@thanh01.pmt/curriculum-kit 1.0.8 → 1.0.10

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 (42) hide show
  1. package/dist/ai/index.cjs +36 -10
  2. package/dist/ai/index.cjs.map +1 -1
  3. package/dist/ai/index.d.cts +5 -5
  4. package/dist/ai/index.d.ts +5 -5
  5. package/dist/ai/index.mjs +36 -10
  6. package/dist/ai/index.mjs.map +1 -1
  7. package/dist/{index-BfDHBO7f.d.ts → index-B8lOdFuz.d.ts} +1 -1
  8. package/dist/{index-BEicVaQ9.d.cts → index-DhxvfPoW.d.cts} +1 -1
  9. package/dist/index.cjs +43 -16
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +6 -6
  12. package/dist/index.d.ts +6 -6
  13. package/dist/index.mjs +43 -16
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/media/index.cjs +30 -4
  16. package/dist/media/index.cjs.map +1 -1
  17. package/dist/media/index.d.cts +1 -1
  18. package/dist/media/index.d.ts +1 -1
  19. package/dist/media/index.mjs +30 -4
  20. package/dist/media/index.mjs.map +1 -1
  21. package/dist/{milestoneBundleGenerator-CbXhs1CP.d.ts → milestoneBundleGenerator-Bkba8OPG.d.ts} +1 -1
  22. package/dist/{milestoneBundleGenerator-DrBtHzBO.d.cts → milestoneBundleGenerator-CzSOeAzU.d.cts} +1 -1
  23. package/dist/pipeline/index.cjs +5 -5
  24. package/dist/pipeline/index.cjs.map +1 -1
  25. package/dist/pipeline/index.d.cts +3 -3
  26. package/dist/pipeline/index.d.ts +3 -3
  27. package/dist/pipeline/index.mjs +5 -5
  28. package/dist/pipeline/index.mjs.map +1 -1
  29. package/dist/{provider-factory-DH3udYlN.d.ts → provider-factory-DxzOVEmh.d.cts} +1 -1
  30. package/dist/{provider-factory-DH3udYlN.d.cts → provider-factory-DxzOVEmh.d.ts} +1 -1
  31. package/dist/storage/index.d.cts +2 -2
  32. package/dist/storage/index.d.ts +2 -2
  33. package/dist/{streamRunner-C7j5LKon.d.cts → streamRunner-CcpmxOf1.d.cts} +20 -1
  34. package/dist/{streamRunner-C7j5LKon.d.ts → streamRunner-CcpmxOf1.d.ts} +20 -1
  35. package/dist/workflow/index.cjs +33 -7
  36. package/dist/workflow/index.cjs.map +1 -1
  37. package/dist/workflow/index.d.cts +2 -2
  38. package/dist/workflow/index.d.ts +2 -2
  39. package/dist/workflow/index.mjs +33 -7
  40. package/dist/workflow/index.mjs.map +1 -1
  41. package/package.json +22 -21
  42. package/LICENSE +0 -21
@@ -1,5 +1,5 @@
1
1
  import { MilestoneInput, LessonPlan, CurriculumQualityReport, ActivityLab, CodeLab, SelfLab, DiagnosticQuiz, SlideDeck, Handout, Worksheet, TeacherGuide, Extension, ProjectRoadmap } from './schemas/index.js';
2
- import { M as ModelResolutionOptions } from './provider-factory-DH3udYlN.js';
2
+ import { M as ModelResolutionOptions } from './provider-factory-DxzOVEmh.js';
3
3
  import { G as GitPublishOptions, a as GitPublishResult, S as SupabasePublishOptions, b as SupabasePublishResult } from './supabasePublisher-C627qXFT.js';
4
4
  import * as workflow from 'workflow';
5
5
  import { z } from 'zod';
@@ -1,5 +1,5 @@
1
1
  import { MilestoneInput, LessonPlan, CurriculumQualityReport, ActivityLab, CodeLab, SelfLab, DiagnosticQuiz, SlideDeck, Handout, Worksheet, TeacherGuide, Extension, ProjectRoadmap } from './schemas/index.cjs';
2
- import { M as ModelResolutionOptions } from './provider-factory-DH3udYlN.cjs';
2
+ import { M as ModelResolutionOptions } from './provider-factory-DxzOVEmh.cjs';
3
3
  import { G as GitPublishOptions, a as GitPublishResult, S as SupabasePublishOptions, b as SupabasePublishResult } from './supabasePublisher-C627qXFT.cjs';
4
4
  import * as workflow from 'workflow';
5
5
  import { z } from 'zod';
package/dist/index.cjs CHANGED
@@ -212,7 +212,7 @@ function isModelAllowed(model) {
212
212
  }
213
213
  function getDesignatedFallbackChain() {
214
214
  const rawProviders = resolveApiKey("FALLBACK_AI_PROVIDER") || resolveApiKey("FALLBACK_AI_PROVIDERS") || resolveApiKey("DEFAULT_AI_PROVIDER") || "nvidia,openrouter";
215
- const rawModels = resolveApiKey("FALLBACK_AI_MODEL") || resolveApiKey("FALLBACK_AI_MODELS") || resolveApiKey("DEFAULT_AI_MODEL") || "nvidia/nemotron-3-ultra-550b-a55b,@preset/coding-free,deepseek/deepseek-chat:free";
215
+ const rawModels = resolveApiKey("FALLBACK_AI_MODEL") || resolveApiKey("FALLBACK_AI_MODELS") || resolveApiKey("DEFAULT_AI_MODEL") || "nvidia/nemotron-3-ultra-550b-a55b:free,@preset/coding-free,deepseek/deepseek-chat:free";
216
216
  const providerList = rawProviders.split(",").map((p) => p.trim().toLowerCase()).filter((p) => p.length > 0 && isProviderEnabled(p));
217
217
  const modelList = rawModels.split(",").map((m) => m.trim()).filter((m) => m.length > 0 && isModelAllowed(m));
218
218
  const chain = [];
@@ -221,7 +221,7 @@ function getDesignatedFallbackChain() {
221
221
  if (provider === "nvidia") {
222
222
  providerModels = modelList.filter((m) => m.startsWith("nvidia/") || m.startsWith("meta/") || m.startsWith("mistralai/"));
223
223
  if (providerModels.length === 0) {
224
- providerModels = ["nvidia/nemotron-3-ultra-550b-a55b", "nvidia/nemotron-3.5-lightning-30b-a3b"];
224
+ providerModels = ["nvidia/nemotron-3-ultra-550b-a55b:free", "nvidia/nemotron-3.5-lightning-30b-a3b"];
225
225
  }
226
226
  } else if (provider === "openrouter") {
227
227
  providerModels = modelList.filter((m) => m.startsWith("@") || m.includes("/") || m.includes(":"));
@@ -257,7 +257,7 @@ function getDesignatedFallbackChain() {
257
257
  function getDesignatedFallbackConfig() {
258
258
  const chain = getDesignatedFallbackChain();
259
259
  if (chain.length > 0) return chain[0];
260
- return { provider: "nvidia", model: "nvidia/nemotron-3-ultra-550b-a55b" };
260
+ return { provider: "nvidia", model: "nvidia/nemotron-3-ultra-550b-a55b:free" };
261
261
  }
262
262
  function extractThoughtAndContent(rawText) {
263
263
  let text = rawText || "";
@@ -450,6 +450,32 @@ Guidelines:
450
450
  3. Keep technical terminology and official API symbols intact.
451
451
  4. Format output using clean Markdown, clear sections, bullet points, and code blocks where required.
452
452
  5. Do NOT use emojis in headings, tab titles, or UI navigation labels.`;
453
+ if (options.customInference) {
454
+ try {
455
+ const text = await options.customInference({
456
+ systemInstruction,
457
+ userPrompt: messages.map((m) => m.content).join("\n\n"),
458
+ messages,
459
+ temperature,
460
+ maxTokens,
461
+ onChunk: onChunk ?? (() => {
462
+ })
463
+ });
464
+ if (text && text.trim()) return text;
465
+ throw createAiInferenceError({
466
+ errorCode: "ERR_AI_ALL_PROVIDERS_FAILED",
467
+ message: "customInference returned empty output",
468
+ rawError: { customInference: "empty response" }
469
+ });
470
+ } catch (e) {
471
+ if (e?.errorCode || e?.name === "AiInferenceError") throw e;
472
+ throw createAiInferenceError({
473
+ errorCode: "ERR_AI_ALL_PROVIDERS_FAILED",
474
+ message: `customInference failed: ${e?.message || e}`,
475
+ rawError: { customInference: String(e?.message || e) }
476
+ });
477
+ }
478
+ }
453
479
  const formattedMessages = [
454
480
  { role: "system", content: systemInstruction },
455
481
  ...messages.map((m) => ({
@@ -462,8 +488,8 @@ Guidelines:
462
488
  const isNvidiaPreferred = requestedModel.startsWith("nvidia/") || Boolean(nvidiaKey && !openrouterKey) && isProviderEnabled("nvidia");
463
489
  if (nvidiaKey && isProviderEnabled("nvidia")) {
464
490
  const candidateNemotronModels = [
465
- requestedModel.startsWith("nvidia/") ? requestedModel : "nvidia/nemotron-3-ultra-550b-a55b",
466
- "nvidia/nemotron-3-ultra-550b-a55b",
491
+ requestedModel.startsWith("nvidia/") ? requestedModel : "nvidia/nemotron-3-ultra-550b-a55b:free",
492
+ "nvidia/nemotron-3-ultra-550b-a55b:free",
467
493
  "nvidia/nemotron-3.5-lightning-30b-a3b",
468
494
  "nvidia/nemotron-3-super-120b-a12b",
469
495
  "nvidia/llama-3.1-nemotron-70b-instruct"
@@ -2623,7 +2649,7 @@ var RoadmapInputSchema = zod.z.object({
2623
2649
  // src/ai/provider-factory.ts
2624
2650
  init_streamRunner();
2625
2651
  var DEFAULT_MODELS = {
2626
- nvidia: "nvidia/nemotron-3-ultra-550b-a55b",
2652
+ nvidia: "nvidia/nemotron-3-ultra-550b-a55b:free",
2627
2653
  openrouter: "@preset/coding-free",
2628
2654
  alibaba: "qwen3.7-plus",
2629
2655
  dashscope: "qwen3.7-plus",
@@ -2634,7 +2660,7 @@ var DEFAULT_MODELS = {
2634
2660
  };
2635
2661
  var NVIDIA_MODELS = {
2636
2662
  codingFast: "nvidia/nemotron-3.5-lightning-30b-a3b",
2637
- reasoningUltra: "nvidia/nemotron-3-ultra-550b-a55b",
2663
+ reasoningUltra: "nvidia/nemotron-3-ultra-550b-a55b:free",
2638
2664
  superMoE: "nvidia/nemotron-3-super-120b-a12b",
2639
2665
  llamaNemotron: "nvidia/llama-3.1-nemotron-70b-instruct",
2640
2666
  translation: "nvidia/riva-translate-4b-instruct-v2",
@@ -2660,7 +2686,7 @@ function getAIModel(options = {}) {
2660
2686
  apiKey,
2661
2687
  baseURL: options.baseURL || "https://integrate.api.nvidia.com/v1"
2662
2688
  });
2663
- return nvidia.chat(resolvedModelName || "nvidia/nemotron-3-ultra-550b-a55b");
2689
+ return nvidia.chat(resolvedModelName || "nvidia/nemotron-3-ultra-550b-a55b:free");
2664
2690
  }
2665
2691
  if (provider === "openrouter") {
2666
2692
  const apiKey = options.apiKey || process.env.OPENROUTER_API_KEY || process.env.OPENAI_API_KEY || "";
@@ -6325,7 +6351,7 @@ var ModelPolicyResolver = class {
6325
6351
  {
6326
6352
  provider: "nvidia",
6327
6353
  providerLabel: "NVIDIA NIM API",
6328
- modelName: "nvidia/nemotron-3-ultra-550b-a55b",
6354
+ modelName: "nvidia/nemotron-3-ultra-550b-a55b:free",
6329
6355
  maxTokens: 32768,
6330
6356
  temperature: 0.15,
6331
6357
  reasoningEffort: "high",
@@ -6750,7 +6776,7 @@ var PROVIDER_ENDPOINTS = {
6750
6776
  alibaba: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions",
6751
6777
  nvidia: "https://integrate.api.nvidia.com/v1/chat/completions"
6752
6778
  };
6753
- var NVIDIA_DEFAULT_MODEL = "nvidia/nemotron-3-ultra-550b-a55b";
6779
+ var NVIDIA_DEFAULT_MODEL = "nvidia/nemotron-3-ultra-550b-a55b:free";
6754
6780
  function resolveProviderRoute(options) {
6755
6781
  const openrouterKey = options.openrouterKey?.trim() || (typeof process !== "undefined" ? process.env.OPENROUTER_API_KEY || "" : "");
6756
6782
  const deepseekKey = options.deepseekKey?.trim() || (typeof process !== "undefined" ? process.env.DEEPSEEK_API_KEY || "" : "");
@@ -13547,7 +13573,7 @@ async function streamLLMWithFallback(systemPrompt, userPrompt, apiKeys = {}, onC
13547
13573
  }
13548
13574
  if (nvidiaKey && isProviderEnabled("nvidia")) {
13549
13575
  const nemotronModels = [
13550
- "nvidia/nemotron-3-ultra-550b-a55b",
13576
+ "nvidia/nemotron-3-ultra-550b-a55b:free",
13551
13577
  "nvidia/nemotron-3.5-lightning-30b-a3b",
13552
13578
  "nvidia/nemotron-3-super-120b-a12b",
13553
13579
  "nvidia/llama-3.1-nemotron-70b-instruct"
@@ -13724,11 +13750,12 @@ ${targetLayer === 1 ? `
13724
13750
  - Field 5 (id: 'entryBridge', type: 'single_choice'): Recommended prerequisite baseline & bridge mechanism for ${targetAge}.
13725
13751
  ` : targetLayer === 2 ? `
13726
13752
  - Layer 2 MUST focus on Teaching Framework, Persona & Lab Logistics (Methodology & Content Style baseline).
13727
- - Field 1 (id: 'pedagogy', type: 'single_choice'): Core pedagogical model (PBL, EDP, 5E, Hybrid 5E+PBL) with pros/cons analyzed in descriptions.
13728
- - Field 2 (id: 'voiceAndTone', type: 'single_choice'): Persona & Teaching Voice (CONTENT_STYLE_GUIDE: Encouraging Mentor vs Industry Engineer vs Storyteller Guide vs Socratic Facilitator).
13729
- - Field 3 (id: 'classDynamic', type: 'single_choice'): Class structure & Kit ratio (1:1 Individual, 2:1 Pair Programming, 3-4 Project Team).
13730
- - Field 4 (id: 'hardwareDeployment', type: 'single_choice'): Lab logistics deployment (Lab kits provided, BYOD, Cloud simulator, Take-home kit).
13731
- - Field 5 (id: 'teacherRole', type: 'single_choice'): Teacher role and instructional modality (Teacher-led step-by-step vs Facilitator vs Mentor).
13753
+ - Field 1 (id: 'lessonPacingModel', type: 'single_choice'): Lesson pacing model (e.g. 1 Session = 1 Independent Lesson vs Multi-session Thematic Units vs Hybrid Modular) with pedagogical pros/cons matching course duration.
13754
+ - Field 2 (id: 'pedagogy', type: 'single_choice'): Core pedagogical model (PBL, EDP, 5E, Hybrid 5E+PBL) with pros/cons analyzed in descriptions.
13755
+ - Field 3 (id: 'voiceAndTone', type: 'single_choice'): Persona & Teaching Voice (CONTENT_STYLE_GUIDE: Encouraging Mentor vs Industry Engineer vs Storyteller Guide vs Socratic Facilitator).
13756
+ - Field 4 (id: 'classDynamic', type: 'single_choice'): Class structure & Kit ratio (1:1 Individual, 2:1 Pair Programming, 3-4 Project Team).
13757
+ - Field 5 (id: 'hardwareDeployment', type: 'single_choice'): Lab logistics deployment (Lab kits provided, BYOD, Cloud simulator, Take-home kit).
13758
+ - Field 6 (id: 'teacherRole', type: 'single_choice'): Teacher role and instructional modality (Teacher-led step-by-step vs Facilitator vs Mentor).
13732
13759
  ` : `
13733
13760
  - Layer 3 MUST focus on Concrete Execution, Art Direction & Packaging (Now that user confirmed Pedagogy '${pedagogy}').
13734
13761
  - Field 1 (id: 'capstoneTheme', type: 'textarea'): Detailed Capstone product theme designed strictly around confirmed '${pedagogy}' model and '${exitVision}'.