/** * RuntimeCoordinator -- shared host/runtime coordination surface. * * Bridges Plan and ECS into the live host path by: * - defining the execution graph for runtime passes * - backing quantizer state indices and dirty epochs with dense stores * * The coordinator is intentionally light-weight on the hot path: the plan is * constructed once up front, and dense stores are used for numeric state that * is read repeatedly during runtime work. * * @module */ import { EntityId } from './ecs.js'; import type { DenseStore } from './ecs.js'; import { Plan } from './plan.js'; /** * Named stages of the runtime frame pass, in canonical topological order: * discrete quantization first, then blend weights, then target emitters. */ export type RuntimePhase = 'compute-discrete' | 'compute-blend' | 'emit-css' | 'emit-glsl' | 'emit-wgsl' | 'emit-aria'; /** Options accepted by {@link RuntimeCoordinator.create}: entity capacity and plan name. */ export interface RuntimeCoordinatorConfig { readonly capacity?: number; readonly name?: string; } /** * Live coordinator surface: the immutable runtime {@link Plan}, ordered phase * list, dense stores for state index + dirty epoch, and registration/mutation * APIs used by the compositor on the hot path. */ export interface RuntimeCoordinatorShape { readonly plan: Plan.IR; readonly phases: readonly RuntimePhase[]; readonly stores: { readonly stateIndex: DenseStore; readonly dirtyEpoch: DenseStore; }; reset(registrations?: readonly { readonly name: string; readonly states: readonly string[]; }[]): void; registerQuantizer(name: string, states: readonly string[]): EntityId; removeQuantizer(name: string): void; hasQuantizer(name: string): boolean; setState(name: string, state: string): void; applyState(name: string, state: string): number; getStateIndex(name: string): number; markDirty(name: string): void; getDirtyEpoch(name: string): number; registeredNames(): readonly string[]; } /** * Build a fresh {@link RuntimeCoordinator} with dense backing stores and the * canonical runtime plan. Prefer {@link RuntimeCoordinator.create}, which is * the exported entry point. */ export declare function createRuntimeCoordinator(config?: RuntimeCoordinatorConfig): RuntimeCoordinatorShape; /** * Runtime coordinator namespace — single entry point for building the shared * {@link Plan} + ECS store bundle consumed by every host adapter. */ export declare const RuntimeCoordinator: { /** Create a fresh coordinator. See {@link createRuntimeCoordinator}. */ readonly create: typeof createRuntimeCoordinator; }; export declare namespace RuntimeCoordinator { /** Alias for `RuntimeCoordinatorShape`. */ type Shape = RuntimeCoordinatorShape; /** Alias for `RuntimeCoordinatorConfig`. */ type Config = RuntimeCoordinatorConfig; /** Alias for `RuntimePhase`. */ type Phase = RuntimePhase; } //# sourceMappingURL=runtime-coordinator.d.ts.map