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

Compare

+19 −3 in 4 places
Lines 11–17 at 318 (were 11–16 at 271)
1111import { UsageError } from "./args.ts";
1212import { type MachineServers, machineServers, TOKEN_SERVERS, tokenGoesTo, trustedList } from "./core.ts";
1313import { fromEnv } from "./env-names.ts";
14+import { isLocal, storeDir } from "./local-store.ts";
1415import { homeFile, stateDir } from "./state-dir.ts";
1516
1617/** What .avcs/config.json holds. */
Lines 28–41 at 318 (were 27–36 at 271)
2728 * routes anyone can read and sends no credential. It has no agent; its config holds server, project and this.
2829 */
2930 readonly visitor?: boolean;
31+ /** A local project's store (abso init --local --store), when it isn't the machine's own: ABSO_STORE or the OS data folder. */
32+ readonly store?: string;
3033}
3134
3235export interface Config extends Settings {
3336 readonly token?: string;
37+ /** For a local project (server "local"): the store folder its history is in, or undefined when there's none to use. */
38+ readonly localStore?: string;
3439}
3540
3641export function configPath(root: string): string {
Lines 69–83 at 318 (were 64–74 at 271)
6469 for (const key of ["server", "project", "agent"] as const) {
6570 if (typeof raw[key] !== "string" || raw[key] === "") throw new Error(`${configPath(root)} has no "${key}"`);
6671 }
67− const token = tokenFor(raw.server!, env, root, tokenFileOk);
72+ // A local project's calls never leave this process, so no credential goes with them.
73+ const local = isLocal(raw.server);
74+ const token = local ? undefined : tokenFor(raw.server!, env, root, tokenFileOk);
6875 return {
6976 server: raw.server!,
7077 project: raw.project!,
7178 agent: raw.agent!,
79+ ...(typeof raw.store === "string" && raw.store !== "" ? { store: raw.store } : {}),
80+ ...(local ? { localStore: storeDir(env, raw.store, root) } : {}),
7281 ...(typeof raw.follow === "string" && raw.follow !== "" ? { follow: raw.follow } : {}),
7382 ...(raw.reader === true ? { reader: true } : {}),
7483 ...(token ? { token } : {}),
Lines 284–300 at 318 (were 275–284 at 271)
275284
276285export function writeConfig(root: string, settings: Settings): void {
277286 mkdirSync(stateDir(root), { recursive: true });
278− const { server, project, agent, follow, reader, visitor } = settings;
287+ const { server, project, agent, follow, reader, visitor, store } = settings;
279288 const written = visitor
280289 ? { server, project, visitor: true }
281− : { server, project, agent, ...(follow ? { follow } : {}), ...(reader ? { reader: true } : {}) };
290+ : {
291+ server,
292+ project,
293+ agent,
294+ ...(follow ? { follow } : {}),
295+ ...(reader ? { reader: true } : {}),
296+ ...(store ? { store } : {}),
297+ };
282298 writeFileSync(configPath(root), `${JSON.stringify(written, null, 2)}\n`);
283299 excludeFromGit(root);
284300}
MCP
compare on this site's /mcp
CLI
abso diff 271 318 client/src/config.ts --json
JSON
/christopher/abso-core/compare/271..318?file=client%2Fsrc%2Fconfig.ts&format=json