pixelkiln 0.1.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/AGENTS.md ADDED
@@ -0,0 +1,64 @@
1
+ # Agent workflows
2
+
3
+ PixelKiln includes an official agent skill for tools that support the open
4
+ `SKILL.md` format. It teaches the operational decisions that matter: plan before
5
+ spending, cap every paid run, restore before regenerating, keep selection human,
6
+ and preserve provenance through packaging.
7
+
8
+ ## Install the skill
9
+
10
+ From any project directory:
11
+
12
+ ```bash
13
+ npx skills add gfargo/pixelkiln@pixelkiln
14
+ ```
15
+
16
+ Then ask your agent to use `$pixelkiln` while working with a PixelKiln manifest.
17
+ The skill is provider-neutral and does not contain credentials or make provider
18
+ calls by itself.
19
+
20
+ ## What the skill changes
21
+
22
+ With the skill loaded, an agent should:
23
+
24
+ 1. Find and validate `pixelkiln.manifest.json`.
25
+ 2. Run `doctor --dry-run` and `plan` before paid work.
26
+ 3. Report actionable, recoverable, and cost totals in the provider's unit.
27
+ 4. Use `restore` instead of regenerating recoverable assets.
28
+ 5. Pass an explicit `--budget` within the amount the user authorized.
29
+ 6. Leave artwork selection in the local `pick` page unless the user gives a
30
+ specific selection rule.
31
+ 7. Commit the manifest, lockfile, generated output, and artifact companions—but
32
+ never credentials or `.pixelkiln/` caches.
33
+
34
+ The skill guides the workflow; PixelKiln remains the deterministic execution
35
+ layer. This separation keeps agent reasoning out of polling, hashing, downloads,
36
+ state transitions, and output placement.
37
+
38
+ ## PixelLab MCP and PixelKiln
39
+
40
+ The [official PixelLab MCP server](https://github.com/pixellab-code/pixellab-mcp)
41
+ gives an agent direct PixelLab creation tools. It is complementary to PixelKiln,
42
+ not a replacement:
43
+
44
+ | Layer | Responsibility |
45
+ |---|---|
46
+ | PixelLab MCP | Agent-facing access to PixelLab generation capabilities. |
47
+ | PixelKiln skill | Agent guidance for safe project-level operations. |
48
+ | PixelKiln library/CLI | Budgets, state, provenance, review, recovery, audit, and packaging. |
49
+ | PixelLab adapter | The current production and live-tested generation backend. |
50
+
51
+ PixelKiln's core is provider-neutral by design, but PixelLab is the only
52
+ production adapter today. Do not claim compatibility with another backend until
53
+ its adapter and live integration tests ship.
54
+
55
+ ## Recommended first prompt
56
+
57
+ ```text
58
+ Use $pixelkiln to inspect this project's manifest, run the free checks and plan,
59
+ then tell me the exact provider-unit budget required before generating anything.
60
+ ```
61
+
62
+ For command details, continue with the [CLI reference](./CLI.md). For recovery
63
+ and account-level operations, read [Recovery and account safety](./RECOVERY.md)
64
+ before making changes.
@@ -0,0 +1,120 @@
1
+ # Architecture
2
+
3
+ PixelKiln separates provider mechanics from the project state machine:
4
+
5
+ ```text
6
+ manifest + lock + planning + review + recovery + artifact pipelines
7
+ ──────────────────── Provider interface ─────────────────────────
8
+ PixelLabProvider FakeProvider future adapters
9
+ ```
10
+
11
+ Everything above the provider boundary is backend-neutral. URL shapes, auth
12
+ headers, request/response schemas, and optional account capabilities remain in
13
+ the adapter.
14
+
15
+ ## Manifest and resolved specs
16
+
17
+ The committed manifest is intent. Resolution combines one style and one asset,
18
+ loads/reference-hashes style images, applies overrides, chooses a provider-
19
+ supported generator, and computes a deterministic spec hash. The hash excludes
20
+ project root, output location, and tags but includes every pixel-affecting
21
+ setting.
22
+
23
+ See [manifest reference](./MANIFEST.md).
24
+
25
+ ## Lockfile
26
+
27
+ `pixelkiln.lock.json` is the committed paid-work record. Version 2 entries
28
+ retain:
29
+
30
+ - style/asset identity and spec hash;
31
+ - provider and remote object/job ids;
32
+ - explicit lifecycle status and errors;
33
+ - source URLs/candidates/selections;
34
+ - `outputs[]` with portable path, SHA-256, and optional structural role;
35
+ - provider-specific metadata under a provider-id namespace;
36
+ - successful submission cost and cost unit.
37
+
38
+ Lock keys are `styleId/assetId`. Output paths use manifest-relative `/`
39
+ separators so a clone or moved checkout remains valid. Legacy absolute v2 paths
40
+ are rebased in memory and rewritten portably on the next save. The current
41
+ manifest remains destination authority; a stale lock path cannot redirect
42
+ restore into an unrelated project file.
43
+
44
+ Unlike cost units—`generations`, `usd`, and `free`—are never summed. Candidate
45
+ count also belongs to the provider estimate rather than being assumed globally.
46
+
47
+ ## State machine
48
+
49
+ The provider pipeline is deliberately resumable:
50
+
51
+ ```text
52
+ plan → submit → poll → pick (when needed) → fetch
53
+ └──────── structural/inline outputs ────────┘
54
+ ```
55
+
56
+ Remote ids are saved immediately after submission. Generation and download
57
+ failures remain separate, so paid work with a temporary CDN failure is
58
+ recoverable at zero generation cost. Each stage can be rerun independently;
59
+ `gen` is only their everyday orchestration.
60
+
61
+ Provider responses are runtime-validated before entering lock state. A 2xx
62
+ response with a missing object id, malformed URL set, invalid estimate, or
63
+ changed field type becomes an explicit adapter error rather than corrupted
64
+ durable state.
65
+
66
+ ## Output identity
67
+
68
+ One manifest asset may produce multiple structural members. Roles such as
69
+ `tile-03` are load-bearing identity, not presentation. Audits, packs, mounts,
70
+ and exporters all use the same role model. A consumer must request a role when
71
+ there is no unambiguous primary output.
72
+
73
+ PNG ingestion validates signature, chunks, CRCs, palettes, compressed data,
74
+ scanlines, dimensions, and supported color modes before bytes become durable
75
+ output or recovery cache data.
76
+
77
+ ## Concurrency and lock saves
78
+
79
+ Lock writes use a same-directory temporary file and rename. An advisory writer
80
+ lock serializes separate processes. In-process saves queue per path, and
81
+ field-level dirty patches merge separate snapshots so updates to different
82
+ assets—or different fields of one asset—do not silently lose the earlier write.
83
+ Stale advisory locks are recoverable after their safety window.
84
+
85
+ ## Derived artifact transactions
86
+
87
+ Pack, mount, and export use a separate managed bundle writer:
88
+
89
+ 1. Recover an interrupted prior transaction.
90
+ 2. Validate provenance ownership and manual edits.
91
+ 3. Compare every desired member and skip identical bytes.
92
+ 4. Write an immutable transaction journal.
93
+ 5. Stage all changing members beside their destinations.
94
+ 6. Move existing members to unique backups.
95
+ 7. Promote every stage.
96
+ 8. Write a durable commit marker.
97
+ 9. Remove backups, stages, journal, and marker.
98
+
99
+ Before the marker, recovery restores the old complete set. After the marker,
100
+ recovery keeps the new complete set and finishes cleanup. Journal paths are
101
+ validated against current destinations and reserved same-directory temp names.
102
+ See [derived artifacts](./ARTIFACTS.md).
103
+
104
+ ## Caches
105
+
106
+ The project content cache is keyed by output SHA-256. The account cache maps
107
+ provider object ids to remote content hashes for adoption/salvage. Neither is
108
+ authoritative or committed; both can be deleted and rebuilt. Every recovery
109
+ byte is structurally validated before use.
110
+
111
+ ## Provider capability boundary
112
+
113
+ Required provider members cover support/estimate, submit, poll, selection where
114
+ applicable, and download. Account-wide listing, tagging, deletion, and balance
115
+ are optional. Commands such as adopt or salvage report a capability gap rather
116
+ than failing through an undefined method.
117
+
118
+ `FakeProvider` implements the same contract in memory, which keeps the paid
119
+ pipeline testable without credentials or network access. See
120
+ [library API](./LIBRARY.md) and [provider notes](../PROVIDERS.md).
@@ -0,0 +1,162 @@
1
+ # Derived artifacts
2
+
3
+ PixelKiln turns validated source PNGs into application-ready bundles without a
4
+ provider call:
5
+
6
+ - `pack`: deterministic grid sheet plus frame atlas;
7
+ - `mount`: declared stable cells in a new or existing sheet;
8
+ - `export`: structural tile atlas plus generic, Tiled, or Godot metadata.
9
+
10
+ Every CLI bundle includes generated output, metadata, and a
11
+ `<base>.pixelkiln.json` provenance companion.
12
+
13
+ ## Pack
14
+
15
+ ```bash
16
+ pixelkiln pack --style neon
17
+ pixelkiln pack --style ground --output-role tile-00 --output-role tile-01
18
+ pixelkiln pack --style mixed --primary-only
19
+ ```
20
+
21
+ Manifest mode reads exactly the outputs recorded by the lockfile. Frames sort
22
+ by asset id for byte-stable layouts. Structural sets preserve provider order
23
+ and qualify ids by role (`terrain/tile-03`). The grid cell is the largest source
24
+ sprite; smaller frames retain their real dimensions at the cell's top-left.
25
+
26
+ All standard non-interlaced PNG color modes and bit depths are decoded and
27
+ normalized to RGBA. Corrupt/interlaced inputs are reported as skipped. If no
28
+ input is readable, packing fails rather than emitting an empty sheet.
29
+
30
+ Explicit mode packs sources from any project and requires no manifest:
31
+
32
+ ```bash
33
+ pixelkiln pack --inputs sprites.json --out dist/sheet
34
+ ```
35
+
36
+ ```json
37
+ [
38
+ { "id": "effect_euphoric", "path": "art/effect_euphoric.png" },
39
+ { "id": "aura_golden", "path": "../shared/aura_golden.png" }
40
+ ]
41
+ ```
42
+
43
+ Paths resolve from the inputs JSON directory. Duplicate ids fail before file
44
+ decoding because consumers must have one unambiguous frame per id.
45
+
46
+ ## Mount
47
+
48
+ `pack` moves cells when the sorted input set changes. `mount` is for sheets
49
+ whose cell coordinates are already load-bearing in scene files, saved data, or
50
+ engine configuration.
51
+
52
+ Declare `style.mount` and per-asset `cell` values in the manifest. A base sheet
53
+ is optional and may equal the output. Only declared cells are cleared/replaced;
54
+ all other base pixels survive byte-for-byte. A sprite larger than its cell is
55
+ reported and skipped rather than cropped. Two assets cannot own one cell.
56
+
57
+ Use asset `source` when mounting a palette-remapped, aligned, hand-touched, or
58
+ otherwise post-processed file instead of the raw lock output. Use `outputRole`
59
+ to choose one member of a structural set. See [manifest reference](./MANIFEST.md).
60
+
61
+ ## Export
62
+
63
+ ```bash
64
+ pixelkiln export --style ground --only terrain --format generic
65
+ pixelkiln export --style ground --only terrain --format tiled
66
+ pixelkiln export --style ground --only terrain --format godot
67
+ ```
68
+
69
+ Generic JSON retains all provider rules and normalized masks. Tiled and Godot
70
+ translate recognized four-edge/four-corner semantics and reject unknown or
71
+ lossy mappings. See [TILES.md](./TILES.md) for the format contracts.
72
+
73
+ ## Provenance companion
74
+
75
+ The companion is engine-neutral and versioned:
76
+
77
+ ```jsonc
78
+ {
79
+ "format": "pixelkiln-artifact-bundle",
80
+ "version": 1,
81
+ "kind": "pack",
82
+ "fingerprint": "…",
83
+ "sources": [
84
+ { "id": "anvil", "path": "../art/anvil.png", "sha256": "…", "included": true }
85
+ ],
86
+ "options": { "columns": 8, "order": "id", "style": "base" },
87
+ "outputs": [
88
+ { "path": "sheet.png", "sha256": "…" },
89
+ { "path": "sheet.json", "sha256": "…" }
90
+ ]
91
+ }
92
+ ```
93
+
94
+ Source paths are relative to the companion. Options are recursively key-sorted
95
+ before hashing. The fingerprint covers sources, options, and output hashes.
96
+ Manifest-driven bundles conservatively include the project manifest and
97
+ lockfile, so newly declared or recorded sources make an older artifact stale.
98
+
99
+ Verify without rebuilding:
100
+
101
+ ```ts
102
+ import { verifyArtifactBundle } from "pixelkiln"
103
+
104
+ const verification = await verifyArtifactBundle("dist/sheet.pixelkiln.json")
105
+ if (!verification.current) {
106
+ console.error(verification.changedSources, verification.changedOutputs)
107
+ }
108
+ ```
109
+
110
+ ## Ownership and manual edits
111
+
112
+ PixelKiln never silently claims a differing existing destination:
113
+
114
+ - No companion + identical desired bytes: adopt it, preserve its mtime, and
115
+ add provenance.
116
+ - No companion + differing bytes: refuse the entire bundle.
117
+ - Valid companion + matching recorded output: update normally.
118
+ - Valid companion + manually changed output: refuse the entire bundle.
119
+ - Invalid or altered companion: refuse takeover.
120
+
121
+ After reviewing the difference, `--force` explicitly replaces and takes
122
+ ownership of every changing member:
123
+
124
+ ```bash
125
+ pixelkiln pack --style neon --force
126
+ ```
127
+
128
+ Library consumers get the same policy from
129
+ `writeManagedArtifactBundle(..., { force: true })`.
130
+
131
+ ## Transactional writes
132
+
133
+ Changed members are compared first, staged beside their destinations, and only
134
+ then promoted. Duplicate normalized destinations fail before mutation.
135
+ Byte-identical members are not rewritten. If an ordinary write/promotion error
136
+ occurs, newly promoted files are removed and previous backups are restored.
137
+ Any recovery failure retains the backup and reports its exact path.
138
+
139
+ ## Abrupt termination recovery
140
+
141
+ Managed writes create an immutable `<companion>.transaction` journal before
142
+ staging. After every member is promoted, a separate durable commit marker is
143
+ created before cleanup.
144
+
145
+ On the next invocation:
146
+
147
+ - journal without marker: restore the prior complete bundle and remove stages;
148
+ - journal with marker: retain the fully committed new bundle and finish cleanup;
149
+ - live owning process: refuse concurrent recovery;
150
+ - destination or temp path outside the current bundle: refuse unsafe recovery
151
+ and retain the journal for inspection.
152
+
153
+ The journal is short-lived and should not normally appear in Git status. A
154
+ hard-exit integration test covers both sides of the commit boundary.
155
+
156
+ ## Library persistence
157
+
158
+ `packSprites`, `packStyle`, `mountSprites`, `mountStyle`, and `exportTileset`
159
+ return bytes, metadata, skipped-input details, and source hashes. Use
160
+ `writeManagedArtifactBundle` for the CLI's ownership, provenance, transaction,
161
+ and recovery policy. `writeArtifactBundle` is the lower-level staged/rollback
162
+ primitive for callers that supply their own ownership policy.
package/docs/CLI.md ADDED
@@ -0,0 +1,248 @@
1
+ # CLI reference
2
+
3
+ ```text
4
+ pixelkiln <command> [options]
5
+ ```
6
+
7
+ Unknown commands, positional arguments, and flags are errors. Repeated
8
+ `--style`, `--only`, `--claims`, and `--output-role` values accumulate; comma-
9
+ separated values work too. This strict parsing prevents a misspelled filter
10
+ from widening a paid run.
11
+
12
+ ## Everyday pipeline
13
+
14
+ ### `init`
15
+
16
+ Scaffold a manifest from an existing PNG tree.
17
+
18
+ ```bash
19
+ pixelkiln init --from assets/sprites --exclude characters,gifs --generator map
20
+ ```
21
+
22
+ Prompts are deliberately empty because plausible text is not provenance. Use
23
+ `adopt --write-prompts` to recover exact provider prompts for byte matches.
24
+
25
+ ### `plan`
26
+
27
+ Diff the resolved manifest against the lockfile and disk without calling a
28
+ provider. It reports current, missing, untracked, stale, failed, recoverable,
29
+ in-flight, and orphaned entries plus estimated cost in the provider's unit.
30
+
31
+ ```bash
32
+ pixelkiln plan
33
+ pixelkiln plan --style neon --only anvil,hammer --json --check
34
+ ```
35
+
36
+ `--check` exits nonzero unless every selected entry is current.
37
+
38
+ ### `doctor`
39
+
40
+ Validate the manifest, references, lockfile recovery sources, output ownership,
41
+ writability, stale jobs, current plan, API-key configuration, and provider
42
+ connectivity. `--dry-run` skips only live connectivity. Supports `--json` and
43
+ exits nonzero for unsafe state.
44
+
45
+ ### `gen`
46
+
47
+ Run `submit` → `poll` → `pick` → `fetch`. This is the normal paid workflow.
48
+ Use `--budget` as a hard ceiling and filters to limit scope.
49
+
50
+ ```bash
51
+ pixelkiln gen --style neon --only anvil,hammer --budget 80
52
+ ```
53
+
54
+ ### `submit`
55
+
56
+ Queue selected missing/stale generation work without polling it. Enforces the
57
+ provider spacing and concurrency limits, validates estimates at the spending
58
+ boundary, and saves each remote id immediately.
59
+
60
+ ### `poll`
61
+
62
+ Advance submitted jobs to completed, failed, or selection-ready states. It can
63
+ be rerun safely after an interrupted session.
64
+
65
+ ### `pick`
66
+
67
+ Open the local candidate-review UI for jobs with alternatives. Arrow keys
68
+ navigate, Enter selects, 1–9 choose directly, and 0 leaves a row unresolved.
69
+ Only rows submitted with **Apply selections** are written to the lockfile;
70
+ unchosen rows remain ready for later review, and closing the window applies
71
+ nothing. See the [Getting started guide](GETTING_STARTED.md#start-a-new-project)
72
+ for a screenshot of the actual interface.
73
+
74
+ ### `fetch`
75
+
76
+ Download completed or selected outputs, validate complete PNG structure, write
77
+ the manifest-authoritative destinations, populate the content cache, and update
78
+ output hashes. `--tag` also pushes manifest tags after successful downloads.
79
+
80
+ ### `restore`
81
+
82
+ Repair missing generated files without buying new generations. It prefers
83
+ validated local content-addressed cache bytes and otherwise reuses provider
84
+ URLs. It never replaces a destination whose bytes disagree with the lock.
85
+
86
+ ## Reconciliation and lifecycle
87
+
88
+ ### `adopt`
89
+
90
+ Match local files to existing provider objects by SHA-256. `--write-prompts`
91
+ copies recovered prompts into the manifest; `--tag` pushes project tags. Local
92
+ retouches remain untracked rather than being regenerated or overwritten.
93
+
94
+ ### `accept`
95
+
96
+ Re-baseline intact existing art after prompt/style prose changes. Artwork bytes
97
+ do not change; only the recorded spec hash moves. Missing or modified output is
98
+ not accepted.
99
+
100
+ ### `salvage`
101
+
102
+ Review remote objects no supplied lockfile claims. On shared accounts, pass
103
+ every other project lock via repeatable `--claims`; sibling manifests are used
104
+ to exclude objects matching another project's styles. `--dry-run --json`
105
+ provides a scriptable inventory. Import, keep, and discard are review decisions;
106
+ discard only tags an object.
107
+
108
+ ### `purge`
109
+
110
+ Delete provider objects previously tagged `pixelkiln:discard`. It is separate
111
+ from salvage, lists targets, asks for confirmation, and refuses non-interactive
112
+ deletion without `--yes`. Use `--dry-run` first.
113
+
114
+ ### `prune`
115
+
116
+ Remove lock entries no style/asset pair in the manifest resolves to. These
117
+ accumulate when an asset is renamed or moved between styles: the old entry keeps
118
+ claiming the output path the new one now owns, which is what `doctor` reports as
119
+ `lock-outputs`.
120
+
121
+ Offline. It lists what it would remove, asks for confirmation, and refuses
122
+ non-interactive removal without `--yes`. Use `--dry-run` first. The artwork on
123
+ disk is untouched and nothing is deleted from the provider account, but the
124
+ pruned entries' provenance is gone, so those objects read as unclaimed the next
125
+ time you run `salvage`.
126
+
127
+ `--style` and `--only` are rejected: prune compares the lockfile against the
128
+ whole manifest, so a filter would make every entry it excluded look undeclared.
129
+
130
+ ### `tag`
131
+
132
+ Push current manifest tags to tracked provider objects. This does not generate
133
+ or download artwork.
134
+
135
+ ### `balance`
136
+
137
+ Show the provider's remaining balance and cost unit.
138
+
139
+ ### `status`
140
+
141
+ Summarize lock entries by state and successful submission spend by cost unit.
142
+ Supports `--json`; unlike units are never added together.
143
+
144
+ ## Local quality and derived output
145
+
146
+ ### `audit`
147
+
148
+ Measure palette distance, transparent canvas share, and opaque color count for
149
+ every selected output. Structural sets are evaluated member-by-member.
150
+
151
+ ```bash
152
+ pixelkiln audit --style neon --json --check \
153
+ --max-distance 35 --min-transparency 0.1 --max-colors 128 --sigma 1.5
154
+ ```
155
+
156
+ ### `cache`
157
+
158
+ Inspect the local content cache and account object-hash cache. `--check` exits
159
+ nonzero for unsafe state. `--prune` removes malformed, corrupt, partial, and
160
+ unreferenced cache data; it does not delete provider objects.
161
+
162
+ ### `pack`
163
+
164
+ Build a deterministic RGBA sprite sheet, JSON atlas, and `.pixelkiln.json`
165
+ provenance companion. Manifest mode reads lock outputs. Explicit-input mode
166
+ needs no manifest:
167
+
168
+ ```bash
169
+ pixelkiln pack --style neon --columns 8
170
+ pixelkiln pack --inputs sprites.json --out dist/sheet
171
+ ```
172
+
173
+ Use repeatable `--output-role` for structural members or `--primary-only` for
174
+ unambiguous single outputs. These modes are mutually exclusive.
175
+
176
+ ### `mount`
177
+
178
+ Write sprites into manifest-declared cells, optionally over an existing base
179
+ sheet. Undeclared cells survive byte-for-byte; each declared cell is cleared
180
+ before its sprite is placed.
181
+
182
+ ### `export`
183
+
184
+ Build a structural tile atlas plus generic JSON, Tiled TSJ, or Godot TRES
185
+ metadata and a provenance companion.
186
+
187
+ ```bash
188
+ pixelkiln export --style ground --only terrain --format tiled --columns 8
189
+ ```
190
+
191
+ See [derived artifacts](./ARTIFACTS.md) and [tiles](./TILES.md).
192
+
193
+ ## Utility commands
194
+
195
+ ### `help`
196
+
197
+ Print the built-in command and option summary. `--help` and `-h` are aliases.
198
+
199
+ ### `--version`
200
+
201
+ Print the package version. `-v` is an alias.
202
+
203
+ ## Options
204
+
205
+ | Option | Applies to | Meaning |
206
+ |---|---|---|
207
+ | `--manifest <path>` | manifest commands | Manifest path; defaults to `pixelkiln.manifest.json`. |
208
+ | `--lock <path>` | manifest commands | Lock path; defaults beside the manifest. |
209
+ | `--style a,b` | most workflows | Restrict styles; repeatable. |
210
+ | `--only id1,id2` | most workflows | Restrict asset ids; repeatable. |
211
+ | `--budget <n>` | submit/gen | Refuse work above this provider-unit cost. |
212
+ | `--force` | gen/derived commands | Regenerate current work or explicitly take ownership of modified/unowned derived output. |
213
+ | `--dry-run` | supported mutating commands | Inspect without spending or mutating provider state. |
214
+ | `--json` | plan/doctor/audit/cache/status/salvage | Machine-readable stdout where supported. |
215
+ | `--check` | plan/audit/cache | Exit nonzero when selected state is unsafe. |
216
+ | `--yes`, `-y` | confirmed operations | Skip an interactive confirmation. |
217
+ | `--no-open` | pick/salvage | Do not automatically open the browser. |
218
+ | `--tag` | fetch/adopt | Also push tags after the command's primary work. |
219
+ | `--claims <paths>` | salvage | Other project lockfiles; repeatable and comma-separated. |
220
+ | `--all` | salvage dry run | List every unclaimed object rather than the first 30. |
221
+ | `--from <dir>` | init | Existing source tree to scan. |
222
+ | `--exclude <names>` | init | Directory/name fragments to exclude; repeatable. |
223
+ | `--generator <name>` | init | Generator assigned to the scaffolded style. |
224
+ | `--name <name>` | init | Project name for the scaffolded manifest. |
225
+ | `--write-prompts` | adopt | Recover provider prompts into the manifest. |
226
+ | `--port <n>` | pick/salvage | Local review server port; otherwise chooses a free port. |
227
+ | `--out <path>` | pack/export | Output base override. Export requires one selected tileset. |
228
+ | `--inputs <path>` | pack | JSON array of `{ id, path }`; requires `--out`. |
229
+ | `--columns <n>` | pack/export | Grid columns, 1–1024; default is near-square. |
230
+ | `--format <name>` | export | `generic` (default), `tiled`, or `godot`. |
231
+ | `--output-role <role>` | pack | Include named structural roles; repeatable. |
232
+ | `--primary-only` | pack | Include only unambiguous primary/single outputs. |
233
+ | `--max-distance <n>` | audit | Absolute palette-distance ceiling. |
234
+ | `--min-transparency <0..1>` | audit | Minimum transparent canvas share. |
235
+ | `--max-colors <n>` | audit | Maximum distinct opaque colors. |
236
+ | `--sigma <n>` | audit | Relative outlier cutoff; defaults to 1.5. |
237
+ | `--prune` | cache | Remove invalid and unreferenced cache data. |
238
+
239
+ ## Exit and output contract
240
+
241
+ - Parse, schema, ownership, provider, and filesystem errors exit nonzero.
242
+ - `submit`, `poll`, `fetch`, and `gen` exit nonzero on partial failure or
243
+ timeout; automation cannot mistake an incomplete batch for success.
244
+ - Human progress goes to stderr when `salvage --dry-run --json` reserves stdout
245
+ for JSON.
246
+ - `plan --check`, `audit --check`, and `cache --check` are intended as CI gates.
247
+ - Commands that can spend or delete expose their scope before doing so; budget
248
+ and confirmation are separate protections.