import { ModelRegistry } from "../../models/ModelRegistry.js";
import { PricingRegistry } from "../../models/PricingRegistry.js";
export class Capabilities {
    static getContextWindow(modelId) {
        const val = ModelRegistry.getContextWindow(modelId, "anthropic");
        return val ?? 200_000;
    }
    static getMaxOutputTokens(modelId) {
        const val = ModelRegistry.getMaxOutputTokens(modelId, "anthropic");
        return val ?? 4_096;
    }
    static supportsVision(modelId) {
        const model = this.findModel(modelId);
        if (model?.modalities?.input?.includes("image"))
            return true;
        return /claude-3/.test(modelId);
    }
    static supportsTools(modelId) {
        const model = this.findModel(modelId);
        if (model?.capabilities?.includes("function_calling"))
            return true;
        return /claude-3/.test(modelId);
    }
    static supportsJsonMode(modelId) {
        const model = this.findModel(modelId);
        if (model?.capabilities.includes("json_mode"))
            return true;
        return this.supportsTools(modelId);
    }
    static supportsExtendedThinking(modelId) {
        const model = this.findModel(modelId);
        if (model?.capabilities.includes("reasoning"))
            return true;
        return /claude-3-7/.test(modelId) || /thinking/.test(modelId);
    }
    static getCapabilities(modelId) {
        const caps = ["streaming"];
        const model = this.findModel(modelId);
        if (model) {
            if (model.capabilities.includes("function_calling"))
                caps.push("function_calling");
            if (model.capabilities.includes("reasoning"))
                caps.push("reasoning");
            if (model.capabilities.includes("json_mode"))
                caps.push("json_mode");
            model.capabilities.forEach((c) => {
                if (!caps.includes(c))
                    caps.push(c);
            });
            return caps;
        }
        if (this.supportsTools(modelId))
            caps.push("function_calling");
        if (this.supportsExtendedThinking(modelId))
            caps.push("reasoning");
        if (this.supportsJsonMode(modelId))
            caps.push("json_mode");
        if (/claude-3/.test(modelId))
            caps.push("batch");
        return caps;
    }
    static getPricing(modelId) {
        return PricingRegistry.getPricing(modelId, "anthropic");
    }
    static findModel(modelId) {
        return ModelRegistry.find(modelId, "anthropic");
    }
}
