botanary 0.2.2 → 0.4.0

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.
Files changed (37) hide show
  1. package/README.md +140 -2
  2. package/dist/bin/botanary.js +5 -2
  3. package/dist/bin/botanary.js.map +1 -1
  4. package/dist/package.json +15 -8
  5. package/dist/src/app-url.js +19 -2
  6. package/dist/src/app-url.js.map +1 -1
  7. package/dist/src/cli.js +17 -0
  8. package/dist/src/cli.js.map +1 -1
  9. package/dist/src/commands/account.js +171 -0
  10. package/dist/src/commands/account.js.map +1 -0
  11. package/dist/src/commands/agent.js +6 -6
  12. package/dist/src/commands/agent.js.map +1 -1
  13. package/dist/src/commands/authority.js +634 -0
  14. package/dist/src/commands/authority.js.map +1 -0
  15. package/dist/src/commands/services.js +434 -0
  16. package/dist/src/commands/services.js.map +1 -0
  17. package/dist/src/commands/session-writes.js +196 -0
  18. package/dist/src/commands/session-writes.js.map +1 -0
  19. package/dist/src/commands/sign.js +306 -0
  20. package/dist/src/commands/sign.js.map +1 -0
  21. package/dist/src/commands/tokens.js +36 -0
  22. package/dist/src/commands/tokens.js.map +1 -0
  23. package/dist/src/commands/wallet.js +596 -44
  24. package/dist/src/commands/wallet.js.map +1 -1
  25. package/dist/src/commands/watch.js +259 -0
  26. package/dist/src/commands/watch.js.map +1 -0
  27. package/dist/src/help/examples.js +538 -8
  28. package/dist/src/help/examples.js.map +1 -1
  29. package/dist/src/package-version.js +53 -0
  30. package/dist/src/package-version.js.map +1 -0
  31. package/dist/src/progress.js +19 -0
  32. package/dist/src/progress.js.map +1 -1
  33. package/dist/src/render/balance.js +19 -2
  34. package/dist/src/render/balance.js.map +1 -1
  35. package/dist/src/validate.js +55 -9
  36. package/dist/src/validate.js.map +1 -1
  37. package/package.json +24 -18
package/README.md CHANGED
@@ -6,6 +6,10 @@ Botanary from your terminal - a guided CLI over the same wallet and agent lanes
6
6
 
7
7
  `agent whoami` used to print this machine's local key readout. It now asks the backend what Botanary actually says about this agent (claimed? live? which account? which grant?), which is what the name means everywhere else. The local readout moved to `agent identity`, unchanged.
8
8
 
9
+ ## New in 0.4.0
10
+
11
+ This release closes the gap between what the web app can write and what this CLI could reach: `solana` (send, swap, and Botanary Mandates Program grant/freeze/revoke), `mandates grant|freeze|unfreeze|revoke|confirm|pause|resume|cancel`, `signers guardian set`, `signers policy set|remove`, `signers condition-set`, `signers migrate`, `rules update`, `agentwallet deposit` and `approvals announce`. `test/sign-kind-parity.spec.ts` is the durable guard behind this: it asserts every registered, available sign-kind the backend serves is reachable from a command here, so this gap cannot silently reopen. See "What this CLI cannot do" below for the two real, remaining exceptions.
12
+
9
13
  ## Install
10
14
 
11
15
  ```bash
@@ -20,7 +24,7 @@ Run `botanary` with no arguments for a guided REPL, or run any command directly:
20
24
  ```bash
21
25
  botanary login
22
26
  botanary balance
23
- botanary send --amount 25 --token USDC --recipient 0xAb12...9F3 --chain-id 8453
27
+ botanary send --amount 25 --token 0x833589fCD6eDb6E08f4c7C32D4f71b54bda02913 --recipient 0xAb12...9F3 --chain-id 8453
24
28
  botanary agent whoami
25
29
  botanary mcp config claude
26
30
  ```
@@ -29,6 +33,8 @@ Every command works both ways: answer prompts interactively, or pass flags and a
29
33
 
30
34
  ## Commands
31
35
 
36
+ Every command below is real and registered - `test/help-format.spec.ts` fails the build if one is missing a description or help metadata, and `test/sign-kind-parity.spec.ts` fails it if a mutating command's own backend counterpart (a "sign-kind") exists but nothing here reaches it. Run `botanary <command> --help` for a command's own flags, or `botanary prompt` for every command, every flag, and worked examples in one place.
37
+
32
38
  | Command | Description |
33
39
  |---------|-------------|
34
40
  | **Wallet** | |
@@ -39,15 +45,107 @@ Every command works both ways: answer prompts interactively, or pass flags and a
39
45
  | `chains` | Every chain this backend serves, and what each can do |
40
46
  | `gas [options]` | Gas methods available for this account on a chain |
41
47
  | `balance` | What this account holds, across every chain |
48
+ | `tokens [options] [query]` | Every token held on a chain, with the address `send` needs |
42
49
  | `send [options]` | Send tokens from an account you own |
50
+ | `swap [options]` | Swap tokens in an account you own |
43
51
  | `activity` | Recent sends, swaps and yield transactions |
44
52
  | `markets` | Public market data: prices and symbols |
45
53
  | `yield` | Yield pools, a shortlist, and this account's positions |
46
- | `mandates` | What the agent lane may spend unattended (testnet only) |
54
+ | `yield deposit [options]` | Deposit into a yield pool |
55
+ | `yield withdraw [options]` | Withdraw from a yield pool |
56
+ | `yield claim [options]` | Claim accrued rewards from a yield pool |
57
+ | `solana` | Send, swap and manage Botanary Mandates on Solana - key-keyed, not chainId-keyed |
58
+ | `solana send [options]` | Send tokens on Solana (raw base-unit amount) |
59
+ | `solana swap [options]` | Swap tokens on Solana (human-scale amount) |
60
+ | `solana mandate` | Grant, freeze/unfreeze and revoke Botanary Mandates Program delegations on Solana |
61
+ | `solana mandate grant [options]` | Grant a bounded Solana mandate |
62
+ | `solana mandate freeze [options]` | Freeze (or `--unfreeze`) every Solana mandate for this owner at once |
63
+ | `solana mandate revoke <id> [options]` | Revoke a Solana mandate |
64
+ | `mandates` | What the agent lane may spend unattended (testnet only) - reads both delegations and mandates |
65
+ | `mandates suggest` | Suggest a bounded mandate for each agent that has none |
66
+ | `mandates propose [options]` | Compile a parsed rule/mandate intent against the capability matrix (a pure read) |
67
+ | `mandates grant [options]` | Grant bounded access to a delegatee agent (a Smart Session, the classic delegation lane) |
68
+ | `mandates freeze <delegationId>` | Freeze a delegation (reversible) |
69
+ | `mandates unfreeze <delegationId>` | Unfreeze a delegation |
70
+ | `mandates revoke <delegationId>` | Revoke a delegation (permanent) |
71
+ | `mandates confirm [options]` | Confirm and enable proposed mandates or rules, from `mandates propose` |
72
+ | `mandates pause <mandateId>` | Pause a mandate (reversible) |
73
+ | `mandates resume <mandateId>` | Resume a paused mandate |
74
+ | `mandates cancel <mandateId>` | Revoke a mandate (permanent) - named `cancel`, not `revoke`, to stay distinct from `mandates revoke`, which targets a delegation, a different id space |
47
75
  | `agents` | Connected agents and any pending approval requests |
76
+ | `agents approve <id>` | Approve an agent's request - the owner signs, the agent can never approve its own request |
77
+ | `agents deny <id>` | **Read-only.** There is no deny route on the backend - reads the request back and explains why |
78
+ | `agents claim <code> [options]` | Claim a pending pairing and bind that agent to this account |
79
+ | `agents revoke <id>` | Disconnect an agent from this account |
80
+ | `account` | Deploy, set up, fund, freeze/unfreeze and migrate this account |
81
+ | `account deploy` | Mint a new account with its own address (always the next CREATE2 index) |
82
+ | `account setup [options]` | Install every account module this chain is missing |
83
+ | `account fund [options]` | Mint testnet USDC into this account (testnet faucet top-up) |
84
+ | `account freeze [options]` | Freeze this account (kill-switch) |
85
+ | `account unfreeze [options]` | Unfreeze this account |
86
+ | `account migrate [options]` | Migrate this account to today's address |
87
+ | `account rename [accountId] [options]` | Rename (and/or hide/unhide) an account - off-chain metadata only |
88
+ | `recovery` | Social recovery: guardians and the emergency signer-set replacement |
89
+ | `recovery status` | The live guardian set on this account |
90
+ | `recovery install [options]` | Install social recovery with a guardian set and an M-of-N threshold |
91
+ | `recovery guardian add [options]` | Add a recovery guardian |
92
+ | `recovery guardian remove <guardianId> [options]` | Remove a recovery guardian |
93
+ | `recovery recover [options]` | Replace this account's whole signer set (the emergency lane) |
94
+ | `signers` | This account's enrolled signers (the v1 authority core, BotanaryPolicyValidator) |
95
+ | `signers list` | Every enrolled signer, by index |
96
+ | `signers add [options]` | Enrol a new ECDSA signer on this chain |
97
+ | `signers remove [options]` | Remove a signer from this chain, by index |
98
+ | `signers threshold [options]` | Set the account-wide signer approval threshold |
99
+ | `signers trust-anchor [options]` | Mirror an issuer's currently-active signing key onto this account |
100
+ | `signers guardian set [options]` | Set the policy-validator guardian threshold over a subset of signer indexes (not `recovery guardian` - a different contract) |
101
+ | `signers policy set [options]` | Write (or overwrite) the conditional signing policy at a slot |
102
+ | `signers policy remove [options]` | Remove the conditional signing policy at a slot |
103
+ | `signers condition-set [options]` | Add or remove a condition-set member |
104
+ | `signers migrate [options]` | Upgrade this account's authority core onto BotanaryPolicyValidator (step 1 of 2) |
105
+ | `devices` | Co-signer devices on this account's OwnableValidator root |
106
+ | `devices list` | The live device set and its M-of-N threshold |
107
+ | `devices add [options]` | Add a device as a co-signer |
108
+ | `devices remove [options]` | Remove a device from the co-signer set |
109
+ | `devices threshold [options]` | Set the M-of-N device signing threshold |
110
+ | `panic` | The panic freeze lane: any one listed device can freeze the account, gas-abstractedly |
111
+ | `panic install [options]` | Install the panic freeze lane |
112
+ | `panic freeze [options]` | Freeze the account via the panic lane |
113
+ | `rules` | Owner-lane caps and allowlist on this account's AgentGuard hook |
114
+ | `rules update [options]` | Update account caps and/or the contract/recipient allowlist, from JSON files |
115
+ | `notifications [options]` | Alerts - blocked actions, depeg warnings, and the like |
116
+ | `notifications read <id>` | Mark one notification as read |
117
+ | `notifications read-all` | Mark every notification as read |
118
+ | `paysh` | pay.sh: the x402 spending balance and its guardrails |
119
+ | `paysh accounts` | This account's recorded pay.sh accounts (read-only - creation is Privy-client-side) |
120
+ | `paysh topup [options]` | Top up the pay.sh balance |
121
+ | `paysh withdraw [options]` | Withdraw from a pay.sh account's custodial Solana USDC balance |
122
+ | `paysh allowlist <accountId>` | **Read-only.** The trusted pay.sh domains for this account |
123
+ | `paysh settings <accountId>` | **Read-only.** This account's persisted default copilot pay.sh mode |
124
+ | `marketplace` | Hire an ACP agent under a bounded mandate, and run its jobs |
125
+ | `marketplace hire [options]` | Hire an ACP agent under a bounded mandate |
126
+ | `marketplace deposit [options]` | Deposit into a Virtuals-custodied wallet |
127
+ | `marketplace jobs create [options]` | Create an ACP job under a mandate (op 1 of a hire) |
128
+ | `marketplace jobs fund [options]` | Fund an ACP job under a mandate (op 2 of a hire) |
129
+ | `apis` | The x402 paid-API catalog, and the on-chain spending budget backing it |
130
+ | `apis budget <chainId> <agentId>` | Read the current API budget and its state |
131
+ | `apis budget commit [options]` | Commit a three-transaction atomic API spending budget |
132
+ | `apis providers [options]` | Ranked, searchable catalog of x402 API providers |
133
+ | `onramp [options]` | Start a fiat-to-crypto Buy checkout session - no UserOp, no signature |
134
+ | `onramp methods` | Chains currently buyable through the wired onramp provider |
135
+ | `agentwallet` | Deposit into a Virtuals agent wallet |
136
+ | `agentwallet deposit [options]` | Deposit into a Virtuals agent wallet (distinct from `marketplace deposit`) |
137
+ | `approvals` | Announce a collected off-chain approval |
138
+ | `approvals announce <digest> [options]` | Announce a collected approval, by its digest |
48
139
  | `open [target]` | Open Botanary in your browser |
49
140
  | `accounts` | Manage which owner account subsequent commands use |
141
+ | `accounts list` | Every account this login can see |
142
+ | `accounts use <accountId>` | Switch the active account |
50
143
  | `api [options] [path]` | Read any documented GET endpoint as the owner |
144
+ | `sign` | Owner-authorized writes: park a typed intent and wait for your browser to sign it - the ONE write path underneath every command above |
145
+ | `sign list` | Sign requests this machine parked and is still waiting on |
146
+ | `sign show <id>` | Read one sign request by id, with its op status |
147
+ | `sign resume <handle>` | Rejoin an interrupted wait on a sign request this machine parked |
148
+ | `watch` | Tail live events in the foreground: agent requests, balance changes, sign-request status |
51
149
  | **Agent** | |
52
150
  | `agent` | This machine's own agent identity, grant, and spend under it |
53
151
  | `agent identity` | This machine's local agent key: address, public key, fingerprint |
@@ -87,6 +185,30 @@ Every command works both ways: answer prompts interactively, or pass flags and a
87
185
  | `update-check` | Check whether a newer botanary is published |
88
186
  | `update` | Update botanary to the latest published version |
89
187
 
188
+ ## What this CLI cannot do
189
+
190
+ Terminal-first parity is not total parity. Two genuine gaps remain, both by design rather than oversight:
191
+
192
+ - **`agents deny` does not exist as a write.** The backend (`AgentsController`) has no deny, decline or
193
+ reject route for an agent's request at all - only `requests/{id}/approve`. An owner can approve an
194
+ agent's request from the terminal but cannot deny one; a request is either approved or left to expire on
195
+ its own. `agents deny <id>` ships as a read-only command that explains this rather than failing with an
196
+ opaque "unknown command".
197
+ - **`paysh allowlist` and `paysh settings` are refused as writes for any CLI session.** The backend's own
198
+ `CliSessionForbidden` gate 403s them because pay.sh and agent-wallet writes move value with no owner
199
+ signature anywhere in the loop - a CLI session (`kind: 'cli'`, minted by `botanary login`) is read-only
200
+ there by design. Both ship as reads only; make the change in the web app.
201
+
202
+ Separately, **`solana.send`/`solana.swap` cover Solana; Stellar sends and swaps are not reachable from
203
+ anywhere** - not this CLI, not `botanary-mcp`, not the web app. Review panels exist on the backend's own
204
+ sign-kind registry, but there is no client-side Stellar signing infrastructure anywhere in this workspace
205
+ (no `@stellar/stellar-sdk`, no Stellar signer in the auth store), so nothing can actually sign a Stellar
206
+ operation yet. This is a signing-infrastructure gap, not a CLI gap.
207
+
208
+ `test/sign-kind-parity.spec.ts` is what proves these are the only gaps: it walks the backend's sign-kind
209
+ registry and fails the build if any AVAILABLE kind (i.e. not one of the two Stellar kinds above, which the
210
+ registry itself marks unavailable) has no reachable command.
211
+
90
212
  ## Non-interactive use
91
213
 
92
214
  Use `--json` to get machine-readable output, `--yes` to skip the review step on money commands, and `--dry-run` to preflight without sending. The failure contract is strict: on success, stdout is the response payload (or a plain string); on failure, stdout carries an error object.
@@ -198,6 +320,10 @@ pnpm test
198
320
  pnpm dev # run bin/botanary.ts directly, watching for changes
199
321
  ```
200
322
 
323
+ ## Why send requires a token address, not a symbol
324
+
325
+ The `send` command requires a contract address or CAIP-19 asset ref, never a symbol. This is by design: a symbol is a label a contract picks for itself, and two contracts on one chain can legally share the same symbol. The product will not guess which one you meant. Use `botanary tokens --chain-id <id> [query]` to list every token this account holds on a chain, each with the contract address `--token` needs.
326
+
201
327
  `BOTANARY_MCP_HOME` and `BOTANARY_API_URL` behave exactly as documented in `botanary-mcp`'s own README - this package depends on that one as its engine and adds no storage or network logic of its own.
202
328
 
203
329
  ## Release note
@@ -215,3 +341,15 @@ Repeat that order for any future release where the CLI needs a change in the eng
215
341
  against an unpublished `botanary-mcp` installs broken.
216
342
 
217
343
  See `docs/superpowers/specs/2026-08-19-botanary-cli-completion-design.md` section 5 for the rationale.
344
+
345
+ ### 0.4.0 (the terminal-first sign-kind parity release)
346
+
347
+ Same fixed order, and it matters for the same reason: npm's caret on a `0.x` version is restrictive, so
348
+ `"botanary-mcp": "^0.7.0"` means `>=0.7.0 <0.8.0` and would never resolve to `0.8.0` on its own.
349
+
350
+ 1. `botanary-mcp@0.8.0` publishes to npm first.
351
+ 2. `tools/botanary-cli/package.json`'s `botanary-mcp` dependency bumps from `^0.7.0` to `^0.8.0`,
352
+ alongside `botanary`'s own bump to `0.4.0`. **Both version numbers are already bumped in this repo** -
353
+ the CLI's actual dependency resolution (a real `pnpm install` against the published `0.8.0`) happens in
354
+ the publish task, not here, since `0.8.0` does not exist on the registry until step 1 runs.
355
+ 3. `botanary@0.4.0` publishes.
@@ -2,9 +2,12 @@
2
2
  import { createDefaultRuntime } from 'botanary-mcp';
3
3
  import { runCli } from '../src/cli.js';
4
4
  import { EXIT } from '../src/errors.js';
5
+ // Read from package.json with `fs` at runtime, NOT `import('../package.json')`: that import made tsc
6
+ // copy the manifest into outDir, publishing a stray nested `dist/package.json`. See the header of
7
+ // src/package-version.ts.
8
+ import { CLI_VERSION } from '../src/package-version.js';
5
9
  // Deliberately the only file in this package that is not unit tested directly - it wires the real runtime
6
10
  // factory into runCli and traps SIGINT, and nothing else.
7
- const packageJson = await import('../package.json', { with: { type: 'json' } });
8
11
  // @clack/prompts leaves the cursor hidden and the terminal in raw mode if a prompt is interrupted, so a
9
12
  // bare Ctrl-C would hand back an unusable shell. Restore both, then exit with the conventional 130.
10
13
  process.on('SIGINT', () => {
@@ -16,7 +19,7 @@ process.on('SIGINT', () => {
16
19
  });
17
20
  const exitCode = await runCli(process.argv.slice(2), {
18
21
  createRuntime: (options) => createDefaultRuntime(options),
19
- cliVersion: packageJson.default.version,
22
+ cliVersion: CLI_VERSION,
20
23
  });
21
24
  process.exit(exitCode);
22
25
  //# sourceMappingURL=botanary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"botanary.js","sourceRoot":"","sources":["../../bin/botanary.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,MAAM,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AA0G;AAC1G,0DAA0D;AAE1D,wGAAwG;AACxG,oGAAoG;AACpG,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAClC,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK;QAAE,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACzD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACnD,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC;IACzD,UAAU,EAAE,WAAW;CACxB,CAAC,CAAC;AACH,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC"}
package/dist/package.json CHANGED
@@ -1,15 +1,22 @@
1
1
  {
2
2
  "name": "botanary",
3
3
  "type": "module",
4
- "version": "0.2.2",
4
+ "version": "0.3.0",
5
5
  "description": "Botanary from your terminal - a guided CLI over the same wallet and agent lanes botanary-mcp exposes to a coding agent.",
6
6
  "license": "UNLICENSED",
7
7
  "homepage": "https://docs.botanary.xyz",
8
- "keywords": ["botanary", "cli", "wallet"],
8
+ "keywords": [
9
+ "botanary",
10
+ "cli",
11
+ "wallet"
12
+ ],
9
13
  "bin": {
10
14
  "botanary": "dist/bin/botanary.js"
11
15
  },
12
- "files": ["dist", "README.md"],
16
+ "files": [
17
+ "dist",
18
+ "README.md"
19
+ ],
13
20
  "engines": {
14
21
  "node": ">=22.0.0"
15
22
  },
@@ -23,13 +30,13 @@
23
30
  "test:watch": "vitest"
24
31
  },
25
32
  "dependencies": {
26
- "botanary-mcp": "^0.6.1",
27
- "commander": "^13.1.0",
28
33
  "@clack/prompts": "^0.9.1",
29
- "picocolors": "^1.1.1",
30
- "gradient-string": "^3.0.0",
34
+ "botanary-mcp": "^0.7.0",
35
+ "cli-table3": "^0.6.5",
36
+ "commander": "^13.1.0",
31
37
  "figlet": "^1.7.0",
32
- "cli-table3": "^0.6.5"
38
+ "gradient-string": "^3.0.0",
39
+ "picocolors": "^1.1.1"
33
40
  },
34
41
  "devDependencies": {
35
42
  "@swc-node/register": "^1.10.9",
@@ -1,6 +1,23 @@
1
1
  import { invalidArgs } from './errors.js';
2
- /** Surfaces `botanary open <target>` knows about. Each is a real route in the app. */
3
- export const APP_TARGETS = ['mandates', 'agents', 'history', 'yield', 'markets', 'settings'];
2
+ /** Surfaces `botanary open <target>` knows about. Each is a real route in the app - see
3
+ * `botanary-fe/src/app` for the current route list (`find src/app -name page.tsx` there is the source
4
+ * of truth). `/delegations`, `/rules` and `/earn` retired; `/activity` permanently redirects to
5
+ * `/history`, so it is never listed here on its own. */
6
+ export const APP_TARGETS = [
7
+ 'mandates',
8
+ 'agents',
9
+ 'history',
10
+ 'yield',
11
+ 'markets',
12
+ 'settings',
13
+ 'grant',
14
+ 'recovery',
15
+ 'apis',
16
+ 'copilot',
17
+ 'stocks',
18
+ 'marketplace',
19
+ 'launchpad',
20
+ ];
4
21
  /**
5
22
  * The app origin for an API base URL, by dropping a leading `api.` label: `api.app.botanary.xyz` is served
6
23
  * by Caddy in front of the same deployment as `app.botanary.xyz`.
@@ -1 +1 @@
1
- {"version":3,"file":"app-url.js","sourceRoot":"","sources":["../../src/app-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,sFAAsF;AACtF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAEtG;;;;;;;GAOG;AACH,MAAM,UA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AC,CAAC;QAChC,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACtF,OAAO,GAAG,CAAC,MAAM,CAAC;IACpB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,UAAU,CAAC;IACpB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,UAAkB,EAAE,MAAe;IACxD,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IAC3B,IAAI,CAAE,WAAiC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACzD,MAAM,WAAW,CACf,mBAAmB,MAAM,kBAAkB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EACpE,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAC/B,CAAC"}
package/dist/src/cli.js CHANGED
@@ -3,10 +3,17 @@ import { CommanderError } from 'commander';
3
3
  import { createContext } from './context.js';
4
4
  import { createProgram } from './parser.js';
5
5
  import { registerWalletCommands } from './commands/wallet.js';
6
+ import { registerSignCommands } from './commands/sign.js';
7
+ import { registerTokenCommands } from './commands/tokens.js';
6
8
  import { registerAgentCommands } from './commands/agent.js';
7
9
  import { registerMcpCommands } from './commands/mcp.js';
8
10
  import { registerSystemCommands } from './commands/system.js';
9
11
  import { registerUtilityCommands } from './commands/utilities.js';
12
+ import { registerAccountCommands } from './commands/account.js';
13
+ import { registerWatchCommands } from './commands/watch.js';
14
+ import { registerAuthorityCommands } from './commands/authority.js';
15
+ import { registerSessionWriteCommands } from './commands/session-writes.js';
16
+ import { registerServiceCommands } from './commands/services.js';
10
17
  import { runRepl } from './repl.js';
11
18
  import { colors, setColorEnabled } from './render/colors.js';
12
19
  import { readConfig } from './config-store.js';
@@ -81,10 +88,20 @@ export async function runCli(argv, deps) {
81
88
  const program = createProgram();
82
89
  program.version(deps.cliVersion, '-v, --version', 'Print the installed botanary CLI version');
83
90
  registerWalletCommands(program);
91
+ registerSignCommands(program);
92
+ registerTokenCommands(program);
84
93
  registerAgentCommands(program);
85
94
  registerMcpCommands(program);
86
95
  registerSystemCommands(program, deps.cliVersion);
87
96
  registerUtilityCommands(program, deps.cliVersion);
97
+ // Order matters from here down: later modules (authority, session-writes, services) look up an
98
+ // existing top-level Command (`account`, `agents`, `mandates`) by name to attach subcommands onto,
99
+ // rather than creating a second command of the same name - see each module's own doc comment for why.
100
+ registerAccountCommands(program);
101
+ registerWatchCommands(program);
102
+ registerAuthorityCommands(program);
103
+ registerSessionWriteCommands(program);
104
+ registerServiceCommands(program);
88
105
  program.exitOverride();
89
106
  // Recorded here, rather than sniffed from argv, because a global flag (`--json`, `--yes`, ...) can sit
90
107
  // before OR after the command name - `preAction` fires with the actual leaf command about to run,
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,C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AO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,171 @@
1
+ import { submitIntent, describeSignOutcome } from './sign.js';
2
+ import { group } from '../help/groups.js';
3
+ import { printResult } from '../render/print.js';
4
+ import { step } from '../progress.js';
5
+ import { confirmOrThrow, dryRunPayload, renderReview } from '../review.js';
6
+ import { assertTierAllows, findChain } from '../validate.js';
7
+ import { invalidArgs, notLoggedIn } from '../errors.js';
8
+ /** Mirrors `wallet.ts`'s/`sign.ts`'s own `requireWalletToken` - duplicated for the same reason
9
+ * `tokens.ts` duplicates it: every write here funnels through `submitIntent` (sign.ts), so importing a
10
+ * shared helper FROM sign.ts back into a file sign.ts might one day need to import from is exactly the
11
+ * circular-dependency shape sign.ts's own comment warns against. */
12
+ async function requireWalletToken(ctx) {
13
+ const session = await ctx.runtime.walletSession();
14
+ if (!session)
15
+ throw notLoggedIn();
16
+ return session.sessionToken;
17
+ }
18
+ /** Parse `--op-count`, shared by `account setup` and `account migrate` - both DTOs (`CliAccountSetupIntentDto`,
19
+ * `CliAccountMigrateIntentDto`) declare it optional-positive-integer, defaulting server-side to 1 when
20
+ * omitted (see `sign-request.dto.ts`'s own doc comments on each). */
21
+ function parseOpCount(raw) {
22
+ if (raw === undefined)
23
+ return undefined;
24
+ const value = Number(raw);
25
+ if (!Number.isInteger(value) || value <= 0) {
26
+ throw invalidArgs(`--op-count must be a positive integer, got ${JSON.stringify(raw)}.`);
27
+ }
28
+ return value;
29
+ }
30
+ /** Review, confirm (or dry-run), park the intent, and print the outcome - the same four steps every
31
+ * `submitIntent` caller in `wallet.ts` already repeats for `swap`/`yield deposit`/`yield withdraw`. */
32
+ async function reviewAndSubmit(ctx, title, rows, warnings, kind, params) {
33
+ if (ctx.dryRun) {
34
+ printResult(ctx, dryRunPayload(title, rows, warnings), () => renderReview('Dry run - nothing will be sent', rows, warnings));
35
+ return;
36
+ }
37
+ await confirmOrThrow(ctx, title, rows, warnings);
38
+ const outcome = await submitIntent(ctx, kind, params);
39
+ printResult(ctx, outcome.data, () => describeSignOutcome(outcome));
40
+ }
41
+ /**
42
+ * `account` (singular) - owner-signed lifecycle actions on the account itself: deploy a new one, install
43
+ * missing modules, top up on testnet, freeze/unfreeze the kill-switch, and migrate to today's address.
44
+ * Every action here is a `submitIntent` write; there is no read half beyond what `accounts list` (the
45
+ * PLURAL group in wallet.ts) already gives.
46
+ *
47
+ * `account rename` is deliberately NOT here - it is a plain session write (`PATCH /accounts/{id}`, no
48
+ * signature involved), wired onto this same Command object by `session-writes.ts` (Task 19). Registration
49
+ * order in cli.ts matters: this module must run first so that command exists to attach to.
50
+ */
51
+ export function registerAccountCommands(program) {
52
+ const account = group(program.command('account').description("Deploy, set up, fund, freeze/unfreeze and migrate this account"), 'Wallet');
53
+ account
54
+ .command('deploy')
55
+ .description('Mint a new account with its own address (always the next CREATE2 index)')
56
+ .action(async () => {
57
+ const ctx = program.opts().__ctx;
58
+ await requireWalletToken(ctx);
59
+ const rows = [{ label: 'action', value: 'deploy a new account' }, { label: 'signed by', value: 'you, in your browser' }];
60
+ await reviewAndSubmit(ctx, 'Review this account deploy', rows, [], 'account.deploy', {});
61
+ });
62
+ account
63
+ .command('setup')
64
+ .description('Install every account module this chain is missing')
65
+ .requiredOption('--chain-id <chainId>', 'Chain to set up - see `botanary chains`')
66
+ .option('--op-count <n>', 'How many ops this setup will produce - omit to let the backend size it (usually 1)')
67
+ .action(async (opts) => {
68
+ const ctx = program.opts().__ctx;
69
+ const token = await requireWalletToken(ctx);
70
+ const chains = await step(ctx, 'Reading chains', () => ctx.runtime.api.get('/v1/chains', token));
71
+ const chain = findChain(chains, opts.chainId);
72
+ assertTierAllows(chain, 'send');
73
+ if (chain.chainId === null) {
74
+ throw invalidArgs(`${chain.name} (${chain.key}) has no EVM chain id - account setup is EVM-only today.`, 'Pick an EVM chain - see `botanary chains`.');
75
+ }
76
+ const opCount = parseOpCount(opts.opCount);
77
+ const rows = [
78
+ { label: 'action', value: 'install missing account modules' },
79
+ { label: 'chain', value: `${chain.name} (${chain.key}, ${chain.tier})` },
80
+ { label: 'signed by', value: 'you, in your browser' },
81
+ ];
82
+ const warnings = chain.testnet ? ['This is a testnet chain.'] : [];
83
+ await reviewAndSubmit(ctx, 'Review this account setup', rows, warnings, 'account.setup', {
84
+ chainId: chain.chainId,
85
+ ...(opCount !== undefined ? { opCount } : {}),
86
+ });
87
+ });
88
+ account
89
+ .command('fund')
90
+ .description('Mint testnet USDC into this account (testnet faucet top-up, never a real transfer)')
91
+ .option('--account-id <accountId>', 'Specific account of yours - omit for your default')
92
+ .action(async (opts) => {
93
+ const ctx = program.opts().__ctx;
94
+ await requireWalletToken(ctx);
95
+ const rows = [
96
+ { label: 'action', value: 'mint testnet USDC into this account' },
97
+ { label: 'signed by', value: 'you, in your browser' },
98
+ ];
99
+ const warnings = ['Testnet faucet only - this never moves real funds.'];
100
+ await reviewAndSubmit(ctx, 'Review this account fund', rows, warnings, 'account.fund', {
101
+ ...(opts.accountId ? { accountId: opts.accountId } : {}),
102
+ });
103
+ });
104
+ account
105
+ .command('freeze')
106
+ .description('Freeze this account (kill-switch) - no further transfers are authorized until unfrozen')
107
+ .option('--account-id <accountId>', 'Specific account of yours - omit for your default')
108
+ .option('--lane <lane>', 'owner or panic - which frozen-flag lane to set, omit for the default')
109
+ .action(async (opts) => {
110
+ const ctx = program.opts().__ctx;
111
+ await requireWalletToken(ctx);
112
+ if (opts.lane !== undefined && opts.lane !== 'owner' && opts.lane !== 'panic') {
113
+ throw invalidArgs(`--lane must be "owner" or "panic", got ${JSON.stringify(opts.lane)}.`);
114
+ }
115
+ const rows = [
116
+ { label: 'action', value: 'freeze this account' },
117
+ ...(opts.lane ? [{ label: 'lane', value: opts.lane }] : []),
118
+ { label: 'signed by', value: 'you, in your browser' },
119
+ ];
120
+ const warnings = ['This is the kill-switch. No further transfers will be authorized until you unfreeze.'];
121
+ await reviewAndSubmit(ctx, 'Review this account freeze', rows, warnings, 'account.freeze', {
122
+ ...(opts.accountId ? { accountId: opts.accountId } : {}),
123
+ ...(opts.lane ? { lane: opts.lane } : {}),
124
+ });
125
+ });
126
+ account
127
+ .command('unfreeze')
128
+ .description('Unfreeze this account, restoring its ability to authorize transfers')
129
+ .option('--account-id <accountId>', 'Specific account of yours - omit for your default')
130
+ .action(async (opts) => {
131
+ const ctx = program.opts().__ctx;
132
+ await requireWalletToken(ctx);
133
+ const rows = [
134
+ { label: 'action', value: 'unfreeze this account' },
135
+ { label: 'signed by', value: 'you, in your browser' },
136
+ ];
137
+ await reviewAndSubmit(ctx, 'Review this account unfreeze', rows, [], 'account.unfreeze', {
138
+ ...(opts.accountId ? { accountId: opts.accountId } : {}),
139
+ });
140
+ });
141
+ account
142
+ .command('migrate')
143
+ .description("Migrate this account to today's address (zero, one or two ops, depending on its current phase)")
144
+ .requiredOption('--chain-id <chainId>', 'Chain to migrate on - see `botanary chains`')
145
+ .option('--account-id <accountId>', 'Specific account of yours - omit for your default')
146
+ .option('--op-count <n>', 'How many ops this migration will produce - omit to let the backend size it (usually 1)')
147
+ .action(async (opts) => {
148
+ const ctx = program.opts().__ctx;
149
+ const token = await requireWalletToken(ctx);
150
+ const chains = await step(ctx, 'Reading chains', () => ctx.runtime.api.get('/v1/chains', token));
151
+ const chain = findChain(chains, opts.chainId);
152
+ assertTierAllows(chain, 'send');
153
+ if (chain.chainId === null) {
154
+ throw invalidArgs(`${chain.name} (${chain.key}) has no EVM chain id - account migration is EVM-only today.`, 'Pick an EVM chain - see `botanary chains`.');
155
+ }
156
+ const opCount = parseOpCount(opts.opCount);
157
+ const rows = [
158
+ { label: 'action', value: "migrate this account to today's address" },
159
+ { label: 'chain', value: `${chain.name} (${chain.key}, ${chain.tier})` },
160
+ { label: 'signed by', value: 'you, in your browser' },
161
+ ];
162
+ const warnings = chain.testnet ? ['This is a testnet chain.'] : [];
163
+ await reviewAndSubmit(ctx, 'Review this account migration', rows, warnings, 'account.migrate', {
164
+ chainId: chain.chainId,
165
+ ...(opts.accountId ? { accountId: opts.accountId } : {}),
166
+ ...(opCount !== undefined ? { opCount } : {}),
167
+ });
168
+ });
169
+ return account;
170
+ }
171
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/commands/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAkB,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAExD;;;qEAGqE;AACrE,KAAK,UAAU,kBAAkB,CAAC,GAAe;IAC/C,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;IAClD,IAAI,CAAC,OAAO;QAAE,MAAM,WAAW,EAAE,CAAC;IAClC,OAAO,OAAO,CAAC,YAAY,CAAC;AAC9B,CAAC;AAED;;sEAEsE;AACtE,SAAS,YAAY,CAAC,GAAuB;IAC3C,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,MAAM,CAA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AI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -115,7 +115,7 @@ export function registerAgentCommands(program) {
115
115
  .description('Spend under this agent\'s own grant, unattended (propose_payment)')
116
116
  .option('--recipient <address>', 'Destination address (0x... on EVM)')
117
117
  .option('--amount <amount>', 'Amount in display units, e.g. 5')
118
- .option('--token <symbol>', 'Token symbol the grant budgets, e.g. USDC')
118
+ .option('--token <addressOrAssetRef>', 'Token the grant budgets - contract address or CAIP-19 asset ref, never a symbol')
119
119
  .option('--chain-id <chainId>', 'Chain the grant is on - see `botanary agent grant`')
120
120
  .action(async (opts) => {
121
121
  const ctx = program.opts().__ctx;
@@ -161,7 +161,7 @@ export function registerAgentCommands(program) {
161
161
  return;
162
162
  }
163
163
  await confirmOrThrow(ctx, 'Review this spend', rows, warnings);
164
- const result = await step(ctx, 'Spending under the grant', () => proposePayment(ctx.runtime, { recipient: to, amount, tokenSymbol, chainId: chain.chainId ?? Number.NaN }));
164
+ const result = await step(ctx, 'Spending under the grant', () => proposePayment(ctx.runtime, { recipient: to, amount, token: tokenSymbol, chainId: chain.chainId ?? Number.NaN }));
165
165
  const outcome = classifyAgentAction(result);
166
166
  ctx.outcome.exit = outcome.exit;
167
167
  printResult(ctx, result);
@@ -169,8 +169,8 @@ export function registerAgentCommands(program) {
169
169
  agent
170
170
  .command('swap')
171
171
  .description('Swap under this agent\'s own grant, unattended (propose_swap)')
172
- .option('--token-in <symbol>', 'Token to sell')
173
- .option('--token-out <symbol>', 'Token to buy')
172
+ .option('--token-in <addressOrAssetRef>', 'Token to sell - contract address or CAIP-19 asset ref, never a symbol')
173
+ .option('--token-out <addressOrAssetRef>', 'Token to buy - contract address or CAIP-19 asset ref, never a symbol')
174
174
  .option('--amount-in <amount>', 'Amount of --token-in to sell, in display units')
175
175
  .option('--chain-id <chainId>', 'Chain the grant is on - see `botanary agent grant`')
176
176
  .option('--max-slippage-bps <bps>', 'Maximum acceptable slippage, in basis points')
@@ -203,8 +203,8 @@ export function registerAgentCommands(program) {
203
203
  }
204
204
  await confirmOrThrow(ctx, 'Review this swap', rows, warnings);
205
205
  const result = await step(ctx, 'Swapping under the grant', () => proposeSwap(ctx.runtime, {
206
- tokenIn,
207
- tokenOut,
206
+ assetIn: tokenIn,
207
+ assetOut: tokenOut,
208
208
  amountIn: amount,
209
209
  chainId: chain.chainId ?? Number.NaN,
210
210
  ...(maxSlippageBps ? { maxSlippageBps: Number(maxSlippageBps) } : {}),