import type { Session, ToolCallRecord } from '../types/index.js'; import type { ToolExecutor, ExecutableTool } from './ToolExecutor.js'; import type { ToolEnforcer } from '../guards/ToolEnforcer.js'; import type { HookRunner } from '../hooks/HookRunner.js'; import type { MemoryService } from '../memory/MemoryService.js'; export interface DefaultToolExecutorConfig { enforcer: ToolEnforcer; hookRunner: HookRunner; memoryService?: MemoryService; /** Default timeout in milliseconds for tool execution. Defaults to 30000 (30s). */ defaultToolTimeoutMs?: number; } /** * Error thrown when a tool execution exceeds the configured timeout. */ export declare class ToolTimeoutError extends Error { readonly toolName: string; readonly timeoutMs: number; constructor(toolName: string, timeoutMs: number); } /** * Default tool executor extracted from Runtime.wrapToolsWithEnforcement(). * * Handles: * - Enforcement checks via ToolEnforcer * - Idempotency key generation * - Context enrichment (experimental_context) * - Error propagation via HookRunner */ export declare class DefaultToolExecutor implements ToolExecutor { private enforcer; private hookRunner; private memoryService?; private defaultToolTimeoutMs?; constructor(config: DefaultToolExecutorConfig); execute(args: { session: Session; userId?: string; agentId: string; toolName: string; tool: ExecutableTool; input: unknown; toolCallId?: string; abortSignal?: AbortSignal; step?: number; turn?: number; toolCallHistory?: ToolCallRecord[]; }): Promise; buildIdempotencyKey(args: { sessionId: string; agentId: string; step: number; toolName: string; toolCallId: string; }): string; private withToolExecutionMetadata; }