chore: merge main and resolve MCP contract conflicts

This commit is contained in:
morluto
2026-07-16 20:42:14 +08:00
104 changed files with 2097 additions and 204 deletions
+7 -3
View File
@@ -4,13 +4,15 @@ import { Client } from "@modelcontextprotocol/client";
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
import { describe, expect, it } from "vitest";
import { CATALOG_IDENTITY } from "../src/catalogIdentity.js";
const mainPath = fileURLToPath(new URL("../dist/main.js", import.meta.url));
const fixturePath = fileURLToPath(
new URL("./fixtures/fakeLauncher.mjs", import.meta.url),
);
describe("production stdio runtime", () => {
it("starts the built entrypoint, lists 89 tools, calls one, and shuts down", async () => {
it("starts the built entrypoint, lists the catalog, calls one, and shuts down", async () => {
const transport = new StdioClientTransport({
command: process.execPath,
args: [mainPath],
@@ -32,7 +34,7 @@ describe("production stdio runtime", () => {
try {
await client.connect(transport);
const tools = await client.listTools();
expect(tools.tools).toHaveLength(89);
expect(tools.tools).toHaveLength(CATALOG_IDENTITY.counts.mcp_tools);
const result = await client.callTool({
name: "current_document",
arguments: {},
@@ -78,7 +80,9 @@ describe("production stdio runtime", () => {
try {
await client.connect(transport);
expect((await client.listTools()).tools).toHaveLength(89);
expect((await client.listTools()).tools).toHaveLength(
CATALOG_IDENTITY.counts.mcp_tools,
);
} finally {
await client.close();
await transport.close();