import { type KenTurnPayload, type AutopilotMarkerPayload, type AppMarkerPayload, type SessionEntry, type SessionManager, type TurnMetricPayload } from "../session-manager.js"; import type { CompactionAnchorRemap } from "../compaction/compactor.js"; /** * Display-only transcript history recorded against a session file: Ken Kai * turns, autopilot verdicts, app markers and per-turn metrics. NEVER part of * the LLM message history — persisted as `custom` entries (parentId null, so * never on the message DAG) and reloaded on resume so the transcript renders * the same rows the live run showed. Persistence is a no-op while the session * has no file (transient sessions keep markers in memory only). */ export declare class TranscriptMarkers { private readonly getSessionManager; private readonly getSessionPath; private kenTurns; private autopilotMarkers; private appMarkers; private turnMetrics; constructor(getSessionManager: () => SessionManager, getSessionPath: () => string); getKenTurns(): KenTurnPayload[]; getAutopilotMarkers(): AutopilotMarkerPayload[]; getAppMarkers(): AppMarkerPayload[]; getTurnMetrics(): TurnMetricPayload[]; /** Summed cost when every recorded turn has a known price, else undefined. */ knownCostUsd(): number | undefined; /** Drop everything — display-only history belongs to the OLD session. */ clear(): void; /** * Restore from a loaded session file. The leaf is passed so each marker also * carries its FILE-order position, the fallback used when a legacy anchor is * out of range (see RecordedPosition). */ restore(entries: SessionEntry[], leafId: string | null | undefined): void; /** * Rebase every transcript anchor (Ken turns, autopilot verdicts, app markers) * onto a freshly compacted message list. */ remapAnchors(remap: CompactionAnchorRemap | undefined): void; recordKenTurn(question: string, reply: string, afterMessageCount: number): Promise; recordAutopilotMarker(phase: AutopilotMarkerPayload["phase"], extra: { reason?: string; body?: string; } | undefined, afterMessageCount: number): Promise; recordAppMarker(kind: AppMarkerPayload["kind"], data: Record, afterMessageCount: number): Promise; /** Keep a turn metric in memory; {@link persistTurnMetric} writes it. */ addTurnMetric(payload: TurnMetricPayload): void; persistTurnMetric(payload: TurnMetricPayload): Promise; /** * Re-append everything to the current session file. Called after a * continuation/compaction file is created so display-only history isn't lost * when the session is rewritten (those rewrites only re-persist messages). * Each marker keeps its original `afterMessageCount` anchor. */ rePersistAll(): Promise; private rePersistTurnMetrics; private rePersist; private append; }