import type { MiniAgentEvent } from '../subagent/agent-events.js'; import type { PendingToolAbortStore } from './pending-tool-aborts.js'; import type { Message, ContentBlock } from '../session/session-jsonl.js'; import type { Tool, ToolContext } from '../tools/tool-types.js'; import type { ToolHookRegistry } from '../tools/tool-hooks.js'; import { type ToolLoopGuardState } from '../tools/tool-loop-guard.js'; export interface AgentLoopToolExecutionMetrics { totalToolCalls: number; toolErrors: number; consecutiveToolErrors: number; toolCallsByName: Record; prepNextTurnParallelMs: number; } export interface ExecuteAgentLoopToolCallsParams { sessionKey: string; currentMessages: Message[]; assistantContent: ContentBlock[]; toolCalls: { id: string; name: string; input: Record; }[]; resolveToolsForRun: () => Tool[]; toolCtx: ToolContext; toolHooks?: ToolHookRegistry; abortSignal: AbortSignal; toolTimeoutMs: number; toolHeartbeatIntervalMs: number; skipHeartbeatToolNames: Set; checkToolApproval?: (call: { id: string; name: string; input: unknown; abortSignal: AbortSignal; }) => Promise<{ approved: boolean; decision: string; reason?: string; } | null>; toolAbortSignalFor?: (toolCallId: string) => AbortSignal | undefined; enrichToolContext?: (baseCtx: ToolContext, sessionKey: string) => ToolContext; parallelSafeTools: Set; loadToolsMetaName?: string; toolLoopGuard: ToolLoopGuardState; maxToolCalls?: number; metrics: AgentLoopToolExecutionMetrics; evaluateSteering: () => Message[]; appendMessage: (sessionKey: string, msg: Message) => Promise; push: (event: MiniAgentEvent) => void; pendingToolAborts: PendingToolAbortStore; } export declare function parallelToolCallsWithinBudget(groupSize: number, metrics: Pick, maxToolCalls?: number): boolean; export declare function executeAgentLoopToolCalls(params: ExecuteAgentLoopToolCallsParams): Promise<{ pendingMessages: Message[]; }>; //# sourceMappingURL=agent-loop-tool-execution.d.ts.map