@vue-skuilder/db 0.1.31-b → 0.1.31
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/{contentSource-ygoFw9oV.d.ts → contentSource-Bdwkvqa8.d.ts} +16 -0
- package/dist/{contentSource-B7nXusjk.d.cts → contentSource-DF1nUbPQ.d.cts} +16 -0
- package/dist/core/index.d.cts +34 -3
- package/dist/core/index.d.ts +34 -3
- package/dist/core/index.js +510 -50
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +510 -50
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-BW7HvkMt.d.cts → dataLayerProvider-BKmVoyJR.d.ts} +20 -1
- package/dist/{dataLayerProvider-BfXUVDuG.d.ts → dataLayerProvider-BQdfJuBN.d.cts} +20 -1
- package/dist/impl/couch/index.d.cts +156 -4
- package/dist/impl/couch/index.d.ts +156 -4
- package/dist/impl/couch/index.js +730 -41
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +729 -41
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +3 -2
- package/dist/impl/static/index.d.ts +3 -2
- package/dist/impl/static/index.js +467 -31
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +467 -31
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +64 -3
- package/dist/index.d.ts +64 -3
- package/dist/index.js +948 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +948 -72
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/interfaces/contentSource.ts +6 -0
- package/src/core/interfaces/courseDB.ts +6 -0
- package/src/core/interfaces/dataLayerProvider.ts +20 -0
- package/src/core/navigators/Pipeline.ts +414 -9
- package/src/core/navigators/PipelineAssembler.ts +23 -18
- package/src/core/navigators/PipelineDebugger.ts +35 -1
- package/src/core/navigators/filters/hierarchyDefinition.ts +78 -8
- package/src/core/navigators/generators/prescribed.ts +95 -0
- package/src/core/navigators/index.ts +12 -0
- package/src/impl/common/BaseUserDB.ts +4 -1
- package/src/impl/couch/CourseSyncService.ts +356 -0
- package/src/impl/couch/PouchDataLayerProvider.ts +21 -1
- package/src/impl/couch/courseDB.ts +60 -13
- package/src/impl/couch/index.ts +1 -0
- package/src/impl/static/courseDB.ts +5 -0
- package/src/study/ItemQueue.ts +42 -0
- package/src/study/SessionController.ts +195 -22
- package/src/study/SpacedRepetition.ts +3 -1
- package/tests/core/navigators/Pipeline.test.ts +1 -1
- package/tests/core/navigators/PipelineAssembler.test.ts +15 -14
|
@@ -240,6 +240,11 @@ interface CourseDBInterface extends NavigationStrategyManager, StudyContentSourc
|
|
|
240
240
|
* @returns Map from cardId to array of tag names
|
|
241
241
|
*/
|
|
242
242
|
getAppliedTagsBatch(cardIds: string[]): Promise<Map<string, string[]>>;
|
|
243
|
+
/**
|
|
244
|
+
* Get all card IDs in the course.
|
|
245
|
+
* Used by diagnostics to scan the full card space.
|
|
246
|
+
*/
|
|
247
|
+
getAllCardIds(): Promise<string[]>;
|
|
243
248
|
/**
|
|
244
249
|
* Add a tag to a card
|
|
245
250
|
*/
|
|
@@ -908,6 +913,7 @@ declare function getCardOrigin(card: WeightedCard): 'new' | 'review' | 'failed';
|
|
|
908
913
|
declare enum Navigators {
|
|
909
914
|
ELO = "elo",
|
|
910
915
|
SRS = "srs",
|
|
916
|
+
PRESCRIBED = "prescribed",
|
|
911
917
|
HIERARCHY = "hierarchyDefinition",
|
|
912
918
|
INTERFERENCE = "interferenceMitigator",
|
|
913
919
|
RELATIVE_PRIORITY = "relativePriority",
|
|
@@ -1038,6 +1044,11 @@ declare abstract class ContentNavigator implements StudyContentSource {
|
|
|
1038
1044
|
* @returns Cards sorted by score descending, with provenance trails
|
|
1039
1045
|
*/
|
|
1040
1046
|
getWeightedCards(_limit: number): Promise<WeightedCard[]>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Set ephemeral hints for the next pipeline run.
|
|
1049
|
+
* No-op for non-Pipeline navigators. Pipeline overrides this.
|
|
1050
|
+
*/
|
|
1051
|
+
setEphemeralHints(_hints: Record<string, unknown>): void;
|
|
1041
1052
|
}
|
|
1042
1053
|
|
|
1043
1054
|
type StudySessionFailedItem = StudySessionFailedNewItem | StudySessionFailedReviewItem;
|
|
@@ -1096,6 +1107,11 @@ interface StudyContentSource {
|
|
|
1096
1107
|
* Used for recording learning outcomes.
|
|
1097
1108
|
*/
|
|
1098
1109
|
getOrchestrationContext?(): Promise<OrchestrationContext>;
|
|
1110
|
+
/**
|
|
1111
|
+
* Set ephemeral hints for the next pipeline run.
|
|
1112
|
+
* No-op for sources that don't support hints.
|
|
1113
|
+
*/
|
|
1114
|
+
setEphemeralHints?(hints: Record<string, unknown>): void;
|
|
1099
1115
|
}
|
|
1100
1116
|
declare function getStudySource(source: ContentSourceID, user: UserDBInterface): Promise<StudyContentSource>;
|
|
1101
1117
|
|
|
@@ -240,6 +240,11 @@ interface CourseDBInterface extends NavigationStrategyManager, StudyContentSourc
|
|
|
240
240
|
* @returns Map from cardId to array of tag names
|
|
241
241
|
*/
|
|
242
242
|
getAppliedTagsBatch(cardIds: string[]): Promise<Map<string, string[]>>;
|
|
243
|
+
/**
|
|
244
|
+
* Get all card IDs in the course.
|
|
245
|
+
* Used by diagnostics to scan the full card space.
|
|
246
|
+
*/
|
|
247
|
+
getAllCardIds(): Promise<string[]>;
|
|
243
248
|
/**
|
|
244
249
|
* Add a tag to a card
|
|
245
250
|
*/
|
|
@@ -908,6 +913,7 @@ declare function getCardOrigin(card: WeightedCard): 'new' | 'review' | 'failed';
|
|
|
908
913
|
declare enum Navigators {
|
|
909
914
|
ELO = "elo",
|
|
910
915
|
SRS = "srs",
|
|
916
|
+
PRESCRIBED = "prescribed",
|
|
911
917
|
HIERARCHY = "hierarchyDefinition",
|
|
912
918
|
INTERFERENCE = "interferenceMitigator",
|
|
913
919
|
RELATIVE_PRIORITY = "relativePriority",
|
|
@@ -1038,6 +1044,11 @@ declare abstract class ContentNavigator implements StudyContentSource {
|
|
|
1038
1044
|
* @returns Cards sorted by score descending, with provenance trails
|
|
1039
1045
|
*/
|
|
1040
1046
|
getWeightedCards(_limit: number): Promise<WeightedCard[]>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Set ephemeral hints for the next pipeline run.
|
|
1049
|
+
* No-op for non-Pipeline navigators. Pipeline overrides this.
|
|
1050
|
+
*/
|
|
1051
|
+
setEphemeralHints(_hints: Record<string, unknown>): void;
|
|
1041
1052
|
}
|
|
1042
1053
|
|
|
1043
1054
|
type StudySessionFailedItem = StudySessionFailedNewItem | StudySessionFailedReviewItem;
|
|
@@ -1096,6 +1107,11 @@ interface StudyContentSource {
|
|
|
1096
1107
|
* Used for recording learning outcomes.
|
|
1097
1108
|
*/
|
|
1098
1109
|
getOrchestrationContext?(): Promise<OrchestrationContext>;
|
|
1110
|
+
/**
|
|
1111
|
+
* Set ephemeral hints for the next pipeline run.
|
|
1112
|
+
* No-op for sources that don't support hints.
|
|
1113
|
+
*/
|
|
1114
|
+
setEphemeralHints?(hints: Record<string, unknown>): void;
|
|
1099
1115
|
}
|
|
1100
1116
|
declare function getStudySource(source: ContentSourceID, user: UserDBInterface): Promise<StudyContentSource>;
|
|
1101
1117
|
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a2 as LearnableWeight, L as UserOutcomeRecord, a3 as OrchestrationContext, W as WeightedCard, U as UserDBInterface, C as CourseDBInterface, X as StrategyContribution } from '../contentSource-
|
|
2
|
-
export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, K as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, N as NavigatorConstructor, _ as NavigatorRole, $ as NavigatorRoles, Z as Navigators, j as ScheduledCard, H as SessionTrackingData, i as StudentClassroomDBInterface, h as StudyContentSource, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, S as StudySessionItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, I as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, a4 as computeDeviation, a6 as computeEffectiveWeight, a5 as computeSpread, a7 as createOrchestrationContext, Y as getCardOrigin, O as getRegisteredNavigator, R as getRegisteredNavigatorNames, Q as getRegisteredNavigatorRole, r as getStudySource, P as hasRegisteredNavigator, V as initializeNavigatorRegistry, a1 as isFilter, a0 as isGenerator, p as isReview, M as registerNavigator } from '../contentSource-
|
|
3
|
-
export { D as DataLayerProvider } from '../dataLayerProvider-
|
|
1
|
+
import { a2 as LearnableWeight, L as UserOutcomeRecord, a3 as OrchestrationContext, W as WeightedCard, U as UserDBInterface, C as CourseDBInterface, X as StrategyContribution } from '../contentSource-DF1nUbPQ.cjs';
|
|
2
|
+
export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, K as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, N as NavigatorConstructor, _ as NavigatorRole, $ as NavigatorRoles, Z as Navigators, j as ScheduledCard, H as SessionTrackingData, i as StudentClassroomDBInterface, h as StudyContentSource, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, S as StudySessionItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, I as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, a4 as computeDeviation, a6 as computeEffectiveWeight, a5 as computeSpread, a7 as createOrchestrationContext, Y as getCardOrigin, O as getRegisteredNavigator, R as getRegisteredNavigatorNames, Q as getRegisteredNavigatorRole, r as getStudySource, P as hasRegisteredNavigator, V as initializeNavigatorRegistry, a1 as isFilter, a0 as isGenerator, p as isReview, M as registerNavigator } from '../contentSource-DF1nUbPQ.cjs';
|
|
3
|
+
export { D as DataLayerProvider } from '../dataLayerProvider-BQdfJuBN.cjs';
|
|
4
4
|
import { D as DocType, i as QuestionRecord, b as DocTypePrefixes, C as CardHistory, c as CardRecord } from '../types-legacy-JXDxinpU.cjs';
|
|
5
5
|
export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, F as Field, G as GuestUsername, Q as QualifiedCardID, h as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from '../types-legacy-JXDxinpU.cjs';
|
|
6
6
|
import { DataShape, ParsedCard } from '@vue-skuilder/common';
|
|
@@ -383,6 +383,27 @@ interface CardGenerator {
|
|
|
383
383
|
*/
|
|
384
384
|
type CardGeneratorFactory<TConfig = unknown> = (config: TConfig) => CardGenerator;
|
|
385
385
|
|
|
386
|
+
/**
|
|
387
|
+
* Diagnosis of the full card space for the current user.
|
|
388
|
+
*/
|
|
389
|
+
interface CardSpaceDiagnosis {
|
|
390
|
+
totalCards: number;
|
|
391
|
+
threshold: number;
|
|
392
|
+
wellIndicated: number;
|
|
393
|
+
encountered: number;
|
|
394
|
+
wellIndicatedNew: number;
|
|
395
|
+
byType: Record<string, {
|
|
396
|
+
total: number;
|
|
397
|
+
wellIndicated: number;
|
|
398
|
+
new: number;
|
|
399
|
+
}>;
|
|
400
|
+
filterBreakdown: Array<{
|
|
401
|
+
name: string;
|
|
402
|
+
wellIndicated: number;
|
|
403
|
+
}>;
|
|
404
|
+
elapsedMs: number;
|
|
405
|
+
}
|
|
406
|
+
|
|
386
407
|
/**
|
|
387
408
|
* Summary of a single generator's contribution.
|
|
388
409
|
*/
|
|
@@ -424,6 +445,7 @@ interface PipelineRunReport {
|
|
|
424
445
|
origin: 'new' | 'review' | 'unknown';
|
|
425
446
|
finalScore: number;
|
|
426
447
|
provenance: StrategyContribution[];
|
|
448
|
+
tags?: string[];
|
|
427
449
|
selected: boolean;
|
|
428
450
|
}>;
|
|
429
451
|
}
|
|
@@ -477,6 +499,15 @@ declare const pipelineDebugAPI: {
|
|
|
477
499
|
* If no runs are captured yet, falls back to showing just the registry.
|
|
478
500
|
*/
|
|
479
501
|
showStrategies(): void;
|
|
502
|
+
/**
|
|
503
|
+
* Scan the full card space through the filter chain for the current user.
|
|
504
|
+
*
|
|
505
|
+
* Reports how many cards are well-indicated and how many are new.
|
|
506
|
+
* Use this to understand how the search space grows during onboarding.
|
|
507
|
+
*
|
|
508
|
+
* @param threshold - Score threshold for "well indicated" (default 0.10)
|
|
509
|
+
*/
|
|
510
|
+
diagnoseCardSpace(threshold?: number): Promise<CardSpaceDiagnosis | null>;
|
|
480
511
|
/**
|
|
481
512
|
* Show help.
|
|
482
513
|
*/
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a2 as LearnableWeight, L as UserOutcomeRecord, a3 as OrchestrationContext, W as WeightedCard, U as UserDBInterface, C as CourseDBInterface, X as StrategyContribution } from '../contentSource-
|
|
2
|
-
export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, K as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, N as NavigatorConstructor, _ as NavigatorRole, $ as NavigatorRoles, Z as Navigators, j as ScheduledCard, H as SessionTrackingData, i as StudentClassroomDBInterface, h as StudyContentSource, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, S as StudySessionItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, I as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, a4 as computeDeviation, a6 as computeEffectiveWeight, a5 as computeSpread, a7 as createOrchestrationContext, Y as getCardOrigin, O as getRegisteredNavigator, R as getRegisteredNavigatorNames, Q as getRegisteredNavigatorRole, r as getStudySource, P as hasRegisteredNavigator, V as initializeNavigatorRegistry, a1 as isFilter, a0 as isGenerator, p as isReview, M as registerNavigator } from '../contentSource-
|
|
3
|
-
export { D as DataLayerProvider } from '../dataLayerProvider-
|
|
1
|
+
import { a2 as LearnableWeight, L as UserOutcomeRecord, a3 as OrchestrationContext, W as WeightedCard, U as UserDBInterface, C as CourseDBInterface, X as StrategyContribution } from '../contentSource-Bdwkvqa8.js';
|
|
2
|
+
export { J as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, G as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, K as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, N as NavigatorConstructor, _ as NavigatorRole, $ as NavigatorRoles, Z as Navigators, j as ScheduledCard, H as SessionTrackingData, i as StudentClassroomDBInterface, h as StudyContentSource, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, S as StudySessionItem, n as StudySessionNewItem, o as StudySessionReviewItem, T as TeacherClassroomDBInterface, I as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, a4 as computeDeviation, a6 as computeEffectiveWeight, a5 as computeSpread, a7 as createOrchestrationContext, Y as getCardOrigin, O as getRegisteredNavigator, R as getRegisteredNavigatorNames, Q as getRegisteredNavigatorRole, r as getStudySource, P as hasRegisteredNavigator, V as initializeNavigatorRegistry, a1 as isFilter, a0 as isGenerator, p as isReview, M as registerNavigator } from '../contentSource-Bdwkvqa8.js';
|
|
3
|
+
export { D as DataLayerProvider } from '../dataLayerProvider-BKmVoyJR.js';
|
|
4
4
|
import { D as DocType, i as QuestionRecord, b as DocTypePrefixes, C as CardHistory, c as CardRecord } from '../types-legacy-JXDxinpU.js';
|
|
5
5
|
export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, F as Field, G as GuestUsername, Q as QualifiedCardID, h as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from '../types-legacy-JXDxinpU.js';
|
|
6
6
|
import { DataShape, ParsedCard } from '@vue-skuilder/common';
|
|
@@ -383,6 +383,27 @@ interface CardGenerator {
|
|
|
383
383
|
*/
|
|
384
384
|
type CardGeneratorFactory<TConfig = unknown> = (config: TConfig) => CardGenerator;
|
|
385
385
|
|
|
386
|
+
/**
|
|
387
|
+
* Diagnosis of the full card space for the current user.
|
|
388
|
+
*/
|
|
389
|
+
interface CardSpaceDiagnosis {
|
|
390
|
+
totalCards: number;
|
|
391
|
+
threshold: number;
|
|
392
|
+
wellIndicated: number;
|
|
393
|
+
encountered: number;
|
|
394
|
+
wellIndicatedNew: number;
|
|
395
|
+
byType: Record<string, {
|
|
396
|
+
total: number;
|
|
397
|
+
wellIndicated: number;
|
|
398
|
+
new: number;
|
|
399
|
+
}>;
|
|
400
|
+
filterBreakdown: Array<{
|
|
401
|
+
name: string;
|
|
402
|
+
wellIndicated: number;
|
|
403
|
+
}>;
|
|
404
|
+
elapsedMs: number;
|
|
405
|
+
}
|
|
406
|
+
|
|
386
407
|
/**
|
|
387
408
|
* Summary of a single generator's contribution.
|
|
388
409
|
*/
|
|
@@ -424,6 +445,7 @@ interface PipelineRunReport {
|
|
|
424
445
|
origin: 'new' | 'review' | 'unknown';
|
|
425
446
|
finalScore: number;
|
|
426
447
|
provenance: StrategyContribution[];
|
|
448
|
+
tags?: string[];
|
|
427
449
|
selected: boolean;
|
|
428
450
|
}>;
|
|
429
451
|
}
|
|
@@ -477,6 +499,15 @@ declare const pipelineDebugAPI: {
|
|
|
477
499
|
* If no runs are captured yet, falls back to showing just the registry.
|
|
478
500
|
*/
|
|
479
501
|
showStrategies(): void;
|
|
502
|
+
/**
|
|
503
|
+
* Scan the full card space through the filter chain for the current user.
|
|
504
|
+
*
|
|
505
|
+
* Reports how many cards are well-indicated and how many are new.
|
|
506
|
+
* Use this to understand how the search space grows during onboarding.
|
|
507
|
+
*
|
|
508
|
+
* @param threshold - Score threshold for "well indicated" (default 0.10)
|
|
509
|
+
*/
|
|
510
|
+
diagnoseCardSpace(threshold?: number): Promise<CardSpaceDiagnosis | null>;
|
|
480
511
|
/**
|
|
481
512
|
* Show help.
|
|
482
513
|
*/
|