/**
 * AI-powered screen analyzer — detects interactive TUI prompts in terminal output
 * by sending snapshots to a lightweight LLM and parsing structured responses.
 *
 * Token-saving protocol:
 *   1. Text diff — skip if snapshot unchanged
 *   2. Cumulative stability — require N consecutive unchanged snapshots
 *   3. AI-driven cooldown — AI returns checkAgainWhen to control re-call timing
 *   4. Prompt-active guard — stop calling AI once a prompt is reported, until resolved
 */
export interface ScreenAnalyzerConfig {
    baseUrl: string;
    apiKey: string;
    model: string;
    intervalMs: number;
    stableCount: number;
    snapshotMaxChars: number;
    extraHeaders?: Record<string, string>;
    extraBody?: Record<string, unknown>;
}
export interface TuiPromptOption {
    label: string;
    text: string;
    selected: boolean;
    type: 'select' | 'toggle' | 'confirm' | 'input';
    index: number;
}
export interface ScreenAnalysis {
    needsInteraction: boolean;
    description?: string;
    options?: TuiPromptOption[];
    multiSelect?: boolean;
    toggleKey?: string;
    confirmKey?: string;
    checkAgainWhen: 'content_changed' | 'after_5s' | 'after_10s' | 'not_needed';
}
export interface ScreenAnalyzerCallbacks {
    getSnapshot: () => string;
    onAnalyzing: () => void;
    onTuiPrompt: (description: string, options: TuiPromptOption[], multiSelect: boolean) => void;
    onTuiPromptResolved: (selectedText?: string) => void;
    log: (msg: string) => void;
}
/** Remove survey lines (plus the option row that follows each) from a snapshot.
 *  The survey banner is RESIDENT — it stays on screen for the whole session
 *  until dismissed. Matching the WHOLE snapshot against it used to veto every
 *  analysis, which blinded the analyzer to real prompts sharing the screen
 *  (e.g. AskUserQuestion rendered above a survey banner was never detected).
 *  Stripping the survey's own lines keeps it invisible to the AI without
 *  suppressing anything else. */
export declare function stripOptionalSurveyLines(text: string): string;
export declare class ScreenAnalyzer {
    private config;
    private callbacks;
    private timer;
    private lastSnapshot;
    private stableCount;
    private lastAnalyzedSnapshot;
    private waitingForContentChange;
    private timerCooldownUntil;
    private promptActive;
    private _analyzing;
    private disposed;
    constructor(config: ScreenAnalyzerConfig, callbacks: ScreenAnalyzerCallbacks);
    /** Whether an AI call is currently in flight */
    get isAnalyzing(): boolean;
    start(): void;
    dispose(): void;
    /** Called externally when user has made a selection via card click */
    notifySelection(selectedText: string): void;
    private tick;
    private analyze;
    private callAI;
}
//# sourceMappingURL=screen-analyzer.d.ts.map