@artblocks/abx-cli 0.1.0-alpha.9 → 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.
- package/CHANGELOG.md +402 -0
- package/assets/renderer-scaffold/README.md +44 -13
- package/assets/renderer-scaffold/foundry.toml +5 -0
- package/assets/renderer-scaffold/remappings.txt +1 -1
- package/assets/renderer-scaffold/script/DeployHooks.s.sol +24 -0
- package/assets/renderer-scaffold/script/Preview.s.sol +99 -0
- package/assets/renderer-scaffold/src/MyHooks.sol +20 -0
- package/assets/renderer-scaffold/src/MyRenderer.sol +4 -4
- package/assets/renderer-scaffold/src/MyTraits.sol +2 -2
- package/assets/renderer-scaffold/test/MyRenderer.t.sol +60 -3
- package/dist/bin.d.ts +26 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +63 -0
- package/dist/bin.js.map +1 -0
- package/dist/capabilities.d.ts +132 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +175 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/commands/auth.d.ts +54 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +483 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/contract.d.ts +19 -0
- package/dist/commands/contract.d.ts.map +1 -0
- package/dist/commands/contract.js +171 -0
- package/dist/commands/contract.js.map +1 -0
- package/dist/commands/deploy.d.ts +296 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +5736 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/feedback.d.ts +7 -0
- package/dist/commands/feedback.d.ts.map +1 -0
- package/dist/commands/feedback.js +154 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/maintenance.d.ts +4 -0
- package/dist/commands/maintenance.d.ts.map +1 -0
- package/dist/commands/maintenance.js +114 -0
- package/dist/commands/maintenance.js.map +1 -0
- package/dist/commands/project.d.ts +458 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +1837 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/reads.d.ts +85 -0
- package/dist/commands/reads.d.ts.map +1 -0
- package/dist/commands/reads.js +881 -0
- package/dist/commands/reads.js.map +1 -0
- package/dist/commands/scaffold.d.ts +89 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +741 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/service.d.ts +67 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +761 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/commands/storage.d.ts +51 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +399 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/commands/submit-app.d.ts +102 -0
- package/dist/commands/submit-app.d.ts.map +1 -0
- package/dist/commands/submit-app.js +638 -0
- package/dist/commands/submit-app.js.map +1 -0
- package/dist/config.d.ts +94 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +332 -12
- package/dist/config.js.map +1 -1
- package/dist/conformance.d.ts +31 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +400 -0
- package/dist/conformance.js.map +1 -0
- package/dist/contract-read-error.d.ts +5 -0
- package/dist/contract-read-error.d.ts.map +1 -0
- package/dist/contract-read-error.js +37 -0
- package/dist/contract-read-error.js.map +1 -0
- package/dist/creator-agent.d.ts +49 -0
- package/dist/creator-agent.d.ts.map +1 -0
- package/dist/creator-agent.js +363 -0
- package/dist/creator-agent.js.map +1 -0
- package/dist/creator-keyring.d.ts +26 -0
- package/dist/creator-keyring.d.ts.map +1 -0
- package/dist/creator-keyring.js +57 -0
- package/dist/creator-keyring.js.map +1 -0
- package/dist/creator-signer.d.ts +52 -0
- package/dist/creator-signer.d.ts.map +1 -0
- package/dist/creator-signer.js +267 -0
- package/dist/creator-signer.js.map +1 -0
- package/dist/deploy-plan.d.ts +218 -0
- package/dist/deploy-plan.d.ts.map +1 -0
- package/dist/deploy-plan.js +20 -0
- package/dist/deploy-plan.js.map +1 -0
- package/dist/deps.d.ts +6 -39
- package/dist/deps.d.ts.map +1 -1
- package/dist/deps.js +4 -68
- package/dist/deps.js.map +1 -1
- package/dist/errors.d.ts +22 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +32 -0
- package/dist/errors.js.map +1 -0
- package/dist/flag-allowlists.d.ts +53 -0
- package/dist/flag-allowlists.d.ts.map +1 -0
- package/dist/flag-allowlists.js +188 -0
- package/dist/flag-allowlists.js.map +1 -0
- package/dist/flags.d.ts +53 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +151 -1
- package/dist/flags.js.map +1 -1
- package/dist/jsonout.d.ts +37 -0
- package/dist/jsonout.d.ts.map +1 -0
- package/dist/jsonout.js +79 -0
- package/dist/jsonout.js.map +1 -0
- package/dist/kind.d.ts +57 -0
- package/dist/kind.d.ts.map +1 -0
- package/dist/kind.js +122 -0
- package/dist/kind.js.map +1 -0
- package/dist/main.js +859 -5374
- package/dist/main.js.map +1 -1
- package/dist/mintpage.d.ts +17 -2
- package/dist/mintpage.d.ts.map +1 -1
- package/dist/mintpage.js +241 -54
- package/dist/mintpage.js.map +1 -1
- package/dist/output.d.ts +184 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +774 -0
- package/dist/output.js.map +1 -0
- package/dist/ownerops.d.ts +450 -57
- package/dist/ownerops.d.ts.map +1 -1
- package/dist/ownerops.js +2219 -358
- package/dist/ownerops.js.map +1 -1
- package/dist/preview.d.ts +23 -5
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +95 -43
- package/dist/preview.js.map +1 -1
- package/dist/provision.d.ts +3 -13
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +19 -21
- package/dist/provision.js.map +1 -1
- package/dist/remote.d.ts +116 -9
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +371 -14
- package/dist/remote.js.map +1 -1
- package/dist/riskgate.d.ts +101 -0
- package/dist/riskgate.d.ts.map +1 -0
- package/dist/riskgate.js +343 -0
- package/dist/riskgate.js.map +1 -0
- package/dist/scaffold.d.ts +12 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +56 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/schema.d.ts +36 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +121 -26
- package/dist/schema.js.map +1 -1
- package/dist/script-chunks.d.ts +8 -0
- package/dist/script-chunks.d.ts.map +1 -0
- package/dist/script-chunks.js +35 -0
- package/dist/script-chunks.js.map +1 -0
- package/dist/served.d.ts +30 -0
- package/dist/served.d.ts.map +1 -0
- package/dist/served.js +112 -0
- package/dist/served.js.map +1 -0
- package/dist/signer.d.ts +20 -1
- package/dist/signer.d.ts.map +1 -1
- package/dist/signer.js +110 -18
- package/dist/signer.js.map +1 -1
- package/dist/update-check.d.ts +60 -9
- package/dist/update-check.d.ts.map +1 -1
- package/dist/update-check.js +105 -18
- package/dist/update-check.js.map +1 -1
- package/package.json +17 -12
- package/skill/SKILL.md +211 -354
- package/skill/agents/openai.yaml +4 -0
- package/skill/reference/capabilities.md +195 -0
- package/skill/reference/code.md +236 -0
- package/skill/reference/creator-token.md +94 -0
- package/skill/reference/deploy.md +177 -0
- package/skill/reference/diagnose.md +178 -0
- package/skill/reference/hosting.md +191 -102
- package/skill/reference/operate.md +237 -0
- package/skill/reference/services.md +173 -0
- package/skill/reference/setup.md +221 -42
- package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +0 -32
- package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +0 -26
- package/dist/inspect.d.ts +0 -48
- package/dist/inspect.d.ts.map +0 -1
- package/dist/inspect.js +0 -184
- package/dist/inspect.js.map +0 -1
- package/dist/migrate.d.ts +0 -65
- package/dist/migrate.d.ts.map +0 -1
- package/dist/migrate.js +0 -180
- package/dist/migrate.js.map +0 -1
- package/dist/onchain-uri.d.ts +0 -97
- package/dist/onchain-uri.d.ts.map +0 -1
- package/dist/onchain-uri.js +0 -243
- package/dist/onchain-uri.js.map +0 -1
- package/dist/upload.d.ts +0 -28
- package/dist/upload.d.ts.map +0 -1
- package/dist/upload.js +0 -41
- package/dist/upload.js.map +0 -1
- package/skill/reference/code-projects.md +0 -246
- package/skill/reference/operating.md +0 -118
- package/skill/reference/troubleshooting.md +0 -28
package/skill/reference/setup.md
CHANGED
|
@@ -1,42 +1,221 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
package/dist/inspect.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/inspect.js
DELETED
|
@@ -1,184 +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
|
-
/** Approx bytes a known on-chain dependency adds to the ASSEMBLED document (gzip'd + base64'd, as it
|
|
13
|
-
* rides in the inline data-URI). Measured from real drops; used only for the RPC-size estimate. */
|
|
14
|
-
const KNOWN_DEP_DOC_BYTES = {
|
|
15
|
-
'p5@1.0.0': 200_000, // p5 1.0.0 (~623KB raw) rides ~200KB gzip+base64 in the document
|
|
16
|
-
};
|
|
17
|
-
/** The on-chain runtime the generator always inlines (abx.js + the gunzip bootstrap), base64'd. */
|
|
18
|
-
const RUNTIME_DOC_BYTES = 13_000;
|
|
19
|
-
/** A single `eth_call` returning `tokenURI` comfortably carries this much document on a default node
|
|
20
|
-
* (geth's 50M gas cap; memory expansion is ~quadratic). Past it, marketplaces that call `tokenURI`
|
|
21
|
-
* once may time out — prefer the generator's piecewise getters, directory mode, or a CDN dep. */
|
|
22
|
-
const SINGLE_CALL_DOC_CEILING = 1_500_000;
|
|
23
|
-
/** PostParam keys the script READS from tokenData — the palette-style customization inputs. A deploy
|
|
24
|
-
* that omits these from `--schema` silently drops them (the render sees `undefined` → its default),
|
|
25
|
-
* which is exactly how a real session "forgot" the palette it had itself identified. Heuristic (the
|
|
26
|
-
* script isn't executed): find identifiers aliased to `abx.tokenData`, then their property reads;
|
|
27
|
-
* plus direct `abx.tokenData.key`, destructuring, and `tokenData['key']`. `seed` is intrinsic, not a
|
|
28
|
-
* PostParam, so it's excluded. Advisory — over- or under-detection is a hint, never a hard gate. */
|
|
29
|
-
function paramKeys(source) {
|
|
30
|
-
const keys = new Set();
|
|
31
|
-
const add = (k) => { if (k && k !== 'seed')
|
|
32
|
-
keys.add(k); };
|
|
33
|
-
// Identifiers aliased to the token-data object — either `abx.tokenData` (via abx.js) or the raw
|
|
34
|
-
// injected global `window.abxTokenData` (e.g. `var td = (window.abx && abx.tokenData) || {}`).
|
|
35
|
-
const aliases = new Set();
|
|
36
|
-
// The `(?!…\.[A-Za-z_$])` guard: only alias when the RHS is the tokenData OBJECT, not a PROPERTY of
|
|
37
|
-
// it — `const seed = abx.tokenData.seed` aliases `seed` to a scalar, so its method calls
|
|
38
|
-
// (`seed.startsWith(…)`) must NOT be read as params (the false-positive that flagged startsWith/slice).
|
|
39
|
-
const aliasRe = /\b([A-Za-z_$][\w$]*)\s*=\s*[^;\n]*(?:abx\s*\??\s*\.\s*tokenData|window\s*\??\s*\.\s*abxTokenData)(?!\s*\??\s*\.\s*[A-Za-z_$])/g;
|
|
40
|
-
let m;
|
|
41
|
-
while ((m = aliasRe.exec(source)) !== null)
|
|
42
|
-
aliases.add(m[1]);
|
|
43
|
-
for (const a of aliases) {
|
|
44
|
-
// `(?!\s*\()` excludes method CALLS (`td.slice(…)`) — a param read is a bare property, never a call.
|
|
45
|
-
const dotRe = new RegExp(`\\b${a.replace(/[$]/g, '\\$')}\\s*\\??\\s*\\.\\s*([A-Za-z_$][\\w$]*)(?!\\s*\\()`, 'g');
|
|
46
|
-
let d;
|
|
47
|
-
while ((d = dotRe.exec(source)) !== null)
|
|
48
|
-
add(d[1]);
|
|
49
|
-
}
|
|
50
|
-
// Direct `abx.tokenData.key` and `abx.tokenData['key']`.
|
|
51
|
-
const directRe = /abx\s*\??\s*\.\s*tokenData\s*\??\s*(?:\.\s*([A-Za-z_$][\w$]*)|\[\s*['"]([^'"]+)['"]\s*\])/g;
|
|
52
|
-
while ((m = directRe.exec(source)) !== null)
|
|
53
|
-
add(m[1] ?? m[2]);
|
|
54
|
-
// Destructuring: `const { palette, foo } = abx.tokenData` (or an alias).
|
|
55
|
-
const destrRe = /(?:const|let|var)\s*\{([^}]*)\}\s*=\s*[^;\n]*(?:abx\s*\.\s*tokenData|\b(?:tokenData|td)\b)/g;
|
|
56
|
-
while ((m = destrRe.exec(source)) !== null) {
|
|
57
|
-
for (const part of m[1].split(','))
|
|
58
|
-
add(part.split(':')[0].trim().replace(/\.\.\./, '') || undefined);
|
|
59
|
-
}
|
|
60
|
-
return [...keys];
|
|
61
|
-
}
|
|
62
|
-
/** Extract the key names from the first `abx.traits({ ... })` object literal (flat objects only). */
|
|
63
|
-
function traitKeys(source) {
|
|
64
|
-
const m = source.match(/abx\s*\??\s*\.\s*traits\s*\(\s*\{([^}]*)\}/);
|
|
65
|
-
if (!m)
|
|
66
|
-
return [];
|
|
67
|
-
const keys = [];
|
|
68
|
-
// A key sits at the start of the object or right after a comma (so a ternary VALUE like
|
|
69
|
-
// `? 'Sparse' : 'Dense'` — a `:` not preceded by `,`/`{` — is never mistaken for a key). Allow
|
|
70
|
-
// leading whitespace after `^` so the FIRST key (preceded only by the newline after `{`) is caught.
|
|
71
|
-
// A key is EITHER a quoted string (arbitrary content — `'Plant Count'`, a spaced trait_type a
|
|
72
|
-
// marketplace shows) OR a bare identifier; a bare-identifier-only match silently dropped quoted
|
|
73
|
-
// keys, and "believe inspect" then sent authors chasing a phantom missing trait.
|
|
74
|
-
const re = /(?:^\s*|[,{]\s*)(?:(['"])([^'"]+)\1|([A-Za-z_$][\w$]*))\s*:/g;
|
|
75
|
-
let k;
|
|
76
|
-
while ((k = re.exec(m[1])) !== null)
|
|
77
|
-
keys.push(k[2] ?? k[3]);
|
|
78
|
-
return [...new Set(keys)];
|
|
79
|
-
}
|
|
80
|
-
export function analyzeScript(source, declaredDeps = []) {
|
|
81
|
-
const bytes = new TextEncoder().encode(source).length;
|
|
82
|
-
const keys = traitKeys(source);
|
|
83
|
-
const usesMathRandom = /Math\s*\.\s*random\s*\(/.test(source);
|
|
84
|
-
// p5's bare random(...) — a `random(` NOT preceded by `.` or a word char (so not Math.random / obj.random)
|
|
85
|
-
const usesBareRandom = /(^|[^.\w])random\s*\(/.test(source);
|
|
86
|
-
const seeded = /\brandomSeed\s*\(/.test(source);
|
|
87
|
-
const usesNoise = /\bnoise\s*\(/.test(source);
|
|
88
|
-
const looksP5 = /\bcreateCanvas\s*\(|function\s+setup\s*\(|function\s+draw\s*\(|\bp5\b/.test(source);
|
|
89
|
-
const depHints = [];
|
|
90
|
-
if (looksP5)
|
|
91
|
-
depHints.push('p5');
|
|
92
|
-
if (/\bTHREE\b/.test(source))
|
|
93
|
-
depHints.push('three');
|
|
94
|
-
if (/\bTone\b/.test(source))
|
|
95
|
-
depHints.push('tone');
|
|
96
|
-
// The abx.js runtime data contract — does the script read state + report traits the ONE way the
|
|
97
|
-
// toolkit injects/captures them? A near-miss global deploys fine but is silently broken.
|
|
98
|
-
// `\??\s*\.` tolerates optional chaining (`abx?.tokenData`) — a common, correct way to read it.
|
|
99
|
-
const readsTokenData = /abx\s*\??\s*\.\s*tokenData\b/.test(source) || /window\s*\??\s*\.\s*abxTokenData\b/.test(source);
|
|
100
|
-
const reportsTraits = /abx\s*\??\s*\.\s*traits\s*\(/.test(source);
|
|
101
|
-
let wrongGlobal = null;
|
|
102
|
-
if (!readsTokenData) {
|
|
103
|
-
if (/window\s*\.\s*tokenTraits\b/.test(source))
|
|
104
|
-
wrongGlobal = 'window.tokenTraits — traits are reported by CALLING abx.traits({…}), never by writing a global';
|
|
105
|
-
else if (/window\s*\.\s*tokenData\b/.test(source))
|
|
106
|
-
wrongGlobal = 'window.tokenData — abx injects window.abxTokenData (read it via abx.tokenData), not window.tokenData';
|
|
107
|
-
else if (/\btokenData\b/.test(source))
|
|
108
|
-
wrongGlobal = 'a bare `tokenData` — read abx.tokenData (via abx.js) or the raw window.abxTokenData global';
|
|
109
|
-
}
|
|
110
|
-
// Trait-reproducibility rubric (see docs/research/onchain-traits-feasibility.md).
|
|
111
|
-
let verdict;
|
|
112
|
-
let reason;
|
|
113
|
-
if (keys.length === 0) {
|
|
114
|
-
verdict = 'none';
|
|
115
|
-
reason = 'no abx.traits({…}) call → NO marketplace traits on ANY lane. A resolver captures the keys you pass to abx.traits(); it does not invent traits from internal variables or a global. Call abx.traits({…}) in the sketch if you want filterable traits.';
|
|
116
|
-
}
|
|
117
|
-
else if (usesMathRandom && !seeded) {
|
|
118
|
-
verdict = 'infeasible';
|
|
119
|
-
reason = 'traits derive from Math.random() (unseeded) — non-deterministic, reproducible nowhere. Serve attributes via a resolver, or ship without marketplace traits.';
|
|
120
|
-
}
|
|
121
|
-
else if (seeded && looksP5) {
|
|
122
|
-
verdict = 'exact-likely';
|
|
123
|
-
reason = 'seeded p5 random() is a documented LCG — integer floor/threshold/select traits port EXACTLY to Solidity. Confirm no trait keys off a raw float value. Wire with --attributes-renderer (see docs/research/onchain-traits-feasibility.md).';
|
|
124
|
-
}
|
|
125
|
-
else if (seeded) {
|
|
126
|
-
verdict = 'careful';
|
|
127
|
-
reason = "seeded, but the PRNG isn't identified as p5 — reproducible on-chain if you port that generator + the exact call order.";
|
|
128
|
-
}
|
|
129
|
-
else if (usesBareRandom) {
|
|
130
|
-
verdict = 'unknown';
|
|
131
|
-
reason = 'traits present and random() is used, but no randomSeed() was found — check the art is deterministic before attempting on-chain traits.';
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
verdict = 'exact-likely';
|
|
135
|
-
reason = 'traits look derived from the seed/params directly (no PRNG) — reproducible on-chain via an attributes field-renderer.';
|
|
136
|
-
}
|
|
137
|
-
const deps = declaredDeps;
|
|
138
|
-
let unknownDepSizes = false;
|
|
139
|
-
let depDocBytes = 0;
|
|
140
|
-
for (const d of deps) {
|
|
141
|
-
if (d in KNOWN_DEP_DOC_BYTES)
|
|
142
|
-
depDocBytes += KNOWN_DEP_DOC_BYTES[d];
|
|
143
|
-
else
|
|
144
|
-
unknownDepSizes = true;
|
|
145
|
-
}
|
|
146
|
-
const estBytes = bytes + RUNTIME_DOC_BYTES + depDocBytes;
|
|
147
|
-
return {
|
|
148
|
-
bytes,
|
|
149
|
-
estChunks: Math.max(1, Math.ceil(bytes / 22_000)),
|
|
150
|
-
traits: { present: keys.length > 0, keys },
|
|
151
|
-
paramHints: paramKeys(source),
|
|
152
|
-
prng: { seeded, usesBareRandom, usesMathRandom, usesNoise },
|
|
153
|
-
depHints,
|
|
154
|
-
looksP5,
|
|
155
|
-
feasibility: { verdict, reason },
|
|
156
|
-
doc: { estBytes, deps, fitsSingleCall: estBytes <= SINGLE_CALL_DOC_CEILING && !unknownDepSizes, unknownDepSizes },
|
|
157
|
-
runtime: { readsTokenData, reportsTraits, wrongGlobal },
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
/** A one-line lane recommendation derived from the analysis (the decision-tree output). */
|
|
161
|
-
export function recommendLane(a) {
|
|
162
|
-
const bigDoc = !a.doc.fitsSingleCall && !a.doc.unknownDepSizes;
|
|
163
|
-
if (bigDoc) {
|
|
164
|
-
return 'DIRECTORY mode (--code-dir) or a CDN dependency — the assembled document is too large for a single tokenURI eth_call to be reliable.';
|
|
165
|
-
}
|
|
166
|
-
if (a.feasibility.verdict === 'infeasible') {
|
|
167
|
-
return 'RESOLVER lane (--public-base-url) if marketplace traits matter (a server serves the JS-derived attributes), OR --onchain-uri and accept no marketplace traits (the tokenURI + animation are still fully on-chain).';
|
|
168
|
-
}
|
|
169
|
-
if (a.feasibility.verdict === 'exact-likely' || a.feasibility.verdict === 'none') {
|
|
170
|
-
const dep = a.depHints.length ? ` --dep ${a.depHints[0]}@<version>` : '';
|
|
171
|
-
const docKb = Math.round(a.doc.estBytes / 1000);
|
|
172
|
-
// Owner call (real-world experience): for a generative drop meant to sell, LEAD with the off-chain
|
|
173
|
-
// resolver — maneuverable over time + marketplaces fetch a SMALL tokenURI reliably. Fully-on-chain
|
|
174
|
-
// is the durability-max alternative, but its ~docKb tokenURI (whole doc per call) strains some
|
|
175
|
-
// marketplace/indexer reads. Traits are NOT a free flag on the on-chain lane (deployed renderer).
|
|
176
|
-
const traits = a.traits.present
|
|
177
|
-
? ` Traits (${a.traits.keys.join(', ')}): the resolver serves them from the render with no Solidity; on the on-chain lane they need a DEPLOYED --attributes-renderer (fork SeedTraitsRenderer.sol) or they're omitted.`
|
|
178
|
-
: ``;
|
|
179
|
-
return (`RECOMMENDED for a drop you'll sell — OFF-CHAIN RESOLVER (--public-base-url + an effects runner): maneuverable (metadata/serving can evolve without on-chain surgery) and marketplaces fetch a SMALL tokenURI reliably.${traits}\n` +
|
|
180
|
-
` ALTERNATIVE — FULLY ON-CHAIN (--onchain-uri${dep} --image-base <bucket>): maximal durability / no server, but the tokenURI carries the whole ~${docKb}KB document per call (some marketplace + indexer reads choke on a doc this big), stills are MANUAL, and later changes are on-chain re-points. Pick it when permanence + zero-infra outweigh maneuverability.`);
|
|
181
|
-
}
|
|
182
|
-
return (`RECOMMENDED — an OFF-CHAIN RESOLVER (--public-base-url): maneuverable, and it serves traits from the render regardless of the PRNG. --onchain-uri also works for tokenURI + animation, but first verify the script is deterministic (see the feasibility note), and note the large-tokenURI marketplace-read tradeoff; on that lane traits need a DEPLOYED --attributes-renderer or are omitted.`);
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=inspect.js.map
|
package/dist/inspect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;oGACoG;AACpG,MAAM,mBAAmB,G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