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

Function integrationsList

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

Source from the content-addressed store, hash-verified

3207 );
3208
3209 const integrationsList = (): Effect.Effect<readonly Integration[], StorageFailure> =>
3210 Effect.gen(function* () {
3211 const rows = yield* core.findMany("integration", {});
3212 const staticIntegrationList = staticIntegrations().map(staticDeclToIntegration);
3213 const dbIntegrations = yield* Effect.forEach(rows, (row) =>
3214 describeAuthMethodsForRow(row).pipe(
3215 Effect.map((authMethods) =>
3216 rowToIntegration(row, authMethods, describeDisplayForRow(row)),
3217 ),
3218 ),
3219 );
3220 // A scoped toolkit must not advertise providers it grants no tools from
3221 // (mirrors `connectionsList`). Static integrations are system namespaces, not
3222 // user providers, so they stay; DB-backed integrations are filtered to
3223 // those that contribute at least one visible tool under the active policy.
3224 if (!activeToolPolicyProvider) return [...staticIntegrationList, ...dbIntegrations];
3225 const visibleTools = yield* toolsList({ includeAnnotations: false });
3226 const visibleIntegrationSlugs = new Set(
3227 visibleTools.filter((tool) => !tool.static).map((tool) => String(tool.integration)),
3228 );
3229 return [
3230 ...staticIntegrationList,
3231 ...dbIntegrations.filter((integration) =>
3232 visibleIntegrationSlugs.has(String(integration.slug)),
3233 ),
3234 ];
3235 });
3236
3237 const integrationsGet = (
3238 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