Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 63 to 64

Compare

+10 −7 in 3 places
Lines 18–27 at 64 (were 18–27 at 63)
1818import { type FullMode, foldModes, writeKnownModes } from "./modes.ts";
1919import { projectFileName, readProjectFile, startingProjectFileText, writeStartingProjectFile } from "./project-file.ts";
2020import { refusedText } from "./safety.ts";
21−import { stateDir } from "./state-dir.ts";
21+import { OLD_STATE_DIR, STATE_DIR, stateDir } from "./state-dir.ts";
2222
2323/**
24− * The server to join or start on (abso issue 349): --server, then ABSO_SERVER, then the server this box is signed in
24+ * The server to join or start on: --server, then ABSO_SERVER, then the server this box is signed in
2525 * to (abso login wrote it), then https://api.abso.dev. A box signed in to more than one server has to say which.
2626 */
2727export function serverFrom(args: Parsed, env: Pick<Env, "env">, home?: string): string {
Lines 106–121 at 64 (were 106–118 at 63)
106106}
107107
108108/**
109− * Where abso join writes (abso issue 351): --dir, else here when this folder is empty, else ./<project>, which has
110− * to be new or empty so nobody's files are written over.
109+ * Where abso join writes: --dir, else here when --agent is given (as before, so a folder prepared with
110+ * abso key install --server is joined where its key is). With no --agent: here when this folder is empty, else
111+ * ./<project>, which has to be new or empty so nobody's files are written over. A folder holding only abso's own
112+ * state folder counts as empty.
111113 */
112−function joinFolder(args: Parsed, env: Env, project: string): string {
114+export function joinFolder(args: Parsed, env: Pick<Env, "cwd">, project: string): string {
113115 const dir = str(args, "dir");
114116 if (dir !== undefined) return resolve(env.cwd, dir);
115− const empty = (path: string) => readdirSync(path).length === 0;
117+ if (str(args, "agent") !== undefined) return resolve(env.cwd);
118+ const empty = (path: string) => readdirSync(path).every((name) => name === STATE_DIR || name === OLD_STATE_DIR);
116119 if (empty(env.cwd)) return resolve(env.cwd);
117120 const sub = resolve(env.cwd, project);
118121 if (existsSync(sub) && (!statSync(sub).isDirectory() || !empty(sub)))
Lines 143–149 at 64 (were 140–146 at 63)
140143 agent = agentFrom(args);
141144 minted = box && !hasKey ? await mintKey(box, project, agent) : undefined;
142145 } else {
143− // abso issue 351: no --agent takes the box's name, or the next free -2, -3.
146+ // No --agent: the box's name, or the next free -2, -3.
144147 if (!box) throw new UsageError("abso login signs this box in first (or give --agent <name>)");
145148 if (hasKey) throw new UsageError(`${root} already has a key: give its agent's name with --agent <name>`);
146149 const free = await mintFreeName(box, project, defaultAgentName());
MCP
compare on this site's /mcp
CLI
abso diff 63 64 client/src/join-commands.ts --json
JSON
/christopher/abso-core/compare/63..64?file=client%2Fsrc%2Fjoin-commands.ts&format=json