import type { LLMMessage } from '../llm/llm-provider.js'; import type { SessionStore, SessionMeta } from './session.js'; export interface JsonlSessionStoreConfig { dir: string; maxSessions?: number; } export declare class JsonlSessionStore implements SessionStore { private readonly dir; private readonly maxSessions; constructor(config: JsonlSessionStoreConfig); private encodedSessionStem; private decodeSessionStem; private sessionPath; private ensureDir; private enqueueWrite; private appendLineDurably; /** * Atomic full-file rewrite: write a temp file in the same directory, fsync, * then rename over the target. `rename` is atomic on POSIX, so a crash leaves * either the previous file or the new one — never a partial truncate. Used by * `replaceMessages` to prune accumulated dead lines (prior `state_replace` * snapshots and superseded `message` lines) instead of appending yet another * full snapshot, which made the session file grow without bound over a long * session: every `replaceMessages` appended the full history while replay * ignored everything before the latest `state_replace`, so dead bytes * accumulated ~ (history size) × (number of replaces). */ private rewriteFileDurably; private deriveTitle; private replayMessagesFromContent; loadMessages(sessionKey: string): Promise; appendMessage(sessionKey: string, message: LLMMessage): Promise; replaceMessages(sessionKey: string, messages: LLMMessage[]): Promise; private fileExists; private pruneOldestSessions; listSessions(): Promise; deleteSession(sessionKey: string): Promise; exists(sessionKey: string): Promise; } //# sourceMappingURL=jsonl-session-store.d.ts.map