jobs
The jobs namespace — the engine's Luau API reference for jobs.
The jobs namespace — 4 functions.
globals/jobs/find
globals/jobs/find(name: string) -> JobHandle?
Look up a registered job by name. Returns a JobHandle or nil for anonymous / unknown names. Single FFI crossing — returns the id directly, no registry snapshot.
globals/jobs/inspect
globals/jobs/inspect(target: JobHandle | string) -> JobInfo?
Return a snapshot row by job handle or by name without retrieving a full handle. Single FFI crossing — pulls only the matching row.
globals/jobs/list
globals/jobs/list(phase: string?) -> { JobInfo }
List registered job summaries. Pass a phase name to filter to a single phase. Single FFI crossing — only the requested rows cross the bridge.
globals/jobs/register
globals/jobs/register(descriptor: table) -> JobHandle?
Register a substrate job. Returns a JobHandle on success, nil on validation failure. Dispatches by executor.kind:\n - "kernel" / "stub" → standard __jobs.register (JSON-only descriptor).\n - "luau" → __jobs.register_luau(descriptor, executor.run) so the Luau function survives the JSON crossing as a stable registry ref. The dispatcher invokes the run closure once per frame; the closure captures any bindings/buffers it needs.\n\norigin is auto-filled with the VFS path of the calling script unless the descriptor already supplies one — surfaced under /zero/runtime/jobs/<phase>/<key>/origin.txt for agent traceability. Single FFI crossing — auto-origin runs Rust-side via lua_getinfo, no separate stack-inspection trip.