/** * * BrowserEventLogger * * Append-only JSONL writer for browser-event records. Each line is * a self-contained JSON object, so a crash mid-write leaves a * partial line that downstream readers skip. * * The log path is supplied by the caller (CLI / sub-agent progress * signal). For QA slices the convention is: * `.peaks/_runtime//qa/browser-events.jsonl` * * The logger is fire-and-forget for the production write path: * a failed append prints a stderr hint and continues, never throws. * The test suite asserts the on-disk format. */ export type SpuriousRestartEvent = { readonly kind: 'spurious_restart'; readonly ts: string; readonly sessionId: string; readonly closeTs: string; readonly navigateTs: string; readonly deltaMs: number; }; export type BrowserEventRecord = SpuriousRestartEvent; export type BrowserEventLoggerOptions = { /** Absolute file path. The logger creates the parent dir if missing. */ readonly filePath: string; }; export declare class BrowserEventLogger { private readonly filePath; constructor(options: BrowserEventLoggerOptions); /** * Append one record to the JSONL file. Never throws on write * failure (matches the log-commands fire-and-forget pattern; the * detector's halt is the user-facing signal, not the log line). */ append(record: BrowserEventRecord): void; }