Versions 4 to 5
Lines 5–13 at 5 (were 5–11 at 4)
77
8−import type { Api, Ask, Draft, DraftBody, IssuePage, IssueRow } from "./api.ts";
Lines 109–156 at 5 (were 107–114 at 4)
109111
112+/** The most one attachment may be: the Issues Worker's cap, checked here before sending (abso issue 171). */
114+
115+/** Uploads each file --attach names (comma-separated), in order, and answers their ids. Nothing is sent if a file is missing or too big. */
116+async function uploadAttachments(api: Api, cwd: string, value: string | undefined): Promise<string[]> {
119+ if (paths.length === 0) throw new UsageError("--attach names files, comma-separated: --attach shot.png,after.png");
129+ throw new UsageError(`--attach ${p} is ${sizeText(size)}; one attachment is at most ${sizeText(ATTACH_MAX)}`);
133+ for (const f of files) ids.push((await api.attachmentUpload(readFileSync(f.full), f.name)).id);
136+
138+ return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${Math.round(n / 1024)} KB` : `${(n / (1024 * 1024)).toFixed(1)} MB`;
140+
148+ (a) => `${indent}attached ${a.id}: ${q(a.name)}, ${sizeText(a.size)}${api ? `, ${api.attachmentUrl(a.id)}` : ""}`,
151+
111−export function issuePage(p: IssuePage): string[] {
Lines 170–185 at 5 (were 128–141 at 4)
129171 ...(i.lines ? [`From ${i.lines.file} lines ${i.lines.from}-${i.lines.to} at version ${i.lines.version}.`] : []),
136− ...p.comments.map(
137− (c) => ` ${c.by}${c.kind === "objection" ? " objects" : ""}, ${shortWhen(c.at)}: ${q(c.text)}`,
138− ),
Lines 330–342 at 5 (were 286–293 at 4)
287331 'avcs issue new "<title>" [--description "..."] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>]',
289− const r = await api.issueOpen({ ...openFields(args, rest.join(" ")), title: rest.join(" ") });
290− return { text: `Opened issue ${r.id}. avcs start "..." --issue ${r.id} starts on it.`, json: { id: r.id } };
335+ const r = await api.issueOpen({ ...fields, ...(attachments.length > 0 ? { attachments } : {}) });
337+ text: `Opened issue ${r.id}${attachments.length > 0 ? ` with ${plural(attachments.length, "attachment")} (${attachments.join(", ")})` : ""}. avcs start "..." --issue ${r.id} starts on it.`,
Lines 389–402 at 5 (were 340–350 at 4)
341390 "--quiet and --notify go with an edit (--title, --description, --parent, --agent, --blocked-by, --label or --unlabel)",
344− const r = await api.issueComment(id, (comment ?? object)!, object !== undefined);
346− text: `${object !== undefined ? "Objected" : "Commented"} on issue ${id}. Its agents hear it.`,
347− json: { id: r.id, issue: id },
398+ text: `${object !== undefined ? "Objected" : "Commented"} on issue ${id}${attachments.length > 0 ? ` with ${plural(attachments.length, "attachment")} (${attachments.join(", ")})` : ""}. Its agents hear it.`,
Lines 425–431 at 5 (were 373–379 at 4)
376− return { text: issuePage(page).join("\n"), json: { ...page } };
378430
- MCP
- compare on this site's /mcp
- CLI
- abso diff 4 5 client/src/issues.ts --json
- JSON
- /christopher/abso-core/compare/4..5?file=client%2Fsrc%2Fissues.ts&format=json