@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
package/dist/core/index.js
CHANGED
|
@@ -695,13 +695,12 @@ function clearRunHistory() {
|
|
|
695
695
|
_pendingRuns = [];
|
|
696
696
|
}
|
|
697
697
|
function getOrigin(card) {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
return "unknown";
|
|
698
|
+
return card.reviewID ? "review" : "new";
|
|
699
|
+
}
|
|
700
|
+
function requiredBy(card) {
|
|
701
|
+
return card.provenance.find(
|
|
702
|
+
(p) => p.strategy === "ephemeralHint" && p.score === Number.POSITIVE_INFINITY
|
|
703
|
+
)?.strategyName;
|
|
705
704
|
}
|
|
706
705
|
function captureRun(report) {
|
|
707
706
|
const fullReport = {
|
|
@@ -725,17 +724,23 @@ function parseCardElo(provenance) {
|
|
|
725
724
|
}
|
|
726
725
|
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards, regulators) {
|
|
727
726
|
const selectedIds = new Set(selectedCards.map((c) => c.cardId));
|
|
728
|
-
const toReport = (card) =>
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
727
|
+
const toReport = (card) => {
|
|
728
|
+
const required = requiredBy(card);
|
|
729
|
+
const first = card.provenance[0];
|
|
730
|
+
const generator = first && first.strategy !== "ephemeralHint" ? first.strategyName || first.strategy : void 0;
|
|
731
|
+
return {
|
|
732
|
+
cardId: card.cardId,
|
|
733
|
+
courseId: card.courseId,
|
|
734
|
+
origin: getOrigin(card),
|
|
735
|
+
...generator ? { generator } : {},
|
|
736
|
+
...required ? { required } : {},
|
|
737
|
+
finalScore: card.score,
|
|
738
|
+
cardElo: card.cardElo ?? parseCardElo(card.provenance),
|
|
739
|
+
provenance: card.provenance,
|
|
740
|
+
tags: card.tags,
|
|
741
|
+
selected: selectedIds.has(card.cardId)
|
|
742
|
+
};
|
|
743
|
+
};
|
|
739
744
|
const selectedReported = [];
|
|
740
745
|
const nearMissReported = [];
|
|
741
746
|
const discardedTailCards = [];
|
|
@@ -1864,10 +1869,14 @@ var init_elo = __esm({
|
|
|
1864
1869
|
const userElo = (0, import_common5.toCourseElo)(courseReg.elo);
|
|
1865
1870
|
userGlobalElo = userElo.global.score;
|
|
1866
1871
|
}
|
|
1867
|
-
const activeCards = await
|
|
1872
|
+
const [activeCards, seenCards] = await Promise.all([
|
|
1873
|
+
this.user.getActiveCards(),
|
|
1874
|
+
this.user.getSeenCards(this.course.getCourseID()).catch(() => [])
|
|
1875
|
+
]);
|
|
1876
|
+
const notNew = /* @__PURE__ */ new Set([...activeCards.map((ac) => ac.cardID), ...seenCards]);
|
|
1868
1877
|
const newCards = (await this.course.getCardsCenteredAtELO(
|
|
1869
1878
|
{ limit, elo: "user" },
|
|
1870
|
-
(c) => !
|
|
1879
|
+
(c) => !notNew.has(c.cardID)
|
|
1871
1880
|
)).map((c) => ({ ...c, status: "new" }));
|
|
1872
1881
|
const scored = newCards.map((c) => {
|
|
1873
1882
|
const cardElo = c.elo ?? 1e3;
|
|
@@ -1960,11 +1969,11 @@ function formatAge(ms) {
|
|
|
1960
1969
|
}
|
|
1961
1970
|
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
1962
1971
|
if (minCount <= 0) return [];
|
|
1963
|
-
const exposeTags = new Set(tags.filter((tag) =>
|
|
1972
|
+
const exposeTags = new Set(tags.filter((tag) => (0, import_common6.tagRole)(tag) === "expose"));
|
|
1964
1973
|
for (const tag of tags) {
|
|
1965
|
-
if (
|
|
1966
|
-
const
|
|
1967
|
-
if (
|
|
1974
|
+
if ((0, import_common6.tagRole)(tag) !== "intro") continue;
|
|
1975
|
+
const expose = (0, import_common6.withTagRole)(tag, "expose");
|
|
1976
|
+
if (expose) exposeTags.add(expose);
|
|
1968
1977
|
}
|
|
1969
1978
|
return [...exposeTags].filter((tag) => {
|
|
1970
1979
|
const tagElo = userTagElo[tag];
|
|
@@ -1974,10 +1983,11 @@ function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
|
1974
1983
|
function pickTopByScore(cards, limit) {
|
|
1975
1984
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
1976
1985
|
}
|
|
1977
|
-
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;
|
|
1986
|
+
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;
|
|
1978
1987
|
var init_prescribed = __esm({
|
|
1979
1988
|
"src/core/navigators/generators/prescribed.ts"() {
|
|
1980
1989
|
"use strict";
|
|
1990
|
+
import_common6 = require("@vue-skuilder/common");
|
|
1981
1991
|
init_navigators();
|
|
1982
1992
|
init_StrategyPressureDebugger();
|
|
1983
1993
|
init_logger();
|
|
@@ -3208,7 +3218,9 @@ function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
|
|
|
3208
3218
|
const tags = [];
|
|
3209
3219
|
for (const tag of cardTags) {
|
|
3210
3220
|
const user = userElo.tags[tag];
|
|
3211
|
-
if (!user || user.score ===
|
|
3221
|
+
if ((0, import_common7.isCountOnlyTag)(tag) || !user || user.score === import_common7.COUNT_ONLY_SCORE || user.count < minTagCount) {
|
|
3222
|
+
continue;
|
|
3223
|
+
}
|
|
3212
3224
|
const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
|
|
3213
3225
|
tags.push({
|
|
3214
3226
|
tag,
|
|
@@ -3280,11 +3292,12 @@ function createEloDistanceFilter(config) {
|
|
|
3280
3292
|
transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
|
|
3281
3293
|
};
|
|
3282
3294
|
}
|
|
3283
|
-
var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF,
|
|
3295
|
+
var import_common7, DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, DEFAULT_CARD_ELO, MULTI_DIM_ELO_KEY, multiDimElo, EloDistanceFilter;
|
|
3284
3296
|
var init_eloDistance = __esm({
|
|
3285
3297
|
"src/core/navigators/filters/eloDistance.ts"() {
|
|
3286
3298
|
"use strict";
|
|
3287
3299
|
init_navigators();
|
|
3300
|
+
import_common7 = require("@vue-skuilder/common");
|
|
3288
3301
|
init_logger();
|
|
3289
3302
|
DEFAULT_ELO_DISTANCE_CONFIG = {
|
|
3290
3303
|
halfLife: 300,
|
|
@@ -3294,7 +3307,6 @@ var init_eloDistance = __esm({
|
|
|
3294
3307
|
minTagCount: 3
|
|
3295
3308
|
};
|
|
3296
3309
|
TAG_CONFIDENCE_HALF = 10;
|
|
3297
|
-
COUNT_ONLY_SENTINEL = -1;
|
|
3298
3310
|
DEFAULT_CARD_ELO = 1e3;
|
|
3299
3311
|
MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
|
|
3300
3312
|
multiDimElo = readMultiDimElo();
|
|
@@ -3337,12 +3349,12 @@ var hierarchyDefinition_exports = {};
|
|
|
3337
3349
|
__export(hierarchyDefinition_exports, {
|
|
3338
3350
|
default: () => HierarchyDefinitionNavigator
|
|
3339
3351
|
});
|
|
3340
|
-
var
|
|
3352
|
+
var import_common8, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
|
|
3341
3353
|
var init_hierarchyDefinition = __esm({
|
|
3342
3354
|
"src/core/navigators/filters/hierarchyDefinition.ts"() {
|
|
3343
3355
|
"use strict";
|
|
3344
3356
|
init_navigators();
|
|
3345
|
-
|
|
3357
|
+
import_common8 = require("@vue-skuilder/common");
|
|
3346
3358
|
init_logger();
|
|
3347
3359
|
DEFAULT_MIN_COUNT2 = 3;
|
|
3348
3360
|
HierarchyDefinitionNavigator = class _HierarchyDefinitionNavigator extends ContentNavigator {
|
|
@@ -3392,7 +3404,7 @@ var init_hierarchyDefinition = __esm({
|
|
|
3392
3404
|
const mastered = /* @__PURE__ */ new Set();
|
|
3393
3405
|
try {
|
|
3394
3406
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3395
|
-
const userElo = (0,
|
|
3407
|
+
const userElo = (0, import_common8.toCourseElo)(courseReg.elo);
|
|
3396
3408
|
for (const prereqs of Object.values(this.config.prerequisites)) {
|
|
3397
3409
|
for (const prereq of prereqs) {
|
|
3398
3410
|
const tagElo = userElo.tags[prereq.tag];
|
|
@@ -3764,12 +3776,12 @@ var interferenceMitigator_exports = {};
|
|
|
3764
3776
|
__export(interferenceMitigator_exports, {
|
|
3765
3777
|
default: () => InterferenceMitigatorNavigator
|
|
3766
3778
|
});
|
|
3767
|
-
var
|
|
3779
|
+
var import_common9, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
|
|
3768
3780
|
var init_interferenceMitigator = __esm({
|
|
3769
3781
|
"src/core/navigators/filters/interferenceMitigator.ts"() {
|
|
3770
3782
|
"use strict";
|
|
3771
3783
|
init_navigators();
|
|
3772
|
-
|
|
3784
|
+
import_common9 = require("@vue-skuilder/common");
|
|
3773
3785
|
DEFAULT_MIN_COUNT3 = 10;
|
|
3774
3786
|
DEFAULT_MIN_ELAPSED_DAYS = 3;
|
|
3775
3787
|
DEFAULT_INTERFERENCE_DECAY = 0.8;
|
|
@@ -3854,7 +3866,7 @@ var init_interferenceMitigator = __esm({
|
|
|
3854
3866
|
const immature = /* @__PURE__ */ new Set();
|
|
3855
3867
|
try {
|
|
3856
3868
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3857
|
-
const userElo = (0,
|
|
3869
|
+
const userElo = (0, import_common9.toCourseElo)(courseReg.elo);
|
|
3858
3870
|
const minCount = this.config.maturityThreshold?.minCount ?? DEFAULT_MIN_COUNT3;
|
|
3859
3871
|
const minElo = this.config.maturityThreshold?.minElo;
|
|
3860
3872
|
const minElapsedDays = this.config.maturityThreshold?.minElapsedDays ?? DEFAULT_MIN_ELAPSED_DAYS;
|
|
@@ -4645,11 +4657,11 @@ function logCardProvenance(cards, maxCards = 3) {
|
|
|
4645
4657
|
}
|
|
4646
4658
|
}
|
|
4647
4659
|
}
|
|
4648
|
-
var
|
|
4660
|
+
var import_common10, VERBOSE_RESULTS, Pipeline;
|
|
4649
4661
|
var init_Pipeline = __esm({
|
|
4650
4662
|
"src/core/navigators/Pipeline.ts"() {
|
|
4651
4663
|
"use strict";
|
|
4652
|
-
|
|
4664
|
+
import_common10 = require("@vue-skuilder/common");
|
|
4653
4665
|
init_navigators();
|
|
4654
4666
|
init_logger();
|
|
4655
4667
|
init_orchestration();
|
|
@@ -4669,6 +4681,11 @@ var init_Pipeline = __esm({
|
|
|
4669
4681
|
* This eliminates a remote getCourseConfig() round trip per pipeline run.
|
|
4670
4682
|
*/
|
|
4671
4683
|
_cachedOrchestration = null;
|
|
4684
|
+
/**
|
|
4685
|
+
* Hash of the strategy docs this pipeline was assembled from (see
|
|
4686
|
+
* versionStamps.ts), set by whoever builds it. Stamped on every run.
|
|
4687
|
+
*/
|
|
4688
|
+
strategyHash;
|
|
4672
4689
|
/**
|
|
4673
4690
|
* Persistent tag cache. Maps cardId → tag names.
|
|
4674
4691
|
*
|
|
@@ -4862,7 +4879,8 @@ var init_Pipeline = __esm({
|
|
|
4862
4879
|
logResultCards(result);
|
|
4863
4880
|
logCardProvenance(result, 3);
|
|
4864
4881
|
try {
|
|
4865
|
-
const
|
|
4882
|
+
const courseConfig = await this.course?.getCourseConfig().catch(() => void 0);
|
|
4883
|
+
const courseName = courseConfig?.name;
|
|
4866
4884
|
const report = buildRunReport(
|
|
4867
4885
|
this.course?.getCourseID() || "unknown",
|
|
4868
4886
|
courseName,
|
|
@@ -4877,7 +4895,11 @@ var init_Pipeline = __esm({
|
|
|
4877
4895
|
scoredCards,
|
|
4878
4896
|
regulators
|
|
4879
4897
|
);
|
|
4880
|
-
|
|
4898
|
+
const versions = {
|
|
4899
|
+
...this.strategyHash ? { strategies: this.strategyHash } : {},
|
|
4900
|
+
...courseConfig?.contentVersion ? { content: courseConfig.contentVersion } : {}
|
|
4901
|
+
};
|
|
4902
|
+
captureRun({ ...report, ...Object.keys(versions).length ? { versions } : {} });
|
|
4881
4903
|
} catch (e) {
|
|
4882
4904
|
logger.debug(`[Pipeline] Failed to capture debug run: ${e}`);
|
|
4883
4905
|
}
|
|
@@ -5138,7 +5160,7 @@ var init_Pipeline = __esm({
|
|
|
5138
5160
|
let userCourseElo;
|
|
5139
5161
|
try {
|
|
5140
5162
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
5141
|
-
userCourseElo = (0,
|
|
5163
|
+
userCourseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
5142
5164
|
userElo = userCourseElo.global.score;
|
|
5143
5165
|
} catch (e) {
|
|
5144
5166
|
logger.debug(`[Pipeline] Could not get user ELO, using default: ${e}`);
|
|
@@ -5200,7 +5222,7 @@ var init_Pipeline = __esm({
|
|
|
5200
5222
|
*/
|
|
5201
5223
|
async getTagEloStatus(tagFilter) {
|
|
5202
5224
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
5203
|
-
const courseElo = (0,
|
|
5225
|
+
const courseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
5204
5226
|
const result = {};
|
|
5205
5227
|
if (!tagFilter) {
|
|
5206
5228
|
for (const [tag, data] of Object.entries(courseElo.tags)) {
|
|
@@ -5374,6 +5396,36 @@ var init_Pipeline = __esm({
|
|
|
5374
5396
|
}
|
|
5375
5397
|
});
|
|
5376
5398
|
|
|
5399
|
+
// src/core/versionStamps.ts
|
|
5400
|
+
function stableStringify(value) {
|
|
5401
|
+
if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
|
|
5402
|
+
if (value && typeof value === "object") {
|
|
5403
|
+
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
5404
|
+
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(",")}}`;
|
|
5405
|
+
}
|
|
5406
|
+
return JSON.stringify(value);
|
|
5407
|
+
}
|
|
5408
|
+
function strategyHash(strategies) {
|
|
5409
|
+
if (strategies.length === 0) return DEFAULT_STRATEGY_HASH;
|
|
5410
|
+
const text = strategies.map((s) => {
|
|
5411
|
+
const { _rev: _ignored, ...rest } = s;
|
|
5412
|
+
return stableStringify(rest);
|
|
5413
|
+
}).sort().join("\n");
|
|
5414
|
+
let h = 2166136261;
|
|
5415
|
+
for (let i = 0; i < text.length; i++) {
|
|
5416
|
+
h ^= text.charCodeAt(i);
|
|
5417
|
+
h = Math.imul(h, 16777619);
|
|
5418
|
+
}
|
|
5419
|
+
return (h >>> 0).toString(16).padStart(8, "0");
|
|
5420
|
+
}
|
|
5421
|
+
var DEFAULT_STRATEGY_HASH;
|
|
5422
|
+
var init_versionStamps = __esm({
|
|
5423
|
+
"src/core/versionStamps.ts"() {
|
|
5424
|
+
"use strict";
|
|
5425
|
+
DEFAULT_STRATEGY_HASH = "default";
|
|
5426
|
+
}
|
|
5427
|
+
});
|
|
5428
|
+
|
|
5377
5429
|
// src/core/navigators/defaults.ts
|
|
5378
5430
|
var defaults_exports = {};
|
|
5379
5431
|
__export(defaults_exports, {
|
|
@@ -5426,7 +5478,9 @@ function createDefaultPipeline(user, course) {
|
|
|
5426
5478
|
course,
|
|
5427
5479
|
createDefaultEloDistanceStrategy(courseId)
|
|
5428
5480
|
);
|
|
5429
|
-
|
|
5481
|
+
const pipeline = new Pipeline(compositeGenerator, [eloDistanceFilter], user, course);
|
|
5482
|
+
pipeline.strategyHash = DEFAULT_STRATEGY_HASH;
|
|
5483
|
+
return pipeline;
|
|
5430
5484
|
}
|
|
5431
5485
|
var init_defaults = __esm({
|
|
5432
5486
|
"src/core/navigators/defaults.ts"() {
|
|
@@ -5438,6 +5492,7 @@ var init_defaults = __esm({
|
|
|
5438
5492
|
init_srs();
|
|
5439
5493
|
init_eloDistance();
|
|
5440
5494
|
init_types_legacy();
|
|
5495
|
+
init_versionStamps();
|
|
5441
5496
|
}
|
|
5442
5497
|
});
|
|
5443
5498
|
|
|
@@ -5581,6 +5636,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5581
5636
|
init_logger();
|
|
5582
5637
|
init_CompositeGenerator();
|
|
5583
5638
|
init_pipelinePlan();
|
|
5639
|
+
init_versionStamps();
|
|
5584
5640
|
PipelineAssembler = class {
|
|
5585
5641
|
/**
|
|
5586
5642
|
* Assembles a navigation pipeline from strategy documents.
|
|
@@ -5662,6 +5718,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5662
5718
|
}
|
|
5663
5719
|
}
|
|
5664
5720
|
const pipeline = new Pipeline(generator, filters, user, course);
|
|
5721
|
+
pipeline.strategyHash = strategyHash(strategies);
|
|
5665
5722
|
logger.debug(
|
|
5666
5723
|
`[PipelineAssembler] Assembled pipeline with ${generatorStrategies.length} generator(s) and ${filters.length} filter(s)`
|
|
5667
5724
|
);
|
|
@@ -6101,11 +6158,11 @@ ${JSON.stringify(config)}
|
|
|
6101
6158
|
function isSuccessRow(row) {
|
|
6102
6159
|
return "doc" in row && row.doc !== null && row.doc !== void 0;
|
|
6103
6160
|
}
|
|
6104
|
-
var
|
|
6161
|
+
var import_common11, CourseDB;
|
|
6105
6162
|
var init_courseDB = __esm({
|
|
6106
6163
|
"src/impl/couch/courseDB.ts"() {
|
|
6107
6164
|
"use strict";
|
|
6108
|
-
|
|
6165
|
+
import_common11 = require("@vue-skuilder/common");
|
|
6109
6166
|
init_couch();
|
|
6110
6167
|
init_updateQueue();
|
|
6111
6168
|
init_types_legacy();
|
|
@@ -6209,14 +6266,14 @@ var init_courseDB = __esm({
|
|
|
6209
6266
|
docs.rows.forEach((r) => {
|
|
6210
6267
|
if (isSuccessRow(r)) {
|
|
6211
6268
|
if (r.doc && r.doc.elo) {
|
|
6212
|
-
ret.push((0,
|
|
6269
|
+
ret.push((0, import_common11.toCourseElo)(r.doc.elo));
|
|
6213
6270
|
} else {
|
|
6214
6271
|
logger.warn("no elo data for card: " + r.id);
|
|
6215
|
-
ret.push((0,
|
|
6272
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6216
6273
|
}
|
|
6217
6274
|
} else {
|
|
6218
6275
|
logger.warn("no elo data for card: " + JSON.stringify(r));
|
|
6219
|
-
ret.push((0,
|
|
6276
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6220
6277
|
}
|
|
6221
6278
|
});
|
|
6222
6279
|
return ret;
|
|
@@ -6419,7 +6476,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6419
6476
|
async getCourseTagStubs() {
|
|
6420
6477
|
return getCourseTagStubs(this.id);
|
|
6421
6478
|
}
|
|
6422
|
-
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0,
|
|
6479
|
+
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common11.blankCourseElo)()) {
|
|
6423
6480
|
try {
|
|
6424
6481
|
const resp = await addNote55(this.id, codeCourse, shape, data, author, tags, uploads, elo);
|
|
6425
6482
|
if (resp.ok) {
|
|
@@ -6428,19 +6485,19 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6428
6485
|
`[courseDB.addNote] Note added but card creation failed: ${resp.cardCreationError}`
|
|
6429
6486
|
);
|
|
6430
6487
|
return {
|
|
6431
|
-
status:
|
|
6488
|
+
status: import_common11.Status.error,
|
|
6432
6489
|
message: `Note was added but no cards were created: ${resp.cardCreationError}`,
|
|
6433
6490
|
id: resp.id
|
|
6434
6491
|
};
|
|
6435
6492
|
}
|
|
6436
6493
|
return {
|
|
6437
|
-
status:
|
|
6494
|
+
status: import_common11.Status.ok,
|
|
6438
6495
|
message: "",
|
|
6439
6496
|
id: resp.id
|
|
6440
6497
|
};
|
|
6441
6498
|
} else {
|
|
6442
6499
|
return {
|
|
6443
|
-
status:
|
|
6500
|
+
status: import_common11.Status.error,
|
|
6444
6501
|
message: "Unexpected error adding note"
|
|
6445
6502
|
};
|
|
6446
6503
|
}
|
|
@@ -6452,7 +6509,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6452
6509
|
message: ${err.message}`
|
|
6453
6510
|
);
|
|
6454
6511
|
return {
|
|
6455
|
-
status:
|
|
6512
|
+
status: import_common11.Status.error,
|
|
6456
6513
|
message: `Error adding note to course. ${e.reason || err.message}`
|
|
6457
6514
|
};
|
|
6458
6515
|
}
|
|
@@ -6646,7 +6703,7 @@ ${e.stack}` : JSON.stringify(e);
|
|
|
6646
6703
|
const courseDoc = (await u.getCourseRegistrationsDoc()).courses.find((c) => {
|
|
6647
6704
|
return c.courseID === this.id;
|
|
6648
6705
|
});
|
|
6649
|
-
targetElo = (0,
|
|
6706
|
+
targetElo = (0, import_common11.EloToNumber)(courseDoc.elo);
|
|
6650
6707
|
} catch {
|
|
6651
6708
|
targetElo = 1e3;
|
|
6652
6709
|
}
|
|
@@ -7010,14 +7067,14 @@ var init_auth = __esm({
|
|
|
7010
7067
|
});
|
|
7011
7068
|
|
|
7012
7069
|
// src/impl/couch/CouchDBSyncStrategy.ts
|
|
7013
|
-
var
|
|
7070
|
+
var import_common12;
|
|
7014
7071
|
var init_CouchDBSyncStrategy = __esm({
|
|
7015
7072
|
"src/impl/couch/CouchDBSyncStrategy.ts"() {
|
|
7016
7073
|
"use strict";
|
|
7017
7074
|
init_factory();
|
|
7018
7075
|
init_types_legacy();
|
|
7019
7076
|
init_logger();
|
|
7020
|
-
|
|
7077
|
+
import_common12 = require("@vue-skuilder/common");
|
|
7021
7078
|
init_common();
|
|
7022
7079
|
init_pouchdb_setup();
|
|
7023
7080
|
init_couch();
|
|
@@ -7115,13 +7172,13 @@ function getStreak(records) {
|
|
|
7115
7172
|
function getLapses(records) {
|
|
7116
7173
|
return records.filter((r) => r.isCorrect === false).length;
|
|
7117
7174
|
}
|
|
7118
|
-
var import_moment4,
|
|
7175
|
+
var import_moment4, import_common14, duration;
|
|
7119
7176
|
var init_SpacedRepetition = __esm({
|
|
7120
7177
|
"src/study/SpacedRepetition.ts"() {
|
|
7121
7178
|
"use strict";
|
|
7122
7179
|
init_util();
|
|
7123
7180
|
import_moment4 = __toESM(require("moment"), 1);
|
|
7124
|
-
|
|
7181
|
+
import_common14 = require("@vue-skuilder/common");
|
|
7125
7182
|
init_logger();
|
|
7126
7183
|
duration = import_moment4.default.duration;
|
|
7127
7184
|
}
|
|
@@ -7140,42 +7197,42 @@ var init_SrsService = __esm({
|
|
|
7140
7197
|
});
|
|
7141
7198
|
|
|
7142
7199
|
// src/study/services/tagRecent.ts
|
|
7143
|
-
var
|
|
7200
|
+
var import_common15;
|
|
7144
7201
|
var init_tagRecent = __esm({
|
|
7145
7202
|
"src/study/services/tagRecent.ts"() {
|
|
7146
7203
|
"use strict";
|
|
7147
|
-
|
|
7204
|
+
import_common15 = require("@vue-skuilder/common");
|
|
7148
7205
|
}
|
|
7149
7206
|
});
|
|
7150
7207
|
|
|
7151
7208
|
// src/study/services/EloService.ts
|
|
7152
|
-
var
|
|
7209
|
+
var import_common16;
|
|
7153
7210
|
var init_EloService = __esm({
|
|
7154
7211
|
"src/study/services/EloService.ts"() {
|
|
7155
7212
|
"use strict";
|
|
7156
|
-
|
|
7213
|
+
import_common16 = require("@vue-skuilder/common");
|
|
7157
7214
|
init_logger();
|
|
7158
7215
|
init_tagRecent();
|
|
7159
7216
|
}
|
|
7160
7217
|
});
|
|
7161
7218
|
|
|
7162
7219
|
// src/study/services/ResponseProcessor.ts
|
|
7163
|
-
var
|
|
7220
|
+
var import_common17;
|
|
7164
7221
|
var init_ResponseProcessor = __esm({
|
|
7165
7222
|
"src/study/services/ResponseProcessor.ts"() {
|
|
7166
7223
|
"use strict";
|
|
7167
7224
|
init_core();
|
|
7168
7225
|
init_logger();
|
|
7169
|
-
|
|
7226
|
+
import_common17 = require("@vue-skuilder/common");
|
|
7170
7227
|
}
|
|
7171
7228
|
});
|
|
7172
7229
|
|
|
7173
7230
|
// src/study/services/CardHydrationService.ts
|
|
7174
|
-
var
|
|
7231
|
+
var import_common18;
|
|
7175
7232
|
var init_CardHydrationService = __esm({
|
|
7176
7233
|
"src/study/services/CardHydrationService.ts"() {
|
|
7177
7234
|
"use strict";
|
|
7178
|
-
|
|
7235
|
+
import_common18 = require("@vue-skuilder/common");
|
|
7179
7236
|
init_logger();
|
|
7180
7237
|
}
|
|
7181
7238
|
});
|
|
@@ -9105,6 +9162,7 @@ var init_SessionController = __esm({
|
|
|
9105
9162
|
init_util2();
|
|
9106
9163
|
init_navigators();
|
|
9107
9164
|
init_Pipeline();
|
|
9165
|
+
init_versionStamps();
|
|
9108
9166
|
init_SourceMixer();
|
|
9109
9167
|
init_MixerDebugger();
|
|
9110
9168
|
init_SessionDebugger();
|
|
@@ -9114,11 +9172,11 @@ var init_SessionController = __esm({
|
|
|
9114
9172
|
});
|
|
9115
9173
|
|
|
9116
9174
|
// src/study/TagFilteredContentSource.ts
|
|
9117
|
-
var
|
|
9175
|
+
var import_common19, TagFilteredContentSource;
|
|
9118
9176
|
var init_TagFilteredContentSource = __esm({
|
|
9119
9177
|
"src/study/TagFilteredContentSource.ts"() {
|
|
9120
9178
|
"use strict";
|
|
9121
|
-
|
|
9179
|
+
import_common19 = require("@vue-skuilder/common");
|
|
9122
9180
|
init_courseDB();
|
|
9123
9181
|
init_logger();
|
|
9124
9182
|
TagFilteredContentSource = class {
|
|
@@ -9204,7 +9262,7 @@ var init_TagFilteredContentSource = __esm({
|
|
|
9204
9262
|
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
9205
9263
|
*/
|
|
9206
9264
|
async getWeightedCards(limit) {
|
|
9207
|
-
if (!(0,
|
|
9265
|
+
if (!(0, import_common19.hasActiveFilter)(this.filter)) {
|
|
9208
9266
|
logger.warn("[TagFilteredContentSource] getWeightedCards called with no active filter");
|
|
9209
9267
|
return { cards: [] };
|
|
9210
9268
|
}
|
|
@@ -9535,13 +9593,13 @@ async function dropUserFromClassroom(user, classID) {
|
|
|
9535
9593
|
async function getUserClassrooms(user) {
|
|
9536
9594
|
return getOrCreateClassroomRegistrationsDoc(user);
|
|
9537
9595
|
}
|
|
9538
|
-
var
|
|
9596
|
+
var import_common20, import_moment8, log3, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
|
|
9539
9597
|
var init_BaseUserDB = __esm({
|
|
9540
9598
|
"src/impl/common/BaseUserDB.ts"() {
|
|
9541
9599
|
"use strict";
|
|
9542
9600
|
init_core();
|
|
9543
9601
|
init_util();
|
|
9544
|
-
|
|
9602
|
+
import_common20 = require("@vue-skuilder/common");
|
|
9545
9603
|
import_moment8 = __toESM(require("moment"), 1);
|
|
9546
9604
|
init_types_legacy();
|
|
9547
9605
|
init_logger();
|
|
@@ -9644,7 +9702,7 @@ Currently logged-in as ${this._username}.`
|
|
|
9644
9702
|
);
|
|
9645
9703
|
}
|
|
9646
9704
|
const result = await this.syncStrategy.createAccount(username, password);
|
|
9647
|
-
if (result.status ===
|
|
9705
|
+
if (result.status === import_common20.Status.ok) {
|
|
9648
9706
|
log3(`Account created successfully, updating username to ${username}`);
|
|
9649
9707
|
this._username = username;
|
|
9650
9708
|
try {
|
|
@@ -9720,7 +9778,7 @@ Currently logged-in as ${this._username}.`
|
|
|
9720
9778
|
async resetUserData() {
|
|
9721
9779
|
if (this.syncStrategy.canAuthenticate()) {
|
|
9722
9780
|
return {
|
|
9723
|
-
status:
|
|
9781
|
+
status: import_common20.Status.error,
|
|
9724
9782
|
error: "Reset user data is only available for local-only mode. Use logout instead for remote sync."
|
|
9725
9783
|
};
|
|
9726
9784
|
}
|
|
@@ -9742,11 +9800,11 @@ Currently logged-in as ${this._username}.`
|
|
|
9742
9800
|
await localDB.bulkDocs(docsToDelete);
|
|
9743
9801
|
}
|
|
9744
9802
|
await this.init();
|
|
9745
|
-
return { status:
|
|
9803
|
+
return { status: import_common20.Status.ok };
|
|
9746
9804
|
} catch (error) {
|
|
9747
9805
|
logger.error("Failed to reset user data:", error);
|
|
9748
9806
|
return {
|
|
9749
|
-
status:
|
|
9807
|
+
status: import_common20.Status.error,
|
|
9750
9808
|
error: error instanceof Error ? error.message : "Unknown error during reset"
|
|
9751
9809
|
};
|
|
9752
9810
|
}
|
|
@@ -10665,6 +10723,7 @@ var init_factory = __esm({
|
|
|
10665
10723
|
init_common();
|
|
10666
10724
|
init_logger();
|
|
10667
10725
|
init_navigators();
|
|
10726
|
+
init_versionStamps();
|
|
10668
10727
|
NOT_SET = "NOT_SET";
|
|
10669
10728
|
ENV = {
|
|
10670
10729
|
COUCHDB_SERVER_PROTOCOL: NOT_SET,
|
|
@@ -10684,19 +10743,19 @@ async function getStudySource(source, user) {
|
|
|
10684
10743
|
if (source.type === "classroom") {
|
|
10685
10744
|
return await StudentClassroomDB.factory(source.id, user);
|
|
10686
10745
|
} else {
|
|
10687
|
-
if ((0,
|
|
10746
|
+
if ((0, import_common22.hasActiveFilter)(source.tagFilter)) {
|
|
10688
10747
|
return new TagFilteredContentSource(source.id, source.tagFilter, user);
|
|
10689
10748
|
}
|
|
10690
10749
|
return getDataLayer().getCourseDB(source.id);
|
|
10691
10750
|
}
|
|
10692
10751
|
}
|
|
10693
|
-
var
|
|
10752
|
+
var import_common22;
|
|
10694
10753
|
var init_contentSource = __esm({
|
|
10695
10754
|
"src/core/interfaces/contentSource.ts"() {
|
|
10696
10755
|
"use strict";
|
|
10697
10756
|
init_factory();
|
|
10698
10757
|
init_classroomDB2();
|
|
10699
|
-
|
|
10758
|
+
import_common22 = require("@vue-skuilder/common");
|
|
10700
10759
|
init_TagFilteredContentSource();
|
|
10701
10760
|
}
|
|
10702
10761
|
});
|
|
@@ -10836,7 +10895,7 @@ elo: ${elo}`;
|
|
|
10836
10895
|
misc: {}
|
|
10837
10896
|
} : void 0
|
|
10838
10897
|
);
|
|
10839
|
-
if (result.status ===
|
|
10898
|
+
if (result.status === import_common23.Status.ok) {
|
|
10840
10899
|
return {
|
|
10841
10900
|
originalText,
|
|
10842
10901
|
status: "success",
|
|
@@ -10880,11 +10939,11 @@ function validateProcessorConfig(config) {
|
|
|
10880
10939
|
}
|
|
10881
10940
|
return { isValid: true };
|
|
10882
10941
|
}
|
|
10883
|
-
var
|
|
10942
|
+
var import_common23;
|
|
10884
10943
|
var init_cardProcessor = __esm({
|
|
10885
10944
|
"src/core/bulkImport/cardProcessor.ts"() {
|
|
10886
10945
|
"use strict";
|
|
10887
|
-
|
|
10946
|
+
import_common23 = require("@vue-skuilder/common");
|
|
10888
10947
|
init_logger();
|
|
10889
10948
|
}
|
|
10890
10949
|
});
|