{"draft":null,"from":85,"to":86,"files":[{"path":"client/src/config.ts","added":26,"removed":5,"diff":"--- a/client/src/config.ts\n+++ b/client/src/config.ts\n@@ -21,6 +21,11 @@\n \treadonly follow?: string;\n \t/** A reader folder (abso join --reader, #37): it reads everything and records nothing; the server refuses its records too. */\n \treadonly reader?: boolean;\n+\t/**\n+\t * A visitor folder (abso join <project> --reader with no sign-in, for a public project): it reads through the\n+\t * routes anyone can read and sends no credential. It has no agent; its config holds server, project and this.\n+\t */\n+\treadonly visitor?: boolean;\n }\n \n export interface Config extends Settings {\n@@ -44,6 +49,13 @@\n \n export function readConfig(root: string, env: Readonly<Record<string, string | undefined>> = process.env): Config {\n \tconst raw = JSON.parse(readFileSync(configPath(root), \"utf8\")) as Partial<Settings>;\n+\tif (raw.visitor === true) {\n+\t\tfor (const key of [\"server\", \"project\"] as const) {\n+\t\t\tif (typeof raw[key] !== \"string\" || raw[key] === \"\") throw new Error(`${configPath(root)} has no \"${key}\"`);\n+\t\t}\n+\t\t// No token and no key, whatever the environment or the folder holds: a visitor sends no credential.\n+\t\treturn { server: raw.server!, project: raw.project!, agent: \"\", visitor: true };\n+\t}\n \tfor (const key of [\"server\", \"project\", \"agent\"] as const) {\n \t\tif (typeof raw[key] !== \"string\" || raw[key] === \"\") throw new Error(`${configPath(root)} has no \"${key}\"`);\n \t}\n@@ -58,6 +70,15 @@\n \t};\n }\n \n+/** Whether the folder is a visitor's: it reads signed out and sends no credential. Read straight from its config. */\n+export function isVisitor(root: string): boolean {\n+\ttry {\n+\t\treturn (JSON.parse(readFileSync(configPath(root), \"utf8\")) as { visitor?: unknown }).visitor === true;\n+\t} catch {\n+\t\treturn false;\n+\t}\n+}\n+\n /** Whether the folder is a reader (#37): records nothing. Read straight from its config, for the paths that only need this. */\n export function isReader(root: string): boolean {\n \ttry {\n@@ -205,11 +226,11 @@\n \n export function writeConfig(root: string, settings: Settings): void {\n \tmkdirSync(stateDir(root), { recursive: true });\n-\tconst { server, project, agent, follow, reader } = settings;\n-\twriteFileSync(\n-\t\tconfigPath(root),\n-\t\t`${JSON.stringify({ server, project, agent, ...(follow ? { follow } : {}), ...(reader ? { reader: true } : {}) }, null, 2)}\\n`,\n-\t);\n+\tconst { server, project, agent, follow, reader, visitor } = settings;\n+\tconst written = visitor\n+\t\t? { server, project, visitor: true }\n+\t\t: { server, project, agent, ...(follow ? { follow } : {}), ...(reader ? { reader: true } : {}) };\n+\twriteFileSync(configPath(root), `${JSON.stringify(written, null, 2)}\\n`);\n \texcludeFromGit(root);\n }\n "}],"unmatched":[]}