Expand description
Generic streaming subprocess engine — the shared core behind every process-backed harness (bob, Claude Code, Codex, …).
Spawns a child, pipes stdout/stderr line-by-line through a callback
as ProcessEvents, augments PATH so Node-based CLIs resolve even
from a Finder-launched .app, and hands back a ProcessHandle for
cancellation (SIGTERM → SIGKILL). No harness-trait or bob knowledge —
purely subprocess streaming.
Cancellation is the wrinkle: a run needs to be stoppable mid-stream
when the user closes the tab or hits “stop”. ProcessHandle::cancel()
sends SIGTERM (with a SIGKILL fallback) and flips an atomic
cancelled flag the reader threads use to short-circuit.
Structs§
- Process
Handle - Handle to an in-flight streaming run. Caller stores it (e.g. in a
runId-keyed map) so a later
cancel()can find it.
Enums§
- Process
Event - Raw events emitted to the caller’s callback during a streaming run.
JSON-tagged so axum SSE and Tauri Channel render identical payloads
on the wire. Harness-neutral: a process-backed adapter parses the
Stdoutlines into a normalized event vocabulary (e.g.agent-harness’sRunEvent).
Functions§
- augmented_
node_ path - A PATH that resolves Node-based CLIs (bob, claude, codex) even from a
process launched by Finder/Launchpad, which inherits only the minimal
launchd PATH (
/usr/bin:/bin:/usr/sbin:/sbin) rather than the user’s shell PATH. - spawn_
streaming - Spawn an arbitrary streaming child process — the generic engine behind every process-backed harness (bob, Claude Code, Codex).