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 100 --json
JSON
/christopher/abso-core/blame/client/src/issues.ts?version=100&format=json
958 linespinch 51% · First import 41% · devops 4% · review 3% · infra-split 2% · rename 1%Last change rename in version 100,

958 lines from 24 changes in 17 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";
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare30import type { AskReply } from "./issues-wire.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.Compare31import { queuedLines, standing } from "./queue.ts";
init0Start the project32import { seenText, shortWhen } from "./times.ts";
34const q = (s: string): string => JSON.stringify(s);
36/** 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.Compare37function openIssues(env: Env): { root: string; config: Config; api: Api } {
38 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)Compare39 const server = fromEnv(env.env, "ISSUES_SERVER") || issuesServerFor(config.server, readMachineServers(env.env));
init0Start the project40 if (server === undefined)
41 throw new UsageError(
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare42 `${config.server} has no Issues Worker beside it that abso knows; ~/.abso/servers.json or ABSO_ISSUES_SERVER names one`,
init0Start the project43 );
44 if (config.token !== undefined && !tokenGoesTo(server, trustedServers(env.env))) {
45 throw new UsageError(
review27Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)Compare46 `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 project47 );
48 }
49 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.Compare50 return { root, config, api };
init0Start the project51}
53function issueNumber(word: string | undefined, what = "an issue number"): number {
54 if (word === undefined || !/^#?\d+$/.test(word)) throw new UsageError(`${what} is a number, like 12`);
55 return Number(word.replace("#", ""));
58/** One issue as a line. */
59export function issueLine(i: IssueRow): string {
60 const detail = [
61 i.agent !== null && !i.agents.includes(i.agent) ? `for ${i.agent}` : "",
62 i.agents.length > 0 ? i.agents.join(", ") : "",
63 i.blockedBy.length > 0 ? `blocked by ${i.blockedBy.join(", ")}` : "",
64 (i.labels ?? []).length > 0 ? `labels ${i.labels.join(", ")}` : "",
65 i.versions.length > 0 ? `${i.versions.length === 1 ? "version" : "versions"} ${i.versions.join(", ")}` : "",
66 i.waitingOn.length > 0 ? `waiting on ${i.waitingOn.join(", ")}` : "",
67 i.parent !== null ? `under ${i.parent}` : "",
68 i.children > 0 ? plural(i.children, "sub-issue") : "",
69 `updated ${shortWhen(i.updated)}`,
70 ].filter((d) => d !== "");
71 return ` ${String(i.id).padStart(3)} ${i.status.padEnd(11)} ${q(i.title)}${detail.length > 0 ? ` (${detail.join("; ")})` : ""}`;
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare74/** The first line of a reply, for lists; abso ask <N> shows it whole. */
75const firstLine = (text: string): string => {
76 const line = text.split("\n")[0]!;
77 return line.length < text.length ? `${line} ...` : line;
78};
80/** One reply in an ask's thread. */
81function replyLine(r: AskReply, indent: string, whole: boolean): string {
82 return `${indent}${r.by}, ${shortWhen(r.at)}${r.question ? ", a question" : ""}: ${q(whole ? r.text : firstLine(r.text))}`;
85/**
86 * An ask: its head line, its files and options, then, in a list, its newest reply, or with `thread`, every
87 * reply, oldest first; then its answer. Older servers send no thread, only the one asked's acknowledgement.
88 */
89function askLine(a: Ask & { title?: string | null }, api?: Pick<Api, "attachmentUrl">, thread = false): string {
init0Start the project90 const what = a.review ? "a review" : a.kind === "task" ? "a task" : "a question";
91 const where = a.issue === null ? "" : ` on issue ${a.issue}${a.title ? ` (${q(a.title)})` : ""}`;
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare92 const replies = a.replies;
init0Start the project93 const extra = [
94 // 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).Compare95 a.answer
96 ? `${a.outcome === "withdrawn" ? "withdrawn" : "answered"} by ${a.answer.by}, ${shortWhen(a.answer.at)}`
97 : "",
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare98 !a.answer && a.ack && replies === undefined ? `acknowledged ${shortWhen(a.ack.at)}, not answered yet` : "",
pinch53abso ack <ask> ["note"]: the one asked says they have an ask and will answer later. The ask stays open and keeps blocking; abso issue shows it as acknowledged with the note, and the asker hears it. The Ask wire type gains ack, the API client gains ack(), and the skill mentions the command.Compare99 !a.answer && !a.ack && a.seen !== undefined ? seenText(a.seen) : "",
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare100 replies && replies.length > 0 ? (replies.length === 1 ? "1 reply" : `${replies.length} replies`) : "",
101 // Whose turn it is, when it isn't the one asked's: they asked something back.
102 !a.answer && a.waitingOn && a.waitingOn !== a.of ? `waiting on ${a.waitingOn}` : "",
init0Start the project103 a.due ? `due ${a.due}` : "",
104 a.blocks.length > 0 ? `blocks ${a.blocks.join(", ")}` : "",
105 ].filter((x) => x !== "");
106 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.Compare107 const lines = [head, ...attachmentLines(api, a.attachments, " ")];
init0Start the project108 if (a.options.length > 0) lines.push(` options: ${a.options.map((o, i) => `${i + 1}. ${q(o)}`).join(", ")}`);
109 if (a.recommendation) lines.push(` ${a.recommendation.by} recommends: ${q(a.recommendation.text)}`);
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare110 if (replies === undefined) {
111 if (!a.answer && a.ack && a.ack.note !== "") lines.push(` ${a.of} acknowledged: ${q(a.ack.note)}`);
112 } else if (thread) lines.push(...replies.map((r) => replyLine(r, " ", true)));
113 else if (replies.length > 0) lines.push(replyLine(replies[replies.length - 1]!, " last: ", false));
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).Compare114 if (a.answer && a.outcome === "withdrawn") {
115 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.Compare116 } else if (a.answer)
117 lines.push(` answer: ${q(a.answer.words)}`, ...attachmentLines(api, a.answer.attachments, " "));
init0Start the project118 return lines.join("\n");
121/** One edit in an issue's activity: what changed, and who was told. */
122function editLine(e: IssuePage["edits"][number]): string {
123 const c = e.changes;
124 const said = [
125 c.title ? `title ${q(String(c.title.from))} to ${q(String(c.title.to))}` : "",
126 c.description ? "the description" : "",
127 c.parent ? (c.parent.to === null ? "no parent" : `parent issue ${String(c.parent.to)}`) : "",
128 c.agent ? (c.agent.to === null ? "no Agent" : `Agent ${String(c.agent.to)}`) : "",
129 c.blockedBy
130 ? (c.blockedBy.to as number[]).length === 0
131 ? "blocked by nothing"
132 : `blocked by ${(c.blockedBy.to as number[]).join(", ")}`
133 : "",
134 c.labels
135 ? (c.labels.to as string[]).length === 0
136 ? "no labels"
137 : `labels ${(c.labels.to as string[]).join(", ")}`
138 : "",
139 ].filter((x) => x !== "");
140 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.Compare143/** Labels as typed, lower-cased, since the Worker refuses upper case: --label Friction means friction. */
init0Start the project144function labelList(value: string): string[] {
145 return listOf(value).map((l) => l.toLowerCase());
148/** A comma-separated list of names or issue numbers; "none" is the empty list. */
149function listOf(value: string): string[] {
150 return value.trim() === "none"
151 ? []
152 : value
153 .split(",")
154 .map((v) => v.trim())
155 .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.Compare158/** " with 2 attachments (a…, a…)" after a write that carried some; nothing otherwise. */
159function withFiles(ids: readonly string[]): string {
160 return ids.length > 0 ? ` with ${plural(ids.length, "attachment")} (${ids.join(", ")})` : "";
163/**
164 * What to say when a write sent files the server didn't keep: an Issues server from before asks carried
165 * attachments takes the words and leaves the files out. Nothing to say when it kept them, or none were sent.
166 */
167function notKept(sent: readonly string[], kept: readonly string[] | undefined, what: string): string | undefined {
168 if (sent.length === 0 || (kept !== undefined && sent.every((id) => kept.includes(id)))) return undefined;
169 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).Compare172/** The most one attachment may be: the Issues Worker's cap, checked here before sending (abso issue 171). */
173const ATTACH_MAX = 10 * 1024 * 1024;
175/** Uploads each file --attach names (comma-separated), in order, and answers their ids. Nothing is sent if a file is missing or too big. */
176async function uploadAttachments(api: Api, cwd: string, value: string | undefined): Promise<string[]> {
177 if (value === undefined) return [];
178 const paths = listOf(value);
179 if (paths.length === 0) throw new UsageError("--attach names files, comma-separated: --attach shot.png,after.png");
180 const files = paths.map((p) => {
181 const full = resolve(cwd, p);
182 let size: number;
183 try {
184 size = statSync(full).size;
185 } catch {
186 throw new UsageError(`--attach ${p}: no such file`);
187 }
188 if (size > ATTACH_MAX)
189 throw new UsageError(`--attach ${p} is ${sizeText(size)}; one attachment is at most ${sizeText(ATTACH_MAX)}`);
190 return { full, name: basename(full) };
191 });
192 const ids: string[] = [];
193 for (const f of files) ids.push((await api.attachmentUpload(readFileSync(f.full), f.name)).id);
194 return ids;
197function sizeText(n: number): string {
198 return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${Math.round(n / 1024)} KB` : `${(n / (1024 * 1024)).toFixed(1)} MB`;
201/** Attachments as lines under what carries them: name, size and where it's served. */
202function attachmentLines(
203 api: Pick<Api, "attachmentUrl"> | undefined,
204 files: readonly Attachment[] | undefined,
205 indent: string,
206): 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.Compare207 return (files ?? []).flatMap((a) => [
208 `${indent}attached ${a.id}: ${q(a.name)}, ${sizeText(a.size)}${api ? `, ${api.attachmentUrl(a.id)}` : ""}`,
209 // An SVG is shown as the PNG drawn from it; its own file is a download beside it.
210 ...(a.source
211 ? [
212 `${indent} drawn from ${q(a.source.name)}, ${sizeText(a.source.size)}${api ? `, ${api.attachmentUrl(a.id)}/source` : ""}`,
213 ]
214 : []),
215 ]);
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.Compare216}
218/** A saved attachment's file name: its id, then its own name with anything but letters, digits, . - _ made _. */
219export function savedName(id: string, name: string): string {
220 const own = (name.split(/[\\/]/).pop() ?? "")
221 .replace(/[^A-Za-z0-9._-]/g, "_")
222 .replace(/^\.+/, "_")
223 .slice(0, 100);
224 return `${id}-${own || "file"}`;
227/**
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.Compare228 * abso issue N --save-attachments <folder>: every attachment on the issue, its
229 * 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.Compare230 * beside the png drawn from it. Not into the abso folder unless abso leaves
231 * that place out, or the images would be recorded as edits.
232 */
233async function saveAttachments(api: Api, root: string, cwd: string, dir: string, page: IssuePage): Promise<Output> {
234 const target = resolve(cwd, dir);
235 const inside = target === resolve(root) ? "" : relativeTo(root, target);
236 if (inside !== undefined && (inside === "" || !ignoredHere(loadIgnore(root), inside, true)))
237 throw new UsageError(
238 `${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`,
239 );
240 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.Compare241 const all = [
242 ...(page.issue.attachments ?? []),
243 ...page.comments.flatMap((c) => c.attachments ?? []),
244 ...page.asks.flatMap((a) => [...(a.attachments ?? []), ...(a.answer?.attachments ?? [])]),
245 ].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.Compare246 if (all.length === 0)
247 return {
248 text: `Issue ${page.issue.id} has no attachments.`,
249 json: { issue: page.issue.id, folder: target, files: [] },
250 };
251 mkdirSync(target, { recursive: true });
252 const files: { id: string; path: string; size: number }[] = [];
253 for (const a of all) {
254 const wanted = [{ name: a.name, source: false }, ...(a.source ? [{ name: a.source.name, source: true }] : [])];
255 for (const w of wanted) {
256 const bytes = await api.attachmentBytes(a.id, w.source, ATTACH_MAX);
257 const path = join(target, savedName(a.id, w.name));
258 writeFileSync(path, bytes);
259 files.push({ id: a.id, path, size: bytes.length });
260 }
261 }
262 return {
263 text: [
264 `Saved ${plural(files.length, "file")} from issue ${page.issue.id} to ${target}:`,
265 ...files.map((f) => ` ${basename(f.path)}, ${sizeText(f.size)}`),
266 ].join("\n"),
267 json: { issue: page.issue.id, folder: target, files },
268 };
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).Compare269}
init0Start the project271/** 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).Compare272export function issuePage(p: IssuePage, api?: Pick<Api, "attachmentUrl">): string[] {
init0Start the project273 const i = p.issue;
274 const facts = [
275 i.parent !== null ? `Under issue ${i.parent}.` : "",
276 `Opened by ${i.opened.by}, ${shortWhen(i.opened.at)}.`,
277 i.agent !== null ? `Agent: ${i.agent}.` : "",
278 i.agents.length > 0 ? `Working on it: ${i.agents.join(", ")}.` : "",
279 i.blockedBy.length > 0 ? `Blocked by: issue${i.blockedBy.length === 1 ? "" : "s"} ${i.blockedBy.join(", ")}.` : "",
280 (i.labels ?? []).length > 0 ? `Labels: ${i.labels.join(", ")}.` : "",
281 i.versions.length > 0 ? `Versions: ${i.versions.join(", ")}.` : "",
282 i.waitingOn.length > 0 ? `Waiting on: ${i.waitingOn.join(", ")}.` : "",
283 i.closed
284 ? `${i.closed.how === "done" ? "Done" : "Dropped"} by ${i.closed.by}${i.closed.version !== null ? ` in version ${i.closed.version}` : ""}, ${shortWhen(i.closed.at)}.`
285 : "",
286 ].filter((f) => f !== "");
pinch47abso issue: say how to read attached files before their links An issue page lists each attachment with a link, but the link opens only for people signed in on the website; an agent that fetched it was refused and didn't know where else to look. When the issue, its comments, or its asks and answers carry files, the page now says so under the title, with the way in: "3 files are attached below. To read them: abso issue 7 --save-attachments <folder> saves every one there, then open the files. The links are for people signed in on the website." The abso skill gets the same as a line under "Issues and asks", in SKILL.md and in the copy the client carries. Tests in attach.test.ts cover the count across the issue, comments, questions and answers, and a page with no files saying nothing.Compare287 // The links below open for people signed in on the website; an agent's fetch of one is refused. Say the way in
288 // before the first link, so an agent reads the files instead of hunting for them.
289 const files =
290 (i.attachments ?? []).length +
291 p.comments.reduce((n, c) => n + (c.attachments ?? []).length, 0) +
292 p.asks.reduce((n, a) => n + (a.attachments ?? []).length + (a.answer?.attachments ?? []).length, 0);
init0Start the project293 return [
294 `Issue ${i.id}: ${q(i.title)} [${i.status}]`,
295 facts.join(" "),
pinch47abso issue: say how to read attached files before their links An issue page lists each attachment with a link, but the link opens only for people signed in on the website; an agent that fetched it was refused and didn't know where else to look. When the issue, its comments, or its asks and answers carry files, the page now says so under the title, with the way in: "3 files are attached below. To read them: abso issue 7 --save-attachments <folder> saves every one there, then open the files. The links are for people signed in on the website." The abso skill gets the same as a line under "Issues and asks", in SKILL.md and in the copy the client carries. Tests in attach.test.ts cover the count across the issue, comments, questions and answers, and a page with no files saying nothing.Compare296 ...(files > 0
297 ? [
298 `${files === 1 ? "1 file is" : `${files} files are`} attached below. To read ${files === 1 ? "it" : "them"}: abso issue ${i.id} --save-attachments <folder> saves ${files === 1 ? "it" : "every one"} there, then open the files. The links are for people signed in on the website.`,
299 ]
300 : []),
init0Start the project301 ...(i.lines ? [`From ${i.lines.file} lines ${i.lines.from}-${i.lines.to} at version ${i.lines.version}.`] : []),
302 ...(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).Compare303 ...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.Compare304 ...(p.asks.length > 0 ? ["", "Asks:", ...p.asks.map((a) => askLine(a, api))] : []),
init0Start the project305 ...(p.comments.length > 0
306 ? [
307 "",
308 "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).Compare309 ...p.comments.flatMap((c) => [
310 ` ${c.by}${c.kind === "objection" ? " objects" : ""}, ${shortWhen(c.at)}: ${q(c.text)}`,
311 ...attachmentLines(api, c.attachments, " "),
312 ]),
init0Start the project313 ]
314 : []),
315 ...((p.edits ?? []).length > 0 ? ["", "Edits:", ...p.edits.map(editLine)] : []),
316 ...(p.children.length > 0 ? ["", "Sub-issues:", ...p.children.map(issueLine)] : []),
317 ...((i.watchers ?? []).length > 0 ? ["", `Watchers: ${i.watchers.join(", ")}.`] : []),
318 "",
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).Compare319 `abso start "..." --issue ${i.id} starts on it; abso issue ${i.id} --comment "..." comments; abso ask <who> "..." --issue ${i.id} asks.`,
init0Start the project320 ];
323export async function runIssues(args: Parsed, env: Env): Promise<Output> {
324 if (args.positionals.length > 0)
325 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).Compare326 "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 project327 );
328 const { api } = openIssues(env);
329 if (bool(args, "drafts")) {
330 const { drafts } = await api.drafts();
331 return {
332 text:
333 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).Compare334 ? 'No drafts. abso issue draft "<title>" saves one: only you see it, and nobody hears of it.'
init0Start the project335 : [
336 `${plural(drafts.length, "draft")}, newest first (only you see them):`,
337 ...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).Compare338 "abso issue draft <D> --open opens one as an issue; --delete deletes it.",
init0Start the project339 ].join("\n"),
340 json: { drafts },
341 };
342 }
343 if (bool(args, "labels")) {
344 const { labels } = await api.issueLabels();
345 return {
346 text:
347 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).Compare348 ? 'No labels yet. abso issue new "<title>" --label friction labels a new issue; abso issue <N> --label <l> labels one.'
init0Start the project349 : [
350 `${plural(labels.length, "label")} in use:`,
351 ...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).Compare352 "abso issues --label <label> lists a label's issues.",
init0Start the project353 ].join("\n"),
354 json: { labels },
355 };
356 }
357 const parent = str(args, "parent");
358 const filter = {
359 ...(str(args, "status") ? { status: str(args, "status")! } : {}),
360 ...(str(args, "agent") ? { agent: str(args, "agent")! } : {}),
361 ...(parent !== undefined ? { parent: issueNumber(parent, "--parent") } : {}),
362 ...(str(args, "label") !== undefined ? { labels: labelList(str(args, "label")!) } : {}),
363 open: bool(args, "open"),
364 };
365 const { issues } = await api.issues(filter);
366 const scope = [
367 filter.open ? "open " : "",
368 filter.status ? `${filter.status} ` : "",
369 filter.labels ? `${filter.labels.join(", ")} ` : "",
370 ].join("");
371 return {
372 text:
373 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).Compare374 ? `No ${scope}issues${filter.agent ? ` for ${filter.agent}` : ""}${parent !== undefined ? ` under ${parent}` : ""}. abso issue new "<title>" opens one.`
init0Start the project375 : [
376 `${plural(issues.length, `${scope}issue`)}, most recently updated first:`,
377 ...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).Compare378 "abso issue <N> shows one.",
init0Start the project379 ].join("\n"),
380 json: { issues },
381 };
384/** A new issue's fields from the command line, as open and drafts take them; `title` only when words were given. */
385function openFields(args: Parsed, title: string): DraftBody {
386 const lines = str(args, "lines");
387 const at = lines === undefined ? undefined : /^(.+):(\d+)(?:-(\d+))?@(\d+)$/.exec(lines);
388 if (lines !== undefined && !at)
389 throw new UsageError("--lines is <file>:<from>-<to>@<version>, like src/a.ts:10-14@140");
390 const parent = str(args, "parent");
391 return {
392 ...(title !== "" ? { title } : {}),
393 ...(str(args, "description") ? { description: str(args, "description")! } : {}),
394 ...(parent !== undefined ? { parent: issueNumber(parent, "--parent") } : {}),
395 ...(at ? { lines: { file: at[1]!, from: Number(at[2]), to: Number(at[3] ?? at[2]), version: Number(at[4]) } } : {}),
396 ...(str(args, "agent") ? { agent: str(args, "agent")! } : {}),
397 ...(str(args, "blocked-by") !== undefined
398 ? { blockedBy: listOf(str(args, "blocked-by")!).map((b) => issueNumber(b, "--blocked-by")) }
399 : {}),
400 ...(str(args, "notify") !== undefined ? { notify: listOf(str(args, "notify")!) } : {}),
401 ...(str(args, "label") !== undefined ? { labels: labelList(str(args, "label")!) } : {}),
402 };
405/** One draft as a line: its number, title, and what else it holds. */
406function draftLine(d: Draft): string {
407 const b = d.body;
408 const more = [
409 b.agent ? `for ${b.agent}` : "",
410 b.parent ? `under ${b.parent}` : "",
411 (b.labels ?? []).length > 0 ? `labels ${b.labels!.join(", ")}` : "",
412 b.description ? "a description" : "",
413 ].filter((m) => m !== "");
414 return ` draft ${d.id}: ${b.title ? q(b.title) : "(no title yet)"}${more.length > 0 ? ` (${more.join("; ")})` : ""}, saved ${shortWhen(d.saved)}`;
417/**
418 * Drafts (abso issue 3): an issue not opened yet, this agent's alone, with no
419 * number and no news. `abso issue draft "<title>" [fields]` saves a new one;
420 * `abso issue draft <D> [fields]` changes one; --open opens it as an issue;
421 * --delete deletes it. `abso issues --drafts` lists them.
422 */
423async function runDraft(api: Api, args: Parsed, words: string[]): Promise<Output> {
424 const [d, ...more] = words;
425 if (d !== undefined && /^\d+$/.test(d) && more.length === 0) {
426 const id = Number(d);
427 if (bool(args, "delete") && bool(args, "open")) throw new UsageError("--open or --delete, not both");
428 if (bool(args, "delete")) {
429 await api.deleteDraft(id);
430 return { text: `Deleted draft ${id}.`, json: { draft: id, deleted: true } };
431 }
432 if (bool(args, "open")) {
433 const r = await api.openDraft(id, openFields(args, ""));
434 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).Compare435 text: `Opened draft ${id} as issue ${r.id}. abso start "..." --issue ${r.id} starts on it.`,
init0Start the project436 json: { draft: id, id: r.id },
437 };
438 }
439 // Saving replaces the draft's body, so the fields given go over what it holds.
440 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).Compare441 if (!found) throw new UsageError(`you have no draft ${id}; abso issues --drafts lists yours`);
init0Start the project442 await api.saveDraft({ ...found.body, ...openFields(args, ""), id });
443 return { text: `Saved draft ${id}.`, json: { draft: id } };
444 }
445 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).Compare446 throw new UsageError("--open and --delete take a draft's number: abso issue draft <D> --open");
init0Start the project447 const r = await api.saveDraft(openFields(args, words.join(" ")));
448 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).Compare449 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 project450 json: { draft: r.id },
451 };
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.Compare454/** The flags --copy-to goes with: anything else on the same command is refused, so a copy is never half an edit. */
455const COPY_FLAGS = new Set(["copy-to", "clean", "dry-run"]);
457/** abso issue <N> --copy-to <project>: the server reads the issue and writes the copy. */
458async function runCopy(api: Api, id: number, to: string, args: Parsed, env: Env): Promise<Output> {
459 const other = [...args.flags.keys()].filter((f) => !COPY_FLAGS.has(f) && f !== "json");
460 if (other.length > 0)
461 throw new UsageError(`--copy-to goes alone (with --clean and --dry-run), not with --${other[0]}`);
462 if (to === api.config.project)
463 throw new UsageError(`issue ${id} is already in ${to}; --copy-to names another project`);
464 const clean = str(args, "clean");
465 const texts = clean === undefined ? {} : readClean(resolve(env.cwd, clean), clean);
466 const dryRun = bool(args, "dry-run");
467 const from = api.config.project;
468 let answer: CopyAnswer;
469 try {
470 answer = await api.issueCopy(to, { ...texts, from, issue: id, ...(dryRun ? { dryRun: true } : {}) });
471 } catch (e) {
472 if (e instanceof ApiError && e.status === 403 && !dryRun)
473 throw new ApiError(`${e.message}. --dry-run still shows what would go.`, e.status);
474 throw e;
475 }
476 if ("dryRun" in answer) {
477 const p = answer.plan;
478 const edited = (list: { edited: boolean }[]) => list.filter((x) => x.edited).length;
479 const lines = [
480 `A dry run: nothing was written. Copying ${from} issue ${id} into ${to} would make:`,
481 ` ${q(p.title)}${p.closed ? `, ${p.closed.how}` : ""}${p.edited.length > 0 ? ` (${p.edited.join(" and ")} edited when copied)` : ""}`,
482 ` ${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(", ")}` : ""}`,
483 ...skippedLines(p.skipped),
484 `Run it again without --dry-run to copy it.`,
485 ];
486 return { text: lines.join("\n"), json: answer };
487 }
488 return {
489 text: [
490 `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.`,
491 ...skippedLines(answer.skipped),
492 ].join("\n"),
493 json: answer,
494 };
497function skippedLines(skipped: { comments: number[]; asks: number[] }): string[] {
498 const parts = [
499 ...(skipped.comments.length > 0 ? [`comments ${skipped.comments.join(", ")}`] : []),
500 ...(skipped.asks.length > 0 ? [`asks ${skipped.asks.join(", ")}`] : []),
501 ];
502 return parts.length > 0 ? [` not copied: ${parts.join("; ")} (open asks, and what --clean left out)`] : [];
505/** --clean's file: cleaned texts by source id. The server checks each id against the issue it reads. */
506function readClean(path: string, given: string): Omit<CopyBody, "from" | "issue"> {
507 let raw: unknown;
508 try {
509 raw = JSON.parse(readFileSync(path, "utf8"));
510 } catch (e) {
511 throw new UsageError(
512 `--clean ${given}: ${(e as NodeJS.ErrnoException).code === "ENOENT" ? "no such file" : "not JSON"}`,
513 );
514 }
515 if (typeof raw !== "object" || raw === null || Array.isArray(raw))
516 throw new UsageError(`--clean ${given}: a JSON object with title, description, comments or asks`);
517 const known = new Set(["title", "description", "comments", "asks"]);
518 const unknown = Object.keys(raw).filter((k) => !known.has(k));
519 if (unknown.length > 0)
520 throw new UsageError(`--clean ${given}: ${unknown[0]} isn't one of title, description, comments, asks`);
521 return raw as Omit<CopyBody, "from" | "issue">;
init0Start the project524export async function runIssue(args: Parsed, env: Env): Promise<Output> {
525 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.Compare526 const { root, api } = openIssues(env);
527 const saveTo = str(args, "save-attachments");
528 if (saveTo !== undefined) {
529 const other = [...args.flags.keys()].filter((f) => f !== "save-attachments" && f !== "json");
530 if (other.length > 0 || first === "new" || first === "draft")
531 throw new UsageError(
532 `--save-attachments goes alone with an issue number: abso issue <N> --save-attachments <folder>${other.length > 0 ? `, not with --${other[0]}` : ""}`,
533 );
534 }
init0Start the project535 if (first === "draft") return runDraft(api, args, rest);
536 if (first === "new") {
537 if (rest.length === 0)
538 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).Compare539 '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 project540 );
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).Compare541 const fields = { ...openFields(args, rest.join(" ")), title: rest.join(" ") };
542 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
543 const r = await api.issueOpen({ ...fields, ...(attachments.length > 0 ? { attachments } : {}) });
544 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).Compare545 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).Compare546 json: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}) },
547 };
init0Start the project548 }
549 if (first === undefined || rest.length > 0)
550 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).Compare551 'abso issue <N> [--comment "..." | --object "..." | --drop | --reopen | --done [--done-by <version>] | an edit], or abso issue new "<title>"',
init0Start the project552 );
553 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.Compare554 const copyTo = str(args, "copy-to");
555 if (copyTo !== undefined) return runCopy(api, id, copyTo, args, env);
556 if (str(args, "clean") !== undefined || bool(args, "dry-run"))
557 throw new UsageError("--clean and --dry-run go with --copy-to <project>");
init0Start the project558 const comment = str(args, "comment");
559 const object = str(args, "object");
560 const doneBy = str(args, "done-by");
561 const markingDone = bool(args, "done") || doneBy !== undefined;
562 const edits = ["title", "description", "parent", "agent", "blocked-by", "label", "unlabel"].filter(
563 (f) => str(args, f) !== undefined,
564 );
565 if (
566 [
567 comment !== undefined,
568 object !== undefined,
569 bool(args, "drop"),
570 bool(args, "reopen"),
571 markingDone,
572 edits.length > 0,
573 ].filter(Boolean).length > 1
574 )
575 throw new UsageError("one of --comment, --object, --drop, --reopen, --done or an edit at a time");
576 if (edits.length > 0) {
577 const parent = str(args, "parent");
578 const agent = str(args, "agent");
579 const blockedBy = str(args, "blocked-by");
580 const r = await api.issueEdit(id, {
581 ...(str(args, "title") !== undefined ? { title: str(args, "title")! } : {}),
582 ...(str(args, "description") !== undefined ? { description: str(args, "description")! } : {}),
583 ...(parent !== undefined ? { parent: parent === "none" ? null : issueNumber(parent, "--parent") } : {}),
584 ...(agent !== undefined ? { agent: agent === "none" ? null : agent } : {}),
585 ...(blockedBy !== undefined ? { blockedBy: listOf(blockedBy).map((b) => issueNumber(b, "--blocked-by")) } : {}),
586 ...(bool(args, "quiet") ? { notify: false } : {}),
587 ...(str(args, "notify") !== undefined ? { also: listOf(str(args, "notify")!) } : {}),
588 ...(str(args, "label") !== undefined ? { addLabels: labelList(str(args, "label")!) } : {}),
589 ...(str(args, "unlabel") !== undefined ? { removeLabels: labelList(str(args, "unlabel")!) } : {}),
590 // A labels-only edit tells nobody unless --notify names people.
591 ...(edits.every((f) => f === "label" || f === "unlabel") && str(args, "notify") !== undefined
592 ? { notify: true }
593 : {}),
594 });
595 return {
596 text: `Edited issue ${id}. ${r.notified.length > 0 ? `Told ${r.notified.join(", ")}.` : "Told nobody."}`,
597 json: { issue: id, edit: r.edit, notified: r.notified },
598 };
599 }
600 if (bool(args, "quiet") || str(args, "notify") !== undefined)
601 throw new UsageError(
602 "--quiet and --notify go with an edit (--title, --description, --parent, --agent, --blocked-by, --label or --unlabel)",
603 );
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).Compare604 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).Compare605 throw new UsageError("--attach goes with abso issue new or --comment (or --object)");
init0Start the project606 if (comment !== undefined || object !== undefined) {
pinch96Issue comments over 4000 characters go up in parts: abso issue N --comment (or --comment-file) splits at paragraph breaks, else line breaks or spaces, marks each part (1/3), (2/3)..., never ends a part inside a code block it doesn't close, and puts attachments on the first part. An objection over the limit is refused before anything is sent. The help names the limit.Compare607 // Refused before anything goes up: an objection is one comment, and a part of one would read as a whole.
608 if (object !== undefined && object.length > COMMENT_MAX)
609 throw new UsageError(
610 `an objection holds up to ${COMMENT_MAX} characters, and this one has ${object.length}: say it shorter, and put the rest in a --comment`,
611 );
612 const parts = object !== undefined ? [object] : commentParts(comment!);
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).Compare613 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
pinch96Issue comments over 4000 characters go up in parts: abso issue N --comment (or --comment-file) splits at paragraph breaks, else line breaks or spaces, marks each part (1/3), (2/3)..., never ends a part inside a code block it doesn't close, and puts attachments on the first part. An objection over the limit is refused before anything is sent. The help names the limit.Compare614 const ids: number[] = [];
615 for (const [i, part] of parts.entries()) {
616 // The attachments go on the first part, which the rest follow.
617 ids.push((await api.issueComment(id, part, object !== undefined, i === 0 ? attachments : [])).id);
618 }
619 const inParts = parts.length > 1 ? ` in ${parts.length} parts (comments ${ids.join(", ")})` : "";
init0Start the project620 return {
pinch96Issue comments over 4000 characters go up in parts: abso issue N --comment (or --comment-file) splits at paragraph breaks, else line breaks or spaces, marks each part (1/3), (2/3)..., never ends a part inside a code block it doesn't close, and puts attachments on the first part. An objection over the limit is refused before anything is sent. The help names the limit.Compare621 text: `${object !== undefined ? "Objected" : "Commented"} on issue ${id}${inParts}${attachments.length > 0 ? ` with ${plural(attachments.length, "attachment")} (${attachments.join(", ")})` : ""}. Its agents hear it.`,
622 json: {
623 id: ids[0],
624 issue: id,
625 ...(parts.length > 1 ? { parts: ids } : {}),
626 ...(attachments.length > 0 ? { attachments } : {}),
627 },
init0Start the project628 };
629 }
630 if (bool(args, "drop")) {
631 await api.issueDrop(id);
632 return { text: `Dropped issue ${id}.`, json: { issue: id, dropped: true } };
633 }
634 if (bool(args, "reopen")) {
635 await api.issueReopen(id);
636 return { text: `Reopened issue ${id}.`, json: { issue: id, reopened: true } };
637 }
638 if (markingDone) {
639 let version: number | null = null;
640 if (doneBy !== undefined) {
641 version = issueNumber(doneBy, "--done-by");
rename100abso publish is now abso push, abso sync is now abso pull (abso 427) Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing. push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch. Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare642 if (version < 1) throw new UsageError("--done-by is a pushed version, 1 or more");
init0Start the project643 try {
644 await api.show(version, { draft: null });
645 } catch {
646 throw new UsageError(`no version ${version}`);
647 }
648 }
649 await api.issueDone(id, version);
650 return {
651 text: version === null ? `Marked issue ${id} done.` : `Marked issue ${id} done in version ${version}.`,
652 json: { issue: id, done: true, ...(version !== null ? { version } : {}) },
653 };
654 }
655 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.Compare656 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).Compare657 return { text: issuePage(page, api).join("\n"), json: { ...page } };
init0Start the project658}
660export 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).Compare661 const withdraw = str(args, "withdraw");
662 if (withdraw !== undefined) return withdrawAsk(args, env, withdraw);
663 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).Compare664 throw new UsageError('--note goes with --withdraw: abso ask --withdraw <ask> --note "why"');
init0Start the project665 const [of, ...words] = args.positionals;
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare666 if (of !== undefined && words.length === 0 && /^\d+$/.test(of)) return showAsk(args, env, of);
init0Start the project667 if (of === undefined || words.length === 0)
668 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).Compare669 '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 project670 );
671 const { api } = openIssues(env);
672 if (bool(args, "review") && bool(args, "task")) throw new UsageError("an ask is a review or a task, not both");
673 const issue = str(args, "issue");
674 const blocks = str(args, "blocks");
675 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.Compare676 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
init0Start the project677 const r = await api.ask({
678 of,
679 question: words.join(" "),
680 ...(issue !== undefined ? { issue: issueNumber(issue, "--issue") } : {}),
681 ...(bool(args, "review") ? { review: true } : {}),
682 ...(bool(args, "task") ? { kind: "task" as const } : {}),
683 ...(str(args, "due") ? { due: str(args, "due")! } : {}),
684 ...(blocks !== undefined ? { blocks: blocks.split(",").map((b) => issueNumber(b.trim(), "--blocks")) } : {}),
685 ...(options !== undefined
686 ? {
687 options: options
688 .split("|")
689 .map((o) => o.trim())
690 .filter((o) => o !== ""),
691 }
692 : {}),
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.Compare693 ...(attachments.length > 0 ? { attachments } : {}),
init0Start the project694 });
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.Compare695 const lost = notKept(attachments, r.attachments, `ask ${r.id}`);
696 return {
697 text: `Asked ${of} (ask ${r.id})${withFiles(attachments)}. They hear it; abso waiting shows what's open.${lost ? ` ${lost}` : ""}`,
698 json: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}), ...(lost ? { notKept: lost } : {}) },
699 };
init0Start the project700}
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare702/** abso ask <N>: one ask, open or closed, with its whole thread, its answer and whose turn it is. */
703async function showAsk(args: Parsed, env: Env, word: string): Promise<Output> {
704 const others = ["issue", "due", "blocks", "options", "attach"].filter((f) => str(args, f) !== undefined);
705 if (others.length > 0 || bool(args, "review") || bool(args, "task"))
706 throw new UsageError('abso ask <N> shows ask N; to ask, say who and what: abso ask <who> "<question>"');
707 const id = issueNumber(word, "the ask number");
708 const { api, config } = openIssues(env);
709 const { ask } = await api.askThread(id);
710 const side = ask.of === config.agent || ask.by === config.agent;
711 const turn = ask.waitingOn === config.agent ? "you" : ask.waitingOn;
712 const steps = !side
713 ? ""
714 : ask.answer
715 ? `abso reply ${id} "..." still adds to it.`
716 : ask.of === config.agent
717 ? `abso reply ${id} "..." adds to it; abso answer ${id} "..." answers and closes it.`
718 : `abso reply ${id} "..." adds to it.`;
719 const next = [!ask.answer && turn ? `It waits on ${turn}.` : "", steps].join(" ");
720 return {
721 text: [askLine(ask, api, true), next.trim()].filter((l) => l !== "").join("\n"),
722 json: { ask },
723 };
726/** abso reply <ask> "<words>" [--question]: add to an ask's thread, as its asker or the one asked. */
727export async function runReply(args: Parsed, env: Env): Promise<Output> {
728 const [first, ...words] = args.positionals;
729 const id = issueNumber(first, "the ask number");
730 if (words.length === 0)
731 throw new UsageError(
732 `abso reply <ask> "<words>" [--question]: adds to an ask's thread, as its asker or the one asked`,
733 );
734 const { api, config } = openIssues(env);
735 const question = bool(args, "question");
736 const r = await api.reply(id, { text: words.join(" "), ...(question ? { question: true } : {}) });
737 const other = r.ask.by === config.agent ? r.ask.of : r.ask.by;
738 const turn =
739 !r.ask.answer && r.ask.waitingOn
740 ? ` It waits on ${r.ask.waitingOn === config.agent ? "you" : r.ask.waitingOn}.`
741 : "";
742 return { text: `Replied on ask ${id}. ${other} hears it.${turn}`, json: { ask: r.ask } };
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).Compare745/** 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).Compare746async 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.Compare747 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).Compare748 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).Compare749 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).Compare750 const id = issueNumber(word, "the ask number");
751 const { api } = openIssues(env);
752 const note = str(args, "note");
753 const r = await api.withdraw(id, note !== undefined ? { note } : {});
754 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.Compare755}
757/** One search hit as two lines: the issue, then where it matched and the words around it. */
758export function searchLines(h: IssueSearchHit): string[] {
759 const where = h.meaning ? "by meaning" : h.where === "comment" ? `in comment ${h.comment}` : `in the ${h.where}`;
760 const words = h.snippet
761 .replace(/[\u0001\u0002]/g, "")
762 .replace(/\s+/g, " ")
763 .trim();
764 return [
765 ` ${String(h.issue.id).padStart(3)} ${h.issue.status.padEnd(11)} ${q(h.issue.title)}`,
766 ` ${where}${words && words !== h.issue.title ? `: ${q(words)}` : ""}`,
767 ];
770export async function runSearch(args: Parsed, env: Env): Promise<Output> {
771 const words = args.positionals.join(" ").trim();
772 if (words === "") throw new UsageError('search needs words: abso search "<words>" [--limit <N>]');
773 const limitWord = str(args, "limit");
774 const limit = limitWord === undefined ? undefined : Number(limitWord);
775 if (limit !== undefined && !(Number.isInteger(limit) && limit >= 1 && limit <= 50))
776 throw new UsageError("--limit is a number from 1 to 50");
777 const { api } = openIssues(env);
778 const { hits } = await api.issueSearch(words, limit);
779 return {
780 text:
781 hits.length === 0
782 ? `Nothing matches ${q(words)}.`
783 : [
784 `${plural(hits.length, "issue")} for ${q(words)}, best first:`,
785 ...hits.flatMap(searchLines),
786 "abso issue <N> shows one.",
787 ].join("\n"),
788 json: { hits },
789 };
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).Compare790}
init0Start the project792export async function runWaiting(args: Parsed, env: Env): Promise<Output> {
793 if (args.positionals.length > 0)
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare794 throw new UsageError("waiting takes no words: abso waiting [--of <agent or person:id>] [--mine] [--asked]");
795 if (bool(args, "asked")) return askedOf(args, env);
init0Start the project796 const { api, config } = openIssues(env);
797 const mine = bool(args, "mine") || str(args, "of") === config.agent;
798 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.Compare799 // With --mine, your own publishes still in the merge queue are open work too. A server without a queue,
800 // or one that can't be read now, leaves them out rather than failing the asks.
801 const [{ asks }, queue] = await Promise.all([
802 mine ? api.waitingMine() : api.waiting(of),
803 mine ? api.queueState().catch(() => undefined) : undefined,
804 ]);
805 const queued = queuedLines(queue, config.agent);
806 const yours = (queue?.items ?? []).filter((q) => q.agent === config.agent);
init0Start the project807 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.Compare808 text: [
809 ...queued,
810 ...(asks.length === 0
811 ? [queued.length > 0 ? `No open asks of ${of}.` : `Nothing is waiting${of ? ` on ${of}` : ""}.`]
init0Start the project812 : [
813 `${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.Compare814 ...asks.map((a) => askLine(a, api)),
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare815 'abso ask <N> shows one with its thread; abso reply <N> "..." adds to it; abso answer <N> "..." 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.Compare816 ]),
817 ].join("\n"),
818 json: {
819 asks,
820 ...(yours.length > 0
821 ? { queued: yours.map((q) => ({ id: q.id, message: q.message, standing: standing(queue!.items, q.id) })) }
822 : {}),
823 },
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare824 };
827/** abso waiting --asked: the asks you sent, open ones first, then the latest answered, each with its newest reply. */
828async function askedOf(args: Parsed, env: Env): Promise<Output> {
829 if (bool(args, "mine") || str(args, "of") !== undefined)
830 throw new UsageError("--asked lists the asks you sent; it takes no --mine or --of");
831 const { api, config } = openIssues(env);
832 const { asks } = await api.asked();
833 const open = asks.filter((a) => !a.answer);
834 const closed = asks.filter((a) => a.answer);
835 return {
836 text: [
837 ...(asks.length === 0
838 ? [`${config.agent} hasn't asked anything yet.`]
839 : [
840 ...(open.length > 0
841 ? [`${plural(open.length, "open ask")} you sent:`, ...open.map((a) => askLine(a, api))]
842 : []),
843 ...(closed.length > 0
844 ? [
845 `${closed.length === 1 ? "The latest answered" : `The latest ${closed.length} answered`}:`,
846 ...closed.map((a) => askLine(a, api)),
847 ]
848 : []),
849 "abso ask <N> shows one with its whole thread.",
850 ]),
851 ].join("\n"),
852 json: { asks },
pinch53abso ack <ask> ["note"]: the one asked says they have an ask and will answer later. The ask stays open and keeps blocking; abso issue shows it as acknowledged with the note, and the asker hears it. The Ask wire type gains ack, the API client gains ack(), and the skill mentions the command.Compare853 };
856/** abso ack <ask> ["note"]: tell the asker you have it, and answer later. The ask stays open until abso answer. */
857export async function runAck(args: Parsed, env: Env): Promise<Output> {
858 const [first, ...words] = args.positionals;
859 const id = issueNumber(first, "the ask number");
860 const { api } = openIssues(env);
861 const note = words.join(" ");
862 const r = await api.ack(id, note !== "" ? { note } : {});
863 return {
pinch72Asks become threads: abso reply <ask> "..." adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.Compare864 text: `Acknowledged ask ${id}. ${r.ask.by} hears it; abso reply ${id} "..." adds more as you go, and the ask stays open until abso answer ${id} "...".`,
pinch53abso ack <ask> ["note"]: the one asked says they have an ask and will answer later. The ask stays open and keeps blocking; abso issue shows it as acknowledged with the note, and the asker hears it. The Ask wire type gains ack, the API client gains ack(), and the skill mentions the command.Compare865 json: { ask: r.ask },
init0Start the project866 };
869export async function runAnswer(args: Parsed, env: Env): Promise<Output> {
870 const [first, ...words] = args.positionals;
871 const id = issueNumber(first, "the ask number");
872 const option = str(args, "option");
873 const done = bool(args, "done");
874 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).Compare875 throw new UsageError('abso answer <ask> "<words>" | --option <N> [--note "..."] | --done [--note "..."]');
init0Start the project876 const { api } = openIssues(env);
877 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.Compare878 const attachments = await uploadAttachments(api, env.cwd, str(args, "attach"));
init0Start the project879 const r = await api.answer(id, {
880 ...(words.length > 0 ? { words: words.join(" ") } : {}),
881 ...(option !== undefined ? { option: /^\d+$/.test(option) ? Number(option) - 1 : option } : {}),
882 ...(done ? { done: true } : {}),
883 ...(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.Compare884 ...(attachments.length > 0 ? { attachments } : {}),
init0Start the project885 });
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.Compare886 const lost = notKept(
887 attachments,
888 r.ask.answer?.attachments?.map((a) => a.id),
889 `your answer to ask ${id}`,
890 );
891 return {
892 text: `Answered ask ${id}${withFiles(attachments)}. ${r.ask.by} hears it.${lost ? ` ${lost}` : ""}`,
893 json: { ask: r.ask, ...(lost ? { notKept: lost } : {}) },
894 };
pinch96Issue comments over 4000 characters go up in parts: abso issue N --comment (or --comment-file) splits at paragraph breaks, else line breaks or spaces, marks each part (1/3), (2/3)..., never ends a part inside a code block it doesn't close, and puts attachments on the first part. An objection over the limit is refused before anything is sent. The help names the limit.Compare895}
897/** What the Issues Worker takes in one comment (its LIMITS.text). */
898export const COMMENT_MAX = 4000;
900/** Room a part keeps for its "(i/n)" line and blank line, and for closing a code block it ends inside. */
901const PART_MARK = 12;
902const FENCE_CLOSE = 5;
904/**
905 * A comment too long for one, as parts that each fit, each starting with "(i/n)". A part ends at the last
906 * paragraph break that fits, else the last line break, else the last space, else at the limit. A part that
907 * would end inside a fenced code block closes it, and the next part opens it again with the same fence line.
908 */
909export function commentParts(text: string, max = COMMENT_MAX): string[] {
910 if (text.length <= max) return [text];
911 const bodies: string[] = [];
912 let rest = text;
913 let reopen = "";
914 while (rest !== "") {
915 const room = max - PART_MARK - FENCE_CLOSE - reopen.length;
916 let body: string;
917 if (reopen.length + rest.length <= max - PART_MARK) {
918 body = rest;
919 rest = "";
920 } else {
921 const cut = cutAt(rest, room);
922 body = rest.slice(0, cut).trimEnd();
923 // A space cut at goes with neither part; the line breaks between paragraphs go too.
924 rest = rest.slice(rest[cut] === " " ? cut + 1 : cut).replace(/^\n+/, "");
925 if (rest.trim() === "") rest = "";
926 }
927 let part = reopen + body;
928 const fence = openFence(part);
929 if (fence && rest !== "") {
930 part += `\n${fence.marker}`;
931 reopen = `${fence.line}\n`;
932 } else reopen = "";
933 bodies.push(part);
934 }
935 return bodies.map((b, i) => `(${i + 1}/${bodies.length})\n\n${b}`);
938/** Where to end a part of at most `room` characters of `text`: a paragraph break, a line break, a space, or the limit. */
939function cutAt(text: string, room: number): number {
940 const head = text.slice(0, room);
941 const floor = room / 4;
942 for (const at of [head.lastIndexOf("\n\n"), head.lastIndexOf("\n"), head.lastIndexOf(" ")]) if (at > floor) return at;
943 // Not between the two halves of a character outside the Basic Multilingual Plane.
944 const code = text.charCodeAt(room - 1);
945 return code >= 0xd800 && code <= 0xdbff ? room - 1 : room;
948/** The fence line of a code block still open at the end of `text`, and the marker that closes it, or undefined. */
949function openFence(text: string): { line: string; marker: string } | undefined {
950 let open: { line: string; marker: string } | undefined;
951 for (const line of text.split("\n")) {
952 const m = /^\s*(`{3,}|~{3,})/.exec(line);
953 if (!m) continue;
954 if (!open) open = { line, marker: m[1]! };
955 else if (m[1]!.startsWith(open.marker) && line.trim() === m[1]) open = undefined;
956 }
957 return open;
init0Start the project958}