@almadar/runtime 5.0.0 → 5.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.
@@ -175,8 +175,6 @@ function createLogger(namespace) {
175
175
  error: (msg, data) => log("ERROR", msg, data)
176
176
  };
177
177
  }
178
-
179
- // src/BindingResolver.ts
180
178
  var bindLog = createLogger("almadar:runtime:bindings");
181
179
  var CLIENT_ONLY_BINDING_ROOTS = /* @__PURE__ */ new Set(["trait"]);
182
180
  function isClientOnlyBinding(value) {
@@ -1108,18 +1106,51 @@ var EffectExecutor = class {
1108
1106
  const action = args[0];
1109
1107
  const last = args[args.length - 1];
1110
1108
  const emitCfg = last && typeof last === "object" && !Array.isArray(last) && "emit" in last ? this.extractEmitConfig(last) : void 0;
1109
+ effectLog.debug("persist:dispatch", {
1110
+ action,
1111
+ argCount: args.length,
1112
+ argTypes: args.map((a) => Array.isArray(a) ? "array" : a === null ? "null" : typeof a).join(","),
1113
+ traitName: this.context.traitName,
1114
+ transition: this.context.transition
1115
+ });
1116
+ effectLog.debug("persist:emit-config", {
1117
+ action,
1118
+ hasEmitCfg: emitCfg !== void 0,
1119
+ success: emitCfg?.success,
1120
+ failure: emitCfg?.failure
1121
+ });
1111
1122
  try {
1112
1123
  if (action === "batch") {
1113
1124
  const operations = args[1];
1114
1125
  await this.handlers.persist("batch", "", { operations });
1126
+ effectLog.debug("persist:success", {
1127
+ action,
1128
+ entityType: "batch",
1129
+ opCount: operations.length,
1130
+ willEmit: emitCfg?.success
1131
+ });
1115
1132
  this.emitSuccess(emitCfg, "success", operations);
1133
+ effectLog.debug("persist:emit-fired", { action, eventName: emitCfg?.success });
1116
1134
  } else {
1117
1135
  const entityType = args[1];
1118
1136
  const data = args[2];
1119
1137
  await this.handlers.persist(action, entityType, data);
1138
+ const dataId = typeof data === "string" ? data : data && typeof data === "object" ? data.id : void 0;
1139
+ effectLog.debug("persist:success", {
1140
+ action,
1141
+ entityType,
1142
+ dataId,
1143
+ willEmit: emitCfg?.success
1144
+ });
1120
1145
  this.emitSuccess(emitCfg, "success", data);
1146
+ effectLog.debug("persist:emit-fired", { action, eventName: emitCfg?.success });
1121
1147
  }
1122
1148
  } catch (err) {
1149
+ effectLog.error("persist:error", {
1150
+ action,
1151
+ entityType: action === "batch" ? "batch" : args[1],
1152
+ error: err instanceof Error ? err.message : String(err)
1153
+ });
1123
1154
  this.emitFailure(emitCfg, err);
1124
1155
  throw err;
1125
1156
  }
@@ -3193,6 +3224,6 @@ var InMemoryPersistence = class {
3193
3224
  }
3194
3225
  };
3195
3226
 
3196
- export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createMockPersistence, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent };
3197
- //# sourceMappingURL=chunk-S5OLFFHT.js.map
3198
- //# sourceMappingURL=chunk-S5OLFFHT.js.map
3227
+ export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createLogger, createMockPersistence, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent };
3228
+ //# sourceMappingURL=chunk-T343XTYB.js.map
3229
+ //# sourceMappingURL=chunk-T343XTYB.js.map