The CLI is a thin shell over a server-side, importable API. A backend can do NL → eDSL → IR → (preview + diff) without shelling out or re-implementing the evaluator. Three subpath exports of the reframe-video npm package:
reframe-video/compile executes the scene module in-process. Treat untrusted or model-authored source as code: bound it with a timeout and run it where a misbehaving module can’t do harm. True sandboxing is a separate concern.
Load & validate a scene
A ValidationIssue is structured, not prose — so a UI can point at the exact broken node:
The CLI mirrors this: reframe compile --json returns { ok: false, error, kind, issues } on failure.
Check determinism
This is what reframe lint runs for the source-purity half of its gate.
Render a frame
renderFrame evaluates the compiled scene at t and paints the resulting DisplayList; pass an ImageRegistry / VideoRegistry to supply raster sources for image / video nodes. This is the same path the live browser preview uses.
Spatial query — where things are on screen
sceneManifest answers what you can edit (addresses); the spatial query answers where it is and what’s under a point at time t — the other half an editor needs. Pure functions over the DisplayList (each op carries its source id + final scene-space transform), with canvas-free Inter metrics, so no canvas is required:
On the CLI: reframe geometry <scene> --t <sec> --json.
Embedded editor — player --edit
reframe player <scene> --edit -o editor.html builds an embedded-editor variant: no autoplay, seek-driven, exposing a live API + a host↔iframe postMessage channel, so a host (e.g. a desktop or web editor) can click-to-select, draw aligned handles, and preview overlay edits without rebuilding the HTML:
setOverlay(doc) runs composeScene(baseIR, doc) → compileScene → redraw, so a dragged node or motionPath waypoint round-trips as a regen-stable overlay patch (nodes.<id>.x, timeline.<label>.points). --edit-origin <origin> restricts event.origin (default *).