(action: ToolPolicyAction)
| 181 | }; |
| 182 | |
| 183 | const actionRestrictionRank = (action: ToolPolicyAction): number => |
| 184 | Match.value(action).pipe( |
| 185 | Match.when("block", () => 3), |
| 186 | Match.when("require_approval", () => 2), |
| 187 | Match.when("approve", () => 1), |
| 188 | Match.exhaustive, |
| 189 | ); |
| 190 | |
| 191 | const moreRestrictive = <T extends { readonly action: ToolPolicyAction }>( |
| 192 | current: T | undefined, |