import type { ToolCall, ToolResult } from "../../../types.js"; import type { SessionPlan } from "../../../store/plan.js"; import type { SingleToolResult } from "../contracts.js"; export interface ToolGateStagePorts { readonly isPlanMode: boolean; readonly planApproved: () => boolean; readonly scratchDir: string; readonly mcpSafe: (call: ToolCall) => boolean; readonly loadPlan: () => Promise; readonly notify: (level: "info" | "warn", message: string) => void; readonly showCall: (call: ToolCall) => void; readonly emitToolResult: (result: ToolResult, contextOutput: string) => void; readonly writeToolOutput: (chunk: string) => void; } export type ToolGateDecision = { readonly kind: "proceed"; } | { readonly kind: "stop"; readonly result: SingleToolResult; }; export declare const runToolGates: (ports: ToolGateStagePorts, call: ToolCall, level: "safe" | "confirm" | "block", livePlan: SessionPlan | undefined) => Promise;