/**
 * CliProviderInstance — Runtime instance for CLI Provider
 *
 * Lifecycle layer on top of ProviderCliAdapter.
 * collectCliData() + status transition logic from daemon-status.ts moved here.
 */
import { type ProviderModule } from './contracts.js';
import type { ProviderInstance, ProviderState, InstanceContext, HotChatSessionState, SessionModalState } from './provider-instance.js';
import { ProviderCliAdapter } from '../cli-adapters/provider-cli-adapter.js';
import type { PtyTransportFactory } from '../cli-adapters/pty-transport.js';
type PersistableCliHistoryMessage = {
    role: string;
    content: string;
    kind?: string;
    senderName?: string;
    receivedAt?: number;
};
export declare function buildIncrementalHistoryAppendMessages(previousMessages: PersistableCliHistoryMessage[], currentMessages: PersistableCliHistoryMessage[]): PersistableCliHistoryMessage[];
export declare function getForcedNewSessionScriptName(provider: ProviderModule | undefined, launchMode: 'new' | 'resume' | 'manual'): string | null;
export declare function waitForCliAdapterReady(adapter: {
    isReady?: () => boolean;
    getStatus?: () => {
        status?: string;
    };
}, options?: {
    timeoutMs?: number;
    pollMs?: number;
}): Promise<void>;
export declare class CliProviderInstance implements ProviderInstance {
    private provider;
    private workingDir;
    private cliArgs;
    readonly type: string;
    readonly category: "cli";
    private adapter;
    private context;
    private events;
    private lastStatus;
    private generatingStartedAt;
    private settings;
    private monitor;
    private generatingDebounceTimer;
    private generatingDebouncePending;
    private lastApprovalEventAt;
    private autoApproveBusy;
    private autoApproveBusyTimer;
    private controlValues;
    private summaryMetadata;
    private appliedEffectKeys;
    private historyWriter;
    private runtimeMessages;
    private lastPersistedHistoryMessages;
    private lastNativeSourceCanonicalCheckAt;
    private lastNativeSourceCanonicalCacheKey;
    private cachedSqliteDb;
    private cachedSqliteDbPath;
    private cachedSqliteDbMissingUntil;
    readonly instanceId: string;
    private suppressIdleHistoryReplay;
    private errorMessage;
    private errorReason;
    private presentationMode;
    private providerSessionId?;
    private launchMode;
    private readonly startedAt;
    private onProviderSessionResolved?;
    constructor(provider: ProviderModule, workingDir: string, cliArgs?: string[], instanceId?: string, transportFactory?: PtyTransportFactory, options?: {
        providerSessionId?: string;
        launchMode?: 'new' | 'resume' | 'manual';
        onProviderSessionResolved?: (info: {
            instanceId: string;
            providerType: string;
            providerName: string;
            workspace: string;
            providerSessionId: string;
            previousProviderSessionId?: string;
        }) => void;
    });
    refreshProviderDefinition(provider: ProviderModule): void;
    init(context: InstanceContext): Promise<void>;
    onTick(): Promise<void>;
    /**
     * Generic session ID probe using declarative ProviderSessionProbe config.
     * Replaces the previously duplicated probeOpenCode/Codex/Goose functions.
     */
    private probeSessionIdFromConfig;
    getState(): ProviderState;
    setPresentationMode(mode: 'terminal' | 'chat'): void;
    getPresentationMode(): 'terminal' | 'chat';
    getHotChatSessionState(): HotChatSessionState;
    getSessionModalState(): SessionModalState;
    updateSettings(newSettings: Record<string, any>): void;
    onEvent(event: string, data?: any): void;
    dispose(): void;
    private completedDebounceTimer;
    private completedDebouncePending;
    private enforceFreshSessionLaunchIfNeeded;
    private detectStatusTransition;
    private pushEvent;
    private flushEvents;
    private applyProviderResponse;
    private getEffectDedupKey;
    private getPersistedEffectContent;
    getAdapter(): ProviderCliAdapter;
    get cliType(): string;
    get cliName(): string;
    private shouldAutoApprove;
    private recordAutoApproval;
    recordApprovalSelection(buttonText: string): void;
    private formatMarkerTimestamp;
    private maybeAppendRuntimeRecoveryMessage;
    private appendRuntimeSystemMessage;
    private appendRuntimeMessage;
    private mergeConversationMessages;
    private formatApprovalRequestMessage;
    private promoteProviderSessionId;
    private syncCanonicalSavedHistoryIfNeeded;
    private restorePersistedHistoryFromCurrentSession;
    private getProbeDirectories;
    private buildSqlPlaceholderList;
    private querySqliteText;
}
export {};
