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 45 --json
JSON
/christopher/abso-core/blame/client/src/issues.ts?version=45&format=json
756 linesFirst import 52% · pinch 37% · devops 5% · review 4% · infra-split 2%Last change infra-split in version 37,

756 lines from 19 changes in 12 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";
pinch36waiting --mine lists your publishes still in the merge queue: where each stands (being checked, or how many wait ahead of it), whether the queue is paused, and that the outcome comes as news; --json carries them as queued. A server without a queue, or one that can't be read, leaves them out rather than failing the asks.Compare30import { queuedLines, standing } from "./queue.ts";
init0Start the project31import { seenText, shortWhen } from "./times.ts";
33const q = (s: string): string => JSON.stringify(s);
35/** 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.Compare36function openIssues(env: Env): { root: string; config: Config; api: Api } {
37 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)Compare38 const server = fromEnv(env.env, "ISSUES_SERVER") || issuesServerFor(config.server, readMachineServers(env.env));
init0Start the project39 if (server === undefined)
40 throw new UsageError(
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare41 `${config.server} has no Issues Worker beside it that abso knows; ~/.abso/servers.json or ABSO_ISSUES_SERVER names one`,
init0Start the project42 );
43 if (config.token !== undefined && !tokenGoesTo(server, trustedServers(env.env))) {
44 throw new UsageError(
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare45 `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 project46 );
47 }
48 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.Compare49 return { root, config, api };
init0Start the project50}
52function issueNumber(word: string | undefined, what = "an issue number"): number {
53 if (word === undefined || !/^#?\d+$/.test(word)) throw new UsageError(`${what} is a number, like 12`);
54 return Number(word.replace("#", ""));
57/** One issue as a line. */
58export function issueLine(i: IssueRow): string {
59 const detail = [
60 i.agent !== null && !i.agents.includes(i.agent) ? `for ${i.agent}` : "",
61 i.agents.length > 0 ? i.agents.join(", ") : "",
62 i.blockedBy.length > 0 ? `blocked by ${i.blockedBy.join(", ")}` : "",
63 (i.labels ?? []).length > 0 ? `labels ${i.labels.join(", ")}` : "",
64 i.versions.length > 0 ? `${i.versions.length === 1 ? "version" : "versions"} ${i.versions.join(", ")}` : "",
65 i.waitingOn.length > 0 ? `waiting on ${i.waitingOn.join(", ")}` : "",
66 i.parent !== null ? `under ${i.parent}` : "",
67 i.children > 0 ? plural(i.children, "sub-issue") : "",
68 `updated ${shortWhen(i.updated)}`,
69 ].filter((d) => d !== "");
70 return ` ${String(i.id).padStart(3)} ${i.status.padEnd(11)} ${q(i.title)}${detail.length > 0 ? ` (${detail.join("; ")})` : ""}`;
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.Compare73function askLine(a: Ask & { title?: string | null }, api?: Pick<Api, "attachmentUrl">): string {
init0Start the project74 const what = a.review ? "a review" : a.kind === "task" ? "a task" : "a question";
75 const where = a.issue === null ? "" : ` on issue ${a.issue}${a.title ? ` (${q(a.title)})` : ""}`;
76 const extra = [
77 // 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).Compare78 a.answer
79 ? `${a.outcome === "withdrawn" ? "withdrawn" : "answered"} by ${a.answer.by}, ${shortWhen(a.answer.at)}`
80 : "",
init0Start the project81 !a.answer && a.seen !== undefined ? seenText(a.seen) : "",
82 a.due ? `due ${a.due}` : "",
83 a.blocks.length > 0 ? `blocks ${a.blocks.join(", ")}` : "",
84 ].filter((x) => x !== "");
85 const head = ` ask ${a.id}: ${a.by}, ${shortWhen(a.at)}, asks ${a.of} ${what}${where}${extra.length > 0 ? ` (${extra.join("; ")})` : ""}: ${q(a.question)}`;
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.Compare86 const lines = [head, ...attachmentLines(api, a.attachments, " ")];
init0Start the project87 if (a.options.length > 0) lines.push(` options: ${a.options.map((o, i) => `${i + 1}. ${q(o)}`).join(", ")}`);
88 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).Compare89 if (a.answer && a.outcome === "withdrawn") {
90 if (a.answer.words !== "") lines.push(` why: ${q(a.answer.words)}`);
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.Compare91 } else if (a.answer)
92 lines.push(` answer: ${q(a.answer.words)}`, ...attachmentLines(api, a.answer.attachments, " "));
init0Start the project93 return lines.join("\n");
96/** One edit in an issue's activity: what changed, and who was told. */
97function editLine(e: IssuePage["edits"][number]): string {
98 const c = e.changes;
99 const said = [
100 c.title ? `title ${q(String(c.title.from))} to ${q(String(c.title.to))}` : "",
101 c.description ? "the description" : "",
102 c.parent ? (c.parent.to === null ? "no parent" : `parent issue ${String(c.parent.to)}`) : "",
103 c.agent ? (c.agent.to === null ? "no Agent" : `Agent ${String(c.agent.to)}`) : "",
104 c.blockedBy
105 ? (c.blockedBy.to as number[]).length === 0
106 ? "blocked by nothing"
107 : `blocked by ${(c.blockedBy.to as number[]).join(", ")}`
108 : "",
109 c.labels
110 ? (c.labels.to as string[]).length === 0
111 ? "no labels"
112 : `labels ${(c.labels.to as string[]).join(", ")}`
113 : "",
114 ].filter((x) => x !== "");
115 return ` ${e.by}, ${shortWhen(e.at)}: ${said.join("; ")} (${e.notified.length > 0 ? `told ${e.notified.join(", ")}` : "told nobody"})`;
infra-split37Comments and test names give each reason in plain words, without naming who raised it Notes like "(#37, Builder 5)" or "(AVCS - Security)" become "(#37)" or go, and a private commit hash after a name goes with it. Issue numbers and references such as git's CVE-2019-1353 stay. Only comments and test names change; no behavior changes.Compare118/** Labels as typed, lower-cased, since the Worker refuses upper case: --label Friction means friction. */
init0Start the project119function labelList(value: string): string[] {
120 return listOf(value).map((l) => l.toLowerCase());
123/** A comma-separated list of names or issue numbers; "none" is the empty list. */
124function listOf(value: string): string[] {
125 return value.trim() === "none"
126 ? []
127 : value
128 .split(",")
129 .map((v) => v.trim())
130 .filter((v) => v !== "");
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.Compare133/** " with 2 attachments (a…, a…)" after a write that carried some; nothing otherwise. */
134function withFiles(ids: readonly string[]): string {
135 return ids.length > 0 ? ` with ${plural(ids.length, "attachment")} (${ids.join(", ")})` : "";
138/**
139 * What to say when a write sent files the server didn't keep: an Issues server from before asks carried
140 * attachments takes the words and leaves the files out. Nothing to say when it kept them, or none were sent.
141 */
142function notKept(sent: readonly string[], kept: readonly string[] | undefined, what: string): string | undefined {
143 if (sent.length === 0 || (kept !== undefined && sent.every((id) => kept.includes(id)))) return undefined;
144 return `The Issues server didn't keep the ${sent.length === 1 ? "file" : "files"} on ${what}: it is older than this client. The words went; the ${sent.length === 1 ? "file goes" : "files go"} on a comment instead (abso issue <N> --comment "..." --attach ...).`;
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).Compare147/** The most one attachment may be: the Issues Worker's cap, checked here before sending (abso issue 171). */
148const ATTACH_MAX = 10 * 1024 * 1024;
150/** Uploads each file --attach names (comma-separated), in order, and answers their ids. Nothing is sent if a file is missing or too big. */
151async function uploadAttachments(api: Api, cwd: string, value: string | undefined): Promise<string[]> {
152 if (value === undefined) return [];
153 const paths = listOf(value);
154 if (paths.length === 0) throw new UsageError("--attach names files, comma-separated: --attach shot.png,after.png");
155 const files = paths.map((p) => {
156 const full = resolve(cwd, p);
157 let size: number;
158 try {
159 size = statSync(full).size;
160 } catch {
161 throw new UsageError(`--attach ${p}: no such file`);
162 }
163 if (size > ATTACH_MAX)
164 throw new UsageError(`--attach ${p} is ${sizeText(size)}; one attachment is at most ${sizeText(ATTACH_MAX)}`);
165 return { full, name: basename(full) };
166 });
167 const ids: string[] = [];
168 for (const f of files) ids.push((await api.attachmentUpload(readFileSync(f.full), f.name)).id);
169 return ids;
172function sizeText(n: number): string {
173 return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${Math.round(n / 1024)} KB` : `${(n / (1024 * 1024)).toFixed(1)} MB`;
176/** Attachments as lines under what carries them: name, size and where it's served. */
177function attachmentLines(
178 api: Pick<Api, "attachmentUrl"> | undefined,
179 files: readonly Attachment[] | undefined,
180 indent: string,
181): 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.Compare182 return (files ?? []).flatMap((a) => [
183 `${indent}attached ${a.id}: ${q(a.name)}, ${sizeText(a.size)}${api ? `, ${api.attachmentUrl(a.id)}` : ""}`,
184 // An SVG is shown as the PNG drawn from it; its own file is a download beside it.
185 ...(a.source
186 ? [
187 `${indent} drawn from ${q(a.source.name)}, ${sizeText(a.source.size)}${api ? `, ${api.attachmentUrl(a.id)}/source` : ""}`,
188 ]
189 : []),
190 ]);
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.Compare191}
193/** A saved attachment's file name: its id, then its own name with anything but letters, digits, . - _ made _. */
194export function savedName(id: string, name: string): string {
195 const own = (name.split(/[\\/]/).pop() ?? "")
196 .replace(/[^A-Za-z0-9._-]/g, "_")
197 .replace(/^\.+/, "_")
198 .slice(0, 100);
199 return `${id}-${own || "file"}`;
202/**
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.Compare203 * abso issue N --save-attachments <folder>: every attachment on the issue, its
204 * comments and its asks and answers, written to that folder as <id>-<name>; an svg's own file
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.Compare205 * beside the png drawn from it. Not into the abso folder unless abso leaves
206 * that place out, or the images would be recorded as edits.
207 */
208async function saveAttachments(api: Api, root: string, cwd: string, dir: string, page: IssuePage): Promise<Output> {
209 const target = resolve(cwd, dir);
210 const inside = target === resolve(root) ? "" : relativeTo(root, target);
211 if (inside !== undefined && (inside === "" || !ignoredHere(loadIgnore(root), inside, true)))
212 throw new UsageError(
213 `${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`,
214 );
215 const seen = new Set<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.Compare216 const all = [
217 ...(page.issue.attachments ?? []),
218 ...page.comments.flatMap((c) => c.attachments ?? []),
219 ...page.asks.flatMap((a) => [...(a.attachments ?? []), ...(a.answer?.attachments ?? [])]),
220 ].filter((a) => !seen.has(a.id) && seen.add(a.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.Compare221 if (all.length === 0)
222 return {
223 text: `Issue ${page.issue.id} has no attachments.`,
224 json: { issue: page.issue.id, folder: target, files: [] },
225 };
226 mkdirSync(target, { recursive: true });
227 const files: { id: string; path: string; size: number }[] = [];
228 for (const a of all) {
229 const wanted = [{ name: a.name, source: false }, ...(a.source ? [{ name: a.source.name, source: true }] : [])];
230 for (const w of wanted) {
231 const bytes = await api.attachmentBytes(a.id, w.source, ATTACH_MAX);
232 const path = join(target, savedName(a.id, w.name));
233 writeFileSync(path, bytes);
234 files.push({ id: a.id, path, size: bytes.length });
235 }
236 }
237 return {
238 text: [
239 `Saved ${plural(files.length, "file")} from issue ${page.issue.id} to ${target}:`,
240 ...files.map((f) => ` ${basename(f.path)}, ${sizeText(f.size)}`),
241 ].join("\n"),
242 json: { issue: page.issue.id, folder: target, files },
243 };
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).Compare244}
init0Start the project246/** 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).Compare247export function issuePage(p: IssuePage, api?: Pick<Api, "attachmentUrl">): string[] {
init0Start the project248 const i = p.issue;
249 const facts = [
250 i.parent !== null ? `Under issue ${i.parent}.` : "",
251 `Opened by ${i.opened.by}, ${shortWhen(i.opened.at)}.`,
252 i.agent !== null ? `Agent: ${i.agent}.` : "",
253 i.agents.length > 0 ? `Working on it: ${i.agents.join(", ")}.` : "",
254 i.blockedBy.length > 0 ? `Blocked by: issue${i.blockedBy.length === 1 ? "" : "s"} ${i.blockedBy.join(", ")}.` : "",
255 (i.labels ?? []).length > 0 ? `Labels: ${i.labels.join(", ")}.` : "",
256 i.versions.length > 0 ? `Versions: ${i.versions.join(", ")}.` : "",
257 i.waitingOn.length > 0 ? `Waiting on: ${i.waitingOn.join(", ")}.` : "",
258 i.closed
259 ? `${i.closed.how === "done" ? "Done" : "Dropped"} by ${i.closed.by}${i.closed.version !== null ? ` in version ${i.closed.version}` : ""}, ${shortWhen(i.closed.at)}.`
260 : "",
261 ].filter((f) => f !== "");
262 return [
263 `Issue ${i.id}: ${q(i.title)} [${i.status}]`,
264 facts.join(" "),
265 ...(i.lines ? [`From ${i.lines.file} lines ${i.lines.from}-${i.lines.to} at version ${i.lines.version}.`] : []),
266 ...(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).Compare267 ...attachmentLines(api, i.attachments, " "),
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.Compare268 ...(p.asks.length > 0 ? ["", "Asks:", ...p.asks.map((a) => askLine(a, api))] : []),
init0Start the project269 ...(p.comments.length > 0
270 ? [
271 "",
272 "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).Compare273 ...p.comments.flatMap((c) => [
274 ` ${c.by}${c.kind === "objection" ? " objects" : ""}, ${shortWhen(c.at)}: ${q(c.text)}`,
275 ...attachmentLines(api, c.attachments, " "),
276 ]),
init0Start the project277 ]
278 : []),
279 ...((p.edits ?? []).length > 0 ? ["", "Edits:", ...p.edits.map(editLine)] : []),
280 ...(p.children.length > 0 ? ["", "Sub-issues:", ...p.children.map(issueLine)] : []),
281 ...((i.watchers ?? []).length > 0 ? ["", `Watchers: ${i.watchers.join(", ")}.`] : []),
282 "",
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).Compare283 `abso start "..." --issue ${i.id} starts on it; abso issue ${i.id} --comment "..." comments; abso ask <who> "..." --issue ${i.id} asks.`,
init0Start the project284 ];
287export async function runIssues(args: Parsed, env: Env): Promise<Output> {
288 if (args.positionals.length > 0)
289 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).Compare290 "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 project291 );
292 const { api } = openIssues(env);
293 if (bool(args, "drafts")) {
294 const { drafts } = await api.drafts();
295 return {
296 text:
297 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).Compare298 ? 'No drafts. abso issue draft "<title>" saves one: only you see it, and nobody hears of it.'
init0Start the project299 : [
300 `${plural(drafts.length, "draft")}, newest first (only you see them):`,
301 ...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).Compare302 "abso issue draft <D> --open opens one as an issue; --delete deletes it.",
init0Start the project303 ].join("\n"),
304 json: { drafts },
305 };
306 }
307 if (bool(args, "labels")) {
308 const { labels } = await api.issueLabels();
309 return {
310 text:
311 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).Compare312 ? 'No labels yet. abso issue new "<title>" --label friction labels a new issue; abso issue <N> --label <l> labels one.'
init0Start the project313 : [
314 `${plural(labels.length, "label")} in use:`,
315 ...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).Compare316 "abso issues --label <label> lists a label's issues.",
init0Start the project317 ].join("\n"),
318 json: { labels },
319 };
320 }
321 const parent = str(args, "parent");
322 const filter = {
323 ...(str(args, "status") ? { status: str(args, "status")! } : {}),
324 ...(str(args, "agent") ? { agent: str(args, "agent")! } : {}),
325 ...(parent !== undefined ? { parent: issueNumber(parent, "--parent") } : {}),
326 ...(str(args, "label") !== undefined ? { labels: labelList(str(args, "label")!) } : {}),
327 open: bool(args, "open"),
328 };
329 const { issues } = await api.issues(filter);
330 const scope = [
331 filter.open ? "open " : "",
332 filter.status ? `${filter.status} ` : "",
333 filter.labels ? `${filter.labels.join(", ")} ` : "",
334 ].join("");
335 return {
336 text:
337 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).Compare338 ? `No ${scope}issues${filter.agent ? ` for ${filter.agent}` : ""}${parent !== undefined ? ` under ${parent}` : ""}. abso issue new "<title>" opens one.`
init0Start the project339 : [
340 `${plural(issues.length, `${scope}issue`)}, most recently updated first:`,
341 ...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).Compare342 "abso issue <N> shows one.",
init0Start the project343 ].join("\n"),
344 json: { issues },
345 };
348/** A new issue's fields from the command line, as open and drafts take them; `title` only when words were given. */
349function openFields(args: Parsed, title: string): DraftBody {
350 const lines = str(args, "lines");
351 const at = lines === undefined ? undefined : /^(.+):(\d+)(?:-(\d+))?@(\d+)$/.exec(lines);
352 if (lines !== undefined && !at)
353 throw new UsageError("--lines is <file>:<from>-<to>@<version>, like src/a.ts:10-14@140");
354 const parent = str(args, "parent");
355 return {
356 ...(title !== "" ? { title } : {}),
357 ...(str(args, "description") ? { description: str(args, "description")! } : {}),
358 ...(parent !== undefined ? { parent: issueNumber(parent, "--parent") } : {}),
359 ...(at ? { lines: { file: at[1]!, from: Number(at[2]), to: Number(at[3] ?? at[2]), version: Number(at[4]) } } : {}),
360 ...(str(args, "agent") ? { agent: str(args, "agent")! } : {}),
361 ...(str(args, "blocked-by") !== undefined
362 ? { blockedBy: listOf(str(args, "blocked-by")!).map((b) => issueNumber(b, "--blocked-by")) }
363 : {}),
364 ...(str(args, "notify") !== undefined ? { notify: listOf(str(args, "notify")!) } : {}),
365 ...(str(args, "label") !== undefined ? { labels: labelList(str(args, "label")!) } : {}),
366 };
369/** One draft as a line: its number, title, and what else it holds. */
370function draftLine(d: Draft): string {
371 const b = d.body;
372 const more = [
373 b.agent ? `for ${b.agent}` : "",
374 b.parent ? `under ${b.parent}` : "",
375 (b.labels ?? []).length > 0 ? `labels ${b.labels!.join(", ")}` : "",
376 b.description ? "a description" : "",
377 ].filter((m) => m !== "");
378 return ` draft ${d.id}: ${b.title ? q(b.title) : "(no title yet)"}${more.length > 0 ? ` (${more.join("; ")})` : ""}, saved ${shortWhen(d.saved)}`;
381/**
382 * Drafts (abso issue 3): an issue not opened yet, this agent's alone, with no
383 * number and no news. `abso issue draft "<title>" [fields]` saves a new one;
384 * `abso issue draft <D> [fields]` changes one; --open opens it as an issue;
385 * --delete deletes it. `abso issues --drafts` lists them.
386 */
387async function runDraft(api: Api, args: Parsed, words: string[]): Promise<Output> {
388 const [d, ...more] = words;
389 if (d !== undefined && /^\d+$/.test(d) && more.length === 0) {
390 const id = Number(d);
391 if (bool(args, "delete") && bool(args, "open")) throw new UsageError("--open or --delete, not both");
392 if (bool(args, "delete")) {
393 await api.deleteDraft(id);
394 return { text: `Deleted draft ${id}.`, json: { draft: id, deleted: true } };
395 }
396 if (bool(args, "open")) {
397 const r = await api.openDraft(id, openFields(args, ""));
398 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).Compare399 text: `Opened draft ${id} as issue ${r.id}. abso start "..." --issue ${r.id} starts on it.`,
init0Start the project400 json: { draft: id, id: r.id },
401 };
402 }
403 // Saving replaces the draft's body, so the fields given go over what it holds.
404 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).Compare405 if (!found) throw new UsageError(`you have no draft ${id}; abso issues --drafts lists yours`);
init0Start the project406 await api.saveDraft({ ...found.body, ...openFields(args, ""), id });
407 return { text: `Saved draft ${id}.`, json: { draft: id } };
408 }
409 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).Compare410 throw new UsageError("--open and --delete take a draft's number: abso issue draft <D> --open");
init0Start the project411 const r = await api.saveDraft(openFields(args, words.join(" ")));
412 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).Compare413 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 project414 json: { draft: r.id },
415 };
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.Compare418/** The flags --copy-to goes with: anything else on the same command is refused, so a copy is never half an edit. */
419const COPY_FLAGS = new Set(["copy-to", "clean", "dry-run"]);
421/** abso issue <N> --copy-to <project>: the server reads the issue and writes the copy. */
422async function runCopy(api: Api, id: number, to: string, args: Parsed, env: Env): Promise<Output> {
423 const other = [...args.flags.keys()].filter((f) => !COPY_FLAGS.has(f) && f !== "json");
424 if (other.length > 0)
425 throw new UsageError(`--copy-to goes alone (with --clean and --dry-run), not with --${other[0]}`);
426 if (to === api.config.project)
427 throw new UsageError(`issue ${id} is already in ${to}; --copy-to names another project`);
428 const clean = str(args, "clean");
429 const texts = clean === undefined ? {} : readClean(resolve(env.cwd, clean), clean);
430 const dryRun = bool(args, "dry-run");
431 const from = api.config.project;
432 let answer: CopyAnswer;
433 try {
434 answer = await api.issueCopy(to, { ...texts, from, issue: id, ...(dryRun ? { dryRun: true } : {}) });
435 } catch (e) {
436 if (e instanceof ApiError && e.status === 403 && !dryRun)
437 throw new ApiError(`${e.message}. --dry-run still shows what would go.`, e.status);
438 throw e;
439 }
440 if ("dryRun" in answer) {
441 const p = answer.plan;
442 const edited = (list: { edited: boolean }[]) => list.filter((x) => x.edited).length;
443 const lines = [
444 `A dry run: nothing was written. Copying ${from} issue ${id} into ${to} would make:`,
445 ` ${q(p.title)}${p.closed ? `, ${p.closed.how}` : ""}${p.edited.length > 0 ? ` (${p.edited.join(" and ")} edited when copied)` : ""}`,
446 ` ${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(", ")}` : ""}`,
447 ...skippedLines(p.skipped),
448 `Run it again without --dry-run to copy it.`,
449 ];
450 return { text: lines.join("\n"), json: answer };
451 }
452 return {
453 text: [
454 `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.`,
455 ...skippedLines(answer.skipped),
456 ].join("\n"),
457 json: answer,
458 };
461function skippedLines(skipped: { comments: number[]; asks: number[] }): string[] {
462 const parts = [
463 ...(skipped.comments.length > 0 ? [`comments ${skipped.comments.join(", ")}`] : []),
464 ...(skipped.asks.length > 0 ? [`asks ${skipped.asks.join(", ")}`] : []),
465 ];
466 return parts.length > 0 ? [` not copied: ${parts.join("; ")} (open asks, and what --clean left out)`] : [];
469/** --clean's file: cleaned texts by source id. The server checks each id against the issue it reads. */
470function readClean(path: string, given: string): Omit<CopyBody, "from" | "issue"> {
471 let raw: unknown;
472 try {
473 raw = JSON.parse(readFileSync(path, "utf8"));
474 } catch (e) {
475 throw new UsageError(
476 `--clean ${given}: ${(e as NodeJS.ErrnoException).code === "ENOENT" ? "no such file" : "not JSON"}`,
477 );
478 }
479 if (typeof raw !== "object" || raw === null || Array.isArray(raw))
480 throw new UsageError(`--clean ${given}: a JSON object with title, description, comments or asks`);
481 const known = new Set(["title", "description", "comments", "asks"]);
482 const unknown = Object.keys(raw).filter((k) => !known.has(k));
483 if (unknown.length > 0)
484 throw new UsageError(`--clean ${given}: ${unknown[0]} isn't one of title, description, comments, asks`);
485 return raw as Omit<CopyBody, "from" | "issue">;
init0Start the project488export async function runIssue(args: Parsed, env: Env): Promise<Output> {
489 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.Compare490 const { root, api } = openIssues(env);
491 const saveTo = str(args, "save-attachments");
492 if (saveTo !== undefined) {
493 const other = [...args.flags.keys()].filter((f) => f !== "save-attachments" && f !== "json");
494 if (other.length > 0 || first === "new" || first === "draft")
495 throw new UsageError(
496 `--save-attachments goes alone with an issue number: abso issue <N> --save-attachments <folder>${other.length > 0 ? `, not with --${other[0]}` : ""}`,
497 );
498 }
init0Start the project499 if (first === "draft") return runDraft(api, args, rest);
500 if (first === "new") {
501 if (rest.length === 0)
502 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).Compare503 '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 project504 );
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).Compare505 const fields = { ...openFields(args, rest.join(" ")), title: rest.join(" ") };
506 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
507 const r = await api.issueOpen({ ...fields, ...(attachments.length > 0 ? { attachments } : {}) });
508 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).Compare509 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).Compare510 json: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}) },
511 };
init0Start the project512 }
513 if (first === undefined || rest.length > 0)
514 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).Compare515 'abso issue <N> [--comment "..." | --object "..." | --drop | --reopen | --done [--done-by <version>] | an edit], or abso issue new "<title>"',
init0Start the project516 );
517 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.Compare518 const copyTo = str(args, "copy-to");
519 if (copyTo !== undefined) return runCopy(api, id, copyTo, args, env);
520 if (str(args, "clean") !== undefined || bool(args, "dry-run"))
521 throw new UsageError("--clean and --dry-run go with --copy-to <project>");
init0Start the project522 const comment = str(args, "comment");
523 const object = str(args, "object");
524 const doneBy = str(args, "done-by");
525 const markingDone = bool(args, "done") || doneBy !== undefined;
526 const edits = ["title", "description", "parent", "agent", "blocked-by", "label", "unlabel"].filter(
527 (f) => str(args, f) !== undefined,
528 );
529 if (
530 [
531 comment !== undefined,
532 object !== undefined,
533 bool(args, "drop"),
534 bool(args, "reopen"),
535 markingDone,
536 edits.length > 0,
537 ].filter(Boolean).length > 1
538 )
539 throw new UsageError("one of --comment, --object, --drop, --reopen, --done or an edit at a time");
540 if (edits.length > 0) {
541 const parent = str(args, "parent");
542 const agent = str(args, "agent");
543 const blockedBy = str(args, "blocked-by");
544 const r = await api.issueEdit(id, {
545 ...(str(args, "title") !== undefined ? { title: str(args, "title")! } : {}),
546 ...(str(args, "description") !== undefined ? { description: str(args, "description")! } : {}),
547 ...(parent !== undefined ? { parent: parent === "none" ? null : issueNumber(parent, "--parent") } : {}),
548 ...(agent !== undefined ? { agent: agent === "none" ? null : agent } : {}),
549 ...(blockedBy !== undefined ? { blockedBy: listOf(blockedBy).map((b) => issueNumber(b, "--blocked-by")) } : {}),
550 ...(bool(args, "quiet") ? { notify: false } : {}),
551 ...(str(args, "notify") !== undefined ? { also: listOf(str(args, "notify")!) } : {}),
552 ...(str(args, "label") !== undefined ? { addLabels: labelList(str(args, "label")!) } : {}),
553 ...(str(args, "unlabel") !== undefined ? { removeLabels: labelList(str(args, "unlabel")!) } : {}),
554 // A labels-only edit tells nobody unless --notify names people.
555 ...(edits.every((f) => f === "label" || f === "unlabel") && str(args, "notify") !== undefined
556 ? { notify: true }
557 : {}),
558 });
559 return {
560 text: `Edited issue ${id}. ${r.notified.length > 0 ? `Told ${r.notified.join(", ")}.` : "Told nobody."}`,
561 json: { issue: id, edit: r.edit, notified: r.notified },
562 };
563 }
564 if (bool(args, "quiet") || str(args, "notify") !== undefined)
565 throw new UsageError(
566 "--quiet and --notify go with an edit (--title, --description, --parent, --agent, --blocked-by, --label or --unlabel)",
567 );
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).Compare568 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).Compare569 throw new UsageError("--attach goes with abso issue new or --comment (or --object)");
init0Start the project570 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).Compare571 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
572 const r = await api.issueComment(id, (comment ?? object)!, object !== undefined, attachments);
init0Start the project573 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).Compare574 text: `${object !== undefined ? "Objected" : "Commented"} on issue ${id}${attachments.length > 0 ? ` with ${plural(attachments.length, "attachment")} (${attachments.join(", ")})` : ""}. Its agents hear it.`,
575 json: { id: r.id, issue: id, ...(attachments.length > 0 ? { attachments } : {}) },
init0Start the project576 };
577 }
578 if (bool(args, "drop")) {
579 await api.issueDrop(id);
580 return { text: `Dropped issue ${id}.`, json: { issue: id, dropped: true } };
581 }
582 if (bool(args, "reopen")) {
583 await api.issueReopen(id);
584 return { text: `Reopened issue ${id}.`, json: { issue: id, reopened: true } };
585 }
586 if (markingDone) {
587 let version: number | null = null;
588 if (doneBy !== undefined) {
589 version = issueNumber(doneBy, "--done-by");
590 if (version < 1) throw new UsageError("--done-by is a published version, 1 or more");
591 try {
592 await api.show(version, { draft: null });
593 } catch {
594 throw new UsageError(`no version ${version}`);
595 }
596 }
597 await api.issueDone(id, version);
598 return {
599 text: version === null ? `Marked issue ${id} done.` : `Marked issue ${id} done in version ${version}.`,
600 json: { issue: id, done: true, ...(version !== null ? { version } : {}) },
601 };
602 }
603 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.Compare604 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).Compare605 return { text: issuePage(page, api).join("\n"), json: { ...page } };
init0Start the project606}
608export 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).Compare609 const withdraw = str(args, "withdraw");
610 if (withdraw !== undefined) return withdrawAsk(args, env, withdraw);
611 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).Compare612 throw new UsageError('--note goes with --withdraw: abso ask --withdraw <ask> --note "why"');
init0Start the project613 const [of, ...words] = args.positionals;
614 if (of === undefined || words.length === 0)
615 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).Compare616 '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 project617 );
618 const { api } = openIssues(env);
619 if (bool(args, "review") && bool(args, "task")) throw new UsageError("an ask is a review or a task, not both");
620 const issue = str(args, "issue");
621 const blocks = str(args, "blocks");
622 const options = str(args, "options");
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.Compare623 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
init0Start the project624 const r = await api.ask({
625 of,
626 question: words.join(" "),
627 ...(issue !== undefined ? { issue: issueNumber(issue, "--issue") } : {}),
628 ...(bool(args, "review") ? { review: true } : {}),
629 ...(bool(args, "task") ? { kind: "task" as const } : {}),
630 ...(str(args, "due") ? { due: str(args, "due")! } : {}),
631 ...(blocks !== undefined ? { blocks: blocks.split(",").map((b) => issueNumber(b.trim(), "--blocks")) } : {}),
632 ...(options !== undefined
633 ? {
634 options: options
635 .split("|")
636 .map((o) => o.trim())
637 .filter((o) => o !== ""),
638 }
639 : {}),
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.Compare640 ...(attachments.length > 0 ? { attachments } : {}),
init0Start the project641 });
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.Compare642 const lost = notKept(attachments, r.attachments, `ask ${r.id}`);
643 return {
644 text: `Asked ${of} (ask ${r.id})${withFiles(attachments)}. They hear it; abso waiting shows what's open.${lost ? ` ${lost}` : ""}`,
645 json: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}), ...(lost ? { notKept: lost } : {}) },
646 };
init0Start the project647}
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).Compare649/** 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).Compare650async function withdrawAsk(args: Parsed, env: Env, word: string): Promise<Output> {
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.Compare651 const others = ["issue", "due", "blocks", "options", "attach"].filter((f) => str(args, f) !== undefined);
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).Compare652 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).Compare653 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).Compare654 const id = issueNumber(word, "the ask number");
655 const { api } = openIssues(env);
656 const note = str(args, "note");
657 const r = await api.withdraw(id, note !== undefined ? { note } : {});
658 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.Compare659}
661/** One search hit as two lines: the issue, then where it matched and the words around it. */
662export function searchLines(h: IssueSearchHit): string[] {
663 const where = h.meaning ? "by meaning" : h.where === "comment" ? `in comment ${h.comment}` : `in the ${h.where}`;
664 const words = h.snippet
665 .replace(/[\u0001\u0002]/g, "")
666 .replace(/\s+/g, " ")
667 .trim();
668 return [
669 ` ${String(h.issue.id).padStart(3)} ${h.issue.status.padEnd(11)} ${q(h.issue.title)}`,
670 ` ${where}${words && words !== h.issue.title ? `: ${q(words)}` : ""}`,
671 ];
674export async function runSearch(args: Parsed, env: Env): Promise<Output> {
675 const words = args.positionals.join(" ").trim();
676 if (words === "") throw new UsageError('search needs words: abso search "<words>" [--limit <N>]');
677 const limitWord = str(args, "limit");
678 const limit = limitWord === undefined ? undefined : Number(limitWord);
679 if (limit !== undefined && !(Number.isInteger(limit) && limit >= 1 && limit <= 50))
680 throw new UsageError("--limit is a number from 1 to 50");
681 const { api } = openIssues(env);
682 const { hits } = await api.issueSearch(words, limit);
683 return {
684 text:
685 hits.length === 0
686 ? `Nothing matches ${q(words)}.`
687 : [
688 `${plural(hits.length, "issue")} for ${q(words)}, best first:`,
689 ...hits.flatMap(searchLines),
690 "abso issue <N> shows one.",
691 ].join("\n"),
692 json: { hits },
693 };
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).Compare694}
init0Start the project696export async function runWaiting(args: Parsed, env: Env): Promise<Output> {
697 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).Compare698 throw new UsageError("waiting takes no words: abso waiting [--of <agent or person:id>] [--mine]");
init0Start the project699 const { api, config } = openIssues(env);
700 const mine = bool(args, "mine") || str(args, "of") === config.agent;
701 const of = mine ? config.agent : str(args, "of");
pinch36waiting --mine lists your publishes still in the merge queue: where each stands (being checked, or how many wait ahead of it), whether the queue is paused, and that the outcome comes as news; --json carries them as queued. A server without a queue, or one that can't be read, leaves them out rather than failing the asks.Compare702 // With --mine, your own publishes still in the merge queue are open work too. A server without a queue,
703 // or one that can't be read now, leaves them out rather than failing the asks.
704 const [{ asks }, queue] = await Promise.all([
705 mine ? api.waitingMine() : api.waiting(of),
706 mine ? api.queueState().catch(() => undefined) : undefined,
707 ]);
708 const queued = queuedLines(queue, config.agent);
709 const yours = (queue?.items ?? []).filter((q) => q.agent === config.agent);
init0Start the project710 return {
pinch36waiting --mine lists your publishes still in the merge queue: where each stands (being checked, or how many wait ahead of it), whether the queue is paused, and that the outcome comes as news; --json carries them as queued. A server without a queue, or one that can't be read, leaves them out rather than failing the asks.Compare711 text: [
712 ...queued,
713 ...(asks.length === 0
714 ? [queued.length > 0 ? `No open asks of ${of}.` : `Nothing is waiting${of ? ` on ${of}` : ""}.`]
init0Start the project715 : [
716 `${plural(asks.length, "open ask")}${of ? ` of ${of}` : ""}, soonest due first:`,
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.Compare717 ...asks.map((a) => askLine(a, api)),
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).Compare718 'abso answer <ask> "..." answers one asked of you.',
pinch36waiting --mine lists your publishes still in the merge queue: where each stands (being checked, or how many wait ahead of it), whether the queue is paused, and that the outcome comes as news; --json carries them as queued. A server without a queue, or one that can't be read, leaves them out rather than failing the asks.Compare719 ]),
720 ].join("\n"),
721 json: {
722 asks,
723 ...(yours.length > 0
724 ? { queued: yours.map((q) => ({ id: q.id, message: q.message, standing: standing(queue!.items, q.id) })) }
725 : {}),
726 },
init0Start the project727 };
730export async function runAnswer(args: Parsed, env: Env): Promise<Output> {
731 const [first, ...words] = args.positionals;
732 const id = issueNumber(first, "the ask number");
733 const option = str(args, "option");
734 const done = bool(args, "done");
735 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).Compare736 throw new UsageError('abso answer <ask> "<words>" | --option <N> [--note "..."] | --done [--note "..."]');
init0Start the project737 const { api } = openIssues(env);
738 const note = str(args, "note");
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.Compare739 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
init0Start the project740 const r = await api.answer(id, {
741 ...(words.length > 0 ? { words: words.join(" ") } : {}),
742 ...(option !== undefined ? { option: /^\d+$/.test(option) ? Number(option) - 1 : option } : {}),
743 ...(done ? { done: true } : {}),
744 ...(note !== undefined ? { note } : {}),
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.Compare745 ...(attachments.length > 0 ? { attachments } : {}),
init0Start the project746 });
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.Compare747 const lost = notKept(
748 attachments,
749 r.ask.answer?.attachments?.map((a) => a.id),
750 `your answer to ask ${id}`,
751 );
752 return {
753 text: `Answered ask ${id}${withFiles(attachments)}. ${r.ask.by} hears it.${lost ? ` ${lost}` : ""}`,
754 json: { ask: r.ask, ...(lost ? { notKept: lost } : {}) },
755 };
init0Start the project756}