huskies: merge 629_refactor_migrate_commanddispatch_and_commandcontext_to_services_bundle

This commit is contained in:
dave
2026-04-25 20:37:10 +00:00
parent 2a3f88fdcf
commit 14b158d0b2
27 changed files with 407 additions and 544 deletions
+19
View File
@@ -36,3 +36,22 @@ pub struct Services {
/// auto-denying (fail-closed).
pub permission_timeout_secs: u64,
}
#[cfg(test)]
impl Services {
/// Build a minimal `Services` for testing with the given project root and
/// bot display name.
pub fn new_test(project_root: std::path::PathBuf, bot_name: String) -> std::sync::Arc<Self> {
let (_perm_tx, perm_rx) = mpsc::unbounded_channel();
std::sync::Arc::new(Self {
project_root,
agents: std::sync::Arc::new(crate::agents::AgentPool::new_test(3000)),
bot_name,
bot_user_id: String::new(),
ambient_rooms: std::sync::Arc::new(std::sync::Mutex::new(HashSet::new())),
perm_rx: std::sync::Arc::new(TokioMutex::new(perm_rx)),
pending_perm_replies: std::sync::Arc::new(TokioMutex::new(HashMap::new())),
permission_timeout_secs: 120,
})
}
}