@wzrdtech/core package defines the canonical Zod schema for Zap recipes. Every field listed here is validated by parseZapMarkdown() before any run begins — if your Zap.md frontmatter fails validation, no provider jobs are submitted and the error is surfaced immediately with the offending field path.
TypeScript Types
@wzrdtech/core exports the following types, all inferred directly from their Zod schemas:
ZapSpec Fields
Top-level fields of thezapSpecSchema. All fields are required unless a default is noted.
string
required
Recipe slug. Used as the identifier for the Zap in Convex, the CLI, and the API. Must be at least 1 character. By convention, use kebab-case (e.g.
launch-trailer).integer
required
Positive integer recipe version. Increment when making breaking changes to step structure or inputs. Stored on every Convex run record alongside the recipe slug.
string
required
Human-readable description of what the recipe produces. Shown in the web UI and surfaced via
publicZapSpec().number
required
Non-negative estimated cost for one full run at the default
extendCount. Used for display and compared against cap_usd during planning. Set to 0 for mock/free recipes.number
required
Positive hard cap in USD.
assertWithinBudget() throws if the planned run cost exceeds this value before any provider jobs are submitted.string
default:"gmi"
Default provider for all steps that do not declare their own
provider. Must be a registered provider adapter ID. Built-in values: gmi, fal, mock.string
Optional default aspect ratio string forwarded to provider adapters that accept it (e.g.
"16:9", "9:16"). Steps can override at the model level.Record<string, ZapInput>
default:"{}"
Map of input variable names to their
ZapInput declarations. Keys must be UPPER_SNAKE_CASE by convention and are referenced in prompt files as {VARIABLE_NAME}. validateVariables() will throw if a prompt file references an undeclared input.ZapStep[]
required
Ordered array of pipeline steps. At least 1 step is required. Steps are executed in dependency order derived from their
inputs references. See Step Kinds for full step documentation.string
default:"Zap.mp4"
Filename for the final output artifact. Defaults to
Zap.mp4. The stitch step writes its result to this path on local runs and to Blob storage on web runs.ZapInput Fields
Declares a user-supplied input variable. Referenced in prompt files as{VARIABLE_NAME}.
string
required
Input widget type. Must be one of:
string
Display label shown in the web UI above the input widget. Falls back to the variable name if omitted.
string
Helper text shown below the input widget to guide the user. Optional.
boolean
default:"false"
When
true, validateRequiredInputs() will throw before the run is submitted if this input is absent from the request payload.string[]
Array of allowed values for
type: select inputs. Ignored for all other types.ZapStep Fields
Every step in thesteps array is validated against zapStepSchema.
string
required
Unique step identifier within the recipe. Must be at least 1 character.
validateDuplicateStepIds() throws on collision. Used by downstream steps in their inputs arrays and surfaced in all Convex step records.ZapStepKind
required
The generation category for this step. Determines which provider capability is invoked. See Step Kinds for descriptions of all 11 values.
string
Override the
defaults.provider for this step only. Use mock for zero-cost development steps within an otherwise live recipe.string
Model identifier forwarded to the provider adapter. Rate table in the planner uses this field for cost estimation (e.g.
seedance-2-0-260128, fal-ai/flux/dev).string
Path to a Markdown prompt file relative to the recipe root (e.g.
prompts/initial-frame.md). Variable references of the form {VARIABLE_NAME} are resolved against the inputs map at validation time.string[]
Array of upstream step
id values whose outputs are passed as inputs to this step. The order is significant for providers that accept multiple reference assets.number
Positive clip duration in seconds. Used by
quoteStep() to estimate provider cost for time-billed models (e.g. perSecond rates). Required for video.gen and video.extend steps on most providers.integer
Number of generation candidates to request from the provider. Integer between 1 and 16. When
>1, the runtime generates multiple outputs and the best is selected (optionally via RLHF scoring).object
Controls the variable-length extension chain for
video.extend steps. The planner calls expandRepeatSteps() to flatten repeat steps into numbered instances.ZapStitch
Stitch configuration for
kind: stitch steps. See ZapStitch Fields below."draft" | "final"
Optional quality tier hint forwarded to the provider.
draft may use cheaper or faster model variants; final targets the highest quality path.boolean | "optional"
Human feedback flag.
true pauses the run after this step and waits for a human vote. "optional" collects feedback without blocking. false or omitted disables RLHF for this step.When
true, this step’s output asset is eligible to be surfaced publicly (e.g. in a community gallery). Defaults to false.string[]
Array of image URLs or local paths to use as reference images for this step. Forwarded to providers that support reference-based generation (e.g. character consistency).
Record<string, unknown>
Provider-specific audio configuration record for steps that accept audio inputs or parameters. The shape is adapter-defined; unrecognised keys are passed through to the provider.
Record<string, unknown>
Provider-specific first-frame configuration record. Used by image-to-video providers to control how the anchor frame is interpreted (e.g. crop mode, anchor weight).
Record<string, unknown>
Provider-specific VLM judge configuration record. When set, the runtime requests an automated quality score from a vision-language model after the step completes and records the result in the
feedback table.Record<string, unknown>
Provider-specific keyframe configuration record for
kind: keyframes steps. Controls frame extraction interval, scoring criteria, or other adapter-defined parameters.object
Extension mode configuration for
video.extend steps.ZapStitch Fields
Thestitch object configures how assets are assembled into the final output. Used on kind: stitch steps; defaults are applied automatically if the field is omitted.
string
default:"auto"
Stitching engine to use.
string
default:"mp4"
Output container format.
mp4 (H.264, wide compatibility) or webm (VP9, smaller file size).string
default:"standard"
Encode quality preset.
draft (fast preview), standard (default), or high (production quality, slower encode).integer
Output frame rate. Integer between 1 and 120. When omitted, the engine inherits the frame rate of the source clips.
Core API
All functions are exported from@wzrdtech/core.
