( context: ToolPermissionContext, agentToolName: string, agentType: string, )
| 306 | * For example, Agent(Explore) would deny the Explore agent. |
| 307 | */ |
| 308 | export function getDenyRuleForAgent( |
| 309 | context: ToolPermissionContext, |
| 310 | agentToolName: string, |
| 311 | agentType: string, |
| 312 | ): PermissionRule | null { |
| 313 | return ( |
| 314 | getDenyRules(context).find( |
| 315 | rule => |
| 316 | rule.ruleValue.toolName === agentToolName && |
| 317 | rule.ruleValue.ruleContent === agentType, |
| 318 | ) || null |
| 319 | ) |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * Filter agents to exclude those that are denied via Agent(agentType) syntax. |