pixelkiln 0.26.0 → 0.28.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.
@@ -182,6 +182,22 @@ provider object ids to remote content hashes for adoption/salvage. Neither is
182
182
  authoritative or committed; both can be deleted and rebuilt. Every recovery
183
183
  byte is structurally validated before use.
184
184
 
185
+ ## Pinned editor build
186
+
187
+ The gallery's in-browser editor is a web export of Pixelorama with PixelKiln's
188
+ bridge extension, built in CI from a build-time overlay on the pinned upstream
189
+ tag (`tools/pixelorama-bridge/`) and published as a GitHub release whose tag
190
+ semantic-release ignores. The package does not carry the 46 MB build; it
191
+ carries `tools/pixelorama-bridge/pin.json` — the release tag plus the SHA-256
192
+ and size of every file — inlined into `src/editor/pin.ts` at bundle time, so
193
+ the shipped code and the build it trusts are one artifact. `installEditor`
194
+ fetches only missing or mismatched files into a per-release directory under
195
+ the user cache, verifies each against the pin before renaming it into place,
196
+ and the gallery serves a file only after the whole directory verified and its
197
+ size still matches; a file that changed on disk is refused rather than served.
198
+ The release tag is part of the served path, so the browser may cache the
199
+ files as immutable, and a new pin is a new path.
200
+
185
201
  ## Provider capability boundary
186
202
 
187
203
  Providers are selected from a registry by each style's `provider`, falling back
package/docs/ARTIFACTS.md CHANGED
@@ -126,6 +126,31 @@ Generic JSON retains all provider rules and normalized masks. Tiled and Godot
126
126
  translate recognized four-edge/four-corner semantics and reject unknown or
127
127
  lossy mappings. See [TILES.md](./TILES.md) for the format contracts.
128
128
 
129
+ ## Hand-edit companion
130
+
131
+ A hand edit saved from the gallery's in-browser editor leaves a small record
132
+ beside it, `<edit>.edit.json`, that is not a provenance companion and is not
133
+ transactional:
134
+
135
+ ```json
136
+ {
137
+ "version": 1,
138
+ "basedOn": "<sha256 of the generated PNG the edit started from, or null>",
139
+ "sha256": "<sha256 of the edit as saved>",
140
+ "editor": "pixelorama@v1.2.2-stable",
141
+ "protocol": 1,
142
+ "savedAt": "2026-09-12T10:00:00.000Z",
143
+ "project": "anvil.pxo"
144
+ }
145
+ ```
146
+
147
+ `basedOn` lets the gallery report `regenerated-since` by comparing hashes
148
+ rather than modification times; `sha256` shows when another tool rewrote the
149
+ edit after the editor did; `project` names the layered Pixelorama file kept
150
+ beside the edit, which the next in-browser edit opens so layers survive. An edit made with a desktop editor has no
151
+ companion and is judged by file times. Commit the companion and the `.pxo`
152
+ with the edit if you want that history; nothing else reads them.
153
+
129
154
  ## Provenance companion
130
155
 
131
156
  The companion is engine-neutral and versioned:
package/docs/CLI.md CHANGED
@@ -247,6 +247,39 @@ Single-image PNG assets only for now; structural sets and GIF animations are
247
247
  refused with the reason. `--only` must resolve to one asset in one style, so
248
248
  add `--style` when the asset is shared.
249
249
 
250
+ ### `tools`
251
+
252
+ Prepare the in-browser editor before opening a gallery, or check what is on
253
+ disk.
254
+
255
+ ```bash
256
+ pixelkiln tools status
257
+ pixelkiln tools install editor
258
+ PIXELKILN_TOOLS_DIR=/srv/pixelkiln-tools pixelkiln tools install editor
259
+ ```
260
+
261
+ The editor is a web build of [Pixelorama](https://pixelorama.org) with a small
262
+ PixelKiln bridge extension, about 46 MB, and is not part of the npm package.
263
+ Each PixelKiln release pins one build — its GitHub release tag
264
+ (`editor-pixelorama-<upstream tag>-pk.<n>`) and the SHA-256 and size of every
265
+ file — and `install` fetches only the files that are missing or wrong from
266
+ that release, verifies each against the pinned hash before it lands, and
267
+ leaves nothing partial behind: a file that fails verification is discarded
268
+ and the command fails naming it. `status` reports the pinned version, the
269
+ release, and whether every file is present and verified (`--json` for the
270
+ machine-readable form). Running `install` on a complete build fetches nothing.
271
+
272
+ The files live outside the project, in a per-release directory under the
273
+ user's cache (`~/Library/Caches/pixelkiln/tools` on macOS, `$XDG_CACHE_HOME`
274
+ or `~/.cache/pixelkiln/tools` on Linux, `%LOCALAPPDATA%\pixelkiln\tools` on
275
+ Windows), so one copy serves every project and an upgrade never overwrites the
276
+ build an older PixelKiln still expects. `PIXELKILN_TOOLS_DIR` moves that root;
277
+ `PIXELKILN_EDITOR_URL` points the download at a mirror or an internal server
278
+ that hosts the same files (they are still verified against the pinned hashes,
279
+ so a mirror cannot substitute a different build). Once installed the editor
280
+ runs entirely offline; the gallery serves it from the local directory with no
281
+ outbound requests.
282
+
250
283
  ### `gallery`
251
284
 
252
285
  Open a local, read-only gallery of everything the project has generated. Each
@@ -358,6 +391,27 @@ based on an older generation because the art was regenerated since — plus
358
391
  **Open in editor** and **Detach edit**. A card whose edit differs from the
359
392
  generated art shows the edit, since that is what ships, with a ✎ mark.
360
393
 
394
+ `--edit` also offers **Edit in browser**: a pinned build of
395
+ [Pixelorama](https://pixelorama.org) that the gallery serves itself, opened in
396
+ a slide-out sheet with the sprite and the style's palette loaded. See
397
+ [`tools`](#tools) for what is fetched, where it lives, and how it is verified;
398
+ the header shows whether it is installed and, if not, an **Install editor**
399
+ button that fetches it once with a progress bar — nothing is downloaded without
400
+ that click or `tools install editor`. **Save to project** (or ⌘S / Ctrl+S in
401
+ the editor) hands the flattened image back to the page, which writes the same
402
+ `edits/` file `pixelkiln edit` would and declares it; the sheet stays open for
403
+ the next change, **Save & close** does both, and closing with unsaved changes
404
+ asks first. A browser save also keeps Pixelorama's layered `.pxo` beside the
405
+ edit — the next **Edit in browser** hands it back, so layers and frames come
406
+ back as they were (the flattened PNG is used only if the file cannot be read,
407
+ and the sheet says which) — and writes `<edit>.edit.json` recording the
408
+ editor, the time, and the hash of the generation the edit was based on, so
409
+ `regenerated-since` is decided by hash rather than file times for those edits. The record shows the
410
+ editor and the layer file; **Open in desktop editor** and **Detach edit** work
411
+ on the same file. The editor page runs same-origin under its own
412
+ content-security policy and never sees the gallery's session token — the page
413
+ does the write. `--no-editor` hides all of it and serves none of its routes.
414
+
361
415
  A PixelLab `map` or `1dir` record also links to its account object (**Open in
362
416
  pixellab ↗**), where PixelLab's own editor can change it; with `--budget`
363
417
  (any amount — `--budget 0` allows provider contact and no spend) the record
@@ -636,7 +690,8 @@ Print the package version. `-v` is an alias.
636
690
  | `--check` | plan/audit/cache | Exit nonzero when selected state is unsafe. |
637
691
  | `--yes`, `-y` | confirmed operations | Skip an interactive confirmation. For `refine approve`, it records an already-completed human review; it does not replace one. |
638
692
  | `--no-open` | pick/salvage/gallery/edit | Do not automatically open the browser, or the editor for `edit`. |
639
- | `--edit` | gallery | Let the page change asset prompts, sizes, category, and tags, and add assets. Rewrites the manifest only; never contacts a provider or spends. |
693
+ | `--edit` | gallery | Let the page change asset prompts, sizes, category, and tags, and add assets. Rewrites the manifest only; never contacts a provider or spends. Also offers the in-browser editor. |
694
+ | `--no-editor` | gallery | With `--edit`, do not offer, install, or serve the in-browser editor. |
640
695
  | `--tag` | fetch/adopt | Also push tags after the command's primary work. |
641
696
  | `--refresh` | fetch | Re-download downloaded outputs and replace files whose object changed upstream; never generates, never overwrites a local edit without `--force`. |
642
697
  | `--claims <paths>` | salvage | Other project lockfiles; repeatable and comma-separated. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,