@pixerate/editor 0.272.1 → 0.274.0

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.
Files changed (42) hide show
  1. package/dist/chunk-2A5IKZMU.js +557 -0
  2. package/dist/chunk-YH6SKC7P.cjs +557 -0
  3. package/dist/paint-editor/collaboration.d.cts +6 -1
  4. package/dist/paint-editor/collaboration.d.ts +6 -1
  5. package/dist/paint-editor/controller.d.cts +117 -0
  6. package/dist/paint-editor/controller.d.ts +117 -0
  7. package/dist/paint-editor/document.d.cts +1 -1
  8. package/dist/paint-editor/document.d.ts +1 -1
  9. package/dist/paint-editor/evolution-tools.d.cts +48 -0
  10. package/dist/paint-editor/evolution-tools.d.ts +48 -0
  11. package/dist/paint-editor/evolution.d.cts +175 -0
  12. package/dist/paint-editor/evolution.d.ts +175 -0
  13. package/dist/paint-editor/index.cjs +8500 -7258
  14. package/dist/paint-editor/index.d.cts +3 -0
  15. package/dist/paint-editor/index.d.ts +3 -0
  16. package/dist/paint-editor/index.js +8481 -7239
  17. package/dist/paint-editor/presence.d.cts +5 -1
  18. package/dist/paint-editor/presence.d.ts +5 -1
  19. package/dist/paint-editor/ui.d.cts +7 -2
  20. package/dist/paint-editor/ui.d.ts +7 -2
  21. package/dist/raster/fill.d.cts +85 -0
  22. package/dist/raster/fill.d.ts +85 -0
  23. package/dist/raster/index.cjs +9 -1
  24. package/dist/raster/index.d.cts +1 -0
  25. package/dist/raster/index.d.ts +1 -0
  26. package/dist/raster/index.js +8 -0
  27. package/package.json +1 -1
  28. package/skills/README.md +1 -0
  29. package/skills/pixerate-brushes/SKILL.md +3 -0
  30. package/skills/pixerate-paint-editor/SKILL.md +55 -96
  31. package/skills/pixerate-paint-editor/references/brush-facets.md +3 -0
  32. package/skills/pixerate-paint-editor/references/evolution.md +27 -0
  33. package/skills/pixerate-paint-editor/references/mutation.md +25 -0
  34. package/skills/pixerate-paint-editor/references/oils.md +8 -1
  35. package/skills/pixerate-paint-editor/references/smart-inks.md +51 -0
  36. package/skills/pixerate-paint-mutation/SKILL.md +76 -0
  37. package/skills/pixerate-paint-mutation/evals/decline-unanswered.json +58 -0
  38. package/skills/pixerate-paint-mutation/evals/dry-ink-answer.json +74 -0
  39. package/skills/pixerate-paint-mutation/evals/wet-wash-answer.json +76 -0
  40. package/skills/pixerate-paint-oil-impasto/SKILL.md +2 -1
  41. package/skills/pixerate-paint-sketch-to-finish/SKILL.md +16 -5
  42. package/skills/pixerate-paint-sketch-to-finish/evals/flats-under-ink.json +2 -3
@@ -0,0 +1,74 @@
1
+ {
2
+ "prompt": "Claim the pending dry ink mutation on the canvas, let its temporary layer fade out, and answer with a crimson (#dc2626) ink stroke.",
3
+ "fixture": {
4
+ "editor": "paint",
5
+ "width": 200,
6
+ "height": 200,
7
+ "setup": [
8
+ { "tool": "set_brush", "args": { "id": "mutation-ink" } },
9
+ {
10
+ "tool": "paint_stroke",
11
+ "args": {
12
+ "color": "#1e293b",
13
+ "points": [
14
+ { "x": 30, "y": 80, "pressure": 0.8 },
15
+ { "x": 110, "y": 80, "pressure": 0.8 }
16
+ ]
17
+ }
18
+ },
19
+ { "tool": "advance_wet_paint", "args": { "seconds": 2 } }
20
+ ]
21
+ },
22
+ "checks": [
23
+ {
24
+ "tool": "list_mutations",
25
+ "expect": { "mutations": { "$length": 0 } },
26
+ "why": "No pending mutations remain"
27
+ },
28
+ {
29
+ "tool": "list_mutations",
30
+ "args": { "includeAll": true },
31
+ "expect": {
32
+ "mutations": [
33
+ {
34
+ "id": "m1",
35
+ "state": "answered"
36
+ }
37
+ ]
38
+ },
39
+ "why": "Mutation m1 was claimed and answered"
40
+ },
41
+ {
42
+ "tool": "list_strokes",
43
+ "expect": {
44
+ "strokes": {
45
+ "$length": 1,
46
+ "$every": { "color": "#dc2626" }
47
+ }
48
+ },
49
+ "why": "The temporary mutation stroke faded away and only the crimson answer stroke remains"
50
+ }
51
+ ],
52
+ "solution": [
53
+ { "tool": "list_mutations" },
54
+ { "tool": "read_mutation", "args": { "id": "m1" } },
55
+ {
56
+ "tool": "answer_mutation",
57
+ "args": {
58
+ "id": "m1",
59
+ "strokes": [
60
+ {
61
+ "brushId": "ink-pen",
62
+ "brush": { "tip": { "size": 8 } },
63
+ "color": "#dc2626",
64
+ "points": [
65
+ { "x": 60, "y": 40, "pressure": 0.7 },
66
+ { "x": 140, "y": 140, "pressure": 0.8 }
67
+ ]
68
+ }
69
+ ]
70
+ }
71
+ },
72
+ { "tool": "advance_wet_paint", "args": { "seconds": 3 } }
73
+ ]
74
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "prompt": "Claim the pending wet mutation stroke on the canvas, let it fade away, and paint a warm amber (#d97706) watercolour-round answer stroke across the canvas.",
3
+ "fixture": {
4
+ "editor": "paint",
5
+ "width": 200,
6
+ "height": 200,
7
+ "setup": [
8
+ { "tool": "set_brush", "args": { "id": "mutation-wash" } },
9
+ {
10
+ "tool": "paint_stroke",
11
+ "args": {
12
+ "color": "#2563eb",
13
+ "points": [
14
+ { "x": 40, "y": 100, "pressure": 0.8 },
15
+ { "x": 120, "y": 100, "pressure": 0.8 }
16
+ ]
17
+ }
18
+ },
19
+ { "tool": "advance_wet_paint", "args": { "seconds": 2 } }
20
+ ]
21
+ },
22
+ "checks": [
23
+ {
24
+ "tool": "list_mutations",
25
+ "expect": { "mutations": { "$length": 0 } },
26
+ "why": "No pending mutations remain"
27
+ },
28
+ {
29
+ "tool": "list_mutations",
30
+ "args": { "includeAll": true },
31
+ "expect": {
32
+ "mutations": [
33
+ {
34
+ "id": "m1",
35
+ "state": "answered",
36
+ "answerStrokeIds": { "$length": { "$min": 1 } }
37
+ }
38
+ ]
39
+ },
40
+ "why": "Mutation m1 was claimed and answered"
41
+ },
42
+ {
43
+ "tool": "list_strokes",
44
+ "expect": {
45
+ "strokes": {
46
+ "$some": { "color": "#d97706" }
47
+ }
48
+ },
49
+ "why": "The warm amber answer stroke is recorded on the canvas"
50
+ }
51
+ ],
52
+ "solution": [
53
+ { "tool": "list_mutations" },
54
+ { "tool": "read_mutation", "args": { "id": "m1" } },
55
+ {
56
+ "tool": "answer_mutation",
57
+ "args": {
58
+ "id": "m1",
59
+ "note": "Warm amber arc answering the blue wash",
60
+ "strokes": [
61
+ {
62
+ "brushId": "watercolor-round",
63
+ "brush": { "tip": { "size": 18 } },
64
+ "color": "#d97706",
65
+ "points": [
66
+ { "x": 70, "y": 50, "pressure": 0.6 },
67
+ { "x": 110, "y": 100, "pressure": 0.85 },
68
+ { "x": 150, "y": 150, "pressure": 0.6 }
69
+ ]
70
+ }
71
+ ]
72
+ }
73
+ },
74
+ { "tool": "advance_wet_paint", "args": { "seconds": 3 } }
75
+ ]
76
+ }
@@ -69,6 +69,7 @@ This skill is the method. `pixerate-paint-editor` has the full tool reference an
69
69
  | A glowing, glassy bead (a neon or glass tube) | `glow-gel` (light paint with rim and clarity, on dark paper; one loop per layer where they cross) |
70
70
  | Dry, broken strokes over texture | `dry-brush`, or a lower `behaviour.thick.load` |
71
71
  | A metallic highlight | `metallic-paint` |
72
+ | Iridescent structural colour (beetle shell, soap film, pearl glaze) | `scarab-lacquer`, `soap-film`, `pearl-glaze` (or `iridescence` facet); tilt view with `set_view_tilt` |
72
73
  | Paint that stays exactly as laid | `set_instant_dry` on |
73
74
 
74
75
  ## Recipes
@@ -98,7 +99,7 @@ light → short strokes following the form → `set_lighting` → `get_relief`.
98
99
  - `add_layer`, `update_layer`: a layer per pass
99
100
  - `mix_colors`, `color_harmony`, `add_swatch`, `set_color`: palette
100
101
  - `set_brush`, `paint_stroke`, `clean_mixer_brush`: block in, build, blend and impasto strokes
101
- - `set_lighting`, `get_relief`, `flatten_relief`: the relief and its light
102
+ - `set_lighting`, `set_view_tilt`, `get_view_tilt`, `get_relief`, `flatten_relief`: the relief, thin-film iridescence and their light / view angle
102
103
  - `set_instant_dry`: strokes that dry as they end
103
104
  - `undo_paint`: take back a step
104
105
  - `export_image`: deliver
@@ -46,9 +46,15 @@ This skill is the method. `pixerate-paint-editor` has the full tool reference.
46
46
  4. **Hide the sketch.** `update_layer` the Sketch layer `visible: false` (or lower its `opacity`
47
47
  while inking, then hide it).
48
48
  **Check:** `list_layers` shows it hidden.
49
- 5. **Flats.** `add_layer` "Flats", then `move_layer` it below the Ink layer; fill each shape with
50
- its base colour (`marker` or a flat brush, or `fill_layer` for a background).
51
- **Check:** `pick_color` inside a shape is the flat colour; on a line still the ink.
49
+ 5. **Flats.** `add_layer` "Flats", then `move_layer` it below the Ink layer. Call
50
+ `find_unfilled_regions` (`reference` set to the Ink layer id or `"all"`, `layerId` set to the
51
+ Flats layer, `closeGap: 4..8`) to get each enclosed shape's interior seed `point` and `bounds`.
52
+ Fill each shape in one call with `fill_region` (`x`, `y` or `points` for same-coloured shapes,
53
+ `reference` set to the Ink layer id or `"all"`, `closeGap: 4..8` to bridge small line gaps,
54
+ `expand: 1..2` to bleed under anti-aliased ink edges so no white halo shows, or `wet: true` for a
55
+ watercolour wash). Check `leaked`: if `true`, undo (`undo_paint`) and raise `closeGap` or close
56
+ the open line. Use `fill_layer` for a full-canvas ground.
57
+ **Check:** `pick_color` inside a shape is the flat colour; on a line still the ink; `leaked` is `false`.
52
58
  6. **Shading and light.** `add_layer` "Shading" directly above the flats, `update_layer`
53
59
  `blend: "multiply"` (or `shadow`) and `clipped: true`; paint shadows on the side away from the
54
60
  light. A "Light" layer the same way with `highlight` or `screen`.
@@ -64,7 +70,8 @@ This skill is the method. `pixerate-paint-editor` has the full tool reference.
64
70
  | Sketch | `pencil-hb`, light colour, own layer, hidden at the end |
65
71
  | Line art | `ink-pen` (even), `brush-pen` (swelling); own layer on top |
66
72
  | Clean geometric lines (curves, circles, borders) | `stroke_path` with SVG path data and a `pressure` taper, on the Ink layer |
67
- | Flats | `marker` or a flat brush on a layer under the ink |
73
+ | Flats inside line art | `find_unfilled_regions` then `fill_region` (`reference` = Ink layer id or `"all"`, `closeGap: 4..8`, `expand: 1..2`) on a Flats layer under the ink |
74
+ | Watercolour wash inside line art | `fill_region` with `wet: true`, `reference` = Ink layer id, `closeGap: 4..8`, `expand: 1` |
68
75
  | Patterned or textured flats (sky, gradient, galaxy) | `set_effect_paint` with a provider generator, then a flat dry brush on the Flats layer; `set_color` after |
69
76
  | Textured passes (dry brush, sponge, foliage) | A brush with `tip.grain` (`set_brush` `{ tip: { grain: { source: "sanded", depth: 0.6 } } }`) or an image tip from the brush library, with `dynamics.angleJitter` and `flip` so repeats don't show |
70
77
  | Shadows | Clipped layer, `multiply` or `shadow`, a cool colour |
@@ -75,7 +82,10 @@ This skill is the method. `pixerate-paint-editor` has the full tool reference.
75
82
  ## Recipes
76
83
 
77
84
  **Flats under ink.** `add_layer` "Flats" → `move_layer` with the new layer's id and `index` below
78
- the Ink layer → `set_brush` `marker` → `set_color` → strokes inside the shape.
85
+ the Ink layer → `find_unfilled_regions` `{ reference: inkLayerId, layerId: flatsLayerId, closeGap: 4 }`
86
+ → `fill_region` `{ x, y, color, reference: inkLayerId, closeGap: 4, expand: 1 }` (or pass `points`
87
+ to fill multiple regions of the same colour in one undo step). If `leaked: true`, `undo_paint` and
88
+ increase `closeGap`.
79
89
 
80
90
  **Effect flats.** With an effects provider: `search_effects` (`use` generator) → `describe_effect`
81
91
  → `set_effect_paint` → `marker` strokes inside the shape on the Flats layer (the effect shows
@@ -100,6 +110,7 @@ clipped: true }` → `set_brush` `airbrush` → paint the shadow side.
100
110
 
101
111
  - `get_canvas_info`, `list_layers`, `list_strokes`, `pick_color`, `render_preview`: read and check
102
112
  - `set_paper`, `fill_layer`: the ground and backgrounds
113
+ - `find_unfilled_regions`, `fill_region`: inspect enclosed line-art shapes and fill flats under the ink with gap closing and edge expansion
103
114
  - `add_layer`, `update_layer`, `move_layer`, `remove_layer`: one layer per pass; hide, clip, blend
104
115
  - `set_brush`, `set_color`, `paint_stroke`, `replay_strokes`: sketch, ink, flats and shading
105
116
  - `stroke_path`: clean geometric line art from SVG path data
@@ -20,8 +20,7 @@
20
20
  "solution": [
21
21
  { "tool": "add_layer", "args": { "name": "Flats" } },
22
22
  { "tool": "move_layer", "args": { "layerId": { "$read": "list_layers", "path": "layers.0.id" }, "index": 0 } },
23
- { "tool": "set_brush", "args": { "id": "marker" } },
24
- { "tool": "set_color", "args": { "color": "#f2c14e" } },
25
- { "tool": "paint_stroke", "args": { "points": [{ "x": 14, "y": 16 }, { "x": 50, "y": 16 }, { "x": 50, "y": 24 }, { "x": 14, "y": 24 }, { "x": 14, "y": 32 }, { "x": 50, "y": 32 }, { "x": 50, "y": 40 }, { "x": 14, "y": 40 }, { "x": 14, "y": 48 }, { "x": 50, "y": 48 }] } }
23
+ { "tool": "find_unfilled_regions", "args": { "reference": "all", "closeGap": 4 } },
24
+ { "tool": "fill_region", "args": { "x": 32, "y": 32, "color": "#f2c14e", "reference": "all", "closeGap": 4, "expand": 1 } }
26
25
  ]
27
26
  }