Expand description
Shell passthrough: capture subprocess output and build context messages.
The ! prefix in the REPL runs a shell command directly, streams output
to the terminal, captures it into a buffer, and injects the result into
conversation history as a UserMessage with is_meta: true.
This module extracts the capture and message-building logic so it can be tested independently of the REPL event loop.
Structs§
- Captured
Output - Result of capturing shell command output.
Constants§
- MAX_
CAPTURE_ BYTES - Maximum bytes captured from shell output before truncation.
Functions§
- build_
context_ message - Build a context injection message from captured shell output.
- capture_
lines - Capture text into a buffer with a size limit.
- run_
and_ capture - Run a shell command, capture its output, and return the result.