TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gratitude5dee/Zap/llms.txt
Use this file to discover all available pages before exploring further.
@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.
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).Positive integer recipe version. Increment when making breaking changes to step structure or inputs. Stored on every Convex run record alongside the recipe slug.
Human-readable description of what the recipe produces. Shown in the web UI and surfaced via
publicZapSpec().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.Positive hard cap in USD.
assertWithinBudget() throws if the planned run cost exceeds this value before any provider jobs are submitted.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.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.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.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.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}.
Input widget type. Must be one of:
| Value | Description |
|---|---|
string | Single-line text |
textarea | Multi-line text |
image | Image upload or URL |
video | Video upload or URL |
select | Dropdown — requires options array |
number | Numeric input |
Display label shown in the web UI above the input widget. Falls back to the variable name if omitted.
Helper text shown below the input widget to guide the user. Optional.
When
true, validateRequiredInputs() will throw before the run is submitted if this input is absent from the request payload.Array of allowed values for
type: select inputs. Ignored for all other types.ZapStep Fields
Every step in thesteps array is validated against zapStepSchema.
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.The generation category for this step. Determines which provider capability is invoked. See Step Kinds for descriptions of all 11 values.
Override the
defaults.provider for this step only. Use mock for zero-cost development steps within an otherwise live recipe.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).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.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.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.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).Controls the variable-length extension chain for
video.extend steps. The planner calls expandRepeatSteps() to flatten repeat steps into numbered instances.| Sub-field | Type | Description |
|---|---|---|
min | integer ≥ 0 | Minimum expansions (default: 0) |
max | integer 0–64 | Maximum expansions (default: 64) |
default | integer ≥ 0 | Default expansion count shown in the UI |
Stitch configuration for
kind: stitch steps. See ZapStitch Fields below.Optional quality tier hint forwarded to the provider.
draft may use cheaper or faster model variants; final targets the highest quality path.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.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).
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.
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).
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.Provider-specific keyframe configuration record for
kind: keyframes steps. Controls frame extraction interval, scoring criteria, or other adapter-defined parameters.Extension mode configuration for
video.extend steps.| Sub-field | Type | Default | Description |
|---|---|---|---|
mode | "chain" | "anchored" | "chain" | chain feeds each extension’s last frame into the next; anchored always re-anchors to the original first frame. |
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.
Stitching engine to use.
| Value | Description |
|---|---|
auto | Let the runtime choose the best available engine |
local | FFmpeg-based local stitching — always available, no extra dependencies |
hyperframes | HTML composition via the HyperFrames CLI — falls back to local if the CLI is not installed |
Output container format.
mp4 (H.264, wide compatibility) or webm (VP9, smaller file size).Encode quality preset.
draft (fast preview), standard (default), or high (production quality, slower encode).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.
