@haven_ai/cli 0.0.0-dev.202610302111.69d5f98 → 0.0.0-dev.202611042046.7368848
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 +3 -2
- package/dist/cli.cjs +7 -23
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +7 -23
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +7 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -138,7 +138,6 @@ haven agents revoke <id> [--keep-budget] --yes # retires the agent in Haven (t
|
|
|
138
138
|
haven agents rotate-key <id> # new API key, shown once
|
|
139
139
|
haven agents rename <id> <name>
|
|
140
140
|
haven wallets rename <id> <name>
|
|
141
|
-
haven contacts add <name> <address> | contacts remove <id>
|
|
142
141
|
|
|
143
142
|
# set an agent up without the dashboard modal (#2527)
|
|
144
143
|
haven agents connect --name <name> --budget <amount> --token USDC --period <minutes>
|
|
@@ -311,7 +310,9 @@ commands call routes the allow-list leaves out, so they need an ordinary
|
|
|
311
310
|
session too: `haven wallets rename` (`PUT /user/accounts/:id`) and
|
|
312
311
|
`haven activity export --format sie` (`GET /accounting/export`). Under a
|
|
313
312
|
device-code session the backend answers all three with a 401, so they exit
|
|
314
|
-
**3**, the same as a missing session.
|
|
313
|
+
**3**, the same as a missing session. `haven contacts add` and `remove` refuse under
|
|
314
|
+
any session, exit **4**, without calling the backend: saved contacts are written in
|
|
315
|
+
the dashboard. The allow-list lives in
|
|
315
316
|
`packages/backend/src/middleware/owner-cli.ts`; a route that is not on it
|
|
316
317
|
refuses, because #1640 already refuses every purpose-carrying token everywhere
|
|
317
318
|
and this is a single opt-in exception. A census test measures what the
|
package/dist/cli.cjs
CHANGED
|
@@ -171,8 +171,6 @@ function helpText() {
|
|
|
171
171
|
" agents rotate-key <id> Issue a new API key (shown once)",
|
|
172
172
|
" agents rename <id> <name>",
|
|
173
173
|
" wallets rename <id> <name>",
|
|
174
|
-
" contacts add <name> <address> Save an address under a name",
|
|
175
|
-
" contacts remove <id> Forget one",
|
|
176
174
|
"",
|
|
177
175
|
"Budgets (construct-and-hand-off \u2014 the CLI never signs, #2539):",
|
|
178
176
|
" budget grant <agentId> --amount <n> --token USDC --period <minutes>",
|
|
@@ -3155,7 +3153,7 @@ async function checkTextForSecrets(text, deps) {
|
|
|
3155
3153
|
|
|
3156
3154
|
// src/commands.ts
|
|
3157
3155
|
var DEFAULT_API = "https://havenbackend-production-8a00.up.railway.app";
|
|
3158
|
-
var CLI_VERSION = "0.0.0-dev.
|
|
3156
|
+
var CLI_VERSION = "0.0.0-dev.202611042046.7368848";
|
|
3159
3157
|
var CLI_CLIENT_IDENTITY = `@haven_ai/cli/${CLI_VERSION}`;
|
|
3160
3158
|
function accountAddressOf(s) {
|
|
3161
3159
|
return s.account_address ?? "";
|
|
@@ -3253,13 +3251,10 @@ async function dispatch(args, d) {
|
|
|
3253
3251
|
return cmdCatalogList(args, d);
|
|
3254
3252
|
case "contacts list":
|
|
3255
3253
|
return cmdContactsList(args, d);
|
|
3256
|
-
case "contacts add":
|
|
3257
|
-
return cmdContactsAdd(args, d);
|
|
3258
|
-
case "contacts remove":
|
|
3259
|
-
return cmdContactsRemove(args, d);
|
|
3260
3254
|
case "feedback submit":
|
|
3261
3255
|
return cmdFeedbackSubmit(args, d);
|
|
3262
3256
|
default:
|
|
3257
|
+
if (key === "contacts add" || key === "contacts remove") refuseContactWrite();
|
|
3263
3258
|
throw new UsageError(`Unknown command: ${key}.`, "Run `haven --help` for the command list.");
|
|
3264
3259
|
}
|
|
3265
3260
|
}
|
|
@@ -4109,22 +4104,11 @@ async function cmdContactsList(args, d) {
|
|
|
4109
4104
|
);
|
|
4110
4105
|
return EXIT.ok;
|
|
4111
4106
|
}
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
const contact = await api.post("/contacts", { name, address });
|
|
4118
|
-
emit(d, args.flags.json, contact, () => `Added contact "${contact.name}" (${truncateAddress(contact.address)}).`);
|
|
4119
|
-
return EXIT.ok;
|
|
4120
|
-
}
|
|
4121
|
-
async function cmdContactsRemove(args, d) {
|
|
4122
|
-
const id = args.positionals[0];
|
|
4123
|
-
if (!id) throw new UsageError("Usage: haven contacts remove <id>");
|
|
4124
|
-
const { api } = await authed(args, d);
|
|
4125
|
-
await api.del(`/contacts/${id}`);
|
|
4126
|
-
emit(d, args.flags.json, { ok: true, contact_id: id, removed: true }, () => `Contact ${id} removed.`);
|
|
4127
|
-
return EXIT.ok;
|
|
4107
|
+
function refuseContactWrite() {
|
|
4108
|
+
throw new HavenCliError(
|
|
4109
|
+
"Contacts can only be added or removed in the Haven dashboard. `haven contacts list` still works.",
|
|
4110
|
+
EXIT.refused
|
|
4111
|
+
);
|
|
4128
4112
|
}
|
|
4129
4113
|
async function cmdFeedbackSubmit(args, d) {
|
|
4130
4114
|
const text = args.positionals.join(" ").trim();
|