pixelkiln 0.35.0 → 0.36.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.
package/docs/CLI.md CHANGED
@@ -17,6 +17,38 @@ work. The experimental `comfyui` adapter runs committed API-format `map` and
17
17
  ordered still-frame workflows on a self-hosted server. The experimental `scenario` adapter runs
18
18
  hosted still models with Compute Unit preflight and durable asset recovery.
19
19
 
20
+ ## Which command
21
+
22
+ | I want to | Run |
23
+ |---|---|
24
+ | see what a run would do and cost, spending nothing | `pixelkiln plan` |
25
+ | generate everything the manifest still needs | `pixelkiln gen --budget 40` |
26
+ | generate one asset, or one style | `pixelkiln gen --only anvil --budget 2`, `pixelkiln gen --style neon --budget 20` |
27
+ | finish a run that was interrupted | `pixelkiln plan`, then the `next:` command it prints (`poll`, `pick`, or `fetch`) |
28
+ | choose among candidates the provider returned | `pixelkiln pick` |
29
+ | get back a generated file I deleted or lost | `pixelkiln restore` |
30
+ | bring back the generation a regeneration replaced | `pixelkiln history`, then `pixelkiln restore --only anvil --generation 1` |
31
+ | look at everything the project has made | `pixelkiln gallery` |
32
+ | change prompts and sizes, or regenerate, from the browser | `pixelkiln gallery --edit --budget 10` |
33
+ | touch a sprite up by hand and keep the edit | `pixelkiln edit --only anvil` |
34
+ | stop tracking a hand edit | `pixelkiln edit detach --only anvil` |
35
+ | build a sprite sheet | `pixelkiln pack --style base` |
36
+ | place sprites on a sheet at declared cells | `pixelkiln mount --style base` |
37
+ | export a tileset for Tiled or Godot | `pixelkiln export --style ground --format tiled` |
38
+ | check the art against the style's palette and grid | `pixelkiln audit --style base` |
39
+ | produce the palette-clean, grid-true final art | `pixelkiln refine` then `pixelkiln refine approve --from <record> --reviewer "Name"` |
40
+ | claim art already on my provider account | `pixelkiln adopt` |
41
+ | find paid work on the account that no lockfile claims | `pixelkiln salvage` |
42
+ | accept reworded prompts without regenerating | `pixelkiln accept` |
43
+ | drop lock entries the manifest no longer declares | `pixelkiln prune` |
44
+ | check the project before committing or in CI | `pixelkiln doctor`, `pixelkiln plan --check` |
45
+ | see the account balance | `pixelkiln balance` |
46
+ | work across several projects | `pixelkiln workspace add ../other/pixelkiln.manifest.json`, then `--workspace` on `gallery` and `salvage` |
47
+
48
+ Every command takes `--manifest <file>` when the manifest is not in the
49
+ working directory. Commands that spend take `--budget`; commands that replace
50
+ a file you changed take `--force`.
51
+
20
52
  ## Everyday pipeline
21
53
 
22
54
  ### `init`
@@ -790,6 +822,23 @@ Print the package version. `-v` is an alias.
790
822
 
791
823
  ## Exit and output contract
792
824
 
825
+ A command that stops on an error prints `error: <message>` to stderr and
826
+ exits with a code that says what kind of error it was, so a script can branch
827
+ without matching message text.
828
+
829
+ | Exit code | Kind | Example |
830
+ |---|---|---|
831
+ | 1 | anything else | a file the OS would not let PixelKiln write |
832
+ | 2 | usage | an unknown flag, a `--style` that the manifest does not define |
833
+ | 3 | project | no manifest at the path, an invalid manifest, a malformed lockfile or workspace catalog |
834
+ | 4 | provider | the provider rejected a request or answered with something unusable |
835
+ | 5 | refused overwrite | a file on disk differs from its record; nothing was replaced (`--force` overrides) |
836
+ | 6 | budget | the run would spend past `--budget`, or the balance cannot cover it |
837
+ | 7 | capability | the recorded provider does not offer the operation (for example `purge` on a backend with no delete) |
838
+
839
+ Commands that finish with some items failed, such as `fetch` with one
840
+ download refused, exit 1 after printing their totals.
841
+
793
842
  - Parse, schema, ownership, provider, and filesystem errors exit nonzero.
794
843
  - `submit`, `poll`, `fetch`, and `gen` exit nonzero on partial failure or
795
844
  timeout; automation cannot mistake an incomplete batch for success.
package/docs/LIBRARY.md CHANGED
@@ -447,6 +447,38 @@ costs with their unit; use `spendByUnit(lock)` for history. Use
447
447
  `measureBalanceChange(before, after)` when the provider exposes authoritative
448
448
  balance readings and keep that observed delta distinct from the estimate.
449
449
 
450
+ ## Errors a caller can branch on
451
+
452
+ Most failures are plain `Error`s whose message is written for a person. The
453
+ kinds a program might handle differently extend `PixelKilnError` and carry a
454
+ `code`:
455
+
456
+ | Class | `code` | Thrown by |
457
+ |---|---|---|
458
+ | `UsageError` | `usage` | `parseArgs`, `resolveSpecs` when a filter names an unknown style or asset |
459
+ | `ProjectError` | `project` | `loadManifest`, `loadLock`, `loadWorkspace`, `openProject` |
460
+ | `ProviderError` | `provider` | every built-in client on a failed request; `provider` and `status` say which and what. `PixelLabError` is one with the response `body`. |
461
+ | `OverwriteRefusedError` | `refused-overwrite` | `revertGeneration`, `writeManagedArtifactBundle`, `installRecipe`, `snapshotQualityBaseline`; `files` lists what was left alone |
462
+ | `BudgetError` | `budget` | `submit` and the CLI's balance checks |
463
+ | `UnsupportedCapabilityError` | `capability` | `requireList`, `requireDelete`, `requireBalance` |
464
+
465
+ `errorCode(err)` returns the code or `undefined`, and `exitCodeFor(err)` the
466
+ exit code the CLI uses (`EXIT_CODES` is the table). A new code is added only
467
+ when some caller would branch on it; a message that is merely different is
468
+ still a plain `Error`.
469
+
470
+ ```ts
471
+ import { errorCode, ProviderError } from "pixelkiln"
472
+
473
+ try {
474
+ await submit(provider, project.loaded, plan.actionable, project.lock, project.lockPath)
475
+ } catch (err) {
476
+ if (err instanceof ProviderError && err.status === 402) console.error("top up", err.provider)
477
+ else if (errorCode(err) === "budget") console.error("raise the budget or narrow the run")
478
+ else throw err
479
+ }
480
+ ```
481
+
450
482
  ## Stability and file paths
451
483
 
452
484
  - Public imports come from `pixelkiln`; internal `src/` paths are not part of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -33,6 +33,7 @@
33
33
  "test:security": "tsx scripts/check-source-url-hygiene.ts",
34
34
  "test:quality": "tsx src/cli.ts quality check --from benchmarks/provider-hires/comfyui/pixelkiln.quality-baseline.json",
35
35
  "test:package": "node scripts/smoke-package.mjs",
36
+ "test:gallery": "tsx scripts/smoke-gallery.ts",
36
37
  "test:watch": "vitest",
37
38
  "schema": "tsx scripts/gen-schema.ts",
38
39
  "website:dev": "npm run dev --prefix website",
@@ -65,6 +66,7 @@
65
66
  "@semantic-release/npm": "^13.1.5",
66
67
  "@semantic-release/release-notes-generator": "^14.1.1",
67
68
  "@types/node": "^22.10.0",
69
+ "puppeteer-core": "^24.43.1",
68
70
  "semantic-release": "^25.0.9",
69
71
  "tsup": "^8.5.1",
70
72
  "tsx": "^4.19.2",