@vue-skuilder/db 0.1.17 → 0.1.20
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/{userDB-BqwxtJ_7.d.mts → classroomDB-CZdMBiTU.d.ts} +427 -104
- package/dist/{userDB-DNa0XPtn.d.ts → classroomDB-PxDZTky3.d.cts} +427 -104
- package/dist/core/index.d.cts +304 -0
- package/dist/core/index.d.ts +237 -25
- package/dist/core/index.js +2246 -118
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +2235 -114
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-VlngD19_.d.mts → dataLayerProvider-D0MoZMjH.d.cts} +1 -1
- package/dist/{dataLayerProvider-BV5iZqt_.d.ts → dataLayerProvider-D8o6ZnKW.d.ts} +1 -1
- package/dist/impl/couch/{index.d.mts → index.d.cts} +47 -5
- package/dist/impl/couch/index.d.ts +46 -4
- package/dist/impl/couch/index.js +2250 -134
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +2212 -97
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/{index.d.mts → index.d.cts} +6 -6
- package/dist/impl/static/index.d.ts +5 -5
- package/dist/impl/static/index.js +1950 -143
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +1922 -117
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-Bmll7Xse.d.mts → index-B_j6u5E4.d.cts} +1 -1
- package/dist/{index-CD8BZz2k.d.ts → index-Dj0SEgk3.d.ts} +1 -1
- package/dist/{index.d.mts → index.d.cts} +97 -13
- package/dist/index.d.ts +96 -12
- package/dist/index.js +2439 -180
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2386 -135
- package/dist/index.mjs.map +1 -1
- package/dist/pouch/index.js +3 -3
- package/dist/{types-Dbp5DaRR.d.mts → types-Bn0itutr.d.cts} +1 -1
- package/dist/{types-CewsN87z.d.ts → types-DQaXnuoc.d.ts} +1 -1
- package/dist/{types-legacy-6ettoclI.d.ts → types-legacy-DDY4N-Uq.d.cts} +3 -1
- package/dist/{types-legacy-6ettoclI.d.mts → types-legacy-DDY4N-Uq.d.ts} +3 -1
- package/dist/util/packer/{index.d.mts → index.d.cts} +3 -3
- package/dist/util/packer/index.d.ts +3 -3
- package/dist/util/packer/index.js.map +1 -1
- package/dist/util/packer/index.mjs.map +1 -1
- package/docs/brainstorm-navigation-paradigm.md +369 -0
- package/docs/navigators-architecture.md +370 -0
- package/docs/todo-evolutionary-orchestration.md +310 -0
- package/docs/todo-nominal-tag-types.md +121 -0
- package/docs/todo-strategy-authoring.md +401 -0
- package/eslint.config.mjs +1 -1
- package/package.json +9 -4
- package/src/core/index.ts +1 -0
- package/src/core/interfaces/contentSource.ts +88 -4
- package/src/core/interfaces/courseDB.ts +13 -0
- package/src/core/interfaces/navigationStrategyManager.ts +0 -5
- package/src/core/interfaces/userDB.ts +32 -0
- package/src/core/navigators/CompositeGenerator.ts +268 -0
- package/src/core/navigators/Pipeline.ts +318 -0
- package/src/core/navigators/PipelineAssembler.ts +194 -0
- package/src/core/navigators/elo.ts +104 -15
- package/src/core/navigators/filters/eloDistance.ts +132 -0
- package/src/core/navigators/filters/index.ts +9 -0
- package/src/core/navigators/filters/types.ts +115 -0
- package/src/core/navigators/filters/userTagPreference.ts +232 -0
- package/src/core/navigators/generators/index.ts +2 -0
- package/src/core/navigators/generators/types.ts +107 -0
- package/src/core/navigators/hardcodedOrder.ts +111 -12
- package/src/core/navigators/hierarchyDefinition.ts +266 -0
- package/src/core/navigators/index.ts +404 -3
- package/src/core/navigators/inferredPreference.ts +107 -0
- package/src/core/navigators/interferenceMitigator.ts +355 -0
- package/src/core/navigators/relativePriority.ts +255 -0
- package/src/core/navigators/srs.ts +195 -0
- package/src/core/navigators/userGoal.ts +136 -0
- package/src/core/types/strategyState.ts +84 -0
- package/src/core/types/types-legacy.ts +2 -0
- package/src/impl/common/BaseUserDB.ts +74 -7
- package/src/impl/couch/adminDB.ts +1 -2
- package/src/impl/couch/classroomDB.ts +51 -0
- package/src/impl/couch/courseDB.ts +147 -49
- package/src/impl/static/courseDB.ts +11 -4
- package/src/study/SessionController.ts +149 -1
- package/src/study/TagFilteredContentSource.ts +255 -0
- package/src/study/index.ts +1 -0
- package/src/util/dataDirectory.test.ts +51 -22
- package/src/util/logger.ts +0 -1
- package/tests/core/navigators/CompositeGenerator.test.ts +455 -0
- package/tests/core/navigators/Pipeline.test.ts +406 -0
- package/tests/core/navigators/PipelineAssembler.test.ts +351 -0
- package/tests/core/navigators/SRSNavigator.test.ts +344 -0
- package/tests/core/navigators/eloDistanceFilter.test.ts +192 -0
- package/tests/core/navigators/navigators.test.ts +710 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +29 -0
- package/dist/core/index.d.mts +0 -92
- /package/dist/{SyncStrategy-CyATpyLQ.d.mts → SyncStrategy-CyATpyLQ.d.cts} +0 -0
- /package/dist/pouch/{index.d.mts → index.d.cts} +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 './
|
|
1
|
+
import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './classroomDB-PxDZTky3.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 './
|
|
1
|
+
import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './classroomDB-CZdMBiTU.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Main factory interface for data access
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-
|
|
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, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, k as StudySessionItem } from '../../
|
|
4
|
-
export {
|
|
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';
|
|
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
|
-
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.
|
|
7
|
+
import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.cjs';
|
|
8
8
|
|
|
9
9
|
type NamespacedDatashape = string;
|
|
10
10
|
interface DataShape55 {
|
|
@@ -88,6 +88,17 @@ declare class StudentClassroomDB extends ClassroomDBBase implements StudyContent
|
|
|
88
88
|
setChangeFcn(f: (value: unknown) => object): void;
|
|
89
89
|
getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
|
|
90
90
|
getNewCards(): Promise<StudySessionNewItem[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Get cards with suitability scores for presentation.
|
|
93
|
+
*
|
|
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.
|
|
97
|
+
*
|
|
98
|
+
* @param limit - Maximum number of cards to return
|
|
99
|
+
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
100
|
+
*/
|
|
101
|
+
getWeightedCards(limit: number): Promise<WeightedCard[]>;
|
|
91
102
|
}
|
|
92
103
|
/**
|
|
93
104
|
* Interface for managing a classroom.
|
|
@@ -180,6 +191,7 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
|
|
|
180
191
|
updateCourseConfig(cfg: CourseConfig$1): Promise<PouchDB.Core.Response>;
|
|
181
192
|
updateCardElo(cardId: string, elo: CourseElo): Promise<PouchDB.Core.Response>;
|
|
182
193
|
getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
|
|
194
|
+
getAppliedTagsBatch(cardIds: string[]): Promise<Map<string, string[]>>;
|
|
183
195
|
addTagToCard(cardId: string, tagId: string, updateELO?: boolean): Promise<PouchDB.Core.Response>;
|
|
184
196
|
removeTagFromCard(cardId: string, tagId: string): Promise<PouchDB.Core.Response>;
|
|
185
197
|
createTag(name: string, author: string): Promise<PouchDB.Core.Response>;
|
|
@@ -195,9 +207,39 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
|
|
|
195
207
|
getAllNavigationStrategies(): Promise<ContentNavigationStrategyData[]>;
|
|
196
208
|
addNavigationStrategy(data: ContentNavigationStrategyData): Promise<void>;
|
|
197
209
|
updateNavigationStrategy(id: string, data: ContentNavigationStrategyData): Promise<void>;
|
|
198
|
-
|
|
210
|
+
/**
|
|
211
|
+
* Creates an instantiated navigator for this course.
|
|
212
|
+
*
|
|
213
|
+
* Handles multiple generators by wrapping them in CompositeGenerator.
|
|
214
|
+
* This is the preferred method for getting a ready-to-use navigator.
|
|
215
|
+
*
|
|
216
|
+
* @param user - User database interface
|
|
217
|
+
* @returns Instantiated ContentNavigator ready for use
|
|
218
|
+
*/
|
|
219
|
+
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;
|
|
199
231
|
getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
|
|
200
232
|
getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
|
|
233
|
+
/**
|
|
234
|
+
* Get cards with suitability scores for presentation.
|
|
235
|
+
*
|
|
236
|
+
* This is the PRIMARY API for content sources going forward. Delegates to the
|
|
237
|
+
* course's configured NavigationStrategy to get scored candidates.
|
|
238
|
+
*
|
|
239
|
+
* @param limit - Maximum number of cards to return
|
|
240
|
+
* @returns Cards sorted by score descending
|
|
241
|
+
*/
|
|
242
|
+
getWeightedCards(limit: number): Promise<WeightedCard[]>;
|
|
201
243
|
getCardsCenteredAtELO(options?: {
|
|
202
244
|
limit: number;
|
|
203
245
|
elo: 'user' | 'random' | number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-
|
|
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, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, k as StudySessionItem } from '../../
|
|
4
|
-
export {
|
|
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';
|
|
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';
|
|
@@ -88,6 +88,17 @@ declare class StudentClassroomDB extends ClassroomDBBase implements StudyContent
|
|
|
88
88
|
setChangeFcn(f: (value: unknown) => object): void;
|
|
89
89
|
getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
|
|
90
90
|
getNewCards(): Promise<StudySessionNewItem[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Get cards with suitability scores for presentation.
|
|
93
|
+
*
|
|
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.
|
|
97
|
+
*
|
|
98
|
+
* @param limit - Maximum number of cards to return
|
|
99
|
+
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
100
|
+
*/
|
|
101
|
+
getWeightedCards(limit: number): Promise<WeightedCard[]>;
|
|
91
102
|
}
|
|
92
103
|
/**
|
|
93
104
|
* Interface for managing a classroom.
|
|
@@ -180,6 +191,7 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
|
|
|
180
191
|
updateCourseConfig(cfg: CourseConfig$1): Promise<PouchDB.Core.Response>;
|
|
181
192
|
updateCardElo(cardId: string, elo: CourseElo): Promise<PouchDB.Core.Response>;
|
|
182
193
|
getAppliedTags(cardId: string): Promise<PouchDB.Query.Response<TagStub>>;
|
|
194
|
+
getAppliedTagsBatch(cardIds: string[]): Promise<Map<string, string[]>>;
|
|
183
195
|
addTagToCard(cardId: string, tagId: string, updateELO?: boolean): Promise<PouchDB.Core.Response>;
|
|
184
196
|
removeTagFromCard(cardId: string, tagId: string): Promise<PouchDB.Core.Response>;
|
|
185
197
|
createTag(name: string, author: string): Promise<PouchDB.Core.Response>;
|
|
@@ -195,9 +207,39 @@ declare class CourseDB implements StudyContentSource, CourseDBInterface {
|
|
|
195
207
|
getAllNavigationStrategies(): Promise<ContentNavigationStrategyData[]>;
|
|
196
208
|
addNavigationStrategy(data: ContentNavigationStrategyData): Promise<void>;
|
|
197
209
|
updateNavigationStrategy(id: string, data: ContentNavigationStrategyData): Promise<void>;
|
|
198
|
-
|
|
210
|
+
/**
|
|
211
|
+
* Creates an instantiated navigator for this course.
|
|
212
|
+
*
|
|
213
|
+
* Handles multiple generators by wrapping them in CompositeGenerator.
|
|
214
|
+
* This is the preferred method for getting a ready-to-use navigator.
|
|
215
|
+
*
|
|
216
|
+
* @param user - User database interface
|
|
217
|
+
* @returns Instantiated ContentNavigator ready for use
|
|
218
|
+
*/
|
|
219
|
+
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;
|
|
199
231
|
getNewCards(limit?: number): Promise<StudySessionNewItem[]>;
|
|
200
232
|
getPendingReviews(): Promise<(StudySessionReviewItem & ScheduledCard)[]>;
|
|
233
|
+
/**
|
|
234
|
+
* Get cards with suitability scores for presentation.
|
|
235
|
+
*
|
|
236
|
+
* This is the PRIMARY API for content sources going forward. Delegates to the
|
|
237
|
+
* course's configured NavigationStrategy to get scored candidates.
|
|
238
|
+
*
|
|
239
|
+
* @param limit - Maximum number of cards to return
|
|
240
|
+
* @returns Cards sorted by score descending
|
|
241
|
+
*/
|
|
242
|
+
getWeightedCards(limit: number): Promise<WeightedCard[]>;
|
|
201
243
|
getCardsCenteredAtELO(options?: {
|
|
202
244
|
limit: number;
|
|
203
245
|
elo: 'user' | 'random' | number;
|