import type { Tool, ToolCall, ToolResult } from '../../types/tools.js';
import type { ToolRuntimeContext } from './context.js';
import type { ExecutorConfig, ToolExecutionRecord } from './types.js';
export declare class PhasedToolExecutor {
    private readonly config;
    private readonly records;
    private readonly controllers;
    /** Maps ToolCall instances to their idempotency key without mutating the input. */
    private readonly _idKeyMap;
    constructor(config: ExecutorConfig);
    /**
     * Execute a tool call through all pipeline phases.
     * Returns a ToolResult regardless of outcome — callers never need to catch.
     */
    execute(call: ToolCall, tool: Tool, context: ToolRuntimeContext): Promise<ToolResult>;
    /**
     * Cancel an in-flight tool execution.
     * Sets a cancelled flag on the record; the next phase boundary will pick it up.
     */
    cancel(callId: string, reason?: string): void;
    /** Returns the full execution record for a given call id, if any. */
    getRecord(callId: string): ToolExecutionRecord | undefined;
    /** Returns all execution records for in-flight calls. */
    getActiveRecords(): ToolExecutionRecord[];
    /**
     * Extract the idempotency key previously attached to a call during `execute`.
     * Returns `undefined` if no idempotency store is configured.
     */
    private _getIdKey;
    private _fail;
    private _cancel;
    /**
     * Evicts the oldest completed records when the map exceeds MAX_RECORDS.
     * Only completed records are eligible for eviction.
     */
    private _evictOldestCompleted;
    private _emitBudgetEvent;
    private _emitPhaseEvent;
}
//# sourceMappingURL=phased-executor.d.ts.map