@thanh01.pmt/curriculum-kit 1.0.2 → 1.0.4

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.
@@ -15,6 +15,11 @@ interface SingleArtifactRequest {
15
15
  targetAge?: string;
16
16
  scaffoldingLevel?: ScaffoldingLevel;
17
17
  hardwarePlatform?: string[];
18
+ gradeLevel?: string;
19
+ studentCount?: string;
20
+ language?: string;
21
+ extraContext?: string;
22
+ config?: Record<string, any>;
18
23
  contextSot?: {
19
24
  framework?: string;
20
25
  learnerProfile?: string;
@@ -44,7 +49,7 @@ interface SingleArtifactResult {
44
49
  /**
45
50
  * Maps artifact type to default canonical filename and responsible agent persona
46
51
  */
47
- declare function getArtifactMetadata(type: ArtifactType, lessonId?: string): {
52
+ declare function getArtifactMetadata(type: ArtifactType, lessonId?: string, pedagogy?: string): {
48
53
  filename: string;
49
54
  persona: string;
50
55
  templateFile: string;
@@ -15,6 +15,11 @@ interface SingleArtifactRequest {
15
15
  targetAge?: string;
16
16
  scaffoldingLevel?: ScaffoldingLevel;
17
17
  hardwarePlatform?: string[];
18
+ gradeLevel?: string;
19
+ studentCount?: string;
20
+ language?: string;
21
+ extraContext?: string;
22
+ config?: Record<string, any>;
18
23
  contextSot?: {
19
24
  framework?: string;
20
25
  learnerProfile?: string;
@@ -44,7 +49,7 @@ interface SingleArtifactResult {
44
49
  /**
45
50
  * Maps artifact type to default canonical filename and responsible agent persona
46
51
  */
47
- declare function getArtifactMetadata(type: ArtifactType, lessonId?: string): {
52
+ declare function getArtifactMetadata(type: ArtifactType, lessonId?: string, pedagogy?: string): {
48
53
  filename: string;
49
54
  persona: string;
50
55
  templateFile: string;
package/dist/index.cjs CHANGED
@@ -9340,12 +9340,14 @@ var __filename2 = typeof (typeof document === 'undefined' ? require('u' + 'rl').
9340
9340
  var _resolvedDir = __filename2 ? path3__default.default.dirname(__filename2) : typeof __dirname !== "undefined" ? __dirname : process.cwd();
9341
9341
  function loadCurriculumTemplate(templateName) {
9342
9342
  const candidatePaths = [
9343
- path3__default.default.resolve(process.cwd(), "_templates", templateName),
9343
+ path3__default.default.resolve("/Users/tonypham/MEGA/WebApp/WIP/learnwell-platform/packages/curriculum-kit/docs/refs/templates", templateName),
9344
9344
  path3__default.default.resolve(process.cwd(), "packages/curriculum-kit/docs/refs/templates", templateName),
9345
+ path3__default.default.resolve(process.cwd(), "_templates", templateName),
9345
9346
  path3__default.default.resolve(process.cwd(), "docs/refs/templates", templateName),
9346
9347
  path3__default.default.resolve(_resolvedDir, "../docs/refs/templates", templateName),
9347
9348
  path3__default.default.resolve(_resolvedDir, "../../docs/refs/templates", templateName),
9348
9349
  path3__default.default.resolve(_resolvedDir, "../../../docs/refs/templates", templateName),
9350
+ path3__default.default.resolve("/Users/tonypham/MEGA/WebApp/content-gen/the-ultimate-curriculum-agent-os/_templates", templateName),
9349
9351
  path3__default.default.resolve(_resolvedDir, "../../../../the-ultimate-curriculum-agent-os/_templates", templateName)
9350
9352
  ];
9351
9353
  for (const p of candidatePaths) {
@@ -10210,21 +10212,27 @@ footer: "Curriculum OS \u2022 ${lessonCode} (${pedagogyLabel})"
10210
10212
 
10211
10213
  MANDATORY 12-14 SLIDE MICRO-CYCLE STRUCTURE (Delimited by '---'):
10212
10214
  1. **Slide 1 [Title & Mission]:** ${lessonCode}: ${lessonTitle} + Real-world inquiry hook
10213
- 2. **Slide 2 [Agenda & Roadmap]:** Timing and milestone breakdown (${pedagogyLabel})
10214
- 3. **Slide 3 [Warm-Up / Prior Knowledge]:** Prerequisite recall and mental model activator
10215
- 4. **Slide 4 [High-Stakes Hook Scenario]:** Authentic engineering/domain crisis scenario
10216
- 5. **Slide 5 [Core Concept 1: Mental Model]:** Principle definition, core terminology, and analogy
10217
- 6. **Slide 6 [Architecture & Visual Flow]:** Clean Mermaid diagram (flowchart or sequenceDiagram)
10218
- 7. **Slide 7 [Core Concept 2: Syntax / Mechanism Anatomy]:** Breakdown of mechanics and key rules
10219
- 8. **Slide 8 [Executable Blueprint / Demonstration]:** Annotated runnable code or structured domain walkthrough
10220
- 9. **Slide 9 [Guided Practice: Try It Now]:** 3-5 minute active check (I Do -> We Do)
10221
- 10. **Slide 10 [Integrated Hands-On Lab]:** 3-tier differentiated challenge (Bronze / Silver / Gold)
10222
- 11. **Slide 11 [Traffic Light Checkpoint & Pitfalls]:** Formative self-check & top 2 student misconceptions
10223
- 12. **Slide 12 [Exit Ticket & Metacognition]:** Scenario-based check + 1 reflection question
10224
- 13. **Slide 13 [Summary & Next Steps]:** 3 core takeaways and preview of next milestone
10225
-
10226
- Rules:
10227
- - No empty slides or shallow bullet lists. Every slide must contain substantive pedagogical value, diagrams, or runnable snippets.
10215
+ 2. **Slide 2 [Agenda & Roadmap]:** Timing and milestone breakdown table (${pedagogyLabel})
10216
+ 3. **Slide 3 [Warm-Up / Prior Knowledge]:** 2-column recall + 60-second diagnostic challenge card
10217
+ 4. **Slide 4 [High-Stakes Hook Scenario]:** Authentic engineering/domain crisis card + dilemma constraint
10218
+ 5. **Slide 5 [Core Concept 1: Mental Model]:** Definition, intuitive everyday analogy, and golden rule card
10219
+ 6. **Slide 6 [Architecture & Visual Flow]:** Clean Mermaid diagram (flowchart or sequenceDiagram) + 3 flow steps
10220
+ 7. **Slide 7 [Core Concept 2: Syntax / Mechanism Anatomy]:** Side-by-side 6-10 lines runnable code + anatomy breakdown & syntax trap card
10221
+ 8. **Slide 8 [Guided Practice: Try It Now]:** 3-minute active desk task card with starter hint and success criteria
10222
+ 9. **Slide 9 [Integrated Hands-On Lab]:** 3-tier differentiated challenge cards (Bronze / Silver / Gold) + gotcha alert card
10223
+ 10. **Slide 10 [Traffic Light Checkpoint & Pitfalls]:** Formative self-check cards (\u{1F7E2}/\u{1F7E1}/\u{1F534}) & diagnostic test question
10224
+ 11. **Slide 11 [Exit Ticket & Metacognition]:** 2 scenario-based check questions + 1 metacognitive reflection prompt
10225
+ 12. **Slide 12 [Summary & Next Steps]:** 3 core golden rules + preview card of next upcoming milestone
10226
+
10227
+ Mandatory Canvas & Presentation Invariants:
10228
+ - A slide is an INTERACTIVE PROJECTION CANVAS, NOT a textbook! Absolutely NO dense paragraphs or walls of text.
10229
+ - Follow the 6x6 rule: Maximum 4-6 bullet points per slide, maximum 8-12 words per bullet.
10230
+ - Structure slides using \`<div class="columns"><div>...</div><div>...</div></div>\` and \`<div class="card">\`, \`<div class="card highlight">\`, \`<div class="card warning">\`, \`<div class="card success">\`.
10231
+ - MANDATORY PRESENTER NOTES ON EVERY SLIDE: Every slide MUST end with \`<!-- Presenter Notes: ... -->\` containing:
10232
+ * SCRIPT: 60-90s teacher talk track with intuitive analogies.
10233
+ * COLD CALL / CHECK: Specific diagnostic question to ask students.
10234
+ * SCAFFOLDING / GOTCHA: Guidance for students who get stuck.
10235
+ * PACING: Recommended minutes for the slide.
10228
10236
  - Output 100% valid Marp Markdown.`;
10229
10237
  const rawSlide = await runCurriculumAIInference(
10230
10238
  [{ role: "user", content: slidePrompt }],
@@ -10770,11 +10778,14 @@ async function produceBatchLessons(storage, projectId, lessonIds, options = {})
10770
10778
  // src/services/singleArtifactService.ts
10771
10779
  init_streamRunner();
10772
10780
  init_errors();
10773
- function getArtifactMetadata(type, lessonId) {
10781
+ function getArtifactMetadata(type, lessonId, pedagogy) {
10774
10782
  const id = lessonId || "ON_DEMAND";
10775
10783
  switch (type) {
10776
- case "lesson":
10777
- return { filename: `LESSON_${id}.md`, persona: "@content", templateFile: "LESSON_5E_template.md" };
10784
+ case "lesson": {
10785
+ const p = (pedagogy || "").toLowerCase();
10786
+ const templateFile = p === "edp" ? "LESSON_EDP_template.md" : p === "general" ? "LESSON_GENERAL_template.md" : "LESSON_5E_template.md";
10787
+ return { filename: `LESSON_${id}.md`, persona: "@content", templateFile };
10788
+ }
10778
10789
  case "slide":
10779
10790
  return { filename: `SLIDE_${id}.md`, persona: "@illustrator", templateFile: "SLIDE_template.md" };
10780
10791
  case "act":
@@ -10815,6 +10826,8 @@ function getArtifactMetadata(type, lessonId) {
10815
10826
  return { filename: `REVIEW_GAME_${id}.md`, persona: "@assessor", templateFile: "REVIEW_GAME_template.md" };
10816
10827
  case "graphic_organizer":
10817
10828
  return { filename: `GRAPHIC_ORGANIZER_${id}.md`, persona: "@illustrator", templateFile: "GRAPHIC_ORGANIZER_template.md" };
10829
+ default:
10830
+ return { filename: `ARTIFACT_${id}.md`, persona: "@content", templateFile: "LESSON_5E_template.md" };
10818
10831
  }
10819
10832
  }
10820
10833
  async function generateSingleArtifact(req) {
@@ -10827,24 +10840,50 @@ async function generateSingleArtifact(req) {
10827
10840
  targetAge = "14-18 years old (High School / Early College)",
10828
10841
  scaffoldingLevel = "balanced",
10829
10842
  hardwarePlatform = ["MacBook Lab (macOS 14+ / Swift 6)"],
10843
+ gradeLevel,
10844
+ studentCount,
10845
+ language = "Vietnamese",
10846
+ extraContext,
10847
+ config,
10830
10848
  contextSot = {},
10831
10849
  options = {},
10832
10850
  onChunk
10833
10851
  } = req;
10834
- const meta = getArtifactMetadata(artifactType, lessonId);
10835
- const templateContent = loadCurriculumTemplate(meta.templateFile);
10852
+ const meta = getArtifactMetadata(artifactType, lessonId, pedagogy || config?.pedagogicalModel);
10836
10853
  const displayTitle = lessonTitle || topic;
10854
+ const loadedTemplate = loadCurriculumTemplate(meta.templateFile);
10855
+ const templateContent = loadedTemplate || getDefaultFallbackTemplate(artifactType, displayTitle, lessonId || "ON_DEMAND");
10837
10856
  const hwStr = hardwarePlatform.join(", ");
10857
+ const selectedDevices = (config?.devices || (hardwarePlatform[0]?.toLowerCase().includes("paper") ? "paper-only" : "laptop")).toLowerCase();
10858
+ const isBilingual = language.toLowerCase().includes("bilingual") || language.toLowerCase().includes("song");
10859
+ const isVietnamese = !isBilingual && language.toLowerCase().includes("viet");
10860
+ const langRule = isBilingual ? `1. AUTHORING LANGUAGE: Bilingual (Vietnamese - English). Headings and core conceptual definitions should be presented in Vietnamese with English technical terms in parentheses. Explanations and instructional text are in Vietnamese. Key code terms, comments, and challenge summaries are presented bilingually.` : isVietnamese ? `1. AUTHORING LANGUAGE: Vietnamese for all instructional text, explanations, questions, rubrics, and presenter notes. Programming code, syntax keywords, and standard API identifiers remain in standard English (with Vietnamese explanation comments/notes).` : `1. AUTHORING LANGUAGE: 100% English (Plan C Canonical Specification).`;
10861
+ const isPaperOnly = selectedDevices === "paper-only" || hwStr.toLowerCase().includes("paper") || hwStr.toLowerCase().includes("print-ready");
10862
+ const deviceRule = isPaperOnly ? `
10863
+ - \u{1F4C4} PAPER-ONLY / NO-DEVICE ENVIRONMENT: The learning space has NO computers or screens. All exercises, worksheets, task cards, exit tickets, and code analyses MUST be 100% printable. Provide write-in blank boxes, printed code snippets with line numbers, tracing tables, and physical manipulative instructions.` : selectedDevices === "tablet" || selectedDevices === "smartphone" ? `
10864
+ - \u{1F4F1} MOBILE/TABLET ENVIRONMENT: Activities should be optimized for touch interfaces and mobile/tablet sandboxes (e.g. Swift Playgrounds, Web IDEs, tap/touch interactions).` : `
10865
+ - \u{1F4BB} LAPTOP/DESKTOP ENVIRONMENT: Full keyboard, terminal, multi-file code editing, and browser developer tooling are available.`;
10866
+ const classDynamicsRule = studentCount ? `
10867
+ - \u{1F465} CLASS SIZE LOGISTICS: Class has exactly ${studentCount} students. Structure group sizes, pair-programming pairs, station rotations, and material distribution to realistically accommodate ${studentCount} students without bottlenecks.` : "";
10868
+ const scaffoldingRule = scaffoldingLevel === "foundation" ? `
10869
+ - \u{1FA9C} FOUNDATION SCAFFOLDING: High instructional support. Provide step-by-step numbered breakdowns, concrete real-world analogies, hints for every problem, scaffolded starter code/fill-in-the-blanks, and frequent check-for-understanding prompts.` : scaffoldingLevel === "advanced" ? `
10870
+ - \u{1F680} ADVANCED CHALLENGE: Minimal scaffolding. Focus on deeper system architecture, edge case handling, computational complexity, performance optimization, and open-ended extension challenges.` : `
10871
+ - \u2696\uFE0F BALANCED SCAFFOLDING: Balanced approach combining structured teacher guidance with independent inquiry and problem solving.`;
10872
+ const extraContextRule = extraContext ? `
10873
+ - \u{1F3AF} CRITICAL USER INSTRUCTIONS (MANDATORY): "${extraContext}". You MUST directly reflect and satisfy every point of this user guidance in the generated artifact!` : "";
10874
+ const artifactSpecializedPrompt = getArtifactSpecializedInvariants(artifactType, {
10875
+ ...req,
10876
+ studentCount});
10838
10877
  const systemPrompt = `You are ${meta.persona}, an expert Curriculum & Pedagogical Specialist in the Curriculum OS Multi-Agent Team.
10839
10878
  Your task is to author a canonical, publication-grade learning artifact of type "${artifactType.toUpperCase()}".
10840
10879
 
10841
10880
  ### CORE OPERATIONAL INVARIANTS:
10842
- 1. AUTHORING LANGUAGE: 100% English (Plan C Canonical Specification).
10881
+ ${langRule}
10843
10882
  2. NON-MOCK CODE INVARIANT: Any code snippet provided MUST be 100% syntactically valid, idiomatic, and executable without placeholders or fake functions.
10844
10883
  3. PEDAGOGICAL GROUNDING: Strictly align with the ${pedagogy.toUpperCase()} model, Bloom's Revised Taxonomy, and IEEE/ACM CS2023 guidelines.
10845
- 4. SCAFFOLDING LEVEL: "${scaffoldingLevel.toUpperCase()}" (Foundation: High support & concrete analogies; Balanced: Application & problem solving; Advanced: Systems architecture & concurrency invariants).
10846
- 5. TARGET AUDIENCE: ${targetAge} on ${hwStr}.
10847
- 6. OUTPUT INTEGRITY: Output clean Markdown starting directly with YAML frontmatter. Do not wrap entire response in triple backticks.`;
10884
+ 4. SCAFFOLDING LEVEL: "${scaffoldingLevel.toUpperCase()}".${scaffoldingRule}
10885
+ 5. TARGET AUDIENCE: ${gradeLevel ? `Grade ${gradeLevel}, ` : ""}${targetAge} on ${hwStr}.${deviceRule}${classDynamicsRule}${extraContextRule}
10886
+ 6. OUTPUT INTEGRITY: Output clean Markdown starting directly with YAML frontmatter. Do not wrap entire response in triple backticks.${artifactSpecializedPrompt}`;
10848
10887
  const userPrompt = `### CONTEXT GROUND TRUTH:
10849
10888
  - Topic / Concept Domain: "${topic}"
10850
10889
  - Lesson ID: "${lessonId || "ON_DEMAND"}"
@@ -10852,7 +10891,13 @@ Your task is to author a canonical, publication-grade learning artifact of type
10852
10891
  - Pedagogy: "${pedagogy.toUpperCase()}"
10853
10892
  - Scaffolding Level: "${scaffoldingLevel}"
10854
10893
  - Hardware Environment: "${hwStr}"
10855
-
10894
+ ${gradeLevel ? `- Target Grade Level: "${gradeLevel}"
10895
+ ` : ""}${studentCount ? `- Class Size: "${studentCount} students"
10896
+ ` : ""}- Target Language: "${language}"
10897
+ ${selectedDevices ? `- Device Mode: "${selectedDevices}"
10898
+ ` : ""}${extraContext ? `- User Specific Guidance & Requirements: "${extraContext}"
10899
+ ` : ""}${config ? `- Full Task Config: ${JSON.stringify(config)}
10900
+ ` : ""}
10856
10901
  ${contextSot.framework ? `### SOT CURRICULUM FRAMEWORK:
10857
10902
  ${contextSot.framework.slice(0, 1500)}
10858
10903
  ` : ""}
@@ -10866,15 +10911,10 @@ ${contextSot.handout.slice(0, 1e3)}
10866
10911
  ### MANDATORY CANONICAL TEMPLATE CONTRACT:
10867
10912
  Use the following reference template structure as the exact specification:
10868
10913
 
10869
- ${templateContent || `---
10870
- id: "${lessonId || "ON_DEMAND"}"
10871
- title: "${displayTitle}"
10872
- type: "${artifactType.toUpperCase()}"
10873
- ---
10874
- # ${displayTitle}`}
10914
+ ${templateContent}
10875
10915
 
10876
10916
  ### TASK INSTRUCTION:
10877
- Generate the complete, thorough, production-grade "${artifactType.toUpperCase()}" artifact for "${displayTitle}". Ensure all [REQUIRED] sections are fully developed with realistic, detailed engineering content.`;
10917
+ Generate the complete, thorough, publication-grade "${artifactType.toUpperCase()}" artifact for "${displayTitle}". Ensure all [REQUIRED] sections are fully developed with realistic, detailed pedagogical and technical content. Strictly follow the specialized invariants for "${artifactType.toUpperCase()}".`;
10878
10918
  let accumulatedContent = "";
10879
10919
  let accumulatedThought = "";
10880
10920
  try {
@@ -10913,6 +10953,253 @@ Generate the complete, thorough, production-grade "${artifactType.toUpperCase()}
10913
10953
  });
10914
10954
  }
10915
10955
  }
10956
+ function getArtifactSpecializedInvariants(type, req) {
10957
+ const cfg = req.config || {};
10958
+ const isPaperOnly = cfg.devices === "paper-only" || req.hardwarePlatform?.some((h) => h.toLowerCase().includes("paper"));
10959
+ const studentCount = req.studentCount || "25";
10960
+ switch (type) {
10961
+ case "slide": {
10962
+ const slideCount = cfg.slideCount || 10;
10963
+ const presentationStyle = cfg.presentationStyle || "modern";
10964
+ const presentationDuration = cfg.presentationDuration || 45;
10965
+ const includeSpeakerNotes = cfg.includeSpeakerNotes !== false;
10966
+ return `
10967
+ ### \u{1F3AC} SLIDE PRESENTATION & MARP ARCHITECTURE INVARIANTS:
10968
+ 1. **SLIDE COUNT & TIMING TARGET**:
10969
+ - Generate EXACTLY ${slideCount} slides separated by \`---\` horizontal rules.
10970
+ - Pacing: Target total duration is ${presentationDuration} minutes (~${Math.round(Number(presentationDuration) / Number(slideCount))} mins per slide).
10971
+ - Visual Style: "${presentationStyle.toUpperCase()}". Maintain high visual clarity, contrasting accents, and executive polish.
10972
+ 2. **STRICT CONCISENESS & 6x6 RULE (ABSOLUTELY NO TEXT WALLS)**:
10973
+ - A slide is an INTERACTIVE PROJECTION CANVAS, NOT a textbook or lesson plan!
10974
+ - Maximum 4\u20136 bullet points per slide.
10975
+ - Maximum 8\u201312 words per bullet point. Forbid dense multi-sentence paragraphs on the slide surface.
10976
+ 3. **SPEAKER NOTES FOR ALL SPOKEN WORDS (<!-- Presenter Notes: ... -->)**:
10977
+ ${includeSpeakerNotes ? `- MANDATORY: Every single slide MUST contain structured presenter notes in \`<!-- Presenter Notes: ... -->\` at the bottom:
10978
+ - SCRIPT: 60-90s teacher talk track with intuitive analogies.
10979
+ - COLD CALL / CHECK: Diagnostic question to ask students.
10980
+ - SCAFFOLDING / GOTCHA: How to resolve student misconceptions.
10981
+ - PACING: Recommended minutes for the slide.` : "- Optional brief presenter notes."}
10982
+ 4. **2-COLUMN & CALLOUT CARD LAYOUTS**:
10983
+ - Use \`<div class="columns"><div>...</div><div>...</div></div>\` for comparisons, code vs. mechanics, or side-by-side tasks.
10984
+ - Use \`<div class="card">\`, \`<div class="card highlight">\`, \`<div class="card warning">\`, and \`<div class="card success">\` for scannable chunking.
10985
+ 5. **CLICK-TO-REVEAL SYSTEM**:
10986
+ - Use \`<!-- clicks -->\` before bulleted lists (\`<ul>\` or \`<ol>\`) for incremental click-to-reveal.
10987
+ - Use \`<!-- click -->\` before answers, code reveals, or key callouts.
10988
+ 6. **CONCISE CODE SNIPPETS**:
10989
+ - Maximum 6\u201310 lines of clean code per snippet with inline comments. Never paste whole files.
10990
+ 7. **MERMAID VISUALS**:
10991
+ - Use Mermaid flowcharts (\`graph TD\` or \`graph LR\`) or sequence diagrams for workflows and control loops.`;
10992
+ }
10993
+ case "tiered_practice": {
10994
+ const techStack = cfg.techStack || (req.hardwarePlatform?.[0] || "Modern Programming Language");
10995
+ const includeUnitTests = cfg.includeUnitTests !== false;
10996
+ return `
10997
+ ### \u{1FA9C} TIERED PRACTICE ARCHITECTURE INVARIANTS (3-TIER ADAPTIVE):
10998
+ - Target Technology Stack: "${techStack}"
10999
+ ${includeUnitTests ? "- Automated Testing: Include explicit executable Unit Tests / Assertions for verifying Bronze, Silver, and Gold tiers." : ""}
11000
+ 1. **3 EXPLICIT RIGOR TIERS**:
11001
+ - **\u{1F949} Tier 1 (Bronze / C\u01A1 b\u1EA3n)**: 70% starter boilerplate / 30% fill-in. Direct recall, scaffolded fill-in-the-blanks, single-concept recognition with starter hints.
11002
+ - **\u{1F948} Tier 2 (Silver / Ti\xEAu chu\u1EA9n)**: 30% starter boilerplate / 70% implementation. Independent multi-step problem solving, bug identification, synthesis of 2+ concepts.
11003
+ - **\u{1F947} Tier 3 (Gold / Th\u1EED th\xE1ch)**: 0% code / open architecture. Edge case handling, algorithmic optimization, open-ended architectural design or extension.
11004
+ 2. **COMPLETE WORKED SOLUTIONS & ANSWER KEYS**:
11005
+ - Provide step-by-step worked solutions for every problem across all 3 tiers.
11006
+ 3. **SELF-DIAGNOSTIC RUBRIC**:
11007
+ - Include a clear student rubric with criteria for when a student is ready to level up from Bronze \u2794 Silver \u2794 Gold.`;
11008
+ }
11009
+ case "exit_ticket": {
11010
+ const questionCount = cfg.questionCount || 3;
11011
+ const diagnosticFocus = cfg.diagnosticFocus || "misconceptions";
11012
+ return `
11013
+ ### \u{1F39F}\uFE0F EXIT TICKET ARCHITECTURE INVARIANTS:
11014
+ 1. **EXACTLY ${questionCount} TARGETED ITEMS (3\u20135 MINUTE DURATION)**:
11015
+ - Item 1: Quick diagnostic checking mastery of the core objective.
11016
+ - Item 2: Application with diagnostic trap focusing on: "${diagnosticFocus}".
11017
+ - Item 3: Metacognitive self-check (Confidence rating 1\u20135 + "Explain what is still fuzzy").
11018
+ 2. **TEACHER DIAGNOSTIC INTERVENTION GUIDE**:
11019
+ - Provide a quick lookup table: "If student chooses/writes X \u2794 Misconception is Y \u2794 Quick remedy is Z".${isPaperOnly ? "\n3. **PRINTABLE CUT-OUT FORMAT**: Include student name/date line and cut-border dashed line." : ""}`;
11020
+ }
11021
+ case "quiz": {
11022
+ const questionCount = cfg.questionCount || 5;
11023
+ const questionTypes = Array.isArray(cfg.questionTypes) ? cfg.questionTypes.join(", ") : cfg.questionTypes || "multiple_choice";
11024
+ const diagnosticFocus = cfg.diagnosticFocus || "balanced";
11025
+ return `
11026
+ ### \u{1F4DD} BLOOM-ALIGNED QUIZ ARCHITECTURE INVARIANTS:
11027
+ 1. **EXACTLY ${questionCount} QUESTIONS (${questionTypes.toUpperCase()})**:
11028
+ - Diagnostic emphasis: "${diagnosticFocus}".
11029
+ - 40% Remember/Understand (Conceptual foundations).
11030
+ - 40% Apply/Analyze (Bug finding, code tracing, scenario application).
11031
+ - 20% Evaluate/Create (Algorithmic reasoning, trade-off evaluation).
11032
+ 2. **HIGH-QUALITY DISTRACTORS WITH RATIONALE**:
11033
+ - For every multiple choice item, explain WHY each incorrect option is a plausible misconception and WHY the key is correct.
11034
+ 3. **COMPLETE ANSWER KEY & SCORING RUBRIC**:
11035
+ - Explicit point distribution, partial credit guidelines, and sample ideal answers for open-ended questions.`;
11036
+ }
11037
+ case "task_cards": {
11038
+ const cardCount = cfg.cardCount || 12;
11039
+ const cardUsage = cfg.cardUsage || "stations";
11040
+ return `
11041
+ ### \u{1F4CB} TASK CARDS ARCHITECTURE INVARIANTS:
11042
+ 1. **SET OF EXACTLY ${cardCount} NUMBERED CARDS (Optimized for ${cardUsage.toUpperCase()})**:
11043
+ - Clearly mark each card: Card # (1 to ${cardCount}), Difficulty (Foundation / Standard / Challenge), and Target Skill.
11044
+ 2. **STUDENT RECORDING SHEET (B\u1EA2NG GHI \u0110\xC1P \xC1N)**:
11045
+ - Include a structured printable grid where students record answers for Cards 1\u2013${cardCount}.
11046
+ 3. **TEACHER MASTER KEY**:
11047
+ - Quick reference key with verified answers and explanations.${isPaperOnly ? "\n4. **PRINT-READY CARD BORDERS**: Layout with clean visual borders ready for physical printing and cutting." : ""}`;
11048
+ }
11049
+ case "graphic_organizer": {
11050
+ const diagramType = cfg.diagramType || "concept_map";
11051
+ const includeFillIn = cfg.includeFillInExercise !== false;
11052
+ return `
11053
+ ### \u{1F4CA} GRAPHIC ORGANIZER ARCHITECTURE INVARIANTS:
11054
+ 1. **VISUAL MODEL TYPE: "${diagramType.toUpperCase()}"**:
11055
+ - Structure a clear cognitive thinking tool: Concept Map, Flowchart, Venn Diagram, Hierarchy Tree, or Cause-Effect Matrix.
11056
+ 2. **VALID MERMAID SYNTAX**:
11057
+ - Embed complete, 100% syntactically correct Mermaid diagrams showing the knowledge structure.
11058
+ 3. **ACTIVE STUDENT INTERACTION PROMPTS**:
11059
+ ${includeFillIn ? "- Include interactive fill-in-the-blank nodes and connection articulation challenges." : "- Include synthesis and reflection prompts based on the visual model."}`;
11060
+ }
11061
+ case "choice_board": {
11062
+ const gridSize = cfg.gridSize || "3x3";
11063
+ const completionRule = cfg.completionRule || "row_column_diagonal";
11064
+ return `
11065
+ ### \u{1F3AF} CHOICE BOARD ARCHITECTURE INVARIANTS (UDL ${gridSize.toUpperCase()} MATRIX):
11066
+ 1. **${gridSize.toUpperCase()} MENU (UDL MULTIPLE MEANS OF EXPRESSION)**:
11067
+ - Option tasks spanning practical coding, architectural diagrams, analytical writing, and real-world scenarios.
11068
+ 2. **COMPLETION CONTRACT: "${completionRule.toUpperCase()}"**:
11069
+ - Explicit rule (e.g. Tic-Tac-Toe 3-in-a-row/column/diagonal, or Point Bounty system).
11070
+ 3. **UNIFIED EVALUATION RUBRIC**:
11071
+ - Consistent grading criteria applicable across all task choices on the board.`;
11072
+ }
11073
+ case "station_rotation": {
11074
+ const stationCount = cfg.stationCount || 3;
11075
+ const stationDuration = cfg.stationDuration || 15;
11076
+ return `
11077
+ ### \u{1F504} STATION ROTATION ARCHITECTURE INVARIANTS:
11078
+ 1. **EXACTLY ${stationCount} STATIONS SCALED FOR ${studentCount} STUDENTS**:
11079
+ - Group size: ~${Math.ceil(Number(studentCount) / Number(stationCount)) || 7} students per group.
11080
+ - Distinct station roles: Teacher-Led Small Group, Independent Practical Lab, Collaborative / Unplugged Peer Challenge.
11081
+ 2. **TIMING & TRANSITIONS (${stationDuration} MINS/STATION)**:
11082
+ - ${stationDuration} minutes per station + 3-minute structured rotation protocol.
11083
+ 3. **STATION DELIVERABLES & ACCOUNTABILITY**:
11084
+ - Clear check-in deliverable required at each station to ensure on-task accountability.`;
11085
+ }
11086
+ case "act":
11087
+ case "codelab":
11088
+ case "science_lab": {
11089
+ const techStack = cfg.techStack || (req.hardwarePlatform?.[0] || "Modern Programming Language");
11090
+ const includeUnitTests = cfg.includeUnitTests !== false;
11091
+ return `
11092
+ ### \u{1F4BB} HANDS-ON LAB & CODE ACTIVITY ARCHITECTURE INVARIANTS:
11093
+ - Technology Stack: "${techStack}"
11094
+ ${includeUnitTests ? "- Unit Testing: Provide automated assertions or test runner checks." : ""}
11095
+ 1. **100% RUNNABLE CODE / RIGOROUS PROCEDURE**:
11096
+ - Absolutely no fake APIs, mock functions, or non-executable pseudocode.
11097
+ 2. **STRUCTURED LAB PHASES**:
11098
+ - Objective & Environmental Prerequisites.
11099
+ - Starter Skeleton Code with clear \`// TODO [Student Task]\` comments.
11100
+ - Step-by-step Guided Challenges (Level 1 \u2794 Level 2 \u2794 Level 3).
11101
+ - Automated Verification / Test Cases.
11102
+ - Complete Reference Solution with design explanation.`;
11103
+ }
11104
+ case "bell_ringer":
11105
+ return `
11106
+ ### \u{1F514} BELL RINGER ARCHITECTURE INVARIANTS (3\u20135 MIN WARM-UP):
11107
+ 1. **3 QUICK HOOK QUESTIONS**:
11108
+ - 2 rapid-fire recall questions activating previous knowledge.
11109
+ - 1 curiosity hook question bridging into today's core topic.
11110
+ 2. **60-SECOND TEACHER REVIEW KEY**:
11111
+ - Quick-glance answer key for instant whole-class review.`;
11112
+ case "review_game":
11113
+ return `
11114
+ ### \u{1F3AE} REVIEW GAME ARCHITECTURE INVARIANTS:
11115
+ 1. **GAMIFIED STRUCTURE**:
11116
+ - Jeopardy-style board (3\u20134 Categories x 3 Point Values: 100 / 200 / 300) OR 3-Round Interactive Trivia.
11117
+ 2. **CLEAR RULES & TEAM DYNAMICS**:
11118
+ - Team scoring rules, buzz-in protocol, and tie-breaker challenge.
11119
+ 3. **COMPLETE QUESTION & ANSWER DECK**:
11120
+ - Verified answers and point values for the host/teacher.`;
11121
+ case "guide": {
11122
+ const lessonDuration = cfg.lessonDuration || 90;
11123
+ return `
11124
+ ### \u{1F4D6} TEACHER GUIDE ARCHITECTURE INVARIANTS (${lessonDuration} MINS LESSON):
11125
+ 1. **MINUTE-BY-MINUTE PACING TIMELINE**:
11126
+ - Pacing broken down for ${lessonDuration} minutes (Hook, Modeling, Guided Practice, Independent Practice, Debrief).
11127
+ 2. **SOCRATIC QUESTIONS & PROMPTS**:
11128
+ - Cold-call questions with anticipated student misconceptions and remediation scripts.
11129
+ 3. **DIFFERENTIATION STRATEGIES**:
11130
+ - Specific adaptations for students needing support vs. high-flyers needing extension.`;
11131
+ }
11132
+ case "worksheet":
11133
+ case "handout":
11134
+ return `
11135
+ ### \u{1F4D1} WORKSHEET / HANDOUT ARCHITECTURE INVARIANTS:
11136
+ 1. **I DO \u2794 WE DO \u2794 YOU DO SCAFFOLDING**:
11137
+ - Part 1 (I Do): Fully worked and annotated example.
11138
+ - Part 2 (We Do): Guided problem with fill-in hints and scaffolding scaffolds.
11139
+ - Part 3 (You Do): Independent mastery challenge.
11140
+ 2. **SELF-CHECK RUBRIC**:
11141
+ - End-of-worksheet self-evaluation checklist.${isPaperOnly ? "\n3. **PRINTABLE WORKSPACES**: Include spacious, clean write-in boxes and workspace for calculations/code." : ""}`;
11142
+ case "rubric": {
11143
+ const rubricScale = cfg.rubricScale || "4_levels";
11144
+ return `
11145
+ ### \u{1F4CA} ANALYTIC RUBRIC ARCHITECTURE INVARIANTS (${rubricScale.toUpperCase()} SCALE):
11146
+ 1. **RIGOROUS PROFICIENCY LEVELS**:
11147
+ - 4 Proficiency Levels: Level 4 (Exemplary) | Level 3 (Proficient) | Level 2 (Developing) | Level 1 (Beginning).
11148
+ 2. **CONCRETE OBSERVABLE CRITERIA**:
11149
+ - Each cell MUST describe concrete, observable behavioral evidence, not vague words like "good" or "average".`;
11150
+ }
11151
+ case "glossary":
11152
+ return `
11153
+ ### \u{1F4DA} TECHNICAL GLOSSARY ARCHITECTURE INVARIANTS:
11154
+ 1. **COMPREHENSIVE TERM PROFILES**:
11155
+ - For every key term: Technical Definition, Real-world Analogy, Code Syntax Example, and Common Misconception.`;
11156
+ case "bom":
11157
+ return `
11158
+ ### \u{1F4E6} BILL OF MATERIALS (BOM) ARCHITECTURE INVARIANTS:
11159
+ 1. **CLASS-SCALED INVENTORY FOR ${studentCount} STUDENTS**:
11160
+ - Exact quantities calculated for ${studentCount} students.
11161
+ - Component specifications, estimated unit cost, and affordable alternatives.`;
11162
+ case "lesson": {
11163
+ const lessonDuration = cfg.lessonDuration || 90;
11164
+ const pedagogicalModel = cfg.pedagogicalModel || req.pedagogy || "5e";
11165
+ return `
11166
+ ### \u{1F393} CANONICAL LESSON PLAN INVARIANTS (${pedagogicalModel.toUpperCase()} MODEL, ${lessonDuration} MINS):
11167
+ 1. **A. LESSON DESIGN PLAN**:
11168
+ - Learning Objectives (Bloom-aligned) & Observable Student Evidence.
11169
+ - Activity Sequence mapping every phase with timing totaling ${lessonDuration} minutes.
11170
+ - Resource Map & Assessment Map with explicit Artifact Contracts.
11171
+ 2. **B. LESSON FLOW**:
11172
+ - Detailed teacher moves, student actions, scripted key questions, and check-for-understanding points for every activity phase.`;
11173
+ }
11174
+ default:
11175
+ return "";
11176
+ }
11177
+ }
11178
+ function getDefaultFallbackTemplate(type, title, id) {
11179
+ const upperType = type.toUpperCase();
11180
+ return `---
11181
+ id: "${id}"
11182
+ title: "${title}"
11183
+ type: "${upperType}"
11184
+ version: "1.0.0"
11185
+ date: "${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}"
11186
+ ---
11187
+
11188
+ # ${title}
11189
+
11190
+ ## 1. Overview & Learning Objectives
11191
+ <!-- [REQUIRED] State 2-3 measurable, Bloom-aligned learning objectives -->
11192
+
11193
+ ## 2. Core Pedagogical Content
11194
+ <!-- [REQUIRED] Provide the core educational substance, questions, problems, and diagrams -->
11195
+
11196
+ ## 3. Practice & Differentiation
11197
+ <!-- [REQUIRED] Tiered support, worked examples, and challenges -->
11198
+
11199
+ ## 4. Assessment & Answer Key
11200
+ <!-- [REQUIRED] Complete solutions, rubrics, and diagnostic teacher feedback -->
11201
+ `;
11202
+ }
10916
11203
 
10917
11204
  // src/services/projectCreationService.ts
10918
11205
  init_streamRunner();