"""Command definitions — categories, rate limit grouping, and defaults."""

from __future__ import annotations

# Map commands to rate limit categories
_RATE_CATEGORY: dict[str, str] = {
    # Immich
    "search": "search", "find": "search", "person": "search",
    "place": "search", "favorites": "search", "people": "search",
    # Gitea (API calls share a category)
    "repos": "api", "issues": "api", "prs": "api", "commits": "api",
    # Planka (API calls share a category)
    "boards": "api", "cards": "api", "lists": "api",
    # Home Assistant (WebSocket queries share a category)
    "entities": "api", "state": "api", "areas": "api",
}


def get_rate_category(cmd: str) -> str:
    return _RATE_CATEGORY.get(cmd, "default")


DEFAULT_COMMANDS_CONFIG = {
    "enabled": ["help", "status", "albums", "events", "latest", "random", "favorites", "summary", "memory"],
    "response_mode": "media",
    "default_count": 5,
    "rate_limits": {"search": 30, "api": 15, "default": 10},
}
