import type { AgentPromptOptions, AiMessage, AnyTool, ToolCall } from './types.js'; /** * When continuing a chat after a stop-on-approval round-trip, the supplied * `messages` array ends with an `assistant` message whose `toolCalls` were * never fulfilled (the loop paused before executing them). Most providers * (Anthropic in particular) reject such conversations because every * `tool_use` block must be followed by a matching `tool_result`. * * This helper detects that case, executes the pending **server** tool calls * (honoring `approvedToolCallIds` / `rejectedToolCallIds`), appends the * resulting tool messages to `messages` in place, and returns them. The * caller can attach the returned list to `AgentResponse.resumedToolMessages` * so that the panels dispatcher persists them in the conversation store. * * Client tools (no `execute`) must come back from the browser with their * tool result already in the conversation, so the trailing assistant message * will not have unmatched `toolCalls` for them — they're handled outside. */ export declare function resumePendingToolCalls(deps: { messages: AiMessage[]; toolMap: Map; options: AgentPromptOptions | undefined; }): Promise<{ resumed: AiMessage[]; approvalStillRequired: { toolCall: ToolCall; isClientTool: boolean; } | undefined; }>; //# sourceMappingURL=resume-approval.d.ts.map