/** Tool-round phase of runInternal (plan 059). */ import type { AgentRunRef, GuardrailRecord, LoopContext, NestedRunRef, PendingDecision, ResumeNestedRun, StickyDecision, ToolCallContent, ToolRegistry, ToolResult, Usage } from "../../contracts.js"; import { AgentDelegationSuspendedError } from "../../contracts.js"; import type { RoundContext, SessionHost } from "./types.js"; export declare function matchNestedSticky(session: SessionHost, decision: PendingDecision): StickyDecision | undefined; export declare function matchStickyDecision(session: SessionHost, call: ToolCallContent, registry: ToolRegistry): StickyDecision | undefined; export declare function buildPendingDecision(session: SessionHost, call: ToolCallContent, approvalId: string, registry: ToolRegistry, runId: string, metadata: Readonly>, signal: AbortSignal, ask?: GuardrailRecord): PendingDecision; export declare function applyNestedRun(session: SessionHost, input: { ref: AgentRunRef; toolCall: ToolCallContent; path: readonly string[]; pending: readonly PendingDecision[]; hook?: ResumeNestedRun; }): Promise<{ toolResult: ToolResult; } | { entry: NestedRunRef; pending: PendingDecision[]; }>; export declare function suspendGatedRound(ctx: RoundContext): Promise; export declare function suspendNested(ctx: RoundContext, nested: { entry: NestedRunRef; toolCall: ToolCallContent; pending: PendingDecision[]; }): Promise; export declare function replayToolResult(ctx: RoundContext, result: ToolResult): Promise; export declare function handleNestedSignal(ctx: RoundContext, error: AgentDelegationSuspendedError): Promise; export declare function bindChargeToolRound(ctx: RoundContext): LoopContext["chargeToolRound"]; export declare function bindDispatchToolCall(ctx: RoundContext): LoopContext["dispatchToolCall"]; export declare function replayDurableNestedAndPending(ctx: RoundContext): Promise; export declare function runLoopUntilSettled(ctx: RoundContext): Promise;