MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / moreRestrictive

Function moreRestrictive

packages/core/sdk/src/policies.ts:191–199  ·  view source on GitHub ↗
(
  current: T | undefined,
  candidate: T,
)

Source from the content-addressed store, hash-verified

189 );
190
191const 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
201export const resolveToolPolicy = (
202 toolId: string,

Callers 2

resolveToolPolicyFunction · 0.85

Calls 1

actionRestrictionRankFunction · 0.85

Tested by

no test coverage detected