feat(core): map providers to integrations (#33562)

This commit is contained in:
Dax
2026-06-24 00:53:31 +00:00
committed by GitHub
parent c556bddda3
commit 4898263dec
8 changed files with 202 additions and 141 deletions
+2 -2
View File
@@ -73,7 +73,7 @@ export const layer = Layer.effect(
if (provider.disabled) return false
if (typeof provider.request.body.apiKey === "string") return true
if (integration?.connections.length) return true
return !integration
return provider.integrationID === undefined && !integration
}
const projectModel = (model: ModelV2.Info, provider: ProviderV2.Info) => {
@@ -184,7 +184,7 @@ export const layer = Layer.effect(
available: Effect.fn("CatalogV2.provider.available")(function* () {
const active = new Map((yield* integrations.list()).map((integration) => [integration.id, integration]))
return (yield* result.provider.all()).filter((provider) =>
available(provider, active.get(Integration.ID.make(provider.id))),
available(provider, active.get(provider.integrationID ?? Integration.ID.make(provider.id))),
)
}),
},