oneie 5.8.0 → 5.9.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 (270) hide show
  1. package/README.md +114 -6
  2. package/dist/package.json +37 -11
  3. package/dist/src/age-1k8hs4ec.js +1 -0
  4. package/dist/src/client-n6fpnd9f.js +1 -0
  5. package/dist/src/evm-tx-cqhm9rtt.js +1 -0
  6. package/dist/src/hl-run-0pv1e0p2.js +1 -0
  7. package/dist/src/index-f5vhzspa.js +12 -0
  8. package/dist/src/index-h3nrt8bx.js +4 -0
  9. package/dist/src/index-st6k9vhc.js +2062 -0
  10. package/dist/src/index.js +1122 -134
  11. package/dist/src/message-key-yczrxszr.js +1 -0
  12. package/dist/src/message-lock-thr851d5.js +5 -0
  13. package/dist/src/sweep-order-jrq2hkye.js +1 -0
  14. package/dist/src/sweep-runner-jftw9em7.js +1 -0
  15. package/package.json +37 -11
  16. package/dist/src/agent.d.ts +0 -75
  17. package/dist/src/agent.js +0 -1334
  18. package/dist/src/agentverse.d.ts +0 -26
  19. package/dist/src/agentverse.js +0 -171
  20. package/dist/src/args.d.ts +0 -9
  21. package/dist/src/args.js +0 -61
  22. package/dist/src/auth.d.ts +0 -6
  23. package/dist/src/auth.js +0 -121
  24. package/dist/src/balances.d.ts +0 -89
  25. package/dist/src/balances.js +0 -202
  26. package/dist/src/banner.d.ts +0 -1
  27. package/dist/src/banner.js +0 -17
  28. package/dist/src/broadcast.d.ts +0 -8
  29. package/dist/src/broadcast.js +0 -175
  30. package/dist/src/catalog.d.ts +0 -12
  31. package/dist/src/catalog.js +0 -76
  32. package/dist/src/ceiling.d.ts +0 -36
  33. package/dist/src/ceiling.js +0 -189
  34. package/dist/src/chat.d.ts +0 -2
  35. package/dist/src/chat.js +0 -92
  36. package/dist/src/check.d.ts +0 -11
  37. package/dist/src/check.js +0 -53
  38. package/dist/src/client.d.ts +0 -5
  39. package/dist/src/client.js +0 -157
  40. package/dist/src/compiler.d.ts +0 -36
  41. package/dist/src/compiler.js +0 -366
  42. package/dist/src/config.d.ts +0 -24
  43. package/dist/src/config.js +0 -70
  44. package/dist/src/connect.d.ts +0 -2
  45. package/dist/src/connect.js +0 -64
  46. package/dist/src/coordinate.d.ts +0 -3
  47. package/dist/src/coordinate.js +0 -58
  48. package/dist/src/create.d.ts +0 -2
  49. package/dist/src/create.js +0 -113
  50. package/dist/src/credits.d.ts +0 -29
  51. package/dist/src/credits.js +0 -88
  52. package/dist/src/deploy.d.ts +0 -2
  53. package/dist/src/deploy.js +0 -19
  54. package/dist/src/dev.d.ts +0 -2
  55. package/dist/src/dev.js +0 -75
  56. package/dist/src/device-flow.d.ts +0 -57
  57. package/dist/src/device-flow.js +0 -173
  58. package/dist/src/doctor.d.ts +0 -26
  59. package/dist/src/doctor.js +0 -146
  60. package/dist/src/draw.d.ts +0 -18
  61. package/dist/src/draw.js +0 -156
  62. package/dist/src/endpoint.d.ts +0 -2
  63. package/dist/src/endpoint.js +0 -250
  64. package/dist/src/env.d.ts +0 -3
  65. package/dist/src/env.js +0 -37
  66. package/dist/src/eval.d.ts +0 -2
  67. package/dist/src/eval.js +0 -43
  68. package/dist/src/fn.d.ts +0 -2
  69. package/dist/src/fn.js +0 -70
  70. package/dist/src/group.d.ts +0 -2
  71. package/dist/src/group.js +0 -117
  72. package/dist/src/hl-run.d.ts +0 -119
  73. package/dist/src/hl-run.js +0 -480
  74. package/dist/src/hl.d.ts +0 -17
  75. package/dist/src/hl.js +0 -148
  76. package/dist/src/index.d.ts +0 -2
  77. package/dist/src/init.d.ts +0 -76
  78. package/dist/src/init.js +0 -278
  79. package/dist/src/join.d.ts +0 -11
  80. package/dist/src/join.js +0 -297
  81. package/dist/src/key-publish.d.ts +0 -40
  82. package/dist/src/key-publish.js +0 -232
  83. package/dist/src/key-seal.d.ts +0 -21
  84. package/dist/src/key-seal.js +0 -142
  85. package/dist/src/key-sweep.d.ts +0 -93
  86. package/dist/src/key-sweep.js +0 -270
  87. package/dist/src/key.d.ts +0 -26
  88. package/dist/src/key.js +0 -338
  89. package/dist/src/lib/age-plugin.d.ts +0 -51
  90. package/dist/src/lib/age-plugin.js +0 -130
  91. package/dist/src/lib/agent-env.d.ts +0 -12
  92. package/dist/src/lib/agent-env.js +0 -48
  93. package/dist/src/lib/api-path.d.ts +0 -2
  94. package/dist/src/lib/api-path.js +0 -40
  95. package/dist/src/lib/asker.d.ts +0 -34
  96. package/dist/src/lib/asker.js +0 -126
  97. package/dist/src/lib/check-words.d.ts +0 -57
  98. package/dist/src/lib/check-words.js +0 -144
  99. package/dist/src/lib/client.d.ts +0 -20
  100. package/dist/src/lib/client.js +0 -71
  101. package/dist/src/lib/env-sealed.d.ts +0 -53
  102. package/dist/src/lib/env-sealed.js +0 -184
  103. package/dist/src/lib/flow-tag.d.ts +0 -86
  104. package/dist/src/lib/flow-tag.js +0 -230
  105. package/dist/src/lib/hl-core/actions.d.ts +0 -99
  106. package/dist/src/lib/hl-core/actions.js +0 -69
  107. package/dist/src/lib/hl-core/eip712.d.ts +0 -33
  108. package/dist/src/lib/hl-core/eip712.js +0 -107
  109. package/dist/src/lib/hl-core/errors.d.ts +0 -10
  110. package/dist/src/lib/hl-core/errors.js +0 -15
  111. package/dist/src/lib/hl-core/exchange.d.ts +0 -24
  112. package/dist/src/lib/hl-core/exchange.js +0 -47
  113. package/dist/src/lib/hl-core/index.d.ts +0 -13
  114. package/dist/src/lib/hl-core/index.js +0 -14
  115. package/dist/src/lib/hl-core/meta.d.ts +0 -57
  116. package/dist/src/lib/hl-core/meta.js +0 -110
  117. package/dist/src/lib/hl-core/msgpack.d.ts +0 -18
  118. package/dist/src/lib/hl-core/msgpack.js +0 -136
  119. package/dist/src/lib/hl-core/net.d.ts +0 -2
  120. package/dist/src/lib/hl-core/net.js +0 -7
  121. package/dist/src/lib/hl-core/signing.d.ts +0 -103
  122. package/dist/src/lib/hl-core/signing.js +0 -295
  123. package/dist/src/lib/hl-core/wire.d.ts +0 -34
  124. package/dist/src/lib/hl-core/wire.js +0 -81
  125. package/dist/src/lib/invoked-as.d.ts +0 -2
  126. package/dist/src/lib/invoked-as.js +0 -24
  127. package/dist/src/lib/journey-words.d.ts +0 -84
  128. package/dist/src/lib/journey-words.js +0 -363
  129. package/dist/src/lib/journey.d.ts +0 -150
  130. package/dist/src/lib/journey.js +0 -264
  131. package/dist/src/lib/key-receipt.d.ts +0 -48
  132. package/dist/src/lib/key-receipt.js +0 -116
  133. package/dist/src/lib/key-source.d.ts +0 -9
  134. package/dist/src/lib/key-source.js +0 -33
  135. package/dist/src/lib/keyfile.d.ts +0 -136
  136. package/dist/src/lib/keyfile.js +0 -397
  137. package/dist/src/lib/launch-claude.d.ts +0 -5
  138. package/dist/src/lib/launch-claude.js +0 -45
  139. package/dist/src/lib/lock-lookup.d.ts +0 -40
  140. package/dist/src/lib/lock-lookup.js +0 -92
  141. package/dist/src/lib/message-seal.d.ts +0 -63
  142. package/dist/src/lib/message-seal.js +0 -150
  143. package/dist/src/lib/net-choice.d.ts +0 -28
  144. package/dist/src/lib/net-choice.js +0 -72
  145. package/dist/src/lib/network.d.ts +0 -22
  146. package/dist/src/lib/network.js +0 -50
  147. package/dist/src/lib/next-words.d.ts +0 -105
  148. package/dist/src/lib/next-words.js +0 -298
  149. package/dist/src/lib/paths.d.ts +0 -41
  150. package/dist/src/lib/paths.js +0 -91
  151. package/dist/src/lib/plan-draw.d.ts +0 -56
  152. package/dist/src/lib/plan-draw.js +0 -219
  153. package/dist/src/lib/plan-live.d.ts +0 -20
  154. package/dist/src/lib/plan-live.js +0 -192
  155. package/dist/src/lib/qr.d.ts +0 -21
  156. package/dist/src/lib/qr.js +0 -402
  157. package/dist/src/lib/roster.d.ts +0 -20
  158. package/dist/src/lib/roster.js +0 -79
  159. package/dist/src/lib/sale-card.d.ts +0 -117
  160. package/dist/src/lib/sale-card.js +0 -261
  161. package/dist/src/lib/shop-init.d.ts +0 -62
  162. package/dist/src/lib/shop-init.js +0 -63
  163. package/dist/src/lib/sui-grpc-send.d.ts +0 -90
  164. package/dist/src/lib/sui-grpc-send.js +0 -128
  165. package/dist/src/lib/swap-core.d.ts +0 -163
  166. package/dist/src/lib/swap-core.js +0 -405
  167. package/dist/src/lib/tasks-digest.d.ts +0 -66
  168. package/dist/src/lib/tasks-digest.js +0 -200
  169. package/dist/src/lib/tasks-graph.d.ts +0 -79
  170. package/dist/src/lib/tasks-graph.js +0 -463
  171. package/dist/src/lib/tasks-lens.d.ts +0 -31
  172. package/dist/src/lib/tasks-lens.js +0 -47
  173. package/dist/src/lib/tasks-next.d.ts +0 -25
  174. package/dist/src/lib/tasks-next.js +0 -103
  175. package/dist/src/lib/tasks-prove.d.ts +0 -15
  176. package/dist/src/lib/tasks-prove.js +0 -68
  177. package/dist/src/lib/tasks-route.d.ts +0 -29
  178. package/dist/src/lib/tasks-route.js +0 -151
  179. package/dist/src/lib/tasks-score.d.ts +0 -36
  180. package/dist/src/lib/tasks-score.js +0 -152
  181. package/dist/src/lib/tasks-workspace.d.ts +0 -18
  182. package/dist/src/lib/tasks-workspace.js +0 -73
  183. package/dist/src/lib/timed-fetch.d.ts +0 -33
  184. package/dist/src/lib/timed-fetch.js +0 -59
  185. package/dist/src/lib/vault-read.d.ts +0 -24
  186. package/dist/src/lib/vault-read.js +0 -77
  187. package/dist/src/lib/vaultfile.d.ts +0 -103
  188. package/dist/src/lib/vaultfile.js +0 -249
  189. package/dist/src/lib/wallet-money.d.ts +0 -222
  190. package/dist/src/lib/wallet-money.js +0 -578
  191. package/dist/src/lib/wallet-request.d.ts +0 -50
  192. package/dist/src/lib/wallet-request.js +0 -86
  193. package/dist/src/links.d.ts +0 -5
  194. package/dist/src/links.js +0 -45
  195. package/dist/src/media.d.ts +0 -29
  196. package/dist/src/media.js +0 -487
  197. package/dist/src/message-receipt.d.ts +0 -25
  198. package/dist/src/message-receipt.js +0 -71
  199. package/dist/src/message.d.ts +0 -13
  200. package/dist/src/message.js +0 -92
  201. package/dist/src/move.d.ts +0 -36
  202. package/dist/src/move.js +0 -152
  203. package/dist/src/network-cmd.d.ts +0 -17
  204. package/dist/src/network-cmd.js +0 -74
  205. package/dist/src/next.d.ts +0 -12
  206. package/dist/src/next.js +0 -67
  207. package/dist/src/onboard.d.ts +0 -16
  208. package/dist/src/onboard.js +0 -149
  209. package/dist/src/plugin.d.ts +0 -2
  210. package/dist/src/plugin.js +0 -193
  211. package/dist/src/push.d.ts +0 -2
  212. package/dist/src/push.js +0 -115
  213. package/dist/src/render.d.ts +0 -21
  214. package/dist/src/render.js +0 -32
  215. package/dist/src/secrets-device.d.ts +0 -32
  216. package/dist/src/secrets-device.js +0 -127
  217. package/dist/src/secrets-give.d.ts +0 -125
  218. package/dist/src/secrets-give.js +0 -236
  219. package/dist/src/secrets-list.d.ts +0 -27
  220. package/dist/src/secrets-list.js +0 -84
  221. package/dist/src/secrets-run.d.ts +0 -31
  222. package/dist/src/secrets-run.js +0 -182
  223. package/dist/src/secrets.d.ts +0 -33
  224. package/dist/src/secrets.js +0 -200
  225. package/dist/src/setup.d.ts +0 -6
  226. package/dist/src/setup.js +0 -127
  227. package/dist/src/ship.d.ts +0 -2
  228. package/dist/src/ship.js +0 -18
  229. package/dist/src/shop-buy.d.ts +0 -16
  230. package/dist/src/shop-buy.js +0 -101
  231. package/dist/src/shop.d.ts +0 -10
  232. package/dist/src/shop.js +0 -112
  233. package/dist/src/skill-parser.d.ts +0 -14
  234. package/dist/src/skill-parser.js +0 -113
  235. package/dist/src/skill.d.ts +0 -2
  236. package/dist/src/skill.js +0 -493
  237. package/dist/src/slug.d.ts +0 -2
  238. package/dist/src/slug.js +0 -6
  239. package/dist/src/social.d.ts +0 -2
  240. package/dist/src/social.js +0 -106
  241. package/dist/src/staff.d.ts +0 -2
  242. package/dist/src/staff.js +0 -104
  243. package/dist/src/start.d.ts +0 -27
  244. package/dist/src/start.js +0 -225
  245. package/dist/src/status.d.ts +0 -2
  246. package/dist/src/status.js +0 -52
  247. package/dist/src/substrate.d.ts +0 -2
  248. package/dist/src/substrate.js +0 -258
  249. package/dist/src/swap.d.ts +0 -93
  250. package/dist/src/swap.js +0 -622
  251. package/dist/src/tasks.d.ts +0 -2
  252. package/dist/src/tasks.js +0 -743
  253. package/dist/src/templates.d.ts +0 -1
  254. package/dist/src/templates.js +0 -213
  255. package/dist/src/thread.d.ts +0 -2
  256. package/dist/src/thread.js +0 -52
  257. package/dist/src/trade.d.ts +0 -2
  258. package/dist/src/trade.js +0 -91
  259. package/dist/src/trail.d.ts +0 -2
  260. package/dist/src/trail.js +0 -41
  261. package/dist/src/validate.d.ts +0 -13
  262. package/dist/src/validate.js +0 -35
  263. package/dist/src/wallet-money.d.ts +0 -158
  264. package/dist/src/wallet-money.js +0 -664
  265. package/dist/src/wallet.d.ts +0 -169
  266. package/dist/src/wallet.js +0 -973
  267. package/dist/src/workflow.d.ts +0 -2
  268. package/dist/src/workflow.js +0 -169
  269. package/dist/src/write.d.ts +0 -43
  270. package/dist/src/write.js +0 -180
@@ -1,202 +0,0 @@
1
- /**
2
- * `one wallet balances [address]` — what is REALLY at the wallet you loaded, on mainnet.
3
- *
4
- * `wallet get` reads ONE's own ledger, which for most chains is test money: it printed
5
- * 0.000000 for an address that held real ETH and USDC (measured 2026-11-09). This reads the
6
- * chains themselves, through public read-only endpoints, with no key and nothing signed:
7
- * EVM ETH, USDC, USDT on Ethereum, Base and Arbitrum
8
- * Sui SUI on mainnet
9
- * Hyperliquid perps and spot, never summed (HyperCore keeps them apart)
10
- *
11
- * A read that FAILS is `unavailable`, never 0: a short answer must say it is short.
12
- */
13
- import { Command } from 'commander';
14
- const EVM_ADDRESS = /^0x[0-9a-fA-F]{40}$/;
15
- const SUI_ADDRESS = /^0x[0-9a-fA-F]{64}$/;
16
- export const isEvmAddress = (s) => EVM_ADDRESS.test(s);
17
- export const isSuiAddress = (s) => SUI_ADDRESS.test(s);
18
- export const EVM_CHAINS = [
19
- {
20
- name: 'ethereum', rpc: 'https://ethereum-rpc.publicnode.com',
21
- tokens: [
22
- { symbol: 'USDC', contract: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', decimals: 6 },
23
- { symbol: 'USDT', contract: '0xdac17f958d2ee523a2206206994597c13d831ec7', decimals: 6 },
24
- ],
25
- },
26
- { name: 'base', rpc: 'https://base-rpc.publicnode.com', tokens: [{ symbol: 'USDC', contract: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', decimals: 6 }] },
27
- {
28
- name: 'arbitrum', rpc: 'https://arbitrum-one-rpc.publicnode.com',
29
- tokens: [
30
- { symbol: 'USDC', contract: '0xaf88d065e77c8cc2239327c5edb3a432268e5831', decimals: 6 },
31
- { symbol: 'USDT', contract: '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9', decimals: 6 },
32
- ],
33
- },
34
- ];
35
- /** Sui's public JSON-RPC was switched off; GraphQL is the supported public read (measured 2026-11-09). */
36
- export const SUI_GRAPHQL = 'https://graphql.mainnet.sui.io/graphql';
37
- export const HL_INFO = 'https://api.hyperliquid.xyz/info';
38
- /** Base units → a plain decimal, no float. */
39
- export function formatUnits(raw, decimals) {
40
- const neg = raw < 0n;
41
- const s = (neg ? -raw : raw).toString().padStart(decimals + 1, '0');
42
- const whole = s.slice(0, s.length - decimals);
43
- const frac = s.slice(s.length - decimals).replace(/0+$/, '');
44
- return `${neg ? '-' : ''}${whole}${frac ? `.${frac}` : ''}`;
45
- }
46
- async function post(f, url, body) {
47
- const res = await f(url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) });
48
- if (!res.ok)
49
- throw new Error('http_error');
50
- return res.json();
51
- }
52
- const row = (chain, asset, read, decimals) => read().then((raw) => ({ chain, asset, amount: formatUnits(raw, decimals) }), (e) => ({ chain, asset, amount: null, unavailable: e instanceof Error ? e.message : 'read_failed' }));
53
- const rpcHex = async (f, url, method, params) => {
54
- const r = (await post(f, url, { jsonrpc: '2.0', id: 1, method, params }));
55
- if (typeof r.result !== 'string' || !/^0x[0-9a-fA-F]*$/.test(r.result))
56
- throw new Error('bad_answer');
57
- return r.result === '0x' ? 0n : BigInt(r.result);
58
- };
59
- export async function readEvm(address, f) {
60
- const pad = address.slice(2).toLowerCase().padStart(64, '0');
61
- const reads = [];
62
- for (const c of EVM_CHAINS) {
63
- reads.push(row(c.name, 'ETH', () => rpcHex(f, c.rpc, 'eth_getBalance', [address, 'latest']), 18));
64
- for (const t of c.tokens) {
65
- reads.push(row(c.name, t.symbol, () => rpcHex(f, c.rpc, 'eth_call', [{ to: t.contract, data: `0x70a08231${pad}` }, 'latest']), t.decimals));
66
- }
67
- }
68
- return Promise.all(reads);
69
- }
70
- export async function readSui(address, f) {
71
- return [
72
- await row('sui', 'SUI', async () => {
73
- const r = (await post(f, SUI_GRAPHQL, {
74
- query: 'query($a: SuiAddress!) { address(address: $a) { balance(coinType: "0x2::sui::SUI") { totalBalance } } }',
75
- variables: { a: address },
76
- }));
77
- const b = r.data?.address?.balance?.totalBalance;
78
- // An address that never held SUI has a null balance object: that is a real zero only when the
79
- // address itself answered.
80
- if (r.data?.address && r.data.address.balance === null)
81
- return 0n;
82
- if (typeof b !== 'string' || !/^\d+$/.test(b))
83
- throw new Error('bad_answer');
84
- return BigInt(b);
85
- }, 9),
86
- ];
87
- }
88
- export async function readHyperliquid(address, f) {
89
- try {
90
- const [p, s] = await Promise.all([
91
- post(f, HL_INFO, { type: 'clearinghouseState', user: address }),
92
- post(f, HL_INFO, { type: 'spotClearinghouseState', user: address }),
93
- ]);
94
- return {
95
- perps: p.marginSummary?.accountValue ?? null,
96
- withdrawable: p.withdrawable ?? null,
97
- spot: (s.balances ?? []).map((b) => ({ coin: b.coin, total: b.total })),
98
- };
99
- }
100
- catch (e) {
101
- return { perps: null, withdrawable: null, spot: null, unavailable: e instanceof Error ? e.message : 'read_failed' };
102
- }
103
- }
104
- export async function readBalances(addresses, f) {
105
- const [evm, sui, hl] = await Promise.all([
106
- addresses.evm ? readEvm(addresses.evm, f) : Promise.resolve([]),
107
- addresses.sui ? readSui(addresses.sui, f) : Promise.resolve([]),
108
- addresses.evm ? readHyperliquid(addresses.evm, f) : Promise.resolve(undefined),
109
- ]);
110
- return {
111
- ok: true,
112
- network: 'mainnet',
113
- rows: [...evm, ...sui],
114
- ...(hl ? { hyperliquid: hl } : {}),
115
- note: 'Mainnet, read from the chains themselves. `wallet get` shows ONE\'s own ledger, which is test money for most chains. A row that says unavailable was not read; it is not zero.',
116
- };
117
- }
118
- export function balanceLines(r, addresses) {
119
- const lines = [];
120
- const pad = (s, n) => s.padEnd(n);
121
- if (addresses.evm)
122
- lines.push(`evm ${addresses.evm}`);
123
- if (addresses.sui)
124
- lines.push(`sui ${addresses.sui}`);
125
- for (const x of r.rows) {
126
- const v = x.amount === null ? `unavailable (${x.unavailable ?? 'read_failed'})` : x.amount;
127
- if (x.amount === '0')
128
- continue;
129
- lines.push(`${pad(x.chain, 10)}${pad(x.asset, 6)}${v}`);
130
- }
131
- const nonzero = r.rows.filter((x) => x.amount !== '0').length;
132
- if (nonzero === 0)
133
- lines.push('(every chain read answered: nothing here)');
134
- if (r.hyperliquid) {
135
- const h = r.hyperliquid;
136
- if (h.unavailable)
137
- lines.push(`hyperliquid unavailable (${h.unavailable})`);
138
- else {
139
- lines.push(`hyperliquid perps ${h.perps ?? '0'} (withdrawable ${h.withdrawable ?? '0'})`);
140
- lines.push(`hyperliquid spot ${h.spot && h.spot.length ? h.spot.map((b) => `${b.total} ${b.coin}`).join(', ') : 'none'}`);
141
- lines.push('perps and spot are separate balances; they are not summed');
142
- }
143
- }
144
- return lines;
145
- }
146
- export function balancesCmd(deps, defaultApi) {
147
- return new Command('balances')
148
- .description('What is really in your wallet on mainnet: ETH, USDC, USDT on Ethereum, Base and Arbitrum; SUI; Hyperliquid perps and spot. No key, nothing signed. No address = your workspace wallet')
149
- .argument('[address]', 'a 0x EVM address (40 hex) or a Sui address (64 hex)')
150
- .option('--workspace <slug>', 'Workspace (defaults to AGENCY_SLUG)')
151
- .option('--actor <id>', 'Actor within the workspace (defaults to workspace)')
152
- .option('--api <url>', 'API base URL', defaultApi)
153
- .option('--key <key>', 'API key (needed only without an address)')
154
- .action(async function (address, opts) {
155
- const json = Boolean(this.optsWithGlobals().json);
156
- let addrs;
157
- if (address) {
158
- const a = address.trim();
159
- if (isEvmAddress(a))
160
- addrs = { evm: a };
161
- else if (isSuiAddress(a))
162
- addrs = { sui: a };
163
- else {
164
- const err = { ok: false, error: 'bad_address', next: 'Pass a 0x EVM address (40 hex characters) or a Sui address (64).' };
165
- if (json)
166
- process.stdout.write(JSON.stringify(err) + '\n');
167
- else
168
- console.error('✗', err.next);
169
- process.exit(1);
170
- return;
171
- }
172
- }
173
- else {
174
- try {
175
- addrs = await deps.addresses(opts);
176
- }
177
- catch (e) {
178
- const msg = e instanceof Error ? e.message : 'wallet_read_failed';
179
- if (json)
180
- process.stdout.write(JSON.stringify({ ok: false, error: 'wallet_read_failed', detail: msg, next: 'Pass an address: one wallet balances 0x…' }) + '\n');
181
- else
182
- console.error('✗', msg, '\n Pass an address: one wallet balances 0x…');
183
- process.exit(1);
184
- return;
185
- }
186
- if (!addrs.evm && !addrs.sui) {
187
- const err = { ok: false, error: 'no_address', next: 'Your workspace has no wallet address registered. Pass one: one wallet balances 0x…' };
188
- if (json)
189
- process.stdout.write(JSON.stringify(err) + '\n');
190
- else
191
- console.error('✗', err.next);
192
- process.exit(1);
193
- return;
194
- }
195
- }
196
- const r = await readBalances(addrs, deps.fetch);
197
- if (json)
198
- process.stdout.write(JSON.stringify({ ...r, addresses: addrs }) + '\n');
199
- else
200
- console.log(balanceLines(r, addrs).join('\n'));
201
- });
202
- }
@@ -1 +0,0 @@
1
- export declare function displayBanner(): void;
@@ -1,17 +0,0 @@
1
- // The ONE wordmark — ported from legacy 3.8.3's banner.js, plain stdout
2
- // (no chalk: the current CLI stays dependency-lean). Shown only on the
3
- // human-TTY paths (bare invocation, `create`) — never for an agent shell,
4
- // which wants signal, not decoration.
5
- export function displayBanner() {
6
- process.stdout.write(`
7
- ██████╗ ███╗ ██╗███████╗
8
- ██╔═══██╗████╗ ██║██╔════╝
9
- ██║ ██║██╔██╗ ██║█████╗
10
- ██║ ██║██║╚██╗██║██╔══╝
11
- ╚██████╔╝██║ ╚████║███████╗
12
- ╚═════╝ ╚═╝ ╚═══╝╚══════╝
13
- Give your agents financial superpowers.
14
- https://one.ie
15
-
16
- `);
17
- }
@@ -1,8 +0,0 @@
1
- import { Command } from 'commander';
2
- /** `one broadcast` — operate newsletters from the terminal.
3
- * Two verbs: list + send. Both hit broadcast:* receivers via ask(); no new route. */
4
- export declare function broadcastCmd(): Command;
5
- /** `one segment` — read-only v1: list + preview audience segments from the terminal. */
6
- export declare function segmentCmd(): Command;
7
- /** `one newsletter` — pull/push newsletter block trees from the terminal. */
8
- export declare function newsletterCmd(): Command;
@@ -1,175 +0,0 @@
1
- import { Command } from 'commander';
2
- import { authHeaders, resolveBase } from './lib/client.js';
3
- import { askPath } from './lib/api-path.js';
4
- const DEFAULT_API = resolveBase({}, 'https://api.one.ie');
5
- async function ask(api, receiver, data) {
6
- const res = await fetch(askPath(api.replace(/\/$/, ''), receiver), {
7
- method: 'POST',
8
- headers: authHeaders(),
9
- body: JSON.stringify({ data }),
10
- });
11
- if (!res.ok) {
12
- process.stderr.write(`POST /api/ask/${receiver} → ${res.status}\n`);
13
- process.exit(1);
14
- }
15
- return res.json();
16
- }
17
- function out(data) {
18
- process.stdout.write(JSON.stringify(data, null, 2) + '\n');
19
- }
20
- /** `one broadcast` — operate newsletters from the terminal.
21
- * Two verbs: list + send. Both hit broadcast:* receivers via ask(); no new route. */
22
- export function broadcastCmd() {
23
- const cmd = new Command('broadcast').description('Operate email broadcasts (newsletters)');
24
- cmd
25
- .command('list')
26
- .description('List broadcasts for the workspace')
27
- .option('--limit <n>', 'Max results', '20')
28
- .option('--api <url>', 'API base URL', DEFAULT_API)
29
- .action(async (opts) => {
30
- out(await ask(opts.api, 'broadcast:list', { limit: Number(opts.limit) }));
31
- });
32
- cmd
33
- .command('send <id>')
34
- .description('Send a broadcast now (inline drain, suppression-checked)')
35
- .option('--api <url>', 'API base URL', DEFAULT_API)
36
- .action(async (id, opts) => {
37
- out(await ask(opts.api, 'broadcast:send', { broadcastId: id }));
38
- });
39
- return cmd;
40
- }
41
- /** `one segment` — read-only v1: list + preview audience segments from the terminal. */
42
- export function segmentCmd() {
43
- const cmd = new Command('segment').description('List and preview audience segments');
44
- cmd
45
- .command('list')
46
- .description('List audience segments for the workspace')
47
- .option('--api <url>', 'API base URL', DEFAULT_API)
48
- .action(async (opts) => {
49
- out(await ask(opts.api, 'segment:list', {}));
50
- });
51
- cmd
52
- .command('preview <id>')
53
- .description('Preview an audience segment by id — live count + up to 10 sample addresses')
54
- .option('--api <url>', 'API base URL', DEFAULT_API)
55
- .action(async (id, opts) => {
56
- const got = await ask(opts.api, 'segment:get', { id });
57
- if (!got.segment) {
58
- process.stderr.write(`segment:get returned no segment for id=${id}\n`);
59
- process.exit(1);
60
- }
61
- out(await ask(opts.api, 'segment:preview', { definition: got.segment.definition }));
62
- });
63
- return cmd;
64
- }
65
- // ---------------------------------------------------------------------------
66
- // Inline block serialization — mirrors serialize.ts; no Zod dep (CLI rule)
67
- // ---------------------------------------------------------------------------
68
- function serializeBlocksMd(blocks) {
69
- return blocks.map(({ kind, ...rest }) => '```block ' + kind + '\n' + JSON.stringify(rest) + '\n```').join('\n\n');
70
- }
71
- function parseBlocksMd(md) {
72
- const blocks = [];
73
- const fence = /^```block ([a-z]+)\n([\s\S]*?)\n```$/gm;
74
- let m;
75
- while ((m = fence.exec(md)) !== null) {
76
- const lineNo = md.slice(0, m.index).split('\n').length;
77
- try {
78
- const body = JSON.parse(m[2]);
79
- blocks.push({ kind: m[1], ...body });
80
- }
81
- catch (e) {
82
- throw new Error(`parseBlocks: invalid JSON at line ${lineNo}: ${e instanceof Error ? e.message : e}`);
83
- }
84
- }
85
- return blocks;
86
- }
87
- function diffBlocks(before, after) {
88
- const diffs = [];
89
- const beforeById = new Map(before.map(b => [b.id, b]));
90
- const afterById = new Map(after.map(b => [b.id, b]));
91
- for (const [id, b] of beforeById) {
92
- if (!afterById.has(id)) {
93
- diffs.push({ op: '-', kind: b.kind, id });
94
- }
95
- }
96
- for (const [id, a] of afterById) {
97
- if (!beforeById.has(id)) {
98
- diffs.push({ op: '+', kind: a.kind, id });
99
- }
100
- else {
101
- const b = beforeById.get(id);
102
- if (JSON.stringify(b) !== JSON.stringify(a)) {
103
- diffs.push({ op: '~', kind: a.kind, id });
104
- }
105
- }
106
- }
107
- return diffs;
108
- }
109
- /** `one newsletter` — pull/push newsletter block trees from the terminal. */
110
- export function newsletterCmd() {
111
- const cmd = new Command('newsletter').description('Pull and push newsletter component trees');
112
- cmd
113
- .command('pull <broadcastId>')
114
- .description('Fetch a broadcast and print its blocks as markdown')
115
- .option('--api <url>', 'API base URL', DEFAULT_API)
116
- .action(async (broadcastId, opts) => {
117
- const res = await ask(opts.api, 'broadcast:get', { broadcastId });
118
- const b = res.broadcast;
119
- if (!b) {
120
- process.stderr.write(`broadcast:get returned no broadcast\n`);
121
- process.exit(1);
122
- }
123
- if (b.components && Array.isArray(b.components) && b.components.length > 0) {
124
- process.stdout.write(serializeBlocksMd(b.components) + '\n');
125
- }
126
- else if (b.body_md) {
127
- process.stdout.write(b.body_md + '\n');
128
- }
129
- else {
130
- process.stdout.write('');
131
- }
132
- });
133
- cmd
134
- .command('push <broadcastId> <file>')
135
- .description('Parse a markdown file and update broadcast components')
136
- .option('--api <url>', 'API base URL', DEFAULT_API)
137
- .option('--test', 'Dry-run: mark update as test_send')
138
- .action(async (broadcastId, file, opts) => {
139
- const { readFileSync } = await import('node:fs');
140
- let md;
141
- try {
142
- md = readFileSync(file, 'utf8');
143
- }
144
- catch (e) {
145
- process.stderr.write(`Cannot read ${file}: ${e instanceof Error ? e.message : e}\n`);
146
- process.exit(1);
147
- }
148
- let components;
149
- try {
150
- components = parseBlocksMd(md);
151
- }
152
- catch (e) {
153
- process.stderr.write(`${e instanceof Error ? e.message : e}\n`);
154
- process.exit(1);
155
- }
156
- // Fetch current state for diff display
157
- const current = await ask(opts.api, 'broadcast:get', { broadcastId });
158
- const prev = (current.broadcast?.components ?? []);
159
- const version = current.broadcast?.version;
160
- const diffs = diffBlocks(prev, components);
161
- for (const d of diffs) {
162
- process.stdout.write(`${d.op} ${d.kind} (${d.id})\n`);
163
- }
164
- if (diffs.length === 0) {
165
- process.stdout.write('(no changes)\n');
166
- }
167
- const payload = { broadcastId, components };
168
- if (version !== undefined)
169
- payload['version'] = version;
170
- if (opts.test)
171
- payload['test_send'] = true;
172
- out(await ask(opts.api, 'broadcast:update', payload));
173
- });
174
- return cmd;
175
- }
@@ -1,12 +0,0 @@
1
- import { Command } from 'commander';
2
- interface CatalogItem {
3
- receiver: string;
4
- summary?: string;
5
- effect?: string;
6
- cost?: unknown;
7
- reversible?: boolean;
8
- settles?: string;
9
- }
10
- export declare function catalogItems(data: Record<string, unknown>): CatalogItem[];
11
- export declare function catalogCommands(program: Command): void;
12
- export {};
@@ -1,76 +0,0 @@
1
- import { askPath } from './lib/api-path.js';
2
- import { authHeaders } from './lib/client.js';
3
- const DEFAULT_API = process.env.ONEIE_BASE_URL ?? process.env.ONE_API_URL ?? 'https://api.one.ie';
4
- function base(opts) {
5
- return (opts.api ?? DEFAULT_API).replace(/\/$/, '');
6
- }
7
- const RECIPE_BLURB = {
8
- spine: 'onboard — become an actor, mint a key, declare capability',
9
- build: 'build a world — workspace, group, actor, thing',
10
- trade: 'discover peers, hire, get paid',
11
- transact: 'post a bounty, settle onchain',
12
- };
13
- function formatItem(it) {
14
- const meta = [];
15
- if (it.cost != null)
16
- meta.push(`cost: ${typeof it.cost === 'object' ? JSON.stringify(it.cost) : it.cost}`);
17
- if (it.settles && it.settles !== 'none')
18
- meta.push(`settles: ${it.settles}`);
19
- if (it.reversible === false)
20
- meta.push('reversible: false');
21
- const tail = meta.length ? ` · ${meta.join(' · ')}` : '';
22
- return ` ${it.receiver.padEnd(28)}${it.summary ?? ''}${tail}`;
23
- }
24
- function formatCatalog(items, goal) {
25
- if (goal) {
26
- const match = items.filter((it) => it.receiver.toLowerCase().includes(goal.toLowerCase()));
27
- if (!match.length)
28
- return ` (no receivers matching "${goal}")`;
29
- return `GOAL: ${goal}\n\n` + match.map(formatItem).join('\n');
30
- }
31
- const grouped = {};
32
- for (const it of items) {
33
- const group = it.receiver.split(':')[0] ?? 'other';
34
- (grouped[group] ??= []).push(it);
35
- }
36
- const out = [];
37
- for (const [group, groupItems] of Object.entries(grouped)) {
38
- out.push(`${group.toUpperCase()} — ${RECIPE_BLURB[group] ?? ''}`);
39
- groupItems.forEach((it) => out.push(formatItem(it)));
40
- out.push('');
41
- }
42
- return out.join('\n');
43
- }
44
- // The door answers { outcome, result: CatalogItem[] }; older shapes put the list at
45
- // items / receivers. Reading only those two printed an empty catalog.
46
- export function catalogItems(data) {
47
- const r = data.result;
48
- const list = Array.isArray(r) ? r : r?.items ?? data.items ?? data.receivers ?? [];
49
- return Array.isArray(list) ? list : [];
50
- }
51
- export function catalogCommands(program) {
52
- program
53
- .command('catalog')
54
- .description('Browse receiver surface by recipe')
55
- .option('--goal <text>', 'Filter by receiver group or keyword')
56
- .option('--api <url>', 'API base URL', DEFAULT_API)
57
- .option('--json', 'Output raw JSON')
58
- .action(async (opts) => {
59
- const res = await fetch(askPath(base(opts), 'meta:catalog'), {
60
- method: 'POST',
61
- headers: authHeaders(),
62
- body: JSON.stringify({ data: opts.goal ? { goal: opts.goal } : {} }),
63
- });
64
- if (!res.ok) {
65
- process.stderr.write(`meta:catalog → ${res.status}\n`);
66
- process.exit(1);
67
- }
68
- const data = await res.json();
69
- if (opts.json) {
70
- process.stdout.write(JSON.stringify(data, null, 2) + '\n');
71
- return;
72
- }
73
- const items = catalogItems(data);
74
- process.stdout.write(formatCatalog(items, opts.goal) + '\n');
75
- });
76
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * ceiling.ts — `one wallet ceiling create | set | show | register`: an agent's on-chain spend
3
- * ceiling (pay/contracts/spend-cap, `SpendCeiling`), driven from the terminal.
4
- *
5
- * create The OWNER's key signs `create_ceiling(agentId, perTx, total)`. The sender becomes
6
- * the ceiling's owner, so the bound is the owner's from the first block and starts
7
- * enabled. Signing opens the owner's vault (Touch ID for a Keychain vault).
8
- * set The OWNER's key signs `update_ceiling` — raise, lower, pause. Over the limit means
9
- * this: only the owner's biometric moves the bound. An agent cannot.
10
- * show The chain's own reading of a ceiling: owner, agent, both bounds, spent, enabled.
11
- * register Hands the ceiling to pay through the `agent:register-ceiling` receiver — the same
12
- * door the SDK, the MCP `ask` tool and the page call. pay checks the object is a
13
- * SpendCeiling for that agent, owned by the agent's claimed human.
14
- *
15
- * Amounts are dollars on the command line and cents on chain (the contract's unit).
16
- * Dry by default: without --live, create and set print the call and sign nothing.
17
- * The package id per network is pay's (pay/backend/src/config.ts `spendCapPackage`);
18
- * tests/ceiling.test.ts fails if this copy drifts from it.
19
- */
20
- import { Command } from 'commander';
21
- import { type Net } from './lib/wallet-money.js';
22
- /** pay's spend-cap package per network — a copy, pinned to pay/backend/src/config.ts by test. */
23
- export declare const SPEND_CAP_PACKAGE: Record<Net, string | undefined>;
24
- /** "12.34" → 1234 cents; anything else → null. */
25
- export declare function dollarsToCents(v: string): number | null;
26
- export interface CeilingFields {
27
- owner: string;
28
- agentId: string;
29
- perTxCents: number;
30
- totalCents: number;
31
- spentCents: number;
32
- enabled: boolean;
33
- }
34
- /** The ceiling's Move fields as the gRPC json reading gives them, numbers made numbers. */
35
- export declare function readCeilingFields(json: Record<string, unknown> | null | undefined): CeilingFields | null;
36
- export declare function ceilingCmd(): Command;