pixelkiln 0.4.0 → 0.5.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
@@ -11,6 +11,7 @@ Requires Node.js 20 or newer.
11
11
 
12
12
  ```bash
13
13
  npm ci
14
+ npm run test:release
14
15
  npm run typecheck
15
16
  npm run test:docs
16
17
  npm test
@@ -114,6 +115,17 @@ short-lived credential, and the npm CLI performs the exchange itself during
114
115
  signed provenance attestation linking the tarball to its source commit and
115
116
  workflow run.
116
117
 
118
+ The release job is serialized so two quick merges cannot publish concurrently,
119
+ and it times out after 20 minutes rather than holding publishing permission
120
+ indefinitely. `npm run test:release` checks the repository-side trust contract:
121
+ the OIDC permission, GitHub-hosted runner, registry configuration, full checkout
122
+ history, absence of an npm publishing token, and the expected release plugins.
123
+
124
+ The public `gfargo/skills` tap watches PixelKiln releases on an hourly schedule.
125
+ When a new tag appears, it mirrors the tagged `skills/pixelkiln/` directory,
126
+ bumps the games plugin, and publishes a games release. PixelKiln remains the
127
+ source of truth; the source repository needs no cross-repository write token.
128
+
117
129
  Two conditions have to hold on the npm side, and neither lives in this
118
130
  repository:
119
131
 
package/PROVIDERS.md CHANGED
@@ -80,6 +80,55 @@ the outputs directly reproducible across services.
80
80
  See the [environment provider benchmark](./docs/PROVIDER_BENCHMARK.md) for the
81
81
  twelve generated images, prompts, manifests, measured costs, and review.
82
82
 
83
+ ## Use both providers in one project
84
+
85
+ One manifest selects one provider. PixelKiln does not currently support a
86
+ provider override on an individual style or asset. The boundary is deliberate:
87
+ one command constructs one account adapter, and one `--budget` must have one
88
+ meaning. PixelLab generations and Retro Diffusion dollars cannot share a safe
89
+ ceiling.
90
+
91
+ A repository can still use both providers today. Give each provider its own
92
+ manifest, lockfile, and output directory:
93
+
94
+ ```text
95
+ art/
96
+ pixelkiln.pixellab.manifest.json
97
+ pixelkiln.pixellab.lock.json
98
+ pixelkiln.retrodiffusion.manifest.json
99
+ pixelkiln.retrodiffusion.lock.json
100
+ pixelkiln.workspace.json
101
+ ```
102
+
103
+ Plan and authorize each manifest separately:
104
+
105
+ ```bash
106
+ pixelkiln plan --manifest art/pixelkiln.pixellab.manifest.json --lock art/pixelkiln.pixellab.lock.json
107
+ pixelkiln gen --manifest art/pixelkiln.pixellab.manifest.json --lock art/pixelkiln.pixellab.lock.json --budget <generations>
108
+
109
+ pixelkiln plan --manifest art/pixelkiln.retrodiffusion.manifest.json --lock art/pixelkiln.retrodiffusion.lock.json
110
+ pixelkiln gen --manifest art/pixelkiln.retrodiffusion.manifest.json --lock art/pixelkiln.retrodiffusion.lock.json --budget <usd>
111
+ ```
112
+
113
+ Register both manifests in the workspace catalog for aggregate status and
114
+ complete claim checks. Keep the provider lockfiles separate. Package their
115
+ reviewed outputs independently, or combine explicit files with `pixelkiln pack
116
+ --inputs <file> --out <path>`.
117
+
118
+ This is a useful split when PixelLab handles prompt-sensitive buildings and
119
+ account recovery while Retro Diffusion handles environment-styled backdrops,
120
+ clean cutouts, or native animation. Retro Diffusion is not a higher-resolution
121
+ route through PixelKiln today: its useful environment styles cap at 384×384,
122
+ while PixelLab `map` reaches 400×400. Its advantage is the model/style and
123
+ output type, not raw dimensions.
124
+
125
+ Native mixed-provider support inside one manifest would be a larger feature,
126
+ not a schema-only change. It needs provider selection on each style, plans and
127
+ confirmations grouped by provider and cost unit, separate budget ceilings,
128
+ per-provider polling and downloads, and an explicit provider for account-wide
129
+ commands. The lockfile already records a provider on every entry, so the state
130
+ format can support that direction without merging provider identities.
131
+
83
132
  ## Cost comparison
84
133
 
85
134
  The services use different billing units, so PixelKiln never adds their costs
@@ -129,6 +178,8 @@ estimate and hard budget remain enforced.
129
178
  4. Add a local ComfyUI adapter for GPU-backed, no-per-call-cost generation.
130
179
  5. Consider general raster providers only with explicit nearest-neighbor,
131
180
  palette, transparency, and reproducibility checks.
181
+ 6. Evaluate per-style provider selection with provider-keyed budgets; do not
182
+ overload the current scalar `--budget` or silently sum incompatible units.
132
183
 
133
184
  Midjourney is not an adapter target without an official public API. Automating
134
185
  its consumer UI would be fragile and could violate provider terms.
package/README.md CHANGED
@@ -25,9 +25,9 @@ tileset, GIF, and spritesheet live runs remain. See
25
25
  large environment and building workflows.
26
26
  `FakeProvider` exercises the same contract deterministically in tests.
27
27
 
28
- > **Release status:** the package is pre-1.0 and the first npm publication is
29
- > tracked in [issue #1](https://github.com/gfargo/pixelkiln/issues/1). Until it
30
- > is live, use a repository checkout.
28
+ > **Release status:** PixelKiln is published on npm. Merges to `main` use
29
+ > Semantic Release and npm Trusted Publishing, with signed provenance and no
30
+ > long-lived npm publishing token.
31
31
 
32
32
  ## Why PixelKiln
33
33
 
@@ -76,21 +76,18 @@ a row unresolved. Nothing is applied when the window is closed without using
76
76
  **Apply selections**. See the [CLI reference](docs/CLI.md#pick) for the complete
77
77
  review workflow.
78
78
 
79
- ## Install from a checkout
79
+ ## Install
80
80
 
81
81
  Requires Node.js 20 or newer.
82
82
 
83
83
  ```bash
84
- git clone https://github.com/gfargo/pixelkiln.git
85
- cd pixelkiln
86
- npm ci
87
- npm run pixelkiln -- help
88
- npm test
84
+ npm install --save-dev pixelkiln
85
+ npx pixelkiln --help
89
86
  ```
90
87
 
91
- `npm run pixelkiln -- …` executes the TypeScript source. `npm run build`
92
- creates the ESM, CommonJS, declarations, and CLI distribution used by the
93
- published package.
88
+ For library use, both `import("pixelkiln")` and `require("pixelkiln")` are
89
+ supported. Contributors can still run `npm run pixelkiln -- …` from a checkout
90
+ to execute the TypeScript source directly.
94
91
 
95
92
  ## Five-minute start
96
93
 
@@ -114,14 +111,11 @@ RD_API_KEY=...
114
111
  Validate locally, inspect exact work/cost, then generate with a hard ceiling:
115
112
 
116
113
  ```bash
117
- /path/to/pixelkiln/node_modules/.bin/tsx /path/to/pixelkiln/src/cli.ts doctor --dry-run
118
- /path/to/pixelkiln/node_modules/.bin/tsx /path/to/pixelkiln/src/cli.ts plan
119
- /path/to/pixelkiln/node_modules/.bin/tsx /path/to/pixelkiln/src/cli.ts gen --budget 120
114
+ npx pixelkiln doctor --dry-run
115
+ npx pixelkiln plan
116
+ npx pixelkiln gen --budget 120
120
117
  ```
121
118
 
122
- Once installed from npm, those commands become `pixelkiln doctor`,
123
- `pixelkiln plan`, and `pixelkiln gen`.
124
-
125
119
  `gen` submits, polls, opens the candidate-review sheet when necessary,
126
120
  downloads validated output, populates the recovery cache, and updates
127
121
  `pixelkiln.lock.json`. Commit the manifest, lockfile, generated art, and any
package/docs/AGENTS.md CHANGED
@@ -59,6 +59,13 @@ new project or a large environment asset. Once chosen, follow
59
59
  [Set up PixelLab](./PIXELLAB.md) or
60
60
  [Set up Retro Diffusion](./RETRO_DIFFUSION.md).
61
61
 
62
+ The installed skill keeps the shared safety workflow in `SKILL.md` and loads a
63
+ focused reference only when needed: PixelLab, Retro Diffusion, or a project that
64
+ uses both. Mixed-provider repositories should use separate manifests and
65
+ lockfiles so each plan and budget keeps its provider-specific unit. The
66
+ [provider comparison](../PROVIDERS.md#use-both-providers-in-one-project) has a
67
+ complete layout and command example.
68
+
62
69
  ## Recommended first prompt
63
70
 
64
71
  ```text
@@ -11,18 +11,16 @@ checks need provider access.
11
11
  - Node.js 20 or newer
12
12
  - A credential for the manifest's selected provider: `PIXELLAB_API_KEY` for
13
13
  PixelLab or `RD_API_KEY` for experimental Retro Diffusion support
14
- - A repository checkout until the first npm release in
15
- [issue #1](https://github.com/gfargo/pixelkiln/issues/1) is complete
16
14
 
17
- From a checkout:
15
+ Install the published package in the project that owns the art:
18
16
 
19
17
  ```bash
20
- npm ci
21
- npm run pixelkiln -- help
18
+ npm install --save-dev pixelkiln
19
+ npx pixelkiln --help
22
20
  ```
23
21
 
24
- The rest of this guide uses `pixelkiln` for readability. In the checkout,
25
- replace it with `npm run pixelkiln --`.
22
+ The rest of this guide uses `pixelkiln` for readability. With a project-local
23
+ installation, prefix commands with `npx` or call them from an npm script.
26
24
 
27
25
  ## Using an agent
28
26
 
@@ -71,6 +69,9 @@ provider options and current limits, or
71
69
  [PixelLab vs. Retro Diffusion](../PROVIDERS.md) for selection guidance.
72
70
  The provider setup guides give the shortest complete path for
73
71
  [PixelLab](PIXELLAB.md) and [Retro Diffusion](RETRO_DIFFUSION.md).
72
+ If one repository needs both, use separate provider-specific manifests and
73
+ lockfiles. See
74
+ [Use both providers in one project](../PROVIDERS.md#use-both-providers-in-one-project).
74
75
 
75
76
  Before spending anything, validate and price the selected work:
76
77
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "pixelkiln",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Manifest-driven pixel-art generation, review, recovery, and packaging with deterministic provenance.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
9
  "bin": {
10
- "pixelkiln": "./bin/pixelkiln.js"
10
+ "pixelkiln": "bin/pixelkiln.js"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
@@ -29,6 +29,7 @@
29
29
  "typecheck": "tsc --noEmit",
30
30
  "test": "vitest run",
31
31
  "test:docs": "node scripts/check-docs.mjs",
32
+ "test:release": "node scripts/check-release.mjs",
32
33
  "test:package": "node scripts/smoke-package.mjs",
33
34
  "test:watch": "vitest",
34
35
  "schema": "tsx scripts/gen-schema.ts",
@@ -12,9 +12,7 @@ submission, reviewed by a human, and recorded with exact provenance.
12
12
 
13
13
  - Locate `pixelkiln.manifest.json` first. Paths are manifest-relative.
14
14
  - Never inspect, print, or commit provider credentials. Read the manifest's
15
- top-level `provider`: PixelKiln loads `PIXELLAB_API_KEY` for `pixellab` and
16
- `RD_API_KEY` for experimental `retrodiffusion` from `.env.local` beside the
17
- manifest or from the current working directory.
15
+ top-level `provider`, then load the matching provider reference below.
18
16
  - Run `pixelkiln doctor --dry-run` and `pixelkiln plan` before paid work. Report
19
17
  actionable, recoverable, and estimated cost figures with their provider unit.
20
18
  - Do not regenerate recoverable work. Use `pixelkiln restore` first.
@@ -43,11 +41,18 @@ debugging one phase. Use `restore` for missing bytes, `adopt` for exact matches
43
41
  already in the provider account, and `salvage` for reviewed unclaimed objects.
44
42
  Use `pack`, `mount`, or `export` only for the artifact format the project needs.
45
43
 
46
- PixelKiln's orchestration is provider-neutral. PixelLab is its production and
47
- paid-generation-tested adapter. Retro Diffusion stills, tileset sheets,
48
- animated GIFs, and PNG spritesheets are experimental. Authenticated RD Fast and
49
- RD Plus single-candidate stills have passed from quote through validated output
50
- and recovery. Advanced workflows remain mock-tested.
44
+ ## Provider routing
45
+
46
+ Read only the reference needed for the current decision:
47
+
48
+ - For PixelLab configuration, generators, costs, alpha behavior, or account
49
+ operations, read [references/pixellab.md](references/pixellab.md).
50
+ - For Retro Diffusion styles, USD budgets, environment assets, animation, or
51
+ experimental limits, read
52
+ [references/retro-diffusion.md](references/retro-diffusion.md).
53
+ - When one game or repository needs both providers, read
54
+ [references/mixed-providers.md](references/mixed-providers.md).
55
+
51
56
  `FakeProvider` is the deterministic test adapter. Do not describe Retro
52
57
  Diffusion as production-ready until representative multi-candidate, tileset,
53
58
  GIF, and spritesheet live smoke tests pass.
@@ -0,0 +1,43 @@
1
+ # Mixed-provider projects
2
+
3
+ Read this reference when one game or repository needs assets from both PixelLab
4
+ and Retro Diffusion.
5
+
6
+ One manifest selects one top-level `provider`. Do not add undocumented
7
+ per-style provider fields: the current CLI constructs one account adapter for a
8
+ manifest run, and a single `--budget` has one provider-specific unit.
9
+
10
+ Use one manifest and lockfile per provider inside the same project:
11
+
12
+ ```text
13
+ art/
14
+ pixelkiln.pixellab.manifest.json
15
+ pixelkiln.pixellab.lock.json
16
+ pixelkiln.retrodiffusion.manifest.json
17
+ pixelkiln.retrodiffusion.lock.json
18
+ pixelkiln.workspace.json
19
+ ```
20
+
21
+ Keep their output directories distinct. Plan and authorize them separately:
22
+
23
+ ```bash
24
+ pixelkiln plan --manifest art/pixelkiln.pixellab.manifest.json --lock art/pixelkiln.pixellab.lock.json
25
+ pixelkiln gen --manifest art/pixelkiln.pixellab.manifest.json --lock art/pixelkiln.pixellab.lock.json --budget <generations>
26
+
27
+ pixelkiln plan --manifest art/pixelkiln.retrodiffusion.manifest.json --lock art/pixelkiln.retrodiffusion.lock.json
28
+ pixelkiln gen --manifest art/pixelkiln.retrodiffusion.manifest.json --lock art/pixelkiln.retrodiffusion.lock.json --budget <usd>
29
+ ```
30
+
31
+ Register both manifests in the workspace catalog so aggregate status and claim
32
+ checks see the whole project. A mixed-provider warning is expected because it
33
+ prevents account-wide commands from silently assuming one backend.
34
+
35
+ Package each manifest's reviewed outputs independently, or use `pixelkiln pack
36
+ --inputs <file> --out <path>` with an explicit JSON list when the final sheet
37
+ must combine files from both providers. Never merge the two lockfiles or add
38
+ generation counts to USD. Each entry must retain the provider that produced it.
39
+
40
+ A practical split is PixelLab for prompt-sensitive buildings and mature account
41
+ recovery, then Retro Diffusion for environment-styled backdrops, clean cutouts,
42
+ or native animation. The committed benchmark is evidence for those tendencies,
43
+ not a guarantee; run one representative asset before expanding either batch.
@@ -0,0 +1,35 @@
1
+ # PixelLab
2
+
3
+ Read this reference when a manifest selects `pixellab`, when choosing between
4
+ providers, or before any PixelLab account operation.
5
+
6
+ ## Operational boundary
7
+
8
+ - Credential: `PIXELLAB_API_KEY` in `.env.local` beside the manifest or in the
9
+ process environment. Never print or commit it.
10
+ - Status: production adapter. Generation and account workflows have live
11
+ coverage.
12
+ - Cost unit: subscription generations. Copy the exact `pixelkiln plan` total
13
+ into `--budget`; do not translate it into dollars.
14
+ - Account operations: balance, adopt, salvage, tag, and separately confirmed
15
+ purge are supported. Read `docs/RECOVERY.md` before using them.
16
+
17
+ ## Generator choice
18
+
19
+ | Generator | Use it for | Measured cost |
20
+ |---|---|---:|
21
+ | `map` | One prop, icon, building, or landmark, up to 400×400 | 1 generation |
22
+ | `pixflux` | Closed palettes or full-bleed backgrounds | 1 generation |
23
+ | `1dir` | Reference-guided work or several candidates | 20–40 generations |
24
+ | `tiles` | Ground variations or connected structures | 20–40 generations |
25
+
26
+ In the committed environment benchmark, PixelLab followed complex building
27
+ prompts more closely and produced the stronger scenic background. Its 256px map
28
+ objects were opaque despite the route's transparency claim, so inspect alpha on
29
+ one representative result before a batch.
30
+
31
+ For setup and current field constraints, use
32
+ <https://pixelkiln.griffen.codes/docs/pixellab>. When working in the PixelKiln
33
+ repository, `docs/PIXELLAB.md` and `docs/ENDPOINTS.md` are the canonical local
34
+ sources. The provider sources are <https://www.pixellab.ai/> and
35
+ <https://api.pixellab.ai/v2/docs>.
@@ -0,0 +1,40 @@
1
+ # Retro Diffusion
2
+
3
+ Read this reference when a manifest selects `retrodiffusion`, when evaluating
4
+ large scene work, or when using native animation and tileset output.
5
+
6
+ ## Operational boundary
7
+
8
+ - Credential: `RD_API_KEY` in `.env.local` beside the manifest or in the
9
+ process environment. Never print or commit it.
10
+ - Status: experimental adapter. RD Fast and RD Plus single-candidate stills are
11
+ live-tested through quote, submit, download, provenance, and recovery.
12
+ Multi-candidate, tileset, GIF, and spritesheet paths remain mock-tested.
13
+ - Cost unit: USD. PixelKiln enforces the offline plan, then checks Retro
14
+ Diffusion's free authoritative quote before submission.
15
+ - Account operations: balance is supported. Listing, adopt, salvage, tagging,
16
+ and deletion are not exposed by the current adapter.
17
+
18
+ ## Where it earns a place
19
+
20
+ - `rd_plus__environment` for one-point-perspective scenic backgrounds.
21
+ - `rd_plus__topdown_map` for 3/4 top-down maps.
22
+ - `rd_tile__scene_object` for 64–384px objects placed on tile maps.
23
+ - `rd_plus__topdown_asset` or `rd_plus__isometric_asset` for isolated assets.
24
+ - `rd_animation__*` and `rd_advanced_animation__*` for GIF or PNG spritesheet
25
+ output.
26
+
27
+ The useful environment styles currently top out at 384×384. PixelLab's `map`
28
+ route reaches 400×400, so Retro Diffusion is not the higher-resolution option
29
+ through PixelKiln today. Choose it for its scene styles, cleaner transparent
30
+ cutouts, smaller palettes, cinematic framing, or native animation. Build truly
31
+ large scenes from separately generated terrain, backdrop, landmark, building,
32
+ and foreground layers, then integer-upscale with nearest-neighbor filtering.
33
+
34
+ For setup, selectors, and option constraints, use
35
+ <https://pixelkiln.griffen.codes/docs/retro-diffusion>. The matched visual
36
+ evidence is at <https://pixelkiln.griffen.codes/docs/provider-benchmark>. When
37
+ working in the PixelKiln repository, the same canonical sources are
38
+ `docs/RETRO_DIFFUSION.md` and `docs/PROVIDER_BENCHMARK.md`. The provider sources
39
+ are <https://www.retrodiffusion.ai/> and
40
+ <https://www.retrodiffusion.ai/app/guide/api>.