Check if tool_name matches the matcher pattern. Args: matcher: Pattern like "Bash", "Edit|Write", "*" tool_name: Actual tool name Returns: True if matches
(self, matcher: str, tool_name: str)
| 125 | return True |
| 126 | |
| 127 | def _matches_tool(self, matcher: str, tool_name: str) -> bool: |
| 128 | """Check if tool_name matches the matcher pattern. |
| 129 | |
| 130 | Args: |
| 131 | matcher: Pattern like "Bash", "Edit|Write", "*" |
| 132 | tool_name: Actual tool name |
| 133 | |
| 134 | Returns: |
| 135 | True if matches |
| 136 | """ |
| 137 | if matcher == '*': |
| 138 | return True |
| 139 | |
| 140 | # Split on | for OR matching |
| 141 | patterns = matcher.split('|') |
| 142 | return tool_name in patterns |
| 143 | |
| 144 | def _check_condition(self, condition: Condition, tool_name: str, |
| 145 | tool_input: Dict[str, Any], input_data: Dict[str, Any] = None) -> bool: |