Expand description
omni cast mode — stream stdin to the omni wire command stream (bd-5cd61e).
omni cast reads stdin and forwards it, in real time, as a stream of
crate::wire::InjectionCommands to the selected sink (the NDJSON wire on
stdout by default, or the Android transport with --adb). It is the
streaming sibling of one-shot omni send.
§Framing (Frame)
line(default): each input line becomes atextcommand (empty lines are skipped). Good forproducer | omni cast.char: each input character is forwarded as it arrives —\n/\r->key enter,\t->key tab, everything else -> a one-charactertextcommand. Good for real-time keystroke forwarding.ndjson: each input line is parsed as a canonical NDJSONInjectionCommandand forwarded verbatim (a pump/forward mode), e.g.omni send text hi | omni cast --ndjson --adb. Blank lines are skipped; a malformed line is an error.
The actual delivery (stdout NDJSON vs. Android am-broadcast) is the caller’s
sink; this module owns only stdin -> command translation, so it is unit
testable without a real terminal or device. The caller flushes the sink per
command for real-time behaviour.
Enums§
- Frame
- How
omni castframes stdin into commands.
Functions§
- char_
to_ command - Map a single character to a command for
Frame::Charstreaming. - run_
cast - Drive a cast: read from
input, translate perframe, and hand eachInjectionCommandtosink(which delivers + flushes it). Returns the number of commands emitted. - run_
cast_ reader - Convenience wrapper that reads from any
Read(wrapping it in astd::io::BufReader).