@vue-skuilder/db 0.1.30 → 0.1.31-a

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.
@@ -1131,19 +1131,20 @@ var init_elo = __esm({
1131
1131
  const scored = newCards.map((c, i) => {
1132
1132
  const cardElo = cardEloData[i]?.global?.score ?? 1e3;
1133
1133
  const distance = Math.abs(cardElo - userGlobalElo);
1134
- const score = Math.max(0, 1 - distance / 500);
1134
+ const rawScore = Math.max(0, 1 - distance / 500);
1135
+ const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
1135
1136
  return {
1136
1137
  cardId: c.cardID,
1137
1138
  courseId: c.courseID,
1138
- score,
1139
+ score: samplingKey,
1139
1140
  provenance: [
1140
1141
  {
1141
1142
  strategy: "elo",
1142
1143
  strategyName: this.strategyName || this.name,
1143
1144
  strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
1144
1145
  action: "generated",
1145
- score,
1146
- reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), new card`
1146
+ score: samplingKey,
1147
+ reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
1147
1148
  }
1148
1149
  ]
1149
1150
  };
@@ -2836,7 +2837,6 @@ __export(navigators_exports, {
2836
2837
  getCardOrigin: () => getCardOrigin,
2837
2838
  getRegisteredNavigator: () => getRegisteredNavigator,
2838
2839
  getRegisteredNavigatorNames: () => getRegisteredNavigatorNames,
2839
- getRegisteredNavigatorRole: () => getRegisteredNavigatorRole,
2840
2840
  hasRegisteredNavigator: () => hasRegisteredNavigator,
2841
2841
  initializeNavigatorRegistry: () => initializeNavigatorRegistry,
2842
2842
  isFilter: () => isFilter,
@@ -2845,19 +2845,16 @@ __export(navigators_exports, {
2845
2845
  pipelineDebugAPI: () => pipelineDebugAPI,
2846
2846
  registerNavigator: () => registerNavigator
2847
2847
  });
2848
- function registerNavigator(implementingClass, constructor, role) {
2849
- navigatorRegistry.set(implementingClass, { constructor, role });
2850
- logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}${role ? ` (${role})` : ""}`);
2848
+ function registerNavigator(implementingClass, constructor) {
2849
+ navigatorRegistry.set(implementingClass, constructor);
2850
+ logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}`);
2851
2851
  }
2852
2852
  function getRegisteredNavigator(implementingClass) {
2853
- return navigatorRegistry.get(implementingClass)?.constructor;
2853
+ return navigatorRegistry.get(implementingClass);
2854
2854
  }
2855
2855
  function hasRegisteredNavigator(implementingClass) {
2856
2856
  return navigatorRegistry.has(implementingClass);
2857
2857
  }
2858
- function getRegisteredNavigatorRole(implementingClass) {
2859
- return navigatorRegistry.get(implementingClass)?.role;
2860
- }
2861
2858
  function getRegisteredNavigatorNames() {
2862
2859
  return Array.from(navigatorRegistry.keys());
2863
2860
  }
@@ -2903,12 +2900,10 @@ function getCardOrigin(card) {
2903
2900
  return "new";
2904
2901
  }
2905
2902
  function isGenerator(impl) {
2906
- if (NavigatorRoles[impl] === "generator" /* GENERATOR */) return true;
2907
- return getRegisteredNavigatorRole(impl) === "generator" /* GENERATOR */;
2903
+ return NavigatorRoles[impl] === "generator" /* GENERATOR */;
2908
2904
  }
2909
2905
  function isFilter(impl) {
2910
- if (NavigatorRoles[impl] === "filter" /* FILTER */) return true;
2911
- return getRegisteredNavigatorRole(impl) === "filter" /* FILTER */;
2906
+ return NavigatorRoles[impl] === "filter" /* FILTER */;
2912
2907
  }
2913
2908
  var navigatorRegistry, Navigators, NavigatorRole, NavigatorRoles, ContentNavigator;
2914
2909
  var init_navigators = __esm({