/**
 * Centralized Model Definitions
 * Single source of truth for all supported AI models
 */

/**
 * Claude (Anthropic) Models
 *
 * Note: Claude uses two different formats:
 * - SDK format ('sonnet', 'opus') - used by the UI and claude-sdk.js
 * - API format ('claude-sonnet-4.5') - used by slash commands for display
 */
export const CLAUDE_MODELS = {
  OPTIONS: [
    { value: "Main", label: "Main (auto router)" },
    { value: "cc/claude-opus-4-7", label: "Opus 4.7 (cc)" },
    { value: "cc/claude-opus-4-6", label: "Opus 4.6 (cc)" },
    { value: "cc/claude-sonnet-4-6", label: "Sonnet 4.6 (cc)" },
    { value: "cc/claude-opus-4-5-20251101", label: "Opus 4.5 (cc)" },
    { value: "cc/claude-sonnet-4-5-20250929", label: "Sonnet 4.5 (cc)" },
    { value: "cc/claude-haiku-4-5-20251001", label: "Haiku 4.5 (cc)" },
    { value: "kr/claude-sonnet-4.5", label: "Sonnet 4.5 (kr)" },
    { value: "kr/claude-haiku-4.5", label: "Haiku 4.5 (kr)" },
    { value: "kr/deepseek-3.2", label: "DeepSeek 3.2 (kr)" },
    { value: "kr/qwen3-coder-next", label: "Qwen3 Coder Next (kr)" },
    { value: "kr/glm-5", label: "GLM-5 (kr)" },
    { value: "kr/MiniMax-M2.5", label: "MiniMax M2.5 (kr)" },
    { value: "kr/claude-sonnet-4.5-thinking", label: "Sonnet 4.5 Thinking (kr)" },
    { value: "kr/claude-haiku-4.5-thinking", label: "Haiku 4.5 Thinking (kr)" },
    { value: "kr/claude-sonnet-4.5-agentic", label: "Sonnet 4.5 Agentic (kr)" },
    { value: "kr/claude-haiku-4.5-agentic", label: "Haiku 4.5 Agentic (kr)" },
    { value: "kr/claude-sonnet-4.5-thinking-agentic", label: "Sonnet 4.5 Think+Agent (kr)" },
    { value: "kr/claude-haiku-4.5-thinking-agentic", label: "Haiku 4.5 Think+Agent (kr)" },
    { value: "openrouter/nvidia/nemotron-3-nano-30b-a3b:free", label: "Nemotron Nano 30B" },
    { value: "openrouter/openrouter/owl-alpha", label: "Owl Alpha" },
    { value: "openrouter/nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free", label: "Nemotron Omni 30B" },
    { value: "openrouter/nvidia/nemotron-3-super-120b-a12b:free", label: "Nemotron Super 120B" },
    { value: "openrouter/google/gemma-4-26b-a4b-it:free", label: "Gemma 4 26B (free)" },
    { value: "openrouter/arcee-ai/trinity-large-thinking:free", label: "Trinity Large Thinking" },
    { value: "nvidia/parakeet-ctc-1.1b-asr", label: "Parakeet ASR (nvidia)" },
    { value: "nvidia/deepseek-ai/deepseek-v4-flash", label: "DeepSeek V4 Flash (nvidia)" },
    { value: "nvidia/z-ai/glm-5.1", label: "GLM-5.1 (nvidia)" },
    { value: "nvidia/moonshotai/kimi-k2.6", label: "Kimi K2.6 (nvidia)" },
    { value: "ollama/gpt-oss:120b", label: "GPT OSS 120B (ollama)" },
    { value: "ollama/kimi-k2.5", label: "Kimi K2.5 (ollama)" },
    { value: "ollama/glm-5", label: "GLM-5 (ollama)" },
    { value: "ollama/minimax-m2.5", label: "MiniMax M2.5 (ollama)" },
    { value: "ollama/glm-4.7-flash", label: "GLM-4.7 Flash (ollama)" },
    { value: "ollama/qwen3.5", label: "Qwen 3.5 (ollama)" },
    { value: "ollama-local/r1-14b-32k", label: "R1 14B 32K (local)" },
    { value: "gemini/gemini-3.1-pro-preview", label: "Gemini 3.1 Pro Preview" },
    { value: "gemini/gemini-3.1-flash-lite-preview", label: "Gemini 3.1 Flash Lite" },
    { value: "gemini/gemini-3-flash-preview", label: "Gemini 3 Flash Preview" },
    { value: "gemini/gemini-2.0-flash-lite", label: "Gemini 2.0 Flash Lite" },
    { value: "gemini/gemma-4-31b-it", label: "Gemma 4 31B" },
    { value: "ds/deepseek-v4-pro", label: "DeepSeek V4 Pro (ds)" },
    { value: "ds/deepseek-v4-pro-max", label: "DeepSeek V4 Pro Max (ds)" },
    { value: "ds/deepseek-v4-pro-none", label: "DeepSeek V4 Pro None (ds)" },
    { value: "ds/deepseek-v4-flash", label: "DeepSeek V4 Flash (ds)" },
    { value: "ds/deepseek-chat", label: "DeepSeek Chat (ds)" },
    { value: "ds/deepseek-reasoner", label: "DeepSeek Reasoner (ds)" },
    { value: "cx/gpt-5.5", label: "GPT-5.5 (cx)" },
    { value: "cx/gpt-5.5-review", label: "GPT-5.5 Review (cx)" },
    { value: "cx/gpt-5.4", label: "GPT-5.4 (cx)" },
    { value: "cx/gpt-5.4-review", label: "GPT-5.4 Review (cx)" },
    { value: "cx/gpt-5.3-codex", label: "GPT-5.3 Codex (cx)" },
    { value: "cx/gpt-5.3-codex-review", label: "GPT-5.3 Codex Review (cx)" },
    { value: "cl/anthropic/claude-opus-4.7", label: "Opus 4.7 (cl)" },
    { value: "cl/anthropic/claude-sonnet-4.6", label: "Sonnet 4.6 (cl)" },
    { value: "cl/anthropic/claude-opus-4.6", label: "Opus 4.6 (cl)" },
    { value: "cl/openai/gpt-5.3-codex", label: "GPT-5.3 Codex (cl)" },
    { value: "cl/openai/gpt-5.4", label: "GPT-5.4 (cl)" },
    { value: "cl/google/gemini-3.1-pro-preview", label: "Gemini 3.1 Pro (cl)" },
    { value: "cl/google/gemini-3.1-flash-lite-preview", label: "Gemini 3.1 Flash Lite (cl)" },
    { value: "cl/kwaipilot/kat-coder-pro", label: "KAT Coder Pro (cl)" },
    { value: "mistral/mistral-large-latest", label: "Mistral Large" },
    { value: "mistral/codestral-latest", label: "Codestral" },
    { value: "mistral/mistral-medium-latest", label: "Mistral Medium" },
    { value: "jinx/kiro-claude-sonnet-4-5", label: "Kiro Sonnet 4.5 (jinx)" },
    { value: "jinx/kiro-auto", label: "Kiro Auto (jinx)" },
    { value: "jinx/kiro-claude-sonnet-4-5-agentic", label: "Kiro Sonnet 4.5 Agentic (jinx)" },
    { value: "jinx/kiro-qwen3-coder-next-agentic", label: "Kiro Qwen3 Coder Agentic (jinx)" },
    { value: "jinx/kiro-claude-sonnet-4", label: "Kiro Sonnet 4 (jinx)" },
    { value: "jinx/kiro-glm-5-agentic", label: "Kiro GLM-5 Agentic (jinx)" },
    { value: "jinx/kiro-minimax-m2-1-agentic", label: "Kiro MiniMax M2.1 Agentic (jinx)" },
    { value: "jinx/kiro-deepseek-3-2", label: "Kiro DeepSeek 3.2 (jinx)" },
    { value: "jinx/kiro-glm-5", label: "Kiro GLM-5 (jinx)" },
    { value: "jinx/claude-haiku-4-5-20251001", label: "Haiku 4.5 (jinx)" },
    { value: "jinx/kiro-minimax-m2-5-agentic", label: "Kiro MiniMax M2.5 Agentic (jinx)" },
    { value: "jinx/claude-sonnet-4-5-20250929", label: "Sonnet 4.5 (jinx)" },
    { value: "jinx/kiro-claude-haiku-4-5-agentic", label: "Kiro Haiku 4.5 Agentic (jinx)" },
    { value: "jinx/kiro-deepseek-3-2-agentic", label: "Kiro DeepSeek 3.2 Agentic (jinx)" },
    { value: "jinx/kiro-minimax-m2-5", label: "Kiro MiniMax M2.5 (jinx)" },
    { value: "jinx/claude-sonnet-4-20250514", label: "Sonnet 4 (jinx)" },
    { value: "jinx/kiro-minimax-m2-1", label: "Kiro MiniMax M2.1 (jinx)" },
    { value: "jinx/kiro-claude-haiku-4-5", label: "Kiro Haiku 4.5 (jinx)" },
    { value: "jinx/claude-haiku-4-5", label: "Haiku 4.5 (jinx)" },
    { value: "ag/gemini-3.1-pro-high", label: "Gemini 3.1 Pro High (ag)" },
    { value: "ag/gemini-3.1-pro-low", label: "Gemini 3.1 Pro Low (ag)" },
    { value: "ag/gemini-3-flash", label: "Gemini 3 Flash (ag)" },
    { value: "ag/claude-opus-4-6-thinking", label: "Opus 4.6 Thinking (ag)" },
    { value: "ag/gpt-oss-120b-medium", label: "GPT OSS 120B Medium (ag)" },
  ],
  DEFAULT: "cc/claude-sonnet-4-6",
};

/**
 * Cursor Models
 */
export const CURSOR_MODELS = {
  OPTIONS: [
    { value: "opus-4.6-thinking", label: "Claude 4.6 Opus (Thinking)" },
    { value: "gpt-5.3-codex", label: "GPT-5.3" },
    { value: "gpt-5.2-high", label: "GPT-5.2 High" },
    { value: "gemini-3-pro", label: "Gemini 3 Pro" },
    { value: "opus-4.5-thinking", label: "Claude 4.5 Opus (Thinking)" },
    { value: "gpt-5.2", label: "GPT-5.2" },
    { value: "gpt-5.1", label: "GPT-5.1" },
    { value: "gpt-5.1-high", label: "GPT-5.1 High" },
    { value: "composer-1", label: "Composer 1" },
    { value: "auto", label: "Auto" },
    { value: "sonnet-4.5", label: "Claude 4.5 Sonnet" },
    { value: "sonnet-4.5-thinking", label: "Claude 4.5 Sonnet (Thinking)" },
    { value: "opus-4.5", label: "Claude 4.5 Opus" },
    { value: "gpt-5.1-codex", label: "GPT-5.1 Codex" },
    { value: "gpt-5.1-codex-high", label: "GPT-5.1 Codex High" },
    { value: "gpt-5.1-codex-max", label: "GPT-5.1 Codex Max" },
    { value: "gpt-5.1-codex-max-high", label: "GPT-5.1 Codex Max High" },
    { value: "opus-4.1", label: "Claude 4.1 Opus" },
    { value: "grok", label: "Grok" },
  ],

  DEFAULT: "gpt-5.3-codex",
};

/**
 * Codex (OpenAI) Models
 */
export const CODEX_MODELS = {
  OPTIONS: [
    { value: "gpt-5.5", label: "GPT-5.5" },
    { value: "gpt-5.4", label: "GPT-5.4" },
    { value: "gpt-5.4-mini", label: "GPT-5.4 mini" },
    { value: "gpt-5.3-codex", label: "GPT-5.3 Codex" },
    { value: "gpt-5.2-codex", label: "GPT-5.2 Codex" },
    { value: "gpt-5.2", label: "GPT-5.2" },
    { value: "gpt-5.1-codex-max", label: "GPT-5.1 Codex Max" },
    { value: "o3", label: "O3" },
    { value: "o4-mini", label: "O4-mini" },
  ],

  DEFAULT: "gpt-5.4",
};

/**
 * Gemini Models
 */
export const GEMINI_MODELS = {
  OPTIONS: [
    { value: "gemini-3.1-pro-preview", label: "Gemini 3.1 Pro Preview" },
    { value: "gemini-3-pro-preview", label: "Gemini 3 Pro Preview" },
    { value: "gemini-3-flash-preview", label: "Gemini 3 Flash Preview" },
    { value: "gemini-2.5-flash", label: "Gemini 2.5 Flash" },
    { value: "gemini-2.5-pro", label: "Gemini 2.5 Pro" },
    { value: "gemini-2.0-flash-lite", label: "Gemini 2.0 Flash Lite" },
    { value: "gemini-2.5-flash-lite", label: "Gemini 2.5 Flash Lite" },
    { value: "gemini-2.0-flash", label: "Gemini 2.0 Flash" },
    { value: "gemini-2.0-pro-exp", label: "Gemini 2.0 Pro Experimental" },
    {
      value: "gemini-2.0-flash-thinking-exp",
      label: "Gemini 2.0 Flash Thinking",
    },
  ],

  DEFAULT: "gemini-3.1-pro-preview",
};

/**
 * Ordered provider registry. Display order in selection UIs.
 */
export const PROVIDERS = [
  { id: "claude", name: "Anthropic", models: CLAUDE_MODELS },
  { id: "codex", name: "OpenAI", models: CODEX_MODELS },
  { id: "gemini", name: "Google", models: GEMINI_MODELS },
  { id: "cursor", name: "Cursor", models: CURSOR_MODELS },
];
