@happyvertical/smrt-education 0.57.46 → 0.57.48

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 (41) hide show
  1. package/AGENTS.md +5 -0
  2. package/README.md +7 -1
  3. package/agents/learner-service.md +31 -2
  4. package/agents/question-extraction.md +108 -0
  5. package/agents/submission-service.md +15 -0
  6. package/dist/chunks/{workbook-photo-service-DKgoUHeb.js → workbook-photo-service-B7Tujv__.js} +6494 -1153
  7. package/dist/chunks/workbook-photo-service-B7Tujv__.js.map +1 -0
  8. package/dist/collections.d.ts +4 -1
  9. package/dist/collections.d.ts.map +1 -1
  10. package/dist/course-authoring-contracts.d.ts +1 -1
  11. package/dist/course-authoring-contracts.d.ts.map +1 -1
  12. package/dist/index.d.ts +11 -5
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +1049 -4628
  15. package/dist/index.js.map +1 -1
  16. package/dist/ingestion.d.ts +2 -0
  17. package/dist/ingestion.d.ts.map +1 -1
  18. package/dist/ingestion.js +197 -2
  19. package/dist/ingestion.js.map +1 -1
  20. package/dist/learner-history.d.ts +50 -0
  21. package/dist/learner-history.d.ts.map +1 -0
  22. package/dist/learner-service.d.ts +78 -2
  23. package/dist/learner-service.d.ts.map +1 -1
  24. package/dist/manifest.json +4255 -1444
  25. package/dist/question-extraction-contracts.d.ts +231 -0
  26. package/dist/question-extraction-contracts.d.ts.map +1 -0
  27. package/dist/question-extraction-ingestion.d.ts +44 -0
  28. package/dist/question-extraction-ingestion.d.ts.map +1 -0
  29. package/dist/question-extraction-models.d.ts +56 -0
  30. package/dist/question-extraction-models.d.ts.map +1 -0
  31. package/dist/question-extraction-service.d.ts +71 -0
  32. package/dist/question-extraction-service.d.ts.map +1 -0
  33. package/dist/question-extraction.d.ts +317 -0
  34. package/dist/question-extraction.d.ts.map +1 -0
  35. package/dist/smrt-knowledge.json +961 -143
  36. package/dist/submission-service.d.ts +34 -1
  37. package/dist/submission-service.d.ts.map +1 -1
  38. package/dist/submissions.d.ts +25 -1
  39. package/dist/submissions.d.ts.map +1 -1
  40. package/package.json +10 -10
  41. package/dist/chunks/workbook-photo-service-DKgoUHeb.js.map +0 -1
@@ -0,0 +1,317 @@
1
+ import { type QuestionContentInput, type WorksheetBundle } from './question-contracts.js';
2
+ import { type ExtractedAnchor, type ExtractedAnchorInput, type ExtractedOrigin, type ExtractedQuestion, type QuestionExtraction, type QuestionExtractionGrounding, type QuestionExtractionMatch, type QuestionExtractionSourceKind } from './question-extraction-contracts.js';
3
+ /**
4
+ * Closed argument schema of the `extract-questions` handler: what a proposal
5
+ * generator may fill. Every object is closed; every optional fact is explicit null.
6
+ */
7
+ export declare const QUESTION_EXTRACTION_ARGS_SCHEMA: {
8
+ readonly type: "object";
9
+ readonly additionalProperties: false;
10
+ readonly required: readonly ["version", "sourceKind", "worksheetVersionId", "pages", "sections", "questions", "studentWork", "omissions"];
11
+ readonly properties: {
12
+ readonly version: {
13
+ readonly type: "integer";
14
+ readonly enum: readonly [1];
15
+ };
16
+ readonly sourceKind: {
17
+ readonly type: "string";
18
+ readonly enum: readonly QuestionExtractionSourceKind[];
19
+ };
20
+ readonly worksheetVersionId: {
21
+ anyOf: Record<string, unknown>[];
22
+ };
23
+ readonly pages: {
24
+ readonly type: "array";
25
+ readonly minItems: 1;
26
+ readonly maxItems: 1000;
27
+ readonly items: {
28
+ readonly type: "object";
29
+ readonly additionalProperties: false;
30
+ readonly required: readonly ["evidenceId", "page", "role", "readability"];
31
+ readonly properties: {
32
+ readonly evidenceId: {
33
+ type: string;
34
+ minLength: number;
35
+ maxLength: number;
36
+ };
37
+ readonly page: {
38
+ anyOf: Record<string, unknown>[];
39
+ };
40
+ readonly role: {
41
+ readonly type: "string";
42
+ readonly enum: readonly import("./question-extraction-contracts.js").ExtractedPageRole[];
43
+ };
44
+ readonly readability: {
45
+ readonly type: "string";
46
+ readonly enum: readonly import("./question-extraction-contracts.js").ExtractedReadability[];
47
+ };
48
+ };
49
+ };
50
+ };
51
+ readonly sections: {
52
+ readonly type: "array";
53
+ readonly maxItems: 64;
54
+ readonly items: {
55
+ readonly type: "object";
56
+ readonly additionalProperties: false;
57
+ readonly required: readonly ["id", "label", "evidenceId", "page"];
58
+ readonly properties: {
59
+ readonly id: {
60
+ type: string;
61
+ pattern: string;
62
+ };
63
+ readonly label: {
64
+ anyOf: Record<string, unknown>[];
65
+ };
66
+ readonly evidenceId: {
67
+ type: string;
68
+ minLength: number;
69
+ maxLength: number;
70
+ };
71
+ readonly page: {
72
+ anyOf: Record<string, unknown>[];
73
+ };
74
+ };
75
+ };
76
+ };
77
+ readonly questions: {
78
+ readonly type: "array";
79
+ readonly maxItems: 200;
80
+ readonly items: {
81
+ readonly type: "object";
82
+ readonly additionalProperties: false;
83
+ readonly required: readonly ["key", "numbering", "role", "sectionId", "status", "prompt", "responseType", "responseTypeOrigin", "choices", "subparts", "media", "answerKey", "rubric", "pointsPossible", "pointsOrigin", "anchors"];
84
+ readonly properties: {
85
+ readonly key: {
86
+ type: string;
87
+ pattern: string;
88
+ };
89
+ readonly numbering: {
90
+ anyOf: Record<string, unknown>[];
91
+ };
92
+ readonly role: {
93
+ readonly type: "string";
94
+ readonly enum: readonly ["exercise", "example"];
95
+ };
96
+ readonly sectionId: {
97
+ anyOf: Record<string, unknown>[];
98
+ };
99
+ readonly status: {
100
+ readonly type: "string";
101
+ readonly enum: readonly import("./question-extraction-contracts.js").ExtractedQuestionStatus[];
102
+ };
103
+ readonly prompt: {
104
+ anyOf: Record<string, unknown>[];
105
+ };
106
+ readonly responseType: {
107
+ anyOf: Record<string, unknown>[];
108
+ };
109
+ readonly responseTypeOrigin: {
110
+ type: string;
111
+ enum: ExtractedOrigin[];
112
+ };
113
+ readonly choices: {
114
+ readonly type: "array";
115
+ readonly maxItems: 50;
116
+ readonly items: {
117
+ readonly type: "object";
118
+ readonly additionalProperties: false;
119
+ readonly required: readonly ["id", "label"];
120
+ readonly properties: {
121
+ readonly id: {
122
+ type: string;
123
+ pattern: string;
124
+ };
125
+ readonly label: {
126
+ type: string;
127
+ minLength: number;
128
+ maxLength: number;
129
+ };
130
+ };
131
+ };
132
+ };
133
+ readonly subparts: {
134
+ readonly type: "array";
135
+ readonly maxItems: 50;
136
+ readonly items: {
137
+ readonly type: "object";
138
+ readonly additionalProperties: false;
139
+ readonly required: readonly ["partKey", "prompt"];
140
+ readonly properties: {
141
+ readonly partKey: {
142
+ type: string;
143
+ pattern: string;
144
+ };
145
+ readonly prompt: {
146
+ type: string;
147
+ minLength: number;
148
+ maxLength: number;
149
+ };
150
+ };
151
+ };
152
+ };
153
+ readonly media: {
154
+ readonly type: "array";
155
+ readonly maxItems: 20;
156
+ readonly items: {
157
+ readonly type: "object";
158
+ readonly additionalProperties: false;
159
+ readonly required: readonly ["kind", "description", "anchor"];
160
+ readonly properties: {
161
+ readonly kind: {
162
+ readonly type: "string";
163
+ readonly enum: readonly import("./question-extraction-contracts.js").ExtractedMediaKind[];
164
+ };
165
+ readonly description: {
166
+ type: string;
167
+ minLength: number;
168
+ maxLength: number;
169
+ };
170
+ readonly anchor: {
171
+ anyOf: Record<string, unknown>[];
172
+ };
173
+ };
174
+ };
175
+ };
176
+ readonly answerKey: {
177
+ anyOf: Record<string, unknown>[];
178
+ };
179
+ readonly rubric: {
180
+ anyOf: Record<string, unknown>[];
181
+ };
182
+ readonly pointsPossible: {
183
+ anyOf: Record<string, unknown>[];
184
+ };
185
+ readonly pointsOrigin: {
186
+ anyOf: Record<string, unknown>[];
187
+ };
188
+ readonly anchors: {
189
+ type: string;
190
+ maxItems: number;
191
+ items: {
192
+ type: string;
193
+ additionalProperties: boolean;
194
+ required: string[];
195
+ properties: {
196
+ evidenceId: {
197
+ type: string;
198
+ minLength: number;
199
+ maxLength: number;
200
+ };
201
+ page: {
202
+ anyOf: Record<string, unknown>[];
203
+ };
204
+ regionId: {
205
+ anyOf: Record<string, unknown>[];
206
+ };
207
+ };
208
+ };
209
+ };
210
+ };
211
+ };
212
+ };
213
+ readonly studentWork: {
214
+ readonly type: "array";
215
+ readonly maxItems: 400;
216
+ readonly items: {
217
+ readonly type: "object";
218
+ readonly additionalProperties: false;
219
+ readonly required: readonly ["questionKey", "observed", "legibility", "anchors"];
220
+ readonly properties: {
221
+ readonly questionKey: {
222
+ anyOf: Record<string, unknown>[];
223
+ };
224
+ readonly observed: {
225
+ anyOf: Record<string, unknown>[];
226
+ };
227
+ readonly legibility: {
228
+ readonly type: "string";
229
+ readonly enum: readonly import("./question-extraction-contracts.js").ExtractedLegibility[];
230
+ };
231
+ readonly anchors: {
232
+ type: string;
233
+ maxItems: number;
234
+ items: {
235
+ type: string;
236
+ additionalProperties: boolean;
237
+ required: string[];
238
+ properties: {
239
+ evidenceId: {
240
+ type: string;
241
+ minLength: number;
242
+ maxLength: number;
243
+ };
244
+ page: {
245
+ anyOf: Record<string, unknown>[];
246
+ };
247
+ regionId: {
248
+ anyOf: Record<string, unknown>[];
249
+ };
250
+ };
251
+ };
252
+ };
253
+ };
254
+ };
255
+ };
256
+ readonly omissions: {
257
+ readonly type: "array";
258
+ readonly maxItems: 200;
259
+ readonly items: {
260
+ readonly type: "object";
261
+ readonly additionalProperties: false;
262
+ readonly required: readonly ["evidenceId", "page", "reason", "description"];
263
+ readonly properties: {
264
+ readonly evidenceId: {
265
+ type: string;
266
+ minLength: number;
267
+ maxLength: number;
268
+ };
269
+ readonly page: {
270
+ anyOf: Record<string, unknown>[];
271
+ };
272
+ readonly reason: {
273
+ readonly type: "string";
274
+ readonly enum: readonly import("./question-extraction-contracts.js").ExtractedOmissionReason[];
275
+ };
276
+ readonly description: {
277
+ type: string;
278
+ minLength: number;
279
+ maxLength: number;
280
+ };
281
+ };
282
+ };
283
+ };
284
+ };
285
+ };
286
+ /**
287
+ * Validate extractor output against the closed contract and the intake's
288
+ * retained evidence. Every source page must be accounted for (an entry in
289
+ * `pages`), so unreadable or unsupported content is marked, never dropped.
290
+ * Throws `QuestionExtractionValidationError`; never repairs or guesses.
291
+ */
292
+ export declare function normalizeQuestionExtraction(value: unknown, grounding: QuestionExtractionGrounding): QuestionExtraction;
293
+ /**
294
+ * Idempotency identity of an extraction source: the source kind plus the
295
+ * sorted retained evidence hashes. Re-ingesting the same bytes yields the same
296
+ * identity; a fresh scan (new bytes) is a new source. Never derived from text.
297
+ */
298
+ export declare function questionExtractionSourceIdentity(sourceKind: QuestionExtractionSourceKind, grounding: QuestionExtractionGrounding): string;
299
+ /**
300
+ * Link extracted questions to known worksheet revisions on evidence only: a
301
+ * worksheet identity (printed on the page, or supplied by the host) plus the
302
+ * printed position, checked against section, response type, choice and part
303
+ * counts. Prompt text is never used. Conflicts and duplicate claims are
304
+ * `ambiguous` and stay unattached.
305
+ */
306
+ export declare function matchExtractedQuestions(extraction: QuestionExtraction, worksheets: readonly WorksheetBundle[], options?: {
307
+ expectedWorksheetVersionId?: string;
308
+ }): QuestionExtractionMatch;
309
+ /**
310
+ * Question content for a readable printed exercise, or null when the item must
311
+ * not become a record (an example, or unreadable/unsupported). Printed facts are
312
+ * `extracted`; extractor guesses are `inferred`. Student work never enters here.
313
+ */
314
+ export declare function extractedQuestionContent(question: ExtractedQuestion): QuestionContentInput | null;
315
+ /** Re-exported for hosts building their own anchor display. */
316
+ export type { ExtractedAnchor, ExtractedAnchorInput };
317
+ //# sourceMappingURL=question-extraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question-extraction.d.ts","sourceRoot":"","sources":["../src/question-extraction.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,oBAAoB,EAIzB,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAQL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAUtB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EAGlC,MAAM,oCAAoC,CAAC;AAmC5C;;;GAGG;AACH,e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