@vue-skuilder/common-ui 0.2.2 → 0.2.4

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.
@@ -1,3 +1,4 @@
1
+ import { ReplanHints, OutcomeObserver } from '../../../db/dist/index.mjs';
1
2
  /**
2
3
  * Misc. config for a study StudySessionConfig
3
4
  */
@@ -29,11 +30,27 @@ export type StudySessionConfig = {
29
30
  */
30
31
  initialReviewCap?: number;
31
32
  /**
32
- * Optional hints to apply to the very first pipeline run (session init).
33
+ * Optional session-durable hints applied from session init onward.
33
34
  * Uses the same format as `ReplanOptions.hints` — boost/exclude/require tags.
34
- * Applied via `setEphemeralHints()` before `prepareSession()`.
35
+ *
36
+ * Routed to `SessionController.setSessionHints()` before `prepareSession()`,
37
+ * so they are re-merged into every pipeline run for the rest of the session
38
+ * (initial plan + every replan), not consumed by the first run alone. This
39
+ * is what a post-lesson concept boost wants: emphasis that outlives the
40
+ * first queue rebuild rather than being clobbered by the first auto-replan.
41
+ */
42
+ initHints?: ReplanHints;
43
+ /**
44
+ * Hooks invoked after each question response is processed, for the whole
45
+ * session. The framework-blessed seam for cross-cutting reactions to
46
+ * observed performance — e.g. boosting a just-failed concept tag via
47
+ * session-durable hints, in one place rather than per question view.
48
+ *
49
+ * Each observer receives a read-only `SessionOutcome` (record + card tags +
50
+ * nav result) and a narrow `SessionControls` capability (read/merge/replace
51
+ * session hints, request a replan). See `OutcomeObserver` in `@vue-skuilder/db`.
35
52
  */
36
- initHints?: Record<string, unknown>;
53
+ outcomeObservers?: OutcomeObserver[];
37
54
  };
38
55
  /**
39
56
  * Built-in card transition presets provided by StudySession.
@@ -1 +1 @@
1
- {"version":3,"file":"StudySession.types.d.ts","sourceRoot":"","sources":["../../src/components/StudySession.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,OAAO,CAAC;IAEvB;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,YAAY,GAAG,YAAY,CAAC;AAElF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"StudySession.types.d.ts","sourceRoot":"","sources":["../../src/components/StudySession.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,OAAO,CAAC;IAEvB;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACtC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,YAAY,GAAG,YAAY,CAAC;AAElF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StudySession.vue.d.ts","sourceRoot":"","sources":["../../src/components/StudySession.vue"],"names":[],"mappings":"AAiFA;AAAA,OAmzBO,EAAE,eAAe,EAAW,QAAQ,EAAE,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAM/C,OAAO,UAAU,MAAM,gCAAgC,CAAC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G;;IAYH;;;;;;;;;;;;;OAaG;kCAC2B,aAAa;uBAUxB,MAAM,GAAG,SAAS;kCASxB,OAAO;;;;8BAsJM,MAAM,WAAW,MAAM,GAAG,MAAM;0BAI9B,aAAa,KAAK,UAAU;6BAiF/B,cAAc;;qBAsDhB,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;mBAO/C,YAAY,GAAG,IAAI;;;;;;;cA1dvB,QAAQ,CAAC,eAAe,EAAE,CAAC;;;;cAI1B,QAAQ,CAAC,eAAe,CAAC;;;;cAIzB,QAAQ,CAAC,iBAAiB,CAAC;;;;cAI3B,QAAQ,CAAC,kBAAkB,CAAC;;;;;;cAI1B,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,CAAC;;;;;;;;;;;;cAY7C,QAAQ,CAAC,oBAAoB,GAAG,MAAM,CAAC;;;;cAIvC,QAAQ,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnDlD,wBAwhBG"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.2.2",
6
+ "version": "0.2.4",
7
7
  "sideEffects": false,
8
8
  "main": "./dist/common-ui.umd.js",
9
9
  "module": "./dist/common-ui.es.js",
@@ -34,8 +34,8 @@
34
34
  "@highlightjs/vue-plugin": "^2.1.2",
35
35
  "@mdi/font": "^7.3.67",
36
36
  "@vojtechlanka/vue-tags-input": "^3",
37
- "@vue-skuilder/common": "0.2.2",
38
- "@vue-skuilder/db": "0.2.2",
37
+ "@vue-skuilder/common": "0.2.4",
38
+ "@vue-skuilder/db": "0.2.4",
39
39
  "highlight.js": "^11.0.1",
40
40
  "marked": "^15.0.6",
41
41
  "moment": "^2.29.4",
@@ -71,5 +71,5 @@
71
71
  "vite-plugin-dts": "^4.5.3",
72
72
  "vitest": "^4.1.0"
73
73
  },
74
- "stableVersion": "0.2.2"
74
+ "stableVersion": "0.2.4"
75
75
  }
@@ -1,3 +1,5 @@
1
+ import type { ReplanHints, OutcomeObserver } from '@vue-skuilder/db';
2
+
1
3
  /**
2
4
  * Misc. config for a study StudySessionConfig
3
5
  */
@@ -32,11 +34,28 @@ export type StudySessionConfig = {
32
34
  initialReviewCap?: number;
33
35
 
34
36
  /**
35
- * Optional hints to apply to the very first pipeline run (session init).
37
+ * Optional session-durable hints applied from session init onward.
36
38
  * Uses the same format as `ReplanOptions.hints` — boost/exclude/require tags.
37
- * Applied via `setEphemeralHints()` before `prepareSession()`.
39
+ *
40
+ * Routed to `SessionController.setSessionHints()` before `prepareSession()`,
41
+ * so they are re-merged into every pipeline run for the rest of the session
42
+ * (initial plan + every replan), not consumed by the first run alone. This
43
+ * is what a post-lesson concept boost wants: emphasis that outlives the
44
+ * first queue rebuild rather than being clobbered by the first auto-replan.
45
+ */
46
+ initHints?: ReplanHints;
47
+
48
+ /**
49
+ * Hooks invoked after each question response is processed, for the whole
50
+ * session. The framework-blessed seam for cross-cutting reactions to
51
+ * observed performance — e.g. boosting a just-failed concept tag via
52
+ * session-durable hints, in one place rather than per question view.
53
+ *
54
+ * Each observer receives a read-only `SessionOutcome` (record + card tags +
55
+ * nav result) and a narrow `SessionControls` capability (read/merge/replace
56
+ * session hints, request a replan). See `OutcomeObserver` in `@vue-skuilder/db`.
38
57
  */
39
- initHints?: Record<string, unknown>;
58
+ outcomeObservers?: OutcomeObserver[];
40
59
  };
41
60
 
42
61
  /**
@@ -102,6 +102,7 @@ import {
102
102
  getStudySource,
103
103
  HydratedCard,
104
104
  isQuestionRecord,
105
+ OutcomeObserver,
105
106
  ReplanOptions,
106
107
  ResponseResult,
107
108
  SessionController,
@@ -385,13 +386,20 @@ export default defineComponent({
385
386
  // db.setChangeFcn(this.handleClassroomMessage());
386
387
  });
387
388
 
388
- const scOptions: { defaultBatchLimit?: number; initialReviewCap?: number } = {};
389
+ const scOptions: {
390
+ defaultBatchLimit?: number;
391
+ initialReviewCap?: number;
392
+ outcomeObservers?: OutcomeObserver[];
393
+ } = {};
389
394
  if (this.sessionConfig?.defaultBatchLimit !== undefined) {
390
395
  scOptions.defaultBatchLimit = this.sessionConfig.defaultBatchLimit;
391
396
  }
392
397
  if (this.sessionConfig?.initialReviewCap !== undefined) {
393
398
  scOptions.initialReviewCap = this.sessionConfig.initialReviewCap;
394
399
  }
400
+ if (this.sessionConfig?.outcomeObservers?.length) {
401
+ scOptions.outcomeObservers = this.sessionConfig.outcomeObservers;
402
+ }
395
403
 
396
404
  this.sessionController = markRaw(
397
405
  new SessionController<ViewComponent>(
@@ -405,12 +413,14 @@ export default defineComponent({
405
413
  );
406
414
  this.sessionController.sessionRecord = this.sessionRecord;
407
415
 
408
- // Apply init hints if provided (e.g. post-lesson boost tags)
416
+ // Apply init hints as SESSION-DURABLE hints (e.g. post-lesson boost
417
+ // tags). Routed through the controller's session-hints accumulator so
418
+ // they are re-merged into every pipeline run for the rest of the
419
+ // session — rather than being consumed by the initial plan alone and
420
+ // then clobbered by the first (replace-mode) auto-replan.
409
421
  if (this.sessionConfig?.initHints) {
410
- for (const source of this.sessionContentSources) {
411
- source.setEphemeralHints?.(this.sessionConfig.initHints as any);
412
- }
413
- console.log('[StudySession] Applied init hints to content sources');
422
+ this.sessionController.setSessionHints(this.sessionConfig.initHints);
423
+ console.log('[StudySession] Applied init hints as session-durable hints');
414
424
  }
415
425
 
416
426
  await this.sessionController.prepareSession();