/**
 * Tool Phases
 *
 * Defines phases for tool execution streaming, allowing
 * real-time updates during tool operations.
 */
import { EventEmitter } from 'events';
/**
 * Tool execution phase
 */
export type ToolPhase = 'start' | 'update' | 'result';
/**
 * Tool phase event
 */
export interface ToolPhaseEvent {
    /** Current phase */
    phase: ToolPhase;
    /** Tool call ID */
    toolCallId: string;
    /** Tool name */
    toolName: string;
    /** Progress percentage (0-100), only for 'update' phase */
    progress?: number;
    /** Status message */
    message?: string;
    /** Tool result, only for 'result' phase */
    result?: ToolPhaseResult;
    /** Timestamp */
    timestamp: number;
}
/**
 * Tool phase result
 */
export interface ToolPhaseResult {
    /** Whether the tool execution succeeded */
    success: boolean;
    /** Output from the tool */
    output?: string;
    /** Error message if failed */
    error?: string;
    /** Execution duration in milliseconds */
    duration: number;
    /** Additional metadata */
    metadata?: Record<string, unknown>;
}
/**
 * Tool phase emitter events
 */
export interface ToolPhaseEvents {
    'phase': (event: ToolPhaseEvent) => void;
    'phase:start': (event: ToolPhaseEvent) => void;
    'phase:update': (event: ToolPhaseEvent) => void;
    'phase:result': (event: ToolPhaseEvent) => void;
    'error': (error: Error) => void;
}
/**
 * Emitter for tool phase events
 */
export declare class ToolPhaseEmitter extends EventEmitter {
    private _toolCallId;
    private _toolName;
    private startTime;
    private currentPhase;
    private progress;
    /** Get the tool call ID */
    get toolCallId(): string;
    /** Get the tool name */
    get toolName(): string;
    constructor(toolCallId: string, toolName: string);
    /**
     * Emit start phase
     */
    start(message?: string): void;
    /**
     * Emit update phase with progress
     */
    update(progress: number, message?: string): void;
    /**
     * Emit result phase
     */
    result(result: Omit<ToolPhaseResult, 'duration'>): void;
    /**
     * Emit error
     */
    error(error: Error): void;
    /**
     * Get current phase
     */
    getPhase(): ToolPhase;
    /**
     * Get current progress
     */
    getProgress(): number;
    /**
     * Get elapsed time
     */
    getElapsedTime(): number;
}
/**
 * Manages multiple tool phase emitters
 */
export declare class ToolPhaseManager extends EventEmitter {
    private emitters;
    private phaseListeners;
    /**
     * Create emitter for a tool call
     */
    createEmitter(toolCallId: string, toolName: string): ToolPhaseEmitter;
    /**
     * Get emitter for a tool call
     */
    getEmitter(toolCallId: string): ToolPhaseEmitter | undefined;
    /**
     * Remove emitter for a tool call
     */
    removeEmitter(toolCallId: string): boolean;
    /**
     * Add a phase listener
     */
    addPhaseListener(listener: (event: ToolPhaseEvent) => void): void;
    /**
     * Remove a phase listener
     */
    removePhaseListener(listener: (event: ToolPhaseEvent) => void): void;
    /**
     * Notify all listeners
     */
    private notifyListeners;
    /**
     * Get all active tool calls
     */
    getActiveToolCalls(): Array<{
        toolCallId: string;
        toolName: string;
        phase: ToolPhase;
        progress: number;
    }>;
    /**
     * Clear all emitters
     */
    clear(): void;
    /**
     * Dispose
     */
    dispose(): void;
}
/**
 * Get or create the ToolPhaseManager singleton
 */
export declare function getToolPhaseManager(): ToolPhaseManager;
/**
 * Reset the ToolPhaseManager singleton
 */
export declare function resetToolPhaseManager(): void;
