Versions 59 to 318
Lines 7–29 at 318 (were 7–13 at 59)
10−import { boxPublic, boxText, forgetBox, login, logout, mintKey, readBox, writeBox } from "../src/box.ts";
1127
Lines 32–37 at 318 (were 16–22 at 59)
19− max_agents: 5,
2237const record = { server: SERVER, id: "b_0123abcd", credential: CREDENTIAL, grant, expiresAt: Date.parse(EXPIRES) };
Lines 70–167 at 318 (were 55–60 at 59)
5772
109+
110+test("login sends requested grants only at device start and retains the user's actual approval", async () => {
143+
164+
58165test("login shows the code, waits while it's pending, and keeps the credential in the user folder", async () => {
Lines 205–273 at 318 (were 98–107 at 59)
101− assert.match(boxText(got, SERVER, 0), /abso \(writer\), game \(reader\)\. Up to 5 agents\./);
104212
213+test("login opens the approve page with the code in it, and prints the link and code all the same", async () => {
237+ "To sign this box in, open https://abso.dev/login/box?code=WXYZ-BCDF and approve the code WXYZ-BCDF.",
240+
241+test("an open that doesn't start says nothing about a browser, and the printed link stands", async () => {
263+ "To sign this box in, open https://abso.dev/login/box?code=WXYZ-BCDF and approve the code WXYZ-BCDF.",
270+
Lines 379–554 at 318 (were 213–215 at 59)
382+
383+test("join and init pick the server in the one order: --server, the folder's, ABSO_SERVER, then prod", () => {
386+ const args = (server?: string) => ({ positionals: [], flags: new Map(server ? [["server", server]] : []) });
391+ assert.equal(serverFrom(args(), none), "https://api.abso.dev", "a sign-in elsewhere doesn't pick the server");
392+ assert.deepEqual(signedInServers(h, Date.now() + 2e6), [], "an expired sign-in doesn't count");
393+ assert.equal(serverFrom(args(), { ...none, env: { ABSO_SERVER: "https://env.example" } }), "https://env.example");
395+ serverFrom(args("https://flag.example"), { ...none, env: { ABSO_SERVER: "https://env.example" } }),
400+
401+test("join with no --agent takes the box's name, skips names this box holds, and moves past a taken one", async () => {
414+ seen.map((s) => [new URL(s.url).pathname, (s.body as { agent?: string } | null)?.agent ?? null]),
423+
424+test("abso init from a box (abso 663): one key for every try, waiting out a pending create; abso box says all projects", async () => {
425+ const record = { server: SERVER, id: "b_1", credential: CREDENTIAL, grant, expiresAt: Date.now() + 86_400_000 };
452+ assert.ok(seen.every((s) => s.path === "/box/projects" && s.key === "33333333-3333-4333-8333-333333333333"));
454+ assert.deepEqual(JSON.parse(seen[0]!.body), { name: "made", files: [{ path: "a.txt", text: "hi\n" }] });
455+ const all = { ...record, grant: { projects: [], scopes: [{ kind: "member-all", role: "writer" }] } };
461+
462+// abso 684: in an agent's folder, login asks a person in the project instead of relaying the code.
465+ assert.equal(device, started.device_code, "the ask is made with this client's own device code");
477+
478+test("an asked login says who was asked and until when, and doesn't lead with the code (abso 684)", async () => {
488+ [200, { box_id: "b_test", box_token: CREDENTIAL, expires_at: EXPIRES, grant: { projects: [] } }],
500+ /^Asked the person who approved this agent's box \(ask 41 in abso\) to sign this box in, as at most writer\.$/,
502+ assert.match(said[1]!, /^Waiting for their answer, until .* CT\. To approve it yourself instead: /);
505+
529+
530+test("an asked login that nobody answers withdraws its ask and grants nothing (abso 684)", async () => {
- MCP
- compare on this site's /mcp
- CLI
- abso diff 59 318 client/test/box.test.ts --json
- JSON
- /christopher/abso-core/compare/59..318?file=client%2Ftest%2Fbox.test.ts&format=json