AgentManager

Struct AgentManager 

Source
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

Source

pub fn new(db_path: PathBuf) -> Self

Create a new AgentManager with the given database path

Source

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.

Source

pub async fn spawn_agent_with_request(&self, request: AgentSpawnRequest)

Spawn a lightweight agent using an explicit configuration request.

Source

pub async fn get_agent_status(&self, id: &str) -> Option<AgentInfo>

Get status information for a specific agent

Source

pub async fn list_agents(&self) -> Vec<AgentInfo>

List all active agents

Source

pub async fn update_activity(&self, id: &str)

Update last activity timestamp for an agent

Source

pub async fn send_event(&self, id: &str, payload: String)

Publish an event to a specific agent if present

Source

pub async fn shutdown_all(&self, grace_secs: u64)

Gracefully shutdown all agents, waiting up to grace_secs for completion

Source

pub fn default_db_path() -> PathBuf

Compute a default DB path under the user’s data dir

Trait Implementations§

Source§

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 Self: 'async_trait, 'life0: '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 Self: 'async_trait, 'life0: '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 Self: 'async_trait, 'life0: 'async_trait, 'life1: '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 Self: 'async_trait, 'life0: 'async_trait, 'life1: '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 Self: 'async_trait, 'life0: 'async_trait,

Shutdown all agents with a grace period
Source§

impl Clone for AgentManager

Source§

fn clone(&self) -> AgentManager

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more