@vue-skuilder/db 0.2.36 → 0.3.0

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 (59) hide show
  1. package/dist/{contentSource-D_E7JaxR.d.ts → contentSource-2zVmcjKA.d.ts} +6 -1
  2. package/dist/core/index.cjs +203 -148
  3. package/dist/core/index.cjs.map +1 -1
  4. package/dist/core/index.d.ts +5 -5
  5. package/dist/core/navigators/Pipeline.mjs +8 -0
  6. package/dist/core/navigators/Pipeline.mjs.map +1 -1
  7. package/dist/core/navigators/generators/prescribed.mjs +29 -11
  8. package/dist/core/navigators/generators/prescribed.mjs.map +1 -1
  9. package/dist/core/versionStamps.mjs +1 -1
  10. package/dist/{dataLayerProvider-BDshhSp_.d.ts → dataLayerProvider-rGyLQ93v.d.ts} +1 -1
  11. package/dist/diagnostics/index.d.ts +3 -3
  12. package/dist/impl/common/BaseUserDB.mjs +32 -15
  13. package/dist/impl/common/BaseUserDB.mjs.map +1 -1
  14. package/dist/impl/couch/CourseSyncService.mjs +111 -11
  15. package/dist/impl/couch/CourseSyncService.mjs.map +1 -1
  16. package/dist/impl/couch/PouchDataLayerProvider.mjs +16 -1
  17. package/dist/impl/couch/PouchDataLayerProvider.mjs.map +1 -1
  18. package/dist/impl/couch/courseAPI.mjs +24 -10
  19. package/dist/impl/couch/courseAPI.mjs.map +1 -1
  20. package/dist/impl/couch/courseDB.mjs +19 -9
  21. package/dist/impl/couch/courseDB.mjs.map +1 -1
  22. package/dist/impl/couch/index.cjs +297 -141
  23. package/dist/impl/couch/index.cjs.map +1 -1
  24. package/dist/impl/couch/index.d.ts +27 -4
  25. package/dist/impl/couch/index.mjs +20 -3
  26. package/dist/impl/couch/index.mjs.map +1 -1
  27. package/dist/impl/couch/updateQueue.mjs +69 -46
  28. package/dist/impl/couch/updateQueue.mjs.map +1 -1
  29. package/dist/impl/static/index.cjs +147 -93
  30. package/dist/impl/static/index.cjs.map +1 -1
  31. package/dist/impl/static/index.d.ts +4 -4
  32. package/dist/{index-BLDpFYG3.d.ts → index-C745YB_6.d.ts} +1 -1
  33. package/dist/index.cjs +345 -171
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.ts +23 -10
  36. package/dist/index.mjs +2 -1
  37. package/dist/study/SessionController.mjs +4 -0
  38. package/dist/study/SessionController.mjs.map +1 -1
  39. package/dist/{types-DChCz22D.d.ts → types-DF0JuPbs.d.ts} +1 -1
  40. package/dist/{types-legacy-fT5Y1Wuy.d.ts → types-legacy-DdVjg81H.d.ts} +1 -1
  41. package/dist/util/packer/index.d.ts +3 -3
  42. package/dist/util/perfMarks.mjs +30 -0
  43. package/dist/util/perfMarks.mjs.map +1 -0
  44. package/package.json +3 -3
  45. package/src/core/interfaces/courseDB.ts +6 -0
  46. package/src/core/navigators/Pipeline.ts +8 -0
  47. package/src/core/navigators/generators/prescribed.ts +42 -16
  48. package/src/impl/common/BaseUserDB.ts +42 -23
  49. package/src/impl/couch/CourseSyncService.ts +149 -22
  50. package/src/impl/couch/PouchDataLayerProvider.ts +14 -1
  51. package/src/impl/couch/courseAPI.ts +26 -12
  52. package/src/impl/couch/courseDB.ts +25 -12
  53. package/src/impl/couch/index.ts +16 -5
  54. package/src/impl/couch/updateQueue.ts +86 -82
  55. package/src/study/SessionController.ts +4 -0
  56. package/src/util/index.ts +1 -0
  57. package/src/util/perfMarks.ts +35 -0
  58. package/tests/impl/courseSync.test.ts +139 -0
  59. package/tests/impl/updateQueue.test.ts +57 -0
package/dist/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  export { A as AdminDBInterface, d as AssignedCard, a as AssignedContent, c as AssignedCourse, b as AssignedTag, C as ClassroomDBInterface, S as StudentClassroomDBInterface, T as TeacherClassroomDBInterface } from './classroomDB-DLTtLZct.js';
2
- import { U as UserDBInterface, g as CourseRegistrationDoc, m as SessionEloEvent, S as StudySessionItem, W as WeightedCard, R as ReplanHints, o as StudyContentSource, x as SessionStateSnapshotProvider, G as GeneratorResult, N as NavigatorRole, c as ContentNavigationStrategyData, F as FilterKind, y as RegulatorConfig, C as CourseDBInterface } from './contentSource-D_E7JaxR.js';
3
- export { P as ActivityRecord, ae as CardFilter, ag as CardFilterFactory, ah as CardGenerator, aj as CardGeneratorFactory, K as ClassroomRegistration, J as ClassroomRegistrationDesignation, L as ClassroomRegistrationDoc, d as ContentNavigator, v as ContentSourceID, b as CourseInfo, Q as CourseRegistration, a as CoursesDBInterface, aB as DEFAULT_REGULATOR_CONFIG, aM as DocumentUpdater, af as FilterContext, at as FilterImpact, ai as GeneratorContext, as as GeneratorSummary, _ as HYDRATION_MARKER_ID, $ as HydrationMarker, aF as INTAKE_CLOCK_KEY, aE as IntakeClockState, av as LearnableWeight, a0 as NavigatorConstructor, ab as NavigatorRoles, aa as Navigators, aw as OrchestrationContext, au as PipelineForecaster, aq as PipelineRunReport, l as RegulatorName, j as RegulatorReading, ar as RunReportCard, f as ScheduledCard, h as SessionStateSnapshot, M as SessionTrackingData, a8 as StrategyContribution, e as StudySessionDoc, p as StudySessionFailedItem, q as StudySessionFailedNewItem, r as StudySessionFailedReviewItem, s as StudySessionNewItem, t as StudySessionReviewItem, k as StudySessionRunCard, n as StudySessionRunCardTrail, i as StudySessionRunSummary, O as UserConfig, H as UserCourseSetting, E as UserCourseSettings, B as UserDBAuthenticator, z as UserDBReader, A as UserDBWriter, Y as UserHydrationState, Z as UserHydrationStatus, T as UserOutcomeRecord, I as UsrCrsDataInterface, aL as applyReading, ax as computeDeviation, az as computeEffectiveWeight, ay as computeSpread, aA as createOrchestrationContext, ap as drainCapturedRuns, aH as frozenMsAt, am as getActivePipeline, a9 as getCardOrigin, aP as getLapses, a5 as getRegisteredFilterKind, a2 as getRegisteredNavigator, a6 as getRegisteredNavigatorNames, a4 as getRegisteredNavigatorRole, ao as getRunsForSession, aO as getStreak, w as getStudySource, a3 as hasRegisteredNavigator, a7 as initializeNavigatorRegistry, aI as intakeHours, aK as intakeReading, ad as isFilter, ac as isGenerator, u as isReview, V as makeStudySessionId, al as mountPipelineDebugger, aN as newInterval, X as newSessionId, ak as pipelineDebugAPI, a1 as registerNavigator, aG as resetIntakeClock, aD as reviewMassReading, aC as reviewWeight, an as setDebugSessionId, aJ as stepIntakeClock } from './contentSource-D_E7JaxR.js';
4
- import { D as DataLayerProvider } from './dataLayerProvider-BDshhSp_.js';
5
- import { e as CardHistory, c as CardRecord, d as QuestionRecord } from './types-legacy-fT5Y1Wuy.js';
6
- export { C as CardData, f as CourseListData, g as DataShapeData, b 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-fT5Y1Wuy.js';
2
+ import { U as UserDBInterface, g as CourseRegistrationDoc, m as SessionEloEvent, S as StudySessionItem, W as WeightedCard, R as ReplanHints, o as StudyContentSource, x as SessionStateSnapshotProvider, G as GeneratorResult, N as NavigatorRole, c as ContentNavigationStrategyData, F as FilterKind, y as RegulatorConfig, C as CourseDBInterface } from './contentSource-2zVmcjKA.js';
3
+ export { P as ActivityRecord, ae as CardFilter, ag as CardFilterFactory, ah as CardGenerator, aj as CardGeneratorFactory, K as ClassroomRegistration, J as ClassroomRegistrationDesignation, L as ClassroomRegistrationDoc, d as ContentNavigator, v as ContentSourceID, b as CourseInfo, Q as CourseRegistration, a as CoursesDBInterface, aB as DEFAULT_REGULATOR_CONFIG, aM as DocumentUpdater, af as FilterContext, at as FilterImpact, ai as GeneratorContext, as as GeneratorSummary, _ as HYDRATION_MARKER_ID, $ as HydrationMarker, aF as INTAKE_CLOCK_KEY, aE as IntakeClockState, av as LearnableWeight, a0 as NavigatorConstructor, ab as NavigatorRoles, aa as Navigators, aw as OrchestrationContext, au as PipelineForecaster, aq as PipelineRunReport, l as RegulatorName, j as RegulatorReading, ar as RunReportCard, f as ScheduledCard, h as SessionStateSnapshot, M as SessionTrackingData, a8 as StrategyContribution, e as StudySessionDoc, p as StudySessionFailedItem, q as StudySessionFailedNewItem, r as StudySessionFailedReviewItem, s as StudySessionNewItem, t as StudySessionReviewItem, k as StudySessionRunCard, n as StudySessionRunCardTrail, i as StudySessionRunSummary, O as UserConfig, H as UserCourseSetting, E as UserCourseSettings, B as UserDBAuthenticator, z as UserDBReader, A as UserDBWriter, Y as UserHydrationState, Z as UserHydrationStatus, T as UserOutcomeRecord, I as UsrCrsDataInterface, aL as applyReading, ax as computeDeviation, az as computeEffectiveWeight, ay as computeSpread, aA as createOrchestrationContext, ap as drainCapturedRuns, aH as frozenMsAt, am as getActivePipeline, a9 as getCardOrigin, aP as getLapses, a5 as getRegisteredFilterKind, a2 as getRegisteredNavigator, a6 as getRegisteredNavigatorNames, a4 as getRegisteredNavigatorRole, ao as getRunsForSession, aO as getStreak, w as getStudySource, a3 as hasRegisteredNavigator, a7 as initializeNavigatorRegistry, aI as intakeHours, aK as intakeReading, ad as isFilter, ac as isGenerator, u as isReview, V as makeStudySessionId, al as mountPipelineDebugger, aN as newInterval, X as newSessionId, ak as pipelineDebugAPI, a1 as registerNavigator, aG as resetIntakeClock, aD as reviewMassReading, aC as reviewWeight, an as setDebugSessionId, aJ as stepIntakeClock } from './contentSource-2zVmcjKA.js';
4
+ import { D as DataLayerProvider } from './dataLayerProvider-rGyLQ93v.js';
5
+ import { e as CardHistory, c as CardRecord, d as QuestionRecord } from './types-legacy-DdVjg81H.js';
6
+ export { C as CardData, g as CourseListData, h as DataShapeData, b as DisplayableData, D as DocType, f as DocTypePrefixes, F as Field, G as GuestUsername, Q as QualifiedCardID, i as QuestionData, S as SkuilderCourseData, a as Tag, T as TagStub, l as log } from './types-legacy-DdVjg81H.js';
7
7
  import { SrsBacklogDebug, StrategyPressureDebug, Loggable } from './core/index.js';
8
8
  export { BulkCardProcessorConfig, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DiversityRerankOptions, 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';
9
9
  import { TaggedPerformance, TagFilter, DataShape, SeedMeta, CourseConfig } from '@vue-skuilder/common';
10
- import { S as StaticCourseManifest } from './types-DChCz22D.js';
11
- export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-DChCz22D.js';
12
- import { F as FileSystemAdapter } from './index-BLDpFYG3.js';
13
- export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-BLDpFYG3.js';
10
+ import { S as StaticCourseManifest } from './types-DF0JuPbs.js';
11
+ export { A as AttachmentData, C as ChunkMetadata, D as DesignDocument, I as IndexMetadata, a as PackedCourseData, P as PackerConfig } from './types-DF0JuPbs.js';
12
+ import { F as FileSystemAdapter } from './index-C745YB_6.js';
13
+ export { C as CouchDBToStaticPacker, a as FileStats, b as FileSystemError } from './index-C745YB_6.js';
14
14
  export { R as REVIEW_TIME_FORMAT, m as makeScheduledCardId } from './userDBKeys-ne1g4Xuq.js';
15
15
  import 'moment';
16
16
 
@@ -293,6 +293,19 @@ declare function getDbPath(dbName: string): string;
293
293
  */
294
294
  declare function initializeDataDirectory(): Promise<void>;
295
295
 
296
+ /**
297
+ * User Timing marks for session and sync milestones.
298
+ *
299
+ * Names are `sk:`-prefixed (apps add their own, e.g. LP's `lp:`). Read them with
300
+ * `performance.getEntriesByType('mark' | 'measure')`: synthetic runs (Playwright,
301
+ * Lighthouse's `user-timings`) and, later, real-user measurement.
302
+ *
303
+ * Marks never throw: a missing or partial User Timing API is a no-op.
304
+ */
305
+ declare function perfMark(name: string, detail?: Record<string, unknown>): void;
306
+ /** A measure from `start` (a mark name or a `performance.now()` value) to now or `end`. */
307
+ declare function perfMeasure(name: string, start: string | number, end?: string | number, detail?: Record<string, unknown>): void;
308
+
296
309
  /**
297
310
  * Represents a batch of content fetched from a single StudyContentSource.
298
311
  */
@@ -1649,4 +1662,4 @@ interface CouchDbUserDoc extends PouchDB.Authentication.User {
1649
1662
  entitlements: UserEntitlements;
1650
1663
  }
1651
1664
 
1652
- export { type ActiveSessionHandle, type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, ContentNavigationStrategyData, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, FilterKind, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, NavigatorRole, type OutcomeObserver, PIPELINE_STAGES, type PipelinePlan, type PipelineStageInfo, type PipelineStageKey, type PlannedNavigator, type PlannedNavigatorOrigin, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, RegulatorConfig, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionDebugSnapshot, type SessionDebugTarget, type SessionDrawnCardDebug, SessionEloEvent, type SessionOutcome, type SessionQueueDebug, type SessionQueueItemDebug, type SessionRunReport, SessionStateSnapshotProvider, type SkippedStrategy, 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, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, planPipeline, processCustomQuestionsData, recordCardPresentation, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, toggleSessionOverlay, validateMigration, validateStaticCourse };
1665
+ export { type ActiveSessionHandle, type AggregatedDocument, type AttachmentUploadResult, CardHistory, type CardPresentation, CardRecord, ContentNavigationStrategyData, type CouchDbUserDoc, CourseDBInterface, CourseLookup, CourseRegistrationDoc, type CustomQuestionsData, DEFAULT_MIGRATION_OPTIONS, type DataLayerConfig, DataLayerProvider, type DocumentCounts, ENV, type Entitlement, FileSystemAdapter, FilterKind, GeneratorResult, Loggable, type MigrationOptions, type MigrationResult, type MixerCardInfo, type MixerRunReport, NOT_SET, NavigatorRole, type OutcomeObserver, PIPELINE_STAGES, type PipelinePlan, type PipelineStageInfo, type PipelineStageKey, type PlannedNavigator, type PlannedNavigatorOrigin, type ProcessedDataShape, type ProcessedQuestionData, QuestionRecord, type QueueSnapshot, QuotaRoundRobinMixer, RegulatorConfig, ReplanHints, type ReplanOptions, type ResponseResult, type RestoreProgress, type SessionAction, SessionController, type SessionControls, type SessionDebugSnapshot, type SessionDebugTarget, type SessionDrawnCardDebug, SessionEloEvent, type SessionOutcome, type SessionQueueDebug, type SessionQueueItemDebug, type SessionRunReport, SessionStateSnapshotProvider, type SkippedStrategy, 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, mixerDebugAPI, mountMixerDebugger, mountSessionDebugger, perfMark, perfMeasure, planPipeline, processCustomQuestionsData, recordCardPresentation, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, sessionDebugAPI, snapshotQueues, startSessionTracking, toggleSessionOverlay, validateMigration, validateStaticCourse };
package/dist/index.mjs CHANGED
@@ -8,6 +8,7 @@ import { DocType, DocTypePrefixes, GuestUsername, log } from "./core/types/types
8
8
  import { REVIEW_TIME_FORMAT, makeScheduledCardId } from "./impl/common/userDBKeys.mjs";
9
9
  import CourseLookup from "./impl/couch/courseLookupDB.mjs";
10
10
  import { Loggable } from "./util/Loggable.mjs";
11
+ import { perfMark, perfMeasure } from "./util/perfMarks.mjs";
11
12
  import { aggregateOutcomesForGradient, computeStrategyGradient } from "./core/orchestration/gradient.mjs";
12
13
  import { getDefaultLearnableWeight, runPeriodUpdate, updateLearningState, updateStrategyWeight } from "./core/orchestration/learning.mjs";
13
14
  import { computeOutcomeSignal, scoreAccuracyInZone } from "./core/orchestration/signal.mjs";
@@ -35,4 +36,4 @@ import { HYDRATION_MARKER_ID } from "./core/types/hydration.mjs";
35
36
  import { importParsedCards, validateProcessorConfig } from "./core/bulkImport/cardProcessor.mjs";
36
37
  import { mountUserDBDebugger, userDBDebugAPI } from "./core/UserDBDebugger.mjs";
37
38
  import { isDataShapeRegistered, isDataShapeSchemaAvailable, isQuestionTypeRegistered, processCustomQuestionsData, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType } from "./courseConfigRegistration.mjs";
38
- export { ContentNavigator, CouchDBToStaticPacker, CourseLookup, DEFAULT_REGULATOR_CONFIG, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DocType, DocTypePrefixes, ENV, FileSystemError, GuestUsername, HYDRATION_MARKER_ID, INTAKE_CLOCK_KEY, Loggable, NOT_SET, NavigatorRole, NavigatorRoles, Navigators, PIPELINE_STAGES, QuotaRoundRobinMixer, REVIEW_TIME_FORMAT, SessionController, StaticToCouchDBMigrator, TagFilteredContentSource, _resetDataLayer, aggregateOutcomesForGradient, applyReading, areQuestionRecords, buildStrategyStateId, captureMixerRun, captureStrategyPressure, clearSrsBacklogDebug, clearStaleSessionDebugState, clearStrategyPressureDebug, computeDeviation, computeEffectiveWeight, computeOutcomeSignal, computeSpread, computeStrategyGradient, createOrchestrationContext, diversityRerank, docIsDeleted, drainCapturedRuns, endSessionTracking, ensureAppDataDirectory, frozenMsAt, getActiveController, getActivePipeline, getAppDataDirectory, getCardHistoryID, getCardOrigin, getDataLayer, getDbPath, getDefaultLearnableWeight, getLapses, getRegisteredFilterKind, getRegisteredNavigator, getRegisteredNavigatorNames, getRegisteredNavigatorRole, getRunsForSession, getSrsBacklogDebug, getStrategyPressureDebug, getStreak, getStudySource, hasRegisteredNavigator, importParsedCards, initializeDataDirectory, initializeDataLayer, initializeNavigatorRegistry, intakeHours, intakeReading, isDataShapeRegistered, isDataShapeSchemaAvailable, isFilter, isGenerator, isQuestionRecord, isQuestionTypeRegistered, isReview, log, makeScheduledCardId, makeStudySessionId, mixerDebugAPI, mountMixerDebugger, mountPipelineDebugger, mountSessionDebugger, mountUserDBDebugger, newInterval, newSessionId, parseCardHistoryID, pipelineDebugAPI, planPipeline, processCustomQuestionsData, recordCardPresentation, recordUserOutcome, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerNavigator, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, resetIntakeClock, reviewMassReading, reviewWeight, runPeriodUpdate, scoreAccuracyInZone, sessionDebugAPI, setDebugSessionId, snapshotQueues, startSessionTracking, stepIntakeClock, toggleSessionOverlay, updateLearningState, updateStrategyWeight, userDBDebugAPI, validateMigration, validateProcessorConfig, validateStaticCourse };
39
+ export { ContentNavigator, CouchDBToStaticPacker, CourseLookup, DEFAULT_REGULATOR_CONFIG, DIVERSITY_FLOOR, DIVERSITY_STRENGTH, DocType, DocTypePrefixes, ENV, FileSystemError, GuestUsername, HYDRATION_MARKER_ID, INTAKE_CLOCK_KEY, Loggable, NOT_SET, NavigatorRole, NavigatorRoles, Navigators, PIPELINE_STAGES, QuotaRoundRobinMixer, REVIEW_TIME_FORMAT, SessionController, StaticToCouchDBMigrator, TagFilteredContentSource, _resetDataLayer, aggregateOutcomesForGradient, applyReading, areQuestionRecords, buildStrategyStateId, captureMixerRun, captureStrategyPressure, clearSrsBacklogDebug, clearStaleSessionDebugState, clearStrategyPressureDebug, computeDeviation, computeEffectiveWeight, computeOutcomeSignal, computeSpread, computeStrategyGradient, createOrchestrationContext, diversityRerank, docIsDeleted, drainCapturedRuns, endSessionTracking, ensureAppDataDirectory, frozenMsAt, getActiveController, getActivePipeline, getAppDataDirectory, getCardHistoryID, getCardOrigin, getDataLayer, getDbPath, getDefaultLearnableWeight, getLapses, getRegisteredFilterKind, getRegisteredNavigator, getRegisteredNavigatorNames, getRegisteredNavigatorRole, getRunsForSession, getSrsBacklogDebug, getStrategyPressureDebug, getStreak, getStudySource, hasRegisteredNavigator, importParsedCards, initializeDataDirectory, initializeDataLayer, initializeNavigatorRegistry, intakeHours, intakeReading, isDataShapeRegistered, isDataShapeSchemaAvailable, isFilter, isGenerator, isQuestionRecord, isQuestionTypeRegistered, isReview, log, makeScheduledCardId, makeStudySessionId, mixerDebugAPI, mountMixerDebugger, mountPipelineDebugger, mountSessionDebugger, mountUserDBDebugger, newInterval, newSessionId, parseCardHistoryID, perfMark, perfMeasure, pipelineDebugAPI, planPipeline, processCustomQuestionsData, recordCardPresentation, recordUserOutcome, registerActiveController, registerBlanksCard, registerCustomQuestionTypes, registerDataShape, registerNavigator, registerQuestionType, registerSeedData, removeCustomQuestionTypes, removeDataShape, removeQuestionType, resetIntakeClock, reviewMassReading, reviewWeight, runPeriodUpdate, scoreAccuracyInZone, sessionDebugAPI, setDebugSessionId, snapshotQueues, startSessionTracking, stepIntakeClock, toggleSessionOverlay, updateLearningState, updateStrategyWeight, userDBDebugAPI, validateMigration, validateProcessorConfig, validateStaticCourse };
@@ -7,6 +7,7 @@ import { getCardOrigin } from "../core/navigators/index.mjs";
7
7
  import { sessionVersions } from "../core/versionStamps.mjs";
8
8
  import { DocType } from "../core/types/types-legacy.mjs";
9
9
  import { Loggable } from "../util/Loggable.mjs";
10
+ import { perfMark, perfMeasure } from "../util/perfMarks.mjs";
10
11
  import { recordUserOutcome } from "../core/orchestration/recording.mjs";
11
12
  import { mergeHints } from "../core/navigators/Pipeline.mjs";
12
13
  import { isQuestionRecord } from "../core/util/index.mjs";
@@ -294,11 +295,14 @@ var SessionController = class SessionController extends Loggable {
294
295
  async prepareSession() {
295
296
  if (this.sources.some((s) => typeof s.getWeightedCards !== "function")) throw new Error("[SessionController] All content sources must implement getWeightedCards().");
296
297
  clearStaleSessionDebugState();
298
+ perfMark("sk:session-prepare-start");
297
299
  const wellIndicated = await this.getWeightedContent();
298
300
  this._recordRuns("bootstrap");
299
301
  this._wellIndicatedRemaining = wellIndicated;
300
302
  if (wellIndicated >= 0 && wellIndicated < SessionController.MIN_WELL_INDICATED) this.log(`[Init] Only ${wellIndicated}/${SessionController.MIN_WELL_INDICATED} well-indicated cards in initial load`);
301
303
  await this.hydrationService.ensureHydratedCards();
304
+ perfMark("sk:session-prepared");
305
+ perfMeasure("sk:session-prepare", "sk:session-prepare-start", "sk:session-prepared");
302
306
  startSessionTracking(this.sessionId, this.supplyQ.length, this.failedQ.length);
303
307
  this._openDocPromise = this._openSessionDoc();
304
308
  this._intervalHandle = setInterval(() => {