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

Versions 20 to 318

Compare

+504 −113 in 34 places
Lines 1–18 at 318 (were 1–16 at 20)
11// The command table and the dispatcher. main() returns what to print and the
22// exit code instead of printing, so tests can call it directly.
33
4−import { readFileSync } from "node:fs";
5−import { resolve } from "node:path";
4+import { existsSync, readFileSync } from "node:fs";
5+import { join, resolve } from "node:path";
66import { runAnnounce, runNews, runStart } from "./announce.ts";
77import { ApiError } from "./api.ts";
88import { bool, type FlagSpec, type Parsed, parseArgs, str, UsageError } from "./args.ts";
9+import { runAutosettle } from "./autosettle-commands.ts";
910import { bodyFilesHelp, readBodyFiles, withBodyFiles } from "./body-files.ts";
10−import { boxPublic, boxText, login, logout, readBox } from "./box.ts";
11+import { boxName, boxPublic, boxText, login, loginRequest, logout, originOf, readBox } from "./box.ts";
1112import { runDiff, runFiles, runLog, runRestore, runShow } from "./changes.ts";
1213import { runCheckIgnore } from "./check-ignore.ts";
1314import { runCi } from "./ci.ts";
15+import { clientVersion } from "./client-version.ts";
1416import {
1517 type Env,
1618 EXIT,
Lines 38–85 at 318 (were 36–51 at 20)
3638 runSync,
3739 takeNews,
3840} from "./commands.ts";
39−import { configPath, findRoot, installKey, readConfig, readToken } from "./config.ts";
41+import { configPath, findRoot, installKey, isVisitor, readConfig, runKey, tokenFile } from "./config.ts";
42+import { newsBlockLines, newsShown } from "./core.ts";
43+import { doctor, doctorText, plainError, realProbe, whoami } from "./doctor.ts";
4044import { runDraftSync, runLand, runSwitch } from "./drafts.ts";
45+import { fromEnv } from "./env-names.ts";
4146import { runExport } from "./export.ts";
47+import { runFlag } from "./flag-commands.ts";
48+import { runGroup, runGroups } from "./group-commands.ts";
4249import { runBlame, runWhere, runWho, runWhy } from "./history.ts";
43−import { runAnswer, runAsk, runIssue, runIssues, runSearch, runWaiting } from "./issues.ts";
44−import { adminToken, issuedPublic, keyList, keyListText, keyNew, keyRevoke } from "./key-admin.ts";
50+import {
51+ openIssues,
52+ runAck,
53+ runAnswer,
54+ runAsk,
55+ runIssue,
56+ runIssues,
57+ runReply,
58+ runSearch,
59+ runWaiting,
60+} from "./issues.ts";
61+import { adminToken, adminTokenWords, issuedPublic, keyList, keyListText, keyNew, keyRevoke } from "./key-admin.ts";
62+import { closeLocalStores } from "./local-store.ts";
63+import { browserSkip, openInBrowser } from "./open-browser.ts";
64+import { runOrg, runOrgs } from "./orgs.ts";
4565import { runUnqueue } from "./queue.ts";
4666import { runNote, runNotes, runReview } from "./review.ts";
67+import {
68+ checkFolderServer,
69+ chooseServer,
70+ localRefusal,
71+ SERVER_ORDER,
72+ serverFlag,
73+ serverHelp,
74+ serverUse,
75+} from "./server-choice.ts";
76+import { installSkill, SKILL, skillPath } from "./skill.ts";
77+import { stateDir } from "./state-dir.ts";
78+import { colorsPass, terminalText } from "./terminal-text.ts";
4779import { runAmend, runDrop, runFollow, runLabel, runLabels, runPluck } from "./versions.ts";
4880import { runVisibility } from "./visibility-commands.ts";
81+import { checkVisitor } from "./visitor.ts";
82+import { handoffText, patFromFile, webLogin } from "./web-session.ts";
4983
5084interface CommandDef {
5185 readonly flags: FlagSpec;
Lines 90–98 at 318 (were 56–68 at 20)
5690 readonly run: (args: Parsed, env: Env) => Promise<Output>;
5791}
5892
59−/** The server login, box and logout act on: --server, or the folder's. */
60−function boxServer(args: Parsed, env: Env): string {
61− const flag = str(args, "server");
62− if (flag) return flag;
63− const root = findRoot(env.cwd);
64− if (!root) throw new UsageError("give --server <url>, or run this inside an agent's folder");
65− return (JSON.parse(readFileSync(configPath(root), "utf8")) as { server: string }).server;
93+/** The server login, box, logout, orgs, org, whoami and doctor act on, in the order every command picks one (server-choice.ts). */
94+export function boxServer(args: Parsed, env: Pick<Env, "cwd" | "env">): string {
95+ return chooseServer(serverFlag(args), env.cwd, env.env);
6696}
6797
6898async function runKeyInstall(args: Parsed, env: Env): Promise<Output> {
Lines 114–136 at 318 (were 84–94 at 20)
84114
85115const COMMANDS: Readonly<Record<string, CommandDef>> = {
86116 init: {
87− flags: { server: "string", project: "string", agent: "string", "as-is": "boolean" },
88− usage: "abso init [folder] --server <url> --project <name> --agent <name> [--as-is]",
117+ flags: {
118+ server: "string",
119+ project: "string",
120+ agent: "string",
121+ "as-is": "boolean",
122+ org: "string",
123+ public: "boolean",
124+ private: "boolean",
125+ "token-file": "boolean",
126+ local: "boolean",
127+ store: "string",
128+ },
129+ usage:
130+ "abso init [folder] --project <name> [--agent <name>] [--as-is] [--org <org>] [--public|--private] [--token-file] | abso init [folder] --local --project <name> [--agent <name>] [--store <folder>] [--as-is]",
89131 about:
90− "Create a project on the server from a folder's text files. The folder becomes that agent's folder. It writes a starting .avcsignore, and, when the folder has no avcs.json and package.json gives a check or a build to guess, an avcs.json (setup, check, build and out): what the server's CI runs on each new version of shared. Without one, CI runs what it can guess itself, or nothing. --as-is writes neither: the folder goes up exactly as it is (an import).",
91− run: runInit,
132+ "Create a project on the server from a folder's text files. The folder becomes that agent's folder. It writes a starting .absoignore, and, when the folder has no abso.json and package.json gives a check or a build to guess, an abso.json (setup, check, build and out): what the server's CI runs on each new version of shared. Without one, CI runs what it can guess itself, or nothing. --as-is writes neither: the folder goes up exactly as it is (an import). On a server this box is signed in to (abso login, approving all your projects), the project is made as you, the way the website's New project makes it: you own it, it's private unless you say --public, and the folder joins it at once with its own key (--agent names it; else the box's name). --org <org> makes it that organization's project. Elsewhere it needs --agent and a token: ABSO_TOKEN, or with --token-file this machine's ~/.abso/token, which is never used unasked. Before it makes anything, it says what it signs in with. --local makes a local project instead: its history is kept on this machine, in a store folder, and no server, sign-in or network is needed (Node 22.13 or later). The store is --store <folder> (kept in the folder's settings; inside the folder, .absoignore leaves it out), else ABSO_STORE, else this user's data folder (%LOCALAPPDATA%\\abso\\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store). The agent is --agent, else this computer's name.",
133+ run: (args, env) => runInit(args, env),
92134 },
93135 key: {
94136 flags: {
Lines 145–151 at 318 (were 103–109 at 20)
103145 usage:
104146 "abso key install [--server <url> [--dir <folder>]] | abso key new <agent> [--server <url> [--dir <folder>]] [--project <name>] [--expires <Nd>] [--role owner|writer|reader] [--print] | abso key list [--agent <name>] [--project <name>] | abso key revoke <id> [--project <name>]",
105147 about:
106− "install reads {key, id} from stdin into .abso/key. With --server, it writes it into a folder not joined yet, so abso join there signs in with the key. new writes the key into that folder and prints only the id; its role is writer unless --role says otherwise (a reader only reads; a writer writes on its own agent's routes; an owner also skips or revokes CI, resumes the queue, syncs git and exports); --print writes the key to stdout instead. list and revoke never print a key. These three read the admin token from AVCS_ADMIN_TOKEN or ~/.abso/admin-token and send it only to a server named in AVCS_ADMIN_SERVERS. An agent does not run them unless a person on the project says so.",
148+ "install reads {key, id} from stdin into .abso/key. With --server, it writes it into a folder not joined yet, so abso join there signs in with the key. new writes the key into that folder and prints only the id; its role is writer unless --role says otherwise (a reader only reads; a writer writes on its own agent's routes; an owner also skips or revokes CI, resumes the queue, syncs git and exports); --print writes the key to stdout instead. list and revoke never print a key. These three read the admin token from ABSO_ADMIN_TOKEN or ~/.abso/admin-token and send it only to a server named in ABSO_ADMIN_SERVERS. An agent does not run them unless a person on the project says so.",
107149 run: async (args, env) => {
108150 const sub = args.positionals[0];
109151 if (sub === "install" && args.positionals.length === 1) return runKeyInstall(args, env);
Lines 154–171 at 318 (were 112–128 at 20)
112154 if (!root) throw new UsageError("abso key runs inside an agent's folder, or takes --server <url>");
113155 let config: ReturnType<typeof readConfig>;
114156 try {
115− config = readConfig(root, env.env);
157+ config = readConfig(root, env.env, env.tokenFile === true);
116158 } catch {
117159 config = {
118160 server: serverFlag ?? "",
119161 project: str(args, "project") ?? "",
120162 agent: "admin",
121− token: readToken(env.env),
163+ token: fromEnv(env.env, "TOKEN")?.trim() || (env.tokenFile ? tokenFile() : undefined),
122164 };
123165 }
124166 if (serverFlag) config = { ...config, server: serverFlag };
125167 const admin = adminToken(env.env);
168+ (env.writeErr ?? env.write)(`${adminTokenWords(env.env)}\n`);
126169 if (sub === "new" && args.positionals.length === 2) {
127170 const server = str(args, "server") ?? config.server;
128171 const project = str(args, "project") ?? config.project;
Lines 206–254 at 318 (were 163–175 at 20)
163206 },
164207 },
165208 login: {
166− flags: { server: "string" },
167− usage: "abso login [--server <url>]",
209+ flags: {
210+ server: "string",
211+ "no-browser": "boolean",
212+ "no-ask": "boolean",
213+ projects: "string",
214+ role: "string",
215+ days: "string",
216+ web: "boolean",
217+ site: "string",
218+ "pat-file": "string",
219+ },
220+ usage:
221+ "abso login [--no-browser] [--no-ask] [--projects <name,name>] [--role <reader|writer|owner>] [--days <1-90>] | abso login --web [--pat-file <file> [--site http://localhost:<port>]]",
168222 about:
169− "Sign this box in once (abso issue 108): it shows a code and a link, and waits while a person approves the code on the website, choosing the projects, the highest role and how many agents. Then abso join in any of those projects gives each agent its own key, with no approval. The box's sign-in is kept in your user folder, never in a project folder, and is never printed. Without --server, the folder's server.",
223+ "Sign this box in once: it opens the approve page in your browser with the code filled in, prints the link and the code too, and waits while a person approves the code on the website, choosing the projects, the highest role and how long. Then abso join in any of those projects gives each agent its own key, with no approval. The box's sign-in is kept in your user folder, never in a project folder, and is never printed. No browser opens with --no-browser or ABSO_NO_BROWSER, over SSH, under CI, or on Linux without a display. In an agent's folder on the same server, it also asks a person in that project to approve it (the person who approved the agent's box, else the project's owners), as an abso ask, so nobody has to relay the code; the box can then be granted that project at no more than the agent's own role. --no-ask shows the code only. --web, on staging only, signs a browser in to the website instead: it prints a link that works once, within a minute, and signs whichever browser opens it in as the person who approved this box, but only to the projects the box was granted and at most as a writer, until the box is revoked or ends (or, with --pat-file, as the test account whose PAT that file holds, at most as a writer). It writes issues, replies, answers, groups and announcements, and changes no members, roles, visibility, keys, boxes or settings. The box's sign-in, the PAT and the session never appear. It goes only to the staging website beside this folder's staging server; any other server, prod included, is refused and nothing is sent. --site, with --pat-file only, points it at a website on this machine (http://localhost or 127.0.0.1).",
170224 run: async (args, env) => {
171225 const server = boxServer(args, env);
172− const record = await login(server, { say: (line) => process.stderr.write(`${line}\n`) });
226+ if (bool(args, "web")) {
227+ const patFile = str(args, "pat-file");
228+ const { handoff, site } = await webLogin({
229+ server,
230+ site: str(args, "site"),
231+ kind: patFile === undefined ? "box" : "pat",
232+ credential: () => {
233+ if (patFile !== undefined) return patFromFile(patFile);
234+ const record = readBox(server);
235+ if (record === undefined || record.expiresAt <= Date.now())
236+ throw new UsageError(`this box isn't signed in to ${server}: abso login first, or --pat-file <file>`);
237+ return record.credential;
238+ },
239+ });
240+ return { text: handoffText(handoff, site, patFile === undefined), json: { ...handoff } };
241+ }
242+ const open =
243+ bool(args, "no-browser") || browserSkip(env.env, process.platform) !== null
244+ ? undefined
245+ : (url: string) => openInBrowser(url);
246+ const record = await login(server, {
247+ ask: bool(args, "no-ask") ? undefined : loginAsk(server, env),
248+ request: loginRequest(args),
249+ say: (line) => process.stderr.write(terminalText(`${line}\n`, colorsPass(process.stderr, env.env))),
250+ open,
251+ });
173252 return {
174253 text: `This box is signed in. ${boxText(record, server).split("\n").slice(1).join(" ")}`,
175254 json: { box: boxPublic(record) },
Lines 257–263 at 318 (were 178–184 at 20)
178257 },
179258 box: {
180259 flags: { server: "string" },
181− usage: "abso box [--server <url>]",
260+ usage: "abso box",
182261 about:
183262 "What this box's sign-in allows: its projects, the highest role its agents may have, how many agents it has made and may make, and when it expires. Never the credential.",
184263 run: async (args, env) => {
Lines 266–295 at 318 (were 187–195 at 20)
187266 return { text: boxText(record, server), json: { box: boxPublic(record) } };
188267 },
189268 },
269+ whoami: {
270+ flags: { server: "string" },
271+ usage: "abso whoami",
272+ about:
273+ "Who and where you're signed in: this box's sign-in, as the server sees it (so a revoked one shows), its projects, roles and expiry, and this folder's project, agent and kind of key. Never a credential.",
274+ run: async (args, env) => {
275+ const out = await whoami(boxServer(args, env), env.cwd, env.env, realProbe());
276+ return { text: out.text, json: out.json };
277+ },
278+ },
279+ doctor: {
280+ flags: { server: "string" },
281+ usage: "abso doctor",
282+ about:
283+ "Checks what commands need, one line each: Node's version, that the server answers, this box's sign-in (present, unexpired, accepted), and this folder's key against its project. A failed check says what to do next, and the exit is 1. Never prints a credential.",
284+ run: async (args, env) => {
285+ const checks = await doctor(boxServer(args, env), env.cwd, env.env, realProbe());
286+ const failed = checks.some((c) => c.result === "fail");
287+ return { text: doctorText(checks), json: { checks }, ...(failed ? { exit: EXIT.error } : {}) };
288+ },
289+ },
190290 logout: {
191291 flags: { server: "string" },
192− usage: "abso logout [--server <url>]",
292+ usage: "abso logout",
193293 about:
194294 "End this box's sign-in on the server and forget it here. Keys its agents already have stop working with it.",
195295 run: async (args, env) => {
Lines 305–368 at 318 (were 205–215 at 20)
205305 };
206306 },
207307 },
308+ orgs: {
309+ flags: { server: "string" },
310+ usage: "abso orgs",
311+ about:
312+ "Your organizations and your role in each, and invitations waiting for you. It reads as the person who approved this box's sign-in (abso login).",
313+ run: (args, env) => runOrgs(boxServer(args, env)),
314+ },
315+ org: {
316+ flags: {
317+ server: "string",
318+ name: "string",
319+ invite: "string",
320+ as: "string",
321+ role: "string",
322+ remove: "string",
323+ leave: "boolean",
324+ members: "string",
325+ "projects-by": "string",
326+ },
327+ usage:
328+ "abso org <name> [--invite <person>|link [--as owner] | --role <person>=owner|member | --remove <person> | --leave | --members read|write | --projects-by members|owners] | abso org new <name> [--name <shown name>]",
329+ about:
330+ "An organization: its projects, people, open invites and settings, as the person who approved this box's sign-in sees them (people and settings only to members). One change at a time. abso org new makes one as that person, from a box approved for all their projects; other changes are made on the website, and abso says where.",
331+ run: (args, env) => runOrg(args, boxServer(args, env)),
332+ },
333+ skill: {
334+ flags: { dir: "string" },
335+ usage: "abso skill install [--dir <skills folder>] | abso skill show",
336+ about:
337+ "The abso skill for Claude Code: how to work in an abso folder, and what never to share. install writes it to ~/.claude/skills/abso/SKILL.md (--dir names another skills folder) and changes no settings; run it again after updating abso. show prints it.",
338+ run: async (args, env) => {
339+ const [verb, ...more] = args.positionals;
340+ if (verb === "show" && more.length === 0) return { text: SKILL, json: { skill: SKILL } };
341+ if (verb !== "install" || more.length > 0)
342+ throw new UsageError("abso skill install [--dir <skills folder>] | abso skill show");
343+ const path = skillPath(str(args, "dir"), env.cwd);
344+ const done = installSkill(path);
345+ const said = { installed: "Installed", updated: "Updated", current: "Already current:" }[done];
346+ return {
347+ text: `${said} the abso skill at ${path}. New Claude Code sessions load it.`,
348+ json: { path, done },
349+ };
350+ },
351+ },
208352 join: {
209− flags: { server: "string", agent: "string", dir: "string", reader: "boolean" },
210− usage: "abso join <project> --agent <name> --server <url> [--dir <folder>] [--reader]",
353+ flags: {
354+ server: "string",
355+ agent: "string",
356+ dir: "string",
357+ reader: "boolean",
358+ "token-file": "boolean",
359+ local: "boolean",
360+ store: "string",
361+ },
362+ usage:
363+ "abso join <project> [--agent <name>] [--dir <folder>] [--reader] [--token-file] | abso join <project> --local [--agent <name>] [--store <folder>] [--dir <folder>]",
211364 about:
212− "Join a project as a new agent and write its shared files into the folder (default: here). --reader joins as a reader: it reads everything and records nothing, and the server refuses its edits, records and publishes.",
365+ "Join a project as a new agent and write its shared files into a folder: --dir, else here when this folder is empty, else ./<project> (which has to be new or empty). Without --agent the agent is named after this box (the name abso login gave it, lower-cased), or the next free <name>-2, <name>-3; that needs the box signed in with abso login. --reader joins as a reader: it reads everything and records nothing, and the server refuses its edits, records and pushes. With --reader and no sign-in, a public project is joined to read signed out: the folder holds only its settings, sends no sign-in, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused. It says what it signs in with: a new key from this box's sign-in, the folder's key, or ABSO_TOKEN; this machine's ~/.abso/token only with --token-file, never unasked. --local joins a local project (abso init --local) from the same store: --store, else ABSO_STORE, else this user's data folder; the agent is --agent, else this computer's name.",
213366 run: runJoin,
214367 },
215368 record: {
Lines 372–378 at 318 (were 219–225 at 20)
219372 "Send every file that changed since the server last heard about it (--all: every file). For edits the hook did not see.",
220373 run: runRecord,
221374 },
222− publish: {
375+ push: {
223376 flags: {
224377 message: "string",
225378 binary: "string",
Lines 383–391 at 318 (were 230–238 at 20)
230383 "no-wait": "boolean",
231384 done: "boolean",
232385 },
233− usage: 'abso publish -m "<why>" [--as-is] [--check ["<command>"]] [--wait <seconds> | --no-wait] [--done]',
386+ usage: 'abso push -m "<why>" [--as-is] [--check ["<command>"]] [--wait <seconds> | --no-wait] [--done]',
234387 about:
235− 'Record, then add your draft to shared. Refused when it collides with work published since your last sync, or when lines a sync showed changed on both sides are still untouched (--as-is publishes both sides\' lines anyway). --check "<command>" (e.g. --check "npm run typecheck") first syncs, then runs the command in your box on your draft with newest shared, and publishes only if it exits 0, so two changes that each pass alone can\'t turn shared red. --check alone runs the "build" and then the "check" in the project\'s avcs.json (your draft\'s copy), as the server does on each new version. With the merge queue on ("queue": true in avcs.json), a publish to shared is queued and lands only once the project\'s check passes on shared with it on top: publish waits up to 100 s for that (--wait <seconds> changes it, --no-wait returns at once), then says it landed (exit 0), was pulled with the check\'s output (exit 2, its changes still in your draft), or is still queued (exit 3; the outcome comes as news). --check alone is skipped then, since the queue runs the check. --done takes your start note back once it\'s published: this publish finishes that work.',
388+ 'Record, then add your draft to shared. Refused when it collides with work pushed since your last pull, or when lines a pull showed changed on both sides are still untouched (--as-is pushes both sides\' lines anyway). --check "<command>" (e.g. --check "npm run typecheck") first pulls, then runs the command in your box on your draft with newest shared, and pushes only if it exits 0, so two changes that each pass alone can\'t turn shared red. --check alone runs the "build" and then the "check" in the project\'s abso.json (your draft\'s copy), as the server does on each new version. With the merge queue on ("queue": true in abso.json), a push to shared is queued and lands only once the project\'s check passes on shared with it on top: push waits up to 100 s for that (--wait <seconds> changes it, --no-wait returns at once), then says it landed (exit 0), was turned back with the check\'s output (exit 2, its changes still in your draft), or is still queued (exit 3; the outcome comes as news). --check alone is skipped then, since the queue runs the check. --done takes your start note back once it\'s pushed: this push finishes that work.',
236389 run: runPublish,
237390 },
238391 bisect: {
Lines 400–420 at 318 (were 247–267 at 20)
247400 flags: {},
248401 usage: "abso reader on|off",
249402 about:
250− "Make this folder's agent a reader, which reads everything and records nothing (the server refuses its edits, records and publishes), or a writer again. Refused while it has unpublished or parked work.",
403+ "Make this folder's agent a reader, which reads everything and records nothing (the server refuses its edits, records and pushes), or a writer again. Refused while it has unpushed or parked work.",
251404 run: runReader,
252405 },
253406 settle: {
254407 flags: { yours: "boolean", theirs: "boolean", both: "boolean" },
255408 usage: "abso settle <file...> --yours|--theirs|--both",
256409 about:
257− "Settle the collisions a sync marked in these files: each marker block becomes your lines, theirs, or both (yours first), then it records. abso status lists the files with markers.",
410+ "Settle the collisions a pull marked in these files: each marker block becomes your lines, theirs, or both (yours first), then it records. abso status lists the files with markers.",
258411 run: runSettle,
259412 },
260− sync: {
413+ pull: {
261414 flags: { verbose: "boolean", full: "boolean" },
262− usage: "abso sync [--full]",
415+ usage: "abso pull [--full]",
263416 about:
264− "Record, then bring shared's new work into the folder. Lines changed on both sides are listed as collisions to settle. --full writes any file of yours the folder is missing, not only what changed since your last sync.",
417+ "Record, then bring shared's new work into the folder. Lines changed on both sides are listed as collisions to settle. --full writes any file of yours the folder is missing, not only what changed since your last pull.",
265418 run: runSync,
266419 },
267420 run: {
Lines 433–439 at 318 (were 280–286 at 20)
280433 usage:
281434 'abso run [--detach] [--replace] [--fresh] [--box <name>] [--at <version> [--files <glob>]] <command...> | abso run ... -- <program> <arg...> | abso run --parallel "<command>" "<command>"...',
282435 about:
283− "Send the folder to this agent's box, run the command there, and stream its output back. Exits with the command's code. After --, each word goes to the program exactly as typed (quotes, backslashes, regex text); without --, the words are one shell command. The box's stderr comes out on stderr. --detach starts it and prints its id without waiting. While a run is still going in the box, a new one is refused (409, naming it), since it would replace the files under it; --replace stops the old one first. --parallel runs each quoted command at once in the box (one upload), labels each line [1], [2], ..., ends with each one's exit code, and exits with the worst. --at <version> runs that version of the folder's space instead of the folder (for bisecting); with --files <glob>, only the matching files are taken from that version. The folder is never touched. --fetch <glob>[,<glob>...] brings matching files from the box's /w back after the run (see abso fetch); several globs go in one argument, comma-separated (--fetch 'shots/*.png,out/*.json'), as for --files and --with. The box's /w is replaced by your folder on every run; the rest of the box (/tmp, ~/.cache, /w/node_modules) lasts between runs until the box stops (idle 30 minutes, or restarted). abso's own notices go to stderr, apart from the command's output; --quiet drops them (the command's own stderr still comes through). --with <box path>=<local path>[,...] adds files (or a folder's files) for this run only: they go to the box and are never written to your folder or recorded, for an A/B run that leaves the project alone. --box <name> (or AVCS_BOX=<name>) runs in another box of yours, with its own /w and state, so a subagent's runs and yours don't wait on each other; logs and fetch take --box too. After abso prep, a fresh box starts from the prep; --fresh starts this run from the plain image instead.",
436+ "Send the folder to this agent's box, run the command there, and stream its output back. Exits with the command's code. After --, each word goes to the program exactly as typed (quotes, backslashes, regex text); without --, the words are one shell command. The box's stderr comes out on stderr. --detach starts it and prints its id without waiting. While a run is still going in the box, a new one is refused (409, naming it), since it would replace the files under it; --replace stops the old one first. --parallel runs each quoted command at once in the box (one upload), labels each line [1], [2], ..., ends with each one's exit code, and exits with the worst. --at <version> runs that version of the folder's space instead of the folder (for bisecting); with --files <glob>, only the matching files are taken from that version. The folder is never touched. --fetch <glob>[,<glob>...] brings matching files from the box's /w back after the run (see abso fetch); several globs go in one argument, comma-separated (--fetch 'shots/*.png,out/*.json'), as for --files and --with. The box's /w is replaced by your folder on every run; the rest of the box (/tmp, ~/.cache, /w/node_modules) lasts between runs until the box stops (idle 30 minutes, or restarted). abso's own notices go to stderr, apart from the command's output; --quiet drops them (the command's own stderr still comes through). --with <box path>=<local path>[,...] adds files (or a folder's files) for this run only: they go to the box and are never written to your folder or recorded, for an A/B run that leaves the project alone. --box <name> (or ABSO_BOX=<name>) runs in another box of yours, with its own /w and state, so a subagent's runs and yours don't wait on each other; logs and fetch take --box too. After abso prep, a fresh box starts from the prep; --fresh starts this run from the plain image instead.",
284437 rest: true,
285438 run: runRun,
286439 },
Lines 448–461 at 318 (were 295–308 at 20)
295448 flags: {},
296449 usage: "abso mv <from> <to>",
297450 about:
298− "Move a file in your draft, its lines keeping their history (as git mv), recorded as a move rather than guessed from the folder. The way to change a file's case: README.md and readme.md are one file in abso, and a write under another spelling goes to the existing one, with a warning that names abso mv. It reaches shared with your next publish.",
451+ "Move a file in your draft, its lines keeping their history (as git mv), recorded as a move rather than guessed from the folder. The way to change a file's case: README.md and readme.md are one file in abso, and a write under another spelling goes to the existing one, with a warning that names abso mv. It reaches shared with your next push.",
299452 run: runMv,
300453 },
301454 review: {
302455 flags: { since: "string" },
303456 usage: "abso review [<id> | v<version> | <agent>] [--since <position|2h>]",
304457 about:
305− "Review is reading what landed (#44). With no change: the changes with anything new since you last looked, newest first (a change is one start note's work, a named draft's, or a lone publish), and the mark moves on; --since 2h (or a log position) looks further back without moving it. With a change id, v<version> (the change holding that version of shared) or an agent (its newest change): that change's page, with what it set out to do, its versions, what it settled, its reviewers and its notes.",
458+ "Review is reading what landed. With no change: the changes with anything new since you last looked, newest first (a change is one start note's work, a named draft's, or a lone push), and the mark moves on; --since 2h (or a log position) looks further back without moving it. With a change id, v<version> (the change holding that version of shared) or an agent (its newest change): that change's page, with what it set out to do, its versions, what it settled, its reviewers and its notes.",
306459 run: runReview,
307460 },
308461 note: {
Lines 472–478 at 318 (were 319–325 at 20)
319472 usage:
320473 'abso note <file>:<line>[-<line>] "<text>" [--object | --read] [--draft <agent> | --at <version>] | abso note --reply <id> "<text>" | abso note --close <id> --resolved|--withdrawn',
321474 about:
322− "A note on lines (#44): it sits on those lines and follows them as the file changes. The lines' authors and the change's agent hear it as news. The line numbers are as your folder shows the file (it records first); --draft <agent> notes their unpublished work as their draft shows it, --at <version> a version of shared. --object asks for a fix (it shows as addressed once all its lines change); --read says you read it, telling nobody. --reply answers a note; --close closes one of yours.",
475+ "A note on lines: it sits on those lines and follows them as the file changes. The lines' authors and the change's agent hear it as news. The line numbers are as your folder shows the file (it records first); --draft <agent> notes their unpushed work as their draft shows it, --at <version> a version of shared. --object asks for a fix (it shows as addressed once all its lines change); --read says you read it, telling nobody. --reply answers a note; --close closes one of yours.",
323476 run: runNote,
324477 },
325478 notes: {
Lines 495–501 at 318 (were 342–348 at 20)
342495 usage:
343496 "abso issues [--open] [--status <status>] [--agent <agent>] [--parent <N>] [--label <l,l>] | abso issues --labels",
344497 about:
345− "The project's issues (#54), most recently updated first, each with its status, agents, labels, versions and who it waits on. --label keeps the issues with every label named (friction, say); --labels lists the labels in use, with how many issues are open under each; --drafts lists your drafts. A status comes from the work: abso start --issue N puts an issue In progress, an open ask makes it Blocked (or In review, for a review), and publish --done closes it.",
498+ "The project's issues, most recently updated first, each with its status, agents, labels, versions and who it waits on. --label keeps the issues with every label named (friction, say); --labels lists the labels in use, with how many issues are open under each; --drafts lists your drafts. A status comes from the work: abso start --issue N puts an issue In progress, an open ask makes it Blocked (or In review, for a review), and push --done closes it.",
346499 run: runIssues,
347500 },
348501 issue: {
Lines 519–533 at 318 (were 366–376 at 20)
366519 open: "boolean",
367520 delete: "boolean",
368521 attach: "string",
522+ "copy-to": "string",
523+ clean: "string",
524+ "dry-run": "boolean",
525+ "save-attachments": "string",
369526 },
370527 usage:
371− 'abso issue <N> [--comment "..." [--attach <file,file>] | --object "..." | --drop | --reopen | --done [--done-by <version>]] | abso issue <N> [--title "..."] [--description "..."] [--parent <N|none>] [--agent <agent|none>] [--blocked-by <N,N|none>] [--label <l,l>] [--unlabel <l,l>] [--notify <who,who> | --quiet] | abso issue new "<title>" [--description "..."] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>] [--attach <file,file>]',
528+ 'abso issue <N> --save-attachments <folder> | abso issue <N> --copy-to <project> [--clean <file>] [--dry-run] | abso issue <N> [--comment "..." [--attach <file,file>] | --object "..." | --drop | --reopen | --done [--done-by <version>]] | abso issue <N> [--title "..."] [--description "..."] [--parent <N|none>] [--agent <agent|none>] [--blocked-by <N,N|none>] [--label <l,l>] [--unlabel <l,l>] [--notify <who,who> | --quiet] | abso issue new "<title>" [--description "..."] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>] [--attach <file,file>]',
372529 about:
373− "One issue: its description, Agent, Blocked by, labels, asks, comments, edits, sub-issues and watchers. --comment comments on it and --object objects; its agents hear either. --drop drops it. --reopen opens a dropped issue again. --done marks it done by hand, and --done-by <version> names the published version that did it. publish --done still marks it done too. --title, --description, --parent, --agent and --blocked-by edit it, and the edit tells its watchers (who opened it, its Agent and agents, its Reviewer, whoever was named in Notify, and whoever commented); --notify tells more people, --quiet tells nobody. --label adds labels and --unlabel takes them off (friction, area:client: lower-case letters, digits and - _ . :); a label-only edit tells nobody unless --notify names people. An issue is Blocked until each issue it's blocked by is Done. abso issue new opens one; --lines ties it to lines at a version of shared, --agent says who it's for, --notify tells people now, and --label labels it. --attach shot.png,after.png puts images on a new issue or a comment (png, jpeg, gif or webp, 10 MB each; the server checks the type by the bytes and takes out metadata such as where a photo was taken), and prints each one's id for the text to point at; the issue's page lists them with a link. abso issue draft \"<title>\" [the same fields] saves a draft instead: yours alone, with no number and no news; abso issue draft <D> [fields] changes it, --open opens it as an issue, --delete deletes it.",
530+ "One issue: its description, Agent, Blocked by, labels, asks, comments, edits, sub-issues and watchers. --comment comments on it and --object objects; its agents hear either. A comment holds up to 4000 characters: a longer --comment (or --comment-file) goes up in parts, split at paragraph breaks and each starting (1/3), (2/3) and so on, and a longer --object is refused before anything is sent. --drop drops it. --reopen opens a dropped issue again. --done marks it done by hand, and --done-by <version> names the pushed version that did it. push --done still marks it done too. --title, --description, --parent, --agent and --blocked-by edit it, and the edit tells its watchers (who opened it, its Agent and agents, its Reviewer, whoever was named in Notify, and whoever commented); --notify tells more people, --quiet tells nobody. --label adds labels and --unlabel takes them off (friction, area:client: lower-case letters, digits and - _ . :); a label-only edit tells nobody unless --notify names people. An issue is Blocked until each issue it's blocked by is Done. abso issue new opens one; --lines ties it to lines at a version of shared, --agent says who it's for, --notify tells people now, and --label labels it. --attach shot.png,after.png puts images on a new issue or a comment (png, jpeg, gif or webp, 10 MB each; the server checks the type by the bytes and takes out metadata such as where a photo was taken. An svg, up to 1 MB, is drawn as a png, and its own file is kept as a download, on servers that take svg), and prints each one's id for the text to point at; the issue's page lists them with a link, and --save-attachments <folder> saves every one on the issue and its comments there as <id>-<name> (an svg's own file too), outside the abso folder or where abso leaves files out. --copy-to <project> copies the issue into another project, with its comments, answered asks and labels, each keeping its author and time; --dry-run shows what would go and writes nothing, and --clean <file> gives cleaned texts by source id as JSON ({title, description, comments: [{id, text}], asks: [{id, question, answer}]}; a comment left out of a given list isn't copied). Copying out of a project on a live server takes an owner of that project. abso issue draft \"<title>\" [the same fields] saves a draft instead: yours alone, with no number and no news; abso issue draft <D> [fields] changes it, --open opens it as an issue, --delete deletes it.",
374531 run: runIssue,
375532 },
376533 ask: {
Lines 540–551 at 318 (were 383–393 at 20)
383540 options: "string",
384541 withdraw: "string",
385542 note: "string",
543+ attach: "string",
386544 },
387545 usage:
388− 'abso ask <who> "<question>" [--issue <N>] [--review | --task] [--due <YYYY-MM-DD>] [--blocks <N,N>] [--options "A|B|C"] | abso ask --withdraw <ask> [--note "why"]',
546+ 'abso ask <who> "<question>" [--issue <N>] [--review | --task] [--due <YYYY-MM-DD>] [--blocks <N,N>] [--options "A|B|C"] [--attach <file,file>] | abso ask <N> | abso ask --withdraw <ask> [--note "why"]',
389547 about:
390− "Ask an agent, or a person (person:<id>), something; they hear it. On an issue, it holds the issue at Blocked (In review for --review) until answered. --task asks for something done instead of an answer; --options gives the choices; --blocks names the issues waiting on it. --withdraw takes back an ask you made that no longer needs an answer: it leaves their waiting list, stops holding the issue, keeps your --note as why, and they hear it.",
548+ "Ask an agent, or a person (person:<id>), something; they hear it. Who must be one of the project's agents or members; a name that isn't is refused, with the closest one suggested. abso ask <N> shows ask N, open or closed, with its whole thread, its answer and whose turn it is. On an issue, it holds the issue at Blocked (In review for --review) until answered. --task asks for something done instead of an answer; --options gives the choices; --blocks names the issues waiting on it. --attach sends files with the question, as on an issue. --withdraw takes back an ask you made that no longer needs an answer: it leaves their waiting list, stops holding the issue, keeps your --note as why, and they hear it.",
391549 run: runAsk,
392550 },
393551 search: {
Lines 556–654 at 318 (were 398–435 at 20)
398556 run: runSearch,
399557 },
400558 waiting: {
401− flags: { of: "string", mine: "boolean" },
402− usage: "abso waiting [--of <agent or person:id>] [--mine]",
403− about: "The open asks, soonest due first: every one, those of someone (--of), or those of you (--mine).",
559+ flags: { of: "string", mine: "boolean", asked: "boolean" },
560+ usage: "abso waiting [--of <agent or person:id>] [--mine] [--asked]",
561+ about:
562+ "The open asks, soonest due first: every one, those waiting on someone (--of), or those waiting on you (--mine), each with its newest reply. An ask waits on the one asked until they answer, or on the asker after a reply with --question, until the asker replies. --mine also lists your pushes still in the merge queue and where each stands; the outcome comes as news. --asked lists the asks you sent instead, open ones first, then the latest answered.",
404563 run: runWaiting,
405564 },
406565 answer: {
407− flags: { option: "string", note: "string", done: "boolean" },
566+ flags: { option: "string", note: "string", done: "boolean", attach: "string" },
408567 usage:
409− 'abso answer <ask> "<words>" | abso answer <ask> --option <N> [--note "..."] | abso answer <ask> --done [--note "..."]',
568+ 'abso answer <ask> "<words>" | abso answer <ask> --option <N> [--note "..."] | abso answer <ask> --done [--note "..."], each with [--attach <file,file>]',
410569 about:
411− "Answer an ask of you, in your own words, by picking an option (by number or text), or, for a task, with --done. The asker hears it.",
570+ "Answer an ask of you, in your own words, by picking an option (by number or text), or, for a task, with --done. --attach sends files with the answer. The asker hears it.",
412571 run: runAnswer,
413572 },
573+ ack: {
574+ flags: {},
575+ usage: 'abso ack <ask> ["<note>"]',
576+ about:
577+ "Acknowledge an ask of you without answering it yet: it's the first reply in its thread. The asker hears it, with your note, and the ask stays open. abso reply adds more; abso answer closes it later.",
578+ run: runAck,
579+ },
580+ reply: {
581+ flags: { question: "boolean" },
582+ usage: 'abso reply <ask> "<words>" [--question]',
583+ about:
584+ 'Add to an ask\'s thread, as its asker or the one asked, open or closed: "ok, let me check", what you found, a follow-up. The other side hears it, and the ask stays as it is; abso answer still closes it. --question, from the one asked, asks the asker something back: the ask waits on them until they reply. On a public project, anyone can read the thread.',
585+ run: runReply,
586+ },
587+ groups: {
588+ flags: {},
589+ usage: "abso groups",
590+ about:
591+ "The project's groups you can see: named sets of agents and people, each with one shared history. A private group shows only to its members and the project's owners. abso group <name> reads one.",
592+ run: runGroups,
593+ },
594+ group: {
595+ flags: {
596+ post: "string",
597+ reply: "string",
598+ news: "string",
599+ except: "string",
600+ join: "boolean",
601+ leave: "boolean",
602+ add: "string",
603+ remove: "string",
604+ rename: "string",
605+ private: "optional",
606+ joinable: "string",
607+ closed: "boolean",
608+ before: "string",
609+ limit: "string",
610+ kind: "string",
611+ },
612+ usage:
613+ 'abso group <name> [--post "<words>" [--reply <N>] [--news all|none|<names> | --except <names>]] [--join | --leave | --add <who> | --remove <who> | --rename <name> | --private on|off | --joinable on|off] [--before <N>] [--limit <N>] [--kind message|member|settings] | abso group new <name> [--private] [--closed] [--add <names>]',
614+ about:
615+ "A group: its settings, members and history, newest first (--before reads further back, --kind filters). --post adds a message, with news for every other member unless --news names some, --except leaves some out, or --news none keeps it in the history only. A retry never posts twice. --join and --leave are yours to do any time, for a joinable group; a private one is joined only by its exact name. Its maker and the project's owners add, remove, rename and switch private and joinable. abso group new makes one, with you in it; --closed means members are added rather than joining. A reader may make, join and post in groups too.",
616+ run: runGroup,
617+ },
414618 unqueue: {
415619 flags: {},
416620 usage: "abso unqueue",
417621 about:
418− "Take back your publishes still waiting in the merge queue: their changes stay in your draft, unpublished. Refused while one is being checked; it lands or is pulled within a few minutes (abso drop takes it back after it lands).",
622+ "Take back your pushes still waiting in the merge queue: their changes stay in your draft, unpushed. Refused while one is being checked; it lands or is turned back within a few minutes (abso drop takes it back after it lands).",
419623 run: runUnqueue,
420624 },
421625 visibility: {
422626 flags: { yes: "boolean" },
423627 usage: "abso visibility [public|private] [--yes]",
424628 about:
425− "Whether the project is public (abso issue 152). With no word, says which. public, with --yes, lets anyone read it, signed in or not: files, versions, drafts, notes, Issues, people's names, CI as pass or fail; never keys, CI logs, preview links or boxes. private makes it members-only again. Switching takes the project owner's key (on staging, the shared token works too).",
629+ "Whether the project is public. With no word, says which. public, with --yes, lets anyone read it, signed in or not: files, versions, drafts, notes, Issues, people's names, CI as pass or fail; never keys, CI logs, preview links or boxes. private makes it members-only again. Switching takes the project owner's key (on staging, the shared token works too).",
426630 run: runVisibility,
427631 },
632+ autosettle: {
633+ flags: { at: "string" },
634+ usage: "abso autosettle [off|advise|settle] [--at 0.3-0.95] | abso autosettle history [<id>]",
635+ about:
636+ "What the server does with a held push (abso-core 23). With no word, says which. advise: each collision comes back with a model's pick (keep yours, keep theirs, keep both, or leave it to an agent), how sure it is, and why; the agent still settles. settle: when the model is at least --at sure about every collision, your abso settles it and pushes again by itself, saying so in the message; anything less sure stays held, with the advice. off: held pushes come back as they always have. New projects start on advise. Changing it takes the project owner's key (on staging, the shared token works too). ABSO_AUTOSETTLE=off on a machine makes its abso settle nothing by itself. abso autosettle history lists the held pushes the model advised on, newest first, with what it said and what was then kept; history <id> shows one, with its calls to the model (--json has each request and answer).",
637+ run: runAutosettle,
638+ },
639+ flag: {
640+ flags: { why: "string", project: "string", person: "string", limit: "string" },
641+ usage:
642+ 'abso flag [list] | abso flag log [--limit N] | abso flag set <flag> <value> --why "..." [--project <name> | --person person:<id>] | abso flag unset <flag> --why "..." [--project <name> | --person person:<id>]',
643+ about:
644+ "The server's feature flags: switches flipped while it runs, with no deploy. list shows each flag, the values it takes, its safe default, what it gates, and where it's set. set gives it a value for the whole server, or for one --project or --person; unset takes that value away. Each change says --why, and the server keeps who, when, the old and new value, and why; log shows those changes, newest first. A read takes the person's value, then the project's, then the whole server's, then the safe one. The server decides who may: its admin token, read from ABSO_ADMIN_TOKEN or ~/.abso/admin-token and sent only to a server ABSO_ADMIN_SERVERS names, and an owner's key where the server takes one. An agent does not flip a flag unless a person on the project says so.",
645+ run: runFlag,
646+ },
428647 ci: {
429648 flags: { version: "string", revoke: "boolean" },
430649 usage: "abso ci [<version>] | abso ci --revoke",
431650 about:
432− "The project's CI: the server runs avcs.json's setup, build and check on each new version of shared, one job at a time on the newest. abso ci says whether shared is green or red (and since which version, by whom, once a bisect finds it), what is being checked, and the preview link of the newest passing build, which needs no token. abso ci <version> shows that version's job: which step failed, its exit code, and the end of its output. status says the same in a line, and log marks each version of shared. --revoke ends every preview link handed out so far and makes a new one.",
651+ "The project's CI: the server runs abso.json's setup, build and check on each new version of shared, one job at a time on the newest. abso ci says whether shared is green or red (and since which version, by whom, once a bisect finds it), what is being checked, and the preview link of the newest passing build, which needs no token. abso ci <version> shows that version's job: which step failed, its exit code, and the end of its output. status says the same in a line, and log marks each version of shared. --revoke ends every preview link handed out so far and makes a new one.",
433652 run: runCi,
434653 },
435654 shot: {
Lines 674–680 at 318 (were 455–461 at 20)
455674 usage:
456675 'abso shot ["/<path>?<query>"] [--scale 0.1-1] [--region x0,y0,x1,y1] [--text] [--tree [--interactive] [--depth N]] [--find "<text>"] [--max-chars N] [--image] [--at <version>] [--eval "<js>"] [--click "x,y[@ms];ref_N[@ms]"] [--mouse x,y|ref_N] [--out <file.png>] [--wait <ms>] [--size <w>x<h>]',
457676 about:
458− "A look at your folder's game, taken in your box: it runs the project's vite dev server and Playwright on that page (default /, a 1280x720 page). Images cost tokens, so read without one when you can: --text prints the page's visible text, --tree its elements (role, name, a ref like ref_12, and its box in page pixels; --interactive only what can be clicked or typed in; --depth N levels), and --find \"<text>\" the elements matching some text; each is capped at --max-chars (default 5000). With none of those, or with --image, it writes a PNG to .avcs/shots/ (never recorded) or --out, and prints its pixel size and about how many tokens reading it costs (width x height / 750). --scale 0.5 halves the width and height (a quarter of the tokens); --region x0,y0,x1,y1 takes part of the page at full detail; they combine. Coordinates are always the page's, whatever the scale or region. To set up a state first, --eval runs JavaScript in the page and --click clicks points (x,y or ref_N; several separated by ;; @ms waits first), in that order, a second after load and two frames after the eval; --mouse x,y or ref_N leaves the pointer there (for hover cards); then it waits --wait ms (default 3000) and looks. It prints --eval's result, page errors and the first 30 console messages. Refs come from --tree or --find on the same page in the same state. --at <version> looks at that version of your folder's space instead of the folder (as abso run --at). Needs vite and playwright in the project's devDependencies; abso prep with npx --no-install playwright install chromium makes it fast.",
677+ "A look at your folder's game, taken in your box: it runs the project's vite dev server and Playwright on that page (default /, a 1280x720 page). Images cost tokens, so read without one when you can: --text prints the page's visible text, --tree its elements (role, name, a ref like ref_12, and its box in page pixels; --interactive only what can be clicked or typed in; --depth N levels), and --find \"<text>\" the elements matching some text; each is capped at --max-chars (default 5000). With none of those, or with --image, it writes a PNG to .abso/shots/ (never recorded) or --out, and prints its pixel size and about how many tokens reading it costs (width x height / 750). --scale 0.5 halves the width and height (a quarter of the tokens); --region x0,y0,x1,y1 takes part of the page at full detail; they combine. Coordinates are always the page's, whatever the scale or region. To set up a state first, --eval runs JavaScript in the page and --click clicks points (x,y or ref_N; several separated by ;; @ms waits first), in that order, a second after load and two frames after the eval; --mouse x,y or ref_N leaves the pointer there (for hover cards); then it waits --wait ms (default 3000) and looks. It prints --eval's result, page errors and the first 30 console messages. Refs come from --tree or --find on the same page in the same state. --at <version> looks at that version of your folder's space instead of the folder (as abso run --at). Needs vite and playwright in the project's devDependencies; abso prep with npx --no-install playwright install chromium makes it fast.",
459678 run: runShot,
460679 },
461680 prep: {
Lines 716–729 at 318 (were 497–510 at 20)
497716 flags: { short: "boolean" },
498717 usage: "abso status [--short]",
499718 about:
500− "The shared version, whether shared is green or red by the project's CI (abso ci has more), who waits in the merge queue, every agent's base and draft, and what in this folder is not yet recorded. --short prints one word for stamping a build: the version this folder is on (214), with the named draft (coast@3), +unpublished when it holds changes not yet published, and +queued when a publish of yours waits in the merge queue.",
719+ "The shared version, whether shared is green or red by the project's CI (abso ci has more), who waits in the merge queue, every agent's base and draft, and what in this folder is not yet recorded. --short prints one word for stamping a build: the version this folder is on (214), with the named draft (coast@3), +unpushed when it holds changes not yet pushed, and +queued when a push of yours waits in the merge queue.",
501720 run: runStatus,
502721 },
503722 switch: {
504723 flags: { carry: "boolean", verbose: "boolean" },
505724 usage: "abso switch <draft> | abso switch -c <new draft> | abso switch shared",
506725 about:
507− "Move this folder to a named draft, or back to shared. Your unpublished changes are parked where you leave and come back when you return; -c carries them into a new draft instead.",
726+ "Move this folder to a named draft, or back to shared. Your unpushed changes are parked where you leave and come back when you return; -c carries them into a new draft instead.",
508727 run: runSwitch,
509728 },
510729 land: {
Lines 733–763 at 318 (were 514–544 at 20)
514733 "Land your named draft in shared, as one unit. Refused only on a collision with work that landed in shared since the draft began.",
515734 run: runLand,
516735 },
517− "draft-sync": {
736+ "draft-pull": {
518737 flags: {},
519− usage: "abso draft-sync",
738+ usage: "abso draft-pull",
520739 about: "Move your named draft onto shared's newest version, then bring that into this folder.",
521740 run: runDraftSync,
522741 },
523742 diff: {
524− flags: { draft: "string" },
525− usage: "abso diff [file...] | abso diff <from> <to> [file...] [--draft <name>]",
743+ flags: { draft: "string", agent: "string" },
744+ usage: "abso diff [file...] [--agent <name>] | abso diff <from> <to> [file...] [--draft <name>]",
526745 about:
527− "Your unpublished changes, line by line, as git prints them (records first). With two versions: what changed between them in this space.",
746+ "Your unpushed changes, line by line, as git prints them (records first). --agent <name>: that agent's recorded, unpushed changes instead, to review them; it changes nothing. With two versions: what changed between them in this space.",
528747 run: runDiff,
529748 },
530749 restore: {
531750 flags: { all: "boolean" },
532751 usage: "abso restore <file...> | abso restore <file>:<line>[-<line>] | abso restore --all",
533752 about:
534− "Discard your unpublished changes to those files (--all: to every file), like git restore. The files go back to how your space has them. <file>:<lines> puts back only the changes that touch those lines (numbered as abso diff shows the file now) and keeps your other changes to it.",
753+ "Discard your unpushed changes to those files (--all: to every file), like git restore. The files go back to how your space has them. <file>:<lines> puts back only the changes that touch those lines (numbered as abso diff shows the file now) and keeps your other changes to it.",
535754 run: runRestore,
536755 },
537756 export: {
538− flags: { version: "string", keep: "string" },
539− usage: "abso export <dir> [--version <N>] [--keep <glob>]",
757+ flags: { version: "string", keep: "string", without: "string" },
758+ usage: "abso export <dir> [--version <N>] [--without <version,...>] [--keep <glob>]",
540759 about:
541− "Write one published version of this folder's space (the newest unless --version) into a folder of its own, for a build that doesn't move. The folder must be empty, an earlier export (which it replaces, keeping node_modules and what --keep names), or one .avcsignore leaves out; .avcs-export.json there names the version.",
760+ "Write one pushed version of this folder's space (the newest unless --version) into a folder of its own, for a build that doesn't move. The folder must be empty, an earlier export (which it replaces, keeping node_modules and what --keep names), or one .absoignore leaves out; .avcs-export.json there names the version. --without 37,38 writes the version of shared with those earlier versions left out, and names them there too; shared doesn't change, and it is refused, naming the chain, when a version it keeps builds on one left out.",
542761 run: runExport,
543762 },
544763 files: {
Lines 768–785 at 318 (were 549–565 at 20)
549768 run: runFiles,
550769 },
551770 log: {
552− flags: { limit: "string", draft: "string", since: "string", by: "string", count: "boolean" },
771+ flags: { limit: "string", before: "string", draft: "string", since: "string", by: "string", count: "boolean" },
553772 usage:
554− "abso log [file] [-n <count>] [--draft <name>] [--since <version|30m|2h|1d|date>] [--by <agent,...>] [--count]",
773+ "abso log [file] [-n <count>] [--before <version>] [--draft <name>] [--since <version|30m|2h|1d|date>] [--by <agent,...>] [--count]",
555774 about:
556− "The published versions of this folder's space (shared or a named draft), newest first: who, when, why and which files, and for shared, whether the version passed CI's check (abso ci). With a file: only the versions that changed it. --since takes a version (the versions after it), a span back from now (30m, 2h, 1d), a clock time today (20:00) or a date and time; --by keeps one agent's versions (or several, comma-separated); --count prints versions and files per agent instead of the list.",
775+ "The pushed versions of this folder's space (shared or a named draft), newest first: who, when, why and which files, and for shared, whether the version passed CI's check (abso ci). With a file: only the versions that changed it. --before <version> starts below that version, so any stretch of history can be listed; the end of the list names the --before for the next older ones. --since takes a version (the versions after it), a span back from now (30m, 2h, 1d), a clock time today (20:00) or a date and time; --by keeps one agent's versions (or several, comma-separated); --count prints versions and files per agent instead of the list.",
557776 run: runLog,
558777 },
559778 show: {
560− flags: { draft: "string" },
561− usage: "abso show <version> | abso show <version>:<file> [--draft <name>]",
562− about: "One version: who published it, why, and its diff. With :<file>, that file's text as it was then.",
779+ flags: { draft: "string", without: "string" },
780+ usage: "abso show <version> | abso show <version>:<file> [--draft <name>] [--without <version,...>]",
781+ about:
782+ "One version: who pushed it, why, and its diff. With :<file>, that file's text as it was then. --without 37,38 shows the version of shared with those earlier versions left out: what differs, and with :<file> that file. Shared doesn't change. Refused, naming the chain, when a version it keeps builds on one left out.",
563783 run: runShow,
564784 },
565785 announce: {
Lines 793–806 at 318 (were 573–586 at 20)
573793 flags: { done: "boolean", issue: "string" },
574794 usage: 'abso start "<what>" [files...] [--issue <n>] | abso start --done',
575795 about:
576− "Say what you are starting on, before your first edit, so abso where shows it to everyone. Names who already has unpublished changes in those files, and tells them. Nothing is locked; publishing ends the note.",
796+ "Say what you are starting on, before your first edit, so abso where shows it to everyone. Names who already has unpushed changes in those files, and tells them. Nothing is locked; pushing ends the note.",
577797 run: runStart,
578798 },
579799 news: {
580− flags: {},
581− usage: "abso news",
800+ flags: { stream: "boolean", follow: "boolean" },
801+ usage: "abso news [--stream | --follow]",
582802 about:
583− "The news waiting for you: collisions, changed definitions, moved lines and announcements. Each item comes once.",
803+ "The news waiting for you: collisions, changed definitions, moved lines and announcements. Each item comes once. --stream prints a Monitor call that wakes a Claude Code chat the moment news arrives (a ticket that opens the stream once, within a minute); --follow holds the stream itself and prints a line per item until stopped.",
584804 run: runNews,
585805 },
586806 "fix-eol": {
Lines 814–847 at 318 (were 594–627 at 20)
594814 flags: {},
595815 usage: "abso who <file...>",
596816 about:
597− "For each file: who last changed it, who has unpublished changes in it (and where), and whose abso start note names it. Ask before you start in someone's file.",
817+ "For each file: who last changed it, who has unpushed changes in it (and where), and whose abso start note names it. Ask before you start in someone's file.",
598818 run: runWho,
599819 },
600820 where: {
601821 flags: {},
602822 usage: "abso where",
603− about: "Who is working where: each file with unpublished changes, whose they are, and which lines.",
823+ about: "Who is working where: each file with unpushed changes, whose they are, and which lines.",
604824 run: runWhere,
605825 },
606826 blame: {
607827 flags: { from: "string", to: "string", version: "string", draft: "string", mine: "boolean" },
608828 usage: "abso blame <file> [--from <n>] [--to <n>] [--version <n>] [--draft <name> | --mine]",
609829 about:
610− "Who wrote each line of the file as shared has it (or had it at --version), and the publish that brought it in. --draft reads a named draft; --mine reads your own view, marking your unpublished lines with *.",
830+ "Who wrote each line of the file as shared has it (or had it at --version), and the push that brought it in. --draft reads a named draft; --mine reads your own view, marking your unpushed lines with *.",
611831 run: runBlame,
612832 },
613833 why: {
614− flags: { draft: "string", mine: "boolean" },
615− usage: "abso why <file>:<line> [--draft <name> | --mine]",
834+ flags: { draft: "string", mine: "boolean", at: "string", all: "boolean" },
835+ usage: "abso why <file>:<line> [--at <version>] [--all] [--draft <name> | --mine]",
616836 about:
617− "Why one line of shared (or of a named draft, or your own view) is the way it is: its change, its publish, its reasons, and any collision it settled.",
837+ "Why one line of shared (or of a named draft, or your own view) is the way it is: the newest change to what it does, its push, its reasons, any collision it settled, and the line's earlier changes, newest first. Changes that only touched formatting (whitespace, line wrapping, quotes, trailing commas) are skipped, and why says which; --all shows them too. A line imported from git names its commit, and #N in it names the old repository's issue when abso.json's \"gitIssues\" says where those are. --at <version> reads the line as shared (or the draft) had it then, as blame --version does.",
618838 run: runWhy,
619839 },
620840 drop: {
621841 flags: { message: "string", "with-dependents": "boolean" },
622842 usage: 'abso drop <version...> -m "<why>" [--with-dependents]',
623843 about:
624− "Take published versions back out of shared, as a new version: like git revert. History keeps them. Refused when later versions build on them, unless --with-dependents drops those too.",
844+ "Take pushed versions back out of shared, as a new version: like git revert. History keeps them. Refused when later versions build on them, unless --with-dependents drops those too.",
625845 run: runDrop,
626846 },
627847 pluck: {
Lines 855–861 at 318 (were 635–641 at 20)
635855 flags: { message: "string" },
636856 usage: 'abso amend -m "<new message>"',
637857 about:
638− "Correct the message of your newest publish in this space. Only the message changes; the log keeps the original.",
858+ "Correct the message of your newest push in this space. Only the message changes; the log keeps the original.",
639859 run: runAmend,
640860 },
641861 label: {
Lines 875–896 at 318 (were 655–676 at 20)
655875 flags: { none: "boolean" },
656876 usage: "abso follow <label> | abso follow --none",
657877 about:
658− "Make this folder follow a label: every sync takes it to the newest version of shared with that label, not the newest version. --none goes back to following shared.",
878+ "Make this folder follow a label: every pull takes it to the newest version of shared with that label, not the newest version. --none goes back to following shared.",
659879 run: runFollow,
660880 },
661881 "check-ignore": {
662882 flags: {},
663883 usage: "abso check-ignore <path...>",
664884 about:
665− "Whether abso leaves each path out, and which line of which ignore file decided (git's rules, for .gitignore and .avcsignore).",
885+ "Whether abso leaves each path out, and which line of which ignore file decided (git's rules, for .gitignore and .absoignore).",
666886 run: runCheckIgnore,
667887 },
668888 pipeline: {
669− flags: { on: "string", space: "string", pipeline: "string", every: "string" },
889+ flags: { on: "string", space: "string", pipeline: "string", every: "string", log: "string" },
670890 usage:
671− "abso pipeline check [file] [--on publish|draft|green|land|hand|schedule [--space <name>] [--pipeline <name>] [--every <when>]]",
891+ "abso pipeline check [file] [--on push|draft|green|land|hand|schedule [--space <name>] [--pipeline <name>] [--every <when>]] | abso pipeline runs [<run>] [--log <pipeline.job>]",
672892 about:
673− "Read the folder's pipeline file (abso.yml, abso.yaml or avcs.json, or the file named) and say what's wrong with it, place by place: a cycle in needs, a job that doesn't exist, secrets a draft could reach, a key it doesn't know. Exits 1 when it has problems. With --on, it says which pipelines that event starts (in shared, or --space), with their jobs in waves that can run side by side, and why each other pipeline doesn't start. It reads only the file.",
893+ "Read the folder's pipeline file (abso.yml, abso.yaml or abso.json, or the file named) and say what's wrong with it, place by place: a cycle in needs, a job that doesn't exist, secrets a draft could reach, a key it doesn't know. Exits 1 when it has problems. With --on, it says which pipelines that event starts (in shared, or --space), with their jobs in waves that can run side by side, and why each other pipeline doesn't start. It reads only the file. abso pipeline runs asks the server what the project's pipelines did: the runs, newest first; with a run's number, its jobs (state, why, exit, time, an npm or deploy job's phase); with --log <pipeline.job>, that job's output.",
674894 // Loaded only here, so the yaml package it needs can't stop every other command
675895 // when a checkout lacks it (abso issue 168).
676896 run: async (args, env) => {
Lines 909–980 at 318 (were 689–710 at 20)
689909 },
690910};
691911
692−function help(): string {
912+const HELP_INTRO = "abso: version control for agents. This is its command-line client.";
913+const HELP_NOTE =
914+ "Every command takes --json. Settings live in .abso/config.json (.avcs/config.json in a folder from before the rename). A folder with a key signs in with that key and nothing else. Without one, the token comes from ABSO_TOKEN; this machine's ~/.abso/token (or ~/.avcs/token from before) is used only by a command given --token-file. " +
915+ "Every command that talks to a server takes --server <url>; one that works only on this machine (skill, check-ignore, pause, resume, fix-eol) doesn't. In a joined folder --server must be the folder's own server: another is refused, never swapped in. An explicit --server is used as given, and no setting redirects it. The server is " +
916+ SERVER_ORDER +
917+ ": which servers this box is signed in to plays no part.";
919+/** A command's flags: its own, and --server and --token-file for every command that talks to a server (server-choice.ts). */
920+function flagsOf(name: string, def: CommandDef): FlagSpec {
921+ return serverUse(name) === "local" ? def.flags : { ...def.flags, server: "string", "token-file": "boolean" };
922+}
924+/** Every command as help shows it, in order: the table's, then the three it doesn't hold. */
925+function helpEntries(): { name: string; usage: string; about: string; flags: FlagSpec; server?: string }[] {
693926 return [
694− "abso: version control for agents. This is its command-line client.",
695− "",
696− ...Object.values(COMMANDS).flatMap((c) => [` ${c.usage}`, ` ${c.about}`]),
697− " abso hook",
698− " The Claude Code PostToolUse hook. Reads the hook JSON on stdin; never fails.",
699− " abso mcp",
700− " An MCP server on stdin and stdout: the reading commands and the everyday writing ones as tools, answering with the same text as here. Add it with claude mcp add abso -- node <repo>/client/abso.ts mcp.",
701− " abso --version",
702− " This client's version and commit, and the abso mods installed on this machine.",
703− "",
704− "Every command takes --json. Settings live in .abso/config.json (.avcs/config.json in a folder from before the rename). The token comes from AVCS_TOKEN, or else ~/.abso/token (or ~/.avcs/token from before).",
705− ].join("\n");
927+ ...Object.entries(COMMANDS).map(([name, c]) => {
928+ const server = serverHelp(name);
929+ return { name, usage: c.usage, about: c.about, flags: flagsOf(name, c), ...(server ? { server } : {}) };
930+ }),
931+ {
932+ name: "hook",
933+ usage: "abso hook",
934+ about: "The Claude Code PostToolUse hook. Reads the hook JSON on stdin; never fails.",
935+ flags: {},
936+ },
937+ {
938+ name: "mcp",
939+ usage: "abso mcp",
940+ about:
941+ "An MCP server on stdin and stdout: the reading commands and the everyday writing ones as tools, answering with the same text as here. Add it with claude mcp add abso -- abso mcp (on Windows, claude mcp add abso -- cmd /c abso mcp).",
942+ flags: {},
943+ },
944+ {
945+ name: "--version",
946+ usage: "abso --version",
947+ about: "This client's version and commit, and the abso mods installed on this machine.",
948+ flags: {},
949+ },
950+ ];
706951}
707952
953+function help(): string {
954+ const entries = helpEntries().flatMap((c) => [
955+ ` ${c.usage}`,
956+ ` ${c.about}`,
957+ ...(c.server ? [` ${c.server}`] : []),
958+ ]);
959+ return [HELP_INTRO, "", ...entries, "", HELP_NOTE].join("\n");
960+}
962+/**
963+ * help --json: the same entries as data, for a command reference built from the client itself. A flag is
964+ * "string" (takes a value), "boolean" (stands alone) or "optional" (a value that may be left off); every
965+ * command also takes --json and --help.
966+ */
967+function helpJson(): Record<string, unknown> {
968+ return {
969+ ok: true,
970+ command: "help",
971+ version: clientVersion(),
972+ intro: HELP_INTRO,
973+ note: HELP_NOTE,
974+ commands: helpEntries(),
975+ };
976+}
708978export interface MainResult {
709979 readonly stdout: string;
710980 readonly stderr: string;
Lines 987–1057 at 318 (were 717–747 at 20)
717987export function commandTable(): Readonly<
718988 Record<string, { readonly flags: FlagSpec; readonly usage: string; readonly about: string }>
719989> {
720− return COMMANDS;
990+ return Object.fromEntries(Object.entries(COMMANDS).map(([name, c]) => [name, { ...c, flags: flagsOf(name, c) }]));
721991}
722992
723993function newsBlock(news: readonly string[]): string[] {
724− return news.length === 0 ? [] : ["News:", ...news.map((n) => ` ${n}`)];
994+ return newsBlockLines(news.map((n) => newsShown(n)));
725995}
726996
997+/** Whether this folder's calls carry a key or token, for how a refusal is worded. False when that can't be told. */
998+function credentialSent(env: Env, tokenFileAsked: boolean): string | undefined {
999+ try {
1000+ const root = findRoot(env.cwd);
1001+ if (root && readConfig(root, env.env, tokenFileAsked).token === undefined) return undefined;
1002+ if (root && existsSync(join(stateDir(root), "key"))) return "this folder's key";
1003+ if (fromEnv(env.env, "TOKEN")?.trim()) return "ABSO_TOKEN";
1004+ if (root && runKey(env.env)) return "this pipeline run's key";
1005+ return tokenFileAsked && tokenFile() !== undefined ? "the token file, ~/.abso/token" : undefined;
1006+ } catch {
1007+ return undefined;
1008+ }
1011+/** git's forms of push and pull that abso doesn't have (#427): one plain line naming the abso way. */
1012+function gitOnlyForm(command: string, words: readonly string[]): string | undefined {
1013+ const has = (...forms: string[]) => words.some((w) => forms.some((f) => w === f || w.startsWith(`${f}=`)));
1014+ if (command === "push" && has("-f", "--force", "--force-with-lease", "--force-if-includes"))
1015+ return "abso push has no --force: nothing overwrites shared. When a push is refused, abso pull brings in the other side and abso settle keeps yours, theirs or both.";
1016+ if (command === "push" && has("-u", "--set-upstream", "--all", "--tags"))
1017+ return "abso push has no upstreams, branches or tags: it adds your draft to shared. A named draft is abso switch <name>; a label is abso label.";
1018+ if (command === "pull" && has("--rebase", "-r", "--no-rebase", "--ff-only", "--ff", "--no-ff", "--squash"))
1019+ return "abso pull has no --rebase or merge modes: it always brings shared under your draft, and lines changed on both sides are listed for abso settle.";
1020+ return undefined;
7271023export async function main(argv: readonly string[], env: Env): Promise<MainResult> {
1024+ try {
1025+ return await runMain(argv, env);
1026+ } finally {
1027+ // A local project's store stays open only while its command runs.
1028+ closeLocalStores();
1029+ }
1032+async function runMain(argv: readonly string[], env: Env): Promise<MainResult> {
7281033 const command = argv[0];
7291034 const json = argv.includes("--json") && command !== "run" && command !== "logs";
1035+ const asked = argv.includes("--token-file");
7301036 if (command === undefined || command === "help" || command === "--help" || command === "-h") {
1037+ if (json) {
1038+ const data = helpJson();
1039+ return { stdout: `${JSON.stringify(data, null, 2)}\n`, stderr: "", exit: EXIT.ok, data };
1040+ }
7311041 return { stdout: `${help()}\n`, stderr: "", exit: EXIT.ok };
7321042 }
7331043 try {
7341044 if (command === "--version") {
7351045 // Loaded only here: it runs git, and no other command needs it.
7361046 const { versionReport } = await import("./install.ts");
737− const { newerCommitNote } = await import("./client-version.ts");
1047+ const { newerClientNote } = await import("./client-version.ts");
7381048 const report = versionReport(env.env);
7391049 const root = findRoot(env.cwd);
7401050 let behind: string | undefined;
7411051 if (root) {
7421052 try {
7431053 const server = (JSON.parse(readFileSync(configPath(root), "utf8")) as { server?: string }).server;
744− if (server) behind = await newerCommitNote(server);
1054+ if (server) behind = await newerClientNote(server);
7451055 } catch {}
7461056 }
7471057 return {
Lines 1065–1107 at 318 (were 755–770 at 20)
7551065 const def = COMMANDS[command];
7561066 if (!def)
7571067 throw new UsageError(
758− `unknown command ${JSON.stringify(command)}; the commands are ${Object.keys(COMMANDS).join(", ")}, hook`,
1068+ `unknown command ${JSON.stringify(command)}; the commands are ${Object.keys(COMMANDS).join(", ")}, hook, mcp`,
7591069 );
760− const parsed = parseArgs(command, argv.slice(1), withBodyFiles(command, def.flags), def.rest);
1070+ const gitOnly = gitOnlyForm(command, argv.slice(1));
1071+ if (gitOnly) throw new UsageError(gitOnly);
1072+ const use = serverUse(command);
1073+ const words = argv.includes("--") ? argv.slice(1, argv.indexOf("--")) : argv.slice(1);
1074+ if (use === "local" && words.some((w) => w === "--server" || w.startsWith("--server=")))
1075+ throw new UsageError(localRefusal(command));
1076+ const parsed = parseArgs(command, argv.slice(1), withBodyFiles(command, flagsOf(command, def)), def.rest);
1077+ if ((command === "push" || command === "pull") && parsed.positionals.length > 0)
1078+ throw new UsageError(
1079+ `abso ${command} takes no remote or branch: it ${command === "push" ? "adds your draft to shared" : "brings shared into this folder"}. A named draft is abso switch <name>.`,
1080+ );
7611081 if (bool(parsed, "help")) {
7621082 const files = bodyFilesHelp(command, def.flags);
763− return { stdout: `${def.usage}\n ${def.about}\n${files ? ` ${files}\n` : ""}`, stderr: "", exit: EXIT.ok };
1083+ const server = serverHelp(command);
1084+ return {
1085+ stdout: `${def.usage}\n ${def.about}\n${server ? ` ${server}\n` : ""}${files ? ` ${files}\n` : ""}`,
1086+ stderr: "",
1087+ exit: EXIT.ok,
1088+ };
7641089 }
1090+ // --server is checked before anything is read or sent: a bad value, or (for a command on a joined folder)
1091+ // a server that isn't the folder's own, is refused here.
1092+ const named = use === "local" ? undefined : serverFlag(parsed);
1093+ if (named !== undefined && use === "folder") checkFolderServer(command, named, env.cwd);
1094+ // A folder that reads signed out runs its reads and nothing else, refused before any call.
1095+ const root = findRoot(env.cwd);
1096+ if (root !== undefined && isVisitor(root)) checkVisitor(command, parsed, readConfig(root, env.env).project);
7651097 const args = readBodyFiles(command, parsed, env.cwd, env.readStdin);
7661098 takeNews(); // what an earlier call in this process left (tests run many)
767− const out = await def.run(args, env);
1099+ const runEnv: Env = {
1100+ ...env,
1101+ ...(named === undefined ? {} : { server: named }),
1102+ ...(bool(parsed, "token-file") ? { tokenFile: true } : {}),
1103+ };
1104+ const out = await def.run(args, runEnv);
7681105 const exit = out.exit ?? EXIT.ok;
7691106 // Every command that took news while recording prints it (#37, News Report).
7701107 const news = takeNews();
Lines 1112–1118 at 318 (were 775–781 at 20)
7751112 ...(news.length > 0 && !("news" in out.json) ? { news } : {}),
7761113 };
7771114 if (json || bool(args, "json")) return { stdout: `${JSON.stringify(data, null, 2)}\n`, stderr: "", exit, data };
778− // run, logs and bisect: stdout is the box command's, and may be piped; news goes to stderr there (#37, Builder 3).
1115+ // run, logs and bisect: stdout is the box command's, and may be piped; news goes to stderr there (#37).
7791116 const boxOut = command === "run" || command === "logs" || command === "bisect";
7801117 const text = [...(out.text === "" ? [] : [out.text.replace(/\n$/, "")]), ...(boxOut ? [] : newsBlock(news))].join(
7811118 "\n",
Lines 1123–1132 at 318 (were 786–792 at 20)
7861123 const e = err as Error;
7871124 const code = err instanceof UsageError ? "usage" : err instanceof ApiError ? "server" : "error";
7881125 const message =
789− err instanceof UsageError || err instanceof ApiError ? e.message : `${e.message}${e.stack ? `\n${e.stack}` : ""}`;
1126+ plainError(err, credentialSent(env, asked), !asked && tokenFile() !== undefined) ??
1127+ (err instanceof UsageError || err instanceof ApiError
1128+ ? e.message
1129+ : `${e.message}${e.stack ? `\n${e.stack}` : ""}`);
7901130 // The server refusing (409) is like a collision: exit 2, not a failure.
7911131 const exit = err instanceof ApiError && err.status === 409 ? EXIT.refused : EXIT.error;
7921132 // News taken before the failure still shows.
Lines 1141–1194 at 318 (were 801–803 at 20)
8011141 };
8021142 }
8031143}
1145+/**
1146+ * abso 684: in an agent's folder on this same server, the ask `abso login` makes of a person in that project, so nobody
1147+ * relays the code. The folder's agent key proves the agent; the device code proves the sign-in is this client's own.
1148+ * Null outside such a folder, or when nobody could be asked: login then shows the code alone.
1149+ */
1150+function loginAsk(server: string, env: Env): NonNullable<Parameters<typeof login>[1]["ask"]> | undefined {
1151+ const root = findRoot(env.cwd);
1152+ if (root === undefined || isVisitor(root)) return undefined;
1153+ const config = readConfig(root, env.env);
1154+ if (config.token === undefined || originOf(config.server) !== originOf(server)) return undefined;
1155+ return async ({ device, user }) => {
1156+ const asked = await fetch(`${originOf(server)}/login/ask`, {
1157+ method: "POST",
1158+ headers: { "content-type": "application/json", authorization: `Bearer ${config.token}` },
1159+ body: JSON.stringify({ project: config.project, agent: config.agent, device_code: device, user_code: user }),
1160+ });
1161+ const body = (await asked.json().catch(() => ({}))) as {
1162+ error?: string;
1163+ people?: string[];
1164+ expires_at?: string;
1165+ request_url?: string;
1166+ role?: string;
1167+ };
1168+ if (!asked.ok || !Array.isArray(body.people) || typeof body.request_url !== "string")
1169+ throw new Error(body.error ?? `the server answered ${asked.status}`);
1170+ const expiresAt = Date.parse(body.expires_at ?? "");
1171+ const { api } = openIssues(env);
1172+ const when = new Intl.DateTimeFormat("en-US", { timeZone: "America/Chicago", hour: "numeric", minute: "2-digit" });
1173+ const question = `Please sign in my box "${boxName()}" for ${config.project}, as at most ${body.role}. It expires at ${when.format(new Date(expiresAt))} CT. Approve or deny: ${body.request_url}`;
1174+ const asks: number[] = [];
1175+ for (const of of body.people) asks.push((await api.ask({ of, question })).id);
1176+ const first = asks[0];
1177+ if (first !== undefined)
1178+ await fetch(`${originOf(server)}/login/ask/link`, {
1179+ method: "POST",
1180+ headers: { "content-type": "application/json" },
1181+ body: JSON.stringify({ device_code: device, ask: first }),
1182+ });
1183+ return {
1184+ project: config.project,
1185+ who: body.people.length === 1 ? "the person who approved this agent's box" : `the owners of ${config.project}`,
1186+ asks,
1187+ expiresAt,
1188+ role: body.role ?? "writer",
1189+ withdraw: async () => {
1190+ for (const id of asks) await api.withdraw(id, { note: "The sign-in ran out; nothing was granted." });
1191+ },
1192+ };
1193+ };
MCP
compare on this site's /mcp
CLI
abso diff 20 318 client/src/main.ts --json
JSON
/christopher/abso-core/compare/20..318?file=client%2Fsrc%2Fmain.ts&format=json