- MCP
- blame on this site's /mcp
- CLI
- abso blame client/src/config.ts --json
- JSON
- /christopher/abso-core/blame/client/src/config.ts?format=json
312 linesFirst import 60% · pinch 21% · readspeed 10% · review 8%Last change pinch in version 287,
312 lines from 8 changes in 8 versions.
2// them, and the token.
3//
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare4// The token is never in the folder: it comes from the ABSO_TOKEN environment
pinch95Pipeline run key: when ABSO_KEY_FILE names a file holding an agent key and no token or folder key is set, the client sends that key (only to servers a token may go to), keeps it in memory only, and never prints it. abso join takes the agent from ABSO_AGENT for such a key; status and doctor name it as a pipeline run's key.Compare5// variable, or else from ~/.avcs/token, outside every repo. A pipeline run's
6// key comes from the file ABSO_KEY_FILE names, and is only ever held in memory.
8import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
9import { homedir } from "node:os";
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare10import { basename, dirname, join, resolve } from "node:path";
12import { type MachineServers, machineServers, TOKEN_SERVERS, tokenGoesTo, trustedList } from "./core.ts";
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare13import { fromEnv } from "./env-names.ts";
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare14import { isLocal, storeDir } from "./local-store.ts";
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare15import { homeFile, stateDir } from "./state-dir.ts";
17/** What .avcs/config.json holds. */
18export interface Settings {
19 readonly server: string;
20 readonly project: string;
21 readonly agent: string;
22 /** A label the folder follows (abso follow): every sync moves it to the newest version with that label. */
23 readonly follow?: string;
24 /** A reader folder (abso join --reader, #37): it reads everything and records nothing; the server refuses its records too. */
25 readonly reader?: boolean;
pinch86Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.Compare26 /**
27 * A visitor folder (abso join <project> --reader with no sign-in, for a public project): it reads through the
28 * routes anyone can read and sends no credential. It has no agent; its config holds server, project and this.
29 */
30 readonly visitor?: boolean;
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare31 /** A local project's store (abso init --local --store), when it isn't the machine's own: ABSO_STORE or the OS data folder. */
32 readonly store?: string;
35export interface Config extends Settings {
36 readonly token?: string;
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare37 /** For a local project (server "local"): the store folder its history is in, or undefined when there's none to use. */
38 readonly localStore?: string;
41export function configPath(root: string): string {
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare42 return join(stateDir(root), "config.json");
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare45/** The nearest folder at or above `start` that has .abso/config.json (or .avcs/config.json, from before the rename), or undefined. */
47 let dir = resolve(start);
48 for (;;) {
49 if (existsSync(configPath(dir))) return dir;
50 const up = dirname(dir);
51 if (up === dir) return undefined;
52 dir = up;
53 }
54}
readspeed268abso init and join sign in with the box sign-in; ~/.abso/token only with --token-file
Before, abso init used ~/.abso/token whenever the file existed, ahead of the box sign-in. So a project could be made with whatever credential happened to be in that file, without the agent knowing. abso join with --agent fell back to the same file.
- init signs in with the box sign-in when there is one. A token named in the environment (ABSO_TOKEN, or a pipeline run's ABSO_KEY_FILE) is used as given.
- ~/.abso/token is used only with the new --token-file flag, on init and on join, and never by itself. Without the flag and with nothing else to sign in with, init refuses before it makes anything ("~/.abso/token is used only with --token-file"), and so does join's sign-in error.
- --token-file is refused in a folder that already has a key.
- Both say what they sign in with before they make or join anything: "this box's sign-in, b_...", "a new key from this box's sign-in", "this folder's key", "ABSO_TOKEN", or "the token file, ~/.abso/token, as --token-file asks".
- config.ts: trustedToken and tokenFile are exported, and readConfig takes tokenFileOk (default true, so other commands are unchanged).
Tests: client/test/init-credential.test.ts (4). With a token file and a box sign-in, init sends only the box's credential. With only a token file, init is refused and no project is made. With --token-file, init and join use the file and say so. All client tests pass (440).
Closes issue 25.Compare56export function readConfig(
57 root: string,
58 env: Readonly<Record<string, string | undefined>> = process.env,
readspeed271No command picks up a credential from a file nobody asked for
Follows "abso init signs in with the box sign-in" (issue 25), and applies it to every command.
- A folder with a key signs in with that key and nothing else: not ABSO_TOKEN, not ~/.abso/token, even when the server refuses the key. A key file that can't be read is now an error ("abso key install puts a key back") instead of a quiet fall back to another credential.
- With no key, a command signs in with ABSO_TOKEN (or a pipeline run's ABSO_KEY_FILE). This machine's ~/.abso/token is used only by a command given --token-file, which every command that talks to a server now takes. Without it, a refused call says "You're not signed in. Run abso login, then abso join <project>. ~/.abso/token is used only with --token-file." abso doctor says the same about a token file it finds unused. The edit hook and MCP tools never read it.
- The admin token (ABSO_ADMIN_TOKEN, or ~/.abso/admin-token) is read only by abso key and abso flag. Each says "Using the admin token, from ..." every time it uses it. A test holds that no other module reads the file.
What changes for you: a folder with no key that relied on ~/.abso/token needs --token-file on each command, or ABSO_TOKEN, or a key (abso login, then abso join).
Tests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).Compare59 tokenFileOk = false,
readspeed268abso init and join sign in with the box sign-in; ~/.abso/token only with --token-file
Before, abso init used ~/.abso/token whenever the file existed, ahead of the box sign-in. So a project could be made with whatever credential happened to be in that file, without the agent knowing. abso join with --agent fell back to the same file.
- init signs in with the box sign-in when there is one. A token named in the environment (ABSO_TOKEN, or a pipeline run's ABSO_KEY_FILE) is used as given.
- ~/.abso/token is used only with the new --token-file flag, on init and on join, and never by itself. Without the flag and with nothing else to sign in with, init refuses before it makes anything ("~/.abso/token is used only with --token-file"), and so does join's sign-in error.
- --token-file is refused in a folder that already has a key.
- Both say what they sign in with before they make or join anything: "this box's sign-in, b_...", "a new key from this box's sign-in", "this folder's key", "ABSO_TOKEN", or "the token file, ~/.abso/token, as --token-file asks".
- config.ts: trustedToken and tokenFile are exported, and readConfig takes tokenFileOk (default true, so other commands are unchanged).
Tests: client/test/init-credential.test.ts (4). With a token file and a box sign-in, init sends only the box's credential. With only a token file, init is refused and no project is made. With --token-file, init and join use the file and say so. All client tests pass (440).
Closes issue 25.Compare60): Config {
init0Start the project61 const raw = JSON.parse(readFileSync(configPath(root), "utf8")) as Partial<Settings>;
pinch86Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.Compare62 if (raw.visitor === true) {
63 for (const key of ["server", "project"] as const) {
64 if (typeof raw[key] !== "string" || raw[key] === "") throw new Error(`${configPath(root)} has no "${key}"`);
65 }
66 // No token and no key, whatever the environment or the folder holds: a visitor sends no credential.
67 return { server: raw.server!, project: raw.project!, agent: "", visitor: true };
68 }
70 if (typeof raw[key] !== "string" || raw[key] === "") throw new Error(`${configPath(root)} has no "${key}"`);
71 }
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare72 // A local project's calls never leave this process, so no credential goes with them.
73 const local = isLocal(raw.server);
74 const token = local ? undefined : tokenFor(raw.server!, env, root, tokenFileOk);
76 server: raw.server!,
77 project: raw.project!,
78 agent: raw.agent!,
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare79 ...(typeof raw.store === "string" && raw.store !== "" ? { store: raw.store } : {}),
80 ...(local ? { localStore: storeDir(env, raw.store, root) } : {}),
init0Start the project81 ...(typeof raw.follow === "string" && raw.follow !== "" ? { follow: raw.follow } : {}),
82 ...(raw.reader === true ? { reader: true } : {}),
83 ...(token ? { token } : {}),
84 };
85}
pinch86Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.Compare87/** Whether the folder is a visitor's: it reads signed out and sends no credential. Read straight from its config. */
88export function isVisitor(root: string): boolean {
89 try {
90 return (JSON.parse(readFileSync(configPath(root), "utf8")) as { visitor?: unknown }).visitor === true;
91 } catch {
92 return false;
93 }
94}
init0Start the project96/** Whether the folder is a reader (#37): records nothing. Read straight from its config, for the paths that only need this. */
97export function isReader(root: string): boolean {
98 try {
99 return (JSON.parse(readFileSync(configPath(root), "utf8")) as { reader?: unknown }).reader === true;
100 } catch {
101 return false;
102 }
103}
105/**
106 * The token for `server`, refusing a server it may not go to (core.ts
107 * tokenGoesTo): a folder's config names its server, and anyone can write one.
108 */
109/** What status may say about the credential. Never the key or the token. */
110export function credentialLabel(
111 root: string,
112 server: string,
113 env: Readonly<Record<string, string | undefined>> = process.env,
readspeed271No command picks up a credential from a file nobody asked for
Follows "abso init signs in with the box sign-in" (issue 25), and applies it to every command.
- A folder with a key signs in with that key and nothing else: not ABSO_TOKEN, not ~/.abso/token, even when the server refuses the key. A key file that can't be read is now an error ("abso key install puts a key back") instead of a quiet fall back to another credential.
- With no key, a command signs in with ABSO_TOKEN (or a pipeline run's ABSO_KEY_FILE). This machine's ~/.abso/token is used only by a command given --token-file, which every command that talks to a server now takes. Without it, a refused call says "You're not signed in. Run abso login, then abso join <project>. ~/.abso/token is used only with --token-file." abso doctor says the same about a token file it finds unused. The edit hook and MCP tools never read it.
- The admin token (ABSO_ADMIN_TOKEN, or ~/.abso/admin-token) is read only by abso key and abso flag. Each says "Using the admin token, from ..." every time it uses it. A test holds that no other module reads the file.
What changes for you: a folder with no key that relied on ~/.abso/token needs --token-file on each command, or ABSO_TOKEN, or a key (abso login, then abso join).
Tests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).Compare114 tokenFileOk = false,
pinch95Pipeline run key: when ABSO_KEY_FILE names a file holding an agent key and no token or folder key is set, the client sends that key (only to servers a token may go to), keeps it in memory only, and never prints it. abso join takes the agent from ABSO_AGENT for such a key; status and doctor name it as a pipeline run's key.Compare115): { kind: "agent key" | "shared token" | "pipeline run key" | "none"; id: string | null } {
117 if (key) {
118 if (originOf(key.server) !== originOf(server)) return { kind: "none", id: null };
119 return { kind: "agent key", id: key.id };
120 }
pinch95Pipeline run key: when ABSO_KEY_FILE names a file holding an agent key and no token or folder key is set, the client sends that key (only to servers a token may go to), keeps it in memory only, and never prints it. abso join takes the agent from ABSO_AGENT for such a key; status and doctor name it as a pipeline run's key.Compare121 if (fromEnv(env, "TOKEN")) return { kind: "shared token", id: null };
122 if (fromEnv(env, "KEY_FILE")) return { kind: "pipeline run key", id: null };
readspeed271No command picks up a credential from a file nobody asked for
Follows "abso init signs in with the box sign-in" (issue 25), and applies it to every command.
- A folder with a key signs in with that key and nothing else: not ABSO_TOKEN, not ~/.abso/token, even when the server refuses the key. A key file that can't be read is now an error ("abso key install puts a key back") instead of a quiet fall back to another credential.
- With no key, a command signs in with ABSO_TOKEN (or a pipeline run's ABSO_KEY_FILE). This machine's ~/.abso/token is used only by a command given --token-file, which every command that talks to a server now takes. Without it, a refused call says "You're not signed in. Run abso login, then abso join <project>. ~/.abso/token is used only with --token-file." abso doctor says the same about a token file it finds unused. The edit hook and MCP tools never read it.
- The admin token (ABSO_ADMIN_TOKEN, or ~/.abso/admin-token) is read only by abso key and abso flag. Each says "Using the admin token, from ..." every time it uses it. A test holds that no other module reads the file.
What changes for you: a folder with no key that relied on ~/.abso/token needs --token-file on each command, or ABSO_TOKEN, or a key (abso login, then abso join).
Tests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).Compare123 return { kind: tokenFileOk && tokenFile() ? "shared token" : "none", id: null };
126interface StoredKey {
127 server: string;
128 key: string;
129 id: string;
130}
132function keyPath(root: string): string {
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare133 return join(stateDir(root), "key");
136function originOf(server: string): string {
137 try {
138 return new URL(server).origin;
139 } catch {
140 return server;
141 }
142}
144function readKeyFile(root: string): StoredKey | undefined {
145 try {
146 const raw = JSON.parse(readFileSync(keyPath(root), "utf8")) as Partial<StoredKey>;
147 if (typeof raw.server !== "string" || typeof raw.key !== "string" || typeof raw.id !== "string") return undefined;
148 if (!raw.key.startsWith("abso_sk_") || !/^k_[0-9a-f]{8}$/.test(raw.id)) return undefined;
149 return { server: raw.server, key: raw.key, id: raw.id };
150 } catch {
151 return undefined;
152 }
153}
155/**
156 * Writes `.avcs/key` from the JSON the staging issue route printed (`{key, id}`),
157 * pinned to this folder's server, or to `serverFlag` in a folder not joined yet.
158 * Reads stdin. Prints nothing that contains the key.
159 */
160export function installKey(root: string, stdin: string, serverFlag?: string): { id: string } {
161 const configured = existsSync(configPath(root))
162 ? (JSON.parse(readFileSync(configPath(root), "utf8")) as { server?: string }).server
163 : undefined;
164 if (configured && serverFlag && originOf(configured) !== originOf(serverFlag))
165 throw new UsageError(`this folder's server is ${configured}, not ${serverFlag}`);
166 const server = configured ?? serverFlag;
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare167 if (!server) throw new UsageError("this folder has no .abso/config.json yet: give --server <url>");
169 try {
170 parsed = JSON.parse(stdin) as { key?: unknown; id?: unknown };
171 } catch {
172 throw new UsageError("abso key install reads {key, id} as JSON from stdin");
173 }
174 if (
175 typeof parsed.key !== "string" ||
176 !parsed.key.startsWith("abso_sk_") ||
177 typeof parsed.id !== "string" ||
178 !/^k_[0-9a-f]{8}$/.test(parsed.id)
179 )
180 throw new UsageError("stdin needs {key, id} from the staging issue route");
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare181 mkdirSync(stateDir(root), { recursive: true });
init0Start the project182 writeFileSync(keyPath(root), `${JSON.stringify({ server, key: parsed.key, id: parsed.id })}\n`, { mode: 0o600 });
183 try {
184 chmodSync(keyPath(root), 0o600);
185 } catch {
186 // Windows has no owner-only mode. The file is still under .avcs/, which abso never records.
187 }
188 return { id: parsed.id };
189}
191export function tokenFor(
192 server: string,
193 env: Readonly<Record<string, string | undefined>> = process.env,
194 root?: string,
readspeed271No command picks up a credential from a file nobody asked for
Follows "abso init signs in with the box sign-in" (issue 25), and applies it to every command.
- A folder with a key signs in with that key and nothing else: not ABSO_TOKEN, not ~/.abso/token, even when the server refuses the key. A key file that can't be read is now an error ("abso key install puts a key back") instead of a quiet fall back to another credential.
- With no key, a command signs in with ABSO_TOKEN (or a pipeline run's ABSO_KEY_FILE). This machine's ~/.abso/token is used only by a command given --token-file, which every command that talks to a server now takes. Without it, a refused call says "You're not signed in. Run abso login, then abso join <project>. ~/.abso/token is used only with --token-file." abso doctor says the same about a token file it finds unused. The edit hook and MCP tools never read it.
- The admin token (ABSO_ADMIN_TOKEN, or ~/.abso/admin-token) is read only by abso key and abso flag. Each says "Using the admin token, from ..." every time it uses it. A test holds that no other module reads the file.
What changes for you: a folder with no key that relied on ~/.abso/token needs --token-file on each command, or ABSO_TOKEN, or a key (abso login, then abso join).
Tests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).Compare195 tokenFileOk = false,
197 if (root) {
198 const key = readKeyFile(root);
readspeed271No command picks up a credential from a file nobody asked for
Follows "abso init signs in with the box sign-in" (issue 25), and applies it to every command.
- A folder with a key signs in with that key and nothing else: not ABSO_TOKEN, not ~/.abso/token, even when the server refuses the key. A key file that can't be read is now an error ("abso key install puts a key back") instead of a quiet fall back to another credential.
- With no key, a command signs in with ABSO_TOKEN (or a pipeline run's ABSO_KEY_FILE). This machine's ~/.abso/token is used only by a command given --token-file, which every command that talks to a server now takes. Without it, a refused call says "You're not signed in. Run abso login, then abso join <project>. ~/.abso/token is used only with --token-file." abso doctor says the same about a token file it finds unused. The edit hook and MCP tools never read it.
- The admin token (ABSO_ADMIN_TOKEN, or ~/.abso/admin-token) is read only by abso key and abso flag. Each says "Using the admin token, from ..." every time it uses it. A test holds that no other module reads the file.
What changes for you: a folder with no key that relied on ~/.abso/token needs --token-file on each command, or ABSO_TOKEN, or a key (abso login, then abso join).
Tests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).Compare199 // A folder with a key signs in with that key and nothing else, even when the server refuses it.
200 if (!key && existsSync(keyPath(root)))
201 throw new UsageError(
202 `this folder's key file (${keyPath(root)}) can't be read, so abso sends nothing; abso key install puts a key back`,
203 );
205 if (originOf(key.server) !== originOf(server))
206 throw new UsageError("this folder's key was issued for a different server, so abso will not send it");
207 return key.key;
208 }
209 }
readspeed268abso init and join sign in with the box sign-in; ~/.abso/token only with --token-file
Before, abso init used ~/.abso/token whenever the file existed, ahead of the box sign-in. So a project could be made with whatever credential happened to be in that file, without the agent knowing. abso join with --agent fell back to the same file.
- init signs in with the box sign-in when there is one. A token named in the environment (ABSO_TOKEN, or a pipeline run's ABSO_KEY_FILE) is used as given.
- ~/.abso/token is used only with the new --token-file flag, on init and on join, and never by itself. Without the flag and with nothing else to sign in with, init refuses before it makes anything ("~/.abso/token is used only with --token-file"), and so does join's sign-in error.
- --token-file is refused in a folder that already has a key.
- Both say what they sign in with before they make or join anything: "this box's sign-in, b_...", "a new key from this box's sign-in", "this folder's key", "ABSO_TOKEN", or "the token file, ~/.abso/token, as --token-file asks".
- config.ts: trustedToken and tokenFile are exported, and readConfig takes tokenFileOk (default true, so other commands are unchanged).
Tests: client/test/init-credential.test.ts (4). With a token file and a box sign-in, init sends only the box's credential. With only a token file, init is refused and no project is made. With --token-file, init and join use the file and say so. All client tests pass (440).
Closes issue 25.Compare210 return trustedToken(
211 server,
212 env,
213 fromEnv(env, "TOKEN")?.trim() || runKey(env) || (tokenFileOk ? readToken(env) : undefined),
214 );
215}
217/** The token as given, if abso may send it to this server; refused, in words, if not. */
218export function trustedToken(
219 server: string,
220 env: Readonly<Record<string, string | undefined>>,
221 token: string | undefined,
222): string | undefined {
223 if (token === undefined || tokenGoesTo(server, trustedServers(env))) return token;
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare225 `this folder's server is ${server}, and abso sends your token only to ${[...TOKEN_SERVERS, "this machine"].join(", ")}, and the servers ~/.abso/servers.json or ABSO_TRUSTED_SERVERS name. ` +
226 `If ${server} is yours, name it in ~/.abso/servers.json or ABSO_TRUSTED_SERVERS (comma-separated); if you didn't set it, someone else wrote .abso/config.json.`,
228}
230let machine: MachineServers | undefined;
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare231/** This machine's servers (core.ts machineServers), from ~/.abso/servers.json (or the older ~/.avcs/servers.json), read once. ABSO_SERVERS_FILE names another file (tests). */
init0Start the project232export function readMachineServers(env: Readonly<Record<string, string | undefined>> = process.env): MachineServers {
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare233 if (fromEnv(env, "SERVERS_FILE") !== undefined) return machineServers(readOr(fromEnv(env, "SERVERS_FILE") as string));
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare234 machine ??= machineServers(readOr(homeFile(homedir(), "servers.json")));
236}
237const readOr = (path: string): string | undefined => {
238 try {
239 return readFileSync(path, "utf8");
240 } catch {
241 return undefined;
242 }
243};
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare245/** The servers the token may go to beyond abso's own: ABSO_TRUSTED_SERVERS, then this machine's servers.json. */
init0Start the project246export function trustedServers(env: Readonly<Record<string, string | undefined>> = process.env): string {
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare247 return trustedList(fromEnv(env, "TRUSTED_SERVERS"), readMachineServers(env));
pinch95Pipeline run key: when ABSO_KEY_FILE names a file holding an agent key and no token or folder key is set, the client sends that key (only to servers a token may go to), keeps it in memory only, and never prints it. abso join takes the agent from ABSO_AGENT for such a key; status and doctor name it as a pipeline run's key.Compare248}
250/**
251 * A pipeline run's key, from the file ABSO_KEY_FILE names (the runner writes it, mode 600, holding the bare key).
252 * Read each time and kept in memory only; nothing abso writes or prints holds it, errors included.
253 */
254export function runKey(env: Readonly<Record<string, string | undefined>> = process.env): string | undefined {
255 const path = fromEnv(env, "KEY_FILE");
256 if (!path) return undefined;
257 let text: string;
258 try {
259 text = readFileSync(path, "utf8");
260 } catch {
261 throw new UsageError(`ABSO_KEY_FILE names ${path}, which abso can't read`);
262 }
263 const key = text.trim();
264 if (!/^abso_sk_[A-Za-z0-9_-]+$/.test(key))
265 throw new UsageError(`ABSO_KEY_FILE names ${path}, which doesn't hold an abso key`);
266 return key;
readspeed268abso init and join sign in with the box sign-in; ~/.abso/token only with --token-file
Before, abso init used ~/.abso/token whenever the file existed, ahead of the box sign-in. So a project could be made with whatever credential happened to be in that file, without the agent knowing. abso join with --agent fell back to the same file.
- init signs in with the box sign-in when there is one. A token named in the environment (ABSO_TOKEN, or a pipeline run's ABSO_KEY_FILE) is used as given.
- ~/.abso/token is used only with the new --token-file flag, on init and on join, and never by itself. Without the flag and with nothing else to sign in with, init refuses before it makes anything ("~/.abso/token is used only with --token-file"), and so does join's sign-in error.
- --token-file is refused in a folder that already has a key.
- Both say what they sign in with before they make or join anything: "this box's sign-in, b_...", "a new key from this box's sign-in", "this folder's key", "ABSO_TOKEN", or "the token file, ~/.abso/token, as --token-file asks".
- config.ts: trustedToken and tokenFile are exported, and readConfig takes tokenFileOk (default true, so other commands are unchanged).
Tests: client/test/init-credential.test.ts (4). With a token file and a box sign-in, init sends only the box's credential. With only a token file, init is refused and no project is made. With --token-file, init and join use the file and say so. All client tests pass (440).
Closes issue 25.Compare267}
readspeed271No command picks up a credential from a file nobody asked for
Follows "abso init signs in with the box sign-in" (issue 25), and applies it to every command.
- A folder with a key signs in with that key and nothing else: not ABSO_TOKEN, not ~/.abso/token, even when the server refuses the key. A key file that can't be read is now an error ("abso key install puts a key back") instead of a quiet fall back to another credential.
- With no key, a command signs in with ABSO_TOKEN (or a pipeline run's ABSO_KEY_FILE). This machine's ~/.abso/token is used only by a command given --token-file, which every command that talks to a server now takes. Without it, a refused call says "You're not signed in. Run abso login, then abso join <project>. ~/.abso/token is used only with --token-file." abso doctor says the same about a token file it finds unused. The edit hook and MCP tools never read it.
- The admin token (ABSO_ADMIN_TOKEN, or ~/.abso/admin-token) is read only by abso key and abso flag. Each says "Using the admin token, from ..." every time it uses it. A test holds that no other module reads the file.
What changes for you: a folder with no key that relied on ~/.abso/token needs --token-file on each command, or ABSO_TOKEN, or a key (abso login, then abso join).
Tests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).Compare269/** This machine's token file (~/.abso/token, else ~/.avcs/token), or none. Read only for a command given --token-file. */
readspeed268abso init and join sign in with the box sign-in; ~/.abso/token only with --token-file
Before, abso init used ~/.abso/token whenever the file existed, ahead of the box sign-in. So a project could be made with whatever credential happened to be in that file, without the agent knowing. abso join with --agent fell back to the same file.
- init signs in with the box sign-in when there is one. A token named in the environment (ABSO_TOKEN, or a pipeline run's ABSO_KEY_FILE) is used as given.
- ~/.abso/token is used only with the new --token-file flag, on init and on join, and never by itself. Without the flag and with nothing else to sign in with, init refuses before it makes anything ("~/.abso/token is used only with --token-file"), and so does join's sign-in error.
- --token-file is refused in a folder that already has a key.
- Both say what they sign in with before they make or join anything: "this box's sign-in, b_...", "a new key from this box's sign-in", "this folder's key", "ABSO_TOKEN", or "the token file, ~/.abso/token, as --token-file asks".
- config.ts: trustedToken and tokenFile are exported, and readConfig takes tokenFileOk (default true, so other commands are unchanged).
Tests: client/test/init-credential.test.ts (4). With a token file and a box sign-in, init sends only the box's credential. With only a token file, init is refused and no project is made. With --token-file, init and join use the file and say so. All client tests pass (440).
Closes issue 25.Compare270export function tokenFile(): string | undefined {
271 return readToken({});
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare274/** ABSO_TOKEN if set, else ~/.abso/token, else ~/.avcs/token, else none. */
init0Start the project275export function readToken(env: Readonly<Record<string, string | undefined>> = process.env): string | undefined {
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare276 const fromVar = fromEnv(env, "TOKEN");
277 if (fromVar) return fromVar.trim();
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare279 return readFileSync(homeFile(homedir(), "token"), "utf8").trim() || undefined;
281 return undefined;
282 }
283}
285export function writeConfig(root: string, settings: Settings): void {
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare286 mkdirSync(stateDir(root), { recursive: true });
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare287 const { server, project, agent, follow, reader, visitor, store } = settings;
pinch86Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.Compare288 const written = visitor
289 ? { server, project, visitor: true }
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare290 : {
291 server,
292 project,
293 agent,
294 ...(follow ? { follow } : {}),
295 ...(reader ? { reader: true } : {}),
296 ...(store ? { store } : {}),
297 };
pinch86Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.Compare298 writeFileSync(configPath(root), `${JSON.stringify(written, null, 2)}\n`);
300}
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare302/** If the folder is a git repo, keep its state folder (.abso/, or .avcs/ in an older folder) out of it (in .git/info/exclude, so .gitignore isn't changed). */
304 const git = join(root, ".git");
305 if (!existsSync(join(git, "HEAD"))) return;
306 const exclude = join(git, "info", "exclude");
307 const text = existsSync(exclude) ? readFileSync(exclude, "utf8") : "";
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare308 const name = `${basename(stateDir(root))}/`;
309 if (text.split(/\r?\n/).some((line) => line.trim() === name || line.trim() === `/${name}`)) return;
review17New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.Compare311 writeFileSync(exclude, `${text}${text === "" || text.endsWith("\n") ? "" : "\n"}/${name}\n`);