import assert from "node:assert/strict"; import test from "node:test"; import { readFile } from "node:fs/promises"; import { TOOL_DEFINITIONS } from "../src/mcp-server.js"; test("README commands match package scripts and the executable MCP schemas", async () => { const [readme, packageText] = await Promise.all([ readFile(new URL("../../README.md", import.meta.url), "utf8"), readFile(new URL("../../package.json", import.meta.url), "utf8"), ]); const packageJson = JSON.parse(packageText) as { bin: Record; files: string[]; scripts: Record; }; for (const script of ["typecheck", "build", "test", "start", "smoke", "verify:package"]) { assert.equal(typeof packageJson.scripts[script], "string"); assert.equal( readme.includes(`npm run ${script}`) || (script === "start" && readme.includes("npm start")) || (script === "test" && readme.includes("npm test")), true, ); } assert.equal(packageJson.bin["codex-chief-of-staff"], "dist/src/index.js"); assert.deepEqual(packageJson.files, ["dist/src", "README.md"]); for (const tool of TOOL_DEFINITIONS) { assert.equal(readme.includes(`\`${tool.name}(`), true, `README is missing ${tool.name}`); } assert.match(readme, /codex mcp add codex-chief-of-staff/); assert.match(readme, /codex mcp remove codex-chief-of-staff/); assert.match(readme, /npm install --global/); assert.match(readme, /command -v codex-chief-of-staff/); assert.match(readme, /-- codex-chief-of-staff/); });