use std::sync::Arc;
pub use ag_agent::{
AgentBackend, AgentBackendError, AppServerClient, AppServerError, AppServerTurnResponse,
MockAgentBackend, MockAppServerClient, RealOneShotClient, instruction_bootstrap_key,
};
use ag_contracts::{AgentChannel, OneShotClient};
use ag_session::AgentKind;
use super::{RuntimeFactory, SessionRuntime, UtilityRuntime};
pub fn cli_runtime(backend: std::sync::Arc<dyn AgentBackend>, kind: AgentKind) -> SessionRuntime {
SessionRuntime::from_channel(ag_agent::create_cli_agent_channel_with_backend(
backend, kind,
))
}
impl RuntimeFactory {
pub fn with_app_server(client: Arc<dyn ag_agent::AppServerClient>) -> Self {
Self {
app_server: Some(client),
}
}
}
impl SessionRuntime {
pub fn from_channel(channel: Arc<dyn AgentChannel>) -> Self {
Self { channel }
}
}
impl UtilityRuntime {
pub fn from_client(client: Arc<dyn OneShotClient>) -> Self {
Self { client }
}
}