rsclaw 0.0.1-alpha.1

rsclaw: High-performance AI agent (BETA). Optimized for M4 Max and 2GB VPS. 100% compatible with openclaw
Documentation
#[allow(unused_imports)]
pub mod router;
#[allow(unused_imports)]
pub mod session;

use crate::agent::AgentManager;
use crate::channel::ChannelManager;
use std::sync::Arc;
use tokio::sync::RwLock;

/// Gateway orchestrates channels and agents.
pub struct Gateway {
    agent_manager: Arc<RwLock<AgentManager>>,
    channel_manager: Arc<ChannelManager>,
}

impl Gateway {
    /// Create a new gateway.
    pub fn new(max_concurrent_agents: u32) -> Self {
        let agent_manager = Arc::new(RwLock::new(AgentManager::new(max_concurrent_agents)));
        let channel_manager = Arc::new(ChannelManager::new(agent_manager.clone()));

        Self {
            agent_manager,
            channel_manager,
        }
    }

    /// Get the channel manager.
    pub fn channels(&self) -> Arc<ChannelManager> {
        self.channel_manager.clone()
    }

    /// Get the agent manager.
    pub fn agents(&self) -> Arc<RwLock<AgentManager>> {
        self.agent_manager.clone()
    }
}