pub struct AgentOps { /* private fields */ }Expand description
Resolved set of agent-native reduction knobs for one invocation.
Implementations§
Source§impl AgentOps
impl AgentOps
Sourcepub fn from_cli(cli: &Cli) -> AppResult<Self>
pub fn from_cli(cli: &Cli) -> AppResult<Self>
Build the plan from parsed CLI flags.
§Errors
Returns crate::error::ErrorKind::InvalidInput when a --filter expression
is malformed.
Sourcepub fn from_args(args: &AgentArgs) -> AppResult<Self>
pub fn from_args(args: &AgentArgs) -> AppResult<Self>
Build the plan from the reduction flag group.
select accepts CSV or repetition; empty items are dropped so a stray comma
never becomes a projection for the empty key.
§Errors
Returns crate::error::ErrorKind::InvalidInput when a --filter expression
is malformed.
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Whether any reduction knob is set.
--max-output-bytes alone does not activate the pipeline: per-command
budgeting already enforces it upstream, and activating here would change the
established envelope shape for callers that never asked for agent_surface.
Sourcepub fn apply_to_bytes(&self, raw: &[u8]) -> Vec<u8> ⓘ
pub fn apply_to_bytes(&self, raw: &[u8]) -> Vec<u8> ⓘ
Apply the pipeline to already-serialized envelope bytes.
Passes the input through unchanged when it is not a JSON object (shell
completion scripts, human markdown) or when the envelope reports ok: false.
The returned buffer always ends with a newline when non-empty.
Sourcepub fn apply_to_envelope(&self, env: &mut Value)
pub fn apply_to_envelope(&self, env: &mut Value)
Apply the pipeline in place to a parsed success envelope.
Adds an agent_surface object describing what the reduction did. Callers that
pass an error envelope get an untouched value.