pub struct AgentManager { /* private fields */ }Expand description
Core agent manager implementation
Manages agent lifecycles without GUI dependencies. GUI/Tauri-specific features are in the GUI crate’s wrapper.
Implementations§
Source§impl AgentManager
impl AgentManager
Sourcepub fn new(db_path: PathBuf) -> AgentManager
pub fn new(db_path: PathBuf) -> AgentManager
Create a new AgentManager with the given database path
Sourcepub async fn spawn_agent(&self, id: String, name: String)
pub async fn spawn_agent(&self, id: String, name: String)
Spawn a lightweight agent task that listens for commands
This is a basic implementation. GUI can override spawn behavior by wrapping this manager.
Sourcepub async fn spawn_agent_with_request(&self, request: AgentSpawnRequest)
pub async fn spawn_agent_with_request(&self, request: AgentSpawnRequest)
Spawn a lightweight agent using an explicit configuration request.
Sourcepub async fn get_agent_status(&self, id: &str) -> Option<AgentInfo>
pub async fn get_agent_status(&self, id: &str) -> Option<AgentInfo>
Get status information for a specific agent
Sourcepub async fn list_agents(&self) -> Vec<AgentInfo>
pub async fn list_agents(&self) -> Vec<AgentInfo>
List all active agents
Sourcepub async fn update_activity(&self, id: &str)
pub async fn update_activity(&self, id: &str)
Update last activity timestamp for an agent
Sourcepub async fn send_event(&self, id: &str, payload: String)
pub async fn send_event(&self, id: &str, payload: String)
Publish an event to a specific agent if present
Sourcepub async fn shutdown_all(&self, grace_secs: u64)
pub async fn shutdown_all(&self, grace_secs: u64)
Gracefully shutdown all agents, waiting up to grace_secs for completion
Sourcepub fn default_db_path() -> PathBuf
pub fn default_db_path() -> PathBuf
Compute a default DB path under the user’s data dir
Trait Implementations§
Source§impl AgentSpawner for AgentManager
impl AgentSpawner for AgentManager
Source§fn spawn_agent<'life0, 'async_trait>(
&'life0 self,
id: String,
name: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentManager: 'async_trait,
fn spawn_agent<'life0, 'async_trait>(
&'life0 self,
id: String,
name: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentManager: 'async_trait,
Spawn an agent and return its id
Source§fn spawn_agent_with_request<'life0, 'async_trait>(
&'life0 self,
request: AgentSpawnRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentManager: 'async_trait,
fn spawn_agent_with_request<'life0, 'async_trait>(
&'life0 self,
request: AgentSpawnRequest,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentManager: 'async_trait,
Spawn an agent with an explicit request payload.
Source§fn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
payload: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
AgentManager: 'async_trait,
fn send_event<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
payload: String,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
AgentManager: 'async_trait,
Send an event envelope to a running agent
Source§fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
AgentManager: 'async_trait,
fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
AgentManager: 'async_trait,
Attempt to restore state for an agent
Source§fn shutdown_all<'life0, 'async_trait>(
&'life0 self,
grace_secs: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentManager: 'async_trait,
fn shutdown_all<'life0, 'async_trait>(
&'life0 self,
grace_secs: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentManager: 'async_trait,
Shutdown all agents with a grace period
Source§impl Clone for AgentManager
impl Clone for AgentManager
Source§fn clone(&self) -> AgentManager
fn clone(&self) -> AgentManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl OrchestratorAgentManager for AgentManager
impl OrchestratorAgentManager for AgentManager
Source§fn get_agent_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<AgentInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_agent_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<AgentInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get status information for a specific agent.
Auto Trait Implementations§
impl Freeze for AgentManager
impl !RefUnwindSafe for AgentManager
impl Send for AgentManager
impl Sync for AgentManager
impl Unpin for AgentManager
impl !UnwindSafe for AgentManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].