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

Compare

+38 −0 in 1 place
new file, 38 lines
1+import assert from "node:assert/strict";
2+import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
3+import { tmpdir } from "node:os";
4+import { join } from "node:path";
5+import { test } from "node:test";
6+import { newFolderDir } from "../src/state-dir.ts";
7+
8+/** A Claude config folder with these mods installed, each at this version. */
9+function claudeWith(mods: Record<string, string>): { CLAUDE_CONFIG_DIR: string } {
10+ const dir = mkdtempSync(join(tmpdir(), "abso-claude-"));
11+ for (const [name, version] of Object.entries(mods)) {
12+ const mod = join(dir, "skills", name);
13+ mkdirSync(mod, { recursive: true });
14+ writeFileSync(join(mod, ".avcs-install.json"), JSON.stringify({ mod: name, version }));
15+ }
16+ return { CLAUDE_CONFIG_DIR: dir };
17+}
19+test("a new folder gets .abso when no mod is installed, or every installed mod knows it", () => {
20+ assert.equal(newFolderDir(claudeWith({})), ".abso");
21+ assert.equal(newFolderDir(claudeWith({ avcs: "0.2.0+abc1234", "avcs-view": "0.2.0" })), ".abso");
22+ assert.equal(newFolderDir(claudeWith({ abso: "0.3.1.dirty" })), ".abso");
23+});
25+test("a new folder keeps .avcs while any installed mod is older than the rename", () => {
26+ assert.equal(newFolderDir(claudeWith({ avcs: "0.1.0+2ecf1a7" })), ".avcs");
27+ assert.equal(newFolderDir(claudeWith({ avcs: "0.2.0", "avcs-view": "0.1.0" })), ".avcs");
28+ assert.equal(newFolderDir(claudeWith({ avcs: "unreadable" })), ".avcs");
29+});
31+test("a mod folder with no readable install record counts as old", () => {
32+ const env = claudeWith({});
33+ const mod = join(env.CLAUDE_CONFIG_DIR, "skills", "avcs");
34+ mkdirSync(mod, { recursive: true }); // copied in by hand: no .avcs-install.json
35+ assert.equal(newFolderDir(env), ".avcs");
36+ writeFileSync(join(mod, ".avcs-install.json"), "not json");
37+ assert.equal(newFolderDir(env), ".avcs");
38+});
MCP
compare on this site's /mcp
CLI
abso diff 2 318 client/test/new-folder-dir.test.ts --json
JSON
/christopher/abso-core/compare/2..318?file=client%2Ftest%2Fnew-folder-dir.test.ts&format=json