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