Versions 2 to 318
Lines 10–16 at 318 (were 10–16 at 2)
13−// copy, so the next `abso record` (publish and sync run one) sends it whole.
1414
Lines 33–39 at 318 (were 33–39 at 2)
36−import { STAMP } from "./stamp.ts";
3737
Lines 89–103 at 318 (were 89–96 at 2)
92−/** How often to ask for news without an edit (announcements reach an agent that isn't editing). */
93−const NEWS_POLL_MS = 30_000;
93+ * How often to ask for news without an edit (announcements reach an agent that isn't editing). Every 5 minutes, and
94+ * not at all in a chat that has made no tool call for IDLE_MS: prod abso's object reset under the load of every chat
95+ * asking every 30 seconds (2026-10-15). abso news --stream (abso 690) wakes a chat without asking.
Lines 115–124 at 318 (were 108–115 at 2)
111− $.clock.every(NEWS_POLL_MS, () => {
Lines 127–137 at 318 (were 118–123 at 2)
120129
134+
Lines 158–164 at 318 (were 144–150 at 2)
147− ...(text !== undefined && text.includes("\u0000")
148162 ? { nul: { at: text.indexOf("\u0000"), line: text.slice(0, text.indexOf("\u0000")).split("\n").length } }
Lines 182–205 at 318 (were 168–182 at 2)
170184
187+/** How long abso hook may take on a local project's edit: it waits up to two minutes for the store's lock. */
189+
194+ /** What abso hook handed back for the agent, on a local project's edit (it keeps the news log itself). */
176− if ((await readOr($, `${job.root}/.avcs/paused`)) !== undefined) {
178− } else if (/"reader"\s*:\s*true/.test((await readOr($, `${job.root}/.avcs/config.json`)) ?? "")) {
199+ } else if (/"reader"\s*:\s*true/.test((await readOr($, `${await stateOf($, job.root)}/config.json`)) ?? "")) {
201+ } else if (LOCAL_FOLDER.test((await readOr($, `${await stateOf($, job.root)}/config.json`)) ?? "")) {
Lines 212–218 at 318 (were 189–195 at 2)
192− await $.fs.write(`${job.root}/.avcs/known/${job.rel}`, FORGOTTEN).catch(() => {});
Lines 220–230 at 318 (were 197–207 at 2)
198221 `${new Date(job.queuedAt).toISOString()}\t${job.tool}\t${job.rel}\t${outcome}\t${done - started}ms sending, ${started - job.queuedAt}ms queued (in process, async)\t${CLIENT}`,
200− const context = newsContext(news);
204− await log($, job.root, news.map((n) => `${at}\t${n}`).join("\n"), "news.log");
227+ if (news.length > 0) await log($, job.root, news.map((n) => `${at}\t${n}`).join("\n"), "news.log");
Lines 237–294 at 318 (were 214–227 at 2)
216239
241+ * A local project's history is in a store on this machine that only the abso command opens, so its edits go to
242+ * `abso hook` from the checkout this mod was installed from, as Claude Code's command hook would run it.
244+async function handToClient($: Engine, job: Job): Promise<{ outcome: string; context?: string }> {
248+ "skipped: a local project, and this mod has no abso to hand it to (install-mod.ts adds one); abso record sends it",
263+ if (ran.exitCode !== 0) throw new Error(`abso hook exited ${ran.exitCode}: ${ran.stderr.trim().split("\n").at(-1)}`);
269+ : (JSON.parse(out) as { hookSpecificOutput?: { additionalContext?: unknown } }).hookSpecificOutput
276+
217277/** Ask for the news waiting for this agent (announcements, collisions) and hand it to the model. */
220− const config = JSON.parse(await $.fs.read(`${root}/.avcs/config.json`)) as {
280+ // While this seat holds its news stream (abso news --stream or --follow, abso 690), the stream wakes the chat.
227294 `${config.server.replace(/\/+$/, "")}/p/${encodeURIComponent(config.project)}/a/${encodeURIComponent(config.agent)}/news`,
Lines 296–302 at 318 (were 229–235 at 2)
232− "x-avcs-client": CLIENT,
Lines 330–348 at 318 (were 263–271 at 2)
265332
333+/** A folder's state folder: .abso, or .avcs in a folder from before the rename. (A mod can't import the client's state-dir.ts.) */
337+
340+ return (await readOr($, `${slash(home)}/.abso/${name}`)) ?? (await readOr($, `${slash(home)}/.avcs/${name}`));
342+
266343/** Whether the server has this path as a symbolic link (.avcs/modes.json, written by the client). */
268− const raw = await readOr($, `${root}/.avcs/modes.json`);
Lines 370–376 at 318 (were 293–299 at 2)
295372
296−/** The nearest folder above the file that has .avcs/config.json, cached per folder. */
373+/** The nearest folder above the file that has .abso/config.json (or .avcs/config.json from before the rename), cached per folder. */
Lines 379–385 at 318 (were 302–308 at 2)
305− if (await $.fs.exists(`${dir}/.avcs/config.json`)) {
382+ if ((await $.fs.exists(`${dir}/.abso/config.json`)) || (await $.fs.exists(`${dir}/.avcs/config.json`))) {
Lines 391–425 at 318 (were 314–348 at 2)
316393
317−/** AVCS_TOKEN if set, else ~/.avcs/token; none for a server the token may not go to (core.ts tokenGoesTo, with this machine's servers.json). */
394+/** AVCS_TOKEN if set, else ~/.abso/token, else ~/.avcs/token; none for a server the token may not go to (core.ts tokenGoesTo, with this machine's servers.json). */
320− const machine = machineServers(home ? await readOr($, `${slash(home)}/.avcs/servers.json`) : undefined);
321398 if (!tokenGoesTo(server, trustedList(await $.env.get("AVCS_TRUSTED_SERVERS"), machine))) return undefined;
324− return home ? (await readOr($, `${slash(home)}/.avcs/token`))?.trim() || undefined : undefined;
326403
327404async function send($: Engine, job: Job, who: Who): Promise<{ outcome: string; news: readonly string[] }> {
329406 // While an abso command changes the folder's records, leave the known copy alone: the next record sends the file (#51).
330− if (lockHeld(await readOr($, `${root}/.avcs/${LOCK_FILE}`), Date.now()))
331408 return { outcome: "skipped: another abso command is changing this folder; abso record sends it", news: [] };
333− const knownPath = `${root}/.avcs/known/${rel}`;
337414 // A text file an edit left with a NUL byte: tell the agent now, not forty minutes later (#25).
338− const warning = `${rel} now has a NUL byte at line ${job.nul.line} (character ${job.nul.at}), so it reads as binary. abso will not send or publish it, and the other agents keep its last text, until the NUL is gone.`;
415+ const warning = `${rel} now has a NUL byte at line ${job.nul.line} (character ${job.nul.at}), so it reads as binary. abso will not send or push it, and the other agents keep its last text, until the NUL is gone.`;
341418 return { outcome: "skipped: file is missing or not text; abso record catches up", news: [] };
344421
345− const config = JSON.parse(await $.fs.read(`${root}/.avcs/config.json`)) as {
Lines 431–437 at 318 (were 354–360 at 2)
357− "x-avcs-client": CLIENT,
Lines 463–469 at 318 (were 386–392 at 2)
386463/** One line per edit in .avcs/hook.log (or another log there), as the command hook writes, kept under LOG_LIMIT. */
389− const path = `${root}/.avcs/${file}`;
391468 if (text.length > LOG_LIMIT) text = text.slice(text.indexOf("\n", text.length - LOG_LIMIT / 2) + 1);
- MCP
- compare on this site's /mcp
- CLI
- abso diff 2 318 client/hooks/register.ts --json
- JSON
- /christopher/abso-core/compare/2..318?file=client%2Fhooks%2Fregister.ts&format=json