Expand description
Worker-only child ownership. Cancellation signals a private Unix process group promptly; only its owner may revoke the capability and reap the PID.
Structs§
- Capture
Policy - Bounds and stdin handling for one capture.
- Command
Output - Owned
Process - Owns both the child and the cancellation capability. Never put this in editor state: Drop may wait, so it belongs exclusively to a worker stack.
- Stream
Output - One streamed run’s outcome: everything except stdout, which the consumer already saw chunk by chunk.
- Stream
Policy - Bounds for one streamed run. Stdout has no retention limit by construction: the consumer, not the pipe, decides what to keep.
Enums§
- Capture
Error - Why a capture did not produce output.
capturefolds these back into the historicalFailurespellings; richer callers (remote exec) match on them directly. - Stdin
Policy - What capture does with the child’s stdin.
- Stream
Error - Why a streamed run did not complete. Mirrors
CaptureError;StreamError::Consumercarries the consumer’s own error type so a parse/shape failure surfaces typed, never flattened to a message.
Functions§
- capture
- At most 64 KiB per pipe, 30 seconds, stdin from
/dev/null. No terminal input/output is inherited. - capture_
with - Run one command to completion under explicit bounds. The child runs
in its own process group owned by
OwnedProcess; cancellation SIGKILLs it, the deadline kills it, and both pipes are drained concurrently with bounded retention. - stream_
with - Run one command to completion while its stdout streams through
consume. Supervision is identical tocapture_with: own process group, cancellation SIGKILLs it, the deadline kills it, stderr is drained concurrently with bounded retention, stdin is/dev/null. Stdout is never retained — a bounded number of chunks is in flight between the reader thread andconsume, so memory stays bounded by what the consumer keeps. A consumer error kills the child and surfaces asStreamError::Consumer.