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 39 to 40

Compare

+30 −4 in 2 places
Lines 107–156 at 40 (were 107–133 at 39)
107107
108108/** The abso mod: what the hook imports first, plugin.json last. src/core.ts is the only client file it imports. */
109109export const AVCS_MOD: ModSpec = {
110− name: "avcs",
110+ name: "abso-hooks",
111111 from: CLIENT_DIR,
112112 files: ["src/core.ts", "hooks/stamp.ts", "hooks/register.ts", "hooks/hooks.json", ".claude-plugin/plugin.json"],
113113 test: "hooks/register.test.ts",
114114};
115115
116−/** The avcs-view mod (#12), from client/view. */
116+/** The abso-view mod (#12), from client/view. */
117117export const VIEW_MOD: ModSpec = {
118− name: "avcs-view",
118+ name: "abso-view",
119119 from: join(CLIENT_DIR, "view"),
120120 files: ["types/index.d.ts", "hooks/stamp.ts", "hooks/register.tsx", "hooks/hooks.json", ".claude-plugin/plugin.json"],
121121 test: "hooks/register.test.ts",
122122};
123123
124+/** The skills folders the mods had before the rename; an install moves them out of the way (see retireOldMod). */
125+export const OLD_MOD_NAMES: Readonly<Record<string, string>> = { "abso-hooks": "avcs", "abso-view": "avcs-view" };
124127/** Where Claude Code's skills folder keeps a mod. */
125128export const skillsFolder = (name: string, env: Readonly<Record<string, string | undefined>> = process.env) =>
126129 join(env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude"), "skills", name);
127130
128131export const modInstalled = (env: Readonly<Record<string, string | undefined>> = process.env) =>
129− existsSync(at(skillsFolder(AVCS_MOD.name, env), MANIFEST));
132+ existsSync(at(skillsFolder(AVCS_MOD.name, env), MANIFEST)) ||
133+ existsSync(at(skillsFolder(OLD_MOD_NAMES[AVCS_MOD.name]!, env), MANIFEST));
130134
135+/**
136+ * After the new mod is in, the folder it replaces (skills/avcs, skills/avcs-view) would load beside it, so it
137+ * is moved, not deleted, to ~/.abso/retired-mods/<name>-<stamp>. Returns where it went, or undefined when there was none.
138+ */
139+export function retireOldMod(
140+ spec: ModSpec,
141+ env: Readonly<Record<string, string | undefined>> = process.env,
142+ now: Date = new Date(),
143+): string | undefined {
144+ const old = OLD_MOD_NAMES[spec.name];
145+ if (old === undefined) return undefined;
146+ const from = skillsFolder(old, env);
147+ if (!existsSync(from)) return undefined;
148+ const to = join(homedir(), ".abso", "retired-mods", `${old}-${now.toISOString().replace(/[:.]/g, "-")}`);
149+ mkdirSync(dirname(to), { recursive: true });
150+ renameRetrying(from, to);
151+ return to;
152+}
131154/** The version an install of `spec` gets: plugin.json's, plus the last commit that changed its files (and .dirty when they differ from it). */
132155export function versionFor(spec: ModSpec, commit?: string | null): string {
133156 const manifest = JSON.parse(readFileSync(at(spec.from, MANIFEST), "utf8")) as { version?: unknown };
Lines 428–436 at 40 (were 405–410 at 39)
405428 }
406429 const unchecked = options.includes("--unchecked");
407430 const r = installMod(spec, { target, check: unchecked ? () => undefined : checkWithClaude(spec) });
431+ // Only for the real skills folder: an install to another folder leaves the old mod alone.
432+ const retired = target === resolve(skillsFolder(spec.name)) ? retireOldMod(spec) : undefined;
433+ if (retired) console.log(`Moved the old ${OLD_MOD_NAMES[spec.name]} mod out of the skills folder, to ${retired}.`);
408434 if (!r.changed) {
409435 console.log(`The ${spec.name} mod ${r.version} is already installed in ${target}; nothing changed.`);
410436 return;
MCP
compare on this site's /mcp
CLI
abso diff 39 40 client/src/install.ts --json
JSON
/christopher/abso-core/compare/39..40?file=client%2Fsrc%2Finstall.ts&format=json