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
MCP
blame on this site's /mcp
CLI
abso blame worker/project/test/seat-notice.test.ts --version 277 --json
JSON
/christopher/abso-core/blame/worker/project/test/seat-notice.test.ts?version=277&format=json
38 linesgroups 100%Last change groups in version 277,

38 lines from 2 changes in 1 version.

groups277Seats say who is calling, and a seat's earlier chat can hear that another chat picked it up. The CLI sends X-Abso-Caller on every call: the chat's session id (CLAUDE_CODE_SESSION_ID, when abso runs in a Claude Code chat), the computer's name and the folder, base64url JSON, at most 512 bytes. A folder that reads signed out sends none. src/caller.ts reads it back exactly or not at all. It's information only; the agent key still decides who is calling. The engine's seatNotice(agent, place, key) queues one fixed-wording news line to that seat, once per key. An answer carrying seatNotice is printed once with the news. Tests: client caller and visitor, worker/project seat-notice, announce-person, news-*, tells (29 pass); tsc clean.Compare1// A seat's earlier chat hears that another chat just used the seat: one line, worded here, once per key, to that seat only.
2import assert from "node:assert/strict";
3import { test } from "node:test";
4import { MemoryStore, Project } from "../project.ts";
5
6function setup() {
7 const store = new MemoryStore();
8 const project = new Project(store);
9 project.init({ "a.txt": "a\n" }, 0);
10 for (const a of ["ann", "bob"]) project.sync(a);
11 project.news("ann");
12 project.news("bob");
13 return { project, store };
16test("the seat hears it once, as news, and the history keeps it", () => {
17 const { project, store } = setup();
18 assert.equal(project.seatNotice("ann", "groups on DESKTOP-1", "seat ann:s1:s2:0"), true);
19 assert.equal(
20 project.seatNotice("ann", "groups on DESKTOP-1", "seat ann:s1:s2:0"),
21 false,
22 "the same key adds nothing",
23 );
24 assert.deepEqual(project.news("bob").news, [], "only that seat");
25 assert.deepEqual(project.news("ann").news, ["ann was just used from another chat (groups on DESKTOP-1)"]);
26 const replayed = Project.load(store.entries, new MemoryStore());
27 assert.deepEqual(replayed.news("ann").news, [], "replay knows it was heard");
28 assert.equal(replayed.seatNotice("ann", "groups on DESKTOP-1", "seat ann:s1:s2:0"), false, "and that it was sent");
29});
31test("no seat, no place or a key that isn't a seat's adds nothing; the place stays one line", () => {
32 const { project } = setup();
33 assert.equal(project.seatNotice("cal", "x on m", "seat cal:a:b:0"), false);
34 assert.equal(project.seatNotice("ann", " \n ", "seat ann:a:b:0"), false);
35 assert.equal(project.seatNotice("ann", "x on m", "announce 1"), false);
36 assert.equal(project.seatNotice("ann", "two\nlines on m", "seat ann:a:b:1"), true);
37 assert.deepEqual(project.news("ann").news, ["ann was just used from another chat (two lines on m)"]);
38});