- MCP
- show on this site's /mcp
- CLI
- abso show 35 --json
- JSON
- /christopher/abso-core/versions/35?format=json
Client: 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.
of shared·pinch··Not checked
Version 34 · Files at version 35
5 files, 172 lines added, 21 removed.
--- a/client/src/api.ts
+++ b/client/src/api.ts
@@ -613,13 +613,14 @@
616− }): Promise<{ id: number; news?: IssueNews }> {
619620
622− body: { words?: string; option?: number | string; note?: string; done?: boolean },
623+ body: { words?: string; option?: number | string; note?: string; done?: boolean; attachments?: string[] },
--- a/client/src/issues-wire.ts
+++ b/client/src/issues-wire.ts
@@ -68,6 +68,8 @@
@@ -76,7 +78,7 @@
79− answer: { by: string; words: string; at: number } | null;
8082 /** When waiting first listed it to the one it's asked of; null until then (abso issue 124). */
8284 /** "withdrawn" when the asker took it back; absent for an open or answered ask, and from older servers. */
--- a/client/src/issues.ts
+++ b/client/src/issues.ts
@@ -69,7 +69,7 @@
6969 return ` ${String(i.id).padStart(3)} ${i.status.padEnd(11)} ${q(i.title)}${detail.length > 0 ? ` (${detail.join("; ")})` : ""}`;
7171
72−function askLine(a: Ask & { title?: string | null }): string {
7474 const where = a.issue === null ? "" : ` on issue ${a.issue}${a.title ? ` (${q(a.title)})` : ""}`;
@@ -82,12 +82,13 @@
8484 const head = ` ask ${a.id}: ${a.by}, ${shortWhen(a.at)}, asks ${a.of} ${what}${where}${extra.length > 0 ? ` (${extra.join("; ")})` : ""}: ${q(a.question)}`;
85− const lines = [head];
8686 if (a.options.length > 0) lines.push(` options: ${a.options.map((o, i) => `${i + 1}. ${q(o)}`).join(", ")}`);
8787 if (a.recommendation) lines.push(` ${a.recommendation.by} recommends: ${q(a.recommendation.text)}`);
90− } else if (a.answer) lines.push(` answer: ${q(a.answer.words)}`);
91+ lines.push(` answer: ${q(a.answer.words)}`, ...attachmentLines(api, a.answer.attachments, " "));
9394
@@ -128,6 +129,20 @@
130131
136+
138+ * What to say when a write sent files the server didn't keep: an Issues server from before asks carried
139+ * attachments takes the words and leaves the files out. Nothing to say when it kept them, or none were sent.
141+function notKept(sent: readonly string[], kept: readonly string[] | undefined, what: string): string | undefined {
142+ if (sent.length === 0 || (kept !== undefined && sent.every((id) => kept.includes(id)))) return undefined;
143+ 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 ...).`;
145+
131146/** The most one attachment may be: the Issues Worker's cap, checked here before sending (abso issue 171). */
133148
@@ -184,8 +199,8 @@
185200
187− * abso issue N --save-attachments <folder>: every attachment on the issue and
188− * its comments, written to that folder as <id>-<name>; an svg's own file
@@ -197,9 +212,11 @@
197212 `${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`,
200− const all = [...(page.issue.attachments ?? []), ...page.comments.flatMap((c) => c.attachments ?? [])].filter(
201− (a) => !seen.has(a.id) && seen.add(a.id),
202− );
@@ -247,7 +264,7 @@
247264 ...(i.lines ? [`From ${i.lines.file} lines ${i.lines.from}-${i.lines.to} at version ${i.lines.version}.`] : []),
250− ...(p.asks.length > 0 ? ["", "Asks:", ...p.asks.map(askLine)] : []),
@@ -602,6 +619,7 @@
@@ -618,13 +636,18 @@
622− return { text: `Asked ${of} (ask ${r.id}). They hear it; abso waiting shows what's open.`, json: { id: r.id } };
643+ text: `Asked ${of} (ask ${r.id})${withFiles(attachments)}. They hear it; abso waiting shows what's open.${lost ? ` ${lost}` : ""}`,
644+ json: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}), ...(lost ? { notKept: lost } : {}) },
624647
625648/** abso ask --withdraw <ask> [--note "why"]: the asker takes an ask back. It closes like an answer, and the one asked hears it. */
627− const others = ["issue", "due", "blocks", "options"].filter((f) => str(args, f) !== undefined);
650+ const others = ["issue", "due", "blocks", "options", "attach"].filter((f) => str(args, f) !== undefined);
628651 if (args.positionals.length > 0 || others.length > 0 || bool(args, "review") || bool(args, "task"))
629652 throw new UsageError('abso ask --withdraw <ask> [--note "why"] takes nothing else: it takes back an ask you made');
@@ -682,7 +705,7 @@
685− ...asks.map(askLine),
@@ -698,11 +721,21 @@
698721 throw new UsageError('abso answer <ask> "<words>" | --option <N> [--note "..."] | --done [--note "..."]');
703727 ...(option !== undefined ? { option: /^\d+$/.test(option) ? Number(option) - 1 : option } : {}),
707− return { text: `Answered ask ${id}. ${r.ask.by} hears it.`, json: { ask: r.ask } };
738+ text: `Answered ask ${id}${withFiles(attachments)}. ${r.ask.by} hears it.${lost ? ` ${lost}` : ""}`,
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -437,11 +437,12 @@
442− 'abso ask <who> "<question>" [--issue <N>] [--review | --task] [--due <YYYY-MM-DD>] [--blocks <N,N>] [--options "A|B|C"] | abso ask --withdraw <ask> [--note "why"]',
443+ 'abso ask <who> "<question>" [--issue <N>] [--review | --task] [--due <YYYY-MM-DD>] [--blocks <N,N>] [--options "A|B|C"] [--attach <file,file>] | abso ask --withdraw <ask> [--note "why"]',
444− "Ask an agent, or a person (person:<id>), something; they hear it. On an issue, it holds the issue at Blocked (In review for --review) until answered. --task asks for something done instead of an answer; --options gives the choices; --blocks names the issues waiting on it. --withdraw takes back an ask you made that no longer needs an answer: it leaves their waiting list, stops holding the issue, keeps your --note as why, and they hear it.",
445+ "Ask an agent, or a person (person:<id>), something; they hear it. On an issue, it holds the issue at Blocked (In review for --review) until answered. --task asks for something done instead of an answer; --options gives the choices; --blocks names the issues waiting on it. --attach sends files with the question, as on an issue. --withdraw takes back an ask you made that no longer needs an answer: it leaves their waiting list, stops holding the issue, keeps your --note as why, and they hear it.",
@@ -458,11 +459,11 @@
461− flags: { option: "string", note: "string", done: "boolean" },
463− 'abso answer <ask> "<words>" | abso answer <ask> --option <N> [--note "..."] | abso answer <ask> --done [--note "..."]',
464+ 'abso answer <ask> "<words>" | abso answer <ask> --option <N> [--note "..."] | abso answer <ask> --done [--note "..."], each with [--attach <file,file>]',
465− "Answer an ask of you, in your own words, by picking an option (by number or text), or, for a task, with --done. The asker hears it.",
466+ "Answer an ask of you, in your own words, by picking an option (by number or text), or, for a task, with --done. --attach sends files with the answer. The asker hears it.",
--- a/client/test/attach.test.ts
+++ b/client/test/attach.test.ts
@@ -43,6 +43,32 @@
55+ return json({ ask: { by: "bob", answer: { by: "ann", words: "w", at: 0, attachments: files } } });
66+ answer: { attachments: [{ id: "a00000000000e", name: "answer.png", type: "image/png", size: 13 }] },
4672 // Issue 8 carries an svg-drawn image on itself and again on a comment, plus one more on the comment.
@@ -179,6 +205,65 @@
181207
225+ const ask = JSON.parse(seen.at(-1)!.body.toString()) as { question: string; attachments: string[] };
232+ const answer = JSON.parse(seen.at(-1)!.body.toString()) as { words: string; attachments: string[] };
241+
245+ const init = await avcs(dir, ["init", "--server", fake.url, "--project", "keepless", "--agent", "ann"]);
257+
264+ assert.deepEqual(readdirSync(out).sort(), ["a00000000000d-question.png", "a00000000000e-answer.png"]);
266+
@@ -238,5 +323,34 @@
239324 /\n {4}attached a0000000000aa: "logo.png", 4 KB, \S+\/a0000000000aa\n {6}drawn from "logo.svg", 512 B, https:\/\/issues.example\/p\/x\/attachments\/a0000000000aa\/source/,
350+ const asks = issuePage(asked, { attachmentUrl: (id: string) => `https://i.example/${id}` }).join("\n");
353+ /ask 4: .*"Which\?"\n {4}attached a00000000000d: "a.png", 1 KB, https:\/\/i.example\/a00000000000d\n {4}answer: "This"\n {6}attached a00000000000e: "b.png", 1 KB/,