384 Commits
Author SHA1 Message Date
zeekay ffe73447a3 security: fix 3 HIGH + 3 MEDIUM findings from red team review
- H-1: guard negative abs_off in obj_bytes() (buffer read bypass)
- H-2: remove CERT_NONE from ZapClient TLS (MITM protection)
- H-3: add MAX_MESSAGE_SIZE check in ZapServer (OOM DoS)
- M-5: log exceptions instead of bare pass in server
- L-1: validate ZAP version in Message.parse()
- L-2: wrap req_id at u32 boundary in CloudClient
2026-03-31 20:57:16 -07:00
zeekay 985bec5352 feat: add CloudClient and rewrite wire protocol for Rust compatibility
- Add CloudClient for luxfi/zap binary protocol (TCP + auto-TLS)
- Rewrite wire.py Builder/ObjectBuilder to match Rust single-buffer architecture
- Fix response field offsets (CLOUD_RESP_BODY=4, CLOUD_RESP_ERROR=12)
- Use signed i32 relative offsets from absolute positions
- 28 unit tests + cross-language integration test passing
2026-03-29 15:13:32 -07:00
zeekay 7e47625094 fix: lint — ruff format and fix for hanzo-tools-ui and hanzo-mcp 2026-03-27 20:00:21 -07:00
zeekay 7767986eea feat: add RAG search via Hanzo Cloud (search-docs + chat-docs)
Replace custom fastembed/sqlite-vec approach with Hanzo Cloud search
infrastructure. UI tool now has:
- ask: RAG chat about components via cloud-api.hanzo.ai/api/chat-docs
- semantic_search: hybrid fulltext+vector via cloud-api.hanzo.ai/api/search-docs
- rebuild_index: push components to Hanzo Cloud search index
- index_status: check search index stats

Uses publishable key (pk-hanzo-ui-search-2026) for reads, admin key for writes.
Same infrastructure as docs.hanzo.ai search.
2026-03-27 19:31:16 -07:00
zeekay fa7865c895 fix: registry client uses static JSON paths for CF Pages compatibility
Update RegistryClient to fetch from /api/registry/components.json and
/api/registry/components/{name}.json (pre-built static files), with
fallback to Next.js API routes. Works on CF Pages, GitHub Pages, and
server mode. Add lux registry URL (ui.lux.finance).
2026-03-27 19:15:46 -07:00
zeekay a07a57d6bb feat: add UI registry server and tiered backend (local → registry → github)
Add FastAPI registry server that pre-fetches all component data from
hanzoai/ui on GitHub, caches in memory, refreshes every 15min. Serves
instant cached responses. Deploy at ui.hanzo.ai.

- registry/cache.py: eager full-cache with concurrent GitHub fetching
- registry/server.py: FastAPI endpoints for components, blocks, search
- registry/client.py: RegistryClient matching GitHubAPIClient interface
- Dockerfile for containerized deployment
- UiTool now uses 3-tier fallback: local disk → registry → GitHub API
- Bump hanzo-tools-ui to 0.2.0, server deps optional (fastapi, uvicorn)
2026-03-27 19:06:38 -07:00
zeekay c0e7414b42 feat: enable ui tool in hanzo-mcp with local-first component reading
Add hanzo-tools-ui to workspace members and hanzo-mcp dependencies so
the ui tool is actually discoverable at runtime. Add LocalUIClient that
reads components directly from ~/work/hanzo/ui when available, falling
back to GitHub API. Adds list_packages and read_file actions. Fixes
GitHub config components_path to match actual repo layout (pkg/ui/primitives).
2026-03-27 18:50:09 -07:00
zeekay 244ff90dee fix: depend on hanzo-flow (hyphenated PyPI name) 2026-03-25 04:02:13 -07:00
zeekay 113d6f3e8b fix: flow CLI binary is 'flow' not 'hanzo-flow' 2026-03-25 04:01:09 -07:00
zeekay 931d9927fe fix: update hanzo-flow entry point to flow.launcher (internal rename) 2026-03-25 02:39:47 -07:00
zeekay a820dd32de feat: add hanzo-flow package (re-exports hanzoflow CLI as hanzo-flow) 2026-03-25 01:23:47 -07:00
zeekay 3da9fecd20 chore: update SDK client, memory docs, and tests 2026-03-24 18:41:29 -07:00
zeekay 2c8c6a6f55 feat(memory): add namespace/key support + BlueRedChannel coordination class
- SQLite backend: namespace, key, tags, TTL, append support
- PluginMemoryService: full parity with TypeScript/Rust (list, stats, clear, tag, history, export/import)
- BlueRedChannel class for blue-red agent coordination protocol
- 30/30 tests passing
2026-03-24 18:03:30 -07:00
zeekay bd7e0078d9 chore: update hanzo-kms package 2026-03-23 10:26:07 -07:00
zeekay 959eab9db3 fix(api): add User-Agent header to APIs.guru fetch to fix CI 403
APIs.guru CDN blocks requests with Python's default User-Agent
(Python-urllib/3.x) from datacenter IPs, causing the weekly
Generate API Providers workflow to fail with HTTP 403.
2026-03-22 20:03:09 -07:00
zeekay 5ad26a7c78 chore: update dependencies to latest 2026-03-21 11:45:05 -07:00
zeekay 5480779e8a chore: update dependencies to latest 2026-03-21 11:01:05 -07:00
zeekay 7a5eba2dad feat(hanzo-tasks): Python SDK for durable task execution
New hanzo-tasks package wrapping temporalio SDK with Hanzo conventions:
- Client: connect, submit, get_result, cancel, signal, query
- Worker: register workflows/activities, poll and execute
- Pre-built workflows: AgentTaskWorkflow, PipelineWorkflow, FanOutWorkflow
- Pluggable agent executor via set_agent_executor()
- 28 tests passing
2026-03-19 10:29:31 -07:00
zeekay 867bda8090 rebrand: fix insights host URL and remove redundant env var fallback 2026-03-13 18:03:09 -07:00
zeekay 20778ab5c8 rebrand: PostHog→Insights in MCP analytics 2026-03-13 16:52:56 -07:00
zeekay df275b96f8 refactor(hanzo-mcp): clean up ZAP server bridge 2026-03-13 16:52:56 -07:00
zeekay 905cc907d8 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 46933ea6f5 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 580ff05460 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 c287c1eaf8 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 985bb9fedc 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 6548975fd9 fix: ruff format MCP files + update required tool count to 21 2026-03-12 01:40:46 -07:00
zeekay 997b7b91fb 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 e602907141 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 644620c743 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 d6c5630b2f 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 ff57f6ffe2 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 ff0043473e 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 1725d71492 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 7e25c192c6 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 3685b81f91 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 c9e279855f 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 5d03527549 bump: hanzo-tools-browser 0.4.4 2026-03-10 09:50:00 -07:00
zeekay 45674599f3 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 22a66029c0 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 7ffee0d761 chore: bump hanzo-tools-shell 0.6.3, hanzo 0.4.2 (Windows compat) 2026-03-09 21:11:39 -07:00
zeekay 949b6c8bdf 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 1a7ec1bad0 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 8176a2b4bd 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 1132e4beae 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 c7496dee8a 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 259d437061 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 231b2288a5 fix(ci): sort imports in 4 test files (ruff I001) 2026-03-06 14:45:17 -08:00
zeekay 66762c2941 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 2b883711ad chore: gitignore build/ artifacts, remove tracked build files 2026-03-06 12:24:01 -08:00