MCPcopy Create free account
hub / github.com/AI45Lab/Code / fork

Method fork

core/src/skills/registry.rs:48–56  ·  view source on GitHub ↗

Fork this registry into an independent copy. The fork shares no state with the original — skills added to the fork do not affect the source registry. The validator is preserved so that session and delegated-agent registries keep the same safety policy.

(&self)

Source from the content-addressed store, hash-verified

46 /// do not affect the source registry. The validator is preserved so
47 /// that session and delegated-agent registries keep the same safety policy.
48 pub fn fork(&self) -> Self {
49 let skills = self.skills.read().unwrap().clone();
50 let builtin_names = self.builtin_names.read().unwrap().clone();
51 Self {
52 skills: Arc::new(RwLock::new(skills)),
53 builtin_names: Arc::new(RwLock::new(builtin_names)),
54 validator: Arc::new(RwLock::new(self.validator.read().unwrap().clone())),
55 }
56 }
57
58 /// Set the skill validator (safety gate)
59 pub fn set_validator(&self, validator: Arc<dyn SkillValidator>) {

Calls 1

cloneMethod · 0.45

Tested by 3

test_fork_is_independentFunction · 0.64