@vue-skuilder/db 0.1.32-c → 0.1.32-e
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/{dataLayerProvider-BAn-LRh5.d.ts → contentSource-BMlMwSiG.d.cts} +202 -626
- package/dist/{dataLayerProvider-BJqBlMIl.d.cts → contentSource-Ht3N2f-y.d.ts} +202 -626
- package/dist/core/index.d.cts +23 -84
- package/dist/core/index.d.ts +23 -84
- package/dist/core/index.js +476 -1819
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +456 -1803
- package/dist/core/index.mjs.map +1 -1
- package/dist/dataLayerProvider-BEqB8VBR.d.cts +67 -0
- package/dist/dataLayerProvider-DObSXjnf.d.ts +67 -0
- package/dist/impl/couch/index.d.cts +5 -5
- package/dist/impl/couch/index.d.ts +5 -5
- package/dist/impl/couch/index.js +484 -1827
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +460 -1807
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +5 -4
- package/dist/impl/static/index.d.ts +5 -4
- package/dist/impl/static/index.js +458 -1801
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +437 -1784
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-X6wHrURm.d.ts → index-BWvO-_rJ.d.ts} +1 -1
- package/dist/{index-m8MMGxxR.d.cts → index-Ba7hYbHj.d.cts} +1 -1
- package/dist/index.d.cts +461 -11
- package/dist/index.d.ts +461 -11
- package/dist/index.js +9239 -9159
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9129 -9049
- package/dist/index.mjs.map +1 -1
- package/dist/{types-DZ5dUqbL.d.ts → types-CJrLM1Ew.d.ts} +1 -1
- package/dist/{types-ZL8tOPQZ.d.cts → types-W8n-B6HG.d.cts} +1 -1
- package/dist/{types-legacy-C7r0T4OV.d.cts → types-legacy-JXDxinpU.d.cts} +1 -1
- package/dist/{types-legacy-C7r0T4OV.d.ts → types-legacy-JXDxinpU.d.ts} +1 -1
- package/dist/util/packer/index.d.cts +3 -3
- package/dist/util/packer/index.d.ts +3 -3
- package/package.json +2 -2
- package/src/core/interfaces/contentSource.ts +2 -3
- package/src/core/navigators/Pipeline.ts +60 -6
- package/src/core/navigators/PipelineDebugger.ts +103 -0
- package/src/core/navigators/filters/hierarchyDefinition.ts +2 -1
- package/src/core/navigators/filters/interferenceMitigator.ts +2 -1
- package/src/core/navigators/filters/relativePriority.ts +2 -1
- package/src/core/navigators/filters/userTagPreference.ts +2 -1
- package/src/core/navigators/generators/CompositeGenerator.ts +58 -5
- package/src/core/navigators/generators/elo.ts +7 -7
- package/src/core/navigators/generators/prescribed.ts +124 -35
- package/src/core/navigators/generators/srs.ts +3 -4
- package/src/core/navigators/generators/types.ts +48 -2
- package/src/core/navigators/index.ts +3 -3
- package/src/impl/couch/classroomDB.ts +4 -3
- package/src/impl/couch/courseDB.ts +3 -3
- package/src/impl/static/courseDB.ts +3 -3
- package/src/study/SessionController.ts +5 -27
- package/src/study/TagFilteredContentSource.ts +4 -3
package/dist/core/index.d.cts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { K as ActivityRecord, A as AdminDBInterface,
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { a7 as LearnableWeight, M as UserOutcomeRecord, a8 as OrchestrationContext, W as WeightedCard, U as UserDBInterface, C as CourseDBInterface, Z as StrategyContribution } from '../contentSource-BMlMwSiG.cjs';
|
|
2
|
+
export { K as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, a4 as CardGenerator, a6 as CardGeneratorFactory, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, H as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, L as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, a5 as GeneratorContext, G as GeneratorResult, N as NavigatorConstructor, a0 as NavigatorRole, a1 as NavigatorRoles, $ as Navigators, R as ReplanHints, j as ScheduledCard, I 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, J as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, a9 as computeDeviation, ab as computeEffectiveWeight, aa as computeSpread, ac as createOrchestrationContext, _ as getCardOrigin, P as getRegisteredNavigator, X as getRegisteredNavigatorNames, V as getRegisteredNavigatorRole, r as getStudySource, Q as hasRegisteredNavigator, Y as initializeNavigatorRegistry, a3 as isFilter, a2 as isGenerator, p as isReview, O as registerNavigator } from '../contentSource-BMlMwSiG.cjs';
|
|
3
|
+
export { D as DataLayerProvider } from '../dataLayerProvider-BEqB8VBR.cjs';
|
|
4
|
+
import { D as DocType, i as QuestionRecord, b as DocTypePrefixes, C as CardHistory, c as CardRecord } from '../types-legacy-JXDxinpU.cjs';
|
|
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';
|
|
5
6
|
import { DataShape, ParsedCard } from '@vue-skuilder/common';
|
|
6
7
|
import 'moment';
|
|
7
8
|
|
|
9
|
+
declare abstract class Loggable {
|
|
10
|
+
protected abstract readonly _className: string;
|
|
11
|
+
protected log(...args: unknown[]): void;
|
|
12
|
+
protected error(...args: unknown[]): void;
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
/**
|
|
9
16
|
* Snapshot of the learning state for a strategy.
|
|
10
17
|
*
|
|
@@ -297,85 +304,6 @@ interface CardFilter {
|
|
|
297
304
|
*/
|
|
298
305
|
type CardFilterFactory<TConfig = unknown> = (config: TConfig) => CardFilter;
|
|
299
306
|
|
|
300
|
-
/**
|
|
301
|
-
* Context available to generators when producing candidates.
|
|
302
|
-
*
|
|
303
|
-
* Built once per getWeightedCards() call by the Pipeline.
|
|
304
|
-
*/
|
|
305
|
-
interface GeneratorContext {
|
|
306
|
-
/** User database interface */
|
|
307
|
-
user: UserDBInterface;
|
|
308
|
-
/** Course database interface */
|
|
309
|
-
course: CourseDBInterface;
|
|
310
|
-
/** User's global ELO score for this course */
|
|
311
|
-
userElo: number;
|
|
312
|
-
/** Orchestration context for evolutionary weighting */
|
|
313
|
-
orchestration?: OrchestrationContext;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* A generator that produces candidate cards with initial scores.
|
|
317
|
-
*
|
|
318
|
-
* Generators are the "source" stage of a navigation pipeline.
|
|
319
|
-
* They query the database for eligible cards and assign initial
|
|
320
|
-
* suitability scores based on their strategy (ELO proximity,
|
|
321
|
-
* review urgency, fixed order, etc.).
|
|
322
|
-
*
|
|
323
|
-
* ## Implementation Guidelines
|
|
324
|
-
*
|
|
325
|
-
* 1. **Create provenance**: Each card should have a provenance entry
|
|
326
|
-
* with action='generated' documenting why it was selected.
|
|
327
|
-
*
|
|
328
|
-
* 2. **Score semantics**: Higher scores = more suitable for presentation.
|
|
329
|
-
* Scores should be in [0, 1] range for composability.
|
|
330
|
-
*
|
|
331
|
-
* 3. **Limit handling**: Respect the limit parameter, but may over-fetch
|
|
332
|
-
* internally if needed for scoring accuracy.
|
|
333
|
-
*
|
|
334
|
-
* 4. **Sort before returning**: Return cards sorted by score descending.
|
|
335
|
-
*
|
|
336
|
-
* ## Example Implementation
|
|
337
|
-
*
|
|
338
|
-
* ```typescript
|
|
339
|
-
* const myGenerator: CardGenerator = {
|
|
340
|
-
* name: 'My Generator',
|
|
341
|
-
* async getWeightedCards(limit, context) {
|
|
342
|
-
* const candidates = await fetchCandidates(context.course, limit);
|
|
343
|
-
* return candidates.map(c => ({
|
|
344
|
-
* cardId: c.id,
|
|
345
|
-
* courseId: context.course.getCourseID(),
|
|
346
|
-
* score: computeScore(c, context),
|
|
347
|
-
* provenance: [{
|
|
348
|
-
* strategy: 'myGenerator',
|
|
349
|
-
* strategyName: 'My Generator',
|
|
350
|
-
* strategyId: 'MY_GENERATOR',
|
|
351
|
-
* action: 'generated',
|
|
352
|
-
* score: computeScore(c, context),
|
|
353
|
-
* reason: 'Explanation of selection'
|
|
354
|
-
* }]
|
|
355
|
-
* }));
|
|
356
|
-
* }
|
|
357
|
-
* };
|
|
358
|
-
* ```
|
|
359
|
-
*/
|
|
360
|
-
interface CardGenerator {
|
|
361
|
-
/** Human-readable name for this generator */
|
|
362
|
-
name: string;
|
|
363
|
-
/**
|
|
364
|
-
* Produce candidate cards with initial scores.
|
|
365
|
-
*
|
|
366
|
-
* @param limit - Maximum number of cards to return
|
|
367
|
-
* @param context - Shared context (user, course, userElo, etc.)
|
|
368
|
-
* @returns Cards sorted by score descending, with provenance
|
|
369
|
-
*/
|
|
370
|
-
getWeightedCards(limit: number, context: GeneratorContext): Promise<WeightedCard[]>;
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Factory function type for creating generators from configuration.
|
|
374
|
-
*
|
|
375
|
-
* Used by PipelineAssembler to instantiate generators from strategy documents.
|
|
376
|
-
*/
|
|
377
|
-
type CardGeneratorFactory<TConfig = unknown> = (config: TConfig) => CardGenerator;
|
|
378
|
-
|
|
379
307
|
/**
|
|
380
308
|
* Diagnosis of the full card space for the current user.
|
|
381
309
|
*/
|
|
@@ -470,6 +398,17 @@ declare const pipelineDebugAPI: {
|
|
|
470
398
|
* Explain why reviews may or may not have been selected.
|
|
471
399
|
*/
|
|
472
400
|
explainReviews(): void;
|
|
401
|
+
/**
|
|
402
|
+
* Show prescribed-related cards from the most recent run.
|
|
403
|
+
*
|
|
404
|
+
* Highlights:
|
|
405
|
+
* - cards directly generated by the prescribed strategy
|
|
406
|
+
* - blocked prescribed targets mentioned in provenance
|
|
407
|
+
* - support tags resolved for blocked targets
|
|
408
|
+
*
|
|
409
|
+
* @param groupId - Optional prescribed group ID filter (e.g. 'intro-core')
|
|
410
|
+
*/
|
|
411
|
+
showPrescribed(groupId?: string): void;
|
|
473
412
|
/**
|
|
474
413
|
* Show all runs in compact format.
|
|
475
414
|
*/
|
|
@@ -704,4 +643,4 @@ declare const userDBDebugAPI: {
|
|
|
704
643
|
*/
|
|
705
644
|
declare function mountUserDBDebugger(): void;
|
|
706
645
|
|
|
707
|
-
export { type BulkCardProcessorConfig, type CardFilter, type CardFilterFactory,
|
|
646
|
+
export { type BulkCardProcessorConfig, type CardFilter, type CardFilterFactory, CardHistory, CardRecord, CourseDBInterface, DocType, DocTypePrefixes, type FilterContext, type FilterImpact, type GeneratorSummary, type GradientObservation, type GradientResult, type ImportResult, LearnableWeight, Loggable, OrchestrationContext, type PeriodUpdateInput, type PeriodUpdateResult, type PipelineRunReport, QuestionRecord, type SignalConfig, StrategyContribution, type StrategyLearningState, type StrategyStateDoc, type StrategyStateId, UserDBInterface, UserOutcomeRecord, WeightedCard, aggregateOutcomesForGradient, areQuestionRecords, buildStrategyStateId, computeOutcomeSignal, computeStrategyGradient, docIsDeleted, getCardHistoryID, getDefaultLearnableWeight, importParsedCards, isQuestionRecord, mountPipelineDebugger, mountUserDBDebugger, parseCardHistoryID, pipelineDebugAPI, recordUserOutcome, runPeriodUpdate, scoreAccuracyInZone, updateLearningState, updateStrategyWeight, userDBDebugAPI, validateProcessorConfig };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { K as ActivityRecord, A as AdminDBInterface,
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { a7 as LearnableWeight, M as UserOutcomeRecord, a8 as OrchestrationContext, W as WeightedCard, U as UserDBInterface, C as CourseDBInterface, Z as StrategyContribution } from '../contentSource-Ht3N2f-y.js';
|
|
2
|
+
export { K as ActivityRecord, A as AdminDBInterface, v as AssignedCard, g as AssignedContent, u as AssignedCourse, t as AssignedTag, a4 as CardGenerator, a6 as CardGeneratorFactory, c as ClassroomDBInterface, F as ClassroomRegistration, E as ClassroomRegistrationDesignation, H as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, L as CourseRegistration, s as CourseRegistrationDoc, b as CoursesDBInterface, a5 as GeneratorContext, G as GeneratorResult, N as NavigatorConstructor, a0 as NavigatorRole, a1 as NavigatorRoles, $ as Navigators, R as ReplanHints, j as ScheduledCard, I 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, J as UserConfig, z as UserCourseSetting, y as UserCourseSettings, x as UserDBAuthenticator, a as UserDBReader, w as UserDBWriter, B as UsrCrsDataInterface, a9 as computeDeviation, ab as computeEffectiveWeight, aa as computeSpread, ac as createOrchestrationContext, _ as getCardOrigin, P as getRegisteredNavigator, X as getRegisteredNavigatorNames, V as getRegisteredNavigatorRole, r as getStudySource, Q as hasRegisteredNavigator, Y as initializeNavigatorRegistry, a3 as isFilter, a2 as isGenerator, p as isReview, O as registerNavigator } from '../contentSource-Ht3N2f-y.js';
|
|
3
|
+
export { D as DataLayerProvider } from '../dataLayerProvider-DObSXjnf.js';
|
|
4
|
+
import { D as DocType, i as QuestionRecord, b as DocTypePrefixes, C as CardHistory, c as CardRecord } from '../types-legacy-JXDxinpU.js';
|
|
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';
|
|
5
6
|
import { DataShape, ParsedCard } from '@vue-skuilder/common';
|
|
6
7
|
import 'moment';
|
|
7
8
|
|
|
9
|
+
declare abstract class Loggable {
|
|
10
|
+
protected abstract readonly _className: string;
|
|
11
|
+
protected log(...args: unknown[]): void;
|
|
12
|
+
protected error(...args: unknown[]): void;
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
/**
|
|
9
16
|
* Snapshot of the learning state for a strategy.
|
|
10
17
|
*
|
|
@@ -297,85 +304,6 @@ interface CardFilter {
|
|
|
297
304
|
*/
|
|
298
305
|
type CardFilterFactory<TConfig = unknown> = (config: TConfig) => CardFilter;
|
|
299
306
|
|
|
300
|
-
/**
|
|
301
|
-
* Context available to generators when producing candidates.
|
|
302
|
-
*
|
|
303
|
-
* Built once per getWeightedCards() call by the Pipeline.
|
|
304
|
-
*/
|
|
305
|
-
interface GeneratorContext {
|
|
306
|
-
/** User database interface */
|
|
307
|
-
user: UserDBInterface;
|
|
308
|
-
/** Course database interface */
|
|
309
|
-
course: CourseDBInterface;
|
|
310
|
-
/** User's global ELO score for this course */
|
|
311
|
-
userElo: number;
|
|
312
|
-
/** Orchestration context for evolutionary weighting */
|
|
313
|
-
orchestration?: OrchestrationContext;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* A generator that produces candidate cards with initial scores.
|
|
317
|
-
*
|
|
318
|
-
* Generators are the "source" stage of a navigation pipeline.
|
|
319
|
-
* They query the database for eligible cards and assign initial
|
|
320
|
-
* suitability scores based on their strategy (ELO proximity,
|
|
321
|
-
* review urgency, fixed order, etc.).
|
|
322
|
-
*
|
|
323
|
-
* ## Implementation Guidelines
|
|
324
|
-
*
|
|
325
|
-
* 1. **Create provenance**: Each card should have a provenance entry
|
|
326
|
-
* with action='generated' documenting why it was selected.
|
|
327
|
-
*
|
|
328
|
-
* 2. **Score semantics**: Higher scores = more suitable for presentation.
|
|
329
|
-
* Scores should be in [0, 1] range for composability.
|
|
330
|
-
*
|
|
331
|
-
* 3. **Limit handling**: Respect the limit parameter, but may over-fetch
|
|
332
|
-
* internally if needed for scoring accuracy.
|
|
333
|
-
*
|
|
334
|
-
* 4. **Sort before returning**: Return cards sorted by score descending.
|
|
335
|
-
*
|
|
336
|
-
* ## Example Implementation
|
|
337
|
-
*
|
|
338
|
-
* ```typescript
|
|
339
|
-
* const myGenerator: CardGenerator = {
|
|
340
|
-
* name: 'My Generator',
|
|
341
|
-
* async getWeightedCards(limit, context) {
|
|
342
|
-
* const candidates = await fetchCandidates(context.course, limit);
|
|
343
|
-
* return candidates.map(c => ({
|
|
344
|
-
* cardId: c.id,
|
|
345
|
-
* courseId: context.course.getCourseID(),
|
|
346
|
-
* score: computeScore(c, context),
|
|
347
|
-
* provenance: [{
|
|
348
|
-
* strategy: 'myGenerator',
|
|
349
|
-
* strategyName: 'My Generator',
|
|
350
|
-
* strategyId: 'MY_GENERATOR',
|
|
351
|
-
* action: 'generated',
|
|
352
|
-
* score: computeScore(c, context),
|
|
353
|
-
* reason: 'Explanation of selection'
|
|
354
|
-
* }]
|
|
355
|
-
* }));
|
|
356
|
-
* }
|
|
357
|
-
* };
|
|
358
|
-
* ```
|
|
359
|
-
*/
|
|
360
|
-
interface CardGenerator {
|
|
361
|
-
/** Human-readable name for this generator */
|
|
362
|
-
name: string;
|
|
363
|
-
/**
|
|
364
|
-
* Produce candidate cards with initial scores.
|
|
365
|
-
*
|
|
366
|
-
* @param limit - Maximum number of cards to return
|
|
367
|
-
* @param context - Shared context (user, course, userElo, etc.)
|
|
368
|
-
* @returns Cards sorted by score descending, with provenance
|
|
369
|
-
*/
|
|
370
|
-
getWeightedCards(limit: number, context: GeneratorContext): Promise<WeightedCard[]>;
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Factory function type for creating generators from configuration.
|
|
374
|
-
*
|
|
375
|
-
* Used by PipelineAssembler to instantiate generators from strategy documents.
|
|
376
|
-
*/
|
|
377
|
-
type CardGeneratorFactory<TConfig = unknown> = (config: TConfig) => CardGenerator;
|
|
378
|
-
|
|
379
307
|
/**
|
|
380
308
|
* Diagnosis of the full card space for the current user.
|
|
381
309
|
*/
|
|
@@ -470,6 +398,17 @@ declare const pipelineDebugAPI: {
|
|
|
470
398
|
* Explain why reviews may or may not have been selected.
|
|
471
399
|
*/
|
|
472
400
|
explainReviews(): void;
|
|
401
|
+
/**
|
|
402
|
+
* Show prescribed-related cards from the most recent run.
|
|
403
|
+
*
|
|
404
|
+
* Highlights:
|
|
405
|
+
* - cards directly generated by the prescribed strategy
|
|
406
|
+
* - blocked prescribed targets mentioned in provenance
|
|
407
|
+
* - support tags resolved for blocked targets
|
|
408
|
+
*
|
|
409
|
+
* @param groupId - Optional prescribed group ID filter (e.g. 'intro-core')
|
|
410
|
+
*/
|
|
411
|
+
showPrescribed(groupId?: string): void;
|
|
473
412
|
/**
|
|
474
413
|
* Show all runs in compact format.
|
|
475
414
|
*/
|
|
@@ -704,4 +643,4 @@ declare const userDBDebugAPI: {
|
|
|
704
643
|
*/
|
|
705
644
|
declare function mountUserDBDebugger(): void;
|
|
706
645
|
|
|
707
|
-
export { type BulkCardProcessorConfig, type CardFilter, type CardFilterFactory,
|
|
646
|
+
export { type BulkCardProcessorConfig, type CardFilter, type CardFilterFactory, CardHistory, CardRecord, CourseDBInterface, DocType, DocTypePrefixes, type FilterContext, type FilterImpact, type GeneratorSummary, type GradientObservation, type GradientResult, type ImportResult, LearnableWeight, Loggable, OrchestrationContext, type PeriodUpdateInput, type PeriodUpdateResult, type PipelineRunReport, QuestionRecord, type SignalConfig, StrategyContribution, type StrategyLearningState, type StrategyStateDoc, type StrategyStateId, UserDBInterface, UserOutcomeRecord, WeightedCard, aggregateOutcomesForGradient, areQuestionRecords, buildStrategyStateId, computeOutcomeSignal, computeStrategyGradient, docIsDeleted, getCardHistoryID, getDefaultLearnableWeight, importParsedCards, isQuestionRecord, mountPipelineDebugger, mountUserDBDebugger, parseCardHistoryID, pipelineDebugAPI, recordUserOutcome, runPeriodUpdate, scoreAccuracyInZone, updateLearningState, updateStrategyWeight, userDBDebugAPI, validateProcessorConfig };
|