mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-27 04:20:09 +00:00
- 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
63 lines
1.4 KiB
Python
63 lines
1.4 KiB
Python
"""Version control tools for Hanzo AI (HIP-0300).
|
|
|
|
Tools:
|
|
- vcs: Unified version control tool (HIP-0300)
|
|
- status: Working tree status
|
|
- diff: Show differences (unified patch format)
|
|
- apply: Apply patch
|
|
- commit: Create commit
|
|
- branch: Branch operations (list, create, delete)
|
|
- checkout: Switch branches
|
|
- log: Commit history
|
|
|
|
Outputs diffs in unified patch format for use with fs.apply_patch.
|
|
|
|
Install:
|
|
pip install hanzo-tools-vcs
|
|
|
|
Usage:
|
|
from hanzo_tools.vcs import register_tools, TOOLS
|
|
|
|
# Register with MCP server
|
|
register_tools(mcp_server)
|
|
|
|
# Or access the unified tool
|
|
from hanzo_tools.vcs import VcsTool
|
|
"""
|
|
|
|
from hanzo_tools.core import BaseTool, ToolRegistry
|
|
|
|
from .git_tool import GitTool, git_tool
|
|
|
|
# Backward compat
|
|
VcsTool = GitTool
|
|
vcs_tool = git_tool
|
|
|
|
# Export list for tool discovery - HIP-0300 unified tool
|
|
TOOLS = [GitTool]
|
|
|
|
__all__ = [
|
|
"GitTool",
|
|
"git_tool",
|
|
"VcsTool",
|
|
"vcs_tool",
|
|
"register_tools",
|
|
"TOOLS",
|
|
]
|
|
|
|
|
|
def register_tools(mcp_server, **kwargs) -> list[BaseTool]:
|
|
"""Register vcs tools with the MCP server.
|
|
|
|
Args:
|
|
mcp_server: The FastMCP server instance
|
|
**kwargs: Additional options (cwd, etc.)
|
|
|
|
Returns:
|
|
List of registered tool instances
|
|
"""
|
|
cwd = kwargs.get("cwd")
|
|
tool = VcsTool(cwd=cwd)
|
|
ToolRegistry.register_tool(mcp_server, tool)
|
|
return [tool]
|