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

Function resolvePolicyFromRuleSet

packages/core/sdk/src/executor.ts:4162–4180  ·  view source on GitHub ↗
(
      toolId: string,
      ruleSet: ActivePolicyRuleSet,
      defaultRequiresApproval?: boolean,
    )

Source from the content-addressed store, hash-verified

4160 .pipe(Effect.map((rows) => ({ kind: "global" as const, rows })));
4161
4162 const resolvePolicyFromRuleSet = (
4163 toolId: string,
4164 ruleSet: ActivePolicyRuleSet,
4165 defaultRequiresApproval?: boolean,
4166 ): Effect.Effect<EffectivePolicy, StorageFailure> =>
4167 ruleSet.kind === "prepared"
4168 ? Effect.succeed(ruleSet.resolve({ toolId, defaultRequiresApproval }))
4169 : ruleSet.kind === "provider"
4170 ? ruleSet.provider.resolve
4171 ? ruleSet.provider.resolve({ toolId, defaultRequiresApproval })
4172 : Effect.succeed(resolveProviderPolicyFromRules(toolId, ruleSet.rules ?? []))
4173 : Effect.succeed(
4174 resolveEffectivePolicy(
4175 toolId,
4176 ruleSet.rows,
4177 ownerRankForRow,
4178 defaultRequiresApproval,
4179 ),
4180 );
4181
4182 // ------------------------------------------------------------------
4183 // Tools (read surface)

Callers 3

toolsListFunction · 0.85
toolSchemaFunction · 0.85
executeFunction · 0.85

Calls 3

resolveEffectivePolicyFunction · 0.90
resolveMethod · 0.80

Tested by

no test coverage detected