import { type SessionLocator, type SessionPaths } from '../../session/paths.js'; import type { SessionId } from '../../types/ids/index.js'; import type { SessionLogEntry } from './chain.js'; import { type LogMedium, type ReadSessionLogOptions, SessionLogCore, type SessionLogCoreOptions, type SessionLogRead, type SessionLogReadSummary } from './core.js'; /** The bytes of one log file. */ export declare class DiskLogMedium implements LogMedium { readonly file: string; constructor(file: string); size(): Promise; read(offset: number, length: number): Promise; stream(offset: number): AsyncIterable; append(bytes: Uint8Array, expectedOffset: number, sync: boolean): Promise; truncate(size: number, expectedSize: number): Promise; } export interface DiskSessionLogOptions extends Pick { readonly sessionId: SessionId; /** `.jsonl`. */ readonly file: string; /** `/`: the lease files and `tool-results/`. */ readonly sessionDir: string; /** * Where the session sits in its project's layout. {@link DiskSessionLog.at} * sets it; otherwise it is read from `file` (`…//subagents/.jsonl` * names its ancestors), so a log opened from the index's `logPath` sits * where `at` put it. The stores that keep a session's other documents * (`checkpoints/`, …) read it, so a child session's documents land in its * own directory under its ancestors rather than at the top level. */ readonly locator?: SessionLocator; } /** A session log on disk. One instance per writer process; readers may open their own. */ export declare class DiskSessionLog extends SessionLogCore { readonly file: string; readonly sessionDir: string; /** * See {@link DiskSessionLogOptions.locator}. `undefined` only for a log * whose file is not named `.jsonl`. */ readonly locator: SessionLocator | undefined; constructor(options: DiskSessionLogOptions); /** The log of `locator` in a project's layout. */ static at(paths: SessionPaths, locator: SessionLocator, options?: Pick): DiskSessionLog; } /** * Walk a session log file, verifying the chain (spec §4.1). Yields each * record with its pointer and returns the summary. A missing file is an empty * log. */ export declare function streamSessionLog(file: string, options?: ReadSessionLogOptions & { readonly sessionId?: SessionId; }): AsyncGenerator; /** Read a whole session log file: strict by default, or tolerant (stops at the first break). */ export declare function readSessionLog(file: string, options?: ReadSessionLogOptions & { readonly sessionId?: SessionId; }): Promise; //# sourceMappingURL=disk.d.ts.map