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 155 to 156

Compare

+10 −17 in 2 places
Lines 8–14 at 156 (were 8–14 at 155)
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";
Lines 228–245 at 156 (were 228–252 at 155)
228228 assert.equal(plainError(new Error("anything else"), true), undefined);
229229});
230230
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", () => {
231+test("whoami with nothing named shows prod, and names the other servers this box is signed in to", async () => {
232232 const outside = temp("outside");
233− const empty = temp("home");
234− assert.equal(checkServer(undefined, outside, {}, empty, NOW), "https://api.abso.dev");
235233 const home = temp("home");
236234 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",
235+ const fetcher = server({ "/box": [200, { revoked_at: null }] });
236+ const prod = await whoami("https://api.abso.dev", outside, {}, probe(fetcher, home));
237+ assert.match(
238+ prod.text,
239+ /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\./,
243240 );
244− const expired = temp("home");
245− writeBox(box(NOW - 1), expired);
246− assert.equal(checkServer(undefined, outside, {}, expired, NOW), "https://api.abso.dev");
247241 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− );
242+ const both = await whoami("https://api.abso.dev", outside, {}, probe(fetcher, home));
243+ assert.match(both.text, /Signed in to https:\/\/api\.abso\.dev as box b_0123abcd/);
244+ assert.equal(both.json.server, "https://api.abso.dev");
252245});
MCP
compare on this site's /mcp
CLI
abso diff 155 156 client/test/doctor.test.ts --json
JSON
/christopher/abso-core/compare/155..156?file=client%2Ftest%2Fdoctor.test.ts&format=json