{"file":"client/src/join-commands.ts","version":318,"total":559,"from":1,"to":559,"lines":[{"n":1,"text":"// abso init and abso join: start a project from a folder, or join one into a folder.","atom":"a0","author":"init","version":0},{"n":2,"text":"","atom":"a0","author":"init","version":0},{"n":3,"text":"import { randomUUID } from \"node:crypto\";","atom":"a2067","author":"box-grants","version":185},{"n":4,"text":"import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from \"node:fs\";","atom":"a2067","author":"box-grants","version":185},{"n":5,"text":"import { isAbsolute, join, relative, resolve, sep } from \"node:path\";","atom":"a2821","author":"pinch","version":287},{"n":6,"text":"import { Api, ApiError, type SyncAnswer } from \"./api.ts\";","atom":"a2767","author":"pinch","version":281},{"n":7,"text":"import { bool, type Parsed, str, UsageError } from \"./args.ts\";","atom":"a0","author":"init","version":0},{"n":8,"text":"import { writeKnownBlobs } from \"./blobs.ts\";","atom":"a0","author":"init","version":0},{"n":9,"text":"import {","atom":"a2067","author":"box-grants","version":185},{"n":10,"text":"\ttype BoxRecord,","atom":"a2067","author":"box-grants","version":185},{"n":11,"text":"\tboxCreateProject,","atom":"a2067","author":"box-grants","version":185},{"n":12,"text":"\tdefaultAgentName,","atom":"a2067","author":"box-grants","version":185},{"n":13,"text":"\tmintFreeName,","atom":"a2067","author":"box-grants","version":185},{"n":14,"text":"\tmintKey,","atom":"a2067","author":"box-grants","version":185},{"n":15,"text":"\ttype NewProject,","atom":"a2067","author":"box-grants","version":185},{"n":16,"text":"\treadBox,","atom":"a2067","author":"box-grants","version":185},{"n":17,"text":"} from \"./box.ts\";","atom":"a2067","author":"box-grants","version":185},{"n":18,"text":"import { STARTING_ABSOIGNORE } from \"./check-ignore.ts\";","atom":"a209","author":"review","version":27},{"n":19,"text":"import { builtCopy } from \"./client-version.ts\";","atom":"a2765","author":"pinch","version":281},{"n":20,"text":"import { type Env, type Output, plural } from \"./command-env.ts\";","atom":"a0","author":"init","version":0},{"n":21,"text":"import { applyAnswer, leftOutText, pullAnswer, pullWritten, syncFolder, uploadBlobs } from \"./commands.ts\";","atom":"a2767","author":"pinch","version":281},{"n":22,"text":"import {","atom":"a2685","author":"readspeed","version":268},{"n":23,"text":"\tfindRoot,","atom":"a2685","author":"readspeed","version":268},{"n":24,"text":"\tinstallKey,","atom":"a2685","author":"readspeed","version":268},{"n":25,"text":"\treadConfig,","atom":"a2685","author":"readspeed","version":268},{"n":26,"text":"\trunKey,","atom":"a2685","author":"readspeed","version":268},{"n":27,"text":"\ttype Settings,","atom":"a2685","author":"readspeed","version":268},{"n":28,"text":"\ttokenFile,","atom":"a2685","author":"readspeed","version":268},{"n":29,"text":"\ttrustedToken,","atom":"a2685","author":"readspeed","version":268},{"n":30,"text":"\twriteConfig,","atom":"a2685","author":"readspeed","version":268},{"n":31,"text":"} from \"./config.ts\";","atom":"a2685","author":"readspeed","version":268},{"n":32,"text":"import { elsewhereText } from \"./doctor.ts\";","atom":"a1578","author":"speed","version":156},{"n":33,"text":"import { fromEnv } from \"./env-names.ts\";","atom":"a209","author":"review","version":27},{"n":34,"text":"import { clearKnown, loadIgnore, readFolder, writeKnown } from \"./folder.ts\";","atom":"a0","author":"init","version":0},{"n":35,"text":"import { installerCommand, modHandsLocal, modInstalled } from \"./install.ts\";","atom":"a2870","author":"pinch","version":293},{"n":36,"text":"import { LOCAL, NO_STORE, storeDir } from \"./local-store.ts\";","atom":"a2821","author":"pinch","version":287},{"n":37,"text":"import { type FullMode, foldModes, writeKnownModes } from \"./modes.ts\";","atom":"a0","author":"init","version":0},{"n":38,"text":"import { initInOrg, siteOf } from \"./orgs.ts\";","atom":"a2067","author":"box-grants","version":185},{"n":39,"text":"import { projectFileName, readProjectFile, startingProjectFileText, writeStartingProjectFile } from \"./project-file.ts\";","atom":"a234","author":"review","version":28},{"n":40,"text":"import { refusedText } from \"./safety.ts\";","atom":"a0","author":"init","version":0},{"n":41,"text":"import { chooseServer, serverFlag } from \"./server-choice.ts\";","atom":"a1578","author":"speed","version":156},{"n":42,"text":"import { OLD_STATE_DIR, STATE_DIR, stateDir } from \"./state-dir.ts\";","atom":"a627","author":"trials","version":64},{"n":43,"text":"","atom":"a0","author":"init","version":0},{"n":44,"text":"/** The server to join or start on, in the order every command picks one (server-choice.ts chooseServer). */","atom":"a1578","author":"speed","version":156},{"n":45,"text":"export function serverFrom(args: Parsed, env: Pick<Env, \"env\" | \"cwd\">): string {","atom":"a1578","author":"speed","version":156},{"n":46,"text":"\treturn chooseServer(serverFlag(args), env.cwd, env.env);","atom":"a1578","author":"speed","version":156},{"n":47,"text":"}","atom":"a0","author":"init","version":0},{"n":48,"text":"","atom":"a0","author":"init","version":0},{"n":49,"text":"const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;","atom":"a621","author":"trials","version":63},{"n":50,"text":"","atom":"a621","author":"trials","version":63},{"n":51,"text":"function agentFrom(args: Parsed, named?: string): string {","atom":"a804","author":"pinch","version":95},{"n":52,"text":"\tconst agent = named ?? str(args, \"agent\");","atom":"a804","author":"pinch","version":95},{"n":53,"text":"\tif (!agent) throw new UsageError(\"give this folder's agent name with --agent <name>\");","atom":"a0","author":"init","version":0},{"n":54,"text":"\tif (!NAME.test(agent))","atom":"a621","author":"trials","version":63},{"n":55,"text":"\t\tthrow new UsageError(`agent names are letters, digits, dot, dash and underscore (got ${JSON.stringify(agent)})`);","atom":"a0","author":"init","version":0},{"n":56,"text":"\treturn agent;","atom":"a0","author":"init","version":0},{"n":57,"text":"}","atom":"a0","author":"init","version":0},{"n":58,"text":"","atom":"a0","author":"init","version":0},{"n":59,"text":"function makeSettings(args: Parsed, env: Env, project: string): Settings {","atom":"a0","author":"init","version":0},{"n":60,"text":"\treturn { server: serverFrom(args, env), project, agent: agentFrom(args) };","atom":"a0","author":"init","version":0},{"n":61,"text":"}","atom":"a0","author":"init","version":0},{"n":62,"text":"","atom":"a0","author":"init","version":0},{"n":63,"text":"/**","atom":"a2413","author":"onboard","version":224},{"n":64,"text":" * A new project has nothing in it yet: say what comes next, since the join itself wrote nothing. Not for a reader, which","atom":"a2413","author":"onboard","version":224},{"n":65,"text":" * can't push, or when files were already in the folder (the join's own line names them).","atom":"a2413","author":"onboard","version":224},{"n":66,"text":" */","atom":"a2413","author":"onboard","version":224},{"n":67,"text":"export function emptyHint(version: number, written: number, kept: number, reader: boolean): string[] {","atom":"a2413","author":"onboard","version":224},{"n":68,"text":"\tif (reader || version !== 0 || written > 0 || kept > 0) return [];","atom":"a2413","author":"onboard","version":224},{"n":69,"text":"\treturn ['The project is empty. Put its files in this folder, then abso push -m \"why\" publishes them.'];","atom":"a2413","author":"onboard","version":224},{"n":70,"text":"}","atom":"a2413","author":"onboard","version":224},{"n":71,"text":"","atom":"a2413","author":"onboard","version":224},{"n":72,"text":"/** A credential other than the box's, and how init and join name it when they say what they sign in with. */","atom":"a2685","author":"readspeed","version":268},{"n":73,"text":"export interface Credential {","atom":"a2685","author":"readspeed","version":268},{"n":74,"text":"\treadonly token: string | undefined;","atom":"a2685","author":"readspeed","version":268},{"n":75,"text":"\treadonly words: string;","atom":"a2685","author":"readspeed","version":268},{"n":76,"text":"}","atom":"a2685","author":"readspeed","version":268},{"n":77,"text":"","atom":"a2685","author":"readspeed","version":268},{"n":78,"text":"/**","atom":"a2685","author":"readspeed","version":268},{"n":79,"text":" * What init and join sign in with when it isn't the box's sign-in. The machine's token file only with --token-file, and","atom":"a2685","author":"readspeed","version":268},{"n":80,"text":" * never into a folder that already has a key; else a token the environment names (ABSO_TOKEN, or a pipeline run's","atom":"a2685","author":"readspeed","version":268},{"n":81,"text":" * ABSO_KEY_FILE); else none. The token file is never read unasked, so a project is never made or joined with a shared","atom":"a2685","author":"readspeed","version":268},{"n":82,"text":" * credential nobody chose.","atom":"a2685","author":"readspeed","version":268},{"n":83,"text":" */","atom":"a2685","author":"readspeed","version":268},{"n":84,"text":"export function tokenCredential(","atom":"a2685","author":"readspeed","version":268},{"n":85,"text":"\targs: Parsed,","atom":"a2685","author":"readspeed","version":268},{"n":86,"text":"\tenv: Env[\"env\"],","atom":"a2685","author":"readspeed","version":268},{"n":87,"text":"\tserver: string,","atom":"a2685","author":"readspeed","version":268},{"n":88,"text":"\troot: string,","atom":"a2685","author":"readspeed","version":268},{"n":89,"text":"\tfile: () => string | undefined = tokenFile,","atom":"a2685","author":"readspeed","version":268},{"n":90,"text":"): Credential | undefined {","atom":"a2685","author":"readspeed","version":268},{"n":91,"text":"\tif (bool(args, \"token-file\")) {","atom":"a2685","author":"readspeed","version":268},{"n":92,"text":"\t\tif (existsSync(join(stateDir(root), \"key\")))","atom":"a2685","author":"readspeed","version":268},{"n":93,"text":"\t\t\tthrow new UsageError(`${root} already has a key, so it signs in with that: leave off --token-file`);","atom":"a2685","author":"readspeed","version":268},{"n":94,"text":"\t\tconst token = trustedToken(server, env, file());","atom":"a2685","author":"readspeed","version":268},{"n":95,"text":"\t\tif (!token) throw new UsageError(\"--token-file reads ~/.abso/token, and this machine has none\");","atom":"a2685","author":"readspeed","version":268},{"n":96,"text":"\t\treturn { token, words: \"the token file, ~/.abso/token, as --token-file asks\" };","atom":"a2685","author":"readspeed","version":268},{"n":97,"text":"\t}","atom":"a2685","author":"readspeed","version":268},{"n":98,"text":"\tconst named = fromEnv(env, \"TOKEN\")?.trim();","atom":"a2685","author":"readspeed","version":268},{"n":99,"text":"\tif (named) return { token: trustedToken(server, env, named), words: \"ABSO_TOKEN\" };","atom":"a2685","author":"readspeed","version":268},{"n":100,"text":"\tconst run = runKey(env);","atom":"a2685","author":"readspeed","version":268},{"n":101,"text":"\tif (run) return { token: trustedToken(server, env, run), words: \"a pipeline run's key (ABSO_KEY_FILE)\" };","atom":"a2685","author":"readspeed","version":268},{"n":102,"text":"\treturn undefined;","atom":"a2685","author":"readspeed","version":268},{"n":103,"text":"}","atom":"a2685","author":"readspeed","version":268},{"n":104,"text":"","atom":"a2685","author":"readspeed","version":268},{"n":105,"text":"/**","atom":"a2821","author":"pinch","version":287},{"n":106,"text":" * --local (abso init, abso join): the project's history is in a store on this machine, not on a server. The store is","atom":"a2821","author":"pinch","version":287},{"n":107,"text":" * --store, else ABSO_STORE, else the OS's data folder; one given with --store is kept in the folder's config.","atom":"a2821","author":"pinch","version":287},{"n":108,"text":" */","atom":"a2821","author":"pinch","version":287},{"n":109,"text":"function localFrom(args: Parsed, env: Env, command: string): { dir: string; settings: { store?: string } } | undefined {","atom":"a2821","author":"pinch","version":287},{"n":110,"text":"\tconst store = str(args, \"store\");","atom":"a2821","author":"pinch","version":287},{"n":111,"text":"\tif (!bool(args, \"local\")) {","atom":"a2821","author":"pinch","version":287},{"n":112,"text":"\t\tif (store !== undefined)","atom":"a2821","author":"pinch","version":287},{"n":113,"text":"\t\t\tthrow new UsageError(\"--store goes with --local: it says where a local project's history is\");","atom":"a2821","author":"pinch","version":287},{"n":114,"text":"\t\treturn undefined;","atom":"a2821","author":"pinch","version":287},{"n":115,"text":"\t}","atom":"a2821","author":"pinch","version":287},{"n":116,"text":"\tif (str(args, \"server\") !== undefined)","atom":"a2821","author":"pinch","version":287},{"n":117,"text":"\t\tthrow new UsageError(\"--local or --server, not both: a local project has no server\");","atom":"a2821","author":"pinch","version":287},{"n":118,"text":"\tif (str(args, \"org\") !== undefined || bool(args, \"public\") || bool(args, \"private\") || bool(args, \"reader\"))","atom":"a2821","author":"pinch","version":287},{"n":119,"text":"\t\tthrow new UsageError(","atom":"a2821","author":"pinch","version":287},{"n":120,"text":"\t\t\t`abso ${command} --local takes --project, --agent, --store and --as-is; a local project has no server to share it`,","atom":"a2821","author":"pinch","version":287},{"n":121,"text":"\t\t);","atom":"a2821","author":"pinch","version":287},{"n":122,"text":"\tconst dir = storeDir(env.env, store, env.cwd);","atom":"a2821","author":"pinch","version":287},{"n":123,"text":"\tif (dir === undefined) throw new UsageError(NO_STORE);","atom":"a2821","author":"pinch","version":287},{"n":124,"text":"\treturn { dir, settings: store === undefined ? {} : { store: dir } };","atom":"a2821","author":"pinch","version":287},{"n":125,"text":"}","atom":"a2821","author":"pinch","version":287},{"n":126,"text":"","atom":"a2821","author":"pinch","version":287},{"n":127,"text":"/** A store inside the project folder is left out of its files: a line in .absoignore. Its relative path, if so. */","atom":"a2821","author":"pinch","version":287},{"n":128,"text":"function ignoreStoreInside(root: string, dir: string): string | undefined {","atom":"a2821","author":"pinch","version":287},{"n":129,"text":"\tconst rel = relative(root, dir);","atom":"a2821","author":"pinch","version":287},{"n":130,"text":"\tif (rel === \"\" || rel.startsWith(\"..\") || isAbsolute(rel)) return undefined;","atom":"a2821","author":"pinch","version":287},{"n":131,"text":"\tconst line = `/${rel.split(sep).join(\"/\")}/`;","atom":"a2821","author":"pinch","version":287},{"n":132,"text":"\tconst file = join(root, \".absoignore\");","atom":"a2821","author":"pinch","version":287},{"n":133,"text":"\tconst had = existsSync(file) ? readFileSync(file, \"utf8\") : \"\";","atom":"a2821","author":"pinch","version":287},{"n":134,"text":"\tconst lines = had.split(/\\r?\\n/);","atom":"a2821","author":"pinch","version":287},{"n":135,"text":"\tif (!lines.includes(line)) {","atom":"a2821","author":"pinch","version":287},{"n":136,"text":"\t\tconst gap = had === \"\" || had.endsWith(\"\\n\") ? \"\" : \"\\n\";","atom":"a2821","author":"pinch","version":287},{"n":137,"text":"\t\twriteFileSync(file, `${had}${gap}${line}\\n`);","atom":"a2821","author":"pinch","version":287},{"n":138,"text":"\t}","atom":"a2821","author":"pinch","version":287},{"n":139,"text":"\treturn rel;","atom":"a2821","author":"pinch","version":287},{"n":140,"text":"}","atom":"a2821","author":"pinch","version":287},{"n":141,"text":"","atom":"a2821","author":"pinch","version":287},{"n":142,"text":"/** What init and join say about a local project's store. */","atom":"a2821","author":"pinch","version":287},{"n":143,"text":"function localText(dir: string, project: string, ignored?: string): string {","atom":"a2821","author":"pinch","version":287},{"n":144,"text":"\treturn `It's a local project: its history is in ${join(dir, project)}, on this machine, and no server is needed.${ignored === undefined ? \"\" : ` .absoignore leaves the store, ${ignored}, out of the project's files.`}`;","atom":"a2821","author":"pinch","version":287},{"n":145,"text":"}","atom":"a2821","author":"pinch","version":287},{"n":146,"text":"","atom":"a2821","author":"pinch","version":287},{"n":147,"text":"/** Why a token file is no fallback: said when one is here and nothing else signs in. */","atom":"a2685","author":"readspeed","version":268},{"n":148,"text":"const TOKEN_FILE_ASKED = \"~/.abso/token is used only with --token-file.\";","atom":"a2685","author":"readspeed","version":268},{"n":149,"text":"","atom":"a2685","author":"readspeed","version":268},{"n":150,"text":"export async function runInit(args: Parsed, env: Env): Promise<Output> {","atom":"a0","author":"init","version":0},{"n":151,"text":"\tif (args.positionals.length > 1) throw new UsageError(\"init takes one folder\");","atom":"a0","author":"init","version":0},{"n":152,"text":"\tconst root = resolve(env.cwd, args.positionals[0] ?? \".\");","atom":"a0","author":"init","version":0},{"n":153,"text":"\tif (!existsSync(root) || !statSync(root).isDirectory()) throw new UsageError(`${root} is not a folder`);","atom":"a0","author":"init","version":0},{"n":154,"text":"\tif (findRoot(root) === root) throw new UsageError(`${root} already has .abso/config.json`);","atom":"a107","author":"review","version":17},{"n":155,"text":"\tconst project = str(args, \"project\");","atom":"a0","author":"init","version":0},{"n":156,"text":"\tif (!project) throw new UsageError(\"give the project a name with --project <name>\");","atom":"a0","author":"init","version":0},{"n":157,"text":"\t// Checked before any call: a name like \"..\" would otherwise go out as part of the request's path.","atom":"a2944","author":"pinch","version":305},{"n":158,"text":"\tif (!NAME.test(project))","atom":"a2944","author":"pinch","version":305},{"n":159,"text":"\t\tthrow new UsageError(","atom":"a2944","author":"pinch","version":305},{"n":160,"text":"\t\t\t`project names are letters, digits, dot, dash and underscore (got ${JSON.stringify(project)})`,","atom":"a2944","author":"pinch","version":305},{"n":161,"text":"\t\t);","atom":"a2944","author":"pinch","version":305},{"n":162,"text":"\tif (bool(args, \"public\") && bool(args, \"private\")) throw new UsageError(\"--public or --private, not both\");","atom":"a2067","author":"box-grants","version":185},{"n":163,"text":"\tconst local = localFrom(args, env, \"init\");","atom":"a2821","author":"pinch","version":287},{"n":164,"text":"\t// A box signed in here, and no other credential asked for: the project is made as the person who approved the box,","atom":"a2685","author":"readspeed","version":268},{"n":165,"text":"\t// the way the website makes one (abso 663). The token file only with --token-file, never by itself.","atom":"a2685","author":"readspeed","version":268},{"n":166,"text":"\tconst server = local ? LOCAL : serverFrom(args, env);","atom":"a2821","author":"pinch","version":287},{"n":167,"text":"\tconst box = local ? undefined : readBox(server);","atom":"a2821","author":"pinch","version":287},{"n":168,"text":"\tconst credential = local ? undefined : tokenCredential(args, env.env, server, root);","atom":"a2821","author":"pinch","version":287},{"n":169,"text":"\tconst say = env.writeErr ?? env.write;","atom":"a2685","author":"readspeed","version":268},{"n":170,"text":"\tif (box && credential === undefined) {","atom":"a2685","author":"readspeed","version":268},{"n":171,"text":"\t\tsay(`Signing in with this box's sign-in, ${box.id}.","atom":"a2685","author":"readspeed","version":268},{"n":172,"text":"`);","atom":"a2685","author":"readspeed","version":268},{"n":173,"text":"\t\treturn initFromBox(args, env, root, project, server, box);","atom":"a2067","author":"box-grants","version":185},{"n":174,"text":"\t}","atom":"a2685","author":"readspeed","version":268},{"n":175,"text":"\tif (!local && credential === undefined && tokenFile() !== undefined)","atom":"a2821","author":"pinch","version":287},{"n":176,"text":"\t\tthrow new UsageError(","atom":"a2685","author":"readspeed","version":268},{"n":177,"text":"\t\t\t`abso init signs in with this box's sign-in, and this box isn't signed in to ${server}: abso login signs it in. ${TOKEN_FILE_ASKED}`,","atom":"a2685","author":"readspeed","version":268},{"n":178,"text":"\t\t);","atom":"a2685","author":"readspeed","version":268},{"n":179,"text":"\tconst org = str(args, \"org\");","atom":"a2067","author":"box-grants","version":185},{"n":180,"text":"\tif (org !== undefined) return initInOrg(org, server);","atom":"a2067","author":"box-grants","version":185},{"n":181,"text":"\tconst config: Settings = local","atom":"a2821","author":"pinch","version":287},{"n":182,"text":"\t\t? { server: LOCAL, project, agent: agentFrom(args, str(args, \"agent\") ?? defaultAgentName()), ...local.settings }","atom":"a2821","author":"pinch","version":287},{"n":183,"text":"\t\t: makeSettings(args, env, project);","atom":"a2821","author":"pinch","version":287},{"n":184,"text":"\tconst asIs = bool(args, \"as-is\");","atom":"a0","author":"init","version":0},{"n":185,"text":"\tconst absoignore = join(root, \".absoignore\");","atom":"a209","author":"review","version":27},{"n":186,"text":"\tconst wroteIgnore = !asIs && !existsSync(absoignore) && !existsSync(join(root, \".avcsignore\"));","atom":"a209","author":"review","version":27},{"n":187,"text":"\tif (wroteIgnore) writeFileSync(absoignore, STARTING_ABSOIGNORE);","atom":"a209","author":"review","version":27},{"n":188,"text":"\t// A store kept inside the project folder, like a virtual environment, isn't the project's files.","atom":"a2821","author":"pinch","version":287},{"n":189,"text":"\tconst ignoredStore = local ? ignoreStoreInside(root, local.dir) : undefined;","atom":"a2821","author":"pinch","version":287},{"n":190,"text":"\t// What the server runs on each new version (#39), guessed from package.json; recorded with the rest.","atom":"a0","author":"init","version":0},{"n":191,"text":"\tconst wroteProject = asIs ? \"exists\" : writeStartingProjectFile(root);","atom":"a0","author":"init","version":0},{"n":192,"text":"\tconst { files, blobs, modes, leftOut } = readFolder(root, loadIgnore(root));","atom":"a0","author":"init","version":0},{"n":193,"text":"\tconst token = credential?.token;","atom":"a2685","author":"readspeed","version":268},{"n":194,"text":"\tif (!local)","atom":"a2821","author":"pinch","version":287},{"n":195,"text":"\t\tsay(`Signing in with ${credential?.words ?? `no credential: nothing here signs in to ${server}`}.","atom":"a2821","author":"pinch","version":287},{"n":196,"text":"`);","atom":"a2685","author":"readspeed","version":268},{"n":197,"text":"\tconst api = new Api({ ...config, ...(token ? { token } : {}), ...(local ? { localStore: local.dir } : {}) });","atom":"a2821","author":"pinch","version":287},{"n":198,"text":"\tlet answer: Awaited<ReturnType<Api[\"init\"]>>;","atom":"a2767","author":"pinch","version":281},{"n":199,"text":"\ttry {","atom":"a2767","author":"pinch","version":281},{"n":200,"text":"\t\tawait uploadBlobs(api, blobs);","atom":"a2767","author":"pinch","version":281},{"n":201,"text":"\t\tanswer = await api.init(","atom":"a2767","author":"pinch","version":281},{"n":202,"text":"\t\t\tObject.fromEntries(files),","atom":"a2767","author":"pinch","version":281},{"n":203,"text":"\t\t\tmodes,","atom":"a2767","author":"pinch","version":281},{"n":204,"text":"\t\t\tObject.fromEntries([...blobs].map(([rel, b]) => [rel, b.sha])),","atom":"a2767","author":"pinch","version":281},{"n":205,"text":"\t\t);","atom":"a2767","author":"pinch","version":281},{"n":206,"text":"\t} catch (error) {","atom":"a2767","author":"pinch","version":281},{"n":207,"text":"\t\t// No project was made: the starting files init wrote go too, so the folder is as it was.","atom":"a2767","author":"pinch","version":281},{"n":208,"text":"\t\tif (wroteIgnore) rmSync(absoignore, { force: true });","atom":"a2767","author":"pinch","version":281},{"n":209,"text":"\t\tif (typeof wroteProject !== \"string\") rmSync(join(root, projectFileName(root)), { force: true });","atom":"a2767","author":"pinch","version":281},{"n":210,"text":"\t\tthrow error;","atom":"a2767","author":"pinch","version":281},{"n":211,"text":"\t}","atom":"a2767","author":"pinch","version":281},{"n":212,"text":"\twriteConfig(root, config);","atom":"a0","author":"init","version":0},{"n":213,"text":"\tclearKnown(root);","atom":"a0","author":"init","version":0},{"n":214,"text":"\tfor (const [rel, text] of files) writeKnown(root, rel, text);","atom":"a0","author":"init","version":0},{"n":215,"text":"\twriteKnownBlobs(root, new Map([...blobs].map(([rel, b]) => [rel, b.sha])));","atom":"a0","author":"init","version":0},{"n":216,"text":"\tconst knownModes = new Map<string, FullMode>();","atom":"a0","author":"init","version":0},{"n":217,"text":"\tfoldModes(knownModes, modes);","atom":"a0","author":"init","version":0},{"n":218,"text":"\twriteKnownModes(root, knownModes);","atom":"a0","author":"init","version":0},{"n":219,"text":"\tconst synced = await syncFolder(root, api);","atom":"a0","author":"init","version":0},{"n":220,"text":"\treturn {","atom":"a0","author":"init","version":0},{"n":221,"text":"\t\ttext: [","atom":"a0","author":"init","version":0},{"n":222,"text":"\t\t\t`Created project ${project} at version ${answer.version} from ${plural(files.size, \"text file\")} in ${root}.`,","atom":"a0","author":"init","version":0},{"n":223,"text":"\t\t\t...leftOutText(leftOut),","atom":"a0","author":"init","version":0},{"n":224,"text":"\t\t\t...(wroteIgnore","atom":"a0","author":"init","version":0},{"n":225,"text":"\t\t\t\t? [\"Wrote a starting .absoignore (Claude Code state and operating system files); edit it like .gitignore.\"]","atom":"a209","author":"review","version":27},{"n":226,"text":"\t\t\t\t: []),","atom":"a0","author":"init","version":0},{"n":227,"text":"\t\t\t// A local project has no CI to run abso.json, so no word about one that isn't there.","atom":"a2821","author":"pinch","version":287},{"n":228,"text":"\t\t\t...(local && wroteProject === \"nothing\" ? [] : startingProjectFileText(wroteProject)),","atom":"a2821","author":"pinch","version":287},{"n":229,"text":"\t\t\t...(answer.skipped && answer.skipped.length > 0 ? [`The server skipped: ${answer.skipped.join(\", \")}.`] : []),","atom":"a0","author":"init","version":0},{"n":230,"text":"\t\t\t...(local ? [localText(local.dir, project, ignoredStore)] : []),","atom":"a2821","author":"pinch","version":287},{"n":231,"text":"\t\t\t`This folder is agent ${config.agent}. Settings are in .abso/config.json.`,","atom":"a107","author":"review","version":17},{"n":232,"text":"\t\t\t...refusedText(synced.refused),","atom":"a0","author":"init","version":0},{"n":233,"text":"\t\t\t...(synced.kept.length > 0 ? [`Kept your copy of ${synced.kept.join(\", \")}.`] : []),","atom":"a0","author":"init","version":0},{"n":234,"text":"\t\t\thookHint(env.env, local !== undefined),","atom":"a2821","author":"pinch","version":287},{"n":235,"text":"\t\t].join(\"\\n\"),","atom":"a0","author":"init","version":0},{"n":236,"text":"\t\tjson: {","atom":"a0","author":"init","version":0},{"n":237,"text":"\t\t\tproject,","atom":"a0","author":"init","version":0},{"n":238,"text":"\t\t\tversion: answer.version,","atom":"a0","author":"init","version":0},{"n":239,"text":"\t\t\tfiles: files.size,","atom":"a0","author":"init","version":0},{"n":240,"text":"\t\t\troot,","atom":"a0","author":"init","version":0},{"n":241,"text":"\t\t\tagent: config.agent,","atom":"a0","author":"init","version":0},{"n":242,"text":"\t\t\twroteAbsoignore: wroteIgnore,","atom":"a2067","author":"box-grants","version":185},{"n":243,"text":"\t\t\twroteProjectFile: typeof wroteProject === \"string\" ? null : wroteProject,","atom":"a2067","author":"box-grants","version":185},{"n":244,"text":"\t\t\tleftOut,","atom":"a2067","author":"box-grants","version":185},{"n":245,"text":"\t\t\t...(local ? { store: local.dir } : {}),","atom":"a2821","author":"pinch","version":287},{"n":246,"text":"\t\t},","atom":"a2067","author":"box-grants","version":185},{"n":247,"text":"\t};","atom":"a2067","author":"box-grants","version":185},{"n":248,"text":"}","atom":"a2067","author":"box-grants","version":185},{"n":249,"text":"","atom":"a2067","author":"box-grants","version":185},{"n":250,"text":"/** The most a new project's folder may be from a box: the server takes a body up to 25 MB, base64 and JSON included. */","atom":"a2067","author":"box-grants","version":185},{"n":251,"text":"const BOX_INIT_MAX = 24 * 1024 * 1024;","atom":"a2067","author":"box-grants","version":185},{"n":252,"text":"/** The Idempotency-Key of an abso init that didn't finish, so running it again makes the same project (abso 663). */","atom":"a2067","author":"box-grants","version":185},{"n":253,"text":"const INIT_KEY = \"init-key\";","atom":"a2067","author":"box-grants","version":185},{"n":254,"text":"","atom":"a2067","author":"box-grants","version":185},{"n":255,"text":"/**","atom":"a2067","author":"box-grants","version":185},{"n":256,"text":" * abso init from a signed-in box (abso 663): the server makes the project as the person who approved the box, the way the","atom":"a2067","author":"box-grants","version":185},{"n":257,"text":" * website's New project does (owner, visibility, address), with the folder as its first version. This folder then","atom":"a2067","author":"box-grants","version":185},{"n":258,"text":" * joins it like abso join, with its own key from the box, so it works at once with no new approval.","atom":"a2067","author":"box-grants","version":185},{"n":259,"text":" */","atom":"a2067","author":"box-grants","version":185},{"n":260,"text":"async function initFromBox(","atom":"a2067","author":"box-grants","version":185},{"n":261,"text":"\targs: Parsed,","atom":"a2067","author":"box-grants","version":185},{"n":262,"text":"\tenv: Env,","atom":"a2067","author":"box-grants","version":185},{"n":263,"text":"\troot: string,","atom":"a2067","author":"box-grants","version":185},{"n":264,"text":"\tproject: string,","atom":"a2067","author":"box-grants","version":185},{"n":265,"text":"\tserver: string,","atom":"a2067","author":"box-grants","version":185},{"n":266,"text":"\tbox: BoxRecord,","atom":"a2067","author":"box-grants","version":185},{"n":267,"text":"): Promise<Output> {","atom":"a2067","author":"box-grants","version":185},{"n":268,"text":"\tif (!NAME.test(project))","atom":"a2067","author":"box-grants","version":185},{"n":269,"text":"\t\tthrow new UsageError(","atom":"a2072","author":"box-grants","version":185},{"n":270,"text":"\t\t\t`project names are letters, digits, dot, dash and underscore (got ${JSON.stringify(project)})`,","atom":"a2072","author":"box-grants","version":185},{"n":271,"text":"\t\t);","atom":"a2072","author":"box-grants","version":185},{"n":272,"text":"\tconst named = str(args, \"agent\");","atom":"a2067","author":"box-grants","version":185},{"n":273,"text":"\tif (named !== undefined) agentFrom(args);","atom":"a2067","author":"box-grants","version":185},{"n":274,"text":"\tconst asIs = bool(args, \"as-is\");","atom":"a2067","author":"box-grants","version":185},{"n":275,"text":"\tconst absoignore = join(root, \".absoignore\");","atom":"a2067","author":"box-grants","version":185},{"n":276,"text":"\tconst wroteIgnore = !asIs && !existsSync(absoignore) && !existsSync(join(root, \".avcsignore\"));","atom":"a2067","author":"box-grants","version":185},{"n":277,"text":"\tif (wroteIgnore) writeFileSync(absoignore, STARTING_ABSOIGNORE);","atom":"a2067","author":"box-grants","version":185},{"n":278,"text":"\tconst wroteProject = asIs ? \"exists\" : writeStartingProjectFile(root);","atom":"a2067","author":"box-grants","version":185},{"n":279,"text":"\tconst { files, blobs, leftOut } = readFolder(root, loadIgnore(root));","atom":"a2067","author":"box-grants","version":185},{"n":280,"text":"\tconst listed: NonNullable<NewProject[\"files\"]>[number][] = [","atom":"a2067","author":"box-grants","version":185},{"n":281,"text":"\t\t...[...files].map(([path, text]) => ({ path, text })),","atom":"a2067","author":"box-grants","version":185},{"n":282,"text":"\t\t...[...blobs].map(([path, b]) => ({ path, base64: Buffer.from(b.bytes).toString(\"base64\") })),","atom":"a2067","author":"box-grants","version":185},{"n":283,"text":"\t];","atom":"a2067","author":"box-grants","version":185},{"n":284,"text":"\tconst org = str(args, \"org\");","atom":"a2067","author":"box-grants","version":185},{"n":285,"text":"\tconst body: NewProject = {","atom":"a2067","author":"box-grants","version":185},{"n":286,"text":"\t\tname: project,","atom":"a2067","author":"box-grants","version":185},{"n":287,"text":"\t\t...(org === undefined ? {} : { owner: org }),","atom":"a2067","author":"box-grants","version":185},{"n":288,"text":"\t\t...(bool(args, \"public\")","atom":"a2072","author":"box-grants","version":185},{"n":289,"text":"\t\t\t? { visibility: \"public\" as const }","atom":"a2072","author":"box-grants","version":185},{"n":290,"text":"\t\t\t: bool(args, \"private\")","atom":"a2072","author":"box-grants","version":185},{"n":291,"text":"\t\t\t\t? { visibility: \"private\" as const }","atom":"a2072","author":"box-grants","version":185},{"n":292,"text":"\t\t\t\t: {}),","atom":"a2072","author":"box-grants","version":185},{"n":293,"text":"\t\t...(listed.length > 0 ? { files: listed } : {}),","atom":"a2067","author":"box-grants","version":185},{"n":294,"text":"\t};","atom":"a2067","author":"box-grants","version":185},{"n":295,"text":"\tif (JSON.stringify(body).length > BOX_INIT_MAX)","atom":"a2067","author":"box-grants","version":185},{"n":296,"text":"\t\tthrow new UsageError(","atom":"a2067","author":"box-grants","version":185},{"n":297,"text":"\t\t\t`${root} is over 24 MB to send. Make ${project} with abso init on a smaller folder (or on the website), then copy the rest in and push.`,","atom":"a2067","author":"box-grants","version":185},{"n":298,"text":"\t\t);","atom":"a2067","author":"box-grants","version":185},{"n":299,"text":"\t// One key per folder until it finishes: running the same abso init again is the same project, never a second.","atom":"a2067","author":"box-grants","version":185},{"n":300,"text":"\tconst keyPath = join(stateDir(root), INIT_KEY);","atom":"a2067","author":"box-grants","version":185},{"n":301,"text":"\tlet key = existsSync(keyPath) ? readFileSync(keyPath, \"utf8\").trim() : \"\";","atom":"a2067","author":"box-grants","version":185},{"n":302,"text":"\tif (!/^[0-9a-f-]{36}$/.test(key)) {","atom":"a2067","author":"box-grants","version":185},{"n":303,"text":"\t\tkey = randomUUID();","atom":"a2067","author":"box-grants","version":185},{"n":304,"text":"\t\tmkdirSync(stateDir(root), { recursive: true });","atom":"a2067","author":"box-grants","version":185},{"n":305,"text":"\t\twriteFileSync(keyPath, key);","atom":"a2067","author":"box-grants","version":185},{"n":306,"text":"\t}","atom":"a2067","author":"box-grants","version":185},{"n":307,"text":"\tconst made = await boxCreateProject(box, body, key);","atom":"a2067","author":"box-grants","version":185},{"n":308,"text":"\tconst visibility = typeof made.visibility === \"string\" ? made.visibility : \"private\";","atom":"a2067","author":"box-grants","version":185},{"n":309,"text":"\tconst minted =","atom":"a2067","author":"box-grants","version":185},{"n":310,"text":"\t\tnamed !== undefined","atom":"a2067","author":"box-grants","version":185},{"n":311,"text":"\t\t\t? { ...(await mintKey(box, project, named)), agent: named }","atom":"a2067","author":"box-grants","version":185},{"n":312,"text":"\t\t\t: await mintFreeName(box, project, defaultAgentName());","atom":"a2067","author":"box-grants","version":185},{"n":313,"text":"\tconst config = { server, project, agent: minted.agent };","atom":"a2067","author":"box-grants","version":185},{"n":314,"text":"\twriteConfig(root, config);","atom":"a2067","author":"box-grants","version":185},{"n":315,"text":"\tclearKnown(root);","atom":"a2067","author":"box-grants","version":185},{"n":316,"text":"\tinstallKey(root, JSON.stringify({ key: minted.key, id: minted.id }));","atom":"a2067","author":"box-grants","version":185},{"n":317,"text":"\trmSync(keyPath, { force: true });","atom":"a2067","author":"box-grants","version":185},{"n":318,"text":"\tconst synced = await syncFolder(root, new Api(readConfig(root, env.env)), true);","atom":"a2067","author":"box-grants","version":185},{"n":319,"text":"\tconst owner = org ?? \"you\";","atom":"a2067","author":"box-grants","version":185},{"n":320,"text":"\treturn {","atom":"a2067","author":"box-grants","version":185},{"n":321,"text":"\t\ttext: [","atom":"a2067","author":"box-grants","version":185},{"n":322,"text":"\t\t\t`Created project ${project} (${visibility}, owned by ${owner}) at version ${synced.version} from ${plural(listed.length, \"file\")} in ${root}.`,","atom":"a2067","author":"box-grants","version":185},{"n":323,"text":"\t\t\t...leftOutText(leftOut),","atom":"a2067","author":"box-grants","version":185},{"n":324,"text":"\t\t\t...(wroteIgnore","atom":"a2067","author":"box-grants","version":185},{"n":325,"text":"\t\t\t\t? [\"Wrote a starting .absoignore (Claude Code state and operating system files); edit it like .gitignore.\"]","atom":"a2067","author":"box-grants","version":185},{"n":326,"text":"\t\t\t\t: []),","atom":"a2067","author":"box-grants","version":185},{"n":327,"text":"\t\t\t...startingProjectFileText(wroteProject),","atom":"a2067","author":"box-grants","version":185},{"n":328,"text":"\t\t\t`This folder is agent ${minted.agent}, with its own key, ${minted.id}, made from this box's sign-in. Settings are in .abso/config.json.`,","atom":"a2067","author":"box-grants","version":185},{"n":329,"text":"\t\t\t...refusedText(synced.refused),","atom":"a2067","author":"box-grants","version":185},{"n":330,"text":"\t\t\t...(synced.written.length > 0 ? [`Wrote ${plural(synced.written.length, \"file\")} from shared.`] : []),","atom":"a2067","author":"box-grants","version":185},{"n":331,"text":"\t\t\thookHint(env.env),","atom":"a2067","author":"box-grants","version":185},{"n":332,"text":"\t\t].join(\"\\n\"),","atom":"a2067","author":"box-grants","version":185},{"n":333,"text":"\t\tjson: {","atom":"a2067","author":"box-grants","version":185},{"n":334,"text":"\t\t\tproject,","atom":"a2067","author":"box-grants","version":185},{"n":335,"text":"\t\t\tid: made.id ?? null,","atom":"a2067","author":"box-grants","version":185},{"n":336,"text":"\t\t\towner: made.owner ?? null,","atom":"a2067","author":"box-grants","version":185},{"n":337,"text":"\t\t\tvisibility,","atom":"a2067","author":"box-grants","version":185},{"n":338,"text":"\t\t\tversion: synced.version,","atom":"a2067","author":"box-grants","version":185},{"n":339,"text":"\t\t\tfiles: listed.length,","atom":"a2067","author":"box-grants","version":185},{"n":340,"text":"\t\t\troot,","atom":"a2067","author":"box-grants","version":185},{"n":341,"text":"\t\t\tagent: minted.agent,","atom":"a2067","author":"box-grants","version":185},{"n":342,"text":"\t\t\tkey_id: minted.id,","atom":"a2067","author":"box-grants","version":185},{"n":343,"text":"\t\t\twroteAbsoignore: wroteIgnore,","atom":"a209","author":"review","version":27},{"n":344,"text":"\t\t\twroteProjectFile: typeof wroteProject === \"string\" ? null : wroteProject,","atom":"a0","author":"init","version":0},{"n":345,"text":"\t\t\tleftOut,","atom":"a0","author":"init","version":0},{"n":346,"text":"\t\t},","atom":"a0","author":"init","version":0},{"n":347,"text":"\t};","atom":"a0","author":"init","version":0},{"n":348,"text":"}","atom":"a0","author":"init","version":0},{"n":349,"text":"","atom":"a0","author":"init","version":0},{"n":350,"text":"/**","atom":"a621","author":"trials","version":63},{"n":351,"text":" * Where abso join writes: --dir, else here when --agent is given (as before, so a folder prepared with","atom":"a627","author":"trials","version":64},{"n":352,"text":" * abso key install --server is joined where its key is). With no --agent: here when this folder is empty, else","atom":"a627","author":"trials","version":64},{"n":353,"text":" * ./<project>, which has to be new or empty so nobody's files are written over. A folder holding only abso's own","atom":"a627","author":"trials","version":64},{"n":354,"text":" * state folder counts as empty.","atom":"a627","author":"trials","version":64},{"n":355,"text":" */","atom":"a621","author":"trials","version":63},{"n":356,"text":"export function joinFolder(args: Parsed, env: Pick<Env, \"cwd\">, project: string): string {","atom":"a627","author":"trials","version":64},{"n":357,"text":"\tconst dir = str(args, \"dir\");","atom":"a621","author":"trials","version":63},{"n":358,"text":"\tif (dir !== undefined) return resolve(env.cwd, dir);","atom":"a621","author":"trials","version":63},{"n":359,"text":"\tif (str(args, \"agent\") !== undefined) return resolve(env.cwd);","atom":"a627","author":"trials","version":64},{"n":360,"text":"\tconst empty = (path: string) => readdirSync(path).every((name) => name === STATE_DIR || name === OLD_STATE_DIR);","atom":"a627","author":"trials","version":64},{"n":361,"text":"\tif (empty(env.cwd)) return resolve(env.cwd);","atom":"a621","author":"trials","version":63},{"n":362,"text":"\tconst sub = resolve(env.cwd, project);","atom":"a621","author":"trials","version":63},{"n":363,"text":"\tif (existsSync(sub) && (!statSync(sub).isDirectory() || !empty(sub)))","atom":"a621","author":"trials","version":63},{"n":364,"text":"\t\tthrow new UsageError(`${sub} already has files in it: say where to join with --dir <folder>`);","atom":"a621","author":"trials","version":63},{"n":365,"text":"\treturn sub;","atom":"a621","author":"trials","version":63},{"n":366,"text":"}","atom":"a621","author":"trials","version":63},{"n":367,"text":"","atom":"a621","author":"trials","version":63},{"n":368,"text":"/** Signed out, the server doesn't say who owns a project, and the website puts every project under this one owner for now. */","atom":"a653","author":"pinch","version":70},{"n":369,"text":"const SITE_OWNER = \"christopher\";","atom":"a653","author":"pinch","version":70},{"n":370,"text":"","atom":"a653","author":"pinch","version":70},{"n":371,"text":"/**","atom":"a647","author":"pinch","version":69},{"n":372,"text":" * Whether anyone can read the project: its status answers with no credentials. Only the answer's code","atom":"a776","author":"pinch","version":86},{"n":373,"text":" * counts, never its body, and no redirect is followed. A private project and a missing one look the same.","atom":"a776","author":"pinch","version":86},{"n":374,"text":" */","atom":"a647","author":"pinch","version":69},{"n":375,"text":"export async function isPublic(server: string, project: string): Promise<boolean> {","atom":"a776","author":"pinch","version":86},{"n":376,"text":"\ttry {","atom":"a647","author":"pinch","version":69},{"n":377,"text":"\t\tconst response = await fetch(new URL(`/p/${encodeURIComponent(project)}/status`, server), {","atom":"a776","author":"pinch","version":86},{"n":378,"text":"\t\t\tredirect: \"error\",","atom":"a776","author":"pinch","version":86},{"n":379,"text":"\t\t\tsignal: AbortSignal.timeout(3000),","atom":"a776","author":"pinch","version":86},{"n":380,"text":"\t\t});","atom":"a776","author":"pinch","version":86},{"n":381,"text":"\t\treturn response.status === 200;","atom":"a776","author":"pinch","version":86},{"n":382,"text":"\t} catch {","atom":"a776","author":"pinch","version":86},{"n":383,"text":"\t\treturn false;","atom":"a776","author":"pinch","version":86},{"n":384,"text":"\t}","atom":"a776","author":"pinch","version":86},{"n":385,"text":"}","atom":"a776","author":"pinch","version":86},{"n":386,"text":"","atom":"a776","author":"pinch","version":86},{"n":387,"text":"/**","atom":"a776","author":"pinch","version":86},{"n":388,"text":" * Why a join failed signed out. Without --reader, the client reads only as an agent, which needs a","atom":"a776","author":"pinch","version":86},{"n":389,"text":" * sign-in; a public project is read signed out on the website, or with abso join --reader.","atom":"a776","author":"pinch","version":86},{"n":390,"text":" */","atom":"a776","author":"pinch","version":86},{"n":391,"text":"async function signedOut(server: string, project: string): Promise<string> {","atom":"a647","author":"pinch","version":69},{"n":392,"text":"\treturn (await isPublic(server, project))","atom":"a776","author":"pinch","version":86},{"n":393,"text":"\t\t? `${project} is public: read it at ${siteOf(server)}/${SITE_OWNER}/${project} (every page is also JSON), or here with abso join ${project} --reader. To work on it: abso login.`","atom":"a776","author":"pinch","version":86},{"n":394,"text":"\t\t: `This box isn't signed in to ${server}. abso login signs it in.${elsewhereText(server, `abso join ${project}`)}`;","atom":"a1578","author":"speed","version":156},{"n":395,"text":"}","atom":"a776","author":"pinch","version":86},{"n":396,"text":"","atom":"a776","author":"pinch","version":86},{"n":397,"text":"/** A folder that reads a public project signed out: no agent, no key, no copy of the files. */","atom":"a776","author":"pinch","version":86},{"n":398,"text":"async function joinAsVisitor(root: string, server: string, project: string, env: Env): Promise<Output> {","atom":"a776","author":"pinch","version":86},{"n":399,"text":"\twriteConfig(root, { server, project, agent: \"\", visitor: true });","atom":"a776","author":"pinch","version":86},{"n":400,"text":"\tconst api = new Api(readConfig(root, env.env));","atom":"a776","author":"pinch","version":86},{"n":401,"text":"\tlet version: number;","atom":"a776","author":"pinch","version":86},{"n":402,"text":"\ttry {","atom":"a776","author":"pinch","version":86},{"n":403,"text":"\t\tversion = (await api.status()).version;","atom":"a776","author":"pinch","version":86},{"n":404,"text":"\t} catch (error) {","atom":"a776","author":"pinch","version":86},{"n":405,"text":"\t\trmSync(stateDir(root), { recursive: true, force: true });","atom":"a776","author":"pinch","version":86},{"n":406,"text":"\t\tthrow error;","atom":"a776","author":"pinch","version":86},{"n":407,"text":"\t}","atom":"a776","author":"pinch","version":86},{"n":408,"text":"\treturn {","atom":"a776","author":"pinch","version":86},{"n":409,"text":"\t\ttext: [","atom":"a776","author":"pinch","version":86},{"n":410,"text":"\t\t\t`Joined ${project} to read it signed out, at version ${version}, in ${root}. Nothing is sent with a sign-in, and nothing here is recorded.`,","atom":"a776","author":"pinch","version":86},{"n":411,"text":"\t\t\t`This folder holds no copy of the files: abso files lists them, abso show ${version}:<file> prints one, and status, log, blame, why, where, issues, issue and search read the rest.`,","atom":"a776","author":"pinch","version":86},{"n":412,"text":"\t\t\t`To work on ${project}: abso login, then abso join ${project} in a new folder.`,","atom":"a776","author":"pinch","version":86},{"n":413,"text":"\t\t\t...(root === resolve(env.cwd) ? [] : [`cd ${relative(env.cwd, root) || root}`]),","atom":"a776","author":"pinch","version":86},{"n":414,"text":"\t\t].join(\"\\n\"),","atom":"a776","author":"pinch","version":86},{"n":415,"text":"\t\tjson: { project, visitor: true, version, root },","atom":"a776","author":"pinch","version":86},{"n":416,"text":"\t};","atom":"a776","author":"pinch","version":86},{"n":417,"text":"}","atom":"a647","author":"pinch","version":69},{"n":418,"text":"","atom":"a2766","author":"pinch","version":281},{"n":419,"text":"/** A join that failed before writing files: its state goes, but a key (already here, or made for it) stays for the next try. */","atom":"a2766","author":"pinch","version":281},{"n":420,"text":"function takeBackJoin(root: string): void {","atom":"a2766","author":"pinch","version":281},{"n":421,"text":"\tconst dir = stateDir(root);","atom":"a2766","author":"pinch","version":281},{"n":422,"text":"\tif (!existsSync(join(dir, \"key\"))) {","atom":"a2766","author":"pinch","version":281},{"n":423,"text":"\t\trmSync(dir, { recursive: true, force: true });","atom":"a2766","author":"pinch","version":281},{"n":424,"text":"\t\treturn;","atom":"a2766","author":"pinch","version":281},{"n":425,"text":"\t}","atom":"a2766","author":"pinch","version":281},{"n":426,"text":"\tfor (const entry of readdirSync(dir)) if (entry !== \"key\") rmSync(join(dir, entry), { recursive: true, force: true });","atom":"a2766","author":"pinch","version":281},{"n":427,"text":"}","atom":"a2766","author":"pinch","version":281},{"n":428,"text":"","atom":"a645","author":"pinch","version":69},{"n":429,"text":"export async function runJoin(args: Parsed, env: Env): Promise<Output> {","atom":"a0","author":"init","version":0},{"n":430,"text":"\tif (args.positionals.length !== 1) throw new UsageError(\"join takes the project name: abso join <project>\");","atom":"a621","author":"trials","version":63},{"n":431,"text":"\tconst project = args.positionals[0]!;","atom":"a0","author":"init","version":0},{"n":432,"text":"\tif (!NAME.test(project))","atom":"a621","author":"trials","version":63},{"n":433,"text":"\t\tthrow new UsageError(","atom":"a621","author":"trials","version":63},{"n":434,"text":"\t\t\t`project names are letters, digits, dot, dash and underscore (got ${JSON.stringify(project)})`,","atom":"a621","author":"trials","version":63},{"n":435,"text":"\t\t);","atom":"a621","author":"trials","version":63},{"n":436,"text":"\tconst root = joinFolder(args, env, project);","atom":"a621","author":"trials","version":63},{"n":437,"text":"\tmkdirSync(root, { recursive: true });","atom":"a0","author":"init","version":0},{"n":438,"text":"\tif (findRoot(root) === root) throw new UsageError(`${root} already has .abso/config.json`);","atom":"a107","author":"review","version":17},{"n":439,"text":"\tconst reader = bool(args, \"reader\");","atom":"a0","author":"init","version":0},{"n":440,"text":"\t// A local project: no box, key or credential, and the agent is --agent or this computer's name.","atom":"a2821","author":"pinch","version":287},{"n":441,"text":"\tconst local = localFrom(args, env, \"join\");","atom":"a2821","author":"pinch","version":287},{"n":442,"text":"\tconst server = local ? LOCAL : serverFrom(args, env);","atom":"a2821","author":"pinch","version":287},{"n":443,"text":"\tconst box = local ? undefined : readBox(server);","atom":"a2821","author":"pinch","version":287},{"n":444,"text":"\tconst hasKey = !local && existsSync(join(stateDir(root), \"key\"));","atom":"a2821","author":"pinch","version":287},{"n":445,"text":"\tconst credential = local ? undefined : tokenCredential(args, env.env, server, root);","atom":"a2821","author":"pinch","version":287},{"n":446,"text":"\tconst tokenFileAsked = bool(args, \"token-file\");","atom":"a2685","author":"readspeed","version":268},{"n":447,"text":"\tlet agent: string;","atom":"a621","author":"trials","version":63},{"n":448,"text":"\tlet minted: { key: string; id: string } | undefined;","atom":"a621","author":"trials","version":63},{"n":449,"text":"\tif (local) agent = agentFrom(args, str(args, \"agent\") ?? defaultAgentName());","atom":"a2821","author":"pinch","version":287},{"n":450,"text":"\telse if (str(args, \"agent\") !== undefined) {","atom":"a2821","author":"pinch","version":287},{"n":451,"text":"\t\tagent = agentFrom(args);","atom":"a621","author":"trials","version":63},{"n":452,"text":"\t\tminted =","atom":"a2685","author":"readspeed","version":268},{"n":453,"text":"\t\t\tbox && !hasKey && !fromEnv(env.env, \"KEY_FILE\") && !tokenFileAsked","atom":"a2685","author":"readspeed","version":268},{"n":454,"text":"\t\t\t\t? await mintKey(box, project, agent)","atom":"a2685","author":"readspeed","version":268},{"n":455,"text":"\t\t\t\t: undefined;","atom":"a2685","author":"readspeed","version":268},{"n":456,"text":"\t} else if (fromEnv(env.env, \"KEY_FILE\")) {","atom":"a804","author":"pinch","version":95},{"n":457,"text":"\t\t// A pipeline run's key (ABSO_KEY_FILE) belongs to one agent, which the runner names in ABSO_AGENT.","atom":"a804","author":"pinch","version":95},{"n":458,"text":"\t\tconst named = fromEnv(env.env, \"AGENT\");","atom":"a804","author":"pinch","version":95},{"n":459,"text":"\t\tif (!named)","atom":"a804","author":"pinch","version":95},{"n":460,"text":"\t\t\tthrow new UsageError(\"a pipeline run's key joins as its own agent: give it with --agent <name> or ABSO_AGENT\");","atom":"a804","author":"pinch","version":95},{"n":461,"text":"\t\tagent = agentFrom(args, named);","atom":"a804","author":"pinch","version":95},{"n":462,"text":"\t} else {","atom":"a621","author":"trials","version":63},{"n":463,"text":"\t\t// No --agent: the box's name, or the next free -2, -3. Not signed in, --reader reads a public project signed out.","atom":"a776","author":"pinch","version":86},{"n":464,"text":"\t\tif (!box && reader && !hasKey && (await isPublic(server, project)))","atom":"a776","author":"pinch","version":86},{"n":465,"text":"\t\t\treturn joinAsVisitor(root, server, project, env);","atom":"a776","author":"pinch","version":86},{"n":466,"text":"\t\tif (!box)","atom":"a647","author":"pinch","version":69},{"n":467,"text":"\t\t\tthrow new UsageError(","atom":"a647","author":"pinch","version":69},{"n":468,"text":"\t\t\t\t`${await signedOut(server, project)} (A folder that already has a key joins with --agent <name>.)`,","atom":"a647","author":"pinch","version":69},{"n":469,"text":"\t\t\t);","atom":"a647","author":"pinch","version":69},{"n":470,"text":"\t\tif (hasKey) throw new UsageError(`${root} already has a key: give its agent's name with --agent <name>`);","atom":"a621","author":"trials","version":63},{"n":471,"text":"\t\tconst free = await mintFreeName(box, project, defaultAgentName());","atom":"a621","author":"trials","version":63},{"n":472,"text":"\t\tagent = free.agent;","atom":"a621","author":"trials","version":63},{"n":473,"text":"\t\tminted = { key: free.key, id: free.id };","atom":"a621","author":"trials","version":63},{"n":474,"text":"\t}","atom":"a621","author":"trials","version":63},{"n":475,"text":"\tconst config = { server, project, agent, ...(reader ? { reader: true } : {}), ...local?.settings };","atom":"a2821","author":"pinch","version":287},{"n":476,"text":"\twriteConfig(root, config);","atom":"a0","author":"init","version":0},{"n":477,"text":"\tclearKnown(root);","atom":"a0","author":"init","version":0},{"n":478,"text":"\tif (minted) installKey(root, JSON.stringify(minted));","atom":"a0","author":"init","version":0},{"n":479,"text":"\t// The token file only with --token-file: readConfig reads it otherwise.","atom":"a2685","author":"readspeed","version":268},{"n":480,"text":"\tlet read: ReturnType<typeof readConfig>;","atom":"a2776","author":"pinch","version":281},{"n":481,"text":"\ttry {","atom":"a2776","author":"pinch","version":281},{"n":482,"text":"\t\tread = readConfig(root, env.env, false);","atom":"a2776","author":"pinch","version":281},{"n":483,"text":"\t} catch (error) {","atom":"a2776","author":"pinch","version":281},{"n":484,"text":"\t\ttakeBackJoin(root);","atom":"a2776","author":"pinch","version":281},{"n":485,"text":"\t\tthrow error;","atom":"a2776","author":"pinch","version":281},{"n":486,"text":"\t}","atom":"a2776","author":"pinch","version":281},{"n":487,"text":"\tconst settings = tokenFileAsked ? { ...read, token: credential?.token } : read;","atom":"a2685","author":"readspeed","version":268},{"n":488,"text":"\tif (!local)","atom":"a2821","author":"pinch","version":287},{"n":489,"text":"\t\t(env.writeErr ?? env.write)(","atom":"a2821","author":"pinch","version":287},{"n":490,"text":"\t\t\t`Signing in with ${minted && box ? `a new key from this box's sign-in, ${box.id}` : hasKey ? \"this folder's key\" : (credential?.words ?? `no credential: nothing here signs in to ${server}`)}.","atom":"a2821","author":"pinch","version":287},{"n":491,"text":"`,","atom":"a2685","author":"readspeed","version":268},{"n":492,"text":"\t\t);","atom":"a2821","author":"pinch","version":287},{"n":493,"text":"\tconst api = new Api(settings);","atom":"a0","author":"init","version":0},{"n":494,"text":"\tlet answer: SyncAnswer;","atom":"a2765","author":"pinch","version":281},{"n":495,"text":"\ttry {","atom":"a0","author":"init","version":0},{"n":496,"text":"\t\t// Before the sync, so the server never takes a record from this folder.","atom":"a0","author":"init","version":0},{"n":497,"text":"\t\tif (reader) await api.reader(true);","atom":"a0","author":"init","version":0},{"n":498,"text":"\t\t// Every file, even when the server has seen this agent sync before: its plain sync answer would hold only what changed since (#37).","atom":"a0","author":"init","version":0},{"n":499,"text":"\t\tanswer = await pullAnswer(root, api, true);","atom":"a2765","author":"pinch","version":281},{"n":500,"text":"\t} catch (error) {","atom":"a0","author":"init","version":0},{"n":501,"text":"\t\t// Nothing is written yet: take back what join wrote so it can run again here.","atom":"a2765","author":"pinch","version":281},{"n":502,"text":"\t\ttakeBackJoin(root);","atom":"a2765","author":"pinch","version":281},{"n":503,"text":"\t\tif (!(error instanceof ApiError && error.status === 401 && !box && !settings.token)) throw error;","atom":"a0","author":"init","version":0},{"n":504,"text":"\t\tconst why = await signedOut(config.server, project);","atom":"a2685","author":"readspeed","version":268},{"n":505,"text":"\t\tthrow new UsageError(!tokenFileAsked && tokenFile() !== undefined ? `${why} ${TOKEN_FILE_ASKED}` : why);","atom":"a2685","author":"readspeed","version":268},{"n":506,"text":"\t}","atom":"a0","author":"init","version":0},{"n":507,"text":"\tconst synced = await applyAnswer(root, api, answer);","atom":"a2765","author":"pinch","version":281},{"n":508,"text":"\tpullWritten(root);","atom":"a2765","author":"pinch","version":281},{"n":509,"text":"\treturn {","atom":"a0","author":"init","version":0},{"n":510,"text":"\t\ttext: [","atom":"a0","author":"init","version":0},{"n":511,"text":"\t\t\t`Joined ${project} as ${config.agent} at version ${synced.version}: wrote ${plural(synced.written.length, \"file\")} into ${root}.${reader ? \" It is a reader: status, pull, log, show, files and export work, and nothing it does is recorded or pushed.\" : \"\"}${minted ? ` It signs in with its own key, ${minted.id}, made from this box's sign-in.` : \"\"}`,","atom":"a844","author":"rename","version":100},{"n":512,"text":"\t\t\t...refusedText(synced.refused),","atom":"a0","author":"init","version":0},{"n":513,"text":"\t\t\t...(synced.kept.length > 0","atom":"a0","author":"init","version":0},{"n":514,"text":"\t\t\t\t? [","atom":"a0","author":"init","version":0},{"n":515,"text":"\t\t\t\t\t\t`These files were already here and differ from shared, so they were left alone: ${synced.kept.join(\", \")}. abso record sends them as your changes.`,","atom":"a0","author":"init","version":0},{"n":516,"text":"\t\t\t\t\t]","atom":"a0","author":"init","version":0},{"n":517,"text":"\t\t\t\t: []),","atom":"a0","author":"init","version":0},{"n":518,"text":"\t\t\t...(local ? [localText(local.dir, project)] : []),","atom":"a2821","author":"pinch","version":287},{"n":519,"text":"\t\t\t...emptyHint(synced.version, synced.written.length, synced.kept.length, reader),","atom":"a2413","author":"onboard","version":224},{"n":520,"text":"\t\t\t...setupHint(root),","atom":"a0","author":"init","version":0},{"n":521,"text":"\t\t\thookHint(env.env, local !== undefined),","atom":"a2821","author":"pinch","version":287},{"n":522,"text":"\t\t\t...(root === resolve(env.cwd) ? [] : [`cd ${relative(env.cwd, root) || root}`]),","atom":"a621","author":"trials","version":63},{"n":523,"text":"\t\t].join(\"\\n\"),","atom":"a0","author":"init","version":0},{"n":524,"text":"\t\tjson: {","atom":"a0","author":"init","version":0},{"n":525,"text":"\t\t\tproject,","atom":"a0","author":"init","version":0},{"n":526,"text":"\t\t\tagent: config.agent,","atom":"a0","author":"init","version":0},{"n":527,"text":"\t\t\tversion: synced.version,","atom":"a0","author":"init","version":0},{"n":528,"text":"\t\t\twritten: synced.written,","atom":"a0","author":"init","version":0},{"n":529,"text":"\t\t\tkept: synced.kept,","atom":"a0","author":"init","version":0},{"n":530,"text":"\t\t\trefused: synced.refused,","atom":"a0","author":"init","version":0},{"n":531,"text":"\t\t\troot,","atom":"a0","author":"init","version":0},{"n":532,"text":"\t\t},","atom":"a0","author":"init","version":0},{"n":533,"text":"\t};","atom":"a0","author":"init","version":0},{"n":534,"text":"}","atom":"a0","author":"init","version":0},{"n":535,"text":"","atom":"a0","author":"init","version":0},{"n":536,"text":"/** What to run before building or testing here (#43): a joined folder has the project's files, not what avcs.json's setup installs. */","atom":"a315","author":"infra-split","version":37},{"n":537,"text":"function setupHint(root: string): string[] {","atom":"a0","author":"init","version":0},{"n":538,"text":"\tconst read = readProjectFile(root);","atom":"a0","author":"init","version":0},{"n":539,"text":"\tconst setup = read !== null && \"file\" in read ? read.file.setup : \"\";","atom":"a0","author":"init","version":0},{"n":540,"text":"\treturn setup === \"\"","atom":"a0","author":"init","version":0},{"n":541,"text":"\t\t? []","atom":"a0","author":"init","version":0},{"n":542,"text":"\t\t: [`Nothing is installed yet. Before building or testing here, run ${projectFileName(root)}'s setup: ${setup}`];","atom":"a234","author":"review","version":28},{"n":543,"text":"}","atom":"a0","author":"init","version":0},{"n":544,"text":"","atom":"a0","author":"init","version":0},{"n":545,"text":"function hookHint(env: Readonly<Record<string, string | undefined>>, local = false): string {","atom":"a2821","author":"pinch","version":287},{"n":546,"text":"\t// A local project has no server: the mod hands its edits to abso hook, when it was installed with one to hand them to.","atom":"a2866","author":"pinch","version":293},{"n":547,"text":"\tif (local) {","atom":"a2866","author":"pinch","version":293},{"n":548,"text":"\t\tif (modHandsLocal(env))","atom":"a2866","author":"pinch","version":293},{"n":549,"text":"\t\t\treturn \"Edits made by Claude Code here are recorded by the abso mod on this machine, through abso hook. Anything else: abso record.\";","atom":"a2866","author":"pinch","version":293},{"n":550,"text":"\t\tif (modInstalled(env) && !builtCopy())","atom":"a2866","author":"pinch","version":293},{"n":551,"text":"\t\t\treturn `abso record sends the edits made here: the abso mod on this machine is older than local projects. ${installerCommand(\"install-mod.ts\")} updates it, and new chats load it.`;","atom":"a2866","author":"pinch","version":293},{"n":552,"text":"\t\treturn \"abso record sends the edits made here, whoever made them.\";","atom":"a2866","author":"pinch","version":293},{"n":553,"text":"\t}","atom":"a2866","author":"pinch","version":293},{"n":554,"text":"\tif (modInstalled(env))","atom":"a2765","author":"pinch","version":281},{"n":555,"text":"\t\treturn \"Edits made by Claude Code here are recorded by the abso mod on this machine, signed in as this folder. Anything else: abso record.\";","atom":"a2765","author":"pinch","version":281},{"n":556,"text":"\t// A built copy (the npm package) has no installer to point at (abso-core 18).","atom":"a2765","author":"pinch","version":281},{"n":557,"text":"\tif (builtCopy()) return \"abso record sends the edits made here, whoever made them.\";","atom":"a2765","author":"pinch","version":281},{"n":558,"text":"\treturn `Edits made by Claude Code reach the server through the abso mod, which isn't on this machine yet: ${installerCommand(\"install-mod.ts\")} installs it, and new chats load it. Anything else: abso record.`;","atom":"a2765","author":"pinch","version":281},{"n":559,"text":"}","atom":"a0","author":"init","version":0}],"atoms":[{"atom":"a0","author":"init","message":"Start the project","time":1791506895507,"timeIso":"2026-10-09T00:48:15.507Z","publish":{"draft":null,"version":0,"agent":"init","message":"Start the project","time":1791506895507,"timeIso":"2026-10-09T00:48:15.507Z"}},{"atom":"a107","author":"review","message":"","time":1791522261912,"timeIso":"2026-10-09T05:04:21.912Z","publish":{"draft":null,"version":17,"agent":"review","message":"New folders keep their state in .abso/, and the machine's sign-in, servers and admin token are read from ~/.abso/ first, then ~/.avcs/. A folder made before, with only .avcs/, is untouched: it keeps working, is never half-moved, and no older client or mod loses it. stateDir(root) and homeFile/homeWritePath are in the new client/src/state-dir.ts and replace the old AVCS_DIR constant everywhere. abso login writes only to ~/.abso/ and leaves ~/.avcs/ alone; logout removes both copies. The edit mod and the view mod read either folder. .abso is skipped like .avcs (including its odd spellings), the git exclude names whichever folder is in use, and the messages name .abso. Not changed: avcs.json (the server reads that name, so abso.json needs the server to learn it first), .avcsignore, env var names and wire headers. Tests: 709 run, 708 pass (one is skipped), including new ones for the folder choice, the home-file order and box sign-in; biome ci has no errors.","time":1791522270512,"timeIso":"2026-10-09T05:04:30.512Z"}},{"atom":"a209","author":"review","message":"","time":1791533506483,"timeIso":"2026-10-09T08:11:46.483Z","publish":{"draft":null,"version":27,"agent":"review","message":"Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)","time":1791533840174,"timeIso":"2026-10-09T08:17:20.174Z"}},{"atom":"a234","author":"review","message":"","time":1791539181105,"timeIso":"2026-10-09T09:46:21.105Z","publish":{"draft":null,"version":28,"agent":"review","message":"Client: abso.json is the project file (avcs.json still read; a new project gets abso.json unless it has either); new folders get .abso when no installed mod is older than 0.2.0; both mods are 0.2.0 (abso 253, 224)","time":1791539181568,"timeIso":"2026-10-09T09:46:21.568Z"}},{"atom":"a315","author":"infra-split","message":"","time":1791546813593,"timeIso":"2026-10-09T11:53:33.593Z","publish":{"draft":null,"version":37,"agent":"infra-split","message":"Comments and test names give each reason in plain words, without naming who raised it\n\nNotes like \"(#37, Builder 5)\" or \"(AVCS - Security)\" become \"(#37)\" or go, and a private commit hash after a name goes with it. Issue numbers and references such as git's CVE-2019-1353 stay. Only comments and test names change; no behavior changes.","time":1791547035956,"timeIso":"2026-10-09T11:57:15.956Z"}},{"atom":"a621","author":"trials","message":"","time":1791601554431,"timeIso":"2026-10-10T03:05:54.431Z","publish":{"draft":null,"version":63,"agent":"trials","message":"abso join <project> works with no --agent and no --dir (abso issue 351), so the project page can show npx abso-cli join <project>.\n\n- Agent: the box's name (the hostname abso login sends), lower-cased; if taken, <name>-2, -3, up to 20 tries. Names this box already holds in the project (GET /box) are skipped without minting, since minting one again replaces that agent's key and would cut off its folder. A 409 for a taken name moves on; the agent-limit 409 says the limit and where to revoke. No box sign-in: abso login first, or --agent.\n- Folder: --dir, else here when empty, else ./<project>, which must be new or empty; it prints cd <folder> when it isn't here.\n- --agent, --dir and --server still win. Project names are checked before use as a folder.\nTests: box.test.ts (mintFreeName: held name skipped, 409 moves on, agent limit), client.test.ts (empty folder, ./<project>, refusing a non-empty one); the git line-endings test now joins with --dir . since its folder has files.","time":1791601556423,"timeIso":"2026-10-10T03:05:56.423Z"}},{"atom":"a627","author":"trials","message":"","time":1791601972847,"timeIso":"2026-10-10T03:12:52.847Z","publish":{"draft":null,"version":64,"agent":"trials","message":"join: a folder prepared with abso key install --server is joined where it is again (Pinch's catch on 63).\n\n- --agent keeps 'here' as the default, as before 63, so scripts that join into a prepared folder still do. The ./<project> rule is only for a join with no --agent.\n- A folder holding only abso's own state folder (.abso, or the older .avcs) counts as empty.\n- New tests: joinFolder's rule (empty, only .abso, files here, --agent, --dir, a taken ./<project>), and a runJoin test that installs a key with --server and joins with --agent and no --dir: it joins here and sends that key (the shared token is wrong, so only the key gets through). The git line-endings test is back to joining without --dir.\n- Issue numbers taken out of the new code comments and test names.","time":1791601975047,"timeIso":"2026-10-10T03:12:55.047Z"}},{"atom":"a645","author":"pinch","message":"","time":1791607141430,"timeIso":"2026-10-10T04:39:01.430Z","publish":{"draft":null,"version":69,"agent":"pinch","message":"join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.","time":1791607846461,"timeIso":"2026-10-10T04:50:46.461Z"}},{"atom":"a647","author":"pinch","message":"","time":1791607395888,"timeIso":"2026-10-10T04:43:15.888Z","publish":{"draft":null,"version":69,"agent":"pinch","message":"join, signed out: for a public project, the error names its page on the website and says the client needs a sign-in, even to read ('abso-core is public: read it at https://abso.dev/p/abso-core (every page is also JSON). The client needs a sign-in, even to read: abso login.'). Whether it's public is asked of the server with no credentials. A project that isn't public keeps the plain 'abso login signs it in'. Product Lead's wording.","time":1791607846461,"timeIso":"2026-10-10T04:50:46.461Z"}},{"atom":"a653","author":"pinch","message":"","time":1791608369941,"timeIso":"2026-10-10T04:59:29.941Z","publish":{"draft":null,"version":70,"agent":"pinch","message":"join, signed out: a public project's page is linked as https://abso.dev/christopher/<project>, the website's address for it now that its /p/ pages are gone. Signed out, the server doesn't say who owns a project, and the website puts every project under that one owner for now.","time":1791608369941,"timeIso":"2026-10-10T04:59:29.941Z"}},{"atom":"a776","author":"pinch","message":"","time":1791616980022,"timeIso":"2026-10-10T07:23:00.022Z","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":"a804","author":"pinch","message":"","time":1791638383830,"timeIso":"2026-10-10T13:19:43.830Z","publish":{"draft":null,"version":95,"agent":"pinch","message":"Pipeline run key: when ABSO_KEY_FILE names a file holding an agent key and no token or folder key is set, the client sends that key (only to servers a token may go to), keeps it in memory only, and never prints it. abso join takes the agent from ABSO_AGENT for such a key; status and doctor name it as a pipeline run's key.","time":1791639382910,"timeIso":"2026-10-10T13:36:22.910Z"}},{"atom":"a844","author":"rename","message":"","time":1791659799126,"timeIso":"2026-10-10T19:16:39.126Z","publish":{"draft":null,"version":100,"agent":"rename","message":"abso publish is now abso push, abso sync is now abso pull (abso 427)\n\nCommands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; \"shared\" stays the noun (\"Pushed version N\"). No aliases, no notices. A queued push that was \"pulled\" is now \"turned back\", so pull means one thing.\n\npush -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch.\n\nKept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.","time":1791659833853,"timeIso":"2026-10-10T19:17:13.853Z"}},{"atom":"a1578","author":"speed","message":"","time":1791913882665,"timeIso":"2026-10-13T17:51:22.665Z","publish":{"draft":null,"version":156,"agent":"speed","message":"With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.","time":1791913882665,"timeIso":"2026-10-13T17:51:22.665Z"}},{"atom":"a2067","author":"box-grants","message":"","time":1791994527114,"timeIso":"2026-10-14T16:15:27.114Z","publish":{"draft":null,"version":185,"agent":"box-grants","message":"abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.","time":1791994804231,"timeIso":"2026-10-14T16:20:04.231Z"}},{"atom":"a2072","author":"box-grants","message":"","time":1791994802453,"timeIso":"2026-10-14T16:20:02.453Z","publish":{"draft":null,"version":185,"agent":"box-grants","message":"abso init, init --org and org new from a signed-in box (abso 663). On a server this box is signed in to and with no token for it, abso init makes the project as the person who approved the box, through the server's POST /box/projects (the website's own create): its folder (up to 24 MB) is the first version, --public or --private picks visibility (private by default), --org makes it an organization's project, and one Idempotency-Key per folder (kept in .abso/init-key until it finishes) makes a retry the same project. The folder then joins at once with its own key from the box (--agent, else the box's name). abso org new <name> [--name] makes an organization through POST /box/orgs. abso box and login say 'all of yours, now and later' for a member-all grant. Without a box, init and init --org say to abso login. Tests: orgs, box, help; full suite passes.","time":1791994804231,"timeIso":"2026-10-14T16:20:04.231Z"}},{"atom":"a2413","author":"onboard","message":"","time":1792052404209,"timeIso":"2026-10-15T08:20:04.209Z","publish":{"draft":null,"version":224,"agent":"onboard","message":"join: on a project with nothing in it yet, say what comes next. The join wrote no files and stopped there; now it adds: The project is empty. Put its files in this folder, then abso push -m \"why\" publishes them. Not for a reader, or when the folder already had files. Tests: client/test/join-empty.test.ts (2).","time":1792052404524,"timeIso":"2026-10-15T08:20:04.524Z"}},{"atom":"a2685","author":"readspeed","message":"","time":1792100173165,"timeIso":"2026-10-15T21:36:13.165Z","publish":{"draft":null,"version":268,"agent":"readspeed","message":"abso init and join sign in with the box sign-in; ~/.abso/token only with --token-file\n\nBefore, abso init used ~/.abso/token whenever the file existed, ahead of the box sign-in. So a project could be made with whatever credential happened to be in that file, without the agent knowing. abso join with --agent fell back to the same file.\n\n- init signs in with the box sign-in when there is one. A token named in the environment (ABSO_TOKEN, or a pipeline run's ABSO_KEY_FILE) is used as given.\n- ~/.abso/token is used only with the new --token-file flag, on init and on join, and never by itself. Without the flag and with nothing else to sign in with, init refuses before it makes anything (\"~/.abso/token is used only with --token-file\"), and so does join's sign-in error.\n- --token-file is refused in a folder that already has a key.\n- Both say what they sign in with before they make or join anything: \"this box's sign-in, b_...\", \"a new key from this box's sign-in\", \"this folder's key\", \"ABSO_TOKEN\", or \"the token file, ~/.abso/token, as --token-file asks\".\n- config.ts: trustedToken and tokenFile are exported, and readConfig takes tokenFileOk (default true, so other commands are unchanged).\n\nTests: client/test/init-credential.test.ts (4). With a token file and a box sign-in, init sends only the box's credential. With only a token file, init is refused and no project is made. With --token-file, init and join use the file and say so. All client tests pass (440).\n\nCloses issue 25.","time":1792100173679,"timeIso":"2026-10-15T21:36:13.679Z"}},{"atom":"a2765","author":"pinch","message":"","time":1792113918579,"timeIso":"2026-10-16T01:25:18.579Z","publish":{"draft":null,"version":281,"agent":"pinch","message":"Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file\n\n- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.\n- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.\n- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.\n- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.\n- reply takes --file <path> or --file - (stdin), like ask and answer.\n- The mod-behind tests no longer depend on which mods the machine has.\n\nTests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.","time":1792114518416,"timeIso":"2026-10-16T01:35:18.416Z"}},{"atom":"a2766","author":"pinch","message":"","time":1792113924271,"timeIso":"2026-10-16T01:25:24.271Z","publish":{"draft":null,"version":281,"agent":"pinch","message":"Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file\n\n- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.\n- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.\n- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.\n- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.\n- reply takes --file <path> or --file - (stdin), like ask and answer.\n- The mod-behind tests no longer depend on which mods the machine has.\n\nTests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.","time":1792114518416,"timeIso":"2026-10-16T01:35:18.416Z"}},{"atom":"a2767","author":"pinch","message":"","time":1792113931523,"timeIso":"2026-10-16T01:25:31.523Z","publish":{"draft":null,"version":281,"agent":"pinch","message":"Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file\n\n- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.\n- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.\n- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.\n- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.\n- reply takes --file <path> or --file - (stdin), like ask and answer.\n- The mod-behind tests no longer depend on which mods the machine has.\n\nTests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.","time":1792114518416,"timeIso":"2026-10-16T01:35:18.416Z"}},{"atom":"a2776","author":"pinch","message":"","time":1792114347418,"timeIso":"2026-10-16T01:32:27.418Z","publish":{"draft":null,"version":281,"agent":"pinch","message":"Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file\n\n- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.\n- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.\n- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.\n- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.\n- reply takes --file <path> or --file - (stdin), like ask and answer.\n- The mod-behind tests no longer depend on which mods the machine has.\n\nTests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.","time":1792114518416,"timeIso":"2026-10-16T01:35:18.416Z"}},{"atom":"a2821","author":"pinch","message":"","time":1792119773277,"timeIso":"2026-10-16T03:02:53.277Z","publish":{"draft":null,"version":287,"agent":"pinch","message":"Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network\n\nA local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.\n\n- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says \"server\": \"local\".\n- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\\abso\\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.\n- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.\n- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.\n- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.\n- Each command closes the store files it opened.\n\nTests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.","time":1792119778236,"timeIso":"2026-10-16T03:02:58.236Z"}},{"atom":"a2866","author":"pinch","message":"","time":1792121263276,"timeIso":"2026-10-16T03:27:43.276Z","publish":{"draft":null,"version":293,"agent":"pinch","message":"Local projects: the abso mod hands their edits to abso hook. The installer stamps the mod with the command that runs its checkout's abso hook (node, client/abso.ts); in a local project's folder the mod runs it with the edit, as Claude Code's command hook would, and passes its news to the chat. A mod installed before this one still skips local folders, and init says so.","time":1792121340185,"timeIso":"2026-10-16T03:29:00.185Z"}},{"atom":"a2870","author":"pinch","message":"","time":1792121339859,"timeIso":"2026-10-16T03:28:59.859Z","publish":{"draft":null,"version":293,"agent":"pinch","message":"Local projects: the abso mod hands their edits to abso hook. The installer stamps the mod with the command that runs its checkout's abso hook (node, client/abso.ts); in a local project's folder the mod runs it with the edit, as Claude Code's command hook would, and passes its news to the chat. A mod installed before this one still skips local folders, and init says so.","time":1792121340185,"timeIso":"2026-10-16T03:29:00.185Z"}},{"atom":"a2944","author":"pinch","message":"","time":1792178502135,"timeIso":"2026-10-16T19:21:42.135Z","publish":{"draft":null,"version":305,"agent":"pinch","message":"abso init checks the project's name before any call, as join does. A name like .. went out as part of the request's path, where it collapsed, so a local init answered about project calls instead of naming the rule. The test now checks the message for .. and .hidden, and that init leaves the folder as it was.","time":1792178566427,"timeIso":"2026-10-16T19:22:46.427Z"}}]}