@vue-skuilder/db 0.2.30 → 0.2.32
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-B6FrSihy.d.cts → contentSource-CTQ4kWhR.d.cts} +41 -4
- package/dist/{contentSource-CqJmbOZN.d.ts → contentSource-JmWYu8IK.d.ts} +41 -4
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +138 -79
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +90 -30
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-DUxDqMtZ.d.cts → dataLayerProvider-DfI_KYAe.d.cts} +1 -1
- package/dist/{dataLayerProvider-B9_UCvkR.d.ts → dataLayerProvider-rlLE2Mf-.d.ts} +1 -1
- package/dist/diagnostics/index.d.cts +18 -3
- package/dist/diagnostics/index.d.ts +18 -3
- package/dist/diagnostics/index.js +171 -135
- package/dist/diagnostics/index.js.map +1 -1
- package/dist/diagnostics/index.mjs +168 -135
- package/dist/diagnostics/index.mjs.map +1 -1
- package/dist/impl/couch/index.d.cts +8 -2
- package/dist/impl/couch/index.d.ts +8 -2
- package/dist/impl/couch/index.js +142 -83
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +90 -30
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.d.cts +2 -2
- package/dist/impl/static/index.d.ts +2 -2
- package/dist/impl/static/index.js +129 -70
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +90 -30
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +204 -114
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +128 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/navigators/Pipeline.ts +13 -2
- package/src/core/navigators/PipelineAssembler.ts +2 -0
- package/src/core/navigators/PipelineDebugger.ts +54 -23
- package/src/core/navigators/defaults.ts +4 -1
- package/src/core/navigators/filters/eloDistance.ts +7 -8
- package/src/core/navigators/generators/elo.ts +8 -2
- package/src/core/navigators/generators/prescribed.ts +7 -5
- package/src/core/types/studySession.ts +23 -2
- package/src/core/versionStamps.ts +66 -0
- package/src/diagnostics/derive.ts +5 -2
- package/src/diagnostics/pipeline.ts +28 -0
- package/src/diagnostics/text.ts +24 -4
- package/src/factory.ts +6 -0
- package/src/study/SessionController.ts +6 -1
- package/src/study/services/EloService.ts +33 -6
- package/tsup.config.ts +5 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as ClassroomDBInterface, A as AdminDBInterface } from '../../classroomDB-DLTtLZct.cjs';
|
|
2
|
-
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, k as CourseInfo, l as StudySessionItem, D as DataLayerResult, b as ContentNavigationStrategyData, m as ContentNavigator, n as ReplanHints, G as GeneratorResult } from '../../contentSource-
|
|
3
|
-
import { D as DataLayerProvider } from '../../dataLayerProvider-
|
|
2
|
+
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, k as CourseInfo, l as StudySessionItem, D as DataLayerResult, b as ContentNavigationStrategyData, m as ContentNavigator, n as ReplanHints, G as GeneratorResult } from '../../contentSource-CTQ4kWhR.cjs';
|
|
3
|
+
import { D as DataLayerProvider } from '../../dataLayerProvider-DfI_KYAe.cjs';
|
|
4
4
|
import { S as StaticCourseManifest } from '../../types-D0oQeJAi.cjs';
|
|
5
5
|
import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
|
|
6
6
|
import { S as SkuilderCourseData, d as QualifiedCardID, e as TagStub, T as Tag } from '../../types-legacy-BkOYOR6U.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as ClassroomDBInterface, A as AdminDBInterface } from '../../classroomDB-DLTtLZct.js';
|
|
2
|
-
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, k as CourseInfo, l as StudySessionItem, D as DataLayerResult, b as ContentNavigationStrategyData, m as ContentNavigator, n as ReplanHints, G as GeneratorResult } from '../../contentSource-
|
|
3
|
-
import { D as DataLayerProvider } from '../../dataLayerProvider-
|
|
2
|
+
import { U as UserDBInterface, C as CourseDBInterface, a as CoursesDBInterface, k as CourseInfo, l as StudySessionItem, D as DataLayerResult, b as ContentNavigationStrategyData, m as ContentNavigator, n as ReplanHints, G as GeneratorResult } from '../../contentSource-JmWYu8IK.js';
|
|
3
|
+
import { D as DataLayerProvider } from '../../dataLayerProvider-rlLE2Mf-.js';
|
|
4
4
|
import { S as StaticCourseManifest } from '../../types-dXWfyz9B.js';
|
|
5
5
|
import { CourseConfig, CourseElo, DataShape } from '@vue-skuilder/common';
|
|
6
6
|
import { S as SkuilderCourseData, d as QualifiedCardID, e as TagStub, T as Tag } from '../../types-legacy-BkOYOR6U.js';
|
|
@@ -504,13 +504,12 @@ function clearRunHistory() {
|
|
|
504
504
|
_pendingRuns = [];
|
|
505
505
|
}
|
|
506
506
|
function getOrigin(card) {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
return "unknown";
|
|
507
|
+
return card.reviewID ? "review" : "new";
|
|
508
|
+
}
|
|
509
|
+
function requiredBy(card) {
|
|
510
|
+
return card.provenance.find(
|
|
511
|
+
(p) => p.strategy === "ephemeralHint" && p.score === Number.POSITIVE_INFINITY
|
|
512
|
+
)?.strategyName;
|
|
514
513
|
}
|
|
515
514
|
function captureRun(report) {
|
|
516
515
|
const fullReport = {
|
|
@@ -534,17 +533,23 @@ function parseCardElo(provenance) {
|
|
|
534
533
|
}
|
|
535
534
|
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards, regulators) {
|
|
536
535
|
const selectedIds = new Set(selectedCards.map((c) => c.cardId));
|
|
537
|
-
const toReport = (card) =>
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
536
|
+
const toReport = (card) => {
|
|
537
|
+
const required = requiredBy(card);
|
|
538
|
+
const first = card.provenance[0];
|
|
539
|
+
const generator = first && first.strategy !== "ephemeralHint" ? first.strategyName || first.strategy : void 0;
|
|
540
|
+
return {
|
|
541
|
+
cardId: card.cardId,
|
|
542
|
+
courseId: card.courseId,
|
|
543
|
+
origin: getOrigin(card),
|
|
544
|
+
...generator ? { generator } : {},
|
|
545
|
+
...required ? { required } : {},
|
|
546
|
+
finalScore: card.score,
|
|
547
|
+
cardElo: card.cardElo ?? parseCardElo(card.provenance),
|
|
548
|
+
provenance: card.provenance,
|
|
549
|
+
tags: card.tags,
|
|
550
|
+
selected: selectedIds.has(card.cardId)
|
|
551
|
+
};
|
|
552
|
+
};
|
|
548
553
|
const selectedReported = [];
|
|
549
554
|
const nearMissReported = [];
|
|
550
555
|
const discardedTailCards = [];
|
|
@@ -1673,10 +1678,14 @@ var init_elo = __esm({
|
|
|
1673
1678
|
const userElo = (0, import_common5.toCourseElo)(courseReg.elo);
|
|
1674
1679
|
userGlobalElo = userElo.global.score;
|
|
1675
1680
|
}
|
|
1676
|
-
const activeCards = await
|
|
1681
|
+
const [activeCards, seenCards] = await Promise.all([
|
|
1682
|
+
this.user.getActiveCards(),
|
|
1683
|
+
this.user.getSeenCards(this.course.getCourseID()).catch(() => [])
|
|
1684
|
+
]);
|
|
1685
|
+
const notNew = /* @__PURE__ */ new Set([...activeCards.map((ac) => ac.cardID), ...seenCards]);
|
|
1677
1686
|
const newCards = (await this.course.getCardsCenteredAtELO(
|
|
1678
1687
|
{ limit, elo: "user" },
|
|
1679
|
-
(c) => !
|
|
1688
|
+
(c) => !notNew.has(c.cardID)
|
|
1680
1689
|
)).map((c) => ({ ...c, status: "new" }));
|
|
1681
1690
|
const scored = newCards.map((c) => {
|
|
1682
1691
|
const cardElo = c.elo ?? 1e3;
|
|
@@ -1769,11 +1778,11 @@ function formatAge(ms) {
|
|
|
1769
1778
|
}
|
|
1770
1779
|
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
1771
1780
|
if (minCount <= 0) return [];
|
|
1772
|
-
const exposeTags = new Set(tags.filter((tag) =>
|
|
1781
|
+
const exposeTags = new Set(tags.filter((tag) => (0, import_common6.tagRole)(tag) === "expose"));
|
|
1773
1782
|
for (const tag of tags) {
|
|
1774
|
-
if (
|
|
1775
|
-
const
|
|
1776
|
-
if (
|
|
1783
|
+
if ((0, import_common6.tagRole)(tag) !== "intro") continue;
|
|
1784
|
+
const expose = (0, import_common6.withTagRole)(tag, "expose");
|
|
1785
|
+
if (expose) exposeTags.add(expose);
|
|
1777
1786
|
}
|
|
1778
1787
|
return [...exposeTags].filter((tag) => {
|
|
1779
1788
|
const tagElo = userTagElo[tag];
|
|
@@ -1783,10 +1792,11 @@ function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
|
1783
1792
|
function pickTopByScore(cards, limit) {
|
|
1784
1793
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
1785
1794
|
}
|
|
1786
|
-
var DEFAULT_FRESHNESS_WINDOW, DEFAULT_MAX_DIRECT_PER_RUN, DEFAULT_MAX_SUPPORT_PER_RUN, DEFAULT_HIERARCHY_DEPTH, DEFAULT_MIN_COUNT, DEFAULT_PRACTICE_MIN_COUNT, DEFAULT_MAX_PRACTICE_PER_RUN, BASE_TARGET_SCORE, BASE_SUPPORT_SCORE, DISCOVERED_SUPPORT_SCORE, BASE_PRACTICE_SCORE, PRACTICE_BASE_MULT, MAX_PRACTICE_MULTIPLIER, PRACTICE_STALENESS_BUMP_PER_DAY, MAX_TARGET_MULTIPLIER, MAX_SUPPORT_MULTIPLIER, PRESCRIBED_DEBUG_VERSION, PrescribedCardsGenerator;
|
|
1795
|
+
var import_common6, DEFAULT_FRESHNESS_WINDOW, DEFAULT_MAX_DIRECT_PER_RUN, DEFAULT_MAX_SUPPORT_PER_RUN, DEFAULT_HIERARCHY_DEPTH, DEFAULT_MIN_COUNT, DEFAULT_PRACTICE_MIN_COUNT, DEFAULT_MAX_PRACTICE_PER_RUN, BASE_TARGET_SCORE, BASE_SUPPORT_SCORE, DISCOVERED_SUPPORT_SCORE, BASE_PRACTICE_SCORE, PRACTICE_BASE_MULT, MAX_PRACTICE_MULTIPLIER, PRACTICE_STALENESS_BUMP_PER_DAY, MAX_TARGET_MULTIPLIER, MAX_SUPPORT_MULTIPLIER, PRESCRIBED_DEBUG_VERSION, PrescribedCardsGenerator;
|
|
1787
1796
|
var init_prescribed = __esm({
|
|
1788
1797
|
"src/core/navigators/generators/prescribed.ts"() {
|
|
1789
1798
|
"use strict";
|
|
1799
|
+
import_common6 = require("@vue-skuilder/common");
|
|
1790
1800
|
init_navigators();
|
|
1791
1801
|
init_StrategyPressureDebugger();
|
|
1792
1802
|
init_logger();
|
|
@@ -3017,7 +3027,9 @@ function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
|
|
|
3017
3027
|
const tags = [];
|
|
3018
3028
|
for (const tag of cardTags) {
|
|
3019
3029
|
const user = userElo.tags[tag];
|
|
3020
|
-
if (!user || user.score ===
|
|
3030
|
+
if ((0, import_common7.isCountOnlyTag)(tag) || !user || user.score === import_common7.COUNT_ONLY_SCORE || user.count < minTagCount) {
|
|
3031
|
+
continue;
|
|
3032
|
+
}
|
|
3021
3033
|
const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
|
|
3022
3034
|
tags.push({
|
|
3023
3035
|
tag,
|
|
@@ -3089,11 +3101,12 @@ function createEloDistanceFilter(config) {
|
|
|
3089
3101
|
transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
|
|
3090
3102
|
};
|
|
3091
3103
|
}
|
|
3092
|
-
var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF,
|
|
3104
|
+
var import_common7, DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, DEFAULT_CARD_ELO, MULTI_DIM_ELO_KEY, multiDimElo, EloDistanceFilter;
|
|
3093
3105
|
var init_eloDistance = __esm({
|
|
3094
3106
|
"src/core/navigators/filters/eloDistance.ts"() {
|
|
3095
3107
|
"use strict";
|
|
3096
3108
|
init_navigators();
|
|
3109
|
+
import_common7 = require("@vue-skuilder/common");
|
|
3097
3110
|
init_logger();
|
|
3098
3111
|
DEFAULT_ELO_DISTANCE_CONFIG = {
|
|
3099
3112
|
halfLife: 300,
|
|
@@ -3103,7 +3116,6 @@ var init_eloDistance = __esm({
|
|
|
3103
3116
|
minTagCount: 3
|
|
3104
3117
|
};
|
|
3105
3118
|
TAG_CONFIDENCE_HALF = 10;
|
|
3106
|
-
COUNT_ONLY_SENTINEL = -1;
|
|
3107
3119
|
DEFAULT_CARD_ELO = 1e3;
|
|
3108
3120
|
MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
|
|
3109
3121
|
multiDimElo = readMultiDimElo();
|
|
@@ -3146,12 +3158,12 @@ var hierarchyDefinition_exports = {};
|
|
|
3146
3158
|
__export(hierarchyDefinition_exports, {
|
|
3147
3159
|
default: () => HierarchyDefinitionNavigator
|
|
3148
3160
|
});
|
|
3149
|
-
var
|
|
3161
|
+
var import_common8, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
|
|
3150
3162
|
var init_hierarchyDefinition = __esm({
|
|
3151
3163
|
"src/core/navigators/filters/hierarchyDefinition.ts"() {
|
|
3152
3164
|
"use strict";
|
|
3153
3165
|
init_navigators();
|
|
3154
|
-
|
|
3166
|
+
import_common8 = require("@vue-skuilder/common");
|
|
3155
3167
|
init_logger();
|
|
3156
3168
|
DEFAULT_MIN_COUNT2 = 3;
|
|
3157
3169
|
HierarchyDefinitionNavigator = class _HierarchyDefinitionNavigator extends ContentNavigator {
|
|
@@ -3201,7 +3213,7 @@ var init_hierarchyDefinition = __esm({
|
|
|
3201
3213
|
const mastered = /* @__PURE__ */ new Set();
|
|
3202
3214
|
try {
|
|
3203
3215
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3204
|
-
const userElo = (0,
|
|
3216
|
+
const userElo = (0, import_common8.toCourseElo)(courseReg.elo);
|
|
3205
3217
|
for (const prereqs of Object.values(this.config.prerequisites)) {
|
|
3206
3218
|
for (const prereq of prereqs) {
|
|
3207
3219
|
const tagElo = userElo.tags[prereq.tag];
|
|
@@ -3573,12 +3585,12 @@ var interferenceMitigator_exports = {};
|
|
|
3573
3585
|
__export(interferenceMitigator_exports, {
|
|
3574
3586
|
default: () => InterferenceMitigatorNavigator
|
|
3575
3587
|
});
|
|
3576
|
-
var
|
|
3588
|
+
var import_common9, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
|
|
3577
3589
|
var init_interferenceMitigator = __esm({
|
|
3578
3590
|
"src/core/navigators/filters/interferenceMitigator.ts"() {
|
|
3579
3591
|
"use strict";
|
|
3580
3592
|
init_navigators();
|
|
3581
|
-
|
|
3593
|
+
import_common9 = require("@vue-skuilder/common");
|
|
3582
3594
|
DEFAULT_MIN_COUNT3 = 10;
|
|
3583
3595
|
DEFAULT_MIN_ELAPSED_DAYS = 3;
|
|
3584
3596
|
DEFAULT_INTERFERENCE_DECAY = 0.8;
|
|
@@ -3663,7 +3675,7 @@ var init_interferenceMitigator = __esm({
|
|
|
3663
3675
|
const immature = /* @__PURE__ */ new Set();
|
|
3664
3676
|
try {
|
|
3665
3677
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3666
|
-
const userElo = (0,
|
|
3678
|
+
const userElo = (0, import_common9.toCourseElo)(courseReg.elo);
|
|
3667
3679
|
const minCount = this.config.maturityThreshold?.minCount ?? DEFAULT_MIN_COUNT3;
|
|
3668
3680
|
const minElo = this.config.maturityThreshold?.minElo;
|
|
3669
3681
|
const minElapsedDays = this.config.maturityThreshold?.minElapsedDays ?? DEFAULT_MIN_ELAPSED_DAYS;
|
|
@@ -4208,11 +4220,11 @@ function logCardProvenance(cards, maxCards = 3) {
|
|
|
4208
4220
|
}
|
|
4209
4221
|
}
|
|
4210
4222
|
}
|
|
4211
|
-
var
|
|
4223
|
+
var import_common10, VERBOSE_RESULTS, Pipeline;
|
|
4212
4224
|
var init_Pipeline = __esm({
|
|
4213
4225
|
"src/core/navigators/Pipeline.ts"() {
|
|
4214
4226
|
"use strict";
|
|
4215
|
-
|
|
4227
|
+
import_common10 = require("@vue-skuilder/common");
|
|
4216
4228
|
init_navigators();
|
|
4217
4229
|
init_logger();
|
|
4218
4230
|
init_orchestration();
|
|
@@ -4232,6 +4244,11 @@ var init_Pipeline = __esm({
|
|
|
4232
4244
|
* This eliminates a remote getCourseConfig() round trip per pipeline run.
|
|
4233
4245
|
*/
|
|
4234
4246
|
_cachedOrchestration = null;
|
|
4247
|
+
/**
|
|
4248
|
+
* Hash of the strategy docs this pipeline was assembled from (see
|
|
4249
|
+
* versionStamps.ts), set by whoever builds it. Stamped on every run.
|
|
4250
|
+
*/
|
|
4251
|
+
strategyHash;
|
|
4235
4252
|
/**
|
|
4236
4253
|
* Persistent tag cache. Maps cardId → tag names.
|
|
4237
4254
|
*
|
|
@@ -4425,7 +4442,8 @@ var init_Pipeline = __esm({
|
|
|
4425
4442
|
logResultCards(result);
|
|
4426
4443
|
logCardProvenance(result, 3);
|
|
4427
4444
|
try {
|
|
4428
|
-
const
|
|
4445
|
+
const courseConfig = await this.course?.getCourseConfig().catch(() => void 0);
|
|
4446
|
+
const courseName = courseConfig?.name;
|
|
4429
4447
|
const report = buildRunReport(
|
|
4430
4448
|
this.course?.getCourseID() || "unknown",
|
|
4431
4449
|
courseName,
|
|
@@ -4440,7 +4458,11 @@ var init_Pipeline = __esm({
|
|
|
4440
4458
|
scoredCards,
|
|
4441
4459
|
regulators
|
|
4442
4460
|
);
|
|
4443
|
-
|
|
4461
|
+
const versions = {
|
|
4462
|
+
...this.strategyHash ? { strategies: this.strategyHash } : {},
|
|
4463
|
+
...courseConfig?.contentVersion ? { content: courseConfig.contentVersion } : {}
|
|
4464
|
+
};
|
|
4465
|
+
captureRun({ ...report, ...Object.keys(versions).length ? { versions } : {} });
|
|
4444
4466
|
} catch (e) {
|
|
4445
4467
|
logger.debug(`[Pipeline] Failed to capture debug run: ${e}`);
|
|
4446
4468
|
}
|
|
@@ -4701,7 +4723,7 @@ var init_Pipeline = __esm({
|
|
|
4701
4723
|
let userCourseElo;
|
|
4702
4724
|
try {
|
|
4703
4725
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
4704
|
-
userCourseElo = (0,
|
|
4726
|
+
userCourseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
4705
4727
|
userElo = userCourseElo.global.score;
|
|
4706
4728
|
} catch (e) {
|
|
4707
4729
|
logger.debug(`[Pipeline] Could not get user ELO, using default: ${e}`);
|
|
@@ -4763,7 +4785,7 @@ var init_Pipeline = __esm({
|
|
|
4763
4785
|
*/
|
|
4764
4786
|
async getTagEloStatus(tagFilter) {
|
|
4765
4787
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
4766
|
-
const courseElo = (0,
|
|
4788
|
+
const courseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
4767
4789
|
const result = {};
|
|
4768
4790
|
if (!tagFilter) {
|
|
4769
4791
|
for (const [tag, data] of Object.entries(courseElo.tags)) {
|
|
@@ -4937,6 +4959,36 @@ var init_Pipeline = __esm({
|
|
|
4937
4959
|
}
|
|
4938
4960
|
});
|
|
4939
4961
|
|
|
4962
|
+
// src/core/versionStamps.ts
|
|
4963
|
+
function stableStringify(value) {
|
|
4964
|
+
if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
|
|
4965
|
+
if (value && typeof value === "object") {
|
|
4966
|
+
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
4967
|
+
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(",")}}`;
|
|
4968
|
+
}
|
|
4969
|
+
return JSON.stringify(value);
|
|
4970
|
+
}
|
|
4971
|
+
function strategyHash(strategies) {
|
|
4972
|
+
if (strategies.length === 0) return DEFAULT_STRATEGY_HASH;
|
|
4973
|
+
const text = strategies.map((s) => {
|
|
4974
|
+
const { _rev: _ignored, ...rest } = s;
|
|
4975
|
+
return stableStringify(rest);
|
|
4976
|
+
}).sort().join("\n");
|
|
4977
|
+
let h = 2166136261;
|
|
4978
|
+
for (let i = 0; i < text.length; i++) {
|
|
4979
|
+
h ^= text.charCodeAt(i);
|
|
4980
|
+
h = Math.imul(h, 16777619);
|
|
4981
|
+
}
|
|
4982
|
+
return (h >>> 0).toString(16).padStart(8, "0");
|
|
4983
|
+
}
|
|
4984
|
+
var DEFAULT_STRATEGY_HASH;
|
|
4985
|
+
var init_versionStamps = __esm({
|
|
4986
|
+
"src/core/versionStamps.ts"() {
|
|
4987
|
+
"use strict";
|
|
4988
|
+
DEFAULT_STRATEGY_HASH = "default";
|
|
4989
|
+
}
|
|
4990
|
+
});
|
|
4991
|
+
|
|
4940
4992
|
// src/core/navigators/defaults.ts
|
|
4941
4993
|
var defaults_exports = {};
|
|
4942
4994
|
__export(defaults_exports, {
|
|
@@ -4989,7 +5041,9 @@ function createDefaultPipeline(user, course) {
|
|
|
4989
5041
|
course,
|
|
4990
5042
|
createDefaultEloDistanceStrategy(courseId)
|
|
4991
5043
|
);
|
|
4992
|
-
|
|
5044
|
+
const pipeline = new Pipeline(compositeGenerator, [eloDistanceFilter], user, course);
|
|
5045
|
+
pipeline.strategyHash = DEFAULT_STRATEGY_HASH;
|
|
5046
|
+
return pipeline;
|
|
4993
5047
|
}
|
|
4994
5048
|
var init_defaults = __esm({
|
|
4995
5049
|
"src/core/navigators/defaults.ts"() {
|
|
@@ -5001,6 +5055,7 @@ var init_defaults = __esm({
|
|
|
5001
5055
|
init_srs();
|
|
5002
5056
|
init_eloDistance();
|
|
5003
5057
|
init_types_legacy();
|
|
5058
|
+
init_versionStamps();
|
|
5004
5059
|
}
|
|
5005
5060
|
});
|
|
5006
5061
|
|
|
@@ -5144,6 +5199,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5144
5199
|
init_logger();
|
|
5145
5200
|
init_CompositeGenerator();
|
|
5146
5201
|
init_pipelinePlan();
|
|
5202
|
+
init_versionStamps();
|
|
5147
5203
|
PipelineAssembler = class {
|
|
5148
5204
|
/**
|
|
5149
5205
|
* Assembles a navigation pipeline from strategy documents.
|
|
@@ -5225,6 +5281,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5225
5281
|
}
|
|
5226
5282
|
}
|
|
5227
5283
|
const pipeline = new Pipeline(generator, filters, user, course);
|
|
5284
|
+
pipeline.strategyHash = strategyHash(strategies);
|
|
5228
5285
|
logger.debug(
|
|
5229
5286
|
`[PipelineAssembler] Assembled pipeline with ${generatorStrategies.length} generator(s) and ${filters.length} filter(s)`
|
|
5230
5287
|
);
|
|
@@ -5589,11 +5646,11 @@ var init_navigators = __esm({
|
|
|
5589
5646
|
});
|
|
5590
5647
|
|
|
5591
5648
|
// src/impl/couch/courseDB.ts
|
|
5592
|
-
var
|
|
5649
|
+
var import_common11;
|
|
5593
5650
|
var init_courseDB = __esm({
|
|
5594
5651
|
"src/impl/couch/courseDB.ts"() {
|
|
5595
5652
|
"use strict";
|
|
5596
|
-
|
|
5653
|
+
import_common11 = require("@vue-skuilder/common");
|
|
5597
5654
|
init_couch();
|
|
5598
5655
|
init_updateQueue();
|
|
5599
5656
|
init_types_legacy();
|
|
@@ -5656,14 +5713,14 @@ var init_auth = __esm({
|
|
|
5656
5713
|
});
|
|
5657
5714
|
|
|
5658
5715
|
// src/impl/couch/CouchDBSyncStrategy.ts
|
|
5659
|
-
var
|
|
5716
|
+
var import_common12;
|
|
5660
5717
|
var init_CouchDBSyncStrategy = __esm({
|
|
5661
5718
|
"src/impl/couch/CouchDBSyncStrategy.ts"() {
|
|
5662
5719
|
"use strict";
|
|
5663
5720
|
init_factory();
|
|
5664
5721
|
init_types_legacy();
|
|
5665
5722
|
init_logger();
|
|
5666
|
-
|
|
5723
|
+
import_common12 = require("@vue-skuilder/common");
|
|
5667
5724
|
init_common();
|
|
5668
5725
|
init_pouchdb_setup();
|
|
5669
5726
|
init_couch();
|
|
@@ -5737,13 +5794,13 @@ function getStreak(records) {
|
|
|
5737
5794
|
function getLapses(records) {
|
|
5738
5795
|
return records.filter((r) => r.isCorrect === false).length;
|
|
5739
5796
|
}
|
|
5740
|
-
var import_moment4,
|
|
5797
|
+
var import_moment4, import_common14, duration;
|
|
5741
5798
|
var init_SpacedRepetition = __esm({
|
|
5742
5799
|
"src/study/SpacedRepetition.ts"() {
|
|
5743
5800
|
"use strict";
|
|
5744
5801
|
init_util();
|
|
5745
5802
|
import_moment4 = __toESM(require("moment"), 1);
|
|
5746
|
-
|
|
5803
|
+
import_common14 = require("@vue-skuilder/common");
|
|
5747
5804
|
init_logger();
|
|
5748
5805
|
duration = import_moment4.default.duration;
|
|
5749
5806
|
}
|
|
@@ -5762,42 +5819,42 @@ var init_SrsService = __esm({
|
|
|
5762
5819
|
});
|
|
5763
5820
|
|
|
5764
5821
|
// src/study/services/tagRecent.ts
|
|
5765
|
-
var
|
|
5822
|
+
var import_common15;
|
|
5766
5823
|
var init_tagRecent = __esm({
|
|
5767
5824
|
"src/study/services/tagRecent.ts"() {
|
|
5768
5825
|
"use strict";
|
|
5769
|
-
|
|
5826
|
+
import_common15 = require("@vue-skuilder/common");
|
|
5770
5827
|
}
|
|
5771
5828
|
});
|
|
5772
5829
|
|
|
5773
5830
|
// src/study/services/EloService.ts
|
|
5774
|
-
var
|
|
5831
|
+
var import_common16;
|
|
5775
5832
|
var init_EloService = __esm({
|
|
5776
5833
|
"src/study/services/EloService.ts"() {
|
|
5777
5834
|
"use strict";
|
|
5778
|
-
|
|
5835
|
+
import_common16 = require("@vue-skuilder/common");
|
|
5779
5836
|
init_logger();
|
|
5780
5837
|
init_tagRecent();
|
|
5781
5838
|
}
|
|
5782
5839
|
});
|
|
5783
5840
|
|
|
5784
5841
|
// src/study/services/ResponseProcessor.ts
|
|
5785
|
-
var
|
|
5842
|
+
var import_common17;
|
|
5786
5843
|
var init_ResponseProcessor = __esm({
|
|
5787
5844
|
"src/study/services/ResponseProcessor.ts"() {
|
|
5788
5845
|
"use strict";
|
|
5789
5846
|
init_core();
|
|
5790
5847
|
init_logger();
|
|
5791
|
-
|
|
5848
|
+
import_common17 = require("@vue-skuilder/common");
|
|
5792
5849
|
}
|
|
5793
5850
|
});
|
|
5794
5851
|
|
|
5795
5852
|
// src/study/services/CardHydrationService.ts
|
|
5796
|
-
var
|
|
5853
|
+
var import_common18;
|
|
5797
5854
|
var init_CardHydrationService = __esm({
|
|
5798
5855
|
"src/study/services/CardHydrationService.ts"() {
|
|
5799
5856
|
"use strict";
|
|
5800
|
-
|
|
5857
|
+
import_common18 = require("@vue-skuilder/common");
|
|
5801
5858
|
init_logger();
|
|
5802
5859
|
}
|
|
5803
5860
|
});
|
|
@@ -7721,6 +7778,7 @@ var init_SessionController = __esm({
|
|
|
7721
7778
|
init_util2();
|
|
7722
7779
|
init_navigators();
|
|
7723
7780
|
init_Pipeline();
|
|
7781
|
+
init_versionStamps();
|
|
7724
7782
|
init_SourceMixer();
|
|
7725
7783
|
init_MixerDebugger();
|
|
7726
7784
|
init_SessionDebugger();
|
|
@@ -7730,11 +7788,11 @@ var init_SessionController = __esm({
|
|
|
7730
7788
|
});
|
|
7731
7789
|
|
|
7732
7790
|
// src/study/TagFilteredContentSource.ts
|
|
7733
|
-
var
|
|
7791
|
+
var import_common19;
|
|
7734
7792
|
var init_TagFilteredContentSource = __esm({
|
|
7735
7793
|
"src/study/TagFilteredContentSource.ts"() {
|
|
7736
7794
|
"use strict";
|
|
7737
|
-
|
|
7795
|
+
import_common19 = require("@vue-skuilder/common");
|
|
7738
7796
|
init_courseDB();
|
|
7739
7797
|
init_logger();
|
|
7740
7798
|
}
|
|
@@ -8073,13 +8131,13 @@ async function dropUserFromClassroom(user, classID) {
|
|
|
8073
8131
|
async function getUserClassrooms(user) {
|
|
8074
8132
|
return getOrCreateClassroomRegistrationsDoc(user);
|
|
8075
8133
|
}
|
|
8076
|
-
var
|
|
8134
|
+
var import_common20, import_moment8, log3, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
|
|
8077
8135
|
var init_BaseUserDB = __esm({
|
|
8078
8136
|
"src/impl/common/BaseUserDB.ts"() {
|
|
8079
8137
|
"use strict";
|
|
8080
8138
|
init_core();
|
|
8081
8139
|
init_util();
|
|
8082
|
-
|
|
8140
|
+
import_common20 = require("@vue-skuilder/common");
|
|
8083
8141
|
import_moment8 = __toESM(require("moment"), 1);
|
|
8084
8142
|
init_types_legacy();
|
|
8085
8143
|
init_logger();
|
|
@@ -8182,7 +8240,7 @@ Currently logged-in as ${this._username}.`
|
|
|
8182
8240
|
);
|
|
8183
8241
|
}
|
|
8184
8242
|
const result = await this.syncStrategy.createAccount(username, password);
|
|
8185
|
-
if (result.status ===
|
|
8243
|
+
if (result.status === import_common20.Status.ok) {
|
|
8186
8244
|
log3(`Account created successfully, updating username to ${username}`);
|
|
8187
8245
|
this._username = username;
|
|
8188
8246
|
try {
|
|
@@ -8258,7 +8316,7 @@ Currently logged-in as ${this._username}.`
|
|
|
8258
8316
|
async resetUserData() {
|
|
8259
8317
|
if (this.syncStrategy.canAuthenticate()) {
|
|
8260
8318
|
return {
|
|
8261
|
-
status:
|
|
8319
|
+
status: import_common20.Status.error,
|
|
8262
8320
|
error: "Reset user data is only available for local-only mode. Use logout instead for remote sync."
|
|
8263
8321
|
};
|
|
8264
8322
|
}
|
|
@@ -8280,11 +8338,11 @@ Currently logged-in as ${this._username}.`
|
|
|
8280
8338
|
await localDB.bulkDocs(docsToDelete);
|
|
8281
8339
|
}
|
|
8282
8340
|
await this.init();
|
|
8283
|
-
return { status:
|
|
8341
|
+
return { status: import_common20.Status.ok };
|
|
8284
8342
|
} catch (error) {
|
|
8285
8343
|
logger.error("Failed to reset user data:", error);
|
|
8286
8344
|
return {
|
|
8287
|
-
status:
|
|
8345
|
+
status: import_common20.Status.error,
|
|
8288
8346
|
error: error instanceof Error ? error.message : "Unknown error during reset"
|
|
8289
8347
|
};
|
|
8290
8348
|
}
|
|
@@ -9203,6 +9261,7 @@ var init_factory = __esm({
|
|
|
9203
9261
|
init_common();
|
|
9204
9262
|
init_logger();
|
|
9205
9263
|
init_navigators();
|
|
9264
|
+
init_versionStamps();
|
|
9206
9265
|
NOT_SET = "NOT_SET";
|
|
9207
9266
|
ENV = {
|
|
9208
9267
|
COUCHDB_SERVER_PROTOCOL: NOT_SET,
|
|
@@ -9214,13 +9273,13 @@ var init_factory = __esm({
|
|
|
9214
9273
|
});
|
|
9215
9274
|
|
|
9216
9275
|
// src/core/interfaces/contentSource.ts
|
|
9217
|
-
var
|
|
9276
|
+
var import_common22;
|
|
9218
9277
|
var init_contentSource = __esm({
|
|
9219
9278
|
"src/core/interfaces/contentSource.ts"() {
|
|
9220
9279
|
"use strict";
|
|
9221
9280
|
init_factory();
|
|
9222
9281
|
init_classroomDB2();
|
|
9223
|
-
|
|
9282
|
+
import_common22 = require("@vue-skuilder/common");
|
|
9224
9283
|
init_TagFilteredContentSource();
|
|
9225
9284
|
}
|
|
9226
9285
|
});
|
|
@@ -9293,11 +9352,11 @@ var init_hydration = __esm({
|
|
|
9293
9352
|
});
|
|
9294
9353
|
|
|
9295
9354
|
// src/core/bulkImport/cardProcessor.ts
|
|
9296
|
-
var
|
|
9355
|
+
var import_common23;
|
|
9297
9356
|
var init_cardProcessor = __esm({
|
|
9298
9357
|
"src/core/bulkImport/cardProcessor.ts"() {
|
|
9299
9358
|
"use strict";
|
|
9300
|
-
|
|
9359
|
+
import_common23 = require("@vue-skuilder/common");
|
|
9301
9360
|
init_logger();
|
|
9302
9361
|
}
|
|
9303
9362
|
});
|
|
@@ -10089,11 +10148,11 @@ var init_StaticDataUnpacker = __esm({
|
|
|
10089
10148
|
});
|
|
10090
10149
|
|
|
10091
10150
|
// src/impl/static/courseDB.ts
|
|
10092
|
-
var
|
|
10151
|
+
var import_common24, StaticCourseDB;
|
|
10093
10152
|
var init_courseDB3 = __esm({
|
|
10094
10153
|
"src/impl/static/courseDB.ts"() {
|
|
10095
10154
|
"use strict";
|
|
10096
|
-
|
|
10155
|
+
import_common24 = require("@vue-skuilder/common");
|
|
10097
10156
|
init_types_legacy();
|
|
10098
10157
|
init_logger();
|
|
10099
10158
|
init_defaults();
|
|
@@ -10354,7 +10413,7 @@ var init_courseDB3 = __esm({
|
|
|
10354
10413
|
}
|
|
10355
10414
|
async addNote(_codeCourse, _shape, _data, _author, _tags, _uploads, _elo) {
|
|
10356
10415
|
return {
|
|
10357
|
-
status:
|
|
10416
|
+
status: import_common24.Status.error,
|
|
10358
10417
|
message: "Cannot add notes in static mode"
|
|
10359
10418
|
};
|
|
10360
10419
|
}
|