(&self, tool_name: &str)
| 102 | } |
| 103 | |
| 104 | pub(crate) fn check_skill_restrictions(&self, tool_name: &str) -> Option<ToolGateDecision> { |
| 105 | if !self.config.enforce_active_skill_tool_restrictions { |
| 106 | return None; |
| 107 | } |
| 108 | |
| 109 | let registry = self.config.skill_registry.as_ref()?; |
| 110 | let restricting_skills = registry.global_tool_restricting_skills(); |
| 111 | if restricting_skills.is_empty() { |
| 112 | return None; |
| 113 | } |
| 114 | |
| 115 | let allowed = restricting_skills |
| 116 | .iter() |
| 117 | .any(|skill| skill.is_tool_allowed(tool_name)); |
| 118 | if allowed { |
| 119 | return None; |
| 120 | } |
| 121 | |
| 122 | let msg = format!("Tool '{}' is not allowed by any active skill.", tool_name); |
| 123 | Some(ToolGateDecision::Deny { |
| 124 | output: msg.clone(), |
| 125 | event_reason: msg, |
| 126 | reason: ToolGateDenial::SkillRestriction, |
| 127 | }) |
| 128 | } |
| 129 | |
| 130 | pub(crate) fn permission_decision( |
| 131 | &self, |
no test coverage detected