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 68 to 69

Compare

+22 −2 in 4 places
Lines 16–22 at 69 (were 16–21 at 68)
1616import { clearKnown, loadIgnore, readFolder, writeKnown } from "./folder.ts";
1717import { modInstalled } from "./install.ts";
1818import { type FullMode, foldModes, writeKnownModes } from "./modes.ts";
19+import { siteOf } from "./orgs.ts";
1920import { projectFileName, readProjectFile, startingProjectFileText, writeStartingProjectFile } from "./project-file.ts";
2021import { refusedText } from "./safety.ts";
2122import { OLD_STATE_DIR, STATE_DIR, stateDir } from "./state-dir.ts";
Lines 124–145 at 69 (were 123–128 at 68)
123124 return sub;
124125}
125126
127+/**
128+ * Why a join failed signed out. The client reads only as an agent, which needs a
129+ * sign-in; a public project is read signed out on the website. Whether the
130+ * project is public is asked of the server with no credentials.
131+ */
132+async function signedOut(server: string, project: string): Promise<string> {
133+ let open = false;
134+ try {
135+ const response = await fetch(new URL(`/p/${project}/status`, server), { signal: AbortSignal.timeout(3000) });
136+ open = response.ok;
137+ } catch {}
138+ return open
139+ ? `${project} is public: read it at ${siteOf(server)}/p/${project} (every page is also JSON). The client needs a sign-in, even to read: abso login.`
140+ : `This box isn't signed in to ${server}. abso login signs it in.`;
141+}
126143export async function runJoin(args: Parsed, env: Env): Promise<Output> {
127144 if (args.positionals.length !== 1) throw new UsageError("join takes the project name: abso join <project>");
128145 const project = args.positionals[0]!;
Lines 161–170 at 69 (were 144–150 at 68)
144161 minted = box && !hasKey ? await mintKey(box, project, agent) : undefined;
145162 } else {
146163 // No --agent: the box's name, or the next free -2, -3.
147− if (!box) throw new UsageError("abso login signs this box in first (or give --agent <name>)");
164+ if (!box)
165+ throw new UsageError(
166+ `${await signedOut(server, project)} (A folder that already has a key joins with --agent <name>.)`,
167+ );
148168 if (hasKey) throw new UsageError(`${root} already has a key: give its agent's name with --agent <name>`);
149169 const free = await mintFreeName(box, project, defaultAgentName());
150170 agent = free.agent;
Lines 185–191 at 69 (were 165–171 at 68)
165185 } catch (error) {
166186 if (!(error instanceof ApiError && error.status === 401 && !box && !settings.token)) throw error;
167187 rmSync(stateDir(root), { recursive: true, force: true });
168− throw new UsageError(`This box isn't signed in to ${config.server}. abso login signs it in.`);
188+ throw new UsageError(await signedOut(config.server, project));
169189 }
170190 return {
171191 text: [
MCP
compare on this site's /mcp
CLI
abso diff 68 69 client/src/join-commands.ts --json
JSON
/christopher/abso-core/compare/68..69?file=client%2Fsrc%2Fjoin-commands.ts&format=json