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 75 to 76

Compare

+36 −1 in 4 places
Lines 38–44 at 76 (were 38–43 at 75)
3838} from "./commands.ts";
3939import { configPath, findRoot, installKey, readConfig, readToken } from "./config.ts";
4040import { newsBlockLines, newsShown, TOKEN_SERVERS } from "./core.ts";
41+import { doctor, doctorText, plainError, realProbe, whoami } from "./doctor.ts";
4142import { runDraftSync, runLand, runSwitch } from "./drafts.ts";
4243import { runExport } from "./export.ts";
4344import { runBlame, runWhere, runWho, runWhy } from "./history.ts";
Lines 203–229 at 76 (were 202–207 at 75)
202203 return { text: boxText(record, server), json: { box: boxPublic(record) } };
203204 },
204205 },
206+ whoami: {
207+ flags: { server: "string" },
208+ usage: "abso whoami [--server <url>]",
209+ about:
210+ "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.",
211+ run: async (args, env) => {
212+ const out = await whoami(boxServer(args, env), env.cwd, env.env, realProbe());
213+ return { text: out.text, json: out.json };
214+ },
215+ },
216+ doctor: {
217+ flags: { server: "string" },
218+ usage: "abso doctor [--server <url>]",
219+ about:
220+ "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.",
221+ run: async (args, env) => {
222+ const checks = await doctor(boxServer(args, env), env.cwd, env.env, realProbe());
223+ const failed = checks.some((c) => c.result === "fail");
224+ return { text: doctorText(checks), json: { checks }, ...(failed ? { exit: EXIT.error } : {}) };
225+ },
226+ },
205227 logout: {
206228 flags: { server: "string" },
207229 usage: "abso logout [--server <url>]",
Lines 825–840 at 76 (were 803–808 at 75)
803825 return newsBlockLines(news.map((n) => newsShown(n)));
804826}
805827
828+/** Whether this folder's calls carry a key or token, for how a refusal is worded. False when that can't be told. */
829+function carriesCredential(env: Env): boolean {
830+ try {
831+ const root = findRoot(env.cwd);
832+ return root ? readConfig(root, env.env).token !== undefined : readToken(env.env) !== undefined;
833+ } catch {
834+ return false;
835+ }
836+}
806838export async function main(argv: readonly string[], env: Env): Promise<MainResult> {
807839 const command = argv[0];
808840 const json = argv.includes("--json") && command !== "run" && command !== "logs";
Lines 897–906 at 76 (were 865–871 at 75)
865897 const e = err as Error;
866898 const code = err instanceof UsageError ? "usage" : err instanceof ApiError ? "server" : "error";
867899 const message =
868− err instanceof UsageError || err instanceof ApiError ? e.message : `${e.message}${e.stack ? `\n${e.stack}` : ""}`;
900+ plainError(err, carriesCredential(env)) ??
901+ (err instanceof UsageError || err instanceof ApiError
902+ ? e.message
903+ : `${e.message}${e.stack ? `\n${e.stack}` : ""}`);
869904 // The server refusing (409) is like a collision: exit 2, not a failure.
870905 const exit = err instanceof ApiError && err.status === 409 ? EXIT.refused : EXIT.error;
871906 // News taken before the failure still shows.
MCP
compare on this site's /mcp
CLI
abso diff 75 76 client/src/main.ts --json
JSON
/christopher/abso-core/compare/75..76?file=client%2Fsrc%2Fmain.ts&format=json