pub fn receive_session<R: BufRead, W: Write, O: Write>(
reader: R,
daemon_writer: W,
output: O,
token: &str,
max_commands: Option<usize>,
) -> Result<SessionEnd, AppError>Expand description
Subscribe to a local daemon and copy received commands to output as NDJSON.
max_commands = None drains until the connection closes. Control frames are
not written to output; daemon pings are answered with pongs. This function is
public so applications can consume the same low-latency stream directly
without spawning omni or implementing the subscription handshake.
ยงErrors
Returns AppError::internal on relay or output I/O failure.