pub struct BashOutputCompressor { /* private fields */ }Expand description
Deterministic compressor for bash tool output.
When enabled and bash output exceeds the configured line threshold, the model-facing content is compressed to the last N lines plus a truncation marker. Full output is preserved on the UI event/export surface.
Implementations§
Source§impl BashOutputCompressor
impl BashOutputCompressor
Sourcepub fn with_threshold(line_threshold: usize) -> Self
pub fn with_threshold(line_threshold: usize) -> Self
Creates a new compressor with a custom line threshold.
Sourcepub fn compress(&self, content: &str) -> CompressedOutput
pub fn compress(&self, content: &str) -> CompressedOutput
Compresses bash output if it exceeds the line threshold.
When the number of lines is at or below the threshold, the content is
returned unchanged with strategy = "none".
When the number of lines exceeds the threshold, the output is compressed
to the last N lines with a truncation marker, and strategy = "last_n_lines".
§Determinism
This method is fully deterministic: the same input string always produces the same output bytes. No timestamps, random state, or external context is used.
Trait Implementations§
Source§impl Clone for BashOutputCompressor
impl Clone for BashOutputCompressor
Source§fn clone(&self) -> BashOutputCompressor
fn clone(&self) -> BashOutputCompressor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more