use std::{ops::Deref, sync::Arc}; #[derive(Clone)] pub struct AgentState(Arc); impl AgentState { pub async fn new() -> anyhow::Result { Ok(Self(Arc::new(State::new().await?))) } } impl From<&AgentState> for AgentState { fn from(value: &AgentState) -> Self { value.clone() } } impl Deref for AgentState { type Target = Arc; fn deref(&self) -> &Self::Target { &self.0 } } pub struct State {} impl State { pub async fn new() -> anyhow::Result { Ok(Self {}) } }