Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
blame on this site's /mcp
CLI
abso blame client/src/issues.ts --version 34 --json
JSON
/christopher/abso-core/blame/client/src/issues.ts?version=34&format=json
708 linesFirst import 57% · pinch 31% · devops 5% · review 4% · infra-split 3%Last change pinch in version 29,

708 lines from 16 changes in 9 versions.

review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare1// Issues (#54): abso issues, abso issue, abso ask, abso waiting and avcs
init0Start the project2// answer. The Issues Worker keeps them (avcs-issues beside avcs, or
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare3// ABSO_ISSUES_SERVER), and takes the same token. Statuses come from the work: a start note naming
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare4// an issue (abso start --issue N) puts it In progress, an open ask Blocked or
init0Start the project5// In review, and publish --done closes it. Other agents' and people's words
6// are quoted as JSON, so none can print as another line (#30).
7
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.Compare8import { mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
9import { basename, join, resolve } from "node:path";
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.Compare10import {
11 type Api,
12 ApiError,
13 type Ask,
14 type Attachment,
15 type CopyAnswer,
16 type CopyBody,
17 type Draft,
18 type DraftBody,
19 type IssuePage,
20 type IssueRow,
21 type IssueSearchHit,
22} from "./api.ts";
init0Start the project23import { bool, type Parsed, str, UsageError } from "./args.ts";
24import { type Env, type Output, open, plural } from "./commands.ts";
25import { type Config, readMachineServers, trustedServers } from "./config.ts";
26import { issuesServerFor, tokenGoesTo } from "./core.ts";
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare27import { fromEnv } from "./env-names.ts";
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.Compare28import { ignoredHere } from "./fetch.ts";
29import { loadIgnore, relativeTo } from "./folder.ts";
init0Start the project30import { seenText, shortWhen } from "./times.ts";
32const q = (s: string): string => JSON.stringify(s);
34/** The folder, with its Api pointed at the Issues Worker: the token goes only where tokenGoesTo allows, as for the avcs server. */
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.Compare35function openIssues(env: Env): { root: string; config: Config; api: Api } {
36 const { root, config, api } = open(env);
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare37 const server = fromEnv(env.env, "ISSUES_SERVER") || issuesServerFor(config.server, readMachineServers(env.env));
init0Start the project38 if (server === undefined)
39 throw new UsageError(
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare40 `${config.server} has no Issues Worker beside it that abso knows; ~/.abso/servers.json or ABSO_ISSUES_SERVER names one`,
init0Start the project41 );
42 if (config.token !== undefined && !tokenGoesTo(server, trustedServers(env.env))) {
43 throw new UsageError(
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare44 `the Issues Worker is ${server}, and abso sends your token only to its own servers and this machine. If ${server} is yours, name it in ~/.abso/servers.json or ABSO_TRUSTED_SERVERS.`,
init0Start the project45 );
46 }
47 api.issuesServer = server;
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.Compare48 return { root, config, api };
init0Start the project49}
51function issueNumber(word: string | undefined, what = "an issue number"): number {
52 if (word === undefined || !/^#?\d+$/.test(word)) throw new UsageError(`${what} is a number, like 12`);
53 return Number(word.replace("#", ""));
56/** One issue as a line. */
57export function issueLine(i: IssueRow): string {
58 const detail = [
59 i.agent !== null && !i.agents.includes(i.agent) ? `for ${i.agent}` : "",
60 i.agents.length > 0 ? i.agents.join(", ") : "",
61 i.blockedBy.length > 0 ? `blocked by ${i.blockedBy.join(", ")}` : "",
62 (i.labels ?? []).length > 0 ? `labels ${i.labels.join(", ")}` : "",
63 i.versions.length > 0 ? `${i.versions.length === 1 ? "version" : "versions"} ${i.versions.join(", ")}` : "",
64 i.waitingOn.length > 0 ? `waiting on ${i.waitingOn.join(", ")}` : "",
65 i.parent !== null ? `under ${i.parent}` : "",
66 i.children > 0 ? plural(i.children, "sub-issue") : "",
67 `updated ${shortWhen(i.updated)}`,
68 ].filter((d) => d !== "");
69 return ` ${String(i.id).padStart(3)} ${i.status.padEnd(11)} ${q(i.title)}${detail.length > 0 ? ` (${detail.join("; ")})` : ""}`;
72function askLine(a: Ask & { title?: string | null }): string {
73 const what = a.review ? "a review" : a.kind === "task" ? "a task" : "a question";
74 const where = a.issue === null ? "" : ` on issue ${a.issue}${a.title ? ` (${q(a.title)})` : ""}`;
75 const extra = [
76 // Who answered, and when, on the ask's own line, so a handled ask can't pass for an open one.
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).Compare77 a.answer
78 ? `${a.outcome === "withdrawn" ? "withdrawn" : "answered"} by ${a.answer.by}, ${shortWhen(a.answer.at)}`
79 : "",
init0Start the project80 !a.answer && a.seen !== undefined ? seenText(a.seen) : "",
81 a.due ? `due ${a.due}` : "",
82 a.blocks.length > 0 ? `blocks ${a.blocks.join(", ")}` : "",
83 ].filter((x) => x !== "");
84 const head = ` ask ${a.id}: ${a.by}, ${shortWhen(a.at)}, asks ${a.of} ${what}${where}${extra.length > 0 ? ` (${extra.join("; ")})` : ""}: ${q(a.question)}`;
85 const lines = [head];
86 if (a.options.length > 0) lines.push(` options: ${a.options.map((o, i) => `${i + 1}. ${q(o)}`).join(", ")}`);
87 if (a.recommendation) lines.push(` ${a.recommendation.by} recommends: ${q(a.recommendation.text)}`);
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).Compare88 if (a.answer && a.outcome === "withdrawn") {
89 if (a.answer.words !== "") lines.push(` why: ${q(a.answer.words)}`);
90 } else if (a.answer) lines.push(` answer: ${q(a.answer.words)}`);
init0Start the project91 return lines.join("\n");
94/** One edit in an issue's activity: what changed, and who was told. */
95function editLine(e: IssuePage["edits"][number]): string {
96 const c = e.changes;
97 const said = [
98 c.title ? `title ${q(String(c.title.from))} to ${q(String(c.title.to))}` : "",
99 c.description ? "the description" : "",
100 c.parent ? (c.parent.to === null ? "no parent" : `parent issue ${String(c.parent.to)}`) : "",
101 c.agent ? (c.agent.to === null ? "no Agent" : `Agent ${String(c.agent.to)}`) : "",
102 c.blockedBy
103 ? (c.blockedBy.to as number[]).length === 0
104 ? "blocked by nothing"
105 : `blocked by ${(c.blockedBy.to as number[]).join(", ")}`
106 : "",
107 c.labels
108 ? (c.labels.to as string[]).length === 0
109 ? "no labels"
110 : `labels ${(c.labels.to as string[]).join(", ")}`
111 : "",
112 ].filter((x) => x !== "");
113 return ` ${e.by}, ${shortWhen(e.at)}: ${said.join("; ")} (${e.notified.length > 0 ? `told ${e.notified.join(", ")}` : "told nobody"})`;
116/** Labels as typed, lower-cased, since the Worker refuses upper case (Security): --label Friction means friction. */
117function labelList(value: string): string[] {
118 return listOf(value).map((l) => l.toLowerCase());
121/** A comma-separated list of names or issue numbers; "none" is the empty list. */
122function listOf(value: string): string[] {
123 return value.trim() === "none"
124 ? []
125 : value
126 .split(",")
127 .map((v) => v.trim())
128 .filter((v) => v !== "");
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).Compare131/** The most one attachment may be: the Issues Worker's cap, checked here before sending (abso issue 171). */
132const ATTACH_MAX = 10 * 1024 * 1024;
134/** Uploads each file --attach names (comma-separated), in order, and answers their ids. Nothing is sent if a file is missing or too big. */
135async function uploadAttachments(api: Api, cwd: string, value: string | undefined): Promise<string[]> {
136 if (value === undefined) return [];
137 const paths = listOf(value);
138 if (paths.length === 0) throw new UsageError("--attach names files, comma-separated: --attach shot.png,after.png");
139 const files = paths.map((p) => {
140 const full = resolve(cwd, p);
141 let size: number;
142 try {
143 size = statSync(full).size;
144 } catch {
145 throw new UsageError(`--attach ${p}: no such file`);
146 }
147 if (size > ATTACH_MAX)
148 throw new UsageError(`--attach ${p} is ${sizeText(size)}; one attachment is at most ${sizeText(ATTACH_MAX)}`);
149 return { full, name: basename(full) };
150 });
151 const ids: string[] = [];
152 for (const f of files) ids.push((await api.attachmentUpload(readFileSync(f.full), f.name)).id);
153 return ids;
156function sizeText(n: number): string {
157 return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${Math.round(n / 1024)} KB` : `${(n / (1024 * 1024)).toFixed(1)} MB`;
160/** Attachments as lines under what carries them: name, size and where it's served. */
161function attachmentLines(
162 api: Pick<Api, "attachmentUrl"> | undefined,
163 files: readonly Attachment[] | undefined,
164 indent: string,
165): string[] {
pinch24abso issue N lists an SVG attachment's own file. A server that takes SVG attachments draws each one as a PNG, and keeps the SVG only as a download. The issue page now shows that download under the image: 'drawn from "logo.svg", 512 B, <link>/source'. The --attach help says svg is taken, up to 1 MB, on servers that take it.Compare166 return (files ?? []).flatMap((a) => [
167 `${indent}attached ${a.id}: ${q(a.name)}, ${sizeText(a.size)}${api ? `, ${api.attachmentUrl(a.id)}` : ""}`,
168 // An SVG is shown as the PNG drawn from it; its own file is a download beside it.
169 ...(a.source
170 ? [
171 `${indent} drawn from ${q(a.source.name)}, ${sizeText(a.source.size)}${api ? `, ${api.attachmentUrl(a.id)}/source` : ""}`,
172 ]
173 : []),
174 ]);
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.Compare175}
177/** A saved attachment's file name: its id, then its own name with anything but letters, digits, . - _ made _. */
178export function savedName(id: string, name: string): string {
179 const own = (name.split(/[\\/]/).pop() ?? "")
180 .replace(/[^A-Za-z0-9._-]/g, "_")
181 .replace(/^\.+/, "_")
182 .slice(0, 100);
183 return `${id}-${own || "file"}`;
186/**
187 * abso issue N --save-attachments <folder>: every attachment on the issue and
188 * its comments, written to that folder as <id>-<name>; an svg's own file
189 * beside the png drawn from it. Not into the abso folder unless abso leaves
190 * that place out, or the images would be recorded as edits.
191 */
192async function saveAttachments(api: Api, root: string, cwd: string, dir: string, page: IssuePage): Promise<Output> {
193 const target = resolve(cwd, dir);
194 const inside = target === resolve(root) ? "" : relativeTo(root, target);
195 if (inside !== undefined && (inside === "" || !ignoredHere(loadIgnore(root), inside, true)))
196 throw new UsageError(
197 `${dir} is inside this abso folder, so abso would record the images as your edits. Save them outside the folder, or into a folder .absoignore leaves out`,
198 );
199 const seen = new Set<string>();
200 const all = [...(page.issue.attachments ?? []), ...page.comments.flatMap((c) => c.attachments ?? [])].filter(
201 (a) => !seen.has(a.id) && seen.add(a.id),
202 );
203 if (all.length === 0)
204 return {
205 text: `Issue ${page.issue.id} has no attachments.`,
206 json: { issue: page.issue.id, folder: target, files: [] },
207 };
208 mkdirSync(target, { recursive: true });
209 const files: { id: string; path: string; size: number }[] = [];
210 for (const a of all) {
211 const wanted = [{ name: a.name, source: false }, ...(a.source ? [{ name: a.source.name, source: true }] : [])];
212 for (const w of wanted) {
213 const bytes = await api.attachmentBytes(a.id, w.source, ATTACH_MAX);
214 const path = join(target, savedName(a.id, w.name));
215 writeFileSync(path, bytes);
216 files.push({ id: a.id, path, size: bytes.length });
217 }
218 }
219 return {
220 text: [
221 `Saved ${plural(files.length, "file")} from issue ${page.issue.id} to ${target}:`,
222 ...files.map((f) => ` ${basename(f.path)}, ${sizeText(f.size)}`),
223 ].join("\n"),
224 json: { issue: page.issue.id, folder: target, files },
225 };
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).Compare226}
init0Start the project228/** An issue's page, as text. */
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).Compare229export function issuePage(p: IssuePage, api?: Pick<Api, "attachmentUrl">): string[] {
init0Start the project230 const i = p.issue;
231 const facts = [
232 i.parent !== null ? `Under issue ${i.parent}.` : "",
233 `Opened by ${i.opened.by}, ${shortWhen(i.opened.at)}.`,
234 i.agent !== null ? `Agent: ${i.agent}.` : "",
235 i.agents.length > 0 ? `Working on it: ${i.agents.join(", ")}.` : "",
236 i.blockedBy.length > 0 ? `Blocked by: issue${i.blockedBy.length === 1 ? "" : "s"} ${i.blockedBy.join(", ")}.` : "",
237 (i.labels ?? []).length > 0 ? `Labels: ${i.labels.join(", ")}.` : "",
238 i.versions.length > 0 ? `Versions: ${i.versions.join(", ")}.` : "",
239 i.waitingOn.length > 0 ? `Waiting on: ${i.waitingOn.join(", ")}.` : "",
240 i.closed
241 ? `${i.closed.how === "done" ? "Done" : "Dropped"} by ${i.closed.by}${i.closed.version !== null ? ` in version ${i.closed.version}` : ""}, ${shortWhen(i.closed.at)}.`
242 : "",
243 ].filter((f) => f !== "");
244 return [
245 `Issue ${i.id}: ${q(i.title)} [${i.status}]`,
246 facts.join(" "),
247 ...(i.lines ? [`From ${i.lines.file} lines ${i.lines.from}-${i.lines.to} at version ${i.lines.version}.`] : []),
248 ...(i.description !== "" ? ["", ...i.description.split("\n").map((l) => ` ${l}`)] : []),
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).Compare249 ...attachmentLines(api, i.attachments, " "),
init0Start the project250 ...(p.asks.length > 0 ? ["", "Asks:", ...p.asks.map(askLine)] : []),
251 ...(p.comments.length > 0
252 ? [
253 "",
254 "Comments:",
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).Compare255 ...p.comments.flatMap((c) => [
256 ` ${c.by}${c.kind === "objection" ? " objects" : ""}, ${shortWhen(c.at)}: ${q(c.text)}`,
257 ...attachmentLines(api, c.attachments, " "),
258 ]),
init0Start the project259 ]
260 : []),
261 ...((p.edits ?? []).length > 0 ? ["", "Edits:", ...p.edits.map(editLine)] : []),
262 ...(p.children.length > 0 ? ["", "Sub-issues:", ...p.children.map(issueLine)] : []),
263 ...((i.watchers ?? []).length > 0 ? ["", `Watchers: ${i.watchers.join(", ")}.`] : []),
264 "",
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare265 `abso start "..." --issue ${i.id} starts on it; abso issue ${i.id} --comment "..." comments; abso ask <who> "..." --issue ${i.id} asks.`,
init0Start the project266 ];
269export async function runIssues(args: Parsed, env: Env): Promise<Output> {
270 if (args.positionals.length > 0)
271 throw new UsageError(
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare272 "issues takes no words: abso issues [--open] [--status <s>] [--agent <a>] [--parent <N>] [--label <l,l>] | abso issues --labels; abso issue <N> shows one",
init0Start the project273 );
274 const { api } = openIssues(env);
275 if (bool(args, "drafts")) {
276 const { drafts } = await api.drafts();
277 return {
278 text:
279 drafts.length === 0
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare280 ? 'No drafts. abso issue draft "<title>" saves one: only you see it, and nobody hears of it.'
init0Start the project281 : [
282 `${plural(drafts.length, "draft")}, newest first (only you see them):`,
283 ...drafts.map(draftLine),
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare284 "abso issue draft <D> --open opens one as an issue; --delete deletes it.",
init0Start the project285 ].join("\n"),
286 json: { drafts },
287 };
288 }
289 if (bool(args, "labels")) {
290 const { labels } = await api.issueLabels();
291 return {
292 text:
293 labels.length === 0
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare294 ? 'No labels yet. abso issue new "<title>" --label friction labels a new issue; abso issue <N> --label <l> labels one.'
init0Start the project295 : [
296 `${plural(labels.length, "label")} in use:`,
297 ...labels.map((l) => ` ${l.label}: ${l.open} open of ${l.total}`),
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare298 "abso issues --label <label> lists a label's issues.",
init0Start the project299 ].join("\n"),
300 json: { labels },
301 };
302 }
303 const parent = str(args, "parent");
304 const filter = {
305 ...(str(args, "status") ? { status: str(args, "status")! } : {}),
306 ...(str(args, "agent") ? { agent: str(args, "agent")! } : {}),
307 ...(parent !== undefined ? { parent: issueNumber(parent, "--parent") } : {}),
308 ...(str(args, "label") !== undefined ? { labels: labelList(str(args, "label")!) } : {}),
309 open: bool(args, "open"),
310 };
311 const { issues } = await api.issues(filter);
312 const scope = [
313 filter.open ? "open " : "",
314 filter.status ? `${filter.status} ` : "",
315 filter.labels ? `${filter.labels.join(", ")} ` : "",
316 ].join("");
317 return {
318 text:
319 issues.length === 0
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare320 ? `No ${scope}issues${filter.agent ? ` for ${filter.agent}` : ""}${parent !== undefined ? ` under ${parent}` : ""}. abso issue new "<title>" opens one.`
init0Start the project321 : [
322 `${plural(issues.length, `${scope}issue`)}, most recently updated first:`,
323 ...issues.map(issueLine),
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare324 "abso issue <N> shows one.",
init0Start the project325 ].join("\n"),
326 json: { issues },
327 };
330/** A new issue's fields from the command line, as open and drafts take them; `title` only when words were given. */
331function openFields(args: Parsed, title: string): DraftBody {
332 const lines = str(args, "lines");
333 const at = lines === undefined ? undefined : /^(.+):(\d+)(?:-(\d+))?@(\d+)$/.exec(lines);
334 if (lines !== undefined && !at)
335 throw new UsageError("--lines is <file>:<from>-<to>@<version>, like src/a.ts:10-14@140");
336 const parent = str(args, "parent");
337 return {
338 ...(title !== "" ? { title } : {}),
339 ...(str(args, "description") ? { description: str(args, "description")! } : {}),
340 ...(parent !== undefined ? { parent: issueNumber(parent, "--parent") } : {}),
341 ...(at ? { lines: { file: at[1]!, from: Number(at[2]), to: Number(at[3] ?? at[2]), version: Number(at[4]) } } : {}),
342 ...(str(args, "agent") ? { agent: str(args, "agent")! } : {}),
343 ...(str(args, "blocked-by") !== undefined
344 ? { blockedBy: listOf(str(args, "blocked-by")!).map((b) => issueNumber(b, "--blocked-by")) }
345 : {}),
346 ...(str(args, "notify") !== undefined ? { notify: listOf(str(args, "notify")!) } : {}),
347 ...(str(args, "label") !== undefined ? { labels: labelList(str(args, "label")!) } : {}),
348 };
351/** One draft as a line: its number, title, and what else it holds. */
352function draftLine(d: Draft): string {
353 const b = d.body;
354 const more = [
355 b.agent ? `for ${b.agent}` : "",
356 b.parent ? `under ${b.parent}` : "",
357 (b.labels ?? []).length > 0 ? `labels ${b.labels!.join(", ")}` : "",
358 b.description ? "a description" : "",
359 ].filter((m) => m !== "");
360 return ` draft ${d.id}: ${b.title ? q(b.title) : "(no title yet)"}${more.length > 0 ? ` (${more.join("; ")})` : ""}, saved ${shortWhen(d.saved)}`;
363/**
364 * Drafts (abso issue 3): an issue not opened yet, this agent's alone, with no
365 * number and no news. `abso issue draft "<title>" [fields]` saves a new one;
366 * `abso issue draft <D> [fields]` changes one; --open opens it as an issue;
367 * --delete deletes it. `abso issues --drafts` lists them.
368 */
369async function runDraft(api: Api, args: Parsed, words: string[]): Promise<Output> {
370 const [d, ...more] = words;
371 if (d !== undefined && /^\d+$/.test(d) && more.length === 0) {
372 const id = Number(d);
373 if (bool(args, "delete") && bool(args, "open")) throw new UsageError("--open or --delete, not both");
374 if (bool(args, "delete")) {
375 await api.deleteDraft(id);
376 return { text: `Deleted draft ${id}.`, json: { draft: id, deleted: true } };
377 }
378 if (bool(args, "open")) {
379 const r = await api.openDraft(id, openFields(args, ""));
380 return {
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare381 text: `Opened draft ${id} as issue ${r.id}. abso start "..." --issue ${r.id} starts on it.`,
init0Start the project382 json: { draft: id, id: r.id },
383 };
384 }
385 // Saving replaces the draft's body, so the fields given go over what it holds.
386 const found = (await api.drafts()).drafts.find((x) => x.id === id);
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare387 if (!found) throw new UsageError(`you have no draft ${id}; abso issues --drafts lists yours`);
init0Start the project388 await api.saveDraft({ ...found.body, ...openFields(args, ""), id });
389 return { text: `Saved draft ${id}.`, json: { draft: id } };
390 }
391 if (bool(args, "open") || bool(args, "delete"))
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare392 throw new UsageError("--open and --delete take a draft's number: abso issue draft <D> --open");
init0Start the project393 const r = await api.saveDraft(openFields(args, words.join(" ")));
394 return {
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare395 text: `Saved draft ${r.id}. Only you see it, and nobody hears of it. abso issue draft ${r.id} --open opens it as an issue.`,
init0Start the project396 json: { draft: r.id },
397 };
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.Compare400/** The flags --copy-to goes with: anything else on the same command is refused, so a copy is never half an edit. */
401const COPY_FLAGS = new Set(["copy-to", "clean", "dry-run"]);
403/** abso issue <N> --copy-to <project>: the server reads the issue and writes the copy. */
404async function runCopy(api: Api, id: number, to: string, args: Parsed, env: Env): Promise<Output> {
405 const other = [...args.flags.keys()].filter((f) => !COPY_FLAGS.has(f) && f !== "json");
406 if (other.length > 0)
407 throw new UsageError(`--copy-to goes alone (with --clean and --dry-run), not with --${other[0]}`);
408 if (to === api.config.project)
409 throw new UsageError(`issue ${id} is already in ${to}; --copy-to names another project`);
410 const clean = str(args, "clean");
411 const texts = clean === undefined ? {} : readClean(resolve(env.cwd, clean), clean);
412 const dryRun = bool(args, "dry-run");
413 const from = api.config.project;
414 let answer: CopyAnswer;
415 try {
416 answer = await api.issueCopy(to, { ...texts, from, issue: id, ...(dryRun ? { dryRun: true } : {}) });
417 } catch (e) {
418 if (e instanceof ApiError && e.status === 403 && !dryRun)
419 throw new ApiError(`${e.message}. --dry-run still shows what would go.`, e.status);
420 throw e;
421 }
422 if ("dryRun" in answer) {
423 const p = answer.plan;
424 const edited = (list: { edited: boolean }[]) => list.filter((x) => x.edited).length;
425 const lines = [
426 `A dry run: nothing was written. Copying ${from} issue ${id} into ${to} would make:`,
427 ` ${q(p.title)}${p.closed ? `, ${p.closed.how}` : ""}${p.edited.length > 0 ? ` (${p.edited.join(" and ")} edited when copied)` : ""}`,
428 ` ${plural(p.comments.length, "comment")}${edited(p.comments) > 0 ? ` (${edited(p.comments)} edited)` : ""}, ${plural(p.asks.length, "answered ask")}${edited(p.asks) > 0 ? ` (${edited(p.asks)} edited)` : ""}${p.labels.length > 0 ? `, labelled ${p.labels.join(", ")}` : ""}`,
429 ...skippedLines(p.skipped),
430 `Run it again without --dry-run to copy it.`,
431 ];
432 return { text: lines.join("\n"), json: answer };
433 }
434 return {
435 text: [
436 `Copied ${from} issue ${id} to ${to} issue ${answer.id}. Its comments and asks keep their authors and times, and issue ${id} has a comment saying where it went.`,
437 ...skippedLines(answer.skipped),
438 ].join("\n"),
439 json: answer,
440 };
443function skippedLines(skipped: { comments: number[]; asks: number[] }): string[] {
444 const parts = [
445 ...(skipped.comments.length > 0 ? [`comments ${skipped.comments.join(", ")}`] : []),
446 ...(skipped.asks.length > 0 ? [`asks ${skipped.asks.join(", ")}`] : []),
447 ];
448 return parts.length > 0 ? [` not copied: ${parts.join("; ")} (open asks, and what --clean left out)`] : [];
451/** --clean's file: cleaned texts by source id. The server checks each id against the issue it reads. */
452function readClean(path: string, given: string): Omit<CopyBody, "from" | "issue"> {
453 let raw: unknown;
454 try {
455 raw = JSON.parse(readFileSync(path, "utf8"));
456 } catch (e) {
457 throw new UsageError(
458 `--clean ${given}: ${(e as NodeJS.ErrnoException).code === "ENOENT" ? "no such file" : "not JSON"}`,
459 );
460 }
461 if (typeof raw !== "object" || raw === null || Array.isArray(raw))
462 throw new UsageError(`--clean ${given}: a JSON object with title, description, comments or asks`);
463 const known = new Set(["title", "description", "comments", "asks"]);
464 const unknown = Object.keys(raw).filter((k) => !known.has(k));
465 if (unknown.length > 0)
466 throw new UsageError(`--clean ${given}: ${unknown[0]} isn't one of title, description, comments, asks`);
467 return raw as Omit<CopyBody, "from" | "issue">;
init0Start the project470export async function runIssue(args: Parsed, env: Env): Promise<Output> {
471 const [first, ...rest] = args.positionals;
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.Compare472 const { root, api } = openIssues(env);
473 const saveTo = str(args, "save-attachments");
474 if (saveTo !== undefined) {
475 const other = [...args.flags.keys()].filter((f) => f !== "save-attachments" && f !== "json");
476 if (other.length > 0 || first === "new" || first === "draft")
477 throw new UsageError(
478 `--save-attachments goes alone with an issue number: abso issue <N> --save-attachments <folder>${other.length > 0 ? `, not with --${other[0]}` : ""}`,
479 );
480 }
init0Start the project481 if (first === "draft") return runDraft(api, args, rest);
482 if (first === "new") {
483 if (rest.length === 0)
484 throw new UsageError(
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare485 'abso issue new "<title>" [--description "..."] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>]',
init0Start the project486 );
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).Compare487 const fields = { ...openFields(args, rest.join(" ")), title: rest.join(" ") };
488 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
489 const r = await api.issueOpen({ ...fields, ...(attachments.length > 0 ? { attachments } : {}) });
490 return {
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare491 text: `Opened issue ${r.id}${attachments.length > 0 ? ` with ${plural(attachments.length, "attachment")} (${attachments.join(", ")})` : ""}. abso start "..." --issue ${r.id} starts on it.`,
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).Compare492 json: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}) },
493 };
init0Start the project494 }
495 if (first === undefined || rest.length > 0)
496 throw new UsageError(
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare497 'abso issue <N> [--comment "..." | --object "..." | --drop | --reopen | --done [--done-by <version>] | an edit], or abso issue new "<title>"',
init0Start the project498 );
499 const id = issueNumber(first);
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.Compare500 const copyTo = str(args, "copy-to");
501 if (copyTo !== undefined) return runCopy(api, id, copyTo, args, env);
502 if (str(args, "clean") !== undefined || bool(args, "dry-run"))
503 throw new UsageError("--clean and --dry-run go with --copy-to <project>");
init0Start the project504 const comment = str(args, "comment");
505 const object = str(args, "object");
506 const doneBy = str(args, "done-by");
507 const markingDone = bool(args, "done") || doneBy !== undefined;
508 const edits = ["title", "description", "parent", "agent", "blocked-by", "label", "unlabel"].filter(
509 (f) => str(args, f) !== undefined,
510 );
511 if (
512 [
513 comment !== undefined,
514 object !== undefined,
515 bool(args, "drop"),
516 bool(args, "reopen"),
517 markingDone,
518 edits.length > 0,
519 ].filter(Boolean).length > 1
520 )
521 throw new UsageError("one of --comment, --object, --drop, --reopen, --done or an edit at a time");
522 if (edits.length > 0) {
523 const parent = str(args, "parent");
524 const agent = str(args, "agent");
525 const blockedBy = str(args, "blocked-by");
526 const r = await api.issueEdit(id, {
527 ...(str(args, "title") !== undefined ? { title: str(args, "title")! } : {}),
528 ...(str(args, "description") !== undefined ? { description: str(args, "description")! } : {}),
529 ...(parent !== undefined ? { parent: parent === "none" ? null : issueNumber(parent, "--parent") } : {}),
530 ...(agent !== undefined ? { agent: agent === "none" ? null : agent } : {}),
531 ...(blockedBy !== undefined ? { blockedBy: listOf(blockedBy).map((b) => issueNumber(b, "--blocked-by")) } : {}),
532 ...(bool(args, "quiet") ? { notify: false } : {}),
533 ...(str(args, "notify") !== undefined ? { also: listOf(str(args, "notify")!) } : {}),
534 ...(str(args, "label") !== undefined ? { addLabels: labelList(str(args, "label")!) } : {}),
535 ...(str(args, "unlabel") !== undefined ? { removeLabels: labelList(str(args, "unlabel")!) } : {}),
536 // A labels-only edit tells nobody unless --notify names people.
537 ...(edits.every((f) => f === "label" || f === "unlabel") && str(args, "notify") !== undefined
538 ? { notify: true }
539 : {}),
540 });
541 return {
542 text: `Edited issue ${id}. ${r.notified.length > 0 ? `Told ${r.notified.join(", ")}.` : "Told nobody."}`,
543 json: { issue: id, edit: r.edit, notified: r.notified },
544 };
545 }
546 if (bool(args, "quiet") || str(args, "notify") !== undefined)
547 throw new UsageError(
548 "--quiet and --notify go with an edit (--title, --description, --parent, --agent, --blocked-by, --label or --unlabel)",
549 );
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).Compare550 if (str(args, "attach") !== undefined && comment === undefined && object === undefined)
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare551 throw new UsageError("--attach goes with abso issue new or --comment (or --object)");
init0Start the project552 if (comment !== undefined || object !== undefined) {
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).Compare553 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
554 const r = await api.issueComment(id, (comment ?? object)!, object !== undefined, attachments);
init0Start the project555 return {
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).Compare556 text: `${object !== undefined ? "Objected" : "Commented"} on issue ${id}${attachments.length > 0 ? ` with ${plural(attachments.length, "attachment")} (${attachments.join(", ")})` : ""}. Its agents hear it.`,
557 json: { id: r.id, issue: id, ...(attachments.length > 0 ? { attachments } : {}) },
init0Start the project558 };
559 }
560 if (bool(args, "drop")) {
561 await api.issueDrop(id);
562 return { text: `Dropped issue ${id}.`, json: { issue: id, dropped: true } };
563 }
564 if (bool(args, "reopen")) {
565 await api.issueReopen(id);
566 return { text: `Reopened issue ${id}.`, json: { issue: id, reopened: true } };
567 }
568 if (markingDone) {
569 let version: number | null = null;
570 if (doneBy !== undefined) {
571 version = issueNumber(doneBy, "--done-by");
572 if (version < 1) throw new UsageError("--done-by is a published version, 1 or more");
573 try {
574 await api.show(version, { draft: null });
575 } catch {
576 throw new UsageError(`no version ${version}`);
577 }
578 }
579 await api.issueDone(id, version);
580 return {
581 text: version === null ? `Marked issue ${id} done.` : `Marked issue ${id} done in version ${version}.`,
582 json: { issue: id, done: true, ...(version !== null ? { version } : {}) },
583 };
584 }
585 const page = await api.issue(id);
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.Compare586 if (saveTo !== undefined) return saveAttachments(api, root, env.cwd, saveTo, page);
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).Compare587 return { text: issuePage(page, api).join("\n"), json: { ...page } };
init0Start the project588}
590export async function runAsk(args: Parsed, env: Env): Promise<Output> {
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).Compare591 const withdraw = str(args, "withdraw");
592 if (withdraw !== undefined) return withdrawAsk(args, env, withdraw);
593 if (str(args, "note") !== undefined)
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare594 throw new UsageError('--note goes with --withdraw: abso ask --withdraw <ask> --note "why"');
init0Start the project595 const [of, ...words] = args.positionals;
596 if (of === undefined || words.length === 0)
597 throw new UsageError(
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare598 'abso ask <who> "<question>" [--issue <N>] [--review | --task] [--due <YYYY-MM-DD>] [--blocks <N,N>] [--options "A|B|C"]; who is an agent, or person:<id>',
init0Start the project599 );
600 const { api } = openIssues(env);
601 if (bool(args, "review") && bool(args, "task")) throw new UsageError("an ask is a review or a task, not both");
602 const issue = str(args, "issue");
603 const blocks = str(args, "blocks");
604 const options = str(args, "options");
605 const r = await api.ask({
606 of,
607 question: words.join(" "),
608 ...(issue !== undefined ? { issue: issueNumber(issue, "--issue") } : {}),
609 ...(bool(args, "review") ? { review: true } : {}),
610 ...(bool(args, "task") ? { kind: "task" as const } : {}),
611 ...(str(args, "due") ? { due: str(args, "due")! } : {}),
612 ...(blocks !== undefined ? { blocks: blocks.split(",").map((b) => issueNumber(b.trim(), "--blocks")) } : {}),
613 ...(options !== undefined
614 ? {
615 options: options
616 .split("|")
617 .map((o) => o.trim())
618 .filter((o) => o !== ""),
619 }
620 : {}),
621 });
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare622 return { text: `Asked ${of} (ask ${r.id}). They hear it; abso waiting shows what's open.`, json: { id: r.id } };
init0Start the project623}
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare625/** abso ask --withdraw <ask> [--note "why"]: the asker takes an ask back. It closes like an answer, and the one asked hears it. */
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).Compare626async function withdrawAsk(args: Parsed, env: Env, word: string): Promise<Output> {
627 const others = ["issue", "due", "blocks", "options"].filter((f) => str(args, f) !== undefined);
628 if (args.positionals.length > 0 || others.length > 0 || bool(args, "review") || bool(args, "task"))
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare629 throw new UsageError('abso ask --withdraw <ask> [--note "why"] takes nothing else: it takes back an ask you made');
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).Compare630 const id = issueNumber(word, "the ask number");
631 const { api } = openIssues(env);
632 const note = str(args, "note");
633 const r = await api.withdraw(id, note !== undefined ? { note } : {});
634 return { text: `Withdrew ask ${id}. ${r.ask.of} hears it, and it no longer waits on them.`, json: { ask: r.ask } };
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.Compare635}
637/** One search hit as two lines: the issue, then where it matched and the words around it. */
638export function searchLines(h: IssueSearchHit): string[] {
639 const where = h.meaning ? "by meaning" : h.where === "comment" ? `in comment ${h.comment}` : `in the ${h.where}`;
640 const words = h.snippet
641 .replace(/[\u0001\u0002]/g, "")
642 .replace(/\s+/g, " ")
643 .trim();
644 return [
645 ` ${String(h.issue.id).padStart(3)} ${h.issue.status.padEnd(11)} ${q(h.issue.title)}`,
646 ` ${where}${words && words !== h.issue.title ? `: ${q(words)}` : ""}`,
647 ];
650export async function runSearch(args: Parsed, env: Env): Promise<Output> {
651 const words = args.positionals.join(" ").trim();
652 if (words === "") throw new UsageError('search needs words: abso search "<words>" [--limit <N>]');
653 const limitWord = str(args, "limit");
654 const limit = limitWord === undefined ? undefined : Number(limitWord);
655 if (limit !== undefined && !(Number.isInteger(limit) && limit >= 1 && limit <= 50))
656 throw new UsageError("--limit is a number from 1 to 50");
657 const { api } = openIssues(env);
658 const { hits } = await api.issueSearch(words, limit);
659 return {
660 text:
661 hits.length === 0
662 ? `Nothing matches ${q(words)}.`
663 : [
664 `${plural(hits.length, "issue")} for ${q(words)}, best first:`,
665 ...hits.flatMap(searchLines),
666 "abso issue <N> shows one.",
667 ].join("\n"),
668 json: { hits },
669 };
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).Compare670}
init0Start the project672export async function runWaiting(args: Parsed, env: Env): Promise<Output> {
673 if (args.positionals.length > 0)
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare674 throw new UsageError("waiting takes no words: abso waiting [--of <agent or person:id>] [--mine]");
init0Start the project675 const { api, config } = openIssues(env);
676 const mine = bool(args, "mine") || str(args, "of") === config.agent;
677 const of = mine ? config.agent : str(args, "of");
678 const { asks } = mine ? await api.waitingMine() : await api.waiting(of);
679 return {
680 text:
681 asks.length === 0
682 ? `Nothing is waiting${of ? ` on ${of}` : ""}.`
683 : [
684 `${plural(asks.length, "open ask")}${of ? ` of ${of}` : ""}, soonest due first:`,
685 ...asks.map(askLine),
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare686 'abso answer <ask> "..." answers one asked of you.',
init0Start the project687 ].join("\n"),
688 json: { asks },
689 };
692export async function runAnswer(args: Parsed, env: Env): Promise<Output> {
693 const [first, ...words] = args.positionals;
694 const id = issueNumber(first, "the ask number");
695 const option = str(args, "option");
696 const done = bool(args, "done");
697 if (words.length === 0 && option === undefined && !done)
review16The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).Compare698 throw new UsageError('abso answer <ask> "<words>" | --option <N> [--note "..."] | --done [--note "..."]');
init0Start the project699 const { api } = openIssues(env);
700 const note = str(args, "note");
701 const r = await api.answer(id, {
702 ...(words.length > 0 ? { words: words.join(" ") } : {}),
703 ...(option !== undefined ? { option: /^\d+$/.test(option) ? Number(option) - 1 : option } : {}),
704 ...(done ? { done: true } : {}),
705 ...(note !== undefined ? { note } : {}),
706 });
707 return { text: `Answered ask ${id}. ${r.ask.by} hears it.`, json: { ask: r.ask } };