From a2b0ee0dabed8316a9536f5608ae9c5a94327c2c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 14 Sep 2026 12:15:17 +0000 Subject: [PATCH] fix(test): accept Windows node.exe MCP launch in m87 ZCode install Windows CI writes node.exe + npx-cli.js (same as Codex). The new ZCode test required command === "npx", which only holds on POSIX. --- CHANGELOG.md | 2 +- tests/m87-zcode-host.test.ts | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01f0342..8e8d31b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project are documented in this file. ### Added -- **ZCode 宿主支持**:新增 `zcode` HostAdapter(capabilities: `mcp-stdio` + `skills` + `rules`)。`graphflow install` 现在会检测 `~/.zcode` 并完成三件事:(1) 向 `~/.zcode/cli/config.json` 的 **`mcp.servers`**(ZCode 嵌套结构,新增 `configFormat: "zcode"`)注入 `graphflow` stdio MCP 服务器;(2) 将 `skills/graphflow/SKILL.md` 复制到 `~/.zcode/skills/graphflow/`;(3) 向 `~/.zcode/AGENTS.md` 写入受管指令块(append-with-markers,不动用户内容)。工作区级 `.zcode/config.json` 目标同步支持,`doctor` / `uninstall` 均已覆盖(注入/检测/移除均为幂等操作;卸载时清理 `mcp.servers` 条目但保留其它服务器与顶层键)。新增测试 `tests/m87-zcode-host.test.ts`(3 条:注册表形状 / 安装+状态+幂等 / 预存配置保留)。 +- **ZCode 宿主支持**:新增 `zcode` HostAdapter(capabilities: `mcp-stdio` + `skills` + `rules`)。`graphflow install` 现在会检测 `~/.zcode` 并完成三件事:(1) 向 `~/.zcode/cli/config.json` 的 **`mcp.servers`**(ZCode 嵌套结构,新增 `configFormat: "zcode"`)注入 `graphflow` stdio MCP 服务器;(2) 将 `skills/graphflow/SKILL.md` 复制到 `~/.zcode/skills/graphflow/`;(3) 向 `~/.zcode/AGENTS.md` 写入受管指令块(append-with-markers,不动用户内容)。工作区级 `.zcode/config.json` 目标同步支持,`doctor` / `uninstall` 均已覆盖(注入/检测/移除均为幂等操作;卸载时清理 `mcp.servers` 条目但保留其它服务器与顶层键)。新增测试 `tests/m87-zcode-host.test.ts`(3 条:注册表形状 / 安装+状态+幂等 / 预存配置保留)。Windows 上 MCP 命令是 `node.exe` + `npx-cli.js`(与 Codex 相同),m87 不再硬编码 `npx`。 ## [1.18.5] - 2026-09-13 diff --git a/tests/m87-zcode-host.test.ts b/tests/m87-zcode-host.test.ts index a325499..6654457 100644 --- a/tests/m87-zcode-host.test.ts +++ b/tests/m87-zcode-host.test.ts @@ -82,12 +82,20 @@ describe("M87 ZCode host", () => { const config = JSON.parse(readFileSync(configPath, "utf8")) as { mcp?: { servers?: Record }; }; - expect(config.mcp?.servers?.graphflow?.command).toBe("npx"); - expect(config.mcp?.servers?.graphflow?.args).toEqual([ - "-y", - "--package=@roarpeng/graphflow", - "graphflow-mcp", - ]); + const server = config.mcp?.servers?.graphflow; + expect(server?.command).toBeTruthy(); + expect(server?.args).toContain("graphflow-mcp"); + expect(server?.args).toContain("--package=@roarpeng/graphflow"); + if (process.platform === "win32") { + expect(server?.command?.toLowerCase()).toMatch(/node(\.exe)?$/); + } else { + expect(server?.command).toBe("npx"); + expect(server?.args).toEqual([ + "-y", + "--package=@roarpeng/graphflow", + "graphflow-mcp", + ]); + } expect(existsSync(join(home, ".zcode", "skills", "graphflow", "SKILL.md"))).toBe(true); const agents = readFileSync(join(home, ".zcode", "AGENTS.md"), "utf8");