@haven_ai/cli 0.0.0-dev.202610250420.40d28aa → 0.0.0-dev.202610260823.6a4f13e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -85,7 +85,8 @@ prints the address, the amount **and which chain** — read the chain from there
85
85
  rather than assuming one. You can compose the message; you cannot send the money.
86
86
 
87
87
  **Every command takes `--json`**, and every refusal is a JSON object with a
88
- machine-readable `code`. The contract and the six exit codes are in
88
+ machine-readable `code` (an `agents connect --run` refusal carries the
89
+ connector's own code, under `outcome.error`). The contract and the six exit codes are in
89
90
  [*For agents and scripts*](#for-agents-and-scripts) below — read that before
90
91
  branching on anything.
91
92
 
@@ -105,7 +106,7 @@ haven login # browser device-code approval (the def
105
106
  haven login --email you@example.com # password path instead (prompt or HAVEN_PASSWORD)
106
107
  haven login --no-wait --json # print the link object and exit — resume with --poll
107
108
  haven login --poll <device_code> # one poll round: 0 approved, 3 pending, 4 denied
108
- haven whoami # user, session expiry, API URL
109
+ haven whoami # email and name; --json adds session expiry and API URL
109
110
  haven guide # the agent onboarding runbook
110
111
  haven logout
111
112
 
@@ -147,6 +148,7 @@ haven agents connect --status <setupId> [--wait]
147
148
  # budgets: construct-and-hand-off (#2539) — the CLI never signs
148
149
  haven budget grant <agentId> --amount 25 --token USDC --period 1440
149
150
  haven budget grant <agentId> --amount 25 --token USDC --period 1440 --recipient <address> --wait
151
+ haven budget grant <agentId> --amount 25 --token USDC --period 1440 --expires <unix-seconds>
150
152
  haven budget revoke <agentId> <delegationHash> [--wait]
151
153
  ```
152
154
 
@@ -304,7 +306,12 @@ budget, change signers, move funds, change your credentials, or rotate an
304
306
  agent's keys — neither the delegate key (`/agents/:id/rekey/*`) nor the API key
305
307
  (`/agents/:id/rotate-key`). `haven agents rotate-key` therefore needs an
306
308
  ordinary session (`haven login --email`), not a device-code one: issuing a
307
- fresh credential is a change of authority, and the human keeps those. The allow-list lives in
309
+ fresh credential is a change of authority, and the human keeps those. Two more
310
+ commands call routes the allow-list leaves out, so they need an ordinary
311
+ session too: `haven wallets rename` (`PUT /user/accounts/:id`) and
312
+ `haven activity export --format sie` (`GET /accounting/export`). Under a
313
+ device-code session the backend answers all three with a 401, so they exit
314
+ **3**, the same as a missing session. The allow-list lives in
308
315
  `packages/backend/src/middleware/owner-cli.ts`; a route that is not on it
309
316
  refuses, because #1640 already refuses every purpose-carrying token everywhere
310
317
  and this is a single opt-in exception. A census test measures what the
@@ -317,12 +324,22 @@ haven agents list --json # success: the payload, unchanged
317
324
  haven agents show missing --json # failure: one object, still parseable
318
325
  ```
319
326
 
320
- A failure is always:
327
+ A failure is this object, with two exceptions below:
321
328
 
322
329
  ```json
323
330
  { "ok": false, "error": { "code": "not_authenticated", "message": "Not authenticated.", "hint": "Run `haven login` ..." } }
324
331
  ```
325
332
 
333
+ The first exception is a connector refusal under `haven agents connect --run`. It
334
+ exits **4** with the run object (`setup_id`, `approval_url`,
335
+ `connector_command`, `connector_exit_code`, `outcome`, `relay`), and the
336
+ connector's own error (`code`, `next_action`) is under `outcome.error`.
337
+
338
+ The second is a device login the user has not confirmed in the browser yet
339
+ (`haven login --json` past its wait, or `haven login --poll <code> --json`). It
340
+ exits **3** with `{ "status": "pending", "device_code": …, "retry_after": … }`
341
+ and no `ok` or `error` (see the login section above).
342
+
326
343
  Success keeps whatever shape the command already returned — including the bare
327
344
  arrays the list commands emit — so a script that parses a success today keeps
328
345
  working. `login`, `logout` and the manage commands, which used to print only a
@@ -364,7 +381,9 @@ test; the copy exists so this package keeps **zero runtime dependencies** and
364
381
 
365
382
  - `--api <url>` or `HAVEN_API_URL` — backend URL (defaults to the hosted Haven
366
383
  backend). The backend is pinned into the saved session at login.
367
- - `HAVEN_EMAIL` / `HAVEN_PASSWORD` — non-interactive login (CI/scripts).
384
+ - `HAVEN_EMAIL` / `HAVEN_PASSWORD` — non-interactive login (CI/scripts). With
385
+ `HAVEN_EMAIL` set, a bare `haven login` takes the password path, not the
386
+ device flow.
368
387
  - Session is stored owner-only at `~/.haven/session.json`. Treat it like a
369
388
  secret; `haven logout` removes it.
370
389
 
package/dist/cli.cjs CHANGED
@@ -3155,7 +3155,7 @@ async function checkTextForSecrets(text, deps) {
3155
3155
 
3156
3156
  // src/commands.ts
3157
3157
  var DEFAULT_API = "https://havenbackend-production-8a00.up.railway.app";
3158
- var CLI_VERSION = "0.0.0-dev.202610250420.40d28aa";
3158
+ var CLI_VERSION = "0.0.0-dev.202610260823.6a4f13e";
3159
3159
  var CLI_CLIENT_IDENTITY = `@haven_ai/cli/${CLI_VERSION}`;
3160
3160
  function accountAddressOf(s) {
3161
3161
  return s.account_address ?? "";