vtcode_core/tools/registry/
sandbox_facade.rs1use super::ToolRegistry;
4
5pub(super) fn runtime_sandbox_config_default() -> vtcode_config::SandboxConfig {
6 vtcode_config::SandboxConfig { enabled: false, ..Default::default() }
8}
9
10impl ToolRegistry {
11 pub fn apply_sandbox_config(&self, sandbox_config: &vtcode_config::SandboxConfig) {
12 let mut guard = self
15 .runtime_sandbox_config
16 .write()
17 .unwrap_or_else(|poisoned| poisoned.into_inner());
18 *guard = sandbox_config.clone();
19 }
20
21 pub fn sandbox_config(&self) -> vtcode_config::SandboxConfig {
22 self.runtime_sandbox_config
23 .read()
24 .map(|guard| guard.clone())
25 .unwrap_or_else(|_| runtime_sandbox_config_default())
26 }
27}