@vue-skuilder/db 0.1.20 → 0.1.21

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 (70) hide show
  1. package/CLAUDE.md +2 -2
  2. package/dist/{classroomDB-CZdMBiTU.d.ts → contentSource-BP9hznNV.d.ts} +150 -196
  3. package/dist/{classroomDB-PxDZTky3.d.cts → contentSource-DsJadoBU.d.cts} +150 -196
  4. package/dist/core/index.d.cts +3 -3
  5. package/dist/core/index.d.ts +3 -3
  6. package/dist/core/index.js +615 -1758
  7. package/dist/core/index.js.map +1 -1
  8. package/dist/core/index.mjs +579 -1727
  9. package/dist/core/index.mjs.map +1 -1
  10. package/dist/{dataLayerProvider-D8o6ZnKW.d.ts → dataLayerProvider-CHYrQ5pB.d.cts} +1 -1
  11. package/dist/{dataLayerProvider-D0MoZMjH.d.cts → dataLayerProvider-MDTxXq2l.d.ts} +1 -1
  12. package/dist/impl/couch/index.d.cts +6 -22
  13. package/dist/impl/couch/index.d.ts +6 -22
  14. package/dist/impl/couch/index.js +598 -1769
  15. package/dist/impl/couch/index.js.map +1 -1
  16. package/dist/impl/couch/index.mjs +579 -1755
  17. package/dist/impl/couch/index.mjs.map +1 -1
  18. package/dist/impl/static/index.d.cts +22 -6
  19. package/dist/impl/static/index.d.ts +22 -6
  20. package/dist/impl/static/index.js +617 -1629
  21. package/dist/impl/static/index.js.map +1 -1
  22. package/dist/impl/static/index.mjs +607 -1624
  23. package/dist/impl/static/index.mjs.map +1 -1
  24. package/dist/index.d.cts +64 -56
  25. package/dist/index.d.ts +64 -56
  26. package/dist/index.js +1000 -2161
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +970 -2127
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/pouch/index.js +3 -0
  31. package/dist/pouch/index.js.map +1 -1
  32. package/dist/pouch/index.mjs +3 -0
  33. package/dist/pouch/index.mjs.map +1 -1
  34. package/docs/navigators-architecture.md +2 -9
  35. package/package.json +3 -3
  36. package/src/core/interfaces/classroomDB.ts +5 -13
  37. package/src/core/interfaces/contentSource.ts +6 -66
  38. package/src/core/interfaces/courseDB.ts +2 -7
  39. package/src/core/navigators/Pipeline.ts +24 -53
  40. package/src/core/navigators/PipelineAssembler.ts +1 -1
  41. package/src/core/navigators/defaults.ts +84 -0
  42. package/src/core/navigators/{hierarchyDefinition.ts → filters/hierarchyDefinition.ts} +11 -25
  43. package/src/core/navigators/{interferenceMitigator.ts → filters/interferenceMitigator.ts} +10 -24
  44. package/src/core/navigators/{relativePriority.ts → filters/relativePriority.ts} +10 -24
  45. package/src/core/navigators/filters/userTagPreference.ts +1 -16
  46. package/src/core/navigators/{CompositeGenerator.ts → generators/CompositeGenerator.ts} +15 -64
  47. package/src/core/navigators/{elo.ts → generators/elo.ts} +13 -63
  48. package/src/core/navigators/{srs.ts → generators/srs.ts} +11 -40
  49. package/src/core/navigators/generators/types.ts +1 -1
  50. package/src/core/navigators/index.ts +36 -91
  51. package/src/impl/couch/classroomDB.ts +100 -103
  52. package/src/impl/couch/courseDB.ts +5 -81
  53. package/src/impl/couch/pouchdb-setup.ts +7 -0
  54. package/src/impl/static/StaticDataUnpacker.ts +50 -1
  55. package/src/impl/static/courseDB.ts +76 -37
  56. package/src/study/SessionController.ts +122 -202
  57. package/src/study/SourceMixer.ts +65 -0
  58. package/src/study/TagFilteredContentSource.ts +49 -92
  59. package/src/study/index.ts +1 -0
  60. package/src/study/services/CardHydrationService.ts +165 -81
  61. package/src/util/dataDirectory.ts +1 -1
  62. package/src/util/index.ts +0 -1
  63. package/tests/core/navigators/CompositeGenerator.test.ts +44 -168
  64. package/tests/core/navigators/Pipeline.test.ts +5 -72
  65. package/tests/core/navigators/PipelineAssembler.test.ts +8 -58
  66. package/tests/core/navigators/navigators.test.ts +118 -151
  67. package/src/core/navigators/hardcodedOrder.ts +0 -163
  68. package/src/util/tuiLogger.ts +0 -139
  69. /package/src/core/navigators/{inferredPreference.ts → filters/inferredPreferenceStub.ts} +0 -0
  70. /package/src/core/navigators/{userGoal.ts → filters/userGoalStub.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './classroomDB-CZdMBiTU.js';
1
+ import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './contentSource-DsJadoBU.cjs';
2
2
 
3
3
  /**
4
4
  * Main factory interface for data access
@@ -1,4 +1,4 @@
1
- import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './classroomDB-PxDZTky3.cjs';
1
+ import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './contentSource-BP9hznNV.js';
2
2
 
3
3
  /**
4
4
  * Main factory interface for data access
@@ -1,7 +1,7 @@
1
1
  import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-DDY4N-Uq.cjs';
2
2
  import { Moment } from 'moment';
3
- import { A as AdminDBInterface, h as AssignedContent, i as StudyContentSource, j as StudentClassroomDBInterface, U as UserDBInterface, f as StudySessionReviewItem, g as ScheduledCard, S as StudySessionNewItem, W as WeightedCard, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, k as ContentNavigator, l as StudySessionItem } from '../../classroomDB-PxDZTky3.cjs';
4
- export { q as ContentSourceID, m as StudySessionFailedItem, n as StudySessionFailedNewItem, o as StudySessionFailedReviewItem, r as getStudySource, p as isReview } from '../../classroomDB-PxDZTky3.cjs';
3
+ import { A as AdminDBInterface, g as AssignedContent, h as StudyContentSource, i as StudentClassroomDBInterface, U as UserDBInterface, W as WeightedCard, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, S as StudySessionItem, j as ScheduledCard } from '../../contentSource-DsJadoBU.cjs';
4
+ export { q as ContentSourceID, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, r as getStudySource, p as isReview } from '../../contentSource-DsJadoBU.cjs';
5
5
  import * as _vue_skuilder_common from '@vue-skuilder/common';
6
6
  import { ClassroomConfig, DataShape, CourseElo, CourseConfig as CourseConfig$1 } from '@vue-skuilder/common';
7
7
  import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.cjs';
@@ -86,14 +86,11 @@ declare class StudentClassroomDB extends ClassroomDBBase implements StudyContent
86
86
  init(): Promise<void>;
87
87
  static factory(classID: string, user: UserDBInterface): Promise<StudentClassroomDB>;
88
88
  setChangeFcn(f: (value: unknown) => object): void;
89
- getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
90
- getNewCards(): Promise<StudySessionNewItem[]>;
91
89
  /**
92
90
  * Get cards with suitability scores for presentation.
93
91
  *
94
- * This implementation wraps the legacy getNewCards/getPendingReviews methods,
95
- * assigning score=1.0 to all cards. StudentClassroomDB does not currently
96
- * support pluggable navigation strategies.
92
+ * Gathers new cards from assigned content (courses, tags, cards) and
93
+ * pending reviews scheduled for this classroom. Assigns score=1.0 to all.
97
94
  *
98
95
  * @param limit - Maximum number of cards to return
99
96
  * @returns Cards sorted by score descending (all scores = 1.0)
@@ -150,7 +147,7 @@ declare class CoursesDB implements CoursesDBInterface {
150
147
  getCourseConfig(courseId: string): Promise<CourseConfig$1>;
151
148
  disambiguateCourse(courseId: string, disambiguator: string): Promise<void>;
152
149
  }
153
- declare class CourseDB implements StudyContentSource, CourseDBInterface {
150
+ declare class CourseDB implements CourseDBInterface {
154
151
  private db;
155
152
  private id;
156
153
  private _getCurrentUser;
@@ -217,19 +214,6 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
217
214
  * @returns Instantiated ContentNavigator ready for use
218
215
  */
219
216
  createNavigator(user: UserDBInterface): Promise<ContentNavigator>;
220
- private makeDefaultEloStrategy;
221
- private makeDefaultSrsStrategy;
222
- /**
223
- * Creates the default navigation pipeline for courses with no configured strategies.
224
- *
225
- * Default: Pipeline(Composite(ELO, SRS), [eloDistanceFilter])
226
- * - ELO generator: scores new cards by skill proximity
227
- * - SRS generator: scores reviews by overdueness and interval recency
228
- * - ELO distance filter: penalizes cards far from user's current level
229
- */
230
- private createDefaultPipeline;
231
- getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
232
- getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
233
217
  /**
234
218
  * Get cards with suitability scores for presentation.
235
219
  *
@@ -347,4 +331,4 @@ declare function getStartAndEndKeys(key: string): {
347
331
  endkey: string;
348
332
  };
349
333
 
350
- export { AdminDB, CLASSROOM_CONFIG, ClassroomLookupDB, type ClassroomMessage, CouchDBSyncStrategy, CourseDB, CoursesDB, REVIEW_TIME_FORMAT, StudentClassroomDB, StudyContentSource, StudySessionItem, StudySessionNewItem, StudySessionReviewItem, TeacherClassroomDB, addNote55, addTagToCard, createPouchDBConfig, createTag, deleteTag, filterAllDocsByPrefix, getAncestorTagIDs, getAppliedTags, getChildTagStubs, getClassroomConfig, getClassroomDB, getCouchUserDB, getCourseDB, getCourseDataShapes, getCourseDoc, getCourseDocs, getCourseQuestionTypes, getCourseTagStubs, getCredentialledCourseConfig, getCredentialledDataShapes, getLatestVersion, getRandomCards, getStartAndEndKeys, getTag, getTagID, hexEncode, localUserDB, removeTagFromCard, scheduleCardReview, updateCardElo, updateCredentialledCourseConfig, updateGuestAccountExpirationDate, updateTag, usernameIsAvailable };
334
+ export { AdminDB, CLASSROOM_CONFIG, ClassroomLookupDB, type ClassroomMessage, CouchDBSyncStrategy, CourseDB, CoursesDB, REVIEW_TIME_FORMAT, StudentClassroomDB, StudyContentSource, StudySessionItem, TeacherClassroomDB, addNote55, addTagToCard, createPouchDBConfig, createTag, deleteTag, filterAllDocsByPrefix, getAncestorTagIDs, getAppliedTags, getChildTagStubs, getClassroomConfig, getClassroomDB, getCouchUserDB, getCourseDB, getCourseDataShapes, getCourseDoc, getCourseDocs, getCourseQuestionTypes, getCourseTagStubs, getCredentialledCourseConfig, getCredentialledDataShapes, getLatestVersion, getRandomCards, getStartAndEndKeys, getTag, getTagID, hexEncode, localUserDB, removeTagFromCard, scheduleCardReview, updateCardElo, updateCredentialledCourseConfig, updateGuestAccountExpirationDate, updateTag, usernameIsAvailable };
@@ -1,7 +1,7 @@
1
1
  import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-DDY4N-Uq.js';
2
2
  import { Moment } from 'moment';
3
- import { A as AdminDBInterface, h as AssignedContent, i as StudyContentSource, j as StudentClassroomDBInterface, U as UserDBInterface, f as StudySessionReviewItem, g as ScheduledCard, S as StudySessionNewItem, W as WeightedCard, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, k as ContentNavigator, l as StudySessionItem } from '../../classroomDB-CZdMBiTU.js';
4
- export { q as ContentSourceID, m as StudySessionFailedItem, n as StudySessionFailedNewItem, o as StudySessionFailedReviewItem, r as getStudySource, p as isReview } from '../../classroomDB-CZdMBiTU.js';
3
+ import { A as AdminDBInterface, g as AssignedContent, h as StudyContentSource, i as StudentClassroomDBInterface, U as UserDBInterface, W as WeightedCard, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, f as ContentNavigator, S as StudySessionItem, j as ScheduledCard } from '../../contentSource-BP9hznNV.js';
4
+ export { q as ContentSourceID, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, r as getStudySource, p as isReview } from '../../contentSource-BP9hznNV.js';
5
5
  import * as _vue_skuilder_common from '@vue-skuilder/common';
6
6
  import { ClassroomConfig, DataShape, CourseElo, CourseConfig as CourseConfig$1 } from '@vue-skuilder/common';
7
7
  import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.js';
@@ -86,14 +86,11 @@ declare class StudentClassroomDB extends ClassroomDBBase implements StudyContent
86
86
  init(): Promise<void>;
87
87
  static factory(classID: string, user: UserDBInterface): Promise<StudentClassroomDB>;
88
88
  setChangeFcn(f: (value: unknown) => object): void;
89
- getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
90
- getNewCards(): Promise<StudySessionNewItem[]>;
91
89
  /**
92
90
  * Get cards with suitability scores for presentation.
93
91
  *
94
- * This implementation wraps the legacy getNewCards/getPendingReviews methods,
95
- * assigning score=1.0 to all cards. StudentClassroomDB does not currently
96
- * support pluggable navigation strategies.
92
+ * Gathers new cards from assigned content (courses, tags, cards) and
93
+ * pending reviews scheduled for this classroom. Assigns score=1.0 to all.
97
94
  *
98
95
  * @param limit - Maximum number of cards to return
99
96
  * @returns Cards sorted by score descending (all scores = 1.0)
@@ -150,7 +147,7 @@ declare class CoursesDB implements CoursesDBInterface {
150
147
  getCourseConfig(courseId: string): Promise<CourseConfig$1>;
151
148
  disambiguateCourse(courseId: string, disambiguator: string): Promise<void>;
152
149
  }
153
- declare class CourseDB implements StudyContentSource, CourseDBInterface {
150
+ declare class CourseDB implements CourseDBInterface {
154
151
  private db;
155
152
  private id;
156
153
  private _getCurrentUser;
@@ -217,19 +214,6 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
217
214
  * @returns Instantiated ContentNavigator ready for use
218
215
  */
219
216
  createNavigator(user: UserDBInterface): Promise<ContentNavigator>;
220
- private makeDefaultEloStrategy;
221
- private makeDefaultSrsStrategy;
222
- /**
223
- * Creates the default navigation pipeline for courses with no configured strategies.
224
- *
225
- * Default: Pipeline(Composite(ELO, SRS), [eloDistanceFilter])
226
- * - ELO generator: scores new cards by skill proximity
227
- * - SRS generator: scores reviews by overdueness and interval recency
228
- * - ELO distance filter: penalizes cards far from user's current level
229
- */
230
- private createDefaultPipeline;
231
- getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
232
- getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
233
217
  /**
234
218
  * Get cards with suitability scores for presentation.
235
219
  *
@@ -347,4 +331,4 @@ declare function getStartAndEndKeys(key: string): {
347
331
  endkey: string;
348
332
  };
349
333
 
350
- export { AdminDB, CLASSROOM_CONFIG, ClassroomLookupDB, type ClassroomMessage, CouchDBSyncStrategy, CourseDB, CoursesDB, REVIEW_TIME_FORMAT, StudentClassroomDB, StudyContentSource, StudySessionItem, StudySessionNewItem, StudySessionReviewItem, TeacherClassroomDB, addNote55, addTagToCard, createPouchDBConfig, createTag, deleteTag, filterAllDocsByPrefix, getAncestorTagIDs, getAppliedTags, getChildTagStubs, getClassroomConfig, getClassroomDB, getCouchUserDB, getCourseDB, getCourseDataShapes, getCourseDoc, getCourseDocs, getCourseQuestionTypes, getCourseTagStubs, getCredentialledCourseConfig, getCredentialledDataShapes, getLatestVersion, getRandomCards, getStartAndEndKeys, getTag, getTagID, hexEncode, localUserDB, removeTagFromCard, scheduleCardReview, updateCardElo, updateCredentialledCourseConfig, updateGuestAccountExpirationDate, updateTag, usernameIsAvailable };
334
+ export { AdminDB, CLASSROOM_CONFIG, ClassroomLookupDB, type ClassroomMessage, CouchDBSyncStrategy, CourseDB, CoursesDB, REVIEW_TIME_FORMAT, StudentClassroomDB, StudyContentSource, StudySessionItem, TeacherClassroomDB, addNote55, addTagToCard, createPouchDBConfig, createTag, deleteTag, filterAllDocsByPrefix, getAncestorTagIDs, getAppliedTags, getChildTagStubs, getClassroomConfig, getClassroomDB, getCouchUserDB, getCourseDB, getCourseDataShapes, getCourseDoc, getCourseDocs, getCourseQuestionTypes, getCourseTagStubs, getCredentialledCourseConfig, getCredentialledDataShapes, getLatestVersion, getRandomCards, getStartAndEndKeys, getTag, getTagID, hexEncode, localUserDB, removeTagFromCard, scheduleCardReview, updateCardElo, updateCredentialledCourseConfig, updateGuestAccountExpirationDate, updateTag, usernameIsAvailable };