refactor: route bundled capability providers through plugin runtime

This commit is contained in:
Peter Steinberger
2026-03-27 13:57:45 +00:00
parent 8d054e7892
commit f1503bd5c7
5 changed files with 26 additions and 56 deletions

View File

@@ -1,4 +1,3 @@
import { listBundledImageGenerationProviderEntries } from "../../bundled-image-generation-providers.js";
import {
BUNDLED_IMAGE_GENERATION_PLUGIN_IDS,
BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS,
@@ -226,10 +225,16 @@ function loadMediaUnderstandingProviderContractRegistry(): MediaUnderstandingPro
function loadImageGenerationProviderContractRegistry(): ImageGenerationProviderContractEntry[] {
if (!imageGenerationProviderContractRegistryCache) {
imageGenerationProviderContractRegistryCache =
listBundledImageGenerationProviderEntries().filter((entry) =>
BUNDLED_IMAGE_GENERATION_PLUGIN_IDS.includes(entry.pluginId),
);
const registry = loadBundledCapabilityRuntimeRegistry({
pluginIds: BUNDLED_IMAGE_GENERATION_PLUGIN_IDS,
pluginSdkResolution: "dist",
});
imageGenerationProviderContractRegistryCache = registry.imageGenerationProviders.map(
(entry) => ({
pluginId: entry.pluginId,
provider: entry.provider,
}),
);
}
return imageGenerationProviderContractRegistryCache;
}