- MCP
- show on this site's /mcp
- CLI
- abso show 59 --json
- JSON
- /christopher/abso-core/versions/59?format=json
The client reports an npm package's version: a build that sets ABSO_PACKAGE_VERSION gets it from abso --version and in its client header, and a built copy (the npm package or a downloaded abso.mjs) reports the installed mods without pointing at install scripts it doesn't have
of shared·pinch··Not checked
Version 58 · Files at version 59
3 files, 24 lines added, 4 removed.
--- a/client/src/client-version.ts
+++ b/client/src/client-version.ts
@@ -65,6 +65,15 @@
6565 return typeof stamp === "string" && /^[0-9a-f]{7,64}$/.test(stamp) ? stamp.slice(0, 7) : undefined;
6767
68+/** Set by the npm package build: the package's version, such as 0.58.0. Absent everywhere else. */
73+
74+/** A built copy (the npm package or a downloaded abso.mjs), which has no mods to install from, rather than a checkout. */
75+export const builtCopy = (): boolean => packageVersion() !== undefined || bundledCommit() !== undefined;
76+
6978
@@ -86,8 +95,9 @@
8897
89−/** This client's version: 0.1.0+ed45dad, or plugin.json's alone outside a git checkout. */
98+/** This client's version: the npm package's (0.58.0), else 0.1.0+ed45dad, or plugin.json's alone outside a git checkout. */
--- a/client/src/install.ts
+++ b/client/src/install.ts
@@ -45,7 +45,7 @@
48−import { CLIENT_DIR, clientPlace, clientVersion, headCommit } from "./client-version.ts";
48+import { builtCopy, CLIENT_DIR, clientPlace, clientVersion, headCommit } from "./client-version.ts";
4949
@@ -552,13 +552,16 @@
555+ // A built copy has no mod files to compare with or install from: it reports what is installed.
556− lines.push(`the ${m.name} mod: not installed (node client/${installer})`);
557+ lines.push(`the ${m.name} mod: not installed${builtCopy() ? "" : ` (node client/${installer})`}`);
561− m.version === m.current ? "" : `; this client has ${m.current}: node client/${installer} installs it`;
--- a/client/test/install.test.ts
+++ b/client/test/install.test.ts
@@ -490,4 +490,11 @@
493+
496+ const script = `globalThis.__ABSO_PACKAGE_VERSION__ = "0.58.0"; const m = await import(${JSON.stringify(url)}); console.log(m.clientVersion());`;
497+ const r = spawnSync(process.execPath, ["--input-type=module", "-e", script], { encoding: "utf8" });