- MCP
- show on this site's /mcp
- CLI
- abso show 29 --json
- JSON
- /christopher/abso-core/versions/29?format=json
Client: 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.
of shared·pinch··Not checked
Version 28 · Files at version 29
8 files, 162 lines added, 28 removed.
--- a/client/README.md
+++ b/client/README.md
@@ -152,9 +152,10 @@
155−an abso folder inside that one. A call's `folder`, and the files the `issue`
156−tool's `attach` names, must be in the folder the server started in or below it:
157−anything outside is refused. Add it to Claude Code with:
158159
--- a/client/src/api.ts
+++ b/client/src/api.ts
@@ -517,6 +517,29 @@
519519
520+ /** An attachment's bytes, or with `source` the svg it was drawn from; refused past `max` bytes. */
523+ throw new ApiError(`${this.config.server} has no Issues Worker beside it; ABSO_ISSUES_SERVER names one`);
534+ `could not reach ${this.issuesServer}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
537+ if (!res.ok) throw new ApiError(`${url} answered ${res.status}: ${errorSentence(await res.text())}`, res.status);
539+ if (bytes.length > max) throw new ApiError(`${url} sent ${bytes.length} bytes, more than an attachment may be`);
542+
520543 /** An edit (abso issue 3): it tells the issue's watchers, and `also`, unless `notify` is false. null clears a parent or Agent. */
--- a/client/src/export.ts
+++ b/client/src/export.ts
@@ -1,8 +1,10 @@
3−// shared does (#37, Playtester 1). The folder gets .abso-export.json (.avcs-export.json before the rename) naming
4−// the version, to stamp the build with. Exporting again replaces the folder,
5−// keeping node_modules (and what --keep names) so a build needs no new install.
@@ -19,9 +21,9 @@
2022
2123/** The file an export leaves in its folder: what it holds, and the sign that the folder is one export may replace. */
22−export const EXPORT_STAMP = ".abso-export.json";
23−/** The name before the rename: an export made then still counts as one. */
24−const OLD_EXPORT_STAMP = ".avcs-export.json";
25+/** Its earlier names: an export made then still counts as one. A .json name drew the project's formatter. */
2527
2628/** Where an export may go: outside the abso folder, or in a part of it abso leaves out. Empty, or an earlier export. */
@@ -38,8 +40,7 @@
3840 if (!statSync(target).isDirectory()) throw new UsageError(`${target} is a file; export to a folder`);
41− !existsSync(join(target, EXPORT_STAMP)) &&
42− !existsSync(join(target, OLD_EXPORT_STAMP))
4546 `${target} has files in it; export to an empty folder (an export replaces only a folder an earlier export made)`,
@@ -137,7 +138,7 @@
140− writeFileSync(join(target, EXPORT_STAMP), `${JSON.stringify(stamp, null, 2)}\n`);
143144 `Exported version ${version} of ${space} to ${target}: ${plural(written, "file")}. ${EXPORT_STAMP} there names the version; abso export to the same folder replaces it.`,
--- a/client/src/issues.ts
+++ b/client/src/issues.ts
@@ -5,8 +5,8 @@
77
8−import { readFileSync, statSync } from "node:fs";
9−import { basename, resolve } from "node:path";
@@ -25,13 +25,15 @@
2931
3133
3234/** The folder, with its Api pointed at the Issues Worker: the token goes only where tokenGoesTo allows, as for the avcs server. */
33−function openIssues(env: Env): { config: Config; api: Api } {
34− const { config, api } = open(env);
3537 const server = fromEnv(env.env, "ISSUES_SERVER") || issuesServerFor(config.server, readMachineServers(env.env));
@@ -43,7 +45,7 @@
46− return { config, api };
4850
@@ -172,6 +174,57 @@
174176
177+/** A saved attachment's file name: its id, then its own name with anything but letters, digits, . - _ made _. */
185+
192+async function saveAttachments(api: Api, root: string, cwd: string, dir: string, page: IssuePage): Promise<Output> {
197+ `${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(
211+ const wanted = [{ name: a.name, source: false }, ...(a.source ? [{ name: a.source.name, source: true }] : [])];
227+
@@ -416,7 +469,15 @@
416469
419− const { api } = openIssues(env);
478+ `--save-attachments goes alone with an issue number: abso issue <N> --save-attachments <folder>${other.length > 0 ? `, not with --${other[0]}` : ""}`,
@@ -522,6 +583,7 @@
527589
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -390,11 +390,12 @@
395− 'abso issue <N> --copy-to <project> [--clean <file>] [--dry-run] | abso issue <N> [--comment "..." [--attach <file,file>] | --object "..." | --drop | --reopen | --done [--done-by <version>]] | abso issue <N> [--title "..."] [--description "..."] [--parent <N|none>] [--agent <agent|none>] [--blocked-by <N,N|none>] [--label <l,l>] [--unlabel <l,l>] [--notify <who,who> | --quiet] | abso issue new "<title>" [--description "..."] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>] [--attach <file,file>]',
396+ 'abso issue <N> --save-attachments <folder> | abso issue <N> --copy-to <project> [--clean <file>] [--dry-run] | abso issue <N> [--comment "..." [--attach <file,file>] | --object "..." | --drop | --reopen | --done [--done-by <version>]] | abso issue <N> [--title "..."] [--description "..."] [--parent <N|none>] [--agent <agent|none>] [--blocked-by <N,N|none>] [--label <l,l>] [--unlabel <l,l>] [--notify <who,who> | --quiet] | abso issue new "<title>" [--description "..."] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>] [--attach <file,file>]',
397− "One issue: its description, Agent, Blocked by, labels, asks, comments, edits, sub-issues and watchers. --comment comments on it and --object objects; its agents hear either. --drop drops it. --reopen opens a dropped issue again. --done marks it done by hand, and --done-by <version> names the published version that did it. publish --done still marks it done too. --title, --description, --parent, --agent and --blocked-by edit it, and the edit tells its watchers (who opened it, its Agent and agents, its Reviewer, whoever was named in Notify, and whoever commented); --notify tells more people, --quiet tells nobody. --label adds labels and --unlabel takes them off (friction, area:client: lower-case letters, digits and - _ . :); a label-only edit tells nobody unless --notify names people. An issue is Blocked until each issue it's blocked by is Done. abso issue new opens one; --lines ties it to lines at a version of shared, --agent says who it's for, --notify tells people now, and --label labels it. --attach shot.png,after.png puts images on a new issue or a comment (png, jpeg, gif or webp, 10 MB each; the server checks the type by the bytes and takes out metadata such as where a photo was taken. An svg, up to 1 MB, is drawn as a png, and its own file is kept as a download, on servers that take svg), and prints each one's id for the text to point at; the issue's page lists them with a link. --copy-to <project> copies the issue into another project, with its comments, answered asks and labels, each keeping its author and time; --dry-run shows what would go and writes nothing, and --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). Copying out of a project on a live server takes an owner of that project. abso issue draft \"<title>\" [the same fields] saves a draft instead: yours alone, with no number and no news; abso issue draft <D> [fields] changes it, --open opens it as an issue, --delete deletes it.",
398+ "One issue: its description, Agent, Blocked by, labels, asks, comments, edits, sub-issues and watchers. --comment comments on it and --object objects; its agents hear either. --drop drops it. --reopen opens a dropped issue again. --done marks it done by hand, and --done-by <version> names the published version that did it. publish --done still marks it done too. --title, --description, --parent, --agent and --blocked-by edit it, and the edit tells its watchers (who opened it, its Agent and agents, its Reviewer, whoever was named in Notify, and whoever commented); --notify tells more people, --quiet tells nobody. --label adds labels and --unlabel takes them off (friction, area:client: lower-case letters, digits and - _ . :); a label-only edit tells nobody unless --notify names people. An issue is Blocked until each issue it's blocked by is Done. abso issue new opens one; --lines ties it to lines at a version of shared, --agent says who it's for, --notify tells people now, and --label labels it. --attach shot.png,after.png puts images on a new issue or a comment (png, jpeg, gif or webp, 10 MB each; the server checks the type by the bytes and takes out metadata such as where a photo was taken. An svg, up to 1 MB, is drawn as a png, and its own file is kept as a download, on servers that take svg), and prints each one's id for the text to point at; the issue's page lists them with a link, and --save-attachments <folder> saves every one on the issue and its comments there as <id>-<name> (an svg's own file too), outside the abso folder or where abso leaves files out. --copy-to <project> copies the issue into another project, with its comments, answered asks and labels, each keeping its author and time; --dry-run shows what would go and writes nothing, and --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). Copying out of a project on a live server takes an owner of that project. abso issue draft \"<title>\" [the same fields] saves a draft instead: yours alone, with no number and no news; abso issue draft <D> [fields] changes it, --open opens it as an issue, --delete deletes it.",
--- a/client/src/mcp.ts
+++ b/client/src/mcp.ts
@@ -120,8 +120,8 @@
122122
123−/** The tool inputs that name files on this machine to read, comma-separated: each is confined like the folder. */
124−export const FILE_INPUTS = ["attach", "clean"] as const;
123+/** The tool inputs that name files or folders on this machine to read or write, comma-separated: each is confined like the folder. */
125125
@@ -149,7 +149,7 @@
152− refused: `--${flag} ${p} is outside ${start}, the folder this server started in; a tool reads files from there or below`,
152+ refused: `--${flag} ${p} is outside ${start}, the folder this server started in; a tool reads and writes files only there or below`,
--- a/client/test/attach.test.ts
+++ b/client/test/attach.test.ts
@@ -3,7 +3,7 @@
44
6−import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
@@ -43,6 +43,20 @@
46+ // Issue 8 carries an svg-drawn image on itself and again on a comment, plus one more on the comment.
51+ comments: [{ attachments: [logo, { id: "a00000000000c", name: "after.png", type: "image/png", size: 13 }] }],
59+ return res.writeHead(200, { "content-type": "image/png" }).end(`${served[1]}${served[2] ?? ""}`);
@@ -142,6 +156,29 @@
144158
159+ it("--save-attachments saves each attachment once, an svg's own file too, outside the folder", async () => {
166+ assert.deepEqual(names, ["a00000000000b-logo.svg", "a00000000000b-shot_one.png", "a00000000000c-after.png"]);
167+ assert.equal(readFileSync(join(out, "images", "a00000000000b-logo.svg"), "utf8"), "a00000000000b/source");
168+ assert.equal(readFileSync(join(out, "images", "a00000000000c-after.png"), "utf8"), "a00000000000c");
181+
--- a/client/test/client.test.ts
+++ b/client/test/client.test.ts
@@ -1925,16 +1925,22 @@
1928− assert.deepEqual(listAll(out), [".abso-export.json", ".absoignore", "index.html", "src/game.ts", "src/new.ts"]);
1928+ assert.deepEqual(listAll(out), [".abso-export", ".absoignore", "index.html", "src/game.ts", "src/new.ts"]);
19301930 assert.equal(read(out, "index.html"), "<p>v0</p>\n", "published files, not the unpublished edit");
1931− assert.equal(JSON.parse(read(out, ".abso-export.json")).version, 1);
1932− // The newest by default; an earlier export's folder is replaced whole.
1935+ // The newest by default; an earlier export's folder is replaced whole, one stamped by an older client too.
1936− /^Exported version 2 of shared to .*build: 4 files\. \.abso-export\.json there names the version/,
19391945 // Exporting again keeps the build's node_modules (abso never exports it) and what --keep names, and nothing else.
@@ -2694,6 +2700,9 @@
26952701 assert.match(refused({ clean: "../clean.json" }), /^--clean \.\.\/clean\.json is outside/);
2704+ assert.match(refused({ "save-attachments": "../images" }), /^--save-attachments \.\.\/images is outside/);
26972706 assert.deepEqual(confineCall(start, { folder: "sub", attach: "../a.txt" }), { folder: join(start, "sub") });