export type TranscriptItem = { kind: 'user'; id: string; text: string; } | { kind: 'assistant'; id: string; text: string; } | { kind: 'thinking'; id: string; text: string; } | { kind: 'tool'; id: string; name: string; toolUseId?: string; inputPreview: string; status: 'running' | 'ok' | 'error'; output?: string; outputUnavailable?: boolean; diff?: string; durationMs?: number; } | { kind: 'error'; id: string; message: string; } | { kind: 'notice'; id: string; text: string; } | { kind: 'subagent'; id: string; subagentId: string; parentId?: string; status: string; label: string; model?: string; agentType?: string; durationMs?: number; totalCostUsd?: number; promptHead?: string; turnCount?: number; stopReason?: string; parentToolUseId?: string; } | { kind: 'bg_job'; id: string; jobId: string; status: string; label: string; }; export type ToolCallItem = Extract; export type SubagentItem = Extract; export interface SessionTotals { costUsd: number; durationMs: number; turns: number; inputTokens?: number; outputTokens?: number; cacheReadTokens?: number; } export interface LedgerRecordLike { v?: number; ts?: number; kind?: string; [key: string]: unknown; } export interface SseStreamFrame { record: LedgerRecordLike; replay: boolean; } export type ToolIndex = Map; export type SubagentIndex = Map; export declare function resetIdCounter(): void; export declare function ledgerRecordToItem(record: LedgerRecordLike, toolIndex?: ToolIndex, subagentIndex?: SubagentIndex): TranscriptItem | undefined; export declare function accumulateTotals(totals: SessionTotals, record: LedgerRecordLike): SessionTotals; export declare function ledgerToItems(records: LedgerRecordLike[]): TranscriptItem[];