Summary
toolcraft@0.0.109 cannot produce a truly standalone ESM bundle when an application imports toolcraft/sdk or toolcraft/mcp, even when following the documented esbuild standalone recipe.
Those entry points unconditionally reach @poe-code/process-runner/dist/docker/build-context.js, which uses createRequire(import.meta.url)("ignore"). esbuild cannot statically bundle that dynamic require. The packed application therefore starts only while a separate ignore package happens to be resolvable, and fails in a clean consumer with ERR_MODULE_NOT_FOUND / Cannot find module 'ignore'.
Reproduction
- Install
toolcraft@0.0.109 and esbuild@0.28.1.
- Create an entry that imports
createSDK from toolcraft/sdk, or imports the MCP runner from toolcraft/mcp.
- Bundle it using the exact README recipe (
bundle: true, format: "esm", platform: "node", target: "node18", splitting: false).
- Install only the resulting application package in a clean temporary consumer, without Toolcraft or
ignore as runtime dependencies.
- Import the generated SDK bundle or start the MCP bundle.
Observed:
Error: Cannot find module 'ignore'
Require stack:
- .../dist/toolcraft.js
The emitted bundle retains code equivalent to:
const require = createRequire(import.meta.url);
const createIgnore = require("ignore");
The CLI-only path can tree-shake optional integrations, but the SDK and MCP entry points import human-in-loop / approval modules that reach process-runner even when the command tree does not configure those features.
Expected
The supported Toolcraft SDK and MCP entry points should bundle and execute in a clean consumer using Toolcraft's documented standalone esbuild recipe, without downstream packages adding an undeclared ignore runtime dependency, source rewrite, alias, shim, or custom bundler plugin.
Acceptance criteria
- Add a fixture that bundles an app importing
toolcraft/sdk and one importing toolcraft/mcp with the documented esbuild recipe.
- Install each packed fixture in a clean consumer containing no external Toolcraft or
ignore runtime package.
- Import/start both bundles on Node.js 18.18, 20, 22, and 24.
- Ensure unused process-runner/human-in-loop code is tree-shaken, or replace the dynamic require with a bundler-compatible supported implementation.
Summary
toolcraft@0.0.109cannot produce a truly standalone ESM bundle when an application importstoolcraft/sdkortoolcraft/mcp, even when following the documented esbuild standalone recipe.Those entry points unconditionally reach
@poe-code/process-runner/dist/docker/build-context.js, which usescreateRequire(import.meta.url)("ignore"). esbuild cannot statically bundle that dynamic require. The packed application therefore starts only while a separateignorepackage happens to be resolvable, and fails in a clean consumer withERR_MODULE_NOT_FOUND/Cannot find module 'ignore'.Reproduction
toolcraft@0.0.109andesbuild@0.28.1.createSDKfromtoolcraft/sdk, or imports the MCP runner fromtoolcraft/mcp.bundle: true,format: "esm",platform: "node",target: "node18",splitting: false).ignoreas runtime dependencies.Observed:
The emitted bundle retains code equivalent to:
The CLI-only path can tree-shake optional integrations, but the SDK and MCP entry points import human-in-loop / approval modules that reach process-runner even when the command tree does not configure those features.
Expected
The supported Toolcraft SDK and MCP entry points should bundle and execute in a clean consumer using Toolcraft's documented standalone esbuild recipe, without downstream packages adding an undeclared
ignoreruntime dependency, source rewrite, alias, shim, or custom bundler plugin.Acceptance criteria
toolcraft/sdkand one importingtoolcraft/mcpwith the documented esbuild recipe.ignoreruntime package.