Commit Graph
509 Commits
Author SHA1 Message Date
zeekay d27d06de13 test(zap,paas): add protocol and tool test suites
ZAP: 58 tests covering types, wire format encoding, server dispatch,
and full client-server integration over TCP (handshake, tool calls,
batch, ping, multiple clients, large payloads).

PaaS: 21 tests covering action routing, parameter validation, JWT
decode, auth fallbacks, deployment listing, and error propagation.
2026-03-13 16:52:56 -07:00
zeekay e7fff16a38 fix(curl): accept json parameter in MCP tool registration
Field(alias="json") doesn't translate to Python kwargs — FastMCP
passes the schema name directly. Rename json_body to json in the
registered function signature.
2026-03-13 16:52:55 -07:00
zeekay 748f342df3 feat(hanzo-zap): add ZAP SDK package to monorepo (0.6.1)
Zero-copy Agent Protocol SDK — client, server, types.
Patch bump from PyPI 0.6.0 to bring into monorepo workspace.
2026-03-12 18:30:18 -07:00
zeekay 2c7d718f6a ci: rename runners to {org}-{role}-{os}-{arch} convention
Unified ARC runner naming across all orgs:
- lux-build → lux-build-linux-amd64
- hanzo-build → hanzo-build-linux-amd64
- hanzo-k8s → hanzo-deploy-linux-amd64
- liquidity-build → liquidity-build-linux-amd64
2026-03-12 18:23:57 -07:00
zeekay b4c4e5b796 fix(zap): replace websockets with native ZAP TCP transport
- Rewrite zap_server.py to use asyncio TCP (not websockets library)
- ZAP server now speaks native binary protocol over raw TCP
- Wire format: [magic:4][type:1][length:4 BE][JSON payload]
- Remove websockets from ide optional dependency
- Fix type annotations: any -> Any, dict -> dict[str, Any]
- Add proper frame reading with asyncio.StreamReader.readexactly()
- Support MAX_MESSAGE_SIZE (16MB) limit per ZAP spec
2026-03-12 16:23:41 -07:00
zeekay 367b604e40 chore(hanzo-mcp): bump version to 0.15.0
HIP-0300 bidirectional action sync release:
- Full action parity across Python/TS/Rust implementations
- 13 unified tools with complete action coverage
2026-03-12 15:39:28 -07:00
zeekay d62f46fbc0 fix: ruff format MCP files + update required tool count to 21 2026-03-12 01:40:46 -07:00
zeekay 38262cd3bc fix: resolve mypy errors and update shell tool count in tests
- Fix type shadowing in forgiving_edit.py (needle_lines int/list conflict)
- Add return type annotations to prompts functions
- Fix change_type indexing for None case in utils.py
- Fix commit.message bytes/str handling in utils.py
- Add proper dict typing for tree entries in utils.py
- Update shell tool count from 8 to 9 in test assertions
2026-03-12 01:30:57 -07:00
zeekay 5cb3968f35 fix: resolve all ruff lint errors (F401, F841, E741, I001)
Remove unused imports, fix unsorted import blocks, rename ambiguous
variable, and remove unused local variable assignment.
2026-03-12 01:12:30 -07:00
zeekay 2d37599510 fix(hanzo-mcp): update fallback version to 0.14.0, add watchdog to dev deps
- server.py: fallback version 0.12.5 → 0.14.0 (matches pyproject.toml)
- pyproject.toml: add watchdog>=3.0.0 to dev extras (required by dev_server.py)
2026-03-11 16:57:20 -07:00
zeekay f64e9fce6c feat(hanzo-mcp): 100% MCP/ZAP protocol parity with method pass-through v0.14.0
- Add handle_method parameter to ZapServer for full MCP protocol parity
- Server routes resources/list, resources/read, prompts/list, prompts/get through ZAP
- All MCP methods work identically over ZAP binary WebSocket transport
- Matches Node @hanzo/mcp v2.4.0 ZAP parity implementation
2026-03-11 15:33:00 -07:00
zeekay 3aba26db16 fix(zap): dual-protocol decode, fix tool extraction, persist auth token
- Decode supports both MCP ZAP and hanzo/dev wire formats
- Fix _start_zap_server to use _tool_manager._tools (not .items())
- Persist auth token to ~/.hanzo/mcp_token instead of random per-run
2026-03-11 13:26:46 -07:00
zeekay 1ff7bfc10f feat(zap): add ZAP WebSocket server for browser extension discovery
Binary protocol server matching Node MCP implementation. Auto-starts
in background thread on run(). Supports multi-browser connections on
ports 9999-9995.
2026-03-11 13:12:52 -07:00
zeekay 53282938f4 docs: add LLM.md project guide 2026-03-11 10:14:51 -07:00
zeekay 69dd83710b feat(tools): bidirectional HIP-0300 action sync across Python/TS/Rust
Sync all tool actions across all three language implementations:
- code: +8 actions (search_symbol, outline, metrics, exports, types, hierarchy, rename, grep_replace)
- fetch: +2 actions (request, open)
- think: restructured to 12 action-based handlers
- tasks: +12 actions (stats, search, batch, archive, move, prioritize, assign, subtasks, notes, export, import, delete)
- plan: +13 actions (create, show, list, next, archive, add_step, remove_step, estimate, visualize, clone, cancel, notes, progress)
- mode: +3 actions (switch alias, list_presets, select_preset)
- memory: +10 actions (search, stats, clear, export, import, merge, tag, untag, namespaces, history)
- fs: +1 action (mv)
- git: +21 actions (blame, show, stash, tag, remote, merge, rebase, cherry_pick, reset, clean, init, clone, fetch, pull, push, config, worktree, reflog, shortlog, rev_parse, describe, bisect)
2026-03-10 21:57:50 -07:00
zeekay 7090d1c2ae feat(tools): fix BaseTool dispatch + achieve 100% HIP-0300 conformance
- Fix BaseTool.register() to bypass FastMCP's broken **kwargs introspection
  by creating Tool objects manually with Pydantic extra="allow" models
- Add PARAM_ALIASES support for cross-implementation parity (path→uri)
- Fix ExecTool to use ShellExecutor.run_shell() (correct 5-tuple API)
- Fix CodeTool tree-sitter import for tree-sitter-language-pack 0.25+
- Fix MemoryTool fallback to markdown backend when knowledge service unavailable
- Add ExecTool to shell TOOLS list
- Remove redundant register() overrides from code/fetch/plan/vcs/fs tools
- Add code, network, mode test categories to conformance suite (23 cases)
- Add parallel benchmark (benchmark_parallel.py)

Results: Python 23/23 (100%), 350/350 parallel calls async-safe
2026-03-10 19:41:02 -07:00
zeekay efc1459649 feat: add HIP-0300 cross-language MCP conformance test suite
Python script that speaks raw MCP JSON-RPC over stdio to test behavioral
equivalence across TypeScript and Python MCP servers. Maps unified (fs,
exec, git) and legacy (read_file, run_command) tool names transparently.

Results: TS 12/12 (100%), Python 11/12 (92%) — parity on fs, shell, vcs.
2026-03-10 17:17:30 -07:00
zeekay c27035430d feat(mcp): register code, git, fetch tools for HIP-0300 parity with TS MCP
Wire up the three missing HIP-0300 unified tools:
- code (AST, symbols, definition, references, transform)
- git (status, diff, commit, branch, log)
- fetch (search, fetch, download, crawl)

These packages existed but weren't in hanzo-mcp dependencies.
Also updates their dep from hanzo-tools-core to hanzo-tools.

Bumps hanzo-mcp to 0.13.0.
2026-03-10 16:50:08 -07:00
zeekay 52c4add894 fix(browser): unwrap CDP Runtime.evaluate results for consistency
The CDP bridge server now unwraps Runtime.evaluate results from the
nested CDP format {result: {type, value}} to just the value, matching
Playwright's evaluate return format.

Also bumps hanzo-tools-browser to 0.4.5 and hanzo-mcp to 0.12.9.
2026-03-10 10:38:31 -07:00
zeekay 3365393641 bump: hanzo-tools-browser 0.4.4 2026-03-10 09:50:00 -07:00
zeekay d02dda001b fix(browser): add missing action-to-method mappings in CDP bridge
url, title, reload, go_back, go_forward, tab_info were not mapped
to their hanzo.* / Page.* CDP equivalents, causing "Unknown method"
errors when routed through the extension.
2026-03-10 09:45:15 -07:00
zeekay ef77e9d31f feat: auto-install uvloop on Linux/macOS with platform gate
Move uvloop from opt-in [performance] extra to a platform-gated hard
dependency (sys_platform != 'win32'). On Linux/macOS it installs
automatically; on Windows pip/uv skips it entirely. Runtime fallback
in hanzo_async already handles ImportError gracefully.

- hanzo-async 0.1.2 → 0.1.3: uvloop now a default dep
- hanzo-mcp 0.12.7 → 0.12.8: uvloop in main deps, removed from [performance]
2026-03-09 21:11:54 -07:00
zeekay 191b74b779 chore: bump hanzo-tools-shell 0.6.3, hanzo 0.4.2 (Windows compat) 2026-03-09 21:11:39 -07:00
zeekay 1f801dcb93 fix: Windows/WSL compatibility for shell tools and CLI helpers
- exec_tool: add Windows shell detection (pwsh/cmd), use taskkill for process kill
- shell_detect: skip Unix paths on Windows, add pwsh/cmd fallback chain
- dev.py: replace all `which` subprocess calls with shutil.which()
- test_hanzo_dev: use shutil.which() instead of subprocess which
2026-03-09 21:10:37 -07:00
zeekay 173243a482 fix(ci): fix Windows test workflow - hanzoai installs from root, not pkg/
hanzoai is the root workspace package (pyproject.toml at repo root),
not pkg/hanzoai. Also use wslpath for reliable workspace path in WSL.
2026-03-09 20:57:53 -07:00
zeekay 6ae84e9f65 fix: Windows + WSL compatibility across python-sdk
Make uvloop fully opt-in (performance extra only, not a hard dep).
Add Windows native support: shell resolution (pwsh/cmd), signal
handling (SIGKILL guard), platform-appropriate paths, chmod guards.

Changes:
- hanzo-mcp: move uvloop from hard dep to [performance] extra
- hanzo-tools-shell: resolve pwsh/powershell/cmd on Windows,
  use correct invocation flags (cmd /c, pwsh -Command)
- hanzo-tools-shell: guard signal.SIGKILL (doesn't exist on Windows)
- hanzo-tools-computer: replace HOME=/tmp fallback with Path.home()
- hanzo-mcp cli: platform-appropriate socket path default
- hanzoai auth: skip os.chmod on Windows
- hanzo install: skip os.chmod on Windows
- Add .github/workflows/test-windows.yml (native + WSL2 matrix)

Versions bumped: hanzo-mcp 0.12.7, hanzo-async 0.1.2,
hanzo-tools-shell 0.6.2, hanzo-tools-computer 0.5.4
2026-03-09 20:50:55 -07:00
zeekay 85e186ee28 chore: add README.md for hanzo-tools-code and hanzo-tools-test
Required for PyPI package builds (hatchling validates readme existence).
2026-03-09 17:49:54 -07:00
zeekay cffe020f57 fix(ci): add hanzo-tools-ui to pyright exclude list
New package was missing from the pyright exclude, causing
"Cannot instantiate abstract class" error in CI lint.
2026-03-07 00:10:49 -08:00
zeekay 91d6283cea fix(ci): install libatomic1 for pyright on ARC runner
The hanzo-build ARC runner image is missing libatomic.so.1 which
pyright-python's bundled Node.js requires. Install it before linting.
2026-03-07 00:07:40 -08:00
zeekay bbeaaa3dd2 fix: resolve all I001 import sorting errors across monorepo
Auto-fix 75 import sorting violations detected by ruff check
across hanzo-mcp, hanzo-network, hanzo-tools-*, and other packages.
Verified clean with both ruff 0.14.6 and 0.14.14 (CI version).
2026-03-07 00:01:43 -08:00
zeekay b15250328b fix(ci): relax config tool count, install hanzo-tools shim in test matrix
Config tools use try/except for graceful degradation so the count
varies by environment. Accept >= 1 instead of exactly 2.
2026-03-06 23:49:53 -08:00
zeekay aff98ecc38 fix(ci): install hanzo-tools shim before hanzo-tools-core in test workflow
hanzo-tools-core depends on hanzo_tools.core.unified which is provided
by the hanzo-tools base package. Install it first. Also add config and
computer packages to test matrix.
2026-03-06 23:46:48 -08:00
zeekay 277515e0e7 fix: ruff lint errors across hanzo-tools-* packages (I001, F401, F541)
Fix 21 auto-fixable errors: import sorting (I001), unused import (F401),
and empty f-strings (F541) in 13 files across tool packages.
2026-03-06 23:44:10 -08:00
zeekay dd5ae39e55 fix(ci): install local hanzo-tools-agent in release-check venv
The release-check creates a fresh venv that pulls from PyPI where
hanzo-tools-agent 0.3.1 still has IChingTool. Override with local.
2026-03-06 15:01:10 -08:00
zeekay 86410899d0 fix(ci): drop --no-deps from local tool installs to resolve psutil
The --no-deps flag skipped transitive deps like psutil needed by
hanzo-tools-shell. Let uv resolve deps naturally.
2026-03-06 14:58:31 -08:00
zeekay cc7af1282b fix(ci): remove PYTEST_DISABLE_PLUGIN_AUTOLOAD, override addopts in CI
The pyproject.toml addopts includes -p asyncio which conflicts with
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1. Override addopts in CI commands
to get clean test output with full error messages.
2026-03-06 14:53:07 -08:00
zeekay c0f2f47959 fix(ci): install local tool packages in CI to match monorepo renames
CI was pulling hanzo-tools-agent 0.3.1 from PyPI which still has
IChingTool. Override with local editable installs so ZenTool/etc
are available during tests.
2026-03-06 14:49:55 -08:00
zeekay 248267bc8d fix(ci): sort imports in 4 test files (ruff I001) 2026-03-06 14:45:17 -08:00
zeekay 4c8b36fab9 ci: switch all workflows to hanzo-build ARC runners, fix stale iching refs
- Replace ubuntu-latest with hanzo-build across all 11 workflow files
- Fix IChingTool → ZenTool references in test-hanzo-mcp and test-hanzo-tools
2026-03-06 14:42:06 -08:00
zeekay d63f961a42 fix(ci): align test expectations with tool renames, fix ruff lint/format
- test_all_tools: todo→tasks, iching→zen tool name expectations
- ruff: fix import sorting in test files
- ruff: format server.py and batch_tool.py
2026-03-06 14:10:57 -08:00
zeekay d5f5c3e400 chore: gitignore build/ artifacts, remove tracked build files 2026-03-06 12:24:01 -08:00
zeekay 5c93279b64 fix(screen): write captures to file instead of returning inline base64
Screenshots and session frames are now saved to ~/.hanzo/screen/ and
the tool returns the file path. Prevents blowing up context with ~52K
chars of base64 per capture.
2026-03-06 04:18:32 -08:00
zeekay 2627398822 fix(mcp): inject hanzo-mcp version into MCP server metadata
Sets _mcp_server.version from importlib.metadata so clients see the
correct hanzo-mcp package version instead of the default.
2026-03-06 03:56:01 -08:00
zeekay 074acc447d feat(browser): add wait_for_selector, query_selector_all to extension actions 2026-03-06 03:49:20 -08:00
zeekay 6528f39f13 feat(browser): add navigation/fetch/history to extension actions 2026-03-06 03:43:55 -08:00
zeekay 3ac1f9f890 fix(browser): fix extension result passthrough, add DOM actions
- Fix result normalization: non-dict values no longer crash with **spread
- Add 20+ DOM actions to extension_actions set (get/set HTML/text,
  attributes, styles, classes, mutations, localStorage, cookies, etc.)
- Bump hanzo-tools-browser 0.4.3, hanzo-mcp 0.12.6
2026-03-06 03:33:33 -08:00
zeekay d5818d2dc9 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
zeekay aff3ec6e8a bump: hanzo-tools-browser 0.4.2, hanzo-mcp 0.12.4
- browser: auto-start CDP bridge on BrowserTool init (extension-first routing)
- mcp: pin hanzo-tools-browser>=0.4.2
2026-03-06 00:55:37 -08:00
zeekay 167ed4ed80 fix(browser): auto-start CDP bridge on BrowserTool init
The CDP bridge server (ws://localhost:9223 + http://localhost:9224)
was never starting because the entrypoint loader instantiates
BrowserTool directly, bypassing the package-level register_tools()
which called start_cdp_bridge().

Now BrowserTool.__init__() auto-starts the bridge when backend is
not "playwright", ensuring the browser extension can connect and
be used as the preferred backend over headless Playwright.
2026-03-06 00:32:42 -08:00
zeekay 08cd64afac feat(browser): configurable backend + fix CDP bridge for websockets >= 13
- Add BROWSER_BACKEND env var: firefox | chrome | extension | playwright | auto
- Config persists to ~/.hanzo/extension/config.json
- Fix CDP bridge WebSocket handler signature for websockets >= 13 (new API)
- Add browser-based client resolution in CDP bridge
- Add /config GET/POST endpoints for extension preference sync
- Backend-aware routing: explicit backends don't fall back to Playwright
2026-03-04 19:35:00 -08:00