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

Function integrationsList

packages/core/sdk/src/executor.ts:2818–2840  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2816 );
2817
2818 const integrationsList = (): Effect.Effect<readonly Integration[], StorageFailure> =>
2819 Effect.gen(function* () {
2820 const rows = yield* core.findMany("integration", {});
2821 const staticIntegrationList = staticIntegrations().map(staticDeclToIntegration);
2822 const dbIntegrations = rows.map((row) =>
2823 rowToIntegration(row, describeAuthMethodsForRow(row), describeDisplayForRow(row)),
2824 );
2825 // A scoped toolkit must not advertise providers it grants no tools from
2826 // (mirrors `connectionsList`). Static integrations are system namespaces, not
2827 // user providers, so they stay; DB-backed integrations are filtered to
2828 // those that contribute at least one visible tool under the active policy.
2829 if (!activeToolPolicyProvider) return [...staticIntegrationList, ...dbIntegrations];
2830 const visibleTools = yield* toolsList({ includeAnnotations: false });
2831 const visibleIntegrationSlugs = new Set(
2832 visibleTools.filter((tool) => !tool.static).map((tool) => String(tool.integration)),
2833 );
2834 return [
2835 ...staticIntegrationList,
2836 ...dbIntegrations.filter((integration) =>
2837 visibleIntegrationSlugs.has(String(integration.slug)),
2838 ),
2839 ];
2840 });
2841
2842 const integrationsGet = (
2843 slug: IntegrationSlug,

Callers 1

createExecutorFunction · 0.85

Calls 5

staticIntegrationsFunction · 0.85
rowToIntegrationFunction · 0.85
describeDisplayForRowFunction · 0.85
toolsListFunction · 0.70

Tested by

no test coverage detected