from dataclasses import dataclass


@dataclass
class AuthContext:
    account_id: str
    access_token: str
    plan: str  # "free", "pro", "enterprise"


@dataclass
class ProviderResolution:
    provider: str  # "openai", "elevenlabs", "edge-tts", etc.
    method: str  # "nexus", "managed_key", "local_key", "free"
    api_key: str | None  # The key to use (None for free providers)
    endpoint: str | None  # Override endpoint (for Nexus)
    credits_estimated: float | None  # Estimated credit cost


class NoProviderAvailable(Exception):
    """Raised when no provider can fulfill the request."""

    pass
