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 269 to 270

Compare

+15 −1 in 3 places
Lines 2–15 at 270 (were 2–12 at 269)
22// delivered once as news on each one's next edit (or the mod's next poll),
33// and the news waiting for this agent.
44
5+import { writeFileSync } from "node:fs";
6+import { join } from "node:path";
57import { newsLines } from "./api.ts";
68import { bool, type Parsed, str, UsageError } from "./args.ts";
79import { type Env, type Output, open, plural } from "./commands.ts";
810import { logNews } from "./folder.ts";
9−import { follow, monitorArgs, type Socket, streamText } from "./news-stream.ts";
11+import { follow, monitorArgs, type Socket, STREAM_MARK, streamMarkUntil, streamText } from "./news-stream.ts";
12+import { stateDir } from "./state-dir.ts";
1013import { newsWithTime } from "./times.ts";
1114
1215export async function runAnnounce(args: Parsed, env: Env): Promise<Output> {
Lines 77–98 at 270 (were 74–85 at 269)
7477 return { text: lines.join("\n"), json: { ...answer } };
7578}
7679
80+/** Says this folder's seat holds its news stream until `until`, so the abso-hooks mod's poll stands down. Best effort. */
81+function markStream(root: string, until: number): void {
82+ try {
83+ writeFileSync(join(stateDir(root), STREAM_MARK), JSON.stringify({ until }));
84+ } catch {
85+ // The mod keeps polling; nothing is lost.
86+ }
87+}
7789export async function runNews(args: Parsed, env: Env): Promise<Output> {
7890 const { root, config, api } = open(env);
7991 if (bool(args, "stream") && bool(args, "follow"))
8092 throw new UsageError("abso news takes --stream or --follow, not both");
8193 if (bool(args, "stream")) {
8294 const ticket = await api.newsTicket();
95+ markStream(root, streamMarkUntil(ticket, Date.now()));
8396 return {
8497 text: streamText(ticket, config.project, config.agent),
8598 json: { monitor: monitorArgs(ticket, config.project, config.agent), expiresAt: ticket.expiresAt },
Lines 112–118 at 270 (were 99–104 at 269)
99112 logNews(root, [line]);
100113 env.write(`${line.replace(/\r?\n/g, " ")}\n`);
101114 },
115+ held: (until) => markStream(root, until),
102116 note: (line) =>
103117 env.write(`${line}
104118`),
MCP
compare on this site's /mcp
CLI
abso diff 269 270 client/src/announce.ts --json
JSON
/christopher/abso-core/compare/269..270?file=client%2Fsrc%2Fannounce.ts&format=json