pub struct BeforeToolApply {
pub tool_name: String,
pub safety: SafetyClass,
pub args: Value,
pub result: Option<SyntheticToolResult>,
}Expand description
Entry point for call-type transformations, invoked before each ToolApply.
Two orthogonal intervention axes:
- Modify args (data axis): rewrite the parameters passed to the tool.
- Fill result (short-circuit):
Some= skip the actual tool invocation and use this synthetic output as the result; the turn continues. This is fundamentally different fromBreak(which ends the entire turn) — do not confuse “intercepting a single tool” with “ending the turn”.
Fields§
§tool_name: String§safety: SafetyClassThe tool’s safety level, placed in the envelope for the matcher’s safety filtering.
args: ValueModifiable tool arguments.
result: Option<SyntheticToolResult>The result that will be produced. None = actually run the tool; Some =
short-circuit.
Trait Implementations§
Source§impl Clone for BeforeToolApply
impl Clone for BeforeToolApply
Source§fn clone(&self) -> BeforeToolApply
fn clone(&self) -> BeforeToolApply
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BeforeToolApply
impl Debug for BeforeToolApply
Source§impl HookStep for BeforeToolApply
impl HookStep for BeforeToolApply
Source§fn event_name(&self) -> &'static str
fn event_name(&self) -> &'static str
Event name (snake_case). Used in envelope headers and matchers.
Source§fn to_envelope(&self) -> Value
fn to_envelope(&self) -> Value
Projects the step into an input envelope — fed to command stdin / prompt
templates. Contains a common header plus step-specific fields.
Source§fn apply_verdict(
&mut self,
verdict: &Value,
) -> Result<HookControl, VerdictError>
fn apply_verdict( &mut self, verdict: &Value, ) -> Result<HookControl, VerdictError>
Apply the handler’s output verdict (JSON) back to this step: parse the common
control / additional_context fields, then handle the step-specific “fill
output” fields. Returns a control directive. Read moreAuto Trait Implementations§
impl Freeze for BeforeToolApply
impl RefUnwindSafe for BeforeToolApply
impl Send for BeforeToolApply
impl Sync for BeforeToolApply
impl Unpin for BeforeToolApply
impl UnsafeUnpin for BeforeToolApply
impl UnwindSafe for BeforeToolApply
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more