"""ClickUp tool configuration."""

from __future__ import annotations

from typing import TYPE_CHECKING

from mindroom.tool_system.declarations import ConfigField, SetupType, ToolCategory, ToolStatus
from mindroom.tool_system.registration import register_tool_with_metadata

if TYPE_CHECKING:
    from agno.tools.clickup import ClickUpTools


@register_tool_with_metadata(
    name="clickup",
    display_name="ClickUp",
    description="Manage tasks, spaces, and lists in ClickUp project management",
    category=ToolCategory.PRODUCTIVITY,
    status=ToolStatus.REQUIRES_CONFIG,
    setup_type=SetupType.API_KEY,
    icon="SiClickup",
    icon_color="text-purple-600",
    config_fields=[
        ConfigField(
            name="api_key",
            label="API Key",
            type="password",
            required=True,
            placeholder="ClickUp API key",
            description="API key from ClickUp",
        ),
        ConfigField(
            name="master_space_id",
            label="Master Space ID",
            type="text",
            required=True,
            placeholder="ClickUp space ID",
            description="ID of the master space to work with",
        ),
    ],
    dependencies=["requests"],
    docs_url="https://docs.agno.com/tools/toolkits/others/clickup",
    helper_text="Get your API key from [ClickUp Settings > Apps](https://app.clickup.com/settings/apps)",
    function_names=("create_task", "delete_task", "get_task", "list_lists", "list_spaces", "list_tasks", "update_task"),
)
def clickup_tools() -> type[ClickUpTools]:
    """Return ClickUp tools for project management."""
    from agno.tools.clickup import ClickUpTools

    return ClickUpTools
