- MCP
- code on this site's /mcp
- CLI
- none: the JSON below is the answer
- JSON
- /christopher/abso-core/files/client/avcs.ts?draft=login-timeout&format=json
37 linesFirst import 100%0 versions changed it
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.
6import { enableCompileCache } from "node:module";
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.
10enableCompileCache();
12const argv = process.argv.slice(2);
14if (argv[0] === "hook") {
15 const { runHook } = await import("./src/hook.ts");
16 const chunks: Buffer[] = [];
17 for await (const chunk of process.stdin) chunks.push(chunk as Buffer);
18 const result = await runHook(Buffer.concat(chunks).toString("utf8"));
19 if (result.stdout) process.stdout.write(result.stdout);
20 // Always 0: the hook never stops the agent.
21 process.exitCode = 0;
22} else if (argv[0] === "mcp") {
23 // An MCP server on stdin and stdout, for as long as the client keeps it open.
24 const { serveMcp } = await import("./src/mcp.ts");
25 await serveMcp(process.stdin, (line) => process.stdout.write(`${line}\n`), process.cwd(), process.env);
26} else {
27 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);
36 process.exitCode = result.exit;
37}