feat: endpoints for config management via goose-server (#1207)

Co-authored-by: Lily Delalande <ldelalande@squareup.com>
This commit is contained in:
Alex Hancock
2025-02-12 21:19:13 -05:00
committed by GitHub
parent e461e6845d
commit 9287eaeb5d
14 changed files with 569 additions and 6 deletions
+4
View File
@@ -1,5 +1,7 @@
use anyhow::Result;
use goose::agents::Agent;
use serde_json::Value;
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::Mutex;
@@ -9,6 +11,7 @@ use tokio::sync::Mutex;
pub struct AppState {
pub agent: Arc<Mutex<Option<Box<dyn Agent>>>>,
pub secret_key: String,
pub config: Arc<Mutex<HashMap<String, Value>>>,
}
impl AppState {
@@ -16,6 +19,7 @@ impl AppState {
Ok(Self {
agent: Arc::new(Mutex::new(None)),
secret_key,
config: Arc::new(Mutex::new(HashMap::new())),
})
}
}