Commit Graph
201 Commits
Author SHA1 Message Date
zeekay 0f8b1e9906 feat(shell): nested arrays auto-parallel in DAG execution
zsh(["setup", ["a", "b", "c"], "cleanup"])
# Runs: setup → (a, b, c in parallel) → cleanup

Bump hanzo-tools-shell to v0.3.3
2025-12-27 13:34:59 -08:00
zeekay fb1873b2ac feat(shell): add bash tool and shell parameter for runtime switching
- Add shell parameter to zsh/bash/shell tools for runtime shell switching
- Add BashTool for bash-specific scripts
- Usage: zsh("cmd", shell="bash") or bash("cmd")
- Bump hanzo-tools-shell to v0.3.2
2025-12-27 13:32:07 -08:00
zeekay 47c9c200b3 refactor(shell): merge dag into zsh for unified shell tool
- ZshTool now includes full DAG functionality (serial, parallel, graph)
- Single "zsh" command for all shell operations
- Usage: zsh("ls") or zsh(["cmd1", "cmd2"]) or zsh([...], parallel=True)
- DagTool kept in codebase for backwards compatibility
- Removed DagTool from default TOOLS list
- Bump hanzo-tools-shell to v0.3.1
2025-12-27 13:09:33 -08:00
zeekay 06f86e01f4 feat(agent): add direct API mode and auto-backgrounding
- Add _exec_api method for OpenAI/Anthropic-compatible API calls
- Add httpx and uvloop as optional dependencies [api] [perf]
- Auto-background long-running agent processes with ps --logs support
- Configure YOLO mode flags for all CLI agents
- Bump hanzo-tools-agent to v0.2.7, hanzo-mcp to v0.10.26
2025-12-27 13:06:01 -08:00
zeekay 955b30a004 Bump agent tools 2025-12-27 10:50:15 -08:00
zeekay 16d1277bc3 refactor: rename hanzo-tools-filesystem to hanzo-tools-fs
- Shorter package name for brevity
- hanzo_tools.filesystem -> hanzo_tools.fs
- Updated all dependencies and CI
2025-12-26 16:56:44 -08:00
zeekay a9769ebb28 refactor: merge hanzo-tools-core into hanzo-tools
- hanzo-tools now contains core infrastructure (BaseTool, ToolRegistry, etc.)
- hanzo-tools-core becomes a thin backwards-compat wrapper
- All tool packages now depend on hanzo-tools>=0.3.0
- Reduces package count and simplifies dependency tree
2025-12-26 16:53:58 -08:00
zeekay 4f2e58e76c docs(consensus): document MCP mesh usage 2025-12-26 16:45:04 -08:00
zeekay d2e5decf24 feat(consensus): add MCP mesh for agent-to-agent consensus
- MCPMesh: Register agents as MCP servers
- MCPAgent: Call tools on other agents
- run_mcp_consensus: N rounds of discussion via MCP
- create_mesh: Convenience factory

Each agent in consensus is available as MCP to every other.
2025-12-26 16:44:37 -08:00
zeekay 00c8bf1994 refactor: rename hanzo-metastable-consensus to hanzo-consensus
Simplified package naming for clarity.
2025-12-26 16:42:52 -08:00
zeekay a46a541db1 feat(llm): use hanzo-metastable-consensus for consensus tool
- Replace litellm aggregation with Metastable protocol
- Two-phase finality: Sampling + Finality
- Reference: https://github.com/luxfi/consensus
2025-12-26 16:39:01 -08:00
zeekay 436ff4bf3d feat: extract hanzo-metastable-consensus package
- New package: hanzo-metastable-consensus
- Two-phase finality: Sampling + Finality
- Used by hanzo-tools-agent for consensus action
- Reference: https://github.com/luxfi/consensus
2025-12-26 16:20:32 -08:00
zeekay 67d8c62d5c feat(agent): multi-agent orchestration with DAG, swarm, Lux Quasar consensus
- Actions: run, dag, swarm, consensus, dispatch, list, status, config
- DAG execution with topological sort and {dep_id} output injection
- Swarm for work distribution with asyncio.Semaphore max_concurrent
- Lux Quasar consensus: Nova DAG + Quasar finality phases
- Photon luminance-weighted peer sampling (faster agents = higher weight)

Native agents: claude, codex, gemini, grok, qwen, vibe, dev

Anthropic-compatible agents (via claude CLI):
- minimax (MiniMax-M2.1)
- kimi (Kimi K2 / Moonshot)
- deepseek (DeepSeek)
- yi (Yi / 01.AI)
- glm (Zhipu GLM-4)
- baichuan (Baichuan4)
- step (StepFun)
- dashscope (Qwen Max via DashScope)
- qwen-cc (Qwen Plus via DashScope)

Consensus: https://github.com/luxfi/consensus
2025-12-26 16:08:35 -08:00
zeekay 4b4b69cd0a refactor(agent): rename Lux Quasar to Metastable consensus 2025-12-26 15:49:42 -08:00
zeekay d7f2fcdbf6 feat(agent): one tool with actions, not many tools
Consolidated agent tool with actions:
- run: single agent execution (claude -p default)
- dag: DAG execution with dependencies and {dep_id} injection
- swarm: work distribution with max_concurrent semaphore
- consensus: Lux Quasar protocol (Nova + Quasar phases)
- dispatch: different agents for different tasks

Removed hanzo-agents SDK dependency. Lightweight CLI execution.

Consensus: https://github.com/luxfi/consensus
2025-12-26 15:46:48 -08:00
zeekay 08af6230f0 chore: bump hanzo-tools-shell to 0.3.0 2025-12-26 13:25:55 -08:00
zeekay a2403c928b feat(shell): add curl, jq, wget tools for shell escaping-free operations
Add three new shell tools that bypass shell escaping issues by using
subprocess with list arguments instead of shell interpretation:

- curl: HTTP client with proper JSON body handling
- jq: JSON processor with direct filter passing
- wget: File/site downloads with mirror mode support

These tools solve the common problem of shell escaping nightmares
when working with complex JSON or special characters.

Updates:
- Added CurlTool, JqTool, WgetTool to hanzo-tools-shell
- Updated __all__ exports and TOOLS list
- Added tools to entrypoint_loader PACKAGE_TOOL_PREFIXES
2025-12-26 13:25:21 -08:00
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
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 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 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