import type { SessionEntry } from "../../session-manager-types.ts"; import type { SessionListQuery, SessionRecordHeader, SessionSnapshot, SessionStore, SessionSummary, SessionWriteOptions, StorageDescriptor } from "./types.js"; /** * The default session store, plus the JSONL sessions saved before it existed. * * Sessions from before the SQLite default stay in `/sessions` and are * listed from there, so `/resume` and `--continue` show them without any upfront * work. A legacy session is converted into the database only when it is opened, * following pi's migrate-on-load pattern; afterwards it is read from the database * like any other session. The JSONL files are never modified. Deleting a session * records its ID so a legacy copy of it is not listed again. Listing reads a large legacy * session only from its two ends, so its cost does not grow with the size of the history. */ export declare class LegacySessionStore implements SessionStore { private readonly inner; private readonly legacyDirectory; private readonly databasePath; private legacy?; private index?; private readonly summaries; private deletions?; constructor(inner: SessionStore, options: { readonly legacyDirectory: string; readonly databasePath: string; }); get descriptor(): StorageDescriptor; create(header: SessionRecordHeader, entries: readonly SessionEntry[]): Promise<{ readonly lastSeq: number; }>; append(sessionId: string, entries: readonly SessionEntry[], options: SessionWriteOptions): Promise<{ readonly lastSeq: number; }>; replace(sessionId: string, header: SessionRecordHeader, entries: readonly SessionEntry[], options: SessionWriteOptions): Promise<{ readonly lastSeq: number; }>; load(sessionId: string): Promise; readHeader(sessionId: string): Promise; delete(sessionId: string): Promise; list(query: SessionListQuery): AsyncIterable; findMostRecent(query: { readonly cwd: string; readonly includeInternal?: boolean; }): Promise; close(): Promise; /** Convert one legacy session into the database the first time it is needed. */ private convert; /** The first readable copy of a legacy session; a damaged duplicate does not hide a readable one. */ private readLegacy; private findLegacy; private legacyFiles; /** * Header-only index of the legacy directory, read once; nothing writes legacy sessions any more. * Copies of one session, such as conflict copies left by a sync tool, are ordered newest first. */ private legacyIndex; /** * Listing rows are cached per store until a copy of the session changes on disk. A row is built * from bounded reads, not a full parse, so listing does not cost the size of the history. */ private summarize; private legacyStore; private deletionDatabase; private isDeleted; private markDeleted; } //# sourceMappingURL=legacy-session-store.d.ts.map