Expand description
Assistant markdown rendering: streaming terminal renderer for model output.
Port of the “Assistant Markdown Rendering” section of refs/ds4/ds4_agent.c.
The renderer handles only the cheap markdown cues that make terminal output
readable: **bold**, *italic*, inline code, and fenced code blocks with a
kilo-style keyword highlighter. It is a streaming parser, so it buffers only
ambiguous marker bytes long enough to decide whether they are formatting or
literal text. It also hides <think> tags and renders thinking text grey.
Structs§
- Render
Options - Options controlling the token renderer’s output.
- Syntax
- One language entry of the poor man’s code highlighter.
- Tail
Capture - Ring buffer recording the last N output bytes plus a total byte count.
- Token
Renderer - Streaming markdown-aware terminal renderer for assistant output.
Functions§
- syntax_
for_ lang - Looks up a syntax entry by language name or alias, defaulting to generic.
- syntax_
for_ path - Looks up a syntax entry from a file path’s basename and extension.