Skip to main content

AgentBehavior

Trait AgentBehavior 

Source
pub trait AgentBehavior: Send + Sync {
Show 13 methods // Required method fn id(&self) -> &str; // Provided methods fn behavior_ids(&self) -> Vec<&str> { ... } fn register_lattice_paths(&self, _registry: &mut LatticeRegistry) { ... } fn register_state_scopes(&self, _registry: &mut StateScopeRegistry) { ... } fn register_state_action_deserializers( &self, _registry: &mut StateActionDeserializerRegistry, ) { ... } fn run_start<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<LifecycleAction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn step_start<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<LifecycleAction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn before_inference<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<BeforeInferenceAction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn after_inference<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<AfterInferenceAction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn before_tool_execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<BeforeToolExecuteAction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn after_tool_execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<AfterToolExecuteAction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn step_end<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<LifecycleAction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn run_end<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<LifecycleAction>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... }
}
Expand description

Behavioral abstraction for agent phase hooks.

Each hook receives an immutable ReadOnlyContext snapshot and returns a typed ActionSet describing effects to apply. The loop applies these actions via match — no dynamic dispatch, no runtime validation.

All hook methods have default no-op implementations; plugins only override the phases they care about.

Required Methods§

Source

fn id(&self) -> &str

Provided Methods§

Source

fn behavior_ids(&self) -> Vec<&str>

Source

fn register_lattice_paths(&self, _registry: &mut LatticeRegistry)

Register lattice (CRDT) paths with the registry.

Source

fn register_state_scopes(&self, _registry: &mut StateScopeRegistry)

Register state scopes with the registry.

Source

fn register_state_action_deserializers( &self, _registry: &mut StateActionDeserializerRegistry, )

Register state-action deserializers for persisted intent-log replay and recovery.

Source

fn run_start<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<LifecycleAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn step_start<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<LifecycleAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn before_inference<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<BeforeInferenceAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn after_inference<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<AfterInferenceAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn before_tool_execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<BeforeToolExecuteAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn after_tool_execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<AfterToolExecuteAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn step_end<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<LifecycleAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn run_end<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _ctx: &'life1 ReadOnlyContext<'life2>, ) -> Pin<Box<dyn Future<Output = ActionSet<LifecycleAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§