/** Roles this module carries; anything else is dropped with its message. */ export type TranscriptTextRole = 'user' | 'assistant'; /** * One admitted content block, in the order the message carried it. * * **Order is preserved rather than bucketed**, because narration is assigned by * adjacency: a message holding `text A, tool_use(Read), text B, tool_use(Edit)` * must narrate the `Read` with A and the `Edit` with B. Collecting the text into * one string and the tool names into another loses exactly the information that * distinguishes those two calls, and the resulting mistake — prose written * *after* a call attached to it — is the confidently-wrong kind this module * treats as worse than no narration at all. */ export type TranscriptBlock = { kind: 'text'; /** * One `type:'text'` block, newlines intact. * * Intact because the next step is structural: `stripCodeBlocks` recognizes * a fence by its position at the start of a line, so any normalization * that touches newlines here would silently disarm it. */ text: string; } | { kind: 'tool_use'; toolName: string; }; /** One transcript message, reduced to the parts the class table admits. */ export type TranscriptTextMessage = { role: TranscriptTextRole; blocks: TranscriptBlock[]; }; /** * Parse one transcript line into a message, or `null` if it carries none. * * `null` for a line that is malformed JSON, has no recognized role, or is the * agent's own bookkeeping (`isMeta`) — slash-command echoes, hook output and * compaction notices are injected *into* the user role but are not the user * speaking, and the class table's "user turns" row is about what the user said. */ export declare function parseTranscriptTextMessage(line: string): TranscriptTextMessage | null; /** * Read a transcript file as text messages, in transcript order. * * An unreadable file yields an empty list rather than throwing: narration is * additive evidence, and a session whose transcript moved or was deleted must * still sync its actions exactly as it does today. */ export declare function readTranscriptTextMessages(path: string): Promise; //# sourceMappingURL=messages.d.ts.map