import type { ToolCall } from "../../../types.js"; import type { SessionPlan } from "../../../store/plan.js"; import { type TaskWorkLedger } from "../../task-evidence.js"; export interface ToolDispatchDelegation { id: string; taskId?: string; } export interface ToolDispatchPorts { readonly mutatePlan: (mutator: (draft: SessionPlan) => boolean) => Promise<{ ok: boolean; plan?: SessionPlan | undefined; } | undefined>; readonly renderPlan: (plan: SessionPlan) => void; readonly setPendingSessionStatePlan: (plan: SessionPlan) => void; readonly notify: (level: "info" | "warn", message: string) => void; readonly getLedger: () => TaskWorkLedger | null; readonly setLedger: (ledger: TaskWorkLedger | null) => void; } export type ToolDispatchOutcome = { readonly kind: "dispatch"; readonly dispatchedTaskId: string | undefined; readonly delegation: ToolDispatchDelegation | undefined; } | { readonly kind: "reject"; readonly reason: string; }; export declare const resolveToolDispatch: (ports: ToolDispatchPorts, call: ToolCall, plan: SessionPlan | undefined) => Promise;