Commit Graph
280 Commits
Author SHA1 Message Date
zeekay 3f883514c8 chore: bump hanzo-mcp to 0.10.22, hanzo-tools-agent to 0.2.1 2025-12-26 12:25:51 -08:00
zeekay 303a05a616 feat(agent): agentic proxy with agent integration
Enhanced agent tool architecture:
- 8 CLI agents: claude, codex, gemini, grok, qwen, vibe, code, dev
- Auto-detects agent environment for seamless auth
- Shares hanzo-mcp config with spawned agents
- Lightweight - no heavy litellm dependency

Essential tools reorganization:
- Added agent, think, critic to essential tools
- Removed llm/consensus from essential (heavy deps, opt-in)
- HEAVY_TOOLS constant for tracking opt-in tools

Config sharing:
- HANZO_AGENT_PARENT=true passed to child agents
- MCP config env vars propagated
- API keys shared when appropriate
2025-12-26 12:25:16 -08:00
zeekay 3d4aa8c6c6 fix: update agent tests for unified tools 2025-12-26 12:08:56 -08:00
zeekay a9a0813b6c fix: lint and format issues 2025-12-26 12:07:03 -08:00
zeekay 16eadf211b chore: bump hanzo-mcp to 0.10.21 2025-12-26 11:45:26 -08:00
zeekay 5a1c976535 feat: consolidate tools - 52 to 30 tools
Major consolidation of hanzo-mcp tools:

Memory (9 → 1 tool):
- Unified UnifiedMemoryTool with actions: recall, create, update, delete,
  manage, facts, store, summarize, kb

Agent (10+ → 3 tools):
- Unified UnifiedAgentTool for claude, codex, gemini, grok CLI agents
- Removed duplicate critic (use reasoning.critic instead)
- Kept iching and review tools
- Removed code_auth, network, request_clarification

LLM (3 → 2 tools):
- Removed llm_manage (consolidated into llm)

Tool Management (4 → 1 tool):
- Existing unified `tool` command handles install, enable, disable, list

Essential Tools:
- Added memory, shell, open, tool to ESSENTIAL_TOOLS
- Added memory to ESSENTIAL_SYSTEM_TOOLS (always enabled)
- Updated hanzo mode with iching, review, computer

Bug fixes:
- Fixed async await warning in dag_tool.py
- Fixed duplicate critic conflict between agent and reasoning
2025-12-26 11:43:19 -08:00
zeekay 2cb7eb03fc feat(hanzo-mcp): unified tool command and essential tools system
Major improvements to mode and tool management:

1. Essential System Tools - Critical tools (llm, consensus, config, mode,
   tool, version, stats) are now ALWAYS enabled regardless of active mode.
   Previously, mode system disabled all tools then only enabled mode-specific
   ones, causing critical tools to be unavailable.

2. Unified 'tool' Command - Consolidates tool_install, tool_enable,
   tool_disable, tool_list into single 'tool' command with actions:
   - list: List all tools by category
   - enable/disable: Toggle tool state
   - install/uninstall: Package management
   - upgrade/reload: Update tools
   - self_update: Update hanzo-mcp

3. Fixed Permission Manager - Made permission_manager optional in:
   - FileSystemTool base class
   - ComputerTool
   - ConfigTool
   - ReadTool, WriteTool, EditTool
   Now creates default PermissionManager if not provided.

4. Fixed Mode System - Builtin modes (hanzo, minimal, fullstack, devops,
   security) are now always registered alongside hanzo-persona profiles.
   Previously they were skipped when hanzo-persona was available.

5. Updated ESSENTIAL_TOOLS constant with modern tool names and added
   llm, consensus, config, mode to ensure they're in all default modes.

Version bump: 0.10.19 -> 0.10.20
v0.10.20 forge/v0.10.20
2025-12-26 11:09:45 -08:00
zeekay ba22163460 feat(hanzo-mcp): v0.10.18 - add hanzo-tools-* and hanzo-persona as required dependencies 2025-12-26 10:47:00 -08:00
zeekay b59c52e665 chore: update hanzo-agent submodule 2025-12-26 10:36:26 -08:00
zeekay c6f8162b8c chore: publish hanzo-tools-{config,llm,mcp,vector} and meta package 0.2.0 2025-12-26 10:30:14 -08:00
zeekay 23b8a161a9 chore: bump hanzo-tools-* to 0.2.0, hanzo-mcp to 0.10.17
Published all packages to PyPI:
- hanzo-tools-core 0.2.0
- hanzo-tools-filesystem 0.2.0
- hanzo-tools-shell 0.2.0
- hanzo-tools-browser 0.2.0
- hanzo-tools-memory 0.2.0
- hanzo-tools-todo 0.2.0
- hanzo-tools-reasoning 0.2.0
- hanzo-tools-lsp 0.2.0
- hanzo-tools-refactor 0.2.0
- hanzo-tools-database 0.2.0
- hanzo-tools-agent 0.2.0
- hanzo-tools-jupyter 0.2.0
- hanzo-tools-editor 0.2.0
- hanzo-tools-computer 0.2.0
- hanzo-mcp 0.10.17
2025-12-26 06:49:24 -08:00
zeekay 44e505abf2 feat(hanzo-tools-computer): v0.2.0 - comprehensive Mac automation
- Add window management: get_active_window, list_windows, focus_window
- Add screen management: get_screens, screen_size, current_screen
- Add region abstractions: define_region, region_screenshot, region_locate
- Add image utilities: locate_all, wait_for_image, wait_while_image
- Add pixel operations: pixel, pixel_matches with tolerance
- Add timing controls: set_pause, set_failsafe, countdown
- Add input helpers: write (with clear), key_down/key_up, move_relative
- Add batch operations: run multiple actions in one call
- Performance: thread pool executor, cached screen info, faster polling
- All operations non-blocking with async-first design
2025-12-26 06:45:07 -08:00
zeekay 0997cbe412 fix(ci): remove extra backslash in tag extraction v0.10.17 forge/v0.10.17 2025-12-26 06:43:10 -08:00
zeekay a0eb0391e4 ci: update publish-pypi.yml to support all hanzo-tools-* packages
- Add all 17 hanzo-tools packages to publish workflow
- Support tag-based publishing for individual packages
- Add workflow_dispatch with "all" option for manual publishing
- Handle missing package directories gracefully
2025-12-26 06:39:58 -08:00
zeekay 7ff34ba5bf feat(hanzo-tools): v0.10.17 - modular tool packages + computer control
- Add hanzo-tools-computer package for pyautogui Mac automation
- Fix hanzo-tools-agent imports to use new package structure
- Add get_read_only_*_tools() helpers to filesystem/jupyter
- Remove BatchTool (replaced by dag - one tool per capability)
- Remove hanzo-persona dependency (not published yet)
- Simplify pyproject.toml for local development

Packages ready for PyPI:
- hanzo-tools-core
- hanzo-tools-filesystem
- hanzo-tools-shell
- hanzo-tools-browser
- hanzo-tools-memory
- hanzo-tools-todo
- hanzo-tools-reasoning
- hanzo-tools-lsp
- hanzo-tools-refactor
- hanzo-tools-database
- hanzo-tools-agent
- hanzo-tools-jupyter
- hanzo-tools-editor
- hanzo-tools-computer (NEW)
2025-12-26 06:37:28 -08:00
zeekay dd0f3a9b5c fix(hanzo-mcp): convert blocking subprocess.run to async
- git_search.py: All 6 subprocess.run calls converted to asyncio.create_subprocess_exec
- search_tool.py: All 6 subprocess.run + 3 blocking file reads converted to async
- npx.py: Converted to asyncio.create_subprocess_exec with proper timeout
- uvx.py: Both subprocess calls converted to async with timeout handling
- open.py: Platform openers converted to async fire-and-forget pattern

All tools now use non-blocking async I/O for better concurrency.
Tests: 31/31 passing.
2025-12-26 05:47:19 -08:00
zeekay 30d59c9793 fix(tools): cleanup and architecture documentation
- Delete deprecated agent_tool_v1_deprecated.py and swarm_tool_v1_deprecated.py
- Keep CriticTool as name='critic' (not code_review) per user request
- Add missing stub classes for CLI agents when hanzo-agents unavailable
- Fix NameError: ClaudeCodeAgent not defined in tests
- Document hanzo-mcp vs hanzo-tools-* architecture in CLAUDE.md
2025-12-26 05:25:55 -08:00
zeekay 2d1bdd997f refactor: cleanup and consolidate tool packages
- Delete deprecated files (agent_tool_v1_deprecated.py, swarm_tool_v1_deprecated.py)
- Consolidate duplicate LLM tools (merge llm_tool.py into llm_unified.py)
- Rename agent CriticTool to CodeReviewTool to avoid conflict with reasoning critic
- Fix stub classes in swarm_tool.py to raise ImportError instead of silent pass
- Update CLAUDE.md with accurate tool counts (62 tools across 17 packages)
2025-12-26 05:05:41 -08:00
zeekay 37a6371772 chore(hanzo-mcp): bump version to 0.10.9 2025-12-26 04:44:58 -08:00
zeekay 033e9d26f4 fix: run black formatter on pkg/hanzo 2025-12-26 04:37:43 -08:00
zeekay 2367bdbfde chore(hanzo-mcp): bump version to 0.10.8 2025-12-26 04:32:46 -08:00
zeekay b21ca3a5ce fix: run ruff check --fix and format across entire codebase 2025-12-26 04:31:06 -08:00
zeekay dacdc3b797 chore(hanzo-mcp): bump version to 0.10.8 2025-12-26 04:28:13 -08:00
zeekay 5f3a6e3cbf feat(hanzo-mcp): add DISPLAY INSTRUCTIONS to filesystem and find tools
Updated tool descriptions with DISPLAY INSTRUCTIONS to guide LLM output rendering:
- read.py: Show output in fenced code block with language hint
- write.py: Show brief status message
- edit.py: Show diff in fenced code block
- find_tool.py: Show formatted file list directly

This helps agent and other LLMs render tool output more readably
instead of showing raw JSON.
2025-12-26 04:27:15 -08:00
zeekay c51b954a18 fix: sort imports in hanzo-mcp shell tools 2025-12-26 04:23:26 -08:00
zeekay db1d3744eb fix: update test_no_stubs to recognize execute method and call aliases 2025-12-26 04:21:31 -08:00
zeekay 14bb7c1258 fix: update CI workflow to handle variable agent tool count (10-12) 2025-12-26 04:16:33 -08:00
zeekay 82ea895893 fix: make new tool packages optional in tests for CI compatibility 2025-12-26 04:14:36 -08:00
zeekay c825db98e5 chore: run ruff format on all hanzo packages 2025-12-26 04:12:26 -08:00
zeekay a3b58c011f chore: fix ruff linting issues across all hanzo-tools packages
- Fix import sorting (I001) in all packages
- Fix bare except (E722) in lsp_tool.py
- Fix duplicate set item (B033) in refactor_tool.py
2025-12-26 04:11:10 -08:00
zeekay 1e988d8d26 fix: remove unused lru_cache import and update test expectations
- Remove unused functools.lru_cache import from refactor_tool.py
  (fixes ruff TID251 banned import error)
- Update test_all_tools.py to include new packages:
  config (2 tools), mcp_tools (4 tools), llm (0-4), vector (0-3)
- Make agent tool count flexible (10-12) for platform differences
- Total tools now 57-66 depending on optional dependencies
2025-12-26 04:10:22 -08:00
zeekay ebf074bd0a feat(hanzo-mcp): improve tool output formatting for agent display
- Add MCPResourceDocument.to_readable_string() for human-readable output
- Update search, find, lsp, refactor tools to use readable format
- Cleaner to_json_string() that doesn't double-wrap data
- Better formatted results with:
  - Search stats and timing info
  - Numbered results with file:line locations
  - Truncated long matches for readability
  - Pagination info
- Sync improvements to hanzo-tools-core package
2025-12-26 04:07:00 -08:00
zeekay e346468d08 docs(hanzo-tools): add README files for new packages
- hanzo-tools-config: config, mode tools
- hanzo-tools-mcp: mcp management tools
- hanzo-tools-llm: LLM interaction tools
- hanzo-tools-vector: vector search tools
2025-12-26 03:59:54 -08:00
zeekay f736cab3ed fix(hanzo-tools-agent): add missing semaphore in deprecated swarm tool
Fixes F821 undefined name error in swarm_tool_v1_deprecated.py
2025-12-26 03:58:20 -08:00
zeekay c32eef2fa0 feat(hanzo-tools): complete modular tool packages v0.10.7
- Add hanzo-tools-llm (4 tools: llm, unified_llm, consensus, llm_manage)
- Add hanzo-tools-vector (3 tools: index, vector_index, vector_search)
- Add hanzo-tools-config (2 tools: config, mode)
- Add hanzo-tools-mcp (4 tools: mcp, mcp_add, mcp_remove, mcp_stats)
- Update hanzo-tools meta package with all 17 packages
- Bump hanzo-mcp to v0.10.7

Total: 63 tools across 17 modular packages

Bundle extras:
- [core]: filesystem, shell, todo, reasoning, config
- [dev]: core + editor, lsp, refactor
- [ai]: llm, agent, memory
- [all]: everything
2025-12-26 03:51:15 -08:00
zeekay 08970ba62c fix(dag): add defensive check for ProcessManager singleton
Add runtime check to provide better error message if ProcessManager()
returns None. This should never happen with proper singleton pattern,
but helps diagnose issues in edge cases.
2025-12-26 03:49:32 -08:00
zeekay c63f370fea test(hanzo-tools): add tests and CI for 53 tools across 13 packages
- Add test_all_tools.py with 28 tests covering:
  - Package imports and tool counts
  - Import speed verification (no blocking)
  - Async call method verification
  - Total tool count validation (53 tools)

- Add test-hanzo-tools.yml CI workflow:
  - Runs on push/PR to pkg/hanzo-tools-*
  - Installs all 13 tool packages
  - Verifies all tools import correctly
2025-12-25 23:18:58 -08:00
zeekay d5f8e3f2b5 feat(hanzo-tools): add modular tool packages with 53 tools across 13 packages
Introduces hanzo-tools-* namespace packages for independent tool installation:

Core packages:
- hanzo-tools-core: BaseTool, ToolRegistry, PermissionManager
- hanzo-tools-filesystem: read, write, edit, tree, find, search, ast (7 tools)
- hanzo-tools-shell: dag, ps, zsh, shell, npx, uvx, open (7 tools)

AI/Agent packages:
- hanzo-tools-agent: critic, iching, review, network, CLI agents (12 tools)
- hanzo-tools-memory: recall/create/update/delete memories, facts, KB (9 tools)
- hanzo-tools-reasoning: think, critic (2 tools)

Editor/Dev packages:
- hanzo-tools-lsp: Language Server Protocol tool (1 tool)
- hanzo-tools-refactor: rename, extract, inline, move, change_signature (1 tool)
- hanzo-tools-database: SQL + graph database tools (8 tools)
- hanzo-tools-editor: neovim integration (3 tools)
- hanzo-tools-jupyter: notebook read/edit (1 tool)
- hanzo-tools-browser: Playwright browser automation (1 tool)
- hanzo-tools-todo: unified todo management (1 tool)

Key improvements:
- All subprocess.run calls have timeout protection
- All tool .call() methods are async
- Namespace package pattern for mix-and-match installation
- Entry point discovery via hanzo.tools
- No blocking imports (all < 2s)

Also updates hanzo-mcp:
- Browser tool integration
- Tool install/registry for dynamic tool management
- Auto-background timeout reduced to 60s
2025-12-25 22:38:26 -08:00
zeekay 8750f1ce8b fix(hanzo-mcp): v0.10.4 - fix search hanging and null process_manager
- Add 30s timeout to each search engine (grep, ast, lsp, git)
- Fix NoneType error when process_manager unavailable in auto_timeout
- Prevents LSP engine from hanging indefinitely on large codebases
forge/hanzo-mcp-0.10.4 hanzo-mcp-0.10.4
2025-12-25 19:58:46 -08:00
zeekay 3857226b3c feat(hanzo-mcp): v0.10.3 - add uvloop support for faster async
- Add uvloop>=0.21.0 to performance extras (Linux/macOS only)
- Create event_loop utility for early uvloop configuration
- Configure uvloop at CLI startup before async imports
- Provides 2-4x faster event loop for async operations

Install with: pip install hanzo-mcp[performance]
forge/hanzo-mcp-0.10.3 hanzo-mcp-0.10.3
2025-12-25 19:47:34 -08:00
zeekay 958bed4dd3 fix(hanzo-aci): update dependencies to fix security vulnerabilities
- h11: 0.14.0 → 0.16.0 (critical: malformed chunked-encoding)
- urllib3: 2.3.0 → 2.6.2 (high: decompression chain attack)
- aiohttp: 3.11.14 → 3.13.2 (low: HTTP smuggling)
- requests: 2.32.3 → 2.32.5 (medium: .netrc leak)
- filelock: 3.18.0 → 3.20.1 (medium: symlink attack)

Fixes all 8 Dependabot security alerts.
2025-12-25 19:40:31 -08:00
zeekay dc4209ea6d chore(hanzo-mcp): update uv.lock for v0.10.2 2025-12-25 19:36:29 -08:00
zeekay eca755b76e feat(hanzo-mcp): v0.10.2 - DAG auto-backgrounding and zsh tool
- DAG commands that exceed timeout now auto-background instead of failing
- Backgrounded processes return SUCCESS status so DAG continues
- Register backgrounded processes with ProcessManager for ps tool tracking
- Async log capture for backgrounded process output
- Enable standalone zsh tool for simple single-command execution
- All I/O uses aiofiles for non-blocking async operations
- Kill any backgrounded process without affecting DAG completion
forge/hanzo-mcp-0.10.2 hanzo-mcp-0.10.2
2025-12-25 18:51:21 -08:00
zeekay 4e90aff2ae fix(hanzo-mcp): v0.10.1 - improve shell resolution
- Check Homebrew paths first (/opt/homebrew/bin, /usr/local/bin)
- Prefer zsh, fallback to bash if not available
- Support both Apple Silicon and Intel Macs
2025-12-25 17:47:09 -08:00
zeekay fe35677866 feat(hanzo-mcp): v0.10.0 - minimal orthogonal tool set
BREAKING: Shell tools consolidated
- dag: Replaces bash, zsh, shell, exec, batch (one way to run commands)
- ps: Replaces process (UNIX-style naming)
- zsh-only by default

30 tools registered (down from ~50+):
- Shell: dag, ps, npx, uvx, open
- Files: read, write, edit, multi_edit
- Search: search, find, ast, tree
- LSP: lsp, refactor
- Thinking: think, critic
- Memory: recall/create/update/delete/manage memories
- Knowledge: recall/store facts, manage knowledge bases
- Meta: rules, mode, todo, version

Philosophy: "One and only one way to do everything"
2025-12-25 17:21:06 -08:00
zeekay 7df83db91d feat(hanzo-mcp): add version MCP tool
- Add version() tool to get hanzo-mcp version via MCP
- Sync __version__ with pyproject.toml (0.9.23)
- Returns hanzo_mcp version, python version, platform, arch
hanzo-mcp-0.9.23 forge/hanzo-mcp-0.9.23
2025-12-25 11:44:36 -08:00
zeekay 6bb39a94c1 chore(hanzo-mcp): bump version to 0.9.22 2025-12-25 11:12:55 -08:00
zeekay 266b54104b fix(hanzo-mcp): update deprecated APIs and dependencies
- Replace has_permission() with is_path_allowed() across all tools
- Update tests to use AutoPaginatedResponse instead of PaginatedResponse
- Fix batch tool invocations to use tool_name/input instead of tool/parameters
- Update ReadTool/WriteTool imports from new module locations
- Add skip markers for deprecated tests (UvxBackgroundTool, swarm dispatch_to_model)
- Update all dependencies to latest versions (aiofiles 25.1.0, fastmcp 2.14.1, etc.)
- Add e2e LiteLLM integration test structure

All tests pass (35 passed, 6 skipped)
2025-12-25 11:11:38 -08:00
zeekay 5d85bfcb09 feat(shell): add --force-shell option to override shell selection
- Add --force-shell CLI argument with choices [bash, zsh, sh]
- Set HANZO_MCP_FORCE_SHELL environment variable when option is used
- Modified BashTool, ZshTool, and ShellTool to respect the env var
- Allows users to force all shell operations to use a specific shell
  even when AI requests a different one

Example usage in ~/.claude.json:
  "args": ["hanzo-mcp", "--force-shell", "zsh"]

Bumps version to 0.9.19
2025-12-24 22:23:15 -08:00
zeekay b26ad5e88b fix(todo): add missing read_todos/write_todos methods to TodoTool
The TodoTool was calling self.read_todos() and self.write_todos() but
these methods were not defined in either TodoTool or TodoBaseTool.
Added the methods using TodoStorage with a default session ID.
2025-12-24 18:10:40 -08:00