@happyvertical/smrt-education 0.57.50 → 0.57.52

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.
Files changed (57) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +18 -1
  3. package/agents/course-authoring-service.md +39 -0
  4. package/agents/course-bundle-import.md +80 -2
  5. package/agents/course-generation-review.md +53 -0
  6. package/agents/learner-service.md +20 -0
  7. package/agents/tutor-context.md +2 -1
  8. package/dist/chunks/{workbook-photo-service-WwDDC5GF.js → workbook-photo-service-BtMQsbhq.js} +1036 -402
  9. package/dist/chunks/workbook-photo-service-BtMQsbhq.js.map +1 -0
  10. package/dist/course-authoring-contracts.d.ts +23 -1
  11. package/dist/course-authoring-contracts.d.ts.map +1 -1
  12. package/dist/course-authoring-models.d.ts +2 -0
  13. package/dist/course-authoring-models.d.ts.map +1 -1
  14. package/dist/course-authoring-service.d.ts +56 -2
  15. package/dist/course-authoring-service.d.ts.map +1 -1
  16. package/dist/course-bundle-contracts.d.ts +23 -3
  17. package/dist/course-bundle-contracts.d.ts.map +1 -1
  18. package/dist/course-bundle-models.d.ts +3 -0
  19. package/dist/course-bundle-models.d.ts.map +1 -1
  20. package/dist/course-bundle-service.d.ts +45 -1
  21. package/dist/course-bundle-service.d.ts.map +1 -1
  22. package/dist/course-bundle.d.ts +32 -0
  23. package/dist/course-bundle.d.ts.map +1 -1
  24. package/dist/course-generation-contracts.d.ts +91 -0
  25. package/dist/course-generation-contracts.d.ts.map +1 -1
  26. package/dist/course-generation-models.d.ts +29 -0
  27. package/dist/course-generation-models.d.ts.map +1 -1
  28. package/dist/course-generation-output.d.ts +9 -3
  29. package/dist/course-generation-output.d.ts.map +1 -1
  30. package/dist/course-generation-proposal-generator.d.ts +171 -1
  31. package/dist/course-generation-proposal-generator.d.ts.map +1 -1
  32. package/dist/course-generation-review-service.d.ts +15 -1
  33. package/dist/course-generation-review-service.d.ts.map +1 -1
  34. package/dist/document-converter.d.ts +138 -0
  35. package/dist/document-converter.d.ts.map +1 -0
  36. package/dist/index.d.ts +8 -5
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +750 -340
  39. package/dist/index.js.map +1 -1
  40. package/dist/ingestion.js +1 -1
  41. package/dist/learner-history.d.ts +23 -0
  42. package/dist/learner-history.d.ts.map +1 -1
  43. package/dist/learner-interest-theme.d.ts +25 -0
  44. package/dist/learner-interest-theme.d.ts.map +1 -0
  45. package/dist/learner-service.d.ts +31 -2
  46. package/dist/learner-service.d.ts.map +1 -1
  47. package/dist/learners.d.ts +4 -0
  48. package/dist/learners.d.ts.map +1 -1
  49. package/dist/manifest.json +3716 -2783
  50. package/dist/question-authoring-service.d.ts +12 -0
  51. package/dist/question-authoring-service.d.ts.map +1 -1
  52. package/dist/smrt-knowledge.json +380 -17
  53. package/dist/tutor-context-service.d.ts.map +1 -1
  54. package/dist/tutor-contracts.d.ts +8 -0
  55. package/dist/tutor-contracts.d.ts.map +1 -1
  56. package/package.json +8 -8
  57. package/dist/chunks/workbook-photo-service-WwDDC5GF.js.map +0 -1
@@ -1,4 +1,6 @@
1
1
  import { CourseAuthoringError } from './course-authoring-contracts.js';
2
+ import type { InterestTheme, InterestThemeInput } from './learner-interest-theme.js';
3
+ import type { QuestionAnswerKey, QuestionChoice, QuestionResponseType, QuestionRubric, QuestionSubpart } from './question-contracts.js';
2
4
  export type CourseGenerationStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'refused';
3
5
  export declare const COURSE_GENERATION_STATUSES: readonly CourseGenerationStatus[];
4
6
  export declare const COURSE_GENERATION_TERMINAL: readonly CourseGenerationStatus[];
@@ -39,6 +41,66 @@ export interface CourseGeneratorIdentity {
39
41
  model: string;
40
42
  version: string;
41
43
  }
44
+ /**
45
+ * What a generation request produces: the whole course (today's behaviour and
46
+ * the default) or exactly one lesson with its worksheet, answer key and themed
47
+ * explanations.
48
+ */
49
+ export type CourseGenerationTarget = 'course' | 'lesson';
50
+ export declare const COURSE_GENERATION_TARGETS: readonly CourseGenerationTarget[];
51
+ /** Where the theme used for a request came from. */
52
+ export type CourseGenerationThemeSource = 'override' | 'saved' | 'none';
53
+ /** Longest structured field (subject, category, area), in characters. */
54
+ export declare const MAX_GENERATION_BRIEF_FIELD_CHARS = 200;
55
+ /** Longest objective statement, in characters. */
56
+ export declare const MAX_GENERATION_OBJECTIVE_CHARS = 1000;
57
+ /** Highest grade level a structured request may name (0 is kindergarten). */
58
+ export declare const MAX_GENERATION_GRADE = 12;
59
+ /**
60
+ * Structured fields a host may carry on a generation request next to the free
61
+ * `instruction`. All are optional except that a `lesson` target needs an
62
+ * objective (from `objective` or, failing that, `area`). Untrusted text: it is
63
+ * bounded, stored and sent to the provider as data, never as authority.
64
+ */
65
+ export interface CourseGenerationBriefInput {
66
+ /** Defaults to `course`. */
67
+ target?: CourseGenerationTarget;
68
+ subject?: string;
69
+ category?: string;
70
+ /** The specific skill to learn, for example "multiplying by tens". */
71
+ area?: string;
72
+ /** Whole grade level, 0-12. */
73
+ grade?: number;
74
+ /**
75
+ * The curriculum's objective for a lesson. The theme never changes it; it is
76
+ * carried verbatim in the generation brief and the proposal.
77
+ */
78
+ objective?: string;
79
+ /** Stable `LearningObjective` id the generated questions are linked to. */
80
+ learningObjectiveId?: string;
81
+ /** The learner the request is for; needed to fall back to their saved theme. */
82
+ learnerId?: string;
83
+ /**
84
+ * Per-request theme. When present it wins for this request only; it never
85
+ * changes the learner's saved preference.
86
+ */
87
+ theme?: InterestThemeInput | null;
88
+ }
89
+ /** The resolved, stored brief: what the provider is asked and what review shows. */
90
+ export interface CourseGenerationBrief {
91
+ target: CourseGenerationTarget;
92
+ subject: string;
93
+ category: string;
94
+ area: string;
95
+ grade: number | null;
96
+ objective: string;
97
+ learningObjectiveId: string | null;
98
+ learnerId: string | null;
99
+ /** The theme used for story and examples only, or null when there was none. */
100
+ theme: InterestTheme | null;
101
+ /** `override` (this request), `saved` (the learner's preference) or `none`. */
102
+ themeSource: CourseGenerationThemeSource;
103
+ }
42
104
  /** What a generator is given: the exact snapshot retained on the job. */
43
105
  export interface CourseGeneratorRequest {
44
106
  tenantId: string;
@@ -47,6 +109,12 @@ export interface CourseGeneratorRequest {
47
109
  instruction: string;
48
110
  /** Immutable snapshot of the base revision; never contains answer keys. */
49
111
  material: unknown;
112
+ /**
113
+ * The resolved structured brief, when the request carried one. For a `lesson`
114
+ * target the generator must return exactly one lesson that teaches
115
+ * `brief.objective`; the theme may change only its story and examples.
116
+ */
117
+ brief?: CourseGenerationBrief;
50
118
  }
51
119
  /**
52
120
  * Host-injected generation port. It matches the ingestion `ProposalGenerator`
@@ -71,6 +139,16 @@ export interface CourseGenerationLimits {
71
139
  maxOutputBytes: number;
72
140
  }
73
141
  /** Closed, validated generation output. Absent members are not proposed. */
142
+ /** One generated question (lesson target only); the answer key is required. */
143
+ export interface CourseGenerationProposalQuestion {
144
+ prompt: string;
145
+ responseType: QuestionResponseType;
146
+ choices?: QuestionChoice[];
147
+ subparts?: QuestionSubpart[];
148
+ answerKey: QuestionAnswerKey;
149
+ rubric?: QuestionRubric;
150
+ pointsPossible?: number;
151
+ }
74
152
  export interface CourseGenerationProposalLesson {
75
153
  /** Existing lesson to propose changes to; omitted for a new lesson. */
76
154
  lessonKey?: string;
@@ -81,6 +159,10 @@ export interface CourseGenerationProposalLesson {
81
159
  body?: string;
82
160
  estimatedMinutes?: number;
83
161
  difficulty?: number;
162
+ /** Lesson target only. Always equals the brief's objective once validated. */
163
+ objective?: string;
164
+ /** Lesson target only: the worksheet. Answer keys never reach a learner view. */
165
+ questions?: CourseGenerationProposalQuestion[];
84
166
  }
85
167
  export interface CourseGenerationProposal {
86
168
  course: {
@@ -114,6 +196,8 @@ export interface CourseProposalView {
114
196
  /** The new draft revision holding only additions and fills. */
115
197
  resultRevisionId: string;
116
198
  rationale: string;
199
+ /** The brief the proposal answered: objective, theme and where the theme came from. */
200
+ brief: CourseGenerationBrief | null;
117
201
  fields: CourseProposalFieldView[];
118
202
  }
119
203
  export interface CourseGenerationUsageView {
@@ -146,6 +230,8 @@ export interface CourseGenerationView {
146
230
  baseRevisionId: string;
147
231
  requestKey: string;
148
232
  instruction: string;
233
+ /** The resolved structured brief; null for a plain instruction-only request. */
234
+ brief: CourseGenerationBrief | null;
149
235
  status: CourseGenerationStatus;
150
236
  provider: string;
151
237
  model: string;
@@ -183,4 +269,9 @@ export declare class CourseProposalFieldError extends CourseAuthoringError {
183
269
  readonly fields: readonly string[];
184
270
  constructor(fields: readonly string[]);
185
271
  }
272
+ /** The structured brief was malformed or inconsistent with its target. */
273
+ export declare class CourseGenerationBriefError extends CourseAuthoringError {
274
+ readonly field: string;
275
+ constructor(field: string);
276
+ }
186
277
  //# sourceMappingURL=course-generation-contracts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"course-generation-contracts.d.ts","sourceRoot":"","sources":["../src/course-generation-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,MAAM,MAAM,sBAAsB,GAC9B,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,GACR,WAAW,GACX,SAAS,CAAC;AACd,eAAO,MAAM,0BAA0B,EAAE,SAAS,sBAAsB,EAOvE,CAAC;AACF,eAAO,MAAM,0BAA0B,EAAE,SAAS,sBAAsB,EAKvE,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAEnD,+EAA+E;AAC/E,MAAM,WAAW,6BAA6B;IAC5C,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,M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AM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,yBAAyB,CAAC;IACjC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,2CAA2C;IAC3C,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,yBAAyB,EAAE,CAAC;CACrC;AAED,qBAAa,iCAAkC,SAAQ,oBAAoB;;CAO1E;AACD,qBAAa,6BAA8B,SAAQ,oBAAoB;;CAItE;AACD,qBAAa,+BAAgC,SAAQ,oBAAoB;;CAIxE;AACD,qBAAa,2BAA4B,SAAQ,oBAAoB;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAMlC;AACD,qBAAa,2BAA4B,SAAQ,oBAAoB;;CAIpE;AACD,qBAAa,wBAAyB,SAAQ,oBAAoB;IACpD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE;gBAAzB,MAAM,EAAE,SAAS,MAAM,EAAE;CAM/C;AAED,0EAA0E;AAC1E,qBAAa,0BAA2B,SAAQ,oBAAoB;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;CAGnC"}
@@ -91,4 +91,33 @@ export declare class CourseProposalDecision extends SmrtObject {
91
91
  export declare class CourseProposalDecisionCollection extends SmrtCollection<CourseProposalDecision> {
92
92
  static readonly _itemClass: typeof CourseProposalDecision;
93
93
  }
94
+ /**
95
+ * The structured brief of one generation job and the theme it resolved to:
96
+ * written once with the job, never rewritten, so the guardian review can show
97
+ * the objective, the theme used and whether it was a per-request override.
98
+ */
99
+ export declare class CourseGenerationBriefRecord extends SmrtObject {
100
+ tenantId: string;
101
+ jobId: string;
102
+ courseId: string;
103
+ target: string;
104
+ subject: string;
105
+ category: string;
106
+ area: string;
107
+ /** Whole grade level; `-1` means none was given. */
108
+ grade: number;
109
+ objective: string;
110
+ learningObjectiveId: string;
111
+ learnerId: string;
112
+ themeLabel: string;
113
+ themeKey: string;
114
+ themeSource: string;
115
+ recordedAt: Date;
116
+ constructor(options?: Record<string, unknown>);
117
+ delete(): Promise<void>;
118
+ save(options?: SmrtSaveOptions): Promise<this>;
119
+ }
120
+ export declare class CourseGenerationBriefRecordCollection extends SmrtCollection<CourseGenerationBriefRecord> {
121
+ static readonly _itemClass: typeof CourseGenerationBriefRecord;
122
+ }
94
123
  //# sourceMappingURL=course-generation-models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"course-generation-models.d.ts","sourceRoot":"","sources":["../src/course-generation-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACd,UAAU,EACV,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAC;AAgBlC,qEAAqE;AACrE,qBAMa,mBAAoB,SAAQ,UAAU;IACrC,QAAQ,SAAM;IACgB,QAAQ,SAAM;IACN,cAAc,SAAM;IACtE,UAAU,SAAM;IAChB,aAAa,SAAM;IACM,WAAW,SAAM;IAC1C,2DAA2D;IAClC,SAAS,SAAQ;IAC1C,iBAAiB,SAAM;IACvB,wBAAwB,SAAM;IAC9B,YAAY,SAAM;IAClB,UAAU,OAAc;gBACZ,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;IAIlC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAGvB,IAAI,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAa9D;AACD,qBAAa,6BAA8B,SAAQ,cAAc,CAAC,mBAAmB,CAAC;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AClB,OAAO,SAAM;IACb,QAAQ,SAAM;IACd,IAAI,SAAM;IACV,oDAAoD;IACpD,KAAK,SAAM;IACc,SAAS,SAAM;IACxC,mBAAmB,SAAM;IACzB,SAAS,SAAM;IACf,UAAU,SAAM;IAChB,QAAQ,SAAM;IACd,WAAW,SAAU;IACrB,UAAU,OAAc;gBACZ,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;IAIlC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAGvB,IAAI,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB9D;AACD,qBAAa,qCAAsC,SAAQ,cAAc,CAAC,2BAA2B,CAAC;IACpG,MAAM,CAAC,QAAQ,CAAC,UAAU,qCAA+B;CAC1D"}
@@ -1,11 +1,15 @@
1
1
  import type { CourseDraftInput, CourseRevisionView } from './course-authoring-contracts.js';
2
- import { type CourseGenerationProposal, type CourseProposalFieldStatus } from './course-generation-contracts.js';
2
+ import { type CourseGenerationBrief, type CourseGenerationProposal, type CourseProposalFieldStatus } from './course-generation-contracts.js';
3
+ import type { LessonQuestionRefInput } from './question-contracts.js';
3
4
  /**
4
5
  * Validates untrusted provider output against the closed proposal schema.
5
6
  * `existingLessonKeys` are the lessons of the snapshot the job ran against: a
6
- * proposal may only address a lesson that exists there.
7
+ * proposal may only address a lesson that exists there. With a `lesson` target
8
+ * the proposal must be exactly one new lesson with a body, a worksheet whose
9
+ * questions all carry answer keys, and (when stated) the brief's own objective:
10
+ * a theme may change story and examples, never the objective.
7
11
  */
8
- export declare function validateCourseGenerationOutput(output: unknown, existingLessonKeys: ReadonlySet<string>): CourseGenerationProposal;
12
+ export declare function validateCourseGenerationOutput(output: unknown, existingLessonKeys: ReadonlySet<string>, brief?: Pick<CourseGenerationBrief, 'target' | 'objective'> | null): CourseGenerationProposal;
9
13
  /** Field paths a proposal can decide, and how to read the current value. */
10
14
  export interface ProposalFieldPlan {
11
15
  field: string;
@@ -25,6 +29,8 @@ export declare function draftFromRevision(view: CourseRevisionView): CourseDraft
25
29
  */
26
30
  export declare function applyProposalFields(draft: CourseDraftInput, entries: ReadonlyArray<ProposalFieldPlan>, options: {
27
31
  jobId: string;
32
+ /** Worksheet refs of generated new lessons, by `new-lesson:<n>` index. */
33
+ questionRefs?: ReadonlyMap<number, LessonQuestionRefInput[]>;
28
34
  }): {
29
35
  missing: string[];
30
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"course-generation-output.d.ts","sourceRoot":"","sources":["../src/course-generation-output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,KAAK,wBAAwB,EAE7B,KAAK,yBAAyB,EAC/B,MAAM,kCAAkC,CAAC;AAyC1C;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,OAAO,EACf,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,GACtC,wBAAwB,CAkF1B;AAED,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,yBAAyB,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAmBD,6EAA6E;AAC7E,wBAAgB,YAAY,CAC1B,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,wBAAwB,GACjC,iBAAiB,EAAE,CA+CrB;AAED,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM,WACS,CAAC;AAIzE,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,gBAAgB,CAuC5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACzC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAuEvB"}
1
+ {"version":3,"file":"course-generation-output.d.ts","sourceRoot":"","sources":["../src/course-generation-output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,wBAAwB,EAG7B,KAAK,yBAAyB,EAC/B,MAAM,kCAAkC,CAAC;AAG1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAwEtE;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,OAAO,EACf,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,EACvC,KAAK,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG,IAAI,GACjE,wBAAwB,CAwH1B;AAED,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,yBAAyB,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAmBD,6EAA6E;AAC7E,wBAAgB,YAAY,CAC1B,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,wBAAwB,GACjC,iBAAiB,EAAE,CA+CrB;AAED,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM,WACS,CAAC;AAIzE,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,gBAAgB,CAuC5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACzC,OAAO,EAAE;IACP,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;CAC9D,GACA;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CA0EvB"}
@@ -1,5 +1,5 @@
1
1
  import type { ProposalGenerator } from '@happyvertical/smrt-ingestion/proposals';
2
- import type { CourseMaterialGenerator } from './course-generation-contracts.js';
2
+ import type { CourseGenerationBrief, CourseMaterialGenerator } from './course-generation-contracts.js';
3
3
  export declare const COURSE_PROPOSAL_HANDLER = "@happyvertical/smrt-education:propose-course-material";
4
4
  /** The closed JSON shape a model is asked to produce; validated again on receipt. */
5
5
  export declare const COURSE_PROPOSAL_ARGS_SCHEMA: {
@@ -84,6 +84,176 @@ export declare const COURSE_PROPOSAL_ARGS_SCHEMA: {
84
84
  };
85
85
  };
86
86
  };
87
+ /**
88
+ * The closed shape for a `lesson` target: exactly one new lesson with its
89
+ * themed explanation (`body`), a worksheet whose questions all carry answer
90
+ * keys, and no course-level changes. `objective`, when echoed, must equal the
91
+ * brief's; the service rejects any other value.
92
+ */
93
+ export declare const COURSE_LESSON_PROPOSAL_ARGS_SCHEMA: {
94
+ readonly type: "object";
95
+ readonly additionalProperties: false;
96
+ readonly required: readonly ["lessons"];
97
+ readonly properties: {
98
+ readonly lessons: {
99
+ readonly type: "array";
100
+ readonly minItems: 1;
101
+ readonly maxItems: 1;
102
+ readonly items: {
103
+ readonly type: "object";
104
+ readonly additionalProperties: false;
105
+ readonly required: readonly ["sectionKey", "title", "body", "questions"];
106
+ readonly properties: {
107
+ readonly sectionKey: {
108
+ type: string;
109
+ minLength: number;
110
+ maxLength: number;
111
+ };
112
+ readonly sectionTitle: {
113
+ type: string;
114
+ minLength: number;
115
+ maxLength: number;
116
+ };
117
+ readonly title: {
118
+ type: string;
119
+ minLength: number;
120
+ maxLength: number;
121
+ };
122
+ readonly body: {
123
+ type: string;
124
+ minLength: number;
125
+ maxLength: number;
126
+ };
127
+ readonly estimatedMinutes: {
128
+ readonly type: "integer";
129
+ readonly minimum: 1;
130
+ readonly maximum: 1440;
131
+ };
132
+ readonly difficulty: {
133
+ readonly type: "integer";
134
+ readonly minimum: 1;
135
+ readonly maximum: 10;
136
+ };
137
+ readonly objective: {
138
+ type: string;
139
+ minLength: number;
140
+ maxLength: number;
141
+ };
142
+ readonly questions: {
143
+ readonly type: "array";
144
+ readonly minItems: 1;
145
+ readonly maxItems: 50;
146
+ readonly items: {
147
+ readonly type: "object";
148
+ readonly additionalProperties: false;
149
+ readonly required: readonly ["prompt", "responseType", "answerKey"];
150
+ readonly properties: {
151
+ readonly prompt: {
152
+ type: string;
153
+ minLength: number;
154
+ maxLength: number;
155
+ };
156
+ readonly responseType: {
157
+ readonly type: "string";
158
+ readonly enum: readonly ["short-answer", "numeric", "multiple-choice", "multi-select", "true-false", "extended", "multi-part"];
159
+ };
160
+ readonly choices: {
161
+ readonly type: "array";
162
+ readonly maxItems: 12;
163
+ readonly items: {
164
+ readonly type: "object";
165
+ readonly additionalProperties: false;
166
+ readonly required: readonly ["id", "label"];
167
+ readonly properties: {
168
+ readonly id: {
169
+ type: string;
170
+ minLength: number;
171
+ maxLength: number;
172
+ };
173
+ readonly label: {
174
+ type: string;
175
+ minLength: number;
176
+ maxLength: number;
177
+ };
178
+ };
179
+ };
180
+ };
181
+ readonly subparts: {
182
+ readonly type: "array";
183
+ readonly maxItems: 12;
184
+ readonly items: {
185
+ readonly type: "object";
186
+ };
187
+ };
188
+ readonly answerKey: {
189
+ readonly type: "object";
190
+ readonly properties: {
191
+ readonly correctChoiceIds: {
192
+ type: string;
193
+ maxItems: number;
194
+ items: {
195
+ type: string;
196
+ minLength: number;
197
+ maxLength: number;
198
+ };
199
+ };
200
+ readonly acceptedAnswers: {
201
+ type: string;
202
+ maxItems: number;
203
+ items: {
204
+ type: string;
205
+ minLength: number;
206
+ maxLength: number;
207
+ };
208
+ };
209
+ readonly numeric: {
210
+ readonly type: "object";
211
+ readonly additionalProperties: false;
212
+ readonly required: readonly ["value"];
213
+ readonly properties: {
214
+ readonly value: {
215
+ readonly type: "number";
216
+ };
217
+ readonly tolerance: {
218
+ readonly type: "number";
219
+ };
220
+ };
221
+ };
222
+ readonly parts: {
223
+ readonly type: "object";
224
+ };
225
+ readonly explanation: {
226
+ type: string;
227
+ minLength: number;
228
+ maxLength: number;
229
+ };
230
+ };
231
+ };
232
+ readonly rubric: {
233
+ readonly type: "object";
234
+ };
235
+ readonly pointsPossible: {
236
+ readonly type: "number";
237
+ readonly minimum: 0;
238
+ };
239
+ };
240
+ };
241
+ };
242
+ };
243
+ };
244
+ };
245
+ readonly rationale: {
246
+ type: string;
247
+ minLength: number;
248
+ maxLength: number;
249
+ };
250
+ };
251
+ };
252
+ /**
253
+ * The deterministic brief block appended to the host's instruction. Every value
254
+ * is data from the request; the objective is fixed and the theme is a skin.
255
+ */
256
+ export declare function describeGenerationBrief(brief: CourseGenerationBrief): string;
87
257
  /**
88
258
  * Adapts an ingestion `ProposalGenerator` (the host's trusted SDK-bound
89
259
  * adapter) to the course generation port. The material is offered as one
@@ -1 +1 @@
1
- {"version":3,"file":"course-generation-proposal-generator.d.ts","sourceRoot":"","sources":["../src/course-generation-proposal-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,kCAAkC,CAAC;AAG1C,eAAO,MAAM,uBAAuB,0DACqB,CAAC;AAO1D,qFAAqF;AACrF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC9B,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,iBAAiB,GAC3B,uBAAuB,CAoDzB"}
1
+ {"version":3,"file":"course-generation-proposal-generator.d.ts","sourceRoot":"","sources":["../src/course-generation-proposal-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EACV,qBAAqB,EAErB,uBAAuB,EACxB,MAAM,kCAAkC,CAAC;AAG1C,eAAO,MAAM,uBAAuB,0DACqB,CAAC;AAO1D,qFAAqF;AACrF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC9B,CAAC;AA0DX;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCrC,CAAC;AAEX;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAsB5E;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,iBAAiB,GAC3B,uBAAuB,CA0DzB"}
@@ -1,6 +1,6 @@
1
1
  import type { DatabaseInterface } from '@happyvertical/sql';
2
2
  import { type CourseAuthoringActor, type CourseAuthoringAuthorizer } from './course-authoring-contracts.js';
3
- import { type CourseGenerationLimits, type CourseGenerationView, type CourseMaterialGenerator, type CourseProposalView } from './course-generation-contracts.js';
3
+ import { type CourseGenerationBriefInput, type CourseGenerationLimits, type CourseGenerationView, type CourseMaterialGenerator, type CourseProposalView } from './course-generation-contracts.js';
4
4
  import { type CourseFindingResolutionKind, type CourseReviewContextInput, type CourseReviewFindingInput, type CourseReviewView } from './course-review-contracts.js';
5
5
  import { QuestionAuthoringService, type QuestionAuthoringServiceOptions } from './question-authoring-service.js';
6
6
  type Tx = DatabaseInterface;
@@ -39,7 +39,21 @@ export declare class CourseGenerationReviewService extends QuestionAuthoringServ
39
39
  expectedHeadRevisionId: string;
40
40
  requestKey: string;
41
41
  instruction?: string;
42
+ /**
43
+ * Structured request fields and the target (`course` by default, or one
44
+ * `lesson`). A per-request `theme` wins over the learner's saved theme
45
+ * for this request only and never changes the saved preference.
46
+ */
47
+ brief?: CourseGenerationBriefInput;
42
48
  }): Promise<CourseGenerationView>;
49
+ /**
50
+ * Resolves the theme (override, else the learner's saved one, else none) and
51
+ * checks the learner and objective belong to the tenant. Nothing here writes
52
+ * to the learner: the saved preference is only ever read.
53
+ */
54
+ private resolveBrief;
55
+ /** The stored brief of a job; null for plain requests and un-migrated hosts. */
56
+ private briefFor;
43
57
  /**
44
58
  * Runs a queued job through the injected generator outside any transaction,
45
59
  * then records the outcome. Success writes a new draft revision holding only
@@ -1 +1 @@
1
- {"version":3,"file":"course-generation-review-service.d.ts","sourceRoot":"","sources":["../src/course-generation-review-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,yBAAyB,EAO/B,MAAM,iCAAiC,CAAC;AAOzC,OAAO,EAIL,KAAK,sBAAsB,EAM3B,KAAK,oBAAoB,EAGzB,KAAK,uBAAuB,EAI5B,KAAK,kBAAkB,EAGxB,MAAM,kCAAkC,CAAC;AAc1C,OAAO,EAOL,KAAK,2BAA2B,EAGhC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAI7B,KAAK,gBAAgB,EAEtB,MAAM,8BAA8B,CAAC;AAatC,OAAO,EACL,wBAAwB,EACxB,KAAK,+BAA+B,EACrC,MAAM,iCAAiC,CAAC;AASzC,KAAK,EAAE,GAAG,iBAAiB,CAAC;AAqG5B,MAAM,WAAW,oCACf,SAAQ,+BAA+B;IACvC,8EAA8E;IAC9E,SAAS,CAAC,EAAE,uB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E,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GACrE,OAAO,CAAC,gBAAgB,CAAC;YA+Bd,YAAY;IAiC1B,+EAA+E;cACtD,uBAAuB,CAC9C,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GACjD,OAAO,CAAC,IAAI,CAAC;IAahB;;;OAGG;IACG,iBAAiB,CACrB,OAAO,EAAE,oBAAoB,GAAG;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,UAAU,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC;QAAE,iBAAiB,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAwD3C;;;;OAIG;IACG,cAAc,CAClB,OAAO,EAAE,oBAAoB,GAAG;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,2BAA2B,CAAC;QACxC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC,gBAAgB,CAAC;CA8E7B"}
1
+ {"version":3,"file":"course-generation-review-service.d.ts","sourceRoot":"","sources":["../src/course-generation-review-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,yBAAyB,EAO/B,MAAM,iCAAiC,CAAC;AAOzC,OAAO,EAKL,KAAK,0BAA0B,EAG/B,KAAK,sBAAsB,EAM3B,KAAK,oBAAoB,EAGzB,KAAK,uBAAuB,EAI5B,KAAK,kBAAkB,EAMxB,MAAM,kCAAkC,CAAC;AAe1C,OAAO,EAOL,KAAK,2BAA2B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@@ -0,0 +1,138 @@
1
+ /**
2
+ * Document conversion for Office course-bundle members (SMRT #4615).
3
+ *
4
+ * Untrusted Word and PowerPoint files never run next to the application: the
5
+ * app only talks to a `DocumentConverter`, which renders a member to PDF in an
6
+ * isolated service. The importer enforces the byte and time limits itself, so
7
+ * a misbehaving adapter cannot exceed them.
8
+ */
9
+ /** Office kinds the importer can render. */
10
+ export type OfficeDocumentKind = 'docx' | 'pptx';
11
+ export declare const OFFICE_MEDIA_TYPES: Readonly<Record<OfficeDocumentKind, string>>;
12
+ export declare const DEFAULT_DOCUMENT_CONVERSION_TIMEOUT_MS = 60000;
13
+ export declare const DEFAULT_DOCUMENT_CONVERSION_MAX_BYTES: number;
14
+ export interface DocumentConversionLimits {
15
+ /** Largest input handed to the converter, in bytes. */
16
+ maxInputBytes: number;
17
+ /** Largest rendered PDF accepted back, in bytes. */
18
+ maxOutputBytes: number;
19
+ /** Wall-clock budget for one conversion, in milliseconds. */
20
+ timeoutMs: number;
21
+ }
22
+ export interface DocumentConversionRequest {
23
+ bytes: Uint8Array;
24
+ kind: OfficeDocumentKind;
25
+ /** A neutral file name (extension only matters); never the bundle path. */
26
+ fileName: string;
27
+ limits: DocumentConversionLimits;
28
+ /** Aborted when the time budget is spent; adapters must honour it. */
29
+ signal: AbortSignal;
30
+ }
31
+ export interface DocumentConversionResult {
32
+ /** The rendered document as a PDF. */
33
+ pdf: Uint8Array;
34
+ }
35
+ /** Render an Office document to PDF. Implementations must not retain the bytes. */
36
+ export interface DocumentConverter {
37
+ /** Stable identifier recorded as provenance (for example `gotenberg`). */
38
+ readonly id: string;
39
+ convertToPdf(request: DocumentConversionRequest): Promise<DocumentConversionResult>;
40
+ }
41
+ export type DocumentConversionFailure =
42
+ /** The service could not be reached or answered with a server error. */
43
+ 'unavailable' | 'timeout' | 'too_large'
44
+ /** The service refused or could not render this file. */
45
+ | 'rejected'
46
+ /** The answer was not a usable PDF. */
47
+ | 'invalid_output';
48
+ export declare class DocumentConversionError extends Error {
49
+ readonly code: DocumentConversionFailure;
50
+ constructor(code: DocumentConversionFailure, message?: string);
51
+ }
52
+ /** Text of an Office document as read by an SDK processor (never learner-visible by default). */
53
+ export interface OfficeText {
54
+ /** Whole-document text. */
55
+ text: string;
56
+ /** PPTX only: slide text and speaker notes per slide, in order. */
57
+ slides?: Array<{
58
+ index: number;
59
+ text: string;
60
+ notes?: string;
61
+ }>;
62
+ }
63
+ /**
64
+ * Injectable text reader for Office members. Return `null` when the engine is
65
+ * unavailable. Wire the SDK processor once `@happyvertical/documents` with
66
+ * `extractOffice` is released:
67
+ *
68
+ * ```ts
69
+ * import { extractOffice } from '@happyvertical/documents';
70
+ * const officeTextReader: OfficeTextReader = {
71
+ * async read({ bytes, kind }) {
72
+ * const r = await extractOffice(bytes, kind, { extractImages: false });
73
+ * if (r.status !== 'ok') return null;
74
+ * const slides = kind === 'pptx'
75
+ * ? r.parts.map((p, i) => ({ index: Number(p.metadata?.slide ?? i + 1), text: p.content, notes: p.notes }))
76
+ * : undefined;
77
+ * const text = r.parts.flatMap(function flat(p): string[] { return [p.content, ...(p.parts ?? []).flatMap(flat)]; }).filter(Boolean).join('\n\n');
78
+ * return { text, slides };
79
+ * },
80
+ * };
81
+ * ```
82
+ */
83
+ export interface OfficeTextReader {
84
+ read(input: {
85
+ bytes: Uint8Array;
86
+ kind: OfficeDocumentKind;
87
+ }): Promise<OfficeText | null>;
88
+ }
89
+ export interface GotenbergConverterOptions {
90
+ /** Base URL of the Gotenberg service, for example `http://gotenberg:3000`. */
91
+ baseUrl: string;
92
+ /** Per-request timeout; the importer's own budget still applies. */
93
+ timeoutMs?: number;
94
+ /** Largest input sent and largest response read, in bytes. */
95
+ maxBytes?: number;
96
+ /** Injected for tests; defaults to the global `fetch`. */
97
+ fetch?: typeof fetch;
98
+ }
99
+ /** True when the bytes start like a PDF (header within the first KiB). */
100
+ export declare function looksLikePdf(bytes: Uint8Array): boolean;
101
+ /**
102
+ * Gotenberg (LibreOffice in a container) over HTTP. The only network it ever
103
+ * touches is `baseUrl`; redirects are refused, credentials in the URL are
104
+ * rejected and the response body is read with a hard size cap. Deploy the
105
+ * service with no outbound network of its own.
106
+ */
107
+ export declare class GotenbergDocumentConverter implements DocumentConverter {
108
+ readonly id = "gotenberg";
109
+ private readonly endpoint;
110
+ private readonly timeoutMs;
111
+ private readonly maxBytes;
112
+ private readonly fetchImpl;
113
+ constructor(options: GotenbergConverterOptions);
114
+ convertToPdf(request: DocumentConversionRequest): Promise<DocumentConversionResult>;
115
+ }
116
+ export interface FakeDocumentConverterOptions {
117
+ /** Throw this failure for every call. */
118
+ failWith?: DocumentConversionFailure;
119
+ /** Fail only when this predicate matches the input bytes. */
120
+ failWhen?: (request: DocumentConversionRequest) => boolean;
121
+ /** Wait this long (honouring the abort signal) before answering. */
122
+ delayMs?: number;
123
+ /** Bytes to return instead of the built-in one-page PDF. */
124
+ output?: Uint8Array;
125
+ }
126
+ /** Deterministic in-memory converter for tests. Records every call. */
127
+ export declare class FakeDocumentConverter implements DocumentConverter {
128
+ private readonly options;
129
+ readonly id = "fake";
130
+ readonly calls: Array<{
131
+ kind: OfficeDocumentKind;
132
+ fileName: string;
133
+ byteLength: number;
134
+ }>;
135
+ constructor(options?: FakeDocumentConverterOptions);
136
+ convertToPdf(request: DocumentConversionRequest): Promise<DocumentConversionResult>;
137
+ }
138
+ //# sourceMappingURL=document-converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-converter.d.ts","sourceRoot":"","sources":["../src/document-converter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,4CAA4C;AAC5C,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjD,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAIxE,CAAC;AAEL,eAAO,MAAM,sCAAsC,QAAS,CAAC;AAC7D,eAAO,MAAM,qCAAqC,QAAmB,CAAC;AAEtE,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