@artblocks/abx-cli 0.1.0-alpha.2 → 0.1.0-alpha.20
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 +1762 -0
- package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +17 -0
- package/assets/renderer-scaffold/test/MyRenderer.t.sol +51 -2
- package/dist/commands/deploy.d.ts +206 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +4004 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/project.d.ts +241 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +1044 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/reads.d.ts +64 -0
- package/dist/commands/reads.d.ts.map +1 -0
- package/dist/commands/reads.js +667 -0
- package/dist/commands/reads.js.map +1 -0
- package/dist/commands/scaffold.d.ts +71 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +544 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/service.d.ts +41 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +618 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/commands/storage.d.ts +37 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +335 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/config.d.ts +91 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +244 -11
- 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 +371 -0
- package/dist/conformance.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 +20 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +25 -0
- package/dist/errors.js.map +1 -0
- package/dist/flags.d.ts +41 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +94 -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 +68 -0
- package/dist/jsonout.js.map +1 -0
- package/dist/kind.d.ts +48 -0
- package/dist/kind.d.ts.map +1 -0
- package/dist/kind.js +69 -0
- package/dist/kind.js.map +1 -0
- package/dist/main.js +509 -4708
- 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 +214 -52
- package/dist/mintpage.js.map +1 -1
- package/dist/output.d.ts +148 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +634 -0
- package/dist/output.js.map +1 -0
- package/dist/ownerops.d.ts +132 -44
- package/dist/ownerops.d.ts.map +1 -1
- package/dist/ownerops.js +1067 -327
- package/dist/ownerops.js.map +1 -1
- package/dist/preview.d.ts +81 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +535 -0
- package/dist/preview.js.map +1 -0
- package/dist/prompt.d.ts +17 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +19 -0
- package/dist/prompt.js.map +1 -0
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +10 -7
- package/dist/provision.js.map +1 -1
- package/dist/remote.d.ts +134 -53
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +352 -46
- package/dist/remote.js.map +1 -1
- package/dist/riskgate.d.ts +29 -0
- package/dist/riskgate.d.ts.map +1 -0
- package/dist/riskgate.js +91 -0
- package/dist/riskgate.js.map +1 -0
- package/dist/scaffold.d.ts +10 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +52 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/schema.d.ts +18 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +74 -23
- package/dist/schema.js.map +1 -1
- 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 +13 -0
- package/dist/signer.d.ts.map +1 -1
- package/dist/signer.js +80 -14
- package/dist/signer.js.map +1 -1
- package/dist/update-check.d.ts +58 -4
- package/dist/update-check.d.ts.map +1 -1
- package/dist/update-check.js +92 -11
- package/dist/update-check.js.map +1 -1
- package/package.json +10 -6
- package/skill/SKILL.md +104 -60
- package/skill/reference/code-projects.md +87 -13
- package/skill/reference/creator-token.md +86 -0
- package/skill/reference/decisions.md +61 -0
- package/skill/reference/hosting.md +48 -15
- package/skill/reference/operating.md +29 -8
- package/skill/reference/setup.md +10 -3
- package/skill/reference/troubleshooting.md +31 -4
- 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
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scaffolding + environment commands: `doctor` (check key/RPC/balance/factory/storage — and offer
|
|
3
|
+
* to install/resync the agent skill), `mint-page` (a self-contained Next.js minting app),
|
|
4
|
+
* `scaffold-renderer` (copy the Solidity on-chain-renderer starting point), and `skill` (install
|
|
5
|
+
* the version-locked abx agent skill into a coding agent).
|
|
6
|
+
*/
|
|
7
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
8
|
+
import { homedir } from 'node:os';
|
|
9
|
+
import { basename, join as joinPath, resolve as resolvePath } from 'node:path';
|
|
10
|
+
import { createInterface } from 'node:readline';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { isCurrentFactory, isCurrentOneOfOneEditionFactory, makePublicClient, makeWalletClient, oneOfOneImageAbi, probeRpcEndpoints, resolveChain, } from '@artblocks/abx-sdk';
|
|
13
|
+
import { arweaveAddress, probeStorageBackend, resolveBackend } from '@artblocks/abx-storage';
|
|
14
|
+
import { formatEther } from 'viem';
|
|
15
|
+
import { CHAIN, activeBackendId, arweaveKeyFilePath, factoryAddress, faucetHint, fixedPriceMinterAddress, fixedPriceMinter1155Address, oneOfOneEditionFactoryAddress, loadArweaveJwk, storageOptions, } from '../config.js';
|
|
16
|
+
import { CliError } from '../errors.js';
|
|
17
|
+
import { detectTokenKind } from '../kind.js';
|
|
18
|
+
import { PUBLIC_RPC, mintPageArtifact } from '../mintpage.js';
|
|
19
|
+
import { bold, c, dim, findRepoRoot, g, info, ok, step, warn } from '../output.js';
|
|
20
|
+
import { declinesSkillInstall } from '../prompt.js';
|
|
21
|
+
import { listConfiguredRemotes, misnamedRemoteVars, selfTokenMigrationWarning } from '../remote.js';
|
|
22
|
+
import { copyRendererScaffold } from '../scaffold.js';
|
|
23
|
+
import { AGENT_SKILL_PARENTS, SKILL_DIR_NAME, binaryProvenance, checkForCliUpdate, compareVersions, installedSkillVersions, readCliVersion, readSkillVersion, } from '../update-check.js';
|
|
24
|
+
// ── doctor ────────────────────────────────────────────────────────────────--
|
|
25
|
+
/**
|
|
26
|
+
* Doctor's "want me to fix that?" for a missing or stale skill. Three lanes, deliberately:
|
|
27
|
+
* `--fix` install without asking (CI, scripts, an agent running doctor for someone)
|
|
28
|
+
* interactive name the exact directories, then ask — Enter accepts, since doctor's whole job is
|
|
29
|
+
* getting setup right and this is the one check whose fix is a local file copy
|
|
30
|
+
* non-TTY change NOTHING and print how to do it; a diagnostic must never mutate a
|
|
31
|
+
* scripted environment just because nobody was there to say no
|
|
32
|
+
* Honors `--global` / `--agent` so the fix can target the same place an explicit install would.
|
|
33
|
+
*/
|
|
34
|
+
export async function offerSkillInstall(flags, stale, indent) {
|
|
35
|
+
const opts = { global: flags.global !== undefined, agent: flags.agent };
|
|
36
|
+
const src = resolveBundledSkill();
|
|
37
|
+
if (!src)
|
|
38
|
+
return; // no bundled skill to install (dev checkout oddity) — the hint above still stands
|
|
39
|
+
const verb = stale ? 'resync' : 'install';
|
|
40
|
+
const dests = defaultSkillDests(opts);
|
|
41
|
+
if (flags.fix === undefined) {
|
|
42
|
+
if (!process.stdin.isTTY) {
|
|
43
|
+
console.log(`${indent}${dim(`non-interactive — run \`abx doctor --fix\` (or \`abx skill install\`) to ${verb} it.`)}`);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
47
|
+
const answer = await new Promise((resolve) => {
|
|
48
|
+
// EOF (Ctrl-D) closes the interface WITHOUT firing the question callback — awaiting only the
|
|
49
|
+
// callback would hang doctor forever. Treat a closed stream as a decline: the safe direction is
|
|
50
|
+
// always "change nothing", never "write files because nobody answered".
|
|
51
|
+
rl.once('close', () => resolve('n'));
|
|
52
|
+
rl.question(`${indent}${verb} the abx skill into ${bold(dests)} now? [Y/n] `, resolve);
|
|
53
|
+
});
|
|
54
|
+
rl.close();
|
|
55
|
+
if (declinesSkillInstall(answer)) {
|
|
56
|
+
console.log(`${indent}${dim(`skipped — \`abx skill install\` when you want it.`)}`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
console.log('');
|
|
61
|
+
installSkillToDefaults(src, opts);
|
|
62
|
+
}
|
|
63
|
+
export async function cmdDoctor(flags) {
|
|
64
|
+
console.log(bold('\n abx doctor') + dim(` · ${CHAIN}`) + '\n');
|
|
65
|
+
// Two visual tiers: PASS/FAIL checks (✓/✗) for things that are either working or broken, and an
|
|
66
|
+
// "Optional" block (·) for path-dependent setup that is fine to be unset. We deliberately do NOT
|
|
67
|
+
// use ⚠ for "unset but often fine" — that read as noise; ⚠ is reserved for a real gotcha (a
|
|
68
|
+
// range-capped RPC). Labels are padded so both tiers align.
|
|
69
|
+
const CONT = ' '.repeat(17); // continuation indent: aligns under a check/opt detail column
|
|
70
|
+
const check = (label, pass, detail = '') => console.log(` ${pass ? g('✓') : `${c.red}✗${c.reset}`} ${label.padEnd(13)}${detail ? dim(detail) : ''}`);
|
|
71
|
+
const opt = (label, detail) => console.log(` ${dim('·')} ${label.padEnd(13)}${dim(detail)}`);
|
|
72
|
+
const hasKey = !!process.env.ABX_DEPLOYER_PK;
|
|
73
|
+
// 1. Agent skill — FIRST and prominent. The primary way to use abx is to let a coding agent drive
|
|
74
|
+
// it, so a missing/stale skill is a ✗: not broken infra, but the main UX isn't set up. Its
|
|
75
|
+
// version lives in SKILL.md frontmatter (version-locked to this CLI). Notify-only — no exit code.
|
|
76
|
+
const cliVersion = readCliVersion();
|
|
77
|
+
const skillVersions = installedSkillVersions();
|
|
78
|
+
const staleSkills = skillVersions.filter((v) => compareVersions(cliVersion, v) > 0);
|
|
79
|
+
const skillMissing = skillVersions.length === 0;
|
|
80
|
+
const skillStale = !skillMissing && staleSkills.length > 0;
|
|
81
|
+
if (skillMissing) {
|
|
82
|
+
check('agent skill', false, `not installed — run ${g('abx skill install')}`);
|
|
83
|
+
console.log(`${CONT}${dim('(recommended: let a coding agent drive abx)')}`);
|
|
84
|
+
}
|
|
85
|
+
else if (skillStale) {
|
|
86
|
+
check('agent skill', false, `v${staleSkills.join(', v')} behind CLI v${cliVersion} — run ${g('abx skill install')}`);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
check('agent skill', true, `in sync (v${cliVersion})`);
|
|
90
|
+
}
|
|
91
|
+
// Offer to fix it here rather than only naming the command. `npm i -g` + `abx skill install` was a
|
|
92
|
+
// two-step install flow where the second step is easy to skip and invisible when skipped (an agent
|
|
93
|
+
// that never learned abx just... doesn't use it). Doctor is already the documented first run, so
|
|
94
|
+
// this collapses the flow without an npm `postinstall` hook — which could not work anyway: npm runs
|
|
95
|
+
// lifecycle scripts with cwd set to the installed package dir (so the skill would land inside
|
|
96
|
+
// node_modules), pnpm gates install scripts by default, and writing to a user's ~/.claude on
|
|
97
|
+
// install is the kind of side effect that belongs to the user, not to us.
|
|
98
|
+
if (skillMissing || skillStale) {
|
|
99
|
+
await offerSkillInstall(flags, skillStale, CONT);
|
|
100
|
+
}
|
|
101
|
+
console.log('');
|
|
102
|
+
// 2. Core environment (✓/✗). Signing-wallet balances are computed here (they need the RPC) but
|
|
103
|
+
// printed in the Optional block below, so buffer them.
|
|
104
|
+
let signingOpt = null;
|
|
105
|
+
let minter1155Opt = null;
|
|
106
|
+
let forOpt = null;
|
|
107
|
+
try {
|
|
108
|
+
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
109
|
+
const bn = await publicClient.getBlockNumber();
|
|
110
|
+
// Collapse the RPC report to one line (best endpoint + head), and only add a ⚠ when there is a
|
|
111
|
+
// genuine problem — a range-capped-only set that will grind a resolver under load.
|
|
112
|
+
const probes = await probeRpcEndpoints({ chainKey: CHAIN });
|
|
113
|
+
const usable = probes.filter((pr) => pr.verdict !== 'unusable');
|
|
114
|
+
const best = probes.find((pr) => pr.verdict === 'best') ?? usable[0];
|
|
115
|
+
if (usable.length > 0) {
|
|
116
|
+
check('RPC', true, `${best.label} · head ${bn} · ${best.verdict === 'best' ? 'wide range + archive' : 'range-capped'}`);
|
|
117
|
+
if (!probes.some((pr) => pr.verdict === 'best')) {
|
|
118
|
+
console.log(`${CONT}${c.orange}⚠${c.reset}${dim(' every endpoint is getLogs-range-capped — add a wide-range archive RPC to ABX_RPC_URLS before running a resolver under load')}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
check('RPC', false, `${CHAIN} — no endpoint usable for reconstruction; add a wide-range archive RPC to ABX_RPC_URLS`);
|
|
123
|
+
}
|
|
124
|
+
const factory = factoryAddress();
|
|
125
|
+
if (factory) {
|
|
126
|
+
const code = await publicClient.getCode({ address: factory });
|
|
127
|
+
if (!code || code === '0x')
|
|
128
|
+
check('factory', false, `${factory} — no code on ${CHAIN}; \`abx deploy\` redeploys`);
|
|
129
|
+
else if (await isCurrentFactory(publicClient, factory))
|
|
130
|
+
check('factory', true, factory);
|
|
131
|
+
else
|
|
132
|
+
check('factory', false, `${factory} — older/incompatible; \`abx deploy\` redeploys`);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
check('factory', false, 'none yet — `abx demo` deploys one');
|
|
136
|
+
}
|
|
137
|
+
// The edition twin — same shape as the 721 `factory` check above (isCurrent* probe, same
|
|
138
|
+
// pass/fail posture on "no code yet"). The other two edition factories (EditionImage/
|
|
139
|
+
// EditionCode) and the two edition-related singletons that have no analogous check today
|
|
140
|
+
// either (the 1155 minter, and — same as the 721 minter — no code-version probe to run) are
|
|
141
|
+
// left to their own commands' own bootstrap (`abx deploy-series --copies` / `deploy-code
|
|
142
|
+
// --copies` / `minter configure --token-id`) rather than duplicating a fourth/fifth check here.
|
|
143
|
+
const editionFactory = oneOfOneEditionFactoryAddress();
|
|
144
|
+
if (editionFactory) {
|
|
145
|
+
const code = await publicClient.getCode({ address: editionFactory });
|
|
146
|
+
if (!code || code === '0x')
|
|
147
|
+
check('edition factory', false, `${editionFactory} — no code on ${CHAIN}; \`abx deploy --copies <n|open>\` redeploys`);
|
|
148
|
+
else if (await isCurrentOneOfOneEditionFactory(publicClient, editionFactory))
|
|
149
|
+
check('edition factory', true, editionFactory);
|
|
150
|
+
else
|
|
151
|
+
check('edition factory', false, `${editionFactory} — older/incompatible; \`abx deploy --copies <n|open>\` redeploys`);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
check('edition factory', false, 'none yet — `abx deploy --copies <n|open>` deploys one');
|
|
155
|
+
}
|
|
156
|
+
// The shared edition sale singleton — Optional, not pass/fail: unlike the factory (a platform
|
|
157
|
+
// allowlist anchor), a project that never sells through the shared minter has no reason to have
|
|
158
|
+
// one deployed yet (same reason there is no equivalent 721 `fixedPriceMinter` check above).
|
|
159
|
+
const minter1155 = fixedPriceMinter1155Address();
|
|
160
|
+
if (minter1155) {
|
|
161
|
+
const code = await publicClient.getCode({ address: minter1155 });
|
|
162
|
+
minter1155Opt = code && code !== '0x' ? minter1155 : `${minter1155} configured but no code on ${CHAIN} — \`abx minter configure <addr> --token-id <n> …\` redeploys`;
|
|
163
|
+
}
|
|
164
|
+
if (hasKey) {
|
|
165
|
+
const { account } = makeWalletClient({ chainKey: CHAIN });
|
|
166
|
+
const bal = await publicClient.getBalance({ address: account.address });
|
|
167
|
+
signingOpt = `env key ${account.address} · ${bal > 0n ? `funded ${formatEther(bal)} ETH` : `empty — fund it (${faucetHint(CHAIN)})`}`;
|
|
168
|
+
}
|
|
169
|
+
if (flags.for) {
|
|
170
|
+
const bal = await publicClient.getBalance({ address: flags.for });
|
|
171
|
+
forOpt = `${flags.for} · ${bal > 0n ? `funded ${formatEther(bal)} ETH` : `empty — ${faucetHint(CHAIN)}`}`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
check('RPC', false, err.message);
|
|
176
|
+
}
|
|
177
|
+
// storage backend — resolve it (catches missing config), then probe liveness/creds. B4: the probe
|
|
178
|
+
// is the fuller `probeStorageBackend` (packages/storage/probe.ts), not a bare `.health()` call —
|
|
179
|
+
// for fs/ipfs that's the SAME check as before (reused, not reimplemented); for cloud it's now a
|
|
180
|
+
// real PUT (API) + GET (public base) round trip — the only thing that catches the R2/S3
|
|
181
|
+
// endpoint-vs-public-base trap `.health()` alone couldn't; arweave adds an identity+balance READ
|
|
182
|
+
// (never a paid upload). Kept fast on purpose: only runs once a backend actually resolves, bounded
|
|
183
|
+
// to 1.5s — the same budget `checkForCliUpdate` below uses for its own network check.
|
|
184
|
+
const backendId = activeBackendId();
|
|
185
|
+
try {
|
|
186
|
+
const backend = resolveBackend(storageOptions());
|
|
187
|
+
const h = await probeStorageBackend(storageOptions(), { timeoutMs: 1500 });
|
|
188
|
+
// Whether this backend can name a public URL for what it stores decides one thing operators hit
|
|
189
|
+
// later: a REMOTE effects runner needs it (the resolver serves referenced output by redirect, so
|
|
190
|
+
// it takes a URL and refuses bytes). Co-located rendering doesn't care — hence a note, not a fail.
|
|
191
|
+
const publishable = backend.locator
|
|
192
|
+
? 'can publish to a remote resolver'
|
|
193
|
+
: 'local-only — a remote effects runner needs cloud/ipfs/arweave (co-located rendering is fine)';
|
|
194
|
+
check('storage', h.ok, `${backend.id} · ${h.detail} · ${publishable}`);
|
|
195
|
+
// On failure, name BOTH URLs the cloud check touched — the R2/S3 endpoint-vs-public-base trap is
|
|
196
|
+
// only diagnosable with both hosts on screen, not a bare "fetch failed".
|
|
197
|
+
if (!h.ok && (h.putUrl || h.publicUrl)) {
|
|
198
|
+
console.log(`${CONT}${dim(`put ${h.putUrl ?? '(none)'} · get ${h.publicUrl ?? '(none)'}`)}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
check('storage', false, `${backendId} · ${err.message}`);
|
|
203
|
+
}
|
|
204
|
+
// 2b. Version & provenance — the 3-class drift ladder the skill has long taught in prose
|
|
205
|
+
// ("Resolve the CLI before you install anything"), now checked instead of just explained.
|
|
206
|
+
// `checkForCliUpdate` is already bounded to a ~1.5s network timeout + a 6h disk cache (see
|
|
207
|
+
// update-check.ts), so this never adds a meaningful wait — same budget the RPC probe above uses.
|
|
208
|
+
console.log(`\n ${dim('Version & provenance:')}`);
|
|
209
|
+
const provenance = binaryProvenance();
|
|
210
|
+
if (provenance === 'npx') {
|
|
211
|
+
check('binary', false, 'running via npx — can silently keep serving a stale cached copy after an upgrade');
|
|
212
|
+
console.log(`${CONT}${dim('install instead: `npm install --save-dev @artblocks/abx-cli` (project-local) or `-g` (machine-wide)')}`);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
check('binary', true, provenance === 'source' ? 'source checkout (pnpm abx)' : 'npm install');
|
|
216
|
+
}
|
|
217
|
+
const latest = await checkForCliUpdate(cliVersion);
|
|
218
|
+
if (latest)
|
|
219
|
+
check('npm', false, `v${cliVersion} → v${latest} available — npm i -g @artblocks/abx-cli@latest`);
|
|
220
|
+
else
|
|
221
|
+
check('npm', true, `v${cliVersion} (or offline — checked at most every 6h)`);
|
|
222
|
+
if (skillMissing)
|
|
223
|
+
check('skill ver', false, 'no installed skill to compare — abx skill install');
|
|
224
|
+
else if (skillStale)
|
|
225
|
+
check('skill ver', false, `v${staleSkills.join(', v')} behind CLI v${cliVersion} — abx skill install`);
|
|
226
|
+
else
|
|
227
|
+
check('skill ver', true, `v${cliVersion} matches the CLI`);
|
|
228
|
+
// 3. Optional — path-dependent setup. Unset is fine; these say WHEN you'll need each, so an unset
|
|
229
|
+
// value never reads as a warning.
|
|
230
|
+
console.log(`\n ${dim('Optional — depends how you deploy:')}`);
|
|
231
|
+
if (signingOpt)
|
|
232
|
+
opt('signing', signingOpt);
|
|
233
|
+
else
|
|
234
|
+
opt('signing', 'no env key → sign in your browser wallet (--sign). Preflight yours: `abx doctor --for 0x<addr>`. Set ABX_DEPLOYER_PK for the unattended hot lane.');
|
|
235
|
+
if (forOpt)
|
|
236
|
+
opt('wallet --for', forOpt);
|
|
237
|
+
const baseUrl = process.env.ABX_PUBLIC_BASE_URL;
|
|
238
|
+
if (baseUrl)
|
|
239
|
+
opt('resolver URL', baseUrl);
|
|
240
|
+
else
|
|
241
|
+
opt('resolver URL', 'ABX_PUBLIC_BASE_URL unset → needed for off-chain/resolver-served deploys; skip if fully on-chain (--onchain-image / --onchain-uri).');
|
|
242
|
+
if (minter1155Opt)
|
|
243
|
+
opt('1155 minter', minter1155Opt);
|
|
244
|
+
else
|
|
245
|
+
opt('1155 minter', 'none yet — `abx minter configure <addr> --token-id <n> …` on an edition deploys one');
|
|
246
|
+
if (!process.env.ARWEAVE_JWK && existsSync(arweaveKeyFilePath())) {
|
|
247
|
+
const jwk = loadArweaveJwk();
|
|
248
|
+
opt('arweave key', `${jwk ? arweaveAddress(jwk) + ' ' : ''}holds upload credits — back it up: \`abx storage backup-key --out <path>\``);
|
|
249
|
+
}
|
|
250
|
+
// Named remotes: report what's configured, and — the part doctor was missing — flag a credential
|
|
251
|
+
// stored under a name the CLI does NOT read. That fault presents as "it acts like I never gave it a
|
|
252
|
+
// key", and until now it only surfaced from `abx remote <name>`, which a creator reaches later
|
|
253
|
+
// (doctor is the thing they're told to run FIRST).
|
|
254
|
+
const remotes = listConfiguredRemotes();
|
|
255
|
+
if (remotes.length) {
|
|
256
|
+
opt('remotes', remotes.map((r) => `${r.name.toLowerCase()}${r.hasToken ? '' : ` ${c.orange}(no token)${c.reset}`}`).join(' · '));
|
|
257
|
+
}
|
|
258
|
+
for (const bad of misnamedRemoteVars()) {
|
|
259
|
+
check('remote key', false, `${bad.key} is set but is NOT read — the convention is ${bold(bad.suggestion)} (only _URL and _TOKEN). Rename it.`);
|
|
260
|
+
}
|
|
261
|
+
// The self-host default's credential moved to the named-remote grammar (ABX_REMOTE_SELF_TOKEN) —
|
|
262
|
+
// the OLD var is never read now, so flag it here rather than let a creator discover it as a 401
|
|
263
|
+
// that reads like a wrong key. Same condition `requireRemoteToken` hard-stops a real command on.
|
|
264
|
+
const selfTokenMigration = selfTokenMigrationWarning();
|
|
265
|
+
if (selfTokenMigration)
|
|
266
|
+
check('self token', false, selfTokenMigration);
|
|
267
|
+
console.log('');
|
|
268
|
+
}
|
|
269
|
+
// ── mint-page — scaffold a Next.js mint site for a collection (fixed-price minter) ─────────────
|
|
270
|
+
/**
|
|
271
|
+
* Refuse a mint-page target with NO minter lane. The generated page reads
|
|
272
|
+
* `maxInvocations`/`paused` (or, for an edition, the per-id `totalSupply`/`maxSupply`) and mints
|
|
273
|
+
* through a shared fixed-price minter — none of which a plain 1/1 (`OneOfOneImage`) has, since it
|
|
274
|
+
* has no minter lane at all. Before this check, pointing `mint-page` at a 1/1 wrote a page that
|
|
275
|
+
* compiled and ran fine, then sat on "Loading…" forever with no diagnostic.
|
|
276
|
+
*
|
|
277
|
+
* `kind` is the caller's `detectTokenKind` result — every kind EXCEPT `1of1` composes a minter lane
|
|
278
|
+
* (Series/SeriesCode via `AbxFixedPriceMinter`; the three edition twins via its 1155 sibling — see
|
|
279
|
+
* the parity plan's "deliberate asymmetry" note on why even `OneOfOneEdition`, unlike its 721
|
|
280
|
+
* namesake, ships the sale stack). `undefined` means the probe itself couldn't run (RPC unreachable,
|
|
281
|
+
* address has no code, etc.) — that must NOT refuse: offline/best-effort scaffolding is allowed,
|
|
282
|
+
* same as the `name()` read a few lines above this call.
|
|
283
|
+
*/
|
|
284
|
+
export function assertMintableSeries(token, kind) {
|
|
285
|
+
if (kind?.kind === '1of1') {
|
|
286
|
+
throw new CliError(`${token} looks like a 1/1 (OneOfOneImage) — mint-page sells through a shared fixed-price minter, which needs a Series/EditionImage/EditionCode contract (or an edition of one artwork); a plain 1/1 has no minter lane.\n` +
|
|
287
|
+
` Deploy a Series instead: abx deploy-series --dir <folder> --count 1\n` +
|
|
288
|
+
` …or copies of one artwork: abx deploy --copies <n|open>`);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
export async function cmdMintPage(address, flags) {
|
|
292
|
+
const usage = 'abx mint-page <token> [--dir mint-page] [--name "…"] [--rpc <public-url>] [--minter-contract 0x..]';
|
|
293
|
+
const token = address;
|
|
294
|
+
if (!token || !token.startsWith('0x')) {
|
|
295
|
+
console.error(`usage: ${usage}\n`);
|
|
296
|
+
process.exitCode = 1;
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
300
|
+
// Kind decides which shared minter (721 `AbxFixedPriceMinter` vs its 1155 `…1155` sibling) and
|
|
301
|
+
// which purchase shape (one project-wide sale vs a per-`(token,id)` sale with a quantity) the
|
|
302
|
+
// generated page needs. A probe failure (RPC unreachable, no code at the address) is left
|
|
303
|
+
// `undefined` and does NOT refuse — matches the best-effort name() read below.
|
|
304
|
+
let kind;
|
|
305
|
+
try {
|
|
306
|
+
kind = await detectTokenKind(publicClient, token);
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
warn(`could not confirm ${token}'s kind (RPC unreachable?) — continuing without the check.`);
|
|
310
|
+
}
|
|
311
|
+
assertMintableSeries(token, kind);
|
|
312
|
+
const isEdition = !!kind?.isEdition;
|
|
313
|
+
const minter = isEdition ? fixedPriceMinter1155Address(flags['minter-contract']) : fixedPriceMinterAddress(flags['minter-contract']);
|
|
314
|
+
if (!minter) {
|
|
315
|
+
throw new Error(`no shared ${isEdition ? 'edition ' : ''}fixed-price minter known for ${CHAIN} — run ` +
|
|
316
|
+
`\`abx minter configure ${token}${isEdition ? ' --token-id <n>' : ''} …\` first (it deploys + records one), ` +
|
|
317
|
+
`or set ${isEdition ? 'ABX_FIXED_PRICE_MINTER_1155' : 'ABX_FIXED_PRICE_MINTER'}.`);
|
|
318
|
+
}
|
|
319
|
+
const chain = resolveChain(CHAIN);
|
|
320
|
+
const rpcUrl = flags.rpc && flags.rpc !== 'true' ? flags.rpc : PUBLIC_RPC[chain.id];
|
|
321
|
+
if (!rpcUrl) {
|
|
322
|
+
throw new Error(`no public RPC known for ${CHAIN} (chainId ${chain.id}) — pass --rpc <public-keyless-url> (it is embedded in the public site, so it must not contain a secret key).`);
|
|
323
|
+
}
|
|
324
|
+
// Default the display name from the token's on-chain name (read-only); --name overrides.
|
|
325
|
+
let collectionName = flags.name && flags.name !== 'true' ? flags.name : '';
|
|
326
|
+
if (!collectionName) {
|
|
327
|
+
try {
|
|
328
|
+
collectionName = (await publicClient.readContract({
|
|
329
|
+
address: token,
|
|
330
|
+
abi: oneOfOneImageAbi,
|
|
331
|
+
functionName: 'name',
|
|
332
|
+
}));
|
|
333
|
+
}
|
|
334
|
+
catch {
|
|
335
|
+
collectionName = 'ABX Collection';
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
const art = mintPageArtifact({
|
|
339
|
+
token,
|
|
340
|
+
minter,
|
|
341
|
+
chainId: chain.id,
|
|
342
|
+
chainName: chain.name,
|
|
343
|
+
rpcUrl,
|
|
344
|
+
collectionName,
|
|
345
|
+
explorer: chain.blockExplorers?.default?.url,
|
|
346
|
+
isEdition,
|
|
347
|
+
});
|
|
348
|
+
const dir = flags.dir && flags.dir !== 'true' ? flags.dir : 'mint-page';
|
|
349
|
+
const outDir = resolvePath(dir);
|
|
350
|
+
console.log(bold('\n ABX Self-Host Toolkit — mint page'));
|
|
351
|
+
info(`collection ${bold(collectionName)} ${dim(token)}${isEdition ? dim(` · ${kind.label} (edition)`) : ''}`);
|
|
352
|
+
info(`minter ${minter} ${dim('· ' + chain.name + ' · reads via ' + rpcUrl)}`);
|
|
353
|
+
if (isEdition)
|
|
354
|
+
info(dim('edition purchase shape: token id + quantity, price × qty — no minted-tokens gallery in this v1 page (see the README).'));
|
|
355
|
+
step('Write the mint-page artifact (self-contained Next.js app — reads chain directly, no backend)');
|
|
356
|
+
for (const f of art.files) {
|
|
357
|
+
const dest = joinPath(outDir, f.path);
|
|
358
|
+
mkdirSync(joinPath(dest, '..'), { recursive: true });
|
|
359
|
+
writeFileSync(dest, f.content);
|
|
360
|
+
info(`wrote ${joinPath(dir, f.path)}`);
|
|
361
|
+
}
|
|
362
|
+
step(`Next steps (run from ${bold(dir)}/)`);
|
|
363
|
+
art.steps.forEach((s, i) => console.log(` ${g(`${i + 1}.`)} ${s}`));
|
|
364
|
+
step('Customize — this is a starting point');
|
|
365
|
+
info('Plain React + one CSS file; ask the agent for a bespoke layout per drop. ETH sales + injected wallet by default;');
|
|
366
|
+
info('the README covers RainbowKit (multi-wallet), ERC-20 (add an approve step), and RPC/gallery notes.');
|
|
367
|
+
warn('The RPC in .env.local is PUBLIC (may rate-limit). Never put a secret-keyed RPC in a NEXT_PUBLIC_ var — it ships to the browser.');
|
|
368
|
+
console.log('');
|
|
369
|
+
}
|
|
370
|
+
// ── flags ─────────────────────────────────────────────────────────────────--
|
|
371
|
+
// parseFlags + the Flags type live in flags.ts (unit-testable; repeatable flags like --dep
|
|
372
|
+
// accumulate comma-joined there).
|
|
373
|
+
// ── skill: install the abx agent skill into the user's coding agent ───────────────────────
|
|
374
|
+
// The skill is the agentic half of the toolkit — the CLI is only useful once an agent knows how
|
|
375
|
+
// to drive it. It ships bundled inside the published package (packages/cli/skill/, created at
|
|
376
|
+
// prepack); in dev the same command reads the canonical copy straight from the repo. This is the
|
|
377
|
+
// CANONICAL install path precisely because the bundle is version-locked to the CLI it ships inside
|
|
378
|
+
// (the version lives in SKILL.md frontmatter — see update-check.ts). By default it writes to BOTH
|
|
379
|
+
// `.claude/skills` (Claude Code) and the neutral `.agents/skills` (Cursor · Codex · Gemini ·
|
|
380
|
+
// Copilot all read it), so one command covers the whole ecosystem; `--agent` narrows it. A separate
|
|
381
|
+
// git-based channel, `npx skills add ArtBlocks/abx --skill abx-self-host`, works once the repo is public but is NOT
|
|
382
|
+
// version-locked to a local CLI — prefer `abx skill install`.
|
|
383
|
+
/** Locate the skill folder: the bundled copy beside the compiled CLI (published), else the
|
|
384
|
+
* canonical repo copy (dev). Returns null if neither is present. */
|
|
385
|
+
export function resolveBundledSkill() {
|
|
386
|
+
const here = fileURLToPath(import.meta.url);
|
|
387
|
+
const pkgDir = resolvePath(here, '..', '..');
|
|
388
|
+
const bundled = joinPath(pkgDir, 'skill');
|
|
389
|
+
// Running from SOURCE (`pnpm abx`, tsx on packages/cli/src/**) means we're in the repo working
|
|
390
|
+
// tree, where the canonical skill is the source of truth and `<pkg>/skill` is gitignored PREPACK
|
|
391
|
+
// OUTPUT that may be arbitrarily old. Preferring the bundle there is actively destructive: a
|
|
392
|
+
// leftover `skill/` from a months-old `npm pack` silently overwrote the canonical skill with a
|
|
393
|
+
// copy 8 versions behind (and the drift check then reported the damage as if the user had caused
|
|
394
|
+
// it). In the published layout there is no repo and no canonical copy, so the bundle is correct.
|
|
395
|
+
const fromSource = /[/\\]src[/\\][^/\\]+$/.test(here);
|
|
396
|
+
const root = findRepoRoot();
|
|
397
|
+
const canonical = root ? joinPath(root, '.claude', 'skills', 'abx-self-host') : null;
|
|
398
|
+
if (fromSource && canonical && existsSync(joinPath(canonical, 'SKILL.md')))
|
|
399
|
+
return canonical;
|
|
400
|
+
// Published layout: dist/main.js → <pkg>/skill (see scripts/bundle-skill.mjs).
|
|
401
|
+
if (existsSync(joinPath(bundled, 'SKILL.md')))
|
|
402
|
+
return bundled;
|
|
403
|
+
if (canonical && existsSync(joinPath(canonical, 'SKILL.md')))
|
|
404
|
+
return canonical;
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
/** Locate the in-chain renderer Foundry scaffold: bundled beside the CLI (published), else the
|
|
408
|
+
* repo copy (dev). Same layout in both — it lives under the CLI package's `assets/`. */
|
|
409
|
+
export function resolveRendererScaffold() {
|
|
410
|
+
const pkgDir = resolvePath(fileURLToPath(import.meta.url), '..', '..');
|
|
411
|
+
const bundled = joinPath(pkgDir, 'assets', 'renderer-scaffold');
|
|
412
|
+
if (existsSync(joinPath(bundled, 'foundry.toml')))
|
|
413
|
+
return bundled;
|
|
414
|
+
const root = findRepoRoot();
|
|
415
|
+
if (root) {
|
|
416
|
+
const canonical = joinPath(root, 'packages', 'cli', 'assets', 'renderer-scaffold');
|
|
417
|
+
if (existsSync(joinPath(canonical, 'foundry.toml')))
|
|
418
|
+
return canonical;
|
|
419
|
+
}
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
/** `abx scaffold-renderer [<dir>]` — write a ready-to-build Foundry project for the in-chain
|
|
423
|
+
* Solidity art lane (a seed + PostParam → SVG renderer + coherent traits + tests + a deploy
|
|
424
|
+
* script). abx doesn't compile/deploy Solidity — the creator runs forge, then hands the deployed
|
|
425
|
+
* address to `deploy-code --image-renderer`. Mirrors how deploy-resolver scaffolds an artifact. */
|
|
426
|
+
export function cmdScaffoldRenderer(rest, flags) {
|
|
427
|
+
const dir = resolvePath(rest[0] ?? 'my-renderer');
|
|
428
|
+
const src = resolveRendererScaffold();
|
|
429
|
+
if (!src) {
|
|
430
|
+
throw new Error('bundled renderer scaffold not found (expected <pkg>/assets/renderer-scaffold). Reinstall @artblocks/abx-cli.');
|
|
431
|
+
}
|
|
432
|
+
if (existsSync(dir) && readdirSync(dir).length > 0 && flags.force === undefined) {
|
|
433
|
+
throw new Error(`${dir} already exists and is not empty — pass a fresh path, or --force to write into it.`);
|
|
434
|
+
}
|
|
435
|
+
// Copy + assert it landed. Throws rather than printing a success banner over an empty directory —
|
|
436
|
+
// the alpha.9→alpha.14 failure mode. See src/scaffold.ts for why this is not inline.
|
|
437
|
+
copyRendererScaffold(src, dir);
|
|
438
|
+
ok(`in-chain renderer scaffold → ${dir}`);
|
|
439
|
+
step('The in-chain Solidity art lane — nothing to run after deploy, tokenURI resolves from chain forever');
|
|
440
|
+
info(`${bold('src/MyRenderer.sol')} draws an SVG from the token ${bold('seed')} + a ${bold('palette')} HexColor PostParam; ${bold('src/MyTraits.sol')} reads the SAME seed for coherent on-chain traits. Fork the art; keep the invariants in ${bold('src/interfaces/IAbxFieldRenderer.sol')} (above all: render() must NEVER revert).`);
|
|
441
|
+
info('build + test + deploy it yourself with Foundry (abx does not compile/deploy Solidity):');
|
|
442
|
+
console.log(` ${g('cd')} ${basename(dir)}`);
|
|
443
|
+
console.log(` ${g('forge soldeer install')} ${dim('# fetch solady + forge-std (pinned)')}`);
|
|
444
|
+
console.log(` ${g('forge test')} ${dim('# MUST pass — the never-revert cases')}`);
|
|
445
|
+
console.log(` ${g('forge script script/Deploy.s.sol --rpc-url <rpc> --private-key <key> --broadcast')}`);
|
|
446
|
+
info('then wire the printed addresses into your drop:');
|
|
447
|
+
console.log(` ${g('abx deploy-code --image-renderer <MyRenderer> --attributes-renderer <MyTraits> --onchain-uri --schema palette:HexColor:TokenOwner --name "…" --symbol …')}`);
|
|
448
|
+
info(`full walkthrough: ${bold(`${basename(dir)}/README.md`)} · interface + invariants: https://abx.docs.artblocks.io/protocol/renderers/`);
|
|
449
|
+
}
|
|
450
|
+
/** Human label for each skills-parent dir — which agents pick the skill up from there. */
|
|
451
|
+
export const SKILL_PARENT_LABELS = {
|
|
452
|
+
'.claude/skills': 'Claude Code',
|
|
453
|
+
'.agents/skills': 'Cursor · Codex · Gemini · Copilot',
|
|
454
|
+
};
|
|
455
|
+
/** Resolve which skills-parent dirs `install` should write to. No `--agent` → the whole-ecosystem
|
|
456
|
+
* default (Claude Code + the neutral `.agents/skills` everyone else reads). `--agent a,b` narrows
|
|
457
|
+
* to those agents' dirs (de-duped, since several share `.agents/skills`). */
|
|
458
|
+
export function resolveInstallParents(agentFlag) {
|
|
459
|
+
if (!agentFlag || agentFlag === 'true')
|
|
460
|
+
return ['.claude/skills', '.agents/skills'];
|
|
461
|
+
const parents = new Set();
|
|
462
|
+
for (const raw of agentFlag.split(',')) {
|
|
463
|
+
const a = raw.trim().toLowerCase();
|
|
464
|
+
const parent = AGENT_SKILL_PARENTS[a];
|
|
465
|
+
if (!parent) {
|
|
466
|
+
throw new Error(`unknown --agent '${a}'. Use one of: ${Object.keys(AGENT_SKILL_PARENTS).join(', ')} (or omit --agent to install for every agent).`);
|
|
467
|
+
}
|
|
468
|
+
parents.add(parent);
|
|
469
|
+
}
|
|
470
|
+
return [...parents];
|
|
471
|
+
}
|
|
472
|
+
/** Copy the bundled skill folder to `dest`, replacing any prior copy so a re-install after an
|
|
473
|
+
* upgrade never leaves stale reference files behind.
|
|
474
|
+
*
|
|
475
|
+
* Returns `'already-canonical'` when destination IS the source, having done nothing. That case is
|
|
476
|
+
* not hypothetical: in a dev checkout of the abx repo `resolveBundledSkill()` resolves to the
|
|
477
|
+
* canonical `.claude/skills/abx-self-host`, which is exactly where a cwd-relative install writes —
|
|
478
|
+
* so the `rmSync` below would delete the canonical skill, and the copy would then have no source.
|
|
479
|
+
* A self-destructing install is a bad way to learn that. */
|
|
480
|
+
export function installSkillTo(src, dest) {
|
|
481
|
+
if (resolvePath(src) === resolvePath(dest))
|
|
482
|
+
return 'already-canonical';
|
|
483
|
+
mkdirSync(joinPath(dest, '..'), { recursive: true });
|
|
484
|
+
rmSync(dest, { recursive: true, force: true });
|
|
485
|
+
cpSync(src, dest, { recursive: true });
|
|
486
|
+
return 'installed';
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Install the bundled skill into the default per-agent parents (or `~` with `global`), reporting
|
|
490
|
+
* each destination. Shared by `abx skill install` and `abx doctor`'s offer to fix a missing/stale
|
|
491
|
+
* skill — one implementation, so the two can't drift on where the skill lands or what it prints.
|
|
492
|
+
*/
|
|
493
|
+
export function installSkillToDefaults(src, opts = {}) {
|
|
494
|
+
const version = readSkillVersion(joinPath(src, 'SKILL.md')) ?? readCliVersion();
|
|
495
|
+
const base = opts.global ? homedir() : process.cwd();
|
|
496
|
+
const parents = resolveInstallParents(opts.agent);
|
|
497
|
+
ok(`installed the abx skill v${version}${opts.global ? ' (global, ~)' : ''}:`);
|
|
498
|
+
for (const parent of parents) {
|
|
499
|
+
const dest = joinPath(base, parent, SKILL_DIR_NAME);
|
|
500
|
+
const outcome = installSkillTo(src, dest);
|
|
501
|
+
const label = SKILL_PARENT_LABELS[parent];
|
|
502
|
+
const note = outcome === 'already-canonical' ? dim(' (already the canonical copy — left as is)') : label ? dim(' → ' + label) : '';
|
|
503
|
+
console.log(` ${g(joinPath(parent, SKILL_DIR_NAME))}${note}`);
|
|
504
|
+
}
|
|
505
|
+
info('restart your agent so it loads the skill, then ask it to launch an NFT with abx.');
|
|
506
|
+
info(`the skill is version-locked to this CLI (v${version}); re-run ${g('abx skill install')} after upgrading so the two stay in sync.`);
|
|
507
|
+
return version;
|
|
508
|
+
}
|
|
509
|
+
/** The default skill destinations, as a display string — what doctor's prompt has to name up front. */
|
|
510
|
+
export function defaultSkillDests(opts = {}) {
|
|
511
|
+
const prefix = opts.global ? '~/' : './';
|
|
512
|
+
return resolveInstallParents(opts.agent).map((p) => `${prefix}${p}`).join(' and ');
|
|
513
|
+
}
|
|
514
|
+
export async function cmdSkill(rest, flags) {
|
|
515
|
+
const sub = rest[0] ?? 'install';
|
|
516
|
+
const src = resolveBundledSkill();
|
|
517
|
+
if (!src) {
|
|
518
|
+
throw new Error('bundled skill not found (expected <pkg>/skill or .claude/skills/abx-self-host). ' +
|
|
519
|
+
'Reinstall @artblocks/abx-cli, or install cross-agent with: npx skills add ArtBlocks/abx --skill abx-self-host');
|
|
520
|
+
}
|
|
521
|
+
if (sub === 'path') {
|
|
522
|
+
console.log(src);
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
if (sub === 'install') {
|
|
526
|
+
const version = readSkillVersion(joinPath(src, 'SKILL.md')) ?? readCliVersion();
|
|
527
|
+
// Escape hatch: --target <dir> writes the skill folder straight under <dir> (for an agent
|
|
528
|
+
// whose skills dir we don't special-case, or a bespoke location).
|
|
529
|
+
if (typeof flags.target === 'string' && flags.target !== 'true') {
|
|
530
|
+
const dest = joinPath(resolvePath(flags.target), SKILL_DIR_NAME);
|
|
531
|
+
if (installSkillTo(src, dest) === 'already-canonical') {
|
|
532
|
+
ok(`${dest} is already the canonical skill v${version} — nothing to install.`);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
ok(`installed the abx skill v${version} → ${dest}`);
|
|
536
|
+
info('restart your agent so it loads the skill, then ask it to launch an NFT with abx.');
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
installSkillToDefaults(src, { global: flags.global !== undefined, agent: flags.agent });
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
throw new Error('usage: abx skill <install|path> [--agent claude|cursor|codex|gemini|copilot] [--global] [--target <dir>]');
|
|
543
|
+
}
|
|
544
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/commands/scaffold.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,SAAS,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I,KAAK,CAAC,0GAA0G,CAAC,CAAC;AAC9H,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Address } from '@artblocks/abx-sdk';
|
|
2
|
+
import { type Flags } from '../flags.js';
|
|
3
|
+
/**
|
|
4
|
+
* Ensure the LOCAL client credential for your own resolver exists, generating + persisting one to
|
|
5
|
+
* `.env` (as `ABX_REMOTE_SELF_TOKEN` — the named-remote grammar's "self" entry) if not. The SAME
|
|
6
|
+
* value also has to land on the resolver itself, under ITS OWN var name (`ABX_RESOLVER_ADMIN_TOKEN`,
|
|
7
|
+
* server-side — see remote.ts's header comment for why the two names differ across that boundary);
|
|
8
|
+
* the printed deploy steps carry it across. The token authorizes remote indexing control only
|
|
9
|
+
* (never on-chain signing), and — like every other secret — lives ONLY in `.env`, never in a
|
|
10
|
+
* tool-written file or chat. Returns {token, generated} so the caller can tell the operator what
|
|
11
|
+
* happened without printing the secret itself.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ensureAdminToken(): {
|
|
14
|
+
token: string;
|
|
15
|
+
generated: boolean;
|
|
16
|
+
};
|
|
17
|
+
/** Ensure an ABX_EFFECTS_TOKEN exists locally (generated + persisted to `.env` like the admin
|
|
18
|
+
* token) — it gates a PUBLIC runner's /run + /notify, and the resolver's watcher sends it. */
|
|
19
|
+
export declare function ensureEffectsToken(): {
|
|
20
|
+
token: string;
|
|
21
|
+
generated: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* `abx effects` — run the reference effect runner LOCALLY, in-process (the local counterpart to
|
|
25
|
+
* `abx deploy-effects`, which scaffolds a HOSTED runner). This is what makes a param change / new
|
|
26
|
+
* mint **auto-render** on your own machine: it sweeps every code project the resolver serves and
|
|
27
|
+
* renders any still missing at the CURRENT inputsHash, then keeps sweeping. Co-located with a local
|
|
28
|
+
* `abx serve` (same store) it needs no admin token; against a hosted resolver it publishes via the
|
|
29
|
+
* admin token (locator bridge). Blocks like `serve` — background it. `--once` sweeps all projects a
|
|
30
|
+
* single time and exits (vs `abx render <addr>` which is the per-project repair lane).
|
|
31
|
+
*/
|
|
32
|
+
export declare function cmdEffects(flags: Flags): Promise<void>;
|
|
33
|
+
export declare function cmdServe(flags: Flags): Promise<void>;
|
|
34
|
+
export declare function cmdRemote(spec: string | undefined, flags: Flags): Promise<void>;
|
|
35
|
+
export declare function cmdMigrate(address: Address | undefined, flags: Flags): Promise<void>;
|
|
36
|
+
/** DEV only: copy the minimal, buildable workspace source into the artifact dir so the emitted
|
|
37
|
+
* from-source Dockerfile has a self-contained build context — no node_modules, no repo access. */
|
|
38
|
+
export declare function vendorResolverSource(root: string, outDir: string): void;
|
|
39
|
+
export declare function cmdDeployResolver(flags: Flags): Promise<void>;
|
|
40
|
+
export declare function cmdDeployEffects(flags: Flags): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/commands/service.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,OAAO,EAUb,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAC,KAAK,KAAK,EAAC,MAAM,aAAa,CAAC;AAiCvC;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,IAAI;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAC,CAStE;AAED;+FAC+F;AAC/F,wBAAgB,kBAAkB,IAAI;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAC,CASxE;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CA0C5D;AAGD,wBAAsB,QAAQ,CAAC,KAAK,EAAE,KAAK,iBAiC1C;AAQD,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,iBAoFrE;AA+DD,wBAAsB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,iBAmI1E;AAED;mGACmG;AACnG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CASvE;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,KAAK,iBAyGnD;AAMD,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,KAAK,iBAwFlD"}
|