"""LLM 网关（C1 / ARCH §4）：薄自建，tier→provider+model，屏蔽厂商差异。

T5.4 扩：多适配器（Anthropic/Gemini/OpenAI 兼容）+ 回退链 + 熔断 + 能力协商/降级。
"""

from __future__ import annotations

from .adapters.anthropic import AnthropicAdapter
from .adapters.base import (
    Capabilities,
    ProviderAdapter,
    ProviderResult,
    ProviderUsage,
    StreamChunk,
)
from .adapters.gemini import GeminiAdapter
from .adapters.kimi_code import (
    KIMI_CLI_VERSION,
    KIMI_CODE_BASE_URL,
    KIMI_CODE_PLATFORM,
    KIMI_CODE_PROVIDER,
    KIMI_CODE_USER_AGENT,
    KimiCodeAdapter,
    build_kimi_code_client,
    kimi_code_headers,
    kimi_device_id,
    kimi_device_model,
)
from .adapters.kimi_code_key import (
    KIMI_CODE_KEY_PROVIDER,
    KimiCodeKeyAdapter,
    build_kimi_code_key_client,
)
from .adapters.openai_compat import OpenAICompatAdapter
from .errors import TransientProviderError
from .factory import build_adapter
from .gateway import CircuitBreaker, Gateway
from .ledger import LedgerSink, SqlAlchemyLedgerSink
from .routing import ChainResolver, Route, chain_from_routing, resolve_chain, resolve_route
from .types import (
    Block,
    Delta,
    LlmRequest,
    LlmResponse,
    Scope,
    ServedBy,
    Tier,
    Usage,
)

__all__ = [
    "AnthropicAdapter",
    "Block",
    "Capabilities",
    "ChainResolver",
    "CircuitBreaker",
    "Delta",
    "Gateway",
    "GeminiAdapter",
    "KIMI_CLI_VERSION",
    "KIMI_CODE_BASE_URL",
    "KIMI_CODE_KEY_PROVIDER",
    "KIMI_CODE_PLATFORM",
    "KIMI_CODE_PROVIDER",
    "KIMI_CODE_USER_AGENT",
    "KimiCodeAdapter",
    "KimiCodeKeyAdapter",
    "LedgerSink",
    "LlmRequest",
    "LlmResponse",
    "OpenAICompatAdapter",
    "ProviderAdapter",
    "ProviderResult",
    "ProviderUsage",
    "Route",
    "Scope",
    "ServedBy",
    "SqlAlchemyLedgerSink",
    "StreamChunk",
    "Tier",
    "TransientProviderError",
    "Usage",
    "build_adapter",
    "build_kimi_code_client",
    "build_kimi_code_key_client",
    "chain_from_routing",
    "kimi_code_headers",
    "kimi_device_id",
    "kimi_device_model",
    "resolve_chain",
    "resolve_route",
]
