@artblocks/abx-cli 0.1.0-alpha.6 → 0.1.0-alpha.61

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 (193) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/assets/renderer-scaffold/README.md +41 -11
  3. package/assets/renderer-scaffold/foundry.toml +5 -0
  4. package/assets/renderer-scaffold/remappings.txt +1 -1
  5. package/assets/renderer-scaffold/script/DeployHooks.s.sol +24 -0
  6. package/assets/renderer-scaffold/script/Preview.s.sol +99 -0
  7. package/assets/renderer-scaffold/src/MyHooks.sol +20 -0
  8. package/assets/renderer-scaffold/src/MyRenderer.sol +4 -4
  9. package/assets/renderer-scaffold/src/MyTraits.sol +2 -2
  10. package/assets/renderer-scaffold/test/MyRenderer.t.sol +60 -3
  11. package/dist/bin.d.ts +26 -0
  12. package/dist/bin.d.ts.map +1 -0
  13. package/dist/bin.js +63 -0
  14. package/dist/bin.js.map +1 -0
  15. package/dist/capabilities.d.ts +126 -0
  16. package/dist/capabilities.d.ts.map +1 -0
  17. package/dist/capabilities.js +168 -0
  18. package/dist/capabilities.js.map +1 -0
  19. package/dist/commands/auth.d.ts +54 -0
  20. package/dist/commands/auth.d.ts.map +1 -0
  21. package/dist/commands/auth.js +447 -0
  22. package/dist/commands/auth.js.map +1 -0
  23. package/dist/commands/deploy.d.ts +293 -0
  24. package/dist/commands/deploy.d.ts.map +1 -0
  25. package/dist/commands/deploy.js +5624 -0
  26. package/dist/commands/deploy.js.map +1 -0
  27. package/dist/commands/feedback.d.ts +7 -0
  28. package/dist/commands/feedback.d.ts.map +1 -0
  29. package/dist/commands/feedback.js +147 -0
  30. package/dist/commands/feedback.js.map +1 -0
  31. package/dist/commands/maintenance.d.ts +4 -0
  32. package/dist/commands/maintenance.d.ts.map +1 -0
  33. package/dist/commands/maintenance.js +114 -0
  34. package/dist/commands/maintenance.js.map +1 -0
  35. package/dist/commands/project.d.ts +458 -0
  36. package/dist/commands/project.d.ts.map +1 -0
  37. package/dist/commands/project.js +1832 -0
  38. package/dist/commands/project.js.map +1 -0
  39. package/dist/commands/reads.d.ts +85 -0
  40. package/dist/commands/reads.d.ts.map +1 -0
  41. package/dist/commands/reads.js +881 -0
  42. package/dist/commands/reads.js.map +1 -0
  43. package/dist/commands/scaffold.d.ts +89 -0
  44. package/dist/commands/scaffold.d.ts.map +1 -0
  45. package/dist/commands/scaffold.js +738 -0
  46. package/dist/commands/scaffold.js.map +1 -0
  47. package/dist/commands/service.d.ts +67 -0
  48. package/dist/commands/service.d.ts.map +1 -0
  49. package/dist/commands/service.js +760 -0
  50. package/dist/commands/service.js.map +1 -0
  51. package/dist/commands/storage.d.ts +51 -0
  52. package/dist/commands/storage.d.ts.map +1 -0
  53. package/dist/commands/storage.js +399 -0
  54. package/dist/commands/storage.js.map +1 -0
  55. package/dist/commands/submit-app.d.ts +102 -0
  56. package/dist/commands/submit-app.d.ts.map +1 -0
  57. package/dist/commands/submit-app.js +638 -0
  58. package/dist/commands/submit-app.js.map +1 -0
  59. package/dist/config.d.ts +94 -2
  60. package/dist/config.d.ts.map +1 -1
  61. package/dist/config.js +332 -12
  62. package/dist/config.js.map +1 -1
  63. package/dist/conformance.d.ts +31 -0
  64. package/dist/conformance.d.ts.map +1 -0
  65. package/dist/conformance.js +390 -0
  66. package/dist/conformance.js.map +1 -0
  67. package/dist/contract-read-error.d.ts +5 -0
  68. package/dist/contract-read-error.d.ts.map +1 -0
  69. package/dist/contract-read-error.js +37 -0
  70. package/dist/contract-read-error.js.map +1 -0
  71. package/dist/creator-agent.d.ts +40 -0
  72. package/dist/creator-agent.d.ts.map +1 -0
  73. package/dist/creator-agent.js +206 -0
  74. package/dist/creator-agent.js.map +1 -0
  75. package/dist/creator-signer.d.ts +37 -0
  76. package/dist/creator-signer.d.ts.map +1 -0
  77. package/dist/creator-signer.js +203 -0
  78. package/dist/creator-signer.js.map +1 -0
  79. package/dist/deploy-plan.d.ts +218 -0
  80. package/dist/deploy-plan.d.ts.map +1 -0
  81. package/dist/deploy-plan.js +20 -0
  82. package/dist/deploy-plan.js.map +1 -0
  83. package/dist/deps.d.ts +6 -39
  84. package/dist/deps.d.ts.map +1 -1
  85. package/dist/deps.js +4 -68
  86. package/dist/deps.js.map +1 -1
  87. package/dist/errors.d.ts +22 -0
  88. package/dist/errors.d.ts.map +1 -0
  89. package/dist/errors.js +32 -0
  90. package/dist/errors.js.map +1 -0
  91. package/dist/flag-allowlists.d.ts +53 -0
  92. package/dist/flag-allowlists.d.ts.map +1 -0
  93. package/dist/flag-allowlists.js +185 -0
  94. package/dist/flag-allowlists.js.map +1 -0
  95. package/dist/flags.d.ts +53 -0
  96. package/dist/flags.d.ts.map +1 -1
  97. package/dist/flags.js +151 -1
  98. package/dist/flags.js.map +1 -1
  99. package/dist/jsonout.d.ts +37 -0
  100. package/dist/jsonout.d.ts.map +1 -0
  101. package/dist/jsonout.js +79 -0
  102. package/dist/jsonout.js.map +1 -0
  103. package/dist/kind.d.ts +57 -0
  104. package/dist/kind.d.ts.map +1 -0
  105. package/dist/kind.js +122 -0
  106. package/dist/kind.js.map +1 -0
  107. package/dist/main.js +837 -5213
  108. package/dist/main.js.map +1 -1
  109. package/dist/mintpage.d.ts +17 -2
  110. package/dist/mintpage.d.ts.map +1 -1
  111. package/dist/mintpage.js +241 -54
  112. package/dist/mintpage.js.map +1 -1
  113. package/dist/output.d.ts +184 -0
  114. package/dist/output.d.ts.map +1 -0
  115. package/dist/output.js +774 -0
  116. package/dist/output.js.map +1 -0
  117. package/dist/ownerops.d.ts +450 -57
  118. package/dist/ownerops.d.ts.map +1 -1
  119. package/dist/ownerops.js +2229 -378
  120. package/dist/ownerops.js.map +1 -1
  121. package/dist/preview.d.ts +23 -5
  122. package/dist/preview.d.ts.map +1 -1
  123. package/dist/preview.js +95 -43
  124. package/dist/preview.js.map +1 -1
  125. package/dist/provision.d.ts +3 -13
  126. package/dist/provision.d.ts.map +1 -1
  127. package/dist/provision.js +19 -21
  128. package/dist/provision.js.map +1 -1
  129. package/dist/remote.d.ts +165 -52
  130. package/dist/remote.d.ts.map +1 -1
  131. package/dist/remote.js +459 -46
  132. package/dist/remote.js.map +1 -1
  133. package/dist/riskgate.d.ts +101 -0
  134. package/dist/riskgate.d.ts.map +1 -0
  135. package/dist/riskgate.js +326 -0
  136. package/dist/riskgate.js.map +1 -0
  137. package/dist/scaffold.d.ts +12 -0
  138. package/dist/scaffold.d.ts.map +1 -0
  139. package/dist/scaffold.js +56 -0
  140. package/dist/scaffold.js.map +1 -0
  141. package/dist/schema.d.ts +36 -1
  142. package/dist/schema.d.ts.map +1 -1
  143. package/dist/schema.js +121 -26
  144. package/dist/schema.js.map +1 -1
  145. package/dist/script-chunks.d.ts +8 -0
  146. package/dist/script-chunks.d.ts.map +1 -0
  147. package/dist/script-chunks.js +35 -0
  148. package/dist/script-chunks.js.map +1 -0
  149. package/dist/served.d.ts +30 -0
  150. package/dist/served.d.ts.map +1 -0
  151. package/dist/served.js +112 -0
  152. package/dist/served.js.map +1 -0
  153. package/dist/signer.d.ts +18 -1
  154. package/dist/signer.d.ts.map +1 -1
  155. package/dist/signer.js +104 -17
  156. package/dist/signer.js.map +1 -1
  157. package/dist/update-check.d.ts +55 -1
  158. package/dist/update-check.d.ts.map +1 -1
  159. package/dist/update-check.js +103 -10
  160. package/dist/update-check.js.map +1 -1
  161. package/package.json +16 -12
  162. package/skill/SKILL.md +194 -347
  163. package/skill/agents/openai.yaml +4 -0
  164. package/skill/reference/capabilities.md +193 -0
  165. package/skill/reference/code.md +234 -0
  166. package/skill/reference/creator-token.md +94 -0
  167. package/skill/reference/deploy.md +177 -0
  168. package/skill/reference/diagnose.md +178 -0
  169. package/skill/reference/hosting.md +188 -93
  170. package/skill/reference/operate.md +232 -0
  171. package/skill/reference/services.md +161 -0
  172. package/skill/reference/setup.md +190 -36
  173. package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +0 -32
  174. package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +0 -26
  175. package/dist/inspect.d.ts +0 -48
  176. package/dist/inspect.d.ts.map +0 -1
  177. package/dist/inspect.js +0 -184
  178. package/dist/inspect.js.map +0 -1
  179. package/dist/migrate.d.ts +0 -65
  180. package/dist/migrate.d.ts.map +0 -1
  181. package/dist/migrate.js +0 -180
  182. package/dist/migrate.js.map +0 -1
  183. package/dist/onchain-uri.d.ts +0 -97
  184. package/dist/onchain-uri.d.ts.map +0 -1
  185. package/dist/onchain-uri.js +0 -243
  186. package/dist/onchain-uri.js.map +0 -1
  187. package/dist/upload.d.ts +0 -28
  188. package/dist/upload.d.ts.map +0 -1
  189. package/dist/upload.js +0 -41
  190. package/dist/upload.js.map +0 -1
  191. package/skill/reference/code-projects.md +0 -246
  192. package/skill/reference/operating.md +0 -116
  193. package/skill/reference/troubleshooting.md +0 -28
@@ -0,0 +1,218 @@
1
+ /**
2
+ * The structured `--dry-run --json` / `--json` deploy plan.
3
+ *
4
+ * The JSON payload and human prose are rendered from the same values but remain separate surfaces.
5
+ * Deploy is a high-stakes command family (real gas, address pinning, salt reservation), its exact
6
+ * dry-run prose is covered extensively, and the end-user skill depends on that prose. This module
7
+ * therefore provides a versioned, typed object populated from the SAME locals `commands/deploy.ts`
8
+ * uses for human narration at every `emit(jsonSafe({...}))` call site.
9
+ *
10
+ * A field a lane genuinely has no answer for is explicit `null`, never silently absent — that
11
+ * distinction (present-but-empty vs. not-applicable-here) is the whole point of a schema. See each
12
+ * `deploy.ts` call site for the specific reasoning behind its nulls.
13
+ */
14
+ import type { Address } from '@artblocks/abx-sdk';
15
+ /** Bump whenever a field is added, renamed, or reinterpreted — a consumer keys behavior off this,
16
+ * not off the CLI's own package version (that changes for reasons unrelated to this shape).
17
+ *
18
+ * `as const` is load-bearing, not decoration: a plain `= 1` is a WIDENING literal, so the moment it
19
+ * is read into an un-annotated intermediate object (the resume lane builds one and spreads it into
20
+ * several emits) the property degrades to `number` and stops satisfying `DeployPlan`. Keep it.
21
+ *
22
+ * v2 (this change): added `custody.renderer` and `custody.image`; reinterpreted `transactions.legs`
23
+ * to end with `'deploy'` whenever it is non-null (previously silent about the deploy tx itself —
24
+ * see each field's own doc comment). A consumer keying behavior off `legs`' shape needs to know
25
+ * which version it's reading. */
26
+ export declare const DEPLOY_PLAN_SCHEMA_VERSION: 2;
27
+ /** The six product lanes `deploy.ts` implements — a stable discriminator independent of the legacy
28
+ * `command`/`kind` fields already on the payload (which exist for backward compat and don't fully
29
+ * agree with each other across lanes: `kind: 'edition-code'` vs. this union's `'code-edition'`). */
30
+ export type DeployPlanFamily = '1of1' | '1of1-edition' | 'series' | 'series-edition' | 'code' | 'code-edition';
31
+ /** The signing lanes `laneFromFlags` resolves to, reused verbatim. */
32
+ export type DeployPlanLane = 'send' | 'sign' | 'sponsor' | 'unsigned';
33
+ export interface DeployPlanTransactions {
34
+ /** Wallet TX SIGNATURES this run needs — the exact same count the lane's own dry-run/confirm
35
+ * "approvals" line reports (an off-chain storage upload is a separate signature class, never
36
+ * counted here — see the `approvals` local at each call site). */
37
+ approvals: number;
38
+ /**
39
+ * The ordered, NAMED stages this run signs, ending with `'deploy'` itself — e.g.
40
+ * `['onchain-image-staging', 'deploy']` for an image lane staging bytes into the chunk store first,
41
+ * or `['chunks', 'param-schemas', 'dependencies', 'onchain-uri', 'mints', 'deploy']` for a code
42
+ * project whose setup rides one or more gas-bounded transactions ahead of the deploy tx. `null`
43
+ * when the deploy is a single, self-contained transaction with no named stage worth calling out.
44
+ *
45
+ * A stage name is a GROUP, not a 1:1 tx count: `'chunks'`/`'onchain-image-staging'` can be one
46
+ * atomic write or SEVERAL gas-bounded batch transactions (a 60KB+ script's setup, in particular —
47
+ * see `commands/deploy.ts`'s `planCodeSetupBatches`), and `approvals` is what reports the real
48
+ * total signature count — `legs.length` never needs to equal `approvals`. The one invariant this
49
+ * schema DOES hold: `legs === null` iff `approvals` is exactly the trivial case for that lane (1 for
50
+ * a fresh deploy with nothing riding ahead of it; the resume lane's own fixed count when everything
51
+ * is already done) — i.e. non-null legs always means "something happens beyond the bare minimum."
52
+ *
53
+ * EXCEPTION: the `--resume` lane never deploys (the contract already exists), so its legs name only
54
+ * the groups riding the setup transaction(s) it sends (one or more, gas-bounded, same as a fresh
55
+ * deploy) and never include `'deploy'` — see the `resumeLegs` call sites in `commands/deploy.ts` for
56
+ * why that lane's unit model differs.
57
+ */
58
+ legs: string[] | null;
59
+ }
60
+ export interface DeployPlanRoles {
61
+ /** The address that signs this deploy. `null` only when genuinely unknown yet (a dry run with no
62
+ * `--for` and no resolvable wallet key — the plan is still previewable; just not addressed to
63
+ * anyone in particular). */
64
+ signer: string | null;
65
+ /** Always equal to `signer` in this codebase — every lane sets `owner: deployer` — carried as its
66
+ * own field because a consumer reasoning about roles shouldn't have to know that fact. */
67
+ owner: string | null;
68
+ royaltyReceiver: string | null;
69
+ /** `null` when no `--primary-payee` was given (sale proceeds go to the owner) — the lanes with no
70
+ * concept of a delegated payee at all (the plain 1/1) also report `null` here. */
71
+ primaryPayee: string | null;
72
+ /** `null` when no `--minter` was given (only the owner can mint) — same "no concept" case as
73
+ * `primaryPayee` on the plain 1/1 lane. */
74
+ minter: string | null;
75
+ }
76
+ export interface DeployPlanRoyalty {
77
+ bps: number;
78
+ capBps: number;
79
+ burnable: boolean;
80
+ }
81
+ export interface DeployPlanCustody {
82
+ /** Does `tokenURI`/`contractURI` (or `uri`/`contractURI` on an edition) resolve on-chain via the
83
+ * canonical renderer, vs. through a resolver base baked on-chain. */
84
+ onChainUri: boolean;
85
+ /** Are the IMAGE bytes themselves on-chain (a chunk-store `reader` field) — distinct from
86
+ * `onChainUri`, which only says the metadata JSON resolves on-chain (see deploy.ts's own
87
+ * "puts the metadata JSON on-chain, not the image" warning). `null` on the code lanes, where an
88
+ * image is one of several independently-disposed surfaces — see `surfaces.thumbnail` instead. */
89
+ imageOnChain: boolean | null;
90
+ /** The off-chain storage backend holding bytes this deploy custodies (e.g. `ipfs`, `arweave`,
91
+ * `fs`) — `null` when nothing is stored off-chain (fully on-chain content, or a code project
92
+ * whose script chunks are on-chain and carries no directory build). */
93
+ backend: string | null;
94
+ /** The on-chain `tokenURIBase`/`contractURIBase` this deploy writes — `null`, not `''`, when the
95
+ * lane deliberately leaves it empty because the on-chain renderer is authoritative (baking a
96
+ * base anyway would be misleading: nothing ever reads it while a renderer is set). */
97
+ tokenUriBase: string | null;
98
+ contractUriBase: string | null;
99
+ /** The on-chain renderer address serving `tokenURI`/`contractURI` — the SAME address the "On-chain
100
+ * renderer" step already prints (`would use renderer 0x…` on a dry run, `using renderer 0x…` on a
101
+ * real send). The zero address there means "would deploy the canonical renderer fresh," never
102
+ * "no renderer" — a consumer reading this field needs the same caveat the prose carries. `null`
103
+ * when `onChainUri` is false: off-chain custody has no renderer question to answer. On a
104
+ * `--resume` emit this is always `null` too — the renderer is an InitParams field fixed at the
105
+ * ORIGINAL deploy (like `royalty`/`mint`, see their own doc comments), and a resume doesn't
106
+ * re-read or re-decide it here. */
107
+ renderer: Address | null;
108
+ /** File-level facts about the `--onchain-image` bytes THIS deploy stages, read locally (no chain
109
+ * call) from the exact path `--image` names — `null` unless `imageOnChain` is `true` on a lane
110
+ * that stages a SINGLE file (the 1/1 and 1/1-edition lanes). `null` on `series`/`series-edition`
111
+ * too even when `imageOnChain` is `true` there: those lanes stage ONE FILE PER TOKEN, so no
112
+ * single-file shape fits — the per-token detail is prose-only today (see the `previewImageStaging`
113
+ * loop in `commands/deploy.ts`). */
114
+ image: DeployPlanImageFile | null;
115
+ }
116
+ export interface DeployPlanImageFile {
117
+ /** Raw size of the file on disk, in bytes — the same number the "Stage on-chain image" step's
118
+ * `NNNB → …` line already prints. */
119
+ bytes: number;
120
+ /** Size after the staging plan's chunking/compression (`--compress fastlz` shrinks per chunk;
121
+ * `gzip` shrinks the whole file; `none` leaves it unchanged) — the same number that line's
122
+ * `[fastlz NNN→MMMB]` bracket already prints. */
123
+ stagedBytes: number;
124
+ /** MIME type sniffed from the file's extension (the same `contentTypeFromPath` helper every other
125
+ * content-type-aware line in this file uses) — not itself printed by the staging preview line,
126
+ * but a deterministic fact about the exact file already opened for that preview, computed locally
127
+ * with no chain read, so reporting it costs nothing and fabricates nothing. */
128
+ mimeType: string;
129
+ /** keccak256 of the RAW (pre-compression) file bytes. This is NOT an on-chain commitment — a
130
+ * reader-backed on-chain image has none; the bytes themselves ARE the on-chain content, so there
131
+ * is nothing to commit to separately. It is a content-addressing fact about the LOCAL file,
132
+ * computed the same way (no chain read) for a `--json` consumer that wants to verify provenance
133
+ * later against what actually got staged. */
134
+ contentHash: string;
135
+ }
136
+ export interface DeployPlanMint {
137
+ /** True when nothing mints at deploy (mint later, or via a delegated minter/sale). */
138
+ deferred: boolean;
139
+ /** How many distinct tokens/ids mint at deploy — `0` when deferred. */
140
+ count: number;
141
+ /** Copies PER id (edition lanes only) — `null` on a unique-token lane, where the concept doesn't
142
+ * exist (every id is exactly one copy by construction). A bigint, stringified (see jsonSafe). */
143
+ amountPerId: string | null;
144
+ recipient: string | null;
145
+ }
146
+ export interface DeployPlanEstimate {
147
+ /**
148
+ * A rough, hedged order-of-magnitude ETH/gas figure for THIS deploy's on-chain write cost.
149
+ *
150
+ * `null` is not "not implemented yet" here — it is the honest answer on every lane that genuinely
151
+ * computes no such number today, including the image lanes' `--onchain-image` staging (1/1,
152
+ * 1/1-edition, series, series-edition all skip this: verified directly — none of them prices gas or
153
+ * prints an "est. on-chain cost" line anywhere on the dry-run path). The ONE lane that does compute
154
+ * and print one is the fresh `code` family's on-chain-byte-storage guidance (a best-effort
155
+ * `~200 gas/byte` heuristic priced at the live gas price, wrapped in a try/catch that skips silently
156
+ * if the RPC can't price gas) — see the `planEstimate` local in `commands/deploy.ts`.
157
+ *
158
+ * This field NEVER re-derives or newly computes a number for the plan — it only carries over the
159
+ * exact estimate the human readout already printed. Do not extend this to a lane that doesn't
160
+ * already print one without saying so explicitly wherever that change is made: an estimate implies
161
+ * an RPC gas-price read, which is a new class of work for a dry run that today makes none.
162
+ */
163
+ ethApprox: string | null;
164
+ gasApprox: string | null;
165
+ }
166
+ export interface DeployPlanSurface {
167
+ ok: boolean;
168
+ detail: string;
169
+ }
170
+ /** The code lane's "every marketplace-facing dimension, resolved now" block — `null` on every other
171
+ * lane (an image lane's thumbnail is fully covered by `custody`; it has no separate traits/postParam
172
+ * disposition to report). */
173
+ export interface DeployPlanSurfaces {
174
+ thumbnail: DeployPlanSurface;
175
+ traits: DeployPlanSurface;
176
+ postParams: DeployPlanSurface;
177
+ }
178
+ /** `null` on the image lanes, which have no dependency-registry concept. */
179
+ export interface DeployPlanDependencies {
180
+ count: number;
181
+ registry: string | null;
182
+ }
183
+ /** Present only on a `deploy-code --resume` emit — `null` on a fresh deploy. */
184
+ export interface DeployPlanResume {
185
+ target: string;
186
+ sentLegs: number;
187
+ complete: boolean;
188
+ }
189
+ export interface DeployPlan {
190
+ schemaVersion: typeof DEPLOY_PLAN_SCHEMA_VERSION;
191
+ family: DeployPlanFamily;
192
+ lane: DeployPlanLane;
193
+ transactions: DeployPlanTransactions;
194
+ roles: DeployPlanRoles;
195
+ /** `null` on a `--resume` emit: royalty is an InitParams field fixed at the ORIGINAL deploy, and a
196
+ * resume never touches it — reporting the flags passed to `--resume` here would misleadingly
197
+ * imply this run writes them. */
198
+ royalty: DeployPlanRoyalty | null;
199
+ custody: DeployPlanCustody;
200
+ /** `null` on a `--resume` emit — see the field's own module doc for why the mint plan isn't
201
+ * cleanly reducible to one shape there (edition resume mints are a PER-ID list, not a count). */
202
+ mint: DeployPlanMint | null;
203
+ estimate: DeployPlanEstimate;
204
+ /** Every `warn()` line this invocation raised, ANSI-stripped, in print order — see
205
+ * `beginPlanWarnings`/the local `warn` wrapper in deploy.ts. Not exhaustive of every warning this
206
+ * FILE can print (a trust-anchor bootstrap warning from `output.ts`'s `ensureFactory`/etc. isn't
207
+ * captured — those only fire on a real send that also stands up a fresh trust anchor, and are
208
+ * file-scoped to a different module), but covers every warning the LANE ITSELF raises, which is
209
+ * what a dry-run consumer cares about. */
210
+ warnings: string[];
211
+ surfaces: DeployPlanSurfaces | null;
212
+ dependencies: DeployPlanDependencies | null;
213
+ resume: DeployPlanResume | null;
214
+ }
215
+ /** Strip the tiny ANSI color wrappers (`bold`/`dim`/`g` from output.ts) so a warning captured for the
216
+ * plan reads as plain text — a JSON consumer has no terminal to render escape codes against. */
217
+ export declare function stripAnsiForPlan(s: string): string;
218
+ //# sourceMappingURL=deploy-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-plan.d.ts","sourceRoot":"","sources":["../src/deploy-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;;;;kCAUkC;AAClC,eAAO,MAAM,0BAA0B,EAAG,CAAU,CAAC;AAErD;;qGAEqG;AACrG,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,cAAc,GAAG,QAAQ,GAAG,gBAAgB,GAAG,MAAM,GAAG,cAAc,CAAC;AAE/G,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAEtE,MAAM,WAAW,sBAAsB;IACrC;;uEAEmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B;;iCAE6B;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;+FAC2F;IAC3F,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;uFACmF;IACnF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;gDAC4C;IAC5C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,i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kBAAkB;IACjC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,UAAU,EAAE,iBAAiB,CAAC;CAC/B;AAED,4EAA4E;AAC5E,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,OAAO,0BAA0B,CAAC;IACjD,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,sBAAsB,CAAC;IACrC,KAAK,EAAE,eAAe,CAAC;IACvB;;sCAEkC;IAClC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,iBAAiB,CAAC;IAC3B;sGACkG;IAClG,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;;;+CAK2C;IAC3C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACpC,YAAY,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC5C,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACjC;AAKD;iGACiG;AACjG,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD"}
@@ -0,0 +1,20 @@
1
+ /** Bump whenever a field is added, renamed, or reinterpreted — a consumer keys behavior off this,
2
+ * not off the CLI's own package version (that changes for reasons unrelated to this shape).
3
+ *
4
+ * `as const` is load-bearing, not decoration: a plain `= 1` is a WIDENING literal, so the moment it
5
+ * is read into an un-annotated intermediate object (the resume lane builds one and spreads it into
6
+ * several emits) the property degrades to `number` and stops satisfying `DeployPlan`. Keep it.
7
+ *
8
+ * v2 (this change): added `custody.renderer` and `custody.image`; reinterpreted `transactions.legs`
9
+ * to end with `'deploy'` whenever it is non-null (previously silent about the deploy tx itself —
10
+ * see each field's own doc comment). A consumer keying behavior off `legs`' shape needs to know
11
+ * which version it's reading. */
12
+ export const DEPLOY_PLAN_SCHEMA_VERSION = 2;
13
+ // eslint-disable-next-line no-control-regex
14
+ const ANSI = /\x1b\[[0-9;]*m/g;
15
+ /** Strip the tiny ANSI color wrappers (`bold`/`dim`/`g` from output.ts) so a warning captured for the
16
+ * plan reads as plain text — a JSON consumer has no terminal to render escape codes against. */
17
+ export function stripAnsiForPlan(s) {
18
+ return s.replace(ANSI, '');
19
+ }
20
+ //# sourceMappingURL=deploy-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-plan.js","sourceRoot":"","sources":["../src/deploy-plan.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;kCAUkC;AAClC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAU,CAAC;AA4MrD,4CAA4C;AAC5C,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAE/B;iGACiG;AACjG,MAAM,UAAU,gBAAgB,CAAC,CAAS;IACxC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC7B,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,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AAC;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
  //#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B;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,22 @@
1
+ /**
2
+ * The one error type a command throws when it needs to abort with a specific exit code. No command
3
+ * 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
+ /** Mark a completed batch command as failed when any item failed, while preserving command cleanup. */
21
+ export declare function markBatchFailure(failed: number): boolean;
22
+ //# 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;AAED,uGAAuG;AACvG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAIxD"}
package/dist/errors.js ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The one error type a command throws when it needs to abort with a specific exit code. No command
3
+ * 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
+ /** Mark a completed batch command as failed when any item failed, while preserving command cleanup. */
26
+ export function markBatchFailure(failed) {
27
+ if (failed <= 0)
28
+ return false;
29
+ process.exitCode = 1;
30
+ return true;
31
+ }
32
+ //# 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;AAED,uGAAuG;AACvG,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACrB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Per-command flag allowlists — the one place that knows which flags each command accepts, so the
3
+ * dispatcher can surface a typo'd or unsupported flag instead of silently ignoring it.
4
+ *
5
+ * WHY THIS FILE EXISTS, and why the obvious shortcut doesn't work
6
+ * --------------------------------------------------------------
7
+ * The CLI used to have three different behaviors for an unrecognized flag: `deploy*` REFUSED,
8
+ * `preview`/`tokens`/`storage status`/`attach` WARNED, and ~35 other commands said nothing at all —
9
+ * so `abx set-royalty --bsp 500` or `abx minter buy --quantiy 5` did something quietly different from
10
+ * what was asked. That silence is the worst failure mode the CLI has, because the creator's next
11
+ * action is to believe it worked.
12
+ *
13
+ * The tempting fix is to DERIVE each allowlist from the `usage` string every command already declares.
14
+ * An audit of all ~45 commands says that would be actively harmful: several shared helpers read flags
15
+ * that appear in NO usage string anywhere. `storageOverrides()` reads twelve
16
+ * (`--backend`, `--gateway`, `--public-base`, `--storage-signer`, …) and is pulled in by `add`,
17
+ * `render`, `effects`, `migrate`, `storage upload`, and `storage balance|topup`; `--remote-token` is
18
+ * read by `index`, `verify`, `forget`, `status`, and `migrate`. A usage-derived allowlist would warn on
19
+ * every one of those — a false warning on a VALID flag, which is worse than the silence it replaces,
20
+ * because a notice people learn to distrust stops working for the real cases too.
21
+ *
22
+ * So the sets below are explicit, and composed from the shared groups by name. A command absent from
23
+ * `COMMAND_FLAGS` is simply not checked — this can grow incrementally, and an unlisted command keeps
24
+ * exactly its old behavior rather than acquiring a half-right allowlist.
25
+ */
26
+ /**
27
+ * Flags EVERY owner write accepts: the signing lane (`laneFromFlags`), the opt-in confirm gate, the
28
+ * wallet-lane plumbing, the post-write reindex nudge (`reindexIfKnown` → `resolveRemote`), and
29
+ * `--json`. Sourced from `riskgate.ts` + `ownerops.ts`, never from a usage string.
30
+ */
31
+ export declare const SHARED_WRITE: readonly ["send", "sign", "sponsor", "unsigned", "dry-run", "yes", "confirm", "port", "sign-url-file", "remote", "remote-token", "json"];
32
+ /**
33
+ * What `storageOverrides()` (config.ts) reads. Any command that resolves a storage backend from flags
34
+ * accepts all twelve — and none of them are documented per-command, which is exactly why a
35
+ * usage-derived allowlist would have been wrong.
36
+ */
37
+ export declare const STORAGE_OVERRIDE: readonly ["backend", "endpoint", "bucket", "region", "prefix", "public-base", "gateway", "mode", "api-url", "upload-url", "provider", "storage-signer"];
38
+ /** `remoteFlag()` / `resolveRemote()` — a named service plus its token. */
39
+ export declare const REMOTE: readonly ["remote", "remote-token"];
40
+ /**
41
+ * Command → accepted flags. Keys are the dispatch names in `main.ts`; a two-word command is keyed by
42
+ * `"<cmd> <sub>"` (e.g. `"storage upload"`) and falls back to the bare command when no subcommand row
43
+ * exists. `deploy`/`deploy-series`/`deploy-code` are deliberately ABSENT: they already enforce their
44
+ * own exhaustive allowlists via `refuseStrayFlags`, and duplicating those sets here would be a second
45
+ * copy to drift.
46
+ */
47
+ export declare const COMMAND_FLAGS: Record<string, ReadonlySet<string>>;
48
+ /**
49
+ * The allowlist for a dispatched command, preferring a `"<cmd> <sub>"` row. Returns undefined when the
50
+ * command isn't listed, which means "don't check" — never "nothing is allowed".
51
+ */
52
+ export declare function allowlistFor(cmd: string, sub?: string): ReadonlySet<string> | undefined;
53
+ //# sourceMappingURL=flag-allowlists.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flag-allowlists.d.ts","sourceRoot":"","sources":["../src/flag-allowlists.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,0IAaf,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,yJAanB,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,MAAM,qCAAsC,CAAC;AAI1D;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CA8G7D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAMvF"}