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 124 to 318

Compare

+277 −71 in 30 places
Lines 1–14 at 318 (were 1–13 at 124)
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, loginRequest, 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";
Lines 38–85 at 318 (were 37–59 at 124)
3738 runSync,
3839 takeNews,
3940} from "./commands.ts";
40−import { configPath, findRoot, installKey, isVisitor, readConfig, readToken } from "./config.ts";
41−import { newsBlockLines, newsShown, TOKEN_SERVERS } from "./core.ts";
42−import { checkServer, doctor, doctorText, plainError, realProbe, whoami } from "./doctor.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";
4344import { runDraftSync, runLand, runSwitch } from "./drafts.ts";
45+import { fromEnv } from "./env-names.ts";
4446import { runExport } from "./export.ts";
47+import { runFlag } from "./flag-commands.ts";
48+import { runGroup, runGroups } from "./group-commands.ts";
4549import { runBlame, runWhere, runWho, runWhy } from "./history.ts";
46−import { runAck, runAnswer, runAsk, runIssue, runIssues, runReply, runSearch, runWaiting } from "./issues.ts";
47−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";
4863import { browserSkip, openInBrowser } from "./open-browser.ts";
49−import { initInOrg, runOrg, runOrgs } from "./orgs.ts";
64+import { runOrg, runOrgs } from "./orgs.ts";
5065import { runUnqueue } from "./queue.ts";
5166import { 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";
5276import { installSkill, SKILL, skillPath } from "./skill.ts";
77+import { stateDir } from "./state-dir.ts";
5378import { colorsPass, terminalText } from "./terminal-text.ts";
5479import { runAmend, runDrop, runFollow, runLabel, runLabels, runPluck } from "./versions.ts";
5580import { runVisibility } from "./visibility-commands.ts";
5681import { checkVisitor } from "./visitor.ts";
82+import { handoffText, patFromFile, webLogin } from "./web-session.ts";
5783
5884interface CommandDef {
5985 readonly flags: FlagSpec;
Lines 90–98 at 318 (were 64–76 at 124)
6490 readonly run: (args: Parsed, env: Env) => Promise<Output>;
6591}
6692
67−/** The server login, box and logout act on: --server, the folder's, or outside a folder abso.dev's (TOKEN_SERVERS[0]). */
68−export function boxServer(args: Parsed, env: Pick<Env, "cwd">): string {
69− const flag = str(args, "server");
70− if (flag) return flag;
71− const root = findRoot(env.cwd);
72− if (!root) return TOKEN_SERVERS[0]!;
73− 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);
7496}
7597
7698async function runKeyInstall(args: Parsed, env: Env): Promise<Output> {
Lines 114–136 at 318 (were 92–105 at 124)
92114
93115const COMMANDS: Readonly<Record<string, CommandDef>> = {
94116 init: {
95− flags: { server: "string", project: "string", agent: "string", "as-is": "boolean", org: "string" },
96− usage: "abso init [folder] [--server <url>] --project <name> --agent <name> [--as-is] [--org <org>]",
97− about:
98− "Create a project on the server from a folder's text files (the server is chosen as abso join chooses it). The folder becomes that agent's folder. It writes a starting .absoignore, 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). --org <org> makes it an organization's project: for now that is done on the website, and abso says where.",
99− run: (args, env) => {
100− const org = str(args, "org");
101− return org === undefined ? runInit(args, env) : initInOrg(org, boxServer(args, env));
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",
102128 },
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]",
131+ about:
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),
103134 },
104135 key: {
105136 flags: {
Lines 145–151 at 318 (were 114–120 at 124)
114145 usage:
115146 "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>]",
116147 about:
117− "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.",
118149 run: async (args, env) => {
119150 const sub = args.positionals[0];
120151 if (sub === "install" && args.positionals.length === 1) return runKeyInstall(args, env);
Lines 154–171 at 318 (were 123–139 at 124)
123154 if (!root) throw new UsageError("abso key runs inside an agent's folder, or takes --server <url>");
124155 let config: ReturnType<typeof readConfig>;
125156 try {
126− config = readConfig(root, env.env);
157+ config = readConfig(root, env.env, env.tokenFile === true);
127158 } catch {
128159 config = {
129160 server: serverFlag ?? "",
130161 project: str(args, "project") ?? "",
131162 agent: "admin",
132− token: readToken(env.env),
163+ token: fromEnv(env.env, "TOKEN")?.trim() || (env.tokenFile ? tokenFile() : undefined),
133164 };
134165 }
135166 if (serverFlag) config = { ...config, server: serverFlag };
136167 const admin = adminToken(env.env);
168+ (env.writeErr ?? env.write)(`${adminTokenWords(env.env)}\n`);
137169 if (sub === "new" && args.positionals.length === 2) {
138170 const server = str(args, "server") ?? config.server;
139171 const project = str(args, "project") ?? config.project;
Lines 209–250 at 318 (were 177–198 at 124)
177209 flags: {
178210 server: "string",
179211 "no-browser": "boolean",
212+ "no-ask": "boolean",
180213 projects: "string",
181214 role: "string",
182− "max-agents": "string",
183215 days: "string",
216+ web: "boolean",
217+ site: "string",
218+ "pat-file": "string",
184219 },
185220 usage:
186− "abso login [--server <url>] [--no-browser] [--projects <name,name>] [--role <reader|writer|owner>] [--max-agents <1-50>] [--days <1-90>]",
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>]]",
187222 about:
188− "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 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, or https://api.abso.dev outside a folder. No browser opens with --no-browser or ABSO_NO_BROWSER, over SSH, under CI, or on Linux without a display.",
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).",
189224 run: async (args, env) => {
190225 const server = boxServer(args, env);
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+ }
191242 const open =
192243 bool(args, "no-browser") || browserSkip(env.env, process.platform) !== null
193244 ? undefined
194245 : (url: string) => openInBrowser(url);
195246 const record = await login(server, {
247+ ask: bool(args, "no-ask") ? undefined : loginAsk(server, env),
196248 request: loginRequest(args),
197249 say: (line) => process.stderr.write(terminalText(`${line}\n`, colorsPass(process.stderr, env.env))),
198250 open,
Lines 257–263 at 318 (were 205–211 at 124)
205257 },
206258 box: {
207259 flags: { server: "string" },
208− usage: "abso box [--server <url>]",
260+ usage: "abso box",
209261 about:
210262 "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.",
211263 run: async (args, env) => {
Lines 268–295 at 318 (were 216–243 at 124)
216268 },
217269 whoami: {
218270 flags: { server: "string" },
219− usage: "abso whoami [--server <url>]",
271+ usage: "abso whoami",
220272 about:
221− "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. The server is --server, else ABSO_SERVER, else this folder's, else the one this box signed in to with abso login, else https://api.abso.dev.",
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.",
222274 run: async (args, env) => {
223− const out = await whoami(checkServer(str(args, "server"), env.cwd, env.env), env.cwd, env.env, realProbe());
275+ const out = await whoami(boxServer(args, env), env.cwd, env.env, realProbe());
224276 return { text: out.text, json: out.json };
225277 },
226278 },
227279 doctor: {
228280 flags: { server: "string" },
229− usage: "abso doctor [--server <url>]",
281+ usage: "abso doctor",
230282 about:
231− "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. It picks the server as whoami does.",
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.",
232284 run: async (args, env) => {
233− const checks = await doctor(checkServer(str(args, "server"), env.cwd, env.env), env.cwd, env.env, realProbe());
285+ const checks = await doctor(boxServer(args, env), env.cwd, env.env, realProbe());
234286 const failed = checks.some((c) => c.result === "fail");
235287 return { text: doctorText(checks), json: { checks }, ...(failed ? { exit: EXIT.error } : {}) };
236288 },
237289 },
238290 logout: {
239291 flags: { server: "string" },
240− usage: "abso logout [--server <url>]",
292+ usage: "abso logout",
241293 about:
242294 "End this box's sign-in on the server and forget it here. Keys its agents already have stop working with it.",
243295 run: async (args, env) => {
Lines 307–313 at 318 (were 255–261 at 124)
255307 },
256308 orgs: {
257309 flags: { server: "string" },
258− usage: "abso orgs [--server <url>]",
310+ usage: "abso orgs",
259311 about:
260312 "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).",
261313 run: (args, env) => runOrgs(boxServer(args, env)),
Lines 327–333 at 318 (were 275–281 at 124)
275327 usage:
276328 "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>]",
277329 about:
278− "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. Changes and abso org new are made on the website for now, and abso says where.",
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.",
279331 run: (args, env) => runOrg(args, boxServer(args, env)),
280332 },
281333 skill: {
Lines 350–368 at 318 (were 298–307 at 124)
298350 },
299351 },
300352 join: {
301− flags: { server: "string", agent: "string", dir: "string", reader: "boolean" },
302− usage: "abso join <project> [--agent <name>] [--dir <folder>] [--server <url>] [--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>]",
303364 about:
304− "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. The server is --server, else ABSO_SERVER, else the one this box signed in to with abso login, else https://api.abso.dev. --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.",
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.",
305366 run: runJoin,
306367 },
307368 record: {
Lines 385–391 at 318 (were 324–330 at 124)
324385 },
325386 usage: 'abso push -m "<why>" [--as-is] [--check ["<command>"]] [--wait <seconds> | --no-wait] [--done]',
326387 about:
327− '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 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 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.',
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.',
328389 run: runPublish,
329390 },
330391 bisect: {
Lines 433–439 at 318 (were 372–378 at 124)
372433 usage:
373434 'abso run [--detach] [--replace] [--fresh] [--box <name>] [--at <version> [--files <glob>]] <command...> | abso run ... -- <program> <arg...> | abso run --parallel "<command>" "<command>"...',
374435 about:
375− "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.",
376437 rest: true,
377438 run: runRun,
378439 },
Lines 584–620 at 318 (were 523–528 at 124)
523584 '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.',
524585 run: runReply,
525586 },
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+ },
526618 unqueue: {
527619 flags: {},
528620 usage: "abso unqueue",
Lines 629–654 at 318 (were 537–547 at 124)
537629 "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).",
538630 run: runVisibility,
539631 },
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+ },
540647 ci: {
541648 flags: { version: "string", revoke: "boolean" },
542649 usage: "abso ci [<version>] | abso ci --revoke",
543650 about:
544− "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.",
545652 run: runCi,
546653 },
547654 shot: {
Lines 674–680 at 318 (were 567–573 at 124)
567674 usage:
568675 '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>]',
569676 about:
570− "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.",
571678 run: runShot,
572679 },
573680 prep: {
Lines 754–763 at 318 (were 647–656 at 124)
647754 run: runRestore,
648755 },
649756 export: {
650− flags: { version: "string", keep: "string" },
651− 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>]",
652759 about:
653− "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.",
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.",
654761 run: runExport,
655762 },
656763 files: {
Lines 776–785 at 318 (were 669–677 at 124)
669776 run: runLog,
670777 },
671778 show: {
672− flags: { draft: "string" },
673− usage: "abso show <version> | abso show <version>:<file> [--draft <name>]",
674− about: "One version: who pushed 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.",
675783 run: runShow,
676784 },
677785 announce: {
Lines 797–806 at 318 (were 689–698 at 124)
689797 run: runStart,
690798 },
691799 news: {
692− flags: {},
693− usage: "abso news",
800+ flags: { stream: "boolean", follow: "boolean" },
801+ usage: "abso news [--stream | --follow]",
694802 about:
695− "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.",
696804 run: runNews,
697805 },
698806 "fix-eol": {
Lines 831–840 at 318 (were 723–732 at 124)
723831 run: runBlame,
724832 },
725833 why: {
726− flags: { draft: "string", mine: "boolean" },
727− 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]",
728836 about:
729− "Why one line of shared (or of a named draft, or your own view) is the way it is: its change, its push, 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.",
730838 run: runWhy,
731839 },
732840 drop: {
Lines 890–896 at 318 (were 782–788 at 124)
782890 usage:
783891 "abso pipeline check [file] [--on push|draft|green|land|hand|schedule [--space <name>] [--pipeline <name>] [--every <when>]] | abso pipeline runs [<run>] [--log <pipeline.job>]",
784892 about:
785− "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. 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.",
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.",
786894 // Loaded only here, so the yaml package it needs can't stop every other command
787895 // when a checkout lacks it (abso issue 168).
788896 run: async (args, env) => {
Lines 911–933 at 318 (were 803–814 at 124)
803911
804912const HELP_INTRO = "abso: version control for agents. This is its command-line client.";
805913const HELP_NOTE =
806− "Every command takes --json. Settings live in .abso/config.json (.avcs/config.json in a folder from before the rename). The token comes from ABSO_TOKEN, or else ~/.abso/token (or ~/.avcs/token from before).";
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.";
807918
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+}
808924/** Every command as help shows it, in order: the table's, then the three it doesn't hold. */
809−function helpEntries(): { name: string; usage: string; about: string; flags: FlagSpec }[] {
925+function helpEntries(): { name: string; usage: string; about: string; flags: FlagSpec; server?: string }[] {
810926 return [
811− ...Object.entries(COMMANDS).map(([name, c]) => ({ name, usage: c.usage, about: c.about, flags: c.flags })),
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+ }),
812931 {
813932 name: "hook",
814933 usage: "abso hook",
Lines 951–961 at 318 (were 832–838 at 124)
832951}
833952
834953function help(): string {
835− const entries = helpEntries().flatMap((c) => [` ${c.usage}`, ` ${c.about}`]);
954+ const entries = helpEntries().flatMap((c) => [
955+ ` ${c.usage}`,
956+ ` ${c.about}`,
957+ ...(c.server ? [` ${c.server}`] : []),
958+ ]);
836959 return [HELP_INTRO, "", ...entries, "", HELP_NOTE].join("\n");
837960}
838961
Lines 987–993 at 318 (were 864–870 at 124)
864987export function commandTable(): Readonly<
865988 Record<string, { readonly flags: FlagSpec; readonly usage: string; readonly about: string }>
866989> {
867− return COMMANDS;
990+ return Object.fromEntries(Object.entries(COMMANDS).map(([name, c]) => [name, { ...c, flags: flagsOf(name, c) }]));
868991}
869992
870993function newsBlock(news: readonly string[]): string[] {
Lines 995–1010 at 318 (were 872–883 at 124)
872995}
873996
874997/** Whether this folder's calls carry a key or token, for how a refusal is worded. False when that can't be told. */
875−function carriesCredential(env: Env): boolean {
998+function credentialSent(env: Env, tokenFileAsked: boolean): string | undefined {
876999 try {
8771000 const root = findRoot(env.cwd);
878− return root ? readConfig(root, env.env).token !== undefined : readToken(env.env) !== undefined;
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;
8791006 } catch {
880− return false;
1007+ return undefined;
8811008 }
8821009}
8831010
Lines 1021–1038 at 318 (were 894–901 at 124)
8941021}
8951022
8961023export 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> {
8971033 const command = argv[0];
8981034 const json = argv.includes("--json") && command !== "run" && command !== "logs";
1035+ const asked = argv.includes("--token-file");
8991036 if (command === undefined || command === "help" || command === "--help" || command === "-h") {
9001037 if (json) {
9011038 const data = helpJson();
Lines 1069–1107 at 318 (were 932–952 at 124)
9321069 );
9331070 const gitOnly = gitOnlyForm(command, argv.slice(1));
9341071 if (gitOnly) throw new UsageError(gitOnly);
935− const parsed = parseArgs(command, argv.slice(1), withBodyFiles(command, def.flags), def.rest);
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);
9361077 if ((command === "push" || command === "pull") && parsed.positionals.length > 0)
9371078 throw new UsageError(
9381079 `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>.`,
9391080 );
9401081 if (bool(parsed, "help")) {
9411082 const files = bodyFilesHelp(command, def.flags);
942− 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+ };
9431089 }
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);
9441094 // A folder that reads signed out runs its reads and nothing else, refused before any call.
9451095 const root = findRoot(env.cwd);
9461096 if (root !== undefined && isVisitor(root)) checkVisitor(command, parsed, readConfig(root, env.env).project);
9471097 const args = readBodyFiles(command, parsed, env.cwd, env.readStdin);
9481098 takeNews(); // what an earlier call in this process left (tests run many)
949− 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);
9501105 const exit = out.exit ?? EXIT.ok;
9511106 // Every command that took news while recording prints it (#37, News Report).
9521107 const news = takeNews();
Lines 1123–1129 at 318 (were 968–974 at 124)
9681123 const e = err as Error;
9691124 const code = err instanceof UsageError ? "usage" : err instanceof ApiError ? "server" : "error";
9701125 const message =
971− plainError(err, carriesCredential(env)) ??
1126+ plainError(err, credentialSent(env, asked), !asked && tokenFile() !== undefined) ??
9721127 (err instanceof UsageError || err instanceof ApiError
9731128 ? e.message
9741129 : `${e.message}${e.stack ? `\n${e.stack}` : ""}`);
Lines 1141–1194 at 318 (were 986–988 at 124)
9861141 };
9871142 }
9881143}
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 124 318 client/src/main.ts --json
JSON
/christopher/abso-core/compare/124..318?file=client%2Fsrc%2Fmain.ts&format=json