@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.
package/dist/index.mjs CHANGED
@@ -1359,19 +1359,20 @@ var init_elo = __esm({
1359
1359
  const scored = newCards.map((c, i) => {
1360
1360
  const cardElo = cardEloData[i]?.global?.score ?? 1e3;
1361
1361
  const distance = Math.abs(cardElo - userGlobalElo);
1362
- const score = Math.max(0, 1 - distance / 500);
1362
+ const rawScore = Math.max(0, 1 - distance / 500);
1363
+ const samplingKey = rawScore > 0 ? Math.random() ** (1 / rawScore) : 0;
1363
1364
  return {
1364
1365
  cardId: c.cardID,
1365
1366
  courseId: c.courseID,
1366
- score,
1367
+ score: samplingKey,
1367
1368
  provenance: [
1368
1369
  {
1369
1370
  strategy: "elo",
1370
1371
  strategyName: this.strategyName || this.name,
1371
1372
  strategyId: this.strategyId || "NAVIGATION_STRATEGY-ELO-default",
1372
1373
  action: "generated",
1373
- score,
1374
- reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), new card`
1374
+ score: samplingKey,
1375
+ reason: `ELO distance ${Math.round(distance)} (card: ${Math.round(cardElo)}, user: ${Math.round(userGlobalElo)}), raw ${rawScore.toFixed(3)}, key ${samplingKey.toFixed(3)}`
1375
1376
  }
1376
1377
  ]
1377
1378
  };
@@ -3310,7 +3311,6 @@ __export(navigators_exports, {
3310
3311
  getCardOrigin: () => getCardOrigin,
3311
3312
  getRegisteredNavigator: () => getRegisteredNavigator,
3312
3313
  getRegisteredNavigatorNames: () => getRegisteredNavigatorNames,
3313
- getRegisteredNavigatorRole: () => getRegisteredNavigatorRole,
3314
3314
  hasRegisteredNavigator: () => hasRegisteredNavigator,
3315
3315
  initializeNavigatorRegistry: () => initializeNavigatorRegistry,
3316
3316
  isFilter: () => isFilter,
@@ -3319,19 +3319,16 @@ __export(navigators_exports, {
3319
3319
  pipelineDebugAPI: () => pipelineDebugAPI,
3320
3320
  registerNavigator: () => registerNavigator
3321
3321
  });
3322
- function registerNavigator(implementingClass, constructor, role) {
3323
- navigatorRegistry.set(implementingClass, { constructor, role });
3324
- logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}${role ? ` (${role})` : ""}`);
3322
+ function registerNavigator(implementingClass, constructor) {
3323
+ navigatorRegistry.set(implementingClass, constructor);
3324
+ logger.debug(`[NavigatorRegistry] Registered: ${implementingClass}`);
3325
3325
  }
3326
3326
  function getRegisteredNavigator(implementingClass) {
3327
- return navigatorRegistry.get(implementingClass)?.constructor;
3327
+ return navigatorRegistry.get(implementingClass);
3328
3328
  }
3329
3329
  function hasRegisteredNavigator(implementingClass) {
3330
3330
  return navigatorRegistry.has(implementingClass);
3331
3331
  }
3332
- function getRegisteredNavigatorRole(implementingClass) {
3333
- return navigatorRegistry.get(implementingClass)?.role;
3334
- }
3335
3332
  function getRegisteredNavigatorNames() {
3336
3333
  return Array.from(navigatorRegistry.keys());
3337
3334
  }
@@ -3377,12 +3374,10 @@ function getCardOrigin(card) {
3377
3374
  return "new";
3378
3375
  }
3379
3376
  function isGenerator(impl) {
3380
- if (NavigatorRoles[impl] === "generator" /* GENERATOR */) return true;
3381
- return getRegisteredNavigatorRole(impl) === "generator" /* GENERATOR */;
3377
+ return NavigatorRoles[impl] === "generator" /* GENERATOR */;
3382
3378
  }
3383
3379
  function isFilter(impl) {
3384
- if (NavigatorRoles[impl] === "filter" /* FILTER */) return true;
3385
- return getRegisteredNavigatorRole(impl) === "filter" /* FILTER */;
3380
+ return NavigatorRoles[impl] === "filter" /* FILTER */;
3386
3381
  }
3387
3382
  var navigatorRegistry, Navigators, NavigatorRole, NavigatorRoles, ContentNavigator;
3388
3383
  var init_navigators = __esm({
@@ -11569,7 +11564,6 @@ export {
11569
11564
  getDefaultLearnableWeight,
11570
11565
  getRegisteredNavigator,
11571
11566
  getRegisteredNavigatorNames,
11572
- getRegisteredNavigatorRole,
11573
11567
  getStudySource,
11574
11568
  hasRegisteredNavigator,
11575
11569
  importParsedCards,