@vue-skuilder/db 0.2.21 → 0.2.23
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-BMxsujRu.d.cts → contentSource-BvOpKUeU.d.ts} +442 -79
- package/dist/{contentSource-Bazgkf4C.d.ts → contentSource-DT9NaX69.d.cts} +442 -79
- package/dist/core/index.d.cts +84 -342
- package/dist/core/index.d.ts +84 -342
- package/dist/core/index.js +79 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +74 -4
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-Bt-D6xas.d.ts → dataLayerProvider-CY2B2lyW.d.ts} +1 -1
- package/dist/{dataLayerProvider-DifVCcIS.d.cts → dataLayerProvider-wY6s_4x9.d.cts} +1 -1
- package/dist/impl/couch/index.d.cts +3 -3
- package/dist/impl/couch/index.d.ts +3 -3
- package/dist/impl/couch/index.js +63 -4
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +63 -4
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +4 -4
- package/dist/impl/static/index.d.ts +4 -4
- package/dist/impl/static/index.js +63 -4
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +63 -4
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/{index-BLLT5BYE.d.ts → index-BkBJlGDX.d.ts} +1 -1
- package/dist/{index-k9NFHpS1.d.cts → index-D7WdMDAs.d.cts} +1 -1
- package/dist/index.d.cts +51 -14
- package/dist/index.d.ts +51 -14
- package/dist/index.js +240 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +235 -12
- package/dist/index.mjs.map +1 -1
- package/dist/{types-BFUa1pa3.d.cts → types-DjiFOZxJ.d.cts} +1 -1
- package/dist/{types-legacy-4tlwHnXo.d.cts → types-legacy-CrwyZIvI.d.cts} +10 -2
- package/dist/{types-legacy-4tlwHnXo.d.ts → types-legacy-CrwyZIvI.d.ts} +10 -2
- package/dist/{types-CHgpWQAY.d.ts → types-uJ2Xn3_X.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 +3 -3
- package/src/core/index.ts +1 -0
- package/src/core/interfaces/userDB.ts +7 -0
- package/src/core/navigators/PipelineDebugger.ts +41 -1
- package/src/core/navigators/index.ts +3 -0
- package/src/core/types/studySession.ts +125 -0
- package/src/core/types/types-legacy.ts +8 -0
- package/src/impl/common/BaseUserDB.ts +36 -0
- package/src/study/SessionController.ts +188 -2
- package/src/study/SessionDebugger.ts +4 -3
- package/src/study/SessionOverlay.ts +1 -0
- package/src/study/services/ResponseProcessor.ts +32 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-
|
|
1
|
+
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-uJ2Xn3_X.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstraction for file system operations needed by the migrator.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-
|
|
1
|
+
import { P as PackerConfig, a as PackedCourseData, S as StaticCourseManifest } from './types-DjiFOZxJ.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstraction for file system operations needed by the migrator.
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { U as UserDBInterface, s as CourseRegistrationDoc, S as StudySessionItem, W as WeightedCard, R as ReplanHints, h as StudyContentSource, G as GeneratorResult, C as CourseDBInterface } from './contentSource-
|
|
2
|
-
export {
|
|
3
|
-
import { D as DataLayerProvider } from './dataLayerProvider-
|
|
4
|
-
import { C as CardHistory,
|
|
5
|
-
export {
|
|
1
|
+
import { U as UserDBInterface, s as CourseRegistrationDoc, S as StudySessionItem, W as WeightedCard, R as ReplanHints, h as StudyContentSource, t as SessionStateSnapshotProvider, G as GeneratorResult, C as CourseDBInterface } from './contentSource-DT9NaX69.cjs';
|
|
2
|
+
export { L as ActivityRecord, A as AdminDBInterface, w as AssignedCard, g as AssignedContent, v as AssignedCourse, u as AssignedTag, ae as CardGenerator, ag as CardGeneratorFactory, c as ClassroomDBInterface, H as ClassroomRegistration, F as ClassroomRegistrationDesignation, I as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, M as CourseRegistration, b as CoursesDBInterface, ax as DocumentUpdater, ap as FilterImpact, af as GeneratorContext, ao as GeneratorSummary, _ as HYDRATION_MARKER_ID, $ as HydrationMarker, ar as LearnableWeight, a0 as NavigatorConstructor, aa as NavigatorRole, ab as NavigatorRoles, a9 as Navigators, as as OrchestrationContext, aq as PipelineForecaster, an as PipelineRunReport, j as ScheduledCard, Q as SessionStateSnapshot, J as SessionTrackingData, a7 as StrategyContribution, i as StudentClassroomDBInterface, O as StudySessionDoc, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, P as StudySessionRunSummary, T as TeacherClassroomDBInterface, K as UserConfig, B as UserCourseSetting, z as UserCourseSettings, y as UserDBAuthenticator, a as UserDBReader, x as UserDBWriter, Y as UserHydrationState, Z as UserHydrationStatus, N as UserOutcomeRecord, E as UsrCrsDataInterface, at as computeDeviation, av as computeEffectiveWeight, au as computeSpread, aw as createOrchestrationContext, am as drainCapturedRuns, aj as getActivePipeline, a8 as getCardOrigin, a2 as getRegisteredNavigator, a5 as getRegisteredNavigatorNames, a4 as getRegisteredNavigatorRole, al as getRunsForSession, r as getStudySource, a3 as hasRegisteredNavigator, a6 as initializeNavigatorRegistry, ad as isFilter, ac as isGenerator, p as isReview, V as makeStudySessionId, ai as mountPipelineDebugger, ay as newInterval, X as newSessionId, ah as pipelineDebugAPI, a1 as registerNavigator, ak as setDebugSessionId } from './contentSource-DT9NaX69.cjs';
|
|
3
|
+
import { D as DataLayerProvider } from './dataLayerProvider-wY6s_4x9.cjs';
|
|
4
|
+
import { C as CardHistory, b as CardRecord, c as QuestionRecord } from './types-legacy-CrwyZIvI.cjs';
|
|
5
|
+
export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, D as DocType, i as DocTypePrefixes, 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-CrwyZIvI.cjs';
|
|
6
6
|
import { SrsBacklogDebug, StrategyPressureDebug, Loggable } from './core/index.cjs';
|
|
7
|
-
export { BulkCardProcessorConfig, CardFilter, CardFilterFactory, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DiversityRerankOptions, FilterContext,
|
|
7
|
+
export { BulkCardProcessorConfig, CardFilter, CardFilterFactory, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DiversityRerankOptions, FilterContext, GradientObservation, GradientResult, ImportResult, PeriodUpdateInput, PeriodUpdateResult, PressureGaugeDebug, SignalConfig, StrategyLearningState, StrategyStateDoc, StrategyStateId, aggregateOutcomesForGradient, areQuestionRecords, buildStrategyStateId, captureStrategyPressure, clearSrsBacklogDebug, clearStrategyPressureDebug, computeOutcomeSignal, computeStrategyGradient, diversityRerank, docIsDeleted, getCardHistoryID, getDefaultLearnableWeight, getSrsBacklogDebug, getStrategyPressureDebug, importParsedCards, isQuestionRecord, mountUserDBDebugger, parseCardHistoryID, recordUserOutcome, runPeriodUpdate, scoreAccuracyInZone, updateLearningState, updateStrategyWeight, userDBDebugAPI, validateProcessorConfig } from './core/index.cjs';
|
|
8
8
|
import { TaggedPerformance, TagFilter, DataShape, CourseConfig } from '@vue-skuilder/common';
|
|
9
|
-
import { S as StaticCourseManifest } from './types-
|
|
10
|
-
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-
|
|
11
|
-
import { F as FileSystemAdapter } from './index-
|
|
12
|
-
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-
|
|
9
|
+
import { S as StaticCourseManifest } from './types-DjiFOZxJ.cjs';
|
|
10
|
+
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-DjiFOZxJ.cjs';
|
|
11
|
+
import { F as FileSystemAdapter } from './index-D7WdMDAs.cjs';
|
|
12
|
+
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-D7WdMDAs.cjs';
|
|
13
13
|
import moment from 'moment';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -348,6 +348,7 @@ interface SessionDrawnCardDebug {
|
|
|
348
348
|
}
|
|
349
349
|
/** Live snapshot of the controller, read fresh on each overlay tick. */
|
|
350
350
|
interface SessionDebugSnapshot {
|
|
351
|
+
sessionId: string;
|
|
351
352
|
secondsRemaining: number;
|
|
352
353
|
hasCardGuarantee: boolean;
|
|
353
354
|
minCardsGuarantee: number;
|
|
@@ -662,6 +663,24 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
662
663
|
* `this`; constructed once so observers can rely on referential identity.
|
|
663
664
|
*/
|
|
664
665
|
private _sessionControls;
|
|
666
|
+
/**
|
|
667
|
+
* Minted at construction so the bootstrap pipeline run in `prepareSession()`
|
|
668
|
+
* can carry it. Stamped onto every CardRecord and pipeline run this session.
|
|
669
|
+
*/
|
|
670
|
+
readonly sessionId: string;
|
|
671
|
+
/** Host-supplied. Without it, no durable session doc is written. */
|
|
672
|
+
private _courseId?;
|
|
673
|
+
private _stateSnapshotProvider?;
|
|
674
|
+
private _sessionDoc;
|
|
675
|
+
/**
|
|
676
|
+
* Awaited by the close path — the open write is slow (time-boxed snapshot)
|
|
677
|
+
* and would otherwise land last, leaving a finished session marked `open`.
|
|
678
|
+
*/
|
|
679
|
+
private _openDocPromise;
|
|
680
|
+
private _runLog;
|
|
681
|
+
private static readonly MAX_LOGGED_RUNS;
|
|
682
|
+
/** Guards `endSession()` against the several termination paths racing it. */
|
|
683
|
+
private _sessionClosed;
|
|
665
684
|
private startTime;
|
|
666
685
|
private endTime;
|
|
667
686
|
private _secondsRemaining;
|
|
@@ -685,6 +704,9 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
685
704
|
constructor(sources: StudyContentSource[], time: number, dataLayer: DataLayerProvider, getViewComponent: (viewId: string) => TView, mixer?: SourceMixer, options?: {
|
|
686
705
|
defaultBatchLimit?: number;
|
|
687
706
|
outcomeObservers?: OutcomeObserver[];
|
|
707
|
+
/** Omit to run without durable session recording. */
|
|
708
|
+
courseId?: string;
|
|
709
|
+
stateSnapshotProvider?: SessionStateSnapshotProvider;
|
|
688
710
|
});
|
|
689
711
|
private tick;
|
|
690
712
|
/**
|
|
@@ -696,6 +718,12 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
696
718
|
*/
|
|
697
719
|
private estimateCleanupTime;
|
|
698
720
|
prepareSession(): Promise<void>;
|
|
721
|
+
/** Label the runs the last plan produced. The pipeline can't know the why. */
|
|
722
|
+
private _recordRuns;
|
|
723
|
+
/** Time-boxed and isolated — a bad provider degrades the record, not the session. */
|
|
724
|
+
private _captureState;
|
|
725
|
+
/** Writing at open is what makes an unclosed session visible at all. */
|
|
726
|
+
private _openSessionDoc;
|
|
699
727
|
/**
|
|
700
728
|
* Request a mid-session replan. Re-runs the pipeline with current user state
|
|
701
729
|
* and atomically replaces (or merges into) the supplyQ contents. Safe to call
|
|
@@ -959,6 +987,8 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
959
987
|
*/
|
|
960
988
|
private _shouldInterleaveFailed;
|
|
961
989
|
nextCard(action?: SessionAction): Promise<HydratedCard<TView> | null>;
|
|
990
|
+
/** Not awaited — the host renders the end screen off `nextCard()`'s null. */
|
|
991
|
+
private _terminate;
|
|
962
992
|
/**
|
|
963
993
|
* Public API for processing user responses to cards.
|
|
964
994
|
* @param cardRecord User's response record
|
|
@@ -995,7 +1025,12 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
995
1025
|
* This method aggregates all responses from the session and records a
|
|
996
1026
|
* UserOutcomeRecord if evolutionary orchestration is enabled.
|
|
997
1027
|
*/
|
|
998
|
-
|
|
1028
|
+
/**
|
|
1029
|
+
* Idempotent. Called from every `nextCard()` path that returns null; hosts
|
|
1030
|
+
* should also call it with `'abandoned'` when tearing down mid-session.
|
|
1031
|
+
*/
|
|
1032
|
+
endSession(reason?: 'closed' | 'abandoned'): Promise<void>;
|
|
1033
|
+
private _closeSessionDoc;
|
|
999
1034
|
}
|
|
1000
1035
|
|
|
1001
1036
|
/**
|
|
@@ -1205,9 +1240,11 @@ interface SessionRunReport {
|
|
|
1205
1240
|
*/
|
|
1206
1241
|
declare function clearStaleSessionDebugState(): void;
|
|
1207
1242
|
/**
|
|
1208
|
-
* Start tracking a new session.
|
|
1243
|
+
* Start tracking a new session. The id is owned by `SessionController` — it is
|
|
1244
|
+
* minted at construction so pipeline runs from `prepareSession()` onward can
|
|
1245
|
+
* carry it.
|
|
1209
1246
|
*/
|
|
1210
|
-
declare function startSessionTracking(supplyQLength: number, failedQLength: number): void;
|
|
1247
|
+
declare function startSessionTracking(sessionId: string, supplyQLength: number, failedQLength: number): void;
|
|
1211
1248
|
/**
|
|
1212
1249
|
* Record a card presentation.
|
|
1213
1250
|
*/
|
|
@@ -1523,4 +1560,4 @@ interface CouchDbUserDoc extends PouchDB.Authentication.User {
|
|
|
1523
1560
|
entitlements: UserEntitlements;
|
|
1524
1561
|
}
|
|
1525
1562
|
|
|
1526
|
-
export { type ActiveSessionHandle, type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, type OutcomeObserver, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, REVIEW_TIME_FORMAT, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionDebugSnapshot, type SessionDebugTarget, type SessionDrawnCardDebug, type SessionOutcome, type SessionQueueDebug, type SessionQueueItemDebug, type SessionRunReport, type SourceBatch, type SourceMixer, type SourceSelectionBreakdown, type SourceSummary, SrsBacklogDebug, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StrategyPressureDebug, StudyContentSource, StudySessionItem, type StudySessionRecord, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, captureMixerRun, clearStaleSessionDebugState, endSessionTracking, ensureAppDataDirectory, getActiveController, getAppDataDirectory, getDataLayer, getDbPath, initializeDataDirectory, initializeDataLayer, isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, makeScheduledCardId, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, processCustomQuestionsData, recordCardPresentation, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, toggleSessionOverlay, validateMigration, validateStaticCourse };
|
|
1563
|
+
export { type ActiveSessionHandle, type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, type OutcomeObserver, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, REVIEW_TIME_FORMAT, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionDebugSnapshot, type SessionDebugTarget, type SessionDrawnCardDebug, type SessionOutcome, type SessionQueueDebug, type SessionQueueItemDebug, type SessionRunReport, SessionStateSnapshotProvider, type SourceBatch, type SourceMixer, type SourceSelectionBreakdown, type SourceSummary, SrsBacklogDebug, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StrategyPressureDebug, StudyContentSource, StudySessionItem, type StudySessionRecord, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, captureMixerRun, clearStaleSessionDebugState, endSessionTracking, ensureAppDataDirectory, getActiveController, getAppDataDirectory, getDataLayer, getDbPath, initializeDataDirectory, initializeDataLayer, isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, makeScheduledCardId, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, processCustomQuestionsData, recordCardPresentation, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, toggleSessionOverlay, validateMigration, validateStaticCourse };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { U as UserDBInterface, s as CourseRegistrationDoc, S as StudySessionItem, W as WeightedCard, R as ReplanHints, h as StudyContentSource, G as GeneratorResult, C as CourseDBInterface } from './contentSource-
|
|
2
|
-
export {
|
|
3
|
-
import { D as DataLayerProvider } from './dataLayerProvider-
|
|
4
|
-
import { C as CardHistory,
|
|
5
|
-
export {
|
|
1
|
+
import { U as UserDBInterface, s as CourseRegistrationDoc, S as StudySessionItem, W as WeightedCard, R as ReplanHints, h as StudyContentSource, t as SessionStateSnapshotProvider, G as GeneratorResult, C as CourseDBInterface } from './contentSource-BvOpKUeU.js';
|
|
2
|
+
export { L as ActivityRecord, A as AdminDBInterface, w as AssignedCard, g as AssignedContent, v as AssignedCourse, u as AssignedTag, ae as CardGenerator, ag as CardGeneratorFactory, c as ClassroomDBInterface, H as ClassroomRegistration, F as ClassroomRegistrationDesignation, I as ClassroomRegistrationDoc, e as ContentNavigationStrategyData, f as ContentNavigator, q as ContentSourceID, d as CourseInfo, M as CourseRegistration, b as CoursesDBInterface, ax as DocumentUpdater, ap as FilterImpact, af as GeneratorContext, ao as GeneratorSummary, _ as HYDRATION_MARKER_ID, $ as HydrationMarker, ar as LearnableWeight, a0 as NavigatorConstructor, aa as NavigatorRole, ab as NavigatorRoles, a9 as Navigators, as as OrchestrationContext, aq as PipelineForecaster, an as PipelineRunReport, j as ScheduledCard, Q as SessionStateSnapshot, J as SessionTrackingData, a7 as StrategyContribution, i as StudentClassroomDBInterface, O as StudySessionDoc, k as StudySessionFailedItem, l as StudySessionFailedNewItem, m as StudySessionFailedReviewItem, n as StudySessionNewItem, o as StudySessionReviewItem, P as StudySessionRunSummary, T as TeacherClassroomDBInterface, K as UserConfig, B as UserCourseSetting, z as UserCourseSettings, y as UserDBAuthenticator, a as UserDBReader, x as UserDBWriter, Y as UserHydrationState, Z as UserHydrationStatus, N as UserOutcomeRecord, E as UsrCrsDataInterface, at as computeDeviation, av as computeEffectiveWeight, au as computeSpread, aw as createOrchestrationContext, am as drainCapturedRuns, aj as getActivePipeline, a8 as getCardOrigin, a2 as getRegisteredNavigator, a5 as getRegisteredNavigatorNames, a4 as getRegisteredNavigatorRole, al as getRunsForSession, r as getStudySource, a3 as hasRegisteredNavigator, a6 as initializeNavigatorRegistry, ad as isFilter, ac as isGenerator, p as isReview, V as makeStudySessionId, ai as mountPipelineDebugger, ay as newInterval, X as newSessionId, ah as pipelineDebugAPI, a1 as registerNavigator, ak as setDebugSessionId } from './contentSource-BvOpKUeU.js';
|
|
3
|
+
import { D as DataLayerProvider } from './dataLayerProvider-CY2B2lyW.js';
|
|
4
|
+
import { C as CardHistory, b as CardRecord, c as QuestionRecord } from './types-legacy-CrwyZIvI.js';
|
|
5
|
+
export { d as CardData, e as CourseListData, g as DataShapeData, f as DisplayableData, D as DocType, i as DocTypePrefixes, 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-CrwyZIvI.js';
|
|
6
6
|
import { SrsBacklogDebug, StrategyPressureDebug, Loggable } from './core/index.js';
|
|
7
|
-
export { BulkCardProcessorConfig, CardFilter, CardFilterFactory, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DiversityRerankOptions, FilterContext,
|
|
7
|
+
export { BulkCardProcessorConfig, CardFilter, CardFilterFactory, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DiversityRerankOptions, FilterContext, GradientObservation, GradientResult, ImportResult, PeriodUpdateInput, PeriodUpdateResult, PressureGaugeDebug, SignalConfig, StrategyLearningState, StrategyStateDoc, StrategyStateId, aggregateOutcomesForGradient, areQuestionRecords, buildStrategyStateId, captureStrategyPressure, clearSrsBacklogDebug, clearStrategyPressureDebug, computeOutcomeSignal, computeStrategyGradient, diversityRerank, docIsDeleted, getCardHistoryID, getDefaultLearnableWeight, getSrsBacklogDebug, getStrategyPressureDebug, importParsedCards, isQuestionRecord, mountUserDBDebugger, parseCardHistoryID, recordUserOutcome, runPeriodUpdate, scoreAccuracyInZone, updateLearningState, updateStrategyWeight, userDBDebugAPI, validateProcessorConfig } from './core/index.js';
|
|
8
8
|
import { TaggedPerformance, TagFilter, DataShape, CourseConfig } from '@vue-skuilder/common';
|
|
9
|
-
import { S as StaticCourseManifest } from './types-
|
|
10
|
-
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-
|
|
11
|
-
import { F as FileSystemAdapter } from './index-
|
|
12
|
-
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-
|
|
9
|
+
import { S as StaticCourseManifest } from './types-uJ2Xn3_X.js';
|
|
10
|
+
export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-uJ2Xn3_X.js';
|
|
11
|
+
import { F as FileSystemAdapter } from './index-BkBJlGDX.js';
|
|
12
|
+
export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-BkBJlGDX.js';
|
|
13
13
|
import moment from 'moment';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -348,6 +348,7 @@ interface SessionDrawnCardDebug {
|
|
|
348
348
|
}
|
|
349
349
|
/** Live snapshot of the controller, read fresh on each overlay tick. */
|
|
350
350
|
interface SessionDebugSnapshot {
|
|
351
|
+
sessionId: string;
|
|
351
352
|
secondsRemaining: number;
|
|
352
353
|
hasCardGuarantee: boolean;
|
|
353
354
|
minCardsGuarantee: number;
|
|
@@ -662,6 +663,24 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
662
663
|
* `this`; constructed once so observers can rely on referential identity.
|
|
663
664
|
*/
|
|
664
665
|
private _sessionControls;
|
|
666
|
+
/**
|
|
667
|
+
* Minted at construction so the bootstrap pipeline run in `prepareSession()`
|
|
668
|
+
* can carry it. Stamped onto every CardRecord and pipeline run this session.
|
|
669
|
+
*/
|
|
670
|
+
readonly sessionId: string;
|
|
671
|
+
/** Host-supplied. Without it, no durable session doc is written. */
|
|
672
|
+
private _courseId?;
|
|
673
|
+
private _stateSnapshotProvider?;
|
|
674
|
+
private _sessionDoc;
|
|
675
|
+
/**
|
|
676
|
+
* Awaited by the close path — the open write is slow (time-boxed snapshot)
|
|
677
|
+
* and would otherwise land last, leaving a finished session marked `open`.
|
|
678
|
+
*/
|
|
679
|
+
private _openDocPromise;
|
|
680
|
+
private _runLog;
|
|
681
|
+
private static readonly MAX_LOGGED_RUNS;
|
|
682
|
+
/** Guards `endSession()` against the several termination paths racing it. */
|
|
683
|
+
private _sessionClosed;
|
|
665
684
|
private startTime;
|
|
666
685
|
private endTime;
|
|
667
686
|
private _secondsRemaining;
|
|
@@ -685,6 +704,9 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
685
704
|
constructor(sources: StudyContentSource[], time: number, dataLayer: DataLayerProvider, getViewComponent: (viewId: string) => TView, mixer?: SourceMixer, options?: {
|
|
686
705
|
defaultBatchLimit?: number;
|
|
687
706
|
outcomeObservers?: OutcomeObserver[];
|
|
707
|
+
/** Omit to run without durable session recording. */
|
|
708
|
+
courseId?: string;
|
|
709
|
+
stateSnapshotProvider?: SessionStateSnapshotProvider;
|
|
688
710
|
});
|
|
689
711
|
private tick;
|
|
690
712
|
/**
|
|
@@ -696,6 +718,12 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
696
718
|
*/
|
|
697
719
|
private estimateCleanupTime;
|
|
698
720
|
prepareSession(): Promise<void>;
|
|
721
|
+
/** Label the runs the last plan produced. The pipeline can't know the why. */
|
|
722
|
+
private _recordRuns;
|
|
723
|
+
/** Time-boxed and isolated — a bad provider degrades the record, not the session. */
|
|
724
|
+
private _captureState;
|
|
725
|
+
/** Writing at open is what makes an unclosed session visible at all. */
|
|
726
|
+
private _openSessionDoc;
|
|
699
727
|
/**
|
|
700
728
|
* Request a mid-session replan. Re-runs the pipeline with current user state
|
|
701
729
|
* and atomically replaces (or merges into) the supplyQ contents. Safe to call
|
|
@@ -959,6 +987,8 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
959
987
|
*/
|
|
960
988
|
private _shouldInterleaveFailed;
|
|
961
989
|
nextCard(action?: SessionAction): Promise<HydratedCard<TView> | null>;
|
|
990
|
+
/** Not awaited — the host renders the end screen off `nextCard()`'s null. */
|
|
991
|
+
private _terminate;
|
|
962
992
|
/**
|
|
963
993
|
* Public API for processing user responses to cards.
|
|
964
994
|
* @param cardRecord User's response record
|
|
@@ -995,7 +1025,12 @@ declare class SessionController<TView = unknown> extends Loggable {
|
|
|
995
1025
|
* This method aggregates all responses from the session and records a
|
|
996
1026
|
* UserOutcomeRecord if evolutionary orchestration is enabled.
|
|
997
1027
|
*/
|
|
998
|
-
|
|
1028
|
+
/**
|
|
1029
|
+
* Idempotent. Called from every `nextCard()` path that returns null; hosts
|
|
1030
|
+
* should also call it with `'abandoned'` when tearing down mid-session.
|
|
1031
|
+
*/
|
|
1032
|
+
endSession(reason?: 'closed' | 'abandoned'): Promise<void>;
|
|
1033
|
+
private _closeSessionDoc;
|
|
999
1034
|
}
|
|
1000
1035
|
|
|
1001
1036
|
/**
|
|
@@ -1205,9 +1240,11 @@ interface SessionRunReport {
|
|
|
1205
1240
|
*/
|
|
1206
1241
|
declare function clearStaleSessionDebugState(): void;
|
|
1207
1242
|
/**
|
|
1208
|
-
* Start tracking a new session.
|
|
1243
|
+
* Start tracking a new session. The id is owned by `SessionController` — it is
|
|
1244
|
+
* minted at construction so pipeline runs from `prepareSession()` onward can
|
|
1245
|
+
* carry it.
|
|
1209
1246
|
*/
|
|
1210
|
-
declare function startSessionTracking(supplyQLength: number, failedQLength: number): void;
|
|
1247
|
+
declare function startSessionTracking(sessionId: string, supplyQLength: number, failedQLength: number): void;
|
|
1211
1248
|
/**
|
|
1212
1249
|
* Record a card presentation.
|
|
1213
1250
|
*/
|
|
@@ -1523,4 +1560,4 @@ interface CouchDbUserDoc extends PouchDB.Authentication.User {
|
|
|
1523
1560
|
entitlements: UserEntitlements;
|
|
1524
1561
|
}
|
|
1525
1562
|
|
|
1526
|
-
export { type ActiveSessionHandle, type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, type OutcomeObserver, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, REVIEW_TIME_FORMAT, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionDebugSnapshot, type SessionDebugTarget, type SessionDrawnCardDebug, type SessionOutcome, type SessionQueueDebug, type SessionQueueItemDebug, type SessionRunReport, type SourceBatch, type SourceMixer, type SourceSelectionBreakdown, type SourceSummary, SrsBacklogDebug, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StrategyPressureDebug, StudyContentSource, StudySessionItem, type StudySessionRecord, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, captureMixerRun, clearStaleSessionDebugState, endSessionTracking, ensureAppDataDirectory, getActiveController, getAppDataDirectory, getDataLayer, getDbPath, initializeDataDirectory, initializeDataLayer, isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, makeScheduledCardId, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, processCustomQuestionsData, recordCardPresentation, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, toggleSessionOverlay, validateMigration, validateStaticCourse };
|
|
1563
|
+
export { type ActiveSessionHandle, type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, type OutcomeObserver, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, REVIEW_TIME_FORMAT, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionDebugSnapshot, type SessionDebugTarget, type SessionDrawnCardDebug, type SessionOutcome, type SessionQueueDebug, type SessionQueueItemDebug, type SessionRunReport, SessionStateSnapshotProvider, type SourceBatch, type SourceMixer, type SourceSelectionBreakdown, type SourceSummary, SrsBacklogDebug, StaticCourseManifest, type StaticCourseValidation, StaticToCouchDBMigrator, StrategyPressureDebug, StudyContentSource, StudySessionItem, type StudySessionRecord, TagFilteredContentSource, type UserAccountStatus, UserDBInterface, type UserEntitlements, type ValidationIssue, type ValidationResult, WeightedCard, _resetDataLayer, captureMixerRun, clearStaleSessionDebugState, endSessionTracking, ensureAppDataDirectory, getActiveController, getAppDataDirectory, getDataLayer, getDbPath, initializeDataDirectory, initializeDataLayer, isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, makeScheduledCardId, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, processCustomQuestionsData, recordCardPresentation, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, toggleSessionOverlay, validateMigration, validateStaticCourse };
|