Versions 33 to 318
Lines 23–56 at 318 (were 23–45 at 33)
26−import { issuesServerFor, tokenGoesTo } from "./core.ts";
3134
3336
3437/** The folder, with its Api pointed at the Issues Worker: the token goes only where tokenGoesTo allows, as for the avcs server. */
35−function openIssues(env: Env): { root: string; config: Config; api: Api } {
37− const server = fromEnv(env.env, "ISSUES_SERVER") || issuesServerFor(config.server, readMachineServers(env.env));
45+ // An explicit --server goes to that server's own Issues Worker: ABSO_ISSUES_SERVER doesn't redirect it.
4051 `${config.server} has no Issues Worker beside it that abso knows; ~/.abso/servers.json or ABSO_ISSUES_SERVER names one`,
42− if (config.token !== undefined && !tokenGoesTo(server, trustedServers(env.env))) {
4455 `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.`,
Lines 80–129 at 318 (were 69–93 at 33)
6980 return ` ${String(i.id).padStart(3)} ${i.status.padEnd(11)} ${q(i.title)}${detail.length > 0 ? ` (${detail.join("; ")})` : ""}`;
7182
72−function askLine(a: Ask & { title?: string | null }): string {
88+
91+ return `${indent}${r.by}, ${shortWhen(r.at)}${r.question ? ", a question" : ""}: ${q(whole ? r.text : firstLine(r.text))}`;
93+
95+ * An ask: its head line, its files and options, then, in a list, its newest reply, or with `thread`, every
96+ * reply, oldest first; then its answer. Older servers send no thread, only the one asked's acknowledgement.
98+function askLine(a: Ask & { title?: string | null }, api?: Pick<Api, "attachmentUrl">, thread = false): string {
74100 const where = a.issue === null ? "" : ` on issue ${a.issue}${a.title ? ` (${q(a.title)})` : ""}`;
76103 // Who answered, and when, on the ask's own line, so a handled ask can't pass for an open one.
78105 ? `${a.outcome === "withdrawn" ? "withdrawn" : "answered"} by ${a.answer.by}, ${shortWhen(a.answer.at)}`
80− !a.answer && a.seen !== undefined ? seenText(a.seen) : "",
107+ !a.answer && a.ack && replies === undefined ? `acknowledged ${shortWhen(a.ack.at)}, not answered yet` : "",
109+ replies && replies.length > 0 ? (replies.length === 1 ? "1 reply" : `${replies.length} replies`) : "",
84115 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];
86117 if (a.options.length > 0) lines.push(` options: ${a.options.map((o, i) => `${i + 1}. ${q(o)}`).join(", ")}`);
87118 if (a.recommendation) lines.push(` ${a.recommendation.by} recommends: ${q(a.recommendation.text)}`);
120+ if (!a.answer && a.ack && a.ack.note !== "") lines.push(` ${a.of} acknowledged: ${q(a.ack.note)}`);
122+ else if (replies.length > 0) lines.push(replyLine(replies[replies.length - 1]!, " last: ", false));
90− } else if (a.answer) lines.push(` answer: ${q(a.answer.words)}`);
126+ lines.push(` answer: ${q(a.answer.words)}`, ...attachmentLines(api, a.answer.attachments, " "));
93129
Lines 149–155 at 318 (were 113–119 at 33)
113149 return ` ${e.by}, ${shortWhen(e.at)}: ${said.join("; ")} (${e.notified.length > 0 ? `told ${e.notified.join(", ")}` : "told nobody"})`;
115151
116−/** Labels as typed, lower-cased, since the Worker refuses upper case (Security): --label Friction means friction. */
152+/** Labels as typed, lower-cased, since the Worker refuses upper case: --label Friction means friction. */
Lines 164–183 at 318 (were 128–133 at 33)
130166
171+
173+ * What to say when a write sent files the server didn't keep: an Issues server from before asks carried
174+ * attachments takes the words and leaves the files out. Nothing to say when it kept them, or none were sent.
176+function notKept(sent: readonly string[], kept: readonly string[] | undefined, what: string): string | undefined {
177+ if (sent.length === 0 || (kept !== undefined && sent.every((id) => kept.includes(id)))) return undefined;
178+ 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 ...).`;
180+
131181/** The most one attachment may be: the Issues Worker's cap, checked here before sending (abso issue 171). */
133183
Lines 234–241 at 318 (were 184–191 at 33)
185235
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
Lines 247–257 at 318 (were 197–205 at 33)
197247 `${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− );
Lines 293–316 at 318 (were 241–253 at 33)
241293 ? `${i.closed.how === "done" ? "Done" : "Dropped"} by ${i.closed.by}${i.closed.version !== null ? ` in version ${i.closed.version}` : ""}, ${shortWhen(i.closed.at)}.`
296+ // The links below open for people signed in on the website; an agent's fetch of one is refused. Say the way in
301+ p.asks.reduce((n, a) => n + (a.attachments ?? []).length + (a.answer?.attachments ?? []).length, 0);
307+ `${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.`,
247310 ...(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)] : []),
Lines 613–639 at 318 (were 550–560 at 33)
616+ // Refused before anything goes up: an objection is one comment, and a part of one would read as a whole.
619+ `an objection holds up to ${COMMENT_MAX} characters, and this one has ${object.length}: say it shorter, and put the rest in a --comment`,
554− const r = await api.issueComment(id, (comment ?? object)!, object !== undefined, attachments);
626+ ids.push((await api.issueComment(id, part, object !== undefined, i === 0 ? attachments : [])).id);
628+ const inParts = parts.length > 1 ? ` in ${parts.length} parts (comments ${ids.join(", ")})` : "";
556− text: `${object !== undefined ? "Objected" : "Commented"} on issue ${id}${attachments.length > 0 ? ` with ${plural(attachments.length, "attachment")} (${attachments.join(", ")})` : ""}. Its agents hear it.`,
557− json: { id: r.id, issue: id, ...(attachments.length > 0 ? { attachments } : {}) },
630+ text: `${object !== undefined ? "Objected" : "Commented"} on issue ${id}${inParts}${attachments.length > 0 ? ` with ${plural(attachments.length, "attachment")} (${attachments.join(", ")})` : ""}. Its agents hear it.`,
Lines 648–654 at 318 (were 569–575 at 33)
572− if (version < 1) throw new UsageError("--done-by is a published version, 1 or more");
Lines 672–678 at 318 (were 593–598 at 33)
598678 '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>',
Lines 682–688 at 318 (were 602–607 at 33)
Lines 699–759 at 318 (were 618–630 at 33)
622− return { text: `Asked ${of} (ask ${r.id}). They hear it; abso waiting shows what's open.`, json: { id: r.id } };
706+ text: `Asked ${of} (ask ${r.id})${withFiles(attachments)}. They hear it; abso waiting shows what's open.${lost ? ` ${lost}` : ""}`,
707+ json: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}), ...(lost ? { notKept: lost } : {}) },
624710
711+/** abso ask <N>: one ask, open or closed, with its whole thread, its answer and whose turn it is. */
713+ const others = ["issue", "due", "blocks", "options", "attach"].filter((f) => str(args, f) !== undefined);
715+ throw new UsageError('abso ask <N> shows ask N; to ask, say who and what: abso ask <who> "<question>"');
734+
735+/** abso reply <ask> "<words>" [--question]: add to an ask's thread, as its asker or the one asked. */
741+ `abso reply <ask> "<words>" [--question]: adds to an ask's thread, as its asker or the one asked`,
745+ const r = await api.reply(id, { text: words.join(" "), ...(question ? { question: true } : {}) });
753+
625754/** 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);
756+ const others = ["issue", "due", "blocks", "options", "attach"].filter((f) => str(args, f) !== undefined);
628757 if (args.positionals.length > 0 || others.length > 0 || bool(args, "review") || bool(args, "task"))
629758 throw new UsageError('abso ask --withdraw <ask> [--note "why"] takes nothing else: it takes back an ask you made');
Lines 800–880 at 318 (were 671–694 at 33)
671800
674− throw new UsageError("waiting takes no words: abso waiting [--of <agent or person:id>] [--mine]");
803+ throw new UsageError("waiting takes no words: abso waiting [--of <agent or person:id>] [--mine] [--asked]");
678− const { asks } = mine ? await api.waitingMine() : await api.waiting(of);
808+ // With --mine, your own publishes still in the merge queue are open work too. A server without a queue,
680− text:
681− asks.length === 0
682− ? `Nothing is waiting${of ? ` on ${of}` : ""}.`
820+ ? [queued.length > 0 ? `No open asks of ${of}.` : `Nothing is waiting${of ? ` on ${of}` : ""}.`]
685− ...asks.map(askLine),
686− 'abso answer <ask> "..." answers one asked of you.',
687− ].join("\n"),
824+ 'abso ask <N> shows one with its thread; abso reply <N> "..." adds to it; abso answer <N> "..." answers one asked of you.',
830+ ? { queued: yours.map((q) => ({ id: q.id, message: q.message, standing: standing(queue!.items, q.id) })) }
835+
836+/** abso waiting --asked: the asks you sent, open ones first, then the latest answered, each with its newest reply. */
691864
865+/** abso ack <ask> ["note"]: tell the asker you have it, and answer later. The ask stays open until abso answer. */
873+ 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} "...".`,
877+
Lines 884–967 at 318 (were 698–708 at 33)
698884 throw new UsageError('abso answer <ask> "<words>" | --option <N> [--note "..."] | --done [--note "..."]');
703890 ...(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 } };
901+ text: `Answered ask ${id}${withFiles(attachments)}. ${r.ask.by} hears it.${lost ? ` ${lost}` : ""}`,
905+
908+
909+/** Room a part keeps for its "(i/n)" line and blank line, and for closing a code block it ends inside. */
912+
914+ * A comment too long for one, as parts that each fit, each starting with "(i/n)". A part ends at the last
915+ * paragraph break that fits, else the last line break, else the last space, else at the limit. A part that
916+ * would end inside a fenced code block closes it, and the next part opens it again with the same fence line.
946+
947+/** Where to end a part of at most `room` characters of `text`: a paragraph break, a line break, a space, or the limit. */
951+ for (const at of [head.lastIndexOf("\n\n"), head.lastIndexOf("\n"), head.lastIndexOf(" ")]) if (at > floor) return at;
956+
957+/** The fence line of a code block still open at the end of `text`, and the marker that closes it, or undefined. */
- MCP
- compare on this site's /mcp
- CLI
- abso diff 33 318 client/src/issues.ts --json
- JSON
- /christopher/abso-core/compare/33..318?file=client%2Fsrc%2Fissues.ts&format=json