import { a as buildProviderToolCompatFamilyHooks } from "../../provider-tools-DxDJl3Ax.js";
import { t as definePluginEntry } from "../../plugin-entry-T5k9rMXF.js";
import { r as resolvePluginConfigObject } from "../../plugin-config-runtime-cFiswWnd.js";
import { t as buildOpenAICodexCliBackend } from "../../cli-backend-EJ8x8SW0.js";
import { t as buildOpenAIImageGenerationProvider } from "../../image-generation-provider-CjyWeGvW.js";
import { n as openaiMediaUnderstandingProvider, t as openaiCodexMediaUnderstandingProvider } from "../../media-understanding-provider-BiBtBPC1.js";
import { t as openAiMemoryEmbeddingProviderAdapter } from "../../memory-embedding-adapter-wNrHh93Q.js";
import { t as buildOpenAICodexProviderPlugin } from "../../openai-codex-provider-BTZ1zho2.js";
import { t as buildOpenAIProvider } from "../../openai-provider-B7Je6Chr.js";
import { a as resolveOpenAISystemPromptContribution, i as resolveOpenAIPromptOverlayMode } from "../../prompt-overlay-B1j_HurC.js";
import { t as buildOpenAIRealtimeTranscriptionProvider } from "../../realtime-transcription-provider-CH3sQBYX.js";
import { t as buildOpenAIRealtimeVoiceProvider } from "../../realtime-voice-provider-CBDDKmry.js";
import { t as buildOpenAISpeechProvider } from "../../speech-provider-LIZC2J3e.js";
import { t as buildOpenAIVideoGenerationProvider } from "../../video-generation-provider-DWV7DZg1.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 };
