feat: add agent
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-11-24 00:53:43 +01:00
parent 7487e7336e
commit d1e9eb9eb5
8 changed files with 418 additions and 11 deletions

View File

@@ -0,0 +1,32 @@
use std::{ops::Deref, sync::Arc};
#[derive(Clone)]
pub struct AgentState(Arc<State>);
impl AgentState {
pub async fn new() -> anyhow::Result<Self> {
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<State>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
pub struct State {}
impl State {
pub async fn new() -> anyhow::Result<Self> {
Ok(Self {})
}
}