@artblocks/abx-cli 0.1.0-alpha.0 → 0.1.0-alpha.1
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/dist/flags.d.ts +6 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +7 -1
- package/dist/flags.js.map +1 -1
- package/dist/main.js +50 -0
- package/dist/main.js.map +1 -1
- package/dist/update-check.d.ts +35 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +191 -0
- package/dist/update-check.js.map +1 -0
- package/package.json +3 -3
- package/skill/reference/hosting.md +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Read the running CLI's own version from its package.json. Resolves the same in dev
|
|
2
|
+
* (src/update-check.ts → packages/cli/package.json) and published (dist/update-check.js →
|
|
3
|
+
* <pkg>/package.json) — npm always ships package.json regardless of the `files` allowlist.
|
|
4
|
+
* Returns '0.0.0' if unreadable, so callers never throw on a self-version read. */
|
|
5
|
+
export declare function readCliVersion(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Compare two semver strings. Returns -1 if a < b, 0 if equal, 1 if a > b. Handles the
|
|
8
|
+
* prerelease rule (1.0.0-alpha < 1.0.0) since our own versions are prereleases today
|
|
9
|
+
* (0.1.0-alpha.0). Build metadata (+…) is ignored per semver. Tolerant of a leading `v`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
12
|
+
/** True when `latest` is a strictly newer release than `current`. */
|
|
13
|
+
export declare function isNewer(latest: string, current: string): boolean;
|
|
14
|
+
/** GET the `latest` dist-tag's version from the npm registry. Aborts after {@link TIMEOUT_MS};
|
|
15
|
+
* returns null on any failure (offline, timeout, non-200, malformed body) — never throws. */
|
|
16
|
+
export declare function fetchLatestVersion(pkg?: string): Promise<string | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the latest published version IF it is newer than `current`, else null. Reads a disk
|
|
19
|
+
* cache first and only hits the network when the cache is older than {@link TTL_MS}. On a network
|
|
20
|
+
* failure it still stamps the cache (backing off a full TTL instead of retrying every command).
|
|
21
|
+
* Swallows every error — the update check must never break or slow a real command.
|
|
22
|
+
*
|
|
23
|
+
* `now` is injectable so tests can drive TTL behavior deterministically.
|
|
24
|
+
*/
|
|
25
|
+
export declare function checkForCliUpdate(current: string, now?: number): Promise<string | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Versions stamped by `abx skill install` into any locally-installed skill copy (project-local
|
|
28
|
+
* and global). Lets the notifier catch a skill that has drifted behind an upgraded CLI — the two
|
|
29
|
+
* are co-versioned, and a separately-installed skill copy does NOT move when the CLI upgrades.
|
|
30
|
+
* Copies installed via `npx skills add` carry no marker, so they never produce a false nudge.
|
|
31
|
+
*/
|
|
32
|
+
export declare function installedSkillVersions(): string[];
|
|
33
|
+
/** Filename of the version marker `abx skill install` writes beside an installed skill. */
|
|
34
|
+
export declare const SKILL_VERSION_MARKER = ".abx-skill-version";
|
|
35
|
+
//# sourceMappingURL=update-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":"AAqBA;;;oFAGoF;AACpF,wBAAgB,cAAc,IAAI,MAAM,CAQvC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CA+B5D;AAED,qEAAqE;AACrE,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhE;AAiBD;8FAC8F;AAC9F,wBAAsB,kBAAkB,CAAC,GAAG,SAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAc1E;AAMD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BzG;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAejD;AAED,2FAA2F;AAC3F,eAAO,MAAM,oBAAoB,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update check — a notify-only "you're behind" nudge, extracted from main.ts so the
|
|
3
|
+
* version comparison and cache logic are unit-testable (importing main executes the CLI).
|
|
4
|
+
*
|
|
5
|
+
* Policy (owner's call): NOTIFY, never self-mutate. The CLI checks npm at most once per
|
|
6
|
+
* {@link TTL_MS} (cached to disk), prints an upgrade one-liner to STDERR (so it never
|
|
7
|
+
* corrupts machine-readable stdout an agent may be parsing), and is a hard no-op when
|
|
8
|
+
* offline, in CI, or opted out (ABX_NO_UPDATE_CHECK / --no-update-check — see main.ts).
|
|
9
|
+
* The check lives in the CLI binary, so it fires no matter which agent (Claude, Codex,
|
|
10
|
+
* Cursor, …) drives `abx` — one implementation, every agent covered.
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
13
|
+
import { dirname, join, resolve } from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
import { homedir } from 'node:os';
|
|
16
|
+
const REGISTRY = 'https://registry.npmjs.org';
|
|
17
|
+
const PKG = '@artblocks/abx-cli';
|
|
18
|
+
const TTL_MS = 24 * 60 * 60 * 1000; // check npm at most once a day
|
|
19
|
+
const TIMEOUT_MS = 1500; // never hang a command on a slow/offline network
|
|
20
|
+
/** Read the running CLI's own version from its package.json. Resolves the same in dev
|
|
21
|
+
* (src/update-check.ts → packages/cli/package.json) and published (dist/update-check.js →
|
|
22
|
+
* <pkg>/package.json) — npm always ships package.json regardless of the `files` allowlist.
|
|
23
|
+
* Returns '0.0.0' if unreadable, so callers never throw on a self-version read. */
|
|
24
|
+
export function readCliVersion() {
|
|
25
|
+
try {
|
|
26
|
+
const pkgDir = resolve(fileURLToPath(import.meta.url), '..', '..');
|
|
27
|
+
const raw = JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf8'));
|
|
28
|
+
return typeof raw.version === 'string' ? raw.version : '0.0.0';
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return '0.0.0';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Compare two semver strings. Returns -1 if a < b, 0 if equal, 1 if a > b. Handles the
|
|
36
|
+
* prerelease rule (1.0.0-alpha < 1.0.0) since our own versions are prereleases today
|
|
37
|
+
* (0.1.0-alpha.0). Build metadata (+…) is ignored per semver. Tolerant of a leading `v`.
|
|
38
|
+
*/
|
|
39
|
+
export function compareVersions(a, b) {
|
|
40
|
+
const pa = parseSemver(a);
|
|
41
|
+
const pb = parseSemver(b);
|
|
42
|
+
for (let i = 0; i < 3; i++) {
|
|
43
|
+
if (pa.main[i] !== pb.main[i])
|
|
44
|
+
return pa.main[i] < pb.main[i] ? -1 : 1;
|
|
45
|
+
}
|
|
46
|
+
// A version WITH a prerelease is lower than the same version without one.
|
|
47
|
+
if (!pa.pre.length && !pb.pre.length)
|
|
48
|
+
return 0;
|
|
49
|
+
if (!pa.pre.length)
|
|
50
|
+
return 1;
|
|
51
|
+
if (!pb.pre.length)
|
|
52
|
+
return -1;
|
|
53
|
+
const n = Math.max(pa.pre.length, pb.pre.length);
|
|
54
|
+
for (let i = 0; i < n; i++) {
|
|
55
|
+
const x = pa.pre[i];
|
|
56
|
+
const y = pb.pre[i];
|
|
57
|
+
if (x === undefined)
|
|
58
|
+
return -1; // a shorter prerelease set is smaller (1.0.0-a < 1.0.0-a.1)
|
|
59
|
+
if (y === undefined)
|
|
60
|
+
return 1;
|
|
61
|
+
const xn = /^\d+$/.test(x);
|
|
62
|
+
const yn = /^\d+$/.test(y);
|
|
63
|
+
if (xn && yn) {
|
|
64
|
+
const dx = Number(x);
|
|
65
|
+
const dy = Number(y);
|
|
66
|
+
if (dx !== dy)
|
|
67
|
+
return dx < dy ? -1 : 1;
|
|
68
|
+
}
|
|
69
|
+
else if (xn) {
|
|
70
|
+
return -1; // numeric identifiers rank below alphanumeric ones
|
|
71
|
+
}
|
|
72
|
+
else if (yn) {
|
|
73
|
+
return 1;
|
|
74
|
+
}
|
|
75
|
+
else if (x !== y) {
|
|
76
|
+
return x < y ? -1 : 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
/** True when `latest` is a strictly newer release than `current`. */
|
|
82
|
+
export function isNewer(latest, current) {
|
|
83
|
+
return compareVersions(latest, current) > 0;
|
|
84
|
+
}
|
|
85
|
+
function parseSemver(v) {
|
|
86
|
+
const clean = String(v).trim().replace(/^v/, '').split('+')[0];
|
|
87
|
+
const dash = clean.indexOf('-');
|
|
88
|
+
const mainStr = dash === -1 ? clean : clean.slice(0, dash);
|
|
89
|
+
const preStr = dash === -1 ? '' : clean.slice(dash + 1);
|
|
90
|
+
const parts = mainStr.split('.').map((n) => {
|
|
91
|
+
const d = Number(n);
|
|
92
|
+
return Number.isFinite(d) ? d : 0;
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
main: [parts[0] ?? 0, parts[1] ?? 0, parts[2] ?? 0],
|
|
96
|
+
pre: preStr ? preStr.split('.') : [],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** GET the `latest` dist-tag's version from the npm registry. Aborts after {@link TIMEOUT_MS};
|
|
100
|
+
* returns null on any failure (offline, timeout, non-200, malformed body) — never throws. */
|
|
101
|
+
export async function fetchLatestVersion(pkg = PKG) {
|
|
102
|
+
const ctrl = new AbortController();
|
|
103
|
+
const timer = setTimeout(() => ctrl.abort(), TIMEOUT_MS);
|
|
104
|
+
try {
|
|
105
|
+
// Scoped packages encode the '/' as %2F; the /latest endpoint returns that version's document.
|
|
106
|
+
const res = await fetch(`${REGISTRY}/${pkg.replace('/', '%2F')}/latest`, { signal: ctrl.signal });
|
|
107
|
+
if (!res.ok)
|
|
108
|
+
return null;
|
|
109
|
+
const body = (await res.json());
|
|
110
|
+
return typeof body.version === 'string' ? body.version : null;
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
clearTimeout(timer);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function cachePath() {
|
|
120
|
+
return join(homedir(), '.cache', 'abx', 'update-check.json');
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Resolve the latest published version IF it is newer than `current`, else null. Reads a disk
|
|
124
|
+
* cache first and only hits the network when the cache is older than {@link TTL_MS}. On a network
|
|
125
|
+
* failure it still stamps the cache (backing off a full TTL instead of retrying every command).
|
|
126
|
+
* Swallows every error — the update check must never break or slow a real command.
|
|
127
|
+
*
|
|
128
|
+
* `now` is injectable so tests can drive TTL behavior deterministically.
|
|
129
|
+
*/
|
|
130
|
+
export async function checkForCliUpdate(current, now = Date.now()) {
|
|
131
|
+
let latest = null;
|
|
132
|
+
try {
|
|
133
|
+
const path = cachePath();
|
|
134
|
+
let cache = {};
|
|
135
|
+
try {
|
|
136
|
+
if (existsSync(path))
|
|
137
|
+
cache = JSON.parse(readFileSync(path, 'utf8'));
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
cache = {};
|
|
141
|
+
}
|
|
142
|
+
const fresh = typeof cache.checkedAt === 'number' && now - cache.checkedAt < TTL_MS;
|
|
143
|
+
if (fresh) {
|
|
144
|
+
latest = typeof cache.latest === 'string' ? cache.latest : null;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
const fetched = await fetchLatestVersion();
|
|
148
|
+
latest = fetched ?? (typeof cache.latest === 'string' ? cache.latest : null);
|
|
149
|
+
try {
|
|
150
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
151
|
+
writeFileSync(path, JSON.stringify({ checkedAt: now, latest }));
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
/* a read-only HOME just means we re-check next run */
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
if (!latest)
|
|
162
|
+
return null;
|
|
163
|
+
return isNewer(latest, current) ? latest : null;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Versions stamped by `abx skill install` into any locally-installed skill copy (project-local
|
|
167
|
+
* and global). Lets the notifier catch a skill that has drifted behind an upgraded CLI — the two
|
|
168
|
+
* are co-versioned, and a separately-installed skill copy does NOT move when the CLI upgrades.
|
|
169
|
+
* Copies installed via `npx skills add` carry no marker, so they never produce a false nudge.
|
|
170
|
+
*/
|
|
171
|
+
export function installedSkillVersions() {
|
|
172
|
+
const dirs = [
|
|
173
|
+
join(process.cwd(), '.claude', 'skills', 'abx-self-host'),
|
|
174
|
+
join(homedir(), '.claude', 'skills', 'abx-self-host'),
|
|
175
|
+
];
|
|
176
|
+
const out = [];
|
|
177
|
+
for (const dir of dirs) {
|
|
178
|
+
try {
|
|
179
|
+
const marker = join(dir, '.abx-skill-version');
|
|
180
|
+
if (existsSync(marker))
|
|
181
|
+
out.push(readFileSync(marker, 'utf8').trim());
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
/* ignore an unreadable location */
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return out;
|
|
188
|
+
}
|
|
189
|
+
/** Filename of the version marker `abx skill install` writes beside an installed skill. */
|
|
190
|
+
export const SKILL_VERSION_MARKER = '.abx-skill-version';
|
|
191
|
+
//# sourceMappingURL=update-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-check.js","sourceRoot":"","sources":["../src/update-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAC3E,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
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ABX CLI ('abx') — the agentic UX surface of the Self-Host Toolkit (Layer 3). Deploy, index, serve, and demo a self-hosted ABX project end to end. Wraps the SDK; runs a different implementation and the protocol works identically.",
|
|
6
6
|
"type": "module",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"viem": "^2.21.0",
|
|
41
|
-
"@artblocks/abx-storage": "0.1.0-alpha.0",
|
|
42
|
-
"@artblocks/abx-sdk": "0.1.0-alpha.0",
|
|
43
41
|
"@artblocks/abx-indexer": "0.1.0-alpha.0",
|
|
42
|
+
"@artblocks/abx-sdk": "0.1.0-alpha.0",
|
|
43
|
+
"@artblocks/abx-storage": "0.1.0-alpha.0",
|
|
44
44
|
"@artblocks/abx-token-api": "0.1.0-alpha.0"
|
|
45
45
|
},
|
|
46
46
|
"optionalDependencies": {
|
|
@@ -62,7 +62,7 @@ A failed upload is the #1 place an agent goes off the rails: it invents a cause
|
|
|
62
62
|
|
|
63
63
|
For the large/mutable default. `abx deploy-resolver --provider <fly|render|vps> --domain <meta.you.xyz>` scaffolds the artifact and prints the exact next steps, the DNS record, and the bake reminder. Providers: **fly.io** / **render** (Docker PaaS, free tier, custom domain) and a **VPS** (compose + Caddy auto-TLS). The host is **read-only** — serves + accepts admin index-control, no signing key on it (writes are signed locally), so a compromised host can at worst serve wrong bytes (the keccak catches it). Prefer **a domain you control** (move = DNS, not a tx) — but without one the scaffold now bakes the **real platform hostname** (`<app>.fly.dev` / `<app>.onrender.com`) so the resolver works out of the box (add a custom domain later). It NO LONGER bakes a dead `<app>.example` placeholder, and the resolver **refuses to serve** an `.example`/placeholder base (or a localhost base in a hosted image, `ABX_HOSTED=1`) — a loud fail beats silently serving dead image/animation links. The one sub-decision is *which provider* (ask + recommend); you scaffold, the human owns the cloud account + domain.
|
|
64
64
|
|
|
65
|
-
**The artifact is fully self-contained.** `deploy-resolver` writes `deploy/<provider>/` with its OWN `Dockerfile` + `.dockerignore` + config (a production image installs the published CLI: `npm i -g --no-optional @artblocks/abx-cli`). **Run every next step from that dir.** You never supply, copy, or hand-edit a Dockerfile. **If a step seems to need a file from elsewhere (`../Dockerfile`, a `packages/` dir, the repo), STOP — that's a scaffold bug, not something to work around.** Report it; don't MacGyver it. (Local
|
|
65
|
+
**The artifact is fully self-contained.** `deploy-resolver` writes `deploy/<provider>/` with its OWN `Dockerfile` + `.dockerignore` + config (a production image installs the published CLI: `npm i -g --no-optional @artblocks/abx-cli`). **Run every next step from that dir.** You never supply, copy, or hand-edit a Dockerfile. **If a step seems to need a file from elsewhere (`../Dockerfile`, a `packages/` dir, the repo), STOP — that's a scaffold bug, not something to work around.** Report it; don't MacGyver it. (Local from-source/contributor dev sets `ABX_RESOLVER_SOURCE=1` → a build-from-source artifact instead, still self-contained; you don't set this.)
|
|
66
66
|
|
|
67
67
|
**Never inline a secret into a command.** The generated steps **source from `.env`** (`set -a; . ../../.env; set +a` then `fly secrets set ABX_RPC_URLS="$ABX_RPC_URLS"`) — keep that shape. Never substitute a literal secret into command text; it must never appear in output or shell history.
|
|
68
68
|
|