import type { ToolCall, ToolResult } from "../../../types.js"; import type { SessionPlan, TaskEvidence } from "../../../store/plan.js"; import type { ResponderNotification } from "../../../tools/jobs.js"; import type { LooseWorkReceipt, TaskWorkLedger } from "../../task-evidence.js"; import type { SingleToolResult } from "../contracts.js"; import { type ResponderReadWakeIdentity } from "../responder-read-tool.js"; import { type TaskUpdateGateResult } from "../task-update-gate.js"; export interface MetaToolPlanResult { readonly handled: boolean; readonly ok: boolean; readonly reminder?: boolean | undefined; readonly toast?: string | undefined; readonly cleared?: boolean | undefined; readonly modelNote: string; readonly plan?: SessionPlan | undefined; } export interface MetaToolPorts { readonly step: number; readonly wake: ResponderReadWakeIdentity; readonly pendingNotifications: () => readonly ResponderNotification[]; readonly matchesWakeRevision: (notification: ResponderNotification) => boolean; readonly isClaimed: (notificationId: string) => boolean; readonly markRead: (notificationId: string) => boolean; readonly releaseClaim: (notificationId: string) => void; readonly queueResponderLedger: (notification: ResponderNotification) => void; readonly loadPlan: () => Promise; readonly completionGate: (plan: SessionPlan, taskId: string) => TaskUpdateGateResult; readonly handlePlanTool: (call: ToolCall) => Promise; readonly recordAttempt: (call: ToolCall, ok: boolean) => void; readonly showCall: (call: ToolCall) => void; readonly notify: (level: "info" | "warn", message: string) => void; readonly emitToolResult: (result: ToolResult, contextOutput: string) => void; readonly writeToolOutput: (chunk: string) => void; readonly renderPlan: (plan: SessionPlan) => void; readonly adoptProjectRoot: (plan: SessionPlan) => void; readonly setPendingSessionStatePlan: (plan: SessionPlan | null) => void; readonly clearPlanContext: () => void; readonly getLedger: () => TaskWorkLedger | null; readonly setLedger: (ledger: TaskWorkLedger | null) => void; readonly looseWork: () => readonly LooseWorkReceipt[]; readonly persistTaskEvidence: (taskId: string, evidence: TaskEvidence) => Promise; } export type MetaToolOutcome = { readonly kind: "not-meta"; } | { readonly kind: "handled"; readonly result: SingleToolResult; }; export declare const isRunnerMetaTool: (name: string) => boolean; export declare const runMetaTool: (ports: MetaToolPorts, call: ToolCall) => Promise;