oneie 5.8.0 → 5.8.1

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 (268) hide show
  1. package/dist/package.json +7 -8
  2. package/dist/src/age-yefbe8pe.js +1 -0
  3. package/dist/src/evm-tx-ee2q0e3w.js +1 -0
  4. package/dist/src/hl-run-tgrkrk69.js +1 -0
  5. package/dist/src/index-0rj9wdk9.js +4 -0
  6. package/dist/src/index-91y484c2.js +2052 -0
  7. package/dist/src/index-940y3rnv.js +12 -0
  8. package/dist/src/index.js +1047 -134
  9. package/dist/src/message-key-db1xjdkw.js +1 -0
  10. package/dist/src/message-lock-5vr8079x.js +5 -0
  11. package/dist/src/sweep-order-c2p6rk8c.js +1 -0
  12. package/dist/src/sweep-runner-t68xe7vx.js +1 -0
  13. package/package.json +7 -8
  14. package/dist/src/agent.d.ts +0 -75
  15. package/dist/src/agent.js +0 -1334
  16. package/dist/src/agentverse.d.ts +0 -26
  17. package/dist/src/agentverse.js +0 -171
  18. package/dist/src/args.d.ts +0 -9
  19. package/dist/src/args.js +0 -61
  20. package/dist/src/auth.d.ts +0 -6
  21. package/dist/src/auth.js +0 -121
  22. package/dist/src/balances.d.ts +0 -89
  23. package/dist/src/balances.js +0 -202
  24. package/dist/src/banner.d.ts +0 -1
  25. package/dist/src/banner.js +0 -17
  26. package/dist/src/broadcast.d.ts +0 -8
  27. package/dist/src/broadcast.js +0 -175
  28. package/dist/src/catalog.d.ts +0 -12
  29. package/dist/src/catalog.js +0 -76
  30. package/dist/src/ceiling.d.ts +0 -36
  31. package/dist/src/ceiling.js +0 -189
  32. package/dist/src/chat.d.ts +0 -2
  33. package/dist/src/chat.js +0 -92
  34. package/dist/src/check.d.ts +0 -11
  35. package/dist/src/check.js +0 -53
  36. package/dist/src/client.d.ts +0 -5
  37. package/dist/src/client.js +0 -157
  38. package/dist/src/compiler.d.ts +0 -36
  39. package/dist/src/compiler.js +0 -366
  40. package/dist/src/config.d.ts +0 -24
  41. package/dist/src/config.js +0 -70
  42. package/dist/src/connect.d.ts +0 -2
  43. package/dist/src/connect.js +0 -64
  44. package/dist/src/coordinate.d.ts +0 -3
  45. package/dist/src/coordinate.js +0 -58
  46. package/dist/src/create.d.ts +0 -2
  47. package/dist/src/create.js +0 -113
  48. package/dist/src/credits.d.ts +0 -29
  49. package/dist/src/credits.js +0 -88
  50. package/dist/src/deploy.d.ts +0 -2
  51. package/dist/src/deploy.js +0 -19
  52. package/dist/src/dev.d.ts +0 -2
  53. package/dist/src/dev.js +0 -75
  54. package/dist/src/device-flow.d.ts +0 -57
  55. package/dist/src/device-flow.js +0 -173
  56. package/dist/src/doctor.d.ts +0 -26
  57. package/dist/src/doctor.js +0 -146
  58. package/dist/src/draw.d.ts +0 -18
  59. package/dist/src/draw.js +0 -156
  60. package/dist/src/endpoint.d.ts +0 -2
  61. package/dist/src/endpoint.js +0 -250
  62. package/dist/src/env.d.ts +0 -3
  63. package/dist/src/env.js +0 -37
  64. package/dist/src/eval.d.ts +0 -2
  65. package/dist/src/eval.js +0 -43
  66. package/dist/src/fn.d.ts +0 -2
  67. package/dist/src/fn.js +0 -70
  68. package/dist/src/group.d.ts +0 -2
  69. package/dist/src/group.js +0 -117
  70. package/dist/src/hl-run.d.ts +0 -119
  71. package/dist/src/hl-run.js +0 -480
  72. package/dist/src/hl.d.ts +0 -17
  73. package/dist/src/hl.js +0 -148
  74. package/dist/src/index.d.ts +0 -2
  75. package/dist/src/init.d.ts +0 -76
  76. package/dist/src/init.js +0 -278
  77. package/dist/src/join.d.ts +0 -11
  78. package/dist/src/join.js +0 -297
  79. package/dist/src/key-publish.d.ts +0 -40
  80. package/dist/src/key-publish.js +0 -232
  81. package/dist/src/key-seal.d.ts +0 -21
  82. package/dist/src/key-seal.js +0 -142
  83. package/dist/src/key-sweep.d.ts +0 -93
  84. package/dist/src/key-sweep.js +0 -270
  85. package/dist/src/key.d.ts +0 -26
  86. package/dist/src/key.js +0 -338
  87. package/dist/src/lib/age-plugin.d.ts +0 -51
  88. package/dist/src/lib/age-plugin.js +0 -130
  89. package/dist/src/lib/agent-env.d.ts +0 -12
  90. package/dist/src/lib/agent-env.js +0 -48
  91. package/dist/src/lib/api-path.d.ts +0 -2
  92. package/dist/src/lib/api-path.js +0 -40
  93. package/dist/src/lib/asker.d.ts +0 -34
  94. package/dist/src/lib/asker.js +0 -126
  95. package/dist/src/lib/check-words.d.ts +0 -57
  96. package/dist/src/lib/check-words.js +0 -144
  97. package/dist/src/lib/client.d.ts +0 -20
  98. package/dist/src/lib/client.js +0 -71
  99. package/dist/src/lib/env-sealed.d.ts +0 -53
  100. package/dist/src/lib/env-sealed.js +0 -184
  101. package/dist/src/lib/flow-tag.d.ts +0 -86
  102. package/dist/src/lib/flow-tag.js +0 -230
  103. package/dist/src/lib/hl-core/actions.d.ts +0 -99
  104. package/dist/src/lib/hl-core/actions.js +0 -69
  105. package/dist/src/lib/hl-core/eip712.d.ts +0 -33
  106. package/dist/src/lib/hl-core/eip712.js +0 -107
  107. package/dist/src/lib/hl-core/errors.d.ts +0 -10
  108. package/dist/src/lib/hl-core/errors.js +0 -15
  109. package/dist/src/lib/hl-core/exchange.d.ts +0 -24
  110. package/dist/src/lib/hl-core/exchange.js +0 -47
  111. package/dist/src/lib/hl-core/index.d.ts +0 -13
  112. package/dist/src/lib/hl-core/index.js +0 -14
  113. package/dist/src/lib/hl-core/meta.d.ts +0 -57
  114. package/dist/src/lib/hl-core/meta.js +0 -110
  115. package/dist/src/lib/hl-core/msgpack.d.ts +0 -18
  116. package/dist/src/lib/hl-core/msgpack.js +0 -136
  117. package/dist/src/lib/hl-core/net.d.ts +0 -2
  118. package/dist/src/lib/hl-core/net.js +0 -7
  119. package/dist/src/lib/hl-core/signing.d.ts +0 -103
  120. package/dist/src/lib/hl-core/signing.js +0 -295
  121. package/dist/src/lib/hl-core/wire.d.ts +0 -34
  122. package/dist/src/lib/hl-core/wire.js +0 -81
  123. package/dist/src/lib/invoked-as.d.ts +0 -2
  124. package/dist/src/lib/invoked-as.js +0 -24
  125. package/dist/src/lib/journey-words.d.ts +0 -84
  126. package/dist/src/lib/journey-words.js +0 -363
  127. package/dist/src/lib/journey.d.ts +0 -150
  128. package/dist/src/lib/journey.js +0 -264
  129. package/dist/src/lib/key-receipt.d.ts +0 -48
  130. package/dist/src/lib/key-receipt.js +0 -116
  131. package/dist/src/lib/key-source.d.ts +0 -9
  132. package/dist/src/lib/key-source.js +0 -33
  133. package/dist/src/lib/keyfile.d.ts +0 -136
  134. package/dist/src/lib/keyfile.js +0 -397
  135. package/dist/src/lib/launch-claude.d.ts +0 -5
  136. package/dist/src/lib/launch-claude.js +0 -45
  137. package/dist/src/lib/lock-lookup.d.ts +0 -40
  138. package/dist/src/lib/lock-lookup.js +0 -92
  139. package/dist/src/lib/message-seal.d.ts +0 -63
  140. package/dist/src/lib/message-seal.js +0 -150
  141. package/dist/src/lib/net-choice.d.ts +0 -28
  142. package/dist/src/lib/net-choice.js +0 -72
  143. package/dist/src/lib/network.d.ts +0 -22
  144. package/dist/src/lib/network.js +0 -50
  145. package/dist/src/lib/next-words.d.ts +0 -105
  146. package/dist/src/lib/next-words.js +0 -298
  147. package/dist/src/lib/paths.d.ts +0 -41
  148. package/dist/src/lib/paths.js +0 -91
  149. package/dist/src/lib/plan-draw.d.ts +0 -56
  150. package/dist/src/lib/plan-draw.js +0 -219
  151. package/dist/src/lib/plan-live.d.ts +0 -20
  152. package/dist/src/lib/plan-live.js +0 -192
  153. package/dist/src/lib/qr.d.ts +0 -21
  154. package/dist/src/lib/qr.js +0 -402
  155. package/dist/src/lib/roster.d.ts +0 -20
  156. package/dist/src/lib/roster.js +0 -79
  157. package/dist/src/lib/sale-card.d.ts +0 -117
  158. package/dist/src/lib/sale-card.js +0 -261
  159. package/dist/src/lib/shop-init.d.ts +0 -62
  160. package/dist/src/lib/shop-init.js +0 -63
  161. package/dist/src/lib/sui-grpc-send.d.ts +0 -90
  162. package/dist/src/lib/sui-grpc-send.js +0 -128
  163. package/dist/src/lib/swap-core.d.ts +0 -163
  164. package/dist/src/lib/swap-core.js +0 -405
  165. package/dist/src/lib/tasks-digest.d.ts +0 -66
  166. package/dist/src/lib/tasks-digest.js +0 -200
  167. package/dist/src/lib/tasks-graph.d.ts +0 -79
  168. package/dist/src/lib/tasks-graph.js +0 -463
  169. package/dist/src/lib/tasks-lens.d.ts +0 -31
  170. package/dist/src/lib/tasks-lens.js +0 -47
  171. package/dist/src/lib/tasks-next.d.ts +0 -25
  172. package/dist/src/lib/tasks-next.js +0 -103
  173. package/dist/src/lib/tasks-prove.d.ts +0 -15
  174. package/dist/src/lib/tasks-prove.js +0 -68
  175. package/dist/src/lib/tasks-route.d.ts +0 -29
  176. package/dist/src/lib/tasks-route.js +0 -151
  177. package/dist/src/lib/tasks-score.d.ts +0 -36
  178. package/dist/src/lib/tasks-score.js +0 -152
  179. package/dist/src/lib/tasks-workspace.d.ts +0 -18
  180. package/dist/src/lib/tasks-workspace.js +0 -73
  181. package/dist/src/lib/timed-fetch.d.ts +0 -33
  182. package/dist/src/lib/timed-fetch.js +0 -59
  183. package/dist/src/lib/vault-read.d.ts +0 -24
  184. package/dist/src/lib/vault-read.js +0 -77
  185. package/dist/src/lib/vaultfile.d.ts +0 -103
  186. package/dist/src/lib/vaultfile.js +0 -249
  187. package/dist/src/lib/wallet-money.d.ts +0 -222
  188. package/dist/src/lib/wallet-money.js +0 -578
  189. package/dist/src/lib/wallet-request.d.ts +0 -50
  190. package/dist/src/lib/wallet-request.js +0 -86
  191. package/dist/src/links.d.ts +0 -5
  192. package/dist/src/links.js +0 -45
  193. package/dist/src/media.d.ts +0 -29
  194. package/dist/src/media.js +0 -487
  195. package/dist/src/message-receipt.d.ts +0 -25
  196. package/dist/src/message-receipt.js +0 -71
  197. package/dist/src/message.d.ts +0 -13
  198. package/dist/src/message.js +0 -92
  199. package/dist/src/move.d.ts +0 -36
  200. package/dist/src/move.js +0 -152
  201. package/dist/src/network-cmd.d.ts +0 -17
  202. package/dist/src/network-cmd.js +0 -74
  203. package/dist/src/next.d.ts +0 -12
  204. package/dist/src/next.js +0 -67
  205. package/dist/src/onboard.d.ts +0 -16
  206. package/dist/src/onboard.js +0 -149
  207. package/dist/src/plugin.d.ts +0 -2
  208. package/dist/src/plugin.js +0 -193
  209. package/dist/src/push.d.ts +0 -2
  210. package/dist/src/push.js +0 -115
  211. package/dist/src/render.d.ts +0 -21
  212. package/dist/src/render.js +0 -32
  213. package/dist/src/secrets-device.d.ts +0 -32
  214. package/dist/src/secrets-device.js +0 -127
  215. package/dist/src/secrets-give.d.ts +0 -125
  216. package/dist/src/secrets-give.js +0 -236
  217. package/dist/src/secrets-list.d.ts +0 -27
  218. package/dist/src/secrets-list.js +0 -84
  219. package/dist/src/secrets-run.d.ts +0 -31
  220. package/dist/src/secrets-run.js +0 -182
  221. package/dist/src/secrets.d.ts +0 -33
  222. package/dist/src/secrets.js +0 -200
  223. package/dist/src/setup.d.ts +0 -6
  224. package/dist/src/setup.js +0 -127
  225. package/dist/src/ship.d.ts +0 -2
  226. package/dist/src/ship.js +0 -18
  227. package/dist/src/shop-buy.d.ts +0 -16
  228. package/dist/src/shop-buy.js +0 -101
  229. package/dist/src/shop.d.ts +0 -10
  230. package/dist/src/shop.js +0 -112
  231. package/dist/src/skill-parser.d.ts +0 -14
  232. package/dist/src/skill-parser.js +0 -113
  233. package/dist/src/skill.d.ts +0 -2
  234. package/dist/src/skill.js +0 -493
  235. package/dist/src/slug.d.ts +0 -2
  236. package/dist/src/slug.js +0 -6
  237. package/dist/src/social.d.ts +0 -2
  238. package/dist/src/social.js +0 -106
  239. package/dist/src/staff.d.ts +0 -2
  240. package/dist/src/staff.js +0 -104
  241. package/dist/src/start.d.ts +0 -27
  242. package/dist/src/start.js +0 -225
  243. package/dist/src/status.d.ts +0 -2
  244. package/dist/src/status.js +0 -52
  245. package/dist/src/substrate.d.ts +0 -2
  246. package/dist/src/substrate.js +0 -258
  247. package/dist/src/swap.d.ts +0 -93
  248. package/dist/src/swap.js +0 -622
  249. package/dist/src/tasks.d.ts +0 -2
  250. package/dist/src/tasks.js +0 -743
  251. package/dist/src/templates.d.ts +0 -1
  252. package/dist/src/templates.js +0 -213
  253. package/dist/src/thread.d.ts +0 -2
  254. package/dist/src/thread.js +0 -52
  255. package/dist/src/trade.d.ts +0 -2
  256. package/dist/src/trade.js +0 -91
  257. package/dist/src/trail.d.ts +0 -2
  258. package/dist/src/trail.js +0 -41
  259. package/dist/src/validate.d.ts +0 -13
  260. package/dist/src/validate.js +0 -35
  261. package/dist/src/wallet-money.d.ts +0 -158
  262. package/dist/src/wallet-money.js +0 -664
  263. package/dist/src/wallet.d.ts +0 -169
  264. package/dist/src/wallet.js +0 -973
  265. package/dist/src/workflow.d.ts +0 -2
  266. package/dist/src/workflow.js +0 -169
  267. package/dist/src/write.d.ts +0 -43
  268. package/dist/src/write.js +0 -180
@@ -1,258 +0,0 @@
1
- import { authHeaders, resolveBase, resolveKey } from './lib/client.js';
2
- import { askPath, substrateUrl } from './lib/api-path.js';
3
- import { sendMessage } from './message.js';
4
- const DEFAULT_API = resolveBase({}, 'https://api.one.ie');
5
- function base(opts) {
6
- return resolveBase(opts, 'https://api.one.ie');
7
- }
8
- async function api(url, init) {
9
- const res = await fetch(substrateUrl(url), { headers: authHeaders(), ...init });
10
- if (!res.ok) {
11
- const body = await res.text().catch(() => '');
12
- process.stderr.write(`${init?.method ?? 'GET'} ${url} → ${res.status}\n${body}\n`);
13
- process.exit(1);
14
- }
15
- const ct = res.headers.get('content-type') ?? '';
16
- return ct.includes('json') ? res.json() : res.text();
17
- }
18
- function out(data) {
19
- process.stdout.write(JSON.stringify(data, null, 2) + '\n');
20
- }
21
- function parseJson(raw, flag) {
22
- try {
23
- return JSON.parse(raw);
24
- }
25
- catch {
26
- process.stderr.write(`error: ${flag} must be valid JSON\n`);
27
- process.exit(1);
28
- }
29
- }
30
- async function readStdin() {
31
- return new Promise((resolve) => {
32
- let buf = '';
33
- process.stdin.setEncoding('utf8');
34
- process.stdin.on('data', (chunk) => { buf += chunk; });
35
- process.stdin.on('end', () => resolve(buf.trim()));
36
- });
37
- }
38
- export function substrateCommands(program) {
39
- program
40
- .command('signal <receiver>')
41
- .description('Fire-and-forget signal to any receiver')
42
- .option('--data <json>', 'Signal data as JSON. Use "-" to read from stdin.')
43
- .option('--api <url>', 'API base URL', DEFAULT_API)
44
- .action(async (receiver, opts) => {
45
- let data;
46
- if (opts.data === '-')
47
- data = parseJson(await readStdin(), '--data');
48
- else if (opts.data)
49
- data = parseJson(opts.data, '--data');
50
- out(await api(`${base(opts)}/api/signal/${encodeURIComponent(receiver)}`, {
51
- method: 'POST',
52
- body: JSON.stringify({ data }),
53
- }));
54
- });
55
- program
56
- .command('ask <receiver>')
57
- .description('Signal + wait for outcome (result | timeout | dissolved | failure)')
58
- .option('--data <json>', 'Signal data as JSON. Use "-" to read from stdin.')
59
- .option('--timeout <ms>', 'Timeout in milliseconds', '10000')
60
- .option('--api <url>', 'API base URL', DEFAULT_API)
61
- .action(async (receiver, opts) => {
62
- let data;
63
- if (opts.data === '-')
64
- data = parseJson(await readStdin(), '--data');
65
- else if (opts.data)
66
- data = parseJson(opts.data, '--data');
67
- out(await api(askPath(base(opts), receiver), {
68
- method: 'POST',
69
- body: JSON.stringify({ data, timeoutMs: Number(opts.timeout) }),
70
- }));
71
- });
72
- program
73
- .command('message <text...>')
74
- .description('Say anything — the router picks who answers, the answer prints here')
75
- .option('--json', 'Print the whole reply as JSON')
76
- .option('--api <url>', 'API base URL', DEFAULT_API)
77
- .action(async (words, opts) => {
78
- const code = await sendMessage(words.join(' '), {
79
- fetch, key: resolveKey(), base: base(opts),
80
- stdout: (s) => process.stdout.write(s), stderr: (s) => process.stderr.write(s + '\n'),
81
- }, { json: opts.json });
82
- process.exit(code);
83
- });
84
- program
85
- .command('mark <edge>')
86
- .description('Strengthen a path. Edge format: source>target')
87
- .option('--strength <n>', 'Strength value', '1')
88
- .option('--api <url>', 'API base URL', DEFAULT_API)
89
- .action(async (edge, opts) => {
90
- out(await api(`${base(opts)}/api/mark/${encodeURIComponent(edge)}`, {
91
- method: 'POST',
92
- body: JSON.stringify({ strength: Number(opts.strength) }),
93
- }));
94
- });
95
- program
96
- .command('warn <edge>')
97
- .description('Raise resistance on a path. Edge format: source>target')
98
- .option('--strength <n>', 'Strength value', '1')
99
- .option('--api <url>', 'API base URL', DEFAULT_API)
100
- .action(async (edge, opts) => {
101
- out(await api(`${base(opts)}/api/warn/${encodeURIComponent(edge)}`, {
102
- method: 'POST',
103
- body: JSON.stringify({ strength: Number(opts.strength) }),
104
- }));
105
- });
106
- program
107
- .command('fade')
108
- .description('Asymmetric decay of all paths')
109
- .option('--rate <n>', 'Decay rate 0–1')
110
- .option('--api <url>', 'API base URL', DEFAULT_API)
111
- .action(async (opts) => {
112
- out(await api(`${base(opts)}/api/fade`, {
113
- method: 'POST',
114
- body: JSON.stringify({ rate: opts.rate !== undefined ? Number(opts.rate) : undefined }),
115
- }));
116
- });
117
- program
118
- .command('sub <tag> <actor>')
119
- .description('Subscribe an actor to a tag')
120
- .option('--scope <scope>', 'private | public', 'private')
121
- .option('--api <url>', 'API base URL', DEFAULT_API)
122
- .action(async (tag, actor, opts) => {
123
- out(await api(`${base(opts)}/api/sub`, {
124
- method: 'POST',
125
- body: JSON.stringify({ receiver: actor, tags: [tag], scope: opts.scope }),
126
- }));
127
- });
128
- program
129
- .command('follow <type>')
130
- .description('Deterministic path selection — strongest path for a type')
131
- .option('--api <url>', 'API base URL', DEFAULT_API)
132
- .action(async (type, opts) => {
133
- out(await api(`${base(opts)}/api/follow?tag=${encodeURIComponent(type)}`));
134
- });
135
- program
136
- .command('select <type>')
137
- .description('Probabilistic path selection (strength-weighted)')
138
- .option('--exploration <n>', 'Exploration factor 0–1')
139
- .option('--api <url>', 'API base URL', DEFAULT_API)
140
- .action(async (type, opts) => {
141
- // The route reads `tag` (api/select.ts:11); sending `type` was silently ignored.
142
- const q = new URLSearchParams({ tag: type });
143
- if (opts.exploration)
144
- q.set('exploration', opts.exploration);
145
- out(await api(`${base(opts)}/api/select?${q}`));
146
- });
147
- program
148
- .command('groups')
149
- .description('List groups (dimension 1 — containers)')
150
- .option('--type <type>')
151
- .option('--limit <n>', 'Max results', '20')
152
- .option('--after <cursor>', 'Pagination cursor')
153
- .option('--api <url>', 'API base URL', DEFAULT_API)
154
- .action(async (opts) => {
155
- const q = new URLSearchParams({ limit: opts.limit });
156
- if (opts.type)
157
- q.set('type', opts.type);
158
- if (opts.after)
159
- q.set('after', opts.after);
160
- out(await api(`${base(opts)}/api/export/groups?${q}`));
161
- });
162
- program
163
- .command('actors')
164
- .description('List actors (dimension 2 — humans, agents, bots)')
165
- .option('--type <type>')
166
- .option('--tag <tag>')
167
- .option('--limit <n>', 'Max results', '20')
168
- .option('--after <cursor>')
169
- .option('--api <url>', 'API base URL', DEFAULT_API)
170
- .action(async (opts) => {
171
- const q = new URLSearchParams({ limit: opts.limit });
172
- if (opts.type)
173
- q.set('type', opts.type);
174
- if (opts.tag)
175
- q.set('tag', opts.tag);
176
- if (opts.after)
177
- q.set('after', opts.after);
178
- out(await api(`${base(opts)}/api/export/actors?${q}`));
179
- });
180
- program
181
- .command('things')
182
- .description('List things (dimension 3 — skills, tasks, tokens)')
183
- .option('--type <type>')
184
- .option('--tag <tag>')
185
- .option('--limit <n>', 'Max results', '20')
186
- .option('--after <cursor>')
187
- .option('--api <url>', 'API base URL', DEFAULT_API)
188
- .action(async (opts) => {
189
- const q = new URLSearchParams({ limit: opts.limit });
190
- if (opts.type)
191
- q.set('type', opts.type);
192
- if (opts.tag)
193
- q.set('tag', opts.tag);
194
- if (opts.after)
195
- q.set('after', opts.after);
196
- out(await api(`${base(opts)}/api/things?${q}`));
197
- });
198
- program
199
- .command('paths')
200
- .description('List paths (dimension 4 — weighted connections)')
201
- .option('--source <source>')
202
- .option('--target <target>')
203
- .option('--min-strength <n>', 'Minimum strength filter')
204
- .option('--limit <n>', 'Max results', '20')
205
- .option('--after <cursor>')
206
- .option('--api <url>', 'API base URL', DEFAULT_API)
207
- .action(async (opts) => {
208
- const q = new URLSearchParams({ limit: opts.limit });
209
- if (opts.source)
210
- q.set('source', opts.source);
211
- if (opts.target)
212
- q.set('target', opts.target);
213
- if (opts.minStrength)
214
- q.set('minStrength', opts.minStrength);
215
- if (opts.after)
216
- q.set('after', opts.after);
217
- out(await api(`${base(opts)}/api/export/paths?${q}`));
218
- });
219
- program
220
- .command('events')
221
- .description('List events (dimension 5 — signals, payments)')
222
- .option('--actor <actor>')
223
- .option('--tag <tag>')
224
- .option('--from <iso>', 'ISO timestamp filter from')
225
- .option('--to <iso>', 'ISO timestamp filter to')
226
- .option('--limit <n>', 'Max results', '20')
227
- .option('--api <url>', 'API base URL', DEFAULT_API)
228
- .action(async (opts) => {
229
- const q = new URLSearchParams({ limit: opts.limit });
230
- if (opts.actor)
231
- q.set('actor', opts.actor);
232
- if (opts.tag)
233
- q.set('tag', opts.tag);
234
- if (opts.from)
235
- q.set('from', opts.from);
236
- if (opts.to)
237
- q.set('to', opts.to);
238
- out(await api(`${base(opts)}/api/events?${q}`));
239
- });
240
- program
241
- .command('learning')
242
- .description('List hypotheses (dimension 6 — what was discovered)')
243
- .option('--status <status>', 'pending | testing | confirmed | rejected')
244
- .option('--actor <actor>')
245
- .option('--tag <tag>')
246
- .option('--limit <n>', 'Max results', '20')
247
- .option('--api <url>', 'API base URL', DEFAULT_API)
248
- .action(async (opts) => {
249
- const q = new URLSearchParams({ limit: opts.limit });
250
- if (opts.status)
251
- q.set('status', opts.status);
252
- if (opts.actor)
253
- q.set('actor', opts.actor);
254
- if (opts.tag)
255
- q.set('tag', opts.tag);
256
- out(await api(`${base(opts)}/api/learning?${q}`));
257
- });
258
- }
@@ -1,93 +0,0 @@
1
- /**
2
- * `one swap` and `one hl` — swap any coin to any coin, or send it into Hyperliquid
3
- * (text/swap-plan.md § CLI (A)).
4
- *
5
- * one swap 0.01 BTC hl dry price (default — R11)
6
- * one swap 10 USDC@base to hl --live a real deposit address, checked with 1Click
7
- * one swap status <depositAddress> where is it; --watch polls until it lands
8
- * one swap assets every alias, chain, decimals and signer
9
- * one hl balance [0x…] a Hyperliquid account: perps and spot, never summed
10
- *
11
- * THIS COMMAND NEVER SIGNS AND HOLDS NO KEY. The server only quotes and reads status. On
12
- * --live, nothing printed as a send instruction comes from the ONE server unchecked: the CLI
13
- * reads the quote back from 1Click DIRECTLY (a plain fetch to a fixed host) and runs the client
14
- * check (R16) against its OWN values — asset ids from its own table, the amount from its own
15
- * parseUnits, its own slippage — then builds the send line and the wallet URI itself from
16
- * 1Click's record. A mismatch prints `quote_mismatch` and no send line.
17
- *
18
- * Everything goes over ask() — no new @oneie/sdk import (R2). Every exit closes with
19
- * out(cmd, data): one JSON line under --json, an `error <name>` + the reason otherwise, exit 1
20
- * on ok:false; `status --watch` exits 2 when it stops at its poll cap.
21
- */
22
- import { Command } from 'commander';
23
- import { type SwapRow } from './lib/swap-core.js';
24
- type Obj = Record<string, unknown>;
25
- /** `--watch` polls every 5 s and stops after 360 polls (30 min) — then exits 2, still not final. */
26
- export declare const WATCH_INTERVAL_MS = 5000;
27
- export declare const WATCH_MAX_POLLS = 360;
28
- export interface SwapDeps {
29
- /** One receiver through the ask door; returns the resolver's own answer, or a named HTTP refusal. */
30
- ask(receiver: string, data: Obj, opts?: {
31
- anonymous?: boolean;
32
- }): Promise<Obj>;
33
- /** GET 1Click's own status record, directly — never through ONE. */
34
- oneClick(url: string): Promise<{
35
- ok: true;
36
- body: unknown;
37
- } | {
38
- ok: false;
39
- error: string;
40
- status?: number;
41
- }>;
42
- now(): Date;
43
- sleep(ms: number): Promise<void>;
44
- /** A person at a TTY, not --json, not an agent shell: only then is a [y/N] asked. */
45
- interactive: boolean;
46
- confirm(question: string): Promise<boolean>;
47
- /** Human lines (suppressed under --json by the caller). */
48
- say(lines: string[]): void;
49
- }
50
- export interface Result {
51
- data: Obj;
52
- exitCode?: number;
53
- }
54
- export interface SwapArgs {
55
- words: string[];
56
- live?: boolean;
57
- sendTo?: string;
58
- exactOut?: boolean;
59
- slippage?: string;
60
- mine?: string;
61
- }
62
- export declare function runSwap(args: SwapArgs, deps: SwapDeps): Promise<Result>;
63
- /** The --mine entries shaped like an address on this chain (several = the person must pick). */
64
- export declare function mineOn(mine: readonly string[], chain: SwapRow['chain']): string[];
65
- export interface StatusArgs {
66
- depositAddress: string;
67
- tx?: string;
68
- watch?: boolean;
69
- mine?: string;
70
- /** The slippage you asked for when the address was minted (default 100); the record must match. */
71
- slippage?: string;
72
- /** The amount you asked to swap, in the from asset. The record must match it, or no send line (R18). */
73
- amount?: string;
74
- maxPolls?: number;
75
- }
76
- export declare function runStatus(args: StatusArgs, deps: SwapDeps): Promise<Result>;
77
- /** The server's whole table, read from an `unknown_asset` refusal (R2 — no assets receiver). */
78
- export declare function runAssets(deps: SwapDeps): Promise<Result>;
79
- export interface HlArgs {
80
- address?: string;
81
- testnet?: boolean;
82
- actor?: string;
83
- }
84
- export declare function runHlBalance(args: HlArgs, deps: SwapDeps): Promise<Result>;
85
- /** Close the loop: out() for --json and the error head, the reason lines on stderr, the exit code last. */
86
- export declare function emit(cmd: Command, res: Result): void;
87
- interface Common {
88
- api?: string;
89
- key?: string;
90
- }
91
- export declare function swapCmd(deps?: (cmd: Command, o: Common) => SwapDeps): Command;
92
- export declare function hlCmd(deps?: (cmd: Command, o: Common) => SwapDeps): Command;
93
- export {};