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

Compare

+31 −14 in 8 places
Lines 1–4 at 318 (were 1–4 at 17)
1−// The merge queue on the client (#39): with "queue": true in avcs.json, a
1+// The merge queue on the client (#39): with "queue": true in abso.json, a
22// publish to shared waits in the queue until a batch with it passes the
33// project's check, and lands, or is pulled with the check's output. publish
44// waits for that, up to a cap under the chat's 2-minute command limit; status
Lines 6–15 at 318 (were 6–15 at 17)
66
77import { type Api, newsLines, type QueueItem, type QueueState } from "./api.ts";
88import { type Parsed, UsageError } from "./args.ts";
9−import { type Env, type Output, open, plural } from "./commands.ts";
9+import { type Env, type Output, open } from "./commands.ts";
1010import { logNews } from "./folder.ts";
1111
12−/** How long publish waits by default: under the 2 minutes a Claude Code shell command gets (#39, agreed with Engine). */
12+/** How long publish waits by default: under the 2 minutes a Claude Code shell command gets (#39). */
1313export const WAIT_SECONDS = 100;
1414
1515/** Exit code for a publish still in the queue when the wait ends (#39). */
Lines 30–36 at 318 (were 30–36 at 17)
3030 const batch = items.filter((q) => q.checking).length;
3131 return batch === 1 ? "being checked" : `being checked in a batch of ${batch}`;
3232 }
33− return at === 0 ? "next to be checked" : `waiting, ${at} ${at === 1 ? "publish" : "publishes"} ahead of it`;
33+ return at === 0 ? "next to be checked" : `waiting, ${at} ${at === 1 ? "push" : "pushes"} ahead of it`;
3434}
3535
3636/**
Lines 61–67 at 318 (were 61–67 at 17)
6161 const now = state.paused
6262 ? `the queue is paused: ${state.paused.reason}; next try ${state.paused.nextTry.slice(11, 16)} UTC`
6363 : standing(state.items, id);
64− if (now !== said) say(`abso: your publish is ${now}.\n`);
64+ if (now !== said) say(`abso: your push is ${now}.\n`);
6565 said = now;
6666 }
6767 return { kind: "waiting", state };
Lines 76–82 at 318 (were 76–82 at 17)
7676 // publish says the outcome itself, so that line isn't printed again as news.
7777 const said = [...all]
7878 .reverse()
79− .find((n) => /^Your queued publish ".*" (landed as version \d+|was pulled: )/s.test(n));
79+ .find((n) => /^Your queued push ".*" (landed as version \d+|was turned back: )/s.test(n));
8080 const news = all.filter((n) => n !== said);
8181 const last = state.last;
8282 const landed =
Lines 88–114 at 318 (were 88–114 at 17)
8888 if (last?.kind === "pulled" && last.pulled.includes(id))
8989 return {
9090 kind: "pulled",
91− text: `Your queued publish was pulled: the project's check failed on it.${last.output ? `\n${last.output.trimEnd()}` : ""}`,
91+ text: `Your queued push was turned back: the project's check failed on it.${last.output ? `\n${last.output.trimEnd()}` : ""}`,
9292 news,
9393 };
9494 return { kind: "gone", news };
9595}
9696
9797/**
98− * A pull, said for the publisher (#39, agreed with Engine): the check's output
98+ * A pull, said for the publisher (#39): the check's output
9999 * first, then the verdict as the last line, since that's the line an agent
100100 * acts on. The engine's news has the output in the middle of its sentence.
101101 */
102102export function pulledText(news: string): string {
103103 const m =
104− /^Your queued publish (".*") was pulled: ([^\n]*?)(?::\n([\s\S]*?))?\.? Its changes are still in your draft\.$/s.exec(
104+ /^Your queued push (".*") was turned back: ([^\n]*?)(?::\n([\s\S]*?))?\.? Its changes are still in your draft\.$/s.exec(
105105 news.replace(/\n\. Its changes/, ". Its changes"),
106106 );
107− if (!m) return `${news}\nNot published. Fix it, then publish again.`;
107+ if (!m) return `${news}\nNot pushed. Fix it, then push again.`;
108108 const output = m[3]?.trimEnd() ?? "";
109109 return [
110110 ...(output === "" ? [] : ["The check's output ends:", output]),
111− `Not published: your queued publish ${m[1]} was pulled: ${m[2]!.replace(/\.$/, "")}. Its changes are still in your draft; fix them, then publish again.`,
111+ `Not pushed: your queued push ${m[1]} was turned back: ${m[2]!.replace(/\.$/, "")}. Its changes are still in your draft; fix them, then push again.`,
112112 ].join("\n");
113113}
114114
Lines 138–164 at 318 (were 138–147 at 17)
138138 return lines;
139139}
140140
141+/**
142+ * What abso waiting --mine says about this agent's own publishes in the merge queue: where each stands, whether
143+ * the queue is paused, and how the outcome comes. Nothing when none of theirs waits.
144+ */
145+export function queuedLines(queue: QueueState | null | undefined, me: string): string[] {
146+ const items = queue?.items ?? [];
147+ const mine = items.filter((q) => q.agent === me);
148+ if (mine.length === 0) return [];
149+ return [
150+ ...mine.map(
151+ (q) => `Your push ${q.id} (${JSON.stringify(q.message)}) is in the merge queue: ${standing(items, q.id)}.`,
152+ ),
153+ ...(queue?.paused ? [`The merge queue is paused: ${queue.paused.reason}.`] : []),
154+ `${mine.length === 1 ? "It lands or is turned back" : "Each lands or is turned back"} once the project's check runs on it; the outcome comes as news, and abso unqueue takes ${mine.length === 1 ? "it" : "them"} back.`,
155+ ];
156+}
141158/** abso unqueue: take this agent's queued publishes back; their changes stay in the draft. */
142159export async function runUnqueue(args: Parsed, env: Env): Promise<Output> {
143160 if (args.positionals.length > 0)
144− throw new UsageError("unqueue takes no arguments: it takes back every publish of yours still in the merge queue");
161+ throw new UsageError("unqueue takes no arguments: it takes back every push of yours still in the merge queue");
145162 const { root, api } = open(env);
146163 const answer = await api.unqueue();
147164 // The engine says it as news too ("you withdrew it"); this command's own text says the same, so it isn't printed twice.
Lines 167–177 at 318 (were 150–160 at 17)
150167 () => [] as string[],
151168 );
152169 logNews(root, news);
153− const others = news.filter((n) => !/^Your queued publish ".*" was pulled: you withdrew it\./s.test(n));
170+ const others = news.filter((n) => !/^Your queued push ".*" was turned back: you withdrew it\./s.test(n));
154171 const ids = answer.pulled;
155172 return {
156173 text: [
157− `Took back ${ids.length === 1 ? `queued publish ${ids[0]}` : `queued publishes ${ids.join(", ")}`}: ${ids.length === 1 ? "its" : "their"} changes are still in your draft, unpublished.`,
174+ `Took back ${ids.length === 1 ? `queued push ${ids[0]}` : `queued pushes ${ids.join(", ")}`}: ${ids.length === 1 ? "its" : "their"} changes are still in your draft, unpushed.`,
158175 ...others.map((n) => ` ${n}`),
159176 ].join("\n"),
160177 json: { pulled: ids, news: others },
MCP
compare on this site's /mcp
CLI
abso diff 17 318 client/src/queue.ts --json
JSON
/christopher/abso-core/compare/17..318?file=client%2Fsrc%2Fqueue.ts&format=json