@intellectif/lk-core 0.16.0 → 0.18.0

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 (48) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +2 -2
  3. package/dist/{activity-DcxtpX7Z.d.cts → activity-HH8dxN1v.d.cts} +234 -4
  4. package/dist/{activity-DcxtpX7Z.d.ts → activity-HH8dxN1v.d.ts} +234 -4
  5. package/dist/{chunk-FJJ2GVBA.cjs → chunk-2CV6NU32.cjs} +19 -19
  6. package/dist/{chunk-FJJ2GVBA.cjs.map → chunk-2CV6NU32.cjs.map} +1 -1
  7. package/dist/{chunk-6P6XK2LI.cjs → chunk-COBK2RUX.cjs} +74 -39
  8. package/dist/chunk-COBK2RUX.cjs.map +1 -0
  9. package/dist/{chunk-IRUD73IQ.js → chunk-D3GP5MET.js} +683 -638
  10. package/dist/chunk-D3GP5MET.js.map +1 -0
  11. package/dist/{chunk-F7UOLKWV.cjs → chunk-D4TOPSHV.cjs} +518 -473
  12. package/dist/chunk-D4TOPSHV.cjs.map +1 -0
  13. package/dist/{chunk-VFTVZJO5.cjs → chunk-EOFWSGLU.cjs} +4 -4
  14. package/dist/{chunk-VFTVZJO5.cjs.map → chunk-EOFWSGLU.cjs.map} +1 -1
  15. package/dist/{chunk-S63IOKFP.js → chunk-MMEQKFFQ.js} +44 -9
  16. package/dist/chunk-MMEQKFFQ.js.map +1 -0
  17. package/dist/{chunk-OXF7VT7S.js → chunk-X5DAXBJI.js} +2 -2
  18. package/dist/{chunk-GOZGBVJP.js → chunk-Z7QQZ53L.js} +2 -2
  19. package/dist/{chunk-GOZGBVJP.js.map → chunk-Z7QQZ53L.js.map} +1 -1
  20. package/dist/{index-DRJqwO2y.d.ts → index-BrBBUb1i.d.ts} +141 -83
  21. package/dist/{index-BWpwZRQw.d.cts → index-DejnxQpK.d.cts} +141 -83
  22. package/dist/index.cjs +547 -127
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +145 -9
  25. package/dist/index.d.ts +145 -9
  26. package/dist/index.js +427 -7
  27. package/dist/index.js.map +1 -1
  28. package/dist/schemas.cjs +5 -3
  29. package/dist/schemas.cjs.map +1 -1
  30. package/dist/schemas.d.cts +2 -2
  31. package/dist/schemas.d.ts +2 -2
  32. package/dist/schemas.js +4 -2
  33. package/dist/scoring.cjs +3 -3
  34. package/dist/scoring.d.cts +33 -5
  35. package/dist/scoring.d.ts +33 -5
  36. package/dist/scoring.js +2 -2
  37. package/dist/xapi.cjs +3 -3
  38. package/dist/xapi.d.cts +1 -1
  39. package/dist/xapi.d.ts +1 -1
  40. package/dist/xapi.js +2 -2
  41. package/package.json +1 -1
  42. package/vectors/README.md +9 -3
  43. package/vectors/scoring.json +1258 -10
  44. package/dist/chunk-6P6XK2LI.cjs.map +0 -1
  45. package/dist/chunk-F7UOLKWV.cjs.map +0 -1
  46. package/dist/chunk-IRUD73IQ.js.map +0 -1
  47. package/dist/chunk-S63IOKFP.js.map +0 -1
  48. /package/dist/{chunk-OXF7VT7S.js.map → chunk-X5DAXBJI.js.map} +0 -0
@@ -63,6 +63,197 @@ declare function levenshteinDistance(a: string, b: string, max: number): number;
63
63
  */
64
64
  declare function matchText(input: string, accepted: string | readonly string[], policy?: TextMatchPolicy): TextMatchResult;
65
65
 
66
+ /**
67
+ * The contract between an activity and a model the HOST runs, for help a
68
+ * learner reads: an explanation of a graded answer, and hints before one.
69
+ *
70
+ * The SDK never calls a model and holds no key, prompt or provider. It builds
71
+ * the facts a model is given — from the item, the learner's answer and the
72
+ * SDK's own scorer — and checks what comes back. The model explains a verdict
73
+ * the SDK reached; it never reaches one.
74
+ */
75
+ /**
76
+ * What an author allows AI to do for one item. Absent, or a feature left out,
77
+ * leaves the choice to the deployment. `false` switches a feature off for this
78
+ * item wherever it is delivered; an author can only switch a feature off,
79
+ * never force one on.
80
+ *
81
+ * Switch hints off where any hint would give the answer away — a
82
+ * one-word vocabulary item, say.
83
+ */
84
+ interface ActivityAiPermissions {
85
+ /** An explanation of the learner's graded answer. */
86
+ explanations?: boolean;
87
+ /** Hints before the learner submits. */
88
+ hints?: boolean;
89
+ }
90
+ /**
91
+ * An activity as a renderer holds it: full data or a `redact()` projection.
92
+ * Structural rather than the data union, so a renderer's own view of an item —
93
+ * whose answer-key fields may be absent — is accepted as it is. The AI
94
+ * functions read every field defensively.
95
+ */
96
+ interface AiActivityInput {
97
+ readonly type: string;
98
+ readonly id: string;
99
+ readonly title: string;
100
+ readonly locale?: unknown;
101
+ readonly redacted?: unknown;
102
+ readonly ai?: unknown;
103
+ }
104
+ /** The two kinds of help a learner can be given. */
105
+ type AiFeature = 'explanation' | 'hint';
106
+ /** The activity types the SDK builds facts for. */
107
+ type AiSupportedActivityType = 'multiple-choice' | 'fill-in-the-blanks' | 'gap-select' | 'dictation';
108
+ /**
109
+ * A whole answer's grade, from the SDK's scorer. `category` is the verdict an
110
+ * explanation must agree with: all marks, some, or none.
111
+ */
112
+ interface AiGrade {
113
+ score: number;
114
+ maxScore: number;
115
+ passed: boolean;
116
+ category: AiVerdict;
117
+ }
118
+ /** The three verdicts an explanation can speak to. */
119
+ type AiVerdict = 'correct' | 'partly-correct' | 'incorrect';
120
+ interface AiFactsBase {
121
+ activityId: string;
122
+ title: string;
123
+ /** The language the item is written in, when the author gave one. */
124
+ locale?: string;
125
+ }
126
+ /** One option of a multiple-choice question, and what the learner did with it. */
127
+ interface AiOptionFact {
128
+ id: string;
129
+ text: string;
130
+ chosen: boolean;
131
+ /** Whether this option is part of the answer; `null` when the key is not available. */
132
+ correct: boolean | null;
133
+ /** The author's feedback on this option. */
134
+ feedback?: string;
135
+ }
136
+ interface AiMultipleChoiceFacts extends AiFactsBase {
137
+ activityType: 'multiple-choice';
138
+ question: string;
139
+ mode: 'single' | 'multi';
140
+ options: AiOptionFact[];
141
+ }
142
+ /** One blank, in the order it appears in the passage. */
143
+ interface AiBlankFact {
144
+ id: string;
145
+ /** 1-based, in passage order. */
146
+ position: number;
147
+ /** What the learner typed, or `''`. */
148
+ typed: string;
149
+ /** The answers that count; `null` when the key is not available. */
150
+ accepted: string[] | null;
151
+ /** The SDK's verdict on this blank; `null` before it is graded or without a key. */
152
+ correct: boolean | null;
153
+ /** The author's hint for this blank. */
154
+ hint?: string;
155
+ /** The author's feedback for this blank. */
156
+ feedback?: string;
157
+ }
158
+ interface AiFillInTheBlanksFacts extends AiFactsBase {
159
+ activityType: 'fill-in-the-blanks';
160
+ /** The passage, each blank written as `[1]`, `[2]`… in passage order. */
161
+ passage: string;
162
+ blanks: AiBlankFact[];
163
+ }
164
+ /** One gap, in the order it appears in the passage. */
165
+ interface AiGapFact {
166
+ id: string;
167
+ /** 1-based, in passage order. */
168
+ position: number;
169
+ /** The words offered at this gap. */
170
+ choices: string[];
171
+ /** The word the learner chose, or `null`. */
172
+ chosen: string | null;
173
+ /** The right word; `null` when the key is not available. */
174
+ answer: string | null;
175
+ /** The SDK's verdict on this gap; `null` before it is graded or without a key. */
176
+ correct: boolean | null;
177
+ /** The author's feedback for this gap. */
178
+ feedback?: string;
179
+ }
180
+ interface AiGapSelectFacts extends AiFactsBase {
181
+ activityType: 'gap-select';
182
+ /** The passage, each gap written as `[1]`, `[2]`… in passage order. */
183
+ passage: string;
184
+ gaps: AiGapFact[];
185
+ }
186
+ /** One word of a dictation, as the SDK's alignment paired it. */
187
+ interface AiWordFact {
188
+ /** The word the recording says; `''` for an extra word the learner added. */
189
+ expected: string;
190
+ /** The word the learner typed; `''` for a word they left out. */
191
+ typed: string;
192
+ status: 'correct' | 'incorrect' | 'missing' | 'extra';
193
+ }
194
+ interface AiDictationFacts extends AiFactsBase {
195
+ activityType: 'dictation';
196
+ /** What the recording says; `null` when the key is not available. */
197
+ transcript: string | null;
198
+ /** What the learner typed. */
199
+ typed: string;
200
+ /** The alignment word by word; `null` when the key is not available. */
201
+ words: AiWordFact[] | null;
202
+ }
203
+ /**
204
+ * What a model is told about one item and one answer: the question as the
205
+ * learner saw it, what they answered, and — part by part — the SDK's verdict.
206
+ */
207
+ type AiItemFacts = AiMultipleChoiceFacts | AiFillInTheBlanksFacts | AiGapSelectFacts | AiDictationFacts;
208
+ /**
209
+ * Asks for an explanation of a graded answer. Sent after the SDK has graded
210
+ * it, so `grade` is always present, and an explanation that contradicts
211
+ * `grade.category` is refused.
212
+ */
213
+ interface AiExplanationRequest {
214
+ feature: 'explanation';
215
+ facts: AiItemFacts;
216
+ grade: AiGrade;
217
+ /** The language to answer in: the learner's interface language, when known. */
218
+ learnerLocale?: string;
219
+ }
220
+ /**
221
+ * Asks for the next hint before the learner submits. `facts` carries the key
222
+ * so a model can hint toward the answer; the SDK refuses any hint that
223
+ * contains it.
224
+ */
225
+ interface AiHintRequest {
226
+ feature: 'hint';
227
+ facts: AiItemFacts;
228
+ /** 1-based: the hint being asked for. */
229
+ hintNumber: number;
230
+ /** The hints already shown for this item, oldest first. */
231
+ previousHints: string[];
232
+ learnerLocale?: string;
233
+ }
234
+ /** What produced an AI text, for the record a host keeps. */
235
+ interface AiProvenance {
236
+ /** The model's identifier, e.g. a name and version. */
237
+ model?: string;
238
+ /** A hash or id of the prompt revision. */
239
+ promptHash?: string;
240
+ /** ISO 8601. */
241
+ generatedAt?: string;
242
+ }
243
+ /**
244
+ * What a host's port returns. Plain text: the SDK renders it as text, never
245
+ * as HTML. An explanation may state the verdict it assumed; one that
246
+ * disagrees with the SDK's is refused.
247
+ */
248
+ interface AiTextResult {
249
+ text: string;
250
+ /** For an explanation: the verdict the model explained. */
251
+ verdict?: AiVerdict;
252
+ provenance?: AiProvenance;
253
+ }
254
+ /** Why a result was not shown. */
255
+ type AiRefusal = 'malformed' | 'empty' | 'too-long' | 'contradicts-grade' | 'reveals-answer';
256
+
66
257
  /**
67
258
  * The return trip for deferred grading.
68
259
  *
@@ -139,7 +330,11 @@ interface CriterionScore {
139
330
  band?: string;
140
331
  /** The grader's comment for this criterion, addressed to the learner. */
141
332
  comment?: string;
142
- /** Weight actually applied, echoed from the rubric so the total is checkable. */
333
+ /**
334
+ * Weight actually applied, echoed from the rubric so the total is checkable.
335
+ * Defaults to `1`. Zero or more: `gradeFromRubric` refuses a negative weight
336
+ * rather than let it carry the total outside [0,1].
337
+ */
143
338
  weight?: number;
144
339
  /** Not applicable to this submission (e.g. interaction on a monologue task). */
145
340
  notApplicable?: boolean;
@@ -165,6 +360,10 @@ interface InlineCorrection {
165
360
  * that works in points does not have to normalise by hand: declare
166
361
  * `maxScore` on each {@link CriterionScore} and let `gradeFromRubric` do the
167
362
  * arithmetic, which is the whole point of handing it the judgements.
363
+ *
364
+ * `maxScore` is a positive, finite number and `score` a finite number from 0
365
+ * to it. `outcomeFromGrade` refuses a record that is not, rather than mirror
366
+ * numbers nobody can defend onto an outcome.
168
367
  */
169
368
  interface GradeRecord {
170
369
  score: number;
@@ -590,6 +789,8 @@ interface MultipleChoiceData {
590
789
  learningObjectives?: string[];
591
790
  /** Subjective difficulty on a 1–5 scale. */
592
791
  difficultyLevel?: 1 | 2 | 3 | 4 | 5;
792
+ /** What an author allows AI to do for this item: see {@link ActivityAiPermissions}. */
793
+ ai?: ActivityAiPermissions;
593
794
  }
594
795
  /** Configuration for a single fill-in-the-blank slot. */
595
796
  interface BlankConfig {
@@ -724,6 +925,8 @@ interface GapSelectData {
724
925
  learningObjectives?: string[];
725
926
  /** Subjective difficulty on a 1–5 scale. */
726
927
  difficultyLevel?: 1 | 2 | 3 | 4 | 5;
928
+ /** What an author allows AI to do for this item: see {@link ActivityAiPermissions}. */
929
+ ai?: ActivityAiPermissions;
727
930
  }
728
931
  interface FillInTheBlanksData {
729
932
  schemaVersion: '1.0';
@@ -756,6 +959,8 @@ interface FillInTheBlanksData {
756
959
  learningObjectives?: string[];
757
960
  /** Subjective difficulty on a 1–5 scale. */
758
961
  difficultyLevel?: 1 | 2 | 3 | 4 | 5;
962
+ /** What an author allows AI to do for this item: see {@link ActivityAiPermissions}. */
963
+ ai?: ActivityAiPermissions;
759
964
  }
760
965
  /** A single criterion within a written-response grading rubric. */
761
966
  interface WrittenResponseRubricCriterion {
@@ -818,6 +1023,8 @@ interface WrittenResponseData {
818
1023
  learningObjectives?: string[];
819
1024
  /** Subjective difficulty on a 1–5 scale. */
820
1025
  difficultyLevel?: 1 | 2 | 3 | 4 | 5;
1026
+ /** What an author allows AI to do for this item: see {@link ActivityAiPermissions}. */
1027
+ ai?: ActivityAiPermissions;
821
1028
  }
822
1029
  /**
823
1030
  * A second, slower recording of a dictation — a separate file (a text-to-speech
@@ -920,6 +1127,8 @@ interface DictationData {
920
1127
  learningObjectives?: string[];
921
1128
  /** Subjective difficulty on a 1–5 scale. */
922
1129
  difficultyLevel?: 1 | 2 | 3 | 4 | 5;
1130
+ /** What an author allows AI to do for this item: see {@link ActivityAiPermissions}. */
1131
+ ai?: ActivityAiPermissions;
923
1132
  }
924
1133
  /** A dimension of speech a pronunciation assessor scores, on a 0–100 scale. */
925
1134
  type ReadAloudDimension = 'accuracy' | 'fluency' | 'completeness' | 'prosody';
@@ -1010,6 +1219,8 @@ interface ReadAloudData {
1010
1219
  learningObjectives?: string[];
1011
1220
  /** Subjective difficulty on a 1–5 scale. */
1012
1221
  difficultyLevel?: 1 | 2 | 3 | 4 | 5;
1222
+ /** What an author allows AI to do for this item: see {@link ActivityAiPermissions}. */
1223
+ ai?: ActivityAiPermissions;
1013
1224
  }
1014
1225
  /**
1015
1226
  * Maps each ActivityType string to its learner-response shape. Open for
@@ -1185,8 +1396,13 @@ interface DeferredScoringPartial {
1185
1396
  * a grade has not landed, or the attempt is still open has earned nothing
1186
1397
  * yet, and recording it as zero is how an incomplete attempt becomes a
1187
1398
  * plausible-looking fail.
1399
+ * - `grade_rejected` — a grade came back, and `outcomeFromGrade` refused it
1400
+ * because its numbers cannot be a grade (a `score` or `maxScore` that is not
1401
+ * a finite number, a `maxScore` of 0 or less, or a score outside 0 to
1402
+ * `maxScore`). The record is kept on `rejectedGrade`. A real grade is still
1403
+ * owed, so re-grade the slot: waiting will not bring one.
1188
1404
  */
1189
- type DeferredReason = 'requires_async_grading' | 'no_response_recorded';
1405
+ type DeferredReason = 'requires_async_grading' | 'no_response_recorded' | 'grade_rejected';
1190
1406
  /**
1191
1407
  * The outcome of evaluating a learner response against an activity — the
1192
1408
  * union `evaluate()` returns. Unlike {@link ScoringResult}, it can express
@@ -1213,6 +1429,12 @@ type ItemOutcome = {
1213
1429
  maxScore: number;
1214
1430
  /** Synchronously computable progress facts (word bounds, counts). */
1215
1431
  partial?: DeferredScoringPartial;
1432
+ /**
1433
+ * The record `outcomeFromGrade` refused, verbatim, when `reason` is
1434
+ * `grade_rejected` — kept for audit and for the re-grade. Nothing on it
1435
+ * is mirrored onto the outcome, and nothing reads it as a grade.
1436
+ */
1437
+ rejectedGrade?: GradeRecord;
1216
1438
  } | {
1217
1439
  status: 'graded';
1218
1440
  /**
@@ -1320,7 +1542,15 @@ type InteractionKind = 'option-selected' | 'option-deselected' | 'blank-filled'
1320
1542
  * primary line's language, or `null` with captions off; `payload.secondary` is
1321
1543
  * the second line's, or `null` with none showing. Fires when either changes.
1322
1544
  */
1323
- | 'video-captions-changed' | 'video-fullscreen-changed' | 'video-pip-changed' | (string & {});
1545
+ | 'video-captions-changed' | 'video-fullscreen-changed' | 'video-pip-changed'
1546
+ /**
1547
+ * An AI hint was shown to the learner (`hintNumber`, and the port's
1548
+ * `provenance` when it sent one). Only a hint the SDK accepted: a refused one
1549
+ * is never shown and never reported here.
1550
+ */
1551
+ | 'ai-hint-shown'
1552
+ /** An AI explanation of the graded answer was shown (`provenance` when sent). */
1553
+ | 'ai-explanation-shown' | (string & {});
1324
1554
  /** Fired by activity components on every discrete learner interaction. */
1325
1555
  interface InteractionEvent {
1326
1556
  /** The kind of interaction that occurred. */
@@ -1333,4 +1563,4 @@ interface InteractionEvent {
1333
1563
  payload: Record<string, unknown>;
1334
1564
  }
1335
1565
 
1336
- export { type ValidationResult as $, type ActivityData as A, type BlankConfig as B, type CriterionScore as C, type DeferredReason as D, type MultipleChoiceData as E, type FillInTheBlanksData as F, type GapSelectBank as G, type MultipleChoiceLearnerResponse as H, type InlineCorrection as I, type MultipleChoiceOption as J, type MultipleChoiceOptionMedia as K, type LearnerResponse as L, type MediaPlaybackPolicy as M, type NativeControlHint as N, type ReadAloudDimension as O, type ReadAloudDimensionWeight as P, type ReadAloudLearnerResponse as Q, type ReadAloudData as R, type ReadAloudSlowMedia as S, type RecordingBounds as T, type RecordingRef as U, type ScoringDetail as V, type ScoringOutcome as W, type ScoringResult as X, type TextMatchPolicy as Y, type TextMatchResult as Z, type ValidationError as _, type ActivityDataMap as a, type WrittenResponseData as a0, type WrittenResponseLearnerResponse as a1, type WrittenResponseRubric as a2, type WrittenResponseRubricCriterion as a3, type XAPIActor as a4, type XAPIConfig as a5, type XAPIContext as a6, type XAPIContextActivities as a7, type XAPIError as a8, type XAPIObject as a9, type XAPIResult as aa, type XAPIScore as ab, type XAPIStatement as ac, type XAPIVerbObject as ad, levenshteinDistance as ae, matchText as af, type ActivityFeedback as b, type ActivityMedia as c, type ActivityResult as d, type ActivityType as e, type DeferredScoringPartial as f, type DictationData as g, type DictationEquivalence as h, type DictationLearnerResponse as i, type DictationSlowMedia as j, type DictationTolerance as k, type FillInTheBlanksLearnerResponse as l, type GapSelectChoice as m, type GapSelectData as n, type GapSelectGap as o, type GapSelectLearnerResponse as p, type GradeRecord as q, type Grader as r, type GraderKind as s, type GraderUsage as t, type GradingState as u, type InteractionEvent as v, type InteractionKind as w, type ItemOutcome as x, type LearnerResponseMap as y, type MediaTrack as z };
1566
+ export { type MediaPlaybackPolicy as $, type ActivityAiPermissions as A, type BlankConfig as B, type CriterionScore as C, type DeferredReason as D, type DictationData as E, type DictationEquivalence as F, type DictationLearnerResponse as G, type DictationSlowMedia as H, type DictationTolerance as I, type FillInTheBlanksData as J, type FillInTheBlanksLearnerResponse as K, type GapSelectBank as L, type GapSelectChoice as M, type GapSelectData as N, type GapSelectGap as O, type GapSelectLearnerResponse as P, type GradeRecord as Q, type Grader as R, type GraderKind as S, type GraderUsage as T, type GradingState as U, type InlineCorrection as V, type InteractionEvent as W, type InteractionKind as X, type ItemOutcome as Y, type LearnerResponse as Z, type LearnerResponseMap as _, type ActivityData as a, type MediaTrack as a0, type MultipleChoiceData as a1, type MultipleChoiceLearnerResponse as a2, type MultipleChoiceOption as a3, type MultipleChoiceOptionMedia as a4, type NativeControlHint as a5, type ReadAloudData as a6, type ReadAloudDimension as a7, type ReadAloudDimensionWeight as a8, type ReadAloudLearnerResponse as a9, type ReadAloudSlowMedia as aa, type RecordingBounds as ab, type RecordingRef as ac, type ScoringDetail as ad, type ScoringOutcome as ae, type ScoringResult as af, type TextMatchPolicy as ag, type TextMatchResult as ah, type ValidationError as ai, type ValidationResult as aj, type WrittenResponseData as ak, type WrittenResponseLearnerResponse as al, type WrittenResponseRubric as am, type WrittenResponseRubricCriterion as an, type XAPIActor as ao, type XAPIConfig as ap, type XAPIContext as aq, type XAPIContextActivities as ar, type XAPIError as as, type XAPIObject as at, type XAPIResult as au, type XAPIScore as av, type XAPIStatement as aw, type XAPIVerbObject as ax, levenshteinDistance as ay, matchText as az, type ActivityDataMap as b, type ActivityFeedback as c, type ActivityMedia as d, type ActivityResult as e, type ActivityType as f, type AiActivityInput as g, type AiBlankFact as h, type AiDictationFacts as i, type AiExplanationRequest as j, type AiFeature as k, type AiFillInTheBlanksFacts as l, type AiGapFact as m, type AiGapSelectFacts as n, type AiGrade as o, type AiHintRequest as p, type AiItemFacts as q, type AiMultipleChoiceFacts as r, type AiOptionFact as s, type AiProvenance as t, type AiRefusal as u, type AiSupportedActivityType as v, type AiTextResult as w, type AiVerdict as x, type AiWordFact as y, type DeferredScoringPartial as z };
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkF7UOLKWVcjs = require('./chunk-F7UOLKWV.cjs');
14
+ var _chunkD4TOPSHVcjs = require('./chunk-D4TOPSHV.cjs');
15
15
 
16
16
  // src/schemas/item-group.ts
17
17
  var _v4 = require('zod/v4');
@@ -57,7 +57,7 @@ var StimulusSchema = _v4.z.looseObject({
57
57
  title: _v4.z.string().optional(),
58
58
  body: _v4.z.string().optional(),
59
59
  bodyHtml: _v4.z.string().optional(),
60
- media: _chunkF7UOLKWVcjs.MediaSchema.optional(),
60
+ media: _chunkD4TOPSHVcjs.MediaSchema.optional(),
61
61
  transcript: _v4.z.string().optional(),
62
62
  locale: _v4.z.string().optional(),
63
63
  attribution: _v4.z.string().optional()
@@ -267,7 +267,7 @@ var RedactedStimulusSchema = _v4.z.strictObject({
267
267
  title: _v4.z.string().optional(),
268
268
  body: _v4.z.string().optional(),
269
269
  bodyHtml: _v4.z.string().optional(),
270
- media: _chunkF7UOLKWVcjs.RedactedMediaSchema.optional(),
270
+ media: _chunkD4TOPSHVcjs.RedactedMediaSchema.optional(),
271
271
  locale: _v4.z.string().optional(),
272
272
  attribution: _v4.z.string().optional()
273
273
  });
@@ -286,12 +286,12 @@ var RedactedItemGroupSchema = _v4.z.strictObject({
286
286
  for (const issue of timelineIssues(ctx.value, "redacted")) {
287
287
  ctx.issues.push({ code: "custom", ...issue });
288
288
  }
289
- const captions = _chunkF7UOLKWVcjs.groupCaptionsField.call(void 0, ctx.value);
289
+ const captions = _chunkD4TOPSHVcjs.groupCaptionsField.call(void 0, ctx.value);
290
290
  if (captions !== void 0) {
291
291
  ctx.issues.push({
292
292
  code: "custom",
293
293
  input: _optionalChain([ctx, 'access', _ => _.value, 'access', _2 => _2.stimulus, 'access', _3 => _3.media, 'optionalAccess', _4 => _4[captions]]),
294
- message: _chunkF7UOLKWVcjs.GROUP_CAPTIONS_REVEAL_DICTATION,
294
+ message: _chunkD4TOPSHVcjs.GROUP_CAPTIONS_REVEAL_DICTATION,
295
295
  path: ["stimulus", "media", captions]
296
296
  });
297
297
  }
@@ -311,7 +311,7 @@ function validateItemGroup(data) {
311
311
  const errors = [];
312
312
  const items = [];
313
313
  container.data.items.forEach((item, index) => {
314
- const descriptor = _chunkF7UOLKWVcjs.getActivityTypeDescriptor.call(void 0, item.type);
314
+ const descriptor = _chunkD4TOPSHVcjs.getActivityTypeDescriptor.call(void 0, item.type);
315
315
  if (descriptor === void 0) {
316
316
  errors.push({
317
317
  path: ["items", String(index), "type"],
@@ -327,11 +327,11 @@ function validateItemGroup(data) {
327
327
  }
328
328
  items.push(parsed.data);
329
329
  });
330
- const captions = _chunkF7UOLKWVcjs.groupCaptionsField.call(void 0, container.data);
330
+ const captions = _chunkD4TOPSHVcjs.groupCaptionsField.call(void 0, container.data);
331
331
  if (captions !== void 0) {
332
332
  errors.push({
333
333
  path: ["stimulus", "media", captions],
334
- message: _chunkF7UOLKWVcjs.GROUP_CAPTIONS_REVEAL_DICTATION,
334
+ message: _chunkD4TOPSHVcjs.GROUP_CAPTIONS_REVEAL_DICTATION,
335
335
  code: "custom"
336
336
  });
337
337
  }
@@ -345,37 +345,37 @@ function validateItemGroup(data) {
345
345
 
346
346
  var stimulusJsonSchema = _v4.z.toJSONSchema(StimulusSchema, { target: "draft-7" });
347
347
  var itemGroupJsonSchema = _v4.z.toJSONSchema(ItemGroupSchema, { target: "draft-7" });
348
- var gapSelectJsonSchema = _v4.z.toJSONSchema(_chunkF7UOLKWVcjs.GapSelectDataSchema, {
348
+ var gapSelectJsonSchema = _v4.z.toJSONSchema(_chunkD4TOPSHVcjs.GapSelectDataSchema, {
349
349
  target: "draft-7"
350
350
  });
351
- var dictationJsonSchema = _v4.z.toJSONSchema(_chunkF7UOLKWVcjs.DictationDataSchema, {
351
+ var dictationJsonSchema = _v4.z.toJSONSchema(_chunkD4TOPSHVcjs.DictationDataSchema, {
352
352
  target: "draft-7"
353
353
  });
354
- var readAloudJsonSchema = _v4.z.toJSONSchema(_chunkF7UOLKWVcjs.ReadAloudDataSchema, {
354
+ var readAloudJsonSchema = _v4.z.toJSONSchema(_chunkD4TOPSHVcjs.ReadAloudDataSchema, {
355
355
  target: "draft-7"
356
356
  });
357
- var multipleChoiceJsonSchema = _v4.z.toJSONSchema(_chunkF7UOLKWVcjs.MultipleChoiceDataSchema, {
357
+ var multipleChoiceJsonSchema = _v4.z.toJSONSchema(_chunkD4TOPSHVcjs.MultipleChoiceDataSchema, {
358
358
  target: "draft-7"
359
359
  });
360
- var fillInTheBlanksJsonSchema = _v4.z.toJSONSchema(_chunkF7UOLKWVcjs.FillInTheBlanksDataSchema, {
360
+ var fillInTheBlanksJsonSchema = _v4.z.toJSONSchema(_chunkD4TOPSHVcjs.FillInTheBlanksDataSchema, {
361
361
  target: "draft-7"
362
362
  });
363
- var writtenResponseJsonSchema = _v4.z.toJSONSchema(_chunkF7UOLKWVcjs.WrittenResponseDataSchema, {
363
+ var writtenResponseJsonSchema = _v4.z.toJSONSchema(_chunkD4TOPSHVcjs.WrittenResponseDataSchema, {
364
364
  target: "draft-7"
365
365
  });
366
366
  function jsonSchemaFor(type) {
367
- const descriptor = _chunkF7UOLKWVcjs.getActivityTypeDescriptor.call(void 0, type);
367
+ const descriptor = _chunkD4TOPSHVcjs.getActivityTypeDescriptor.call(void 0, type);
368
368
  if (descriptor === void 0) {
369
- throw new (0, _chunkF7UOLKWVcjs.UnknownActivityTypeError)(type);
369
+ throw new (0, _chunkD4TOPSHVcjs.UnknownActivityTypeError)(type);
370
370
  }
371
371
  return _v4.z.toJSONSchema(descriptor.schema, { target: "draft-7" });
372
372
  }
373
373
 
374
374
  // src/schemas/index.ts
375
375
  function validateActivity(type, data) {
376
- const descriptor = _chunkF7UOLKWVcjs.getActivityTypeDescriptor.call(void 0, type);
376
+ const descriptor = _chunkD4TOPSHVcjs.getActivityTypeDescriptor.call(void 0, type);
377
377
  if (descriptor === void 0) {
378
- throw new (0, _chunkF7UOLKWVcjs.UnknownActivityTypeError)(String(type));
378
+ throw new (0, _chunkD4TOPSHVcjs.UnknownActivityTypeError)(String(type));
379
379
  }
380
380
  const result = descriptor.schema.safeParse(data);
381
381
  if (result.success) {
@@ -417,4 +417,4 @@ function validateActivity(type, data) {
417
417
 
418
418
 
419
419
  exports.INTERACTIVE_VIDEO_ITEM_TYPES = INTERACTIVE_VIDEO_ITEM_TYPES; exports.isInteractiveVideoItemType = isInteractiveVideoItemType; exports.TIMELINE_MAX_QUIZZES = TIMELINE_MAX_QUIZZES; exports.TIMELINE_MAX_ITEMS = TIMELINE_MAX_ITEMS; exports.TIMELINE_MAX_CHAPTERS = TIMELINE_MAX_CHAPTERS; exports.TIMELINE_MAX_TITLE_LENGTH = TIMELINE_MAX_TITLE_LENGTH; exports.StimulusSchema = StimulusSchema; exports.TimelineCueSchema = TimelineCueSchema; exports.TimelineChapterSchema = TimelineChapterSchema; exports.MediaTimelineSchema = MediaTimelineSchema; exports.ItemGroupSchema = ItemGroupSchema; exports.RedactedStimulusSchema = RedactedStimulusSchema; exports.RedactedItemGroupSchema = RedactedItemGroupSchema; exports.validateItemGroup = validateItemGroup; exports.stimulusJsonSchema = stimulusJsonSchema; exports.itemGroupJsonSchema = itemGroupJsonSchema; exports.gapSelectJsonSchema = gapSelectJsonSchema; exports.dictationJsonSchema = dictationJsonSchema; exports.readAloudJsonSchema = readAloudJsonSchema; exports.multipleChoiceJsonSchema = multipleChoiceJsonSchema; exports.fillInTheBlanksJsonSchema = fillInTheBlanksJsonSchema; exports.writtenResponseJsonSchema = writtenResponseJsonSchema; exports.jsonSchemaFor = jsonSchemaFor; exports.validateActivity = validateActivity;
420
- //# sourceMappingURL=chunk-FJJ2GVBA.cjs.map
420
+ //# sourceMappingURL=chunk-2CV6NU32.cjs.map