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 184 to 185

Compare

+39 −0 in 2 places
Lines 9–15 at 185 (were 9–14 at 184)
99import { test } from "node:test";
1010import { parseArgs } from "../src/args.ts";
1111import {
12+ boxCreateProject,
1213 boxPublic,
1314 boxText,
1415 forgetBox,
Lines 420–460 at 185 (were 419–421 at 184)
419420 "snow is this box's already: never minted again, which would replace its key",
420421 );
421422});
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 };
426+ const seen: { path: string; key: string | null; auth: string | null; body: string }[] = [];
427+ let calls = 0;
428+ const fetcher = (async (url: string | URL | Request, init?: RequestInit) => {
429+ const headers = new Headers(init?.headers);
430+ seen.push({
431+ path: new URL(String(url)).pathname,
432+ key: headers.get("idempotency-key"),
433+ auth: headers.get("authorization"),
434+ body: String(init?.body),
435+ });
436+ calls++;
437+ const body =
438+ calls < 3
439+ ? { operation: { id: "op", state: "pending" } }
440+ : { project: "made", id: "proj_1", visibility: "private" };
441+ return new Response(JSON.stringify(body), { status: calls < 3 ? 202 : 200 });
442+ }) as typeof fetch;
443+ const made = await boxCreateProject(
444+ record,
445+ { name: "made", files: [{ path: "a.txt", text: "hi\n" }] },
446+ "33333333-3333-4333-8333-333333333333",
447+ fetcher,
448+ async () => {},
449+ );
450+ assert.equal(made.id, "proj_1");
451+ assert.equal(seen.length, 3);
452+ assert.ok(seen.every((s) => s.path === "/box/projects" && s.key === "33333333-3333-4333-8333-333333333333"));
453+ assert.ok(seen.every((s) => s.auth === `Box ${CREDENTIAL}`));
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" }] } };
456+ assert.match(
457+ boxText(all, SERVER),
458+ /Projects: all of yours, now and later \(writer at most\)\. abso init makes a new one/,
459+ );
460+});
MCP
compare on this site's /mcp
CLI
abso diff 184 185 client/test/box.test.ts --json
JSON
/christopher/abso-core/compare/184..185?file=client%2Ftest%2Fbox.test.ts&format=json