Skip to main content

Module shell_passthrough

Module shell_passthrough 

Source
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§

CapturedOutput
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.