The first thin front-end over the event bus (ADR 0004, decision D-05): a stdout
subscriber that pattern-matches on event.type. It validates the seam — the core
needs no changes for a new front-end.
Channel discipline (ADR 0005):
- stdout — the model's answer: streamed
text_deltas and the final newline. - stderr — activity and diagnostics: tool calls/results, reasoning, status.
render/1 is the pure mapping from an Event to writes ([{:stdout | :stderr, io}]),
so it is unit-testable. consume_until_done/1 owns one canonical Session epoch,
performing writes until that Session emits terminal status ("done" / "error").
The Session may be explicit in :session_id or safely derived from the first
canonical Event; foreign-Session Events never contaminate the epoch.
Summary
Functions
Receive and render Events for the calling (already-subscribed) process until a
terminal status. Returns :ok or :timeout after :idle_timeout ms of silence.
Render the terminal summary when a Presenter suppressed warnings over its cap.
Render one Provider-output truncation warning without changing model text.
Map an Event to a list of {:stdout | :stderr, iodata} writes.
Perform a single {:stdout | :stderr, iodata} write (used by front-ends).
Functions
@spec consume_until_done(keyword()) :: :ok | :timeout
Receive and render Events for the calling (already-subscribed) process until a
terminal status. Returns :ok or :timeout after :idle_timeout ms of silence.
@spec output_truncation_suppression(non_neg_integer(), non_neg_integer()) :: iodata()
Render the terminal summary when a Presenter suppressed warnings over its cap.
Render one Provider-output truncation warning without changing model text.
Map an Event to a list of {:stdout | :stderr, iodata} writes.
@spec write({:stdout | :stderr, iodata()}) :: :ok
Perform a single {:stdout | :stderr, iodata} write (used by front-ends).