Check if a tool is allowed by this skill
(&self, tool_name: &str)
| 236 | |
| 237 | /// Check if a tool is allowed by this skill |
| 238 | pub fn is_tool_allowed(&self, tool_name: &str) -> bool { |
| 239 | let permissions = self.parse_allowed_tools(); |
| 240 | |
| 241 | if permissions.is_empty() { |
| 242 | return false; |
| 243 | } |
| 244 | |
| 245 | // Check if any permission matches |
| 246 | permissions.iter().any(|perm| { |
| 247 | (perm.tool == "*" || perm.tool.eq_ignore_ascii_case(tool_name)) && perm.pattern == "*" |
| 248 | }) |
| 249 | } |
| 250 | |
| 251 | /// Get the skill content formatted for injection into system prompt |
| 252 | pub fn to_system_prompt(&self) -> String { |
no test coverage detected