Library API
Public TypeScript contracts for composing PixelKiln workflows.
PixelKiln's public package entry point exposes the same provider-independent primitives used by the CLI. Use these when a build tool, editor integration, or game pipeline needs structured results instead of terminal output.
Open a project
openProject(manifestPath, options) is the sequence the CLI runs before any command: read .env.local and .env beside the manifest (and in the working directory) into process.env…
Load, resolve, and plan by hand
The pieces openProject composes are exported for callers that need one of them alone, for example a manifest with no lockfile yet, or specs resolved against a provider the regis…
Inspect every generation
buildGallerySnapshot is the offline, serializable view behind pixelkiln gallery: every lock entry with its plan state, outputs, quality record, lineage, and manifest intent, plu…
Hand edits and the in-browser editor
A hand edit never touches the generated file: it is a sibling under <outDir>/edits/ that the manifest points at with source (or sourceByStyle), so plan keeps the generation ok w…
Audit and gate generated art
Audits evaluate every structural output separately.
Inspect and verify recipes
RecipeSchema validates the public v1 format.
Build sprite sheets
Use packStyle for one lockfile style or packSprites for an explicit list.
Export generated tiles
The generic format preserves the complete provider rule object.
Provider integrations
Provider is the capability boundary.
Errors a caller can branch on
Most failures are plain Errors whose message is written for a person.
Stability and file paths
Public imports come from pixelkiln; internal src/ paths are not part of the package contract.
The whole reference is one Markdown file: docs/LIBRARY.md.
