Bootstrapping
bootstrap is the only builtin — a ToolFn registered as a programmatic tool before any invocation. It receives config overrides as args and:
- Computes initial config values:
cwd(from args or by walking up fromprocess.cwd()to find the project root),library(from args orimport.meta.url),workspace(from args or default./workspace). - Stores them on
ctx.globals.configalong with initialpaths: [cwd, { external: library }, { ignore: "dist" }, { ignore: "node_modules" }, { ignore: ".git" }, { ignore: ".cache" }]. - Finds the main skill by walking up from
cwd. Scans all skill files in each directory for one withrole: mainormetadata.main: true. - If found: reads its raw frontmatter, stores the name on
globals.config.mainTool, clears the authority cache, and seeds auth/email config onglobals.internals. - Calls
ctx.manager.next().
bootstrap does NOT discover tools, scan directories, inject implicit inherit values, resolve the cascade, interpolate strings, or initialize MCP servers. All of that happens per-invocation: the orchestrator resolves metadata through the cascade and builds the middleware chain, and config middleware populates ctx.locals.config.
Everything except bootstrap is a real tool on disk. The boundary is absolute.