Files
ai-rpg/app/engine/tools/register_all.py
2026-06-20 19:13:05 +03:00

57 lines
1.6 KiB
Python

"""Build the default tool registry — instantiates and registers all tools."""
from __future__ import annotations
from app.engine.tools.base import ToolRegistry
from app.engine.tools.game import (
AdvanceTimeTool,
AskUserTool,
CalcTool,
CommentToUserTool,
EnvGetTool,
EnvUpdateTool,
EntityCreateTool,
EntityDeleteTool,
EntityGetTool,
EntityListTool,
EntityUpdateTool,
ProposeChangesTool,
RagAddTool,
RagQueryTool,
RandomChoiceTool,
RunSubagentTool,
ScheduleTriggerTool,
SubmitPlanTool,
SubmitStepTool,
SuggestActionsTool,
UpdatePlotRailsTool,
)
from app.engine.tools.schema_tools import (
SchemaAddFieldTool,
SchemaAddTypeTool,
SchemaModifyFieldTool,
SchemaRemoveFieldTool,
)
def build_default_registry() -> ToolRegistry:
"""Construct and return a ToolRegistry with all built-in tools registered."""
reg = ToolRegistry()
# Game tools
for cls in [
EntityCreateTool, EntityGetTool, EntityListTool, EntityUpdateTool,
EntityDeleteTool, EnvUpdateTool, EnvGetTool, UpdatePlotRailsTool,
AdvanceTimeTool, ScheduleTriggerTool, CalcTool, RandomChoiceTool,
RagQueryTool, RagAddTool, RunSubagentTool,
SubmitPlanTool, SubmitStepTool, SuggestActionsTool,
]:
reg.register(cls())
# Interaction tools
for cls in [AskUserTool, ProposeChangesTool, CommentToUserTool]:
reg.register(cls())
# Schema tools
for cls in [SchemaAddTypeTool, SchemaAddFieldTool,
SchemaRemoveFieldTool, SchemaModifyFieldTool]:
reg.register(cls())
return reg