( current: T | undefined, candidate: T, )
| 148 | ); |
| 149 | |
| 150 | const moreRestrictive = <T extends { readonly action: ToolPolicyAction }>( |
| 151 | current: T | undefined, |
| 152 | candidate: T, |
| 153 | ): T => { |
| 154 | if (!current) return candidate; |
| 155 | const currentRank = actionRestrictionRank(current.action); |
| 156 | const candidateRank = actionRestrictionRank(candidate.action); |
| 157 | return candidateRank > currentRank ? candidate : current; |
| 158 | }; |
| 159 | |
| 160 | export const resolveToolPolicy = ( |
| 161 | toolId: string, |
no test coverage detected