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

Function actionRestrictionRank

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

Source from the content-addressed store, hash-verified

140};
141
142const actionRestrictionRank = (action: ToolPolicyAction): number =>
143 Match.value(action).pipe(
144 Match.when("block", () => 3),
145 Match.when("require_approval", () => 2),
146 Match.when("approve", () => 1),
147 Match.exhaustive,
148 );
149
150const moreRestrictive = <T extends { readonly action: ToolPolicyAction }>(
151 current: T | undefined,

Callers 1

moreRestrictiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected