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
code on this site's /mcp
CLI
none: the JSON below is the answer
JSON
/christopher/abso-core/files/client/avcs.ts?version=261&format=json
37 linesFirst import 73% · pinch 27%Last change pinch in version 74, 3 versions changed it

You're reading version 261. The newest is 318, and 1 version since then changed this file. Go to the newestCompare with 318

1// The abso client. Run it as:
2// node client/avcs.ts <command> [options]
3// `abso help` lists the commands. `abso hook` is the Claude Code hook; it
4// loads only what it needs, since every edit pays for its start-up.
5
6import * as nodeModule from "node:module";
7
8// Node keeps the compiled modules (TypeScript already stripped) in a cache in
9// the temp folder. Loading the hook's modules drops from about 55 ms to 11 ms.
10// Node 20 has no compile cache, and the built client runs there without one.
11(nodeModule as { enableCompileCache?: () => unknown }).enableCompileCache?.();
13const argv = process.argv.slice(2);
15if (argv[0] === "hook") {
16 const { runHook } = await import("./src/hook.ts");
17 const chunks: Buffer[] = [];
18 for await (const chunk of process.stdin) chunks.push(chunk as Buffer);
19 const result = await runHook(Buffer.concat(chunks).toString("utf8"));
20 if (result.stdout) process.stdout.write(result.stdout);
21 // Always 0: the hook never stops the agent.
22 process.exitCode = 0;
23} else if (argv[0] === "mcp") {
24 // An MCP server on stdin and stdout, for as long as the client keeps it open.
25 const { serveMcp } = await import("./src/mcp.ts");
26 await serveMcp(process.stdin, (line) => process.stdout.write(`${line}\n`), process.cwd(), process.env);
27} else {
28 const { main } = await import("./src/main.ts");
29 // Everything printed goes through terminalText: most of it is a server's text (abso-core's terminal-text.ts).
30 const { colorsPass, terminalText } = await import("./src/terminal-text.ts");
31 const out = (text: string) => process.stdout.write(terminalText(text, colorsPass(process.stdout, process.env)));
32 const err = (text: string) => process.stderr.write(terminalText(text, colorsPass(process.stderr, process.env)));
33 const result = await main(argv, { cwd: process.cwd(), env: process.env, write: out, writeErr: err });
34 if (result.stdout) out(result.stdout);
35 if (result.stderr) err(result.stderr);
36 process.exitCode = result.exit;