@thanh01.pmt/curriculum-kit 1.4.28 → 1.4.30

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 (39) hide show
  1. package/dist/ai/index.cjs +19 -2
  2. package/dist/ai/index.cjs.map +1 -1
  3. package/dist/ai/index.d.cts +2 -2
  4. package/dist/ai/index.d.ts +2 -2
  5. package/dist/ai/index.mjs +19 -2
  6. package/dist/ai/index.mjs.map +1 -1
  7. package/dist/index.cjs +49 -3
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +5 -5
  10. package/dist/index.d.ts +5 -5
  11. package/dist/index.mjs +49 -3
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/media/index.cjs +19 -2
  14. package/dist/media/index.cjs.map +1 -1
  15. package/dist/media/index.d.cts +1 -1
  16. package/dist/media/index.d.ts +1 -1
  17. package/dist/media/index.mjs +19 -2
  18. package/dist/media/index.mjs.map +1 -1
  19. package/dist/pipeline/index.cjs.map +1 -1
  20. package/dist/pipeline/index.d.cts +1 -1
  21. package/dist/pipeline/index.d.ts +1 -1
  22. package/dist/pipeline/index.mjs.map +1 -1
  23. package/dist/publishers/index.d.cts +1 -1
  24. package/dist/publishers/index.d.ts +1 -1
  25. package/dist/storage/index.cjs +27 -0
  26. package/dist/storage/index.cjs.map +1 -1
  27. package/dist/storage/index.d.cts +11 -2
  28. package/dist/storage/index.d.ts +11 -2
  29. package/dist/storage/index.mjs +27 -0
  30. package/dist/storage/index.mjs.map +1 -1
  31. package/dist/{streamRunner-kpS4MZP1.d.cts → streamRunner-DYHFhNUr.d.cts} +1 -1
  32. package/dist/{streamRunner-kpS4MZP1.d.ts → streamRunner-DYHFhNUr.d.ts} +1 -1
  33. package/dist/{types-BUJGYiep.d.cts → types-Bgk-C4K2.d.cts} +11 -0
  34. package/dist/{types-BUJGYiep.d.ts → types-Bgk-C4K2.d.ts} +11 -0
  35. package/dist/workflow/index.cjs +21 -3
  36. package/dist/workflow/index.cjs.map +1 -1
  37. package/dist/workflow/index.mjs +21 -3
  38. package/dist/workflow/index.mjs.map +1 -1
  39. package/package.json +1 -1
package/dist/ai/index.cjs CHANGED
@@ -464,6 +464,13 @@ Guidelines:
464
464
  });
465
465
  }
466
466
  }
467
+ if (!options.customInference && resolveApiKey("CURRICULUM_KIT_REQUIRE_CUSTOM_INFERENCE") === "1") {
468
+ throw createAiInferenceError({
469
+ errorCode: "ERR_CUSTOM_INFERENCE_REQUIRED",
470
+ message: "customInference is REQUIRED (CURRICULUM_KIT_REQUIRE_CUSTOM_INFERENCE=1): pass buildKitCustomInference(...) so every LLM call flows through the host AI SDK gateway and its unified Langfuse tracing. Raw-fetch provider routes are disabled by mandate.",
471
+ rawError: { mandate: "CURRICULUM_KIT_REQUIRE_CUSTOM_INFERENCE", hasCustomInference: false }
472
+ });
473
+ }
467
474
  const formattedMessages = [
468
475
  { role: "system", content: systemInstruction },
469
476
  ...messages.map((m) => ({
@@ -487,7 +494,12 @@ Guidelines:
487
494
  const unique9RouterModels = Array.from(new Set(candidateModels));
488
495
  for (const model of unique9RouterModels) {
489
496
  try {
490
- const idle = createStreamAbortController({ idleMs: 45e3, totalMs: 3e5 });
497
+ const r9Idle = options.idleTimeoutMs ?? (Number(process.env.ARTIFACT_STREAM_IDLE_TIMEOUT_MS || process.env.STREAM_IDLE_TIMEOUT_MS) || 0) ?? 0;
498
+ const r9Total = options.timeoutMs ?? (Number(process.env.ARTIFACT_STREAM_TOTAL_TIMEOUT_MS || process.env.STREAM_TOTAL_TIMEOUT_MS) || 0) ?? 0;
499
+ const idle = createStreamAbortController({
500
+ idleMs: r9Idle > 0 ? r9Idle : 9e4,
501
+ totalMs: r9Total > 0 ? r9Total : 3e5
502
+ });
491
503
  const res = await fetch(`${ninerouterBaseUrl}/chat/completions`, {
492
504
  method: "POST",
493
505
  headers: {
@@ -730,7 +742,12 @@ Guidelines:
730
742
  try {
731
743
  const rawUrl = resolveApiKey("NINEROUTER_BASE_URL") || resolveApiKey("NINE_ROUTER_BASE_URL") || "https://ai-router.orchable.app/v1";
732
744
  const fbBaseUrl = rawUrl.replace(/["']/g, "").replace(/\/$/, "");
733
- const idle = createStreamAbortController({ idleMs: 45e3, totalMs: 3e5 });
745
+ const fbIdle = options.idleTimeoutMs ?? (Number(process.env.ARTIFACT_STREAM_IDLE_TIMEOUT_MS || process.env.STREAM_IDLE_TIMEOUT_MS) || 0) ?? 0;
746
+ const fbTotal = options.timeoutMs ?? (Number(process.env.ARTIFACT_STREAM_TOTAL_TIMEOUT_MS || process.env.STREAM_TOTAL_TIMEOUT_MS) || 0) ?? 0;
747
+ const idle = createStreamAbortController({
748
+ idleMs: fbIdle > 0 ? fbIdle : 9e4,
749
+ totalMs: fbTotal > 0 ? fbTotal : 3e5
750
+ });
734
751
  const res = await fetch(`${fbBaseUrl}/chat/completions`, {
735
752
  method: "POST",
736
753
  headers: {