import type { Tool, ToolCall, ToolResult } from '../types';
import type { HookPipeline } from '../extensibility/hookPipeline';
import { type LearningRecorder } from '../learning/engine';
import type { RuntimeTracer } from '../core/tracing';
import type { ReadBeforeWriteGate } from './readBeforeWriteGate';
export interface DispatchResult {
    call: ToolCall;
    result: ToolResult;
}
export interface DispatchOptions {
    hooks?: HookPipeline;
    trackUsage?: boolean;
    tracer?: RuntimeTracer;
    /** Per-session, project-scoped learning recorder. When provided and
     * `trackUsage` is true, tool calls are recorded against this recorder
     * instead of the legacy process-wide default. Required to avoid the
     * cross-session race on the module-level default. */
    learningRecorder?: LearningRecorder;
    /**
     * When set, the gate is consulted before every write tool call.
     * Read tool calls are recorded in the gate's ledger automatically.
     * This enforces the read-before-write discipline.
     */
    readBeforeWriteGate?: ReadBeforeWriteGate;
}
export declare class ToolDispatcher {
    private toolMap;
    constructor(tools: Tool[]);
    /**
     * Resolve `requested` to a canonical tool name. If `requested` is already
     * a registered tool, returns it unchanged. If it matches a known alias
     * AND the alias target is registered, returns the canonical name.
     * Otherwise returns `requested` (caller will surface "unknown tool").
     */
    private resolveName;
    dispatch(calls: ToolCall[], permissionCheck?: (call: ToolCall) => Promise<{
        allowed: boolean;
        reason?: string;
    }>, onResult?: (result: DispatchResult) => void, options?: DispatchOptions): Promise<DispatchResult[]>;
    private executeSingle;
    getToolNames(): string[];
    hasToolWithName(name: string): boolean;
}
//# sourceMappingURL=dispatcher.d.ts.map