Initializes the capture around a live sink for status passthrough.
The sink that continues to receive status writes.
Writes command output (the data channel).
Printable text (ANSI permitted) or raw bytes.
Returns the captured data channel as UTF-8 text.
The captured data text.
Writes error-stream output (the err channel).
Printable text (ANSI permitted) or raw bytes.
Returns the captured err channel as UTF-8 text.
The captured error-stream text.
Sends a typed event to the command's origin surface, while the command runs.
The kind names what the data is (games.trek.state); a surface shows
the kinds it knows and drops the rest. Optional: a sink that predates
events, or has nowhere to send one, leaves it out, and a command sends
with sink.event_write?.(kind, data).
What the data is.
The event, shaped by its kind; it must survive JSON.
Writes an ephemeral status line (the status channel).
Transient text; consumers may overwrite or drop it.
Sink that captures the data and err channels while passing status through to a live sink, so transients (spinners, progress) remain visible while a legacy printing command's output is being gathered into an envelope.