"use strict";
/**
 * Provider detection from model name strings.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.detectProvider = detectProvider;
exports.resolveApiKey = resolveApiKey;
/**
 * Detect the LLM provider from a model name string.
 *
 * - gpt-*, o1-*, o3-*, o4-*, chatgpt-* → openai
 * - claude-* → anthropic
 * - everything else → openai-compatible (Groq, Together, local, etc.)
 */
function detectProvider(model) {
    if (/^(gpt-|o1-|o3-|o4-|chatgpt-)/.test(model))
        return 'openai';
    if (/^claude-/.test(model))
        return 'anthropic';
    return 'openai-compatible';
}
/**
 * Resolve the API key for a given provider.
 */
function resolveApiKey(provider) {
    switch (provider) {
        case 'openai':
        case 'openai-compatible':
            return process.env.LT_LLM_API_KEY || process.env.OPENAI_API_KEY;
        case 'anthropic':
            return process.env.ANTHROPIC_API_KEY;
    }
}
