diff --git a/package.json b/package.json index 949928fb7..90b1f5a05 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "build:pi-coding-agent": "npm run build -w @gsd/pi-coding-agent", "build:native-pkg": "npm run build -w @gsd/native", "build:pi": "npm run build:native-pkg && npm run build:pi-tui && npm run build:pi-ai && npm run build:pi-agent-core && npm run build:pi-coding-agent", - "build": "npm run build:pi && tsc && npm run copy-resources && npm run copy-themes && npm run copy-export-html && node scripts/build-web-if-stale.cjs", + "build:mcp-server": "npm run build -w @gsd-build/mcp-server", + "build": "npm run build:pi && npm run build:mcp-server && tsc && npm run copy-resources && npm run copy-themes && npm run copy-export-html && node scripts/build-web-if-stale.cjs", "stage:web-host": "node scripts/stage-web-standalone.cjs", "build:web-host": "npm --prefix web run build && npm run stage:web-host", "copy-resources": "node scripts/copy-resources.cjs", diff --git a/packages/mcp-server/tsconfig.json b/packages/mcp-server/tsconfig.json index 779b48aca..1e62e4af6 100644 --- a/packages/mcp-server/tsconfig.json +++ b/packages/mcp-server/tsconfig.json @@ -20,5 +20,5 @@ "rootDir": "./src" }, "include": ["src/**/*.ts"], - "exclude": ["node_modules", "dist", "**/*.d.ts", "src/**/*.d.ts"] + "exclude": ["node_modules", "dist", "**/*.d.ts", "src/**/*.d.ts", "src/**/*.test.ts"] } diff --git a/scripts/ensure-workspace-builds.cjs b/scripts/ensure-workspace-builds.cjs index 10a6638e4..daecd8689 100644 --- a/scripts/ensure-workspace-builds.cjs +++ b/scripts/ensure-workspace-builds.cjs @@ -97,6 +97,7 @@ if (require.main === module) { 'pi-ai', 'pi-agent-core', 'pi-coding-agent', + 'mcp-server', ] const stale = detectStalePackages(root, WORKSPACE_PACKAGES) diff --git a/scripts/validate-pack.js b/scripts/validate-pack.js index 3ecd195ca..a29cd1f76 100644 --- a/scripts/validate-pack.js +++ b/scripts/validate-pack.js @@ -65,6 +65,7 @@ try { const requiredFiles = [ 'dist/loader.js', 'packages/pi-coding-agent/dist/index.js', + 'packages/mcp-server/dist/cli.js', 'scripts/link-workspace-packages.cjs', 'dist/web/standalone/server.js', ]; @@ -133,6 +134,12 @@ try { // --- Run the binary to confirm end-to-end resolution --- console.log('==> Running installed binary (gsd -v)...'); const loaderPath = join(installedRoot, 'dist', 'loader.js'); + const bundledWorkflowMcpCliPath = join(installedRoot, 'packages', 'mcp-server', 'dist', 'cli.js'); + if (!existsSync(bundledWorkflowMcpCliPath)) { + console.log('ERROR: Bundled workflow MCP CLI missing after install.'); + console.log(` Expected: ${bundledWorkflowMcpCliPath}`); + process.exit(1); + } try { const versionOutput = execSync(`node "${loaderPath}" -v`, { cwd: installDir,