@vue-skuilder/db 0.1.16 → 0.1.18

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 (80) hide show
  1. package/dist/{userDB-DNa0XPtn.d.ts → classroomDB-BgfrVb8d.d.ts} +357 -103
  2. package/dist/{userDB-BqwxtJ_7.d.mts → classroomDB-CTOenngH.d.cts} +358 -104
  3. package/dist/core/index.d.cts +230 -0
  4. package/dist/core/index.d.ts +161 -23
  5. package/dist/core/index.js +1964 -154
  6. package/dist/core/index.js.map +1 -1
  7. package/dist/core/index.mjs +1925 -121
  8. package/dist/core/index.mjs.map +1 -1
  9. package/dist/{dataLayerProvider-BV5iZqt_.d.ts → dataLayerProvider-CZxC9GtB.d.ts} +1 -1
  10. package/dist/{dataLayerProvider-VlngD19_.d.mts → dataLayerProvider-D6PoCwS6.d.cts} +1 -1
  11. package/dist/impl/couch/{index.d.mts → index.d.cts} +46 -5
  12. package/dist/impl/couch/index.d.ts +44 -3
  13. package/dist/impl/couch/index.js +1971 -171
  14. package/dist/impl/couch/index.js.map +1 -1
  15. package/dist/impl/couch/index.mjs +1933 -134
  16. package/dist/impl/couch/index.mjs.map +1 -1
  17. package/dist/impl/static/{index.d.mts → index.d.cts} +5 -6
  18. package/dist/impl/static/index.d.ts +2 -3
  19. package/dist/impl/static/index.js +1614 -119
  20. package/dist/impl/static/index.js.map +1 -1
  21. package/dist/impl/static/index.mjs +1585 -92
  22. package/dist/impl/static/index.mjs.map +1 -1
  23. package/dist/{index-Bmll7Xse.d.mts → index-D-Fa4Smt.d.cts} +1 -1
  24. package/dist/{index.d.mts → index.d.cts} +97 -13
  25. package/dist/index.d.ts +90 -6
  26. package/dist/index.js +2085 -153
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +2031 -106
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/pouch/index.js +3 -3
  31. package/dist/{types-Dbp5DaRR.d.mts → types-CzPDLAK6.d.cts} +1 -1
  32. package/dist/util/packer/{index.d.mts → index.d.cts} +3 -3
  33. package/dist/util/packer/index.js.map +1 -1
  34. package/dist/util/packer/index.mjs.map +1 -1
  35. package/docs/brainstorm-navigation-paradigm.md +369 -0
  36. package/docs/navigators-architecture.md +265 -0
  37. package/docs/todo-evolutionary-orchestration.md +310 -0
  38. package/docs/todo-nominal-tag-types.md +121 -0
  39. package/docs/todo-pipeline-optimization.md +117 -0
  40. package/docs/todo-strategy-authoring.md +401 -0
  41. package/docs/todo-strategy-state-storage.md +278 -0
  42. package/eslint.config.mjs +1 -1
  43. package/package.json +9 -4
  44. package/src/core/interfaces/contentSource.ts +88 -4
  45. package/src/core/interfaces/navigationStrategyManager.ts +0 -5
  46. package/src/core/navigators/CompositeGenerator.ts +268 -0
  47. package/src/core/navigators/Pipeline.ts +205 -0
  48. package/src/core/navigators/PipelineAssembler.ts +194 -0
  49. package/src/core/navigators/elo.ts +104 -15
  50. package/src/core/navigators/filters/eloDistance.ts +132 -0
  51. package/src/core/navigators/filters/index.ts +6 -0
  52. package/src/core/navigators/filters/types.ts +115 -0
  53. package/src/core/navigators/generators/index.ts +2 -0
  54. package/src/core/navigators/generators/types.ts +107 -0
  55. package/src/core/navigators/hardcodedOrder.ts +111 -12
  56. package/src/core/navigators/hierarchyDefinition.ts +266 -0
  57. package/src/core/navigators/index.ts +345 -3
  58. package/src/core/navigators/interferenceMitigator.ts +367 -0
  59. package/src/core/navigators/relativePriority.ts +267 -0
  60. package/src/core/navigators/srs.ts +195 -0
  61. package/src/impl/couch/classroomDB.ts +51 -0
  62. package/src/impl/couch/courseDB.ts +117 -39
  63. package/src/impl/static/courseDB.ts +0 -4
  64. package/src/study/SessionController.ts +149 -1
  65. package/src/study/TagFilteredContentSource.ts +255 -0
  66. package/src/study/index.ts +1 -0
  67. package/src/util/dataDirectory.test.ts +51 -22
  68. package/src/util/logger.ts +0 -1
  69. package/tests/core/navigators/CompositeGenerator.test.ts +455 -0
  70. package/tests/core/navigators/Pipeline.test.ts +405 -0
  71. package/tests/core/navigators/PipelineAssembler.test.ts +351 -0
  72. package/tests/core/navigators/SRSNavigator.test.ts +344 -0
  73. package/tests/core/navigators/eloDistanceFilter.test.ts +192 -0
  74. package/tests/core/navigators/navigators.test.ts +710 -0
  75. package/tsconfig.json +1 -1
  76. package/vitest.config.ts +29 -0
  77. package/dist/core/index.d.mts +0 -92
  78. /package/dist/{SyncStrategy-CyATpyLQ.d.mts → SyncStrategy-CyATpyLQ.d.cts} +0 -0
  79. /package/dist/pouch/{index.d.mts → index.d.cts} +0 -0
  80. /package/dist/{types-legacy-6ettoclI.d.mts → types-legacy-6ettoclI.d.cts} +0 -0
@@ -1,4 +1,4 @@
1
- import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-Dbp5DaRR.mjs';
1
+ import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-CzPDLAK6.cjs';
2
2
 
3
3
  /**
4
4
  * Abstraction for file system operations needed by the migrator.
@@ -1,15 +1,15 @@
1
- import { U as UserDBInterface, r as CourseRegistrationDoc, k as StudySessionItem, i as StudyContentSource } from './userDB-BqwxtJ_7.mjs';
2
- export { I as ActivityRecord, A as AdminDBInterface, u as AssignedCard, h as AssignedContent, t as AssignedCourse, s as AssignedTag, c as ClassroomDBInterface, E as ClassroomRegistration, B as ClassroomRegistrationDesignation, F as ClassroomRegistrationDoc, p as ContentSourceID, C as CourseDBInterface, d as CourseInfo, J as CourseRegistration, b as CoursesDBInterface, K as DocumentUpdater, g as ScheduledCard, G as SessionTrackingData, j as StudentClassroomDBInterface, l as StudySessionFailedItem, m as StudySessionFailedNewItem, n as StudySessionFailedReviewItem, S as StudySessionNewItem, f as StudySessionReviewItem, T as TeacherClassroomDBInterface, H as UserConfig, y as UserCourseSetting, x as UserCourseSettings, w as UserDBAuthenticator, a as UserDBReader, v as UserDBWriter, z as UsrCrsDataInterface, q as getStudySource, o as isReview, L as newInterval } from './userDB-BqwxtJ_7.mjs';
3
- import { D as DataLayerProvider } from './dataLayerProvider-VlngD19_.mjs';
4
- import { C as CardHistory, c as CardRecord } from './types-legacy-6ettoclI.mjs';
5
- export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, D as DocType, b as DocTypePrefixes, F as Field, G as GuestUsername, Q as QualifiedCardID, h as QuestionData, i as QuestionRecord, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from './types-legacy-6ettoclI.mjs';
6
- import { Loggable } from './core/index.mjs';
7
- export { BulkCardProcessorConfig, ContentNavigator, ImportResult, Navigators, areQuestionRecords, docIsDeleted, getCardHistoryID, importParsedCards, isQuestionRecord, parseCardHistoryID, validateProcessorConfig } from './core/index.mjs';
8
- import { S as StaticCourseManifest } from './types-Dbp5DaRR.mjs';
9
- export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-Dbp5DaRR.mjs';
10
- import { F as FileSystemAdapter } from './index-Bmll7Xse.mjs';
11
- export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-Bmll7Xse.mjs';
12
- import '@vue-skuilder/common';
1
+ import { U as UserDBInterface, s as CourseRegistrationDoc, l as StudySessionItem, i as StudyContentSource, S as StudySessionNewItem, f as StudySessionReviewItem, g as ScheduledCard, W as WeightedCard } from './classroomDB-CTOenngH.cjs';
2
+ export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, h as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, k as ContentNavigator, q as ContentSourceID, C as CourseDBInterface, d as CourseInfo, K as CourseRegistration, b as CoursesDBInterface, V as DocumentUpdater, O as NavigatorRole, P as NavigatorRoles, N as Navigators, H as SessionTrackingData, L as StrategyContribution, j as StudentClassroomDBInterface, m as StudySessionFailedItem, n as StudySessionFailedNewItem, o as StudySessionFailedReviewItem, T as TeacherClassroomDBInterface, I as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, M as getCardOrigin, r as getStudySource, R as isFilter, Q as isGenerator, p as isReview, X as newInterval } from './classroomDB-CTOenngH.cjs';
3
+ import { D as DataLayerProvider } from './dataLayerProvider-D6PoCwS6.cjs';
4
+ import { C as CardHistory, c as CardRecord } from './types-legacy-6ettoclI.cjs';
5
+ export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, D as DocType, b as DocTypePrefixes, F as Field, G as GuestUsername, Q as QualifiedCardID, h as QuestionData, i as QuestionRecord, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from './types-legacy-6ettoclI.cjs';
6
+ import { Loggable } from './core/index.cjs';
7
+ export { BulkCardProcessorConfig, CardFilter, CardFilterFactory, CardGenerator, CardGeneratorFactory, FilterContext, GeneratorContext, ImportResult, areQuestionRecords, docIsDeleted, getCardHistoryID, importParsedCards, isQuestionRecord, parseCardHistoryID, validateProcessorConfig } from './core/index.cjs';
8
+ import { TagFilter } from '@vue-skuilder/common';
9
+ import { S as StaticCourseManifest } from './types-CzPDLAK6.cjs';
10
+ export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-CzPDLAK6.cjs';
11
+ import { F as FileSystemAdapter } from './index-D-Fa4Smt.cjs';
12
+ export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-D-Fa4Smt.cjs';
13
13
  import 'moment';
14
14
 
15
15
  /**
@@ -336,6 +336,10 @@ declare class SessionController<TView = unknown> extends Loggable {
336
336
  * Used by SessionControllerDebug component for runtime inspection.
337
337
  */
338
338
  getDebugInfo(): {
339
+ api: {
340
+ mode: string;
341
+ description: string;
342
+ };
339
343
  reviewQueue: {
340
344
  length: number;
341
345
  dequeueCount: number;
@@ -369,7 +373,29 @@ declare class SessionController<TView = unknown> extends Loggable {
369
373
  items: any[];
370
374
  };
371
375
  };
376
+ /**
377
+ * Fetch content using the new getWeightedCards API.
378
+ *
379
+ * This method uses getWeightedCards() to get scored candidates, then uses the
380
+ * scores to determine ordering. For reviews, we still need the full ScheduledCard
381
+ * data from getPendingReviews(), so we fetch both and use scores for ordering.
382
+ *
383
+ * The hybrid approach:
384
+ * 1. Fetch weighted cards to get scoring/ordering information
385
+ * 2. Fetch full review data via legacy getPendingReviews()
386
+ * 3. Order reviews by their weighted scores
387
+ * 4. Add new cards ordered by their weighted scores
388
+ */
389
+ private getWeightedContent;
390
+ /**
391
+ * @deprecated Use getWeightedContent() instead. This method is kept for backward
392
+ * compatibility with sources that don't support getWeightedCards().
393
+ */
372
394
  private getScheduledReviews;
395
+ /**
396
+ * @deprecated Use getWeightedContent() instead. This method is kept for backward
397
+ * compatibility with sources that don't support getWeightedCards().
398
+ */
373
399
  private getNewCards;
374
400
  private _selectNextItemToHydrate;
375
401
  nextCard(action?: SessionAction): Promise<HydratedCard<TView> | null>;
@@ -395,6 +421,64 @@ declare class SessionController<TView = unknown> extends Loggable {
395
421
  private removeItemFromQueue;
396
422
  }
397
423
 
424
+ /**
425
+ * A StudyContentSource that filters cards based on tag inclusion/exclusion.
426
+ *
427
+ * This enables ephemeral, tag-scoped study sessions where users can focus
428
+ * on specific topics within a course without permanent configuration.
429
+ *
430
+ * Filter logic:
431
+ * - If `include` is non-empty: card must have at least one of the included tags
432
+ * - If `exclude` is non-empty: card must not have any of the excluded tags
433
+ * - Both filters are applied (include first, then exclude)
434
+ */
435
+ declare class TagFilteredContentSource implements StudyContentSource {
436
+ private courseId;
437
+ private filter;
438
+ private user;
439
+ private resolvedCardIds;
440
+ constructor(courseId: string, filter: TagFilter, user: UserDBInterface);
441
+ /**
442
+ * Resolves the TagFilter to a set of eligible card IDs.
443
+ *
444
+ * - Cards in `include` tags are OR'd together (card needs at least one)
445
+ * - Cards in `exclude` tags are removed from the result
446
+ */
447
+ private resolveFilteredCardIds;
448
+ /**
449
+ * Gets new cards that match the tag filter and are not already active for the user.
450
+ */
451
+ getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
452
+ /**
453
+ * Gets pending reviews, filtered to only include cards that match the tag filter.
454
+ */
455
+ getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
456
+ /**
457
+ * Get cards with suitability scores for presentation.
458
+ *
459
+ * This implementation wraps the legacy getNewCards/getPendingReviews methods,
460
+ * assigning score=1.0 to all cards. TagFilteredContentSource does not currently
461
+ * support pluggable navigation strategies - it returns flat-scored candidates.
462
+ *
463
+ * @param limit - Maximum number of cards to return
464
+ * @returns Cards sorted by score descending (all scores = 1.0)
465
+ */
466
+ getWeightedCards(limit: number): Promise<WeightedCard[]>;
467
+ /**
468
+ * Clears the cached resolved card IDs.
469
+ * Call this if the underlying tag data may have changed during a session.
470
+ */
471
+ clearCache(): void;
472
+ /**
473
+ * Returns the course ID this source is filtering.
474
+ */
475
+ getCourseId(): string;
476
+ /**
477
+ * Returns the active tag filter.
478
+ */
479
+ getFilter(): TagFilter;
480
+ }
481
+
398
482
  interface CourseLookupDoc {
399
483
  _id: string;
400
484
  _rev: string;
@@ -493,4 +577,4 @@ interface CouchDbUserDoc extends PouchDB.Authentication.User {
493
577
  entitlements: UserEntitlements;
494
578
  }
495
579
 
496
- export { type AggregatedDocument, type AttachmentUploadResult, CardHistory, CardRecord, type CouchDbUserDoc, CourseLookup, CourseRegistrationDoc, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, Loggable, type MigrationOptions, type MigrationResult, NOT_SET, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, _resetDataLayer, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, getLogFilePath, initializeDataDirectory, initializeDataLayer, initializeTuiLogging, logger, showUserError, showUserMessage, validateMigration, validateStaticCourse };
580
+ export { type AggregatedDocument, type AttachmentUploadResult, CardHistory, CardRecord, type CouchDbUserDoc, CourseLookup, CourseRegistrationDoc, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, Loggable, type MigrationOptions, type MigrationResult, NOT_SET, type ResponseResult, type RestoreProgress, ScheduledCard, type SessionAction, SessionController, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, StudySessionNewItem, type StudySessionRecord, StudySessionReviewItem, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, getLogFilePath, initializeDataDirectory, initializeDataLayer, initializeTuiLogging, logger, showUserError, showUserMessage, validateMigration, validateStaticCourse };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { U as UserDBInterface, r as CourseRegistrationDoc, k as StudySessionItem, i as StudyContentSource } from './userDB-DNa0XPtn.js';
2
- export { I as ActivityRecord, A as AdminDBInterface, u as AssignedCard, h as AssignedContent, t as AssignedCourse, s as AssignedTag, c as ClassroomDBInterface, E as ClassroomRegistration, B as ClassroomRegistrationDesignation, F as ClassroomRegistrationDoc, p as ContentSourceID, C as CourseDBInterface, d as CourseInfo, J as CourseRegistration, b as CoursesDBInterface, K as DocumentUpdater, g as ScheduledCard, G as SessionTrackingData, j as StudentClassroomDBInterface, l as StudySessionFailedItem, m as StudySessionFailedNewItem, n as StudySessionFailedReviewItem, S as StudySessionNewItem, f as StudySessionReviewItem, T as TeacherClassroomDBInterface, H as UserConfig, y as UserCourseSetting, x as UserCourseSettings, w as UserDBAuthenticator, a as UserDBReader, v as UserDBWriter, z as UsrCrsDataInterface, q as getStudySource, o as isReview, L as newInterval } from './userDB-DNa0XPtn.js';
3
- import { D as DataLayerProvider } from './dataLayerProvider-BV5iZqt_.js';
1
+ import { U as UserDBInterface, s as CourseRegistrationDoc, l as StudySessionItem, i as StudyContentSource, S as StudySessionNewItem, f as StudySessionReviewItem, g as ScheduledCard, W as WeightedCard } from './classroomDB-BgfrVb8d.js';
2
+ export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, h as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, k as ContentNavigator, q as ContentSourceID, C as CourseDBInterface, d as CourseInfo, K as CourseRegistration, b as CoursesDBInterface, V as DocumentUpdater, O as NavigatorRole, P as NavigatorRoles, N as Navigators, H as SessionTrackingData, L as StrategyContribution, j as StudentClassroomDBInterface, m as StudySessionFailedItem, n as StudySessionFailedNewItem, o as StudySessionFailedReviewItem, T as TeacherClassroomDBInterface, I as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, M as getCardOrigin, r as getStudySource, R as isFilter, Q as isGenerator, p as isReview, X as newInterval } from './classroomDB-BgfrVb8d.js';
3
+ import { D as DataLayerProvider } from './dataLayerProvider-CZxC9GtB.js';
4
4
  import { C as CardHistory, c as CardRecord } from './types-legacy-6ettoclI.js';
5
5
  export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, D as DocType, b as DocTypePrefixes, F as Field, G as GuestUsername, Q as QualifiedCardID, h as QuestionData, i as QuestionRecord, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from './types-legacy-6ettoclI.js';
6
6
  import { Loggable } from './core/index.js';
7
- export { BulkCardProcessorConfig, ContentNavigator, ImportResult, Navigators, areQuestionRecords, docIsDeleted, getCardHistoryID, importParsedCards, isQuestionRecord, parseCardHistoryID, validateProcessorConfig } from './core/index.js';
7
+ export { BulkCardProcessorConfig, CardFilter, CardFilterFactory, CardGenerator, CardGeneratorFactory, FilterContext, GeneratorContext, ImportResult, areQuestionRecords, docIsDeleted, getCardHistoryID, importParsedCards, isQuestionRecord, parseCardHistoryID, validateProcessorConfig } from './core/index.js';
8
+ import { TagFilter } from '@vue-skuilder/common';
8
9
  import { S as StaticCourseManifest } from './types-CewsN87z.js';
9
10
  export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-CewsN87z.js';
10
11
  import { F as FileSystemAdapter } from './index-CD8BZz2k.js';
11
12
  export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-CD8BZz2k.js';
12
- import '@vue-skuilder/common';
13
13
  import 'moment';
14
14
 
15
15
  /**
@@ -336,6 +336,10 @@ declare class SessionController<TView = unknown> extends Loggable {
336
336
  * Used by SessionControllerDebug component for runtime inspection.
337
337
  */
338
338
  getDebugInfo(): {
339
+ api: {
340
+ mode: string;
341
+ description: string;
342
+ };
339
343
  reviewQueue: {
340
344
  length: number;
341
345
  dequeueCount: number;
@@ -369,7 +373,29 @@ declare class SessionController<TView = unknown> extends Loggable {
369
373
  items: any[];
370
374
  };
371
375
  };
376
+ /**
377
+ * Fetch content using the new getWeightedCards API.
378
+ *
379
+ * This method uses getWeightedCards() to get scored candidates, then uses the
380
+ * scores to determine ordering. For reviews, we still need the full ScheduledCard
381
+ * data from getPendingReviews(), so we fetch both and use scores for ordering.
382
+ *
383
+ * The hybrid approach:
384
+ * 1. Fetch weighted cards to get scoring/ordering information
385
+ * 2. Fetch full review data via legacy getPendingReviews()
386
+ * 3. Order reviews by their weighted scores
387
+ * 4. Add new cards ordered by their weighted scores
388
+ */
389
+ private getWeightedContent;
390
+ /**
391
+ * @deprecated Use getWeightedContent() instead. This method is kept for backward
392
+ * compatibility with sources that don't support getWeightedCards().
393
+ */
372
394
  private getScheduledReviews;
395
+ /**
396
+ * @deprecated Use getWeightedContent() instead. This method is kept for backward
397
+ * compatibility with sources that don't support getWeightedCards().
398
+ */
373
399
  private getNewCards;
374
400
  private _selectNextItemToHydrate;
375
401
  nextCard(action?: SessionAction): Promise<HydratedCard<TView> | null>;
@@ -395,6 +421,64 @@ declare class SessionController<TView = unknown> extends Loggable {
395
421
  private removeItemFromQueue;
396
422
  }
397
423
 
424
+ /**
425
+ * A StudyContentSource that filters cards based on tag inclusion/exclusion.
426
+ *
427
+ * This enables ephemeral, tag-scoped study sessions where users can focus
428
+ * on specific topics within a course without permanent configuration.
429
+ *
430
+ * Filter logic:
431
+ * - If `include` is non-empty: card must have at least one of the included tags
432
+ * - If `exclude` is non-empty: card must not have any of the excluded tags
433
+ * - Both filters are applied (include first, then exclude)
434
+ */
435
+ declare class TagFilteredContentSource implements StudyContentSource {
436
+ private courseId;
437
+ private filter;
438
+ private user;
439
+ private resolvedCardIds;
440
+ constructor(courseId: string, filter: TagFilter, user: UserDBInterface);
441
+ /**
442
+ * Resolves the TagFilter to a set of eligible card IDs.
443
+ *
444
+ * - Cards in `include` tags are OR'd together (card needs at least one)
445
+ * - Cards in `exclude` tags are removed from the result
446
+ */
447
+ private resolveFilteredCardIds;
448
+ /**
449
+ * Gets new cards that match the tag filter and are not already active for the user.
450
+ */
451
+ getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
452
+ /**
453
+ * Gets pending reviews, filtered to only include cards that match the tag filter.
454
+ */
455
+ getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
456
+ /**
457
+ * Get cards with suitability scores for presentation.
458
+ *
459
+ * This implementation wraps the legacy getNewCards/getPendingReviews methods,
460
+ * assigning score=1.0 to all cards. TagFilteredContentSource does not currently
461
+ * support pluggable navigation strategies - it returns flat-scored candidates.
462
+ *
463
+ * @param limit - Maximum number of cards to return
464
+ * @returns Cards sorted by score descending (all scores = 1.0)
465
+ */
466
+ getWeightedCards(limit: number): Promise<WeightedCard[]>;
467
+ /**
468
+ * Clears the cached resolved card IDs.
469
+ * Call this if the underlying tag data may have changed during a session.
470
+ */
471
+ clearCache(): void;
472
+ /**
473
+ * Returns the course ID this source is filtering.
474
+ */
475
+ getCourseId(): string;
476
+ /**
477
+ * Returns the active tag filter.
478
+ */
479
+ getFilter(): TagFilter;
480
+ }
481
+
398
482
  interface CourseLookupDoc {
399
483
  _id: string;
400
484
  _rev: string;
@@ -493,4 +577,4 @@ interface CouchDbUserDoc extends PouchDB.Authentication.User {
493
577
  entitlements: UserEntitlements;
494
578
  }
495
579
 
496
- export { type AggregatedDocument, type AttachmentUploadResult, CardHistory, CardRecord, type CouchDbUserDoc, CourseLookup, CourseRegistrationDoc, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, Loggable, type MigrationOptions, type MigrationResult, NOT_SET, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, type StudySessionRecord, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, _resetDataLayer, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, getLogFilePath, initializeDataDirectory, initializeDataLayer, initializeTuiLogging, logger, showUserError, showUserMessage, validateMigration, validateStaticCourse };
580
+ export { type AggregatedDocument, type AttachmentUploadResult, CardHistory, CardRecord, type CouchDbUserDoc, CourseLookup, CourseRegistrationDoc, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, Loggable, type MigrationOptions, type MigrationResult, NOT_SET, type ResponseResult, type RestoreProgress, ScheduledCard, type SessionAction, SessionController, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StudyContentSource, StudySessionItem, StudySessionNewItem, type StudySessionRecord, StudySessionReviewItem, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, ensureAppDataDirectory, getAppDataDirectory, getDataLayer, getDbPath, getLogFilePath, initializeDataDirectory, initializeDataLayer, initializeTuiLogging, logger, showUserError, showUserMessage, validateMigration, validateStaticCourse };