(profile: str | None, available_tools: frozenset[str])
| 189 | |
| 190 | |
| 191 | def profile_allowlist(profile: str | None, available_tools: frozenset[str]) -> set[str] | None: |
| 192 | if not profile: |
| 193 | return None |
| 194 | key = profile.strip().lower() |
| 195 | if key not in _TOOL_PROFILES: |
| 196 | raise ValueError(f"unknown tool profile: {profile}") |
| 197 | expanded = _TOOL_PROFILES[key] |
| 198 | if expanded is None: |
| 199 | return None |
| 200 | return set(expanded & available_tools) |
| 201 | |
| 202 | |
| 203 | def add_allowed( |