Expand description
Command execution with separate stdout/stderr capture, CRLF normalisation, and a per-stream truncation cap.
The cap is “200 lines or 8KB, whichever comes first” per stream. We
normalise CRLF to LF before counting lines so the output is consistent
across platforms. The single truncated flag in ExecOutcome is true
if either stream was clipped.
Structs§
- Exec
Options - Knobs for a single execution.
- Exec
Outcome - Result of running a single command.
Enums§
Constants§
- DEFAULT_
TIMEOUT - Hard wall-clock cap for any single command. Exceeding this returns a truncated result with whatever output has been gathered so far.
- MAX_
BYTES_ PER_ STREAM - Per-stream output cap (bytes). Counted on the post-CRLF-normalised stream.
- MAX_
LINES_ PER_ STREAM - Per-stream output cap (lines). Counted after CRLF normalisation.
Functions§
- cwd_
label - Helper used by integration tests and
shell_describeto surface the resolved command directory as a string. - execute
- Execute the given tokens. The first token is the program; the rest are
passed as discrete arguments — no shell is invoked, which is why the
metacharacter rejection in
crate::safetyis a hard prerequisite.