/**
 * Auto-generates a terminal tab title from session context after a threshold
 * number of tool calls. Uses a lightweight single-shot LLM call to produce a
 * concise ≤30 character title, then sets it via the terminal's OSC 0 escape.
 *
 * Fires at most once per session. Failures are swallowed silently.
 */
import type { Api, Model } from "@dreb/ai";
import type { ModelRegistry } from "../../core/model-registry.js";
import type { TabTitleSettings } from "../../core/settings-manager.js";
export interface TabTitleDeps {
    /** Set the terminal tab title (OSC 0). */
    setTitle: (title: string) => void;
    /** Persist the generated title as the session name. Called with the raw title (without "dreb - " prefix). */
    setSessionName?: (name: string) => void;
    /** Get the current session messages (for context). */
    getMessages: () => Array<{
        role: string;
        content?: unknown;
    }>;
    /** Get the current model (parent session model — used as fallback). */
    getModel: () => Model<Api> | undefined;
    /** Get model registry for API key resolution. */
    getModelRegistry: () => ModelRegistry;
    /** Get the parent provider name. */
    getProvider: () => string | undefined;
    /**
     * Get the user's agentModels settings override for a given agent name, if any.
     * Returns a non-empty fallback list when the user has configured an override.
     */
    getAgentModelsOverride?: (agentName: string) => string[] | undefined;
    /** Current git branch name, or null/undefined if unavailable. */
    getBranch?: () => string | null | undefined;
    /** Repository name (e.g., dirname of cwd), or undefined. */
    getRepo?: () => string | undefined;
    /** Current working directory, or undefined. */
    getCwd?: () => string | undefined;
}
export declare class TabTitleGenerator {
    private readonly settings;
    private readonly deps;
    private toolCallCount;
    private fired;
    private readonly threshold;
    private readonly contextBuffer;
    constructor(settings: TabTitleSettings | undefined, deps: TabTitleDeps);
    /** Whether this generator is enabled. */
    get enabled(): boolean;
    /**
     * Called on each tool_execution_end event. Captures context from the event,
     * increments the counter, and fires title generation when threshold is reached.
     */
    onToolEnd(event?: {
        toolName?: string;
        isError?: boolean;
        result?: unknown;
    }): void;
    /** Called on message_end events — captures labeled context. */
    onMessageEnd(message: {
        role: string;
        content?: unknown;
    }): void;
    /** Exposed for testing — the current tool call count. */
    get currentCount(): number;
    /** Exposed for testing — whether the title has been generated. */
    get hasFired(): boolean;
    private generateTitle;
    private resolveModel;
    private getExploreAgentModels;
    private buildContext;
    /** Clean up LLM response to a usable tab title. */
    private sanitizeTitle;
}
//# sourceMappingURL=tab-title.d.ts.map