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)
| 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>) { |