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

Function policyRulesForSlug

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

getBySlugEntryFunction · 0.85
listPoliciesForRecordFunction · 0.85
listConnectionsForRecordFunction · 0.85

Tested by

no test coverage detected