pixelkiln 0.12.0 → 0.13.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/CONTRIBUTING.md CHANGED
@@ -15,6 +15,7 @@ npm ci
15
15
  npm run test:release
16
16
  npm run typecheck
17
17
  npm run test:docs
18
+ npm run test:security
18
19
  npm test
19
20
  npm run build
20
21
  npm run test:package
@@ -72,6 +73,9 @@ wire contracts.
72
73
  workflow detail in `docs/`, and link every guide from `docs/README.md`.
73
74
  - Run `npm run test:docs` after changing Markdown or the CLI command/flag
74
75
  surface. It checks local links, the docs index, README size, and CLI coverage.
76
+ - Run `npm run test:security` after changing provider source handling, lockfile
77
+ fixtures, or benchmark state. It scans tracked JSON without printing a
78
+ credential-bearing value.
75
79
  - Run the website lint and build checks when changing `website/` or the
76
80
  canonical Markdown it renders.
77
81
  - Run the package smoke test when changing exports, build configuration, the
@@ -85,6 +89,8 @@ wire contracts.
85
89
  I/O and estimates must carry their cost unit.
86
90
  - Provider responses are untrusted input and need runtime validation before
87
91
  entering the lockfile.
92
+ - Temporary signed URLs must not settle in a committed lockfile. Persist a
93
+ refreshable provider reference and keep storage credentials transient.
88
94
  - Lockfile writes must remain atomic and resumable. Additive defaults should
89
95
  preserve valid v2 files when extending lock entries.
90
96
  - Unknown flags and ambiguous output selection are errors. Silent widening is
package/PROVIDERS.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Provider comparison
2
2
 
3
- PixelKiln can run one manifest through PixelLab, Retro Diffusion, or a
4
- self-hosted ComfyUI server. Planning, budgets, review, recovery, and packaging
5
- stay the same. Each adapter handles its service's authentication, prices,
6
- request lifecycle, and file formats.
3
+ PixelKiln can route one manifest through PixelLab, Retro Diffusion, and a
4
+ self-hosted ComfyUI server. Planning, review, recovery, and packaging stay the
5
+ same. Each adapter handles its service's authentication, prices, request
6
+ lifecycle, and file formats.
7
7
 
8
8
  PixelLab remains the default so existing manifests and spec hashes remain
9
- compatible. Select another backend with the manifest's top-level `provider`
10
- field and keep its settings under the matching `providerOptions` key.
9
+ compatible. The manifest's top-level `provider` is the default; a style may
10
+ override it. Keep service settings under the matching `providerOptions` key.
11
11
 
12
12
  To configure a project, use [Set up PixelLab](./docs/PIXELLAB.md),
13
13
  [Set up Retro Diffusion](./docs/RETRO_DIFFUSION.md), or
@@ -26,6 +26,8 @@ them.
26
26
  Live tests now cover single-candidate RD Fast and RD Plus stills from cost quote
27
27
  through submit, poll, PNG download, lockfile provenance, and cache validation.
28
28
  The RD Plus run covered isometric-asset, top-down-asset, and environment styles.
29
+ Lockfiles retain refreshable `retrodiffusion://` result references rather than
30
+ temporary signed storage URLs.
29
31
  Retro Diffusion's multi-candidate review, tileset, GIF, and spritesheet paths
30
32
  have mocked integration coverage but still need representative paid live runs.
31
33
 
@@ -113,58 +115,36 @@ repeatable.
113
115
 
114
116
  ## Use multiple providers in one project
115
117
 
116
- One manifest selects one provider. PixelKiln does not currently support a
117
- provider override on an individual style or asset. The boundary is deliberate:
118
- one command constructs one account adapter, and one `--budget` must have one
119
- meaning. PixelLab generations and Retro Diffusion dollars cannot share a safe
120
- ceiling.
121
-
122
- A repository can still use multiple providers today. Give each provider its own
123
- manifest, lockfile, and output directory:
124
-
125
- ```text
126
- art/
127
- pixelkiln.pixellab.manifest.json
128
- pixelkiln.pixellab.lock.json
129
- pixelkiln.retrodiffusion.manifest.json
130
- pixelkiln.retrodiffusion.lock.json
131
- pixelkiln.comfyui.manifest.json
132
- pixelkiln.comfyui.lock.json
133
- pixelkiln.workspace.json
134
- ```
135
-
136
- Plan and authorize each manifest separately:
118
+ Set a provider on any style that differs from the manifest default. Planning
119
+ and confirmations remain grouped by provider and unit, so PixelLab generations
120
+ and Retro Diffusion dollars are never added together. A mixed run takes a
121
+ separate named ceiling for each paid provider; the free group may be explicit:
137
122
 
138
123
  ```bash
139
- pixelkiln plan --manifest art/pixelkiln.pixellab.manifest.json --lock art/pixelkiln.pixellab.lock.json
140
- pixelkiln gen --manifest art/pixelkiln.pixellab.manifest.json --lock art/pixelkiln.pixellab.lock.json --budget <generations>
124
+ pixelkiln plan
125
+ pixelkiln gen \
126
+ --budget pixellab=12 \
127
+ --budget retrodiffusion=0.20 \
128
+ --budget comfyui=0
129
+ ```
141
130
 
142
- pixelkiln plan --manifest art/pixelkiln.retrodiffusion.manifest.json --lock art/pixelkiln.retrodiffusion.lock.json
143
- pixelkiln gen --manifest art/pixelkiln.retrodiffusion.manifest.json --lock art/pixelkiln.retrodiffusion.lock.json --budget <usd>
131
+ The same lockfile records which provider accepted each item. Resumed polling,
132
+ review, download, restore, and tagging follow that recorded provider. Account
133
+ operations such as `balance`, `adopt`, `salvage`, and `purge` require an
134
+ explicit `--provider` in a mixed manifest.
144
135
 
145
- pixelkiln plan --manifest art/pixelkiln.comfyui.manifest.json --lock art/pixelkiln.comfyui.lock.json
146
- pixelkiln gen --manifest art/pixelkiln.comfyui.manifest.json --lock art/pixelkiln.comfyui.lock.json --budget 0
147
- ```
136
+ This works well when PixelLab handles prompt-sensitive buildings and account
137
+ recovery, Retro Diffusion handles environment-styled backdrops, clean cutouts,
138
+ or native animation, and ComfyUI handles private or project-specific model
139
+ experiments that can absorb manual cleanup. Retro Diffusion is not a
140
+ higher-resolution route through PixelKiln today: its useful environment styles
141
+ cap at 384×384, while PixelLab `map` reaches 400×400. Its advantage is the
142
+ model/style and output type, not raw dimensions.
148
143
 
149
- Register the manifests in the workspace catalog for aggregate status and
150
- complete claim checks. Keep the provider lockfiles separate. Package their
151
- reviewed outputs independently, or combine explicit files with `pixelkiln pack
152
- --inputs <file> --out <path>`.
153
-
154
- This split works when PixelLab handles prompt-sensitive buildings and
155
- account recovery, Retro Diffusion handles environment-styled backdrops, clean
156
- cutouts, or native animation, and ComfyUI handles private or project-specific
157
- model experiments that can absorb manual cleanup. Retro Diffusion is not a higher-resolution
158
- route through PixelKiln today: its useful environment styles cap at 384×384,
159
- while PixelLab `map` reaches 400×400. Its advantage is the model/style and
160
- output type, not raw dimensions.
161
-
162
- Native mixed-provider support inside one manifest would be a larger feature,
163
- not a schema-only change. It needs provider selection on each style, plans and
164
- confirmations grouped by provider and cost unit, separate budget ceilings,
165
- per-provider polling and downloads, and an explicit provider for account-wide
166
- commands. The lockfile already records a provider on every entry, so the state
167
- format can support that direction without merging provider identities.
144
+ See [Mixed-provider projects](./docs/MIXED_PROVIDERS.md) for the manifest,
145
+ budget, recovery, and account-command contract. Separate manifests remain a
146
+ good boundary when different teams, credentials, or release schedules should
147
+ not share one runtime.
168
148
 
169
149
  ## Cost comparison
170
150
 
@@ -199,8 +179,8 @@ The provider boundary owns behavior that differs between services:
199
179
  - downloads and optional account capabilities such as balance, listing,
200
180
  tagging, and deletion.
201
181
 
202
- Planning groups costs by unit instead of adding incompatible values. A budget
203
- is interpreted in the active provider's unit. Providers without a balance or
182
+ Planning groups costs by provider and unit instead of adding incompatible
183
+ values. Mixed runs use provider-keyed ceilings. Providers without a balance or
204
184
  account-management endpoint can still generate safely because the offline
205
185
  estimate and hard budget remain enforced.
206
186
 
@@ -212,12 +192,10 @@ and the approval record work. The tested SDXL plus Pixel Art XL graph can find
212
192
  a composition, but it is not a production preset. Background removal stays in
213
193
  the graph. A person must still check the brief, pixel clusters, and drawing.
214
194
 
215
- Native per-style provider routing remains the highest-value orchestration
216
- feature. One manifest should be able to send a building style to PixelLab, an
217
- animation style to Retro Diffusion, and a private model workflow to ComfyUI.
218
- That requires provider-keyed budgets and confirmations, independently
219
- rate-limited adapters, and an explicit provider for account-wide commands. The
220
- lockfile already records the provider on each entry.
195
+ Per-style provider routing now lets one manifest send a building style to
196
+ PixelLab, an animation style to Retro Diffusion, and a private model workflow
197
+ to ComfyUI. Provider-keyed budgets, independent orchestration, lock-authoritative
198
+ recovery, and explicit account-provider selection ship with it.
221
199
 
222
200
  Scenario remains the best next hosted provider candidate. The implementation
223
201
  scope and acceptance criteria are tracked in
@@ -239,16 +217,14 @@ captured before submission.
239
217
 
240
218
  Recommended order from here:
241
219
 
242
- 1. Benchmark pinned ComfyUI models and prompt patterns across at least two scene
243
- families. Reject any supposed improvement that helps only one subject.
244
- 2. Add per-style provider selection, provider-keyed budgets, and mixed-provider
245
- integration tests.
246
- 3. Finish live Retro Diffusion multi-candidate, tileset, GIF, and spritesheet
220
+ 1. Finish live Retro Diffusion multi-candidate, tileset, GIF, and spritesheet
247
221
  smoke tests.
248
- 4. Build the Scenario still-image spike from issue #52 with dry-run cost, submit, poll,
222
+ 2. Build the Scenario still-image spike from issue #52 with dry-run cost, submit, poll,
249
223
  download, and one custom-model or reference-image benchmark.
250
- 5. Design ComfyUI Cloud as a separate authenticated and billable adapter.
251
- 6. Consider general raster marketplaces only with explicit nearest-neighbor,
224
+ 3. Benchmark another pinned ComfyUI model and prompt pattern across at least two
225
+ scene families. Reject any improvement that helps only one subject.
226
+ 4. Design ComfyUI Cloud as a separate authenticated and billable adapter.
227
+ 5. Consider general raster marketplaces only with explicit nearest-neighbor,
252
228
  palette, transparency, and reproducibility checks.
253
229
 
254
230
  Midjourney is not an adapter target without an official public API. Automating
package/README.md CHANGED
@@ -21,7 +21,8 @@ Plus stills; its multi-candidate, tileset, GIF, and spritesheet paths are tested
21
21
  with fixtures but still need paid live runs. ComfyUI has passed local generation,
22
22
  four-candidate review, cache recovery, and native-grid refinement on Apple MPS.
23
23
  Its tested SDXL workflow can find a composition, but it is not a finished
24
- pixel-art preset. The [provider comparison](./PROVIDERS.md) lists the tested
24
+ pixel-art preset. Styles in one manifest may use different providers with
25
+ separate budget ceilings. The [provider comparison](./PROVIDERS.md) lists the tested
25
26
  limits and the best route for buildings and environments. `FakeProvider` covers
26
27
  the same contract in automated tests.
27
28
 
@@ -54,10 +55,10 @@ PixelKiln keeps the missing record:
54
55
 
55
56
  | Workflow | What PixelKiln provides |
56
57
  |---|---|
57
- | Plan and budget | Offline manifest/lock/disk diff, provider-unit estimates, hard `--budget` ceiling, JSON/CI gate. |
58
+ | Plan and budget | Offline manifest/lock/disk diff, provider-grouped estimates, keyed mixed-provider budget ceilings, JSON/CI gate. |
58
59
  | Generate and review | Resumable submit/poll/pick/fetch pipeline with a fast local candidate sheet. |
59
60
  | Existing-art onboarding | Manifest scaffolding, exact-hash account adoption, and prompt recovery. |
60
- | Recovery | Validated local content cache, provider URL restore, account object-hash cache, and resumable jobs. |
61
+ | Recovery | Validated local content cache, durable provider-reference restore, account object-hash cache, and resumable jobs. |
61
62
  | Shared-account safety | Cross-project claim files or a registered workspace catalog, sibling-style exclusion, reviewed salvage, keep/discard tags, separate confirmed purge. |
62
63
  | Quality control | Palette distance, transparency, color-count, relative outlier, cache-integrity, and doctor gates. |
63
64
  | Sprite packaging | Deterministic RGBA packing, stable-cell mounting, explicit external input lists, structural output roles. |
@@ -138,7 +139,8 @@ See [Getting started](./docs/GETTING_STARTED.md) for new and existing projects.
138
139
  Use [Set up PixelLab](./docs/PIXELLAB.md),
139
140
  [Set up Retro Diffusion](./docs/RETRO_DIFFUSION.md), or
140
141
  [Set up ComfyUI](./docs/COMFYUI.md) for provider-specific configuration,
141
- manifest examples, and current limits.
142
+ manifest examples, and current limits. See [Mixed-provider projects](./docs/MIXED_PROVIDERS.md)
143
+ when styles in one manifest need different backends.
142
144
 
143
145
  ## Agent skill
144
146
 
@@ -335,16 +337,14 @@ import {
335
337
  buildPlan,
336
338
  loadLock,
337
339
  loadManifest,
338
- PixelLabProvider,
339
340
  resolveSpecs,
340
341
  } from "pixelkiln"
341
342
 
342
343
  const loaded = await loadManifest("pixelkiln.manifest.json")
343
- const provider = PixelLabProvider.forOffline()
344
- const specs = await resolveSpecs(loaded, { provider })
344
+ const specs = await resolveSpecs(loaded)
345
345
  const plan = await buildPlan(specs, await loadLock("pixelkiln.lock.json"))
346
346
 
347
- console.log(plan.cost, plan.costUnit, plan.actionable.length)
347
+ console.log(plan.groups, plan.actionable.length)
348
348
  ```
349
349
 
350
350
  The package also exports audit and image-regression gates, provider-neutral refinement, lock/output
@@ -364,6 +364,7 @@ exporters, managed artifact writes, and offline provenance verification. See
364
364
  | [Versioned recipes](./docs/RECIPES.md) | Pinned workflow packs, model hashes, manifest templates, and quality contracts. |
365
365
  | [CLI reference](./docs/CLI.md) | Every command, flag, JSON mode, and exit contract. |
366
366
  | [Manifest reference](./docs/MANIFEST.md) | Every style/asset field and generator constraint. |
367
+ | [Mixed-provider projects](./docs/MIXED_PROVIDERS.md) | Per-style routing, provider-keyed budgets, recovery, and account commands. |
367
368
  | [Agent workflows](./docs/AGENTS.md) | Official skill install, operating model, and provider-aware safety. |
368
369
  | [Generators](./docs/GENERATORS.md) | Capability choice, measured costs, palettes, style references, and tiles. |
369
370
  | [Environment provider benchmark](./docs/PROVIDER_BENCHMARK.md) | Thirty provider outputs plus native-grid and final-palette results comparing large scenes, transparency, palette size, and file readiness. |
package/SECURITY.md CHANGED
@@ -29,10 +29,19 @@ reporter.
29
29
 
30
30
  PixelKiln handles provider credentials, paid API actions, remote object deletion,
31
31
  local output paths, a localhost review server, and generated HTML containing
32
- provider data. Reports involving authentication leakage, path traversal,
32
+ provider data. Temporary provider result URLs can also contain signing
33
+ credentials in their query string. Reports involving authentication leakage, path traversal,
33
34
  cross-origin review actions, HTML/script injection, unsafe overwrite/delete
34
35
  behavior, lockfile corruption, or budget bypass are security relevant.
35
36
 
36
37
  Never attach a real `PIXELLAB_API_KEY`, `RD_API_KEY`, `.env` file, private
37
38
  provider URL, or unredacted lockfile from a confidential project to a public
38
39
  report.
40
+
41
+ PixelKiln keeps durable provider references in lockfiles when an adapter can
42
+ refresh an expiring result. After successful ingestion it removes signed URLs,
43
+ inline data URLs, and local file URLs from settled lock entries. A failed
44
+ download may retain its source locally so `fetch` can retry, but that in-flight
45
+ lockfile should not be committed. `npm run test:security` checks every tracked
46
+ JSON file for credential-bearing URLs and reports only the file and JSON path,
47
+ never the sensitive value.
package/dist/cli.d.ts CHANGED
@@ -12,6 +12,8 @@ interface Args {
12
12
  force: boolean;
13
13
  yes: boolean;
14
14
  budget?: number;
15
+ /** Repeatable provider-keyed budgets used by a mixed-provider run. */
16
+ providerBudgets: Record<string, number>;
15
17
  dryRun: boolean;
16
18
  all: boolean;
17
19
  json: boolean;
@@ -50,7 +52,7 @@ interface Args {
50
52
  workspace?: string;
51
53
  /** Positional target for recipe and workspace subcommands. */
52
54
  target?: string;
53
- /** `workspace add`: provider id to register the project under. Defaults to "pixellab". */
55
+ /** Account provider selector; also the `workspace add` catalog provider hint. */
54
56
  provider?: string;
55
57
  /** `workspace add`: free-form account label, e.g. distinguishing sandboxes. */
56
58
  account?: string;