@thanh01.pmt/curriculum-kit 1.0.16 → 1.0.17

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.
package/dist/index.d.cts CHANGED
@@ -407,12 +407,15 @@ interface ExtractedStreamChunk {
407
407
  * Pure function so the extraction contract is unit-testable.
408
408
  *
409
409
  * Reasoning arrives through provider-specific shapes:
410
- * - `reasoning-delta` / legacy `reasoning` parts (mapped by SDK providers),
411
- * - `raw` parts (emitted when `includeRawChunks: true`) whose `rawValue` is the
412
- * provider's OpenAI-compatible SSE chunk: NVIDIA NIM & DeepSeek put thinking
413
- * in `choices[0].delta.reasoning_content`, OpenRouter in `choices[0].delta.reasoning`.
414
- * Without this extraction the entire thinking phase renders as a blank UI
415
- * (only text-delta reaches the caller) the observed ~30s silent wait.
410
+ * - `reasoning-delta` / legacy `reasoning` parts (mapped by SDK providers).
411
+ *
412
+ * DUP-STREAM FIX (measured live against NVIDIA NIM nemotron-ultra, 2026-09-10):
413
+ * with `includeRawChunks: true` the SDK emits BOTH the mapped `text-delta`
414
+ * /`reasoning-delta` part AND the `raw` provider chunk carrying the SAME
415
+ * token. Extracting text from `raw` parts therefore duplicated every token
416
+ * ("Lớp 1ớp 1 (6-7 (6-7 tuổi)…"), destroying the JSON and causing the ~90%
417
+ * wizard prefill failure. The mapped parts are the single source of truth —
418
+ * `raw` parts must contribute NOTHING here.
416
419
  */
417
420
  declare function extractStreamChunk(part: any): ExtractedStreamChunk;
418
421
  declare function createStreamAbortSignal(budget: Required<StreamBudget>): StreamAbortHandle;
package/dist/index.d.ts CHANGED
@@ -407,12 +407,15 @@ interface ExtractedStreamChunk {
407
407
  * Pure function so the extraction contract is unit-testable.
408
408
  *
409
409
  * Reasoning arrives through provider-specific shapes:
410
- * - `reasoning-delta` / legacy `reasoning` parts (mapped by SDK providers),
411
- * - `raw` parts (emitted when `includeRawChunks: true`) whose `rawValue` is the
412
- * provider's OpenAI-compatible SSE chunk: NVIDIA NIM & DeepSeek put thinking
413
- * in `choices[0].delta.reasoning_content`, OpenRouter in `choices[0].delta.reasoning`.
414
- * Without this extraction the entire thinking phase renders as a blank UI
415
- * (only text-delta reaches the caller) the observed ~30s silent wait.
410
+ * - `reasoning-delta` / legacy `reasoning` parts (mapped by SDK providers).
411
+ *
412
+ * DUP-STREAM FIX (measured live against NVIDIA NIM nemotron-ultra, 2026-09-10):
413
+ * with `includeRawChunks: true` the SDK emits BOTH the mapped `text-delta`
414
+ * /`reasoning-delta` part AND the `raw` provider chunk carrying the SAME
415
+ * token. Extracting text from `raw` parts therefore duplicated every token
416
+ * ("Lớp 1ớp 1 (6-7 (6-7 tuổi)…"), destroying the JSON and causing the ~90%
417
+ * wizard prefill failure. The mapped parts are the single source of truth —
418
+ * `raw` parts must contribute NOTHING here.
416
419
  */
417
420
  declare function extractStreamChunk(part: any): ExtractedStreamChunk;
418
421
  declare function createStreamAbortSignal(budget: Required<StreamBudget>): StreamAbortHandle;
package/dist/index.mjs CHANGED
@@ -13561,15 +13561,6 @@ function extractStreamChunk(part) {
13561
13561
  const content = part.text ?? part.delta ?? "";
13562
13562
  return content ? { content } : {};
13563
13563
  }
13564
- if (part.type === "raw") {
13565
- const raw = part.rawValue;
13566
- const delta = raw?.choices?.[0]?.delta;
13567
- const reasoning = delta?.reasoning_content ?? delta?.reasoning ?? raw?.delta?.reasoning_content ?? raw?.delta?.reasoning;
13568
- if (typeof reasoning === "string" && reasoning) return { thought: reasoning };
13569
- const text = delta?.content ?? raw?.delta?.content;
13570
- if (typeof text === "string" && text) return { content: text };
13571
- return {};
13572
- }
13573
13564
  return {};
13574
13565
  }
13575
13566
  function createStreamAbortSignal(budget) {