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 26 to 27

Compare

+11 −9 in 4 places
Lines 1–7 at 27 (were 1–7 at 26)
11// The folder's settings (.avcs/config.json), finding the folder that holds
22// them, and the token.
33//
4−// The token is never in the folder: it comes from the AVCS_TOKEN environment
4+// The token is never in the folder: it comes from the ABSO_TOKEN environment
55// variable, or else from ~/.avcs/token, outside every repo.
66
77import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
Lines 9–15 at 27 (were 9–14 at 26)
99import { basename, dirname, join, resolve } from "node:path";
1010import { UsageError } from "./args.ts";
1111import { type MachineServers, machineServers, TOKEN_SERVERS, tokenGoesTo, trustedList } from "./core.ts";
12+import { fromEnv } from "./env-names.ts";
1213import { homeFile, stateDir } from "./state-dir.ts";
1314
1415/** What .avcs/config.json holds. */
Lines 167–181 at 27 (were 166–180 at 26)
166167 const trusted = trustedServers(env);
167168 if (token === undefined || tokenGoesTo(server, trusted)) return token;
168169 throw new UsageError(
169− `this folder's server is ${server}, and abso sends your token only to ${[...TOKEN_SERVERS, "this machine"].join(", ")}, and the servers ~/.abso/servers.json or AVCS_TRUSTED_SERVERS name. ` +
170− `If ${server} is yours, name it in ~/.abso/servers.json or AVCS_TRUSTED_SERVERS (comma-separated); if you didn't set it, someone else wrote .abso/config.json.`,
170+ `this folder's server is ${server}, and abso sends your token only to ${[...TOKEN_SERVERS, "this machine"].join(", ")}, and the servers ~/.abso/servers.json or ABSO_TRUSTED_SERVERS name. ` +
171+ `If ${server} is yours, name it in ~/.abso/servers.json or ABSO_TRUSTED_SERVERS (comma-separated); if you didn't set it, someone else wrote .abso/config.json.`,
171172 );
172173}
173174
174175let machine: MachineServers | undefined;
175−/** This machine's servers (core.ts machineServers), from ~/.abso/servers.json (or ~/.abso/servers.json), read once. AVCS_SERVERS_FILE names another file (tests). */
176+/** This machine's servers (core.ts machineServers), from ~/.abso/servers.json (or the older ~/.avcs/servers.json), read once. ABSO_SERVERS_FILE names another file (tests). */
176177export function readMachineServers(env: Readonly<Record<string, string | undefined>> = process.env): MachineServers {
177− if (env.AVCS_SERVERS_FILE !== undefined) return machineServers(readOr(env.AVCS_SERVERS_FILE));
178+ if (fromEnv(env, "SERVERS_FILE") !== undefined) return machineServers(readOr(fromEnv(env, "SERVERS_FILE") as string));
178179 machine ??= machineServers(readOr(homeFile(homedir(), "servers.json")));
179180 return machine;
180181}
Lines 187–201 at 27 (were 186–199 at 26)
186187 }
187188};
188189
189−/** The servers the token may go to beyond abso's own: AVCS_TRUSTED_SERVERS, then this machine's servers.json. */
190+/** The servers the token may go to beyond abso's own: ABSO_TRUSTED_SERVERS, then this machine's servers.json. */
190191export function trustedServers(env: Readonly<Record<string, string | undefined>> = process.env): string {
191− return trustedList(env.AVCS_TRUSTED_SERVERS, readMachineServers(env));
192+ return trustedList(fromEnv(env, "TRUSTED_SERVERS"), readMachineServers(env));
192193}
193194
194−/** AVCS_TOKEN if set, else ~/.abso/token, else ~/.avcs/token, else none. */
195+/** ABSO_TOKEN if set, else ~/.abso/token, else ~/.avcs/token, else none. */
195196export function readToken(env: Readonly<Record<string, string | undefined>> = process.env): string | undefined {
196− if (env.AVCS_TOKEN) return env.AVCS_TOKEN.trim();
197+ const fromVar = fromEnv(env, "TOKEN");
198+ if (fromVar) return fromVar.trim();
197199 try {
198200 return readFileSync(homeFile(homedir(), "token"), "utf8").trim() || undefined;
199201 } catch {
MCP
compare on this site's /mcp
CLI
abso diff 26 27 client/src/config.ts --json
JSON
/christopher/abso-core/compare/26..27?file=client%2Fsrc%2Fconfig.ts&format=json