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
blame on this site's /mcp
CLI
abso blame client/test/join-signed-out.test.ts --json
JSON
/christopher/abso-core/blame/client/test/join-signed-out.test.ts?format=json
79 linespinch 100%Last change pinch in version 86,

79 lines from 3 changes in 2 versions.

pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare1// A join with no sign-in says abso login signs the box in. For a public project
pinch86Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.Compare2// it also says where the website shows it, and that --reader reads it here
3// (visitor.test.ts has that folder). The client runs as its own process with an
4// empty home, so no sign-in or token on this machine is found.
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare5
6import assert from "node:assert/strict";
7import { execFile } from "node:child_process";
8import { mkdtempSync, rmSync } from "node:fs";
9import { createServer, type Server } from "node:http";
10import type { AddressInfo } from "node:net";
11import { tmpdir } from "node:os";
12import { join, resolve } from "node:path";
13import { after, before, describe, it } from "node:test";
14import { type Fake, startFake } from "./fake-server.ts";
16const CLIENT = resolve(import.meta.dirname, "..", "abso.ts");
17let fake: Fake;
18// A server where every project is public: status answers signed out, and the agent routes want a sign-in.
19let open: Server;
20let openUrl: string;
21const dirs: string[] = [];
22const temp = () => {
23 const dir = mkdtempSync(join(tmpdir(), "abso-test-signed-out-"));
24 dirs.push(dir);
25 return dir;
26};
28before(async () => {
29 fake = await startFake(0, "test-token-not-secret");
30 open = createServer((req, res) => {
31 if (req.method === "GET" && /^\/p\/[^/]+\/status$/.test(req.url ?? ""))
32 return res.writeHead(200, { "content-type": "application/json" }).end('{"version":1,"agents":[]}');
33 res.writeHead(401, { "content-type": "application/json" }).end('{"error":"sign in"}');
34 });
35 await new Promise<void>((done) => open.listen(0, "127.0.0.1", done));
36 openUrl = `http://127.0.0.1:${(open.address() as AddressInfo).port}`;
37});
38after(async () => {
39 await fake.close();
40 open.close();
41 for (const dir of dirs) rmSync(dir, { recursive: true, force: true });
42});
44/** Runs the client signed out: an empty home, and no token in the environment. */
45function signedOut(...args: string[]): Promise<{ code: number; stderr: string }> {
46 const home = temp();
47 const env: Record<string, string> = {
48 PATH: process.env.PATH ?? "",
49 HOME: home,
50 USERPROFILE: home,
51 AVCS_SERVERS_FILE: "no-servers.json",
52 };
53 if (process.env.CLAUDE_CONFIG_DIR) env.CLAUDE_CONFIG_DIR = process.env.CLAUDE_CONFIG_DIR;
54 if (process.env.SystemRoot) env.SystemRoot = process.env.SystemRoot;
55 return new Promise((done) => {
56 execFile(process.execPath, [CLIENT, ...args], { cwd: temp(), env }, (error, _stdout, stderr) =>
57 done({ code: typeof error?.code === "number" ? error.code : 0, stderr }),
58 );
59 });
62describe("join, signed out", () => {
63 it("to a public project, as a reader, names its page on the website and abso login", async () => {
64 const run = await signedOut("join", "abso-core", "--agent", "qa-reader", "--reader", "--server", openUrl);
65 assert.notEqual(run.code, 0);
66 assert.match(
67 run.stderr,
pinch86Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.Compare68 /abso-core is public: read it at http:\/\/127\.0\.0\.1:\d+\/christopher\/abso-core \(every page is also JSON\), or here with abso join abso-core --reader\. To work on it: abso login\./,
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare69 );
70 });
72 it("to a project that isn't public, keeps to abso login, and says a folder with a key joins with --agent", async () => {
73 const run = await signedOut("join", "secret", "--server", fake.url);
74 assert.notEqual(run.code, 0);
75 assert.match(run.stderr, /isn't signed in to .*abso login signs it in\./);
76 assert.doesNotMatch(run.stderr, /is public/);
77 assert.match(run.stderr, /A folder that already has a key joins with --agent <name>/);
78 });
79});