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

Function actionRestrictionRank

packages/core/sdk/src/policies.ts:183–189  ·  view source on GitHub ↗
(action: ToolPolicyAction)

Source from the content-addressed store, hash-verified

181};
182
183const 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
191const moreRestrictive = <T extends { readonly action: ToolPolicyAction }>(
192 current: T | undefined,

Callers 1

moreRestrictiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected