Skip to main content

render_event_line

Function render_event_line 

Source
pub fn render_event_line(envelope: &SessionEventEnvelope) -> String
Expand description

Render one line for a single streamed event, for attach/run-task.

Why: a human watching a live run wants a compact, timestamped narration — not the raw internally-tagged JSON. What: matches the handful of variants the M1 cut line actually produces (session lifecycle, tool lifecycle, generic message/log/progress) with a readable one-liner; anything else falls back to [<kind>] using the envelope’s own kind string rather than an exhaustive match on Event, so a future variant added elsewhere never breaks this function’s compilation. Test: tests::render_event_line_covers_key_variants, tests::render_event_line_falls_back_for_unknown_kind.