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 83 to 84

Compare

+26 −1 in 2 places
Lines 3–14 at 84 (were 3–11 at 83)
33// when one fails. Neither prints a credential. plainError words the commonest failures the same way.
44
55import { ApiError } from "./api-error.ts";
6−import { type Answer, type BoxRecord, boxGet, boxText, originOf, readBox } from "./box.ts";
6+import { UsageError } from "./args.ts";
7+import { type Answer, type BoxRecord, boxGet, boxText, originOf, readBox, signedInServers } from "./box.ts";
78import { builtCopy } from "./client-version.ts";
89import { type Config, credentialLabel, findRoot, readConfig } from "./config.ts";
10+import { TOKEN_SERVERS } from "./core.ts";
11+import { fromEnv } from "./env-names.ts";
1013/** The lowest Node major each kind of copy runs on: the npm package is built for 20, a checkout runs its .ts as is. */
1114export function nodeNeeded(built: boolean): number {
Lines 42–69 at 84 (were 39–44 at 83)
3942 }
4043}
4144
45+/**
46+ * The server whoami and doctor look at, in the order join picks one: --server, then ABSO_SERVER, then this
47+ * folder's server, then the one this box signed in to with abso login, then https://api.abso.dev. A box signed
48+ * in to more than one server has to say which.
49+ */
50+export function checkServer(
51+ flag: string | undefined,
52+ cwd: string,
53+ env: Readonly<Record<string, string | undefined>>,
54+ home?: string,
55+ now = Date.now(),
56+): string {
57+ const named = flag ?? fromEnv(env, "SERVER");
58+ if (named) return named;
59+ const folder = folderOf(cwd, env)?.config?.server;
60+ if (folder) return folder;
61+ const signedIn = signedInServers(home, now);
62+ if (signedIn.length > 1)
63+ throw new UsageError(`this box is signed in to ${signedIn.join(" and ")}: say which with --server <url>`);
64+ return signedIn[0] ?? TOKEN_SERVERS[0]!;
65+}
4267const day = (ms: number) => new Date(ms).toISOString().slice(0, 16).replace("T", " ");
4368
4469/** The server's view of this box: GET /box, as the box. */
MCP
compare on this site's /mcp
CLI
abso diff 83 84 client/src/doctor.ts --json
JSON
/christopher/abso-core/compare/83..84?file=client%2Fsrc%2Fdoctor.ts&format=json