@vue-skuilder/standalone-ui 0.1.39 → 0.2.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.
@@ -25818,7 +25818,11 @@ async function initializeDataLayer(t) {
25818
25818
  if (dataLayerInstance) return logger.warn("Data layer already initialized. Returning existing instance."), dataLayerInstance;
25819
25819
  if (await initializeNavigatorRegistry(), t.options.localStoragePrefix && (ENV.LOCAL_STORAGE_PREFIX = t.options.localStoragePrefix), t.type === "couch") {
25820
25820
  if (!t.options.COUCHDB_SERVER_URL || !t.options.COUCHDB_SERVER_PROTOCOL) throw Error("Missing CouchDB server URL or protocol");
25821
- if (ENV.COUCHDB_SERVER_PROTOCOL = t.options.COUCHDB_SERVER_PROTOCOL, ENV.COUCHDB_SERVER_URL = t.options.COUCHDB_SERVER_URL, ENV.COUCHDB_USERNAME = t.options.COUCHDB_USERNAME, ENV.COUCHDB_PASSWORD = t.options.COUCHDB_PASSWORD, t.options.COUCHDB_PASSWORD && t.options.COUCHDB_USERNAME && typeof window < "u") {
25821
+ if (ENV.COUCHDB_SERVER_PROTOCOL = t.options.COUCHDB_SERVER_PROTOCOL, ENV.COUCHDB_SERVER_URL = t.options.COUCHDB_SERVER_URL, ENV.COUCHDB_USERNAME = t.options.COUCHDB_USERNAME, ENV.COUCHDB_PASSWORD = t.options.COUCHDB_PASSWORD, t.options.courseSync) {
25822
+ let { CourseSyncService: c } = await Promise.resolve().then(() => (init_CourseSyncService(), CourseSyncService_exports));
25823
+ c.getInstance().configure(t.options.courseSync);
25824
+ }
25825
+ if (t.options.COUCHDB_PASSWORD && t.options.COUCHDB_USERNAME && typeof window < "u") {
25822
25826
  let { CouchDBSyncStrategy: c } = await Promise.resolve().then(() => (init_CouchDBSyncStrategy(), CouchDBSyncStrategy_exports)), u = new c(), d = await (await BaseUser.instance(u, t.options.COUCHDB_USERNAME)).login(t.options.COUCHDB_USERNAME, t.options.COUCHDB_PASSWORD);
25823
25827
  d.ok ? logger.info(`Successfully authenticated as ${t.options.COUCHDB_USERNAME}`) : logger.warn(`Authentication failed: ${d.error}`);
25824
25828
  }
@@ -26595,7 +26599,7 @@ function mountSessionDebugger() {
26595
26599
  let t = window;
26596
26600
  t.skuilder = t.skuilder || {}, t.skuilder.session = sessionDebugAPI;
26597
26601
  }
26598
- var import___vite_browser_external, import___vite_browser_external$1, import___vite_browser_external$2, import_browser_ponyfill, import_browser_ponyfill$1, import_browser, _SessionController2, __defProp, __getOwnPropNames, __glob, __esm, __export, init_adminDB, init_classroomDB, init_SyncStrategy, isDevelopment, logger, init_logger, GuestUsername, log, DocType, DocTypePrefixes, init_types_legacy, init_util, pouchdb_setup_default, init_pouchdb_setup, init_dataDirectory, REVIEW_TIME_FORMAT, log2, init_userDBHelpers, Loggable, init_Loggable, UpdateQueue, init_updateQueue, UsrCrsData, init_user_course_relDB, CLIENT_CACHE, init_clientCache, AlreadyTaggedErr, init_courseAPI, courseLookupDBTitle, CourseLookup, init_courseLookupDB, PipelineDebugger_exports, _activePipeline, MAX_RUNS, runHistory, DISCARDED_KEEP_TOP, _uiContainer, _selectedRunIndex, _cardSearchQuery, pipelineDebugAPI, init_PipelineDebugger, CompositeGenerator_exports, AggregationMode, DEFAULT_AGGREGATION_MODE, FREQUENCY_BOOST_FACTOR, CompositeGenerator, init_CompositeGenerator, elo_exports, ELONavigator, init_elo, generators_exports, init_generators, prescribed_exports, DEFAULT_FRESHNESS_WINDOW, DEFAULT_MAX_DIRECT_PER_RUN, DEFAULT_MAX_SUPPORT_PER_RUN, DEFAULT_HIERARCHY_DEPTH, DEFAULT_MIN_COUNT, BASE_TARGET_SCORE, BASE_SUPPORT_SCORE, DISCOVERED_SUPPORT_SCORE, MAX_TARGET_MULTIPLIER, MAX_SUPPORT_MULTIPLIER, PRESCRIBED_DEBUG_VERSION, PrescribedCardsGenerator, init_prescribed, srs_exports, DEFAULT_HEALTHY_BACKLOG, MAX_BACKLOG_PRESSURE, SRSNavigator, init_srs, types_exports, init_types, globImport_generators, init_, DEFAULT_LEARNABLE_WEIGHT, init_contentNavigationStrategy, WeightedFilter_exports, WeightedFilter, init_WeightedFilter, eloDistance_exports, DEFAULT_HALF_LIFE, DEFAULT_MIN_MULTIPLIER, DEFAULT_MAX_MULTIPLIER, init_eloDistance, hierarchyDefinition_exports, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator, init_hierarchyDefinition, userTagPreference_exports, UserTagPreferenceFilter, init_userTagPreference, filters_exports, init_filters, inferredPreferenceStub_exports, INFERRED_PREFERENCE_NAVIGATOR_STUB, init_inferredPreferenceStub, interferenceMitigator_exports, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator, init_interferenceMitigator, relativePriority_exports, DEFAULT_PRIORITY, DEFAULT_PRIORITY_INFLUENCE, DEFAULT_COMBINE_MODE, RelativePriorityNavigator, init_relativePriority, types_exports2, init_types2, userGoalStub_exports, USER_GOAL_NAVIGATOR_STUB, init_userGoalStub, globImport_filters, init_2, init_gradient, MIN_OBSERVATIONS_FOR_UPDATE, LEARNING_RATE, MAX_WEIGHT_DELTA, MIN_R_SQUARED_FOR_GRADIENT, FLAT_GRADIENT_THRESHOLD, MAX_HISTORY_LENGTH, init_learning, init_signal, init_recording, MIN_SPREAD, MAX_SPREAD, MIN_WEIGHT, MAX_WEIGHT, init_orchestration, Pipeline_exports, VERBOSE_RESULTS, Pipeline, init_Pipeline, defaults_exports, init_defaults, PipelineAssembler_exports, PipelineAssembler, init_PipelineAssembler, globImport, init_3, navigators_exports, navigatorRegistry, Navigators, NavigatorRole, NavigatorRoles, ContentNavigator, init_navigators, CoursesDB, CourseDB, init_courseDB, classroomLookupDBTitle, CLASSROOM_CONFIG, ClassroomDBBase, StudentClassroomDB, TeacherClassroomDB, ClassroomLookupDB, init_classroomDB2, AdminDB, init_adminDB2, CourseSyncService, init_CourseSyncService, init_auth, CouchDBSyncStrategy_exports, log3, CouchDBSyncStrategy, init_CouchDBSyncStrategy, isBrowser, GUEST_LOCAL_DB, localUserDB, pouchDBincludeCredentialsConfig, REVIEW_TIME_FORMAT2, init_couch, log4, BaseUser, userCoursesDoc, userClassroomsDoc, init_BaseUserDB, init_common, PouchDataLayerProvider_exports, CouchDataLayerProvider, init_PouchDataLayerProvider, pathUtils, nodeFS, StaticDataUnpacker, init_StaticDataUnpacker, StaticCourseDB, init_courseDB2, StaticCoursesDB, init_coursesDB, NoOpSyncStrategy, init_NoOpSyncStrategy, StaticDataLayerProvider_exports, StaticDataLayerProvider, init_StaticDataLayerProvider, NOT_SET, ENV, dataLayerInstance, init_factory, TagFilteredContentSource, init_TagFilteredContentSource, init_contentSource, init_courseDB3, init_dataLayerProvider, init_userDB, init_interfaces, init_user, init_strategyState, init_userOutcome, init_cardProcessor, init_types3, init_bulkImport, userDBDebugAPI, init_UserDBDebugger, init_core, duration, SrsService, EloService, ResponseProcessor, CardHydrationService, ItemQueue, CouchDBToStaticPacker, DEFAULT_MIGRATION_OPTIONS, FileSystemError, nodeFS2, nodeFS3, nodePath, StaticToCouchDBMigrator, QuotaRoundRobinMixer, MAX_RUNS2, runHistory2, mixerDebugAPI, activeSession, sessionHistory, MAX_HISTORY, sessionDebugAPI, SessionController, init_dist = __esmMin((() => {
26602
+ var import___vite_browser_external, import___vite_browser_external$1, import___vite_browser_external$2, import_browser_ponyfill, import_browser_ponyfill$1, import_browser, _SessionController2, __defProp, __getOwnPropNames, __glob, __esm, __export, init_adminDB, init_classroomDB, init_SyncStrategy, isDevelopment, logger, init_logger, GuestUsername, log, DocType, DocTypePrefixes, init_types_legacy, init_util, pouchdb_setup_default, init_pouchdb_setup, init_dataDirectory, REVIEW_TIME_FORMAT, log2, init_userDBHelpers, Loggable, init_Loggable, UpdateQueue, init_updateQueue, UsrCrsData, init_user_course_relDB, CLIENT_CACHE, init_clientCache, AlreadyTaggedErr, init_courseAPI, courseLookupDBTitle, CourseLookup, init_courseLookupDB, PipelineDebugger_exports, _activePipeline, MAX_RUNS, runHistory, DISCARDED_KEEP_TOP, _uiContainer, _selectedRunIndex, _cardSearchQuery, pipelineDebugAPI, init_PipelineDebugger, CompositeGenerator_exports, AggregationMode, DEFAULT_AGGREGATION_MODE, FREQUENCY_BOOST_FACTOR, CompositeGenerator, init_CompositeGenerator, elo_exports, ELONavigator, init_elo, generators_exports, init_generators, prescribed_exports, DEFAULT_FRESHNESS_WINDOW, DEFAULT_MAX_DIRECT_PER_RUN, DEFAULT_MAX_SUPPORT_PER_RUN, DEFAULT_HIERARCHY_DEPTH, DEFAULT_MIN_COUNT, BASE_TARGET_SCORE, BASE_SUPPORT_SCORE, DISCOVERED_SUPPORT_SCORE, MAX_TARGET_MULTIPLIER, MAX_SUPPORT_MULTIPLIER, PRESCRIBED_DEBUG_VERSION, PrescribedCardsGenerator, init_prescribed, srs_exports, DEFAULT_HEALTHY_BACKLOG, MAX_BACKLOG_PRESSURE, SRSNavigator, init_srs, types_exports, init_types, globImport_generators, init_, DEFAULT_LEARNABLE_WEIGHT, init_contentNavigationStrategy, WeightedFilter_exports, WeightedFilter, init_WeightedFilter, eloDistance_exports, DEFAULT_HALF_LIFE, DEFAULT_MIN_MULTIPLIER, DEFAULT_MAX_MULTIPLIER, init_eloDistance, hierarchyDefinition_exports, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator, init_hierarchyDefinition, userTagPreference_exports, UserTagPreferenceFilter, init_userTagPreference, filters_exports, init_filters, inferredPreferenceStub_exports, INFERRED_PREFERENCE_NAVIGATOR_STUB, init_inferredPreferenceStub, interferenceMitigator_exports, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator, init_interferenceMitigator, relativePriority_exports, DEFAULT_PRIORITY, DEFAULT_PRIORITY_INFLUENCE, DEFAULT_COMBINE_MODE, RelativePriorityNavigator, init_relativePriority, types_exports2, init_types2, userGoalStub_exports, USER_GOAL_NAVIGATOR_STUB, init_userGoalStub, globImport_filters, init_2, init_gradient, MIN_OBSERVATIONS_FOR_UPDATE, LEARNING_RATE, MAX_WEIGHT_DELTA, MIN_R_SQUARED_FOR_GRADIENT, FLAT_GRADIENT_THRESHOLD, MAX_HISTORY_LENGTH, init_learning, init_signal, init_recording, MIN_SPREAD, MAX_SPREAD, MIN_WEIGHT, MAX_WEIGHT, init_orchestration, Pipeline_exports, VERBOSE_RESULTS, Pipeline, init_Pipeline, defaults_exports, init_defaults, PipelineAssembler_exports, PipelineAssembler, init_PipelineAssembler, globImport, init_3, navigators_exports, navigatorRegistry, Navigators, NavigatorRole, NavigatorRoles, ContentNavigator, init_navigators, CoursesDB, CourseDB, init_courseDB, classroomLookupDBTitle, CLASSROOM_CONFIG, ClassroomDBBase, StudentClassroomDB, TeacherClassroomDB, ClassroomLookupDB, init_classroomDB2, AdminDB, init_adminDB2, CourseSyncService_exports, DEFAULT_REPLICATION, CourseSyncService, init_CourseSyncService, init_auth, CouchDBSyncStrategy_exports, log3, CouchDBSyncStrategy, init_CouchDBSyncStrategy, isBrowser, GUEST_LOCAL_DB, localUserDB, pouchDBincludeCredentialsConfig, REVIEW_TIME_FORMAT2, init_couch, log4, BaseUser, userCoursesDoc, userClassroomsDoc, init_BaseUserDB, init_common, PouchDataLayerProvider_exports, CouchDataLayerProvider, init_PouchDataLayerProvider, pathUtils, nodeFS, StaticDataUnpacker, init_StaticDataUnpacker, StaticCourseDB, init_courseDB2, StaticCoursesDB, init_coursesDB, NoOpSyncStrategy, init_NoOpSyncStrategy, StaticDataLayerProvider_exports, StaticDataLayerProvider, init_StaticDataLayerProvider, NOT_SET, ENV, dataLayerInstance, init_factory, TagFilteredContentSource, init_TagFilteredContentSource, init_contentSource, init_courseDB3, init_dataLayerProvider, init_userDB, init_interfaces, init_user, init_strategyState, init_userOutcome, init_cardProcessor, init_types3, init_bulkImport, userDBDebugAPI, init_UserDBDebugger, init_core, duration, SrsService, EloService, ResponseProcessor, CardHydrationService, ItemQueue, CouchDBToStaticPacker, DEFAULT_MIGRATION_OPTIONS, FileSystemError, nodeFS2, nodeFS3, nodePath, StaticToCouchDBMigrator, QuotaRoundRobinMixer, MAX_RUNS2, runHistory2, mixerDebugAPI, activeSession, sessionHistory, MAX_HISTORY, sessionDebugAPI, SessionController, init_dist = __esmMin((() => {
26599
26603
  init_defineProperty(), init_index_browser_es$5(), init_index_browser_es(), init_index_es(), import___vite_browser_external = /* @__PURE__ */ __toESM$2(require___vite_browser_external(), 1), import___vite_browser_external$1 = /* @__PURE__ */ __toESM$2(require___vite_browser_external(), 1), import___vite_browser_external$2 = /* @__PURE__ */ __toESM$2(require___vite_browser_external(), 1), init_moment(), init_dist$1(), init_esm_browser(), import_browser_ponyfill = /* @__PURE__ */ __toESM$2(require_browser_ponyfill(), 1), import_browser_ponyfill$1 = /* @__PURE__ */ __toESM$2(require_browser_ponyfill(), 1), import_browser = /* @__PURE__ */ __toESM$2(require_browser(), 1), __defProp = Object.defineProperty, __getOwnPropNames = Object.getOwnPropertyNames, __glob = (t) => (c) => {
26600
26604
  var u = t[c];
26601
26605
  if (u) return u();
@@ -28943,15 +28947,24 @@ ${t.stack}` : JSON.stringify(t);
28943
28947
  }));
28944
28948
  }
28945
28949
  };
28946
- } }), init_CourseSyncService = __esm({ "src/impl/couch/CourseSyncService.ts"() {
28950
+ } }), CourseSyncService_exports = {}, __export(CourseSyncService_exports, { CourseSyncService: () => CourseSyncService }), init_CourseSyncService = __esm({ "src/impl/couch/CourseSyncService.ts"() {
28947
28951
  var t;
28948
- init_pouchdb_setup(), init_couch(), init_logger(), CourseSyncService = (t = class _CourseSyncService {
28952
+ init_pouchdb_setup(), init_couch(), init_logger(), DEFAULT_REPLICATION = {
28953
+ batchSize: 1e3,
28954
+ batchesLimit: 5
28955
+ }, CourseSyncService = (t = class _CourseSyncService {
28949
28956
  constructor() {
28950
- _defineProperty$2(this, "entries", /* @__PURE__ */ new Map());
28957
+ _defineProperty$2(this, "entries", /* @__PURE__ */ new Map()), _defineProperty$2(this, "replicationOptions", DEFAULT_REPLICATION);
28951
28958
  }
28952
28959
  static getInstance() {
28953
28960
  return _CourseSyncService.instance || (_CourseSyncService.instance = new _CourseSyncService()), _CourseSyncService.instance;
28954
28961
  }
28962
+ configure(t) {
28963
+ t.replication && (this.replicationOptions = {
28964
+ ...DEFAULT_REPLICATION,
28965
+ ...t.replication
28966
+ }, logger.info(`[CourseSyncService] Replication configured: batch_size=${this.replicationOptions.batchSize}, batches_limit=${this.replicationOptions.batchesLimit}`));
28967
+ }
28955
28968
  static resetInstance() {
28956
28969
  if (_CourseSyncService.instance) {
28957
28970
  for (let [, t] of _CourseSyncService.instance.entries) t.localDB && t.localDB.close().catch(() => {});
@@ -28998,7 +29011,7 @@ ${t.stack}` : JSON.stringify(t);
28998
29011
  let d = this.localDBName(t), m = new pouchdb_setup_default(d);
28999
29012
  await this.isLocalEpochStale(t, m) && (logger.info(`[CourseSyncService] Stale local DB detected for course ${t} \u2014 destroying before sync`), await m.destroy(), m = new pouchdb_setup_default(d)), c.localDB = m;
29000
29013
  let g = this.getRemoteDB(t), b = Date.now();
29001
- logger.info(`[CourseSyncService] Starting one-shot replication for course ${t}`);
29014
+ logger.info(`[CourseSyncService] Starting one-shot replication for course ${t} (batch_size=${this.replicationOptions.batchSize}, batches_limit=${this.replicationOptions.batchesLimit})`);
29002
29015
  let S = await this.replicate(g, m), C = Date.now() - b;
29003
29016
  logger.info(`[CourseSyncService] Replication complete for course ${t}: ${S.docs_written} docs in ${C}ms`), c.status = { state: "warming-views" };
29004
29017
  let w = Date.now();
@@ -29032,7 +29045,10 @@ ${t.stack}` : JSON.stringify(t);
29032
29045
  }
29033
29046
  replicate(t, c) {
29034
29047
  return new Promise((u, d) => {
29035
- pouchdb_setup_default.replicate(t, c, {}).on("complete", (t) => {
29048
+ pouchdb_setup_default.replicate(t, c, {
29049
+ batch_size: this.replicationOptions.batchSize,
29050
+ batches_limit: this.replicationOptions.batchesLimit
29051
+ }).on("complete", (t) => {
29036
29052
  u(t);
29037
29053
  }).on("error", (t) => {
29038
29054
  d(t);
@@ -31918,7 +31934,7 @@ ${c.id}:`), logger.info(JSON.stringify(c.doc, null, 2));
31918
31934
  return this._secondsRemaining - (d + m) > 20 ? (c = .5, u = .9) : this._secondsRemaining - d > 20 ? (c = .05, u = .9) : (c = .01, u = .1), this.failedQ.length === 0 && (u = 1), this.reviewQ.length === 0 && (c = u), t < c && this.newQ.length ? this.newQ.peek(0) : t < u && this.reviewQ.length ? this.reviewQ.peek(0) : this.failedQ.length ? this.failedQ.peek(0) : (this.log("No more cards available for the session!"), null);
31919
31935
  }
31920
31936
  async nextCard(t = "dismiss-success") {
31921
- if (this.dismissCurrentCard(t), this._minCardsGuarantee > 0 && (this._minCardsGuarantee--, this.log(`[CardGuarantee] ${this._minCardsGuarantee} guaranteed cards remaining`)), this._replanPromise && (this.log("nextCard: awaiting in-flight replan before drawing"), await this._replanPromise), this.newQ.length <= 1 && this._secondsRemaining > 0 && !this._replanPromise) {
31937
+ if (this.dismissCurrentCard(t), this._minCardsGuarantee > 0 && (this._minCardsGuarantee--, this.log(`[CardGuarantee] ${this._minCardsGuarantee} guaranteed cards remaining`)), this._replanPromise && this.newQ.length === 0 && this.reviewQ.length === 0 && this.failedQ.length === 0 && (this.log("nextCard: queues empty, awaiting in-flight replan before drawing"), await this._replanPromise), this.newQ.length <= 1 && this._secondsRemaining > 0 && !this._replanPromise) {
31922
31938
  this._suppressQualityReplan = !1;
31923
31939
  let t = this.reviewQ.length + this.failedQ.length;
31924
31940
  this.log(`[AutoReplan:depletion] newQ has ${this.newQ.length} card(s) (${t} in other queues) with ${this._secondsRemaining}s remaining. Triggering background replan.`), this.requestReplan();