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

Function moreRestrictive

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

Source from the content-addressed store, hash-verified

148 );
149
150const 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
160export const resolveToolPolicy = (
161 toolId: string,

Callers 2

resolveToolPolicyFunction · 0.85

Calls 1

actionRestrictionRankFunction · 0.85

Tested by

no test coverage detected