import { createLogger } from "../../../utils/logger/index.js";
import { init_logger } from "../../../utils/logger.js";
import { registerImageGenerationProvider } from "./provider-registry.js";
//#region src/agent/image/generation/bundled-registry.ts
init_logger();
const log = createLogger("ImageGen:Bundled");
/**
* Register every bundled provider factory exactly once. Failures in a single
* factory are isolated so one broken vendor does not knock out the rest.
*/
function registerBundledImageGenerationProviders(factories) {
	for (const factory of factories) {
		let provider;
		try {
			provider = factory();
		} catch (err) {
			log.warn({
				err,
				phase: "factory_invoke"
			}, `Skipping bundled image-generation provider factory: ${err instanceof Error ? err.message : String(err)}`);
			continue;
		}
		try {
			registerImageGenerationProvider(provider);
		} catch (err) {
			log.warn({
				err,
				providerId: provider?.id,
				phase: "register"
			}, `Failed to register bundled image-generation provider: ${err instanceof Error ? err.message : String(err)}`);
		}
	}
}
//#endregion
export { registerBundledImageGenerationProviders };

//# sourceMappingURL=bundled-registry.js.map