Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
show on this site's /mcp
CLI
abso show 172 --json
JSON
/christopher/abso-core/versions/172?format=json

Build the client for Node 20 instead of committing the build: npm run build writes client/bin/abso.mjs from client/abso.ts, and npm run pack:npm -- <version> packs that same build as the npm package @abso-cli/abso (it never publishes). The committed bundle and the check that kept it current are gone, so client changes need no rebuild. The READMEs give the build steps.

of shared·node20··Not checked

Version 171 · Files at version 172

8 files, 108 lines added, 44 removed.

--- a/README.md
+++ b/README.md
@@ -39,15 +39,18 @@
3939file, [abso.mjs](https://api.abso.dev/client/abso.mjs), with its sha256 beside
4040it at `abso.mjs.sha256`.
4141
42−From this repository, with nothing to install or build, on Node 20 or later:
42+From this repository, on Node 20 or later, build it first:
4343
4444```bash
45+npm ci
46+npm run build
4547node client/bin/abso.mjs help
4648```
4749
48−`client/bin/abso.mjs` is the whole client as one plain-JS file, built from
49−`client/abso.ts` and committed. On Node 24, `node client/abso.ts` runs the
50−TypeScript itself.
50+`npm run build` writes the whole client as one plain-JS file,
51+`client/bin/abso.mjs`, from `client/abso.ts`; build again after pulling. On
52+Node 24, `node client/abso.ts` runs the TypeScript itself, with no build.
53+`npm run pack:npm -- <version>` packs the same build as the npm package.
5154
5255## Where to go next
5356
@@ -167,10 +170,6 @@
167170npm run check
168171```
169172
170−After changing anything the client imports, run `npm run build:client` and push
171−the `client/bin/abso.mjs` it writes: the check fails while that file isn't a
172−build of the client as it is.
173−
174173Before a push, `npm run check:changed` is enough: it runs the tests that
175174import what you changed, the typecheck when it reaches it, and biome on your
176175files (`--list` shows the plan; name files after `--` to pick them yourself).
--- a/abso.json
+++ b/abso.json
@@ -1,5 +1,5 @@
11{
22 "setup": "npm ci --no-audit --no-fund",
33 "check": "npx biome ci . && npm run check",
4− "whole": ["package-lock.json", "client/bin/abso.mjs"]
4+ "whole": ["package-lock.json"]
55}
--- a/client/README.md
+++ b/client/README.md
@@ -11,17 +11,17 @@
1111node client/abso.ts help
1212```
1313
14−On Node 20 or later, run `client/bin/abso.mjs` instead: the same client built
15−into one plain-JS file, committed, so a fresh clone needs no install or build.
14+Node 20 can't run the `.ts` files (it has no type stripping). On Node 20 or
15+later, build the client into one plain-JS file and run that:
1616
1717```bash
18+npm ci
19+npm run build
1820node client/bin/abso.mjs help
1921```
2022
21−Node 20 can't run the `.ts` files (it has no type stripping). After changing
22−anything the client imports, `npm run build:client` rebuilds `bin/abso.mjs`;
23−push it with the change. The project's check (`npm run check:client-bundle`)
24−fails while the file isn't a build of the client as it is.
23+`client/bin/` isn't committed; build again after pulling. The npm package
24+(`npm run pack:npm -- <version>`) ships the same build.
2525
2626### Running it from a git checkout
2727
client/bin/abso.mjsdeleted; this is the file as it was before+0 −0
Binary file client/bin/abso.mjs changed: 601e61926ab4 -> none
--- a/package.json
+++ b/package.json
@@ -11,9 +11,9 @@
1111 "scripts": {
1212 "test": "node --import ./client/test/setup.ts --test \"src/**/*.test.ts\" \"worker/project/**/*.test.ts\" \"client/test/**/*.test.ts\" \"scripts/**/*.test.ts\" \"server/test/**/*.test.ts\"",
1313 "typecheck": "tsc --noEmit -p tsconfig.json",
14− "check": "npm run typecheck && npm run typecheck:server && npm run check:client-bundle && npm test",
15− "build:client": "node scripts/build-client.mjs",
16− "check:client-bundle": "node scripts/build-client.mjs --check",
14+ "check": "npm run typecheck && npm run typecheck:server && npm test",
15+ "build": "node scripts/build-client.mjs",
16+ "pack:npm": "node scripts/pack-npm.mjs",
1717 "check:changed": "node scripts/check-changed.mjs",
1818 "format": "biome check --write .",
1919 "lint": "biome ci .",
--- a/scripts/build-client.mjs
+++ b/scripts/build-client.mjs
@@ -2,17 +2,15 @@
22// as one plain-JS file for Node 20 or later. Node 20 can't run the .ts files themselves (it has no type
33// stripping), so this file is how a checkout runs on it:
44//
5+// npm ci && npm run build
56// node client/bin/abso.mjs help
67//
7−// npm run build:client rebuilds it; run it after changing the client and push the result.
8−// npm run check:client-bundle fails when the file isn't what a build of this folder gives (the check runs it).
8+// The file isn't committed (.gitignore leaves client/bin/ out); build it again after pulling. It sits one
9+// folder under client/, so the client's own folder (client-version.ts) is still client/. scripts/pack-npm.mjs
10+// puts the same build in the npm package.
911//
10−// The file is committed, so a fresh clone runs it with no install and no build. It sits one folder under
11−// client/, so the client's own folder (client-version.ts) is still client/. The build is deterministic:
12−// paths in it are relative to the repo, so it comes out the same on every machine.
13−//
1412// Plain JS on purpose: it runs before anything is built.
15−import { readFileSync, writeFileSync } from "node:fs";
13+import { mkdirSync, writeFileSync } from "node:fs";
1614import { createRequire } from "node:module";
1715import { dirname, join, resolve } from "node:path";
1816import { fileURLToPath } from "node:url";
@@ -20,8 +18,8 @@
2018const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
2119const OUT = "client/bin/abso.mjs";
2220
23−/** The bundle's text, built in memory. */
24−export function buildClient() {
21+/** The bundle's text, built in memory. `banner` adds lines at its top (the npm package stamps its version). */
22+export function buildClient(banner = []) {
2523 const esbuild = createRequire(import.meta.url)("esbuild");
2624 const result = esbuild.buildSync({
2725 absWorkingDir: root,
@@ -37,9 +35,10 @@
3735 // can't do without a real require.
3836 banner: {
3937 js: [
40− "// Built from client/abso.ts by scripts/build-client.mjs (npm run build:client). Don't edit it by hand.",
38+ "// Built from client/abso.ts by scripts/build-client.mjs (npm run build). Don't edit it by hand.",
4139 'import { createRequire as __absoCreateRequire } from "node:module";',
4240 "const require = __absoCreateRequire(import.meta.url);",
41+ ...banner,
4342 ].join("\n"),
4443 },
4544 });
@@ -53,17 +52,7 @@
5352
5453if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
5554 const path = join(root, OUT);
56− const text = buildClient();
57− if (process.argv.includes("--check")) {
58− let have = "";
59− try {
60− have = readFileSync(path, "utf8").replace(/\r\n/g, "\n");
61− } catch {}
62− if (have !== text) {
63− process.stderr.write(
64− `${OUT} is not a build of this folder's client: run npm run build:client and push the file it writes.\n`,
65− );
66− process.exit(1);
67− }
68− } else writeFileSync(path, text);
55+ mkdirSync(dirname(path), { recursive: true });
56+ writeFileSync(path, buildClient());
57+ process.stdout.write(`Built ${OUT}: node ${OUT} help\n`);
6958}
--- /dev/null
+++ b/scripts/pack-npm.mjs
@@ -0,0 +1,73 @@
1+// Packs the npm package @abso-cli/abso from this checkout: the client as scripts/build-client.mjs builds it,
2+// for Node 20 or later. It never publishes and never reads npm's sign-in.
3+//
4+// npm ci && npm run pack:npm -- <version> (e.g. 0.171.0)
5+//
6+// It writes the package to dist/npm/package/ and its tarball, as npm pack names it, to dist/npm/.
7+// The package's layout: bin/abso.mjs checks Node's version and loads dist/abso.mjs, the bundle, stamped
8+// with the version so the client knows it is an installed package.
9+import { execFileSync } from "node:child_process";
10+import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
11+import { dirname, join, resolve } from "node:path";
12+import { fileURLToPath } from "node:url";
13+import { buildClient } from "./build-client.mjs";
15+const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
16+const version = process.argv[2];
17+if (!version || !/^\d+\.\d+\.\d+$/.test(version)) {
18+ process.stderr.write("Use: npm run pack:npm -- <version>, such as 0.171.0\n");
19+ process.exit(2);
20+}
21+const node = 20;
23+const files = {
24+ "package.json": `${JSON.stringify(
25+ {
26+ name: "@abso-cli/abso",
27+ version,
28+ description: "abso: version control built for AI agents first. The command line client.",
29+ license: "MIT",
30+ homepage: "https://abso.dev",
31+ keywords: ["version control", "vcs", "agents", "ai", "abso"],
32+ type: "module",
33+ engines: { node: `>=${node}` },
34+ bin: { abso: "bin/abso.mjs" },
35+ files: ["bin", "dist"],
36+ publishConfig: { access: "public" },
37+ },
38+ null,
39+ 2,
40+ )}\n`,
41+ // A dynamic import, so an older Node reaches the version check before it reads the bundle.
42+ "bin/abso.mjs": `#!/usr/bin/env node
43+const major = Number(process.versions.node.split(".")[0]);
44+if (major < ${node}) {
45+ process.stderr.write("abso needs Node ${node} or later, and this is Node " + process.versions.node + ". Install a newer Node from https://nodejs.org and run abso again.\\n");
46+ process.exit(1);
47+}
48+await import("../dist/abso.mjs");
49+`,
50+ "dist/abso.mjs": buildClient([`globalThis.__ABSO_PACKAGE_VERSION__ = ${JSON.stringify(version)};`]),
51+ "README.md": `# abso\n\nabso is version control for agents. This package is the abso command line.\n\nIt needs Node ${node} or later. Install it with \`npm install -g @abso-cli/abso\`, or run \`npx @abso-cli/abso help\`.\n\n[abso.dev](https://abso.dev)\n`,
52+ LICENSE: readFileSync(join(root, "LICENSE"), "utf8"),
53+};
55+const out = join(root, "dist", "npm");
56+const pkg = join(out, "package");
57+rmSync(pkg, { recursive: true, force: true });
58+for (const [path, text] of Object.entries(files)) {
59+ mkdirSync(dirname(join(pkg, path)), { recursive: true });
60+ writeFileSync(join(pkg, path), text);
61+}
62+// Under npm run, npm_execpath is npm's own script, which runs without a shell on every platform.
63+const npm = process.env.npm_execpath;
64+const pack = ["pack", pkg, "--pack-destination", out, "--ignore-scripts"];
65+const tarball = (
66+ npm
67+ ? execFileSync(process.execPath, [npm, ...pack], { cwd: root, encoding: "utf8" })
68+ : execFileSync("npm", pack, { cwd: root, encoding: "utf8", shell: process.platform === "win32" })
69+)
70+ .trim()
71+ .split("\n")
72+ .pop();
73+process.stdout.write(`Packed @abso-cli/abso ${version}: dist/npm/${tarball}\n`);
--- a/server/README.md
+++ b/server/README.md
@@ -40,16 +40,19 @@
4040
4141## Point the client at it
4242
43−The client is in this repository, built into one plain-JS file that runs on Node 20 or later with nothing to install
44−(`client/bin/abso.mjs`, built from `client/abso.ts`). From the repository's root:
43+The client is in this repository. `npm run build` builds it from `client/abso.ts` into one plain-JS file that runs on
44+Node 20 or later, `client/bin/abso.mjs`. From the repository's root:
4545
4646```bash
47+npm ci
48+npm run build
4749export ABSO_TOKEN=<the token you set>
4850export ABSO_TRUSTED_SERVERS=https://abso.<your-subdomain>.workers.dev
4951alias abso="node $PWD/client/bin/abso.mjs"
5052```
5153
52−On Node 24, `alias abso="node $PWD/client/abso.ts"` runs the TypeScript itself (after `npm ci`).
54+On Node 24, `alias abso="node $PWD/client/abso.ts"` runs the TypeScript itself, with no build. `npm i -g @abso-cli/abso`
55+installs the same client from npm, on Node 20 or later.
5356
5457The client sends its token only to servers you trust, so `ABSO_TRUSTED_SERVERS` (or an entry in
5558`~/.abso/servers.json`) is needed. Issues go to `<server>/issues` on their own.