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 60 to 61

Compare

+35 −1 in 2 places
Lines 7–24 at 61 (were 7–13 at 60)
77import { tmpdir } from "node:os";
88import { join } from "node:path";
99import { test } from "node:test";
10−import { boxPublic, boxText, forgetBox, login, logout, mintKey, readBox, writeBox } from "../src/box.ts";
10+import {
11+ boxPublic,
12+ boxText,
13+ forgetBox,
14+ login,
15+ logout,
16+ mintKey,
17+ readBox,
18+ signedInServers,
19+ writeBox,
20+} from "../src/box.ts";
21+import { serverFrom } from "../src/join-commands.ts";
1122
1223const SERVER = "https://staging.abso.example";
1324const CREDENTIAL = "abso_bx_the-secret-credential";
Lines 282–307 at 61 (were 271–273 at 60)
271282 assert.equal(readBox(SERVER, h), undefined);
272283 assert.equal(forgetBox(SERVER, h), false);
273284});
286+test("join and init pick the server: --server, ABSO_SERVER, the box's sign-in, then api.abso.dev (abso issue 349)", () => {
287+ const h = home();
288+ const args = (server?: string) => ({ positionals: [], flags: new Map(server ? [["server", server]] : []) });
289+ const none = { env: {} };
290+ assert.equal(serverFrom(args(), none, h), "https://api.abso.dev", "nothing signed in: the abso API");
291+ writeBox({ ...record, expiresAt: Date.now() + 1e6 }, h);
292+ assert.deepEqual(signedInServers(h), [SERVER]);
293+ assert.equal(serverFrom(args(), none, h), SERVER, "the server abso login signed this box in to");
294+ assert.deepEqual(signedInServers(h, Date.now() + 2e6), [], "an expired sign-in doesn't count");
295+ assert.equal(serverFrom(args(), { env: { ABSO_SERVER: "https://env.example" } }, h), "https://env.example");
296+ assert.equal(
297+ serverFrom(args("https://flag.example"), { env: { ABSO_SERVER: "https://env.example" } }, h),
298+ "https://flag.example",
299+ );
300+ writeBox({ ...record, server: "https://other.abso.example", expiresAt: Date.now() + 1e6 }, h);
301+ writeBox({ ...record, expiresAt: Date.now() + 1e6 }, h);
302+ assert.throws(
303+ () => serverFrom(args(), none, h),
304+ /signed in to https:\/\/other\.abso\.example and https:\/\/staging\.abso\.example: say which with --server/,
305+ );
306+ assert.equal(serverFrom(args(SERVER), none, h), SERVER, "--server settles it");
307+});
MCP
compare on this site's /mcp
CLI
abso diff 60 61 client/test/box.test.ts --json
JSON
/christopher/abso-core/compare/60..61?file=client%2Ftest%2Fbox.test.ts&format=json