import type { EditorCommand } from "./commands.js"; import type { EditorDocument } from "./types.js"; import { type RuntimeEntityState, type RuntimeStateSnapshot } from "./liveSync.js"; /** Play-mode sim gate held by the editor host — pause freezes ticks; step runs N frames then re-pauses. */ export interface RuntimePlayControl { paused: boolean; pendingSteps: number; } /** Compact reverse-channel view for the play-mode inspector and `runtime_summary` RPC. */ export interface RuntimeInspectorSummary { seq: number; entityCount: number; entities: readonly { id: string; hasPosition: boolean; rotationY?: number; valueKeys: readonly string[]; }[]; tunableKeys: readonly string[]; overrideIds: readonly string[]; play: RuntimePlayControl; } /** One resolved runtime field returned by `runtime_get`. */ export interface RuntimeInspectorGetResult { id: string; kind: "entity" | "tunable" | "missing"; entity?: RuntimeEntityState; path?: string; value?: unknown; override?: RuntimeEntityState; } /** Desired mutation from `runtime_set` before the host applies it. */ export interface RuntimeInspectorSetPlan { entity?: RuntimeEntityState; tunable?: { key: string; value: unknown; }; writeBackCommands: readonly EditorCommand[]; error?: string; } /** * Builds the compact reverse-channel summary used by the play-mode inspector panel and the * `runtime_summary` bridge RPC. * @capability editor-runtime-inspector summarize live runtime entities and tunables for play mode */ export declare function summarizeRuntimeInspector(snapshot: RuntimeStateSnapshot, overrides: Readonly>, play: RuntimePlayControl): RuntimeInspectorSummary; /** * Resolves one entity, entity field, or tunable from the reverse-channel snapshot (with overrides * layered on top for entity rows). * @capability editor-runtime-inspector read one live runtime entity field or tunable */ export declare function getRuntimeInspectorValue(snapshot: RuntimeStateSnapshot, overrides: Readonly>, id: string, path?: string): RuntimeInspectorGetResult; /** * Plans a play-mode poke: builds the ephemeral entity/tunable override and, when `writeBack` is * true, the undoable document commands that promote it into the scene document. * @capability editor-runtime-inspector plan a play-mode runtime_set with optional document write-back */ export declare function planRuntimeInspectorSet(document: EditorDocument, input: { id: string; path?: string; value?: unknown; position?: { x: number; y: number; z: number; }; rotationY?: number; values?: Record; writeBack?: boolean; }): RuntimeInspectorSetPlan; /** * Promotes ephemeral runtime `values` into an undoable meta patch on a document-linked object. * Returns null when the id is not in the document or there are no values. * @capability editor-runtime-inspector promote runtime entity values into a document meta write-back */ export declare function runtimeEntityMetaWriteBackCommand(document: EditorDocument, entity: RuntimeEntityState): EditorCommand | null; /** * Advances the play-control step counter: when paused with pending steps, consumes one and reports * whether the sim should run this frame. When not paused, always runs. * @capability editor-runtime-inspector gate a play-mode frame against pause/step control */ export declare function consumeRuntimePlayStep(play: RuntimePlayControl): { runFrame: boolean; next: RuntimePlayControl; }; /** Default play-control state when entering play mode (running). */ export declare function createRuntimePlayControl(paused?: boolean): RuntimePlayControl;