@pebbly/aseprite-ai-artist 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,48 @@ All notable changes to this project are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versioning is
5
5
  [semver](https://semver.org/).
6
6
 
7
+ ## [0.1.5] — 2026-09-09
8
+
9
+ Three commands reported success while doing nothing. That is worse than an
10
+ error: the agent believes the edit landed and builds the next step on top of it.
11
+ All three surfaced while drawing a 35-layer scene through the bridge, none of
12
+ them from a crash.
13
+
14
+ ### Fixed
15
+
16
+ - **`layer` op `group` could never have worked.** It called
17
+ `Sprite:newGroupLayer()`, which is not in the Aseprite API. Indexing a missing
18
+ field throws rather than returning nil, so the whole batch — every other op in
19
+ it included — rolled back with `Field newGroupLayer does not exist`. The
20
+ method is `newGroup()`.
21
+ - **`cel` op `link` linked nothing and counted everything.** `LinkCels` acts on
22
+ the timeline range, not on the active layer and frame; the old code set those
23
+ and called the command once per target frame, which is a no-op, then reported
24
+ one success per frame. A caller was told a static layer had been shared across
25
+ a cycle while the target frames were still empty. The range now holds the
26
+ source cel and every target together in one call, the reply counts only frames
27
+ that actually ended up sharing the source image, and linking from a frame with
28
+ no cel is now an error naming `copy` as the way to seed one.
29
+ - **`validate` timed out on a large sprite.** Its stray and outline scans asked
30
+ `pixel_to_hex` — a `string.format` — whether a pixel was opaque, for every
31
+ pixel and each of its four neighbours: tens of millions of strings allocated
32
+ to compute a boolean. Presence is now answered without allocating. Measured on
33
+ the 35-layer, 36-frame sprite this was found on, the stray scan went from
34
+ 10.5s to 2.2s and found the identical 1373 strays.
35
+
36
+ ### Changed
37
+
38
+ - **The per-pixel checks skip hidden layers**, as `outline` and `banding`
39
+ already did. A finding about pixels that never reach the export is noise, and
40
+ a document that keeps its earlier drafts as hidden layers is mostly hidden —
41
+ on the sprite above, 769 of 1042 cels. `validate` now says how many layers it
42
+ passed over, so a clean result cannot quietly mean "clean, because I did not
43
+ look".
44
+ - `validate.run` gets its own 120s budget rather than the shared 20s default. A
45
+ thorough pass over a rigged sprite is legitimately slow, and a timeout reads
46
+ to an agent as "Aseprite is not answering" — the one message that sends it
47
+ looking for a workaround.
48
+
7
49
  ## [0.1.4] — 2026-09-08
8
50
 
9
51
  ### Fixed
package/README.md CHANGED
@@ -1,55 +1,54 @@
1
1
  <div align="center">
2
2
 
3
- <img src="docs/media/hero.gif" alt="A pixel robot paints a mushroom house, stroke by stroke" width="512">
3
+ <img src="docs/media/hero2.gif" alt="A pixel robot at an easel paints a landscape stroke by stroke under a pendant lamp" width="768">
4
4
 
5
5
  # Aseprite AI Artist
6
6
 
7
- **Let a coding agent draw pixel art in your open Aseprite window** not in a
8
- copy, not on disk, in the document you are looking at.
7
+ **Your coding agent draws pixel art in the Aseprite window you already have
8
+ open.** Not a copy, not a file on disk the document you are looking at.
9
9
 
10
10
  [![npm](https://img.shields.io/npm/v/@pebbly/aseprite-ai-artist?color=%23e07a3f&label=npm)](https://www.npmjs.com/package/@pebbly/aseprite-ai-artist)
11
11
  [![CI](https://github.com/with-pebbly/aseprite-ai-artist/actions/workflows/ci.yml/badge.svg)](https://github.com/with-pebbly/aseprite-ai-artist/actions/workflows/ci.yml)
12
12
  [![licence](https://img.shields.io/badge/licence-MIT-blue)](LICENSE)
13
13
 
14
- *Forty frames, one 16-colour palette, drawn by Codex through this server in a
15
- live Aseprite window — silhouette, flats, hue-shifted shading, then the lights
16
- come on. Nobody touched a pixel by hand.*
14
+ <sub>192×96, 36 frames, one palette. Drawn through this server into a live
15
+ Aseprite window — the paint appears under the brush, every frame.</sub>
17
16
 
18
17
  </div>
19
18
 
20
19
  ---
21
20
 
22
- One MCP server, one Aseprite extension, and a pixel-art rulebook the agent
23
- actually has to follow. Works with **Claude Code, Codex CLI, Gemini CLI, Cursor,
24
- VS Code and Windsurf** from the same one-line config.
21
+ ## What it does
22
+
23
+ You ask for something. It gets drawn, in front of you.
25
24
 
26
25
  > *"Draw me a 32×32 knight in the PICO-8 palette, then a 4-frame idle."*
27
26
 
28
- The agent inspects the document, picks a palette, blocks in a silhouette,
29
- **looks at what it drew**, shades with proper hue shifting, rigs the character
30
- onto layers, animates, tags the cycle, validates, and tells you what it
31
- compromised on. In your window, undoable, one Ctrl+Z per edit.
27
+ The agent picks a palette, blocks in a silhouette, **looks at what it drew**,
28
+ shades it, splits it onto layers, animates, tags the cycle, and tells you what it
29
+ had to compromise on. Every edit is one Ctrl+Z.
32
30
 
33
- ---
31
+ Works with **Claude Code, Codex CLI, Gemini CLI, Cursor, VS Code and Windsurf**
32
+ from the same one-line config.
34
33
 
35
34
  ## Install
36
35
 
37
- **Requires [Aseprite](https://www.aseprite.org/) 1.3 or newer and Node 22.6+.**
38
- Aseprite must have been run at least once, so that its config directory exists.
36
+ You need [Aseprite](https://www.aseprite.org/) 1.3+ and Node 22.6+. Open Aseprite
37
+ once before you start, so its config folder exists.
39
38
 
40
- ### Step 1 — install the Aseprite extension
39
+ **1 — Install the extension**
41
40
 
42
41
  ```bash
43
42
  npx @pebbly/aseprite-ai-artist install-extension
44
43
  ```
45
44
 
46
- Then **quit and reopen Aseprite**. The extension only dials out at startup, so
47
- an editor left running from before the install will never connect.
45
+ Then quit and reopen Aseprite. It only dials out at startup, so an editor left
46
+ running from before the install will never connect.
48
47
 
49
- ### Step 2 — wire up your agent
48
+ **2 — Connect your agent**
50
49
 
51
50
  <details open>
52
- <summary><b>Claude Code</b> — install the plugin, not the bare server</summary>
51
+ <summary><b>Claude Code</b> — the plugin, not the bare server</summary>
53
52
 
54
53
  <br>
55
54
 
@@ -58,14 +57,14 @@ an editor left running from before the install will never connect.
58
57
  /plugin install aseprite-ai-artist
59
58
  ```
60
59
 
61
- The plugin carries its own MCP server plus the `/pixel-*` skills, the specialist
62
- subagents and the preview hooks. **Do not also add the server by hand** — you
63
- would load the same eighteen tools twice, on every request.
60
+ It brings its own server plus the `/pixel-*` commands, the subagents and the
61
+ preview hooks. Don't also add the server by hand — you'd load all eighteen tools
62
+ twice, on every request.
64
63
 
65
64
  </details>
66
65
 
67
66
  <details>
68
- <summary><b>Codex CLI, Gemini CLI, Cursor, VS Code, Windsurf</b></summary>
67
+ <summary><b>Codex, Gemini, Cursor, VS Code, Windsurf</b></summary>
69
68
 
70
69
  <br>
71
70
 
@@ -73,136 +72,94 @@ would load the same eighteen tools twice, on every request.
73
72
  npx @pebbly/aseprite-ai-artist install codex # ~/.codex/config.toml
74
73
  npx @pebbly/aseprite-ai-artist install gemini # ~/.gemini/settings.json
75
74
  npx @pebbly/aseprite-ai-artist install cursor # ~/.cursor/mcp.json
76
- npx @pebbly/aseprite-ai-artist install --all # every client above
75
+ npx @pebbly/aseprite-ai-artist install --all # all of the above
77
76
  ```
78
77
 
79
- Existing config is backed up first. `--dry-run` shows the change without making
80
- it; `--project` writes into the repository instead of your home directory;
81
- `--agents` also appends a section to your `AGENTS.md`.
78
+ Your existing config is backed up first. `--dry-run` shows the change without
79
+ making it, `--project` writes into the repo instead of your home directory.
82
80
 
83
81
  </details>
84
82
 
85
- Then **restart the agent** so it picks up the new server.
83
+ Restart the agent afterwards so it picks up the new server.
86
84
 
87
- ### Step 3 — check it
85
+ **3 — Check it**
88
86
 
89
87
  ```bash
90
88
  npx @pebbly/aseprite-ai-artist doctor
91
89
  ```
92
90
 
93
- Ticks all the way down and you are ready. If a line is not a tick, it names
94
- which half is missing instead of making you guess.
95
-
96
- Per-client detail and troubleshooting: **[docs/INSTALL.md](docs/INSTALL.md)**.
97
-
98
- ---
99
-
100
- ## Which agent should do the drawing?
101
-
102
- Two separate things matter, and they do not point at the same client.
103
-
104
- **Integration** — how much of the craft a client can actually receive:
91
+ Ticks all the way down and you're ready. If something's missing it says which
92
+ half, instead of making you guess. More detail in
93
+ [docs/INSTALL.md](docs/INSTALL.md).
105
94
 
106
- | Client | Tools | `rules://` + `skill://` | MCP prompts | Slash commands, subagents, hooks |
107
- |---|:--:|:--:|:--:|:--:|
108
- | Claude Code | ✅ | ✅ | ✅ | ✅ via the plugin |
109
- | Codex CLI | ✅ | ✅ | ✖ | — |
110
- | Gemini CLI, Cursor, VS Code, Windsurf | ✅ | ✅ | varies | — |
95
+ ## Which model should do the drawing?
111
96
 
112
- **Drawing ability**hands-on impression rather than a benchmark, and the part
113
- that surprises people:
97
+ Not a benchmark a log of what actually drew the art on this page. Models we
98
+ haven't run are listed as untested rather than guessed at.
114
99
 
115
- - **Reasoning effort matters more than you would expect.** Placing pixels on a
116
- 32×32 grid is a spatial problem: the model has to hold a coordinate frame in
117
- its head, keep a silhouette readable at that size, and notice when a shape has
118
- gone wrong. Turn reasoning up before you blame the tool.
119
- - **Codex CLI on a high-reasoning setting is the best drawer we have used** it
120
- drew the animation at the top of this page and the mascot below, working from
121
- a brief and the rulebook alone.
100
+ | Model | What it drew | How it went |
101
+ |---|---|---|
102
+ | **Claude Fable 5.1** | the animation up top | Best so far. One session, no review passes needed. |
103
+ | **Codex CLI** `gpt-5.6-terra`, high reasoning | the harbour below, and the mascot | Strong, but it took five rounds of critique. |
104
+ | **Claude Opus 5** | the server, the rulebook, every review pass | The planner and the critic. Its own drawing attempt got scrapped. |
105
+ | Gemini 3 Pro, Sonnet 5, Cursor, others | — | Untested. Run one and send us the sprite. |
122
106
 
123
- <img src="docs/media/mascot.png" alt="The mascot" width="96">
124
-
125
- - **Claude Code is the better planner and critic.** Palette construction, rig
126
- layout, animation timing and the review pass come out noticeably stronger;
127
- raw pixel placement at small canvas sizes is weaker.
128
- - If you have both, split the work: brief and review in Claude Code with
129
- `pixel-brief` and `pixel-review`, execute the drawing passes in Codex. They
130
- talk to the same live document through the same bridge, so they can take turns
131
- on one sprite.
107
+ <div align="center">
108
+ <img src="docs/media/mascot.png" alt="The mascot" width="96"><br>
109
+ <sub><i>the mascot Codex, from the brief and the rulebook alone</i></sub>
110
+ </div>
132
111
 
133
- The rulebook narrows the gap a long way an agent that never reads a word of it
134
- still cannot casually widen your palette, because `draw` and `recolor` snap by
135
- perceptual distance and report every colour they moved. It does not close it.
112
+ **Method mattered more than the model.** Both good results came the same way:
136
113
 
137
- ---
114
+ - **Generate, don't hand-place.** Write a small program that emits every frame,
115
+ then push it. Placing pixels one call at a time by eye is where the weak
116
+ attempts died.
117
+ - **Look at frames full-size, one at a time.** A filmstrip is a trap — at that
118
+ size you see what you already know is meant to be there.
119
+ - **Turn reasoning up** before you blame the model. A 32×32 grid is a spatial
120
+ problem.
138
121
 
139
- ## What makes it different
122
+ ## Why this one
140
123
 
141
124
  **It works everywhere, not just in Claude Code.** Most Aseprite MCP projects put
142
- their craft knowledge in a Claude Code plugin. Codex, Gemini and Cursor then get
143
- raw tools and none of the discipline which is most of what separates a sprite
144
- from coloured noise. Here the rules and workflows are served over MCP as
145
- `rules://` and `skill://` resources *and* as MCP prompts, so every client gets
146
- them from one source of truth.
125
+ their craft knowledge in a Claude Code plugin, so Codex and Cursor get raw tools
126
+ and none of the discipline. Here the rules and workflows are served over MCP, so
127
+ every client reads the same source of truth.
147
128
 
148
129
  **Eighteen tools, not ninety.** Every tool schema sits in the model's context on
149
- every turn, whether or not you are drawing. Grouping by noun with an `op` enum,
150
- plus batch arrays, covers the same ground at roughly a sixth of the cost — and
151
- makes batching the default, so one `draw` call is one undo step for you.
130
+ every turn, drawing or not. Grouping by noun with an `op` enum covers the same
131
+ ground at a sixth of the cost — and makes batching the default, so one `draw`
132
+ call is one undo step for you.
152
133
 
153
- **One config line on every OS.** No compiled binary, no per-platform path, no
154
- native dependencies. `npx` and go.
134
+ **It has to look at its own work.** `look` gives the agent an upscaled preview, a
135
+ one-glyph-per-pixel text grid, a filmstrip and a frame-to-frame diff. `validate`
136
+ then checks the sprite mechanically before anything is called finished.
155
137
 
156
- **It has to look at its own work.** `look` gives the agent an upscaled preview,
157
- an exact one-glyph-per-pixel text grid, a filmstrip of every animation frame,
158
- and a pixel-level diff between frames. `validate` then checks the sprite
159
- mechanically before anything gets called finished.
138
+ **It can't quietly wreck your file.** With Aseprite detached, every tool refuses
139
+ immediately instead of timing out because an agent that "recovers" by editing
140
+ the `.aseprite` on disk makes changes you never see, and your next save
141
+ overwrites them.
160
142
 
161
- **It cannot quietly wreck your file.** When Aseprite is not attached, every tool
162
- refuses immediately with `doNotFallBackToDisk` rather than timing out — because
163
- an agent that "recovers" by editing the `.aseprite` file makes changes you never
164
- see, and your next save overwrites them.
165
-
166
- There is [a whole page](docs/RESEARCH.md) on the other projects in this space,
167
- what was taken from them, and where they are still better.
168
-
169
- ---
143
+ There's [a whole page](docs/RESEARCH.md) on the other projects in this space and
144
+ where they're still better.
170
145
 
171
- ## The tools
146
+ ## What's inside
172
147
 
173
- Eighteen, grouped by noun. Full reference in **[docs/TOOLS.md](docs/TOOLS.md)**.
148
+ **Eighteen tools**, grouped by noun `preflight` · `sprite_info` ·
149
+ `sprite_manage` · `look` · `read_pixels` · `draw` · `select` · `transform` ·
150
+ `recolor` · `layer` · `frame` · `tag` · `cel` · `palette` · `validate` ·
151
+ `reference` · `export` · `tileset`, plus `run_lua` as an escape hatch, off by
152
+ default. Full reference: [docs/TOOLS.md](docs/TOOLS.md).
174
153
 
175
- | | |
176
- |---|---|
177
- | **Session** | `preflight` · `sprite_info` · `sprite_manage` |
178
- | **Looking** | `look` · `read_pixels` |
179
- | **Drawing** | `draw` · `select` · `transform` · `recolor` |
180
- | **Structure** | `layer` · `frame` · `tag` · `cel` |
181
- | **Colour & quality** | `palette` · `validate` |
182
- | **Assets** | `reference` · `export` · `tileset` |
154
+ **Eleven workflows** the agent follows, served to every client — `pixel-brief` ·
155
+ `pixel-new` · `pixel-palette` · `pixel-draw` · `pixel-shade` · `pixel-rig` ·
156
+ `pixel-animate` · `pixel-tileset` · `pixel-review` · `pixel-fix` ·
157
+ `pixel-export`. In Claude Code you also get four specialists: **pixel-critic**,
158
+ **palette-smith**, **rig-builder**, **animation-director**.
183
159
 
184
- Plus `run_lua` as an escape hatch, off by default.
185
-
186
- ## The skills
187
-
188
- Workflows the agent follows, served to every client:
189
-
190
- `pixel-brief` · `pixel-new` · `pixel-palette` · `pixel-draw` · `pixel-shade` ·
191
- `pixel-rig` · `pixel-animate` · `pixel-tileset` · `pixel-review` · `pixel-fix` ·
192
- `pixel-export`
193
-
194
- And in Claude Code, four specialist subagents: **pixel-critic** (visual QA),
195
- **palette-smith** (colour), **rig-builder** (layer rigs), **animation-director**
196
- (cycle planning).
197
-
198
- ## The rules
199
-
200
- The craft is encoded in [`rules/`](rules/) and served as `rules://` resources —
201
- palette discipline, hue-shifted shading, silhouette and proportion, outlines and
202
- edges, animation timing, layer rigging, and a review checklist. Skills reference
203
- rules rather than restating them, so a rule has exactly one place to be wrong.
204
-
205
- ---
160
+ **A rulebook** in [`rules/`](rules/) palette discipline, hue-shifted shading,
161
+ silhouette, outlines, animation timing, layer rigging, review checklist. Skills
162
+ reference rules rather than restating them, so a rule has one place to be wrong.
206
163
 
207
164
  ## How it works
208
165
 
@@ -211,38 +168,39 @@ your agent ──stdio/MCP──▶ server ──ws:9932──▶ bridge
211
168
  ```
212
169
 
213
170
  Aseprite's Lua WebSocket is a client only, so the bridge holds the listening
214
- socket. It runs as its own singleton process so that restarting the MCP server —
215
- which agent hosts do freely — does not drop your Aseprite connection, and so a
216
- second agent window can attach without stealing the first one's replies.
171
+ socket. It runs as its own process, so restarting the MCP server — which agent
172
+ hosts do freely — doesn't drop your Aseprite connection, and a second agent
173
+ window can attach without stealing the first one's replies. Details in
174
+ [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
217
175
 
218
- Details in **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)** and the
219
- [ADRs](docs/adr/).
176
+ Both ports bind `127.0.0.1` only. `run_lua` is arbitrary code execution inside
177
+ the app holding your unsaved work, and stays off unless you turn it on — full
178
+ threat model in [SECURITY.md](SECURITY.md).
220
179
 
221
180
  ## Development
222
181
 
223
182
  ```bash
224
- npm install
225
- npm run build
226
- npm test # TypeScript: colour, render, bridge, MCP surface, CLI
227
- npm run test:pure # Lua that needs no editor also what CI runs
228
- npm run test:extension # Lua handlers, headless, against a real sprite
183
+ npm install && npm run build
184
+ npm test # TypeScript
185
+ npm run test:pure # Lua that needs no editor what CI runs
186
+ npm run test:extension # the real handlers, headless, against a real sprite
229
187
  ```
230
188
 
231
- `test:extension` runs the real command handlers inside `aseprite -b` against a
232
- real sprite — the only way to prove that half works without a human clicking.
233
- It needs Aseprite installed, so CI cannot run it; `test:pure` is the part that
234
- runs anywhere.
189
+ `test:extension` needs Aseprite installed, so CI can't run it.
190
+
191
+ ## One more, drawn the same way
235
192
 
236
- ## Security
193
+ <div align="center">
237
194
 
238
- The bridge binds `127.0.0.1` only, on both ports. There is no remote surface and
239
- no authentication, because there is nothing remote to authenticate. `run_lua` is
240
- arbitrary code execution inside the app holding your unsaved work, and is off
241
- unless you turn it on. Full threat model in [SECURITY.md](SECURITY.md).
195
+ <img src="docs/media/harbour.gif" alt="A pixel-art harbour at night: a lighthouse beam sweeps over the water, windows flicker, smoke drifts from a chimney" width="768">
242
196
 
243
- ## Licence
197
+ <sub>256×144, 28 frames, ten layers. Only six of them move — beam, windows,
198
+ water, smoke, boat, stars — each on its own cycle length, which is what keeps an
199
+ ambient loop from feeling mechanical.</sub>
244
200
 
245
- MIT. See [LICENSE](LICENSE).
201
+ </div>
202
+
203
+ ## Licence
246
204
 
247
- Aseprite is a trademark of Igara Studio S.A. This project is not affiliated with
248
- or endorsed by them.
205
+ MIT — see [LICENSE](LICENSE). Aseprite is a trademark of Igara Studio S.A.; this
206
+ project isn't affiliated with them.
@@ -105,10 +105,10 @@ export class LiveClient {
105
105
  */
106
106
  // TODO(boundary): only the call sites whose fields feed a summary or a
107
107
  // decision declare `expect` — draw.batch, recolor.apply, export.run,
108
- // session.site, sprite.info. The rest (select, transform, reference, tileset,
109
- // look, palette) still rest on `call<T>` alone. Extend as each is checked
110
- // against a real reply; guessing a field name here turns a working path into
111
- // a hard error.
108
+ // session.site, sprite.info, validate.run. The rest (select, transform,
109
+ // reference, tileset, look, palette) still rest on `call<T>` alone. Extend as
110
+ // each is checked against a real reply; guessing a field name here turns a
111
+ // working path into a hard error.
112
112
  async call(cmd, args = {}, opts = {}) {
113
113
  const expect = opts.expect ?? [];
114
114
  const timeoutMs = opts.timeoutMs ?? this.timeoutMs;
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/bridge/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAGL,oBAAoB,EAEpB,SAAS,EAET,aAAa,EACb,QAAQ,EACR,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,yFAAyF;AACzF,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAiBjC,MAAM,OAAO,UAAU;IACJ,WAAW,CAAS;IACpB,UAAU,CAAS;IACnB,SAAS,CAAU;IACnB,SAAS,CAAS;IAClB,GAAG,CAAwB;IAEpC,MAAM,GAAqB,IAAI,CAAC;IAChC,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IACrC,GAAG,GAAG,CAAC,CAAC;IACR,cAAc,GAAG,iBAAiB,CAAC;IACnC,cAAc,GAA0B,IAAI,CAAC;IAC7C,MAAM,GAAG,KAAK,CAAC;IACf,WAAW,GAAG,CAAC,CAAC;IAChB,UAAU,GAAkB,IAAI,CAAC;IAEjC,KAAK,GAA4B,IAAI,CAAC;IAE9C,YAAY,OAA0B,EAAE;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,CA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AE,MAAyB;IAC9D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;IACrB,CAAC;IACD,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;AACtD,CAAC"}
@@ -119,7 +119,7 @@ export function registerCraftTools(server, live) {
119
119
  annotations: { readOnlyHint: true, openWorldHint: false },
120
120
  }, async (args) => {
121
121
  try {
122
- const data = await live.call("validate.run", args);
122
+ const data = await live.call("validate.run", args, { expect: ["findings"], timeoutMs: 120_000 });
123
123
  const errors = data.findings.filter((f) => f.severity === "error");
124
124
  const warnings = data.findings.filter((f) => f.severity === "warning");
125
125
  const passed = errors.length === 0 && (!args.strict || warnings.length === 0);
@@ -1 +1 @@
1
- {"version":3,"file":"craft.js","sourceRoot":"","sources":["../../src/tools/craft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,IAAgB;IACpE,MAAM,CAAC,YAAY,CACjB,SAAS,EACT;QACE,KAAK,EAAE,SAAS;QAChB,WAAW,EACT,qEAAqE;YACrE,6IAA6I;YAC7I,uGAAuG;YACvG,oDAAoD;YACpD,mFAAmF;YACnF,gEAAgE;YAChE,+GAA+G;QACjH,WAAW,EAAE;YACX,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAA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AAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBACzC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;oBACnC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACvC;aACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -15,7 +15,7 @@
15
15
  --------------------------------------------------------------------------------
16
16
 
17
17
  local PROTOCOL_VERSION = 1
18
- local EXTENSION_VERSION = "0.1.4"
18
+ local EXTENSION_VERSION = "0.1.5"
19
19
 
20
20
  -- Optional capabilities. The wire version stays 1 across builds; new command
21
21
  -- families are gated on these flags plus the loud unsupported_command reply,
@@ -105,6 +105,21 @@ local function pixel_to_hex(sprite, value)
105
105
  end
106
106
  end
107
107
 
108
+ -- "Is there paint here?" without asking which colour. The scans in validate
109
+ -- test presence far more often than they read a colour — every opaque pixel
110
+ -- plus its four neighbours — and pixel_to_hex answers with a string.format,
111
+ -- so it allocated tens of millions of strings to compute a boolean.
112
+ local function pixel_is_opaque(sprite, value)
113
+ local pc = app.pixelColor
114
+ if sprite.colorMode == ColorMode.INDEXED then
115
+ if value == sprite.transparentColor then return false end
116
+ return value < #sprite.palettes[1]
117
+ elseif sprite.colorMode == ColorMode.GRAY then
118
+ return pc.grayaA(value) ~= 0
119
+ end
120
+ return pc.rgbaA(value) ~= 0
121
+ end
122
+
108
123
  -- Convert a Color into the raw pixel value this sprite's colour mode stores.
109
124
  local function color_to_pixel(sprite, color)
110
125
  local pc = app.pixelColor
@@ -1322,7 +1337,10 @@ local function apply_layer_op(s, op)
1322
1337
  return
1323
1338
  end
1324
1339
  if kind == "group" then
1325
- local group = s:newGroupLayer()
1340
+ -- Sprite:newGroup(), not newGroupLayer(): the latter does not exist, and
1341
+ -- indexing a missing field throws rather than returning nil, so the whole
1342
+ -- batch transaction rolled back with "Field newGroupLayer does not exist".
1343
+ local group = s:newGroup()
1326
1344
  group.name = op.name or "group"
1327
1345
  for _, name in ipairs(op.names or {}) do find_layer(s, name).parent = group end
1328
1346
  return
@@ -1573,15 +1591,42 @@ H["cel.apply"] = function(args)
1573
1591
  s:newCel(dstLayer, dstFrame, src.image:clone(), src.position)
1574
1592
  applied = 1
1575
1593
  elseif op == "link" then
1576
- local frames = args.frames or {}
1594
+ -- LinkCels acts on the timeline range, not on app.layer/app.frame. The
1595
+ -- previous version set those and called the command once per frame, which
1596
+ -- linked nothing at all — and still counted one success per frame, so a
1597
+ -- caller was told a static layer had been shared across a cycle when the
1598
+ -- target frames were still empty. The range has to hold the source cel
1599
+ -- and every target together, in one call.
1600
+ local targets = args.frames or {}
1601
+ if #targets == 0 then
1602
+ fault("invalid_args", "cel op 'link' needs 'frames' — the frames to share this cel with.")
1603
+ end
1604
+ local source = get_cel(s, layer, frame, false)
1605
+ if not source then
1606
+ fault("invalid_args", "No cel on '" .. layer.name .. "' frame " .. frame.frameNumber ..
1607
+ " to link from. Draw it there first, or use op 'copy'.")
1608
+ end
1609
+
1610
+ local numbers = { frame.frameNumber }
1611
+ for _, n in ipairs(targets) do numbers[#numbers + 1] = find_frame(s, n).frameNumber end
1612
+
1577
1613
  preserving_site(function()
1578
- app.layer = layer
1579
- for _, n in ipairs(frames) do
1580
- app.frame = find_frame(s, n)
1581
- app.command.LinkCels()
1582
- applied = applied + 1
1583
- end
1614
+ app.sprite = s
1615
+ app.range.layers = { layer }
1616
+ app.range.frames = numbers
1617
+ app.command.LinkCels()
1618
+ pcall(function() app.range:clear() end)
1584
1619
  end)
1620
+
1621
+ -- Count what happened rather than what was asked for: linking replaces
1622
+ -- the shared image, so a target counts only if it now holds the same
1623
+ -- image object as the source does afterwards.
1624
+ local shared = layer:cel(frame)
1625
+ local id = shared and shared.image.id
1626
+ for _, n in ipairs(targets) do
1627
+ local c = layer:cel(find_frame(s, n))
1628
+ if c and id and c.image.id == id then applied = applied + 1 end
1629
+ end
1585
1630
  elseif op == "unlink" then
1586
1631
  preserving_site(function()
1587
1632
  app.layer = layer; app.frame = frame; app.command.UnlinkCel(); applied = 1
@@ -2911,6 +2956,13 @@ H["validate.run"] = function(args)
2911
2956
  end
2912
2957
  end
2913
2958
 
2959
+ -- Hidden layers are skipped by the per-pixel scans, the way outline and
2960
+ -- banding already skipped them: a finding about pixels that do not reach the
2961
+ -- export is noise, and a document that keeps its earlier drafts around as
2962
+ -- hidden layers is mostly hidden — on the sprite this was measured against,
2963
+ -- 769 of 1042 cels, which is where the 20s budget went.
2964
+ local hidden_skipped = 0
2965
+
2914
2966
  for _, layer in ipairs(s.layers) do
2915
2967
  if not layer.isGroup then
2916
2968
  if wanted.layers and #layer.cels == 0 then
@@ -2918,22 +2970,24 @@ H["validate.run"] = function(args)
2918
2970
  "Layer '" .. layer.name .. "' has no cels on any frame.", { layer = layer.name })
2919
2971
  end
2920
2972
 
2973
+ if not layer.isVisible then hidden_skipped = hidden_skipped + 1 end
2974
+
2921
2975
  for _, cel in ipairs(layer.cels) do
2922
2976
  local img = cel.image
2923
2977
 
2924
- if wanted.strays then
2978
+ if wanted.strays and layer.isVisible then
2925
2979
  -- A lone opaque pixel with no opaque neighbour is nearly always a
2926
2980
  -- misplaced click or an off-by-one in generated coordinates.
2927
2981
  local strays = 0
2928
2982
  local first = nil
2929
2983
  for y = 0, img.height - 1 do
2930
2984
  for x = 0, img.width - 1 do
2931
- if pixel_to_hex(s, img:getPixel(x, y)) then
2985
+ if pixel_is_opaque(s, img:getPixel(x, y)) then
2932
2986
  local neighbours = 0
2933
2987
  for _, d in ipairs({ { 1, 0 }, { -1, 0 }, { 0, 1 }, { 0, -1 } }) do
2934
2988
  local nx, ny = x + d[1], y + d[2]
2935
2989
  if nx >= 0 and ny >= 0 and nx < img.width and ny < img.height
2936
- and pixel_to_hex(s, img:getPixel(nx, ny)) then neighbours = neighbours + 1 end
2990
+ and pixel_is_opaque(s, img:getPixel(nx, ny)) then neighbours = neighbours + 1 end
2937
2991
  end
2938
2992
  if neighbours == 0 then
2939
2993
  strays = strays + 1
@@ -2950,7 +3004,7 @@ H["validate.run"] = function(args)
2950
3004
  end
2951
3005
  end
2952
3006
 
2953
- if wanted.antialiasing and s.colorMode ~= ColorMode.INDEXED then
3007
+ if wanted.antialiasing and layer.isVisible and s.colorMode ~= ColorMode.INDEXED then
2954
3008
  local semi = 0
2955
3009
  for y = 0, img.height - 1 do
2956
3010
  for x = 0, img.width - 1 do
@@ -2989,7 +3043,7 @@ H["validate.run"] = function(args)
2989
3043
  for _, d in ipairs({ { 1, 0 }, { -1, 0 }, { 0, 1 }, { 0, -1 } }) do
2990
3044
  local nx, ny = x + d[1], y + d[2]
2991
3045
  if nx < 0 or ny < 0 or nx >= img.width or ny >= img.height
2992
- or pixel_to_hex(s, img:getPixel(nx, ny)) == nil then exposed = true end
3046
+ or not pixel_is_opaque(s, img:getPixel(nx, ny)) then exposed = true end
2993
3047
  end
2994
3048
  if exposed then
2995
3049
  total = total + 1
@@ -3085,6 +3139,15 @@ H["validate.run"] = function(args)
3085
3139
  end
3086
3140
  end
3087
3141
 
3142
+ -- Say what was not looked at, rather than letting a clean result imply the
3143
+ -- whole document was checked.
3144
+ if hidden_skipped > 0 then
3145
+ add_finding(findings, "layers", "note",
3146
+ hidden_skipped .. " hidden layer(s) were not scanned for strays, outline, banding or " ..
3147
+ "antialiasing — those checks describe what the sprite shows. Make a layer visible to include it.",
3148
+ { count = hidden_skipped })
3149
+ end
3150
+
3088
3151
  return { sprite = sprite_display_name(s), findings = findings }
3089
3152
  end
3090
3153
 
@@ -2,7 +2,7 @@
2
2
  "name": "aseprite-ai-artist",
3
3
  "displayName": "Aseprite AI Artist",
4
4
  "description": "Lets a coding agent draw in this Aseprite session over a local WebSocket link. Connects to 127.0.0.1 only; nothing leaves the machine.",
5
- "version": "0.1.4",
5
+ "version": "0.1.5",
6
6
  "author": "with-pebbly",
7
7
  "publisher": "with-pebbly",
8
8
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pebbly/aseprite-ai-artist",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Agent-native control layer for Aseprite. MCP server (2025-11-25 spec, designed forward to 2026-07-28) + cross-agent skills for Claude Code, Codex, Gemini CLI and Cursor.",
5
5
  "license": "MIT",
6
6
  "type": "module",