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 255 to 256

Compare

+46 −0 in 2 places
Lines 58–67 at 256 (were 58–63 at 255)
5858 Attachment,
5959 Draft,
6060 DraftBody,
61+ GroupEvent,
62+ GroupShown,
63+ GroupSummary,
64+ GroupWrite,
6165 News as IssueNews,
6266 IssuePage,
6367 IssueRow,
Lines 689–736 at 256 (were 685–690 at 255)
685689 return this.#threads(this.#issues("POST", this.agentPath(`reply/${id}`), body));
686690 }
687691
692+ /** A groups call, with a server from before groups named as that rather than a bare 404. */
693+ async #groups<T>(call: Promise<T>): Promise<T> {
694+ try {
695+ return await call;
696+ } catch (err) {
697+ if (err instanceof ApiError && err.status === 404 && /no such issues route|reads have no/.test(err.message))
698+ throw new ApiError(`${this.config.server} doesn't have groups yet`, 404);
699+ throw err;
700+ }
701+ }
703+ /** The project's groups this agent can see. */
704+ groupList(): Promise<{ groups: readonly GroupSummary[] }> {
705+ return this.#groups(this.#issues("GET", this.agentPath("groups")));
706+ }
708+ /** One group's settings and roster, by name or id. */
709+ group(ref: string): Promise<GroupShown> {
710+ return this.#groups(this.#issues("GET", this.agentPath(`group/${encodeURIComponent(ref)}`)));
711+ }
713+ /** A page of a group's history, newest first, and the `before` that reads further back (null at the start). */
714+ groupEvents(
715+ ref: string,
716+ q: { before?: number; limit?: number; kind?: string } = {},
717+ ): Promise<{ events: readonly GroupEvent[]; before: number | null }> {
718+ const qs = query({ before: q.before, limit: q.limit, kind: q.kind }).toString();
719+ return this.#groups(
720+ this.#issues("GET", this.agentPath(`group/${encodeURIComponent(ref)}/events${qs ? `?${qs}` : ""}`)),
721+ );
722+ }
724+ /** Make a group (ref undefined), or post, join, leave, add, remove or change settings in one. */
725+ groupWrite(
726+ ref: string | undefined,
727+ action: "post" | "join" | "leave" | "add" | "remove" | "settings" | undefined,
728+ body: Record<string, unknown>,
729+ ): Promise<GroupWrite> {
730+ const path = ref === undefined ? "groups" : `group/${encodeURIComponent(ref)}/${action}`;
731+ return this.#groups(this.#issues("POST", this.agentPath(path), body));
732+ }
688734 /** Takes back an ask this agent made, with a note on why; the one asked hears it. */
689735 withdraw(id: number, body: { note?: string }): Promise<{ ask: Ask; news?: IssueNews }> {
690736 return this.#issues("POST", this.agentPath(`withdraw/${id}`), body);
MCP
compare on this site's /mcp
CLI
abso diff 255 256 client/src/api.ts --json
JSON
/christopher/abso-core/compare/255..256?file=client%2Fsrc%2Fapi.ts&format=json