(action: ToolPolicyAction)
| 140 | }; |
| 141 | |
| 142 | const actionRestrictionRank = (action: ToolPolicyAction): number => |
| 143 | Match.value(action).pipe( |
| 144 | Match.when("block", () => 3), |
| 145 | Match.when("require_approval", () => 2), |
| 146 | Match.when("approve", () => 1), |
| 147 | Match.exhaustive, |
| 148 | ); |
| 149 | |
| 150 | const moreRestrictive = <T extends { readonly action: ToolPolicyAction }>( |
| 151 | current: T | undefined, |