@syntrologie/runtime-sdk 2.8.0-canary.71 → 2.8.0-canary.73

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.
@@ -20609,7 +20609,13 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
20609
20609
  }
20610
20610
 
20611
20611
  // src/fetchers/mergeConfigs.ts
20612
- function resolveVariantConfigs(client, keys, _strategy = "first-match") {
20612
+ function resolveVariantConfigs(client, keys, strategy = "merge") {
20613
+ if (strategy === "first-match") {
20614
+ return resolveFirstMatch(client, keys);
20615
+ }
20616
+ return resolveMerge(client, keys);
20617
+ }
20618
+ function resolveFirstMatch(client, keys) {
20613
20619
  for (const key of keys) {
20614
20620
  const value = client.getFeatureValue?.(key, null);
20615
20621
  if (!value || typeof value !== "object") continue;
@@ -20617,21 +20623,59 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
20617
20623
  const hasTiles = variant.tiles && variant.tiles.length > 0;
20618
20624
  const hasActions = variant.actions && variant.actions.length > 0;
20619
20625
  if (hasTiles || hasActions) {
20620
- return {
20621
- tiles: variant.tiles ?? [],
20622
- actions: variant.actions ?? [],
20623
- fetchedAt: variant.fetchedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
20624
- ...variant.schemaVersion && { schemaVersion: variant.schemaVersion },
20625
- ...variant.configVersion && { configVersion: variant.configVersion },
20626
- ...variant.canvasTitle && { canvasTitle: variant.canvasTitle },
20627
- ...variant.theme && { theme: variant.theme },
20628
- ...variant.launcher && { launcher: variant.launcher },
20629
- ...variant.meta && { meta: variant.meta }
20630
- };
20626
+ return buildConfig([variant]);
20631
20627
  }
20632
20628
  }
20633
20629
  return null;
20634
20630
  }
20631
+ function resolveMerge(client, keys) {
20632
+ const variants = [];
20633
+ for (const key of keys) {
20634
+ const value = client.getFeatureValue?.(key, null);
20635
+ if (!value || typeof value !== "object") continue;
20636
+ const variant = value;
20637
+ const hasTiles = variant.tiles && variant.tiles.length > 0;
20638
+ const hasActions = variant.actions && variant.actions.length > 0;
20639
+ if (hasTiles || hasActions) {
20640
+ variants.push(variant);
20641
+ }
20642
+ }
20643
+ if (variants.length === 0) return null;
20644
+ return buildConfig(variants);
20645
+ }
20646
+ function buildConfig(variants) {
20647
+ const allTiles = [];
20648
+ const allActions = [];
20649
+ let fetchedAt;
20650
+ let schemaVersion;
20651
+ let configVersion;
20652
+ let canvasTitle;
20653
+ let theme;
20654
+ let launcher;
20655
+ let meta;
20656
+ for (const variant of variants) {
20657
+ if (variant.tiles) allTiles.push(...variant.tiles);
20658
+ if (variant.actions) allActions.push(...variant.actions);
20659
+ fetchedAt ?? (fetchedAt = variant.fetchedAt);
20660
+ schemaVersion ?? (schemaVersion = variant.schemaVersion);
20661
+ configVersion ?? (configVersion = variant.configVersion);
20662
+ canvasTitle ?? (canvasTitle = variant.canvasTitle);
20663
+ theme ?? (theme = variant.theme);
20664
+ launcher ?? (launcher = variant.launcher);
20665
+ meta ?? (meta = variant.meta);
20666
+ }
20667
+ return {
20668
+ tiles: allTiles,
20669
+ actions: allActions,
20670
+ fetchedAt: fetchedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
20671
+ ...schemaVersion && { schemaVersion },
20672
+ ...configVersion && { configVersion },
20673
+ ...canvasTitle && { canvasTitle },
20674
+ ...theme && { theme },
20675
+ ...launcher && { launcher },
20676
+ ...meta && { meta }
20677
+ };
20678
+ }
20635
20679
 
20636
20680
  // src/logger.ts
20637
20681
  var debugEnabled = false;
@@ -20679,7 +20723,7 @@ Please report this to https://github.com/markedjs/marked.`, e2) {
20679
20723
  }
20680
20724
 
20681
20725
  // src/version.ts
20682
- var SDK_VERSION = "2.8.0-canary.71";
20726
+ var SDK_VERSION = "2.8.0-canary.73";
20683
20727
 
20684
20728
  // src/types.ts
20685
20729
  var SDK_SCHEMA_VERSION = "2.0";
@@ -38423,15 +38467,30 @@ ${cssRules}
38423
38467
  const handles = [];
38424
38468
  const appliedHandles = [];
38425
38469
  try {
38426
- for (const action of actions) {
38427
- const handle = await apply(action);
38428
- handles.push(handle);
38429
- appliedHandles.push(handle);
38470
+ const results = await Promise.allSettled(actions.map((action) => apply(action)));
38471
+ const errors = [];
38472
+ for (const result of results) {
38473
+ if (result.status === "fulfilled") {
38474
+ handles.push(result.value);
38475
+ appliedHandles.push(result.value);
38476
+ } else {
38477
+ errors.push(
38478
+ result.reason instanceof Error ? result.reason : new Error(String(result.reason))
38479
+ );
38480
+ }
38481
+ }
38482
+ if (errors.length > 0 && appliedHandles.length === 0) {
38483
+ throw errors[0];
38484
+ }
38485
+ if (errors.length > 0) {
38486
+ console.warn(
38487
+ `[ActionEngine] ${errors.length}/${actions.length} action(s) failed in batch:`,
38488
+ errors.map((e2) => e2.message).join("; ")
38489
+ );
38430
38490
  }
38431
38491
  } catch (error2) {
38432
38492
  console.error(
38433
- `[ActionEngine] Batch apply FAILED at action ${appliedHandles.length + 1}/${actions.length}.`,
38434
- `Successfully applied: ${appliedHandles.length}. Rolling back...`,
38493
+ `[ActionEngine] Batch apply FAILED. Successfully applied: ${appliedHandles.length}. Rolling back...`,
38435
38494
  error2
38436
38495
  );
38437
38496
  for (const handle of appliedHandles) {
@@ -42173,7 +42232,7 @@ ${cssRules}
42173
42232
  }
42174
42233
 
42175
42234
  // src/index.ts
42176
- var RUNTIME_SDK_BUILD = true ? `${"2026-04-14T05:46:14.257Z"} (${"dfc6ecd483b"})` : "dev";
42235
+ var RUNTIME_SDK_BUILD = true ? `${"2026-04-14T22:07:17.655Z"} (${"effea7df865"})` : "dev";
42177
42236
  if (typeof window !== "undefined") {
42178
42237
  console.log(`[Syntro Runtime] Build: ${RUNTIME_SDK_BUILD}`);
42179
42238
  const existing = window.SynOS;