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 155 to 156

Compare

+24 −24 in 9 places
Lines 38–45 at 156 (were 38–45 at 155)
3838 takeNews,
3939} from "./commands.ts";
4040import { 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 { newsBlockLines, newsShown } from "./core.ts";
42+import { doctor, doctorText, plainError, realProbe, whoami } from "./doctor.ts";
4343import { runDraftSync, runLand, runSwitch } from "./drafts.ts";
4444import { runExport } from "./export.ts";
4545import { runBlame, runWhere, runWho, runWhy } from "./history.ts";
Lines 49–63 at 156 (were 49–55 at 155)
4949import { initInOrg, runOrg, runOrgs } from "./orgs.ts";
5050import { runUnqueue } from "./queue.ts";
5151import { runNote, runNotes, runReview } from "./review.ts";
52−import { checkFolderServer, localRefusal, serverFlag, serverHelp, serverUse } from "./server-choice.ts";
52+import {
53+ checkFolderServer,
54+ chooseServer,
55+ localRefusal,
56+ SERVER_ORDER,
57+ serverFlag,
58+ serverHelp,
59+ serverUse,
60+} from "./server-choice.ts";
5361import { installSkill, SKILL, skillPath } from "./skill.ts";
5462import { colorsPass, terminalText } from "./terminal-text.ts";
5563import { runAmend, runDrop, runFollow, runLabel, runLabels, runPluck } from "./versions.ts";
Lines 73–81 at 156 (were 65–77 at 155)
6573 readonly run: (args: Parsed, env: Env) => Promise<Output>;
6674}
6775
68−/** The server login, box and logout act on: --server, the folder's, or outside a folder abso.dev's (TOKEN_SERVERS[0]). */
69−export function boxServer(args: Parsed, env: Pick<Env, "cwd">): string {
70− const flag = str(args, "server");
71− if (flag) return flag;
72− const root = findRoot(env.cwd);
73− if (!root) return TOKEN_SERVERS[0]!;
74− return (JSON.parse(readFileSync(configPath(root), "utf8")) as { server: string }).server;
76+/** The server login, box, logout, orgs, org, whoami and doctor act on, in the order every command picks one (server-choice.ts). */
77+export function boxServer(args: Parsed, env: Pick<Env, "cwd" | "env">): string {
78+ return chooseServer(serverFlag(args), env.cwd, env.env);
7579}
7680
7781async function runKeyInstall(args: Parsed, env: Env): Promise<Output> {
Lines 100–106 at 156 (were 96–102 at 155)
96100 flags: { server: "string", project: "string", agent: "string", "as-is": "boolean", org: "string" },
97101 usage: "abso init [folder] --project <name> --agent <name> [--as-is] [--org <org>]",
98102 about:
99− "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.",
103+ "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 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.",
100104 run: (args, env) => {
101105 const org = str(args, "org");
102106 return org === undefined ? runInit(args, env) : initInOrg(org, boxServer(args, env));
Lines 190–196 at 156 (were 186–192 at 155)
186190 usage:
187191 "abso login [--no-browser] [--projects <name,name>] [--role <reader|writer|owner>] [--max-agents <1-50>] [--days <1-90>]",
188192 about:
189− "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.",
193+ "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. No browser opens with --no-browser or ABSO_NO_BROWSER, over SSH, under CI, or on Linux without a display.",
190194 run: async (args, env) => {
191195 const server = boxServer(args, env);
192196 const open =
Lines 223–231 at 156 (were 219–227 at 155)
219223 flags: { server: "string" },
220224 usage: "abso whoami",
221225 about:
222− "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.",
226+ "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.",
223227 run: async (args, env) => {
224− const out = await whoami(checkServer(str(args, "server"), env.cwd, env.env), env.cwd, env.env, realProbe());
228+ const out = await whoami(boxServer(args, env), env.cwd, env.env, realProbe());
225229 return { text: out.text, json: out.json };
226230 },
227231 },
Lines 233–241 at 156 (were 229–243 at 155)
229233 flags: { server: "string" },
230234 usage: "abso doctor",
231235 about:
232− "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.",
236+ "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.",
233237 run: async (args, env) => {
234− const checks = await doctor(
235− checkServer(str(args, "server"), env.cwd, env.env),
236− env.cwd,
237− env.env,
238− realProbe(),
239− str(args, "server") !== undefined,
240− );
238+ const checks = await doctor(boxServer(args, env), env.cwd, env.env, realProbe());
241239 const failed = checks.some((c) => c.result === "fail");
242240 return { text: doctorText(checks), json: { checks }, ...(failed ? { exit: EXIT.error } : {}) };
243241 },
Lines 306–312 at 156 (were 308–314 at 155)
308306 flags: { server: "string", agent: "string", dir: "string", reader: "boolean" },
309307 usage: "abso join <project> [--agent <name>] [--dir <folder>] [--reader]",
310308 about:
311− "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.",
309+ "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.",
312310 run: runJoin,
313311 },
314312 record: {
Lines 809–817 at 156 (were 811–817 at 155)
811809const HELP_INTRO = "abso: version control for agents. This is its command-line client.";
812810const HELP_NOTE =
813811 "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). " +
814− "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.";
812+ "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 " +
813+ SERVER_ORDER +
814+ ": which servers this box is signed in to plays no part.";
815815
816816/** A command's flags: its own, and --server for every command that talks to a server (server-choice.ts). */
817817function flagsOf(name: string, def: CommandDef): FlagSpec {
MCP
compare on this site's /mcp
CLI
abso diff 155 156 client/src/main.ts --json
JSON
/christopher/abso-core/compare/155..156?file=client%2Fsrc%2Fmain.ts&format=json