Versions 27 to 28
Lines 1–56 at 28 (were 1–27 at 27)
11// Where abso keeps its state (the rename from avcs). Reading takes .abso/ first, then .avcs/, so a folder in
2−// either works. A new folder is still made with .avcs/ for now: an edit mod or Cursor hook installed before the
3−// rename looks only for .avcs/config.json, and would stop recording a .abso/ folder's edits without a word.
4−// New folders move to .abso/ once installs can say which mods know it; `abso migrate` will move old ones. The
5−// user's files are written to ~/.abso/ (an older client that can't find them says so: it isn't silent).
6−// No imports from the rest of the client, so any module can use this.
2+// either works. A new folder is made with .abso/ unless an edit mod installed here is from before the rename:
3+// such a mod looks only for .avcs/config.json, and would stop recording a .abso/ folder's edits without a word.
4+// So a new folder gets .avcs/ while any installed mod is older than MOD_KNOWS_ABSO, and .abso/ otherwise.
5+// The user's files are written to ~/.abso/ (an older client that can't find them says so: it isn't silent).
77
8−import { existsSync } from "node:fs";
1011
1415
15−/** A folder's state folder: whichever has a config.json (.abso first), else whichever exists, else .avcs for a folder not made yet (see above). */
16+/** A folder's state folder: whichever has a config.json (.abso first), else whichever exists, else the new folder's name (newFolderDir). */
1718 for (const name of STATE_DIRS) if (existsSync(join(root, name, "config.json"))) return join(root, name);
19− return join(root, NEW_FOLDER_DIR);
2122
22−/** What a new folder is made with: .avcs until installed mods can be relied on to know .abso. */
23−export const NEW_FOLDER_DIR: string = OLD_STATE_DIR;
23+/** The first mod version whose hooks look for .abso/config.json as well as .avcs/config.json. */
2425
28+
37+
38+/** What a new folder is made with: .abso, unless an installed mod is older than the rename (see the top). */
39+export function newFolderDir(env: Readonly<Record<string, string | undefined>> = process.env): string {
44+ version = (JSON.parse(readFileSync(join(skills, name, ".avcs-install.json"), "utf8")) as { version?: unknown })
49+ if (typeof version !== "string" || !versionAtLeast(version, MOD_KNOWS_ABSO)) return OLD_STATE_DIR;
53+
2554/** A file under the user's home to read: ~/.abso/<parts>, else the old ~/.avcs/<parts> when only that exists, else the new place. */
- MCP
- compare on this site's /mcp
- CLI
- abso diff 27 28 client/src/state-dir.ts --json
- JSON
- /christopher/abso-core/compare/27..28?file=client%2Fsrc%2Fstate-dir.ts&format=json