Scripts

Run a reusable or inline script

Changed on

Inline source skips typecheck and is auto-saved as a scratch script only on success.

post/api/scripts/run

Request

  • Base URL
    http://localhost:3013
  • URL
    http://localhost:3013/api/scripts/run
  • Auth
    HTTP bearer

Headers

X-Runtime-Instance-IDstring

Identifies the concrete runtime instance (worker process) making the call, as generated at its boot. Required to acquire work through the script SDK when multi-runtime mode (MULTI_RUNTIME_ENABLED) is on; ignored otherwise.

Request body

namestring
sourcestring
argsunknown
intentstring
scope'global' | 'agent'
fsMode'none' | 'workspace-rw'
executor'native' | 'quickjs' | 'null' nullable
idempotencyKeystring

Response

Script run completed

resultunknown
durationMsnumber required
stdoutstring required
stderrstring required
exitCodenumber required
error'timeout' | 'oom' | 'killed' | 'import_violation' | 'eval_error' | 'executor_error' | 'capacity_exceeded'

Changes