/**
 * Fire-and-forget tool-call summary emission.
 *
 * Captures tool args on execution_start, generates a one-line summary via
 * a cheap LLM (Haiku) on execution_end, and emits a tool_summary event.
 * Summaries are best-effort UX — never block the agent loop.
 */
import type { ShortcutLlmProxyClient } from '../providers/shortcut-llm-proxy-client.js';
export interface ToolSummaryEvent {
    type: 'tool_summary';
    toolCallId: string;
    summary: string;
}
export interface ToolSummaryDiagnostic {
    toolCallId: string;
    toolName: string;
    status: 'seen' | 'skipped' | 'queued' | 'started' | 'success' | 'empty' | 'failed';
    reason?: string;
}
export interface ToolSummaryEmitterOptions {
    enabled?: boolean;
    isFeatureEnabled?: () => boolean;
    isEligibleTool?: (toolName: string) => boolean;
    maxConcurrent?: number;
    maxPerRun?: number;
    maxOutputTokens?: number;
    getShortcutLlmProxyClient?: () => ShortcutLlmProxyClient | undefined;
    onDiagnostic?: (diagnostic: ToolSummaryDiagnostic) => void;
}
/**
 * Manages the lifecycle of tool-call summary generation.
 *
 * Call {@link reset} on agent_start, {@link captureArgs} on tool_execution_start,
 * {@link maybeGenerate} on tool_execution_end, and {@link abort} on agent_end.
 */
export declare class ToolSummaryEmitter {
    /** Captured tool args keyed by toolCallId. */
    private _argsCapture;
    /** AbortController for in-flight summary calls — aborted on agent_end. */
    private _abort;
    private readonly _enabled;
    private readonly _isFeatureEnabled;
    private readonly _isEligibleTool;
    private readonly _maxConcurrent;
    private readonly _maxPerRun;
    private readonly _maxOutputTokens;
    private readonly _getShortcutLlmProxyClient?;
    private readonly _onDiagnostic?;
    private _scheduledThisRun;
    private _inFlight;
    private _queue;
    constructor(options?: ToolSummaryEmitterOptions);
    /**
     * Reset state at the start of a new agent run.
     */
    reset(): void;
    /**
     * Capture tool arguments when a tool execution starts.
     */
    captureArgs(toolCallId: string, args: unknown): void;
    /**
     * On tool_execution_end, fire-and-forget a summary generation call.
     * Emits a ToolSummaryEvent via the provided callback if successful.
     *
     * This method owns the cheap preflight checks and queue admission. The async
     * worker below owns proxy failures, so the agent event pipeline never awaits
     * or throws on summary generation.
     */
    maybeGenerate(toolCallId: string, toolName: string, result: unknown, emit: (event: ToolSummaryEvent) => void): void;
    /**
     * Abort all in-flight summary calls and clear captured args.
     * Call on agent_end.
     */
    abort(): void;
    private _drainQueue;
    /**
     * Run one summary request and translate all outcomes into diagnostics/events.
     *
     * Empty summaries are diagnostic noise, auth/configuration failures are real
     * failures, and all cases stay best-effort so the main agent loop proceeds.
     */
    private _generateAndEmit;
    private _diagnose;
}
//# sourceMappingURL=tool-summary-emitter.d.ts.map