cli_stream/lib.rs
1//! Generic streaming subprocess engine.
2//!
3//! Spawn a child CLI, stream its stdout/stderr line-by-line through a
4//! callback as [`ProcessEvent`]s, cancel it (SIGTERM → SIGKILL), and
5//! augment `PATH` so Node-based CLIs resolve even from a Finder-launched
6//! `.app`. No agent / harness *protocol* knowledge — it parses no CLI's
7//! output and knows no agent's wire format. The one node-specific concession
8//! is the best-effort PATH resolver (`augmented_node_path`): every consumer in
9//! this family drives a Node-based CLI, and as the shared leaf this is the one
10//! place `bob-rs` and `agent-harness` can both reuse it without a cycle.
11//! Otherwise it's purely subprocess streaming, useful to anyone driving a CLI.
12//!
13//! [`InstallEvent`] is the sibling shape for streamed install/login output.
14//!
15//! This is a deliberate *leaf* crate: both `bob-rs` (the bob SDK) and
16//! `agent-harness` (the framework) depend on it, which is what lets
17//! `bob-rs` stay standalone without a dependency cycle.
18
19pub mod error;
20pub mod install;
21pub mod process;
22
23pub use error::StreamError;
24pub use install::InstallEvent;
25pub use process::{augmented_node_path, spawn_streaming, ProcessEvent, ProcessHandle};