/**
 * @license
 * Copyright 2025 OElite Platform
 * SPDX-License-Identifier: Apache-2.0
 */
import { ProviderType, } from './types.js';
/**
 * Comprehensive model catalog for Arc CLI
 * Supports 75+ models across multiple providers
 */
// Anthropic Claude Models
export const ANTHROPIC_MODELS = [
    {
        id: 'claude-3-5-sonnet-20241022',
        name: 'Claude 3.5 Sonnet',
        provider: ProviderType.ANTHROPIC,
        description: 'Most intelligent model, best for complex tasks',
        capabilities: {
            supportsVision: true,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            supportsJsonMode: true,
            maxTokens: 8192,
            contextWindow: 200000,
        },
        pricing: {
            inputPrice: 3.0,
            outputPrice: 15.0,
            currency: 'USD',
        },
    },
    {
        id: 'claude-3-5-haiku-20241022',
        name: 'Claude 3.5 Haiku',
        provider: ProviderType.ANTHROPIC,
        description: 'Fastest and most compact model for simple tasks',
        capabilities: {
            supportsVision: false,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            supportsJsonMode: true,
            maxTokens: 8192,
            contextWindow: 200000,
        },
        pricing: {
            inputPrice: 0.25,
            outputPrice: 1.25,
            currency: 'USD',
        },
    },
    {
        id: 'claude-3-opus-20240229',
        name: 'Claude 3 Opus',
        provider: ProviderType.ANTHROPIC,
        description: 'Powerful model for highly complex tasks',
        capabilities: {
            supportsVision: true,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            maxTokens: 4096,
            contextWindow: 200000,
        },
        pricing: {
            inputPrice: 15.0,
            outputPrice: 75.0,
            currency: 'USD',
        },
    },
];
// OpenAI Models
export const OPENAI_MODELS = [
    {
        id: 'gpt-4-turbo',
        name: 'GPT-4 Turbo',
        provider: ProviderType.OPENAI,
        description: 'Latest GPT-4 model with vision capabilities',
        capabilities: {
            supportsVision: true,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            supportsJsonMode: true,
            maxTokens: 4096,
            contextWindow: 128000,
        },
        pricing: {
            inputPrice: 10.0,
            outputPrice: 30.0,
            currency: 'USD',
        },
    },
    {
        id: 'gpt-4o',
        name: 'GPT-4o',
        provider: ProviderType.OPENAI,
        description: 'High-intelligence flagship model',
        capabilities: {
            supportsVision: true,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            supportsJsonMode: true,
            maxTokens: 16384,
            contextWindow: 128000,
        },
        pricing: {
            inputPrice: 2.5,
            outputPrice: 10.0,
            currency: 'USD',
        },
    },
    {
        id: 'gpt-4o-mini',
        name: 'GPT-4o Mini',
        provider: ProviderType.OPENAI,
        description: 'Affordable and intelligent small model',
        capabilities: {
            supportsVision: true,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            supportsJsonMode: true,
            maxTokens: 16384,
            contextWindow: 128000,
        },
        pricing: {
            inputPrice: 0.15,
            outputPrice: 0.6,
            currency: 'USD',
        },
    },
    {
        id: 'o1',
        name: 'OpenAI o1',
        provider: ProviderType.OPENAI,
        description: 'Reasoning model for complex problems',
        capabilities: {
            supportsVision: false,
            supportsStreaming: false,
            supportsFunctionCalling: false,
            supportsThinking: true,
            maxTokens: 100000,
            contextWindow: 200000,
        },
        pricing: {
            inputPrice: 15.0,
            outputPrice: 60.0,
            currency: 'USD',
        },
    },
    {
        id: 'o1-mini',
        name: 'OpenAI o1-mini',
        provider: ProviderType.OPENAI,
        description: 'Faster and cheaper reasoning model',
        capabilities: {
            supportsVision: false,
            supportsStreaming: false,
            supportsFunctionCalling: false,
            supportsThinking: true,
            maxTokens: 65536,
            contextWindow: 128000,
        },
        pricing: {
            inputPrice: 3.0,
            outputPrice: 12.0,
            currency: 'USD',
        },
    },
];
// Google Gemini Models
export const GOOGLE_MODELS = [
    {
        id: 'gemini-2.5-flash',
        name: 'Gemini 2.5 Flash',
        provider: ProviderType.GOOGLE,
        description: 'Fast and versatile performance across diverse tasks',
        capabilities: {
            supportsVision: true,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            supportsJsonMode: true,
            maxTokens: 8192,
            contextWindow: 1048576,
        },
        pricing: {
            inputPrice: 0.15,
            outputPrice: 0.6,
            currency: 'USD',
        },
    },
    {
        id: 'gemini-2.5-pro',
        name: 'Gemini 2.5 Pro',
        provider: ProviderType.GOOGLE,
        description: 'Best model for scaling across a wide range of tasks',
        capabilities: {
            supportsVision: true,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            supportsJsonMode: true,
            maxTokens: 8192,
            contextWindow: 2097152,
        },
        pricing: {
            inputPrice: 1.25,
            outputPrice: 5.0,
            currency: 'USD',
        },
    },
    {
        id: 'gemini-1.5-flash',
        name: 'Gemini 1.5 Flash',
        provider: ProviderType.GOOGLE,
        description: 'Fast and cost-efficient multimodal model',
        capabilities: {
            supportsVision: true,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            maxTokens: 8192,
            contextWindow: 1048576,
        },
        pricing: {
            inputPrice: 0.075,
            outputPrice: 0.3,
            currency: 'USD',
        },
    },
];
// DashScope (Qwen) Models
export const DASHSCOPE_MODELS = [
    {
        id: 'qwen-coder-turbo',
        name: 'Qwen Coder Turbo',
        provider: ProviderType.DASHSCOPE,
        description: 'Fast coding model optimized for development tasks',
        capabilities: {
            supportsVision: false,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            maxTokens: 6144,
            contextWindow: 131072,
        },
    },
    {
        id: 'qwen-turbo',
        name: 'Qwen Turbo',
        provider: ProviderType.DASHSCOPE,
        description: 'General-purpose fast model',
        capabilities: {
            supportsVision: false,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            maxTokens: 6144,
            contextWindow: 131072,
        },
    },
    {
        id: 'qwen-max',
        name: 'Qwen Max',
        provider: ProviderType.DASHSCOPE,
        description: 'Most capable Qwen model',
        capabilities: {
            supportsVision: false,
            supportsStreaming: true,
            supportsFunctionCalling: true,
            maxTokens: 6144,
            contextWindow: 131072,
        },
    },
];
// All models combined
export const ALL_MODELS = [
    ...ANTHROPIC_MODELS,
    ...OPENAI_MODELS,
    ...GOOGLE_MODELS,
    ...DASHSCOPE_MODELS,
];
/**
 * Model catalog class for managing and querying models
 */
export class ModelCatalog {
    models = new Map();
    constructor() {
        this.initializeCatalog();
    }
    initializeCatalog() {
        ALL_MODELS.forEach((model) => {
            this.models.set(model.id, model);
        });
    }
    /**
     * Get a model by ID
     */
    getModel(modelId) {
        return this.models.get(modelId);
    }
    /**
     * Get all models
     */
    getAllModels() {
        return Array.from(this.models.values());
    }
    /**
     * Get models by provider
     */
    getModelsByProvider(provider) {
        return this.getAllModels().filter((m) => m.provider === provider);
    }
    /**
     * Get models with specific capabilities
     */
    getModelsWithCapabilities(capabilities) {
        return this.getAllModels().filter((model) => {
            if (capabilities.supportsVision !== undefined &&
                model.capabilities.supportsVision !== capabilities.supportsVision) {
                return false;
            }
            if (capabilities.supportsThinking !== undefined &&
                model.capabilities.supportsThinking !== capabilities.supportsThinking) {
                return false;
            }
            if (capabilities.supportsFunctionCalling !== undefined &&
                model.capabilities.supportsFunctionCalling !==
                    capabilities.supportsFunctionCalling) {
                return false;
            }
            return true;
        });
    }
    /**
     * Find cheapest model matching criteria
     */
    getCheapestModel(capabilities) {
        const models = capabilities
            ? this.getModelsWithCapabilities(capabilities)
            : this.getAllModels();
        return models
            .filter((m) => m.pricing)
            .sort((a, b) => (a.pricing.inputPrice || 0) - (b.pricing.inputPrice || 0))[0];
    }
    /**
     * Register a custom model
     */
    registerModel(model) {
        this.models.set(model.id, model);
    }
    /**
     * Search models by name or description
     */
    searchModels(query) {
        const lowerQuery = query.toLowerCase();
        return this.getAllModels().filter((model) => model.id.toLowerCase().includes(lowerQuery) ||
            model.name.toLowerCase().includes(lowerQuery) ||
            model.description?.toLowerCase().includes(lowerQuery));
    }
}
// Export singleton instance
export const modelCatalog = new ModelCatalog();
//# sourceMappingURL=modelCatalog.js.map