pub trait Action: Send + 'static {
// Required methods
fn label(&self) -> &'static str;
fn apply(self: Box<Self>, step: &mut StepContext<'_>);
// Provided method
fn validate(&self, _phase: Phase) -> Result<(), String> { ... }
}Expand description
Unified action trait for all phase effects.
Actions are emitted by AgentBehavior
hooks and tool effects, then applied to StepContext by the runtime
after validation. Extension plugins and tools can define their own actions
by implementing this trait.
Required Methods§
Sourcefn apply(self: Box<Self>, step: &mut StepContext<'_>)
fn apply(self: Box<Self>, step: &mut StepContext<'_>)
Apply this action to the mutable step context.
Consumes self (boxed) so that actions can move data into the
step context without cloning.