@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/README.md +4 -1
- package/dist/cli.cjs +22 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +22 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +22 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -36,7 +36,8 @@ function parseArgs(argv) {
|
|
|
36
36
|
yes: false,
|
|
37
37
|
noWait: false,
|
|
38
38
|
run: false,
|
|
39
|
-
wait: false
|
|
39
|
+
wait: false,
|
|
40
|
+
hashes: false
|
|
40
41
|
};
|
|
41
42
|
for (let i = 0; i < argv.length; i += 1) {
|
|
42
43
|
const arg = argv[i];
|
|
@@ -47,6 +48,7 @@ function parseArgs(argv) {
|
|
|
47
48
|
else if (arg === "--no-wait") flags.noWait = true;
|
|
48
49
|
else if (arg === "--run") flags.run = true;
|
|
49
50
|
else if (arg === "--wait") flags.wait = true;
|
|
51
|
+
else if (arg === "--hashes") flags.hashes = true;
|
|
50
52
|
else if (VALUE_FLAGS.has(arg)) {
|
|
51
53
|
const value = argv[++i];
|
|
52
54
|
if (value === void 0 || value.startsWith("--")) {
|
|
@@ -127,6 +129,8 @@ function helpText() {
|
|
|
127
129
|
" agents list List your agents",
|
|
128
130
|
" agents show <id> Show one agent + its budget",
|
|
129
131
|
" budget show <agentId> Show an agent's configured budget",
|
|
132
|
+
" budget show <agentId> --hashes Its delegation hashes \u2014 the second",
|
|
133
|
+
" argument `budget revoke` takes, printed nowhere else",
|
|
130
134
|
" activity list [--safe <id|address>] [--agent <id>] [--direction in|out] [--limit <n>] [--offset <n>]",
|
|
131
135
|
" activity export [filters] Emit CSV to stdout (--format csv, default)",
|
|
132
136
|
" activity export --format sie [--from <ISO>] [--to <ISO>] [--company <name>]",
|
|
@@ -585,7 +589,7 @@ async function runConnector(connectorCommand, spawner, onStderr) {
|
|
|
585
589
|
|
|
586
590
|
// src/commands.ts
|
|
587
591
|
var DEFAULT_API = "https://havenbackend-production-8a00.up.railway.app";
|
|
588
|
-
var CLI_VERSION = "0.0.0-dev.
|
|
592
|
+
var CLI_VERSION = "0.0.0-dev.202609071026.e8aec20";
|
|
589
593
|
async function run(argv, deps = {}) {
|
|
590
594
|
const out = deps.out ?? ((l) => process.stdout.write(`${l}
|
|
591
595
|
`));
|
|
@@ -926,10 +930,24 @@ async function cmdAgentsShow(args, d) {
|
|
|
926
930
|
);
|
|
927
931
|
return EXIT.ok;
|
|
928
932
|
}
|
|
933
|
+
var HASH_DISCOVERY_HINT = "haven budget show <agentId> --hashes";
|
|
929
934
|
async function cmdBudgetShow(args, d) {
|
|
930
935
|
const id = args.positionals[0];
|
|
931
|
-
if (!id) throw new UsageError("Usage: haven budget show <agentId>");
|
|
936
|
+
if (!id) throw new UsageError("Usage: haven budget show <agentId> [--hashes]");
|
|
932
937
|
const { api } = await authed(args, d);
|
|
938
|
+
if (args.flags.hashes) {
|
|
939
|
+
const { delegations } = await api.get(`/agents/${id}/delegations`);
|
|
940
|
+
emit(
|
|
941
|
+
d,
|
|
942
|
+
args.flags.json,
|
|
943
|
+
delegations,
|
|
944
|
+
() => delegations.length === 0 ? `No delegations on agent ${id}.` : table(
|
|
945
|
+
["DELEGATION HASH", "STATUS", "VERSION"],
|
|
946
|
+
delegations.map((r) => [r.delegation_hash, r.status, String(r.version)])
|
|
947
|
+
)
|
|
948
|
+
);
|
|
949
|
+
return EXIT.ok;
|
|
950
|
+
}
|
|
933
951
|
const agent = await api.get(`/agents/${id}`);
|
|
934
952
|
const allowances = agent.allowances ?? [];
|
|
935
953
|
emit(
|
|
@@ -1029,7 +1047,7 @@ async function cmdBudgetRevoke(args, d) {
|
|
|
1029
1047
|
const [id, hash] = args.positionals;
|
|
1030
1048
|
if (!id || !hash) throw new UsageError("Usage: haven budget revoke <agentId> <delegationHash> [--wait]");
|
|
1031
1049
|
if (!/^0x[0-9a-fA-F]{64}$/.test(hash)) {
|
|
1032
|
-
throw new UsageError(
|
|
1050
|
+
throw new UsageError(`The delegation hash must be 0x followed by 64 hex characters \u2014 \`${HASH_DISCOVERY_HINT}\` lists them, or the dashboard.`);
|
|
1033
1051
|
}
|
|
1034
1052
|
const { api } = await authed(args, d);
|
|
1035
1053
|
const { delegations } = await api.get(`/agents/${id}/delegations`);
|