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

Compare

+33 −4 in 6 places
Lines 16–22 at 318 (were 16–21 at 87)
1616import { tmpdir } from "node:os";
1717import { join, resolve } from "node:path";
1818import { after, before, describe, it } from "node:test";
19+import { Api } from "../src/api.ts";
1920import { writeBox } from "../src/box.ts";
2021import { writeConfig } from "../src/config.ts";
2122import { isPublic } from "../src/join-commands.ts";
Lines 37–53 at 318 (were 36–49 at 87)
3637 "doctor",
3738 "orgs",
3839 "org",
40+ // A project's groups are its members' to read and write; a visitor sees none.
41+ "groups",
42+ "group",
3943 "skill",
4044 "join",
4145 "record",
42− "publish",
46+ "push",
4347 "bisect",
4448 "reader",
4549 "settle",
46− "sync",
50+ "pull",
4751 "run",
4852 "serve",
4953 "mv",
Lines 61–68 at 318 (were 57–62 at 87)
5761 "reply",
5862 "unqueue",
5963 "visibility",
64+ "autosettle",
65+ "flag",
6066 "ci",
6167 "shot",
6268 "prep",
Lines 72–78 at 318 (were 66–72 at 87)
6672 "logs",
6773 "switch",
6874 "land",
69− "draft-sync",
75+ "draft-pull",
7076 "diff",
7177 "restore",
7278 "export",
Lines 202–208 at 318 (were 196–202 at 87)
196202 server: url,
197203 id: "b_0123abcd",
198204 credential: CREDENTIAL,
199− grant: { projects: [{ project: "abso-core", role: "writer" }], max_agents: 3 },
205+ grant: { projects: [{ project: "abso-core", role: "writer" }] },
200206 expiresAt: Date.now() + 86_400_000,
201207 },
202208 home,
Lines 263–291 at 318 (were 257–262 at 87)
257263 assert.match(runs[0]!.stderr, /isn't signed in to .*abso login signs it in/);
258264 });
259265
266+ it("every request its Api makes goes through one send: reads only, no redirect, no sign-in", async () => {
267+ const real = globalThis.fetch;
268+ const calls: RequestInit[] = [];
269+ globalThis.fetch = (async (_input: unknown, init?: RequestInit) => {
270+ calls.push(init ?? {});
271+ return new Response("{}", { status: 200 });
272+ }) as typeof fetch;
273+ try {
274+ const visitor = new Api({ server: url, project: "abso-core", agent: "", visitor: true, token: TOKEN });
275+ await visitor.send(`${url}/p/abso-core/serve`, { headers: visitor.headers() });
276+ await assert.rejects(visitor.send(`${url}/p/abso-core/a/x/run`, { method: "POST" }), /sends only reads/);
277+ const member = new Api({ server: url, project: "abso-core", agent: "x", token: TOKEN });
278+ await member.send(`${url}/p/abso-core/serve`, { headers: member.headers() });
279+ } finally {
280+ globalThis.fetch = real;
281+ }
282+ assert.equal(calls.length, 2);
283+ assert.equal(calls[0]!.redirect, "error");
284+ assert.equal(new Headers(calls[0]!.headers).get("authorization"), null);
285+ assert.equal(calls[1]!.redirect, undefined);
286+ assert.equal(new Headers(calls[1]!.headers).get("authorization"), `Bearer ${TOKEN}`);
287+ });
260289 it("runs only its reads: every other command is refused before any call, and a new command fails here", async () => {
261290 const sorted = new Set([...Object.keys(VISITOR_READS), ...VISITOR_ELSEWHERE, ...REFUSED]);
262291 for (const name of Object.keys(commandTable()))
MCP
compare on this site's /mcp
CLI
abso diff 87 318 client/test/visitor.test.ts --json
JSON
/christopher/abso-core/compare/87..318?file=client%2Ftest%2Fvisitor.test.ts&format=json