export interface HistorySummary { id: string; writerGeneration?: string | undefined; revision?: number | undefined; name?: string | undefined; createdAt: string; updatedAt: string; cwd: string; messageCount: number; itemCount: number; hasImages: boolean; workspaceFolder?: string | undefined; workspaceCode?: string | undefined; } export interface HistoryIndexEntry { id: string; offset: number; length: number; summary: HistorySummary; } interface HistoryRecordShape { id: string; writerGeneration?: string | undefined; revision?: number | undefined; name?: string | undefined; createdAt: string; updatedAt: string; cwd: string; messages?: Array<{ images?: unknown[] | undefined; }> | undefined; transcript?: unknown[] | undefined; workspaceFolder?: string | undefined; workspaceCode?: string | undefined; } export declare function historySummary(record: HistoryRecordShape): HistorySummary; export interface HistoryAppendResult { entries: HistoryIndexEntry[]; fileSize: number; liveBytes: number; } export declare function historyIndexLiveBytes(entries: readonly HistoryIndexEntry[]): number; /** * Append one record and refresh the (small) index instead of rewriting every * session. Older lines for the same id stay on disk until compaction; the * index keeps only the newest offset per id, matching rebuild semantics. */ export declare function appendIndexedHistoryRecord(jsonlPath: string, indexPath: string, entries: readonly HistoryIndexEntry[], record: T): Promise; export declare function writeIndexedJsonl(jsonlPath: string, indexPath: string, records: readonly HistoryRecordShape[]): Promise; export declare function readValidatedHistoryIndex(jsonlPath: string, indexPath: string): Promise; export declare function readIndexedHistoryRecord(jsonlPath: string, entry: HistoryIndexEntry): Promise; export interface HistoryIndexScanResult { malformed: boolean; } export interface HistoryIndexRebuildResult { entries: HistoryIndexEntry[]; malformed: boolean; } export declare function scanHistoryJsonl(jsonlPath: string, visit: (record: T, offset: number, length: number) => void): Promise; export declare function rebuildHistoryIndexWithStatus(jsonlPath: string, indexPath: string): Promise; export declare function rebuildHistoryIndex(jsonlPath: string, indexPath: string): Promise; export declare function findHistoryRecordStreaming(jsonlPath: string, id: string): Promise; export {};