{"file":"client/src/visitor.ts","version":318,"total":44,"from":1,"to":44,"lines":[{"n":1,"text":"// A visitor folder: abso join <project> --reader with no sign-in, for a public project. It reads the","atom":"a771","author":"pinch","version":86},{"n":2,"text":"// project through the routes anyone can read, and sends no credential, whatever the environment holds","atom":"a771","author":"pinch","version":86},{"n":3,"text":"// (config.ts reads no token for it, and Api sends none and follows no redirect). Which commands it runs","atom":"a771","author":"pinch","version":86},{"n":4,"text":"// is a list of reads: anything not on it is refused here, before any call, so a new command stays","atom":"a771","author":"pinch","version":86},{"n":5,"text":"// refused until someone adds it. The server refuses writes from it too; this is so the refusal is plain.","atom":"a771","author":"pinch","version":86},{"n":6,"text":"","atom":"a771","author":"pinch","version":86},{"n":7,"text":"import { type Parsed, UsageError } from \"./args.ts\";","atom":"a771","author":"pinch","version":86},{"n":8,"text":"","atom":"a771","author":"pinch","version":86},{"n":9,"text":"/** The commands a visitor folder runs, each with the flags it takes there. */","atom":"a771","author":"pinch","version":86},{"n":10,"text":"export const VISITOR_READS: Readonly<Record<string, readonly string[]>> = {","atom":"a771","author":"pinch","version":86},{"n":11,"text":"\tstatus: [],","atom":"a771","author":"pinch","version":86},{"n":12,"text":"\tlog: [\"limit\", \"before\", \"draft\", \"since\", \"by\", \"count\"],","atom":"a771","author":"pinch","version":86},{"n":13,"text":"\tshow: [\"draft\"],","atom":"a771","author":"pinch","version":86},{"n":14,"text":"\tfiles: [\"draft\", \"version\"],","atom":"a771","author":"pinch","version":86},{"n":15,"text":"\tblame: [\"from\", \"to\", \"version\", \"draft\"],","atom":"a771","author":"pinch","version":86},{"n":16,"text":"\twhy: [\"draft\"],","atom":"a771","author":"pinch","version":86},{"n":17,"text":"\twhere: [],","atom":"a771","author":"pinch","version":86},{"n":18,"text":"\tissues: [\"open\", \"status\", \"agent\", \"parent\", \"label\", \"labels\"],","atom":"a771","author":"pinch","version":86},{"n":19,"text":"\tissue: [],","atom":"a771","author":"pinch","version":86},{"n":20,"text":"\tsearch: [\"limit\"],","atom":"a771","author":"pinch","version":86},{"n":21,"text":"};","atom":"a771","author":"pinch","version":86},{"n":22,"text":"","atom":"a771","author":"pinch","version":86},{"n":23,"text":"/** Commands about this box, not the folder: they work from anywhere, a visitor folder too. */","atom":"a771","author":"pinch","version":86},{"n":24,"text":"export const VISITOR_ELSEWHERE: readonly string[] = [\"login\", \"logout\"];","atom":"a771","author":"pinch","version":86},{"n":25,"text":"","atom":"a771","author":"pinch","version":86},{"n":26,"text":"/** Flags every command takes (--server is checked against the folder's own server before this, in main.ts). */","atom":"a1561","author":"speed","version":155},{"n":27,"text":"const EVERY = new Set([\"json\", \"help\", \"server\"]);","atom":"a1561","author":"speed","version":155},{"n":28,"text":"","atom":"a771","author":"pinch","version":86},{"n":29,"text":"export function visitorRefusal(project: string): string {","atom":"a771","author":"pinch","version":86},{"n":30,"text":"\treturn `This folder reads ${project} signed out. To work on it: abso login, then abso join ${project} in a new folder.`;","atom":"a771","author":"pinch","version":86},{"n":31,"text":"}","atom":"a771","author":"pinch","version":86},{"n":32,"text":"","atom":"a771","author":"pinch","version":86},{"n":33,"text":"/** Refuses, before any call, a command or a flag a visitor folder doesn't run. */","atom":"a771","author":"pinch","version":86},{"n":34,"text":"export function checkVisitor(command: string, args: Parsed, project: string): void {","atom":"a771","author":"pinch","version":86},{"n":35,"text":"\tif (VISITOR_ELSEWHERE.includes(command)) return;","atom":"a771","author":"pinch","version":86},{"n":36,"text":"\tconst flags = VISITOR_READS[command];","atom":"a771","author":"pinch","version":86},{"n":37,"text":"\tif (flags === undefined) throw new UsageError(visitorRefusal(project));","atom":"a771","author":"pinch","version":86},{"n":38,"text":"\tfor (const name of args.flags.keys())","atom":"a771","author":"pinch","version":86},{"n":39,"text":"\t\tif (!EVERY.has(name) && !flags.includes(name))","atom":"a771","author":"pinch","version":86},{"n":40,"text":"\t\t\tthrow new UsageError(`${visitorRefusal(project)} Here, ${command} reads only; --${name} isn't one of its reads.`);","atom":"a771","author":"pinch","version":86},{"n":41,"text":"\t// abso issue new and abso issue draft write: here, issue takes only a number.","atom":"a771","author":"pinch","version":86},{"n":42,"text":"\tif (command === \"issue\" && !(args.positionals.length === 1 && /^#?\\d+$/.test(args.positionals[0]!)))","atom":"a771","author":"pinch","version":86},{"n":43,"text":"\t\tthrow new UsageError(`${visitorRefusal(project)} Here, issue reads one issue: abso issue <N>.`);","atom":"a771","author":"pinch","version":86},{"n":44,"text":"}","atom":"a771","author":"pinch","version":86}],"atoms":[{"atom":"a771","author":"pinch","message":"","time":1791616755509,"timeIso":"2026-10-10T07:19:15.509Z","publish":{"draft":null,"version":86,"agent":"pinch","message":"Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.","time":1791616980022,"timeIso":"2026-10-10T07:23:00.022Z"}},{"atom":"a1561","author":"speed","message":"","time":1791913488241,"timeIso":"2026-10-13T17:44:48.241Z","publish":{"draft":null,"version":155,"agent":"speed","message":"Every command that talks to a server now takes --server <url>, parsed and checked in one place (client/src/server-choice.ts). A missing, empty or malformed value is refused before anything is sent. In a joined folder, --server must be the folder's own server: another one is refused rather than swapped in, so a folder's work and key go only to the server it was joined on. Commands that pick their own server (join, init, login, whoami, doctor, box, logout, orgs, org, key) use the named one as given; doctor no longer swaps in the folder's server over an explicit one, and an explicit --server takes issues to that server's own Issues Worker instead of ABSO_ISSUES_SERVER. The five local-only commands refuse --server and say why. Help shows the same --server line for every command of a kind. For abso-core issue 10.","time":1791913490940,"timeIso":"2026-10-13T17:44:50.940Z"}}]}