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

Function integrationsList

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

Source from the content-addressed store, hash-verified

2296 );
2297
2298 const integrationsList = (): Effect.Effect<readonly Integration[], StorageFailure> =>
2299 Effect.gen(function* () {
2300 const rows = yield* core.findMany("integration", {});
2301 const staticIntegrationList = staticIntegrations().map(staticDeclToIntegration);
2302 const dbIntegrations = rows.map((row) =>
2303 rowToIntegration(row, describeAuthMethodsForRow(row), describeDisplayForRow(row)),
2304 );
2305 // A scoped toolkit must not advertise providers it grants no tools from
2306 // (mirrors `connectionsList`). Static integrations are system namespaces, not
2307 // user providers, so they stay; DB-backed integrations are filtered to
2308 // those that contribute at least one visible tool under the active policy.
2309 if (!activeToolPolicyProvider) return [...staticIntegrationList, ...dbIntegrations];
2310 const visibleTools = yield* toolsList({ includeAnnotations: false });
2311 const visibleIntegrationSlugs = new Set(
2312 visibleTools.filter((tool) => !tool.static).map((tool) => String(tool.integration)),
2313 );
2314 return [
2315 ...staticIntegrationList,
2316 ...dbIntegrations.filter((integration) =>
2317 visibleIntegrationSlugs.has(String(integration.slug)),
2318 ),
2319 ];
2320 });
2321
2322 const integrationsGet = (
2323 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