From 7b8fb4c6e172838dbbd3b099d004c5f396561183 Mon Sep 17 00:00:00 2001 From: Kamil Jopek Date: Tue, 5 May 2026 14:21:42 -0500 Subject: [PATCH] fix(toolcraft): bundle process-runner and ship transitive npm deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit toolcraft@0.0.12 crashed at module load because bundled @poe-code/task-list imported the private @poe-code/process-runner workspace package, which was neither in toolcraft's bundle nor on the public registry. Extending the cli smoke to import every entry point also surfaced jose, jsonc-parser, mustache, and smol-toml — transitive deps of bundled mcp-oauth and config-mutations that npm does not auto-install for bundled packages. - bundle @poe-code/process-runner alongside the other private workspace deps - declare jose, jsonc-parser, mustache, smol-toml as runtime deps so npm resolves them when consumers install toolcraft - exercise toolcraft/cli, /mcp, /mcp-proxy, /sdk in the standalone smoke - run smoke:toolcraft-standalone in the toolcraft release workflow before publishing so this regression cannot ship again Closes #282 --- .github/workflows/release-toolcraft.yml | 2 ++ packages/toolcraft/package.json | 10 ++++++++-- scripts/verify-toolcraft-standalone.mjs | 9 ++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-toolcraft.yml b/.github/workflows/release-toolcraft.yml index ca1ae73eee..8486146436 100644 --- a/.github/workflows/release-toolcraft.yml +++ b/.github/workflows/release-toolcraft.yml @@ -49,6 +49,8 @@ jobs: cd ../toolcraft-openapi && npm pkg set "dependencies.toolcraft=^${NEXT}" - name: Build toolcraft packages and dependencies run: npx turbo build --filter=toolcraft-openapi... + - name: Verify standalone install resolves all bundled imports + run: npm run smoke:toolcraft-standalone - name: Publish toolcraft-schema working-directory: packages/toolcraft-schema run: npm publish --provenance --access public diff --git a/packages/toolcraft/package.json b/packages/toolcraft/package.json index 9d37118afa..994cb0b107 100644 --- a/packages/toolcraft/package.json +++ b/packages/toolcraft/package.json @@ -35,8 +35,8 @@ "test": "cd ../.. && vitest run packages/toolcraft/src", "test:unit": "cd ../.. && vitest run packages/toolcraft/src", "lint": "cd ../.. && eslint packages/toolcraft/src --ext ts && tsc -p packages/toolcraft/tsconfig.json --noEmit", - "prepack": "node ../../scripts/manage-bundled-workspace-deps.mjs prepare . @poe-code/design-system @poe-code/agent-mcp-config @poe-code/agent-human-in-loop @poe-code/task-list @poe-code/file-lock @poe-code/agent-defs @poe-code/config-mutations tiny-mcp-client mcp-oauth auth-store", - "postpack": "node ../../scripts/manage-bundled-workspace-deps.mjs cleanup . @poe-code/design-system @poe-code/agent-mcp-config @poe-code/agent-human-in-loop @poe-code/task-list @poe-code/file-lock @poe-code/agent-defs @poe-code/config-mutations tiny-mcp-client mcp-oauth auth-store" + "prepack": "node ../../scripts/manage-bundled-workspace-deps.mjs prepare . @poe-code/design-system @poe-code/agent-mcp-config @poe-code/agent-human-in-loop @poe-code/task-list @poe-code/file-lock @poe-code/agent-defs @poe-code/config-mutations @poe-code/process-runner tiny-mcp-client mcp-oauth auth-store", + "postpack": "node ../../scripts/manage-bundled-workspace-deps.mjs cleanup . @poe-code/design-system @poe-code/agent-mcp-config @poe-code/agent-human-in-loop @poe-code/task-list @poe-code/file-lock @poe-code/agent-defs @poe-code/config-mutations @poe-code/process-runner tiny-mcp-client mcp-oauth auth-store" }, "dependencies": { "@clack/core": "^1.0.0", @@ -45,6 +45,10 @@ "chalk": "^5.6.2", "commander": "^14.0.3", "console-table-printer": "^2.15.0", + "jose": "^6.1.2", + "jsonc-parser": "^3.3.1", + "mustache": "^4.2.0", + "smol-toml": "^1.3.0", "tiny-stdio-mcp-server": "^0.1.0", "yaml": "^2.8.2" }, @@ -67,6 +71,7 @@ "@poe-code/file-lock", "@poe-code/agent-defs", "@poe-code/config-mutations", + "@poe-code/process-runner", "tiny-mcp-client", "mcp-oauth", "auth-store" @@ -79,6 +84,7 @@ "@poe-code/file-lock": "*", "@poe-code/agent-defs": "*", "@poe-code/config-mutations": "*", + "@poe-code/process-runner": "*", "tiny-mcp-client": "*", "mcp-oauth": "*", "auth-store": "*" diff --git a/scripts/verify-toolcraft-standalone.mjs b/scripts/verify-toolcraft-standalone.mjs index 9c0b81d707..6a8388c03a 100644 --- a/scripts/verify-toolcraft-standalone.mjs +++ b/scripts/verify-toolcraft-standalone.mjs @@ -105,7 +105,14 @@ function runConsumerSmoke(projectDir, tarballs) { [ "--input-type=module", "--eval", - ['await import("toolcraft");', 'await import("toolcraft/human-in-loop");'].join("\n") + [ + 'await import("toolcraft");', + 'await import("toolcraft/cli");', + 'await import("toolcraft/mcp");', + 'await import("toolcraft/mcp-proxy");', + 'await import("toolcraft/sdk");', + 'await import("toolcraft/human-in-loop");' + ].join("\n") ], { cwd: projectDir, stdio: "inherit" } );