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 20 to 21

Compare

+52 −2 in 2 places
Lines 48–55 at 21 (were 48–55 at 20)
4848import { absolute, writeFileAtomic } from "../src/folder.ts";
4949import { runHook } from "../src/hook.ts";
5050import { tryFolderLock } from "../src/lock.ts";
51−import { commandTable, main } from "../src/main.ts";
52−import { argvFor } from "../src/mcp.ts";
51+import { boxServer, commandTable, main } from "../src/main.ts";
52+import { argvFor, confineCall, mcpTools } from "../src/mcp.ts";
5353import { pulledText } from "../src/queue.ts";
5454import { noteText, titleLine } from "../src/review.ts";
5555import { screenAnswer, throughLink, unsafeLink, unsafePath } from "../src/safety.ts";
Lines 2641–2696 at 21 (were 2641–2646 at 20)
26412641 assert.deepEqual(parsed.positionals, ["--server=x"]);
26422642 });
26432643
2644+ it("keeps a tool call's folder and --attach files inside the folder the server started in (Security on 233)", async () => {
2645+ const { folders } = await project({ "a.txt": "one\n" }, "alice");
2646+ const start = folders.alice!;
2647+ const refused = (input: Record<string, unknown>) => {
2648+ const r = confineCall(start, input);
2649+ return "refused" in r ? r.refused : "";
2650+ };
2651+ assert.deepEqual(confineCall(start, {}), { folder: start });
2652+ assert.deepEqual(confineCall(start, { folder: "sub" }), { folder: join(start, "sub") });
2653+ assert.deepEqual(confineCall(start, { attach: "a.txt, sub/b.png" }), { folder: start });
2654+ assert.match(refused({ folder: ".." }), /^folder "\.\." is outside .*, the folder this server started in/);
2655+ assert.match(refused({ folder: dirname(start) }), /is outside/);
2656+ assert.match(refused({ folder: "sub/../.." }), /is outside/);
2657+ assert.match(refused({ attach: "a.txt,../x.png" }), /^--attach \.\.\/x\.png is outside/);
2658+ assert.match(refused({ attach: join(tmpdir(), "x.png") }), /is outside/);
2659+ assert.match(refused({ folder: "sub", attach: "../../x.png" }), /is outside/);
2660+ assert.deepEqual(confineCall(start, { folder: "sub", attach: "../a.txt" }), { folder: join(start, "sub") });
2661+ const server = mcp(start);
2662+ try {
2663+ const up = await server.call("tools/call", { name: "status", arguments: { folder: ".." } });
2664+ assert.equal(up.result.isError, true);
2665+ assert.match(up.result.content[0].text, /is outside/);
2666+ const attach = await server.call("tools/call", {
2667+ name: "issue",
2668+ arguments: { args: ["1"], comment: "see", attach: "../../secret.png" },
2669+ });
2670+ assert.equal(attach.result.isError, true);
2671+ assert.match(attach.result.content[0].text, /^--attach \.\.\/\.\.\/secret\.png is outside/);
2672+ } finally {
2673+ server.close();
2674+ }
2675+ });
2677+ it("serves no -file twin, so no tool reads its text from a file", () => {
2678+ for (const tool of mcpTools())
2679+ for (const key of Object.keys(tool.inputSchema.properties as object))
2680+ assert.ok(!key.endsWith("-file") && key !== "file", `${tool.name} takes ${key}`);
2681+ });
2683+ it("abso login, box and logout outside a folder act on https://api.abso.dev", () => {
2684+ const outside = mkdtempSync(join(tmpdir(), "abso-login-"));
2685+ try {
2686+ assert.equal(boxServer(parseArgs("login", [], { server: "string" }), { cwd: outside }), "https://api.abso.dev");
2687+ const given = parseArgs("login", ["--server", "https://example.test"], { server: "string" });
2688+ assert.equal(boxServer(given, { cwd: outside }), "https://example.test");
2689+ } finally {
2690+ rmSync(outside, { recursive: true, force: true });
2691+ }
2692+ });
26442694 it("publish --done takes the start note back once it is published", async () => {
26452695 const { folders } = await project({ "a.txt": "one\n" }, "alice");
26462696 assert.equal((await avcs(folders.alice!, "start", "Two", "a.txt")).exit, 0);
MCP
compare on this site's /mcp
CLI
abso diff 20 21 client/test/client.test.ts --json
JSON
/christopher/abso-core/compare/20..21?file=client%2Ftest%2Fclient.test.ts&format=json