@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/README.md
CHANGED
|
@@ -105,6 +105,7 @@ haven wallets funding [--safe <id|address>] [--wait] # the paste-ready funding
|
|
|
105
105
|
haven agents list
|
|
106
106
|
haven agents show <id>
|
|
107
107
|
haven budget show <agentId>
|
|
108
|
+
haven budget show <agentId> --hashes
|
|
108
109
|
haven activity list [--safe <id|address>] [--agent <id>] [--direction in|out] [--limit <n>] [--offset <n>]
|
|
109
110
|
haven activity export [same filters] > activity.csv
|
|
110
111
|
haven activity export --format sie [--from <ISO>] [--to <ISO>] [--company <name>] > books.si
|
|
@@ -149,7 +150,9 @@ never calls `activate` — that is the whole design.
|
|
|
149
150
|
open budget); `--expires` takes unix seconds (default: 90 days).
|
|
150
151
|
- `budget revoke <agentId> <delegationHash>` prepares the sponsored
|
|
151
152
|
revocation (no gas, one signature). The hash comes from
|
|
152
|
-
`haven
|
|
153
|
+
`haven budget show <agentId> --hashes` or the dashboard. (`agents show` does
|
|
154
|
+
NOT print hashes — it renders the allowances projection, which has no hash
|
|
155
|
+
field. #2612.)
|
|
153
156
|
- `--wait` on either command polls until the human's signature lands (grant:
|
|
154
157
|
the hash turns `active`; revoke: the row turns `revoked`), 5 s interval, 15
|
|
155
158
|
minute ceiling. The build is idempotent for the same parameters while it is
|
package/dist/cli.cjs
CHANGED
|
@@ -38,7 +38,8 @@ function parseArgs(argv) {
|
|
|
38
38
|
yes: false,
|
|
39
39
|
noWait: false,
|
|
40
40
|
run: false,
|
|
41
|
-
wait: false
|
|
41
|
+
wait: false,
|
|
42
|
+
hashes: false
|
|
42
43
|
};
|
|
43
44
|
for (let i = 0; i < argv.length; i += 1) {
|
|
44
45
|
const arg = argv[i];
|
|
@@ -49,6 +50,7 @@ function parseArgs(argv) {
|
|
|
49
50
|
else if (arg === "--no-wait") flags.noWait = true;
|
|
50
51
|
else if (arg === "--run") flags.run = true;
|
|
51
52
|
else if (arg === "--wait") flags.wait = true;
|
|
53
|
+
else if (arg === "--hashes") flags.hashes = true;
|
|
52
54
|
else if (VALUE_FLAGS.has(arg)) {
|
|
53
55
|
const value = argv[++i];
|
|
54
56
|
if (value === void 0 || value.startsWith("--")) {
|
|
@@ -129,6 +131,8 @@ function helpText() {
|
|
|
129
131
|
" agents list List your agents",
|
|
130
132
|
" agents show <id> Show one agent + its budget",
|
|
131
133
|
" budget show <agentId> Show an agent's configured budget",
|
|
134
|
+
" budget show <agentId> --hashes Its delegation hashes \u2014 the second",
|
|
135
|
+
" argument `budget revoke` takes, printed nowhere else",
|
|
132
136
|
" activity list [--safe <id|address>] [--agent <id>] [--direction in|out] [--limit <n>] [--offset <n>]",
|
|
133
137
|
" activity export [filters] Emit CSV to stdout (--format csv, default)",
|
|
134
138
|
" activity export --format sie [--from <ISO>] [--to <ISO>] [--company <name>]",
|
|
@@ -587,7 +591,7 @@ async function runConnector(connectorCommand, spawner, onStderr) {
|
|
|
587
591
|
|
|
588
592
|
// src/commands.ts
|
|
589
593
|
var DEFAULT_API = "https://havenbackend-production-8a00.up.railway.app";
|
|
590
|
-
var CLI_VERSION = "0.0.0-dev.
|
|
594
|
+
var CLI_VERSION = "0.0.0-dev.202609071026.e8aec20";
|
|
591
595
|
async function run(argv, deps = {}) {
|
|
592
596
|
const out = deps.out ?? ((l) => process.stdout.write(`${l}
|
|
593
597
|
`));
|
|
@@ -928,10 +932,24 @@ async function cmdAgentsShow(args, d) {
|
|
|
928
932
|
);
|
|
929
933
|
return EXIT.ok;
|
|
930
934
|
}
|
|
935
|
+
var HASH_DISCOVERY_HINT = "haven budget show <agentId> --hashes";
|
|
931
936
|
async function cmdBudgetShow(args, d) {
|
|
932
937
|
const id = args.positionals[0];
|
|
933
|
-
if (!id) throw new UsageError("Usage: haven budget show <agentId>");
|
|
938
|
+
if (!id) throw new UsageError("Usage: haven budget show <agentId> [--hashes]");
|
|
934
939
|
const { api } = await authed(args, d);
|
|
940
|
+
if (args.flags.hashes) {
|
|
941
|
+
const { delegations } = await api.get(`/agents/${id}/delegations`);
|
|
942
|
+
emit(
|
|
943
|
+
d,
|
|
944
|
+
args.flags.json,
|
|
945
|
+
delegations,
|
|
946
|
+
() => delegations.length === 0 ? `No delegations on agent ${id}.` : table(
|
|
947
|
+
["DELEGATION HASH", "STATUS", "VERSION"],
|
|
948
|
+
delegations.map((r) => [r.delegation_hash, r.status, String(r.version)])
|
|
949
|
+
)
|
|
950
|
+
);
|
|
951
|
+
return EXIT.ok;
|
|
952
|
+
}
|
|
935
953
|
const agent = await api.get(`/agents/${id}`);
|
|
936
954
|
const allowances = agent.allowances ?? [];
|
|
937
955
|
emit(
|
|
@@ -1031,7 +1049,7 @@ async function cmdBudgetRevoke(args, d) {
|
|
|
1031
1049
|
const [id, hash] = args.positionals;
|
|
1032
1050
|
if (!id || !hash) throw new UsageError("Usage: haven budget revoke <agentId> <delegationHash> [--wait]");
|
|
1033
1051
|
if (!/^0x[0-9a-fA-F]{64}$/.test(hash)) {
|
|
1034
|
-
throw new UsageError(
|
|
1052
|
+
throw new UsageError(`The delegation hash must be 0x followed by 64 hex characters \u2014 \`${HASH_DISCOVERY_HINT}\` lists them, or the dashboard.`);
|
|
1035
1053
|
}
|
|
1036
1054
|
const { api } = await authed(args, d);
|
|
1037
1055
|
const { delegations } = await api.get(`/agents/${id}/delegations`);
|