from app.agents.tools.search import (
    search_knowledge, get_knowledge_graph_context,
    build_knowledge_graph, hybrid_search,
)
from app.agents.tools.task import get_tasks, create_task, update_task_status
from app.agents.tools.forum import get_forum_posts, create_forum_post, scan_forum_for_instructions

TASK_TOOLS = [
    get_tasks,
    create_task,
    update_task_status,
]

FORUM_TOOLS = [
    get_forum_posts,
    create_forum_post,
    scan_forum_for_instructions,
]

KNOWLEDGE_RETRIEVAL_TOOLS = [
    search_knowledge,
    hybrid_search,
    get_knowledge_graph_context,
]

KNOWLEDGE_GRAPH_TOOLS = [
    get_knowledge_graph_context,
    build_knowledge_graph,
]

ANALYST_PROGRESS_TOOLS = [
    get_tasks,
    get_forum_posts,
    scan_forum_for_instructions,
]

ANALYST_INSIGHT_TOOLS = [
    get_tasks,
    get_forum_posts,
    search_knowledge,
    hybrid_search,
]

ALL_TOOLS = [
    *KNOWLEDGE_RETRIEVAL_TOOLS,
    build_knowledge_graph,
    *TASK_TOOLS,
    *FORUM_TOOLS,
]

SUB_COMMANDER_TOOLSETS = {
    "planner_scope": [],
    "planner_steps": [],
    "executor_tasks": TASK_TOOLS,
    "executor_forum": FORUM_TOOLS,
    "librarian_retrieval": KNOWLEDGE_RETRIEVAL_TOOLS,
    "librarian_graph": KNOWLEDGE_GRAPH_TOOLS,
    "analyst_progress": ANALYST_PROGRESS_TOOLS,
    "analyst_insights": ANALYST_INSIGHT_TOOLS,
}
