Lines 11–17 at 318 (were 11–16 at 274)
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"; 1617/** What .avcs/config.json holds. */ Lines 28–41 at 318 (were 27–36 at 274)
2728 * routes anyone can read and sends no credential. It has no agent; its config holds server, project and this. 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; 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; 3641export function configPath(root: string): string { Lines 69–83 at 318 (were 64–74 at 274)
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}"`); 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); 6976 server: raw.server!, 7077 project: raw.project!, 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 274)
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 } : {}) };
294+ ...(follow ? { follow } : {}), 295+ ...(reader ? { reader: true } : {}), 296+ ...(store ? { store } : {}), 282298 writeFileSync(configPath(root), `${JSON.stringify(written, null, 2)}\n`); 283299 excludeFromGit(root);