Commit Graph
131 Commits
Author SHA1 Message Date
zeekay 9e93ffbeb2 Name the rest of the stack without importing it
`import hanzo` ran the CLI's module body, so it needed click, rich, httpx and
everything else in the list before it could tell you its own version — on a
bare interpreter it did not import at all. It also read `__version__` back off
this module from `cli`, a cycle that only worked because the assignment
happened to sit above the import.

Both go away by naming things instead of importing them. `__getattr__`
(PEP 562) resolves a member on first touch and caches it, so `hanzo.cloud`
costs nothing until somebody wants the cloud client, and the second touch is a
dict lookup. A member that is not installed says which distribution to install
rather than raising ModuleNotFoundError from somewhere inside us.

This is the shape the npm package and the Rust crate already had: one front
door, everything behind it, nothing loaded that was not asked for. One table
maps a name to its distribution, so adding a member is one line.
2026-09-05 18:15:02 -07:00
zeekay b1ab1198c1 Address the estate at /v1, not /api/v1
Two defaults carried an /api/ prefix this estate does not serve: the commerce
base and the DNS endpoint.

Neither resource answers at either spelling today — api.hanzo.ai serves commerce
carts under /v1/commerce and none of the products or orders this tool asks for,
and dns.hanzo.ai answers nothing at all. The prefix is the part that was wrong
either way; what those tools reach is a separate question.
2026-08-30 16:29:33 -07:00
zeekayandHanzo Dev d6ecee069c iam: pass the scope through, and let the server's refusal speak
Which list routes insist on an owner is the server's rule, and it moves. The
deployed binary requires one on users, sessions and applications and not on
roles, permissions, providers, workspaces, invitations, tokens or audit-logs;
the change that resolves a listing's tenant centrally is written but unreleased.

So nothing here keeps a copy of that rule. The IAM tool no longer refuses a
missing owner on applications and sessions, get_applications takes an owner
rather than demanding one, and no docstring or parameter description promises
that leaving it off makes the credential decide — today that answers 400.

A refusal now reaches the caller as the reason IAM gave rather than as a
transcribed body: the RFC 9457 detail, or the envelope's msg where the route
answers the envelope, which is how memberships refuses.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-24 03:42:08 -07:00
zeekayandHanzo Dev 95e2025681 iam: address the rows IAM serves, and read the shape each route answers
A row is named by owner and name — /v1/iam/users/hanzo/z — read with GET,
replaced with PUT, removed with DELETE. The hand-written clients reached for
verb-noun addresses, and the CLI and route table reached for a verb hanging off
the collection; both spellings are gone from the server.

A collection GET answers a wrapper keyed by the plural, and the key is not
always the word in the path — audit-logs answers auditLogs. Every reader now
takes the key from the table and raises when it is absent, because reading a
missing key as [] reports "none" for a healthy org. A row answers the record
itself, absence is 404, and a refusal is an RFC 9457 problem document carrying
the reason. account, memberships, password and login keep the {status, msg,
data} envelope and have their own reader.

The credential goes in Authorization as client_secret_basic, which is where IAM
reads one; the pair used to ride the query string, where it authenticated
nothing and landed in every log on the path. A password rides beside the user
row rather than inside it, so IAM hashes it and nothing writes it in the clear.
An update reads the row before replacing it, since PUT replaces the whole
record.

Role membership is the role's own users list, so adding and removing a member
reads the role, edits the list and writes it back.

The IAM tool drops enforce, system_info and health; the team tool reaches
IAM's workspaces, memberships, invitations and account instead of deferring to
an address it never had. Both name organizations only when the caller does —
IAM scopes the read, and a hardcoded owner is a refusal for everyone outside it.

The CLI route table is checked against IAM's own registered routes, and every
address here was verified against the running server.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-24 03:36:48 -07:00
zeekay aa18787d58 hanzo iam: address the routes IAM serves
Every command in this tree called /api/get-users, /api/set-password,
/api/add-provider and twenty-five more — the Casdoor-era surface. IAM
serves /v1/iam/<entity> and /v1/iam/password; all twenty-eight 404d. The
client id and secret rode in the query string besides, where the server
never looks and every log does.

IAM's entities all have the same five routes, so this is one
implementation of them over a table of fourteen entities rather than
fourteen hand-written command trees: 1391 lines to 300, and every entity
gains the verbs only some of them had. The credential goes in
Authorization — Basic for a confidential client, a bearer when one is
exported — and configure writes ~/.hanzo/auth.json 0600.

test_iam_cli reads IAM's own route registrations out of its Go source and
asserts every route this CLI names is one of them: 70 checked, and it is
what caught certs/get answering GET where the table said POST.
2026-08-23 12:46:01 -07:00
zeekayandHanzo Dev 22c0e467a3 cli: drop 'hanzo install runtime'
hanzoai/runtime is archived. The subcommand set up a checkout at
~/work/hanzo/runtime and installed the hanzo-runtime / @hanzo/runtime
SDKs — a source tree that no longer exists and packages that were never
really released (npm only ever had 0.0.0-dev; PyPI's last release was
2025-07-15).

Verified: hanzo.commands.install imports clean and install_group now
exposes 13 subcommands with 'runtime' absent.

(cherry picked from commit 16d31994dd)

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-15 09:07:02 -07:00
zeekay ef4f774da5 the credential comes from the environment
This script carried its key as a literal. A key in a source file is a key in
every clone of that file, and this repo mirrors publicly, so the value must be
rotated independently of this change — removing it from the tip does not remove
it from history.

Reads OPENROUTER_API_KEY and exits with a clear message when it is unset.
2026-08-14 16:51:14 -07:00
zooqueen 7166ca70bf chat: point at the two commands that actually start a local endpoint
`hanzo router start` and `hanzo serve` are neither of them commands. The cloud
comes up with `hanzo up`; one model with `hanzo engine serve`.
2026-08-14 16:30:13 -07:00
zooqueenandHanzo Dev 20a2178e61 auth: the two key shapes are pk- and sk-, and one sentence says so
Cloud's APIKeyPrefixes admits pk- and sk- only (auth_identity.go, 4b030b77).
The lsp tool still told the user to set an hk- key, which cloud resolves to no
principal — following the message produced a key that could never authenticate.

The message is now a single NO_KEY beside the resolver that mints it, exported
from hanzo_tools.core, so a second tool reporting it cannot spell it differently.
Resolution order is untouched: HANZO_API_KEY, then ~/.hanzo/config.json .apiKey,
then the CLI's IAM session.

vector_index names the split cloud actually draws: pk- publishable for read,
sk- secret for write.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-08 15:04:19 -07:00
zeekayandHanzo Dev bcffc56ee3 pypi: one canonical hanzo, and superseded packages that say where the real one is
Three published packages declared a console script named `hanzo`, competing with
the native CLI and with each other. Measured on a clean venv at hanzo==0.4.3:
`hanzo --help` printed hanzo-cli's program, not the one pkg/hanzo/README.md
documents. Renamed to `hanzo-py` and `hanzo-cli` — script named after its
distribution. Nothing is yanked; both packages still install and run.

- pkg/hanzo 0.4.4 — summary and README now say the CLI is a native binary
  (curl -fsSL https://hanzo.sh | sh). Dropped the invented command tour
  (`hanzo chat --model gpt-4`, `hanzo node start`, `hanzo router start` on
  localhost:4000): none of those verbs exist in the program this package
  installs. Kept the three library entry points, each import-checked.
- pkg/hanzo-cli 0.2.4 — `hanzo login` replaced with the native `hanzo auth login`
  plus its own `hanzo-cli login`. Verified `hanzo iam users list` and
  `hanzo kms secrets list` against the shipped v1.9.18 binary.
- pkg/hanzo-node 0.1.1 — states the two meanings of the name: the `hanzo-node`
  COMMAND is a symlink to the Hanzo CLI; this package fetches a different binary
  from hanzoai/node, which is private, so the download 404s for the public.
  Documentation URL moved off docs.hanzo.ai/node (404) to hanzo.sh.
- root README (published as `hanzoai`) — `pip install hanzo` no longer advertised
  as the CLI; model ids zen-coder -> zen5-coder (zen-coder is not in the catalog);
  "2452 operations, 1798 schemas" dropped for the spec URL, since the live
  surface is 1058 paths / 1465 operations / 1139 schemas.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-01 13:35:20 -07:00
zeekayandHanzo Dev 9a8b4b5c46 fix(cli): pip install hanzo shipped a 10-command CLI, not the 56-command one
`hanzo` depends on `hanzo-cli`, and BOTH declared `[project.scripts] hanzo`.
Entry-point resolution is install-order dependent, so which CLI a user got was
a coin flip — and hanzo-cli kept winning. The result:

  $ hanzo auth login
  Error: No such command 'auth'.

So the "auth login is broken by Cloudflare 1010" story was real but unreachable:
users never got as far as the HTTP call, because the binary they had did not
have an `auth` command at all. Publishing that fix would have changed nothing.

One command, one owner:
- hanzo-cli drops its console script. `hanzo` is the ONE command.
- `paas` and `bot` are mounted into it — the only two groups with no equivalent.
  `kms` is NOT mounted: `hanzo secrets` is a strict superset (audit/grant/
  revoke/rollback/rotate/versions on top of the same get/list/set/delete), and
  two commands for one concern is what we are removing.
- hanzo_cli grows a __main__ so it stays invocable as `python -m hanzo_cli`,
  and its e2e suite targets that instead of whatever `hanzo` resolves to.

Endpoints, one definition:
- models.IAMConfig (the class the package EXPORTS) gains the HIP-0111 endpoint
  properties. config.IAMConfig had them, but nothing imports that one — a
  second same-named class nobody uses is how the legacy path survived.
- config.py + fastapi.py stop hand-assembling paths and read the constants.
- password_login posted to `/oauth/token`, which is not a 404: IAM serves a
  200 text/html SPA catch-all for unregistered paths, so it received a login
  PAGE and json() blew up on HTML. Verified: legacy 200 text/html vs canonical
  401 application/json.

PKCE, because this is a public client:
- browser_login ships no client_secret, so the authorization code was the only
  secret in the flow and it arrives over a plaintext loopback redirect. The SDK
  already accepted code_challenge/code_verifier; the CLI simply never passed
  them. RFC 8252 §8.1 / RFC 7636 S256.

Version, one source:
- pyproject said 0.4.4, __init__ said 0.3.47, cli.py said 0.3.48, and the
  installed binary reported 0.1.0 — four answers, none right. Now resolved
  from the installed distribution.

Verified on a clean venv: entry-point providers 2 -> 1, commands 10 -> 58,
`hanzo --version` 0.1.0 -> 0.4.4, all four endpoints canonical. hanzo-iam
19/19 pass; hanzo-cli's 20 failures are unchanged before and after and are all
live-service auth (no stored token in this environment).

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-26 14:51:42 -07:00
zeekay a74176fa6c release(cli): hanzo 0.4.4 — auth login actually works
Ships 50d442eb. 0.4.3 cannot complete a login at all: Cloudflare rejects
urllib's default User-Agent in front of hanzo.id with `error code: 1010`, so the
token exchange 403s AFTER the user has already signed in through the browser.
Also adds the PKCE S256 that flow never had, and moves off the legacy
/oauth/* + /api/device/code paths onto the canonical /v1/iam/oauth/* surface
hanzo.id advertises.

Patch bump from the last published version (0.4.3), per the release rule.
2026-07-26 11:26:33 -07:00
zeekay 8183b16aa4 fix(cli): auth login was broken end-to-end — Cloudflare 1010, no PKCE, legacy paths
Three defects in `hanzo auth login`, found while auditing HIP-0111 compliance.

1. LOGIN DID NOT WORK AT ALL. urllib defaults its User-Agent to
   `Python-urllib/3.x`, which Cloudflare refuses in front of hanzo.id with
   `error code: 1010` — a 403 that never reaches IAM. The browser leg looked
   fine, the user signed in, and THEN the token exchange died, so the failure
   landed after the user had already authenticated. Measured on the live host:

     POST /v1/iam/oauth/token   UA=Python-urllib/3.11 -> 403 (CF 1010)
     POST /v1/iam/oauth/token   UA=hanzo-cli/python   -> 400 (reaches IAM)
     POST /v1/iam/oauth/device  UA=Python-urllib/3.11 -> 403 (CF 1010)
     POST /v1/iam/oauth/device  UA=hanzo-cli/python   -> 400 (reaches IAM)

   Every outbound request now identifies itself. The device flow was dead the
   same way.

2. NO PKCE. The flow had zero code_challenge/code_verifier — `state` only,
   which is CSRF protection, not interception protection. HIP-0111 Security
   Considerations makes PKCE S256 mandatory, and RFC 8252 §8.1 requires it for
   native apps specifically: this redirects to a fixed loopback port (1456) that
   any local process can bind or race, so an intercepted authorization code was
   directly redeemable. Now S256, with the verifier bound into the exchange.
   hanzo.id advertises `code_challenge_methods_supported: ["S256"]`.

3. LEGACY PATHS (HIP-0111 §4.4). It called `/oauth/authorize`, `/oauth/token`
   and `/api/device/code` — the `/oauth/*` and `/api/*` spellings the standard
   retired, the latter breaking the absolute "no /api/" rule. Replaced with the
   canonical paths hanzo.id actually advertises in its discovery document, held
   in ONE constant block so no call site spells a path itself (§4.3):

     /v1/iam/oauth/authorize   /v1/iam/oauth/token   /v1/iam/oauth/device

   `/api/device/code` was not merely non-canonical — it answers 401; the real
   device endpoint is `/v1/iam/oauth/device`, per discovery.

Also drops a redundant function-local `import base64` now that the module
imports it.
2026-07-26 11:09:23 -07:00
zeekay c3dd9e752a release: bump auth-fixed packages for publish
Ship the canonical hanzo-app client_id + /v1/iam/get-account fixes:
- hanzoai 2.2.2 → 2.2.3
- hanzo-cli 0.2.1 → 0.2.2
- hanzo 0.4.2 → 0.4.3
- hanzo-tools-auth 0.1.0 → 0.1.1
2026-06-30 22:21:53 -07:00
zeekay 6837c96a23 auth: align all SDK packages to canonical <org>-<app> client ids
IAM seeds apps as <org>-<app> (iam cmd/iam/cli/init_apps.go:57-59):
hanzo-app, zoo-app, lux-app — AppName == ClientID. Several packages used the
inverted 'app-hanzo'/'app-hanzobot' or placeholder '*-client-id', none of which
IAM knows — device/PKCE login would fail. One value, everywhere:

- hanzoai/auth.py: login_with_pkce default -> IAM_CLIENT_ID (hanzo-app)
- hanzo-cli/auth.py: DEFAULT_APP, DEFAULT_CLIENT_ID -> hanzo-app
- hanzo/commands/auth.py: IAM_CLIENT_ID -> hanzo-app
- hanzo-tools-auth/session.py: DEFAULT_APP, DEFAULT_CLIENT_ID -> hanzo-app
- hanzo/commands/iam.py: --app default + doc example -> hanzo-app
- hanzo-cli/bot/commands.py: BOT_IAM_APP/CLIENT_ID app-hanzobot -> hanzo-bot
2026-06-30 17:23:10 -07:00
ecd7412ac9 Point cloud clients at canonical api.hanzo.ai front door (#42)
The cloud API now sits behind one front door (ingress -> gateway -> cloud).
api.cloud.hanzo.ai / cloud-api.hanzo.ai / functions.hanzo.ai are redundant
aliases routing to the same backend, so migrate clients to api.hanzo.ai.

- hanzo-tools-ui: HANZO_CLOUD_API default cloud-api.hanzo.ai -> api.hanzo.ai
  (docs RAG paths /api/search-docs|chat-docs|index-docs are served at /api on
  the cloud backend per AUTH_PUBLIC_PATHS; kept as-is)
- hanzo base status: Functions remote host functions.hanzo.ai ->
  api.hanzo.ai/v1/functions (the canonical gateway path)

Non-breaking: the aliases still resolve to the same backend.

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-30 16:49:00 -07:00
bd0307b62b refactor(iam): drop Casdoor branding — Hanzo IAM only (white-label) (#41)
Co-authored-by: Hanzo Dev <[email protected]>
2026-06-30 14:56:32 -07:00
zeekayandGitHub 7f932fc17d fix(iam): migrate userinfo/get-account to canonical /v1/iam/oauth/userinfo (HIP-0111) (#38)
Co-authored-by: Zach Kelling <[email protected]>
2026-06-24 19:16:18 -07:00
zeekay 1aed790688 deps: drop legacy HANZO_IAM_/HANZO_CLIENT_ID env-var fallback in consumer pkgs
Follow-up to 9c377be (hanzo-iam 1.30.0). Consumer packages now read only
the canonical IAM_ prefix — no upstream-brand alias chain, matching the
new IAMConfig.ENV_PREFIX contract enforced by test_env.py.

Touched modules:
- hanzo-cli: hanzo_cli/auth.py, hanzo_cli/bot/commands.py
- hanzo-tools-auth: hanzo_tools/auth/session.py
- hanzo-tools-iam: hanzo_tools/iam/iam_tool.py
- hanzo: src/hanzo/commands/{auth,iam}.py
- hanzoai: auth.py, llm_client.py
- tests: test_auth_pkce.py (import IAM_CLIENT_ID)

Also adds the generated pkg/hanzo-iam/uv.lock — matches the convention
of the other 17 axis pkgs that track their lockfiles.
2026-05-14 23:39:31 -07:00
zeekay 61ca043a3d style: black --target-version py312 (unblock publish CI) 2026-05-13 13:54:58 -07:00
zeekay ebb04882d6 feat: hanzo-dev Python TUI + LSP + hooks + sandbox + vim + git + multi-auth + full parity
Rename hanzo-repl → hanzo-dev to match @hanzo/dev (Rust/TS).

New packages:
- hanzo-lsp: async LSP client (diagnostics, go-to-def, references, context enrichment)
- hanzo-hooks: pre/post tool use hooks (shell scripts, exit-code deny)
- hanzo-sandbox: container detection, filesystem isolation, Linux unshare

hanzo-dev TUI:
- Vim keybindings (Normal/Insert/Visual/Command modes, 37 tests)
- Git slash commands (/branch /commit /worktree /diff /stash, 13 tests)
- All slash commands at parity: /model /permissions /clear /resume /memory
  /init /export /session /plan /solve /code /auto /fast /remote-control
- Multi-provider auth: Anthropic OAuth, OpenAI device code, Hanzo PKCE, auto-detect

Auth:
- login_with_anthropic() — PKCE via console.hanzo.ai
- login_with_openai() — device code flow via auth.openai.com
- login_auto() — env var detection + saved credential fallback
- OAuthCredentialStore supports provider keys (hanzo/anthropic/openai)

Parity test suite (38 tests): SSE, MCP normalization, permissions, compaction,
token usage, PKCE RFC vector, config, backoff, session roundtrip, hooks.

348 tests total, 0 failures across Python + Rust + Universe E2E.
2026-04-01 10:41:46 -07:00
zeekay 20778ab5c8 rebrand: PostHog→Insights in MCP analytics 2026-03-13 16:52:56 -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 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 9491fc94bb fix(ci): apply black formatting and bump hanzo-mcp to 0.12.3 2026-03-04 11:57:07 -08:00
zeekay 6c8d3c69b9 fix(ci): clean lint/format and bump hanzo-mcp to 0.12.2 2026-03-04 11:53:51 -08:00
zeekay 0279142e4a fix: finalize latest MCP/CLI/SDK updates 2026-03-04 11:27:19 -08:00
zeekay 483d645dd9 feat(dns): add multi-provider DNS CLI
- hanzo dns zones/list/add/rm/update commands
- Multi-provider architecture: Cloudflare + CoreDNS
- Parallel queries across all configured providers
- Provider abstraction for easy extension (Route53, GoDaddy, etc.)
- Thread-safe parallel execution with ThreadPoolExecutor
- Legacy credential format backward compatible
2026-03-03 23:04:29 -08:00
zooqueen 2d66f60f4c fix(ci): apply black formatting to base.py and enhanced_repl.py
Reformat multiline string arguments in write_text() calls and
collapse a ternary expression to satisfy black<26.1 style check
in the Test Hanzo Python SDK CI workflow.
2026-03-03 07:58:23 -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
2bb73348f4 feat(iam): add set-password and enforce-hashing CLI commands (#27)
* feat(iam): add set-password and enforce-hashing CLI commands

Adds two new top-level IAM commands:
- `hanzo iam set-password USER` — directly set/reset a user's password
  via the /api/set-password endpoint (server-side argon2id hashing)
- `hanzo iam enforce-hashing` — set org passwordType to argon2id and
  audit all users for plaintext passwords

* style: format iam.py with black line-length rules

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-26 12:38:49 -08:00
zeekay d094a8b481 rebrand: rename litellm module to llm — complete purge
All imports, test files, docs, and config references updated.
import litellm → import llm across entire codebase.
2026-02-25 15:13:14 -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 964a72bd24 fix(lint): run black formatter on all 69 unformatted files
Co-authored-by: Hanzo Dev <[email protected]>
2026-02-21 14:49:49 -08:00
zooqueenandHanzo Dev ad65de44e1 fix(lint): resolve all ruff E722, S310, S202, S103, B905 errors
Replace bare except with except Exception, add noqa for legitimate
URL opens, tarfile extraction, chmod on installed binaries.

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-21 14:44:43 -08:00
zooqueenandHanzo Dev 24739539d0 fix(cli): sort imports to satisfy ruff I001 lint rule
Co-authored-by: Hanzo Dev <[email protected]>
2026-02-21 13:56:05 -08:00
zooqueen 450cbbf689 feat(cli): replace all 18 stub commands with real API implementations
Every service command (vector, kv, search, doc, events, pubsub, queues,
jobs, secrets, tasks, fn, auto, flow, ml, o11y, cx, growth, platform)
now makes authenticated HTTP calls via shared service_request/check_response
utilities in base.py. No stubs, no hardcoded data, no placeholders.

Bump hanzo 0.4.0→0.4.1, hanzo-cli 0.2.0→0.2.1.
2026-02-21 13:46:55 -08:00
zooqueen dacfe25597 feat(cli): add bot commands, s3 storage, dev/net passthrough
- Add `hanzo bot` command group (status, logs, deploy, env, events) via PaaS API
- Replace all storage placeholders with real boto3 S3 API calls to s3.hanzo.ai
- Rename `hanzo storage` → `hanzo s3` (storage kept as alias)
- Rewrite `hanzo dev` as lazy-install passthrough to @hanzo/dev binary
- Rewrite `hanzo net`/`hanzo node` as passthrough to hanzod binary
- Remove ~350 lines of inline orchestrator/node code in favor of os.execvp()
2026-02-21 11:54:01 -08:00
zooqueenandHanzo Dev 7d3d318e5e feat(cli): add k8s kubectl wrapper and remove REPL
- Add `hanzo k8s` command group to hanzo-cli that wraps kubectl with
  Hanzo-managed auth and default namespace. Uses KubectlGroup that
  dynamically proxies unknown subcommands to kubectl (e.g.
  `hanzo k8s get pods` -> `kubectl get pods -n hanzo`).
- Remove REPL mode from hanzo wrapper: bare `hanzo` now shows help
  instead of dropping into interactive REPL.
- Remove hanzo-ai, hanzo-chat, hanzo-repl entry points.
- Make hanzo-cli a core dependency of hanzo (was optional [cli] extra).
- Remove unused typer dep, move openai/anthropic/prompt-toolkit to
  optional extras ([ai], [interactive]).

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-21 09:46:50 -08:00
zooqueenandHanzo Dev 0fff3308f6 fix: move hanzo-cli/kms to optional deps to unblock publish
hanzo-cli and hanzo-kms need to be published to PyPI first before
hanzo can depend on them. Move to optional [cli] extra for now.

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-20 22:17:02 -08:00
zooqueenandHanzo Dev b476399c1e feat: bump versions and add hanzo-cli/kms/iam to publish workflow
- hanzo-kms 1.0.0 -> 1.1.0 (fix create_secret null comment bug)
- hanzo-cli 0.1.0 -> 0.2.0 (add paas/kms/iam subcommands, top-level deploy alias)
- hanzo 0.3.48 -> 0.4.0 (add hanzo-cli and hanzo-kms as dependencies)
- Add hanzo-cli, hanzo-kms, hanzo-iam to publish-pypi.yml workflow

Co-authored-by: Hanzo Dev <[email protected]>
2026-02-20 22:15:39 -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 19add7aee2 feat: wire CLI to PaaS API with IAM session exchange
- Add PaaS API client with IAM→session token exchange, auto-refresh,
  and session caching (~/.hanzo/paas_session.json)
- Add `hanzo auth context` for org/project/env selection against live API
- Wire `hanzo run` commands to PaaS container CRUD endpoints
- Wire `hanzo k8s` commands to PaaS cluster and workload endpoints
- Add `hanzo git` commands for provider/repo/branch management
- Fix auth.json token format handling (nested tokens.access_token)
- Extract shared find_container/extract_list helpers to api_client
2026-02-15 18:31:44 -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 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 86c2cdcc0d feat: add new tool packages and install command
- Add hanzo-tools-code: code analysis and transformation tools
- Add hanzo-tools-net: network and HTTP tools
- Add hanzo-tools-plan: planning and task management tools
- Add hanzo-tools-test: testing tools
- Add hanzo-tools-vcs: version control tools
- Add install command for dependency management
- Improve CDP bridge server with better error handling
- Add ui_tool for computer tools
- Add unified tool loading and id_tool
- Add HIP documentation (HIP-0300, HIP-0301)
2026-01-24 13:21:16 -08:00
zeekay 2240bd7cbe feat: add cloud CLI commands
New commands for hanzo cloud platform:
- auto, cx, doc, env, events, flow, fn
- growth, iam, install, jobs, k8s, kv
- ml, o11y, platform, pubsub, queues
- run, search, secrets, storage, tasks, vector
2026-01-21 21:45:04 -08:00