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
MCP
blame on this site's /mcp
CLI
abso blame client/src/join-commands.ts --json
JSON
/christopher/abso-core/blame/client/src/join-commands.ts?format=json
559 linespinch 36% · box-grants 21% · First import 19% · readspeed 12% · trials 7% · review 2% · Last change pinch in version 305,

559 lines from 26 changes in 20 versions.

init0Start the project1// abso init and abso join: start a project from a folder, or join one into a folder.
2
box-grants185abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.Compare3import { randomUUID } from "node:crypto";
4import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
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.Compare5import { isAbsolute, join, relative, resolve, sep } from "node:path";
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare6import { Api, ApiError, type SyncAnswer } from "./api.ts";
init0Start the project7import { bool, type Parsed, str, UsageError } from "./args.ts";
8import { writeKnownBlobs } from "./blobs.ts";
box-grants185abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.Compare9import {
10 type BoxRecord,
11 boxCreateProject,
12 defaultAgentName,
13 mintFreeName,
14 mintKey,
15 type NewProject,
16 readBox,
17} from "./box.ts";
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare18import { STARTING_ABSOIGNORE } from "./check-ignore.ts";
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare19import { builtCopy } from "./client-version.ts";
init0Start the project20import { type Env, type Output, plural } from "./command-env.ts";
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare21import { applyAnswer, leftOutText, pullAnswer, pullWritten, syncFolder, uploadBlobs } from "./commands.ts";
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.Compare22import {
23 findRoot,
24 installKey,
25 readConfig,
26 runKey,
27 type Settings,
28 tokenFile,
29 trustedToken,
30 writeConfig,
31} from "./config.ts";
speed156With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.Compare32import { elsewhereText } from "./doctor.ts";
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare33import { fromEnv } from "./env-names.ts";
init0Start the project34import { clearKnown, loadIgnore, readFolder, writeKnown } from "./folder.ts";
pinch293Local projects: the abso mod hands their edits to abso hook. The installer stamps the mod with the command that runs its checkout's abso hook (node, client/abso.ts); in a local project's folder the mod runs it with the edit, as Claude Code's command hook would, and passes its news to the chat. A mod installed before this one still skips local folders, and init says so.Compare35import { installerCommand, modHandsLocal, modInstalled } from "./install.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.Compare36import { LOCAL, NO_STORE, storeDir } from "./local-store.ts";
init0Start the project37import { type FullMode, foldModes, writeKnownModes } from "./modes.ts";
box-grants185abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.Compare38import { initInOrg, siteOf } from "./orgs.ts";
review28Client: abso.json is the project file (avcs.json still read; a new project gets abso.json unless it has either); new folders get .abso when no installed mod is older than 0.2.0; both mods are 0.2.0 (abso 253, 224)Compare39import { projectFileName, readProjectFile, startingProjectFileText, writeStartingProjectFile } from "./project-file.ts";
init0Start the project40import { refusedText } from "./safety.ts";
speed156With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.Compare41import { chooseServer, serverFlag } from "./server-choice.ts";
trials64join: a folder prepared with abso key install --server is joined where it is again (Pinch's catch on 63). - --agent keeps 'here' as the default, as before 63, so scripts that join into a prepared folder still do. The ./<project> rule is only for a join with no --agent. - A folder holding only abso's own state folder (.abso, or the older .avcs) counts as empty. - New tests: joinFolder's rule (empty, only .abso, files here, --agent, --dir, a taken ./<project>), and a runJoin test that installs a key with --server and joins with --agent and no --dir: it joins here and sends that key (the shared token is wrong, so only the key gets through). The git line-endings test is back to joining without --dir. - Issue numbers taken out of the new code comments and test names.Compare42import { OLD_STATE_DIR, STATE_DIR, stateDir } from "./state-dir.ts";
init0Start the project43
speed156With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.Compare44/** The server to join or start on, in the order every command picks one (server-choice.ts chooseServer). */
45export function serverFrom(args: Parsed, env: Pick<Env, "env" | "cwd">): string {
46 return chooseServer(serverFlag(args), env.cwd, env.env);
init0Start the project47}
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare49const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
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.Compare51function agentFrom(args: Parsed, named?: string): string {
52 const agent = named ?? str(args, "agent");
init0Start the project53 if (!agent) throw new UsageError("give this folder's agent name with --agent <name>");
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare54 if (!NAME.test(agent))
init0Start the project55 throw new UsageError(`agent names are letters, digits, dot, dash and underscore (got ${JSON.stringify(agent)})`);
56 return agent;
59function makeSettings(args: Parsed, env: Env, project: string): Settings {
60 return { server: serverFrom(args, env), project, agent: agentFrom(args) };
onboard224join: on a project with nothing in it yet, say what comes next. The join wrote no files and stopped there; now it adds: The project is empty. Put its files in this folder, then abso push -m "why" publishes them. Not for a reader, or when the folder already had files. Tests: client/test/join-empty.test.ts (2).Compare63/**
64 * A new project has nothing in it yet: say what comes next, since the join itself wrote nothing. Not for a reader, which
65 * can't push, or when files were already in the folder (the join's own line names them).
66 */
67export function emptyHint(version: number, written: number, kept: number, reader: boolean): string[] {
68 if (reader || version !== 0 || written > 0 || kept > 0) return [];
69 return ['The project is empty. Put its files in this folder, then abso push -m "why" publishes them.'];
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.Compare72/** A credential other than the box's, and how init and join name it when they say what they sign in with. */
73export interface Credential {
74 readonly token: string | undefined;
75 readonly words: string;
78/**
79 * What init and join sign in with when it isn't the box's sign-in. The machine's token file only with --token-file, and
80 * never into a folder that already has a key; else a token the environment names (ABSO_TOKEN, or a pipeline run's
81 * ABSO_KEY_FILE); else none. The token file is never read unasked, so a project is never made or joined with a shared
82 * credential nobody chose.
83 */
84export function tokenCredential(
85 args: Parsed,
86 env: Env["env"],
87 server: string,
88 root: string,
89 file: () => string | undefined = tokenFile,
90): Credential | undefined {
91 if (bool(args, "token-file")) {
92 if (existsSync(join(stateDir(root), "key")))
93 throw new UsageError(`${root} already has a key, so it signs in with that: leave off --token-file`);
94 const token = trustedToken(server, env, file());
95 if (!token) throw new UsageError("--token-file reads ~/.abso/token, and this machine has none");
96 return { token, words: "the token file, ~/.abso/token, as --token-file asks" };
97 }
98 const named = fromEnv(env, "TOKEN")?.trim();
99 if (named) return { token: trustedToken(server, env, named), words: "ABSO_TOKEN" };
100 const run = runKey(env);
101 if (run) return { token: trustedToken(server, env, run), words: "a pipeline run's key (ABSO_KEY_FILE)" };
102 return undefined;
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.Compare105/**
106 * --local (abso init, abso join): the project's history is in a store on this machine, not on a server. The store is
107 * --store, else ABSO_STORE, else the OS's data folder; one given with --store is kept in the folder's config.
108 */
109function localFrom(args: Parsed, env: Env, command: string): { dir: string; settings: { store?: string } } | undefined {
110 const store = str(args, "store");
111 if (!bool(args, "local")) {
112 if (store !== undefined)
113 throw new UsageError("--store goes with --local: it says where a local project's history is");
114 return undefined;
115 }
116 if (str(args, "server") !== undefined)
117 throw new UsageError("--local or --server, not both: a local project has no server");
118 if (str(args, "org") !== undefined || bool(args, "public") || bool(args, "private") || bool(args, "reader"))
119 throw new UsageError(
120 `abso ${command} --local takes --project, --agent, --store and --as-is; a local project has no server to share it`,
121 );
122 const dir = storeDir(env.env, store, env.cwd);
123 if (dir === undefined) throw new UsageError(NO_STORE);
124 return { dir, settings: store === undefined ? {} : { store: dir } };
127/** A store inside the project folder is left out of its files: a line in .absoignore. Its relative path, if so. */
128function ignoreStoreInside(root: string, dir: string): string | undefined {
129 const rel = relative(root, dir);
130 if (rel === "" || rel.startsWith("..") || isAbsolute(rel)) return undefined;
131 const line = `/${rel.split(sep).join("/")}/`;
132 const file = join(root, ".absoignore");
133 const had = existsSync(file) ? readFileSync(file, "utf8") : "";
134 const lines = had.split(/\r?\n/);
135 if (!lines.includes(line)) {
136 const gap = had === "" || had.endsWith("\n") ? "" : "\n";
137 writeFileSync(file, `${had}${gap}${line}\n`);
138 }
139 return rel;
142/** What init and join say about a local project's store. */
143function localText(dir: string, project: string, ignored?: string): string {
144 return `It's a local project: its history is in ${join(dir, project)}, on this machine, and no server is needed.${ignored === undefined ? "" : ` .absoignore leaves the store, ${ignored}, out of the project's files.`}`;
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.Compare147/** Why a token file is no fallback: said when one is here and nothing else signs in. */
148const TOKEN_FILE_ASKED = "~/.abso/token is used only with --token-file.";
init0Start the project150export async function runInit(args: Parsed, env: Env): Promise<Output> {
151 if (args.positionals.length > 1) throw new UsageError("init takes one folder");
152 const root = resolve(env.cwd, args.positionals[0] ?? ".");
153 if (!existsSync(root) || !statSync(root).isDirectory()) throw new UsageError(`${root} is not a folder`);
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.Compare154 if (findRoot(root) === root) throw new UsageError(`${root} already has .abso/config.json`);
init0Start the project155 const project = str(args, "project");
156 if (!project) throw new UsageError("give the project a name with --project <name>");
pinch305abso init checks the project's name before any call, as join does. A name like .. went out as part of the request's path, where it collapsed, so a local init answered about project calls instead of naming the rule. The test now checks the message for .. and .hidden, and that init leaves the folder as it was.Compare157 // Checked before any call: a name like ".." would otherwise go out as part of the request's path.
158 if (!NAME.test(project))
159 throw new UsageError(
160 `project names are letters, digits, dot, dash and underscore (got ${JSON.stringify(project)})`,
161 );
box-grants185abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.Compare162 if (bool(args, "public") && bool(args, "private")) throw new UsageError("--public or --private, not both");
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.Compare163 const local = localFrom(args, env, "init");
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.Compare164 // A box signed in here, and no other credential asked for: the project is made as the person who approved the box,
165 // the way the website makes one (abso 663). The token file only with --token-file, never by itself.
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.Compare166 const server = local ? LOCAL : serverFrom(args, env);
167 const box = local ? undefined : readBox(server);
168 const credential = local ? undefined : tokenCredential(args, env.env, server, root);
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.Compare169 const say = env.writeErr ?? env.write;
170 if (box && credential === undefined) {
171 say(`Signing in with this box's sign-in, ${box.id}.
172`);
box-grants185abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.Compare173 return initFromBox(args, env, root, project, server, box);
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.Compare174 }
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.Compare175 if (!local && credential === undefined && tokenFile() !== undefined)
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.Compare176 throw new UsageError(
177 `abso init signs in with this box's sign-in, and this box isn't signed in to ${server}: abso login signs it in. ${TOKEN_FILE_ASKED}`,
178 );
box-grants185abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.Compare179 const org = str(args, "org");
180 if (org !== undefined) return initInOrg(org, server);
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.Compare181 const config: Settings = local
182 ? { server: LOCAL, project, agent: agentFrom(args, str(args, "agent") ?? defaultAgentName()), ...local.settings }
183 : makeSettings(args, env, project);
init0Start the project184 const asIs = bool(args, "as-is");
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare185 const absoignore = join(root, ".absoignore");
186 const wroteIgnore = !asIs && !existsSync(absoignore) && !existsSync(join(root, ".avcsignore"));
187 if (wroteIgnore) writeFileSync(absoignore, STARTING_ABSOIGNORE);
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.Compare188 // A store kept inside the project folder, like a virtual environment, isn't the project's files.
189 const ignoredStore = local ? ignoreStoreInside(root, local.dir) : undefined;
init0Start the project190 // What the server runs on each new version (#39), guessed from package.json; recorded with the rest.
191 const wroteProject = asIs ? "exists" : writeStartingProjectFile(root);
192 const { files, blobs, modes, leftOut } = readFolder(root, loadIgnore(root));
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.Compare193 const token = credential?.token;
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.Compare194 if (!local)
195 say(`Signing in with ${credential?.words ?? `no credential: nothing here signs in to ${server}`}.
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.Compare196`);
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.Compare197 const api = new Api({ ...config, ...(token ? { token } : {}), ...(local ? { localStore: local.dir } : {}) });
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare198 let answer: Awaited<ReturnType<Api["init"]>>;
199 try {
200 await uploadBlobs(api, blobs);
201 answer = await api.init(
202 Object.fromEntries(files),
203 modes,
204 Object.fromEntries([...blobs].map(([rel, b]) => [rel, b.sha])),
205 );
206 } catch (error) {
207 // No project was made: the starting files init wrote go too, so the folder is as it was.
208 if (wroteIgnore) rmSync(absoignore, { force: true });
209 if (typeof wroteProject !== "string") rmSync(join(root, projectFileName(root)), { force: true });
210 throw error;
211 }
init0Start the project212 writeConfig(root, config);
213 clearKnown(root);
214 for (const [rel, text] of files) writeKnown(root, rel, text);
215 writeKnownBlobs(root, new Map([...blobs].map(([rel, b]) => [rel, b.sha])));
216 const knownModes = new Map<string, FullMode>();
217 foldModes(knownModes, modes);
218 writeKnownModes(root, knownModes);
219 const synced = await syncFolder(root, api);
220 return {
221 text: [
222 `Created project ${project} at version ${answer.version} from ${plural(files.size, "text file")} in ${root}.`,
223 ...leftOutText(leftOut),
224 ...(wroteIgnore
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare225 ? ["Wrote a starting .absoignore (Claude Code state and operating system files); edit it like .gitignore."]
init0Start the project226 : []),
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.Compare227 // A local project has no CI to run abso.json, so no word about one that isn't there.
228 ...(local && wroteProject === "nothing" ? [] : startingProjectFileText(wroteProject)),
init0Start the project229 ...(answer.skipped && answer.skipped.length > 0 ? [`The server skipped: ${answer.skipped.join(", ")}.`] : []),
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.Compare230 ...(local ? [localText(local.dir, project, ignoredStore)] : []),
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.Compare231 `This folder is agent ${config.agent}. Settings are in .abso/config.json.`,
init0Start the project232 ...refusedText(synced.refused),
233 ...(synced.kept.length > 0 ? [`Kept your copy of ${synced.kept.join(", ")}.`] : []),
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.Compare234 hookHint(env.env, local !== undefined),
init0Start the project235 ].join("\n"),
236 json: {
237 project,
238 version: answer.version,
239 files: files.size,
240 root,
241 agent: config.agent,
box-grants185abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.Compare242 wroteAbsoignore: wroteIgnore,
243 wroteProjectFile: typeof wroteProject === "string" ? null : wroteProject,
244 leftOut,
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.Compare245 ...(local ? { store: local.dir } : {}),
box-grants185abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.Compare246 },
247 };
250/** The most a new project's folder may be from a box: the server takes a body up to 25 MB, base64 and JSON included. */
251const BOX_INIT_MAX = 24 * 1024 * 1024;
252/** The Idempotency-Key of an abso init that didn't finish, so running it again makes the same project (abso 663). */
253const INIT_KEY = "init-key";
255/**
256 * abso init from a signed-in box (abso 663): the server makes the project as the person who approved the box, the way the
257 * website's New project does (owner, visibility, address), with the folder as its first version. This folder then
258 * joins it like abso join, with its own key from the box, so it works at once with no new approval.
259 */
260async function initFromBox(
261 args: Parsed,
262 env: Env,
263 root: string,
264 project: string,
265 server: string,
266 box: BoxRecord,
267): Promise<Output> {
268 if (!NAME.test(project))
269 throw new UsageError(
270 `project names are letters, digits, dot, dash and underscore (got ${JSON.stringify(project)})`,
271 );
272 const named = str(args, "agent");
273 if (named !== undefined) agentFrom(args);
274 const asIs = bool(args, "as-is");
275 const absoignore = join(root, ".absoignore");
276 const wroteIgnore = !asIs && !existsSync(absoignore) && !existsSync(join(root, ".avcsignore"));
277 if (wroteIgnore) writeFileSync(absoignore, STARTING_ABSOIGNORE);
278 const wroteProject = asIs ? "exists" : writeStartingProjectFile(root);
279 const { files, blobs, leftOut } = readFolder(root, loadIgnore(root));
280 const listed: NonNullable<NewProject["files"]>[number][] = [
281 ...[...files].map(([path, text]) => ({ path, text })),
282 ...[...blobs].map(([path, b]) => ({ path, base64: Buffer.from(b.bytes).toString("base64") })),
283 ];
284 const org = str(args, "org");
285 const body: NewProject = {
286 name: project,
287 ...(org === undefined ? {} : { owner: org }),
288 ...(bool(args, "public")
289 ? { visibility: "public" as const }
290 : bool(args, "private")
291 ? { visibility: "private" as const }
292 : {}),
293 ...(listed.length > 0 ? { files: listed } : {}),
294 };
295 if (JSON.stringify(body).length > BOX_INIT_MAX)
296 throw new UsageError(
297 `${root} is over 24 MB to send. Make ${project} with abso init on a smaller folder (or on the website), then copy the rest in and push.`,
298 );
299 // One key per folder until it finishes: running the same abso init again is the same project, never a second.
300 const keyPath = join(stateDir(root), INIT_KEY);
301 let key = existsSync(keyPath) ? readFileSync(keyPath, "utf8").trim() : "";
302 if (!/^[0-9a-f-]{36}$/.test(key)) {
303 key = randomUUID();
304 mkdirSync(stateDir(root), { recursive: true });
305 writeFileSync(keyPath, key);
306 }
307 const made = await boxCreateProject(box, body, key);
308 const visibility = typeof made.visibility === "string" ? made.visibility : "private";
309 const minted =
310 named !== undefined
311 ? { ...(await mintKey(box, project, named)), agent: named }
312 : await mintFreeName(box, project, defaultAgentName());
313 const config = { server, project, agent: minted.agent };
314 writeConfig(root, config);
315 clearKnown(root);
316 installKey(root, JSON.stringify({ key: minted.key, id: minted.id }));
317 rmSync(keyPath, { force: true });
318 const synced = await syncFolder(root, new Api(readConfig(root, env.env)), true);
319 const owner = org ?? "you";
320 return {
321 text: [
322 `Created project ${project} (${visibility}, owned by ${owner}) at version ${synced.version} from ${plural(listed.length, "file")} in ${root}.`,
323 ...leftOutText(leftOut),
324 ...(wroteIgnore
325 ? ["Wrote a starting .absoignore (Claude Code state and operating system files); edit it like .gitignore."]
326 : []),
327 ...startingProjectFileText(wroteProject),
328 `This folder is agent ${minted.agent}, with its own key, ${minted.id}, made from this box's sign-in. Settings are in .abso/config.json.`,
329 ...refusedText(synced.refused),
330 ...(synced.written.length > 0 ? [`Wrote ${plural(synced.written.length, "file")} from shared.`] : []),
331 hookHint(env.env),
332 ].join("\n"),
333 json: {
334 project,
335 id: made.id ?? null,
336 owner: made.owner ?? null,
337 visibility,
338 version: synced.version,
339 files: listed.length,
340 root,
341 agent: minted.agent,
342 key_id: minted.id,
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare343 wroteAbsoignore: wroteIgnore,
init0Start the project344 wroteProjectFile: typeof wroteProject === "string" ? null : wroteProject,
345 leftOut,
346 },
347 };
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare350/**
trials64join: a folder prepared with abso key install --server is joined where it is again (Pinch's catch on 63). - --agent keeps 'here' as the default, as before 63, so scripts that join into a prepared folder still do. The ./<project> rule is only for a join with no --agent. - A folder holding only abso's own state folder (.abso, or the older .avcs) counts as empty. - New tests: joinFolder's rule (empty, only .abso, files here, --agent, --dir, a taken ./<project>), and a runJoin test that installs a key with --server and joins with --agent and no --dir: it joins here and sends that key (the shared token is wrong, so only the key gets through). The git line-endings test is back to joining without --dir. - Issue numbers taken out of the new code comments and test names.Compare351 * Where abso join writes: --dir, else here when --agent is given (as before, so a folder prepared with
352 * abso key install --server is joined where its key is). With no --agent: here when this folder is empty, else
353 * ./<project>, which has to be new or empty so nobody's files are written over. A folder holding only abso's own
354 * state folder counts as empty.
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare355 */
trials64join: a folder prepared with abso key install --server is joined where it is again (Pinch's catch on 63). - --agent keeps 'here' as the default, as before 63, so scripts that join into a prepared folder still do. The ./<project> rule is only for a join with no --agent. - A folder holding only abso's own state folder (.abso, or the older .avcs) counts as empty. - New tests: joinFolder's rule (empty, only .abso, files here, --agent, --dir, a taken ./<project>), and a runJoin test that installs a key with --server and joins with --agent and no --dir: it joins here and sends that key (the shared token is wrong, so only the key gets through). The git line-endings test is back to joining without --dir. - Issue numbers taken out of the new code comments and test names.Compare356export function joinFolder(args: Parsed, env: Pick<Env, "cwd">, project: string): string {
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare357 const dir = str(args, "dir");
358 if (dir !== undefined) return resolve(env.cwd, dir);
trials64join: a folder prepared with abso key install --server is joined where it is again (Pinch's catch on 63). - --agent keeps 'here' as the default, as before 63, so scripts that join into a prepared folder still do. The ./<project> rule is only for a join with no --agent. - A folder holding only abso's own state folder (.abso, or the older .avcs) counts as empty. - New tests: joinFolder's rule (empty, only .abso, files here, --agent, --dir, a taken ./<project>), and a runJoin test that installs a key with --server and joins with --agent and no --dir: it joins here and sends that key (the shared token is wrong, so only the key gets through). The git line-endings test is back to joining without --dir. - Issue numbers taken out of the new code comments and test names.Compare359 if (str(args, "agent") !== undefined) return resolve(env.cwd);
360 const empty = (path: string) => readdirSync(path).every((name) => name === STATE_DIR || name === OLD_STATE_DIR);
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare361 if (empty(env.cwd)) return resolve(env.cwd);
362 const sub = resolve(env.cwd, project);
363 if (existsSync(sub) && (!statSync(sub).isDirectory() || !empty(sub)))
364 throw new UsageError(`${sub} already has files in it: say where to join with --dir <folder>`);
365 return sub;
pinch70join, signed out: a public project's page is linked as https://abso.dev/christopher/<project>, the website's address for it now that its /p/ pages are gone. Signed out, the server doesn't say who owns a project, and the website puts every project under that one owner for now.Compare368/** Signed out, the server doesn't say who owns a project, and the website puts every project under this one owner for now. */
369const SITE_OWNER = "christopher";
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare371/**
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.Compare372 * Whether anyone can read the project: its status answers with no credentials. Only the answer's code
373 * counts, never its body, and no redirect is followed. A private project and a missing one look the same.
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare374 */
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.Compare375export async function isPublic(server: string, project: string): Promise<boolean> {
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare376 try {
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.Compare377 const response = await fetch(new URL(`/p/${encodeURIComponent(project)}/status`, server), {
378 redirect: "error",
379 signal: AbortSignal.timeout(3000),
380 });
381 return response.status === 200;
382 } catch {
383 return false;
384 }
387/**
388 * Why a join failed signed out. Without --reader, the client reads only as an agent, which needs a
389 * sign-in; a public project is read signed out on the website, or with abso join --reader.
390 */
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare391async function signedOut(server: string, project: string): Promise<string> {
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.Compare392 return (await isPublic(server, project))
393 ? `${project} is public: read it at ${siteOf(server)}/${SITE_OWNER}/${project} (every page is also JSON), or here with abso join ${project} --reader. To work on it: abso login.`
speed156With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.Compare394 : `This box isn't signed in to ${server}. abso login signs it in.${elsewhereText(server, `abso join ${project}`)}`;
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.Compare395}
397/** A folder that reads a public project signed out: no agent, no key, no copy of the files. */
398async function joinAsVisitor(root: string, server: string, project: string, env: Env): Promise<Output> {
399 writeConfig(root, { server, project, agent: "", visitor: true });
400 const api = new Api(readConfig(root, env.env));
401 let version: number;
402 try {
403 version = (await api.status()).version;
404 } catch (error) {
405 rmSync(stateDir(root), { recursive: true, force: true });
406 throw error;
407 }
408 return {
409 text: [
410 `Joined ${project} to read it signed out, at version ${version}, in ${root}. Nothing is sent with a sign-in, and nothing here is recorded.`,
411 `This folder holds no copy of the files: abso files lists them, abso show ${version}:<file> prints one, and status, log, blame, why, where, issues, issue and search read the rest.`,
412 `To work on ${project}: abso login, then abso join ${project} in a new folder.`,
413 ...(root === resolve(env.cwd) ? [] : [`cd ${relative(env.cwd, root) || root}`]),
414 ].join("\n"),
415 json: { project, visitor: true, version, root },
416 };
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare417}
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare418
419/** A join that failed before writing files: its state goes, but a key (already here, or made for it) stays for the next try. */
420function takeBackJoin(root: string): void {
421 const dir = stateDir(root);
422 if (!existsSync(join(dir, "key"))) {
423 rmSync(dir, { recursive: true, force: true });
424 return;
425 }
426 for (const entry of readdirSync(dir)) if (entry !== "key") rmSync(join(dir, entry), { recursive: true, force: true });
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare428
init0Start the project429export async function runJoin(args: Parsed, env: Env): Promise<Output> {
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare430 if (args.positionals.length !== 1) throw new UsageError("join takes the project name: abso join <project>");
init0Start the project431 const project = args.positionals[0]!;
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare432 if (!NAME.test(project))
433 throw new UsageError(
434 `project names are letters, digits, dot, dash and underscore (got ${JSON.stringify(project)})`,
435 );
436 const root = joinFolder(args, env, project);
init0Start the project437 mkdirSync(root, { recursive: true });
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.Compare438 if (findRoot(root) === root) throw new UsageError(`${root} already has .abso/config.json`);
init0Start the project439 const reader = bool(args, "reader");
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.Compare440 // A local project: no box, key or credential, and the agent is --agent or this computer's name.
441 const local = localFrom(args, env, "join");
442 const server = local ? LOCAL : serverFrom(args, env);
443 const box = local ? undefined : readBox(server);
444 const hasKey = !local && existsSync(join(stateDir(root), "key"));
445 const credential = local ? undefined : tokenCredential(args, env.env, server, root);
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.Compare446 const tokenFileAsked = bool(args, "token-file");
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare447 let agent: string;
448 let minted: { key: string; id: string } | undefined;
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.Compare449 if (local) agent = agentFrom(args, str(args, "agent") ?? defaultAgentName());
450 else if (str(args, "agent") !== undefined) {
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare451 agent = agentFrom(args);
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.Compare452 minted =
453 box && !hasKey && !fromEnv(env.env, "KEY_FILE") && !tokenFileAsked
454 ? await mintKey(box, project, agent)
455 : undefined;
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.Compare456 } else if (fromEnv(env.env, "KEY_FILE")) {
457 // A pipeline run's key (ABSO_KEY_FILE) belongs to one agent, which the runner names in ABSO_AGENT.
458 const named = fromEnv(env.env, "AGENT");
459 if (!named)
460 throw new UsageError("a pipeline run's key joins as its own agent: give it with --agent <name> or ABSO_AGENT");
461 agent = agentFrom(args, named);
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare462 } else {
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.Compare463 // No --agent: the box's name, or the next free -2, -3. Not signed in, --reader reads a public project signed out.
464 if (!box && reader && !hasKey && (await isPublic(server, project)))
465 return joinAsVisitor(root, server, project, env);
pinch69join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.Compare466 if (!box)
467 throw new UsageError(
468 `${await signedOut(server, project)} (A folder that already has a key joins with --agent <name>.)`,
469 );
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare470 if (hasKey) throw new UsageError(`${root} already has a key: give its agent's name with --agent <name>`);
471 const free = await mintFreeName(box, project, defaultAgentName());
472 agent = free.agent;
473 minted = { key: free.key, id: free.id };
474 }
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.Compare475 const config = { server, project, agent, ...(reader ? { reader: true } : {}), ...local?.settings };
init0Start the project476 writeConfig(root, config);
477 clearKnown(root);
478 if (minted) installKey(root, JSON.stringify(minted));
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.Compare479 // The token file only with --token-file: readConfig reads it otherwise.
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare480 let read: ReturnType<typeof readConfig>;
481 try {
482 read = readConfig(root, env.env, false);
483 } catch (error) {
484 takeBackJoin(root);
485 throw error;
486 }
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.Compare487 const settings = tokenFileAsked ? { ...read, token: credential?.token } : read;
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.Compare488 if (!local)
489 (env.writeErr ?? env.write)(
490 `Signing in with ${minted && box ? `a new key from this box's sign-in, ${box.id}` : hasKey ? "this folder's key" : (credential?.words ?? `no credential: nothing here signs in to ${server}`)}.
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.Compare491`,
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.Compare492 );
init0Start the project493 const api = new Api(settings);
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare494 let answer: SyncAnswer;
init0Start the project495 try {
496 // Before the sync, so the server never takes a record from this folder.
497 if (reader) await api.reader(true);
498 // Every file, even when the server has seen this agent sync before: its plain sync answer would hold only what changed since (#37).
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare499 answer = await pullAnswer(root, api, true);
init0Start the project500 } catch (error) {
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare501 // Nothing is written yet: take back what join wrote so it can run again here.
502 takeBackJoin(root);
init0Start the project503 if (!(error instanceof ApiError && error.status === 401 && !box && !settings.token)) throw error;
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.Compare504 const why = await signedOut(config.server, project);
505 throw new UsageError(!tokenFileAsked && tokenFile() !== undefined ? `${why} ${TOKEN_FILE_ASKED}` : why);
init0Start the project506 }
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare507 const synced = await applyAnswer(root, api, answer);
508 pullWritten(root);
init0Start the project509 return {
510 text: [
rename100abso publish is now abso push, abso sync is now abso pull (abso 427) Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing. push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch. Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare511 `Joined ${project} as ${config.agent} at version ${synced.version}: wrote ${plural(synced.written.length, "file")} into ${root}.${reader ? " It is a reader: status, pull, log, show, files and export work, and nothing it does is recorded or pushed." : ""}${minted ? ` It signs in with its own key, ${minted.id}, made from this box's sign-in.` : ""}`,
init0Start the project512 ...refusedText(synced.refused),
513 ...(synced.kept.length > 0
514 ? [
515 `These files were already here and differ from shared, so they were left alone: ${synced.kept.join(", ")}. abso record sends them as your changes.`,
516 ]
517 : []),
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.Compare518 ...(local ? [localText(local.dir, project)] : []),
onboard224join: on a project with nothing in it yet, say what comes next. The join wrote no files and stopped there; now it adds: The project is empty. Put its files in this folder, then abso push -m "why" publishes them. Not for a reader, or when the folder already had files. Tests: client/test/join-empty.test.ts (2).Compare519 ...emptyHint(synced.version, synced.written.length, synced.kept.length, reader),
init0Start the project520 ...setupHint(root),
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.Compare521 hookHint(env.env, local !== undefined),
trials63abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>. - Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent. - Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here. - --agent, --dir and --server still win. Project names are checked before use as a folder. Tests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.Compare522 ...(root === resolve(env.cwd) ? [] : [`cd ${relative(env.cwd, root) || root}`]),
init0Start the project523 ].join("\n"),
524 json: {
525 project,
526 agent: config.agent,
527 version: synced.version,
528 written: synced.written,
529 kept: synced.kept,
530 refused: synced.refused,
531 root,
532 },
533 };
infra-split37Comments and test names give each reason in plain words, without naming who raised it Notes like "(#37, Builder 5)" or "(AVCS - Security)" become "(#37)" or go, and a private commit hash after a name goes with it. Issue numbers and references such as git's CVE-2019-1353 stay. Only comments and test names change; no behavior changes.Compare536/** What to run before building or testing here (#43): a joined folder has the project's files, not what avcs.json's setup installs. */
init0Start the project537function setupHint(root: string): string[] {
538 const read = readProjectFile(root);
539 const setup = read !== null && "file" in read ? read.file.setup : "";
540 return setup === ""
541 ? []
review28Client: abso.json is the project file (avcs.json still read; a new project gets abso.json unless it has either); new folders get .abso when no installed mod is older than 0.2.0; both mods are 0.2.0 (abso 253, 224)Compare542 : [`Nothing is installed yet. Before building or testing here, run ${projectFileName(root)}'s setup: ${setup}`];
init0Start the project543}
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.Compare545function hookHint(env: Readonly<Record<string, string | undefined>>, local = false): string {
pinch293Local projects: the abso mod hands their edits to abso hook. The installer stamps the mod with the command that runs its checkout's abso hook (node, client/abso.ts); in a local project's folder the mod runs it with the edit, as Claude Code's command hook would, and passes its news to the chat. A mod installed before this one still skips local folders, and init says so.Compare546 // A local project has no server: the mod hands its edits to abso hook, when it was installed with one to hand them to.
547 if (local) {
548 if (modHandsLocal(env))
549 return "Edits made by Claude Code here are recorded by the abso mod on this machine, through abso hook. Anything else: abso record.";
550 if (modInstalled(env) && !builtCopy())
551 return `abso record sends the edits made here: the abso mod on this machine is older than local projects. ${installerCommand("install-mod.ts")} updates it, and new chats load it.`;
552 return "abso record sends the edits made here, whoever made them.";
553 }
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file - help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says. - --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits. - A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays. - A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key. - reply takes --file <path> or --file - (stdin), like ask and answer. - The mod-behind tests no longer depend on which mods the machine has. Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare554 if (modInstalled(env))
555 return "Edits made by Claude Code here are recorded by the abso mod on this machine, signed in as this folder. Anything else: abso record.";
556 // A built copy (the npm package) has no installer to point at (abso-core 18).
557 if (builtCopy()) return "abso record sends the edits made here, whoever made them.";
558 return `Edits made by Claude Code reach the server through the abso mod, which isn't on this machine yet: ${installerCommand("install-mod.ts")} installs it, and new chats load it. Anything else: abso record.`;
init0Start the project559}