ainize 0.1.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 (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +225 -0
  3. package/dist/bin.d.ts +10 -0
  4. package/dist/bin.d.ts.map +1 -0
  5. package/dist/bin.js +711 -0
  6. package/dist/bin.js.map +1 -0
  7. package/dist/client.d.ts +38 -0
  8. package/dist/client.d.ts.map +1 -0
  9. package/dist/client.js +164 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/commands/auth.d.ts +30 -0
  12. package/dist/commands/auth.d.ts.map +1 -0
  13. package/dist/commands/auth.js +216 -0
  14. package/dist/commands/auth.js.map +1 -0
  15. package/dist/commands/branch.d.ts +326 -0
  16. package/dist/commands/branch.d.ts.map +1 -0
  17. package/dist/commands/branch.js +467 -0
  18. package/dist/commands/branch.js.map +1 -0
  19. package/dist/commands/chain.d.ts +43 -0
  20. package/dist/commands/chain.d.ts.map +1 -0
  21. package/dist/commands/chain.js +224 -0
  22. package/dist/commands/chain.js.map +1 -0
  23. package/dist/commands/chat.d.ts +157 -0
  24. package/dist/commands/chat.d.ts.map +1 -0
  25. package/dist/commands/chat.js +395 -0
  26. package/dist/commands/chat.js.map +1 -0
  27. package/dist/commands/dataset.d.ts +51 -0
  28. package/dist/commands/dataset.d.ts.map +1 -0
  29. package/dist/commands/dataset.js +157 -0
  30. package/dist/commands/dataset.js.map +1 -0
  31. package/dist/commands/drive.d.ts +32 -0
  32. package/dist/commands/drive.d.ts.map +1 -0
  33. package/dist/commands/drive.js +68 -0
  34. package/dist/commands/drive.js.map +1 -0
  35. package/dist/commands/huggingface-dataset.d.ts +63 -0
  36. package/dist/commands/huggingface-dataset.d.ts.map +1 -0
  37. package/dist/commands/huggingface-dataset.js +254 -0
  38. package/dist/commands/huggingface-dataset.js.map +1 -0
  39. package/dist/commands/init.d.ts +107 -0
  40. package/dist/commands/init.d.ts.map +1 -0
  41. package/dist/commands/init.js +538 -0
  42. package/dist/commands/init.js.map +1 -0
  43. package/dist/commands/ledger.d.ts +43 -0
  44. package/dist/commands/ledger.d.ts.map +1 -0
  45. package/dist/commands/ledger.js +125 -0
  46. package/dist/commands/ledger.js.map +1 -0
  47. package/dist/commands/node.d.ts +250 -0
  48. package/dist/commands/node.d.ts.map +1 -0
  49. package/dist/commands/node.js +651 -0
  50. package/dist/commands/node.js.map +1 -0
  51. package/dist/commands/patch.d.ts +852 -0
  52. package/dist/commands/patch.d.ts.map +1 -0
  53. package/dist/commands/patch.js +1527 -0
  54. package/dist/commands/patch.js.map +1 -0
  55. package/dist/commands/peers.d.ts +86 -0
  56. package/dist/commands/peers.d.ts.map +1 -0
  57. package/dist/commands/peers.js +143 -0
  58. package/dist/commands/peers.js.map +1 -0
  59. package/dist/commands/teach-dataset.d.ts +381 -0
  60. package/dist/commands/teach-dataset.d.ts.map +1 -0
  61. package/dist/commands/teach-dataset.js +780 -0
  62. package/dist/commands/teach-dataset.js.map +1 -0
  63. package/dist/commands/teach.d.ts +351 -0
  64. package/dist/commands/teach.d.ts.map +1 -0
  65. package/dist/commands/teach.js +435 -0
  66. package/dist/commands/teach.js.map +1 -0
  67. package/dist/context.d.ts +55 -0
  68. package/dist/context.d.ts.map +1 -0
  69. package/dist/context.js +102 -0
  70. package/dist/context.js.map +1 -0
  71. package/dist/ens.d.ts +50 -0
  72. package/dist/ens.d.ts.map +1 -0
  73. package/dist/ens.js +155 -0
  74. package/dist/ens.js.map +1 -0
  75. package/dist/help.d.ts +57 -0
  76. package/dist/help.d.ts.map +1 -0
  77. package/dist/help.js +227 -0
  78. package/dist/help.js.map +1 -0
  79. package/dist/index.d.ts +15 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +15 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/output.d.ts +104 -0
  84. package/dist/output.d.ts.map +1 -0
  85. package/dist/output.js +383 -0
  86. package/dist/output.js.map +1 -0
  87. package/dist/pid.d.ts +5 -0
  88. package/dist/pid.d.ts.map +1 -0
  89. package/dist/pid.js +25 -0
  90. package/dist/pid.js.map +1 -0
  91. package/dist/quiet.d.ts +2 -0
  92. package/dist/quiet.d.ts.map +1 -0
  93. package/dist/quiet.js +12 -0
  94. package/dist/quiet.js.map +1 -0
  95. package/package.json +55 -0
@@ -0,0 +1,467 @@
1
+ import { NodeClient, query } from '../client.js';
2
+ import { CliError, PROG } from '../context.js';
3
+ import { c, confirm, emit, fmtTime, info, kv, ok, shortAddr, table } from '../output.js';
4
+ export function parseContext(pairs = []) {
5
+ const ctxObj = {};
6
+ for (const p of pairs) {
7
+ const i = p.indexOf('=');
8
+ if (i <= 0)
9
+ throw new CliError(`context must be key=value, got "${p}"`);
10
+ ctxObj[p.slice(0, i).trim()] = p.slice(i + 1).trim();
11
+ }
12
+ return ctxObj;
13
+ }
14
+ /** What a track's members are, one by one — the catalogue read once and keyed by id (items 263, 264). */
15
+ async function trackStatuses(ctx) {
16
+ // Every status by name: an omitted `status` hides RETIRED, and a track keeps its withdrawn members.
17
+ const all = 'LISTED,SUPERSEDED,ANNOUNCED,VERIFYING,CHALLENGED,REJECTED,RETIRED,DRAFT';
18
+ const d = await new NodeClient(ctx).get(`/api/catalog?status=${all}&limit=200&include_drafts=1`).catch(() => null);
19
+ return new Map((d?.items ?? []).map((e) => [e.anchor.id, e]));
20
+ }
21
+ /** A track member's own state, in three characters and a colour. */
22
+ function memberChip(e, id) {
23
+ if (!e)
24
+ return `${id} ${c.dim('(unknown here)')}`;
25
+ if (e.status === 'REJECTED')
26
+ return `${id} ${c.err('(failed verification)')}`;
27
+ if (e.status === 'CHALLENGED')
28
+ return `${id} ${c.err('(challenged)')}`;
29
+ if (e.status === 'RETIRED')
30
+ return `${id} ${c.dim('(withdrawn)')}`;
31
+ if (e.status === 'SUPERSEDED')
32
+ return `${id} ${c.dim('(older version)')}`;
33
+ if (e.status !== 'LISTED')
34
+ return `${id} ${c.warn(`(${e.passed}/${e.quorum} verified)`)}`;
35
+ return c.ok(id);
36
+ }
37
+ /**
38
+ * `ainize branch ls` — every track, and what each of its members actually is (item 263).
39
+ *
40
+ * A track is an append-only list, so a bake that FAILED verification stayed on it looking exactly like the one that
41
+ * passed: subscribers could not tell "no bake today" from "today's bake failed" from "I am behind". Each member now
42
+ * carries its own state, and a track whose newest bake failed says so, with what is being served instead.
43
+ */
44
+ export async function branchLs(ctx, opts = {}) {
45
+ // Item 269: fixtures and archived tracks are off the list unless they are asked for by name or with --all.
46
+ const d = await new NodeClient(ctx).get(`/api/branches${opts.all ? '?include_test=1&include_archived=1' : ''}`);
47
+ const cat = await trackStatuses(ctx);
48
+ const newest = (b) => b.patch_ids.map((id) => cat.get(id)).filter((e) => !!e)
49
+ .sort((p, q) => q.anchor.created_at - p.anchor.created_at)[0];
50
+ const failing = d.branches.map((b) => ({ b, last: newest(b) })).filter((x) => x.last && ['REJECTED', 'CHALLENGED'].includes(x.last.status));
51
+ emit(ctx, d, (x) => table(x.branches, [
52
+ { key: 'n', title: 'BRANCH', get: (b) => `${x.mine.includes(b.name) ? c.ok(b.name + ' ✓') : b.name}${b.visibility === 'test' ? c.dim(' (test)') : ''}${b.archived ? c.dim(' (archived)') : ''}` },
53
+ { key: 'c', title: 'CONTEXT', get: (b) => Object.entries(b.context).map(([k, v]) => `${k}=${v}`).join(' ') || '-' },
54
+ { key: 'p', title: 'KNOWLEDGE', get: (b) => {
55
+ const shown = b.current ?? b.patch_ids;
56
+ const rest = b.patch_ids.filter((id) => !shown.includes(id));
57
+ // Item 214: a track is LOADED in this order, and the later item wins on any row two of them share.
58
+ return `${shown.map((id, i) => `${c.dim(`${i + 1}.`)} ${memberChip(cat.get(id), id)}`).join(' ') || c.dim('none current')}`
59
+ + (rest.length ? c.dim(` (+${rest.length} not loaded: ${rest.map((id) => cat.get(id)?.status.toLowerCase() ?? 'unknown').join(', ')})`) : '');
60
+ } },
61
+ { key: 's', title: 'SUBSCRIBERS', get: (b) => b.subscribers.map((s) => s.name ?? shortAddr(s.address, 4)).join(', ') || '-' },
62
+ { key: 'o', title: 'OWNER', get: (b) => shortAddr(b.owner, 6) },
63
+ { key: 't', title: 'CREATED', get: (b) => fmtTime(b.created_at) },
64
+ ], `no branches yet — \`${PROG} branch create law/KR --context jurisdiction=KR --patch <id>\``)
65
+ + failing.map(({ b, last }) => `\n${c.warn('! ')}${b.name}: the newest knowledge on this track, ${last.anchor.id}, ${last.status === 'REJECTED' ? 'failed verification' : 'is challenged by a verifier'} — subscribers keep serving ${(b.current ?? []).join(', ') || 'nothing from this track'}`).join('')
66
+ + (x.mine.length ? `\n${c.dim('✓ = this node subscribes')}` : ''));
67
+ return d;
68
+ }
69
+ /**
70
+ * `ainize branch rm <name> <id>` — take a knowledge off a track you own (item 264).
71
+ *
72
+ * A track was append-only: an unverified or rejected bake could be added and never removed, and `/api/route` handed
73
+ * the whole list — retired, rejected and current alike — to every gateway. A track record is the owner's to rewrite
74
+ * (the node accepts a `branch` record only from the address that first wrote the name), so removal is a new record
75
+ * with the id left out; the ledger keeps both, which is what a public record is for.
76
+ */
77
+ export async function branchRemove(ctx, name, patchId, opts = {}) {
78
+ const client = new NodeClient(ctx);
79
+ const d = await client.get('/api/branches');
80
+ const b = d.branches.find((x) => x.name === name);
81
+ if (!b)
82
+ throw new CliError(`no track called ${name} on this node — \`${PROG} branch ls\` lists them`, 1);
83
+ if (!b.patch_ids.includes(patchId)) {
84
+ throw new CliError(`${patchId} is not on ${name} (it has ${b.patch_ids.length ? b.patch_ids.join(', ') : 'nothing on it'})`, 1);
85
+ }
86
+ const subs = b.subscribers.length;
87
+ info(ctx, [
88
+ `${c.id(patchId)} will be taken off the track ${c.id(name)} (${b.patch_ids.length} → ${b.patch_ids.length - 1} knowledge).`,
89
+ c.dim(` this writes a new public track record; ${subs ? `${subs} subscribing node(s) stop buying and loading it on their next sync` : 'no node subscribes to it yet'}.`),
90
+ c.dim(' nobody is refunded and nothing already bought is taken away — the knowledge itself stays published.'),
91
+ ].join('\n'));
92
+ await confirm(ctx, `Remove ${patchId} from ${name}? [y/N]`, { yes: opts.yes });
93
+ const r = await client.post('/api/branches', {
94
+ name, description: b.description, context: b.context, patch_ids: b.patch_ids.filter((id) => id !== patchId),
95
+ });
96
+ ok(ctx, `${patchId} removed from ${name} — ${r.branch.patch_ids.length} knowledge left on the track`);
97
+ return r.branch;
98
+ }
99
+ export async function branchCreate(ctx, name, a) {
100
+ const r = await new NodeClient(ctx).post('/api/branches', {
101
+ name, description: a.description ?? '', context: parseContext(a.context), patch_ids: a.patch ?? [],
102
+ ...(a.test ? { visibility: 'test' } : {}),
103
+ });
104
+ ok(ctx, `branch ${c.id(name)} created ${c.dim(JSON.stringify(r.branch.context))} with ${r.branch.patch_ids.length} patch(es)`
105
+ + (a.test ? c.dim(' — a TEST track: on the record, off /network, off the router and out of `branch ls`') : ''));
106
+ return r.branch;
107
+ }
108
+ /**
109
+ * `ainize branch archive|unarchive <name>` (item 269) — a track was for ever: 32 throwaway `e2e/*` rows sat on the
110
+ * one page that sells "subscribe to a track", with the two real ones among them and no way to take any of them off.
111
+ * The record stays (a public track is a promise to its subscribers); the shelf is what changes.
112
+ */
113
+ export async function branchArchive(ctx, name, archived) {
114
+ const r = await new NodeClient(ctx).post(`/api/branches/${encodeURIComponent(name)}/archive`, { archived });
115
+ ok(ctx, archived
116
+ ? `${c.id(name)} archived — it is off /network, off the router and out of \`${PROG} branch ls\` (\`${PROG} branch ls --all\` still shows it). Its record and anyone already subscribed are untouched.`
117
+ : `${c.id(name)} is back on the lists`);
118
+ return r.branch;
119
+ }
120
+ export async function branchAdd(ctx, name, patchId, opts = {}) {
121
+ const r = await new NodeClient(ctx).post(`/api/branches/${encodeURIComponent(name)}/patches`, { patch_id: patchId, force: !!opts.force });
122
+ ok(ctx, `${patchId} added to ${name} (${r.branch.patch_ids.length} patches)${opts.force ? c.warn(' — added with --force: subscribers will buy and load it even though it is not verified') : ''}`);
123
+ return r.branch;
124
+ }
125
+ const money = (t) => (t.length ? t.map((x) => `${x.amount} ${x.currency}`).join(' + ') : '0');
126
+ /** `ainize branch quote <name>` — what subscribing would spend, item by item, before anything is spent (item 357). */
127
+ export async function branchQuote(ctx, name) {
128
+ const q = await fetchQuote(ctx, name);
129
+ emit(ctx, q, () => renderQuote(q));
130
+ return q;
131
+ }
132
+ async function fetchQuote(ctx, name) {
133
+ const r = await new NodeClient(ctx).post(`/api/branches/${encodeURIComponent(name)}/quote`, {}, { timeoutMs: 120_000 });
134
+ return r.quote;
135
+ }
136
+ const planLabel = {
137
+ buy: 'BUY', held: 'held', own: 'yours', retired: 'retired', blocked: 'not verified', wrong_model: 'wrong model', unknown: 'unknown',
138
+ };
139
+ function renderQuote(q) {
140
+ const lines = [
141
+ kv([['track', q.branch], ['owner', shortAddr(q.owner, 8)], ['items', `${q.items.length} on the track · ${q.current.length} current${q.retired.length ? ` · ${q.retired.length} retired version(s) skipped` : ''}`]]),
142
+ '',
143
+ table(q.items, [
144
+ // Item 214 — the order they go on the model in: the last one wins on any row two of them share.
145
+ { key: '#', title: 'LOAD', get: (i) => (q.current.includes(i.patch_id) ? String(q.current.indexOf(i.patch_id) + 1) : c.dim('-')), align: 'right' },
146
+ { key: 'p', title: 'KNOWLEDGE', get: (i) => `${i.patch_id}${i.name ? c.dim(` — ${i.name}`) : ''}` },
147
+ { key: 'l', title: 'PLAN', get: (i) => (i.plan === 'buy' ? c.warn(planLabel[i.plan]) : i.plan === 'held' || i.plan === 'own' ? c.ok(planLabel[i.plan]) : c.dim(planLabel[i.plan])) },
148
+ { key: 'a', title: 'PRICE', get: (i) => (i.plan === 'buy' ? `${i.price} ${i.currency}` : '-'), align: 'right' },
149
+ { key: 'w', title: 'WHY', get: (i) => c.dim(i.reason) },
150
+ ], 'this track has no knowledge on it yet'),
151
+ '',
152
+ kv([
153
+ /*
154
+ * Item 359 — a track had no terms at all, so a subscriber paid the full price of every bake for ever and the
155
+ * curator earned nothing for curating. What one period costs, and what the track's own last 30 days actually
156
+ * cost, are both said here: before the decision, not after the thirtieth full-price sale.
157
+ */
158
+ ...(q.subscription?.terms ? [['curation fee', Number(q.subscription.terms.price) > 0
159
+ ? `${q.subscription.terms.price} ${q.subscription.terms.currency} per ${q.subscription.terms.period_days} day(s) to ${shortAddr(q.subscription.owner, 8)}${q.subscription.due ? c.warn(' — due now') : c.ok(` — paid until ${new Date(q.subscription.paid_until ?? 0).toISOString().slice(0, 10)}`)}`
160
+ : c.dim('none — this track is free to follow')]] : []),
161
+ ...(q.subscription && q.subscription.run_rate.knowledge_added > 0 ? [['recent run rate', c.dim(`${q.subscription.run_rate.knowledge_added} knowledge added in the last 30 days, ${q.subscription.run_rate.knowledge_spend} ${q.currency} of them${q.subscription.terms ? ` — about ${q.subscription.run_rate.per_30_days} ${q.currency} for 30 days including the fee` : ''}`)]] : []),
162
+ ['to pay now', q.buy.length ? c.warn(money(q.total)) : c.dim('nothing')],
163
+ ['balance', q.balance === null ? c.dim('(chain wallet — not read here)') : `${q.balance} ${q.currency}`],
164
+ ['model', q.runtime_available ? 'available — the current items are loaded after they are bought' : c.warn(`${q.runtime_error ?? 'unreachable'} — the items are bought but nothing is loaded until it is back`)],
165
+ ]),
166
+ ];
167
+ return lines.join('\n');
168
+ }
169
+ /**
170
+ * `ainize branch subscribe <name>` (item 357). The quote is printed and answered BEFORE anything is spent, the node
171
+ * buys everything before it announces the subscription, and a partial acquisition is an error with a non-zero exit —
172
+ * it used to print `✓ subscribed` after spending the last credits on the first cheap item.
173
+ */
174
+ export async function branchSubscribe(ctx, name, action, opts = {}) {
175
+ const client = new NodeClient(ctx);
176
+ if (action === 'subscribe') {
177
+ const q = await fetchQuote(ctx, name);
178
+ info(ctx, renderQuote(q));
179
+ info(ctx, c.dim(`this node will also buy and load what ${name} adds later, and unload what it retires (\`${PROG} branch unsubscribe ${name}\` stops that; nothing is refunded)`));
180
+ /*
181
+ * Item 237 — subscribing is a PUBLIC act. It appends a `subscribe` record naming this node and the track to the
182
+ * shared ledger, which every peer can read for good (unsubscribing appends a second record; it removes nothing),
183
+ * while `use` / `patch apply` leave no trace anywhere but this node. An operator who treats tracks as a private
184
+ * convenience was never told, before or after.
185
+ */
186
+ const me = await client.get('/api/info', { auth: false }).catch(() => null);
187
+ const who = me?.node?.name ?? me?.name ?? ctx.nodeUrl;
188
+ info(ctx, c.warn('! ') + `this writes a public record on the shared ledger: "${who} serves ${name}". Every peer can read it, and it stays on the record for good — unsubscribing appends another record, it does not remove this one.`);
189
+ info(ctx, c.dim(` loading the same knowledge by hand (\`${PROG} use <id>\`) leaves no trace outside this node.`));
190
+ await confirm(ctx, q.buy.length
191
+ ? `subscribe to ${name}, announce it publicly and spend ${money(q.total)} now? [y/N]`
192
+ : `subscribe to ${name} and announce it publicly? [y/N]`, { yes: opts.yes });
193
+ }
194
+ const r = await client.post(`/api/branches/${encodeURIComponent(name)}/${action}`, action === 'subscribe' ? { replace: !!opts.replace } : {}, { timeoutMs: 30 * 60_000 })
195
+ .catch((err) => {
196
+ // Item 214 — the node refuses when the track would be loaded over knowledge already in the model; say what to do.
197
+ const e = err;
198
+ if (e?.details?.code === 'overlaps_loaded') {
199
+ throw new CliError(`${err.message}\n ${PROG} branch subscribe ${name} --replace`, 1, e.details);
200
+ }
201
+ throw err;
202
+ });
203
+ emit(ctx, r, (x) => renderSubscribe(x, name));
204
+ return r;
205
+ }
206
+ /**
207
+ * `ainize branch terms <name> --price <n> --period-days <d>` — what following your track costs (item 359).
208
+ *
209
+ * A track had no terms anywhere: prices are per anchor, so the most loyal subscriber to a daily track was the most
210
+ * expensive customer, and nobody was paid to keep a channel good. The fee is for the CURATING; the knowledge on the
211
+ * track is still bought from whoever published it.
212
+ */
213
+ export async function branchTerms(ctx, name, opts = {}) {
214
+ const client = new NodeClient(ctx);
215
+ const body = opts.clear ? { price: null } : { price: opts.price, period_days: opts.periodDays };
216
+ const r = await client.post(`/api/branches/${encodeURIComponent(name)}/terms`, body);
217
+ emit(ctx, r, (x) => (x.branch.terms
218
+ ? c.ok('✓ ') + `${c.id(name)} costs ${Number(x.branch.terms.price) === 0 ? 'nothing' : `${x.branch.terms.price} ${x.branch.terms.currency}`} per ${x.branch.terms.period_days} day(s) to follow`
219
+ + c.dim(`\n the fee is paid to this node for curating; every knowledge on the track is still bought from whoever published it`)
220
+ : c.ok('✓ ') + `${c.id(name)} is free to follow — no curation fee`));
221
+ return r;
222
+ }
223
+ /** `ainize branch sync <name>` — bring a subscribed track up to date now (item 255). */
224
+ export async function branchSync(ctx, name) {
225
+ const r = await new NodeClient(ctx).post(`/api/branches/${encodeURIComponent(name)}/sync`, {}, { timeoutMs: 30 * 60_000 });
226
+ emit(ctx, r, (x) => (x.acquired.length || x.applied.length || x.removed.length || x.failed.length
227
+ ? renderSubscribe(x, name)
228
+ : c.dim(`${name} is up to date — nothing to buy, load or unload`)));
229
+ // A track this node is subscribed to that it cannot keep up with is not a success: the caller has to hear about it
230
+ // in the exit code, not only in the log (item 357's other half — a sync spends money and can fail item by item).
231
+ if (r.failed.length) {
232
+ throw new CliError(`${name}: ${r.failed.length} item(s) could not be acquired — this node is subscribed but behind:\n${r.failed.map((f) => ` ${f.patch_id}: ${f.error}`).join('\n')}`, 5);
233
+ }
234
+ return r;
235
+ }
236
+ function renderSubscribe(x, name) {
237
+ const out = [];
238
+ if (x.action === 'unsubscribe') {
239
+ out.push(c.ok('✓ ') + `unsubscribed ${name}${x.removed.length ? ` — unloaded ${x.removed.join(', ')}` : ''}`);
240
+ out.push(c.dim(' the bodies stay on this node and nothing is refunded'));
241
+ return out.join('\n');
242
+ }
243
+ out.push(x.failed.length
244
+ ? c.warn('! ') + `${x.action === 'sync' ? 'synced' : 'subscribed'} ${name} — ${x.failed.length} item(s) could not be acquired`
245
+ : c.ok('✓ ') + `${x.action === 'sync' ? 'synced' : 'subscribed'} ${name}`);
246
+ if (x.acquired.length)
247
+ out.push(` bought ${x.acquired.join(', ')}${x.spent.length ? c.dim(` (${money(x.spent)})`) : ''}`);
248
+ if (x.applied.length)
249
+ out.push(` loaded ${x.applied.join(' → ')}`);
250
+ if (x.removed.length)
251
+ out.push(` unloaded ${x.removed.join(', ')} ${c.dim('(retired by a newer version on this track)')}`);
252
+ for (const s of x.skipped)
253
+ out.push(c.dim(` skipped ${s.patch_id}: ${s.reason}`));
254
+ for (const f of x.failed)
255
+ out.push(c.err(` FAILED ${f.patch_id}: ${f.error}`));
256
+ if (!x.applied.length && !x.acquired.length && !x.failed.length)
257
+ out.push(c.dim(' nothing new to buy or load'));
258
+ return out.join('\n');
259
+ }
260
+ /**
261
+ * `ainize route k=v …` (item 234).
262
+ *
263
+ * The command used to print one branch name and a table of nodes that had once written a `subscribe` record — with
264
+ * no sign that a key went unmatched, that two tracks matched equally well, or that the node it was sending traffic
265
+ * to was serving last week's bake. All three are on the answer now, and a node that is not serving the track's
266
+ * current knowledge is marked instead of listed as if it were.
267
+ */
268
+ export async function route(ctx, pairs, opts = {}) {
269
+ const q = parseContext(pairs);
270
+ const d = await new NodeClient(ctx).get(`/api/route${query({ ...q, ...(opts.partial ? { partial: '1' } : {}) })}`);
271
+ emit(ctx, d, (x) => {
272
+ if (!x.branch) {
273
+ return [
274
+ c.warn(`no track answers every attribute of ${JSON.stringify(q)}`),
275
+ ...x.candidates.map((cd) => c.dim(` ${cd.name} matches ${cd.matched.join(', ')} but not ${cd.unmatched.join(', ')} ${JSON.stringify(cd.context)}`)),
276
+ c.dim(x.candidates.length
277
+ ? ` route to the closest of them anyway: ${PROG} route ${pairs.join(' ')} --partial`
278
+ : ` no track on this node has any of those attributes (${PROG} branch ls)`),
279
+ ].join('\n');
280
+ }
281
+ const lines = [
282
+ `context ${c.dim(JSON.stringify(q))} → track ${c.id(x.branch.name)} ${c.dim(JSON.stringify(x.branch.context))}`,
283
+ c.dim(` matched ${x.matched.join(', ') || 'nothing'}${x.unmatched.length ? c.warn(` · NOT matched: ${x.unmatched.join(', ')} (--partial)`) : ''}`),
284
+ ];
285
+ if (x.ambiguous) {
286
+ lines.push(c.warn(` ${x.candidates.length} tracks match this context equally well — showing ${x.branch.name}: `)
287
+ + c.dim(x.candidates.map((cd) => cd.name).join(', ')));
288
+ }
289
+ lines.push(c.dim(` serving: ${x.current.join(', ') || 'nothing current on this track'}`));
290
+ lines.push(table(x.nodes, [
291
+ { key: 'n', title: 'SERVING NODE', get: (n) => (n.current === false ? c.warn(n.name) : n.name) },
292
+ { key: 'e', title: 'ENDPOINT', get: (n) => n.endpoint },
293
+ { key: 'm', title: 'MODEL', get: (n) => n.model ?? '-' },
294
+ { key: 'l', title: 'LOADED', get: (n) => (n.applied === null ? c.dim('not reported') : n.current ? c.ok('the track, in full') : c.warn(`missing ${n.missing.join(', ')}`)) },
295
+ { key: 'a', title: 'ADDRESS', get: (n) => shortAddr(n.address, 8) },
296
+ ], 'no node currently subscribes to that track'));
297
+ if (x.stale_nodes.length)
298
+ lines.push(c.warn(`! ${x.stale_nodes.length} of these nodes subscribe to ${x.branch.name} but are not serving all of it — sending traffic there answers from an older version, or from the bare model.`));
299
+ return lines.join('\n');
300
+ });
301
+ return d;
302
+ }
303
+ const payoutStatus = (p, maxAttempts = 20) => p.status === 'paid' ? c.ok('paid') : p.status === 'failed' ? (p.attempts >= maxAttempts ? c.err('failed (gave up)') : c.warn(`failed · retrying`)) : c.warn('pending');
304
+ /**
305
+ * Item 321 — the error was sliced to 48 characters, and the one message the code refuses to retry automatically is
306
+ * 93 long: "node restarted during the transfer — confirm on chain whether it went through before retrying". The
307
+ * half that was removed is the instruction, so the operator either retried blind (risking the double payment the
308
+ * code exists to prevent) or never noticed. Nothing is truncated any more: the table keeps the tx hash, and every
309
+ * error is printed under its row, in full, with the command that answers it.
310
+ */
311
+ const payoutTable = (rows, maxAttempts = 20) => table(rows, [
312
+ { key: 'i', title: 'ID', get: (p) => String(p.id), align: 'right' }, { key: 'p', title: 'PATCH', get: (p) => p.patch_id }, { key: 'to', title: 'TO', get: (p) => shortAddr(p.address, 8) },
313
+ { key: 'a', title: 'AMOUNT', get: (p) => `${p.amount} ${p.currency}`, align: 'right' }, { key: 's', title: 'STATUS', get: (p) => payoutStatus(p, maxAttempts) }, { key: 'n', title: 'TRIES', get: (p) => String(p.attempts), align: 'right' },
314
+ { key: 't', title: 'AT', get: (p) => fmtTime(p.updated_at) },
315
+ // Item 314: the transfer key is what joins this payment to the sale it honoured, on anyone's chain explorer.
316
+ { key: 'e', title: 'TX', get: (p) => (p.tx_hash ? p.tx_hash.slice(0, 14) + '…' : p.status === 'failed' ? c.err('—') : c.dim('—')) },
317
+ ]) + payoutErrors(rows);
318
+ /** Every error under the table, whole, each with the concrete next command (item 321). */
319
+ function payoutErrors(rows) {
320
+ const bad = rows.filter((p) => p.last_error);
321
+ if (!bad.length)
322
+ return '';
323
+ return '\n' + bad.map((p) => {
324
+ const what = ` ${c.err('!')} payout #${p.id} (${p.amount} ${p.currency} to ${shortAddr(p.address, 10)} for ${c.id(p.patch_id)})`;
325
+ const why = `\n ${p.last_error}`;
326
+ // The interrupted row is the one the code deliberately will not retry by itself: name the two commands that end it.
327
+ const how = p.last_error === PAYOUT_INTERRUPTED
328
+ ? `\n ${c.dim(`check the chain for /transfer/<this node>/${p.address}/${p.transfer_key ?? `payout_${p.settle_hash.slice(0, 10)}…`}; if the money did NOT move: ${PROG} payouts retry ${p.id}`)}`
329
+ : `\n ${c.dim(`retry it: ${PROG} payouts retry ${p.id}`)}`;
330
+ return what + why + how;
331
+ }).join('\n');
332
+ }
333
+ /** The last_error a row is left with when the node stopped mid-transfer — never retried automatically. */
334
+ export const PAYOUT_INTERRUPTED = 'node restarted during the transfer — confirm on chain whether it went through before retrying';
335
+ /** The wallet's payout lines (exported so the test can render a fixture). */
336
+ export function renderPayoutSummary(x) {
337
+ if (!x.payouts)
338
+ return [];
339
+ const unpaid = x.payouts.items.filter((p) => p.status !== 'paid');
340
+ const head = x.payouts.pending + x.payouts.failed === 0 ? c.ok('none pending') : `${c.warn(String(x.payouts.pending))} pending · ${(x.payouts.failed ? c.err : c.dim)(String(x.payouts.failed))} failed · ${x.payouts.paid} paid`;
341
+ return [kv([['royalty payouts owed', head]]), ...(unpaid.length ? ['\n' + c.head('unpaid payouts (retry: ainize payouts retry <id>)') + '\n' + payoutTable(unpaid.slice(0, 10))] : [])];
342
+ }
343
+ /** `credited` and `paid` are money; `unconfirmed` is a claim by the party that owes it (item 311). */
344
+ const royaltyState = (r) => r.state === 'credited' ? c.ok('credited') : r.state === 'paid' ? c.ok('paid')
345
+ : r.state === 'failed' ? c.err('transfer failed') : r.state === 'pending' ? c.warn('seller says pending')
346
+ : c.warn(`unconfirmed${r.days ? ` (${r.days}d)` : ''}`);
347
+ export async function wallet(ctx) {
348
+ const d = await new NodeClient(ctx).get('/api/me/wallet');
349
+ /**
350
+ * Items 317 + 323 — `sales 4` and `royalties received 1` were counts printed where every other line on this
351
+ * screen is an amount, so an ancestor read "1" and thought they had earned one credit; and the sale rows showed
352
+ * the gross settlement over a net balance with no line for the creator share that had left. The split is on every
353
+ * settlement (`royalty`), so it is summed here: what was charged, what stayed, and what went to whom.
354
+ */
355
+ const unit = d.kind === 'ain' ? 'AIN' : 'CREDIT';
356
+ const round = (n) => Math.round(n * 1e6) / 1e6;
357
+ const me = d.address.toLowerCase();
358
+ const outOf = (s) => Object.entries(s.royalty ?? {})
359
+ .filter(([addr, v]) => Number(v) > 0 && addr.toLowerCase() !== me).reduce((n, [, v]) => n + Number(v), 0);
360
+ const gross = round(d.sales.reduce((n, s) => n + Number(s.amount), 0));
361
+ const sharedOut = round(d.sales.reduce((n, s) => n + outOf(s), 0));
362
+ const royaltyIn = round(d.royalties.reduce((n, r) => n + Number(r.amount ?? 0), 0));
363
+ emit(ctx, d, (x) => [
364
+ kv([['address', x.address], ['ledger', `${x.kind} · ${x.network}`], ['balance', x.balance === null ? c.warn('unknown (chain unreachable)') : `${x.balance} ${x.kind === 'ain' ? 'AIN' : 'CREDIT'}`],
365
+ ['sales', `${gross} ${unit} ${c.dim(`over ${x.sales.length} sale(s)`)}`],
366
+ ['of that, paid out', sharedOut > 0 ? `${sharedOut} ${unit} ${c.dim('to creators, data providers and verifiers')}` : c.dim(`0 ${unit}`)],
367
+ ['net revenue', `${round(gross - sharedOut)} ${unit} ${c.dim('(what stayed here)')}`],
368
+ ['royalties received', `${royaltyIn} ${unit} ${c.dim(`over ${x.royalties.length} payment(s)`)}`],
369
+ ['purchases', x.purchases]]),
370
+ // The three totals a creator has to be able to reconcile: what the records promise, what is actually in the
371
+ // balance or on the chain, and what nobody has confirmed (item 311).
372
+ ...(x.royalty_totals ? [kv([
373
+ ['creator share owed to you', `${x.royalty_totals.owed} ${x.kind === 'ain' ? 'AIN' : 'CREDIT'} ${c.dim('(what the settle records promise)')}`],
374
+ ['of that, in your balance', c.ok(x.royalty_totals.credited)],
375
+ ['of that, transferred', `${x.royalty_totals.paid} ${c.dim("(the seller's node reports the transfer)")}`],
376
+ ['of that, unconfirmed', (Number(x.royalty_totals.unconfirmed) > 0 ? c.warn : c.dim)(`${x.royalty_totals.unconfirmed} ${c.dim('(promised on the record, nobody has confirmed a transfer)')}`)],
377
+ ])] : []),
378
+ // Item 277: 74 free lessons that write no settle record used to leave the seller reading "0 sales" and
379
+ // concluding nobody wanted them. A free hand-over is a download, and it is counted as one.
380
+ ...(x.free_downloads?.length ? [kv([['given away free', `${x.free_downloads.reduce((n, f) => n + f.count, 0)} download(s) of ${x.free_downloads.length} knowledge(s) priced 0 ${c.dim('(no payment, no sale record, no buyer named)')}`]])] : []),
381
+ // Verifying used to earn nothing anywhere in this product (item 325).
382
+ ...(x.verification ? [kv([['earned from verifying', x.verification.length
383
+ ? `${x.verification_total} ${x.kind === 'ain' ? 'AIN' : 'CREDIT'} ${c.dim(`over ${x.verification.length} sale(s) of knowledge you verified`)}`
384
+ : c.dim(`nothing yet${x.verifier_share ? ` — you are paid ${Math.round(x.verifier_share * 100)}% of the seller's side of every sale of a knowledge your attestation keeps on sale` : ''}`)]])] : []),
385
+ ...renderPayoutSummary(x),
386
+ x.sales.length ? '\n' + c.head('recent sales') + '\n' + table(x.sales.slice(-10), [
387
+ { key: 'p', title: 'PATCH', get: (s) => s.patch_id }, { key: 'a', title: 'AMOUNT', get: (s) => `${s.amount} ${s.currency}`, align: 'right' },
388
+ // item 317: the gross is what the buyer paid; these two are what happened to it
389
+ { key: 'y', title: 'YOURS', get: (s) => `${round(Number(s.amount) - outOf(s))}`, align: 'right' },
390
+ { key: 'sh', title: 'SHARED', get: (s) => (outOf(s) > 0 ? c.dim(Object.entries(s.royalty ?? {}).filter(([a2, v]) => Number(v) > 0 && a2.toLowerCase() !== me).map(([a2, v]) => `${shortAddr(a2, 6)} ${v}`).join(' · ')) : ''), align: 'left' },
391
+ { key: 'b', title: 'BUYER', get: (s) => shortAddr(s.buyer, 8) }, { key: 't', title: 'AT', get: (s) => fmtTime(s.created_at) },
392
+ ]) : '',
393
+ x.royalties.length ? '\n' + c.head('creator share (what each sale owes you, and whether it moved)') + '\n' + table(x.royalties.slice(-10), [
394
+ { key: 'p', title: 'PATCH', get: (s) => s.patch_id }, { key: 'a', title: 'AMOUNT', get: (s) => s.amount, align: 'right' },
395
+ { key: 'k', title: 'FOR', get: (s) => (s.kind === 'verification' ? 'verifying' : 'lineage') },
396
+ { key: 'f', title: 'FROM', get: (s) => s.seller_name ?? (s.seller ? shortAddr(s.seller, 8) : '-') },
397
+ { key: 'st', title: 'STATE', get: (s) => (s.state ? royaltyState(s) : c.dim('—')) },
398
+ { key: 'x', title: 'TX', get: (s) => (s.tx_hash ? s.tx_hash.slice(0, 14) + '…' : '') },
399
+ { key: 't', title: 'AT', get: (s) => fmtTime(s.created_at) },
400
+ ]) : '',
401
+ ].filter(Boolean).join('\n'));
402
+ return d;
403
+ }
404
+ /** `ainize payouts ls [--status]` — royalty transfers this node owes creators and data providers (AIN ledger). */
405
+ /**
406
+ * `ainize payouts reconcile` — rebuild what this node owes from its own settlements and pay what is due (item 313).
407
+ *
408
+ * `enqueue` ran in one place, inline with the sale, and nothing ever re-derived it: a settle written before the
409
+ * payouts table existed, a wiped data dir or a crash between the append and the enqueue left a public debt with
410
+ * no row — so no retry, no "failed", and no way for an honest seller to pay what the record says they owe.
411
+ */
412
+ export async function payoutsReconcile(ctx) {
413
+ const d = await new NodeClient(ctx).post('/api/me/payouts/reconcile', {});
414
+ emit(ctx, d, (x) => [
415
+ `${x.recovered ? c.warn('! ') : c.ok('✓ ')}${x.settlements} settlement(s) this node wrote owe ${x.rows} royalty payout(s)`,
416
+ x.recovered ? c.warn(` ${x.recovered} row(s) recovered from the record — money this node owed with nothing to pay it from`) : c.dim(' nothing was missing: every settlement already had its rows'),
417
+ x.run ? c.dim(` attempted ${x.run.attempted} transfer(s): ${x.run.paid} paid, ${x.run.failed} failed (\`${PROG} payouts ls\` for the detail)`) : c.dim(' nothing was due'),
418
+ ].filter(Boolean).join('\n'));
419
+ return d;
420
+ }
421
+ /**
422
+ * `ainize wallet send <address> <amount>` — move earnings out of this node (item 320).
423
+ *
424
+ * Until this, a node that had earned could spend it only by buying other knowledge through the same node: no send,
425
+ * no withdraw, no export beyond `keys backup`, and `chain fund` refuses unless the chain is local. "You get paid
426
+ * per sale" ended at a number on one screen.
427
+ */
428
+ export async function walletSend(ctx, to, amount, opts = {}) {
429
+ const client = new NodeClient(ctx);
430
+ const w = await client.get('/api/me/wallet');
431
+ const unit = w.kind === 'ain' ? 'AIN' : 'CREDIT';
432
+ // …and a node whose ledger is its own book still cannot. The node refuses this in the right words, but the
433
+ // refusal used to arrive AFTER "a transfer on a chain is irreversible" and a [y/N] — so the operator was asked
434
+ // to consent to an irreversible chain transfer on a node that has no chain, which is the pretending item 320 is
435
+ // about. There is nothing to preview and nothing to confirm: go straight to the node and let it say why.
436
+ if (w.kind !== 'ain') {
437
+ await client.post('/api/me/wallet/send', { to, amount, memo: opts.memo });
438
+ throw new Error('unreachable: a node that cannot send refuses this request');
439
+ }
440
+ info(ctx, [
441
+ `${c.bold(`${amount} ${unit}`)} → ${c.id(to)}`,
442
+ c.dim(` from this node's own wallet (${w.address}${w.balance === null ? '' : `, balance ${w.balance} ${unit}`}).`),
443
+ c.warn(' a transfer on a chain is irreversible, and this node cannot ask for it back.'),
444
+ ].join('\n'));
445
+ await confirm(ctx, `Send ${amount} ${unit} to ${to}? [y/N]`, { yes: opts.yes });
446
+ const r = await client.post('/api/me/wallet/send', { to, amount, memo: opts.memo });
447
+ emit(ctx, r, (x) => c.ok('✓ ') + `sent ${x.amount} ${x.currency} to ${x.to} tx ${x.tx_hash.slice(0, 16)}…`
448
+ + (x.balance === null ? '' : c.dim(`\n balance now ${x.balance} ${x.currency}`)));
449
+ return r;
450
+ }
451
+ export async function payoutsLs(ctx, opts = {}) {
452
+ const d = await new NodeClient(ctx).get(`/api/me/payouts${query({ status: opts.status, address: opts.address, limit: opts.limit })}`);
453
+ emit(ctx, d, (x) => [
454
+ kv([['pending', x.summary.pending], ['failed', x.summary.failed], ['paid', x.summary.paid], ['retry', `every ${Math.round(x.retry_ms / 1000)} s, up to ${x.max_attempts} attempts`], ['chain wallet', x.wallet ? 'yes' : c.warn('no (local ledger — rows cannot be paid from this node)')]]),
455
+ '', payoutTable(x.items, x.max_attempts),
456
+ ].join('\n'));
457
+ return d;
458
+ }
459
+ /** `ainize payouts retry <id>` — one immediate transfer attempt (allowed after the automatic attempts are exhausted). */
460
+ export async function payoutRetry(ctx, id) {
461
+ const d = await new NodeClient(ctx).post(`/api/me/payouts/${id}/retry`, {});
462
+ emit(ctx, d, ({ payout: p }) => p.status === 'paid'
463
+ ? `${c.ok('✓')} payout #${p.id} paid: ${p.amount} ${p.currency} → ${shortAddr(p.address, 8)} (${p.tx_hash})`
464
+ : `${c.err('✗')} payout #${p.id} still ${p.status} after ${p.attempts} attempt(s): ${p.last_error ?? ''}`);
465
+ return d;
466
+ }
467
+ //# sourceMappingURL=branch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch.js","sourceRoot":"","sources":["../../src/commands/branch.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,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CAAC"}
@@ -0,0 +1,43 @@
1
+ import { type CliContext } from '../context.js';
2
+ export declare const CHAIN_CONTAINER = "ainize-ain";
3
+ export declare const CHAIN_IMAGE = "ainblockchain/ain-blockchain:latest";
4
+ export declare const CHAIN_PORT = 8081;
5
+ export declare const GENESIS: {
6
+ address: string;
7
+ privateKey: string;
8
+ };
9
+ export declare const CHAIN_ENV: Record<string, string>;
10
+ export interface ChainHealth {
11
+ reachable: boolean;
12
+ health?: boolean;
13
+ state?: string;
14
+ address?: string;
15
+ blockNumber?: number;
16
+ provider: string;
17
+ }
18
+ export declare function chainHealth(provider?: string): Promise<ChainHealth>;
19
+ export declare function chainUp(ctx: CliContext, a?: {
20
+ wait?: number;
21
+ }): Promise<ChainHealth>;
22
+ export declare function chainDown(ctx: CliContext): Promise<void>;
23
+ /** Is this provider URL the local chain `ainize chain up` runs — this host, this port? (item 142) */
24
+ export declare function isLocalChainUrl(provider: string): boolean;
25
+ /**
26
+ * `chain status` reported the health of the CONFIGURED provider beside the container state of the hard-coded
27
+ * `ainize-ain` name, so a node pointed at another chain was told `container ainize-ain: running` next to
28
+ * `reachable no` — two confident signals about two different chains (item 142). The container is only this
29
+ * provider's when the provider IS the local chain.
30
+ */
31
+ export declare function chainStatus(ctx: CliContext, provider?: string): Promise<ChainHealth & {
32
+ container: string | null;
33
+ local: boolean;
34
+ }>;
35
+ export declare function chainFund(ctx: CliContext, address: string, amount?: number, provider?: string): Promise<{
36
+ tx_hash: string;
37
+ balance: number;
38
+ }>;
39
+ /** Register the knowledge app + market rules (ain-js knowledge.setupApp + our /apps/knowledge/market rules). */
40
+ export declare function chainSetup(ctx: CliContext, a?: {
41
+ fund?: number;
42
+ }): Promise<unknown>;
43
+ //# sourceMappingURL=chain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../src/commands/chain.ts"],"names":[],"mappings":"AAWA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,eAAe,CAA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