Initializes a tee sink.
The surrounding sink, which receives every channel.
Writes command output (the data channel).
Printable text (ANSI permitted) or raw bytes.
Writes error-stream output (the err channel).
Printable text (ANSI permitted) or raw bytes.
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.
Everything the data channel carried, as text.
The kept text.
Sink that passes everything through to the sink around it and keeps a copy of the data channel: what
NAME=$(command)holds when the command answers no model. The command still prints as it would have, so a captured run's progress and readout reach the operator; text is kept ANSI-stripped, as a pipe keeps it.