import { a as buildProviderToolCompatFamilyHooks } from "../../provider-tools-BlfPeoDj.js";
import { t as definePluginEntry } from "../../plugin-entry-ieJOYYXv.js";
import { r as resolvePluginConfigObject } from "../../plugin-config-runtime-D2CjQ0_S.js";
import { t as buildOpenAICodexCliBackend } from "../../cli-backend-CBM4LY1Z.js";
import { t as buildOpenAIImageGenerationProvider } from "../../image-generation-provider-Cb_R3DSg.js";
import { n as openaiMediaUnderstandingProvider, t as openaiCodexMediaUnderstandingProvider } from "../../media-understanding-provider-o3ncSHYp.js";
import { t as openAiMemoryEmbeddingProviderAdapter } from "../../memory-embedding-adapter-CimLvt4_.js";
import { t as buildOpenAICodexProviderPlugin } from "../../openai-codex-provider-DykI82AI.js";
import { t as buildOpenAIProvider } from "../../openai-provider-C9uDRjiG.js";
import { a as resolveOpenAISystemPromptContribution, i as resolveOpenAIPromptOverlayMode } from "../../prompt-overlay-C8QXYWWj.js";
import { t as buildOpenAIRealtimeTranscriptionProvider } from "../../realtime-transcription-provider-Bp1El6ZD.js";
import { t as buildOpenAIRealtimeVoiceProvider } from "../../realtime-voice-provider-NXfEEJcD.js";
import { t as buildOpenAISpeechProvider } from "../../speech-provider-8P3FZ54T.js";
import { t as buildOpenAIVideoGenerationProvider } from "../../video-generation-provider-CjNPEMZs.js";
//#region extensions/openai/index.ts
var openai_default = definePluginEntry({
	id: "openai",
	name: "OpenAI Provider",
	description: "Bundled OpenAI provider plugins",
	register(api) {
		const openAIToolCompatHooks = buildProviderToolCompatFamilyHooks("openai");
		const buildProviderWithPromptContribution = (provider) => ({
			...provider,
			...openAIToolCompatHooks,
			resolveSystemPromptContribution: (ctx) => {
				const pluginConfig = resolvePluginConfigObject(ctx.config, "openai") ?? (ctx.config ? void 0 : api.pluginConfig);
				return resolveOpenAISystemPromptContribution({
					config: ctx.config,
					legacyPluginConfig: pluginConfig,
					mode: resolveOpenAIPromptOverlayMode(pluginConfig),
					modelProviderId: provider.id,
					modelId: ctx.modelId,
					trigger: ctx.trigger
				});
			}
		});
		api.registerCliBackend(buildOpenAICodexCliBackend());
		api.registerProvider(buildProviderWithPromptContribution(buildOpenAIProvider()));
		api.registerProvider(buildProviderWithPromptContribution(buildOpenAICodexProviderPlugin()));
		api.registerMemoryEmbeddingProvider(openAiMemoryEmbeddingProviderAdapter);
		api.registerImageGenerationProvider(buildOpenAIImageGenerationProvider());
		api.registerRealtimeTranscriptionProvider(buildOpenAIRealtimeTranscriptionProvider());
		api.registerRealtimeVoiceProvider(buildOpenAIRealtimeVoiceProvider());
		api.registerSpeechProvider(buildOpenAISpeechProvider());
		api.registerMediaUnderstandingProvider(openaiMediaUnderstandingProvider);
		api.registerMediaUnderstandingProvider(openaiCodexMediaUnderstandingProvider);
		api.registerVideoGenerationProvider(buildOpenAIVideoGenerationProvider());
	}
});
//#endregion
export { openai_default as default };
