@haven_ai/cli 0.0.0-dev.202610302111.69d5f98 → 0.0.0-dev.202611041126.f6fdb26
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/dist/index.js
CHANGED
|
@@ -167,8 +167,6 @@ function helpText() {
|
|
|
167
167
|
" agents rotate-key <id> Issue a new API key (shown once)",
|
|
168
168
|
" agents rename <id> <name>",
|
|
169
169
|
" wallets rename <id> <name>",
|
|
170
|
-
" contacts add <name> <address> Save an address under a name",
|
|
171
|
-
" contacts remove <id> Forget one",
|
|
172
170
|
"",
|
|
173
171
|
"Budgets (construct-and-hand-off \u2014 the CLI never signs, #2539):",
|
|
174
172
|
" budget grant <agentId> --amount <n> --token USDC --period <minutes>",
|
|
@@ -3151,7 +3149,7 @@ async function checkTextForSecrets(text, deps) {
|
|
|
3151
3149
|
|
|
3152
3150
|
// src/commands.ts
|
|
3153
3151
|
var DEFAULT_API = "https://havenbackend-production-8a00.up.railway.app";
|
|
3154
|
-
var CLI_VERSION = "0.0.0-dev.
|
|
3152
|
+
var CLI_VERSION = "0.0.0-dev.202611041126.f6fdb26";
|
|
3155
3153
|
var CLI_CLIENT_IDENTITY = `@haven_ai/cli/${CLI_VERSION}`;
|
|
3156
3154
|
function accountAddressOf(s) {
|
|
3157
3155
|
return s.account_address ?? "";
|
|
@@ -3249,13 +3247,10 @@ async function dispatch(args, d) {
|
|
|
3249
3247
|
return cmdCatalogList(args, d);
|
|
3250
3248
|
case "contacts list":
|
|
3251
3249
|
return cmdContactsList(args, d);
|
|
3252
|
-
case "contacts add":
|
|
3253
|
-
return cmdContactsAdd(args, d);
|
|
3254
|
-
case "contacts remove":
|
|
3255
|
-
return cmdContactsRemove(args, d);
|
|
3256
3250
|
case "feedback submit":
|
|
3257
3251
|
return cmdFeedbackSubmit(args, d);
|
|
3258
3252
|
default:
|
|
3253
|
+
if (key === "contacts add" || key === "contacts remove") refuseContactWrite();
|
|
3259
3254
|
throw new UsageError(`Unknown command: ${key}.`, "Run `haven --help` for the command list.");
|
|
3260
3255
|
}
|
|
3261
3256
|
}
|
|
@@ -4105,22 +4100,11 @@ async function cmdContactsList(args, d) {
|
|
|
4105
4100
|
);
|
|
4106
4101
|
return EXIT.ok;
|
|
4107
4102
|
}
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
const contact = await api.post("/contacts", { name, address });
|
|
4114
|
-
emit(d, args.flags.json, contact, () => `Added contact "${contact.name}" (${truncateAddress(contact.address)}).`);
|
|
4115
|
-
return EXIT.ok;
|
|
4116
|
-
}
|
|
4117
|
-
async function cmdContactsRemove(args, d) {
|
|
4118
|
-
const id = args.positionals[0];
|
|
4119
|
-
if (!id) throw new UsageError("Usage: haven contacts remove <id>");
|
|
4120
|
-
const { api } = await authed(args, d);
|
|
4121
|
-
await api.del(`/contacts/${id}`);
|
|
4122
|
-
emit(d, args.flags.json, { ok: true, contact_id: id, removed: true }, () => `Contact ${id} removed.`);
|
|
4123
|
-
return EXIT.ok;
|
|
4103
|
+
function refuseContactWrite() {
|
|
4104
|
+
throw new HavenCliError(
|
|
4105
|
+
"Contacts can only be added or removed in the Haven dashboard. `haven contacts list` still works.",
|
|
4106
|
+
EXIT.refused
|
|
4107
|
+
);
|
|
4124
4108
|
}
|
|
4125
4109
|
async function cmdFeedbackSubmit(args, d) {
|
|
4126
4110
|
const text = args.positionals.join(" ").trim();
|