@sdux-vault/engine 0.9.0 → 0.13.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.
@@ -11,7 +11,7 @@ import { EventBus, initDevtoolsWidget } from '@sdux-vault/devtools';
11
11
  // cmd+alt+j (see .vscode/keybindings.json)
12
12
  // --- END AI MODEL FILE PATH ---
13
13
  const SDUX_PACKAGE = '@sdux-vault/engine';
14
- const SDUX_VERSION = '0.9.0';
14
+ const SDUX_VERSION = '0.13.0';
15
15
  registerVersion(SDUX_PACKAGE, SDUX_VERSION);
16
16
 
17
17
  /**
@@ -1520,6 +1520,7 @@ const KNOWN_VAULT_KEYS = new Set([
1520
1520
  'SDUX::Behavior::Core::Promise',
1521
1521
  'SDUX::Behavior::Core::Reducer',
1522
1522
  'SDUX::Behavior::Core::State',
1523
+ 'SDUX::Behavior::Core::TabSyncState',
1523
1524
  'SDUX::Behavior::Core::Value',
1524
1525
  // ---------------------------------------------------------------------------
1525
1526
  // Addon Behaviors (libs/addons)
@@ -1586,7 +1587,7 @@ class VaultCoreInstance {
1586
1587
  #licenseMap = new Map();
1587
1588
  #terminalStatus = new Map();
1588
1589
  #aiAssistEnabled = false;
1589
- #bypassLicensing = true;
1590
+ #bypassLicensing = false;
1590
1591
  #licenseTimeoutMs;
1591
1592
  // eslint-disable-next-line
1592
1593
  #licenseTimers = new Map();
@@ -2039,6 +2040,11 @@ function isAuthorizedKey(key) {
2039
2040
  return true;
2040
2041
  return instance.isAuthorizedKey(key);
2041
2042
  }
2043
+ function isBypassLicensing() {
2044
+ if (!instance)
2045
+ return false;
2046
+ return instance.isBypassLicensing();
2047
+ }
2042
2048
  function hasVaultLicense() {
2043
2049
  if (!instance)
2044
2050
  return false;
@@ -2122,7 +2128,7 @@ class BehaviorInitializationClass {
2122
2128
  behaviorConfig = behaviorConfigs.get(meta.configKey);
2123
2129
  }
2124
2130
  let licensePayload = undefined;
2125
- if (meta.needsLicense) {
2131
+ if (meta.needsLicense && !isBypassLicensing()) {
2126
2132
  if (!meta.licenseId) {
2127
2133
  isCritical = true;
2128
2134
  throw new Error(`[vault] Behavior "${behaviorKey}" declares needsLicense but has no licenseId.`);
@@ -2512,7 +2518,7 @@ withCoreLicenseBehavior = __decorate([
2512
2518
  key: defineBehaviorKey('Core', 'License'),
2513
2519
  critical: true,
2514
2520
  needsLicense: true,
2515
- licenseId: 'sdux-vault'
2521
+ licenseId: VAULT_LICENSE_ID
2516
2522
  })
2517
2523
  ], withCoreLicenseBehavior);
2518
2524
 
@@ -2715,12 +2721,16 @@ class Orchestrator {
2715
2721
  });
2716
2722
  config.operators = config.operators ?? [];
2717
2723
  config.interceptors = config.interceptors ?? [];
2718
- const allBehaviors = [
2724
+ let allBehaviors = [
2719
2725
  ...defaultBehaviors,
2720
2726
  ...filteredUserBehaviors,
2721
2727
  ...config.operators,
2722
2728
  ...config.interceptors
2723
2729
  ];
2730
+ const hasTabSync = allBehaviors.some((behavior) => behavior.type === BehaviorTypes.TabSyncState);
2731
+ if (hasTabSync) {
2732
+ allBehaviors = allBehaviors.filter((behavior) => behavior.type !== BehaviorTypes.CoreState);
2733
+ }
2724
2734
  const behaviorInit = new BehaviorInitializationClass(this.cellKey);
2725
2735
  this.#registerBehaviorsWithVault(allBehaviors);
2726
2736
  this.#behaviors = behaviorInit.initializeBehaviors(allBehaviors, config.behaviorConfigs);
@@ -2733,6 +2743,7 @@ class Orchestrator {
2733
2743
  #registerStageBehaviors() {
2734
2744
  // Remove merge behavior from the pipeline list
2735
2745
  this.#stageBehaviors = this.#behaviors.filter((behavior) => !(behavior.type === BehaviorTypes.CoreState ||
2746
+ behavior.type === BehaviorTypes.TabSyncState ||
2736
2747
  behavior.type === BehaviorTypes.CoreEmitState ||
2737
2748
  behavior.type === BehaviorTypes.CoreError ||
2738
2749
  behavior.type === BehaviorTypes.ErrorTransform ||
@@ -2740,12 +2751,13 @@ class Orchestrator {
2740
2751
  behavior.type === BehaviorTypes.Merge));
2741
2752
  }
2742
2753
  #registerStateBehavior() {
2743
- // Extract and remove errot behavior
2744
- const coreState = this.#behaviors.filter((behaviort) => behaviort.type === BehaviorTypes.CoreState);
2745
- if (coreState.length > 1) {
2754
+ const tabSyncState = this.#behaviors.filter((behavior) => behavior.type === BehaviorTypes.TabSyncState);
2755
+ const coreState = this.#behaviors.filter((behavior) => behavior.type === BehaviorTypes.CoreState);
2756
+ const stateBehaviors = tabSyncState.length > 0 ? tabSyncState : coreState;
2757
+ if (stateBehaviors.length > 1) {
2746
2758
  throw new Error('Only one core state behavior can be registered for a FeatureCell.');
2747
2759
  }
2748
- this.#coreStateBehavior = coreState[0] ?? null;
2760
+ this.#coreStateBehavior = stateBehaviors[0] ?? null;
2749
2761
  this.#emitStateCallbackBehavior = this.#behaviors.filter((behavior) => isCoreEmitStateCallbackBehavior(behavior))[0];
2750
2762
  }
2751
2763
  #registerErrorBehavior() {
@@ -3380,7 +3392,7 @@ class ControllerInitializationClass {
3380
3392
  controllerConfig = controllerConfigs.get(meta.configKey);
3381
3393
  }
3382
3394
  let licensePayload = undefined;
3383
- if (meta.needsLicense) {
3395
+ if (meta.needsLicense && !isBypassLicensing()) {
3384
3396
  if (!meta.licenseId) {
3385
3397
  isCritical = true;
3386
3398
  throw new Error(`[vault] Controller "${controllerKey}" declares needsLicense but has no licenseId.`);
@@ -4405,5 +4417,5 @@ function resetFeatureCellToken() {
4405
4417
  * Generated bundle index. Do not edit.
4406
4418
  */
4407
4419
 
4408
- export { Conductor, FeatureCellClass, LicensingAbstract, VAULT_LICENSE_ID, VaultCore, createFeatureCellToken, getFeatureCellToken, getLicensePayload, getVaultRegistryForTests, hasVaultLicense, isAuthorizedKey, isPipelineTerminal, registerFeatureCell, registerVaultSettled, resetFeatureCellRegistry, resetVaultForTests, vaultAllSettled, vaultSettled };
4420
+ export { Conductor, FeatureCellClass, LicensingAbstract, VAULT_LICENSE_ID, VaultCore, VerifyLicenseToken, createFeatureCellToken, getFeatureCellToken, getLicensePayload, getVaultRegistryForTests, hasVaultLicense, isAuthorizedKey, isBypassLicensing, isPipelineTerminal, registerFeatureCell, registerVaultSettled, resetFeatureCellRegistry, resetVaultForTests, vaultAllSettled, vaultSettled };
4409
4421
  //# sourceMappingURL=sdux-vault-engine.mjs.map