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
MCP
code on this site's /mcp
CLI
none: the JSON below is the answer
JSON
/christopher/abso-core/files/server/test/projected-move.test.ts?format=json
35 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 163, 1 version changed it
1import assert from "node:assert/strict";
2import { test } from "node:test";
3import { answer } from "../../worker/project/http.ts";
4import { DiskFirstRuntime } from "../src/disk-first-runtime.ts";
5import { memoryStorage } from "./helpers.ts";
6
7test("disk runtime moves a text file without using a stale reader", (t) => {
8 const storage = memoryStorage();
9 t.after(() => storage.db.close());
10 const runtime = () => new DiskFirstRuntime(storage, "move", "move");
11 runtime().initialize(
12 (c) => answer(c, "init", undefined, { files: { "a.txt": "one\ntwo\n" } }),
13 () => {},
14 );
15 while (!runtime().preparePage(() => {}).ready) {}
16 const result = runtime().write(
17 (c) => answer(c, "move", "alice", { from: "a.txt", to: "b.txt" }),
18 () => {},
19 );
20 assert.equal(result.status, 200, JSON.stringify(result));
21 assert.equal(
22 runtime().write(
23 (c) => answer(c, "publish", "alice", { message: "move" }),
24 () => {},
25 ).status,
26 200,
27 );
28 assert.deepEqual(
29 runtime().read(
30 (c) => c.shared().files,
31 () => {},
32 ),
33 { "b.txt": "one\ntwo\n" },
34 );
35});