@haven_ai/cli 0.0.0-dev.202609071016.16aa950 → 0.0.0-dev.202609071026.e8aec20

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/dist/index.d.cts CHANGED
@@ -93,6 +93,14 @@ interface ParsedArgs {
93
93
  run: boolean;
94
94
  /** #2527: poll `agents connect --status` until it settles. */
95
95
  wait: boolean;
96
+ /**
97
+ * #2612: list the delegation HASHES on `budget show`, which is the only
98
+ * thing `budget revoke` accepts as its second argument. Behind a flag
99
+ * because `budget show --json` has emitted a bare allowances array since
100
+ * the first CLI scaffold, and a second shape on the same command would
101
+ * break every existing consumer of it.
102
+ */
103
+ hashes: boolean;
96
104
  version: boolean;
97
105
  yes: boolean;
98
106
  api?: string;
package/dist/index.d.ts CHANGED
@@ -93,6 +93,14 @@ interface ParsedArgs {
93
93
  run: boolean;
94
94
  /** #2527: poll `agents connect --status` until it settles. */
95
95
  wait: boolean;
96
+ /**
97
+ * #2612: list the delegation HASHES on `budget show`, which is the only
98
+ * thing `budget revoke` accepts as its second argument. Behind a flag
99
+ * because `budget show --json` has emitted a bare allowances array since
100
+ * the first CLI scaffold, and a second shape on the same command would
101
+ * break every existing consumer of it.
102
+ */
103
+ hashes: boolean;
96
104
  version: boolean;
97
105
  yes: boolean;
98
106
  api?: string;
package/dist/index.js CHANGED
@@ -34,7 +34,8 @@ function parseArgs(argv) {
34
34
  yes: false,
35
35
  noWait: false,
36
36
  run: false,
37
- wait: false
37
+ wait: false,
38
+ hashes: false
38
39
  };
39
40
  for (let i = 0; i < argv.length; i += 1) {
40
41
  const arg = argv[i];
@@ -45,6 +46,7 @@ function parseArgs(argv) {
45
46
  else if (arg === "--no-wait") flags.noWait = true;
46
47
  else if (arg === "--run") flags.run = true;
47
48
  else if (arg === "--wait") flags.wait = true;
49
+ else if (arg === "--hashes") flags.hashes = true;
48
50
  else if (VALUE_FLAGS.has(arg)) {
49
51
  const value = argv[++i];
50
52
  if (value === void 0 || value.startsWith("--")) {
@@ -125,6 +127,8 @@ function helpText() {
125
127
  " agents list List your agents",
126
128
  " agents show <id> Show one agent + its budget",
127
129
  " budget show <agentId> Show an agent's configured budget",
130
+ " budget show <agentId> --hashes Its delegation hashes \u2014 the second",
131
+ " argument `budget revoke` takes, printed nowhere else",
128
132
  " activity list [--safe <id|address>] [--agent <id>] [--direction in|out] [--limit <n>] [--offset <n>]",
129
133
  " activity export [filters] Emit CSV to stdout (--format csv, default)",
130
134
  " activity export --format sie [--from <ISO>] [--to <ISO>] [--company <name>]",
@@ -583,7 +587,7 @@ async function runConnector(connectorCommand, spawner, onStderr) {
583
587
 
584
588
  // src/commands.ts
585
589
  var DEFAULT_API = "https://havenbackend-production-8a00.up.railway.app";
586
- var CLI_VERSION = "0.0.0-dev.202609071016.16aa950";
590
+ var CLI_VERSION = "0.0.0-dev.202609071026.e8aec20";
587
591
  async function run(argv, deps = {}) {
588
592
  const out = deps.out ?? ((l) => process.stdout.write(`${l}
589
593
  `));
@@ -924,10 +928,24 @@ async function cmdAgentsShow(args, d) {
924
928
  );
925
929
  return EXIT.ok;
926
930
  }
931
+ var HASH_DISCOVERY_HINT = "haven budget show <agentId> --hashes";
927
932
  async function cmdBudgetShow(args, d) {
928
933
  const id = args.positionals[0];
929
- if (!id) throw new UsageError("Usage: haven budget show <agentId>");
934
+ if (!id) throw new UsageError("Usage: haven budget show <agentId> [--hashes]");
930
935
  const { api } = await authed(args, d);
936
+ if (args.flags.hashes) {
937
+ const { delegations } = await api.get(`/agents/${id}/delegations`);
938
+ emit(
939
+ d,
940
+ args.flags.json,
941
+ delegations,
942
+ () => delegations.length === 0 ? `No delegations on agent ${id}.` : table(
943
+ ["DELEGATION HASH", "STATUS", "VERSION"],
944
+ delegations.map((r) => [r.delegation_hash, r.status, String(r.version)])
945
+ )
946
+ );
947
+ return EXIT.ok;
948
+ }
931
949
  const agent = await api.get(`/agents/${id}`);
932
950
  const allowances = agent.allowances ?? [];
933
951
  emit(
@@ -1027,7 +1045,7 @@ async function cmdBudgetRevoke(args, d) {
1027
1045
  const [id, hash] = args.positionals;
1028
1046
  if (!id || !hash) throw new UsageError("Usage: haven budget revoke <agentId> <delegationHash> [--wait]");
1029
1047
  if (!/^0x[0-9a-fA-F]{64}$/.test(hash)) {
1030
- throw new UsageError("The delegation hash must be 0x followed by 64 hex characters \u2014 `haven agents show` or the dashboard lists them.");
1048
+ throw new UsageError(`The delegation hash must be 0x followed by 64 hex characters \u2014 \`${HASH_DISCOVERY_HINT}\` lists them, or the dashboard.`);
1031
1049
  }
1032
1050
  const { api } = await authed(args, d);
1033
1051
  const { delegations } = await api.get(`/agents/${id}/delegations`);