export declare const DEFAULT_JSONL_ROTATE_BYTES: number; export interface JsonlRotationOptions { archiveDir?: string; maxBytes?: number; /** * Cap on how many rotated archive segments to retain. After a rotation, the * oldest archives beyond this count are deleted, bounding total disk use at * roughly `(maxArchives + 1) * maxBytes`. Omitted/undefined ⇒ keep all * archives (the historical behavior); `0` ⇒ keep none. */ maxArchives?: number; } export declare class JsonlAppendLog { readonly path: string; private readonly rotation; /** Captured once; never re-derived at write time. See storage/write-root.ts. */ private readonly writeRoot; constructor(path: string, rotation?: JsonlRotationOptions, writeRoot?: string); append(record: T): Promise; appendIf(record: T, shouldAppend: (records: T[]) => boolean): Promise<{ appended: boolean; }>; appendIfRecent(record: T, shouldAppend: (recentRecords: T[]) => boolean, recentLimit: number): Promise<{ appended: boolean; }>; appendManyByKey(records: T[], keyOf: (record: T) => string): Promise<{ appended: number; }>; /** * Read the last `n` records from the log by seeking from the end of the * file. Avoids loading the full file when the log is large (e.g. 276MB). * Falls back to readAll when the estimated read window covers the whole file. */ readTail(n: number): Promise; readNewestMatching(n: number, matches: (record: T) => boolean): Promise; readNewestUntil(shouldStop: (record: T) => boolean): Promise; readAll(): Promise; private readRotatingTail; private readTailFromDisk; private readTailFromPath; private readAllFromDisk; private readAllFromPath; private refreshCache; private rotationEnabled; private rotateIfNeeded; private pruneArchives; private ownArchivePaths; private segmentPaths; private archivePaths; private nextArchivePath; private archiveDir; } //# sourceMappingURL=jsonl-log.d.ts.map