@almadar/runtime 6.73.0 → 6.74.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,5 +1,5 @@
1
- import { createTickScheduler, EventBus, createUnifiedLoader, MockPersistenceAdapter, InMemoryPersistence, preprocessSchema, normalizeCallSiteConfigToValues, StateMachineManager, parseDurationString, validateEventPayload, formatPayloadValidationError, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, EffectExecutor, LIFECYCLE_EVENTS } from './chunk-H7HQQVQJ.js';
2
- export { InMemoryPersistence, collectDeclaredConfigDefaults } from './chunk-H7HQQVQJ.js';
1
+ import { createTickScheduler, EventBus, createUnifiedLoader, MockPersistenceAdapter, InMemoryPersistence, preprocessSchema, normalizeCallSiteConfigToValues, StateMachineManager, parseDurationString, validateEventPayload, formatPayloadValidationError, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, EffectExecutor, LIFECYCLE_EVENTS } from './chunk-QUW37QRQ.js';
2
+ export { InMemoryPersistence, collectDeclaredConfigDefaults } from './chunk-QUW37QRQ.js';
3
3
  import { isValidCronExpression } from './chunk-OU3ITB5S.js';
4
4
  import { createContextFromBindings, checkMutationAccess, applyRowAccess, accessDeniedMessage } from './chunk-ZWAOJT6R.js';
5
5
  import './chunk-T4VDAB4C.js';
@@ -4326,10 +4326,18 @@ function traitEmbedNamesOf(trait) {
4326
4326
  for (const field of Object.values(trait.config ?? {})) walk(field.default);
4327
4327
  return [...found].sort();
4328
4328
  }
4329
- function resolveForwardedSiblingConfigFrom(trait, parentChain, orbitalConfig, schemaConfig) {
4329
+ function resolveForwardedSiblingConfigFrom(trait, parentChain, orbitalConfig, schemaConfig, schemaOnlyKeys) {
4330
4330
  const declared = trait.config;
4331
4331
  if (!declared) return trait;
4332
- const next = resolveConfigForwards(declared, parentChain, orbitalConfig, void 0, void 0, schemaConfig);
4332
+ const next = resolveConfigForwards(
4333
+ declared,
4334
+ parentChain,
4335
+ orbitalConfig,
4336
+ void 0,
4337
+ void 0,
4338
+ schemaConfig,
4339
+ schemaOnlyKeys
4340
+ );
4333
4341
  return next ? { ...trait, config: next } : trait;
4334
4342
  }
4335
4343
  function callSiteRungValue(rungConfig, knob) {
@@ -4338,8 +4346,9 @@ function callSiteRungValue(rungConfig, knob) {
4338
4346
  return isCallSiteConfigDeclaration(entry) ? entry.default : entry;
4339
4347
  }
4340
4348
  function walkConfigForwardChain(forward, parentChain, orbitalConfig, upstreamOrbitalConfig, upstreamSchemaConfig, schemaConfig) {
4349
+ const unresolved = { value: void 0, reachedSchemaConfigOnly: false };
4341
4350
  let knob = forward.slice("@config.".length);
4342
- if (knob.length === 0 || knob.includes(".")) return void 0;
4351
+ if (knob.length === 0 || knob.includes(".")) return unresolved;
4343
4352
  let value;
4344
4353
  let currentForward = forward;
4345
4354
  for (const rungConfig of parentChain) {
@@ -4358,16 +4367,17 @@ function walkConfigForwardChain(forward, parentChain, orbitalConfig, upstreamOrb
4358
4367
  if (value === void 0 || value === currentForward) value = orbitalConfig?.[knob]?.default;
4359
4368
  if (value === void 0 || value === currentForward) value = upstreamOrbitalConfig?.[knob]?.default;
4360
4369
  if (value === void 0 || value === currentForward) value = upstreamSchemaConfig?.[knob]?.default;
4361
- if (value === void 0 || value === currentForward) value = schemaConfig?.[knob]?.default;
4362
- if (value === void 0 || value === currentForward) return void 0;
4363
- return value;
4370
+ const reachesSchemaConfigRung = value === void 0 || value === currentForward;
4371
+ if (reachesSchemaConfigRung) value = schemaConfig?.[knob]?.default;
4372
+ if (value === void 0 || value === currentForward) return unresolved;
4373
+ return { value, reachedSchemaConfigOnly: reachesSchemaConfigRung };
4364
4374
  }
4365
- function resolveConfigForwards(declared, parentChain, orbitalConfig, upstreamOrbitalConfig, upstreamSchemaConfig, schemaConfig) {
4375
+ function resolveConfigForwards(declared, parentChain, orbitalConfig, upstreamOrbitalConfig, upstreamSchemaConfig, schemaConfig, schemaOnlyKeys) {
4366
4376
  let next;
4367
4377
  for (const [key, field] of Object.entries(declared)) {
4368
4378
  const forward = field.default;
4369
4379
  if (typeof forward !== "string" || !forward.startsWith("@config.")) continue;
4370
- const value = walkConfigForwardChain(
4380
+ const { value, reachedSchemaConfigOnly } = walkConfigForwardChain(
4371
4381
  forward,
4372
4382
  parentChain,
4373
4383
  orbitalConfig,
@@ -4376,6 +4386,7 @@ function resolveConfigForwards(declared, parentChain, orbitalConfig, upstreamOrb
4376
4386
  schemaConfig
4377
4387
  );
4378
4388
  if (value === void 0) continue;
4389
+ if (reachedSchemaConfigOnly) schemaOnlyKeys?.add(key);
4379
4390
  next ??= { ...declared };
4380
4391
  next[key] = { ...field, default: value, forwardedFrom: forward };
4381
4392
  }
@@ -4386,7 +4397,7 @@ function resolveCallSiteConfigForwards(config, parentChain, orbitalConfig, schem
4386
4397
  for (const [key, entry] of Object.entries(config)) {
4387
4398
  const forward = isCallSiteConfigDeclaration(entry) ? entry.default : entry;
4388
4399
  if (typeof forward !== "string" || !forward.startsWith("@config.")) continue;
4389
- const value = walkConfigForwardChain(forward, parentChain, orbitalConfig, void 0, void 0, schemaConfig);
4400
+ const { value } = walkConfigForwardChain(forward, parentChain, orbitalConfig, void 0, void 0, schemaConfig);
4390
4401
  if (value === void 0) continue;
4391
4402
  next ??= { ...config };
4392
4403
  next[key] = isCallSiteConfigDeclaration(entry) ? { ...entry, default: value, forwardedFrom: forward } : value;
@@ -5584,11 +5595,11 @@ function rewriteConfigPagePaths(node, pathMap) {
5584
5595
  }
5585
5596
  return node;
5586
5597
  }
5587
- function rewriteTraitConfigPagePaths(trait, pathMap) {
5598
+ function rewriteTraitConfigPagePaths(trait, pathMap, schemaOnlyKeys) {
5588
5599
  if (pathMap.size === 0 || !trait.config) return trait;
5589
5600
  const nextConfig = {};
5590
5601
  for (const [key, field] of Object.entries(trait.config)) {
5591
- nextConfig[key] = field.default === void 0 ? field : { ...field, default: rewriteConfigPagePaths(field.default, pathMap) };
5602
+ nextConfig[key] = field.default === void 0 || schemaOnlyKeys.has(key) ? field : { ...field, default: rewriteConfigPagePaths(field.default, pathMap) };
5592
5603
  }
5593
5604
  return { ...trait, config: nextConfig };
5594
5605
  }
@@ -7479,17 +7490,30 @@ var ReferenceResolver = class _ReferenceResolver {
7479
7490
  if (pathMap.size > 0) {
7480
7491
  next = rewriteTraitNavigateTargets(next, pathMap);
7481
7492
  }
7493
+ const schemaOnlyKeys = /* @__PURE__ */ new Set();
7482
7494
  for (const embedderName of embeddersOf.get(trait.name) ?? []) {
7483
7495
  const embedderConfig = parentConfigs.get(embedderName);
7484
- next = resolveForwardedSiblingConfigFrom(next, embedderConfig ? [embedderConfig] : []);
7496
+ next = resolveForwardedSiblingConfigFrom(
7497
+ next,
7498
+ embedderConfig ? [embedderConfig] : [],
7499
+ void 0,
7500
+ void 0,
7501
+ schemaOnlyKeys
7502
+ );
7485
7503
  }
7486
- next = resolveForwardedSiblingConfigFrom(next, transitiveEmbedderChain(trait.name));
7487
- next = resolveForwardedSiblingConfigFrom(next, [], foldedConfig, importedSchemaConfig);
7504
+ next = resolveForwardedSiblingConfigFrom(
7505
+ next,
7506
+ transitiveEmbedderChain(trait.name),
7507
+ void 0,
7508
+ void 0,
7509
+ schemaOnlyKeys
7510
+ );
7511
+ next = resolveForwardedSiblingConfigFrom(next, [], foldedConfig, importedSchemaConfig, schemaOnlyKeys);
7488
7512
  if (fieldSubs.size > 0 && next.config) {
7489
7513
  next = { ...next, config: rewriteEntityFieldsInConfig(next.config, fieldSubs) };
7490
7514
  }
7491
7515
  if (pathMap.size > 0) {
7492
- next = rewriteTraitConfigPagePaths(next, pathMap);
7516
+ next = rewriteTraitConfigPagePaths(next, pathMap, schemaOnlyKeys);
7493
7517
  }
7494
7518
  next = applyEventRenames(next, ref.events, keptFinalNames);
7495
7519
  return next;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { EffectExecutor } from './chunk-H7HQQVQJ.js';
2
- export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, LIFECYCLE_EVENTS, MockPersistenceAdapter, StateMachineManager, TickScheduler, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, createInitialTraitState, createMockPersistence, createTestExecutor, createTickScheduler, createUnifiedLoader, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, isBrowser, isElectron, isNamespacedEvent, isNode, isValidDurationString, normalizeCallSiteConfigToValues, normalizeEventKey, parseDurationString, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-H7HQQVQJ.js';
1
+ import { EffectExecutor } from './chunk-QUW37QRQ.js';
2
+ export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, LIFECYCLE_EVENTS, MockPersistenceAdapter, StateMachineManager, TickScheduler, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, createInitialTraitState, createMockPersistence, createTestExecutor, createTickScheduler, createUnifiedLoader, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, isBrowser, isElectron, isNamespacedEvent, isNode, isValidDurationString, normalizeCallSiteConfigToValues, normalizeEventKey, parseDurationString, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-QUW37QRQ.js';
3
3
  export { cronMatches, cronMinuteKey, isValidCronExpression, parseCron, parseCronField } from './chunk-OU3ITB5S.js';
4
4
  import { createContextFromBindings, applyRowAccess, checkMutationAccess, accessDeniedMessage } from './chunk-ZWAOJT6R.js';
5
5
  export { applyRowAccess, checkMutationAccess, containsBindings, createContextFromBindings, createMinimalContext, deferEntityBindings, extractBindings, interpolateProps, interpolateValue } from './chunk-ZWAOJT6R.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/runtime",
3
- "version": "6.73.0",
3
+ "version": "6.74.0",
4
4
  "description": "Interpreted runtime for Almadar orbital applications (OrbitalServerRuntime)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -57,11 +57,11 @@
57
57
  "access": "public"
58
58
  },
59
59
  "dependencies": {
60
- "@almadar/core": "^10.88.0",
60
+ "@almadar/core": "^10.89.0",
61
61
  "@almadar/evaluator": "^2.45.0",
62
62
  "@almadar/logger": "^1.12.0",
63
63
  "@almadar/server": "^2.40.0",
64
- "@almadar/std": "^16.209.0"
64
+ "@almadar/std": "^16.210.0"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "express": "^5.0.0"