@vue-skuilder/db 0.2.27 → 0.2.28

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.
Files changed (59) hide show
  1. package/dist/classroomDB-DLTtLZct.d.cts +86 -0
  2. package/dist/classroomDB-DLTtLZct.d.ts +86 -0
  3. package/dist/{contentSource-LPf044hY.d.ts → contentSource-BoFBwvYa.d.ts} +65 -98
  4. package/dist/{contentSource-D3c1fMAk.d.cts → contentSource-DpQqTG3m.d.cts} +65 -98
  5. package/dist/core/index.d.cts +6 -5
  6. package/dist/core/index.d.ts +6 -5
  7. package/dist/core/index.js +22 -2
  8. package/dist/core/index.js.map +1 -1
  9. package/dist/core/index.mjs +22 -2
  10. package/dist/core/index.mjs.map +1 -1
  11. package/dist/{dataLayerProvider-DaAootVV.d.ts → dataLayerProvider-D_LJT3F4.d.ts} +2 -8
  12. package/dist/{dataLayerProvider-CeLiFbHv.d.cts → dataLayerProvider-Dl3cAAvQ.d.cts} +2 -8
  13. package/dist/diagnostics/index.d.cts +370 -0
  14. package/dist/diagnostics/index.d.ts +370 -0
  15. package/dist/diagnostics/index.js +778 -0
  16. package/dist/diagnostics/index.js.map +1 -0
  17. package/dist/diagnostics/index.mjs +729 -0
  18. package/dist/diagnostics/index.mjs.map +1 -0
  19. package/dist/impl/couch/index.d.cts +4 -3
  20. package/dist/impl/couch/index.d.ts +4 -3
  21. package/dist/impl/couch/index.js +22 -2
  22. package/dist/impl/couch/index.js.map +1 -1
  23. package/dist/impl/couch/index.mjs +22 -2
  24. package/dist/impl/couch/index.mjs.map +1 -1
  25. package/dist/impl/static/index.d.cts +5 -5
  26. package/dist/impl/static/index.d.ts +5 -5
  27. package/dist/impl/static/index.js +22 -8
  28. package/dist/impl/static/index.js.map +1 -1
  29. package/dist/impl/static/index.mjs +22 -8
  30. package/dist/impl/static/index.mjs.map +1 -1
  31. package/dist/{index-BkBJlGDX.d.ts → index-CVGehe_t.d.ts} +1 -1
  32. package/dist/{index-D7WdMDAs.d.cts → index-Ktg72jKb.d.cts} +1 -1
  33. package/dist/index.d.cts +10 -9
  34. package/dist/index.d.ts +10 -9
  35. package/dist/index.js +64 -23
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +64 -23
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/{types-DjiFOZxJ.d.cts → types-D0oQeJAi.d.cts} +1 -1
  40. package/dist/{types-uJ2Xn3_X.d.ts → types-dXWfyz9B.d.ts} +1 -1
  41. package/dist/{types-legacy-CrwyZIvI.d.cts → types-legacy-BkOYOR6U.d.cts} +1 -1
  42. package/dist/{types-legacy-CrwyZIvI.d.ts → types-legacy-BkOYOR6U.d.ts} +1 -1
  43. package/dist/util/packer/index.d.cts +3 -3
  44. package/dist/util/packer/index.d.ts +3 -3
  45. package/package.json +15 -3
  46. package/src/core/interfaces/dataLayerProvider.ts +3 -8
  47. package/src/core/navigators/Pipeline.ts +5 -2
  48. package/src/core/navigators/PipelineDebugger.ts +64 -16
  49. package/src/core/navigators/index.ts +1 -0
  50. package/src/core/types/studySession.ts +37 -0
  51. package/src/diagnostics/dataset.ts +231 -0
  52. package/src/diagnostics/derive.ts +555 -0
  53. package/src/diagnostics/index.ts +24 -0
  54. package/src/diagnostics/loader.ts +191 -0
  55. package/src/diagnostics/text.ts +242 -0
  56. package/src/impl/couch/PouchDataLayerProvider.ts +0 -23
  57. package/src/impl/static/StaticDataLayerProvider.ts +0 -11
  58. package/src/study/SessionController.ts +56 -2
  59. package/tsup.config.ts +1 -0
@@ -1,8 +1,9 @@
1
- import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, R as ReplanHints, G as GeneratorResult } from '../../contentSource-D3c1fMAk.cjs';
2
- import { D as DataLayerProvider } from '../../dataLayerProvider-CeLiFbHv.cjs';
3
- import { S as StaticCourseManifest } from '../../types-DjiFOZxJ.cjs';
1
+ import { C as ClassroomDBInterface, A as AdminDBInterface } from '../../classroomDB-DLTtLZct.cjs';
2
+ import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, i as CourseInfo, j as StudySessionItem, D as DataLayerResult, k as ContentNavigationStrategyData, l as ContentNavigator, R as ReplanHints, G as GeneratorResult } from '../../contentSource-DpQqTG3m.cjs';
3
+ import { D as DataLayerProvider } from '../../dataLayerProvider-Dl3cAAvQ.cjs';
4
+ import { S as StaticCourseManifest } from '../../types-D0oQeJAi.cjs';
4
5
  import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
5
- import { S as SkuilderCourseData, Q as QualifiedCardID, T as TagStub, a as Tag } from '../../types-legacy-CrwyZIvI.cjs';
6
+ import { S as SkuilderCourseData, d as QualifiedCardID, e as TagStub, T as Tag } from '../../types-legacy-BkOYOR6U.cjs';
6
7
  import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-BXliog1m.cjs';
7
8
  import 'moment';
8
9
 
@@ -32,7 +33,6 @@ declare class StaticDataLayerProvider implements DataLayerProvider {
32
33
  getCoursesDB(): CoursesDBInterface;
33
34
  getClassroomDB(_classId: string, _type: 'student' | 'teacher'): Promise<ClassroomDBInterface>;
34
35
  getAdminDB(): AdminDBInterface;
35
- createUserReaderForUser(targetUsername: string): Promise<UserDBReader>;
36
36
  isReadOnly(): boolean;
37
37
  }
38
38
 
@@ -1,8 +1,9 @@
1
- import { U as UserDBInterface, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface, a as UserDBReader, d as CourseInfo, S as StudySessionItem, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, R as ReplanHints, G as GeneratorResult } from '../../contentSource-LPf044hY.js';
2
- import { D as DataLayerProvider } from '../../dataLayerProvider-DaAootVV.js';
3
- import { S as StaticCourseManifest } from '../../types-uJ2Xn3_X.js';
1
+ import { C as ClassroomDBInterface, A as AdminDBInterface } from '../../classroomDB-DLTtLZct.js';
2
+ import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, i as CourseInfo, j as StudySessionItem, D as DataLayerResult, k as ContentNavigationStrategyData, l as ContentNavigator, R as ReplanHints, G as GeneratorResult } from '../../contentSource-BoFBwvYa.js';
3
+ import { D as DataLayerProvider } from '../../dataLayerProvider-D_LJT3F4.js';
4
+ import { S as StaticCourseManifest } from '../../types-dXWfyz9B.js';
4
5
  import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
5
- import { S as SkuilderCourseData, Q as QualifiedCardID, T as TagStub, a as Tag } from '../../types-legacy-CrwyZIvI.js';
6
+ import { S as SkuilderCourseData, d as QualifiedCardID, e as TagStub, T as Tag } from '../../types-legacy-BkOYOR6U.js';
6
7
  import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-BXliog1m.js';
7
8
  import 'moment';
8
9
 
@@ -32,7 +33,6 @@ declare class StaticDataLayerProvider implements DataLayerProvider {
32
33
  getCoursesDB(): CoursesDBInterface;
33
34
  getClassroomDB(_classId: string, _type: 'student' | 'teacher'): Promise<ClassroomDBInterface>;
34
35
  getAdminDB(): AdminDBInterface;
35
- createUserReaderForUser(targetUsername: string): Promise<UserDBReader>;
36
36
  isReadOnly(): boolean;
37
37
  }
38
38
 
@@ -532,7 +532,7 @@ function parseCardElo(provenance) {
532
532
  const match = eloEntry.reason.match(/card:\s*(\d+)/);
533
533
  return match ? parseInt(match[1], 10) : void 0;
534
534
  }
535
- function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints) {
535
+ function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards) {
536
536
  const selectedIds = new Set(selectedCards.map((c) => c.cardId));
537
537
  const toReport = (card) => ({
538
538
  cardId: card.cardId,
@@ -585,6 +585,23 @@ function buildRunReport(courseId, courseName, generatorName, generators, generat
585
585
  note: `${discardedTailCards.length} additional candidate(s) scored below the top ${DISCARDED_KEEP_TOP} near-misses and were not retained (score ${scoreMin.toExponential(2)}\u2013${scoreMax.toExponential(2)}${eloFragment}). Likely ELO-window pull remnants filtered out by hierarchy/lesson/priority gates.`
586
586
  };
587
587
  }
588
+ const isUnselectedNew = (c) => !c.reviewID && !selectedIds.has(c.cardId);
589
+ const generatorScore = (c) => c.provenance[0]?.score ?? 0;
590
+ const keptIds = new Set(allCards.map((c) => c.cardId));
591
+ const hintExcluded = (c) => c.score > 0 && !keptIds.has(c.cardId);
592
+ let nextInLine;
593
+ for (const c of allCards) {
594
+ if (isUnselectedNew(c) && (!nextInLine || c.score > nextInLine.score)) nextInLine = c;
595
+ }
596
+ let topGenerated;
597
+ for (const c of scoredCards ?? allCards) {
598
+ if (!isUnselectedNew(c) || hintExcluded(c)) continue;
599
+ if (!topGenerated || generatorScore(c) > generatorScore(topGenerated)) topGenerated = c;
600
+ }
601
+ const unselectedNew = nextInLine || topGenerated ? {
602
+ ...nextInLine ? { nextInLine: toReport(nextInLine) } : {},
603
+ ...topGenerated && topGenerated.cardId !== nextInLine?.cardId ? { topGenerated: toReport(topGenerated) } : {}
604
+ } : void 0;
588
605
  const reviewsSelected = selectedCards.filter((c) => getOrigin(c) === "review").length;
589
606
  const newSelected = selectedCards.filter((c) => getOrigin(c) === "new").length;
590
607
  return {
@@ -600,6 +617,7 @@ function buildRunReport(courseId, courseName, generatorName, generators, generat
600
617
  reviewsSelected,
601
618
  newSelected,
602
619
  cards,
620
+ unselectedNew,
603
621
  discardedTail
604
622
  };
605
623
  }
@@ -4173,6 +4191,7 @@ var init_Pipeline = __esm({
4173
4191
  }
4174
4192
  logger.debug(`[Pipeline] Filter '${filter.name}': ${beforeScores.size} \u2192 ${cards.length} cards (\u2191${boosted} \u2193${penalized} =${passed})`);
4175
4193
  }
4194
+ const scoredCards = cards;
4176
4195
  cards = cards.filter((c) => c.score > 0);
4177
4196
  const hints = this._ephemeralHints;
4178
4197
  if (hints) {
@@ -4209,7 +4228,8 @@ var init_Pipeline = __esm({
4209
4228
  cards,
4210
4229
  result,
4211
4230
  context.userElo,
4212
- hints ?? void 0
4231
+ hints ?? void 0,
4232
+ scoredCards
4213
4233
  );
4214
4234
  captureRun(report);
4215
4235
  } catch (e) {
@@ -10221,12 +10241,6 @@ var init_StaticDataLayerProvider = __esm({
10221
10241
  getAdminDB() {
10222
10242
  throw new Error("Admin functions not supported in static mode");
10223
10243
  }
10224
- async createUserReaderForUser(targetUsername) {
10225
- logger.warn(`StaticDataLayerProvider: Multi-user access not supported in static mode`);
10226
- logger.warn(`Request: trying to access data for ${targetUsername}`);
10227
- logger.warn(`Returning current user's data instead`);
10228
- return this.getUserDB();
10229
- }
10230
10244
  isReadOnly() {
10231
10245
  return true;
10232
10246
  }