Expand description
A compact, one-way text projection of the canonical transcript model.
to_text is intended for LLM context, not archival or round trips. It
preserves conversational content and compact tool data while discarding
replay-only data: message timestamps, usage, stop reasons, reasoning
signatures/encrypted payloads, and inline image bytes.
to_text_fragment renders a Span of the body in the same format,
with a ── #N ── rule numbering each message by its 1-based position in
the full session — the same ordinals fragment refs (<id>#5-12) use, so
what a reader sees is what they can reference.
Functions§
- to_text
- Render a canonical transcript as compact, LLM-oriented text.
- to_
text_ fragment - Render
spanof the transcript into_text’s format, a── #N ──rule before each message carrying its 1-based ordinal in the full body. Partial spans addfragment=/of=header fields naming the slice.Nonewhenspanis out of bounds, mirroringTranscript::fragment.