import { type DamagedLine, type SequenceGap } from './event-log.js'; import type { SessionEvent, SessionEventKind } from './types.js'; /** What the on-disk stream is known to have lost or mangled. Never optimistic. */ export interface StreamIntegrity { healthy: boolean; damaged: DamagedLine[]; gaps: SequenceGap[]; quarantined: boolean; quarantineError?: string; /** Appends that failed outright; their events survive in memory only. */ writeFailures: number; lastWriteError?: string; /** Appends that had to close off a dangling partial record first. */ boundaryRepairs: number; rotationFailed: boolean; } /** Bounded, typed event stream shared by CLI frontends and future ACP/Toad facades. */ export declare class SessionEvents { private readonly path; private seq; private readonly events; private readonly listeners; private readonly integrityState; private readonly rotatedPath; constructor(path: string); emit(kind: SessionEventKind, fields?: Omit): SessionEvent; since(seq: number): SessionEvent[]; subscribe(listener: (event: SessionEvent) => void): () => void; /** Snapshot of what is known to be wrong with the persisted stream. */ integrity(): StreamIntegrity; private persist; private restore; private describeLoss; private rotateIfNeeded; }