Skip to main content

vtcode_core/tools/registry/
subagent_facade.rs

1use std::sync::Arc;
2
3use super::ToolRegistry;
4use crate::subagents::SubagentController;
5
6impl ToolRegistry {
7    pub fn set_subagent_controller(&self, controller: Arc<SubagentController>) {
8        if let Ok(mut slot) = self.subagent_controller.write() {
9            *slot = Some(controller);
10        }
11    }
12
13    pub fn subagent_controller(&self) -> Option<Arc<SubagentController>> {
14        self.subagent_controller
15            .read()
16            .ok()
17            .and_then(|slot| slot.clone())
18    }
19
20    pub fn has_subagent_controller(&self) -> bool {
21        self.subagent_controller().is_some()
22    }
23}