( current: T | undefined, candidate: T, )
| 189 | ); |
| 190 | |
| 191 | const moreRestrictive = <T extends { readonly action: ToolPolicyAction }>( |
| 192 | current: T | undefined, |
| 193 | candidate: T, |
| 194 | ): T => { |
| 195 | if (!current) return candidate; |
| 196 | const currentRank = actionRestrictionRank(current.action); |
| 197 | const candidateRank = actionRestrictionRank(candidate.action); |
| 198 | return candidateRank > currentRank ? candidate : current; |
| 199 | }; |
| 200 | |
| 201 | export const resolveToolPolicy = ( |
| 202 | toolId: string, |
no test coverage detected