Commit Graph
17 Commits
Author SHA1 Message Date
zeekay fae213a6c0 Follow the cloud surface through the git rename 2026-09-03 16:15:51 -07:00
zeekay 588a790b4b Regenerate against the current cloud document
The lock sat at 574d1f1d while the product moved on. The team surface
stopped at rooms — no messages path, no way to open one — so anything
built on this client had to reach past it with its own HTTP calls, which
is the duplication a generated client exists to prevent.
2026-09-01 02:21:39 -07:00
zeekay c7355b81fe Take the catalog cloud now writes 2026-08-31 23:42:47 -07:00
zeekay 42139d1849 Offer what the fleet offers, not what the contract lists
The unified tool derived its surface from /v1/openapi.json, which describes the
API rather than what a model may be handed. cloud keeps an operation off the
agent surface when its name discloses a bearer secret or when a mutating verb
acts on identity — post_iam_users is in the contract and refused at /v1/mcp, so
this tool offered an identity mutation the fleet declines.

The document still supplies each operation's method and path, which a caller
needs to make the request; the generated catalog supplies which are offered. Two
facts, one source each, and the rule is asked of cloud rather than restated. An
unreadable catalog offers nothing, because failing open widens the surface
silently.

Two aliases pointed at names the fleet had left behind, mapping callers off the
live surface. A synonym may only point at a name it serves.

A fixture naming no operations is not exercising the offer rule and now says so,
rather than the default being weakened to keep it green.
2026-08-30 19:52:51 -07:00
zeekayandHanzo Dev 0178264695 deps: floor hanzo-tools at the version that actually has HanzoCloud
The unified `hanzo` tool imports HanzoCloud from hanzo_tools.core, which
hanzo-tools first shipped in 0.3.3 — but nothing in the dependency graph
required it. hanzo-tools-api asked for `hanzo-tools-core>=0.1.0`, an empty
shim whose own floor is hanzo-tools>=0.3.2, and 0.3.2 has no cloud.py at all.
A resolver was therefore free to satisfy every constraint and still produce an
install where `from hanzo_tools.core import HanzoCloud` raises ImportError.
That is exactly what happened: the legacy-tool gate logged "unified hanzo tool
not importable" and fell back, and the dev venv had to install hanzo-tools
editable to get a working `hanzo`.

Name the real dependency at the real floor:
- hanzo-tools-api: hanzo-tools-core>=0.1.0 -> hanzo-tools>=0.3.4. It imports
  hanzo_tools.core directly, so it must depend on the package that owns it;
  the >=0.1.0 shim floor also still admitted the shadowing duplicate.
- hanzo-tools-vector: hanzo-tools>=0.3.0 -> >=0.3.4 (cloud_vector.py).
- hanzo-mcp: hanzo-tools>=0.3.2 -> >=0.3.4, hanzo-tools-api>=0.3.1 -> >=0.3.2.

Metadata only, on versions not yet published. No version bumps.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 20:44:05 -07:00
zeekayandHanzo Dev d0c125f571 tools: generate the hanzo surface from cloud's OpenAPI registry; delete the vector fake
The `hanzo` dispatcher hand-listed 10 services in SERVICE_TOOL_PATHS, so the
other ~150 cloud products were unreachable until someone cut a Python release.
Project the surface from cloud's /v1/openapi.json instead: cloud tags every
operation with its product (the first path segment after /v1/), so that document
already IS a service/action catalog. 166 services are now reachable, and a newly
mounted app is callable the moment cloud serves it.

Still exactly one MCP tool — agents degrade badly with hundreds — now shaped
hanzo(service, action, params, method), with `services` listing the catalog and
an empty action listing a service's actions.

Delete the local Infinity vector store (3,546 lines). It shipped no embedder, so
its only possible output was random vectors: it ranked "Bananas are yellow" above
an auth document for the query "authentication oauth jwt". A previous fix put the
mock behind HANZO_VECTOR_ALLOW_MOCK, but a fake that a flag can re-enable is
still a fake, and a tool that lies to an agent is worse than a missing one. The
package keeps only the cloud-backed VectorTool, and a test now fails if any
module in it imports `random`.

Make the legacy-tool gate honest: hide the per-service tools only once the
unified tool genuinely imports. It does not import against released hanzo-tools
(HanzoCloud is newer), and disabling them unconditionally would have left no
cloud tools at all.

- spec.py: catalog projection, cache keyed per spec source, stale cache beats
  failing a call. HANZO_OPENAPI_URL decouples catalog from target so a partial
  local host can be driven with the full registry.
- HanzoCloud.call: one generic seam for the verbs the spec names (PUT/PATCH/
  DELETE); auth also resolves the hanzo CLI's IAM session, memoized.
- 40 new tests covering action naming, template binding, method inference,
  param split, and cache fallback.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 20:25:54 -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 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 4ebf26df3e 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 8c05bf99d6 fix(ci): pin black <26.1 to avoid internal error, lower requires-python to 3.12
Black 26.1.0 crashes on multiple exception types in parentheses.
The requires-python bump to 3.14 broke CI which runs Python 3.12.
2026-03-01 16:01:16 -08:00
zeekay 6c376a4d13 [chore] bump all packages to Python 3.14+
Update requires-python to >=3.14 in all 46 pkg/ pyproject.toml files
and the root pyproject.toml (47 files total).
2026-02-28 12:43:10 -08:00
zooqueenandHanzo Dev b144973bfc fix(lint): resolve all ruff + black errors across all packages
Fix 35 ruff errors (E722, F841, B904, B905, B007, E741, S202, S310,
S306, S110, TID251, UP042, F401) and run black on 526 files.

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-21 23:32:32 -08:00
zooqueenandHanzo Dev 920f767417 style: auto-fix ruff lint and format for Python 3.12
Run ruff check --fix and ruff format across the repo to fix ~495
auto-fixable lint errors (mostly I001 import sorting) and reformat
225 files to match the py312 target.

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-20 21:29:31 -08:00
zeekay 8e0f575a1c feat: auth/IAM refactor + add hanzo-iam and hanzo-web3 packages
- Rewrite auth.py with full OAuth token management flow
- Rewrite iam.py with comprehensive IAM commands (users, orgs, apps)
- Add hanzo-iam package for IAM SDK
- Add hanzo-web3 package for blockchain SDK
- Update API providers for new auth flow
2026-02-12 20:47:40 -08:00
zeekay 73fbba8141 feat: add hanzo-kms package, MCP proxy tools, and agent reflexion
- Add hanzo-kms v1.0.0: Secret management SDK compatible with Infisical API
  - Sync and async clients with multiple auth methods (Universal, AWS IAM, Azure, GCP, K8s)
  - Full CRUD operations for secrets with environment injection

- Add MCP proxy system for lazy-loading external MCP servers
  - mcp_proxy.py: Dynamic MCP server connection and tool discovery
  - proxy_tool.py: Tool for managing external MCP server proxies
  - platform_auth.py: Hanzo Platform authentication utilities
  - Built-in servers: platform, github, cloudflare, postgres, sqlite, docker, k8s

- Add agent reflexion module for self-correction and rule management
  - ReflexionEngine for reflection and rule-based behavior updates
  - Integration with hanzo-memory for persistent rules

- Add self_learning_agent example demonstrating reflexion capabilities

- Update ps_tool with improved process management and log handling
- Update browser tools with enhanced CDP bridge and automation
- Bump dependency versions across all tool packages

All tests pass (3156 passed)
2026-02-04 10:55:08 -08:00
zeekay 2940310a5d chore: update sub-package dependencies for security fixes
- Update uv.lock files in all sub-packages
- python-multipart 0.0.21 -> 0.0.22 (arbitrary file write fix)
- urllib3 2.6.1 -> 2.6.3 (decompression-bomb fix)
- Various other dependency updates

Note: docs/package-lock.json has next.js vulnerabilities that need
manual resolution due to npm dependency conflicts.
2026-02-02 22:40:00 -08:00
zeekay 6326973161 feat: add hanzo-tools-api package and hanzo.infra SDK
Add generic REST API tool for calling any API via OpenAPI specs:
- 30+ built-in provider configs with env var auto-detection
- 1100+ auto-generated providers from APIs.guru + oapis.org
- Secure credential management with pluggable storage
- OpenAPI spec parsing with ETag caching
- Agent-friendly interface with search, overview, call actions

Add hanzo.infra unified infrastructure SDK:
- Vector (Qdrant), KV (Redis/Valkey), DocumentDB (MongoDB)
- Storage (S3/MinIO), Search (Meilisearch), PubSub (NATS)
- Tasks (Temporal), Queues, Cron, Functions (Nuclio)
- Async clients with lazy initialization and health checks
- Optional deps via [infra-*] extras

Bump hanzo-mcp to v0.11.4 with api tool integration.
2026-01-19 23:00:17 -08:00