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

Versions 170 to 318

Compare

+15 −23 in 4 places
Lines 2–16 at 318 (were 2–18 at 170)
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";
Lines 18–25 at 318 (were 20–27 at 170)
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,
Lines 31–47 at 318 (were 33–45 at 170)
3331 write: false,
3432 outfile: OUT,
3533 logLevel: "warning",
34+ // Local projects run the open server's code in the client (client/src/local-store.ts); its Durable Object
35+ // base class comes from the Workers runtime, so the bundle gets the client's stand-in.
36+ alias: { "cloudflare:workers": "./client/src/durable-object-stand-in.ts" },
3637 // A bundled CommonJS package (yaml) calls require("process") lazily, which an ES module bundle
3738 // can't do without a real require.
3839 banner: {
3940 js: [
40− "// Built from client/abso.ts by scripts/build-client.mjs (npm run build:client). Don't edit it by hand.",
41+ "// Built from client/abso.ts by scripts/build-client.mjs (npm run build). Don't edit it by hand.",
4142 'import { createRequire as __absoCreateRequire } from "node:module";',
4243 "const require = __absoCreateRequire(import.meta.url);",
44+ ...banner,
4345 ].join("\n"),
4446 },
4547 });
Lines 55–61 at 318 (were 53–69 at 170)
5355
5456if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
5557 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);
58+ mkdirSync(dirname(path), { recursive: true });
59+ writeFileSync(path, buildClient());
60+ process.stdout.write(`Built ${OUT}: node ${OUT} help\n`);
6961}
MCP
compare on this site's /mcp
CLI
abso diff 170 318 scripts/build-client.mjs --json
JSON
/christopher/abso-core/compare/170..318?file=scripts%2Fbuild-client.mjs&format=json