import type { ProviderCatalog } from "./types.js";

export const PROVIDER_CATALOG: ProviderCatalog = {

  // ── Anthropic ──────────────────────────────────────────────────────────

  anthropic: {
    displayName: "Anthropic",
    protocol: "anthropic",
    defaultUrl: "https://api.anthropic.com",
    apiKeyEnvVar: "ANTHROPIC_API_KEY",
    models: {
      "claude-sonnet-4-5-20250929": {
        displayName: "Claude Sonnet 4.5",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: true,
          maxContextTokens: 200000,
          maxOutputTokens: 8192,
        },
        multimodal: {
          input: ["text", "image", "pdf"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["claude-sonnet-4.5", "claude-3-5-sonnet-20250929"],
      },
      "claude-opus-4-20250514": {
        displayName: "Claude Opus 4",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: true,
          maxContextTokens: 200000,
          maxOutputTokens: 32768,
        },
        multimodal: {
          input: ["text", "image", "pdf"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["claude-opus-4", "claude-opus-4.6"],
      },
      "claude-sonnet-4-20250514": {
        displayName: "Claude Sonnet 4",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: true,
          maxContextTokens: 200000,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image", "pdf"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["claude-sonnet-4"],
      },
      "claude-sonnet-4.6": {
        displayName: "Claude Sonnet 4.6",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: true,
          maxContextTokens: 200000,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image", "pdf"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["claude-sonnet-4-6"],
      },
      "claude-haiku-3-5-20241022": {
        displayName: "Claude 3.5 Haiku",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: true,
          maxContextTokens: 200000,
          maxOutputTokens: 8192,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["claude-3-5-haiku", "claude-3.5-haiku", "claude-haiku-3.5"],
      },
    },
  },

  // ── OpenAI ─────────────────────────────────────────────────────────────

  openai: {
    displayName: "OpenAI",
    protocol: "openai",
    defaultUrl: "https://api.openai.com/v1",
    apiKeyEnvVar: "OPENAI_API_KEY",
    models: {
      "gpt-4o": {
        displayName: "GPT-4o",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 128000,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["gpt-4o-2024-11-20"],
      },
      "gpt-4o-mini": {
        displayName: "GPT-4o Mini",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 128000,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "gpt-4.1": {
        displayName: "GPT-4.1",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1047576,
          maxOutputTokens: 32768,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "gpt-4.1-mini": {
        displayName: "GPT-4.1 Mini",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1047576,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "o3": {
        displayName: "o3",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 200000,
          maxOutputTokens: 100000,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "o3-mini": {
        displayName: "o3 Mini",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 200000,
          maxOutputTokens: 65536,
        },
        multimodal: { input: ["text"] },
        aliases: [],
      },
    },
  },

  // ── DeepSeek ───────────────────────────────────────────────────────────

  deepseek: {
    displayName: "DeepSeek",
    protocol: "openai",
    defaultUrl: "https://api.deepseek.com/v1",
    apiKeyEnvVar: "DEEPSEEK_API_KEY",
    models: {
      "deepseek-chat": {
        displayName: "DeepSeek Chat (V3)",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 65536,
          maxOutputTokens: 8192,
        },
        multimodal: { input: ["text"] },
        aliases: ["deepseek-v3"],
      },
      "deepseek-reasoner": {
        displayName: "DeepSeek Reasoner",
        capabilities: {
          supportsToolUse: false,
          supportsStreaming: true,
          supportsParallelToolCalls: false,
          supportsThinking: true,
          supportsJsonSchema: false,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 65536,
          maxOutputTokens: 8192,
        },
        multimodal: { input: ["text"] },
        aliases: [],
      },
      "deepseek-v4-pro": {
        displayName: "DeepSeek V4 Pro",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 131072,
          maxOutputTokens: 8192,
        },
        multimodal: { input: ["text"] },
        aliases: [],
      },
      "deepseek-v4-flash": {
        displayName: "DeepSeek V4 Flash",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1048576,
          maxOutputTokens: 16384,
        },
        multimodal: { input: ["text"] },
        aliases: [],
      },
    },
  },

  // ── Google / Gemini ────────────────────────────────────────────────────

  google: {
    displayName: "Google AI (Gemini)",
    protocol: "openai",
    defaultUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
    apiKeyEnvVar: "GOOGLE_AI_API_KEY",
    models: {
      "gemini-2.0-flash": {
        displayName: "Gemini 2.0 Flash",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1048576,
          maxOutputTokens: 8192,
        },
        multimodal: {
          input: ["text", "image", "audio", "pdf"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["gemini-2.0-flash-001"],
      },
      "gemini-2.5-flash": {
        displayName: "Gemini 2.5 Flash",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1048576,
          maxOutputTokens: 65536,
        },
        multimodal: {
          input: ["text", "image", "audio", "pdf"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "gemini-2.5-pro": {
        displayName: "Gemini 2.5 Pro",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1048576,
          maxOutputTokens: 65536,
        },
        multimodal: {
          input: ["text", "image", "audio", "pdf"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "gemini-3.1-pro-preview": {
        displayName: "Gemini 3.1 Pro Preview",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1048576,
          maxOutputTokens: 8192,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
    },
  },

  // ── MiniMax ────────────────────────────────────────────────────────────

  minimax: {
    displayName: "MiniMax",
    protocol: "openai",
    defaultUrl: "https://api.minimaxi.com/v1",
    apiKeyEnvVar: "MINIMAX_API_KEY",
    models: {
      "MiniMax-M2.5": {
        displayName: "MiniMax M2.5",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1000000,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["minimax-m2.5"],
      },
      "MiniMax-M2.7-highspeed": {
        displayName: "MiniMax M2.7 Highspeed",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 1000000,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
    },
  },

  // ── Moonshot / Kimi ────────────────────────────────────────────────────

  moonshot: {
    displayName: "Moonshot AI (Kimi)",
    protocol: "openai",
    defaultUrl: "https://api.moonshot.cn/v1",
    apiKeyEnvVar: "MOONSHOT_API_KEY",
    models: {
      "kimi-k2.6": {
        displayName: "Kimi K2.6",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 262144,
          maxOutputTokens: 8192,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 20,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/gif", "image/webp"],
          imageDetail: "auto",
        },
        aliases: ["moonshotai/kimi-k2.6"],
      },
    },
  },

  // ── Volcano Ark (火山方舟) ────────────────────────────────────────────

  volc_ark: {
    displayName: "火山方舟 (Volcano Ark)",
    protocol: "openai",
    defaultUrl: "https://ark.cn-beijing.volces.com/api/v3",
    apiKeyEnvVar: "VOLC_ARK_API_KEY",
    models: {
      "doubao-1.5-pro-256k": {
        displayName: "Doubao 1.5 Pro 256K",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 262144,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 10,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "doubao-1.5-pro": {
        displayName: "Doubao 1.5 Pro",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 131072,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text", "image"],
          maxImagesPerRequest: 10,
          supportedImageMimeTypes: ["image/jpeg", "image/png", "image/webp"],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "doubao-1.5-lite-128k": {
        displayName: "Doubao 1.5 Lite 128K",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 131072,
          maxOutputTokens: 8192,
        },
        multimodal: {
          input: ["text"],
          maxImagesPerRequest: 0,
          supportedImageMimeTypes: [],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "doubao-1.5-lite": {
        displayName: "Doubao 1.5 Lite",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: false,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 32768,
          maxOutputTokens: 8192,
        },
        multimodal: {
          input: ["text"],
          maxImagesPerRequest: 0,
          supportedImageMimeTypes: [],
          imageDetail: "auto",
        },
        aliases: [],
      },
      "deepseek-r1": {
        displayName: "DeepSeek R1 (Volc)",
        capabilities: {
          supportsToolUse: true,
          supportsStreaming: true,
          supportsParallelToolCalls: true,
          supportsThinking: true,
          supportsJsonSchema: true,
          supportsSystemPrompt: true,
          supportsPromptCache: false,
          maxContextTokens: 65536,
          maxOutputTokens: 16384,
        },
        multimodal: {
          input: ["text"],
          maxImagesPerRequest: 0,
          supportedImageMimeTypes: [],
          imageDetail: "auto",
        },
        aliases: [],
      },
    },
  },

  // ── Proxy providers (no built-in models; use cross-provider lookup) ───

  openrouter: {
    displayName: "OpenRouter",
    protocol: "openai",
    defaultUrl: "https://openrouter.ai/api/v1",
    apiKeyEnvVar: "OPENROUTER_API_KEY",
    models: {},
  },

};
