import type { Tool, ToolContext, ToolContentBlock, ToolResultOutcome } from './tool-types.js'; import type { ToolHookRegistry } from './tool-hooks.js'; import type { MiniAgentEvent } from '../subagent/agent-events.js'; /** * Tools often encode failure in the returned string (`Error: …`, * `Command failed (exit 1)`, `exit_code: 1`) without throwing. Without this * check, is_error stays false and completion gates / tool-loop failure * counters never see the failure. * * Important: do NOT use multiline `^Error:` over the whole body — successful * test/log output often contains lines like `Error: expected …` and would * be false-positive failures. */ export declare function isStringToolFailureResult(text: string | undefined): boolean; export interface ExecuteToolCallDeps { toolsForRun: Tool[]; toolCtx: ToolContext; sessionKey: string; toolHooks?: ToolHookRegistry; abortSignal: AbortSignal; toolTimeoutMs: number; enableHeartbeat: boolean; heartbeatIntervalMs: number; skipHeartbeatToolNames: ReadonlySet; toolAbortSignalFor?: (toolCallId: string) => AbortSignal | undefined; enrichToolContext?: (baseCtx: ToolContext, sessionKey: string) => ToolContext; checkToolApproval?: (call: { id: string; name: string; input: unknown; abortSignal: AbortSignal; }) => Promise<{ approved: boolean; decision: string; reason?: string; } | null>; push: (event: MiniAgentEvent) => void; onBeforeStartEmit?: (mutatedInput: Record) => void; maxMissedHeartbeats?: number; } export type ExecuteToolCallOutcome = { kind: 'completed'; text: string; isError: boolean; durationMs: number; outcome?: ToolResultOutcome; aborted?: { by: 'user' | 'timeout'; }; structuredContent?: ToolContentBlock[]; } | { kind: 'unknown-tool'; text: string; } | { kind: 'pre-blocked'; text: string; } | { kind: 'hook-blocked'; text: string; } | { kind: 'denied'; text: string; }; export declare function executeOneToolCall(call: { id: string; name: string; input: Record; }, deps: ExecuteToolCallDeps): Promise; export declare function outcomeToResult(outcome: ExecuteToolCallOutcome): { text: string; isError: boolean; structuredContent?: ToolContentBlock[]; }; //# sourceMappingURL=execute-tool-call.d.ts.map