()
| 2250 | ); |
| 2251 | |
| 2252 | const integrationsList = (): Effect.Effect<readonly Integration[], StorageFailure> => |
| 2253 | Effect.gen(function* () { |
| 2254 | const rows = yield* core.findMany("integration", {}); |
| 2255 | const staticIntegrationList = staticIntegrations().map(staticDeclToIntegration); |
| 2256 | const dbIntegrations = rows.map((row) => |
| 2257 | rowToIntegration(row, describeAuthMethodsForRow(row), describeDisplayForRow(row)), |
| 2258 | ); |
| 2259 | // A scoped toolkit must not advertise providers it grants no tools from |
| 2260 | // (mirrors `connectionsList`). Static integrations are system namespaces, not |
| 2261 | // user providers, so they stay; DB-backed integrations are filtered to |
| 2262 | // those that contribute at least one visible tool under the active policy. |
| 2263 | if (!activeToolPolicyProvider) return [...staticIntegrationList, ...dbIntegrations]; |
| 2264 | const visibleTools = yield* toolsList({ includeAnnotations: false }); |
| 2265 | const visibleIntegrationSlugs = new Set( |
| 2266 | visibleTools.filter((tool) => !tool.static).map((tool) => String(tool.integration)), |
| 2267 | ); |
| 2268 | return [ |
| 2269 | ...staticIntegrationList, |
| 2270 | ...dbIntegrations.filter((integration) => |
| 2271 | visibleIntegrationSlugs.has(String(integration.slug)), |
| 2272 | ), |
| 2273 | ]; |
| 2274 | }); |
| 2275 | |
| 2276 | const integrationsGet = ( |
| 2277 | slug: IntegrationSlug, |
no test coverage detected