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 85 to 86

Compare

+26 −5 in 4 places
Lines 21–31 at 86 (were 21–26 at 85)
2121 readonly follow?: string;
2222 /** A reader folder (abso join --reader, #37): it reads everything and records nothing; the server refuses its records too. */
2323 readonly reader?: boolean;
24+ /**
25+ * A visitor folder (abso join <project> --reader with no sign-in, for a public project): it reads through the
26+ * routes anyone can read and sends no credential. It has no agent; its config holds server, project and this.
27+ */
28+ readonly visitor?: boolean;
2429}
2530
2631export interface Config extends Settings {
Lines 49–61 at 86 (were 44–49 at 85)
4449
4550export function readConfig(root: string, env: Readonly<Record<string, string | undefined>> = process.env): Config {
4651 const raw = JSON.parse(readFileSync(configPath(root), "utf8")) as Partial<Settings>;
52+ if (raw.visitor === true) {
53+ for (const key of ["server", "project"] as const) {
54+ if (typeof raw[key] !== "string" || raw[key] === "") throw new Error(`${configPath(root)} has no "${key}"`);
55+ }
56+ // No token and no key, whatever the environment or the folder holds: a visitor sends no credential.
57+ return { server: raw.server!, project: raw.project!, agent: "", visitor: true };
58+ }
4759 for (const key of ["server", "project", "agent"] as const) {
4860 if (typeof raw[key] !== "string" || raw[key] === "") throw new Error(`${configPath(root)} has no "${key}"`);
4961 }
Lines 70–84 at 86 (were 58–63 at 85)
5870 };
5971}
6072
73+/** Whether the folder is a visitor's: it reads signed out and sends no credential. Read straight from its config. */
74+export function isVisitor(root: string): boolean {
75+ try {
76+ return (JSON.parse(readFileSync(configPath(root), "utf8")) as { visitor?: unknown }).visitor === true;
77+ } catch {
78+ return false;
79+ }
80+}
6182/** Whether the folder is a reader (#37): records nothing. Read straight from its config, for the paths that only need this. */
6283export function isReader(root: string): boolean {
6384 try {
Lines 226–236 at 86 (were 205–215 at 85)
205226
206227export function writeConfig(root: string, settings: Settings): void {
207228 mkdirSync(stateDir(root), { recursive: true });
208− const { server, project, agent, follow, reader } = settings;
209− writeFileSync(
210− configPath(root),
211− `${JSON.stringify({ server, project, agent, ...(follow ? { follow } : {}), ...(reader ? { reader: true } : {}) }, null, 2)}\n`,
212− );
229+ const { server, project, agent, follow, reader, visitor } = settings;
230+ const written = visitor
231+ ? { server, project, visitor: true }
232+ : { server, project, agent, ...(follow ? { follow } : {}), ...(reader ? { reader: true } : {}) };
233+ writeFileSync(configPath(root), `${JSON.stringify(written, null, 2)}\n`);
213234 excludeFromGit(root);
214235}
215236
MCP
compare on this site's /mcp
CLI
abso diff 85 86 client/src/config.ts --json
JSON
/christopher/abso-core/compare/85..86?file=client%2Fsrc%2Fconfig.ts&format=json