{"draft":null,"from":175,"to":318,"files":[{"path":"client/src/install.ts","added":35,"removed":8,"diff":"--- a/client/src/install.ts\n+++ b/client/src/install.ts\n@@ -94,6 +94,8 @@\n \t/** For tests: the rename that moves each file into place. */\n \treadonly rename?: (from: string, to: string) => void;\n \treadonly now?: Date;\n+\t/** For tests: the command stamped as HOOK_COMMAND, instead of this client's own `abso hook`. */\n+\treadonly hookCommand?: readonly string[];\n }\n \n const RECORD = \".avcs-install.json\";\n@@ -132,6 +134,15 @@\n \texistsSync(at(skillsFolder(AVCS_MOD.name, env), MANIFEST)) ||\n \texistsSync(at(skillsFolder(OLD_MOD_NAMES[AVCS_MOD.name]!, env), MANIFEST));\n \n+/** Whether the installed abso mod hands a local project's edits to abso hook: it was installed with a HOOK_COMMAND. */\n+export function modHandsLocal(env: Readonly<Record<string, string | undefined>> = process.env): boolean {\n+\ttry {\n+\t\treturn /HOOK_COMMAND[^=\\n]*=\\s*\\[/.test(readFileSync(at(skillsFolder(AVCS_MOD.name, env), STAMP_FILE), \"utf8\"));\n+\t} catch {\n+\t\treturn false;\n+\t}\n+}\n+\n /**\n  * After the new mod is in, the folder it replaces (skills/avcs, skills/avcs-view) would load beside it, so it\n  * is moved, not deleted, to ~/.abso/retired-mods/<name>-<stamp>. Returns where it went, or undefined when there was none.\n@@ -226,8 +237,11 @@\n \treturn commit;\n }\n \n-/** The files to install, stamped with `version`, in install order. */\n-function filesFor(spec: ModSpec, version: string): Map<string, Buffer> {\n+/** The command that runs this checkout's `abso hook`: what the mod hands a local project's edits to. */\n+export const hookCommand = (): readonly string[] => [process.execPath, join(CLIENT_DIR, \"abso.ts\"), \"hook\"];\n+\n+/** The files to install, stamped with `version` (and HOOK_COMMAND, where a stamp.ts has it), in install order. */\n+function filesFor(spec: ModSpec, version: string, hook: readonly string[] = hookCommand()): Map<string, Buffer> {\n \tif (!/^[\\w.+-]+$/.test(version)) throw new Error(`can't stamp the version ${JSON.stringify(version)}`);\n \tconst out = new Map<string, Buffer>();\n \tfor (const rel of spec.files) {\n@@ -239,7 +253,9 @@\n \t\t\tconst text = data.toString(\"utf8\");\n \t\t\tconst stamped = text.replace(/(STAMP[^=\\n]*=\\s*)undefined/, `$1'${version}'`);\n \t\t\tif (stamped === text) throw new Error(`${rel} has no \"STAMP ... = undefined\" line to stamp`);\n-\t\t\tdata = Buffer.from(stamped);\n+\t\t\tdata = Buffer.from(\n+\t\t\t\tstamped.replace(/(HOOK_COMMAND[^=\\n]*=\\s*)undefined/, (_, head: string) => head + JSON.stringify(hook)),\n+\t\t\t);\n \t\t}\n \t\tout.set(rel, data);\n \t}\n@@ -386,7 +402,7 @@\n export function installMod(spec: ModSpec, options: InstallOptions): Installed {\n \tconst target = resolve(options.target);\n \tconst version = versionFor(spec, options.commit);\n-\tconst next = filesFor(spec, version);\n+\tconst next = filesFor(spec, version, options.hookCommand);\n \tconst existed = existsSync(target);\n \tmkdirSync(target, { recursive: true });\n \ttry {\n@@ -517,7 +533,18 @@\n \treadonly current: string;\n }\n \n-/** `avcs --version`: this client, and the mods installed on this machine, compared with this client's. */\n+/**\n+ * The command that runs one of this client's installers (client/install-mod.ts or install-view.ts), by its full\n+ * path. They are .ts files, which Node runs itself from 22.18, so on an older Node it says which one it needs.\n+ */\n+export function installerCommand(installer: string): string {\n+\tconst command = `node ${join(CLIENT_DIR, installer)}`;\n+\treturn (process.features as { typescript?: unknown }).typescript\n+\t\t? command\n+\t\t: `${command} (with Node 22.18 or later, which runs .ts files; this is Node ${process.versions.node})`;\n+}\n+\n+/** `abso --version`: this client, and the mods installed on this machine, compared with this client's. */\n export function versionReport(env: Readonly<Record<string, string | undefined>>): {\n \ttext: string;\n \tjson: Record<string, unknown>;\n@@ -554,14 +581,14 @@\n \t\tmods.push(m);\n \t\t// A built copy has no mod files to compare with or install from: it reports what is installed.\n \t\tif (m.version === undefined) {\n-\t\t\tlines.push(`the ${m.name} mod: not installed${builtCopy() ? \"\" : ` (node client/${installer})`}`);\n+\t\t\tlines.push(`the ${m.name} mod: not installed${builtCopy() ? \"\" : ` (${installerCommand(installer)})`}`);\n \t\t\tcontinue;\n \t\t}\n \t\tconst when = m.at ? `, installed ${m.at.slice(0, 16).replace(\"T\", \" \")} UTC` : \"\";\n \t\tconst behind =\n \t\t\tbuiltCopy() || m.version === m.current\n \t\t\t\t? \"\"\n-\t\t\t\t: `; this client has ${m.current}: node client/${installer} installs it`;\n+\t\t\t\t: `; this client has ${m.current}: ${installerCommand(installer)} installs it`;\n \t\tlines.push(`the ${m.name} mod: ${m.version} in ${m.folder}${when}${behind}`);\n \t}\n \treturn { text: lines.join(\"\\n\"), json: { client, folder: CLIENT_DIR, mods } };\n@@ -579,6 +606,6 @@\n \t\t.filter((m) => m.version?.includes(\"+\") && /\\+[0-9a-f]{7}$/.test(m.current) && m.version !== m.current)\n \t\t.map(\n \t\t\t(m) =>\n-\t\t\t\t`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).`,\n+\t\t\t\t`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).`,\n \t\t);\n }"}],"unmatched":[]}