pub struct SpawnModule { /* private fields */ }Implementations§
Source§impl SpawnModule
impl SpawnModule
pub fn new(catalog: Arc<AgentCatalog>, initial_agent: Arc<dyn Agent>) -> Self
Sourcepub fn current_agent_name(&self) -> Option<String>
pub fn current_agent_name(&self) -> Option<String>
Get the current agent name (top of stack)
Sourcepub fn with_current_agent<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&ActiveAgent) -> R,
pub fn with_current_agent<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&ActiveAgent) -> R,
Execute closure with read access to current agent
Sourcepub fn with_current_agent_mut<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&mut ActiveAgent) -> R,
pub fn with_current_agent_mut<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&mut ActiveAgent) -> R,
Execute closure with mutable access to current agent
Sourcepub fn with_root_agent<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&ActiveAgent) -> R,
pub fn with_root_agent<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&ActiveAgent) -> R,
Execute closure with read access to root agent
Sourcepub fn with_root_agent_mut<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&mut ActiveAgent) -> R,
pub fn with_root_agent_mut<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&mut ActiveAgent) -> R,
Execute closure with mutable access to root agent
Sourcepub fn push_agent(&self, agent: ActiveAgent)
pub fn push_agent(&self, agent: ActiveAgent)
Push a new agent onto the stack
Sourcepub fn pop_agent(&self) -> Option<ActiveAgent>
pub fn pop_agent(&self) -> Option<ActiveAgent>
Pop current agent if stack has > 1 agent (preserves root)
Sourcepub fn stack_depth(&self) -> usize
pub fn stack_depth(&self) -> usize
Get stack depth
Sourcepub fn reset_to_agent(&self, agent: Arc<dyn Agent>)
pub fn reset_to_agent(&self, agent: Arc<dyn Agent>)
Clear stack and reset with new root agent
Sourcepub fn catalog(&self) -> &Arc<AgentCatalog>
pub fn catalog(&self) -> &Arc<AgentCatalog>
Get reference to catalog
Sourcepub fn with_agents<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&[ActiveAgent]) -> R,
pub fn with_agents<F, R>(&self, f: F) -> Option<R>where
F: FnOnce(&[ActiveAgent]) -> R,
Execute closure with read access to all agents
Trait Implementations§
Source§impl Module for SpawnModule
impl Module for SpawnModule
fn prompt_components(&self) -> Vec<Arc<dyn PromptComponent>>
fn context_components(&self) -> Vec<Arc<dyn ContextComponent>>
fn tools(&self) -> Vec<Arc<dyn ToolExecutor>>
Source§fn session_state(&self) -> Option<Arc<dyn SessionStateComponent>>
fn session_state(&self) -> Option<Arc<dyn SessionStateComponent>>
Returns a session state component if this module has persistent state.
Return None if this module has no state to persist across sessions.
Source§fn slash_commands(&self) -> Vec<Arc<dyn SlashCommand>>
fn slash_commands(&self) -> Vec<Arc<dyn SlashCommand>>
Returns slash commands provided by this module.
Default implementation returns an empty vec (no commands).
Source§fn settings_namespace(&self) -> Option<&'static str>
fn settings_namespace(&self) -> Option<&'static str>
Option allows modules without configuration to opt-out, avoiding empty entries.
Source§fn settings_json_schema(&self) -> Option<RootSchema>
fn settings_json_schema(&self) -> Option<RootSchema>
Returns JSON Schema for this module’s settings configuration.
Used for auto-generating settings UI.
Auto Trait Implementations§
impl Freeze for SpawnModule
impl !RefUnwindSafe for SpawnModule
impl Send for SpawnModule
impl Sync for SpawnModule
impl Unpin for SpawnModule
impl !UnwindSafe for SpawnModule
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.