/** * codemode for the first-party subagent platform. * * One tool, `codemode`: the model writes TypeScript that orchestrates * subagents compositionally (Promise.all fan-out, pipelines, map/reduce), * and the tool compiles + runs it in-process via bundle-require, returning * the module's default export as the result. * * The snippet executes IN the host process with full Node access — * process/require/fs are all reachable. Its codemode API is three injected * bindings: * * spawn(options: SpawnOptions): Promise — shared-runtime * spawn (namespace 'codemode'); never rejects, check result.ok. * runWorkflow(spec: WorkflowSpec, opts?): Promise — * declarative multi-stage DAGs over spawn (needs/foreach/gates/retries, * sharesTree tree-diff handoff, control artifacts); never rejects. * log(...args): void — captured into the tool result's details. * * Safety posture: this executes model-written code with the host process's * full privileges. That is the accepted model (your model, your session) — * the same trust boundary as pi-codemode and any bash tool call. */ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent'; export default function codemode(pi: ExtensionAPI): void;