Compile

Compilation is the main quality gate. It parses .ws, applies mood and theme policy, resolves timing and layout, validates structure, and emits a RenderGraph.

Use compile when you want to inspect, validate, diff, or approve a video before rendering it.

Compile From Source

POST/api/compile

Compile `.ws` source

Returns a RenderGraph and diagnostics. No MP4 is rendered.

bash
curl -X POST "$WORKSHOP_URL/api/compile" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $WORKSHOP_API_KEY" \
  -d '{
    "source": "Film "Launch"
  mood: precision

Scene "Intro"
  show "Numbers deserve exact motion."
    size: hero
    enter: rise"
  }'
json
{
  "renderGraph": {
    "version": "1.0.0",
    "film": { "title": "Launch", "mood": "precision" },
    "scenes": []
  },
  "diagnostics": []
}

Request Body

Field Type Required Purpose
source string yes .ws source text
theme string no ThemePack name to apply
preview boolean no Request preview-oriented compilation metadata

Compile From File

POST/api/compile/file

Compile uploaded `.ws`

Accepts multipart form-data with a .ws file.

bash
curl -X POST "$WORKSHOP_URL/api/compile/file" \
  -H "x-api-key: $WORKSHOP_API_KEY" \
  -F "file=@quarterly-results.ws"

Failure Example

json
{
  "error": "Compilation failed",
  "diagnostics": [
    {
      "level": "error",
      "message": "Unknown mood: precise. Using 'confident' as fallback.",
      "line": 2,
      "column": 9
    }
  ]
}

Agents should treat diagnostics as repair instructions. Humans should treat them as reviewable evidence for why a source document cannot move forward.

Next Steps