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 26 to 27

Compare

+24 −22 in 8 places
Lines 10–16 at 27 (were 10–15 at 26)
1010import { type Env, EXIT, type Output, open, plural } from "./command-env.ts";
1111import { LISTED, recordFolder } from "./commands.ts";
1212import { findRoot } from "./config.ts";
13+import { fromEnv, withOldNames } from "./env-names.ts";
1314import { fetchedText, fetchFromBox } from "./fetch.ts";
1415import { absolute, isLocalOnly, loadIgnore, readText, walk, writeFileAtomic } from "./folder.ts";
1516import { onDisk, PLAIN, readKnownModes } from "./modes.ts";
Lines 381–390 at 27 (were 380–389 at 26)
380381 if (at !== undefined) {
381382 // A past version in the box; the folder's files stay as they are (Backtracker's bisect).
382383 const snap = await snapshotAt(root, api, at);
383− const space = stamp.AVCS_SPACE === "shared" ? "shared" : `draft ${stamp.AVCS_SPACE}`;
384+ const space = stamp.ABSO_SPACE === "shared" ? "shared" : `draft ${stamp.ABSO_SPACE}`;
384385 if (filesGlob === undefined) {
385386 entries = await snapshotEntries(api, snap);
386− stamp = { ...stamp, AVCS_VERSION: String(at), AVCS_DRAFT: "0", AVCS_DRAFT_HASH: "", AVCS_AT: String(at) };
387+ stamp = { ...stamp, ABSO_VERSION: String(at), ABSO_DRAFT: "0", ABSO_DRAFT_HASH: "", ABSO_AT: String(at) };
387388 notice(
388389 `abso: running version ${at} of ${space} in the box (${plural(entries.length, "file")}); your folder is untouched.\n`,
389390 );
Lines 393–399 at 27 (were 392–398 at 26)
392393 const old = await snapshotEntries(api, snap, pick);
393394 const gone = entries.filter((e) => pick(e.path) && !old.some((o) => o.path === e.path)).map((e) => e.path);
394395 entries = [...entries.filter((e) => !pick(e.path)), ...old].sort((a, b) => a.path.localeCompare(b.path));
395− stamp = { ...stamp, AVCS_AT: `${at} files ${filesGlob}` };
396+ stamp = { ...stamp, ABSO_AT: `${at} files ${filesGlob}` };
396397 const said =
397398 old.length === 0 && gone.length === 0
398399 ? `no file matches ${filesGlob} in your folder or at version ${at}`
Lines 445–459 at 27 (were 444–458 at 26)
444445 json: { ...p },
445446 };
446447 }
447− // A broken stream reconnects to the run quietly; .avcs/run.log says when and why.
448+ // A broken stream reconnects to the run quietly; .abso/run.log says when and why.
448449 // (Tests shorten the waits with these.)
449450 const delays = (name: string) =>
450− env.env[name]
451+ fromEnv(env.env, name)
451452 ?.split(",")
452453 .map(Number)
453454 .filter((n) => Number.isFinite(n) && n >= 0);
454− const reconnect = delays("AVCS_RUN_RECONNECT_MS");
455− const retry = delays("AVCS_RUN_RETRY_MS");
455+ const reconnect = delays("RUN_RECONNECT_MS");
456+ const retry = delays("RUN_RETRY_MS");
456457 const runner =
457458 reconnect?.length || retry?.length
458459 ? new Api(api.config, api.timeoutMs, reconnect?.length ? reconnect : undefined, retry?.length ? retry : undefined)
Lines 513–520 at 27 (were 512–519 at 26)
512513/** abso fetch <glob...>: files the box made, written into the folder where abso ignores them. */
513514/**
514515 * Which of the agent's boxes run, logs and fetch use (#37): --box <name>, else
515− * AVCS_BOX, else the agent's own. A lead can give each subagent its own box
516− * (AVCS_BOX=2 in its environment), so their runs don't wait on each other.
516+ * ABSO_BOX (or the older AVCS_BOX), else the agent's own. A lead can give each subagent its own box
517+ * (ABSO_BOX=2 in its environment), so their runs don't wait on each other.
517518 */
518519/**
519520 * What this folder last heard about a box's prep: a run's X-Avcs-Prep, or
Lines 550–556 at 27 (were 549–555 at 26)
549550}
550551
551552export function boxOf(args: Parsed, env: Env): string | undefined {
552− const box = str(args, "box") ?? (env.env.AVCS_BOX || undefined);
553+ const box = str(args, "box") ?? fromEnv(env.env, "BOX");
553554 if (box !== undefined && !/^[A-Za-z0-9_-]{1,24}$/.test(box))
554555 throw new UsageError(`a box name is 1-24 letters, digits, - or _ (got ${JSON.stringify(box)})`);
555556 return box;
Lines 582–598 at 27 (were 581–597 at 26)
581582
582583/** What `abso run` tells the command about the code it runs, as environment variables. */
583584export interface RunStamp {
584− readonly AVCS_AGENT: string;
585+ readonly ABSO_AGENT: string;
585586 /** shared, or the named draft. */
586− readonly AVCS_SPACE: string;
587+ readonly ABSO_SPACE: string;
587588 /** The version of that space the draft builds on. */
588− readonly AVCS_VERSION: string;
589+ readonly ABSO_VERSION: string;
589590 /** How many unpublished changes the draft holds (0: the run is exactly that version). */
590− readonly AVCS_DRAFT: string;
591+ readonly ABSO_DRAFT: string;
591592 /** A short hash of the draft's files as they are, "" when the draft is empty. */
592− readonly AVCS_DRAFT_HASH: string;
593+ readonly ABSO_DRAFT_HASH: string;
593594 /** With abso run --at: the version run ("12"), or the files taken from it ("12 files src/*.ts"). */
594− readonly AVCS_AT?: string;
595+ readonly ABSO_AT?: string;
595596}
596597
597598async function runStamp(root: string, agent: string, api: Api): Promise<RunStamp> {
Lines 606–624 at 27 (were 605–622 at 26)
605606 hash = h.digest("hex").slice(0, 12);
606607 }
607608 return {
608− AVCS_AGENT: agent,
609− AVCS_SPACE: me?.draft ?? "shared",
610− AVCS_VERSION: String(me?.base ?? status.version),
611− AVCS_DRAFT: String(me?.draftChanges ?? 0),
612− AVCS_DRAFT_HASH: hash,
609+ ABSO_AGENT: agent,
610+ ABSO_SPACE: me?.draft ?? "shared",
611+ ABSO_VERSION: String(me?.base ?? status.version),
612+ ABSO_DRAFT: String(me?.draftChanges ?? 0),
613+ ABSO_DRAFT_HASH: hash,
613614 };
614615}
615616
616617/** `export A='x' B='y'; `: on every part of a compound command, unlike a bare assignment prefix. */
617618function stampPrefix(stamp: RunStamp): string {
618619 const quote = (v: string) => `'${v.replace(/'/g, `'''`)}'`;
619− return `export ${Object.entries(stamp)
620+ return `export ${Object.entries(withOldNames({ ...stamp }))
621+ .filter((e): e is [string, string] => e[1] !== undefined)
620622 .map(([k, v]) => `${k}=${quote(v)}`)
621623 .join(" ")}; `;
622624}
MCP
compare on this site's /mcp
CLI
abso diff 26 27 client/src/box-commands.ts --json
JSON
/christopher/abso-core/compare/26..27?file=client%2Fsrc%2Fbox-commands.ts&format=json