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