/**
 * Server-saved diagnostics (GENC-1351 §5.8) — the forward-only stream that lets
 * the debug log persist across a whole session lifetime, not just the current
 * page load. This module owns the *pure* pieces: the entry type and the
 * reassembly back into the `{ readme, timeline, meta }` debug-log shape. The
 * element owns capture/cadence; the provider owns storage layout.
 *
 * @packageDocumentation
 */
/**
 * One entry in the diagnostics stream — the debug-log timeline-entry union
 * (`message` / `turn` / `event`, as `getDebugLog()` builds) plus a point-in-time
 * **`meta-snapshot`** carrying the export-time `meta` block (agent summary,
 * context, active debug snapshot, …). Kept permissive: a provider stores and
 * returns these opaquely, and reassembly reads only `kind`, `timestamp` (for
 * ordering), and `meta` (on a snapshot).
 *
 * @public
 */
export interface DiagnosticEntry {
    kind: 'message' | 'turn' | 'event' | 'meta-snapshot';
    /** ISO timestamp — string-comparable, so it orders the stream chronologically. */
    timestamp?: string;
    /** Present on `meta-snapshot` entries: the export-time `meta` block. */
    meta?: unknown;
    /**
     * Present on `meta-snapshot` entries: a stable signature of the near-static config
     * (excludes volatile timestamp/context/debug-snapshot), used by the forward-capture
     * delta to skip re-appending an unchanged block (GENC-1351 §5.8). Absent on other
     * kinds and on pre-signature entries (the delta falls back to the full `meta` then).
     */
    dedupSignature?: string;
    [key: string]: unknown;
}
/** The reassembled debug log — the exact shape `getDebugLog()` returns. @public */
export interface DebugLog {
    readme: readonly string[];
    timeline: DiagnosticEntry[];
    meta: unknown;
}
/**
 * Stable identity for a message diagnostic entry — `timestamp::role::subAgentOf::category`.
 * Used by the forward-capture delta (skip already-emitted messages) and by the
 * restore watermark (skip messages already present in a prior load's stream).
 * `null` when the entry has no timestamp → treat as always-new. Shared so the
 * element's diagnostics capture and the `SessionPersister`'s restore watermark
 * compute identity identically (GENC-1351 §5.8/§5.10).
 *
 * `category` is part of the key because the reasoning/narration/answer split (GENC-1411) emits
 * SEVERAL messages from one model response — the thought summary, any interstitial narration, and
 * the answer/tool-call message — which share `timestamp` + `role` + `subAgentOf`. Keying on those
 * alone collapsed them to one, so the forward-capture dropped all but the first: a server
 * generation's answer message vanished from the persisted debug log while its reasoning survived
 * (GENC-1461). `category` is stable across a message's in-place annotation (only `toolCalls` change,
 * which is deliberately excluded), so a genuine re-append of the same message still dedups.
 *
 * @internal
 */
export declare function diagnosticsMessageKey(entry: DiagnosticEntry): string | null;
/**
 * Reassemble diagnostic entries into the `{ readme, timeline, meta }` debug-log
 * shape (GENC-1351 §5.8). `timeline` = the `message`/`turn`/`event` entries sorted
 * by ISO `timestamp` (kind-rank tie-break). `meta` = the **newest** `meta-snapshot`'s
 * block only — a "state at export" photo, matching the single-page log. The older
 * snapshots are intentionally dropped: the per-turn evolution they would show is
 * already in the timeline (`turn.agentSnapshot` + `context.updated` events), so
 * keeping them would just repeat the bulky, near-static `agentSummary`. `readme` =
 * the passed (current) constant. Pure — reused for both the live current-page log
 * and the reassembled lifetime log stitched from the persisted stream, so both
 * come out shape-identical.
 */
export declare function assembleDebugLog(entries: DiagnosticEntry[], readme: readonly string[]): DebugLog;
//# sourceMappingURL=diagnostics.d.ts.map