/** * dispatch-external-tool-command — the HOST supervisor for the out-of-process * external tool COMMAND dispatch plane (ADR-0054, increments M4-C / M4-D / M4-E). * * For an EXTERNAL-provenance tool command (installed / project-local / * user-global), the host forks the {@link executeToolCommandWorker} entry * instead of importing + running the handler in-process. The worker imports the * untrusted runtime and runs the handler; this supervisor: * * 1. marshals the minimal serializable {@link ToolCommandWorkerSpec} to a temp * file and forks the worker entry via the shared {@link runWorkerSpec} * fork/IPC core, which turns a child throw / `process.exit` / crash / * premature-exit / fork-failure into a structured parent-side rejection, * enforces the wall-clock timeout, serves the worker's host-RPC upcalls * against the REAL host {@link ToolCliContext}, and inherits run correlation * through the child env; * 2. on success, replays the slim {@link ToolCommandResult} through the REAL * host seams (`render` / `emitEnvelope` / `emitJson` / `emitRaw` / * `emitError` / `setExitCode`) so the output contract stays byte-identical * to the in-process path. * * Bundled first-party tools never reach here — they stay in-process (the trusted * computing base). External tools have NO in-process fallback by trust tier * (ADR-0054): a fork failure is a hard, structured error, not a silent in-host * run. */ import type { DispatchExternalToolCommandArgs } from './dispatch-external-tool-command-types.js'; /** * Fork the worker, await its slim {@link ToolCommandResult}, and replay it * through the host seams. A worker fault (throw / `process.exit` / crash / * timeout / fork failure) becomes a structured {@link ToolError} — the host never * crashes. * * @throws {SystemError} when the external command's provenance is `'bundled'` * (a misuse — bundled tools run in-process), or when the worker fails. */ export declare function dispatchExternalToolCommand(args: DispatchExternalToolCommandArgs): Promise; //# sourceMappingURL=dispatch-external-tool-command.d.ts.map