Module scripting

Source
Expand description

Embedded Luau scripting: .luau files in the scripts folder drive the editor through the same tool catalogue the MCP server exposes (editor.tool("timeline.add_clip", {...})). The VM is sandboxed (no io/os/ffi) and interrupted after a wall-clock budget so a runaway loop cannot hang the UI. Scripts run on the UI thread against the live project; the app wraps each run in one undo step.

Constantsยง

BUDGET ๐Ÿ”’
Wall-clock budget for one script run (it executes on the UI thread).
EXAMPLE ๐Ÿ”’

Functionsยง

json_to_lua ๐Ÿ”’
JSON -> Lua value.
list
Every .luau file in the scripts folder, sorted by name. Creates the folder (and a starter example) the first time it is asked for.
lua_to_json ๐Ÿ”’
Lua value -> JSON. Tables with only positive-integer keys become arrays; everything else an object.
run
Run src with an editor global. call executes one tool against the live project and is invoked re-entrantly from inside the VM; logs collects editor.log lines for the app to show.
scripts_dir