import {
	type ProviderName,
	type ModelInfo,
	anthropicModels,
	bedrockModels,
	deepSeekModels,
	moonshotModels,
	geminiModels,
	mistralModels,
	openAiNativeModels,
	openAiCodexModels,
	qwenCodeModels,
	vertexModels,
	xaiModels,
	geminiCliModels,
	sambaNovaModels,
	internationalZAiModels,
	fireworksModels,
	minimaxModels,
	mimoModels,
	basetenModels,
	getClaudeCodeModels,
} from "@roo-code/types"

export const MODELS_BY_PROVIDER: Partial<Record<ProviderName, Record<string, ModelInfo>>> = {
	anthropic: anthropicModels,
	"claude-code": getClaudeCodeModels((window as any).ANTHROPIC_MODEL),
	bedrock: bedrockModels,
	deepseek: deepSeekModels,
	moonshot: moonshotModels,
	gemini: geminiModels,
	"gemini-cli": geminiCliModels,
	mistral: mistralModels,
	"openai-native": openAiNativeModels,
	"openai-codex": openAiCodexModels,
	"qwen-code": qwenCodeModels,
	vertex: vertexModels,
	xai: xaiModels,
	sambanova: sambaNovaModels,
	zai: internationalZAiModels,
	fireworks: fireworksModels,
	minimax: minimaxModels,
	mimo: mimoModels,
	baseten: basetenModels,
}

export const PROVIDERS = [
	{ value: "costrict", label: "CoStrict", proxy: false },
	{ value: "gemini-cli", label: "Gemini CLI", proxy: false },
	{ value: "human-relay", label: "Human Relay", proxy: false },
	{ value: "openrouter", label: "OpenRouter", proxy: false },
	{ value: "anthropic", label: "Anthropic", proxy: false },
	{ value: "claude-code", label: "Claude Code", proxy: false },
	{ value: "gemini", label: "Google Gemini", proxy: false },
	{ value: "deepseek", label: "DeepSeek", proxy: false },
	{ value: "moonshot", label: "Moonshot", proxy: false },
	{ value: "openai-native", label: "OpenAI", proxy: false },
	{ value: "openai-codex", label: "OpenAI - ChatGPT Plus/Pro", proxy: false },
	{ value: "openai", label: "OpenAI Compatible", proxy: true },
	{ value: "qwen-code", label: "Qwen Code", proxy: false },
	{ value: "vertex", label: "GCP Vertex AI", proxy: false },
	{ value: "bedrock", label: "Amazon Bedrock", proxy: false },
	{ value: "vscode-lm", label: "VS Code LM API", proxy: false },
	{ value: "mistral", label: "Mistral", proxy: false },
	{ value: "lmstudio", label: "LM Studio", proxy: true },
	{ value: "ollama", label: "Ollama", proxy: true },
	{ value: "requesty", label: "Requesty", proxy: false },
	{ value: "xai", label: "xAI (Grok)", proxy: false },
	{ value: "litellm", label: "LiteLLM", proxy: true },
	{ value: "sambanova", label: "SambaNova", proxy: false },
	{ value: "zai", label: "Z.ai", proxy: false },
	{ value: "fireworks", label: "Fireworks AI", proxy: false },
	// { value: "roo", label: "Roo Code Router", proxy: false },
	{ value: "vercel-ai-gateway", label: "Vercel AI Gateway", proxy: false },
	{ value: "minimax", label: "MiniMax", proxy: false },
	{ value: "mimo", label: "Xiaomi MiMo", proxy: false },
	{ value: "baseten", label: "Baseten", proxy: false },
	{ value: "unbound", label: "Unbound", proxy: false },
	{ value: "poe", label: "Poe", proxy: false },
].sort((a, b) => a.label.localeCompare(b.label))
