@haven_ai/cli 0.0.0-dev.202610141230.6b940f3 → 0.0.0-dev.202610141738.3a308de
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 +12 -8
- package/dist/cli.cjs +8 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +8 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,7 +53,9 @@ The CLI talks to the hosted Haven backend by default. Point it elsewhere with
|
|
|
53
53
|
|
|
54
54
|
The path an agent walks, and where it stops. Four of the six steps in
|
|
55
55
|
[`/for-agents.md`](https://github.com/d-hinders/Haven-AI/blob/dev/packages/frontend/public/for-agents.md)
|
|
56
|
-
are your user's
|
|
56
|
+
are your user's. With a CLI session you can take step 3 — creating the agent
|
|
57
|
+
and setting its budget — off their hands, and `--run` also does step 4, which
|
|
58
|
+
is yours.
|
|
57
59
|
|
|
58
60
|
```bash
|
|
59
61
|
# 1. Get a scoped session. Prints a code and a link for your user to approve in
|
|
@@ -109,7 +111,7 @@ haven logout
|
|
|
109
111
|
|
|
110
112
|
# read
|
|
111
113
|
haven wallets list
|
|
112
|
-
haven wallets balances --safe <id|address>
|
|
114
|
+
haven wallets balances [--safe <id|address>]
|
|
113
115
|
haven wallets funding [--safe <id|address>] [--wait] # the paste-ready funding instruction (#2534)
|
|
114
116
|
haven agents list
|
|
115
117
|
haven agents show <id>
|
|
@@ -177,7 +179,8 @@ never calls `activate` — that is the whole design.
|
|
|
177
179
|
returns the same hash, so `--wait` converges instead of chasing a version
|
|
178
180
|
that never activates.
|
|
179
181
|
- Under `--json`, grant returns the backend's build object —
|
|
180
|
-
`{
|
|
182
|
+
`{ delegation_hash, version, delegate_account_address, signing_payload,
|
|
183
|
+
build_id, typed_data_hash, signing_url }`
|
|
181
184
|
(`build_id` and `typed_data_hash` are the delegation hash, named for API
|
|
182
185
|
clarity) — plus `agent_id` and `status`. The link first, the settled status
|
|
183
186
|
after: the same two-emission shape as device login.
|
|
@@ -194,7 +197,7 @@ rather than rounding it away.
|
|
|
194
197
|
The connector command is **printed, never composed** — it is the same string
|
|
195
198
|
the dashboard shows for the same setup, because both render what the backend
|
|
196
199
|
built. `--run` executes it for you as a child process with exactly `--json`
|
|
197
|
-
appended and nothing else changed, streams the connector's
|
|
200
|
+
appended and nothing else changed, streams the connector's stderr, and puts the
|
|
198
201
|
thing you have to act on first.
|
|
199
202
|
|
|
200
203
|
If the connector refuses — it cannot tell which runtime to wire, or the machine
|
|
@@ -217,7 +220,7 @@ Approving the budget stays with the human, in the browser, every time.
|
|
|
217
220
|
|
|
218
221
|
### `haven wallets funding`
|
|
219
222
|
|
|
220
|
-
Prints the funding instruction a human acts on: what to send (
|
|
223
|
+
Prints the funding instruction a human acts on: what to send (the token's
|
|
221
224
|
documented minimum-useful amount), to which address, on which chain, plus the
|
|
222
225
|
explorer link and a faucet link on testnets. It reads
|
|
223
226
|
`GET /user/accounts/:accountId/funding` — the same facts the dashboard's funding
|
|
@@ -225,7 +228,8 @@ card shows — and composes nothing locally, so the printed sentence and the
|
|
|
225
228
|
dashboard can never disagree about the amount.
|
|
226
229
|
|
|
227
230
|
`--wait` polls the same read until the account counts as funded, printing the
|
|
228
|
-
elapsed time on stderr
|
|
231
|
+
elapsed time while it waits (on stderr under `--json`), and exits 0 the moment
|
|
232
|
+
`funded` flips.
|
|
229
233
|
On timeout it exits 1 with the elapsed time in the message. It is read-only in
|
|
230
234
|
every mode: it never sends anything and never touches a faucet — the transfer
|
|
231
235
|
itself stays with the human.
|
|
@@ -325,7 +329,7 @@ sentence, now emit an object as well.
|
|
|
325
329
|
| `1` | Failed | Something broke that none of the below describes (a 5xx, an unexpected error). Retrying may help. |
|
|
326
330
|
| `2` | Usage | The command line was wrong — unknown command, missing argument, bad flag, or a `--safe` that matches nothing. Fix the argv; retrying it unchanged will not help. |
|
|
327
331
|
| `3` | Not authenticated | No stored session, or the backend rejected the one we have. Run `haven login`. |
|
|
328
|
-
| `4` | Refused | The
|
|
332
|
+
| `4` | Refused | The answer is no: a 403, 410 or other 4xx from the backend (its own `error` text is echoed when it sends one), or a refusal the CLI makes itself — for example a live budget on `agents revoke`, credential-shaped `feedback submit` text, the connector's refusal under `agents connect --run`, or a device login the human denied. |
|
|
329
333
|
| `5` | Network | The backend could not be reached at all. Check connectivity and `--api`. |
|
|
330
334
|
|
|
331
335
|
**Why a 401 is `3` and not `4`.** The two overlap by definition — a 401 *is* the
|
|
@@ -362,5 +366,5 @@ test; the copy exists so this package keeps **zero runtime dependencies** and
|
|
|
362
366
|
The CLI authenticates as the user and talks to the same JWT API as the
|
|
363
367
|
dashboard. It can read everything and perform backend-only management; anything
|
|
364
368
|
that moves funds or changes on-chain authority is signed by your wallet/passkey
|
|
365
|
-
in the dashboard. Haven never holds your
|
|
369
|
+
in the dashboard. Haven never holds your account's owner key or any delegate key
|
|
366
370
|
through this tool.
|
package/dist/cli.cjs
CHANGED
|
@@ -3152,7 +3152,7 @@ async function checkTextForSecrets(text, deps) {
|
|
|
3152
3152
|
|
|
3153
3153
|
// src/commands.ts
|
|
3154
3154
|
var DEFAULT_API = "https://havenbackend-production-8a00.up.railway.app";
|
|
3155
|
-
var CLI_VERSION = "0.0.0-dev.
|
|
3155
|
+
var CLI_VERSION = "0.0.0-dev.202610141738.3a308de";
|
|
3156
3156
|
var CLI_CLIENT_IDENTITY = `@haven_ai/cli/${CLI_VERSION}`;
|
|
3157
3157
|
function accountAddressOf(s) {
|
|
3158
3158
|
return s.account_address ?? "";
|
|
@@ -3611,6 +3611,11 @@ function budgetSummary(allowances) {
|
|
|
3611
3611
|
if (!allowances || allowances.length === 0) return "\u2014";
|
|
3612
3612
|
return allowances.map((a) => `${a.allowance_amount} ${a.token_symbol}`).join(", ");
|
|
3613
3613
|
}
|
|
3614
|
+
var STILL_ENABLED_STATUSES = /* @__PURE__ */ new Set([
|
|
3615
|
+
"pending",
|
|
3616
|
+
"active",
|
|
3617
|
+
"replaced"
|
|
3618
|
+
]);
|
|
3614
3619
|
var BUDGET_WAIT_TIMEOUT_S = 15 * 60;
|
|
3615
3620
|
var BUDGET_WAIT_INTERVAL_MS = 5e3;
|
|
3616
3621
|
async function cmdBudgetGrant(args, d) {
|
|
@@ -3675,7 +3680,7 @@ async function cmdBudgetGrant(args, d) {
|
|
|
3675
3680
|
await d.sleep(BUDGET_WAIT_INTERVAL_MS);
|
|
3676
3681
|
const { delegations } = await api.get(`/agents/${id}/delegations`);
|
|
3677
3682
|
const mine = delegations.find((row) => row.delegation_hash === built.delegation_hash);
|
|
3678
|
-
if (mine
|
|
3683
|
+
if (mine && (mine.is_live ?? mine.status === "active")) {
|
|
3679
3684
|
emitGrant("active");
|
|
3680
3685
|
return EXIT.ok;
|
|
3681
3686
|
}
|
|
@@ -3779,7 +3784,7 @@ async function cmdAgentRevoke(args, d) {
|
|
|
3779
3784
|
const agent = await api.get(`/agents/${id}`);
|
|
3780
3785
|
if ((agent.live_delegation_count ?? 0) > 0) {
|
|
3781
3786
|
const { delegations } = await api.get(`/agents/${id}/delegations`);
|
|
3782
|
-
live = delegations.filter((r) =>
|
|
3787
|
+
live = delegations.filter((r) => STILL_ENABLED_STATUSES.has(r.status));
|
|
3783
3788
|
}
|
|
3784
3789
|
} catch (err) {
|
|
3785
3790
|
d.o.note(`Couldn't check budgets for agent ${id}, so the revocation was not attempted.`);
|