aether-agent-core 0.6.20

A minimal Rust library for building AI agents with MCP tool integration
Documentation
use crate::events::{AgentObserver, ObserverFactory};
use aether_auth::OAuthCredentialStorage;
use std::sync::Arc;

/// Cross-cutting dependencies threaded to every agent a run spawns — the root
/// agent and any sub-agents created by in-memory MCP servers. Bundling them
/// keeps the plumbing through builders and servers a single value.
#[derive(Clone, Default)]
pub struct AgentDeps {
    pub oauth_credential_store: Option<Arc<dyn OAuthCredentialStorage>>,
    pub observer_factory: Option<ObserverFactory>,
}

impl AgentDeps {
    pub fn new(
        oauth_credential_store: Arc<dyn OAuthCredentialStorage>,
        observer_factory: Option<ObserverFactory>,
    ) -> Self {
        Self { oauth_credential_store: Some(oauth_credential_store), observer_factory }
    }

    /// A fresh observer for one agent, if a factory is configured.
    pub fn observer(&self) -> Option<Box<dyn AgentObserver>> {
        self.observer_factory.as_ref().map(|factory| factory())
    }
}