/** * ForensicsRegistry, in-memory store for FailureReport objects. * * Maintains a bounded circular buffer of reports (newest last), keyed by * report ID for O(1) lookup. Supports `latest()`, `getById()`, raw report * export, and incident bundle export for the /forensics command subcommands. */ import type { FailureReport, ForensicsBundle } from './types.js'; export interface ReplaySnapshotInput { readonly status: string; readonly runId: string | null; readonly currentRev: number; readonly totalRevisions: number; readonly mismatches: ReadonlyArray<{ readonly rev: number; readonly kind: string; readonly description: string; readonly eventName?: string | undefined; readonly ownerDomain?: string | undefined; readonly failureMode?: string | undefined; readonly relatedTurnId?: string | undefined; }>; readonly turnSummaries: ReadonlyArray<{ readonly turnId: string; readonly outcome: 'completed' | 'failed' | 'cancelled'; readonly terminalEvent: 'PREFLIGHT_FAIL' | 'TURN_COMPLETED' | 'TURN_ERROR' | 'TURN_CANCEL'; readonly startedRev?: number | undefined; readonly terminalRev: number; readonly stopReason?: string | undefined; readonly message?: string | undefined; }>; } /** Default maximum number of failure reports retained in memory. */ export declare const DEFAULT_REGISTRY_LIMIT = 100; export declare class ForensicsRegistry { private readonly _reports; private readonly _byId; private readonly _limit; private readonly _subscribers; constructor(limit?: number); /** * Push a new failure report into the registry. * If the buffer is full, the oldest entry is evicted. */ push(report: FailureReport): void; /** * Return the most recently generated report, or null if none exist. */ latest(): FailureReport | null; /** * Return a report by its short ID, or undefined if not found. */ getById(id: string): FailureReport | undefined; /** * Return all reports, newest first. */ getAll(): FailureReport[]; /** * Return the count of retained reports. */ count(): number; /** * Serialize a report to a pretty-printed JSON string. * Returns undefined if the report ID is not found. */ exportAsJson(id: string): string | undefined; /** * Build a richer incident bundle for export, including derived evidence and * optional replay state when available. */ buildBundle(id: string, options?: { replaySnapshot?: ReplaySnapshotInput; }): ForensicsBundle | undefined; /** * Serialize an incident bundle to pretty-printed JSON. * Returns undefined if the report ID is not found. */ exportBundleAsJson(id: string, options?: { replaySnapshot?: ReplaySnapshotInput; }): string | undefined; /** * Subscribe to registry changes. Returns an unsubscribe function. */ subscribe(callback: () => void): () => void; private _notify; private _buildReplayEvidence; private _countBy; } //# sourceMappingURL=registry.d.ts.map