import { DEFAULT_MAX_CONCURRENT_SAFE_TOOL_CALLS, resolveMaxConcurrentSafeToolCalls } from '../../config/concurrency.js'; import type { HookRegistry } from '../hooks.js'; import type { AnthropicToolDef } from '../providers/anthropic-direct/types.js'; import type { ToolDispatcher } from '../providers/anthropic-direct/tool-dispatcher.js'; import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js'; import type { SubagentExecutor } from './subagent-executor.js'; import type { SkillExecutor } from './skill-executor.js'; import type { ComposeExecutor } from './compose-executor.js'; import type { ToolHandler, ConcurrencyClassifier } from './types.js'; import type { ToolActivityReporter } from '../providers/shared/tool-activity.js'; import type { SpawnedPidRegistry } from './handlers/pid-registry.js'; import type { ToolPermissionConfig } from './permissions.js'; import type { CanUseTool } from '../types/sdk-types.js'; import { type GrantSnapshot, type GrantManager } from './grant-manager.js'; import type { TraceSink } from '../trace/index.js'; export { defaultConcurrencyClassifier } from './dispatch-batching.js'; export declare const REPEAT_CIRCUIT_BREAKER_THRESHOLD = 8; export { DEFAULT_MAX_CONCURRENT_SAFE_TOOL_CALLS, resolveMaxConcurrentSafeToolCalls }; export interface SessionToolDispatcherOptions { handlers: Map; schemas: AnthropicToolDef[]; hookRegistry: HookRegistry | undefined; permissions?: ToolPermissionConfig; canUseTool?: CanUseTool; subagentExecutor?: SubagentExecutor; skillExecutor?: SkillExecutor; composeExecutor?: ComposeExecutor; concurrencyClassifier?: ConcurrencyClassifier; maxConcurrentSafeCalls?: number; cwd?: string; readRoots?: string[]; writeRoots?: string[]; allowAll?: boolean; env?: Record; sessionId?: string; parentSessionId?: string; subagentId?: string; sessionGrantManager?: GrantManager; traceWriter?: TraceSink; readOnlyBash?: boolean; maxOutputBytes?: number; spawnedPidRegistry?: SpawnedPidRegistry; bashOutputTailReporter?: (toolUseId: string) => (tail: string | undefined) => void; } export declare class SessionToolDispatcher implements ToolDispatcher { private readonly handlers; private readonly schemas; private readonly hookRegistry; private readonly permissions; private readonly canUseTool; private readonly subagentExecutor; private readonly skillExecutor; private readonly composeExecutor; private readonly classifier; private readonly maxConcurrentSafeCalls; private resolveBase; private readonly _readRoots; private readonly _writeRoots; private _allowAll; private readonly _env; private readonly sessionId; private readonly parentSessionId; private readonly subagentId; private readonly sessionGrantManager; private readonly traceWriter; private readonly readOnlyBash; private readonly maxOutputBytes; private readonly spawnedPidRegistry; private readonly bashOutputTailReporter; private readonly gateState; private readonly repeatFailureGuard; private readonly grantManager; constructor(opts: SessionToolDispatcherOptions); private get handlerContext(); private callHandlerContext; addReadRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void; addWriteRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void; revokeRoot(absPath: string, source?: 'slash' | 'tool', sessionId?: string): void; getGrants(): GrantSnapshot; setAllowAll(allow: boolean): void; setResolveBase(newCwd: string): void; get toolDefs(): readonly AnthropicToolDef[]; private gateDeps; private coreExecDeps; private runPreDispatchGates; private resetDenialBreaker; execute(call: ToolCall): Promise; executeBatch(calls: ToolCall[], onActivity?: ToolActivityReporter): Promise; private executeCore; }