Versions 32 to 318
Lines 7–13 at 318 (were 7–13 at 32)
10−// (X-Avcs-Client). A commit that changes none of them changes nothing to
Lines 45–51 at 318 (were 45–51 at 32)
48−import { CLIENT_DIR, clientPlace, clientVersion } from "./client-version.ts";
48+import { builtCopy, CLIENT_DIR, clientPlace, clientVersion, headCommit } from "./client-version.ts";
4949
Lines 94–101 at 318 (were 94–99 at 32)
97+ /** For tests: the command stamped as HOOK_COMMAND, instead of this client's own `abso hook`. */
98100
Lines 109–167 at 318 (were 107–133 at 32)
107109
108110/** The abso mod: what the hook imports first, plugin.json last. src/core.ts is the only client file it imports. */
110− name: "avcs",
112114 files: ["src/core.ts", "hooks/stamp.ts", "hooks/register.ts", "hooks/hooks.json", ".claude-plugin/plugin.json"],
115117
116−/** The avcs-view mod (#12), from client/view. */
118− name: "avcs-view",
120122 files: ["types/index.d.ts", "hooks/stamp.ts", "hooks/register.tsx", "hooks/hooks.json", ".claude-plugin/plugin.json"],
123125
126+/** The skills folders the mods had before the rename; an install moves them out of the way (see retireOldMod). */
127+export const OLD_MOD_NAMES: Readonly<Record<string, string>> = { "abso-hooks": "avcs", "abso-view": "avcs-view" };
128+
125130export const skillsFolder = (name: string, env: Readonly<Record<string, string | undefined>> = process.env) =>
127132
128133export const modInstalled = (env: Readonly<Record<string, string | undefined>> = process.env) =>
129− existsSync(at(skillsFolder(AVCS_MOD.name, env), MANIFEST));
130136
137+/** Whether the installed abso mod hands a local project's edits to abso hook: it was installed with a HOOK_COMMAND. */
138+export function modHandsLocal(env: Readonly<Record<string, string | undefined>> = process.env): boolean {
140+ return /HOOK_COMMAND[^=\n]*=\s*\[/.test(readFileSync(at(skillsFolder(AVCS_MOD.name, env), STAMP_FILE), "utf8"));
145+
147+ * After the new mod is in, the folder it replaces (skills/avcs, skills/avcs-view) would load beside it, so it
148+ * is moved, not deleted, to ~/.abso/retired-mods/<name>-<stamp>. Returns where it went, or undefined when there was none.
159+ const to = join(homedir(), ".abso", "retired-mods", `${old}-${now.toISOString().replace(/[:.]/g, "-")}`);
164+
131165/** 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). */
133167 const manifest = JSON.parse(readFileSync(at(spec.from, MANIFEST), "utf8")) as { version?: unknown };
Lines 178–247 at 318 (were 144–151 at 32)
146180
147−/** The files to install, stamped with `version`, in install order. */
148−function filesFor(spec: ModSpec, version: string): Map<string, Buffer> {
181+/** A file changed this close to when an answer was kept can't be told apart from one changed just after it. */
183+
190+
192+ * modCommit for the version report, which `abso status` asks on every run: it runs git twice per mod, so
193+ * the answer is kept in ~/.abso/mod-commits.json. A kept answer holds while the checkout's commit (read
194+ * from .git, without git) and each of the mod's files (size, modified time, inode) are as they were, and
195+ * every file was changed clearly before the answer was kept; anything else asks git again. Outside a git
232+ writeFileSync(next, JSON.stringify({ format: 1, mods: { ...kept, [key]: { head, files, at, commit } } }));
239+
240+/** The command that runs this checkout's `abso hook`: what the mod hands a local project's edits to. */
241+export const hookCommand = (): readonly string[] => [process.execPath, join(CLIENT_DIR, "abso.ts"), "hook"];
242+
243+/** The files to install, stamped with `version` (and HOOK_COMMAND, where a stamp.ts has it), in install order. */
244+function filesFor(spec: ModSpec, version: string, hook: readonly string[] = hookCommand()): Map<string, Buffer> {
149245 if (!/^[\w.+-]+$/.test(version)) throw new Error(`can't stamp the version ${JSON.stringify(version)}`);
Lines 253–261 at 318 (were 157–163 at 32)
159255 if (stamped === text) throw new Error(`${rel} has no "STAMP ... = undefined" line to stamp`);
160− data = Buffer.from(stamped);
257+ stamped.replace(/(HOOK_COMMAND[^=\n]*=\s*)undefined/, (_, head: string) => head + JSON.stringify(hook)),
Lines 402–408 at 318 (were 304–310 at 32)
307− const next = filesFor(spec, version);
Lines 503–511 at 318 (were 405–410 at 32)
407505 const r = installMod(spec, { target, check: unchecked ? () => undefined : checkWithClaude(spec) });
508+ if (retired) console.log(`Moved the old ${OLD_MOD_NAMES[spec.name]} mod out of the skills folder, to ${retired}.`);
409510 console.log(`The ${spec.name} mod ${r.version} is already installed in ${target}; nothing changed.`);
Lines 533–550 at 318 (were 432–438 at 32)
434535
435−/** `avcs --version`: this client, and the mods installed on this machine, compared with this client's. */
537+ * The command that runs one of this client's installers (client/install-mod.ts or install-view.ts), by its full
538+ * path. They are .ts files, which Node runs itself from 22.18, so on an older Node it says which one it needs.
544+ : `${command} (with Node 22.18 or later, which runs .ts files; this is Node ${process.versions.node})`;
546+
547+/** `abso --version`: this client, and the mods installed on this machine, compared with this client's. */
Lines 572–594 at 318 (were 460–479 at 32)
463− return versionFor(spec);
582+ // A built copy has no mod files to compare with or install from: it reports what is installed.
471− lines.push(`the ${m.name} mod: not installed (node client/${installer})`);
584+ lines.push(`the ${m.name} mod: not installed${builtCopy() ? "" : ` (${installerCommand(installer)})`}`);
476− m.version === m.current ? "" : `; this client has ${m.current}: node client/${installer} installs it`;
Lines 606–611 at 318 (were 491–496 at 32)
491606 .filter((m) => m.version?.includes("+") && /\+[0-9a-f]{7}$/.test(m.current) && m.version !== m.current)
494− `The ${m.name} mod installed on this machine is ${m.version}, and this client has ${m.current}: node client/${installers[m.name]} installs it (new chats load it).`,
609+ `The ${m.name} mod installed on this machine is ${m.version}, and this client has ${m.current}: ${installerCommand(installers[m.name]!)} installs it (new chats load it).`,
- MCP
- compare on this site's /mcp
- CLI
- abso diff 32 318 client/src/install.ts --json
- JSON
- /christopher/abso-core/compare/32..318?file=client%2Fsrc%2Finstall.ts&format=json