- MCP
- blame on this site's /mcp
- CLI
- abso blame client/src/api.ts --json
- JSON
- /christopher/abso-core/blame/client/src/api.ts?format=json
1,102 linesFirst import 64% · pinch 22% · groups 7% · autosettle 2% · devops 2% · codex-prose-authorship-1 1% · Last change pinch in version 287,
1,102 lines from 30 changes in 29 versions.
2// except `run`, which sends a tar.gz and reads the answer as a stream of JSON
3// lines (box-run.ts).
codex-capacity-chair162Add reviewed disk-first history and indexed graph storage for core issue 16; retain runtime activation gateCompare5import { randomUUID } from "node:crypto";
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.Compare7import { CALLER_HEADER } from "../../src/caller.ts";
9 ChangeAnswer,
10 DraftSyncAnswer,
11 EditAnswer,
12 EditBody,
13 News,
14 NoteAnswer,
15 NoteBody,
16 PublishAnswer,
17 RecordAnswer,
18 StatusAnswer,
19 SwitchAnswer,
20 SyncAnswer,
21} from "./api-answers.ts";
22import { ApiError, errorSentence, neverSent } from "./api-error.ts";
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare23import { UsageError } from "./args.ts";
autosettle220abso autosettle: see or change what the server does with a held push (abso-core 23)
abso autosettle says the project's choice: Off, Advise, or Settle at a confidence. It also says when the gate is stopped and who changed it last. abso autosettle off|advise|settle [--at 0.3-0.95] changes it, which takes the owner's key (on staging, the shared token too); without --at the server keeps its own. On a server with no choice per project (the open server), it says the operator's AUTOSETTLE decides. A visitor folder refuses it.
Tried on project abso's Worker run locally (read, settle --at 0.7, advise, a bad word, --at 2) and on the open server. Tests: autosettle-command (words), visitor (the allow-list), typecheck clean.Compare24import type { AutosettleAnswer, AutosettleMode } from "./autosettle-commands.ts";
26 boxQuery,
27 consumeRun,
28 follow,
29 followUrl,
30 type PrepAnswer,
31 postRun,
32 RECONNECT_DELAYS_MS,
33 RUN_START_RETRY_MS,
34 type RunIO,
35 type RunKind,
36 type ServeAnswer,
37} from "./box-run.ts";
38import type { CiJob, CiStatus, QueueState } from "./ci-answers.ts";
39import { clientVersion } from "./client-version.ts";
40import type { Config } from "./config.ts";
41import type {
42 BlameAnswer,
43 DiffAnswer,
44 DropAnswer,
45 FileChange,
46 FilesAnswer,
47 LogAnswer,
48 Overlap,
49 PluckAnswer,
50 RestoreAnswer,
51 ShowAnswer,
52 View,
53 Where,
54 WhereAnswer,
55 WhyAnswer,
candidates186Read a version of shared without some earlier versions: abso show <N> --without A,B shows what differs and abso export <dir> --version N --without A,B writes the files. The server's GET without?version=&versions= checks the set left exactly as asked: when a version it keeps builds on one left out, it refuses with that chain, the files and the wider set that works, and never widens it. Atoms keep their ids and authors; shared and its log don't change; the same ask gives the same tree hash.Compare56 WithoutAnswer,
devops20Add abso search: find a project's issues by words or meaning
`abso search "<words>" [--limit <N>]` lists the project's issues that
match, best first, and is served as an MCP tool as well.
- Each hit shows the issue, then where it matched: the title, the
description, a comment, or "by meaning".
- "#N" or "N" puts issue N first.
- Where the server also searches by meaning, an issue worded unlike
the search still turns up; the hit says so.Compare58import type {
59 Ask,
60 Attachment,
61 Draft,
62 DraftBody,
groups256groups: abso groups and abso group, for a project's named groups of agents and people with one shared history. abso group <name> reads its settings, members and history (newest first; --before, --limit, --kind). --post adds a message, with news for every other member unless --news names some, --except leaves some out, or --news none keeps it in the history only. --join, --leave, --add, --remove, --rename, --private on|off and --joinable on|off change it; abso group new makes one. A retried post never posts twice (the Idempotency-Key every POST sends). Both are MCP tools; a visitor folder refuses them. Tests: client/test/group-commands.test.ts, visitor.test.ts.Compare63 GroupEvent,
64 GroupShown,
65 GroupSummary,
66 GroupWrite,
devops20Add abso search: find a project's issues by words or meaning
`abso search "<words>" [--limit <N>]` lists the project's issues that
match, best first, and is served as an MCP tool as well.
- Each hit shows the issue, then where it matched: the title, the
description, a comment, or "by meaning".
- "#N" or "N" puts issue N first.
- Where the server also searches by meaning, an issue worded unlike
the search still turns up; the hit says so.Compare67 News as IssueNews,
68 IssuePage,
69 IssueRow,
70 IssueSearchHit,
71} from "./issues-wire.ts";
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare72import { isLocal, LOCAL_BASE, localFetch, NO_STORE } from "./local-store.ts";
75export * from "./api-answers.ts";
76export { ApiError, neverSent } from "./api-error.ts";
77export {
78 type PrepAnswer,
79 RECONNECT_DELAYS_MS,
80 RUN_START_RETRY_MS,
81 type RunIO,
82 type RunKind,
83 type ServeAnswer,
84} from "./box-run.ts";
85export * from "./ci-answers.ts";
86export * from "./history-answers.ts";
devops20Add abso search: find a project's issues by words or meaning
`abso search "<words>" [--limit <N>]` lists the project's issues that
match, best first, and is served as an MCP tool as well.
- Each hit shows the issue, then where it matched: the title, the
description, a comment, or "by meaning".
- "#N" or "N" puts issue N first.
- Where the server also searches by meaning, an issue worded unlike
the search still turns up; the hit says so.Compare87export type { Ask, Attachment, Draft, DraftBody, IssueNews, IssuePage, IssueRow, IssueSearchHit };
89/**
90 * How long a call may take: the base, plus 1 s for each 100 KB it sends
91 * (abso issue 34: a sync that recorded 191 reformatted files first ran out of
92 * its 30 s while the server was still taking them in).
93 */
94export function timeoutFor(baseMs: number, sent: string | undefined): number {
95 return sent === undefined ? baseMs : baseMs + Math.floor(Buffer.byteLength(sent) / 100_000) * 1000;
96}
pinch26Publish and log fixes, and a flaky test removed.
- A publish or a land now waits up to 150 s for the server's answer, not 30 s. The server may work on one request for up to 2 minutes, so a slow merge was reported as failed and then landed.
- abso log reads any length of history. The server sends at most 200 versions a page, and the client now follows its pages: -n 2000 gives 2000, and --since or a folder reads up to 1000. abso log --before <version> starts below that version. The end of the list names the --before for the next older ones, and a filtered read says when it stopped short.
- The test 'sends one run, and takes each command as one quoted word' is removed: it failed on Windows about half the time. The stand-in server the client tests use no longer closes idle kept-alive connections, which other tests also tripped on under load (ECONNRESET).
Check: 722 pass, 0 fail.Compare98/**
99 * How long a publish or a land may take before the client stops waiting: the
100 * server gives one request up to 2 minutes of work, so a small body can still
101 * take that long (a large merge). Waiting less reported publishes as failed
102 * that went on to land.
103 */
104export const PUBLISH_TIMEOUT_MS = 150_000;
106/** The most versions the server's log sends at once. */
107export const LOG_PAGE = 200;
init0Start the project109/** A query string from the values that are set (null and undefined are left out). */
110function query(values: Record<string, string | number | null | undefined>): URLSearchParams {
111 const q = new URLSearchParams();
112 for (const [k, v] of Object.entries(values)) if (v !== null && v !== undefined) q.set(k, String(v));
113 return q;
114}
116export function newsLines(news: News): string[] {
117 if (news === undefined || news === null) return [];
118 return (typeof news === "string" ? [news] : [...news]).filter((s) => typeof s === "string" && s.trim() !== "");
119}
pinch23abso issue <N> --copy-to <project>: copy an issue into another project, with its comments, answered asks and labels, each keeping its author and time. The Issues server reads the source issue itself; the client sends only which issue, and any cleaned texts.
- --dry-run shows what the copy would make (title, how many comments and asks, which were edited, labels) and what's left behind. It writes nothing.
- --clean <file> gives cleaned texts by source id, as JSON: {title, description, comments: [{id, text}], asks: [{id, question, answer}]}. A comment left out of a given list isn't copied.
- --copy-to goes alone, so a copy is never half an edit. Copying into the project the issue is already in is refused before any call.
- When a live server refuses the copy (copying out of a project there takes an owner of it), the message says --dry-run still works.
- The MCP issue tool's clean input is a file too, so it's confined to the server's start folder like attach.
Tests: client/test/issues.test.ts, against a stand-in Issues server. The run --parallel test that sometimes times out under a full run passed when rerun.Compare121/** An issue copy's request: the source, and any texts given cleaned, by their source ids. */
122export interface CopyBody {
123 from: string;
124 issue: number;
125 title?: string;
126 description?: string;
127 comments?: { id: number; text?: string }[];
128 asks?: { id: number; question?: string; answer?: string }[];
129}
131/** What a copy writes, as a dry run answers it. */
132export interface CopyPlan {
133 from: { project: string; issue: number };
134 title: string;
135 edited: ("title" | "description")[];
136 labels: string[];
137 closed: { how: "done" | "dropped" } | null;
138 comments: { edited: boolean }[];
139 asks: { edited: boolean }[];
140 skipped: { comments: number[]; asks: number[] };
141}
143export type CopyAnswer =
144 | { dryRun: true; plan: CopyPlan }
145 | { ok: true; id: number; from: { project: string; issue: number }; skipped: { comments: number[]; asks: number[] } };
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.Compare147/**
148 * The server's line when another chat just used this seat (seatNotice on an answer): kept until main() prints it with
149 * the news, once however many answers carried it.
150 */
151const seatNotices = new Set<string>();
152function noteSeat(answer: unknown): void {
153 if (typeof answer !== "object" || answer === null || Array.isArray(answer)) return;
154 const line = (answer as { seatNotice?: unknown }).seatNotice;
155 if (typeof line === "string" && line !== "" && line.length <= 300 && !/[\u0000-\u001f]/.test(line))
156 seatNotices.add(line);
157}
158export function takeSeatNotices(): string[] {
159 const out = [...seatNotices];
160 seatNotices.clear();
161 return out;
162}
165 readonly config: Config;
166 readonly timeoutMs: number;
168 /** Waits between tries when a run's stream breaks; tests shorten them. */
169 readonly reconnectDelaysMs: readonly number[];
170 readonly startRetryDelaysMs: readonly number[];
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare171 /** Another box of this agent for run, logs and fetch (--box or ABSO_BOX, #37); undefined is its own box. */
174 constructor(
175 config: Config,
176 timeoutMs = 30_000,
177 reconnectDelaysMs: readonly number[] = RECONNECT_DELAYS_MS,
178 startRetryDelaysMs: readonly number[] = RUN_START_RETRY_MS,
179 ) {
180 this.config = config;
181 this.timeoutMs = timeoutMs;
182 this.reconnectDelaysMs = reconnectDelaysMs;
183 this.startRetryDelaysMs = startRetryDelaysMs;
184 }
pinch54The client and the edit mods send and read X-Abso-* headers only (Client, Name, Run-Key, Kind, Admin; Run, Box, Prep from answers). Servers have read X-Abso-* beside the old names for a while and answer under both, so this works with any current server.Compare186 /** What a box run is for, for the server's box-run records (#39): X-Abso-Kind on POST /run. */
189 /** The Issues Worker (#54) this folder's issues calls go to; set by the issues commands (issues.ts). */
190 issuesServer: string | undefined;
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.Compare191
192 /** Who is calling this seat (src/caller.ts): this chat's session, this computer and this folder. Set by open(). */
193 caller: string | undefined;
195 url(path: string, server = this.config.server): string {
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare196 const base = isLocal(server) ? LOCAL_BASE : server;
197 return `${base.replace(/\/+$/, "")}/p/${encodeURIComponent(this.config.project)}${path}`;
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare200 /** A local project's calls: answered in this process (local-store.ts). */
201 private local: ((input: string, init?: RequestInit) => Promise<Response>) | undefined;
204 return `/a/${encodeURIComponent(this.config.agent)}/${action}`;
205 }
207 headers(contentType?: string): Record<string, string> {
208 return {
209 // Which client made the call (#29); the mods send theirs too.
pinch54The client and the edit mods send and read X-Abso-* headers only (Client, Name, Run-Key, Kind, Admin; Run, Box, Prep from answers). Servers have read X-Abso-* beside the old names for a while and answer under both, so this works with any current server.Compare210 "x-abso-client": `abso-cli/${clientVersion()}`,
pinch86Read a public project signed out: abso join <project> --reader with no sign-in makes a folder that reads it. The folder holds only its settings (server, project, visitor), sends no sign-in whatever the environment or the box holds, follows no redirect, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused before any call, from an allow-list a new command has to join. join answers a private project and a missing one alike, by the status answer's code alone. Tests in client/test/visitor.test.ts.Compare211 ...(this.config.token && !this.config.visitor ? { authorization: `Bearer ${this.config.token}` } : {}),
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.Compare212 // A visitor says nothing about where it's reading from.
213 ...(this.caller !== undefined && !this.config.visitor ? { [CALLER_HEADER]: this.caller } : {}),
215 };
216 }
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare218 /**
219 * Every request this Api makes goes through here. In a visitor folder it never sends anything but a GET,
220 * and follows no redirect, so nothing it sends goes anywhere it didn't name (headers() adds no sign-in).
221 */
222 send(url: string, init: RequestInit = {}): Promise<Response> {
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare223 if (isLocal(this.config.server)) {
224 const dir = this.config.localStore;
225 if (dir === undefined) return Promise.reject(new UsageError(NO_STORE));
226 this.local ??= localFetch(dir);
227 return this.local(url, init);
228 }
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare229 if (!this.config.visitor) return fetch(url, init);
230 if ((init.method ?? "GET") !== "GET")
231 return Promise.reject(new ApiError("a folder that reads signed out sends only reads"));
232 return fetch(url, { ...init, redirect: "error" });
233 }
pinch26Publish and log fixes, and a flaky test removed.
- A publish or a land now waits up to 150 s for the server's answer, not 30 s. The server may work on one request for up to 2 minutes, so a slow merge was reported as failed and then landed.
- abso log reads any length of history. The server sends at most 200 versions a page, and the client now follows its pages: -n 2000 gives 2000, and --since or a folder reads up to 1000. abso log --before <version> starts below that version. The end of the list names the --before for the next older ones, and a filtered read says when it stopped short.
- The test 'sends one run, and takes each command as one quoted word' is removed: it failed on Windows about half the time. The stand-in server the client tests use no longer closes idle kept-alive connections, which other tests also tripped on under load (ECONNRESET).
Check: 722 pass, 0 fail.Compare235 async json<T>(
236 method: "GET" | "POST",
237 path: string,
238 body?: unknown,
239 server = this.config.server,
240 atLeastMs = 0,
241 ): Promise<T> {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare243 if (this.config.visitor && method !== "GET")
244 throw new ApiError(`${path}: a folder that reads signed out sends only reads`);
codex-capacity-chair162Add reviewed disk-first history and indexed graph storage for core issue 16; retain runtime activation gateCompare246 const requestId = method === "POST" ? randomUUID() : undefined;
pinch26Publish and log fixes, and a flaky test removed.
- A publish or a land now waits up to 150 s for the server's answer, not 30 s. The server may work on one request for up to 2 minutes, so a slow merge was reported as failed and then landed.
- abso log reads any length of history. The server sends at most 200 versions a page, and the client now follows its pages: -n 2000 gives 2000, and --since or a folder reads up to 1000. abso log --before <version> starts below that version. The end of the list names the --before for the next older ones, and a filtered read says when it stopped short.
- The test 'sends one run, and takes each command as one quoted word' is removed: it failed on Windows about half the time. The stand-in server the client tests use no longer closes idle kept-alive connections, which other tests also tripped on under load (ECONNRESET).
Check: 722 pass, 0 fail.Compare247 const timeoutMs = Math.max(atLeastMs, timeoutFor(this.timeoutMs, sent));
init0Start the project248 // A connection that never opened is tried once more, IPv4 first (#37, GAME - UI/UX: one IPv6
249 // address timed out, and the same command went through seconds later). Nothing went out, so
250 // a POST is as safe to send again as a GET.
251 for (let attempt = 0; res === undefined; attempt++) {
252 try {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare253 res = await this.send(this.url(path, server), {
codex-capacity-chair162Add reviewed disk-first history and indexed graph storage for core issue 16; retain runtime activation gateCompare255 headers: {
256 ...this.headers(sent === undefined ? undefined : "application/json"),
257 ...(requestId ? { "Idempotency-Key": requestId } : {}),
258 },
260 signal: AbortSignal.timeout(timeoutMs),
261 });
262 } catch (err) {
pinch287Local projects: abso init --local keeps a project's history on this machine, with no server, sign-in or network
A local folder's calls never leave the process. The client runs the open server's own router and project object (server/src) in-process, over Node's built-in SQLite. It's the same engine with the same answers, so what the commands print matches a server.
- abso init --local [--project <name>] [--agent <name>] [--store <folder>] makes the project, and abso join <project> --local adds a folder. After that, record, push, pull, log, blame and the held collisions work as usual. The folder's config says "server": "local".
- Where the store lives: --store (kept in the folder's config; a store inside the folder is left out of its files through .absoignore), else ABSO_STORE, else this user's data folder: %LOCALAPPDATA%\abso\store, ~/Library/Application Support/abso/store, or $XDG_DATA_HOME/abso/store. Nothing needs a writable home folder when ABSO_STORE or --store is set.
- Each project is <store>/<project>/project.sqlite. Every call runs in one SQLite write transaction, which is the store's lock: other processes wait for it, and a process that dies mid-call keeps nothing half-written. A process reloads the project only when SQLite's data_version shows another process wrote.
- No credential goes with a local folder's calls. The edit mod leaves local folders alone, so abso record sends their edits. Issues, asks and news aren't in local projects yet.
- Needs Node 22.13 or later (node:sqlite); its experimental warning is kept out of the output. Run as .ts, a module hook supplies the Durable Object base class (client/src/durable-object-stand-in.ts); the build aliases cloudflare:workers to the same file. client/src/local-server.mjs, with its .d.mts, keeps the client's typecheck out of server/src, which has its own.
- Each command closes the store files it opened.
Tests: local (8, with fetch replaced by one that throws: init, record, push, join, pull, log, blame, a held collision, --store inside the folder, refusals), plus failed-start, install, caller, doctor, lost-pull, help, body-files: 60 pass; tsc clean. The bundle built with the alias runs init, push and log locally.Compare263 // A local project's refusal (no store, a Node without SQLite) says itself.
264 if (err instanceof UsageError) throw err;
266 const why =
267 e.name === "TimeoutError"
268 ? `no answer within ${timeoutMs} ms`
269 : ((e.cause as Error | undefined)?.message ?? e.message);
270 if (!neverSent(err)) throw new ApiError(`could not reach ${server}: ${why}`);
271 if (attempt >= 1) {
272 throw new ApiError(
273 `could not reach ${server}: ${why}. Tried twice, the second time IPv4 first; the connection never opened, so nothing reached the server`,
274 undefined,
275 true,
276 );
277 }
278 setDefaultResultOrder("ipv4first");
279 await new Promise((ok) => setTimeout(ok, 500));
280 }
281 }
codex-prose-authorship-1108Implement bounded sequential client recording for #606Compare282 let text: string;
283 try {
284 text = await res.text();
285 } catch (err) {
286 const reason = err instanceof Error ? err.message : String(err);
287 throw new ApiError(`${method} ${path} response body ended unexpectedly: ${reason}`, res.status);
288 }
init0Start the project289 // 409 is a refusal that says what to do (a drop took out lines your work builds on): print it as it is.
290 if (!res.ok)
291 throw new ApiError(
292 res.status === 409
293 ? `refused: ${errorSentence(text)}`
294 : `${method} ${path} answered ${res.status}: ${errorSentence(text)}`,
295 res.status,
296 );
297 try {
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.Compare298 const parsed = JSON.parse(text) as T;
299 noteSeat(parsed);
300 return parsed;
302 throw new ApiError(
303 `${method} ${path} answered with something that isn't JSON: ${text.slice(0, 300)}`,
304 res.status,
305 );
306 }
307 }
309 init(
310 files: Record<string, string>,
311 modes: Modes = {},
312 blobs: Readonly<Record<string, string>> = {},
313 ): Promise<{ version: number; skipped?: readonly string[] }> {
314 return this.json("POST", "/init", {
315 files,
316 ...(Object.keys(modes).length > 0 ? { modes } : {}),
317 ...(Object.keys(blobs).length > 0 ? { blobs } : {}),
318 });
319 }
321 edit(body: EditBody): Promise<EditAnswer> {
322 return this.json("POST", this.agentPath("edit"), body);
323 }
325 record(
326 files: Record<string, string | null>,
327 extra: { session?: string; subagent?: string } = {},
328 modes: Modes = {},
329 blobs: Readonly<Record<string, string>> = {},
330 ): Promise<RecordAnswer> {
331 return this.json("POST", this.agentPath("record"), {
332 files,
333 ...(Object.keys(modes).length > 0 ? { modes } : {}),
334 ...(Object.keys(blobs).length > 0 ? { blobs } : {}),
335 ...extra,
336 });
337 }
339 /** Move a file in the draft (#49): its lines keep their ids. The way to change a file's case. */
340 move(from: string, to: string): Promise<{ ok: boolean; from: string; to: string; news?: News }> {
341 return this.json("POST", this.agentPath("move"), { from, to });
342 }
344 /** Upload a binary file's bytes under their sha256 (the server checks the hash). */
345 async putBlob(sha: string, bytes: Uint8Array): Promise<void> {
346 await this.bytes("PUT", `/blobs/${sha}`, bytes);
347 }
349 /** A preview of one version of shared at a stable URL (abso serve, #37); a build answers 422 with its output. */
350 async serve(version?: number, cmd?: string, out?: string): Promise<ServeAnswer> {
351 const q = new URLSearchParams({
352 ...(version !== undefined ? { version: String(version) } : {}),
353 ...(cmd ? { cmd } : {}),
354 ...(out ? { out } : {}),
355 });
356 let res: Response;
357 try {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare358 res = await this.send(`${this.url("/serve")}?${q}`, {
360 headers: this.headers(),
361 signal: AbortSignal.timeout(20 * 60_000),
362 });
363 } catch (err) {
364 const e = err as Error;
365 throw new ApiError(
366 `could not reach ${this.config.server}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
367 );
368 }
369 const text = await res.text();
370 if (!res.ok && res.status !== 422)
371 throw new ApiError(`serve answered ${res.status}: ${errorSentence(text)}`, res.status);
372 return JSON.parse(text) as ServeAnswer;
373 }
375 /** Runs a setup command on the folder in a fresh box and keeps the box as what it starts from (abso prep, #37). */
376 async prep(command: string, tarGz: Uint8Array<ArrayBuffer>): Promise<PrepAnswer> {
377 let res: Response;
378 try {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare379 res = await this.send(
380 `${this.url(this.agentPath("prep"))}?cmd=${encodeURIComponent(command)}${boxQuery(this.box)}`,
381 {
382 method: "POST",
383 headers: this.headers("application/gzip"),
384 body: tarGz,
385 // A setup command can take minutes (npm ci, a browser download).
386 signal: AbortSignal.timeout(30 * 60_000),
387 },
388 );
390 const e = err as Error;
391 throw new ApiError(
392 `could not reach ${this.config.server}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
393 );
394 }
395 const text = await res.text();
396 if (!res.ok) throw new ApiError(`prep answered ${res.status}: ${errorSentence(text)}`, res.status);
397 return JSON.parse(text) as PrepAnswer;
398 }
400 /** Forgets the box's prep: it starts from the plain image again. Answers whether it had one. */
401 async unprep(): Promise<boolean> {
402 let res: Response;
403 try {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare404 res = await this.send(
init0Start the project405 `${this.url(this.agentPath("prep"))}${this.box ? `?box=${encodeURIComponent(this.box)}` : ""}`,
406 { method: "DELETE", headers: this.headers(), signal: AbortSignal.timeout(this.timeoutMs) },
407 );
408 } catch (err) {
409 const e = err as Error;
410 throw new ApiError(
411 `could not reach ${this.config.server}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
412 );
413 }
414 const text = await res.text();
415 if (!res.ok) throw new ApiError(`prep answered ${res.status}: ${errorSentence(text)}`, res.status);
416 return (JSON.parse(text) as { forgot: boolean }).forgot;
417 }
419 /** A binary file's bytes by their sha256. */
420 /** A tar.gz of the files under the box's /w that match a glob (bash globstar); null when none match or the box has stopped. */
421 async boxFiles(glob: string): Promise<Uint8Array | null> {
422 try {
423 return await this.bytes(
424 "GET",
425 `${this.agentPath("box-files")}?${new URLSearchParams({ glob, ...(this.box ? { box: this.box } : {}) })}`,
426 );
427 } catch (err) {
428 if (err instanceof ApiError && err.status === 404) return null;
429 throw err;
430 }
431 }
433 getBlob(sha: string): Promise<Uint8Array> {
434 return this.bytes("GET", `/blobs/${sha}`);
435 }
437 async bytes(method: "GET" | "PUT", path: string, body?: Uint8Array): Promise<Uint8Array> {
438 let res: Response;
439 try {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare440 res = await this.send(this.url(path), {
442 headers: this.headers(body === undefined ? undefined : "application/octet-stream"),
443 ...(body === undefined ? {} : { body: body as Uint8Array<ArrayBuffer> }),
444 signal: AbortSignal.timeout(Math.max(this.timeoutMs, 120_000)),
445 });
446 } catch (err) {
447 const e = err as Error;
448 throw new ApiError(
449 `could not reach ${this.config.server}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
450 );
451 }
452 const data = new Uint8Array(await res.arrayBuffer());
453 if (!res.ok)
454 throw new ApiError(
455 `${method} ${path} answered ${res.status}: ${errorSentence(new TextDecoder().decode(data))}`,
456 res.status,
457 );
458 return data;
459 }
461 /** Make this agent a reader, or not (#37): a reader's edits, records and publishes are refused. */
462 reader(on: boolean): Promise<{ agent: string; reader: boolean }> {
463 return this.json("POST", this.agentPath("reader"), { reader: on });
464 }
466 publish(message: string, asIs = false): Promise<PublishAnswer> {
pinch26Publish and log fixes, and a flaky test removed.
- A publish or a land now waits up to 150 s for the server's answer, not 30 s. The server may work on one request for up to 2 minutes, so a slow merge was reported as failed and then landed.
- abso log reads any length of history. The server sends at most 200 versions a page, and the client now follows its pages: -n 2000 gives 2000, and --since or a folder reads up to 1000. abso log --before <version> starts below that version. The end of the list names the --before for the next older ones, and a filtered read says when it stopped short.
- The test 'sends one run, and takes each command as one quoted word' is removed: it failed on Windows about half the time. The stand-in server the client tests use no longer closes idle kept-alive connections, which other tests also tripped on under load (ECONNRESET).
Check: 722 pass, 0 fail.Compare467 return this.json(
468 "POST",
469 this.agentPath("publish"),
470 { message, ...(asIs ? { asIs: true } : {}) },
471 undefined,
472 PUBLISH_TIMEOUT_MS,
473 );
476 /** One change (#44). */
477 change(id: number): Promise<ChangeAnswer> {
478 return this.json("GET", `/change/${id}`);
479 }
481 /** The changes with anything new at or after log position `since`, newest first (#44). */
482 /** Changes active since a log position, newest first; `older` is set when more come before the page (ask again with `before`). */
483 changes(
484 since: number,
485 limit = 50,
486 before?: number,
487 ): Promise<{ since: number; next: number; changes: readonly ChangeAnswer[]; older?: number }> {
488 return this.json("GET", `/changes?${query({ since, limit, before })}`);
489 }
491 /** A call to the Issues Worker (#54), with the same token. */
492 #issues<T>(method: "GET" | "POST", path: string, body?: unknown): Promise<T> {
493 if (this.issuesServer === undefined)
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare494 throw new ApiError(`${this.config.server} has no Issues Worker beside it; ABSO_ISSUES_SERVER names one`);
496 }
pinch89abso reply N, abso ask N and abso asked name a server without ask threads instead of answering its bare 404.Compare498 /** An ask-thread call, with a server from before ask threads named as that rather than a bare 404. */
499 async #threads<T>(call: Promise<T>): Promise<T> {
500 try {
501 return await call;
502 } catch (err) {
503 if (err instanceof ApiError && err.status === 404 && /no such issues route/.test(err.message))
504 throw new ApiError(`${this.config.server} doesn't have ask threads yet`, 404);
505 throw err;
506 }
507 }
510 issues(
511 q: { status?: string; agent?: string; parent?: number; open?: boolean; labels?: readonly string[] } = {},
512 ): Promise<{ issues: readonly IssueRow[] }> {
513 return this.#issues(
514 "GET",
515 `/issues?${query({ status: q.status, agent: q.agent, parent: q.parent, open: q.open ? 1 : undefined, label: q.labels && q.labels.length > 0 ? q.labels.join(",") : undefined })}`,
516 );
devops20Add abso search: find a project's issues by words or meaning
`abso search "<words>" [--limit <N>]` lists the project's issues that
match, best first, and is served as an MCP tool as well.
- Each hit shows the issue, then where it matched: the title, the
description, a comment, or "by meaning".
- "#N" or "N" puts issue N first.
- Where the server also searches by meaning, an issue worded unlike
the search still turns up; the hit says so.Compare517 }
519 /**
520 * The project's issues matching q, best first: by its words and, where
521 * the server has it on, by what it means.
522 */
523 issueSearch(q: string, limit?: number): Promise<{ hits: readonly IssueSearchHit[] }> {
524 return this.#issues("GET", `/search?${query({ q, limit })}`);
527 /** Every label in use, with how many issues have it and how many of those are open. */
528 issueLabels(): Promise<{ labels: readonly { label: string; open: number; total: number }[] }> {
529 return this.#issues("GET", "/labels");
530 }
532 issue(id: number): Promise<IssuePage> {
533 return this.#issues("GET", `/issue/${id}`);
534 }
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare536 /** The asks this agent sent: the open ones, then the latest answered, each with its thread. */
537 asked(): Promise<{ asks: readonly (Ask & { title: string | null })[] }> {
pinch89abso reply N, abso ask N and abso asked name a server without ask threads instead of answering its bare 404.Compare538 return this.#threads(this.#issues("GET", this.agentPath("asked")));
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare539 }
541 /** One ask, open or closed, with its thread and who it waits on. */
542 askThread(id: number): Promise<{ ask: Ask & { title: string | null } }> {
pinch89abso reply N, abso ask N and abso asked name a server without ask threads instead of answering its bare 404.Compare543 return this.#threads(this.#issues("GET", `/ask/${id}`));
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare544 }
init0Start the project546 /** Open asks of someone (an agent, or person:<id>), soonest due first; every open ask without `of`. */
547 waiting(of?: string): Promise<{ asks: readonly (Ask & { title: string | null })[] }> {
548 return this.#issues("GET", `/waiting?${query({ of })}`);
549 }
551 /** This agent's open asks; the Worker marks each it lists for the first time as seen (abso issue 124). */
552 async waitingMine(): Promise<{ asks: readonly (Ask & { title: string | null })[] }> {
553 try {
554 return await this.#issues("GET", this.agentPath("waiting"));
555 } catch (err) {
556 // An Issues Worker from before 124 has no /a/:agent/ reads.
557 if (err instanceof ApiError && err.status === 404) return this.waiting(this.config.agent);
558 throw err;
559 }
560 }
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare562 issueOpen(body: DraftBody & { title: string; attachments?: string[] }): Promise<{ id: number; news?: IssueNews }> {
564 }
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare566 /** Uploads an image to the Issues Worker (abso issue 171): it checks the type by the bytes, strips metadata and answers its id. */
567 async attachmentUpload(bytes: Uint8Array, name: string): Promise<Attachment> {
568 if (this.issuesServer === undefined)
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare569 throw new ApiError(`${this.config.server} has no Issues Worker beside it; ABSO_ISSUES_SERVER names one`);
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare570 const path = this.agentPath("attachments");
571 let res: Response;
572 try {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare573 res = await this.send(this.url(path, this.issuesServer), {
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare574 method: "POST",
pinch54The client and the edit mods send and read X-Abso-* headers only (Client, Name, Run-Key, Kind, Admin; Run, Box, Prep from answers). Servers have read X-Abso-* beside the old names for a while and answer under both, so this works with any current server.Compare575 headers: { ...this.headers("application/octet-stream"), "x-abso-name": encodeURIComponent(name) },
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare576 body: bytes as Uint8Array<ArrayBuffer>,
577 signal: AbortSignal.timeout(Math.max(this.timeoutMs, 120_000)),
578 });
579 } catch (err) {
580 const e = err as Error;
581 throw new ApiError(
582 `could not reach ${this.issuesServer}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
583 );
584 }
585 const text = await res.text();
pinch15--attach says plainly when the Issues server doesn't take attachments yet
A server from before attachments has no upload route. It answered 400 'the body is JSON', or 404, and the client printed that as it came, which told nobody what had happened. Now the client says the server doesn't take attachments yet, that the file wasn't sent and nothing was written, and to leave --attach off or link the image instead. A server that has the route but nowhere to keep files (501) gets the same message. A test checks the message and that no issue is opened.Compare586 // A server from before attachments has no upload route: it answers 404, or 400 because the body isn't JSON;
587 // one with the route but nowhere to keep files answers 501. Say so plainly, and that nothing was sent.
588 if (res.status === 404 || res.status === 501 || (res.status === 400 && /the body is JSON/.test(text)))
589 throw new ApiError(
590 `${this.issuesServer} doesn't take attachments yet, so ${name} wasn't sent and nothing was written. Leave --attach off, or link the image instead.`,
591 res.status,
592 );
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare593 if (!res.ok) throw new ApiError(`uploading ${name} answered ${res.status}: ${errorSentence(text)}`, res.status);
594 return JSON.parse(text) as Attachment;
pinch23abso issue <N> --copy-to <project>: copy an issue into another project, with its comments, answered asks and labels, each keeping its author and time. The Issues server reads the source issue itself; the client sends only which issue, and any cleaned texts.
- --dry-run shows what the copy would make (title, how many comments and asks, which were edited, labels) and what's left behind. It writes nothing.
- --clean <file> gives cleaned texts by source id, as JSON: {title, description, comments: [{id, text}], asks: [{id, question, answer}]}. A comment left out of a given list isn't copied.
- --copy-to goes alone, so a copy is never half an edit. Copying into the project the issue is already in is refused before any call.
- When a live server refuses the copy (copying out of a project there takes an owner of it), the message says --dry-run still works.
- The MCP issue tool's clean input is a file too, so it's confined to the server's start folder like attach.
Tests: client/test/issues.test.ts, against a stand-in Issues server. The run --parallel test that sometimes times out under a full run passed when rerun.Compare595 }
597 /**
598 * Copies issue `body.issue` of this project into project `to`, keeping
599 * authors and times: the Issues server reads the source itself, and only
600 * texts may be given cleaned. A dry run answers the plan and writes nothing.
601 */
602 issueCopy(to: string, body: CopyBody & { dryRun?: boolean }): Promise<CopyAnswer> {
603 const there = new Api({ ...this.config, project: to }, this.timeoutMs);
604 there.issuesServer = this.issuesServer;
605 return there.#issues("POST", there.agentPath("copy"), body);
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare606 }
608 /** Where an attachment is served. */
609 attachmentUrl(id: string): string {
610 return this.url(`/attachments/${id}`, this.issuesServer);
611 }
pinch29Client: abso issue N --save-attachments <dir> saves each attachment on an issue and its comments once (an SVG's own file beside its drawing), outside the abso folder unless the place is ignored; MCP confines the folder like attach. abso export now stamps its folder with .abso-export, one line of JSON in a file with no extension, so the exported project's own formatter and linter pass it by; a folder stamped .abso-export.json or .avcs-export.json still counts as an export.Compare612
613 /** An attachment's bytes, or with `source` the svg it was drawn from; refused past `max` bytes. */
614 async attachmentBytes(id: string, source: boolean, max: number): Promise<Uint8Array> {
615 if (this.issuesServer === undefined)
616 throw new ApiError(`${this.config.server} has no Issues Worker beside it; ABSO_ISSUES_SERVER names one`);
617 const url = `${this.attachmentUrl(id)}${source ? "/source" : ""}`;
618 let res: Response;
619 try {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare620 res = await this.send(url, {
pinch29Client: abso issue N --save-attachments <dir> saves each attachment on an issue and its comments once (an SVG's own file beside its drawing), outside the abso folder unless the place is ignored; MCP confines the folder like attach. abso export now stamps its folder with .abso-export, one line of JSON in a file with no extension, so the exported project's own formatter and linter pass it by; a folder stamped .abso-export.json or .avcs-export.json still counts as an export.Compare621 headers: this.headers(),
622 signal: AbortSignal.timeout(Math.max(this.timeoutMs, 120_000)),
623 });
624 } catch (err) {
625 const e = err as Error;
626 throw new ApiError(
627 `could not reach ${this.issuesServer}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
628 );
629 }
630 if (!res.ok) throw new ApiError(`${url} answered ${res.status}: ${errorSentence(await res.text())}`, res.status);
631 const bytes = new Uint8Array(await res.arrayBuffer());
632 if (bytes.length > max) throw new ApiError(`${url} sent ${bytes.length} bytes, more than an attachment may be`);
633 return bytes;
634 }
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare635
init0Start the project636 /** An edit (abso issue 3): it tells the issue's watchers, and `also`, unless `notify` is false. null clears a parent or Agent. */
637 issueEdit(
638 id: number,
639 body: {
640 title?: string;
641 description?: string;
642 parent?: number | null;
643 agent?: string | null;
644 blockedBy?: number[];
645 notify?: boolean;
646 also?: string[];
647 addLabels?: string[];
648 removeLabels?: string[];
649 },
650 ): Promise<{ edit: number; notified: readonly string[]; news?: IssueNews }> {
651 return this.#issues("POST", this.agentPath(`issue/${id}/edit`), body);
652 }
pinch5abso issue new and abso issue N --comment take --attach <file,file> (abso issue 171). Each file goes up to the Issues Worker first (POST /p/:project/a/:agent/attachments, the bytes as the body and the name URI-encoded in X-Avcs-Name), and the write carries the ids the uploads answered. Nothing is sent if a file is missing or over 10 MB. --attach anywhere else is refused. The issue's page lists each attachment under the issue or comment carrying it: id, name, size and its link. The wire types gain Attachment and attachments?. MCP's issue tool takes attach too, since its parameters come from the flags. The server side is abso 621 (off until Cloud binds the bucket). Tests: client/test/attach.test.ts, against a stand-in Issues server. Checked: biome ci, npm run check (698 pass).Compare654 issueComment(
655 id: number,
656 text: string,
657 objection = false,
658 attachments: readonly string[] = [],
659 ): Promise<{ id: number; news?: IssueNews }> {
660 return this.#issues("POST", this.agentPath(`issue/${id}/comment`), {
661 text,
662 ...(objection ? { objection } : {}),
663 ...(attachments.length > 0 ? { attachments } : {}),
664 });
667 issueDrop(id: number): Promise<{ news?: IssueNews }> {
668 return this.#issues("POST", this.agentPath(`issue/${id}/drop`), {});
669 }
671 /** Opens a dropped issue again (abso issue 104). */
672 issueReopen(id: number): Promise<{ news?: IssueNews }> {
673 return this.#issues("POST", this.agentPath(`issue/${id}/reopen`), {});
674 }
676 /** Marks an issue done by hand (abso issue 38). `version` is the publish that did it, when there is one. */
677 issueDone(id: number, version: number | null): Promise<{ news?: IssueNews }> {
678 return this.#issues("POST", this.agentPath(`issue/${id}/done`), { ...(version !== null ? { version } : {}) });
679 }
681 /** This agent's drafts (abso issue 3): its own, with no number and no news, newest first. */
682 drafts(): Promise<{ drafts: readonly Draft[] }> {
683 return this.#issues("GET", this.agentPath("drafts"));
684 }
686 /** Saves a draft, new or (with id) over one of this agent's: the body replaces the draft's. */
687 saveDraft(body: DraftBody & { id?: number }): Promise<{ id: number }> {
688 return this.#issues("POST", this.agentPath("draft"), body);
689 }
691 /** Opens a draft as an issue, `body`'s fields over the draft's, and deletes the draft. */
692 openDraft(id: number, body: DraftBody = {}): Promise<{ id: number; news?: IssueNews }> {
693 return this.#issues("POST", this.agentPath(`draft/${id}/open`), body);
694 }
696 deleteDraft(id: number): Promise<{ ok: boolean }> {
697 return this.#issues("POST", this.agentPath(`draft/${id}/delete`), {});
698 }
700 ask(body: {
701 issue?: number;
702 of: string;
703 question: string;
704 review?: boolean;
705 kind?: "question" | "task";
706 due?: string;
707 blocks?: number[];
708 options?: string[];
pinch35Client: files on asks and answers. abso ask and abso answer take --attach (uploaded first, as on issues; not with --withdraw); an ask lists its question's files under it and its answer's under the answer; abso issue N --save-attachments takes them too. An Issues server from before asks carried files keeps the words and drops the files: abso says so (notKept in --json) instead of losing them quietly. Wire: Ask.attachments and answer.attachments, optional. Client tests 286/286, tsc and biome clean.Compare709 attachments?: string[];
710 }): Promise<{ id: number; news?: IssueNews; attachments?: string[] }> {
712 }
714 answer(
715 id: number,
pinch35Client: files on asks and answers. abso ask and abso answer take --attach (uploaded first, as on issues; not with --withdraw); an ask lists its question's files under it and its answer's under the answer; abso issue N --save-attachments takes them too. An Issues server from before asks carried files keeps the words and drops the files: abso says so (notKept in --json) instead of losing them quietly. Wire: Ask.attachments and answer.attachments, optional. Client tests 286/286, tsc and biome clean.Compare716 body: { words?: string; option?: number | string; note?: string; done?: boolean; attachments?: string[] },
718 return this.#issues("POST", this.agentPath(`answer/${id}`), body);
719 }
infra-split14An asker can take back an ask: abso ask --withdraw <ask> [--note "why"]
An ask that later decisions have overtaken used to sit in the asked person's waiting list for good. Only they could answer it, and "none of these" wasn't an option. Now the one who asked can withdraw it.
- `abso ask --withdraw <ask> [--note "why"]` sends one call to the server's withdraw route. It's refused before any call when mixed with a question or the other ask flags. `--note-file` reads the note from a file or stdin, like every text flag.
- A withdrawn ask closes the way an answered one does: it leaves the waiting list, and it stops holding its issue at Blocked. The ask keeps its question. The asker's note is kept as why, and the one asked hears it.
- Ask gains `outcome?: "withdrawn"`. Older servers leave it out. The asks list and an issue's page show "withdrawn by <asker>" and the note, instead of "answered by".
- The server side of the route comes with the hosted Issues service. Until it's there, the call answers with that server's error.
Tests: the new usage mistakes, and the single POST to the asker's own route. Checked: npx biome ci . and npm run check exit 0 (704 pass, 1 skipped).Compare720
pinch53abso ack <ask> ["note"]: the one asked says they have an ask and will answer later. The ask stays open and keeps blocking; abso issue shows it as acknowledged with the note, and the asker hears it. The Ask wire type gains ack, the API client gains ack(), and the skill mentions the command.Compare721 /** Acknowledges an ask of this agent without answering it: the asker hears it, and the ask stays open. */
722 ack(id: number, body: { note?: string }): Promise<{ ask: Ask; news?: IssueNews }> {
723 return this.#issues("POST", this.agentPath(`ack/${id}`), body);
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare724 }
726 /** Adds to an ask's thread, as its asker or the one asked; the other side hears it, and the ask stays as it is. */
727 reply(id: number, body: { text: string; question?: boolean }): Promise<{ ask: Ask; news?: IssueNews }> {
pinch89abso reply N, abso ask N and abso asked name a server without ask threads instead of answering its bare 404.Compare728 return this.#threads(this.#issues("POST", this.agentPath(`reply/${id}`), body));
pinch53abso ack <ask> ["note"]: the one asked says they have an ask and will answer later. The ask stays open and keeps blocking; abso issue shows it as acknowledged with the note, and the asker hears it. The Ask wire type gains ack, the API client gains ack(), and the skill mentions the command.Compare729 }
groups256groups: abso groups and abso group, for a project's named groups of agents and people with one shared history. abso group <name> reads its settings, members and history (newest first; --before, --limit, --kind). --post adds a message, with news for every other member unless --news names some, --except leaves some out, or --news none keeps it in the history only. --join, --leave, --add, --remove, --rename, --private on|off and --joinable on|off change it; abso group new makes one. A retried post never posts twice (the Idempotency-Key every POST sends). Both are MCP tools; a visitor folder refuses them. Tests: client/test/group-commands.test.ts, visitor.test.ts.Compare731 /** A groups call, with a server from before groups named as that rather than a bare 404. */
732 async #groups<T>(call: Promise<T>): Promise<T> {
733 try {
734 return await call;
735 } catch (err) {
736 if (err instanceof ApiError && err.status === 404 && /no such issues route|reads have no/.test(err.message))
737 throw new ApiError(`${this.config.server} doesn't have groups yet`, 404);
738 throw err;
739 }
740 }
742 /** The project's groups this agent can see. */
743 groupList(): Promise<{ groups: readonly GroupSummary[] }> {
744 return this.#groups(this.#issues("GET", this.agentPath("groups")));
745 }
747 /** One group's settings and roster, by name or id. */
748 group(ref: string): Promise<GroupShown> {
749 return this.#groups(this.#issues("GET", this.agentPath(`group/${encodeURIComponent(ref)}`)));
750 }
752 /** A page of a group's history, newest first, and the `before` that reads further back (null at the start). */
753 groupEvents(
754 ref: string,
755 q: { before?: number; limit?: number; kind?: string } = {},
756 ): Promise<{ events: readonly GroupEvent[]; before: number | null }> {
757 const qs = query({ before: q.before, limit: q.limit, kind: q.kind }).toString();
758 return this.#groups(
759 this.#issues("GET", this.agentPath(`group/${encodeURIComponent(ref)}/events${qs ? `?${qs}` : ""}`)),
760 );
761 }
763 /** Make a group (ref undefined), or post, join, leave, add, remove or change settings in one. */
764 groupWrite(
765 ref: string | undefined,
766 action: "post" | "join" | "leave" | "add" | "remove" | "settings" | undefined,
767 body: Record<string, unknown>,
768 ): Promise<GroupWrite> {
769 const path = ref === undefined ? "groups" : `group/${encodeURIComponent(ref)}/${action}`;
770 return this.#groups(this.#issues("POST", this.agentPath(path), body));
771 }
infra-split14An asker can take back an ask: abso ask --withdraw <ask> [--note "why"]
An ask that later decisions have overtaken used to sit in the asked person's waiting list for good. Only they could answer it, and "none of these" wasn't an option. Now the one who asked can withdraw it.
- `abso ask --withdraw <ask> [--note "why"]` sends one call to the server's withdraw route. It's refused before any call when mixed with a question or the other ask flags. `--note-file` reads the note from a file or stdin, like every text flag.
- A withdrawn ask closes the way an answered one does: it leaves the waiting list, and it stops holding its issue at Blocked. The ask keeps its question. The asker's note is kept as why, and the one asked hears it.
- Ask gains `outcome?: "withdrawn"`. Older servers leave it out. The asks list and an issue's page show "withdrawn by <asker>" and the note, instead of "answered by".
- The server side of the route comes with the hosted Issues service. Until it's there, the call answers with that server's error.
Tests: the new usage mistakes, and the single POST to the asker's own route. Checked: npx biome ci . and npm run check exit 0 (704 pass, 1 skipped).Compare773 /** Takes back an ask this agent made, with a note on why; the one asked hears it. */
774 withdraw(id: number, body: { note?: string }): Promise<{ ask: Ask; news?: IssueNews }> {
775 return this.#issues("POST", this.agentPath(`withdraw/${id}`), body);
776 }
778 /** Notes on lines (#44), by file or change; open ones only with `open`. */
779 notes(q: { file?: string; change?: number; open?: boolean } = {}): Promise<{ notes: readonly NoteAnswer[] }> {
780 return this.json("GET", `/notes?${query({ file: q.file, change: q.change, open: q.open ? 1 : undefined })}`);
781 }
783 note(body: NoteBody): Promise<{ id: number; change: number | null; lines: readonly [number, number] }> {
784 return this.json("POST", this.agentPath("note"), body);
785 }
787 noteClose(id: number, how: "resolved" | "withdrawn"): Promise<unknown> {
788 return this.json("POST", this.agentPath("note-close"), { id, how });
789 }
791 /** The merge queue now (#39). */
792 queueState(): Promise<QueueState> {
793 return this.json("GET", "/queue");
794 }
796 /** The project's visibility (abso issue 152): public or private. */
797 visibility(): Promise<{ project: string; visibility: "public" | "private" }> {
798 return this.json("GET", "/visibility");
799 }
801 /** Switch the project's visibility (abso issue 140): an owner's key, or the shared token on staging. */
802 setVisibility(v: "public" | "private"): Promise<{ project: string; visibility: "public" | "private" }> {
803 return this.json("POST", `/visibility?visibility=${v}`, {});
autosettle220abso autosettle: see or change what the server does with a held push (abso-core 23)
abso autosettle says the project's choice: Off, Advise, or Settle at a confidence. It also says when the gate is stopped and who changed it last. abso autosettle off|advise|settle [--at 0.3-0.95] changes it, which takes the owner's key (on staging, the shared token too); without --at the server keeps its own. On a server with no choice per project (the open server), it says the operator's AUTOSETTLE decides. A visitor folder refuses it.
Tried on project abso's Worker run locally (read, settle --at 0.7, advise, a bad word, --at 2) and on the open server. Tests: autosettle-command (words), visitor (the allow-list), typecheck clean.Compare804 }
806 /** The project's auto-settle choice (abso-core 23): off, advise or settle, and how sure before abso settles. */
807 autosettle(): Promise<AutosettleAnswer> {
808 return this.json("GET", "/autosettle");
809 }
811 /** Change it (abso-core 23): an owner's key, or the shared token on staging. Without `at`, the server keeps its own. */
812 setAutosettle(mode: AutosettleMode, at?: number): Promise<AutosettleAnswer> {
813 return this.json("POST", `/autosettle?mode=${mode}${at === undefined ? "" : `&at=${at}`}`, {});
autosettle223abso autosettle history: the held pushes the model advised on, and what was then kept (abso-core 23)
abso autosettle history lists a project's held pushes that got advice, newest first. Each collision gets one line: what the model said (a side or leave it to an agent, by a check in code or the model with its confidence), whether abso was told to settle it, and what the agent then kept, automatically or by hand, in which version. abso autosettle history <id> shows one, naming its calls to the model; --json has each exact request and raw answer. It reads the platform's /autosettle/history routes (project abso 1249).
Tests: autosettle-command (words, history lines), visitor (the allow-list); typecheck clean.Compare816 /** Auto-settle's history (abso-core 23): held pushes the model advised on, newest first. */
817 autosettleHistory(): Promise<unknown> {
818 return this.json("GET", "/autosettle/history");
819 }
821 /** One held push from the history, with each collision's calls to the model. */
822 autosettleHold(id: number): Promise<unknown> {
823 return this.json("GET", `/autosettle/history/${id}`);
824 }
init0Start the project826 /** Take back this agent's queued publishes (#39); refused while one is being checked. */
827 unqueue(): Promise<{ pulled: readonly number[] }> {
828 return this.json("POST", this.agentPath("unqueue"), {});
829 }
831 /**
832 * Sync; a folder following a label goes to the newest version with that label.
833 * With `full`, the answer holds every file in the agent's view, as a first sync's does,
834 * not only what changed since its last sync (#37: a join for an agent the server knew).
835 */
836 sync(options: { full?: boolean } = {}): Promise<SyncAnswer> {
837 return this.json("POST", this.agentPath("sync"), {
838 ...(this.config.follow ? { label: this.config.follow } : {}),
839 ...(options.full ? { full: true } : {}),
840 });
841 }
843 /** Take published versions back out of shared (with the versions that build on them, when asked). */
844 drop(versions: readonly number[], message: string, withDependents = false): Promise<DropAnswer> {
845 return this.json("POST", this.agentPath("drop"), {
846 versions,
847 message,
848 ...(withDependents ? { withDependents: true } : {}),
849 });
850 }
852 /** Take some versions of a named draft into shared, as one version. */
853 pluck(draft: string, versions: readonly number[], message: string, withDependencies = false): Promise<PluckAnswer> {
854 return this.json("POST", this.agentPath("pluck"), {
855 draft,
856 versions,
857 message,
858 ...(withDependencies ? { withDependencies: true } : {}),
859 });
860 }
862 /** Correct the message of this agent's newest publish in its space. */
863 amend(message: string): Promise<{ version: number; draft: string | null; message: string; was: string }> {
864 return this.json("POST", this.agentPath("amend"), { message });
865 }
867 /** Put a label on a version of shared (the newest by default), or take it off. */
868 label(
869 name: string,
870 version?: number,
871 remove = false,
872 ): Promise<{ name: string; version: number; versions: readonly number[] }> {
873 return this.json("POST", this.agentPath("label"), {
874 name,
875 ...(version === undefined ? {} : { version }),
876 ...(remove ? { remove: true } : {}),
877 });
878 }
880 labels(): Promise<{ labels: Readonly<Record<string, readonly number[]>> }> {
881 return this.json("GET", "/labels");
882 }
884 status(): Promise<StatusAnswer> {
885 return this.json("GET", "/status");
886 }
888 /** The status and the paths in the agent's view, in one trip (abso issue 80). */
889 async statusAndFiles(): Promise<StatusAnswer & { files: FilesAnswer | undefined }> {
890 try {
891 return await this.json("GET", this.agentPath("status"));
892 } catch (err) {
893 // A server from before it has no /a/:agent/status; the listing itself is from #37.
894 if (!(err instanceof ApiError && err.status === 404)) throw err;
895 }
896 const status = await this.status();
897 return { ...status, files: await this.viewFiles().catch(() => undefined) };
898 }
900 /** CI's state (#39), or one version's job. */
901 ci(): Promise<CiStatus>;
902 ci(version: number): Promise<CiJob>;
903 ci(version?: number): Promise<CiStatus | CiJob> {
904 return this.json("GET", version === undefined ? "/ci" : `/ci?${query({ version })}`);
905 }
infra-pipeline85abso pipeline runs: list a project's pipeline runs, show one run's jobs (state, why each stopped, exit, time, an npm or deploy job's phase), and print a job's log with --log <pipeline.job>Compare907 /** The project's pipeline runs, newest first; one run with its jobs; or one job's log (`log` is pipeline.job). */
908 pipelineRuns(run?: number, log?: string): Promise<unknown> {
909 return this.json("GET", run === undefined ? "/pipelines" : `/pipelines?${query({ run, log })}`);
910 }
init0Start the project912 /** Ends every /latest link handed out so far; answers CI's state with the new link. */
913 ciRevoke(): Promise<CiStatus> {
914 return this.json("POST", "/ci/revoke", {});
915 }
917 /** Count versions up to `through` as seen by CI and end any red or bisect, so an import's history isn't checked (#56). */
918 ciSkip(through: number): Promise<unknown> {
919 return this.json("POST", "/ci/skip", { through });
920 }
922 /** Move to a named draft (null: shared). With carry, the current unpublished changes start a new draft. */
923 switchDraft(name: string | null, carry = false): Promise<SwitchAnswer> {
924 return this.json("POST", this.agentPath("draft"), { name, ...(carry ? { carry: true } : {}) });
925 }
927 /** Land never queues: with the merge queue on, the server refuses it (#39). */
928 land(message: string): Promise<Exclude<PublishAnswer, { queued: number }>> {
pinch26Publish and log fixes, and a flaky test removed.
- A publish or a land now waits up to 150 s for the server's answer, not 30 s. The server may work on one request for up to 2 minutes, so a slow merge was reported as failed and then landed.
- abso log reads any length of history. The server sends at most 200 versions a page, and the client now follows its pages: -n 2000 gives 2000, and --since or a folder reads up to 1000. abso log --before <version> starts below that version. The end of the list names the --before for the next older ones, and a filtered read says when it stopped short.
- The test 'sends one run, and takes each command as one quoted word' is removed: it failed on Windows about half the time. The stand-in server the client tests use no longer closes idle kept-alive connections, which other tests also tripped on under load (ECONNRESET).
Check: 722 pass, 0 fail.Compare929 return this.json("POST", this.agentPath("land"), { message }, undefined, PUBLISH_TIMEOUT_MS);
932 draftSync(): Promise<DraftSyncAnswer> {
933 return this.json("POST", this.agentPath("draft-sync"), {});
934 }
936 blame(file: string, from?: number, to?: number, version?: number, view: View = {}): Promise<BlameAnswer> {
937 return this.json("GET", `/blame?${query({ file, from, to, version, ...view })}`);
938 }
940 /** The paths in the agent's view: what its folder should hold (#37). */
941 viewFiles(): Promise<FilesAnswer> {
942 return this.json("GET", this.agentPath("files"));
943 }
945 /** The paths in shared, or a named draft, at a version (the newest by default). */
946 filesAt(draft: string | null, version?: number): Promise<FilesAnswer> {
947 return this.json("GET", `/files?${query({ draft, version })}`);
948 }
950 /** The versions of a space, newest first; with `path`, only those that changed it. */
pinch26Publish and log fixes, and a flaky test removed.
- A publish or a land now waits up to 150 s for the server's answer, not 30 s. The server may work on one request for up to 2 minutes, so a slow merge was reported as failed and then landed.
- abso log reads any length of history. The server sends at most 200 versions a page, and the client now follows its pages: -n 2000 gives 2000, and --since or a folder reads up to 1000. abso log --before <version> starts below that version. The end of the list names the --before for the next older ones, and a filtered read says when it stopped short.
- The test 'sends one run, and takes each command as one quoted word' is removed: it failed on Windows about half the time. The stand-in server the client tests use no longer closes idle kept-alive connections, which other tests also tripped on under load (ECONNRESET).
Check: 722 pass, 0 fail.Compare951 /**
952 * The versions newest first, below `before` when it's given. The server
953 * sends at most LOG_PAGE at a time, so a longer log is read page by page,
954 * following each page's next. `next` on the answer says older ones are left.
955 */
956 async log(where: Where, limit?: number, path?: string, before?: number): Promise<LogAnswer> {
957 let page = await this.#logPage(where, limit === undefined ? undefined : Math.min(limit, LOG_PAGE), path, before);
958 const versions = [...page.versions];
959 while (limit !== undefined && versions.length < limit && page.next !== undefined) {
960 page = await this.#logPage(where, Math.min(limit - versions.length, LOG_PAGE), path, page.next);
961 versions.push(...page.versions);
962 }
963 const { next, ...rest } = page;
964 return { ...rest, versions, ...(next !== undefined ? { next } : {}) };
965 }
967 #logPage(
968 where: Where,
969 limit: number | undefined,
970 path: string | undefined,
971 before: number | undefined,
972 ): Promise<LogAnswer> {
973 return this.json("GET", `/log?${query({ ...where, limit, path, before })}`);
976 show(version: number, where: Where): Promise<ShowAnswer> {
977 return this.json("GET", `/show?${query({ version, ...where })}`);
978 }
980 fileAt(path: string, version: number, where: Where): Promise<{ path: string; version: number; text: string | null }> {
981 return this.json("GET", `/file?${query({ path, version, ...where })}`);
982 }
984 compare(from: number, to: number, where: Where): Promise<{ from: number; to: number; files: readonly FileChange[] }> {
985 return this.json("GET", `/compare?${query({ from, to, ...where })}`);
candidates186Read a version of shared without some earlier versions: abso show <N> --without A,B shows what differs and abso export <dir> --version N --without A,B writes the files. The server's GET without?version=&versions= checks the set left exactly as asked: when a version it keeps builds on one left out, it refuses with that chain, the files and the wider set that works, and never widens it. Atoms keep their ids and authors; shared and its log don't change; the same ask gives the same tree hash.Compare986 }
988 /** Version `version` of shared with `versions` left out, or the refusal naming what builds on them. */
989 without(version: number, versions: readonly number[]): Promise<WithoutAnswer> {
990 return this.json("GET", `/without?${query({ version, versions: versions.join(",") })}`);
993 /** A message to the project's other agents (or those named), delivered once as news. */
994 starting(
995 text: string | null,
996 files?: readonly string[],
997 options: { issue?: number; done?: boolean } = {},
998 ): Promise<{
999 starting: { text: string; files: readonly string[]; time: number; issue?: number } | null;
1000 overlaps: readonly Overlap[];
1001 }> {
1002 return this.json("POST", this.agentPath("starting"), {
1003 text,
1004 ...(files && files.length > 0 ? { files } : {}),
1005 ...(options.issue !== undefined ? { issue: options.issue } : {}),
1006 ...(options.done ? { done: true } : {}),
1007 });
1008 }
1010 announce(text: string, to?: readonly string[]): Promise<{ id: number; to: readonly string[] }> {
1011 return this.json("POST", this.agentPath("announce"), { text, ...(to ? { to } : {}) });
1012 }
1014 /** The news waiting for this agent, handed over once. */
1015 news(): Promise<{ news: News; items?: readonly { readonly text: string; readonly at: number | null }[] }> {
1016 return this.json("POST", this.agentPath("news"), {});
1017 }
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.Compare1019 /** A ticket that opens this agent's news stream once, within a minute (abso 690; news-stream.ts). */
box-grants285abso news --stream (abso 690): read the ticket's expiry as the ISO time the server sends (staging 1418) as well as milliseconds. It printed 'within NaN seconds', and the stream mark that stands the hooks mod's poll down came out NaN, so the poll kept running. Found in the staging proof. Tests: client/test/news-stream.test.ts.Compare1020 newsTicket(): Promise<{ url: string; protocols: string[]; expiresAt: number | string }> {
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.Compare1021 return this.json("POST", this.agentPath("news/ticket"), {});
1022 }
1025 diff(): Promise<DiffAnswer> {
1026 return this.json("POST", this.agentPath("diff"), {});
1027 }
pinch52abso diff --agent <name>: review another agent's unpublished changes
Reviewing a teammate's work before it's published had no command: abso diff showed only your own draft, and abso status names files but not lines. Reviewers read the other agent's folder on disk, which only works on a shared machine and shows their disk, not what they recorded.
abso diff --agent alice now prints alice's recorded, unpublished changes line by line, the way abso diff prints yours: "alice's recorded, unpublished changes in shared (on version 12): 2 files, 5 lines added, 1 removed." Paths narrow it as usual. It reads what the server holds, the same route the website's drafts use, so it records nothing and changes nothing. An agent with no changes says so; a name the project doesn't know is refused by the server. --agent doesn't go with two versions or --draft.
The test server answers GET /p/:project/diff?agent= as the Worker does. Tested in client.test.ts.Compare1028
1029 /** Another agent's recorded, unpublished changes, file by file: read only, as the website's drafts show them. */
1030 diffOf(agent: string): Promise<DiffAnswer> {
1031 return this.json("GET", `/diff?${query({ agent })}`);
1032 }
1034 /** Discard this agent's unpublished changes to `files` (null: all of them). */
1035 restore(files: readonly string[] | null): Promise<RestoreAnswer> {
1036 return this.json("POST", this.agentPath("restore"), files === null ? { all: true } : { files });
1037 }
whytrail193abso why follows a line back past formatting to its reason, and names git commits
why now lists a line's earlier changes, newest first, with what the line read before each. A change that rewrote a line left the line it replaced in the file's history; why pairs the two (same code formatted differently, the same code rewrapped, or the most similar line) and follows the pairs back. A change that only touched formatting (whitespace, line wrapping, quotes, trailing commas, line-end semicolons, parentheses around a lone arrow parameter) is skipped by default, and why names it: 'Skipped 1 formatting change since: version 366'. --all shows those too. --at <version> reads the line as it was at that version.
A push imported from git (client/scripts/import-git.ts, or a plain git push) names its commit and author in why and blame. import-git.ts now also records where the repository's issues are, from origin on GitHub or GitLab or --issues, and why says which issue #N in an imported message or line means. A project imported before this can say it once in abso.json: "gitIssues": "https://github.com/owner/repo/issues".
Closes issues 20 and 21's tool side.Compare1039 why(file: string, line: number, view: View = {}, version?: number): Promise<WhyAnswer> {
1040 return this.json("GET", `/why?${query({ file, line, version, ...view })}`);
1043 where(): Promise<WhereAnswer> {
1044 return this.json("GET", "/where");
1045 }
1047 /**
1048 * Send the folder as a tar.gz and run a command in the agent's box. Output
1049 * goes to `io.out` as it arrives, and the box's stderr to `io.err` (the
1050 * server keeps them apart when asked; an older one sends both as out).
1051 * Answers the command's exit code.
1052 *
1053 * When the stream breaks before the exit line and the server gave the run
1054 * an id, the run goes on in the box: this reconnects to it and carries on
1055 * from the last output printed, so nothing is lost or printed twice. The
1056 * command itself is never sent twice.
1057 */
1058 async run(command: string, tarGz: Uint8Array<ArrayBuffer>, io: RunIO): Promise<number> {
1059 const res = await postRun(this, command, tarGz, io.onRetry, io.replace, io.fresh);
pinch54The client and the edit mods send and read X-Abso-* headers only (Client, Name, Run-Key, Kind, Admin; Run, Box, Prep from answers). Servers have read X-Abso-* beside the old names for a while and answer under both, so this works with any current server.Compare1060 // X-Abso-Box: cold means the box started for this run; X-Abso-Prep says whether it started from the prep (#37).
1061 io.onBox?.(res.headers.get("x-abso-box") === "cold", res.headers.get("x-abso-prep") ?? undefined);
1062 return follow(this, res, res.headers.get("x-abso-run"), { at: 0, errAt: 0 }, io);
1065 /**
1066 * Start a run and answer its id without waiting: the job goes on in the box
1067 * after this connection closes (abso run --detach; abso logs <id> follows it).
1068 */
1069 async startRun(
1070 command: string,
1071 tarGz: Uint8Array<ArrayBuffer>,
1072 onRetry?: (why: string, attempt: number) => void,
1073 replace = false,
1074 ): Promise<string> {
1075 const res = await postRun(this, command, tarGz, onRetry, replace);
pinch54The client and the edit mods send and read X-Abso-* headers only (Client, Name, Run-Key, Kind, Admin; Run, Box, Prep from answers). Servers have read X-Abso-* beside the old names for a while and answer under both, so this works with any current server.Compare1076 const id = res.headers.get("x-abso-run");
1078 // No id: the box failed before the job started ({"error"} in the body), or the server can't detach.
1079 await consumeRun(res, { out: () => {} }, { at: 0, errAt: 0 });
1080 throw new ApiError("this server gives runs no id, so a run can't be detached");
1081 }
1082 await res.body?.cancel();
1083 return id;
1084 }
1086 /** A run's output from its start, for as long as the box keeps it, until it ends (abso logs). Answers its exit code. */
1087 async logs(id: string, io: RunIO): Promise<number> {
1088 let res: Response;
1089 try {
pinch88Every request a folder's Api makes goes through one send(): a folder that reads signed out sends only GETs and follows no redirect on every path, box runs and serve included.Compare1090 res = await this.send(followUrl(this, id, { at: 0, errAt: 0 }), { headers: this.headers() });
1092 const e = err as Error;
1093 throw new ApiError(
1094 `could not reach ${this.config.server}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
1095 );
1096 }
1097 if (res.status === 404) throw new ApiError(`no run ${id} in this box: ${errorSentence(await res.text())}`, 404);
1098 if (!res.ok || res.body === null)
1099 throw new ApiError(`logs answered ${res.status}: ${errorSentence(await res.text())}`, res.status);
1100 return follow(this, res, id, { at: 0, errAt: 0 }, io);
1101 }
1102}