import type { HookEvent, HookResult } from '../hooks/types.js'; import type { ToolCall, ToolResult } from '../types/tools.js'; import type { ToolRegistry } from '../tools/registry.js'; import type { PermissionManager } from '../permissions/manager.js'; import type { RuntimeEventBus } from '../runtime/events/index.js'; import { type ReconciliationReason } from './tool-reconciliation.js'; import type { ConfigManager } from '../config/manager.js'; import type { AgentManager } from '../tools/agent/index.js'; import type { ExecutionPlan, ExecutionPlanManager, PlanItem } from './execution-plan.js'; import type { ProviderRegistry } from '../providers/registry.js'; type HookDispatcherLike = { fire(event: HookEvent): Promise; }; type EmitterContextFactory = (turnId: string) => import('../runtime/emitters/index.js').EmitterContext; export type ToolExecutionDeps = { toolRegistry: ToolRegistry; permissionManager: PermissionManager; hookDispatcher: HookDispatcherLike | null; runtimeBus: RuntimeEventBus | null; sessionId: string; emitterContext: EmitterContextFactory; /** * Stage B: called once per executed tool with (toolName, resolved args, success) so a * code-index reindex scheduler can debounce an incremental reindex of touched files. Invoked * for BOTH success and failure (the scheduler no-ops on failure); never awaited, it must not * block the tool-result path. */ onToolExecuted?: ((toolName: string, args: Record, success: boolean) => void) | undefined; /** * Per-call cancellation seam: `open(callId)` yields the AbortSignal passed to * the tool body (registering the call as cancellable), `close(callId)` * retires it once the call settles. A cancel of ONE call aborts only that * call's signal, other calls in the batch and the turn itself continue. * Optional/undefined preserves the previous uncancellable behavior. */ toolCallSignals?: { open(callId: string): AbortSignal; close(callId: string): void; } | undefined; }; /** The human-readable per-call cancellation message the model sees. */ export declare const TOOL_CALL_CANCELLED_MESSAGE = "cancelled by user"; export declare function executeToolCalls(deps: ToolExecutionDeps, turnId: string, calls: ToolCall[]): Promise; export type ReconciliationDeps = { conversation: { addToolResults: (results: ToolResult[]) => void; addSystemMessage: (message: string) => void; }; runtimeBus: RuntimeEventBus | null; emitterContext: EmitterContextFactory; isReconciliationEnabled: () => boolean; currentSubmissionKey: string | null; pendingToolCalls: ToolCall[]; setPendingToolCalls: (calls: ToolCall[]) => void; }; export declare function reconcileUnresolvedToolCalls(deps: ReconciliationDeps, resolvedResults: ToolResult[], reason: ReconciliationReason): void; export declare function autoSpawnPendingItems(conversation: { addSystemMessage: (message: string) => void; }, plan: ExecutionPlan, items: PlanItem[], agentManager: Pick, configManager: Pick, providerRegistry: Pick, runtimeBus?: RuntimeEventBus | null, emitterContext?: import('../runtime/emitters/index.js').EmitterContext | null, planManager?: Pick | null): string[]; export {}; //# sourceMappingURL=orchestrator-tool-runtime.d.ts.map