formatVersion
SourceVersion of the description, dump, and trace formats.
Runtime
Opt-in runtime introspection for tools, tests, and coding agents.
A runtime made with debug: true carries a debug handle. Runtimes made without it have no handle at all, so production code cannot reach into internals by accident and pays nothing for them.
The handle is read-only: it describes the schema and schedules, dumps the current world as plain data, reports stream retention, and streams trace events while schedules run. Nothing it returns can change the world.
Values in descriptions, dumps, and traces are shared with the world, not copied. World values are immutable by contract, so they stay valid as a history, but serialize them before sending them elsewhere.
@typeonce/bevy-ts-devtools builds sessions, histories, formatting, and invariants on top of this handle.
const runtime = Game.Runtime.make({ services, resources, debug: true })
runtime.debug.nameSchedules({ setup: setupSchedule, update: updateSchedule })
const stop = runtime.debug.observe((event) => {
if (event.type === "system" && event.outcome !== "ok") console.log(event)
})
runtime.tick(setupSchedule)
console.log(runtime.debug.dump({ with: [Player] }))
stop()
Version of the description, dump, and trace formats.