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 49 to 318

Compare

+30 −12 in 2 places
Lines 3–35 at 318 (were 3–16 at 49)
33// `abso help` lists the commands. `abso hook` is the Claude Code hook; it
44// loads only what it needs, since every edit pays for its start-up.
55
6−import { enableCompileCache } from "node:module";
6+import { readFileSync } from "node:fs";
7+import * as nodeModule from "node:module";
8+import { dirname, join } from "node:path";
79
10+const argv = process.argv.slice(2);
12+/**
13+ * Whether this command opens a local project (abso init --local): --local, or a folder whose config names the server
14+ * "local". Those load the open server's code through a module hook, and with the compile cache on Node 24 crashes.
15+ */
16+function opensLocal(): boolean {
17+ if (argv.includes("--local")) return true;
18+ for (let dir = process.cwd(); ; dir = dirname(dir)) {
19+ for (const state of [".abso", ".avcs"]) {
20+ try {
21+ return /"server"\s*:\s*"local"/.test(readFileSync(join(dir, state, "config.json"), "utf8"));
22+ } catch {}
23+ }
24+ if (dirname(dir) === dir) return false;
25+ }
26+}
828// Node keeps the compiled modules (TypeScript already stripped) in a cache in
929// the temp folder. Loading the hook's modules drops from about 55 ms to 11 ms.
10−enableCompileCache();
30+// Node 20 has no compile cache, and the built client runs there without one.
31+if (!opensLocal()) (nodeModule as { enableCompileCache?: () => unknown }).enableCompileCache?.();
1132
12−const argv = process.argv.slice(2);
13−
1433if (argv[0] === "hook") {
1534 const { runHook } = await import("./src/hook.ts");
1635 const chunks: Buffer[] = [];
Lines 44–55 at 318 (were 25–37 at 49)
2544 await serveMcp(process.stdin, (line) => process.stdout.write(`${line}\n`), process.cwd(), process.env);
2645} else {
2746 const { main } = await import("./src/main.ts");
28− const result = await main(argv, {
29− cwd: process.cwd(),
30− env: process.env,
31− write: (text) => process.stdout.write(text),
32− writeErr: (text) => process.stderr.write(text),
33− });
34− if (result.stdout) process.stdout.write(result.stdout);
35− if (result.stderr) process.stderr.write(result.stderr);
47+ // Everything printed goes through terminalText: most of it is a server's text (abso-core's terminal-text.ts).
48+ const { colorsPass, terminalText } = await import("./src/terminal-text.ts");
49+ const out = (text: string) => process.stdout.write(terminalText(text, colorsPass(process.stdout, process.env)));
50+ const err = (text: string) => process.stderr.write(terminalText(text, colorsPass(process.stderr, process.env)));
51+ const result = await main(argv, { cwd: process.cwd(), env: process.env, write: out, writeErr: err });
52+ if (result.stdout) out(result.stdout);
53+ if (result.stderr) err(result.stderr);
3654 process.exitCode = result.exit;
3755}
MCP
compare on this site's /mcp
CLI
abso diff 49 318 client/avcs.ts --json
JSON
/christopher/abso-core/compare/49..318?file=client%2Favcs.ts&format=json