Versions 286 to 318
Lines 3–12 at 318 (were 3–11 at 286)
33
67
78/** The world beneath the mod: a chat in /w/p, an abso folder when `inFolder`, and a server with `news` waiting. */
8−function world(on: On, inFolder: boolean, news: string[][]) {
Lines 22–28 at 318 (were 21–27 at 286)
24− return { value: JSON.stringify({ server: "https://avcs.test", project: "p", agent: "bob" }) };
Lines 115–152 at 318 (were 114–116 at 286)
114115 expect(w.written.get("/w/p/.abso/hook.log") ?? "").toContain("not sent: a NUL byte at line 3");
118+
119+test("a local project's edit goes to abso hook as Claude Code's command hook would get it, and its news to the chat", async ($, on) => {
128+ const stdout = JSON.stringify({ hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: context } });
132+ await $.tool.call({ tool: "Write", tool_use_id: "t1", file_path: "/w/p/notes.md", content: "hello\n" } as never);
Lines 33–39 at 318 (were 33–39 at 286)
36−import { STAMP } from "./stamp.ts";
3737
Lines 182–205 at 318 (were 182–196 at 286)
184184
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). */
192199 } 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 220–230 at 318 (were 211–221 at 286)
212221 `${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}`,
214− const context = newsContext(news);
218− 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–279 at 318 (were 228–233 at 286)
230239
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+
231277/** Ask for the news waiting for this agent (announcements, collisions) and hand it to the model. */
Lines 288–294 at 318 (were 242–247 at 286)
247294 `${config.server.replace(/\/+$/, "")}/p/${encodeURIComponent(config.project)}/a/${encodeURIComponent(config.agent)}/news`,
Lines 3–11 at 318 (were 3–5 at 286)
6+
- MCP
- compare on this site's /mcp
- CLI
- abso diff 286 318 client/hooks --json
- JSON
- /christopher/abso-core/compare/286..318?file=client%2Fhooks&format=json