@almadar/runtime 6.4.0 → 6.4.1

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
- export { InMemoryPersistence, OrbitalServerRuntime, collectDeclaredConfigDefaults, createOrbitalServerRuntime } from './chunk-BKMLP2TV.js';
1
+ export { InMemoryPersistence, OrbitalServerRuntime, collectDeclaredConfigDefaults, createOrbitalServerRuntime } from './chunk-ODKFBOQG.js';
2
2
  import './chunk-PZ5AY32C.js';
3
3
  //# sourceMappingURL=OrbitalServerRuntime.js.map
4
4
  //# sourceMappingURL=OrbitalServerRuntime.js.map
@@ -145,40 +145,44 @@ function interpolateProps(props, ctx) {
145
145
  const typeBindingRaw = props["type"];
146
146
  const patternType = typeof typeBindingRaw === "string" ? typeBindingRaw : void 0;
147
147
  if (typeof entityBindingRaw === "string") {
148
- const resolvedEntity = result["entity"];
149
- const resolvedRow = resolvedEntity !== null && typeof resolvedEntity === "object" && !Array.isArray(resolvedEntity) ? resolvedEntity : null;
150
- const ctxRow = ctx.payload["row"];
151
- const ctxPayloadKeys = Object.keys(ctx.payload).join(",");
152
- const payloadDataRaw = ctx.payload["data"];
153
- const payloadDataLen = Array.isArray(payloadDataRaw) ? payloadDataRaw.length : null;
154
- const ctxEntityRaw = ctx.entity;
155
- const ctxEntityLen = Array.isArray(ctxEntityRaw) ? ctxEntityRaw.length : null;
156
- const resolvedLen = Array.isArray(resolvedEntity) ? resolvedEntity.length : null;
157
- renderLog.debug("interpolateProps:entity", {
158
- patternType,
159
- entityBinding: entityBindingRaw,
160
- resolvedIsObject: resolvedRow !== null,
161
- resolvedIsArray: Array.isArray(resolvedEntity),
162
- resolvedLen,
163
- resolvedEqualsCtxRow: ctxRow !== void 0 && resolvedRow !== null && resolvedRow === ctxRow,
164
- resolvedRowId: resolvedRow?.id,
165
- ctxPayloadKeys,
166
- ctxPayloadDataLen: payloadDataLen,
167
- ctxEntityIsArray: Array.isArray(ctxEntityRaw),
168
- ctxEntityLen
148
+ renderLog.debug("interpolateProps:entity", () => {
149
+ const resolvedEntity = result["entity"];
150
+ const resolvedRow = resolvedEntity !== null && typeof resolvedEntity === "object" && !Array.isArray(resolvedEntity) ? resolvedEntity : null;
151
+ const ctxRow = ctx.payload["row"];
152
+ const ctxPayloadKeys = Object.keys(ctx.payload).join(",");
153
+ const payloadDataRaw = ctx.payload["data"];
154
+ const payloadDataLen = Array.isArray(payloadDataRaw) ? payloadDataRaw.length : null;
155
+ const ctxEntityRaw = ctx.entity;
156
+ const ctxEntityLen = Array.isArray(ctxEntityRaw) ? ctxEntityRaw.length : null;
157
+ const resolvedLen = Array.isArray(resolvedEntity) ? resolvedEntity.length : null;
158
+ return {
159
+ patternType,
160
+ entityBinding: entityBindingRaw,
161
+ resolvedIsObject: resolvedRow !== null,
162
+ resolvedIsArray: Array.isArray(resolvedEntity),
163
+ resolvedLen,
164
+ resolvedEqualsCtxRow: ctxRow !== void 0 && resolvedRow !== null && resolvedRow === ctxRow,
165
+ resolvedRowId: resolvedRow?.id,
166
+ ctxPayloadKeys,
167
+ ctxPayloadDataLen: payloadDataLen,
168
+ ctxEntityIsArray: Array.isArray(ctxEntityRaw),
169
+ ctxEntityLen
170
+ };
169
171
  });
170
172
  }
171
173
  if (patternType === "form-section" || patternType === "form") {
172
- const modeRaw = result["mode"];
173
- const submitRaw = result["submitEvent"];
174
- const cancelRaw = result["cancelEvent"];
175
- bindLog.debug("form-binding", {
176
- patternType,
177
- mode: typeof modeRaw === "string" ? modeRaw : void 0,
178
- submitEvent: typeof submitRaw === "string" ? submitRaw : void 0,
179
- cancelEvent: typeof cancelRaw === "string" ? cancelRaw : void 0,
180
- entity: JSON.stringify(result["entity"] ?? null),
181
- fields: JSON.stringify(result["fields"] ?? null)
174
+ bindLog.debug("form-binding", () => {
175
+ const modeRaw = result["mode"];
176
+ const submitRaw = result["submitEvent"];
177
+ const cancelRaw = result["cancelEvent"];
178
+ return {
179
+ patternType,
180
+ mode: typeof modeRaw === "string" ? modeRaw : void 0,
181
+ submitEvent: typeof submitRaw === "string" ? submitRaw : void 0,
182
+ cancelEvent: typeof cancelRaw === "string" ? cancelRaw : void 0,
183
+ entity: JSON.stringify(result["entity"] ?? null),
184
+ fields: JSON.stringify(result["fields"] ?? null)
185
+ };
182
186
  });
183
187
  }
184
188
  return anyChanged ? result : props;
@@ -234,13 +238,13 @@ function interpolateArray(value, ctx) {
234
238
  }
235
239
  if (isSExpression(value)) {
236
240
  const result = evaluate(value, ctx);
237
- bindLog.info("sexpr:eval", {
241
+ bindLog.debug("sexpr:eval", () => ({
238
242
  operator: typeof value[0] === "string" ? value[0] : "<non-string>",
239
243
  argCount: value.length - 1,
240
244
  inputJson: JSON.stringify(value).slice(0, 300),
241
245
  resultType: typeof result,
242
246
  resultJson: typeof result === "object" && result !== null ? JSON.stringify(result).slice(0, 2e3) : String(result)
243
- });
247
+ }));
244
248
  return result;
245
249
  }
246
250
  const mapped = [];
@@ -1789,7 +1793,7 @@ var MockPersistenceAdapter = class {
1789
1793
  updatedAt: typeof item.updatedAt === "string" ? item.updatedAt : ""
1790
1794
  });
1791
1795
  }
1792
- mockLog.debug("mock:seed", { entityName, count, idsAndTimestamps: JSON.stringify(generated) });
1796
+ mockLog.debug("mock:seed", () => ({ entityName, count, idsAndTimestamps: JSON.stringify(generated) }));
1793
1797
  }
1794
1798
  /**
1795
1799
  * Generate a single mock item based on field schemas.
@@ -4323,7 +4327,7 @@ var OrbitalServerRuntime = class {
4323
4327
  payloadRowId: typeof payloadRowId === "string" || typeof payloadRowId === "number" ? payloadRowId : void 0,
4324
4328
  entityId: request.entityId
4325
4329
  });
4326
- busLog.debug("bus:incoming", {
4330
+ busLog.debug("bus:incoming", () => ({
4327
4331
  orbital: orbitalName,
4328
4332
  event: request.event,
4329
4333
  payload: JSON.stringify(request.payload ?? null),
@@ -4334,15 +4338,15 @@ var OrbitalServerRuntime = class {
4334
4338
  currentState: state.currentState
4335
4339
  }))
4336
4340
  )
4337
- });
4338
- xOrbitalLog.info("processOrbitalEvent:enter", {
4341
+ }));
4342
+ xOrbitalLog.info("processOrbitalEvent:enter", () => ({
4339
4343
  orbital: orbitalName,
4340
4344
  event: request.event,
4341
4345
  traitsInOrbital: registered.traits.map((t) => t.name).join(","),
4342
4346
  payloadActiveTraits: JSON.stringify(
4343
4347
  request.payload?.["_activeTraits"] ?? null
4344
4348
  )
4345
- });
4349
+ }));
4346
4350
  const { event, payload, entityId, user } = request;
4347
4351
  const validationFailures = [];
4348
4352
  for (const trait of registered.traits) {
@@ -4673,7 +4677,7 @@ var OrbitalServerRuntime = class {
4673
4677
  },
4674
4678
  fetch: async (fetchEntityType, options) => {
4675
4679
  try {
4676
- xOrbitalLog.info("fetch:enter", {
4680
+ xOrbitalLog.info("fetch:enter", () => ({
4677
4681
  entityType: fetchEntityType,
4678
4682
  hasOptions: options !== void 0 && options !== null,
4679
4683
  optionsKeys: options ? Object.keys(options).join(",") : "",
@@ -4681,7 +4685,7 @@ var OrbitalServerRuntime = class {
4681
4685
  filterIsArray: Array.isArray(options?.filter),
4682
4686
  filterJson: JSON.stringify(options?.filter ?? null).slice(0, 300),
4683
4687
  payloadJson: JSON.stringify(bindingsRef?.payload ?? null).slice(0, 300)
4684
- });
4688
+ }));
4685
4689
  let result = null;
4686
4690
  let total = 0;
4687
4691
  if (options?.id) {
@@ -5333,5 +5337,5 @@ function buildMatcher(src, listenerOrbital) {
5333
5337
  }
5334
5338
 
5335
5339
  export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, OrbitalServerRuntime, StateMachineManager, buildEmitsFromTraits, collectDeclaredConfigDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMockPersistence, createOrbitalServerRuntime, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes };
5336
- //# sourceMappingURL=chunk-BKMLP2TV.js.map
5337
- //# sourceMappingURL=chunk-BKMLP2TV.js.map
5340
+ //# sourceMappingURL=chunk-ODKFBOQG.js.map
5341
+ //# sourceMappingURL=chunk-ODKFBOQG.js.map