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

Function policyRulesForSlug

packages/plugins/toolkits/src/server.ts:480–497  ·  view source on GitHub ↗
(
    slug: string,
  )

Source from the content-addressed store, hash-verified

478 });
479
480 const policyRulesForSlug = (
481 slug: string,
482 ): Effect.Effect<readonly ToolPolicyProviderRule[], StorageFailure> =>
483 Effect.gen(function* () {
484 const toolkit = yield* getBySlugEntry(slug);
485 if (!toolkit) return [];
486 const policies = yield* listPoliciesForRecord(toolkit.data.id);
487 const connections = yield* listConnectionsForRecord(toolkit.data.id);
488 const legacyPolicyIds = legacyConnectionPolicyIds(policies, connections);
489 return policies
490 .filter((policy) => !legacyPolicyIds.has(policy.id))
491 .map((policy) => ({
492 id: policy.id,
493 pattern: policy.pattern,
494 action: policy.action,
495 position: policy.position,
496 }));
497 });
498
499 const resolvePolicyForSlug = (
500 slug: string,

Callers

nothing calls this directly

Calls 4

getBySlugEntryFunction · 0.85
listPoliciesForRecordFunction · 0.85
listConnectionsForRecordFunction · 0.85

Tested by

no test coverage detected