import type { ChatMessage } from './types.js';
export type LentaRowPreview = {
    source: string;
    role: string;
    flat: number | null;
    domSeq: number | null;
    id: string;
    len: number;
    head: string;
};
export type LentaInvariantIssue = {
    type: string;
    detail?: string;
    dom?: LentaRowPreview;
    bridge?: LentaRowPreview;
    skipped?: string[];
    index?: number;
};
export declare function formatLentaIssue(issue: LentaInvariantIssue): string;
export declare function normPreviewText(t: string | undefined): string;
export declare function previewRow(m: ChatMessage, source: string): LentaRowPreview;
/** `messages` must equal `[...historyMessages, ...liveMessages]` (socket/HTTP payload). */
export declare function checkPayloadCompose(messages: ChatMessage[], historyMessages: ChatMessage[], liveMessages: ChatMessage[]): LentaInvariantIssue[];
/** In-memory store: `messages` = composeDisplayLenta(jsonl, overlay). */
export declare function checkStoreCompose(jsonlHistory: ChatMessage[], domOverlay: ChatMessage[], messages: ChatMessage[]): LentaInvariantIssue[];
export declare function checkMonotonicOrder(messages: ChatMessage[], label: string): LentaInvariantIssue[];
/** DOM overlay must not repeat a turn already in JSONL archive. */
export declare function checkOverlayDuplicatesArchive(jsonlHistory: ChatMessage[], domOverlay: ChatMessage[]): LentaInvariantIssue[];
export declare function checkOverlayAfterArchive(jsonlHistory: ChatMessage[], domOverlay: ChatMessage[]): LentaInvariantIssue[];
/** When not synced with Cursor, DOM overlay for subscribed chat should stay empty. */
export declare function checkSyncGate(synced: boolean, domOverlay: ChatMessage[], domRawCount: number): LentaInvariantIssue[];
export declare function rowSimilar(a: LentaRowPreview, b: LentaRowPreview): boolean;
export declare function domViewportRowCoveredByLenta(dom: LentaRowPreview, lenta: LentaRowPreview): boolean;
/** Viewport bubble already represented somewhere in composed lenta (JSONL + overlay). */
export declare function lentaContainsDomViewportRow(dom: LentaRowPreview, lentaRows: LentaRowPreview[]): boolean;
/** DOM viewport vs full lenta — match each viewport row to lenta from the end (avoids duplicate-text false gaps). */
export declare function compareDomTailToLenta(domRows: LentaRowPreview[], lentaRows: LentaRowPreview[], tail: number, opts?: {
    hasDomOverlay?: boolean;
    hasJsonlArchive?: boolean;
    agentWorking?: boolean;
    agentGenerating?: boolean;
}): {
    issues: LentaInvariantIssue[];
    domTail: LentaRowPreview[];
    lentaTail: LentaRowPreview[];
};
export declare function checkApiMatchesStore(apiMessages: ChatMessage[], storeMessages: ChatMessage[]): LentaInvariantIssue[];
