Skip to main content

Compressor

Trait Compressor 

Source
pub trait Compressor {
    // Required methods
    fn matches(&self, command: &str) -> bool;
    fn compress(&self, command: &str, output: &str) -> String;
}
Expand description

A Compressor knows how to reduce one specific command’s output to fewer tokens while preserving the information the agent needs.

Required Methods§

Source

fn matches(&self, command: &str) -> bool

Returns true if this compressor handles the given command head + args. Called after generic detection (ANSI strip, dedup) so this is per-command logic only.

Source

fn compress(&self, command: &str, output: &str) -> String

Compress the output. Original is left untouched if compression fails.

Implementors§