/** * bind-external-dispatch — per-tool wiring of the ADR-0054 out-of-process * dispatch hook (`RunActionHooks.maybeDispatchExternal`). * * `mountOneTool` calls {@link buildMaybeDispatchExternal} to bind a dispatch * hook to one tool. At dispatch time the hook resolves the tool's provenance * from `currentScope().toolProvenance` (recorded by the bootstrap, paired with * the tool registry by stable id): * * - BUNDLED provenance (or no provenance recorded) → returns `false`; the * command action runs the handler in-process, byte-identical to before. * Bundled tools are the trusted computing base (ADR-0054 trust tiers). * - EXTERNAL provenance (installed / project-local / user-global) → forks the * worker via {@link dispatchExternalToolCommand}, which imports the untrusted * runtime in the worker, runs the handler, and replays the slim result * through the host seams; returns `true` so the action skips the in-process * path. * * ADR-0054 M4-E trust-tier flip: external tools fork the worker **by default**. * The former `OPENSIP_CLI_EXTERNAL_WORKER` opt-in gate is retired (M4-C landed * the full host-RPC seam surface, closing the parity gap that blocked the flip). * `OPENSIP_CLI_NO_WORKER` is now BUNDLED-ONLY — it never lets an external tool * run in-host (an external tool that cannot fork is a hard error, raised by the * supervisor, not a silent in-process fallback). * * Resolving provenance from the scope (not threading it through the mount chain) * keeps this additive: the mount signature is unchanged and host commands — whose * lean context has no run plane — never carry the hook. */ import { type Tool, type ToolCliContext } from '@opensip-cli/core'; import type { RunActionHooks } from './run-plane.js'; /** * Build the `maybeDispatchExternal` hook bound to one tool + its host context. * The returned hook is merged onto the bound `ToolCliContext` by `mountOneTool`. */ export declare function buildMaybeDispatchExternal(tool: Tool, ctx: ToolCliContext, hooks: RunActionHooks): (commandName: string, opts: Record, positionals: readonly unknown[]) => Promise; //# sourceMappingURL=bind-external-dispatch.d.ts.map