Skip to main content

Module viz

Module viz 

Source
Expand description

Streaming tool-call visualization.

Sits between raw model output and the terminal: it detects the DSML tool-call marker in plain text and inside <think> blocks, suppresses the raw DSML markup from display, and instead paints compact, human-friendly tool banners (“$ command”, “Reading file 1:500…”, streamed diff lines with - /+ prefixes). Executable tool calls are still parsed by crate::dsml::DsmlParser; this module only rewrites the terminal projection, never the transcript.

Port of agent_tool_visualizer, agent_dsml_marker_detector, and agent_stream_renderer from ds4_agent.c.

Structs§

CollectSink
A sink that accumulates everything it is given into a shared buffer.
Finished
Snapshot of stream results after generation ends.
StreamRenderer
Streaming display state machine for assistant output.

Constants§

IN_THINK_PROHIBITION
Told to the model when it emitted a tool call inside <think>.

Traits§

RenderSink
Destination for rendered output; the UI layer routes this to its renderer.