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

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 (121) hide show
  1. package/CHANGELOG.md +218 -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 +69 -0
  15. package/dist/commands/scaffold.d.ts.map +1 -0
  16. package/dist/commands/scaffold.js +508 -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 +618 -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/conformance.d.ts +31 -0
  31. package/dist/conformance.d.ts.map +1 -0
  32. package/dist/conformance.js +371 -0
  33. package/dist/conformance.js.map +1 -0
  34. package/dist/deps.d.ts +6 -39
  35. package/dist/deps.d.ts.map +1 -1
  36. package/dist/deps.js +4 -68
  37. package/dist/deps.js.map +1 -1
  38. package/dist/errors.d.ts +20 -0
  39. package/dist/errors.d.ts.map +1 -0
  40. package/dist/errors.js +25 -0
  41. package/dist/errors.js.map +1 -0
  42. package/dist/flags.d.ts +34 -0
  43. package/dist/flags.d.ts.map +1 -1
  44. package/dist/flags.js +74 -0
  45. package/dist/flags.js.map +1 -1
  46. package/dist/main.js +220 -6905
  47. package/dist/main.js.map +1 -1
  48. package/dist/mintpage.d.ts +3 -1
  49. package/dist/mintpage.d.ts.map +1 -1
  50. package/dist/mintpage.js +48 -48
  51. package/dist/mintpage.js.map +1 -1
  52. package/dist/output.d.ts +137 -0
  53. package/dist/output.d.ts.map +1 -0
  54. package/dist/output.js +504 -0
  55. package/dist/output.js.map +1 -0
  56. package/dist/ownerops.d.ts +23 -44
  57. package/dist/ownerops.d.ts.map +1 -1
  58. package/dist/ownerops.js +151 -233
  59. package/dist/ownerops.js.map +1 -1
  60. package/dist/preview.d.ts +8 -4
  61. package/dist/preview.d.ts.map +1 -1
  62. package/dist/preview.js +8 -17
  63. package/dist/preview.js.map +1 -1
  64. package/dist/provision.d.ts.map +1 -1
  65. package/dist/provision.js +10 -7
  66. package/dist/provision.js.map +1 -1
  67. package/dist/remote.d.ts +72 -7
  68. package/dist/remote.d.ts.map +1 -1
  69. package/dist/remote.js +211 -9
  70. package/dist/remote.js.map +1 -1
  71. package/dist/riskgate.d.ts +29 -0
  72. package/dist/riskgate.d.ts.map +1 -0
  73. package/dist/riskgate.js +91 -0
  74. package/dist/riskgate.js.map +1 -0
  75. package/dist/schema.d.ts +6 -0
  76. package/dist/schema.d.ts.map +1 -1
  77. package/dist/schema.js +12 -16
  78. package/dist/schema.js.map +1 -1
  79. package/dist/served.d.ts +1 -17
  80. package/dist/served.d.ts.map +1 -1
  81. package/dist/served.js +47 -0
  82. package/dist/served.js.map +1 -1
  83. package/dist/signer.d.ts +13 -0
  84. package/dist/signer.d.ts.map +1 -1
  85. package/dist/signer.js +42 -19
  86. package/dist/signer.js.map +1 -1
  87. package/dist/update-check.d.ts +27 -0
  88. package/dist/update-check.d.ts.map +1 -1
  89. package/dist/update-check.js +30 -0
  90. package/dist/update-check.js.map +1 -1
  91. package/package.json +6 -6
  92. package/skill/SKILL.md +7 -11
  93. package/skill/reference/code-projects.md +3 -3
  94. package/skill/reference/hosting.md +6 -6
  95. package/skill/reference/operating.md +2 -5
  96. package/skill/reference/setup.md +2 -2
  97. package/skill/reference/troubleshooting.md +1 -1
  98. package/dist/gas.d.ts +0 -63
  99. package/dist/gas.d.ts.map +0 -1
  100. package/dist/gas.js +0 -76
  101. package/dist/gas.js.map +0 -1
  102. package/dist/inspect.d.ts +0 -48
  103. package/dist/inspect.d.ts.map +0 -1
  104. package/dist/inspect.js +0 -290
  105. package/dist/inspect.js.map +0 -1
  106. package/dist/migrate.d.ts +0 -65
  107. package/dist/migrate.d.ts.map +0 -1
  108. package/dist/migrate.js +0 -180
  109. package/dist/migrate.js.map +0 -1
  110. package/dist/onchain-uri.d.ts +0 -81
  111. package/dist/onchain-uri.d.ts.map +0 -1
  112. package/dist/onchain-uri.js +0 -251
  113. package/dist/onchain-uri.js.map +0 -1
  114. package/dist/resume.d.ts +0 -96
  115. package/dist/resume.d.ts.map +0 -1
  116. package/dist/resume.js +0 -95
  117. package/dist/resume.js.map +0 -1
  118. package/dist/upload.d.ts +0 -28
  119. package/dist/upload.d.ts.map +0 -1
  120. package/dist/upload.js +0 -41
  121. package/dist/upload.js.map +0 -1
@@ -0,0 +1,371 @@
1
+ /**
2
+ * Remote-service conformance — the assertion set behind `abx remote <name|url> --conformance`
3
+ * (see `commands/service.ts`'s `cmdRemoteConformance`). Moved here (from the repo-local
4
+ * `scripts/conformance-remote-service.mjs`) so a third party can self-certify a hosted resolver
5
+ * against the PUBLISHED CLI — no repo checkout required, just `npm i -g @artblocks/abx-cli`.
6
+ *
7
+ * The loose script is now a thin argv-parsing wrapper over this same module (kept for
8
+ * `pnpm conformance` and `scripts/e2e-remote-resolver.sh`, which runs it against the reference
9
+ * container on every CI run) — so this module's public strings are load-bearing:
10
+ * `scripts/e2e-remote-resolver.sh` greps stdout for the literal `✓ conformant`. Keep
11
+ * {@link verdictLine} and {@link formatAssertion}'s prefixes stable.
12
+ *
13
+ * Dogfoods the SDK's `AbxServiceClient` — the same client the CLI drives against a remote resolver
14
+ * — so passing here means the real tooling interoperates with the target service, per
15
+ * `specs/self-host-toolkit/remote-services.md`.
16
+ *
17
+ * Tiers (each unlocks with the inputs given — a bare URL with no token still runs the always-tier,
18
+ * which is enough to self-certify the public surface with zero setup):
19
+ * always descriptor served + required fields; unauthenticated write refused; the
20
+ * read-plane's error taxonomy; every DECLARED interface's routes exist
21
+ * token authed GET /v1/projects; the artifact registry refuses bound/referenced
22
+ * output mismatches
23
+ * token + address the full write loop: register → (poll to live) → status → reindex →
24
+ * + chainId deregister. Needs a contract the service can actually replay, so point it
25
+ * at one you own — this is the one tier that persists (then removes) state
26
+ * on the target, which is why it stays opt-in behind BOTH flags together (a
27
+ * token alone is not enough to reach it).
28
+ *
29
+ * A 403 anywhere in the loop reports as legitimate provider scoping (the token isn't authorized for
30
+ * that contract), never a conformance failure.
31
+ */
32
+ import { AbxServiceClient, AbxServiceError, CONTROL_PLANE_INTERFACE, TOKEN_API_INTERFACE } from '@artblocks/abx-sdk';
33
+ const ZERO_ADDRESS = '0x' + '0'.repeat(40);
34
+ // Every lifecycle-bearing status field (register/status responses) must be one of these five words.
35
+ const LIFECYCLE = ['queued', 'backfilling', 'live', 'stale', 'failed'];
36
+ /** One ✓/✗/· line. Nested sub-bullets carry their own leading spaces in `message` (unchanged from
37
+ * the original script), so the indentation is intentional, not a formatting bug. */
38
+ export function formatAssertion(a) {
39
+ const prefix = a.status === 'pass' ? '✓' : a.status === 'fail' ? '✗' : '·';
40
+ return ` ${prefix} ${a.message}`;
41
+ }
42
+ /** The final line — kept byte-stable: `scripts/e2e-remote-resolver.sh` greps for '✓ conformant'. */
43
+ export function verdictLine(report) {
44
+ return report.failures ? `\n✗ ${report.failures} conformance failure(s)\n` : '\n✓ conformant\n';
45
+ }
46
+ export async function runConformance(opts) {
47
+ const base = opts.baseUrl.replace(/\/+$/, '');
48
+ const assertions = [];
49
+ const pass = (message) => assertions.push({ status: 'pass', message });
50
+ const failed = (message) => assertions.push({ status: 'fail', message });
51
+ const note = (message) => assertions.push({ status: 'note', message });
52
+ const scoped = (err) => err instanceof AbxServiceError && err.status === 403;
53
+ const probeAddr = opts.address ?? ZERO_ADDRESS;
54
+ const readJson = async (path) => {
55
+ try {
56
+ const res = await fetch(base + path);
57
+ return { status: res.status, body: (await res.json().catch(() => ({}))) };
58
+ }
59
+ catch (err) {
60
+ return { networkError: err };
61
+ }
62
+ };
63
+ // ── tier 0: the descriptor ────────────────────────────────────────────────────
64
+ const anon = new AbxServiceClient({ baseUrl: base });
65
+ let descriptor = null;
66
+ try {
67
+ descriptor = await anon.descriptor();
68
+ pass('GET /.well-known/abx-service serves JSON');
69
+ }
70
+ catch (err) {
71
+ failed(`no service descriptor: ${err.message}`);
72
+ }
73
+ if (descriptor) {
74
+ Array.isArray(descriptor.interfaces) && descriptor.interfaces.length
75
+ ? pass(`interfaces declared: ${descriptor.interfaces.join(' · ')}`)
76
+ : failed('descriptor.interfaces missing/empty (required)');
77
+ Array.isArray(descriptor.chains) && descriptor.chains.length
78
+ ? pass(`chains declared: ${descriptor.chains.join(', ')}`)
79
+ : failed('descriptor.chains missing/empty (required)');
80
+ if (opts.chainId !== undefined) {
81
+ descriptor.chains?.includes(opts.chainId)
82
+ ? pass(`serves chain ${opts.chainId}`)
83
+ : failed(`descriptor.chains does not include ${opts.chainId} — registrations for it should be refused`);
84
+ }
85
+ const controlPlane = descriptor.interfaces?.includes(CONTROL_PLANE_INTERFACE);
86
+ if (controlPlane) {
87
+ descriptor.auth?.scheme === 'bearer'
88
+ ? pass('auth.scheme is "bearer"')
89
+ : failed(`control plane declared but auth.scheme is ${JSON.stringify(descriptor.auth?.scheme)} (must be "bearer")`);
90
+ }
91
+ else {
92
+ note(`control plane not declared (${CONTROL_PLANE_INTERFACE} absent) — register/list tiers will report accordingly`);
93
+ }
94
+ if (!descriptor.interfaces?.includes(TOKEN_API_INTERFACE))
95
+ note(`descriptor does not declare ${TOKEN_API_INTERFACE} — is this a resolver?`);
96
+ if (descriptor.render?.attached) {
97
+ note(`rendering is managed behind this service (effects: ${descriptor.render.effects ? descriptor.render.effects.map((e) => e.key).join(', ') : 'unverified'})`);
98
+ }
99
+ }
100
+ // ── tier 0: unauthenticated writes must be refused ────────────────────────────
101
+ const chainForProbe = opts.chainId ?? descriptor?.chains?.[0] ?? 1;
102
+ try {
103
+ await anon.registerProject({ chainId: chainForProbe, address: probeAddr });
104
+ failed('unauthenticated POST /v1/projects was ACCEPTED — the control plane must require a bearer token');
105
+ }
106
+ catch (err) {
107
+ if (err instanceof AbxServiceError && err.status === 401)
108
+ pass('unauthenticated register → 401');
109
+ else if (err instanceof AbxServiceError && err.code === 'disabled')
110
+ pass('control plane disabled on this node (404 code "disabled") — honest, conformant');
111
+ else if (err instanceof AbxServiceError)
112
+ failed(`unauthenticated register → ${err.status} ${err.code ?? ''} (expected 401, or 404 code "disabled")`);
113
+ else
114
+ failed(`unauthenticated register probe errored: ${err.message}`);
115
+ }
116
+ // ── tier 0: the read plane's error taxonomy ───────────────────────────────────
117
+ // "No metadata came back" has three distinct causes, and a service that answers a bare 404 to all
118
+ // of them is a trap: a client that hand-built a URL reads its own mistake as a provider outage and
119
+ // files a bug against a working service. Each cause MUST be distinguishable by a machine `code` —
120
+ // remote-services.md → "Three ways a read can miss".
121
+ {
122
+ // (a) a real route with the wrong shape — the observed mistake is dropping the tokenId off
123
+ // /t/{chainId}/{address}/{tokenId} while reaching for collection metadata.
124
+ const shape = await readJson(`/t/${chainForProbe}/${probeAddr}`);
125
+ if (shape.networkError)
126
+ failed(`read-plane probe unreachable: ${shape.networkError.message}`);
127
+ else if (shape.status === 400 && shape.body?.code === 'invalid_request') {
128
+ pass('malformed token path → 400 invalid_request (not a bare 404)');
129
+ /\/c\//.test(shape.body?.error ?? '') || shape.body?.didYouMean
130
+ ? pass(' …and it points at /c/{chainId}/{address} for collection metadata')
131
+ : note(' the 400 does not mention /c/{chainId}/{address} — SHOULD name the route that serves what the caller wanted');
132
+ }
133
+ else if (shape.status === 404) {
134
+ failed(`malformed token path /t/${chainForProbe}/${probeAddr} → bare 404 ${JSON.stringify(shape.body?.code ?? null)} — ` +
135
+ 'MUST be 400 invalid_request naming the correct template; a 404 here is indistinguishable from "not indexed" and reads as an outage');
136
+ }
137
+ else
138
+ failed(`malformed token path → ${shape.status} ${shape.body?.code ?? ''} (expected 400 invalid_request)`);
139
+ // (b) no such route on this node at all
140
+ const unknown = await readJson('/abx-conformance-no-such-route');
141
+ if (unknown.status === 404 && unknown.body?.code === 'unknown_route')
142
+ pass('unknown path → 404 unknown_route');
143
+ else if (unknown.status === 404)
144
+ failed(`unknown path → 404 with code ${JSON.stringify(unknown.body?.code ?? null)} (expected "unknown_route")`);
145
+ else if (!unknown.networkError)
146
+ note(`unknown path → ${unknown.status} (expected 404 unknown_route)`);
147
+ // (c) well-formed, right chain, contract not indexed here — the ONLY one of the three that is
148
+ // about the project. Skipped when --address names a contract the service may actually serve.
149
+ if (!opts.address) {
150
+ const missing = await readJson(`/c/${chainForProbe}/${probeAddr}`);
151
+ if (missing.status === 404 && missing.body?.code === 'not_registered')
152
+ pass('well-formed path, unindexed contract → 404 not_registered');
153
+ else if (missing.status === 404)
154
+ failed(`unindexed contract → 404 with code ${JSON.stringify(missing.body?.code ?? null)} (expected "not_registered")`);
155
+ else if (!missing.networkError)
156
+ note(`unindexed contract probe → ${missing.status} (expected 404 not_registered)`);
157
+ }
158
+ // (d) a chain this node doesn't serve — a request error, and the body says what IS served.
159
+ const wrongChain = await readJson(`/t/999999999/${probeAddr}/0`);
160
+ if (wrongChain.body?.code === 'unsupported_chain') {
161
+ pass(`wrong chain → ${wrongChain.status} unsupported_chain`);
162
+ Array.isArray(wrongChain.body?.chains)
163
+ ? pass(` …and carries the chains it does serve: ${wrongChain.body?.chains?.join(', ')}`)
164
+ : note(' the unsupported_chain body omits `chains` — SHOULD carry the chain ids this node serves');
165
+ }
166
+ else if (!wrongChain.networkError) {
167
+ failed(`wrong chain → ${wrongChain.status} ${JSON.stringify(wrongChain.body?.code ?? null)} (expected code "unsupported_chain")`);
168
+ }
169
+ }
170
+ // ── tier 0: a declared interface means EVERY route it names answers ────────────
171
+ // The interface ids are all-or-nothing. One provider declared `abx-token-api/v1` while `/verify`
172
+ // had never been implemented, and nothing on either side caught it: the route answered a bare 404,
173
+ // which reads to a client as "this service is broken". Omitting an interface is the honest way to
174
+ // express partial support — declaring one and serving a subset is not.
175
+ //
176
+ // The assertion is deliberately narrow: a declared route may legitimately answer 404 `not_registered`
177
+ // (nothing indexed there) or 400 `invalid_request`. What it must NOT answer is `unknown_route` or a
178
+ // code-less 404 — those say the route itself doesn't exist.
179
+ if (descriptor?.interfaces?.includes(TOKEN_API_INTERFACE)) {
180
+ const routes = [
181
+ [`/t/${chainForProbe}/${probeAddr}/0`, 'token metadata'],
182
+ [`/t/${chainForProbe}/${probeAddr}/0/image`, 'token image'],
183
+ [`/c/${chainForProbe}/${probeAddr}`, 'collection metadata'],
184
+ [`/api/project/${chainForProbe}/${probeAddr}`, 'project state'],
185
+ [`/api/project/${chainForProbe}/${probeAddr}/verify`, 'verify'],
186
+ ];
187
+ for (const [path, what] of routes) {
188
+ const r = await readJson(path);
189
+ if (r.networkError) {
190
+ failed(`${what} (${path}) unreachable: ${r.networkError.message}`);
191
+ continue;
192
+ }
193
+ if (r.status === 404 && (r.body?.code === 'unknown_route' || r.body?.code === undefined)) {
194
+ failed(`${what} (${path}) → 404 ${r.body?.code ?? '(no code)'} — but this service declares ${TOKEN_API_INTERFACE}, ` +
195
+ `which names that route. Implement it, or stop declaring the interface.`);
196
+ }
197
+ else
198
+ pass(`${what} route exists (${r.status}${r.body?.code ? ` ${r.body.code}` : ''})`);
199
+ }
200
+ }
201
+ // ── tier 1: an authed token ───────────────────────────────────────────────────
202
+ if (!opts.token) {
203
+ note('no token — skipping the authed tiers');
204
+ return { baseUrl: base, assertions, failures: assertions.filter((a) => a.status === 'fail').length };
205
+ }
206
+ const authed = new AbxServiceClient({ baseUrl: base, token: opts.token });
207
+ try {
208
+ const projects = await authed.listProjects();
209
+ pass(`GET /v1/projects with the token → ${projects.length} project(s) visible`);
210
+ }
211
+ catch (err) {
212
+ if (err instanceof AbxServiceError && err.status === 401)
213
+ failed('the provided token was rejected (401)');
214
+ else
215
+ failed(`GET /v1/projects failed: ${err.message}`);
216
+ }
217
+ // ── tier 1: the artifact registry is a POINTER registry ─────────────────────
218
+ // `specs/protocol/effects.md → Bound vs referenced`. Which form is legal is fixed by the output's
219
+ // binding, and BOTH mismatches must be refused: silently accepting media bytes makes every
220
+ // conforming resolver an object store, and silently accepting a locator for `traits` records
221
+ // something that can never stitch — a wrong answer served confidently. These probes are all
222
+ // refusals, so a conformant service stores nothing as a result of them.
223
+ if (descriptor?.interfaces?.includes(CONTROL_PLANE_INTERFACE)) {
224
+ const publish = async (body) => {
225
+ try {
226
+ const res = await fetch(base + '/v1/effect-artifacts', {
227
+ method: 'POST',
228
+ headers: { authorization: `Bearer ${opts.token}`, 'content-type': 'application/json' },
229
+ body: JSON.stringify({ chainId: chainForProbe, address: probeAddr, tokenId: '0', inputsHash: '0x' + 'ab'.repeat(32), ...body }),
230
+ });
231
+ return { status: res.status, body: (await res.json().catch(() => ({}))) };
232
+ }
233
+ catch (err) {
234
+ return { networkError: err };
235
+ }
236
+ };
237
+ const refuses = async (label, body) => {
238
+ const r = await publish(body);
239
+ if (r.networkError)
240
+ return failed(`${label}: unreachable (${r.networkError.message})`);
241
+ if (r.status === 403)
242
+ return note(`${label}: 403 — this token isn't authorized to write artifacts (provider scoping, not a failure)`);
243
+ if (r.status === 400)
244
+ return pass(`${label} → 400 ${r.body?.code ?? ''}`);
245
+ if (r.status === 404 && r.body?.code === 'unknown_route') {
246
+ return failed(`${label}: the artifact-registry route is missing, but this service declares ${CONTROL_PLANE_INTERFACE} (the routes ride it — there is no separate publish interface)`);
247
+ }
248
+ failed(`${label} → ${r.status} ${r.body?.code ?? ''} (expected 400; accepting this is how a resolver becomes an object store / serves traits that never stitch)`);
249
+ };
250
+ await refuses('bytes for a REFERENCED output (image)', { output: 'image', contentType: 'image/png', bytes_base64: Buffer.from([1, 2, 3]).toString('base64') });
251
+ await refuses('a locator for a BOUND output (traits)', { output: 'traits', locator: 'ipfs://cid-conformance' });
252
+ await refuses('bound content over the 64KB cap', { output: 'traits', bytes_base64: Buffer.alloc(64 * 1024 + 1, 0x41).toString('base64') });
253
+ await refuses('a locator only the producer could resolve', { output: 'image', locator: 'http://localhost:8080/x.png' });
254
+ }
255
+ // ── tier 2: the full register → status → reindex → deregister loop ──────────
256
+ if (!opts.address) {
257
+ note('no address — skipping the register loop (point it at a contract you own on the served chain)');
258
+ }
259
+ else if (opts.chainId === undefined) {
260
+ note('address given without a chainId — skipping the register loop');
261
+ }
262
+ else {
263
+ const chainId = opts.chainId;
264
+ const address = opts.address;
265
+ try {
266
+ const reg = await authed.registerProject({ chainId, address, ...(opts.fromBlock ? { fromBlock: opts.fromBlock } : {}) });
267
+ // Either register shape is conformant: 200 with the completed summary, or 202 + a lifecycle
268
+ // state with catch-up deferred. The SDK normalizes the HTTP status into `accepted`.
269
+ if (reg.accepted) {
270
+ LIFECYCLE.includes(reg.project?.status)
271
+ ? pass(`register → 202 accepted (${reg.project.status}) — catch-up deferred`)
272
+ : failed(`register → 202 but project.status is ${JSON.stringify(reg.project?.status)} (must be one of ${LIFECYCLE.join(' | ')})`);
273
+ }
274
+ else {
275
+ reg.ok && (reg.mode === 'full' || reg.mode === 'incremental')
276
+ ? pass(`register → 200 ok (${reg.mode}, ${reg.project?.eventCount ?? '?'} events)`)
277
+ : failed(`register response missing ok/mode: ${JSON.stringify(reg)}`);
278
+ }
279
+ // DURABLE FIRST: whichever shape answered, the registration must be visible IMMEDIATELY — it
280
+ // is persisted before catch-up, so a slow/failing chain RPC can never lose the add.
281
+ const listed = await authed.listProjects();
282
+ listed.some((p) => p.address?.toLowerCase() === address.toLowerCase())
283
+ ? pass('registration is visible on the list right after register (durable before catch-up)')
284
+ : failed('the project is NOT on GET /v1/projects right after register — the registration must be persisted before catch-up');
285
+ let status = await authed.projectStatus(chainId, address);
286
+ status.fromBlock !== undefined && 'toBlock' in status
287
+ ? pass(`status → fromBlock ${status.fromBlock}, toBlock ${status.toBlock}`)
288
+ : failed(`status response missing fromBlock/toBlock: ${JSON.stringify(status)}`);
289
+ LIFECYCLE.includes(status.status)
290
+ ? pass(`status → lifecycle '${status.status}'`)
291
+ : failed(`status.status is ${JSON.stringify(status.status)} (must be one of ${LIFECYCLE.join(' | ')})`);
292
+ if (!('headBlock' in status))
293
+ failed('status is missing headBlock — a client cannot compute lag / % complete without it');
294
+ else if (status.headBlock)
295
+ pass(`status → headBlock ${status.headBlock} (lag is computable)`);
296
+ else
297
+ note('status.headBlock is null — the field is there, but this service is not reporting head, so a client cannot show % complete');
298
+ // Poll to a terminal state, exactly as the CLI does. A service that defers catch-up must
299
+ // eventually reach `live` with nobody prompting it.
300
+ if (status.status !== 'live' && status.status !== 'failed') {
301
+ note(`'${status.status}' — polling to a terminal state…`);
302
+ try {
303
+ status = await authed.awaitIndexed(chainId, address, {
304
+ timeoutMs: opts.awaitTimeoutMs ?? 120_000,
305
+ intervalMs: opts.awaitIntervalMs ?? 2_000,
306
+ });
307
+ }
308
+ catch (err) {
309
+ failed(`never reached a terminal status: ${err.message}`);
310
+ }
311
+ }
312
+ status.status === 'live'
313
+ ? pass(`caught up → live (${status.eventCount} events, ${status.tokenCount} token(s))`)
314
+ : status.status === 'failed'
315
+ ? failed(`catch-up reported failed${status.error ? ` (${status.error.class})` : ''} — point address at a contract this service can replay`)
316
+ : note(`still '${status.status}' — not a conformance failure, but slower than this fixture waits`);
317
+ if (status.error && !['rpc_unavailable', 'rpc_rate_limited', 'not_abx_contract', 'internal'].includes(status.error.class)) {
318
+ failed(`error.class is ${JSON.stringify(status.error.class)} — must be one of the closed set`);
319
+ }
320
+ if (status.error?.message && /https?:\/\//.test(status.error.message)) {
321
+ failed('error.message contains a URL — it must be credential-free (a keyed RPC URL is a secret)');
322
+ }
323
+ // The accept path, on a project the service now actually serves: a referenced output's locator
324
+ // is recorded and served by REDIRECT — never proxied, so the producer's egress stays its own.
325
+ try {
326
+ const key = (await authed.publishEffectArtifact({
327
+ chainId,
328
+ address,
329
+ tokenId: '0',
330
+ inputsHash: ('0x' + 'ab'.repeat(32)),
331
+ output: 'image',
332
+ contentType: 'image/png',
333
+ locator: 'https://conformance.invalid/still.png',
334
+ })).key;
335
+ pass(`artifact registry accepted a referenced locator (key ${String(key).slice(0, 10)}…)`);
336
+ try {
337
+ const served = await fetch(`${base}/t/${chainId}/${address}/0/data/render/image`, { redirect: 'manual' });
338
+ if (served.status === 302 || served.status === 301)
339
+ pass(' …and the read plane 302-redirects to it (no proxying)');
340
+ else if (served.status === 404)
341
+ note(" the artifact route 404s — the row addresses a different inputsHash than this token's current one (self-invalidation working as designed)");
342
+ else
343
+ failed(` the artifact route answered ${served.status} — a registered locator MUST be served by redirect, never proxied`);
344
+ }
345
+ catch (err) {
346
+ note(`could not probe the artifact read route: ${err.message}`);
347
+ }
348
+ }
349
+ catch (err) {
350
+ if (scoped(err))
351
+ note("403 on artifact publish — the token isn't authorized to write artifacts (provider scoping)");
352
+ else
353
+ failed(`publishing a referenced locator failed: ${err.message}`);
354
+ }
355
+ const re = await authed.reindexProject(chainId, address);
356
+ re.ok ? pass(`reindex → ok (${re.accepted ? `202 ${re.project.status}` : re.mode})`) : failed(`reindex response missing ok: ${JSON.stringify(re)}`);
357
+ const { removed } = await authed.removeProject(chainId, address);
358
+ removed ? pass('deregister → removed') : failed('deregister reported not_registered for a project just registered');
359
+ const second = await authed.removeProject(chainId, address);
360
+ !second.removed ? pass('second deregister → not_registered (idempotent to retry)') : failed('second deregister claimed to remove again');
361
+ }
362
+ catch (err) {
363
+ if (scoped(err))
364
+ note(`403 during the loop — the token isn't authorized for ${address} (provider scoping; not a conformance failure)`);
365
+ else
366
+ failed(`register loop failed: ${err.message}`);
367
+ }
368
+ }
369
+ return { baseUrl: base, assertions, failures: assertions.filter((a) => a.status === 'fail').length };
370
+ }
371
+ //# sourceMappingURL=conformance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance.js","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAC,gBAAgB,EAAE,eAAe,EAAE,uBAAuB,EAAE,mBAAmB,EAA2C,MAAM,oBAAoB,CAAC;AAoC7J,MAAM,YAAY,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC3C,oGAAoG;AACpG,MAAM,SAAS,GAA2B,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE/F;qFACqF;AACrF,MAAM,UAAU,eAAe,CAAC,CAAY;IAC1C,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3E,OAAO,KAAK,MAAM,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACpC,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,WAAW,CAAC,MAAyB;IACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,QAAQ,2BAA2B,CAAC,CAAC,CAAC,kBAAkB,CAAC;AAClG,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAwB;IAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAgB,EAAE,CAAC;IACnC,MAAM,IA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C;IAED,OAAO,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,EAAC,CAAC;AACrG,CAAC"}
package/dist/deps.d.ts CHANGED
@@ -1,46 +1,13 @@
1
- import { type Address, type DependencyReadClient, type Hex, type ParsedDependencyRef, type RegistryDependencyDetails } from '@artblocks/abx-sdk';
1
+ /**
2
+ * The `--dep` flag grammar for `abx deploy-code` — the one CLI-local piece of the dependency
3
+ * lane. Everything downstream of a parsed ref (registry-pointer resolution, setup-multicall leg
4
+ * composition, the selection-time registry check) lives in `@artblocks/abx-sdk`'s `deps.ts`.
5
+ */
6
+ import { type ParsedDependencyRef } from '@artblocks/abx-sdk';
2
7
  /**
3
8
  * Parse the accumulated `--dep` flag value (repeats comma-join — see flags.ts — and each
4
9
  * value may itself be comma-separated) into ordered refs. Order is load-bearing: the first
5
10
  * ref becomes dependency index 0 — the runtime, by convention.
6
11
  */
7
12
  export declare function parseDepFlag(value: string | undefined): ParsedDependencyRef[];
8
- /**
9
- * The registry pointer a deploy with ≥1 Registry-resolution dep should set: an explicit
10
- * `--dep-registry` wins (validated), else the chain's known AB registry (env-overridable),
11
- * else none — the caller WARNS and skips the leg (soft pointer; the resolver falls back to
12
- * its built-in CDN map). Never a blocker.
13
- */
14
- export declare function resolveDepRegistryPointer(flagValue: string | undefined, chainId: number): {
15
- registry: Address | null;
16
- source: 'flag' | 'default' | 'none';
17
- };
18
- /**
19
- * The dependency legs of the setup multicall: one `setDependency(i, resolution, ref)` per
20
- * dep in index order, plus the `setDependencyRegistry` leg when a pointer resolved. These
21
- * ride the SAME atomic setup multicall as script chunks/schemas/mints, in every signing lane.
22
- */
23
- export declare function dependencySetupCalls(deps: ParsedDependencyRef[], registry: Address | null): Hex[];
24
- /** One dep's selection-time verdict (Registry-resolution deps only — OnChain refs never touch a registry). */
25
- export type DepCheck = {
26
- dep: string;
27
- status: 'found';
28
- details: RegistryDependencyDetails;
29
- } | {
30
- dep: string;
31
- status: 'not-found';
32
- } | {
33
- dep: string;
34
- status: 'skipped';
35
- };
36
- /**
37
- * Best-effort existence/on-chain-ness check of every Registry-resolution dep against the
38
- * pointer registry. A revert or an empty record ⇒ `not-found` (a warning — the owner may
39
- * intend a custom registry). A transport failure ⇒ the remaining checks are `skipped` and
40
- * `rpcOk: false` — one info line, never an error: the deploy proceeds regardless.
41
- */
42
- export declare function checkRegistryDeps(client: DependencyReadClient, registry: Address, deps: ParsedDependencyRef[]): Promise<{
43
- checks: DepCheck[];
44
- rpcOk: boolean;
45
- }>;
46
13
  //# sourceMappingURL=deps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAOA,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,GAAG,EACR,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,EAAE,CAW7E;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,MAAM,GACd;IAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;CAAC,CASjE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,GAAG,GAAG,EAAE,CAQjG;AAED,8GAA8G;AAC9G,MAAM,MAAM,QAAQ,GAChB;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,yBAAyB,CAAA;CAAC,GAClE;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAC,GAClC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC,CAAC;AAErC;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,mBAAmB,EAAE,GAC1B,OAAO,CAAC;IAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAC,CAAC,CAyB/C"}
1
+ {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAqB,KAAK,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,EAAE,CAW7E"}
package/dist/deps.js CHANGED
@@ -1,11 +1,9 @@
1
1
  /**
2
- * The deploy-time dependency lane for `abx deploy-code` — pure flag parsing, registry-pointer
3
- * defaulting, and setup-multicall leg composition (all unit-testable, no network), plus the
4
- * BEST-EFFORT selection-time registry check (an eth_call per Registry dep; never blocks a
5
- * deploy). See specs/protocol/dependency-registry.md — the pointer is soft and non-validating.
2
+ * The `--dep` flag grammar for `abx deploy-code` — the one CLI-local piece of the dependency
3
+ * lane. Everything downstream of a parsed ref (registry-pointer resolution, setup-multicall leg
4
+ * composition, the selection-time registry check) lives in `@artblocks/abx-sdk`'s `deps.ts`.
6
5
  */
7
- import { encodeFunctionData } from 'viem';
8
- import { DEP_RESOLUTION, parseDependencyRef, readRegistryDependency, resolveDependencyRegistry, seriesCodeAbi, } from '@artblocks/abx-sdk';
6
+ import { parseDependencyRef } from '@artblocks/abx-sdk';
9
7
  /**
10
8
  * Parse the accumulated `--dep` flag value (repeats comma-join — see flags.ts — and each
11
9
  * value may itself be comma-separated) into ordered refs. Order is load-bearing: the first
@@ -25,66 +23,4 @@ export function parseDepFlag(value) {
25
23
  .filter((s) => s && s.toLowerCase() !== 'none')
26
24
  .map(parseDependencyRef);
27
25
  }
28
- /**
29
- * The registry pointer a deploy with ≥1 Registry-resolution dep should set: an explicit
30
- * `--dep-registry` wins (validated), else the chain's known AB registry (env-overridable),
31
- * else none — the caller WARNS and skips the leg (soft pointer; the resolver falls back to
32
- * its built-in CDN map). Never a blocker.
33
- */
34
- export function resolveDepRegistryPointer(flagValue, chainId) {
35
- if (flagValue !== undefined) {
36
- if (flagValue === 'true' || !/^0x[0-9a-fA-F]{40}$/.test(flagValue)) {
37
- throw new Error(`--dep-registry must be an address (0x + 40 hex); got '${flagValue}'`);
38
- }
39
- return { registry: flagValue, source: 'flag' };
40
- }
41
- const known = resolveDependencyRegistry(chainId);
42
- return known ? { registry: known, source: 'default' } : { registry: null, source: 'none' };
43
- }
44
- /**
45
- * The dependency legs of the setup multicall: one `setDependency(i, resolution, ref)` per
46
- * dep in index order, plus the `setDependencyRegistry` leg when a pointer resolved. These
47
- * ride the SAME atomic setup multicall as script chunks/schemas/mints, in every signing lane.
48
- */
49
- export function dependencySetupCalls(deps, registry) {
50
- const calls = deps.map((d, i) => encodeFunctionData({ abi: seriesCodeAbi, functionName: 'setDependency', args: [BigInt(i), d.resolution, d.ref] }));
51
- if (deps.length && registry) {
52
- calls.push(encodeFunctionData({ abi: seriesCodeAbi, functionName: 'setDependencyRegistry', args: [registry] }));
53
- }
54
- return calls;
55
- }
56
- /**
57
- * Best-effort existence/on-chain-ness check of every Registry-resolution dep against the
58
- * pointer registry. A revert or an empty record ⇒ `not-found` (a warning — the owner may
59
- * intend a custom registry). A transport failure ⇒ the remaining checks are `skipped` and
60
- * `rpcOk: false` — one info line, never an error: the deploy proceeds regardless.
61
- */
62
- export async function checkRegistryDeps(client, registry, deps) {
63
- const registryDeps = deps.filter((d) => d.resolution === DEP_RESOLUTION.registry);
64
- const checks = [];
65
- let rpcOk = true;
66
- for (const d of registryDeps) {
67
- if (!rpcOk) {
68
- checks.push({ dep: d.display, status: 'skipped' });
69
- continue;
70
- }
71
- try {
72
- const details = await readRegistryDependency(client, registry, d.ref);
73
- checks.push(details ? { dep: d.display, status: 'found', details } : { dep: d.display, status: 'not-found' });
74
- }
75
- catch (e) {
76
- // A contract revert means the registry answered "no such dependency"; anything else
77
- // (DNS, timeout, HTTP) means we couldn't ask — degrade to skipped, not failed.
78
- const msg = `${e.name ?? ''} ${e.message ?? ''}`;
79
- if (/ContractFunction|revert|returned no data/i.test(msg)) {
80
- checks.push({ dep: d.display, status: 'not-found' });
81
- }
82
- else {
83
- rpcOk = false;
84
- checks.push({ dep: d.display, status: 'skipped' });
85
- }
86
- }
87
- }
88
- return { checks, rpcOk };
89
- }
90
26
  //# sourceMappingURL=deps.js.map
package/dist/deps.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAC,kBAAkB,EAAC,MAAM,MAAM,CAAC;AACxC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,aAAa,GAMd,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAyB;IACpD,IAAI,KAAK,KAAK,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;IAC5H,4FAA4F;IAC5F,mGAAmG;IACnG,8FAA8F;IAC9F,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;SACvB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC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AAC;gBAC1D,MAAM,CAAC,IAAI,CAAC,EAAC,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAC,CAAC,CAAC;YACrD,CAAC;iBAAM,CAAC;gBACN,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM,CAAC,IAAI,CAAC,EAAC,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAC,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,CAAC;AACzB,CAAC"}
1
+ {"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,kBAAkB,EAA2B,MAAM,oBAAoB,CAAC;AAEhF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAyB;IACpD,IAAI,KAAK,KAAK,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;IAC5H,4FAA4F;IAC5F,mGAAmG;IACnG,8FAA8F;IAC9F,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;SACvB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;SAC9C,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The one error type a command throws when it needs to abort with a specific exit code (phase 3's
3
+ * one-exit-discipline: no command body calls `process.exit()` mid-flow — a LOCAL failure sets
4
+ * `process.exitCode` and returns; a DEEP failure that needs to unwind through several calls throws).
5
+ *
6
+ * A plain `Error` still works everywhere (the top-level catch in main.ts prints `.message` with the
7
+ * same `✗` prefix either way) — `CliError` adds two opt-ins:
8
+ * - `exitCode`, for the rare case that isn't 1.
9
+ * - `alreadyPrinted`, for a validation helper (e.g. ownerops.ts's `requireAddress`/`requireFlag`)
10
+ * that has a non-`void` return type and so can't just set `exitCode` and `return` — it has to
11
+ * `throw` to make the "unreachable after this" true to the type checker, but it already printed
12
+ * its own usage text via `console.error` BEFORE this existed and that text doesn't have (and must
13
+ * not gain) the generic catch's `✗` prefix. The top-level catch skips its own printing for these.
14
+ */
15
+ export declare class CliError extends Error {
16
+ readonly exitCode: number;
17
+ readonly alreadyPrinted: boolean;
18
+ constructor(message: string, exitCode?: number, alreadyPrinted?: boolean);
19
+ }
20
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;gBAErB,OAAO,EAAE,MAAM,EAAE,QAAQ,SAAI,EAAE,cAAc,UAAQ;CAMlE"}
package/dist/errors.js ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The one error type a command throws when it needs to abort with a specific exit code (phase 3's
3
+ * one-exit-discipline: no command body calls `process.exit()` mid-flow — a LOCAL failure sets
4
+ * `process.exitCode` and returns; a DEEP failure that needs to unwind through several calls throws).
5
+ *
6
+ * A plain `Error` still works everywhere (the top-level catch in main.ts prints `.message` with the
7
+ * same `✗` prefix either way) — `CliError` adds two opt-ins:
8
+ * - `exitCode`, for the rare case that isn't 1.
9
+ * - `alreadyPrinted`, for a validation helper (e.g. ownerops.ts's `requireAddress`/`requireFlag`)
10
+ * that has a non-`void` return type and so can't just set `exitCode` and `return` — it has to
11
+ * `throw` to make the "unreachable after this" true to the type checker, but it already printed
12
+ * its own usage text via `console.error` BEFORE this existed and that text doesn't have (and must
13
+ * not gain) the generic catch's `✗` prefix. The top-level catch skips its own printing for these.
14
+ */
15
+ export class CliError extends Error {
16
+ exitCode;
17
+ alreadyPrinted;
18
+ constructor(message, exitCode = 1, alreadyPrinted = false) {
19
+ super(message);
20
+ this.name = 'CliError';
21
+ this.exitCode = exitCode;
22
+ this.alreadyPrinted = alreadyPrinted;
23
+ }
24
+ }
25
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,QAAQ,CAAS;IACjB,cAAc,CAAU;IAEjC,YAAY,OAAe,EAAE,QAAQ,GAAG,CAAC,EAAE,cAAc,GAAG,KAAK;QAC/D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;CACF"}