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/compileCompile `.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/fileCompile 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
- Render - queue MP4 output
- The RenderGraph - inspect the compiled protocol
- Error Handling - diagnostics and status codes