execute
Destructive
Run Luau code in the connected world and return its result, logs, and engine state. Long runs are promoted to a background task ({status:"running", taskId, hint}); the hint says what to do next for your harness (wait resumes the task).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as | No | Your own name, when you are one of several agents sharing one connection to this engine (the sub-agents one agent session runs share its connection, so without it the engine sees all of them as one caller). Pass the same name on every call you make. The engine then treats you as a caller of your own: your roster name is this name, and your play session, the play-shadow writes and refusals that say who wrote what, engine.modeOwner, your shell session and your notices are yours alone. Lowercase letters, digits, '-' and '_'. Leave it out when you are the only agent on your connection. | |
| args | No | Values injected as the SCRIPT_ARGS global. | |
| code | No | Inline Luau source to run. | |
| file | No | VFS path to a .luau file to run instead of `code`. | |
| logs | No | Minimum log level to return (default error). | |
| strict | No | Per-call override for the LSP strict gate. Defaults to true (honour the world's lsp.strict_mode). Set to false on a single call to skip the gate even when error-level diagnostics are present — useful when prototyping against runtime-installed globals the LSP can't see. Diagnostics still flow back in the result so you see what was bypassed. | |
| logScope | No | Whose work the engine-window log lines in the response may be about (default: caller). One engine serves several agents at once and runs all of their content, so its log holds all of their failures. `logs` says how severe a line must be to appear; this says whose work it may be about, which no severity floor can express, because a neighbour's per-frame error IS an error. `caller` keeps the lines this call's own work raised plus the engine's own, and closes the list with one <n error lines from another caller's work left out> marker when there were any. `all` keeps every caller's, which is what a reader debugging the whole engine wants. The engine's own subsystem lines carry no caller and are kept either way. | |
| wait_frames | No | Frames to await deferred work (default 4). |