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 203 to 318

Compare

+50 −0 in 1 place
new file, 50 lines
1+// Groups, the client's part: how history reads, what's refused before any call, and that MCP serves both commands.
2+// The commands against the real store are on the platform side.
3+
4+import assert from "node:assert/strict";
5+import { describe, it } from "node:test";
6+import { eventLine } from "../src/group-commands.ts";
7+import type { GroupEvent } from "../src/issues-wire.ts";
8+import { main } from "../src/main.ts";
9+import { mcpTools } from "../src/mcp.ts";
11+const at = Date.parse("2026-10-15T19:12:00Z");
12+const base = { at, membershipRevision: 1, policyRevision: 1 };
14+describe("groups, the client's part", () => {
15+ it("reads each kind of event as one line, words quoted", () => {
16+ const e = (x: Partial<GroupEvent>): string =>
17+ eventLine({ n: 7, kind: "message", by: "ann", ...base, ...x } as GroupEvent, at);
18+ assert.equal(e({ text: 'hi\nthere "you"' }), ' 7 19:12 UTC ann: "hi\\nthere \\"you\\""');
19+ assert.equal(
20+ e({ text: "re", replyTo: 3, news: [] }),
21+ ' 7 19:12 UTC ann (re 3): "re" (history only, no news)',
22+ );
23+ assert.equal(e({ kind: "joined" }), " 7 19:12 UTC ann joined");
24+ assert.equal(e({ kind: "added", who: "bob" }), " 7 19:12 UTC ann added bob");
25+ assert.equal(
26+ e({ kind: "removed", by: "abso", who: "bob" }),
27+ " 7 19:12 UTC abso removed bob (no longer in the project)",
28+ );
29+ assert.equal(
30+ e({ kind: "settings", detail: { private: { from: false, to: true } } }),
31+ " 7 19:12 UTC ann set private true",
32+ );
33+ });
35+ it("asks for a name before anything else", async () => {
36+ const r = await main(["group"], { cwd: process.cwd(), env: {}, write: () => {} });
37+ assert.equal(r.exit, 1);
38+ assert.match(r.stdout + r.stderr, /abso group <name> reads a group/);
39+ });
41+ it("serves groups and group as MCP tools, with group's flags", () => {
42+ const tools = mcpTools();
43+ const group = tools.find((t) => t.name === "group");
44+ assert.ok(tools.some((t) => t.name === "groups"));
45+ assert.ok(group);
46+ const props = (group.inputSchema as { properties: Record<string, unknown> }).properties;
47+ for (const flag of ["post", "news", "except", "join", "leave", "add", "remove", "before", "kind"])
48+ assert.ok(flag in props, flag);
49+ });
50+});
MCP
compare on this site's /mcp
CLI
abso diff 203 318 client/test/group-commands.test.ts --json
JSON
/christopher/abso-core/compare/203..318?file=client%2Ftest%2Fgroup-commands.test.ts&format=json