@vue-skuilder/db 0.2.31 → 0.2.33
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-Doh1aVBJ.d.cts → contentSource-CTQ4kWhR.d.cts} +22 -0
- package/dist/{contentSource-DMduBjDC.d.ts → contentSource-JmWYu8IK.d.ts} +22 -0
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +50 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +50 -3
- package/dist/core/index.mjs.map +1 -1
- package/dist/{dataLayerProvider-BW1CBAbb.d.cts → dataLayerProvider-DfI_KYAe.d.cts} +1 -1
- package/dist/{dataLayerProvider-Cxfe4nSK.d.ts → dataLayerProvider-rlLE2Mf-.d.ts} +1 -1
- package/dist/diagnostics/index.d.cts +2 -2
- package/dist/diagnostics/index.d.ts +2 -2
- package/dist/diagnostics/index.js +12 -0
- package/dist/diagnostics/index.js.map +1 -1
- package/dist/diagnostics/index.mjs +12 -0
- package/dist/diagnostics/index.mjs.map +1 -1
- package/dist/impl/couch/index.d.cts +17 -2
- package/dist/impl/couch/index.d.ts +17 -2
- package/dist/impl/couch/index.js +50 -3
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +50 -3
- 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 +50 -3
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +50 -3
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +101 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -8
- 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 +12 -0
- package/src/core/navigators/defaults.ts +4 -1
- package/src/core/types/studySession.ts +11 -1
- package/src/core/versionStamps.ts +66 -0
- package/src/diagnostics/text.ts +13 -0
- package/src/factory.ts +6 -0
- package/src/study/SessionController.ts +3 -0
- package/src/study/services/EloService.ts +49 -4
- 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';
|
|
@@ -4244,6 +4244,11 @@ var init_Pipeline = __esm({
|
|
|
4244
4244
|
* This eliminates a remote getCourseConfig() round trip per pipeline run.
|
|
4245
4245
|
*/
|
|
4246
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;
|
|
4247
4252
|
/**
|
|
4248
4253
|
* Persistent tag cache. Maps cardId → tag names.
|
|
4249
4254
|
*
|
|
@@ -4437,7 +4442,8 @@ var init_Pipeline = __esm({
|
|
|
4437
4442
|
logResultCards(result);
|
|
4438
4443
|
logCardProvenance(result, 3);
|
|
4439
4444
|
try {
|
|
4440
|
-
const
|
|
4445
|
+
const courseConfig = await this.course?.getCourseConfig().catch(() => void 0);
|
|
4446
|
+
const courseName = courseConfig?.name;
|
|
4441
4447
|
const report = buildRunReport(
|
|
4442
4448
|
this.course?.getCourseID() || "unknown",
|
|
4443
4449
|
courseName,
|
|
@@ -4452,7 +4458,11 @@ var init_Pipeline = __esm({
|
|
|
4452
4458
|
scoredCards,
|
|
4453
4459
|
regulators
|
|
4454
4460
|
);
|
|
4455
|
-
|
|
4461
|
+
const versions = {
|
|
4462
|
+
...this.strategyHash ? { strategies: this.strategyHash } : {},
|
|
4463
|
+
...courseConfig?.contentVersion ? { content: courseConfig.contentVersion } : {}
|
|
4464
|
+
};
|
|
4465
|
+
captureRun({ ...report, ...Object.keys(versions).length ? { versions } : {} });
|
|
4456
4466
|
} catch (e) {
|
|
4457
4467
|
logger.debug(`[Pipeline] Failed to capture debug run: ${e}`);
|
|
4458
4468
|
}
|
|
@@ -4949,6 +4959,36 @@ var init_Pipeline = __esm({
|
|
|
4949
4959
|
}
|
|
4950
4960
|
});
|
|
4951
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
|
+
|
|
4952
4992
|
// src/core/navigators/defaults.ts
|
|
4953
4993
|
var defaults_exports = {};
|
|
4954
4994
|
__export(defaults_exports, {
|
|
@@ -5001,7 +5041,9 @@ function createDefaultPipeline(user, course) {
|
|
|
5001
5041
|
course,
|
|
5002
5042
|
createDefaultEloDistanceStrategy(courseId)
|
|
5003
5043
|
);
|
|
5004
|
-
|
|
5044
|
+
const pipeline = new Pipeline(compositeGenerator, [eloDistanceFilter], user, course);
|
|
5045
|
+
pipeline.strategyHash = DEFAULT_STRATEGY_HASH;
|
|
5046
|
+
return pipeline;
|
|
5005
5047
|
}
|
|
5006
5048
|
var init_defaults = __esm({
|
|
5007
5049
|
"src/core/navigators/defaults.ts"() {
|
|
@@ -5013,6 +5055,7 @@ var init_defaults = __esm({
|
|
|
5013
5055
|
init_srs();
|
|
5014
5056
|
init_eloDistance();
|
|
5015
5057
|
init_types_legacy();
|
|
5058
|
+
init_versionStamps();
|
|
5016
5059
|
}
|
|
5017
5060
|
});
|
|
5018
5061
|
|
|
@@ -5156,6 +5199,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5156
5199
|
init_logger();
|
|
5157
5200
|
init_CompositeGenerator();
|
|
5158
5201
|
init_pipelinePlan();
|
|
5202
|
+
init_versionStamps();
|
|
5159
5203
|
PipelineAssembler = class {
|
|
5160
5204
|
/**
|
|
5161
5205
|
* Assembles a navigation pipeline from strategy documents.
|
|
@@ -5237,6 +5281,7 @@ var init_PipelineAssembler = __esm({
|
|
|
5237
5281
|
}
|
|
5238
5282
|
}
|
|
5239
5283
|
const pipeline = new Pipeline(generator, filters, user, course);
|
|
5284
|
+
pipeline.strategyHash = strategyHash(strategies);
|
|
5240
5285
|
logger.debug(
|
|
5241
5286
|
`[PipelineAssembler] Assembled pipeline with ${generatorStrategies.length} generator(s) and ${filters.length} filter(s)`
|
|
5242
5287
|
);
|
|
@@ -7733,6 +7778,7 @@ var init_SessionController = __esm({
|
|
|
7733
7778
|
init_util2();
|
|
7734
7779
|
init_navigators();
|
|
7735
7780
|
init_Pipeline();
|
|
7781
|
+
init_versionStamps();
|
|
7736
7782
|
init_SourceMixer();
|
|
7737
7783
|
init_MixerDebugger();
|
|
7738
7784
|
init_SessionDebugger();
|
|
@@ -9215,6 +9261,7 @@ var init_factory = __esm({
|
|
|
9215
9261
|
init_common();
|
|
9216
9262
|
init_logger();
|
|
9217
9263
|
init_navigators();
|
|
9264
|
+
init_versionStamps();
|
|
9218
9265
|
NOT_SET = "NOT_SET";
|
|
9219
9266
|
ENV = {
|
|
9220
9267
|
COUCHDB_SERVER_PROTOCOL: NOT_SET,
|