@artblocks/abx-cli 0.1.0-alpha.8 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +402 -0
  2. package/assets/renderer-scaffold/README.md +44 -13
  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 +132 -0
  16. package/dist/capabilities.d.ts.map +1 -0
  17. package/dist/capabilities.js +175 -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 +483 -0
  22. package/dist/commands/auth.js.map +1 -0
  23. package/dist/commands/contract.d.ts +19 -0
  24. package/dist/commands/contract.d.ts.map +1 -0
  25. package/dist/commands/contract.js +171 -0
  26. package/dist/commands/contract.js.map +1 -0
  27. package/dist/commands/deploy.d.ts +296 -0
  28. package/dist/commands/deploy.d.ts.map +1 -0
  29. package/dist/commands/deploy.js +5736 -0
  30. package/dist/commands/deploy.js.map +1 -0
  31. package/dist/commands/feedback.d.ts +7 -0
  32. package/dist/commands/feedback.d.ts.map +1 -0
  33. package/dist/commands/feedback.js +154 -0
  34. package/dist/commands/feedback.js.map +1 -0
  35. package/dist/commands/maintenance.d.ts +4 -0
  36. package/dist/commands/maintenance.d.ts.map +1 -0
  37. package/dist/commands/maintenance.js +114 -0
  38. package/dist/commands/maintenance.js.map +1 -0
  39. package/dist/commands/project.d.ts +458 -0
  40. package/dist/commands/project.d.ts.map +1 -0
  41. package/dist/commands/project.js +1837 -0
  42. package/dist/commands/project.js.map +1 -0
  43. package/dist/commands/reads.d.ts +85 -0
  44. package/dist/commands/reads.d.ts.map +1 -0
  45. package/dist/commands/reads.js +881 -0
  46. package/dist/commands/reads.js.map +1 -0
  47. package/dist/commands/scaffold.d.ts +89 -0
  48. package/dist/commands/scaffold.d.ts.map +1 -0
  49. package/dist/commands/scaffold.js +741 -0
  50. package/dist/commands/scaffold.js.map +1 -0
  51. package/dist/commands/service.d.ts +67 -0
  52. package/dist/commands/service.d.ts.map +1 -0
  53. package/dist/commands/service.js +761 -0
  54. package/dist/commands/service.js.map +1 -0
  55. package/dist/commands/storage.d.ts +51 -0
  56. package/dist/commands/storage.d.ts.map +1 -0
  57. package/dist/commands/storage.js +399 -0
  58. package/dist/commands/storage.js.map +1 -0
  59. package/dist/commands/submit-app.d.ts +102 -0
  60. package/dist/commands/submit-app.d.ts.map +1 -0
  61. package/dist/commands/submit-app.js +638 -0
  62. package/dist/commands/submit-app.js.map +1 -0
  63. package/dist/config.d.ts +94 -2
  64. package/dist/config.d.ts.map +1 -1
  65. package/dist/config.js +332 -12
  66. package/dist/config.js.map +1 -1
  67. package/dist/conformance.d.ts +31 -0
  68. package/dist/conformance.d.ts.map +1 -0
  69. package/dist/conformance.js +400 -0
  70. package/dist/conformance.js.map +1 -0
  71. package/dist/contract-read-error.d.ts +5 -0
  72. package/dist/contract-read-error.d.ts.map +1 -0
  73. package/dist/contract-read-error.js +37 -0
  74. package/dist/contract-read-error.js.map +1 -0
  75. package/dist/creator-agent.d.ts +49 -0
  76. package/dist/creator-agent.d.ts.map +1 -0
  77. package/dist/creator-agent.js +363 -0
  78. package/dist/creator-agent.js.map +1 -0
  79. package/dist/creator-keyring.d.ts +26 -0
  80. package/dist/creator-keyring.d.ts.map +1 -0
  81. package/dist/creator-keyring.js +57 -0
  82. package/dist/creator-keyring.js.map +1 -0
  83. package/dist/creator-signer.d.ts +52 -0
  84. package/dist/creator-signer.d.ts.map +1 -0
  85. package/dist/creator-signer.js +267 -0
  86. package/dist/creator-signer.js.map +1 -0
  87. package/dist/deploy-plan.d.ts +218 -0
  88. package/dist/deploy-plan.d.ts.map +1 -0
  89. package/dist/deploy-plan.js +20 -0
  90. package/dist/deploy-plan.js.map +1 -0
  91. package/dist/deps.d.ts +6 -39
  92. package/dist/deps.d.ts.map +1 -1
  93. package/dist/deps.js +4 -68
  94. package/dist/deps.js.map +1 -1
  95. package/dist/errors.d.ts +22 -0
  96. package/dist/errors.d.ts.map +1 -0
  97. package/dist/errors.js +32 -0
  98. package/dist/errors.js.map +1 -0
  99. package/dist/flag-allowlists.d.ts +53 -0
  100. package/dist/flag-allowlists.d.ts.map +1 -0
  101. package/dist/flag-allowlists.js +188 -0
  102. package/dist/flag-allowlists.js.map +1 -0
  103. package/dist/flags.d.ts +53 -0
  104. package/dist/flags.d.ts.map +1 -1
  105. package/dist/flags.js +151 -1
  106. package/dist/flags.js.map +1 -1
  107. package/dist/jsonout.d.ts +37 -0
  108. package/dist/jsonout.d.ts.map +1 -0
  109. package/dist/jsonout.js +79 -0
  110. package/dist/jsonout.js.map +1 -0
  111. package/dist/kind.d.ts +57 -0
  112. package/dist/kind.d.ts.map +1 -0
  113. package/dist/kind.js +122 -0
  114. package/dist/kind.js.map +1 -0
  115. package/dist/main.js +875 -5215
  116. package/dist/main.js.map +1 -1
  117. package/dist/mintpage.d.ts +17 -2
  118. package/dist/mintpage.d.ts.map +1 -1
  119. package/dist/mintpage.js +241 -54
  120. package/dist/mintpage.js.map +1 -1
  121. package/dist/output.d.ts +184 -0
  122. package/dist/output.d.ts.map +1 -0
  123. package/dist/output.js +774 -0
  124. package/dist/output.js.map +1 -0
  125. package/dist/ownerops.d.ts +450 -57
  126. package/dist/ownerops.d.ts.map +1 -1
  127. package/dist/ownerops.js +2232 -379
  128. package/dist/ownerops.js.map +1 -1
  129. package/dist/preview.d.ts +23 -5
  130. package/dist/preview.d.ts.map +1 -1
  131. package/dist/preview.js +95 -43
  132. package/dist/preview.js.map +1 -1
  133. package/dist/provision.d.ts +3 -13
  134. package/dist/provision.d.ts.map +1 -1
  135. package/dist/provision.js +19 -21
  136. package/dist/provision.js.map +1 -1
  137. package/dist/remote.d.ts +169 -52
  138. package/dist/remote.d.ts.map +1 -1
  139. package/dist/remote.js +488 -46
  140. package/dist/remote.js.map +1 -1
  141. package/dist/riskgate.d.ts +101 -0
  142. package/dist/riskgate.d.ts.map +1 -0
  143. package/dist/riskgate.js +343 -0
  144. package/dist/riskgate.js.map +1 -0
  145. package/dist/scaffold.d.ts +12 -0
  146. package/dist/scaffold.d.ts.map +1 -0
  147. package/dist/scaffold.js +56 -0
  148. package/dist/scaffold.js.map +1 -0
  149. package/dist/schema.d.ts +36 -1
  150. package/dist/schema.d.ts.map +1 -1
  151. package/dist/schema.js +121 -26
  152. package/dist/schema.js.map +1 -1
  153. package/dist/script-chunks.d.ts +8 -0
  154. package/dist/script-chunks.d.ts.map +1 -0
  155. package/dist/script-chunks.js +35 -0
  156. package/dist/script-chunks.js.map +1 -0
  157. package/dist/served.d.ts +30 -0
  158. package/dist/served.d.ts.map +1 -0
  159. package/dist/served.js +112 -0
  160. package/dist/served.js.map +1 -0
  161. package/dist/signer.d.ts +20 -1
  162. package/dist/signer.d.ts.map +1 -1
  163. package/dist/signer.js +110 -18
  164. package/dist/signer.js.map +1 -1
  165. package/dist/update-check.d.ts +60 -9
  166. package/dist/update-check.d.ts.map +1 -1
  167. package/dist/update-check.js +105 -18
  168. package/dist/update-check.js.map +1 -1
  169. package/package.json +17 -12
  170. package/skill/SKILL.md +211 -349
  171. package/skill/agents/openai.yaml +4 -0
  172. package/skill/reference/capabilities.md +195 -0
  173. package/skill/reference/code.md +236 -0
  174. package/skill/reference/creator-token.md +94 -0
  175. package/skill/reference/deploy.md +177 -0
  176. package/skill/reference/diagnose.md +178 -0
  177. package/skill/reference/hosting.md +192 -92
  178. package/skill/reference/operate.md +237 -0
  179. package/skill/reference/services.md +173 -0
  180. package/skill/reference/setup.md +221 -36
  181. package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +0 -32
  182. package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +0 -26
  183. package/dist/inspect.d.ts +0 -48
  184. package/dist/inspect.d.ts.map +0 -1
  185. package/dist/inspect.js +0 -184
  186. package/dist/inspect.js.map +0 -1
  187. package/dist/migrate.d.ts +0 -65
  188. package/dist/migrate.d.ts.map +0 -1
  189. package/dist/migrate.js +0 -180
  190. package/dist/migrate.js.map +0 -1
  191. package/dist/onchain-uri.d.ts +0 -97
  192. package/dist/onchain-uri.d.ts.map +0 -1
  193. package/dist/onchain-uri.js +0 -243
  194. package/dist/onchain-uri.js.map +0 -1
  195. package/dist/upload.d.ts +0 -28
  196. package/dist/upload.d.ts.map +0 -1
  197. package/dist/upload.js +0 -41
  198. package/dist/upload.js.map +0 -1
  199. package/skill/reference/code-projects.md +0 -246
  200. package/skill/reference/operating.md +0 -116
  201. package/skill/reference/troubleshooting.md +0 -28
@@ -0,0 +1,173 @@
1
+ # First-party services and feedback
2
+
3
+ Use this reference for the public ABX service, API-key login, hosted resolver/rendering, or feedback.
4
+ For provider-independent hosting and migration, also read [hosting.md](hosting.md).
5
+
6
+ ## Contents
7
+
8
+ - [First-party service](#first-party-service)
9
+ - [Creator wallet and sponsorship](#creator-wallet-and-sponsorship)
10
+ - [Feedback targets](#feedback-targets)
11
+
12
+ ## First-party service
13
+
14
+ The documented endpoints are:
15
+
16
+ - documentation: `https://docs.abx.io`
17
+ - service catalog, account, and control: `https://services.abx.io`
18
+ - public token data: `https://resolver.abx.io` (discover it from the catalog; do not hardcode it)
19
+ - OAuth discovery: `https://services.abx.io/.well-known/oauth-authorization-server`
20
+ - manual signup fallback: `https://services.abx.io/signup`
21
+
22
+ The first-party provider has the built-in remote name `abx`:
23
+
24
+ ```bash
25
+ abx remote abx
26
+ ```
27
+
28
+ It needs `ABX_SERVICES_API_KEY` in the project's ignored `.env`; it does not need
29
+ `ABX_REMOTE_ABX_URL`. When the key is absent, use:
30
+
31
+ ```bash
32
+ abx auth login
33
+ ```
34
+
35
+ The CLI starts the OAuth device flow and shows a verified browser URL plus a matching short code.
36
+ The human completes name, email, one-time-code verification, and approval in that browser. The CLI
37
+ polls at the provider-declared interval, receives the API key, and writes it directly to ignored
38
+ `.env` without printing it. The browser never receives the key. Do not ask the human to paste an OTP
39
+ or key into chat. `--no-open` leaves the browser handoff as a link; `--force` is required to replace
40
+ an existing local credential, but does not revoke the displaced provider key. For normal rotation,
41
+ run `abx auth logout` and then `abx auth login`; reserve `--force` for recovery. The CLI refuses
42
+ tracked or unignored `.env` files.
43
+
44
+ The issued API key is long-lived and remains valid until it is revoked. Reuse the stored key across
45
+ tasks and agent sessions; do not start a new login merely because a task or conversation ended. If
46
+ `abx remote abx` authenticates successfully, no login is needed. `abx auth login` also detects an
47
+ already loaded credential and reuses it instead of issuing another.
48
+
49
+ In an agent runner, start `abx auth login --no-open` with a short initial yield or a resumable
50
+ background session. Relay the printed URL and code immediately while that same process keeps polling,
51
+ then resume it after human approval. Do not start another login or add an outer retry loop. If the
52
+ runner cannot yield control while a command waits, ask the human to run the command in their terminal.
53
+
54
+ Logout only for intentional teardown, suspected compromise, deliberate rotation, or to free an
55
+ active-key slot. When revoking, do not only delete the local value:
56
+
57
+ ```bash
58
+ abx auth logout # first-party service
59
+ abx auth logout <name> # another OAuth-capable named remote
60
+ ```
61
+
62
+ Logout discovers the provider's RFC 7009 endpoint, revokes the current key, and only then removes the
63
+ matching `.env` assignment. If the key came from a shell or another environment source, the CLI
64
+ revokes it and tells the human where it still needs to be unset. A repeated logout with no active
65
+ local credential is safe.
66
+
67
+ An account may have up to five active keys. The service stores hashes, so it can list key metadata
68
+ but cannot recover a lost secret. Use `abx auth keys` to inspect active keys and
69
+ `abx auth revoke-key <key-id>` to revoke an unused non-current key. Use `abx auth logout` for the
70
+ current key. Only create another key when a separate environment actually needs its own credential.
71
+
72
+ Use `/signup` only as the manual recovery path. It shows the raw key once, so the human—not the
73
+ agent—must place it in `.env`. An already verified email reuses its account and may receive another
74
+ key, subject to the same limit.
75
+
76
+ Availability, pricing, and quotas are service policy rather than protocol guarantees. Confirm current
77
+ terms before making a durable hosting choice and keep the exit route explicit: the same remote-service
78
+ contract supports another provider or a creator-operated resolver/effects deployment.
79
+
80
+ Before depending on hosted behavior, inspect the live descriptor with `abx remote abx`; do not infer
81
+ capabilities from this file. A remote is a provider catalog and may advertise different HTTPS
82
+ origins for token resolution, control, account operations, and creator wallets. Trust the advertised
83
+ interface endpoint, not a guessed hostname. Use `--remote abx` on commands that accept a managed
84
+ resolver and verify the resulting public surfaces as described in [hosting.md](hosting.md).
85
+
86
+ ## Creator wallet and sponsorship
87
+
88
+ An account with a verified email can use one persistent ABX creator wallet. The
89
+ `ABX_SERVICES_API_KEY` identifies the account but cannot sign. `--sponsor` discovers the provider's
90
+ `abx-creator-wallet/v1` endpoint and provisions or reuses the wallet. The first sponsored command
91
+ asks the human to match one code and approve a Privy agent grant. The CLI keeps the rotating grant in
92
+ the operating system's credential store and reuses it for up to 30 days, unless the creator revokes
93
+ it first. The request-signing key remains memory-only. A reused grant removes another browser step; it does
94
+ not remove the dry run, transaction summary, or production confirmation.
95
+
96
+ The approval is authority for the agent to use the creator wallet, not approval of one displayed
97
+ transaction. Review each exact network and transaction plan in the terminal. The creator can inspect
98
+ and revoke active grants at `https://services.abx.io/authorize`.
99
+
100
+ Treat the live descriptor and account capabilities as the authority for sponsored networks. The
101
+ public [network table](https://docs.abx.io/docs/reference/deployments) is the human-readable summary,
102
+ but it does not guarantee sponsorship for an account or moment. When the creator has not selected
103
+ another signer, prefer this lane for an eligible testnet operation. For production, prove the flow on
104
+ the paired testnet and repeat the production warning before confirmation. Before using it:
105
+
106
+ 1. run `abx auth login` if the account has no API key;
107
+ 2. inspect `abx capabilities --json` and the command help;
108
+ 3. run the same command with `--dry-run --json`;
109
+ 4. summarize the network, creator-wallet address, transaction group, zero value, permanent choices,
110
+ and any experimental or beta status;
111
+ 5. repeat with `--sponsor`; if no usable grant exists, give the human the verified URL and code and
112
+ resume the same command after approval.
113
+
114
+ The lane accepts zero-value calls and receipt-dependent staged content groups up to the live network
115
+ and provider policy. ABX does not impose an additional per-transaction gas ceiling. Use
116
+ `abx deploy-contract` for exact already-compiled creation bytecode; its sponsored path calls the
117
+ keyless CREATE2 proxy because provider-backed raw creation is unsupported. The constructor therefore
118
+ sees the proxy as `msg.sender`; use explicit constructor arguments for ownership. ABX does not
119
+ compile or audit it. Never add retries around a sponsored write. An `unknown` outcome means the
120
+ provider may have submitted it: preserve the operation ID and reconcile status before any new send.
121
+
122
+ Sponsorship is optional service policy, not protocol support. `--send`, `--sign`, and `--unsigned`
123
+ remain first-class bring-your-own alternatives. Honor an explicit choice of any of them. If the
124
+ provider does not advertise the chain, the account is ineligible, or the transaction group exceeds
125
+ policy, select one of those lanes rather than refusing the underlying operation. Do not use
126
+ sponsorship on a production network unless the live descriptor, account capabilities, and command
127
+ all explicitly support it. Never infer eligibility merely because the CLI recognizes the lane.
128
+
129
+ ## Feedback targets
130
+
131
+ `abx feedback` has two deliberately separate targets:
132
+
133
+ | Intent | Command | Recipient |
134
+ |---|---|---|
135
+ | ABX protocol, contracts, CLI, SDK, skill, or docs | `abx feedback` | core ABX team |
136
+ | A remote provider's resolver, rendering, auth, or operations | `abx feedback --remote <name>` | that provider |
137
+
138
+ For first-party hosted-service feedback use `--remote abx`. A third-party remote can advertise the
139
+ optional `abx-service-feedback/v1` interface and operate its own feedback store. Never send
140
+ provider-specific incidents through core feedback merely because both first-party targets currently
141
+ share infrastructure.
142
+
143
+ Discovery and report previews are public. Submission (`--yes`) and `--mine` require the same key
144
+ created by `abx auth login`; login once rather than creating a separate feedback credential. Run the
145
+ command without report flags to inspect its live schema and instructions. To report, provide the
146
+ required structured flags; use `--detail-file` or `--context-file` rather than fragile shell quoting
147
+ for longer content. The CLI shows the exact destination and payload first. Review and redact the
148
+ preview with the human, then repeat with `--yes` only after explicit approval.
149
+
150
+ ```bash
151
+ # Preview core feedback; nothing is sent.
152
+ abx feedback --area cli --kind bug --summary "Concise summary" --detail-file report.md
153
+
154
+ # After the human approves this exact preview.
155
+ abx feedback --area cli --kind bug --summary "Concise summary" --detail-file report.md --yes
156
+
157
+ # Provider-specific preview.
158
+ abx feedback --remote abx --component rendering --kind bug --summary "Concise summary"
159
+
160
+ # Review reports previously submitted with the current key.
161
+ abx feedback --mine
162
+ abx feedback --remote abx --mine
163
+ ```
164
+
165
+ Do not attach `.env`, credentials, wallet/session URLs, full transcripts, or unrelated source files.
166
+ Prefer the smallest reproduction and relevant version/chain/address context. The API key authenticates
167
+ the reporter; hosted-service entitlement is evaluated separately. It never grants transaction-signing
168
+ authority.
169
+
170
+ Use the CLI instead of hand-written HTTP or retry loops. The device flow already handles pending,
171
+ slow-down, and transient polling responses until its fixed expiry. Treat `401` as missing/invalid credentials,
172
+ `403` as recognized credentials without the required entitlement, and schema/interface errors as a
173
+ request or provider-contract mismatch. Read [diagnose.md](diagnose.md) and make one state transition.
@@ -1,36 +1,221 @@
1
- # Environment detail — RPC & troubleshooting
2
-
3
- [← back to SKILL.md](../SKILL.md)
4
-
5
- ## Choosing an RPC (drives re-index speed)
6
-
7
- Reconstruction reads the event log via `eth_getLogs` **from the contract's deploy block** — the CLI records it at deploy and forwards it to a resolver on `add`, and discovers it on-chain (a getCode binary search) for a contract it didn't deploy here. So a normal deploy→index scans a *small, recent* window and is fast on **any** RPC. Providers cap the getLogs block range very differently **and these caps change** — treat any number as illustrative, re-verify before you quote it. *(Illustrative, Jun 2026: Alchemy free ≈10 blocks/call, Infura/Chainstack free ≈2000, PublicNode/dRPC vary; no-key public endpoints are the lowest-friction to try.)* The toolkit **auto-chunks**, so any RPC yields correct state — but a range cap is **not** cost-free to shrug off: a **from-genesis** or long-span reconstruction, or a resolver serving many code projects under load, is slow and rate-limit-prone on a capped endpoint. `abx doctor` rates each endpoint and flags a capped one; treat that flag as a real infra signal, not noise. **First diagnosis when indexing is slow or a hosted resolver won't serve: is it scanning from block 0? Check the scan floor before the RPC tier.**
8
-
9
- When `abx doctor` flags a tight range, or a reconstruction would be large/slow — **a decision point: research and present, don't power through:**
10
- 1. **Do your own current research** (the limits rot) — find a free, range-generous, archive-capable endpoint for this chain *right now*.
11
- 2. **Present clear choices with current specifics** — (a) point `ABX_RPC_URLS` at a higher-range endpoint *(recommended for anything large)*, with the exact signup/URL steps you found; or (b) stay on the current RPC and accept the wait.
12
- 3. The CLI **stops a large job with an estimate** instead of grinding through thousands of requests; a better RPC is the real fix. To chunk through anyway, re-run with `--yes` (or raise `ABX_GETLOGS_MAX_CHUNKS`); `ABX_GETLOGS_RANGE` tunes the window.
13
-
14
- **One RPC var, network-scoped.** `ABX_RPC_URLS` is a comma/space-separated list of endpoints **for the active `ABX_CHAIN`** (there is no singular `ABX_RPC_URL`). The client **fails over** across them at request time — a request one endpoint rejects (a too-wide `eth_getLogs`) is retried on the next — and `abx doctor` **probes every endpoint** and reports a per-endpoint verdict (✓ wide range + archive · ⚠ usable but range-capped · ✗ unusable, with the reason, e.g. *archive refused* / *wrong network*), then names the best for reconstruction. So list a couple, let `doctor` pick, and order the list best-first. For **multiple chains**, set `ABX_RPC_URLS_<CHAIN>` (e.g. `ABX_RPC_URLS_BASE_SEPOLIA`, `ABX_RPC_URLS_SEPOLIA` — the default `ABX_CHAIN` is `base-sepolia`) — a per-chain list that overrides the bare var, never mixed, so one network's endpoints can't leak into another. The var *names* a network but the URL could point anywhere, so before any write the toolkit **verifies `eth_chainId` matches `ABX_CHAIN`** and hard-fails on a mismatch (reads stay unguarded/fast) — that's what makes "which network is this?" a checked fact, not a guess.
15
-
16
- **Re-index is incremental by default** — it resumes from the last-indexed block and only fetches new blocks, so routine re-indexing (after an owner op, or just refreshing) stays instant *regardless* of the range cap. Even the **first** reconstruction scans only from the **deploy block** (not genesis), so range/archive capability bites only on a genuinely long span — a forced full replay (`abx index --full`, a fresh projection, or the dashboard's "Re-index from chain" — the durability proof) of a contract deployed long ago. A "why is this scanning millions of blocks?" moment almost always means the scan floor is wrong (block 0), not that the RPC is inadequate.
17
-
18
- ## Troubleshooting
19
-
20
- - **doctor: signing key** → **not fatal — a missing key is a fork, not a blocker.** A key in `.env` is only needed to sign *unattended* (hot lane). To sign in a browser wallet instead, run the write with `--sign` and no env key is needed. Offer both: add `SEPOLIA_WALLET_PK` (or `SEPOLIA_FUNDED_PK` / `ABX_DEPLOYER_PK` — any one) for autonomous signing, **or** use `--sign`. **deployer unfunded** → fund the printed address from a faucet for the active chain (Base Sepolia by default, else Sepolia).
21
- - **a write reverts with no clear reason (`--onchain-image` / staging)** → don't thrash by retrying variations. Get the actual reason: re-run the same call read-only with `cast call <addr> "<sig>" <args> --rpc-url <one of your ABX_RPC_URLS>`, which surfaces the revert string. The classic culprit is a stale chunk store (deployed before a contract upgrade) — the toolkit now detects this and auto-deploys a current store with a yellow notice, so you shouldn't hit the silent revert, but verify the resolved chunk-store/factory addresses are live (`cast code <addr>`; `abx doctor` / `abx status` print the factory) if anything looks off. **Never silently switch the representation you told the user you'd use** (e.g. fall back from `reader` to `inline`) — if the path changes, say so and why.
22
- - **storage 'cloud' missing accessKeyId/…** → set `ABX_S3_*` in `.env`. **'ipfs' unreachable** → Kubo not running or `PINATA_JWT` missing.
23
- - **re-index slow, or a "scan too large" stop** → **first check the scan floor: is it indexing from block 0 instead of the deploy block?** That's the usual cause of a "huge" scan (an `add` that lost the deploy block). The floor is `flags['from-block'] → the stored deploy block → on-chain discovery`; if none resolve, the CLI refuses rather than sweeping genesis. Only once the floor is correct does the RPC's `eth_getLogs` range matter: the toolkit chunks automatically, but a genuinely large job stops with an estimate rather than grinding. Real fix then: research a current higher-range free endpoint and set `ABX_RPC_URLS` (`abx doctor` reports your range); or re-run with `--yes` to chunk through. **archive-range getLogs refused** → use an archive-capable provider.
24
- - **`serve`/resolver returns `{"error":"unknown project"}`** → the resolver you hit doesn't have that contract in *its own* projection store **yet**. Two distinct situations — diagnose which, and NEVER default to "RPC limit":
25
- - **A hosted resolver you just registered** (`abx add … --remote`): it may still be **backfilling** — hit `GET /` (or `abx status --remote`) to see if it's appearing. If it's slow or stuck, the cause is almost always a **from-genesis scan (from-block=0)**, not the RPC tier — a fixed `abx add` forwards the deploy block, so re-run it and confirm the floor. (Fixed in-toolkit: a first remote add now forwards/derives the deploy block and refuses a genesis default.)
26
- - **A local `abx serve`**: a **store/port** problem. Usual causes, in order: (1) a **stale/duplicate `abx serve` from an old session** holds the port and serves a *different* store — hit `GET /` and see what it lists; (2) you're serving a different store directory than the deploy indexed into; (3) the contract was never registered there. Fix the server/port/registration.
27
- - **`/a/…` returns `{"error":"no live view — not a code project"}` on a project that IS a code drop** → the resolver indexed *above* the deploy block, so it never saw the `code` field written at deploy — a scan-floor bug, **not** a resolver version/compat gap (do NOT redeploy as a static NFT). This is the *opposite* of the genesis bug: the floor is too **high**, not too low. It happened when a `--sign` code deploy spanned blocks (deploy at N, mint at N+2) and the mint block was recorded as the floor. Confirm: `GET /api/project/<addr>` → `collectionFields` is `[]` and `fromBlock` sits above the deploy block. Fix: `abx add <addr> --remote <url> --from-block <deployBlock>` — a *changed* floor forces a full replay that picks up the `code` field. Find the true deploy block with `abx add <addr>` locally (it prints "deploy block N (discovered on-chain)"). (Fixed in-toolkit: `deploy-code` now records the clone-CREATION block, and discovers it on-chain rather than trusting the last-tx receipt.)
28
- - **directory-mode live view 302s to a doubled URL** (`https://arweave.net/https://arweave.net/<txid>/index.html`) → the `code` locator was stored as a full gateway URL and the gateway got prefixed again. Fixed in-toolkit (deploy stores the bare txid/CID; the resolver serves an already-absolute locator verbatim). A resolver image built before the fix still doubles — redeploy it to pick up the resolver-side tolerance.
29
- - **the thumbnail stays a placeholder on a HOSTED resolver even after `abx render` reports `ran=1`** → the render bytes landed in a store the hosted resolver can't read. A local `abx render` with the default `fs` backend writes to your laptop; `ipfs`/`arweave` write a LOCAL key→CID index the resolver doesn't have. Fix: render **to** the resolver — `abx render <addr> --remote <resolver>` (uploads to your `ABX_STORAGE_BACKEND` home and **publishes** a locator/bytes the resolver serves), or stand up the runner beside it (`abx deploy-effects --resolver-url <resolver>`). Only a SHARED `s3`/`cloud` bucket makes a bare local render visible to a hosted resolver. Confirm with `abx verify <addr>`.
30
- - **resolver won't start / errors about `ABX_PUBLIC_BASE_URL`** → it refuses a placeholder `.example` base (a scaffold leftover) or a `localhost` base in a hosted image (`ABX_HOSTED=1`), because it bakes that base into every image/animation URL it serves — a bad one serves dead links, so a loud fail beats silent breakage. Set `ABX_PUBLIC_BASE_URL` to the resolver's real public URL (`fly secrets set ABX_PUBLIC_BASE_URL=https://<app>.fly.dev`, or your custom domain). The current scaffold bakes the real platform hostname by default, so this only bites a hand-edited/old artifact or a stripped env.
31
- - **a hosted resolver LOST its index (or its render thumbnails) after a redeploy** → the SQLite projection wasn't on a persistent volume. The scaffold creates `fly volumes create abx_data` **before** the first deploy so the store lives on `/data` (the mount); if you deployed WITHOUT the volume, the store sat on ephemeral disk and a redeploy wiped it. Fix: ensure the volume exists (`fly volumes list`), then re-index (`abx add <addr> --remote --from-block <deployBlock>`). Note published **render locators + traits live on that same volume** (producer-published, not chain-derived), so restoring them after a volume loss needs a runner re-sweep, not just a chain replay — re-run `abx render <addr> --remote <resolver>` (idempotent; it re-publishes from the storage home without re-rendering) or let the effects service sweep.
32
- - **the project's on-chain `tokenURI` points at a HOSTED resolver but it isn't serving** → **do NOT "fix" it by running `abx serve` locally and handing over a `localhost` link.** The baked URL is the hosted one; a local serve resolves for no one but you. Fix the HOSTED resolver instead: re-run `abx add <addr> --remote` (now forwards the deploy block), check `GET /` on the host, and vet its RPC with `abx doctor`. A local serve is only ever the answer when the baked base is that same local machine.
33
- - **port hygiene before `serve`** → check the port is free first (`lsof -i:8787`). If an old session holds it, kill that process or serve this project on a distinct `--port <n>` (and point its `--public-base-url`/tokenURI accordingly) — a stale server silently answering on the port is the #1 cause of "works for me, `unknown project` for everyone."
34
- - **serving code projects is RPC-heavier than static art** → the live view rebuilds `tokenData` per request, and template-mode script chunks + data-backed (`String`/`Bytes`) params are read **live per view** (scalar PostParams come from the indexed projection, so they don't hit RPC each view). A resolver serving many code projects under marketplace traffic wants a range-generous, reliable RPC — this is a genuine scaling consideration, distinct from the getLogs range cap above.
35
- - **wallet lane: "no injected wallet"** → the human has no extension wallet; fall back to the hot lane (`--send`) if they're comfortable, or the cold lane for a Safe.
36
- - **owner op reverts** → the signer isn't the owner/holder. Check `abx status` / the `/api/project` state for the current owner; sign as that wallet.
1
+ # Setup and safety
2
+
3
+ Use this reference when installing ABX, selecting a binary or signer, configuring a new environment,
4
+ or preparing a real transaction.
5
+
6
+ ## Contents
7
+
8
+ - [Resolve the tool before the project](#resolve-the-tool-before-the-project)
9
+ - [Upgrade when a release is available](#upgrade-when-a-release-is-available)
10
+ - [Never expose secrets](#never-expose-secrets)
11
+ - [Select the chain explicitly through the environment](#select-the-chain-explicitly-through-the-environment)
12
+ - [Choose one signing lane](#choose-one-signing-lane)
13
+ - [Prepare without mutating](#prepare-without-mutating)
14
+ - [New environment checklist](#new-environment-checklist)
15
+
16
+ ## Resolve the tool before the project
17
+
18
+ Inside the ABX source repository run `pnpm abx …`; elsewhere run the installed `abx`. A bare global
19
+ binary inside the repository may be older than the source. Start with:
20
+
21
+ ```bash
22
+ abx version
23
+ abx doctor
24
+ abx capabilities --json
25
+ abx skill install
26
+ ```
27
+
28
+ `abx doctor` reports binary provenance, CLI/skill drift, active chain, RPC health and history reach,
29
+ wallet readiness, canonical factories, storage, and configured remotes without exposing credentials.
30
+ Treat a red check as an actionable setup state, not as permission to improvise a workaround.
31
+
32
+ The shipped skill is named `abx`. `abx skill install` installs it to `.claude/skills/abx` and
33
+ `.agents/skills/abx` by default; `--agent`, `--global`, and `--target` narrow the destination. During
34
+ the rename transition the installer moves a recognized `abx-self-host` folder to
35
+ `.abx-skill-backups/` before installing the new name. It preserves custom bytes rather than deleting
36
+ them. For a custom skills parent, run `abx skill install --target <that-parent>`; do not move or merge
37
+ the old folder manually. Restart the agent after installation.
38
+
39
+ ABX requires Node 22.13 or newer. Prefer a project-local npm dependency for reproducible automation;
40
+ use a global install for interactive machine-wide use. Avoid repeated `npx` execution when version
41
+ provenance matters because caches can outlive an upgrade.
42
+
43
+ ## Upgrade when a release is available
44
+
45
+ Treat an `update available` notice or an outdated `npm` row in `abx doctor` as a recommendation to
46
+ upgrade before planning a deployment or preparing a write. Do not silently change a global install
47
+ or a project's dependencies; tell the creator which version is installed, which version is
48
+ available, and give the command for that install:
49
+
50
+ ```bash
51
+ # Global install
52
+ npm install -g @artblocks/abx-cli@latest
53
+
54
+ # Project-local install
55
+ npm install --save-dev @artblocks/abx-cli@latest
56
+ ```
57
+
58
+ The latest ABX release retains support for canonical projects made with earlier releases unless a
59
+ specific contract generation is explicitly quarantined for a security or correctness reason.
60
+ Updating the CLI does not redeploy or mutate a project. New deployments may use newer factories or
61
+ defaults, so rerun help, capabilities, and the JSON dry run after upgrading.
62
+
63
+ Then refresh the copied skill in the same scope reported by the CLI, restart the agent, and check the
64
+ environment again:
65
+
66
+ ```bash
67
+ abx skill install # project copy
68
+ abx skill install --global # global copy, when reported
69
+ abx doctor
70
+ ```
71
+
72
+ If the creator defers the upgrade, say so once and continue only with the installed release's live
73
+ help and capability output. Never assume a newer flag or behavior exists in an older binary.
74
+
75
+ ## Never expose secrets
76
+
77
+ Do not open, search, quote, or print `.env`. Do not echo variables to test whether they exist. Do not
78
+ paste a private key into a command line, generated file, wallet page, bug report, or transcript.
79
+
80
+ Sensitive values include:
81
+
82
+ - `ABX_DEPLOYER_PK` and any wallet key;
83
+ - credential-bearing `ABX_RPC_URLS*` values;
84
+ - `PINATA_JWT`, S3/R2 keys, `ABX_SERVICES_API_KEY`, other remote-provider tokens, effects/admin
85
+ tokens;
86
+ - Arweave JWK contents and browser signing-session URLs.
87
+
88
+ Use `abx doctor`, `abx remote <name>`, `abx storage show --check`, and redacted CLI errors. If a tool
89
+ ever emits an unredacted credential-bearing endpoint, stop, rotate the credential, and report the
90
+ output bug without repeating the secret.
91
+
92
+ ## Select the chain explicitly through the environment
93
+
94
+ Read the full `chains` array from `abx capabilities --json`. Do not rely on a remembered network
95
+ list. ABX is adding networks, and status may change between releases. There is no `--chain` flag
96
+ because ignoring a wrong-chain request could spend on the wrong network.
97
+
98
+ Choose a production chain by intended users, then measured cost. Use the `pairedChain` reported by
99
+ capabilities for the test run. Large onchain payloads cost more on every network, so compare the dry
100
+ run with Arweave, IPFS, or cloud custody.
101
+
102
+ Before any transaction on an `experimental` or `beta` network, name the network and support level,
103
+ explain what the transaction or transaction group will do, and state the relevant contract,
104
+ configuration, and real-funds risks. ABX has not had an independent third-party audit; bugs,
105
+ misconfiguration, and nondeterministic agent behavior may cause permanent loss. Link to the open
106
+ source, use-at-your-own-risk implementation at
107
+ https://github.com/ArtBlocks/abx. Qualify the same flow on the paired testnet before production.
108
+
109
+ Use per-chain RPC variables when operating more than one chain. `abx doctor` checks chain identity,
110
+ wide-range `eth_getLogs`, archival reach, and nonce coherence. Put a healthy archive endpoint first:
111
+ fallback transports rotate on errors, not on a successful but pruned empty log response.
112
+
113
+ The local projection and managed Arweave identity remain in `.abx-self-host/` unless
114
+ `ABX_DATA_DIR` overrides it. That runtime directory is separate from the renamed `abx` skill and is
115
+ not being renamed. Back up the managed Arweave key with `abx storage backup-key`; never print it.
116
+
117
+ Every WRITE command (`deploy*`, `add`, `index`, `mint`, `set-*`, …) resolves `.abx-self-host`
118
+ strictly relative to the current directory — it never searches upward, so it never creates a
119
+ project's state somewhere unexpected. A handful of READ commands (`status`, `state`, `verify`,
120
+ `doctor`, `capabilities`, `tokens`, `tokenuri`, `contracturi`, `inspect`, `minter show`) DO search
121
+ upward, git-style, for an already-existing `.abx-self-host` if the current directory doesn't have
122
+ one of its own — bounded at the home directory, a `.git` root, or the filesystem root. Practical
123
+ consequence: `cd`-ing into a project's `contracts/` subdirectory before `abx status` still finds
124
+ that project; the same `cd` before `abx add`/`abx deploy*` creates a NEW, empty node right there
125
+ instead. If a status/verify/etc. answer looks emptier than expected, or a write seems to have
126
+ landed in the wrong place, run bare `abx status` — its `data: <path>` line names the exact
127
+ directory that answered, including a note when it was found by searching upward — or set
128
+ `ABX_DATA_DIR` explicitly rather than guessing. See [Local data
129
+ directory](https://docs.abx.io/docs/using-abx/self-hosting#local-data-directory) for the full rule.
130
+
131
+ ## Choose one signing lane
132
+
133
+ Every write uses one of four lanes:
134
+
135
+ | Lane | Select | Use when |
136
+ |---|---|---|
137
+ | Sponsored | `--sponsor` | The live remote advertises sponsorship for this chain and command |
138
+ | Hot | `--send` or default | An environment key may sign unattended |
139
+ | Wallet | `--sign --for 0x…` | A human approves in their browser wallet |
140
+ | Cold | `--unsigned --for 0x…` | A multisig/offline signer needs prepared transactions |
141
+
142
+ Honor an explicit creator choice. Otherwise run `abx capabilities --json`, the command help, and
143
+ `abx remote abx`. Prefer `--sponsor` when the provider advertises the active chain, the command and
144
+ transaction group are eligible, and sponsorship is enabled—especially on a testnet, where it removes
145
+ wallet and faucet setup. Sponsorship is provider policy, not protocol support: if it is unavailable,
146
+ paused, or ineligible, fall back to the appropriate bring-your-own lane rather than treating the ABX
147
+ operation as unsupported.
148
+
149
+ Select the lane before the JSON dry run. The signer can affect ownership, salts, and predicted
150
+ addresses. If the lane changes, rerun the dry run and summarize the revised plan before execution.
151
+
152
+ Run `abx doctor --for <address>` before a wallet or cold operation. On the wallet lane, give the
153
+ human the locally generated signing page; never request or handle their key. On the cold lane, verify
154
+ chain, sender, target, calldata, value, and ordering before handing transactions over.
155
+
156
+ `--onchain-image` staging cannot use the cold lane because each chunk transaction depends on the
157
+ receipt of the preceding transaction. Use hot, wallet, or sponsored signing. Do not split staging
158
+ into a homemade offline sequence.
159
+
160
+ `ABX_DEPLOYER_PK` may be written with or without a `0x` prefix — the CLI and SDK normalize it. Foundry's
161
+ `vm.envUint` does not: a custom forge script that reads the same `.env` needs the `0x` form.
162
+
163
+ For any one EOA, run one write command at a time. ABX obtains pending and latest nonces once, takes the
164
+ safe maximum, increments locally, waits for newly deployed code when a following transaction targets
165
+ it, and throws typed reversion errors. Starting concurrent processes bypasses that serialization.
166
+
167
+ ## Prepare without mutating
168
+
169
+ Use command help and dry runs, not guessed syntax:
170
+
171
+ ```bash
172
+ abx help deploy-code
173
+ abx deploy-code … --dry-run --json
174
+ ```
175
+
176
+ A dry run may read contracts, probe endpoints, analyze files, or verify an address, but it does not
177
+ send or store. Address prediction is meaningful only when the salt and deployer are pinned. Use
178
+ `abx predict` when another contract or resolver must know the collection address before deployment.
179
+
180
+ Before any real send, confirm:
181
+
182
+ - active chain and deploying/owning address;
183
+ - contract family and edition arithmetic;
184
+ - name, symbol, royalties and royalty ceiling;
185
+ - deploy-time options such as burnability and creator-token enrollment;
186
+ - custody, public resolution, image/animation/trait surfaces;
187
+ - mint amount, value, transaction count, and expected gas;
188
+ - every irreversible lock or authority transfer.
189
+
190
+ Do not make a real send merely because a dry run exited successfully. The dry run is the plan; the
191
+ human confirmation authorizes execution.
192
+
193
+ ## New environment checklist
194
+
195
+ 1. Install Node 22.13+ and the desired CLI version.
196
+ 2. Install the co-versioned skill with `abx skill install`, then restart the agent.
197
+ 3. Select the testnet with `ABX_CHAIN` when the default is not appropriate.
198
+ 4. Add RPC and storage configuration outside the transcript. If the live first-party remote
199
+ advertises sponsorship for the chosen chain and command, recommend it before asking the creator
200
+ to configure a signer. Otherwise configure one of the bring-your-own lanes. For first-party hosted
201
+ services, run `abx auth login --no-open` in a short-yield or resumable session: immediately hand
202
+ its verified browser URL and matching code to the human, then resume that same polling process.
203
+ Let the CLI store `ABX_SERVICES_API_KEY` in ignored `.env` without printing it. Never ask for the
204
+ email OTP or key in chat, start duplicate login sessions, or add standing login instructions to
205
+ `AGENTS.md`/`CLAUDE.md`. The key is long-lived: reuse it across tasks and agent sessions. Run
206
+ `abx auth keys` before creating a separate credential if the account is at its five-key limit;
207
+ revoke an unused non-current key with `abx auth revoke-key <key-id>`. Run `abx auth logout` only
208
+ for intentional teardown, compromise, rotation, or cleanup of the current key.
209
+ 5. Run `abx doctor` and resolve every red check relevant to the chosen lane.
210
+ 6. Run `abx storage show --check` when bytes will leave the local disk.
211
+ 7. Run `abx remote <name>` before relying on a configured managed service.
212
+ 8. Run command help, then a JSON dry run.
213
+ 9. Confirm the plan and only then execute.
214
+
215
+ For an eligible first-party account, `--sponsor` replaces local key and faucet setup with an
216
+ account-bound creator wallet. The first use opens a Privy agent grant; later commands reuse that
217
+ grant for up to 30 days, unless the creator revokes it first. Do not ask for another browser approval when the
218
+ CLI resumes an existing grant. Use sponsorship only when the live descriptor and account
219
+ capabilities advertise the active chain. Test the exact flow on the reported paired testnet before
220
+ production. Read [services.md](services.md) before using it. Sponsorship is zero-value and never a
221
+ reason to skip the dry run or transaction summary.
@@ -1,32 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.8.20;
3
-
4
- /// @title IAbxFieldRenderer — the contract your in-chain art implements
5
- /// @notice A field renderer returns ONE metadata field's value, COMPUTED from chain state
6
- /// (the token's seed + PostParams, its owner, anything readable on-chain). The ABX
7
- /// metadata renderer staticcalls it to build `tokenURI` — e.g. an `image` renderer's
8
- /// SVG becomes `data:image/svg+xml;base64,…`. Deploy your renderer, then wire it with
9
- /// `abx deploy-code --image-renderer <address> [--attributes-renderer <address>] --onchain-uri`.
10
- ///
11
- /// @dev THE FIVE INVARIANTS (a reverting or malformed renderer bricks the WHOLE tokenURI —
12
- /// the metadata renderer staticcalls you with NO try/catch):
13
- /// 1. NEVER revert for ANY (token, tokenId, field) — including the collection surface
14
- /// `tokenId == type(uint256).max` (used by `contractURI`). Return a neutral value.
15
- /// 2. Return the correct `contentType` (`image/svg+xml` for an image; `application/json`
16
- /// for an `attributes` array).
17
- /// 3. Guard `field`: revert only a truly unsupported field (a deploy-time miswiring), but
18
- /// still never revert on the fields you DO render.
19
- /// 4. `view` + deterministic: same chain state → same bytes.
20
- /// 5. Bounded output: keep it small (a few hundred bytes of SVG) so `tokenURI` stays a
21
- /// cheap single eth_call. `forge test` the never-revert cases before you wire it.
22
- interface IAbxFieldRenderer {
23
- /// @param token the ABX collection contract (read its params via {IAbxParams}).
24
- /// @param tokenId the token, or `type(uint256).max` for the collection surface.
25
- /// @param field which field to compute (e.g. `"image"`, `"attributes"`).
26
- /// @return contentType MIME of `data` (e.g. `image/svg+xml`, `application/json`).
27
- /// @return data the field's finished bytes.
28
- function render(address token, uint256 tokenId, bytes32 field)
29
- external
30
- view
31
- returns (string memory contentType, bytes memory data);
32
- }
@@ -1,26 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- pragma solidity ^0.8.20;
3
-
4
- /// @title IAbxParams — read the token's on-chain params (seed + collector PostParams)
5
- /// @notice Your renderer reads live state through this. Each value is a `bytes32`; `isSet` tells
6
- /// you whether it exists (fall back to a default if not — see invariant #1). `valueIsHash`
7
- /// is true when the on-chain value is a keccak commitment to off-chain bytes (a literal
8
- /// scalar param like a `seed` or a `HexColor` palette is NOT a hash — check `!valueIsHash`).
9
- ///
10
- /// The tokenData merge rule: a token-scope value overrides the contract-scope one. The
11
- /// common pattern is `tokenParam` first, then `contractParam` as a fallback (see the
12
- /// `_param` helper in MyRenderer.sol).
13
- interface IAbxParams {
14
- /// Returns the token-scope param: its bytes32 `value`, `valueIsHash` (true if it commits to
15
- /// off-chain bytes — a literal scalar like a seed/HexColor is false), and `isSet` (does it exist).
16
- function tokenParam(uint256 tokenId, bytes32 key)
17
- external
18
- view
19
- returns (bytes32 value, bool valueIsHash, bool isSet);
20
-
21
- /// @notice The contract-scope (collection-wide) value — the fallback when a token has none.
22
- function contractParam(bytes32 key)
23
- external
24
- view
25
- returns (bytes32 value, bool valueIsHash, bool isSet);
26
- }
package/dist/inspect.d.ts DELETED
@@ -1,48 +0,0 @@
1
- /**
2
- * `abx inspect <script.js>` — static analysis of a generative script, BEFORE picking a lane.
3
- *
4
- * The membrane fix behind this: an agent (or creator) should DERIVE the deployment lane from what
5
- * the script actually needs — are there traits? are they reproducible on-chain? how big is the
6
- * assembled document (does a single `tokenURI` eth_call even fit)? — instead of guessing "fully
7
- * on-chain!" and walking it back. This module is the pure analysis; `cmdInspect` formats it.
8
- *
9
- * Static only — it never executes the script (that's the resolver/runner's job, and executing
10
- * untrusted art in the CLI would be a footgun). Everything here is regex/heuristic over the source.
11
- */
12
- export type TraitFeasibility = 'none' | 'exact-likely' | 'careful' | 'infeasible' | 'unknown';
13
- export interface ScriptAnalysis {
14
- bytes: number;
15
- estChunks: number;
16
- traits: {
17
- present: boolean;
18
- keys: string[];
19
- };
20
- paramHints: string[];
21
- prng: {
22
- seeded: boolean;
23
- usesBareRandom: boolean;
24
- usesMathRandom: boolean;
25
- usesNoise: boolean;
26
- };
27
- depHints: string[];
28
- looksP5: boolean;
29
- feasibility: {
30
- verdict: TraitFeasibility;
31
- reason: string;
32
- };
33
- doc: {
34
- estBytes: number;
35
- deps: string[];
36
- fitsSingleCall: boolean;
37
- unknownDepSizes: boolean;
38
- };
39
- runtime: {
40
- readsTokenData: boolean;
41
- reportsTraits: boolean;
42
- wrongGlobal: string | null;
43
- };
44
- }
45
- export declare function analyzeScript(source: string, declaredDeps?: string[]): ScriptAnalysis;
46
- /** A one-line lane recommendation derived from the analysis (the decision-tree output). */
47
- export declare function recommendLane(a: ScriptAnalysis): string;
48
- //# sourceMappingURL=inspect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAE9F,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAAC;IAC3C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAC,CAAC;IAC9F,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE;QAAC,OAAO,EAAE,gBAAgB,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC;IACzD,GAAG,EAAE;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,cAAc,EAAE,OAAO,CAAC;QAAC,eAAe,EAAE,OAAO,CAAA;KAAC,CAAC;IAM3F,OAAO,EAAE;QAAC,cAAc,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAAC,CAAC;CACxF;AAsDD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,GAAE,MAAM,EAAO,GAAG,cAAc,CAqEzF;AAED,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CA0BvD"}