- MCP
- blame on this site's /mcp
- CLI
- abso blame client/src/announce.ts --json
- JSON
- /christopher/abso-core/blame/client/src/announce.ts?format=json
149 linesFirst import 54% · box-grants 41% · pinch 3% · rename 2% · infra-split 1%Last change box-grants in version 291,
149 lines from 8 changes in 8 versions.
2// delivered once as news on each one's next edit (or the mod's next poll),
3// and the news waiting for this agent.
box-grants270abso 690: while a seat holds its news stream, the abso-hooks mod's 30-second news poll stands down. abso news --stream marks the folder (.abso/news-stream.json) for the Monitor's 30 minutes plus the ticket's minute; --follow renews the mark on open and at each 45-second ping. The poll asks again once the mark runs out. Tests: client/test/news-stream.test.ts, client/hooks/register.test.ts (node client/test-mods.ts).Compare5import { writeFileSync } from "node:fs";
6import { join } from "node:path";
8import { bool, type Parsed, str, UsageError } from "./args.ts";
9import { type Env, type Output, open, plural } from "./commands.ts";
10import { logNews } from "./folder.ts";
box-grants270abso 690: while a seat holds its news stream, the abso-hooks mod's 30-second news poll stands down. abso news --stream marks the folder (.abso/news-stream.json) for the Monitor's 30 minutes plus the ticket's minute; --follow renews the mark on open and at each 45-second ping. The poll asks again once the mark runs out. Tests: client/test/news-stream.test.ts, client/hooks/register.test.ts (node client/test-mods.ts).Compare11import { follow, monitorArgs, type Socket, STREAM_MARK, streamMarkUntil, streamText } from "./news-stream.ts";
12import { stateDir } from "./state-dir.ts";
15export async function runAnnounce(args: Parsed, env: Env): Promise<Output> {
16 const text = args.positionals.join(" ").trim();
17 if (text === "") throw new UsageError('say what to announce: abso announce [--to a,b] "text"');
18 const rawTo = str(args, "to");
19 const to =
20 rawTo === undefined
21 ? undefined
22 : rawTo
23 .split(",")
24 .map((a) => a.trim())
25 .filter((a) => a !== "");
26 if (to !== undefined && to.length === 0) throw new UsageError("--to names the agents, separated by commas");
27 const { api } = open(env);
28 const answer = await api.announce(text, to);
29 const who = answer.to.length === 0 ? "nobody (no other agents yet)" : answer.to.join(", ");
30 return {
box-grants272abso-hooks mod: ask for news every 5 minutes, not 30 seconds, and not at all in a chat with no tool call for 10 minutes (its next tool call starts it again). Prod abso's object reset under the load of every chat asking every 30 seconds (Agent VCS, 5:10 PM CT). abso announce says so. Tests: node client/test-mods.ts.Compare31 text: `Announced to ${who}. Each gets it once, as news on their next edit, within about 5 minutes in a working chat where the abso mod runs, or at once where it holds its news stream.`,
33 };
34}
36/** abso start: say what you are starting on, before any edit lands (#37, #13). */
37export async function runStart(args: Parsed, env: Env): Promise<Output> {
38 const { api } = open(env);
39 if (bool(args, "done")) {
40 await api.starting(null);
41 return { text: "Starting note taken back.", json: { starting: null, overlaps: [] } };
42 }
43 const text = args.positionals[0]?.trim() ?? "";
44 if (text === "") throw new UsageError('say what you are starting on: abso start "<what>" [files...]');
45 const files = args.positionals.slice(1);
46 // --issue N (#54): the issue this work is for; publish --done closes it.
47 const issueFlag = args.flags.get("issue");
48 const issue = typeof issueFlag === "string" ? Number(issueFlag) : undefined;
49 if (issue !== undefined && (!Number.isInteger(issue) || issue < 1))
50 throw new UsageError('--issue takes an issue number: abso start "<what>" --issue 12');
51 const answer = await api.starting(text, files, issue !== undefined ? { issue } : {});
52 const lines = [
rename100abso publish is now abso push, abso sync is now abso pull (abso 427)
Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing.
push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch.
Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare53 `Starting on "${text}"${files.length > 0 ? `, naming ${files.join(", ")}` : ""}${issue !== undefined ? ` for issue ${issue}` : ""}. abso where shows it to everyone until you push (or abso start --done).` +
54 (issue !== undefined ? ` abso push --done closes issue ${issue}.` : ""),
56 if (answer.overlaps.length > 0) {
57 lines.push("Already there:");
58 for (const o of answer.overlaps) {
59 const what = [
rename100abso publish is now abso push, abso sync is now abso pull (abso 427)
Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing.
push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch.
Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare60 o.changes ? plural(o.changes, "unpushed change") : "",
62 ]
63 .filter((w) => w !== "")
64 .join(", ");
65 lines.push(` ${o.file}: ${o.agent}${what === "" ? "" : ` (${what})`}`);
66 }
infra-split37Comments and test names give each reason in plain words, without naming who raised it
Notes like "(#37, Builder 5)" or "(AVCS - Security)" become "(#37)" or go, and a private commit hash after a name goes with it. Issue numbers and references such as git's CVE-2019-1353 stay. Only comments and test names change; no behavior changes.Compare67 // The sentence people act on names who, and their note (#37: without it, an agent had to run abso where to learn it).
69 const notes = agents.flatMap((a) => {
70 const note = answer.overlaps.find((o) => o.agent === a && o.starting)?.starting;
71 return note === undefined ? [] : [`${a}'s "${note}"`];
72 });
73 lines.push(
74 `${agents.join(" and ")} ${agents.length === 1 ? "hears" : "hear"} of your note on their next edit. If it is the same work${notes.length > 0 ? ` as ${notes.join(" or ")}` : ""}, settle who does what first: abso announce --to ${agents.join(",")} "..." reaches ${agents.length === 1 ? "them" : "each of them"}.`,
75 );
76 }
77 return { text: lines.join("\n"), json: { ...answer } };
78}
box-grants270abso 690: while a seat holds its news stream, the abso-hooks mod's 30-second news poll stands down. abso news --stream marks the folder (.abso/news-stream.json) for the Monitor's 30 minutes plus the ticket's minute; --follow renews the mark on open and at each 45-second ping. The poll asks again once the mark runs out. Tests: client/test/news-stream.test.ts, client/hooks/register.test.ts (node client/test-mods.ts).Compare80/** Says this folder's seat holds its news stream until `until`, so the abso-hooks mod's poll stands down. Best effort. */
81function 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}
box-grants269abso news --stream and --follow (abso 690, news wakes agents): --stream mints a ticket and prints the Monitor call (ws URL plus subprotocols, 30-minute timeout) so a Claude Code chat wakes the moment news arrives, with no polling. --follow holds the seat's stream itself, a line per item, a new ticket per socket, a ping every 45 s, waits 1 s doubling to a minute between sockets, and stops on a refused key or a server without the stream (404). The key never goes in a URL or a Monitor call. Needs the server's news/ticket and news/stream routes (Read Speed, next). Tests: client/test/news-stream.test.ts.Compare89export async function runNews(args: Parsed, env: Env): Promise<Output> {
90 const { root, config, api } = open(env);
91 if (bool(args, "stream") && bool(args, "follow"))
92 throw new UsageError("abso news takes --stream or --follow, not both");
93 if (bool(args, "stream")) {
94 const ticket = await api.newsTicket();
box-grants270abso 690: while a seat holds its news stream, the abso-hooks mod's 30-second news poll stands down. abso news --stream marks the folder (.abso/news-stream.json) for the Monitor's 30 minutes plus the ticket's minute; --follow renews the mark on open and at each 45-second ping. The poll asks again once the mark runs out. Tests: client/test/news-stream.test.ts, client/hooks/register.test.ts (node client/test-mods.ts).Compare95 markStream(root, streamMarkUntil(ticket, Date.now()));
box-grants269abso news --stream and --follow (abso 690, news wakes agents): --stream mints a ticket and prints the Monitor call (ws URL plus subprotocols, 30-minute timeout) so a Claude Code chat wakes the moment news arrives, with no polling. --follow holds the seat's stream itself, a line per item, a new ticket per socket, a ping every 45 s, waits 1 s doubling to a minute between sockets, and stops on a refused key or a server without the stream (404). The key never goes in a URL or a Monitor call. Needs the server's news/ticket and news/stream routes (Read Speed, next). Tests: client/test/news-stream.test.ts.Compare96 return {
97 text: streamText(ticket, config.project, config.agent),
98 json: { monitor: monitorArgs(ticket, config.project, config.agent), expiresAt: ticket.expiresAt },
99 };
100 }
101 if (bool(args, "follow")) {
102 let stop = false;
103 const onInt = () => {
104 stop = true;
105 };
106 process.once("SIGINT", onInt);
107 try {
108 const ended = await follow({
109 mint: () => api.newsTicket(),
box-grants291abso news --follow (abso 690): a frame is a wake. On one, --follow reads the seat's news (POST news, which marks it heard) and prints that answer, one read at a time; frames arriving meanwhile fold into one more read. When the read is empty (staging 1418 counts a frame as heard already, or another chat took it), it prints the frames it hasn't printed. That's for Read Speed's fix, where frames stop counting as heard so a dead Monitor socket loses nothing, and it works on today's server too. Live on staging: 1.5 s, printed once. Tests: client/test/news-stream.test.ts.Compare110 // A frame is a wake: read the news, which marks it heard, and print that (news-stream.ts).
111 take: async () => newsLines((await api.news()).news),
box-grants269abso news --stream and --follow (abso 690, news wakes agents): --stream mints a ticket and prints the Monitor call (ws URL plus subprotocols, 30-minute timeout) so a Claude Code chat wakes the moment news arrives, with no polling. --follow holds the seat's stream itself, a line per item, a new ticket per socket, a ping every 45 s, waits 1 s doubling to a minute between sockets, and stops on a refused key or a server without the stream (404). The key never goes in a URL or a Monitor call. Needs the server's news/ticket and news/stream routes (Read Speed, next). Tests: client/test/news-stream.test.ts.Compare112 connect: (url, protocols) => new WebSocket(url, [...protocols]) as unknown as Socket,
113 write: (line) => {
114 logNews(root, [line]);
115 env.write(`${line.replace(/\r?\n/g, " ")}\n`);
116 },
box-grants270abso 690: while a seat holds its news stream, the abso-hooks mod's 30-second news poll stands down. abso news --stream marks the folder (.abso/news-stream.json) for the Monitor's 30 minutes plus the ticket's minute; --follow renews the mark on open and at each 45-second ping. The poll asks again once the mark runs out. Tests: client/test/news-stream.test.ts, client/hooks/register.test.ts (node client/test-mods.ts).Compare117 held: (until) => markStream(root, until),
box-grants269abso news --stream and --follow (abso 690, news wakes agents): --stream mints a ticket and prints the Monitor call (ws URL plus subprotocols, 30-minute timeout) so a Claude Code chat wakes the moment news arrives, with no polling. --follow holds the seat's stream itself, a line per item, a new ticket per socket, a ping every 45 s, waits 1 s doubling to a minute between sockets, and stops on a refused key or a server without the stream (404). The key never goes in a URL or a Monitor call. Needs the server's news/ticket and news/stream routes (Read Speed, next). Tests: client/test/news-stream.test.ts.Compare118 note: (line) =>
119 env.write(`${line}
120`),
121 sleep: (ms) => new Promise((ok) => setTimeout(ok, ms)),
122 now: () => Date.now(),
123 every: (ms, fn) => {
124 const t = setInterval(fn, ms);
125 return () => clearInterval(t);
126 },
127 stopped: () => stop,
128 });
129 return ended.ended === "refused"
130 ? { text: `The news stream refused this seat: ${ended.reason}`, json: ended, exit: 2 }
131 : { text: "", json: ended };
132 } finally {
133 process.off("SIGINT", onInt);
134 }
135 }
137 const news = newsLines(answer.news);
138 logNews(root, news);
139 if (news.length === 0) return { text: "No news.", json: { news } };
140 const at = new Map((answer.items ?? []).map((i) => [i.text, i.at]));
141 const items = news.map((text) => ({ text, at: at.get(text) ?? null }));
142 return {
pinch33Client: a tell reads as who told you and how sure that is, with what was said on the lines below: "ann (as claimed) told you:", "Robin (a person) told you:", "ann (checked) told you:" for an agent with a key of its own. A person's words are unquoted and their id is left out (news.log keeps the sentence whole). Tells are never cut in an agent's context, and later lines are indented everywhere news is printed (news, the News: block, the edit hook). What the server stores is unchanged. Client tests 273/273, tsc and biome clean.Compare143 text: [
144 `${plural(news.length, "news item")}:`,
145 ...items.map((i) => ` ${newsWithTime(i.text, i.at).replace(/\r?\n/g, "\n ")}`),
146 ].join("\n"),
148 };
149}