@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/impl/couch/index.js
CHANGED
|
@@ -770,13 +770,12 @@ function clearRunHistory() {
|
|
|
770
770
|
_pendingRuns = [];
|
|
771
771
|
}
|
|
772
772
|
function getOrigin(card) {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
return "unknown";
|
|
773
|
+
return card.reviewID ? "review" : "new";
|
|
774
|
+
}
|
|
775
|
+
function requiredBy(card) {
|
|
776
|
+
return card.provenance.find(
|
|
777
|
+
(p) => p.strategy === "ephemeralHint" && p.score === Number.POSITIVE_INFINITY
|
|
778
|
+
)?.strategyName;
|
|
780
779
|
}
|
|
781
780
|
function captureRun(report) {
|
|
782
781
|
const fullReport = {
|
|
@@ -800,17 +799,23 @@ function parseCardElo(provenance) {
|
|
|
800
799
|
}
|
|
801
800
|
function buildRunReport(courseId, courseName, generatorName, generators, generatedCount, filters, allCards, selectedCards, userElo, hints, scoredCards, regulators) {
|
|
802
801
|
const selectedIds = new Set(selectedCards.map((c) => c.cardId));
|
|
803
|
-
const toReport = (card) =>
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
802
|
+
const toReport = (card) => {
|
|
803
|
+
const required = requiredBy(card);
|
|
804
|
+
const first = card.provenance[0];
|
|
805
|
+
const generator = first && first.strategy !== "ephemeralHint" ? first.strategyName || first.strategy : void 0;
|
|
806
|
+
return {
|
|
807
|
+
cardId: card.cardId,
|
|
808
|
+
courseId: card.courseId,
|
|
809
|
+
origin: getOrigin(card),
|
|
810
|
+
...generator ? { generator } : {},
|
|
811
|
+
...required ? { required } : {},
|
|
812
|
+
finalScore: card.score,
|
|
813
|
+
cardElo: card.cardElo ?? parseCardElo(card.provenance),
|
|
814
|
+
provenance: card.provenance,
|
|
815
|
+
tags: card.tags,
|
|
816
|
+
selected: selectedIds.has(card.cardId)
|
|
817
|
+
};
|
|
818
|
+
};
|
|
814
819
|
const selectedReported = [];
|
|
815
820
|
const nearMissReported = [];
|
|
816
821
|
const discardedTailCards = [];
|
|
@@ -1939,10 +1944,14 @@ var init_elo = __esm({
|
|
|
1939
1944
|
const userElo = (0, import_common5.toCourseElo)(courseReg.elo);
|
|
1940
1945
|
userGlobalElo = userElo.global.score;
|
|
1941
1946
|
}
|
|
1942
|
-
const activeCards = await
|
|
1947
|
+
const [activeCards, seenCards] = await Promise.all([
|
|
1948
|
+
this.user.getActiveCards(),
|
|
1949
|
+
this.user.getSeenCards(this.course.getCourseID()).catch(() => [])
|
|
1950
|
+
]);
|
|
1951
|
+
const notNew = /* @__PURE__ */ new Set([...activeCards.map((ac) => ac.cardID), ...seenCards]);
|
|
1943
1952
|
const newCards = (await this.course.getCardsCenteredAtELO(
|
|
1944
1953
|
{ limit, elo: "user" },
|
|
1945
|
-
(c) => !
|
|
1954
|
+
(c) => !notNew.has(c.cardID)
|
|
1946
1955
|
)).map((c) => ({ ...c, status: "new" }));
|
|
1947
1956
|
const scored = newCards.map((c) => {
|
|
1948
1957
|
const cardElo = c.elo ?? 1e3;
|
|
@@ -2035,11 +2044,11 @@ function formatAge(ms) {
|
|
|
2035
2044
|
}
|
|
2036
2045
|
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
2037
2046
|
if (minCount <= 0) return [];
|
|
2038
|
-
const exposeTags = new Set(tags.filter((tag) =>
|
|
2047
|
+
const exposeTags = new Set(tags.filter((tag) => (0, import_common6.tagRole)(tag) === "expose"));
|
|
2039
2048
|
for (const tag of tags) {
|
|
2040
|
-
if (
|
|
2041
|
-
const
|
|
2042
|
-
if (
|
|
2049
|
+
if ((0, import_common6.tagRole)(tag) !== "intro") continue;
|
|
2050
|
+
const expose = (0, import_common6.withTagRole)(tag, "expose");
|
|
2051
|
+
if (expose) exposeTags.add(expose);
|
|
2043
2052
|
}
|
|
2044
2053
|
return [...exposeTags].filter((tag) => {
|
|
2045
2054
|
const tagElo = userTagElo[tag];
|
|
@@ -2049,10 +2058,11 @@ function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
|
2049
2058
|
function pickTopByScore(cards, limit) {
|
|
2050
2059
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
2051
2060
|
}
|
|
2052
|
-
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;
|
|
2061
|
+
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;
|
|
2053
2062
|
var init_prescribed = __esm({
|
|
2054
2063
|
"src/core/navigators/generators/prescribed.ts"() {
|
|
2055
2064
|
"use strict";
|
|
2065
|
+
import_common6 = require("@vue-skuilder/common");
|
|
2056
2066
|
init_navigators();
|
|
2057
2067
|
init_StrategyPressureDebugger();
|
|
2058
2068
|
init_logger();
|
|
@@ -3283,7 +3293,9 @@ function tagAwareGap(cardTags, cardElo, userElo, minTagCount) {
|
|
|
3283
3293
|
const tags = [];
|
|
3284
3294
|
for (const tag of cardTags) {
|
|
3285
3295
|
const user = userElo.tags[tag];
|
|
3286
|
-
if (!user || user.score ===
|
|
3296
|
+
if ((0, import_common7.isCountOnlyTag)(tag) || !user || user.score === import_common7.COUNT_ONLY_SCORE || user.count < minTagCount) {
|
|
3297
|
+
continue;
|
|
3298
|
+
}
|
|
3287
3299
|
const card = cardElo.tags[tag]?.score ?? cardElo.global.score;
|
|
3288
3300
|
tags.push({
|
|
3289
3301
|
tag,
|
|
@@ -3355,11 +3367,12 @@ function createEloDistanceFilter(config) {
|
|
|
3355
3367
|
transform: (cards, context) => applyEloDistance(cards, context, resolved, source)
|
|
3356
3368
|
};
|
|
3357
3369
|
}
|
|
3358
|
-
var DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF,
|
|
3370
|
+
var import_common7, DEFAULT_ELO_DISTANCE_CONFIG, TAG_CONFIDENCE_HALF, DEFAULT_CARD_ELO, MULTI_DIM_ELO_KEY, multiDimElo, EloDistanceFilter;
|
|
3359
3371
|
var init_eloDistance = __esm({
|
|
3360
3372
|
"src/core/navigators/filters/eloDistance.ts"() {
|
|
3361
3373
|
"use strict";
|
|
3362
3374
|
init_navigators();
|
|
3375
|
+
import_common7 = require("@vue-skuilder/common");
|
|
3363
3376
|
init_logger();
|
|
3364
3377
|
DEFAULT_ELO_DISTANCE_CONFIG = {
|
|
3365
3378
|
halfLife: 300,
|
|
@@ -3369,7 +3382,6 @@ var init_eloDistance = __esm({
|
|
|
3369
3382
|
minTagCount: 3
|
|
3370
3383
|
};
|
|
3371
3384
|
TAG_CONFIDENCE_HALF = 10;
|
|
3372
|
-
COUNT_ONLY_SENTINEL = -1;
|
|
3373
3385
|
DEFAULT_CARD_ELO = 1e3;
|
|
3374
3386
|
MULTI_DIM_ELO_KEY = "skuilder:multiDimElo";
|
|
3375
3387
|
multiDimElo = readMultiDimElo();
|
|
@@ -3412,12 +3424,12 @@ var hierarchyDefinition_exports = {};
|
|
|
3412
3424
|
__export(hierarchyDefinition_exports, {
|
|
3413
3425
|
default: () => HierarchyDefinitionNavigator
|
|
3414
3426
|
});
|
|
3415
|
-
var
|
|
3427
|
+
var import_common8, DEFAULT_MIN_COUNT2, HierarchyDefinitionNavigator;
|
|
3416
3428
|
var init_hierarchyDefinition = __esm({
|
|
3417
3429
|
"src/core/navigators/filters/hierarchyDefinition.ts"() {
|
|
3418
3430
|
"use strict";
|
|
3419
3431
|
init_navigators();
|
|
3420
|
-
|
|
3432
|
+
import_common8 = require("@vue-skuilder/common");
|
|
3421
3433
|
init_logger();
|
|
3422
3434
|
DEFAULT_MIN_COUNT2 = 3;
|
|
3423
3435
|
HierarchyDefinitionNavigator = class _HierarchyDefinitionNavigator extends ContentNavigator {
|
|
@@ -3467,7 +3479,7 @@ var init_hierarchyDefinition = __esm({
|
|
|
3467
3479
|
const mastered = /* @__PURE__ */ new Set();
|
|
3468
3480
|
try {
|
|
3469
3481
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3470
|
-
const userElo = (0,
|
|
3482
|
+
const userElo = (0, import_common8.toCourseElo)(courseReg.elo);
|
|
3471
3483
|
for (const prereqs of Object.values(this.config.prerequisites)) {
|
|
3472
3484
|
for (const prereq of prereqs) {
|
|
3473
3485
|
const tagElo = userElo.tags[prereq.tag];
|
|
@@ -3839,12 +3851,12 @@ var interferenceMitigator_exports = {};
|
|
|
3839
3851
|
__export(interferenceMitigator_exports, {
|
|
3840
3852
|
default: () => InterferenceMitigatorNavigator
|
|
3841
3853
|
});
|
|
3842
|
-
var
|
|
3854
|
+
var import_common9, DEFAULT_MIN_COUNT3, DEFAULT_MIN_ELAPSED_DAYS, DEFAULT_INTERFERENCE_DECAY, InterferenceMitigatorNavigator;
|
|
3843
3855
|
var init_interferenceMitigator = __esm({
|
|
3844
3856
|
"src/core/navigators/filters/interferenceMitigator.ts"() {
|
|
3845
3857
|
"use strict";
|
|
3846
3858
|
init_navigators();
|
|
3847
|
-
|
|
3859
|
+
import_common9 = require("@vue-skuilder/common");
|
|
3848
3860
|
DEFAULT_MIN_COUNT3 = 10;
|
|
3849
3861
|
DEFAULT_MIN_ELAPSED_DAYS = 3;
|
|
3850
3862
|
DEFAULT_INTERFERENCE_DECAY = 0.8;
|
|
@@ -3929,7 +3941,7 @@ var init_interferenceMitigator = __esm({
|
|
|
3929
3941
|
const immature = /* @__PURE__ */ new Set();
|
|
3930
3942
|
try {
|
|
3931
3943
|
const courseReg = await context.user.getCourseRegDoc(context.course.getCourseID());
|
|
3932
|
-
const userElo = (0,
|
|
3944
|
+
const userElo = (0, import_common9.toCourseElo)(courseReg.elo);
|
|
3933
3945
|
const minCount = this.config.maturityThreshold?.minCount ?? DEFAULT_MIN_COUNT3;
|
|
3934
3946
|
const minElo = this.config.maturityThreshold?.minElo;
|
|
3935
3947
|
const minElapsedDays = this.config.maturityThreshold?.minElapsedDays ?? DEFAULT_MIN_ELAPSED_DAYS;
|
|
@@ -4474,11 +4486,11 @@ function logCardProvenance(cards, maxCards = 3) {
|
|
|
4474
4486
|
}
|
|
4475
4487
|
}
|
|
4476
4488
|
}
|
|
4477
|
-
var
|
|
4489
|
+
var import_common10, VERBOSE_RESULTS, Pipeline;
|
|
4478
4490
|
var init_Pipeline = __esm({
|
|
4479
4491
|
"src/core/navigators/Pipeline.ts"() {
|
|
4480
4492
|
"use strict";
|
|
4481
|
-
|
|
4493
|
+
import_common10 = require("@vue-skuilder/common");
|
|
4482
4494
|
init_navigators();
|
|
4483
4495
|
init_logger();
|
|
4484
4496
|
init_orchestration();
|
|
@@ -4498,6 +4510,11 @@ var init_Pipeline = __esm({
|
|
|
4498
4510
|
* This eliminates a remote getCourseConfig() round trip per pipeline run.
|
|
4499
4511
|
*/
|
|
4500
4512
|
_cachedOrchestration = null;
|
|
4513
|
+
/**
|
|
4514
|
+
* Hash of the strategy docs this pipeline was assembled from (see
|
|
4515
|
+
* versionStamps.ts), set by whoever builds it. Stamped on every run.
|
|
4516
|
+
*/
|
|
4517
|
+
strategyHash;
|
|
4501
4518
|
/**
|
|
4502
4519
|
* Persistent tag cache. Maps cardId → tag names.
|
|
4503
4520
|
*
|
|
@@ -4691,7 +4708,8 @@ var init_Pipeline = __esm({
|
|
|
4691
4708
|
logResultCards(result);
|
|
4692
4709
|
logCardProvenance(result, 3);
|
|
4693
4710
|
try {
|
|
4694
|
-
const
|
|
4711
|
+
const courseConfig = await this.course?.getCourseConfig().catch(() => void 0);
|
|
4712
|
+
const courseName = courseConfig?.name;
|
|
4695
4713
|
const report = buildRunReport(
|
|
4696
4714
|
this.course?.getCourseID() || "unknown",
|
|
4697
4715
|
courseName,
|
|
@@ -4706,7 +4724,11 @@ var init_Pipeline = __esm({
|
|
|
4706
4724
|
scoredCards,
|
|
4707
4725
|
regulators
|
|
4708
4726
|
);
|
|
4709
|
-
|
|
4727
|
+
const versions = {
|
|
4728
|
+
...this.strategyHash ? { strategies: this.strategyHash } : {},
|
|
4729
|
+
...courseConfig?.contentVersion ? { content: courseConfig.contentVersion } : {}
|
|
4730
|
+
};
|
|
4731
|
+
captureRun({ ...report, ...Object.keys(versions).length ? { versions } : {} });
|
|
4710
4732
|
} catch (e) {
|
|
4711
4733
|
logger.debug(`[Pipeline] Failed to capture debug run: ${e}`);
|
|
4712
4734
|
}
|
|
@@ -4967,7 +4989,7 @@ var init_Pipeline = __esm({
|
|
|
4967
4989
|
let userCourseElo;
|
|
4968
4990
|
try {
|
|
4969
4991
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
4970
|
-
userCourseElo = (0,
|
|
4992
|
+
userCourseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
4971
4993
|
userElo = userCourseElo.global.score;
|
|
4972
4994
|
} catch (e) {
|
|
4973
4995
|
logger.debug(`[Pipeline] Could not get user ELO, using default: ${e}`);
|
|
@@ -5029,7 +5051,7 @@ var init_Pipeline = __esm({
|
|
|
5029
5051
|
*/
|
|
5030
5052
|
async getTagEloStatus(tagFilter) {
|
|
5031
5053
|
const courseReg = await this.user.getCourseRegDoc(this.course.getCourseID());
|
|
5032
|
-
const courseElo = (0,
|
|
5054
|
+
const courseElo = (0, import_common10.toCourseElo)(courseReg.elo);
|
|
5033
5055
|
const result = {};
|
|
5034
5056
|
if (!tagFilter) {
|
|
5035
5057
|
for (const [tag, data] of Object.entries(courseElo.tags)) {
|
|
@@ -5203,6 +5225,36 @@ var init_Pipeline = __esm({
|
|
|
5203
5225
|
}
|
|
5204
5226
|
});
|
|
5205
5227
|
|
|
5228
|
+
// src/core/versionStamps.ts
|
|
5229
|
+
function stableStringify(value) {
|
|
5230
|
+
if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
|
|
5231
|
+
if (value && typeof value === "object") {
|
|
5232
|
+
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
5233
|
+
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(",")}}`;
|
|
5234
|
+
}
|
|
5235
|
+
return JSON.stringify(value);
|
|
5236
|
+
}
|
|
5237
|
+
function strategyHash(strategies) {
|
|
5238
|
+
if (strategies.length === 0) return DEFAULT_STRATEGY_HASH;
|
|
5239
|
+
const text = strategies.map((s) => {
|
|
5240
|
+
const { _rev: _ignored, ...rest } = s;
|
|
5241
|
+
return stableStringify(rest);
|
|
5242
|
+
}).sort().join("\n");
|
|
5243
|
+
let h = 2166136261;
|
|
5244
|
+
for (let i = 0; i < text.length; i++) {
|
|
5245
|
+
h ^= text.charCodeAt(i);
|
|
5246
|
+
h = Math.imul(h, 16777619);
|
|
5247
|
+
}
|
|
5248
|
+
return (h >>> 0).toString(16).padStart(8, "0");
|
|
5249
|
+
}
|
|
5250
|
+
var DEFAULT_STRATEGY_HASH;
|
|
5251
|
+
var init_versionStamps = __esm({
|
|
5252
|
+
"src/core/versionStamps.ts"() {
|
|
5253
|
+
"use strict";
|
|
5254
|
+
DEFAULT_STRATEGY_HASH = "default";
|
|
5255
|
+
}
|
|
5256
|
+
});
|
|
5257
|
+
|
|
5206
5258
|
// src/core/navigators/defaults.ts
|
|
5207
5259
|
var defaults_exports = {};
|
|
5208
5260
|
__export(defaults_exports, {
|
|
@@ -5255,7 +5307,9 @@ function createDefaultPipeline(user, course) {
|
|
|
5255
5307
|
course,
|
|
5256
5308
|
createDefaultEloDistanceStrategy(courseId)
|
|
5257
5309
|
);
|
|
5258
|
-
|
|
5310
|
+
const pipeline = new Pipeline(compositeGenerator, [eloDistanceFilter], user, course);
|
|
5311
|
+
pipeline.strategyHash = DEFAULT_STRATEGY_HASH;
|
|
5312
|
+
return pipeline;
|
|
5259
5313
|
}
|
|
5260
5314
|
var init_defaults = __esm({
|
|
5261
5315
|
"src/core/navigators/defaults.ts"() {
|
|
@@ -5267,6 +5321,7 @@ var init_defaults = __esm({
|
|
|
5267
5321
|
init_srs();
|
|
5268
5322
|
init_eloDistance();
|
|
5269
5323
|
init_types_legacy();
|
|
5324
|
+
init_versionStamps();
|
|
5270
5325
|
}
|
|
5271
5326
|
});
|
|
5272
5327
|
|
|
@@ -5410,6 +5465,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5410
5465
|
init_logger();
|
|
5411
5466
|
init_CompositeGenerator();
|
|
5412
5467
|
init_pipelinePlan();
|
|
5468
|
+
init_versionStamps();
|
|
5413
5469
|
PipelineAssembler = class {
|
|
5414
5470
|
/**
|
|
5415
5471
|
* Assembles a navigation pipeline from strategy documents.
|
|
@@ -5491,6 +5547,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5491
5547
|
}
|
|
5492
5548
|
}
|
|
5493
5549
|
const pipeline = new Pipeline(generator, filters, user, course);
|
|
5550
|
+
pipeline.strategyHash = strategyHash(strategies);
|
|
5494
5551
|
logger.debug(
|
|
5495
5552
|
`[PipelineAssembler] Assembled pipeline with ${generatorStrategies.length} generator(s) and ${filters.length} filter(s)`
|
|
5496
5553
|
);
|
|
@@ -5972,11 +6029,11 @@ ${JSON.stringify(config)}
|
|
|
5972
6029
|
function isSuccessRow(row) {
|
|
5973
6030
|
return "doc" in row && row.doc !== null && row.doc !== void 0;
|
|
5974
6031
|
}
|
|
5975
|
-
var
|
|
6032
|
+
var import_common11, CoursesDB, CourseDB;
|
|
5976
6033
|
var init_courseDB = __esm({
|
|
5977
6034
|
"src/impl/couch/courseDB.ts"() {
|
|
5978
6035
|
"use strict";
|
|
5979
|
-
|
|
6036
|
+
import_common11 = require("@vue-skuilder/common");
|
|
5980
6037
|
init_couch();
|
|
5981
6038
|
init_updateQueue();
|
|
5982
6039
|
init_types_legacy();
|
|
@@ -6125,14 +6182,14 @@ var init_courseDB = __esm({
|
|
|
6125
6182
|
docs.rows.forEach((r) => {
|
|
6126
6183
|
if (isSuccessRow(r)) {
|
|
6127
6184
|
if (r.doc && r.doc.elo) {
|
|
6128
|
-
ret.push((0,
|
|
6185
|
+
ret.push((0, import_common11.toCourseElo)(r.doc.elo));
|
|
6129
6186
|
} else {
|
|
6130
6187
|
logger.warn("no elo data for card: " + r.id);
|
|
6131
|
-
ret.push((0,
|
|
6188
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6132
6189
|
}
|
|
6133
6190
|
} else {
|
|
6134
6191
|
logger.warn("no elo data for card: " + JSON.stringify(r));
|
|
6135
|
-
ret.push((0,
|
|
6192
|
+
ret.push((0, import_common11.blankCourseElo)());
|
|
6136
6193
|
}
|
|
6137
6194
|
});
|
|
6138
6195
|
return ret;
|
|
@@ -6335,7 +6392,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6335
6392
|
async getCourseTagStubs() {
|
|
6336
6393
|
return getCourseTagStubs(this.id);
|
|
6337
6394
|
}
|
|
6338
|
-
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0,
|
|
6395
|
+
async addNote(codeCourse, shape, data, author, tags, uploads, elo = (0, import_common11.blankCourseElo)()) {
|
|
6339
6396
|
try {
|
|
6340
6397
|
const resp = await addNote55(this.id, codeCourse, shape, data, author, tags, uploads, elo);
|
|
6341
6398
|
if (resp.ok) {
|
|
@@ -6344,19 +6401,19 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6344
6401
|
`[courseDB.addNote] Note added but card creation failed: ${resp.cardCreationError}`
|
|
6345
6402
|
);
|
|
6346
6403
|
return {
|
|
6347
|
-
status:
|
|
6404
|
+
status: import_common11.Status.error,
|
|
6348
6405
|
message: `Note was added but no cards were created: ${resp.cardCreationError}`,
|
|
6349
6406
|
id: resp.id
|
|
6350
6407
|
};
|
|
6351
6408
|
}
|
|
6352
6409
|
return {
|
|
6353
|
-
status:
|
|
6410
|
+
status: import_common11.Status.ok,
|
|
6354
6411
|
message: "",
|
|
6355
6412
|
id: resp.id
|
|
6356
6413
|
};
|
|
6357
6414
|
} else {
|
|
6358
6415
|
return {
|
|
6359
|
-
status:
|
|
6416
|
+
status: import_common11.Status.error,
|
|
6360
6417
|
message: "Unexpected error adding note"
|
|
6361
6418
|
};
|
|
6362
6419
|
}
|
|
@@ -6368,7 +6425,7 @@ ${above.rows.map((r) => ` ${r.id}-${r.key}
|
|
|
6368
6425
|
message: ${err.message}`
|
|
6369
6426
|
);
|
|
6370
6427
|
return {
|
|
6371
|
-
status:
|
|
6428
|
+
status: import_common11.Status.error,
|
|
6372
6429
|
message: `Error adding note to course. ${e.reason || err.message}`
|
|
6373
6430
|
};
|
|
6374
6431
|
}
|
|
@@ -6562,7 +6619,7 @@ ${e.stack}` : JSON.stringify(e);
|
|
|
6562
6619
|
const courseDoc = (await u.getCourseRegistrationsDoc()).courses.find((c) => {
|
|
6563
6620
|
return c.courseID === this.id;
|
|
6564
6621
|
});
|
|
6565
|
-
targetElo = (0,
|
|
6622
|
+
targetElo = (0, import_common11.EloToNumber)(courseDoc.elo);
|
|
6566
6623
|
} catch {
|
|
6567
6624
|
targetElo = 1e3;
|
|
6568
6625
|
}
|
|
@@ -6985,11 +7042,11 @@ var init_classroomDB2 = __esm({
|
|
|
6985
7042
|
});
|
|
6986
7043
|
|
|
6987
7044
|
// src/study/TagFilteredContentSource.ts
|
|
6988
|
-
var
|
|
7045
|
+
var import_common12, TagFilteredContentSource;
|
|
6989
7046
|
var init_TagFilteredContentSource = __esm({
|
|
6990
7047
|
"src/study/TagFilteredContentSource.ts"() {
|
|
6991
7048
|
"use strict";
|
|
6992
|
-
|
|
7049
|
+
import_common12 = require("@vue-skuilder/common");
|
|
6993
7050
|
init_courseDB();
|
|
6994
7051
|
init_logger();
|
|
6995
7052
|
TagFilteredContentSource = class {
|
|
@@ -7075,7 +7132,7 @@ var init_TagFilteredContentSource = __esm({
|
|
|
7075
7132
|
* @returns Cards sorted by score descending (all scores = 1.0)
|
|
7076
7133
|
*/
|
|
7077
7134
|
async getWeightedCards(limit) {
|
|
7078
|
-
if (!(0,
|
|
7135
|
+
if (!(0, import_common12.hasActiveFilter)(this.filter)) {
|
|
7079
7136
|
logger.warn("[TagFilteredContentSource] getWeightedCards called with no active filter");
|
|
7080
7137
|
return { cards: [] };
|
|
7081
7138
|
}
|
|
@@ -7163,19 +7220,19 @@ async function getStudySource(source, user) {
|
|
|
7163
7220
|
if (source.type === "classroom") {
|
|
7164
7221
|
return await StudentClassroomDB.factory(source.id, user);
|
|
7165
7222
|
} else {
|
|
7166
|
-
if ((0,
|
|
7223
|
+
if ((0, import_common13.hasActiveFilter)(source.tagFilter)) {
|
|
7167
7224
|
return new TagFilteredContentSource(source.id, source.tagFilter, user);
|
|
7168
7225
|
}
|
|
7169
7226
|
return getDataLayer().getCourseDB(source.id);
|
|
7170
7227
|
}
|
|
7171
7228
|
}
|
|
7172
|
-
var
|
|
7229
|
+
var import_common13;
|
|
7173
7230
|
var init_contentSource = __esm({
|
|
7174
7231
|
"src/core/interfaces/contentSource.ts"() {
|
|
7175
7232
|
"use strict";
|
|
7176
7233
|
init_factory();
|
|
7177
7234
|
init_classroomDB2();
|
|
7178
|
-
|
|
7235
|
+
import_common13 = require("@vue-skuilder/common");
|
|
7179
7236
|
init_TagFilteredContentSource();
|
|
7180
7237
|
}
|
|
7181
7238
|
});
|
|
@@ -7273,11 +7330,11 @@ var init_util = __esm({
|
|
|
7273
7330
|
});
|
|
7274
7331
|
|
|
7275
7332
|
// src/core/bulkImport/cardProcessor.ts
|
|
7276
|
-
var
|
|
7333
|
+
var import_common14;
|
|
7277
7334
|
var init_cardProcessor = __esm({
|
|
7278
7335
|
"src/core/bulkImport/cardProcessor.ts"() {
|
|
7279
7336
|
"use strict";
|
|
7280
|
-
|
|
7337
|
+
import_common14 = require("@vue-skuilder/common");
|
|
7281
7338
|
init_logger();
|
|
7282
7339
|
}
|
|
7283
7340
|
});
|
|
@@ -7782,13 +7839,13 @@ function getStreak(records) {
|
|
|
7782
7839
|
function getLapses(records) {
|
|
7783
7840
|
return records.filter((r) => r.isCorrect === false).length;
|
|
7784
7841
|
}
|
|
7785
|
-
var import_moment4,
|
|
7842
|
+
var import_moment4, import_common15, duration;
|
|
7786
7843
|
var init_SpacedRepetition = __esm({
|
|
7787
7844
|
"src/study/SpacedRepetition.ts"() {
|
|
7788
7845
|
"use strict";
|
|
7789
7846
|
init_util();
|
|
7790
7847
|
import_moment4 = __toESM(require("moment"), 1);
|
|
7791
|
-
|
|
7848
|
+
import_common15 = require("@vue-skuilder/common");
|
|
7792
7849
|
init_logger();
|
|
7793
7850
|
duration = import_moment4.default.duration;
|
|
7794
7851
|
}
|
|
@@ -7807,42 +7864,42 @@ var init_SrsService = __esm({
|
|
|
7807
7864
|
});
|
|
7808
7865
|
|
|
7809
7866
|
// src/study/services/tagRecent.ts
|
|
7810
|
-
var
|
|
7867
|
+
var import_common16;
|
|
7811
7868
|
var init_tagRecent = __esm({
|
|
7812
7869
|
"src/study/services/tagRecent.ts"() {
|
|
7813
7870
|
"use strict";
|
|
7814
|
-
|
|
7871
|
+
import_common16 = require("@vue-skuilder/common");
|
|
7815
7872
|
}
|
|
7816
7873
|
});
|
|
7817
7874
|
|
|
7818
7875
|
// src/study/services/EloService.ts
|
|
7819
|
-
var
|
|
7876
|
+
var import_common17;
|
|
7820
7877
|
var init_EloService = __esm({
|
|
7821
7878
|
"src/study/services/EloService.ts"() {
|
|
7822
7879
|
"use strict";
|
|
7823
|
-
|
|
7880
|
+
import_common17 = require("@vue-skuilder/common");
|
|
7824
7881
|
init_logger();
|
|
7825
7882
|
init_tagRecent();
|
|
7826
7883
|
}
|
|
7827
7884
|
});
|
|
7828
7885
|
|
|
7829
7886
|
// src/study/services/ResponseProcessor.ts
|
|
7830
|
-
var
|
|
7887
|
+
var import_common18;
|
|
7831
7888
|
var init_ResponseProcessor = __esm({
|
|
7832
7889
|
"src/study/services/ResponseProcessor.ts"() {
|
|
7833
7890
|
"use strict";
|
|
7834
7891
|
init_core();
|
|
7835
7892
|
init_logger();
|
|
7836
|
-
|
|
7893
|
+
import_common18 = require("@vue-skuilder/common");
|
|
7837
7894
|
}
|
|
7838
7895
|
});
|
|
7839
7896
|
|
|
7840
7897
|
// src/study/services/CardHydrationService.ts
|
|
7841
|
-
var
|
|
7898
|
+
var import_common19;
|
|
7842
7899
|
var init_CardHydrationService = __esm({
|
|
7843
7900
|
"src/study/services/CardHydrationService.ts"() {
|
|
7844
7901
|
"use strict";
|
|
7845
|
-
|
|
7902
|
+
import_common19 = require("@vue-skuilder/common");
|
|
7846
7903
|
init_logger();
|
|
7847
7904
|
}
|
|
7848
7905
|
});
|
|
@@ -9736,6 +9793,7 @@ var init_SessionController = __esm({
|
|
|
9736
9793
|
init_util2();
|
|
9737
9794
|
init_navigators();
|
|
9738
9795
|
init_Pipeline();
|
|
9796
|
+
init_versionStamps();
|
|
9739
9797
|
init_SourceMixer();
|
|
9740
9798
|
init_MixerDebugger();
|
|
9741
9799
|
init_SessionDebugger();
|
|
@@ -10008,13 +10066,13 @@ async function dropUserFromClassroom(user, classID) {
|
|
|
10008
10066
|
async function getUserClassrooms(user) {
|
|
10009
10067
|
return getOrCreateClassroomRegistrationsDoc(user);
|
|
10010
10068
|
}
|
|
10011
|
-
var
|
|
10069
|
+
var import_common20, import_moment7, log3, HYDRATION_TIMEOUT_MS, BaseUser, userCoursesDoc, userClassroomsDoc;
|
|
10012
10070
|
var init_BaseUserDB = __esm({
|
|
10013
10071
|
"src/impl/common/BaseUserDB.ts"() {
|
|
10014
10072
|
"use strict";
|
|
10015
10073
|
init_core();
|
|
10016
10074
|
init_util();
|
|
10017
|
-
|
|
10075
|
+
import_common20 = require("@vue-skuilder/common");
|
|
10018
10076
|
import_moment7 = __toESM(require("moment"), 1);
|
|
10019
10077
|
init_types_legacy();
|
|
10020
10078
|
init_logger();
|
|
@@ -10117,7 +10175,7 @@ Currently logged-in as ${this._username}.`
|
|
|
10117
10175
|
);
|
|
10118
10176
|
}
|
|
10119
10177
|
const result = await this.syncStrategy.createAccount(username, password);
|
|
10120
|
-
if (result.status ===
|
|
10178
|
+
if (result.status === import_common20.Status.ok) {
|
|
10121
10179
|
log3(`Account created successfully, updating username to ${username}`);
|
|
10122
10180
|
this._username = username;
|
|
10123
10181
|
try {
|
|
@@ -10193,7 +10251,7 @@ Currently logged-in as ${this._username}.`
|
|
|
10193
10251
|
async resetUserData() {
|
|
10194
10252
|
if (this.syncStrategy.canAuthenticate()) {
|
|
10195
10253
|
return {
|
|
10196
|
-
status:
|
|
10254
|
+
status: import_common20.Status.error,
|
|
10197
10255
|
error: "Reset user data is only available for local-only mode. Use logout instead for remote sync."
|
|
10198
10256
|
};
|
|
10199
10257
|
}
|
|
@@ -10215,11 +10273,11 @@ Currently logged-in as ${this._username}.`
|
|
|
10215
10273
|
await localDB.bulkDocs(docsToDelete);
|
|
10216
10274
|
}
|
|
10217
10275
|
await this.init();
|
|
10218
|
-
return { status:
|
|
10276
|
+
return { status: import_common20.Status.ok };
|
|
10219
10277
|
} catch (error) {
|
|
10220
10278
|
logger.error("Failed to reset user data:", error);
|
|
10221
10279
|
return {
|
|
10222
|
-
status:
|
|
10280
|
+
status: import_common20.Status.error,
|
|
10223
10281
|
error: error instanceof Error ? error.message : "Unknown error during reset"
|
|
10224
10282
|
};
|
|
10225
10283
|
}
|
|
@@ -11138,6 +11196,7 @@ var init_factory = __esm({
|
|
|
11138
11196
|
init_common();
|
|
11139
11197
|
init_logger();
|
|
11140
11198
|
init_navigators();
|
|
11199
|
+
init_versionStamps();
|
|
11141
11200
|
NOT_SET = "NOT_SET";
|
|
11142
11201
|
ENV = {
|
|
11143
11202
|
COUCHDB_SERVER_PROTOCOL: NOT_SET,
|
|
@@ -11560,14 +11619,14 @@ var init_auth = __esm({
|
|
|
11560
11619
|
});
|
|
11561
11620
|
|
|
11562
11621
|
// src/impl/couch/CouchDBSyncStrategy.ts
|
|
11563
|
-
var
|
|
11622
|
+
var import_common22, log4, CouchDBSyncStrategy;
|
|
11564
11623
|
var init_CouchDBSyncStrategy = __esm({
|
|
11565
11624
|
"src/impl/couch/CouchDBSyncStrategy.ts"() {
|
|
11566
11625
|
"use strict";
|
|
11567
11626
|
init_factory();
|
|
11568
11627
|
init_types_legacy();
|
|
11569
11628
|
init_logger();
|
|
11570
|
-
|
|
11629
|
+
import_common22 = require("@vue-skuilder/common");
|
|
11571
11630
|
init_common();
|
|
11572
11631
|
init_pouchdb_setup();
|
|
11573
11632
|
init_couch();
|
|
@@ -11708,32 +11767,32 @@ var init_CouchDBSyncStrategy = __esm({
|
|
|
11708
11767
|
}
|
|
11709
11768
|
}
|
|
11710
11769
|
return {
|
|
11711
|
-
status:
|
|
11770
|
+
status: import_common22.Status.ok,
|
|
11712
11771
|
error: void 0
|
|
11713
11772
|
};
|
|
11714
11773
|
} else {
|
|
11715
11774
|
return {
|
|
11716
|
-
status:
|
|
11775
|
+
status: import_common22.Status.error,
|
|
11717
11776
|
error: "Failed to log in after account creation"
|
|
11718
11777
|
};
|
|
11719
11778
|
}
|
|
11720
11779
|
} else {
|
|
11721
11780
|
logger.warn(`Signup not OK: ${JSON.stringify(signupRequest)}`);
|
|
11722
11781
|
return {
|
|
11723
|
-
status:
|
|
11782
|
+
status: import_common22.Status.error,
|
|
11724
11783
|
error: "Account creation failed"
|
|
11725
11784
|
};
|
|
11726
11785
|
}
|
|
11727
11786
|
} catch (e) {
|
|
11728
11787
|
if (e.reason === "Document update conflict.") {
|
|
11729
11788
|
return {
|
|
11730
|
-
status:
|
|
11789
|
+
status: import_common22.Status.error,
|
|
11731
11790
|
error: "This username is taken!"
|
|
11732
11791
|
};
|
|
11733
11792
|
}
|
|
11734
11793
|
logger.error(`Error on signup: ${JSON.stringify(e)}`);
|
|
11735
11794
|
return {
|
|
11736
|
-
status:
|
|
11795
|
+
status: import_common22.Status.error,
|
|
11737
11796
|
error: e.message || "Unknown error during account creation"
|
|
11738
11797
|
};
|
|
11739
11798
|
}
|