@almadar/runtime 3.3.0 → 4.1.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.
@@ -1,4 +1,4 @@
1
- import { I as IEventBus } from './types-B8OfRFfV.js';
1
+ import { I as IEventBus } from './types-CVSBlnzV.js';
2
2
  import { EventPayload } from '@almadar/core';
3
3
 
4
4
  /**
@@ -290,11 +290,6 @@ function createContextFromBindings(bindings, strictBindings, contextExtensions)
290
290
  if (strictBindings) {
291
291
  ctx.strictBindings = true;
292
292
  }
293
- for (const [key, value] of Object.entries(bindings)) {
294
- if (key !== "entity" && key !== "payload" && key !== "state" && key !== "config" && key !== "user" && value != null) {
295
- ctx.singletons.set(key, value);
296
- }
297
- }
298
293
  if (contextExtensions) {
299
294
  Object.assign(ctx, contextExtensions);
300
295
  }
@@ -1015,16 +1010,24 @@ var EffectExecutor = class {
1015
1010
  on_message: asStr(block.on_message) ?? asStr(block.onMessage)
1016
1011
  };
1017
1012
  }
1013
+ /** Build the source metadata stamp for an emit fired from this trait. */
1014
+ sourceStamp() {
1015
+ return {
1016
+ orbital: this.context.orbitalName,
1017
+ trait: this.context.traitName,
1018
+ transition: this.context.transition
1019
+ };
1020
+ }
1018
1021
  emitSuccess(emit, key, payload) {
1019
1022
  const eventName = emit?.[key];
1020
1023
  if (eventName) {
1021
- this.handlers.emit(eventName, payload);
1024
+ this.handlers.emit(eventName, payload, this.sourceStamp());
1022
1025
  }
1023
1026
  }
1024
1027
  emitFailure(emit, err) {
1025
1028
  if (!emit?.failure) return;
1026
1029
  const error = err instanceof Error ? err.message : String(err);
1027
- this.handlers.emit(emit.failure, { error });
1030
+ this.handlers.emit(emit.failure, { error }, this.sourceStamp());
1028
1031
  }
1029
1032
  /**
1030
1033
  * Narrow the generic emit config into the `os/watch-*` handler surface
@@ -1048,7 +1051,7 @@ var EffectExecutor = class {
1048
1051
  case "emit": {
1049
1052
  const event = args[0];
1050
1053
  const payload = args[1];
1051
- this.handlers.emit(event, payload);
1054
+ this.handlers.emit(event, payload, this.sourceStamp());
1052
1055
  break;
1053
1056
  }
1054
1057
  case "set": {
@@ -1810,7 +1813,7 @@ async function getExternalLoaderModule() {
1810
1813
  return null;
1811
1814
  }
1812
1815
  try {
1813
- externalLoaderModule = await import('./external-loader-UBJ6VRW5.js');
1816
+ externalLoaderModule = await import('./external-loader-22F5V5NN.js');
1814
1817
  return externalLoaderModule;
1815
1818
  } catch {
1816
1819
  return null;
@@ -2079,7 +2082,7 @@ var ReferenceResolver = class {
2079
2082
  if (this.loader || this.loaderInitialized) return;
2080
2083
  this.loaderInitialized = true;
2081
2084
  try {
2082
- const { ExternalOrbitalLoader } = await import('./external-loader-UBJ6VRW5.js');
2085
+ const { ExternalOrbitalLoader } = await import('./external-loader-22F5V5NN.js');
2083
2086
  this.loader = new ExternalOrbitalLoader(this.options);
2084
2087
  } catch {
2085
2088
  }
@@ -2689,5 +2692,5 @@ function parseNamespacedEvent(eventName) {
2689
2692
  }
2690
2693
 
2691
2694
  export { EffectExecutor, EventBus, HANDLER_MANIFEST, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent };
2692
- //# sourceMappingURL=chunk-II3JSETH.js.map
2693
- //# sourceMappingURL=chunk-II3JSETH.js.map
2695
+ //# sourceMappingURL=chunk-Z72NLOSF.js.map
2696
+ //# sourceMappingURL=chunk-Z72NLOSF.js.map