"""Vendor registry - single source of truth for supported vendors."""

from typing import Dict, List, Set

# Single source of truth for all supported vendors
VENDORS: Set[str] = {
    "gemini",
    "glm",
    "kimi",
    "mimo",
    "openai",
    "qwen",
}

# Vendor display names for documentation
VENDOR_DISPLAY_NAMES: Dict[str, str] = {
    "gemini": "Google Gemini",
    "glm": "ZhipuAI GLM",
    "kimi": "Moonshot Kimi",
    "mimo": "Xiaomi MiMo",
    "openai": "OpenAI",
    "qwen": "Aliyun Qwen",
}


def get_vendors() -> List[str]:
    """Get sorted list of supported vendor names."""
    return sorted(VENDORS)


def is_valid_vendor(vendor: str) -> bool:
    """Check if vendor name is supported."""
    return vendor.lower() in VENDORS


def normalize_vendor(vendor: str) -> str:
    """Normalize vendor name to lowercase."""
    normalized = vendor.lower().strip()
    if normalized not in VENDORS:
        raise ValueError(f"Unsupported vendor: {vendor}. Supported: {get_vendors()}")
    return normalized
