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

Compare

+31 −0 in 1 place
new file, 31 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { answer } from "../../worker/project/http.ts";
4+import { DiskFirstRuntime } from "../src/disk-first-runtime.ts";
5+import { memoryStorage } from "./helpers.ts";
6+
7+test("disk runtime reads the unpublished diff from indexed membership", (t) => {
8+ const storage = memoryStorage();
9+ t.after(() => storage.db.close());
10+ const runtime = () => new DiskFirstRuntime(storage, "diff", "diff");
11+ runtime().initialize(
12+ (c) => answer(c, "init", undefined, { files: { "a.txt": "before\n" } }),
13+ () => {},
14+ );
15+ while (!runtime().preparePage(() => {}).ready) {}
16+ assert.equal(
17+ runtime().write(
18+ (c) => answer(c, "record", "alice", { files: { "a.txt": "after\n" } }),
19+ () => {},
20+ ).status,
21+ 200,
22+ );
23+ const result = runtime().write(
24+ (c) => answer(c, "diff", "alice", {}),
25+ () => {},
26+ );
27+ assert.equal(result.status, 200, JSON.stringify(result));
28+ assert.deepEqual((result.body as { files: unknown }).files, [
29+ { path: "a.txt", before: "before\n", after: "after\n" },
30+ ]);
31+});
MCP
compare on this site's /mcp
CLI
abso diff 52 318 server/test/projected-diff.test.ts --json
JSON
/christopher/abso-core/compare/52..318?file=server%2Ftest%2Fprojected-diff.test.ts&format=json