14 Commits
Author SHA1 Message Date
hanzo-dev e8ed3ca727 regenerate from cloud@5126939 — the client leaves the hand-merged lineage
pkg/hanzoai/cloud goes +2186 -2126 ~175: 1700 paths / 2354 operations / 2186
schemas, 182 api modules and 2172 model modules, against the 239/1116 it carried
from hanzo.yaml. The document is hanzoai/cloud's own emission now, pinned in a
new .spec-lock by commit and sha256, and generate.py reaches it by value —
--skip-validate-spec means the 1012 missing-`responses` errors no longer write
zero files, so a client can be cut from the authority instead of a projection of
it.

Two renamings come with that, and both are the fix rather than the damage. IAM's
types are namespace-qualified (iam.Role, iam.Application, 95 of them) because a
bare `Role` was two unrelated shapes wearing one name. And the <svc>_ prefix is
gone from every operationId, so every generated method lost it.

The prefix is what broke the examples, and the gate saw only two thirds of it.
Four flows failed on their imports; `money` and `tools` PASSED while every call
in them named a method that no longer existed — an import resolves the names in
the `from … import` line and a method is looked up at call time. All five flows
now name operations that exist, checked by resolving each one as an attribute,
and hanzo.yml records that ceiling so the next reader does not trust the gate
for more than it says.

`chat` is removed, which is a measurement and not a preference: cloud declares
POST /v1/chat/completions with no requestBody and no responses at all, so the
generated method takes no body and returns None — the one call a chat example
exists to make cannot be expressed. Inventing the type, or hand-rolling the HTTP
inside a generated client, is the drift these SDKs exist to prevent; js-sdk
dropped its own chat flow at 2.0.7 for exactly this. It returns the release
cloud gives that route a body.

Two smoke assertions were already red before this regeneration and are now true
again: they pinned AIApi/APIKeysApi/MCPApi and AdminApi.plugin_admin_*, names
from the retired lineage. The surface is all still there under AiApi/KeysApi/
McpApi and AdminApi.admin_plugins.

tests/test_zap_transport.py still errors, exactly as it did before: it imports
`Hanzo` from hanzoai, which the hand-written package does not define. That is
not this document's business and is untouched.

Minor rather than patch: every generated method changed name.

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-08-05 11:00:03 -07:00
hanzo-dev cebcc4fa0c regen the cloud client from the resynced spec (1f9b03b) and repoint every flow
Publish PyPI / Build and publish (push) Failing after 8s
The document grew: cloud's woven spec was merged and won, taking hanzo.yaml from
1132 paths / 1519 operations / 779 schemas to 1737 / 2452 / 1798.
pkg/hanzoai/cloud/ is now 263 api + 2031 model modules, all importing.
`generate.py python --check` reports [python] clean.

The resync also RENAMED nearly every operationId to cloud_<method>_<path>, which
renames every generated method: billing_billingBalance became
cloud_get_v1_billing_balance, cloud_AgentsController.Create became
cloud_post_v1_agents. Examples written against the old names stop resolving —
exactly what the examples gate exists to catch. It went red; this is the fix.

Every flow was re-probed against api.hanzo.ai unauthenticated and with a bogus
key, because a spec says what SHOULD be served and only a request says what IS.
All eleven operations answer 401/403 — routed and identity-gated. Two moved:

  store  to the PROVISIONING plane (POST /v1/kv, GET|DELETE /v1/kv/{name}). The
         per-key data plane the spec also describes is mounted nowhere: GET
         /v1/kv/keys/{key} 404s, PUT and DELETE 405, kv.hanzo.ai 404s the whole
         prefix. A round-trip on keys could not run.
  tools  to GET /v1/tools, the catalog. A live JSON-RPC door at POST /v1/mcp
         answers tools/list with 730 tools but is absent from hanzo.yaml, so the
         generator emits no method and an example would have to bypass the SDK
         to reach it. Of the declared MCP routes /v1/automations/mcp returns 405.

hello stays on bot_authMe: /v1/ai/account answers 200 with
type="anonymous-user" to a request with NO Authorization header, so a hello
built on it certifies a key that would 401 everywhere else.

All six run and report the server's own refusal for a bogus key:
  hello  403 no validated principal      store  403 X-Org-Id required
  chat   401 API key validation failed   agent  403 X-Org-Id required
  money  401 sign in to view billing     tools  403 a validated principal required

money goes through the generated *_without_preload_content variant, because its
two operations are declared with a `default` response and no content so the
typed methods return None though the server sends JSON — a spec gap, and not a
small one: 696 of 2425 operations model no response body. That raw variant does
NOT raise on 4xx (the check lives in the typed deserialization these lack), so
the example checks status itself; without it a 401 body printed as the balance.

3.1.5 -> 3.1.6. 3.1.5 is live on PyPI, so this is a real patch above it.

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-07-31 09:08:30 -07:00
hanzo-dev bb9e1f1b25 regen the cloud client, add the six canonical flows, and gate them in CI
Publish PyPI / Build and publish (push) Failing after 1m22s
REGENERATED pkg/hanzoai/cloud/ from hanzo.yaml @ 07783f5 via the canonical
driver (hanzoai/openapi generate.py python) — 1132 paths, 1519 operations, 779
schemas, landing as 239 api + 1116 model modules. `generate.py python --check`
reports `[python] clean`: the committed tree is byte-identical to a fresh
generation, with no local strip of any kind.

The path count fell from 1885 because the spec deleted 18 products it authored
and served nowhere. Nothing here was lost to a collapse — LLM.md carried an open
defect saying 127 of 411 operations went missing to 23 case-variant tag groups
(AI/ai, Users/users). That is now fixed upstream, and this regeneration proves
it: 239 distinct tags produce 239 api modules, exactly 1:1.

Generating at all required two spec fixes. Both landed in hanzoai/openapi first,
neither is patched here:
  - fc0c17a  35 /v1/platform operations carried no `responses`. OAS 3.x requires
             it and openapi-generator aborts the whole document, so hanzo.yaml
             was producing no client in ANY language.
  - 07783f5  ChatCompletionResponse.choices was `items: {type: object}` — so
             choices[0].message.content came out List[object], unusable without
             a cast, on the most-called route in the API.

SIX EXAMPLES under examples/{hello,chat,money,store,agent,tools}, plus
examples/client.py as the single place a base URL or an env var is resolved.
Same six, same names, same order as the TypeScript set, so a reader who knows
one can navigate the other. They import from hanzoai.cloud — the generated
surface new work targets — not the frozen pkg/hanzoai/{api,models}.

Each flow's call sits behind `if __name__ == "__main__":` deliberately: that is
what lets the gate IMPORT all six to prove every `from hanzoai.cloud import X`
still resolves, with no API key and no socket. A spec change that renames or
drops an operation goes red in CI instead of in a user's app.

CI is the fleet convention and this repo had none: root hanzo.yml + a 7-line
cicd.yml importing hanzoai/ci. The gate is two blocks — import every generated
module (for generated code that IS the build step; there is no compiler to catch
a bad $ref or a model referencing a class the generator declined to emit), then
import the six flows. Both provision an interpreter with uv, because the arc
runner image promises none and a gate that silently no-ops is worse than none.

Scope is deliberate: the cloud client and its flows, not all 65 packages, so a
red gate means "the client the spec just produced is broken" rather than
"something, somewhere". Publishing is untouched — .hanzo/workflows/publish-pypi.yml
stays canonical because it reads the PyPI token from KMS. Two publish paths is
one too many.

3.1.4 -> 3.1.5. PyPI still serves 3.1.1; the tree has been ahead since the KMS
secret at hanzo/prod/python-sdk-publish went unseeded.

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-07-30 23:10:34 -07:00
Zoo Queenandhanzo-dev 6438aabae8 fix(lint): add strict=False to zip() in using_grok example
Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-02-21 23:42:27 -08:00
Zoo Queenandhanzo-dev 8bd394fd15 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 <dev@hanzo.ai>
2026-02-20 21:29:31 -08:00
Zach Kelling 21343d4bd9 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
Zach Kelling d10d3734aa fix: run ruff check --fix and format across entire codebase 2025-12-26 04:31:06 -08:00
hanzo-dev 1eff99f2e6 fix: resolve all lint issues for CI compliance
- Fix import sorting in multiple files
- Replace bare except with except Exception
- Remove broken auth file with syntax errors
2025-09-07 15:43:50 -05:00
hanzo-dev eff8fedef2 refactor: Rename cluster to node and add router management
- Renamed 'cluster' terminology to 'node' throughout codebase for clarity
- Added new 'hanzo router' command for managing LLM proxy server
- Added zsh shell tool with automatic shell detection (prefers zsh over bash)
- Fixed REPL to use cloud mode by default to avoid local server dependency
- Updated chat command to try router (port 4000) before local node (port 8000)
- Added comprehensive Grok documentation to README
- Created NODE_COMPATIBILITY.md documenting integration with desktop app and network

BREAKING CHANGE: 'hanzo cluster' commands now use 'hanzo node' - old commands still work via aliases

Key changes:
- hanzo node start/stop/status - manage local AI nodes
- hanzo router start/stop/status - manage LLM proxy router
- hanzo node worker - manage node workers (formerly cluster nodes)
- Zsh is now default shell when available
- Router runs on port 4000, nodes on port 8000
- Full compatibility with Hanzo desktop app and network layer
2025-09-06 03:27:43 -05:00
hanzo-dev c1794795c0 feat(mcp config): support tools.*.enabled; feat(fs): 'symbols' alias for 'ast'; test: disable pytest plugin autoload for local+CI; chore: bump mcp to 0.8.3; docs: update AGENTS.md; integrate new unified agent architecture + model registry + batch orchestrator 2025-09-05 20:28:26 -05:00
hanzo-dev 0fb978c4fd feat: Add CLI tools support to hanzo-mcp with batch execution
- Implement unified CLI tools module for all AI providers
- Add support for claude/cc, codex, gemini, grok, openhands/oh, hanzo-dev, cline, aider
- Enable parallel batch execution of CLI tools
- Add comprehensive test suite with 16 passing tests
- Fix typing issues with mypy strict mode
- Add GitHub Actions CI/CD workflow with optional integration tests
- Support authentication flow for all providers
- Follow DRY principle with single source of truth
2025-09-05 18:26:03 -05:00
hanzo-dev d64fedfe04 Fix all test issues and achieve 100% test pass rate
- Remove all unconditional pytest.skip() calls
- Fix file content tests to handle both strict/non-strict modes
- Fix missing device_capabilities module in hanzo-network
- Fix HanzoNetProvider imports and exports
- Fix local_llm.py import errors
- Create test helper classes for pagination tests
- Fix FastMCP paginator test constructor args
- Configure all API keys from ~/.zsh/after.zsh
- All tests now pass or skip conditionally based on actual requirements
2025-08-12 16:19:34 -05:00
hanzo-dev eca8bac8e5 Update python monorepo 2025-07-27 03:02:44 -05:00
stainless-app[bot] 9626b2b0d6 initial commit 2025-03-15 03:31:14 +00:00