Files
zeekay 4ebf26df3e feat(mcp): unify tool surfaces, rename iching→zen, fix test infrastructure
- Consolidate memory tools into single unified surface
- Rename IChingTool → ZenTool across agent tools
- Rename tool files: proc_tool→exec_tool, net_tool→fetch_tool,
  vcs_tool→git_tool, todo_tool→tasks_tool
- Add hanzo_tool.py for unified Hanzo API surface
- Add workspace_tool.py for config management
- Add hanzo-tools-ui package with GitHub API integration
- Add unified.py core tool dispatcher
- Update IAM client to RFC-compliant OAuth endpoints
- Fix pytest-asyncio plugin conflict: pin <1.0.0, fix addopts
  double-registration, and align test APIs to current signatures
- Fix integration tests: PermissionManager API, ReviewProtocol
  focus values, AgentTool parameter names, mock llm module for CI
2026-03-06 03:13:54 -08:00

73 lines
1.6 KiB
Python

"""Configuration tools for Hanzo AI.
Tools:
- config: Configuration management
- mode: Development mode switching
- workspace: Workspace context detection
Install:
pip install hanzo-tools-config
"""
import logging
logger = logging.getLogger(__name__)
_tools = []
try:
from .config_tool import ConfigTool
_tools.append(ConfigTool)
except ImportError as e:
logger.debug(f"ConfigTool not available: {e}")
ConfigTool = None
try:
from .mode_tool import ModeTool
_tools.append(ModeTool)
except ImportError as e:
logger.debug(f"ModeTool not available: {e}")
ModeTool = None
try:
from .workspace_tool import WorkspaceTool
_tools.append(WorkspaceTool)
except ImportError as e:
logger.debug(f"WorkspaceTool not available: {e}")
WorkspaceTool = None
TOOLS = _tools
__all__ = [
"TOOLS",
"ConfigTool",
"ModeTool",
"WorkspaceTool",
"register_tools",
]
def register_tools(mcp_server, enabled_tools: dict[str, bool] | None = None):
"""Register config tools with MCP server."""
from hanzo_tools.core import ToolRegistry
enabled = enabled_tools or {}
registered = []
for tool_class in TOOLS:
if tool_class is None:
continue
tool_name = getattr(tool_class, "name", tool_class.__name__.lower())
if enabled.get(tool_name, True):
try:
tool = tool_class()
ToolRegistry.register_tool(mcp_server, tool)
registered.append(tool)
except Exception as e:
logger.warning(f"Failed to register {tool_name}: {e}")
return registered