"""Command manifest registry and derived handler map."""

from .comments import COMMAND_MANIFEST as COMMENTS_COMMAND_MANIFEST
from .docs import COMMAND_MANIFEST as DOCS_COMMAND_MANIFEST
from .fields import COMMAND_MANIFEST as FIELDS_COMMAND_MANIFEST
from .folders import COMMAND_MANIFEST as FOLDERS_COMMAND_MANIFEST
from .lists import COMMAND_MANIFEST as LISTS_COMMAND_MANIFEST
from .spaces import COMMAND_MANIFEST as SPACES_COMMAND_MANIFEST
from .tags import COMMAND_MANIFEST as TAGS_COMMAND_MANIFEST
from .task_types import COMMAND_MANIFEST as TASK_TYPES_COMMAND_MANIFEST
from .tasks import COMMAND_MANIFEST as TASKS_COMMAND_MANIFEST
from .team import COMMAND_MANIFEST as TEAM_COMMAND_MANIFEST

COMMAND_MANIFESTS = [
    TASKS_COMMAND_MANIFEST,
    COMMENTS_COMMAND_MANIFEST,
    DOCS_COMMAND_MANIFEST,
    FIELDS_COMMAND_MANIFEST,
    FOLDERS_COMMAND_MANIFEST,
    LISTS_COMMAND_MANIFEST,
    SPACES_COMMAND_MANIFEST,
    TAGS_COMMAND_MANIFEST,
    TASK_TYPES_COMMAND_MANIFEST,
    TEAM_COMMAND_MANIFEST,
]

HANDLERS = {
    f"{manifest['group']}_{command}": handler
    for manifest in COMMAND_MANIFESTS
    for command, handler in manifest["handlers"].items()
}
