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 71 to 318

Compare

+26 −10 in 11 places
Lines 14–20 at 318 (were 14–19 at 71)
1414import {
1515 LISTED,
1616 leftOutText,
17+ pullUnfinishedText,
1718 READER_REFUSES,
1819 readUnwritten,
1920 recordedFirst,
Lines 40–46 at 318 (were 39–44 at 71)
3940} from "./folder.ts";
4041import { fileArg } from "./history.ts";
4142import { modsBehindText } from "./install.ts";
43+import { isLocal } from "./local-store.ts";
4244import { withFolderLock } from "./lock.ts";
4345import { readKnownModes, writeKnownModes } from "./modes.ts";
4446import { queueText } from "./queue.ts";
Lines 150–157 at 318 (were 148–155 at 71)
148150 writeConfig(root, raw as unknown as Settings);
149151 return {
150152 text: on
151− ? "This folder is a reader now: status, sync, log, show, files and export work, and nothing it does is recorded or published. abso reader off undoes it."
152− : "This folder records and publishes again.",
153+ ? "This folder is a reader now: status, pull, log, show, files and export work, and nothing it does is recorded or pushed. abso reader off undoes it."
154+ : "This folder records and pushes again.",
153155 json: { reader: on },
154156 };
155157}
Lines 160–166 at 318 (were 158–164 at 71)
158160export function openCollisionsText(open: readonly OpenCollision[]): string[] {
159161 if (open.length === 0) return [];
160162 return [
161− `${plural(open.length, "collision")} to settle before you publish (keep yours, theirs or a mix and delete the marker lines, or abso settle <file> --yours|--theirs|--both):`,
163+ `${plural(open.length, "collision")} to settle before you push (keep yours, theirs or a mix and delete the marker lines, or abso settle <file> --yours|--theirs|--both):`,
162164 ...open.map(
163165 (c) =>
164166 ` ${c.file} lines ${c.lines[0]}-${c.lines[1]}, with ${c.theirs.agent}'s version ${c.theirs.version} ("${c.theirs.message}")`,
Lines 218–224 at 318 (were 216–222 at 71)
216218 });
217219 return {
218220 text: [
219− `Moved ${from} to ${to} in your draft; its lines keep their history. It reaches shared with your next publish.`,
221+ `Moved ${from} to ${to} in your draft; its lines keep their history. It reaches shared with your next push.`,
220222 ...(isComposed(to) ? [] : [uncomposedText(to)]),
221223 ].join("\n"),
222224 json: { from: answer.from, to: answer.to },
Lines 262–268 at 318 (were 260–266 at 71)
260262 return {
261263 text: [
262264 ...recordedFirst(recorded).filter((l) => !l.startsWith("Recorded first")),
263− `Settled ${counts.map(([rel, n]) => `${plural(n, "block")} in ${rel}`).join(", ")}, keeping ${which}.${keep === "both" ? " Both sides stay in the file; when you publish, the other author hears that you kept both." : ""}`,
265+ `Settled ${counts.map(([rel, n]) => `${plural(n, "block")} in ${rel}`).join(", ")}, keeping ${which}.${keep === "both" ? " Both sides stay in the file; when you push, the other author hears that you kept both." : ""}`,
264266 ].join("\n"),
265267 json: { keep, files: counts.map(([file, blocks]) => ({ file, blocks })), recorded: recorded.sent },
266268 };
Lines 276–298 at 318 (were 274–285 at 71)
274276 ? missing.join(", ")
275277 : `${missing.slice(0, LISTED).join(", ")}, and ${missing.length - LISTED} more`;
276278 return [
277− `Missing from this folder though your view has ${missing.length === 1 ? "it" : "them"} (abso sync --full writes ${missing.length === 1 ? "it" : "them"}; abso files lists them all): ${some}`,
279+ `Missing from this folder though your view has ${missing.length === 1 ? "it" : "them"} (abso pull --full writes ${missing.length === 1 ? "it" : "them"}; abso files lists them all): ${some}`,
278280 ];
279281}
280282
281283export async function runStatus(args: Parsed, env: Env): Promise<Output> {
282284 const { root, config, api } = open(env);
285+ if (config.visitor) {
286+ // A folder that reads signed out: shared's version and whether it's green. It holds no files to compare.
287+ const status = await api.status();
288+ return {
289+ text: [
290+ `Project ${config.project}: shared is at version ${status.version}. This folder reads it signed out, sending no sign-in: status, log, show, files, blame, why, where, issues, issue and search work here. To work on it: abso login, then abso join ${config.project} in a new folder.`,
291+ ...ciText(status.ci ?? undefined, status.version),
292+ ].join("\n"),
293+ json: { project: config.project, version: status.version, visitor: true, ci: status.ci ?? null },
294+ };
295+ }
283296 const short = bool(args, "short");
284297 const { files: view, ...status } = short ? { ...(await api.status()), files: undefined } : await api.statusAndFiles();
285298 const clean = CleanFiles.load(root);
Lines 304–310 at 318 (were 291–297 at 71)
291304 const me = status.agents.find((a) => a.agent === config.agent);
292305 const unpublished = local.size > 0 || (me?.draftChanges ?? 0) > 0;
293306 // +queued: published into the merge queue, not landed yet (#39).
294− const word = `${me?.draft ? `${me.draft}@` : ""}${me?.base ?? "none"}${unpublished ? "+unpublished" : ""}${(me?.queued?.length ?? 0) > 0 ? "+queued" : ""}`;
307+ const word = `${me?.draft ? `${me.draft}@` : ""}${me?.base ?? "none"}${unpublished ? "+unpushed" : ""}${(me?.queued?.length ?? 0) > 0 ? "+queued" : ""}`;
295308 return { text: word, json: { version: me?.base ?? null, draft: me?.draft ?? null, unpublished, word } };
296309 }
297310 const missing = view === undefined ? [] : missingHere(root, view.files, local);
Lines 326–336 at 318 (were 313–321 at 71)
313326 const space = (draft: string | null | undefined): string => (draft ? `draft ${draft}` : "shared");
314327 const parked = (me?.parked ?? []).filter((p) => p.draftChanges > 0);
315328 const credential = credentialLabel(root, config.server, env.env);
316− const behind = await newerClientNote(config.server);
329+ // A local project reaches for nothing on the network, npm included.
330+ const localProject = isLocal(config.server);
331+ const behind = localProject ? undefined : await newerClientNote(config.server);
317332 const lines = [
318− `Project ${config.project}: shared is at version ${status.version}. This folder is ${config.agent}${config.reader || me?.reader ? ", a reader (it records and publishes nothing)" : ""}, working in ${space(me?.draft)}.${config.follow ? ` It follows label ${config.follow}: syncs take it to the newest version with that label.` : ""} Signed in with ${credential.kind}${credential.id ? ` ${credential.id}` : ""}.`,
333+ `Project ${config.project}: shared is at version ${status.version}. This folder is ${config.agent}${config.reader || me?.reader ? ", a reader (it records and pushes nothing)" : ""}, working in ${space(me?.draft)}.${config.follow ? ` It follows label ${config.follow}: pulls take it to the newest version with that label.` : ""}${localProject ? ` It's a local project, in ${join(config.localStore ?? "", config.project)}.` : ` Signed in with ${credential.kind}${credential.id ? ` ${credential.id}` : ""}.`}`,
319334 ...(behind ? [behind] : []),
320335 // Is shared green (#39)? Right under the first line, since it decides what to do next.
321336 ...ciText(status.ci, status.version),
Lines 345–351 at 318 (were 330–336 at 71)
330345 : `Not yet recorded (abso record sends them): ${[...local.keys()].join(", ")}`,
331346 ...(neverShared.length > 0
332347 ? [
333− `Added to your draft by an earlier record and deleted since, so they never reach shared; the next record (sync, publish, run) takes them out of your draft: ${neverShared.join(", ")}`,
348+ `Added to your draft by an earlier record and deleted since, so they never reach shared; the next record (pull, push, run) takes them out of your draft: ${neverShared.join(", ")}`,
334349 ]
335350 : []),
336351 ...openCollisionsText(me?.collisions ?? []),
Lines 353–359 at 318 (were 338–343 at 71)
338353 ...modsBehindText(env.env),
339354 ...missingText(missing),
340355 ...unwrittenText(unwritten),
356+ ...pullUnfinishedText(root),
341357 ...(crlf.length > 0
342358 ? [
343359 `${plural(crlf.length, "file")} differ${crlf.length === 1 ? "s" : ""} from what abso recorded only in line endings (CRLF here; abso records and abso run sends LF). Harmless; abso fix-eol rewrites ${crlf.length === 1 ? "it" : "them"} with LF.`,
MCP
compare on this site's /mcp
CLI
abso diff 71 318 client/src/status-commands.ts --json
JSON
/christopher/abso-core/compare/71..318?file=client%2Fsrc%2Fstatus-commands.ts&format=json