@thanh01.pmt/curriculum-kit 1.0.11 → 1.0.12

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.mjs CHANGED
@@ -13712,6 +13712,68 @@ Return concise JSON matching:
13712
13712
  }
13713
13713
  return parsedResearch;
13714
13714
  }
13715
+ var CONTEXT_KEY_LABELS = {
13716
+ domain: "Domain",
13717
+ customDomain: "Custom Domain",
13718
+ context: "Educational Context (Tier)",
13719
+ contextLabel: "Educational Context",
13720
+ customContext: "Custom Educational Context",
13721
+ targetAgeTier: "Target Age Tier",
13722
+ targetAge: "Target Age & Audience",
13723
+ customAge: "Custom Age Group",
13724
+ courseDurationTier: "Course Duration Tier",
13725
+ courseDuration: "Planned Course Duration",
13726
+ customDuration: "Custom Course Duration",
13727
+ hardwareReadinessTier: "Hardware Readiness Tier",
13728
+ hardwareReadiness: "Hardware & Tool Readiness",
13729
+ customHardware: "Custom Hardware Setup",
13730
+ language: "Artifact Output Language",
13731
+ totalWeeks: "Total Weeks",
13732
+ sessionsPerWeek: "Sessions Per Week",
13733
+ sessionDurationMinutes: "Session Duration (minutes)",
13734
+ totalSessions: "Total Sessions",
13735
+ isConsecutiveSessions: "Consecutive (Block) Sessions",
13736
+ projectName: "Course Title",
13737
+ projectCode: "Project Identifier",
13738
+ courseDescription: "Idea Description"
13739
+ };
13740
+ var STRUCTURED_PROMPT_KEYS = /* @__PURE__ */ new Set([
13741
+ "projectName",
13742
+ "projectCode",
13743
+ "courseDescription",
13744
+ "language",
13745
+ "primaryGoal",
13746
+ "exitVision",
13747
+ "cognitiveDepth",
13748
+ "valueAndCertification",
13749
+ "entryBridge",
13750
+ "pedagogy",
13751
+ "classDynamic",
13752
+ "hardwareDeployment",
13753
+ "teacherRole",
13754
+ "lessonPacingModel",
13755
+ "voiceAndTone"
13756
+ ]);
13757
+ function buildRemainingContextBlock(accumulatedData) {
13758
+ const lines = [];
13759
+ for (const [key, rawVal] of Object.entries(accumulatedData)) {
13760
+ if (STRUCTURED_PROMPT_KEYS.has(key)) continue;
13761
+ if (rawVal === void 0 || rawVal === null || rawVal === "") continue;
13762
+ if (key.endsWith("_ids") || key.endsWith("_id")) continue;
13763
+ const label = CONTEXT_KEY_LABELS[key] || key.replace(/([A-Z])/g, " $1").replace(/_/g, " ").replace(/^./, (c) => c.toUpperCase()).trim();
13764
+ let valueStr;
13765
+ if (Array.isArray(rawVal)) {
13766
+ valueStr = rawVal.map((v) => typeof v === "object" ? JSON.stringify(v) : String(v)).join("; ");
13767
+ } else if (typeof rawVal === "object") {
13768
+ valueStr = JSON.stringify(rawVal);
13769
+ } else {
13770
+ valueStr = String(rawVal);
13771
+ }
13772
+ if (!valueStr.trim()) continue;
13773
+ lines.push(`- ${label}: ${valueStr}`);
13774
+ }
13775
+ return lines.join("\n");
13776
+ }
13715
13777
  async function streamLayerPrefillWithFallback(options, onChunk) {
13716
13778
  const { action = "prefill", targetLayer = 1, accumulatedData = {}, apiKeys = {} } = options;
13717
13779
  if (action === "research") {
@@ -13722,26 +13784,21 @@ async function streamLayerPrefillWithFallback(options, onChunk) {
13722
13784
  projectName = "Curriculum Course",
13723
13785
  projectCode = "curriculum-course",
13724
13786
  courseDescription = "",
13725
- domain = "tech",
13726
- context = "center",
13727
- contextLabel = "STEM Academy",
13728
13787
  targetAgeTier = "secondary",
13729
13788
  targetAge = "Secondary (Ages 11-15 / Grades 6-9)",
13730
13789
  courseDurationTier = "standard",
13731
13790
  courseDuration = "Standard Course (16-24 sessions / 24-36 hours)",
13732
- hardwareReadinessTier = "none_budget",
13733
- hardwareReadiness = "No dedicated hardware (Plug-and-play simulator or economical kit)",
13734
13791
  primaryGoal = "",
13735
13792
  exitVision = "",
13736
13793
  valueAndCertification = "",
13737
- coreLearningOutcomes = "",
13794
+ entryBridge = "",
13738
13795
  pedagogy = "5E Instructional Model",
13739
- capstoneTheme = "",
13740
- teacherProfile = "Facilitator / STEM Teacher",
13741
- instructionalModality = "Teacher-led step-by-step",
13742
- cognitiveDepth = "Apply",
13743
- budgetOrExistingSpecs = "",
13744
- cognitiveScaffolding = ""
13796
+ lessonPacingModel = "",
13797
+ voiceAndTone = "",
13798
+ classDynamic = "",
13799
+ hardwareDeployment = "",
13800
+ teacherRole = "",
13801
+ cognitiveDepth = "Apply"
13745
13802
  } = accumulatedData;
13746
13803
  const language = typeof options.language === "string" && options.language ? options.language : typeof accumulatedData.language === "string" && accumulatedData.language ? accumulatedData.language : "vi";
13747
13804
  const textLangMandate = language === "vi" ? "natural, fluent Vietnamese (Ti\u1EBFng Vi\u1EC7t)" : language === "en" ? "natural, fluent English" : `natural, fluent ${language}`;
@@ -13777,7 +13834,7 @@ ${targetLayer === 1 ? `
13777
13834
  - Field 2 (id: 'brandingAndTone', type: 'single_choice'): Art Direction & Visual Mood (ART_DIRECTION: Future Maker Lab high-contrast vs Clean Minimalist Studio vs Gamified Playful).
13778
13835
  - Field 3 (id: 'differentiationStrategy', type: 'single_choice'): Differentiation & Scaffolding Strategy (CONTENT_STYLE_GUIDE: Tier 1/2/3 Bronze/Silver/Gold + EXT Challenges vs Open-ended Rubric Studio).
13779
13836
  - Field 4 (id: 'cognitiveScaffolding', type: 'textarea'): Concrete scaffolding methods (Starter Code, color-coded breadboards, 4-step debug poster, simulator preview).
13780
- - Field 5 (id: 'recommendedToolchain', type: 'single_choice'): 3 concrete toolchain/IDE options matching '${hardwareReadiness}'.
13837
+ - Field 5 (id: 'recommendedToolchain', type: 'single_choice'): 3 concrete toolchain/IDE options matching the confirmed Hardware & Tool Readiness from FULL ACCUMULATED CONTEXT.
13781
13838
  - Field 6 (id: 'artifactScope', type: 'multi_choice'): Deliverable artifacts (LESSON mandatory + ACT, QUIZ, SLIDE, WKS, HANDOUT, GUIDE, CODE).
13782
13839
  - Field 7 (id: 'assessmentStrategy', type: 'single_choice'): Grading weights (e.g. 40% Formative Process + 60% Capstone Rubric).
13783
13840
  `}
@@ -13807,10 +13864,8 @@ RETURN STRICT VALID JSON ONLY adhering exactly to this format:
13807
13864
  - Course Title: "${projectName}"
13808
13865
  - Project Identifier: "${projectCode}"
13809
13866
  - Idea Description: "${courseDescription}"
13810
- - Target Age & Audience: ${targetAge} (Tier: ${targetAgeTier})
13811
- - Planned Course Duration: ${courseDuration} (Tier: ${courseDurationTier})
13812
- - Hardware & Tool Readiness: ${hardwareReadiness} (Tier: ${hardwareReadinessTier})
13813
- - Educational Context: ${contextLabel || context} | Domain: ${domain}
13867
+ - Target Age & Audience: ${targetAge}
13868
+ - Planned Course Duration: ${courseDuration}
13814
13869
 
13815
13870
  ${targetLayer >= 2 ? `
13816
13871
  APPROVED PARAMETERS FROM LAYER 1 (STRATEGIC INTENT & OUTCOMES):
@@ -13818,17 +13873,23 @@ APPROVED PARAMETERS FROM LAYER 1 (STRATEGIC INTENT & OUTCOMES):
13818
13873
  - Competency Exit Vision: "${exitVision}"
13819
13874
  - Target Cognitive Depth: "${cognitiveDepth}"
13820
13875
  - Value & Recognition: "${valueAndCertification}"
13876
+ - Prerequisite Entry Bridge: "${entryBridge}"
13821
13877
  ` : ""}
13822
13878
 
13823
13879
  ${targetLayer >= 3 ? `
13824
13880
  APPROVED PARAMETERS FROM LAYER 2 (PEDAGOGY & LOGISTICS):
13825
- - Selected Pedagogy Model: ${pedagogy}
13826
- - Class Dynamics / Hardware Ratio: ${accumulatedData.classDynamic || "1:1 Individual"}
13827
- - Lab Deployment Mode: ${accumulatedData.hardwareDeployment || "Lab provided"}
13828
- - Instructional Role: ${accumulatedData.teacherRole || "Teacher-led"}
13881
+ - Lesson Pacing Model: "${lessonPacingModel}"
13882
+ - Selected Pedagogy Model: "${pedagogy}"
13883
+ - Voice & Tone: "${voiceAndTone}"
13884
+ - Class Dynamics / Hardware Ratio: "${classDynamic}"
13885
+ - Lab Deployment Mode: "${hardwareDeployment}"
13886
+ - Instructional Role: "${teacherRole}"
13829
13887
  ` : ""}
13830
13888
 
13831
- REQUIREMENT: Synthesize all parameters above and produce the high-fidelity pre-fill configuration for LAYER ${targetLayer}.`;
13889
+ FULL ACCUMULATED CONTEXT (ALL CONFIRMED PARAMETERS FROM EVERY PREVIOUS STEP \u2014 user decisions, organization/instructor/template profiles, schedules and constraints; every line below MUST be honored in your output):
13890
+ ${buildRemainingContextBlock(accumulatedData) || "(no additional context)"}
13891
+
13892
+ REQUIREMENT: Synthesize ALL parameters above \u2014 every single line in FULL ACCUMULATED CONTEXT is a confirmed user decision or system constraint and MUST influence the generated configuration. Produce the high-fidelity pre-fill configuration for LAYER ${targetLayer}.`;
13832
13893
  let rawContent = "";
13833
13894
  await streamLLMWithFallback(
13834
13895
  systemPrompt,