@speakableio/core 1.0.45 → 1.0.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.
@@ -118,6 +118,7 @@ interface PageActivity {
118
118
  target_text?: string;
119
119
  type: ActivityPageType;
120
120
  grading_criteria?: string;
121
+ grading_criteria_title?: string;
121
122
  scoring_type?: string;
122
123
  grading_method?: 'simple' | 'rubric' | 'manual' | 'standards_based';
123
124
  feedback_types?: FeedbackTypesCard[];
@@ -160,6 +161,8 @@ interface PageActivity {
160
161
  rich_text?: string;
161
162
  feedbackOff?: boolean;
162
163
  correct_answer_exact_match?: boolean;
164
+ ai_context_block_ids?: string[];
165
+ resolvedContext?: string;
163
166
  }
164
167
  declare const enum ActivityPageType {
165
168
  READ_REPEAT = "READ_REPEAT",
@@ -218,6 +221,7 @@ declare function useCards({ cardIds, enabled, asObject, }: {
218
221
  default_language?: string;
219
222
  target_text?: string;
220
223
  grading_criteria?: string;
224
+ grading_criteria_title?: string;
221
225
  scoring_type?: string;
222
226
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
223
227
  feedback_types?: FeedbackTypesCard[];
@@ -260,6 +264,8 @@ declare function useCards({ cardIds, enabled, asObject, }: {
260
264
  rich_text?: string;
261
265
  feedbackOff?: boolean;
262
266
  correct_answer_exact_match?: boolean;
267
+ ai_context_block_ids?: string[];
268
+ resolvedContext?: string;
263
269
  } | null, Error>[];
264
270
  };
265
271
  declare function useCreateCard(): {
@@ -297,6 +303,7 @@ declare function useCreateCards(): {
297
303
  target_text?: string;
298
304
  type: ActivityPageType;
299
305
  grading_criteria?: string;
306
+ grading_criteria_title?: string;
300
307
  scoring_type?: string;
301
308
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
302
309
  feedback_types?: FeedbackTypesCard[];
@@ -339,6 +346,8 @@ declare function useCreateCards(): {
339
346
  rich_text?: string;
340
347
  feedbackOff?: boolean;
341
348
  correct_answer_exact_match?: boolean;
349
+ ai_context_block_ids?: string[];
350
+ resolvedContext?: string;
342
351
  }[], Error, {
343
352
  cards: PageActivity[];
344
353
  }, unknown>;
@@ -382,6 +391,7 @@ declare function useGetCard({ cardId, enabled }: {
382
391
  default_language?: string;
383
392
  target_text?: string;
384
393
  grading_criteria?: string;
394
+ grading_criteria_title?: string;
385
395
  scoring_type?: string;
386
396
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
387
397
  feedback_types?: FeedbackTypesCard[];
@@ -424,6 +434,8 @@ declare function useGetCard({ cardId, enabled }: {
424
434
  rich_text?: string;
425
435
  feedbackOff?: boolean;
426
436
  correct_answer_exact_match?: boolean;
437
+ ai_context_block_ids?: string[];
438
+ resolvedContext?: string;
427
439
  } | null, Error>;
428
440
 
429
441
  declare const createCardRepo: () => {
@@ -461,6 +473,7 @@ declare const createCardRepo: () => {
461
473
  target_text?: string;
462
474
  type: ActivityPageType;
463
475
  grading_criteria?: string;
476
+ grading_criteria_title?: string;
464
477
  scoring_type?: string;
465
478
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
466
479
  feedback_types?: FeedbackTypesCard[];
@@ -503,6 +516,8 @@ declare const createCardRepo: () => {
503
516
  rich_text?: string;
504
517
  feedbackOff?: boolean;
505
518
  correct_answer_exact_match?: boolean;
519
+ ai_context_block_ids?: string[];
520
+ resolvedContext?: string;
506
521
  }[]>;
507
522
  getCard: (params: {
508
523
  cardId: string;
@@ -533,6 +548,7 @@ declare const createCardRepo: () => {
533
548
  default_language?: string;
534
549
  target_text?: string;
535
550
  grading_criteria?: string;
551
+ grading_criteria_title?: string;
536
552
  scoring_type?: string;
537
553
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
538
554
  feedback_types?: FeedbackTypesCard[];
@@ -575,6 +591,8 @@ declare const createCardRepo: () => {
575
591
  rich_text?: string;
576
592
  feedbackOff?: boolean;
577
593
  correct_answer_exact_match?: boolean;
594
+ ai_context_block_ids?: string[];
595
+ resolvedContext?: string;
578
596
  } | null>;
579
597
  };
580
598
 
@@ -1388,6 +1406,7 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1388
1406
  target_text?: string;
1389
1407
  type: ActivityPageType;
1390
1408
  grading_criteria?: string;
1409
+ grading_criteria_title?: string;
1391
1410
  scoring_type?: string;
1392
1411
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
1393
1412
  feedback_types?: FeedbackTypesCard[];
@@ -1430,6 +1449,8 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1430
1449
  rich_text?: string;
1431
1450
  feedbackOff?: boolean;
1432
1451
  correct_answer_exact_match?: boolean;
1452
+ ai_context_block_ids?: string[];
1453
+ resolvedContext?: string;
1433
1454
  }[]>;
1434
1455
  getCard: (params: {
1435
1456
  cardId: string;
@@ -1460,6 +1481,7 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1460
1481
  default_language?: string;
1461
1482
  target_text?: string;
1462
1483
  grading_criteria?: string;
1484
+ grading_criteria_title?: string;
1463
1485
  scoring_type?: string;
1464
1486
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
1465
1487
  feedback_types?: FeedbackTypesCard[];
@@ -1502,6 +1524,8 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1502
1524
  rich_text?: string;
1503
1525
  feedbackOff?: boolean;
1504
1526
  correct_answer_exact_match?: boolean;
1527
+ ai_context_block_ids?: string[];
1528
+ resolvedContext?: string;
1505
1529
  } | null>;
1506
1530
  };
1507
1531
  };
@@ -1716,6 +1740,7 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1716
1740
  default_language?: string;
1717
1741
  target_text?: string;
1718
1742
  grading_criteria?: string;
1743
+ grading_criteria_title?: string;
1719
1744
  scoring_type?: string;
1720
1745
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
1721
1746
  feedback_types?: FeedbackTypesCard[];
@@ -1758,6 +1783,8 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1758
1783
  rich_text?: string;
1759
1784
  feedbackOff?: boolean;
1760
1785
  correct_answer_exact_match?: boolean;
1786
+ ai_context_block_ids?: string[];
1787
+ resolvedContext?: string;
1761
1788
  } | null, Error>[];
1762
1789
  cardsArray: PageActivityWithId[];
1763
1790
  };
@@ -3261,6 +3288,7 @@ declare const createFsClientWeb: ({ db, httpsCallable, logEvent }: FsClientParam
3261
3288
  target_text?: string;
3262
3289
  type: ActivityPageType;
3263
3290
  grading_criteria?: string;
3291
+ grading_criteria_title?: string;
3264
3292
  scoring_type?: string;
3265
3293
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
3266
3294
  feedback_types?: FeedbackTypesCard[];
@@ -3303,6 +3331,8 @@ declare const createFsClientWeb: ({ db, httpsCallable, logEvent }: FsClientParam
3303
3331
  rich_text?: string;
3304
3332
  feedbackOff?: boolean;
3305
3333
  correct_answer_exact_match?: boolean;
3334
+ ai_context_block_ids?: string[];
3335
+ resolvedContext?: string;
3306
3336
  }[]>;
3307
3337
  getCard: (params: {
3308
3338
  cardId: string;
@@ -3333,6 +3363,7 @@ declare const createFsClientWeb: ({ db, httpsCallable, logEvent }: FsClientParam
3333
3363
  default_language?: string;
3334
3364
  target_text?: string;
3335
3365
  grading_criteria?: string;
3366
+ grading_criteria_title?: string;
3336
3367
  scoring_type?: string;
3337
3368
  grading_method?: "simple" | "rubric" | "manual" | "standards_based";
3338
3369
  feedback_types?: FeedbackTypesCard[];
@@ -3375,6 +3406,8 @@ declare const createFsClientWeb: ({ db, httpsCallable, logEvent }: FsClientParam
3375
3406
  rich_text?: string;
3376
3407
  feedbackOff?: boolean;
3377
3408
  correct_answer_exact_match?: boolean;
3409
+ ai_context_block_ids?: string[];
3410
+ resolvedContext?: string;
3378
3411
  } | null>;
3379
3412
  };
3380
3413
  };
package/dist/index.web.js CHANGED
@@ -2180,24 +2180,34 @@ var createSetRepo = () => {
2180
2180
  // src/utils/ai/detect-transcript-hallucionation.ts
2181
2181
  var HALLUCINATION_THRESHOLDS = {
2182
2182
  // Short repeats
2183
- MIN_CONSECUTIVE_REPEATS: 3,
2184
- MIN_WORDS_FOR_RATIO_CHECK: 10,
2183
+ MIN_CONSECUTIVE_REPEATS: 5,
2184
+ // Increased from 3 to allow phrases like "pio pio pio" or "no no no no"
2185
+ MIN_WORDS_FOR_RATIO_CHECK: 15,
2186
+ // Increased from 10 to require longer text for ratio check
2185
2187
  MAX_UNIQUE_WORDS_FOR_RATIO: 3,
2186
- MIN_REPETITION_RATIO: 3,
2188
+ MIN_REPETITION_RATIO: 4,
2189
+ // Increased from 3 to be more permissive
2187
2190
  // Phrase repeats
2188
- MIN_SENTENCE_LENGTH: 10,
2189
- MIN_CONSECUTIVE_SIMILAR_SENTENCES: 2,
2190
- MIN_SENTENCES_FOR_DUPLICATE_CHECK: 3,
2191
+ MIN_SENTENCE_LENGTH: 15,
2192
+ // Increased from 10 to avoid flagging short natural sentences
2193
+ MIN_CONSECUTIVE_SIMILAR_SENTENCES: 3,
2194
+ // Increased from 2 to allow some natural repetition
2195
+ MIN_SENTENCES_FOR_DUPLICATE_CHECK: 4,
2196
+ // Increased from 3
2191
2197
  // Cyclic patterns
2192
- MIN_CYCLE_LENGTH: 20,
2198
+ MIN_CYCLE_LENGTH: 30,
2199
+ // Increased from 20 to focus on longer patterns
2193
2200
  MIN_CYCLE_REPEATS: 3,
2194
2201
  // Entropy detection
2195
- MIN_LENGTH_FOR_ENTROPY_CHECK: 50,
2196
- MAX_ENTROPY_THRESHOLD: 2.5,
2197
- // bits per character
2202
+ MIN_LENGTH_FOR_ENTROPY_CHECK: 60,
2203
+ // Increased from 50
2204
+ MAX_ENTROPY_THRESHOLD: 2.2,
2205
+ // Decreased from 2.5 to be more strict on entropy (lower = more repetitive needed)
2198
2206
  // Similarity
2199
- SENTENCE_SIMILARITY_THRESHOLD: 0.8,
2200
- SEGMENT_SIMILARITY_THRESHOLD: 0.85
2207
+ SENTENCE_SIMILARITY_THRESHOLD: 0.85,
2208
+ // Increased from 0.8 to require more similarity
2209
+ SEGMENT_SIMILARITY_THRESHOLD: 0.9
2210
+ // Increased from 0.85
2201
2211
  };
2202
2212
  function detectTranscriptHallucinationWithDetails(transcript) {
2203
2213
  if (!transcript || transcript.trim().length === 0) {