@almadar/runtime 6.18.0 → 6.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OrbitalServerRuntime-CJWejtSD.d.ts → OrbitalServerRuntime-TewGACFH.d.ts} +1 -0
- package/dist/OrbitalServerRuntime.d.ts +1 -1
- package/dist/OrbitalServerRuntime.js +11 -7
- package/dist/OrbitalServerRuntime.js.map +1 -1
- package/dist/{chunk-G2VW5WJZ.js → chunk-JZ4IDIUU.js} +89 -3
- package/dist/chunk-JZ4IDIUU.js.map +1 -0
- package/dist/index.d.ts +46 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-G2VW5WJZ.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { B as BindingContext, E as EvaluationContextExtensions, P as PatternProps, a as EffectHandlers, b as EffectContext, c as ExecutionEnvironment, d as EffectResult, T as TraitDefinition } from './types-BA7GoDni.js';
|
|
2
2
|
export { e as Effect, f as EventListener, H as HANDLER_MANIFEST, I as IEventBus, R as RuntimeConfig, g as RuntimeEvent, h as TraitState, i as TransitionObserver, j as TransitionResult, U as Unsubscribe } from './types-BA7GoDni.js';
|
|
3
|
-
import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital } from './OrbitalServerRuntime-
|
|
4
|
-
export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, O as OrbitalEventRequest, e as OrbitalEventResponse, f as OrbitalServerRuntimeConfig, P as PreprocessOptions, g as PreprocessResult, h as PreprocessedSchema, i as ProcessEventOptions, R as RegisteredOrbital, j as RuntimeOrbital, k as RuntimeOrbitalSchema, l as RuntimeTrait, m as StateMachineManager, n as collectDeclaredConfigDefaults, o as collectDeclaredEntityDefaults, p as createInitialTraitState, q as findInitialState, r as findTransition, s as getIsolatedCollectionName, t as getNamespacedEvent, u as isBrowser, v as isElectron, w as isNamespacedEvent, x as isNode, y as normalizeEventKey, z as parseNamespacedEvent, A as preprocessSchema, B as processEvent } from './OrbitalServerRuntime-
|
|
3
|
+
import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital } from './OrbitalServerRuntime-TewGACFH.js';
|
|
4
|
+
export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, O as OrbitalEventRequest, e as OrbitalEventResponse, f as OrbitalServerRuntimeConfig, P as PreprocessOptions, g as PreprocessResult, h as PreprocessedSchema, i as ProcessEventOptions, R as RegisteredOrbital, j as RuntimeOrbital, k as RuntimeOrbitalSchema, l as RuntimeTrait, m as StateMachineManager, n as collectDeclaredConfigDefaults, o as collectDeclaredEntityDefaults, p as createInitialTraitState, q as findInitialState, r as findTransition, s as getIsolatedCollectionName, t as getNamespacedEvent, u as isBrowser, v as isElectron, w as isNamespacedEvent, x as isNode, y as normalizeEventKey, z as parseNamespacedEvent, A as preprocessSchema, B as processEvent } from './OrbitalServerRuntime-TewGACFH.js';
|
|
5
5
|
import { EvaluationContext } from '@almadar/evaluator';
|
|
6
6
|
export { EvaluationContext, createMinimalContext } from '@almadar/evaluator';
|
|
7
7
|
import { EventPayload, EntityField, EntityRow, ServiceParams, PayloadField, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
|
|
@@ -137,6 +137,49 @@ declare class UnifiedLoader implements SchemaLoader {
|
|
|
137
137
|
*/
|
|
138
138
|
declare function createUnifiedLoader(options: UnifiedLoaderOptions): UnifiedLoader;
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* TickScheduler — a single coalesced clock for every registered tick.
|
|
142
|
+
*
|
|
143
|
+
* Replaces "one independent timer per tick" with ONE requestAnimationFrame
|
|
144
|
+
* accumulator loop (falling back to a single ~60fps `setInterval` where rAF
|
|
145
|
+
* isn't available, e.g. Node/SSR) that walks every registered tick each pass
|
|
146
|
+
* and fires whichever one(s) have crossed their own interval — so ticks due
|
|
147
|
+
* in the same pass commit together instead of on independent, uncoordinated
|
|
148
|
+
* timers. Framework-light: no React, usable from `OrbitalServerRuntime`
|
|
149
|
+
* (this package) and from `@almadar/ui`'s `useTraitStateMachine` alike.
|
|
150
|
+
*
|
|
151
|
+
* @packageDocumentation
|
|
152
|
+
*/
|
|
153
|
+
interface TickHandle {
|
|
154
|
+
/** Stop just this tick; the shared loop keeps running for any others still registered. */
|
|
155
|
+
stop(): void;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Coalesced tick scheduler. One instance drives every tick registered on it
|
|
159
|
+
* through a single shared clock.
|
|
160
|
+
*/
|
|
161
|
+
declare class TickScheduler {
|
|
162
|
+
private ticks;
|
|
163
|
+
private nextId;
|
|
164
|
+
private running;
|
|
165
|
+
private frameHandle;
|
|
166
|
+
private readonly hasRaf;
|
|
167
|
+
constructor();
|
|
168
|
+
/**
|
|
169
|
+
* Register a tick. `intervalMs <= 0` means "every pass" (a frame-interval
|
|
170
|
+
* tick, matching LOLO's `interval: "frame"`). Returns a handle to stop
|
|
171
|
+
* just this tick.
|
|
172
|
+
*/
|
|
173
|
+
add(intervalMs: number, onDue: () => void): TickHandle;
|
|
174
|
+
/** Stop every tick and the shared loop. */
|
|
175
|
+
stopAll(): void;
|
|
176
|
+
private ensureRunning;
|
|
177
|
+
private maybeStop;
|
|
178
|
+
private advance;
|
|
179
|
+
}
|
|
180
|
+
/** Construct a new, independent `TickScheduler`. */
|
|
181
|
+
declare function createTickScheduler(): TickScheduler;
|
|
182
|
+
|
|
140
183
|
/**
|
|
141
184
|
* BindingResolver - Platform-Agnostic Binding Resolution
|
|
142
185
|
*
|
|
@@ -917,4 +960,4 @@ declare namespace index {
|
|
|
917
960
|
export { type index_ComposeBehaviorsInput as ComposeBehaviorsInput, type index_ComposeBehaviorsResult as ComposeBehaviorsResult, type index_EventWiringEntry as EventWiringEntry, type index_LayoutStrategy as LayoutStrategy, type index_PipeStep as PipeStep, index_applyEventWiring as applyEventWiring, index_composeBehaviors as composeBehaviors, index_detectLayoutStrategy as detectLayoutStrategy, index_pipeBehaviors as pipeBehaviors };
|
|
918
961
|
}
|
|
919
962
|
|
|
920
|
-
export { BindingContext, type ClientEventBus, type ComposeBehaviorsInput, type ComposeBehaviorsResult, type CreateClientEffectHandlersOptions, type CreateServerEffectHandlersOptions, EffectContext, EffectExecutor, type EffectExecutorOptions, EffectHandlers, EffectResult, type EntitySchema, type EventWiringEntry, ExecutionEnvironment, ImportChainLike, type LayoutStrategy, LoadResult, LoadedOrbital, LoadedSchema, MockPersistenceAdapter, type MockPersistenceConfig, type PayloadMismatch, type PayloadValidationFailure, PersistenceAdapter, type PipeStep, SchemaLoader, type ServerEffectResult, type SlotSetter, TraitDefinition, UnifiedLoaderOptions, applyEventWiring, buildEmitsFromTraits, composeBehaviors, index as composition, containsBindings, createClientEffectHandlers, createContextFromBindings, createMockPersistence, createServerEffectHandlers, createTestExecutor, createUnifiedLoader, detectLayoutStrategy, extractBindings, formatPayloadValidationError, interpolateProps, interpolateValue, pipeBehaviors, validateEventPayload, validatePayloadShapes };
|
|
963
|
+
export { BindingContext, type ClientEventBus, type ComposeBehaviorsInput, type ComposeBehaviorsResult, type CreateClientEffectHandlersOptions, type CreateServerEffectHandlersOptions, EffectContext, EffectExecutor, type EffectExecutorOptions, EffectHandlers, EffectResult, type EntitySchema, type EventWiringEntry, ExecutionEnvironment, ImportChainLike, type LayoutStrategy, LoadResult, LoadedOrbital, LoadedSchema, MockPersistenceAdapter, type MockPersistenceConfig, type PayloadMismatch, type PayloadValidationFailure, PersistenceAdapter, type PipeStep, SchemaLoader, type ServerEffectResult, type SlotSetter, type TickHandle, TickScheduler, TraitDefinition, UnifiedLoaderOptions, applyEventWiring, buildEmitsFromTraits, composeBehaviors, index as composition, containsBindings, createClientEffectHandlers, createContextFromBindings, createMockPersistence, createServerEffectHandlers, createTestExecutor, createTickScheduler, createUnifiedLoader, detectLayoutStrategy, extractBindings, formatPayloadValidationError, interpolateProps, interpolateValue, pipeBehaviors, validateEventPayload, validatePayloadShapes };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EffectExecutor, createContextFromBindings } from './chunk-
|
|
2
|
-
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createMockPersistence, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-
|
|
1
|
+
import { EffectExecutor, createContextFromBindings } from './chunk-JZ4IDIUU.js';
|
|
2
|
+
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, TickScheduler, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createMockPersistence, createTestExecutor, createTickScheduler, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-JZ4IDIUU.js';
|
|
3
3
|
import { __export } from './chunk-PZ5AY32C.js';
|
|
4
4
|
import { createLogger } from '@almadar/logger';
|
|
5
5
|
import { evaluate } from '@almadar/evaluator';
|