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

Compare

+24 −27 in 3 places
Lines 8–20 at 318 (were 8–20 at 91)
88import { test } from "node:test";
99import { ApiError } from "../src/api-error.ts";
1010import { writeBox } from "../src/box.ts";
11−import { checkServer, doctor, doctorText, nodeNeeded, type Probe, plainError, whoami } from "../src/doctor.ts";
11+import { doctor, doctorText, nodeNeeded, type Probe, plainError, whoami } from "../src/doctor.ts";
1212
1313const SERVER = "https://staging.abso.example";
1414const CREDENTIAL = "abso_bx_the-secret-credential";
1515const KEY = "abso_sk_the-secret-key";
1616const NOW = Date.parse("2026-10-10T06:00:00.000Z");
17−const grant = { projects: [{ project: "game", role: "writer" }], max_agents: 3 };
17+const grant = { projects: [{ project: "game", role: "writer" }] };
1818const box = (expiresAt = Date.parse("2026-10-20T00:00:00.000Z")) => ({
1919 server: SERVER,
2020 id: "b_0123abcd",
Lines 180–186 at 318 (were 180–186 at 91)
180180 out.text,
181181 /^Signed in to https:\/\/staging\.abso\.example as box b_0123abcd, approved by christopher\.\n/,
182182 );
183− assert.match(out.text, /Projects: game \(writer\)\. Up to 3 agents\./);
183+ assert.match(out.text, /Projects: game \(writer\)\.\n/);
184184 assert.match(
185185 out.text,
186186 /This folder is agent builder in project game on https:\/\/staging\.abso\.example, with the agent key k_00c0ffee\./,
Lines 211–249 at 318 (were 211–252 at 91)
211211
212212test("plainError words a refusal by whether a credential went, and a server that can't be reached", () => {
213213 const refused = new ApiError("GET /status answered 401: missing or wrong token", 401);
214− assert.equal(plainError(refused, false), "You're not signed in. Run abso login, then abso join <project>.");
215− assert.match(plainError(refused, true)!, /^The server didn't accept this folder's key.*abso doctor checks it/);
214+ assert.equal(plainError(refused, undefined), "You're not signed in. Run abso login, then abso join <project>.");
215+ assert.match(
216+ plainError(refused, "this folder's key")!,
217+ /^The server didn't accept this folder's key.*abso doctor checks it/,
218+ );
219+ assert.match(plainError(refused, "ABSO_TOKEN")!, /^The server didn't accept ABSO_TOKEN: /);
216220 assert.equal(
217− plainError(new ApiError("could not reach https://api.abso.dev: connect ECONNREFUSED"), true),
221+ plainError(new ApiError("could not reach https://api.abso.dev: connect ECONNREFUSED"), "this folder's key"),
218222 "Can't reach https://api.abso.dev: connect ECONNREFUSED. Check your connection; abso doctor checks the rest.",
219223 );
220224 assert.equal(
221225 plainError(
222− new ApiError("could not reach http://x: refused. Nothing was published. Run the same command again."),
223− true,
226+ new ApiError("could not reach http://x: refused. Nothing was pushed. Run the same command again."),
227+ "this folder's key",
224228 ),
225− "Can't reach http://x: refused. Nothing was published. Run the same command again.",
229+ "Can't reach http://x: refused. Nothing was pushed. Run the same command again.",
226230 );
227− assert.equal(plainError(new ApiError("GET /log answered 500: boom", 500), true), undefined);
228− assert.equal(plainError(new Error("anything else"), true), undefined);
231+ assert.equal(plainError(new ApiError("GET /log answered 500: boom", 500), "this folder's key"), undefined);
232+ assert.equal(plainError(new Error("anything else"), "this folder's key"), undefined);
229233});
230234
231−test("whoami and doctor pick the server as join does: --server, ABSO_SERVER, the folder's, the box's sign-in, then abso.dev", () => {
235+test("whoami with nothing named shows prod, and names the other servers this box is signed in to", async () => {
232236 const outside = temp("outside");
233− const empty = temp("home");
234− assert.equal(checkServer(undefined, outside, {}, empty, NOW), "https://api.abso.dev");
235237 const home = temp("home");
236238 writeBox(box(), home);
237− assert.equal(checkServer(undefined, outside, {}, home, NOW), SERVER);
238− assert.equal(checkServer(undefined, folder(), {}, empty, NOW), SERVER);
239− assert.equal(checkServer(undefined, outside, { ABSO_SERVER: "http://env.example" }, home, NOW), "http://env.example");
240− assert.equal(
241− checkServer("http://flag.example", folder(), { ABSO_SERVER: "http://env.example" }, home, NOW),
242− "http://flag.example",
239+ const fetcher = server({ "/box": [200, { revoked_at: null }] });
240+ const prod = await whoami("https://api.abso.dev", outside, {}, probe(fetcher, home));
241+ assert.match(
242+ prod.text,
243+ /This box isn't signed in to https:\/\/api\.abso\.dev\. Run abso login\. This box is signed in to https:\/\/staging\.abso\.example: abso whoami --server <url> uses it\./,
243244 );
244− const expired = temp("home");
245− writeBox(box(NOW - 1), expired);
246− assert.equal(checkServer(undefined, outside, {}, expired, NOW), "https://api.abso.dev");
247245 writeBox({ ...box(), server: "https://api.abso.dev" }, home);
248− assert.throws(
249− () => checkServer(undefined, outside, {}, home, NOW),
250− /signed in to .* and .*: say which with --server/,
251− );
246+ const both = await whoami("https://api.abso.dev", outside, {}, probe(fetcher, home));
247+ assert.match(both.text, /Signed in to https:\/\/api\.abso\.dev as box b_0123abcd/);
248+ assert.equal(both.json.server, "https://api.abso.dev");
252249});
MCP
compare on this site's /mcp
CLI
abso diff 91 318 client/test/doctor.test.ts --json
JSON
/christopher/abso-core/compare/91..318?file=client%2Ftest%2Fdoctor.test.ts&format=json