feat(cli): run Hanzo Cloud agents from the terminal (dev agent)

Add `dev agent {list,run,show}` over the canonical `/v1/agents` registry
(cloud/clients/agents), reusing the signed-in hanzo.id session for auth.

- New crate `agents-client` mirrors `cloud-tasks-client`: wire types
  (Agent/AgentDetail/Run matching the server contract), an `AgentsBackend`
  trait, and a reqwest `HttpClient` that targets `{base}/v1/agents…`,
  injects the bearer JWT via `codex_api::SharedAuthProvider`, and quotes
  server errors honestly. A recorded error run (HTTP 502 with a Run body)
  is surfaced as the Run, not swallowed as a bare status.
- New `cli/src/agent_cmd.rs` module wires the subcommand like the existing
  `cloud` command: resolves base URL (default https://api.hanzo.ai,
  override CODEX_AGENTS_BASE_URL) + AuthManager from the loaded Config,
  fails secure when not signed in. `list`/`run`/`show`, each with `--json`;
  `run` reads the prompt from an arg or stdin.
- Cloud-agent invocation is additive and orthogonal to the local
  config-defined subprocess agents; no shared state.

Tests: 8 wiremock unit tests (list/get/run happy + recorded-error 502 +
503 server error + bearer header + path encoding). `cargo build`, `cargo
clippy -D warnings`, and `cargo test` are clean for the touched crates.

Bumps @hanzo/dev 0.6.91 -> 0.6.92 (patch) so a release can publish.
This commit is contained in:
2026-07-01 23:59:20 -07:00
parent cc81e25379
commit ccbf9c3829
11 changed files with 805 additions and 6 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@hanzo/dev",
"version": "0.6.91",
"version": "0.6.92",
"license": "Apache-2.0",
"description": "Hanzo AI coding assistant - intelligent CLI for developers",
"bin": {
@@ -35,10 +35,10 @@
"prettier": "^3.3.3"
},
"optionalDependencies": {
"@hanzo/dev-darwin-arm64": "0.6.91",
"@hanzo/dev-darwin-x64": "0.6.91",
"@hanzo/dev-linux-x64-musl": "0.6.91",
"@hanzo/dev-linux-arm64-musl": "0.6.91",
"@hanzo/dev-win32-x64": "0.6.91"
"@hanzo/dev-darwin-arm64": "0.6.92",
"@hanzo/dev-darwin-x64": "0.6.92",
"@hanzo/dev-linux-x64-musl": "0.6.92",
"@hanzo/dev-linux-arm64-musl": "0.6.92",
"@hanzo/dev-win32-x64": "0.6.92"
}
}