@artblocks/abx-cli 0.1.0-alpha.17 → 0.1.0-alpha.18

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 (116) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/dist/commands/deploy.d.ts +181 -0
  3. package/dist/commands/deploy.d.ts.map +1 -0
  4. package/dist/commands/deploy.js +2974 -0
  5. package/dist/commands/deploy.js.map +1 -0
  6. package/dist/commands/project.d.ts +134 -0
  7. package/dist/commands/project.d.ts.map +1 -0
  8. package/dist/commands/project.js +919 -0
  9. package/dist/commands/project.js.map +1 -0
  10. package/dist/commands/reads.d.ts +64 -0
  11. package/dist/commands/reads.d.ts.map +1 -0
  12. package/dist/commands/reads.js +635 -0
  13. package/dist/commands/reads.js.map +1 -0
  14. package/dist/commands/scaffold.d.ts +55 -0
  15. package/dist/commands/scaffold.d.ts.map +1 -0
  16. package/dist/commands/scaffold.js +470 -0
  17. package/dist/commands/scaffold.js.map +1 -0
  18. package/dist/commands/service.d.ts +41 -0
  19. package/dist/commands/service.d.ts.map +1 -0
  20. package/dist/commands/service.js +572 -0
  21. package/dist/commands/service.js.map +1 -0
  22. package/dist/commands/storage.d.ts +37 -0
  23. package/dist/commands/storage.d.ts.map +1 -0
  24. package/dist/commands/storage.js +335 -0
  25. package/dist/commands/storage.js.map +1 -0
  26. package/dist/config.d.ts +72 -2
  27. package/dist/config.d.ts.map +1 -1
  28. package/dist/config.js +201 -4
  29. package/dist/config.js.map +1 -1
  30. package/dist/deps.d.ts +6 -39
  31. package/dist/deps.d.ts.map +1 -1
  32. package/dist/deps.js +4 -68
  33. package/dist/deps.js.map +1 -1
  34. package/dist/errors.d.ts +20 -0
  35. package/dist/errors.d.ts.map +1 -0
  36. package/dist/errors.js +25 -0
  37. package/dist/errors.js.map +1 -0
  38. package/dist/flags.d.ts +34 -0
  39. package/dist/flags.d.ts.map +1 -1
  40. package/dist/flags.js +74 -0
  41. package/dist/flags.js.map +1 -1
  42. package/dist/main.js +57 -6751
  43. package/dist/main.js.map +1 -1
  44. package/dist/mintpage.d.ts.map +1 -1
  45. package/dist/mintpage.js +34 -40
  46. package/dist/mintpage.js.map +1 -1
  47. package/dist/output.d.ts +137 -0
  48. package/dist/output.d.ts.map +1 -0
  49. package/dist/output.js +504 -0
  50. package/dist/output.js.map +1 -0
  51. package/dist/ownerops.d.ts +23 -44
  52. package/dist/ownerops.d.ts.map +1 -1
  53. package/dist/ownerops.js +151 -233
  54. package/dist/ownerops.js.map +1 -1
  55. package/dist/preview.d.ts +8 -4
  56. package/dist/preview.d.ts.map +1 -1
  57. package/dist/preview.js +8 -17
  58. package/dist/preview.js.map +1 -1
  59. package/dist/provision.d.ts.map +1 -1
  60. package/dist/provision.js +10 -7
  61. package/dist/provision.js.map +1 -1
  62. package/dist/remote.d.ts +72 -7
  63. package/dist/remote.d.ts.map +1 -1
  64. package/dist/remote.js +211 -9
  65. package/dist/remote.js.map +1 -1
  66. package/dist/riskgate.d.ts +29 -0
  67. package/dist/riskgate.d.ts.map +1 -0
  68. package/dist/riskgate.js +91 -0
  69. package/dist/riskgate.js.map +1 -0
  70. package/dist/schema.d.ts +6 -0
  71. package/dist/schema.d.ts.map +1 -1
  72. package/dist/schema.js +12 -16
  73. package/dist/schema.js.map +1 -1
  74. package/dist/served.d.ts +1 -17
  75. package/dist/served.d.ts.map +1 -1
  76. package/dist/served.js +47 -0
  77. package/dist/served.js.map +1 -1
  78. package/dist/signer.d.ts +13 -0
  79. package/dist/signer.d.ts.map +1 -1
  80. package/dist/signer.js +42 -19
  81. package/dist/signer.js.map +1 -1
  82. package/dist/update-check.d.ts +27 -0
  83. package/dist/update-check.d.ts.map +1 -1
  84. package/dist/update-check.js +30 -0
  85. package/dist/update-check.js.map +1 -1
  86. package/package.json +6 -6
  87. package/skill/SKILL.md +7 -11
  88. package/skill/reference/code-projects.md +3 -3
  89. package/skill/reference/hosting.md +6 -6
  90. package/skill/reference/operating.md +2 -5
  91. package/skill/reference/setup.md +2 -2
  92. package/skill/reference/troubleshooting.md +1 -1
  93. package/dist/gas.d.ts +0 -63
  94. package/dist/gas.d.ts.map +0 -1
  95. package/dist/gas.js +0 -76
  96. package/dist/gas.js.map +0 -1
  97. package/dist/inspect.d.ts +0 -48
  98. package/dist/inspect.d.ts.map +0 -1
  99. package/dist/inspect.js +0 -290
  100. package/dist/inspect.js.map +0 -1
  101. package/dist/migrate.d.ts +0 -65
  102. package/dist/migrate.d.ts.map +0 -1
  103. package/dist/migrate.js +0 -180
  104. package/dist/migrate.js.map +0 -1
  105. package/dist/onchain-uri.d.ts +0 -81
  106. package/dist/onchain-uri.d.ts.map +0 -1
  107. package/dist/onchain-uri.js +0 -251
  108. package/dist/onchain-uri.js.map +0 -1
  109. package/dist/resume.d.ts +0 -96
  110. package/dist/resume.d.ts.map +0 -1
  111. package/dist/resume.js +0 -95
  112. package/dist/resume.js.map +0 -1
  113. package/dist/upload.d.ts +0 -28
  114. package/dist/upload.d.ts.map +0 -1
  115. package/dist/upload.js +0 -41
  116. package/dist/upload.js.map +0 -1
package/dist/output.js ADDED
@@ -0,0 +1,504 @@
1
+ /**
2
+ * Shared CLI plumbing used by more than one command domain (phase 3's split of main.ts into
3
+ * `commands/*.ts`): the tiny ANSI color/narration helpers every command prints through, the
4
+ * trust-anchor "ensure*" bootstrap wrappers (narrating the SDK's anchors.ts for the factory /
5
+ * renderer / seed-source singletons), and a handful of small cross-domain utilities (port checks,
6
+ * the post-deploy reindex retry, `printServing`, `findRepoRoot`, `keepAlive`, optional-dependency
7
+ * loading for effects). Nothing here is domain-specific — a helper that only ONE command domain
8
+ * used stayed in that domain's `commands/*.ts` file instead.
9
+ */
10
+ import { existsSync, readFileSync } from 'node:fs';
11
+ import { join as joinPath, resolve as resolvePath } from 'node:path';
12
+ import { fileURLToPath } from 'node:url';
13
+ import { AnchorUnavailableError, makeHotSender, makePublicClient, makeWalletClient, normalizeAttributes, parseTraitPairs, resolveChain, detectCanonicalFactory as sdkDetectCanonicalFactory, ensureFactory as sdkEnsureFactory, ensureRenderer as sdkEnsureRenderer, ensureSeedSource as sdkEnsureSeedSource, ensureSeriesCodeFactory as sdkEnsureSeriesCodeFactory, ensureSeriesFactory as sdkEnsureSeriesFactory, resolveScanFloor as sdkResolveScanFloor, sleep, } from '@artblocks/abx-sdk';
14
+ import { resolveBackend, validateRenderStorageCombo } from '@artblocks/abx-storage';
15
+ import { CHAIN, explorerBase, activeBackendId, backendResolution, collectContentLocators, localIndexer, storageOptions, storageOverrides } from './config.js';
16
+ import { looksPerTokenAttributes, parseSeriesTraitsById } from './series-traits.js';
17
+ // ── tiny ANSI helpers ───────────────────────────────────────────────────────
18
+ export const c = {
19
+ reset: '\x1b[0m', dim: '\x1b[2m', bold: '\x1b[1m',
20
+ green: '\x1b[38;5;115m', purple: '\x1b[38;5;141m', orange: '\x1b[38;5;215m', red: '\x1b[31m',
21
+ };
22
+ export const g = (s) => `${c.green}${s}${c.reset}`;
23
+ export const p = (s) => `${c.purple}${s}${c.reset}`;
24
+ export const dim = (s) => `${c.dim}${s}${c.reset}`;
25
+ export const bold = (s) => `${c.bold}${s}${c.reset}`;
26
+ export let stepN = 0;
27
+ export const step = (s) => console.log(`\n${p(`[${++stepN}]`)} ${bold(s)}`);
28
+ export const ok = (s) => console.log(` ${g('✓')} ${s}`);
29
+ export const info = (s) => console.log(` ${dim(s)}`);
30
+ export const warn = (s) => console.log(` ${c.orange}⚠${c.reset} ${s}`);
31
+ // When the user/agent opts in (--yes), lift the getLogs chunk cap so a large
32
+ // reconstruction proceeds despite a range-limited RPC (otherwise it stops early with
33
+ // guidance — see GetLogsScanTooLargeError + the skill's "Choosing an RPC" decision).
34
+ export function allowLargeScan(flags) {
35
+ if (flags.yes)
36
+ process.env.ABX_GETLOGS_MAX_CHUNKS = String(1e9);
37
+ }
38
+ /**
39
+ * Resolve the scan floor (fromBlock) for an add/index — the CLI-side shell around the SDK's
40
+ * {@link sdkResolveScanFloor}: builds the client, forwards `--from-block`, and narrates its two
41
+ * possible events (the SDK never prints). See the SDK function's doc comment for the "why" (never
42
+ * a silent genesis default).
43
+ */
44
+ export async function resolveScanFloor(address, localFromBlock, flags) {
45
+ const publicClient = makePublicClient({ chainKey: CHAIN });
46
+ return sdkResolveScanFloor(publicClient, address, {
47
+ explicit: flags['from-block'],
48
+ localFromBlock,
49
+ onEvent: (e) => {
50
+ if (e.kind === 'genesis-warning')
51
+ warn('scanning from genesis (block 0) — slow on a range-capped RPC; pass the deploy block as --from-block to index instantly.');
52
+ else
53
+ info(`deploy block ${e.block} ${dim('(discovered on-chain via getCode — the scan floor)')}`);
54
+ },
55
+ });
56
+ }
57
+ // ── ensure the trust anchor exists ───────────────────────────────────────────
58
+ /**
59
+ * The trust-anchor gate: a factory is THE address platforms allowlist by, so a missing
60
+ * manifest entry must NEVER silently mint a new "canonical" — that fragments trust (and
61
+ * a stale SDK would duplicate factories on real chains). Degrade to guidance; deploying
62
+ * a private trust anchor is an explicit choice (`--bootstrap-factory`).
63
+ */
64
+ export function refuseMissingFactory(kind, envVar, reason) {
65
+ throw new Error(`${reason}\n` +
66
+ ` A canonical ${kind} may already exist for '${CHAIN}' — check with the ABX community / update @artblocks/abx-sdk ` +
67
+ `(the shipped manifest: packages/sdk/src/deployments.ts), or set ${envVar}=0x… if you know the address.\n` +
68
+ ` To deploy your OWN trust anchor instead (private chains, sandboxes — platforms won't recognize its clones), ` +
69
+ `re-run with --bootstrap-factory.`);
70
+ }
71
+ /** A `SendTx` that defers `makeWalletClient`/`makeHotSender` construction until the first actual
72
+ * send — trust-anchor bootstrap is rare (an existing, current anchor is the common case), so the
73
+ * happy path must never require a signing key. Memoized so a multi-tx bootstrap (the SeriesCode
74
+ * factory: 2 libraries + the linked factory itself) reuses ONE sender — and its nonce tracking —
75
+ * rather than a fresh one per send. */
76
+ export function lazyBootstrapSender(publicClient) {
77
+ let cached;
78
+ return (tx) => {
79
+ if (!cached) {
80
+ const { wallet, account } = makeWalletClient({ chainKey: CHAIN });
81
+ cached = makeHotSender({ wallet, account, publicClient });
82
+ }
83
+ return cached(tx);
84
+ };
85
+ }
86
+ /** Get (or deploy) the chain's canonical 1/1 clone factory — narrates the SDK's `ensureFactory`
87
+ * (anchors.ts), which owns the resolve/verify/bootstrap logic; this keeps only the exact console
88
+ * output plus the exit-messaging refusal (`refuseMissingFactory`), which stays CLI-side since the
89
+ * SDK doesn't know a UX's flag names. `quiet` suppresses only the happy-path reuse line (the demo
90
+ * resolves the factory without making a teaching moment of it) — everything else always prints. */
91
+ export async function ensureFactory(override, allowBootstrap = false, quiet = false) {
92
+ const publicClient = makePublicClient({ chainKey: CHAIN });
93
+ const send = lazyBootstrapSender(publicClient);
94
+ try {
95
+ return await sdkEnsureFactory(publicClient, send, {
96
+ chainId: resolveChain(CHAIN).id,
97
+ override,
98
+ allowBootstrap,
99
+ onEvent: (e) => {
100
+ if (e.kind === 'resolved') {
101
+ if (!quiet)
102
+ info(`using canonical factory ${explorerBase()}/address/${e.address}`);
103
+ }
104
+ else if (e.kind === 'stale') {
105
+ info(e.reason === 'no-code'
106
+ ? 'configured factory has no code on this chain — deploying a fresh one'
107
+ : 'configured factory is an older/incompatible version — deploying a fresh trust anchor');
108
+ }
109
+ else if (e.kind === 'deploying') {
110
+ info('deploying the canonical clone factory (ownerless trust anchor)…');
111
+ }
112
+ else if (e.kind === 'deployed') {
113
+ ok(`factory ${e.address}`);
114
+ info(`implementation ${e.implementation}`);
115
+ info(`tx ${explorerBase()}/tx/${e.txHash}`);
116
+ warn(`${CHAIN} (chainId ${resolveChain(CHAIN).id}) isn't in the shipped manifest — to reuse this factory set ${bold(`ABX_FACTORY=${e.address}`)} (or add it to packages/sdk/src/deployments.ts).`);
117
+ }
118
+ },
119
+ });
120
+ }
121
+ catch (err) {
122
+ if (err instanceof AnchorUnavailableError) {
123
+ const reason = err.detail === 'not-configured'
124
+ ? `no canonical 1/1 factory is configured for '${CHAIN}'.`
125
+ : err.detail === 'no-code'
126
+ ? `the configured factory ${err.address} has no code on '${CHAIN}' — check ABX_CHAIN / the RPC endpoint.`
127
+ : `the configured factory ${err.address} is an older/incompatible version on '${CHAIN}'.`;
128
+ refuseMissingFactory('factory', 'ABX_FACTORY', reason);
129
+ }
130
+ throw err;
131
+ }
132
+ }
133
+ // ── ensure the canonical Series trust anchor exists ──────────────────────────
134
+ /** Get (or deploy) the chain's `SeriesImageFactory` — the sibling of {@link ensureFactory}.
135
+ * Narrates the SDK's `ensureSeriesFactory` (anchors.ts), which owns the resolve/verify/bootstrap
136
+ * logic. */
137
+ export async function ensureSeriesFactory(override, allowBootstrap = false) {
138
+ const publicClient = makePublicClient({ chainKey: CHAIN });
139
+ const send = lazyBootstrapSender(publicClient);
140
+ try {
141
+ return await sdkEnsureSeriesFactory(publicClient, send, {
142
+ chainId: resolveChain(CHAIN).id,
143
+ override,
144
+ allowBootstrap,
145
+ onEvent: (e) => {
146
+ if (e.kind === 'resolved')
147
+ info(`using canonical Series factory ${explorerBase()}/address/${e.address}`);
148
+ else if (e.kind === 'stale')
149
+ info('configured Series factory is missing or an older version — deploying a fresh trust anchor');
150
+ else if (e.kind === 'deploying')
151
+ info('deploying the canonical Series clone factory (ownerless trust anchor)…');
152
+ else if (e.kind === 'deployed') {
153
+ ok(`Series factory ${e.address}`);
154
+ info(`implementation ${e.implementation}`);
155
+ info(`tx ${explorerBase()}/tx/${e.txHash}`);
156
+ warn(`${CHAIN} (chainId ${resolveChain(CHAIN).id}) isn't in the shipped manifest — to reuse this factory set ${bold(`ABX_SERIES_FACTORY=${e.address}`)} (or add it to packages/sdk/src/deployments.ts).`);
157
+ }
158
+ },
159
+ });
160
+ }
161
+ catch (err) {
162
+ if (err instanceof AnchorUnavailableError) {
163
+ const reason = err.detail === 'not-configured'
164
+ ? `no canonical Series factory is configured for '${CHAIN}'.`
165
+ : `the configured Series factory ${err.address} is missing or an older version on '${CHAIN}'.`;
166
+ refuseMissingFactory('Series factory', 'ABX_SERIES_FACTORY', reason);
167
+ }
168
+ throw err;
169
+ }
170
+ }
171
+ // ── ensure the canonical on-chain renderer exists ────────────────────────────
172
+ /** Get (or deploy) the chain's shared `AbxMetadataRenderer` — narrates the SDK's `ensureRenderer`
173
+ * (anchors.ts), which also self-heals to the CREATE2-deterministic address before deploying. No
174
+ * `allowBootstrap` gate here (unlike the three clone factories) — the renderer isn't a platform
175
+ * allowlist entry, so there's nothing to refuse; a stale/missing one always just gets redeployed. */
176
+ export async function ensureRenderer(override) {
177
+ const publicClient = makePublicClient({ chainKey: CHAIN });
178
+ const send = lazyBootstrapSender(publicClient);
179
+ return sdkEnsureRenderer(publicClient, send, {
180
+ chainId: resolveChain(CHAIN).id,
181
+ override,
182
+ onEvent: (e) => {
183
+ if (e.kind === 'resolved')
184
+ info(`using canonical renderer ${explorerBase()}/address/${e.address}`);
185
+ else if (e.kind === 'stale')
186
+ info('configured renderer is missing or an older spec version — deploying a fresh one');
187
+ else if (e.kind === 'canonical')
188
+ info(`using canonical renderer at its deterministic address ${explorerBase()}/address/${e.address}`);
189
+ else if (e.kind === 'deploying')
190
+ info('deploying the canonical on-chain metadata renderer (CREATE2)…');
191
+ else if (e.kind === 'deployed') {
192
+ ok(`renderer ${e.address} (spec v${e.specVersion})`);
193
+ info(`tx ${explorerBase()}/tx/${e.txHash}`);
194
+ warn(`not in the shipped manifest for ${CHAIN} — to reuse this renderer set ${bold(`ABX_RENDERER=${e.address}`)} (or add it to packages/sdk/src/deployments.ts).`);
195
+ }
196
+ },
197
+ });
198
+ }
199
+ /** The code-project trust anchor — narrates the SDK's `ensureSeriesCodeFactory` (anchors.ts),
200
+ * which owns the resolve/bootstrap logic (a sandbox / fresh chain links + deploys the two
201
+ * write-path libraries then the factory in-flight; see {@link deploySeriesCodeFactory}). */
202
+ export async function ensureSeriesCodeFactory(publicClient, override, allowBootstrap = false) {
203
+ const send = lazyBootstrapSender(publicClient);
204
+ try {
205
+ return await sdkEnsureSeriesCodeFactory(publicClient, send, {
206
+ chainId: resolveChain(CHAIN).id,
207
+ override,
208
+ allowBootstrap,
209
+ onEvent: (e) => {
210
+ if (e.kind === 'resolved')
211
+ info(`using canonical SeriesCode factory ${explorerBase()}/address/${e.address}`);
212
+ else if (e.kind === 'stale')
213
+ info('configured SeriesCode factory has no code on this chain — deploying a fresh trust anchor');
214
+ else if (e.kind === 'deploying')
215
+ info('deploying the SeriesCode trust anchor (2 libraries → linked factory → implementation)…');
216
+ else if (e.kind === 'deployed') {
217
+ ok(`SeriesCode factory ${e.address} ${dim(`(impl ${e.implementation})`)}`);
218
+ info(`libraries: AbxParamsLib ${e.paramsLib} · AbxCodeLib ${e.codeLib}`);
219
+ warn(`${CHAIN} isn't in the shipped manifest — to reuse, set ${bold(`ABX_SERIES_CODE_FACTORY=${e.address}`)} (or add it to packages/sdk/src/deployments.ts).`);
220
+ }
221
+ },
222
+ });
223
+ }
224
+ catch (err) {
225
+ if (err instanceof AnchorUnavailableError) {
226
+ const reason = err.detail === 'not-configured'
227
+ ? `no canonical SeriesCode factory is configured for '${CHAIN}'.`
228
+ : `the configured SeriesCode factory ${err.address} has no code on '${CHAIN}' — check ABX_CHAIN / the RPC endpoint.`;
229
+ refuseMissingFactory('SeriesCode factory', 'ABX_SERIES_CODE_FACTORY', reason);
230
+ }
231
+ throw err;
232
+ }
233
+ }
234
+ /** The canonical seed source — narrates the SDK's `ensureSeedSource` (anchors.ts): a clean keyless
235
+ * singleton (like the renderer / chunk store / minter), so CREATE2 lands at THE canonical address
236
+ * on any chain. Resolves from the manifest, self-heals to the predicted address (deployed but not
237
+ * yet repointed), else auto-deploys via CREATE2. */
238
+ export async function ensureSeedSource(publicClient) {
239
+ const send = lazyBootstrapSender(publicClient);
240
+ return sdkEnsureSeedSource(publicClient, send, {
241
+ chainId: resolveChain(CHAIN).id,
242
+ onEvent: (e) => {
243
+ if (e.kind === 'canonical')
244
+ info(`using the canonical seed source at its deterministic address ${e.address}`);
245
+ else if (e.kind === 'deployed')
246
+ ok(`AbxSeedSource ${e.address} ${dim('(deployed via CREATE2 — set ABX_SEED_SOURCE to reuse)')}`);
247
+ },
248
+ });
249
+ }
250
+ /**
251
+ * Refuse a port that's already bound, with a formatted one-liner naming the port and the fix.
252
+ *
253
+ * Without this, `listen()` has no `'error'` handler and EADDRINUSE reaches Node's default handler:
254
+ * the creator gets a raw stack trace through `node:net` and our own `dist/` paths, which reads as a
255
+ * crash inside abx rather than "something else is on this port" — and it's the one unformatted error
256
+ * surface in a CLI where every other error is formatted. `preview`'s default port colliding with a
257
+ * studio left running in another terminal was reported as especially hard to diagnose.
258
+ */
259
+ export async function assertPortFree(port, cmd) {
260
+ if (!(await portInUse(port)))
261
+ return;
262
+ throw new Error(`port ${port} is already in use — most likely an \`abx ${cmd}\`/\`abx serve\`/\`abx preview\` still running in another terminal.\n` +
263
+ ` Stop that one (Ctrl-C), or run this on a different port: \`abx ${cmd} --port ${port + 1}\`.`);
264
+ }
265
+ /** Is a TCP port already bound on localhost? Used to preflight a serve BEFORE spending a tx. */
266
+ export async function portInUse(port) {
267
+ const { createServer } = await import('node:net');
268
+ return new Promise((resolve) => {
269
+ const probe = createServer();
270
+ probe.once('error', (e) => resolve(e.code === 'EADDRINUSE'));
271
+ probe.once('listening', () => probe.close(() => resolve(false)));
272
+ probe.listen(port);
273
+ });
274
+ }
275
+ /**
276
+ * Index a project we *just* deployed — and don't believe a zero.
277
+ *
278
+ * `eth_getLogs` is read-after-write inconsistent on load-balanced RPCs: `waitForTransactionReceipt`
279
+ * resolves against a node that has the block, then the log query lands on one that doesn't yet, and
280
+ * returns an empty set for a block we KNOW contains our deploy. The old code took that single read at
281
+ * face value, printed `✓ reconstructed 0 events`, stored the empty projection, and served an empty
282
+ * dashboard — a first-run that looks like the toolkit simply doesn't work. It reproduced 100% of the
283
+ * time on `https://sepolia.base.org`, which is the DEFAULT endpoint when there's no `.env`, i.e. the
284
+ * documented first run was the broken path. The same block returned all 9 logs seconds later.
285
+ *
286
+ * We have the one thing that makes this checkable: we just minted, so the spine cannot be empty.
287
+ * So verify instead of trusting — re-scan with backoff until events appear, and if they never do,
288
+ * say so as a FAILURE with the recovery command rather than dressing a zero up as a ✓.
289
+ */
290
+ export async function reindexAfterDeploy(indexer, address, opts = {}) {
291
+ const attempts = opts.attempts ?? 6;
292
+ const delayMs = opts.delayMs ?? 1500;
293
+ let last = await indexer.reindex(address);
294
+ for (let i = 1; i < attempts && last.state.eventCount === 0; i++) {
295
+ if (i === 1) {
296
+ info(dim("no events yet — the RPC hasn't served the logs for that block; re-scanning…"));
297
+ }
298
+ await sleep(delayMs);
299
+ // `full: true` — the stored projection has 0 events, so there is no valid checkpoint to
300
+ // resume from; a full replay from the deploy block is the only correct re-scan.
301
+ last = await indexer.reindex(address, { full: true });
302
+ }
303
+ if (last.state.eventCount === 0) {
304
+ warn(`the RPC still reports no logs for this project after ${attempts} tries — the deploy DID succeed ` +
305
+ `(it's on chain), but this node can't reconstruct it yet.`);
306
+ console.log(` ${dim('recover with')} ${bold(`abx index ${address} --full`)} ${dim('in a minute, or point ABX_RPC_URLS at a better endpoint (`abx doctor` ranks them).')}`);
307
+ }
308
+ return last;
309
+ }
310
+ // Effects (Playwright + Chromium) is an OPTIONAL dependency of the CLI, so the default
311
+ // `npm i -g @artblocks/abx-cli` stays small + browserless (the resolver serves read-only and never
312
+ // renders). Only `abx render` and `abx effects` need it — load it lazily here so a missing optional
313
+ // dep surfaces ONLY at those call sites, with a fix, instead of breaking startup for everyone.
314
+ export async function loadEffects() {
315
+ try {
316
+ return await import('@artblocks/abx-effects');
317
+ }
318
+ catch {
319
+ throw new Error("effects support isn't installed (the optional @artblocks/abx-effects package + Playwright). " +
320
+ 'Install it with `npm i -g @artblocks/abx-effects`, or reinstall the CLI without --no-optional. ' +
321
+ 'Only `abx render` and `abx effects` need it; everything else runs browserless.');
322
+ }
323
+ }
324
+ /**
325
+ * The publish topology's one hard prerequisite, checked BEFORE any capture.
326
+ *
327
+ * A resolver that doesn't share this machine's disk serves referenced output (the still, a video, a
328
+ * model) by **redirect** — so it needs a URL, and it refuses the bytes (`specs/protocol/effects.md →
329
+ * Bound vs referenced`). A backend that can't name a locator therefore has no publish lane at all,
330
+ * and every render against one would be work spent to earn a 400.
331
+ *
332
+ * So this refuses up front and names the ways out, rather than warning and letting the render run.
333
+ * It deliberately does NOT pick a backend for the operator: which store holds their art — and which
334
+ * gateway serves it — is theirs to decide. The three that work are peers, not a ranking: `https://`
335
+ * from S3/R2, an IPFS gateway, and Arweave are all fine, because derived output is re-creatable and
336
+ * the only real requirement is that a third party can fetch it.
337
+ */
338
+ export function requirePublishableBackend(flags, what) {
339
+ const backend = resolveBackend(storageOptions(storageOverrides(flags)));
340
+ const { backend: name, source } = backendResolution(storageOverrides(flags));
341
+ // The OK/NOT-OK decision is the shared render×storage validator (packages/storage/content-plan.ts)
342
+ // — the same one deploy-code's --image-base guard and dry-run row consult, so this combination
343
+ // can't drift into two disagreeing ideas of "publishable." The wording below stays CLI-specific
344
+ // (it names the exact env vars + every way out) — only the verdict is shared. `backend.id` (not
345
+ // `name`) — `resolveBackend` normalizes the `s3` alias to `cloud`, and the validator's backend set
346
+ // is keyed on the normalized id.
347
+ const result = validateRenderStorageCombo({ backendId: backend.id, cloudHasPublicBase: backend.id === 'cloud' ? !!backend.publicBase : undefined, publishesToRemoteResolver: true });
348
+ if (result.ok)
349
+ return;
350
+ // `cloud` is the one backend that HAS a locator method and can still return null: the URL is
351
+ // `<publicBase>/<key>`, so without a public base it can name nothing. Catch that here too — it
352
+ // would otherwise be the same failure one render later.
353
+ if (name === 'cloud' && !backend.publicBase) {
354
+ throw new Error(`${what} hands the resolver a URL for each render, but the 'cloud' backend has no public read base — ` +
355
+ `set ${bold('ABX_S3_PUBLIC_BASE')} to the bucket's public URL (an R2/CloudFront/S3-website base), ` +
356
+ `or use ${bold('--backend ipfs')} / ${bold('--backend arweave')}, or render co-located with the resolver.`);
357
+ }
358
+ throw new Error(`${what} publishes each render to a resolver that doesn't share this machine's disk, but the '${name}' backend ` +
359
+ `(${source === 'default' ? 'the default' : `from ${source}`}) can't produce a URL for what it stores — so the resolver would have nothing to serve.\n` +
360
+ ` Point it at a backend that can (equal options — pick on cost/ops, not durability dogma):\n` +
361
+ ` ${bold('--backend cloud')} S3 / R2 / B2 with a public base (ABX_S3_* + ABX_S3_PUBLIC_BASE)\n` +
362
+ ` ${bold('--backend ipfs')} Pinata or your own Kubo + a public gateway (PINATA_JWT / ABX_IPFS_*)\n` +
363
+ ` ${bold('--backend arweave')} pay-once permanent (uploads under 100KiB are free, no setup)\n` +
364
+ ` …or run co-located instead: ${bold('abx effects')} on the same host as ${bold('abx serve')}, sharing one backend and no remote token.`);
365
+ }
366
+ // ── shared output ─────────────────────────────────────────────────────────--
367
+ export function printServing(url, address) {
368
+ console.log(`\n ${g('●')} ${bold('serving')} ${url}`);
369
+ console.log(` ${dim('dashboard ')}${url}`);
370
+ console.log(` ${dim('storage ')}${activeBackendId()}`);
371
+ if (address) {
372
+ const cid = resolveChain(CHAIN).id;
373
+ console.log(` ${dim('tokenURI ')}${url}/t/${cid}/${address}/0`);
374
+ console.log(` ${dim('image ')}${url}/t/${cid}/${address}/0/image`);
375
+ console.log(` ${dim('state API ')}${url}/api/project/${address}`);
376
+ }
377
+ // The dashboard is READ-ONLY: re-index/verify are admin actions that 404 unless the node has an
378
+ // ABX_RESOLVER_ADMIN_TOKEN, so there is no button to press. This line used to say "hit Re-index
379
+ // from chain", which sent every first-run user hunting for a control that isn't there.
380
+ console.log(`\n ${dim('The dashboard shows the event spine it replayed — that table IS the reconstruction.')}`);
381
+ if (address) {
382
+ console.log(` ${dim('Rebuild it yourself (read-only, safe):')} ${bold(`abx index ${address} --full`)} ${dim('— replays from the deploy block and must land on identical state.')}`);
383
+ }
384
+ console.log(` ${dim('Ctrl-C to stop.')}\n`);
385
+ }
386
+ /** Walk up from the CLI source to the workspace root (the dir with pnpm-workspace.yaml). Returns
387
+ * null when running from a published install (no workspace) — where --from-source doesn't apply. */
388
+ export function findRepoRoot() {
389
+ let dir = resolvePath(fileURLToPath(import.meta.url), '..');
390
+ for (let i = 0; i < 8; i++) {
391
+ if (existsSync(joinPath(dir, 'pnpm-workspace.yaml')))
392
+ return dir;
393
+ const parent = resolvePath(dir, '..');
394
+ if (parent === dir)
395
+ break;
396
+ dir = parent;
397
+ }
398
+ return null;
399
+ }
400
+ export function keepAlive() {
401
+ process.on('SIGINT', () => {
402
+ console.log(dim('\n stopped.'));
403
+ process.exit(0);
404
+ });
405
+ return new Promise(() => { });
406
+ }
407
+ /**
408
+ * Pick the canonical factory for a clone being added — the CLI-side shell around the SDK's
409
+ * {@link sdkDetectCanonicalFactory} (which does the actual multicall probe; see its doc comment).
410
+ * Shared by `add`'s local + remote paths (project.ts) and the deploy family's post-setup local
411
+ * register (deploy.ts, via {@link registerAndIndexLocally}).
412
+ */
413
+ export async function detectCanonicalFactory(address, override, stored) {
414
+ const publicClient = makePublicClient({ chainKey: CHAIN });
415
+ return sdkDetectCanonicalFactory(publicClient, address, { chainId: resolveChain(CHAIN).id, override, stored });
416
+ }
417
+ /**
418
+ * Register + index a project LOCALLY (this node's own SQLite-backed projection) — the core of
419
+ * `abx add`'s non-`--remote` path, factored out here because it's ALSO how `deploy` / `deploy-series`
420
+ * / `deploy-code` register the project they just deployed (see cmdAdd in commands/project.ts, whose
421
+ * local branch is a thin call to this). Kept self-sufficient (recomputes any `--attributes`/`--traits`
422
+ * edit from `flags` itself) so it never depends on a caller's local variables.
423
+ */
424
+ export async function registerAndIndexLocally(address, flags) {
425
+ const attrRaw = flags.attributes ? readFileSync(resolvePath(process.cwd(), String(flags.attributes)), 'utf8') : undefined;
426
+ const perTokenEdit = attrRaw != null && looksPerTokenAttributes(attrRaw);
427
+ const flagTraits = [];
428
+ if (attrRaw != null && !perTokenEdit)
429
+ flagTraits.push(...normalizeAttributes(JSON.parse(attrRaw)));
430
+ if (flags.traits)
431
+ flagTraits.push(...parseTraitPairs(flags.traits));
432
+ const editedTokenAttributes = perTokenEdit ? parseSeriesTraitsById(attrRaw) : undefined;
433
+ allowLargeScan(flags);
434
+ const indexer = localIndexer();
435
+ const existingReg = indexer.store.getRegistration(address);
436
+ const factory = await detectCanonicalFactory(address, flags.factory, existingReg?.factory);
437
+ // Resolve the scan floor once — the deploy block, never a silent genesis default (see
438
+ // resolveScanFloor). Reused for both register() writes so discovery runs at most once.
439
+ const scanFloor = await resolveScanFloor(address, existingReg?.fromBlock, flags);
440
+ // register() is a full-column upsert, so EVERY off-chain field must be edit-or-preserve here: a flag
441
+ // edits it, its absence keeps what the deploy stored. Omitting one would silently null it on a plain
442
+ // re-index (the clobber bug). Mirrors the remote path's fall-back-to-localReg for the same reason.
443
+ const editDescription = flags.description ?? existingReg?.description ?? undefined;
444
+ const editExternalUrl = flags['external-url'] ?? existingReg?.externalUrl ?? undefined;
445
+ const editAttributes = flagTraits.length ? JSON.stringify(flagTraits) : existingReg?.attributes ?? undefined;
446
+ const editTokenAttributes = editedTokenAttributes && Object.keys(editedTokenAttributes).length
447
+ ? JSON.stringify(editedTokenAttributes)
448
+ : existingReg?.tokenAttributes ?? undefined;
449
+ indexer.register({
450
+ address,
451
+ chainKey: CHAIN,
452
+ fromBlock: scanFloor,
453
+ factory: factory ?? null,
454
+ label: flags.label,
455
+ description: editDescription,
456
+ externalUrl: editExternalUrl,
457
+ attributes: editAttributes,
458
+ tokenAttributes: editTokenAttributes,
459
+ });
460
+ // Set expectations before a potentially multi-minute scan. `eth_getLogs` from a far-back floor
461
+ // auto-chunks but emits no per-block output, so a large span reads as "hung" and invites a Ctrl-C
462
+ // that aborts the index (the #1 add/index friction). Print the span up front when it's large;
463
+ // stay silent on a fresh deploy (tiny recent window). Advisory only — one cheap head read.
464
+ try {
465
+ const prior = indexer.getProject(address);
466
+ const start = prior?.toBlock ? BigInt(prior.toBlock) : BigInt(scanFloor);
467
+ const head = await makePublicClient({ chainKey: CHAIN }).getBlockNumber();
468
+ const span = head - start;
469
+ if (span > 5000n)
470
+ info(`scanning blocks ${start}${dim(' → ')}${head} ${dim(`(~${span} blocks)`)} — on a range-capped RPC (see ${g('abx doctor')}) this can take a few minutes with no per-block output; leave it running.`);
471
+ }
472
+ catch { /* advisory only — the real scan still runs */ }
473
+ // Don't accept a zero here either: `deploy-code` finishes through this command, so this IS the
474
+ // post-deploy index for a code project — and a real ABX clone always emits a spine (its extension
475
+ // registrations at minimum), so 0 events means the RPC hasn't served the logs yet, not that the
476
+ // project is empty. See reindexAfterDeploy.
477
+ const { state, elapsedMs } = await reindexAfterDeploy(indexer, address);
478
+ // Resolve durable locators for off-chain-by-hash content from this machine's index.
479
+ const locators = await collectContentLocators(state, resolveBackend(storageOptions(storageOverrides(flags))));
480
+ if (Object.keys(locators).length) {
481
+ indexer.register({
482
+ address,
483
+ chainKey: CHAIN,
484
+ fromBlock: scanFloor,
485
+ factory: factory ?? null,
486
+ label: flags.label,
487
+ description: editDescription,
488
+ externalUrl: editExternalUrl,
489
+ attributes: editAttributes,
490
+ tokenAttributes: editTokenAttributes,
491
+ contentLocators: JSON.stringify(locators),
492
+ });
493
+ }
494
+ // A ✓ on 0 events is the lie that produced an empty dashboard; reindexAfterDeploy has already
495
+ // explained the failure and named the recovery command, so don't stamp it as success too.
496
+ if (state.eventCount > 0) {
497
+ ok(`registered + indexed ${state.name ?? address} LOCALLY (this machine): ${state.eventCount} events in ${elapsedMs}ms`);
498
+ }
499
+ else {
500
+ warn(`registered ${state.name ?? address}, but with NO reconstructed state — it will serve empty until the index succeeds.`);
501
+ }
502
+ info(`serve it from here with ${bold('abx serve')} — or push it to a hosted resolver with ${bold('abx add ' + address + ' --remote')}`);
503
+ }
504
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAE,OAAO,IAAI,W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