@almadar/runtime 4.2.7 → 4.3.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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
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-BxxO5BCJ.js';
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-BxxO5BCJ.js';
3
- import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital } from './OrbitalServerRuntime-FxB6n8uS.js';
4
- export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, O as OrbitalEventRequest, e as OrbitalEventResponse, f as OrbitalServerRuntimeConfig, P as PersistenceAdapter, g as PreprocessOptions, h as PreprocessResult, i as PreprocessedSchema, j as ProcessEventOptions, R as RegisteredOrbital, k as RuntimeOrbital, l as RuntimeOrbitalSchema, m as RuntimeTrait, n as StateMachineManager, o as createInitialTraitState, p as findInitialState, q as findTransition, r as getIsolatedCollectionName, s as getNamespacedEvent, t as isBrowser, u as isElectron, v as isNamespacedEvent, w as isNode, x as normalizeEventKey, y as parseNamespacedEvent, z as preprocessSchema, A as processEvent } from './OrbitalServerRuntime-FxB6n8uS.js';
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-DwDhc9Jt.js';
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-DwDhc9Jt.js';
3
+ import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital } from './OrbitalServerRuntime-DS7Zs5x1.js';
4
+ export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, O as OrbitalEventRequest, e as OrbitalEventResponse, f as OrbitalServerRuntimeConfig, P as PersistenceAdapter, g as PreprocessOptions, h as PreprocessResult, i as PreprocessedSchema, j as ProcessEventOptions, R as RegisteredOrbital, k as RuntimeOrbital, l as RuntimeOrbitalSchema, m as RuntimeTrait, n as StateMachineManager, o as createInitialTraitState, p as findInitialState, q as findTransition, r as getIsolatedCollectionName, s as getNamespacedEvent, t as isBrowser, u as isElectron, v as isNamespacedEvent, w as isNode, x as normalizeEventKey, y as parseNamespacedEvent, z as preprocessSchema, A as processEvent } from './OrbitalServerRuntime-DS7Zs5x1.js';
5
5
  import { EvaluationContext } from '@almadar/evaluator';
6
6
  export { EvaluationContext, createMinimalContext } from '@almadar/evaluator';
7
7
  import { EventPayload, EntityRow, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { EffectExecutor, EventBus, HANDLER_MANIFEST, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent } from './chunk-ZIDFSYMT.js';
1
+ export { EffectExecutor, EventBus, HANDLER_MANIFEST, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent } from './chunk-P65PKXK2.js';
2
2
  import { __export } from './chunk-PZ5AY32C.js';
3
3
  import { isInlineTrait } from '@almadar/core';
4
4
 
@@ -1,36 +1,25 @@
1
1
  import * as _almadar_core from '@almadar/core';
2
- import { EventPayload, AgentContext, TraitConfig, EntityRow, ServiceParams, ResolvedPatternProps } from '@almadar/core';
2
+ import { EventPayload, AgentContext, TraitConfig, BusEvent, EntityRow, ServiceParams, ResolvedPatternProps, BusEventSource, BusEventListener, Unsubscribe as Unsubscribe$1 } from '@almadar/core';
3
3
 
4
4
  /** Alias for ResolvedPatternProps to avoid breaking internal consumers */
5
5
  type PatternProps = ResolvedPatternProps;
6
6
 
7
7
  type ConfigContext = TraitConfig;
8
8
  /**
9
- * Event structure for cross-trait communication
9
+ * Event structure for cross-trait communication.
10
+ * Re-export of `BusEvent` from `@almadar/core` so runtime + ui + codegen
11
+ * all agree on the bus envelope shape. `RuntimeEvent` is kept as a type
12
+ * alias for anyone importing by the old name.
10
13
  */
11
- interface RuntimeEvent {
12
- /** Event type (e.g., "ORDER_CONFIRMED", "TraitName.EVENT_NAME") */
13
- type: string;
14
- /** Event payload data */
15
- payload?: EventPayload;
16
- /** Timestamp when event was emitted */
17
- timestamp: number;
18
- /** Source information for debugging */
19
- source?: {
20
- orbital?: string;
21
- trait?: string;
22
- transition?: string;
23
- tick?: string;
24
- };
25
- }
26
- type EventListener = (event: RuntimeEvent) => void;
27
- type Unsubscribe = () => void;
14
+ type RuntimeEvent = BusEvent;
15
+ type EventListener = BusEventListener;
16
+ type Unsubscribe = Unsubscribe$1;
28
17
  /**
29
18
  * Event bus interface for pub/sub communication
30
19
  */
31
20
  interface IEventBus {
32
21
  /** Emit an event */
33
- emit(type: string, payload?: EventPayload, source?: RuntimeEvent['source']): void;
22
+ emit(type: string, payload?: EventPayload, source?: BusEventSource): void;
34
23
  /** Subscribe to an event */
35
24
  on(type: string, listener: EventListener): Unsubscribe;
36
25
  /** Subscribe to ALL events (wildcard listener) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/runtime",
3
- "version": "4.2.7",
3
+ "version": "4.3.0",
4
4
  "description": "Interpreted runtime for Almadar orbital applications (OrbitalServerRuntime)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -36,7 +36,7 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@almadar/core": ">=5.2.0",
39
+ "@almadar/core": ">=5.3.1",
40
40
  "@almadar/evaluator": ">=2.9.2",
41
41
  "@almadar/std": "7.2.0",
42
42
  "@faker-js/faker": "^9.3.0"