@thanh01.pmt/curriculum-kit 1.4.43 → 1.4.45

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 (121) hide show
  1. package/dist/ai/index.cjs +66 -470
  2. package/dist/ai/index.cjs.map +1 -1
  3. package/dist/ai/index.d.cts +77 -77
  4. package/dist/ai/index.d.ts +77 -77
  5. package/dist/ai/index.mjs +64 -469
  6. package/dist/ai/index.mjs.map +1 -1
  7. package/dist/index.cjs +478 -837
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +124 -58
  10. package/dist/index.d.ts +124 -58
  11. package/dist/index.mjs +470 -829
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/pipeline/index.cjs +99 -484
  14. package/dist/pipeline/index.cjs.map +1 -1
  15. package/dist/pipeline/index.mjs +97 -483
  16. package/dist/pipeline/index.mjs.map +1 -1
  17. package/dist/schemas/index.d.cts +1064 -1064
  18. package/dist/schemas/index.d.ts +1064 -1064
  19. package/dist/standards/index.d.cts +2 -2
  20. package/dist/standards/index.d.ts +2 -2
  21. package/dist/{standardsCoverageGate-49pJq5t8.d.cts → standardsCoverageGate-CLnq0d0s.d.cts} +12 -12
  22. package/dist/{standardsCoverageGate-49pJq5t8.d.ts → standardsCoverageGate-CLnq0d0s.d.ts} +12 -12
  23. package/dist/templates/ACT_template.md +18 -9
  24. package/dist/templates/ALIGNMENT_MATRIX_template.md +5 -0
  25. package/dist/templates/ART_DIRECTION_template.md +7 -0
  26. package/dist/templates/ASSET_MANIFEST_template.md +5 -0
  27. package/dist/templates/BASELINE_STANDARD.md +5 -0
  28. package/dist/templates/BELL_RINGER_template.md +13 -13
  29. package/dist/templates/CHANGELOG_template.md +3 -0
  30. package/dist/templates/CHOICE_BOARD_template.md +8 -5
  31. package/dist/templates/CODE_template.md +5 -6
  32. package/dist/templates/CONTENT_CONTINUITY_template.md +6 -0
  33. package/dist/templates/CONTENT_STYLE_GUIDE_template.md +4 -5
  34. package/dist/templates/CURRICULUM_FRAMEWORK_template.md +5 -6
  35. package/dist/templates/DEPENDENCY_MAP_template.md +3 -4
  36. package/dist/templates/EXIT_TICKET_template.md +8 -8
  37. package/dist/templates/EXT_template.md +3 -0
  38. package/dist/templates/GLOSSARY_template.md +1 -2
  39. package/dist/templates/GRAPHIC_ORGANIZER_template.md +8 -8
  40. package/dist/templates/GUIDE_template.md +5 -6
  41. package/dist/templates/HANDOUT_template.md +5 -6
  42. package/dist/templates/HANDOVER_DOCUMENT_template.md +8 -0
  43. package/dist/templates/KNOWLEDGE_EXPOSITION_template.md +16 -6
  44. package/dist/templates/LAB_TEMPLATE.md +78 -0
  45. package/dist/templates/LEARNER_PROFILE_template.md +4 -5
  46. package/dist/templates/LESSONS_LEARNED_template.md +8 -0
  47. package/dist/templates/LESSON_5E_template.md +24 -9
  48. package/dist/templates/LESSON_EDP_template.md +26 -10
  49. package/dist/templates/LESSON_GENERAL_template.md +22 -8
  50. package/dist/templates/OUTPUT_CONSTRAINTS_template.md +7 -0
  51. package/dist/templates/PACKAGING_SPEC_template.md +8 -0
  52. package/dist/templates/PILOT_FEEDBACK_template.md +6 -0
  53. package/dist/templates/PROJECT_BRIEF_template.md +8 -0
  54. package/dist/templates/PROJECT_STATUS_template.md +9 -0
  55. package/dist/templates/QUIZ_template.md +7 -0
  56. package/dist/templates/QUIZ_v4.6_template.md +4 -5
  57. package/dist/templates/REFERENCE_PACK_template.md +4 -0
  58. package/dist/templates/REVIEW_GAME_template.md +11 -8
  59. package/dist/templates/RUBRIC_template.md +2 -3
  60. package/dist/templates/SCIENCE_LAB_template.md +11 -5
  61. package/dist/templates/SECTION_LANGUAGE_CONTRACT_template.md +44 -0
  62. package/dist/templates/SELF_LAB_template.md +174 -0
  63. package/dist/templates/SLIDE_template.md +23 -0
  64. package/dist/templates/STATION_ROTATION_template.md +11 -11
  65. package/dist/templates/TASK_CARDS_template.md +8 -8
  66. package/dist/templates/TIERED_PRACTICE_template.md +14 -10
  67. package/dist/templates/UPDATE_ROADMAP_template.md +7 -0
  68. package/dist/templates/WKS_template.md +5 -6
  69. package/dist/workflow/index.cjs +250 -672
  70. package/dist/workflow/index.cjs.map +1 -1
  71. package/dist/workflow/index.d.cts +1 -1
  72. package/dist/workflow/index.d.ts +1 -1
  73. package/dist/workflow/index.mjs +248 -670
  74. package/dist/workflow/index.mjs.map +1 -1
  75. package/docs/refs/templates/ACT_template.md +18 -9
  76. package/docs/refs/templates/ALIGNMENT_MATRIX_template.md +5 -0
  77. package/docs/refs/templates/ART_DIRECTION_template.md +7 -0
  78. package/docs/refs/templates/ASSET_MANIFEST_template.md +5 -0
  79. package/docs/refs/templates/BASELINE_STANDARD.md +5 -0
  80. package/docs/refs/templates/BELL_RINGER_template.md +13 -13
  81. package/docs/refs/templates/CHANGELOG_template.md +3 -0
  82. package/docs/refs/templates/CHOICE_BOARD_template.md +8 -5
  83. package/docs/refs/templates/CODE_template.md +5 -6
  84. package/docs/refs/templates/CONTENT_CONTINUITY_template.md +6 -0
  85. package/docs/refs/templates/CONTENT_STYLE_GUIDE_template.md +4 -5
  86. package/docs/refs/templates/CURRICULUM_FRAMEWORK_template.md +5 -6
  87. package/docs/refs/templates/DEPENDENCY_MAP_template.md +3 -4
  88. package/docs/refs/templates/EXIT_TICKET_template.md +8 -8
  89. package/docs/refs/templates/EXT_template.md +3 -0
  90. package/docs/refs/templates/GLOSSARY_template.md +1 -2
  91. package/docs/refs/templates/GRAPHIC_ORGANIZER_template.md +8 -8
  92. package/docs/refs/templates/GUIDE_template.md +5 -6
  93. package/docs/refs/templates/HANDOUT_template.md +5 -6
  94. package/docs/refs/templates/HANDOVER_DOCUMENT_template.md +8 -0
  95. package/docs/refs/templates/KNOWLEDGE_EXPOSITION_template.md +16 -6
  96. package/docs/refs/templates/LAB_TEMPLATE.md +78 -0
  97. package/docs/refs/templates/LEARNER_PROFILE_template.md +4 -5
  98. package/docs/refs/templates/LESSONS_LEARNED_template.md +8 -0
  99. package/docs/refs/templates/LESSON_5E_template.md +24 -9
  100. package/docs/refs/templates/LESSON_EDP_template.md +26 -10
  101. package/docs/refs/templates/LESSON_GENERAL_template.md +22 -8
  102. package/docs/refs/templates/OUTPUT_CONSTRAINTS_template.md +7 -0
  103. package/docs/refs/templates/PACKAGING_SPEC_template.md +8 -0
  104. package/docs/refs/templates/PILOT_FEEDBACK_template.md +6 -0
  105. package/docs/refs/templates/PROJECT_BRIEF_template.md +8 -0
  106. package/docs/refs/templates/PROJECT_STATUS_template.md +9 -0
  107. package/docs/refs/templates/QUIZ_template.md +7 -0
  108. package/docs/refs/templates/QUIZ_v4.6_template.md +4 -5
  109. package/docs/refs/templates/REFERENCE_PACK_template.md +4 -0
  110. package/docs/refs/templates/REVIEW_GAME_template.md +11 -8
  111. package/docs/refs/templates/RUBRIC_template.md +2 -3
  112. package/docs/refs/templates/SCIENCE_LAB_template.md +11 -5
  113. package/docs/refs/templates/SECTION_LANGUAGE_CONTRACT_template.md +44 -0
  114. package/docs/refs/templates/SELF_LAB_template.md +174 -0
  115. package/docs/refs/templates/SLIDE_template.md +23 -0
  116. package/docs/refs/templates/STATION_ROTATION_template.md +11 -11
  117. package/docs/refs/templates/TASK_CARDS_template.md +8 -8
  118. package/docs/refs/templates/TIERED_PRACTICE_template.md +14 -10
  119. package/docs/refs/templates/UPDATE_ROADMAP_template.md +7 -0
  120. package/docs/refs/templates/WKS_template.md +5 -6
  121. package/package.json +1 -1
package/dist/ai/index.cjs CHANGED
@@ -3,14 +3,16 @@
3
3
  var google = require('@ai-sdk/google');
4
4
  var openai = require('@ai-sdk/openai');
5
5
  var deepseek = require('@ai-sdk/deepseek');
6
- var fs = require('fs');
6
+ var fs2 = require('fs');
7
7
  var path = require('path');
8
+ var url = require('url');
8
9
  var ai = require('ai');
9
10
  var zod = require('zod');
10
11
 
12
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
11
13
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
14
 
13
- var fs__default = /*#__PURE__*/_interopDefault(fs);
15
+ var fs2__default = /*#__PURE__*/_interopDefault(fs2);
14
16
  var path__default = /*#__PURE__*/_interopDefault(path);
15
17
 
16
18
  // src/ai/provider-factory.ts
@@ -133,8 +135,8 @@ function resolveApiKey(keyName, explicitKey) {
133
135
  path__default.default.resolve(currentDir, "../..", ".env")
134
136
  ];
135
137
  for (const envPath of envPaths) {
136
- if (fs__default.default.existsSync(envPath)) {
137
- const content = fs__default.default.readFileSync(envPath, "utf-8");
138
+ if (fs2__default.default.existsSync(envPath)) {
139
+ const content = fs2__default.default.readFileSync(envPath, "utf-8");
138
140
  for (const line of content.split("\n")) {
139
141
  const trimmed = line.trim();
140
142
  if (trimmed && !trimmed.startsWith("#") && trimmed.startsWith(keyName + "=")) {
@@ -1114,467 +1116,61 @@ function detectDefaultProvider() {
1114
1116
  }
1115
1117
  return getDesignatedFallbackConfig().provider;
1116
1118
  }
1117
-
1118
- // src/templates/lessonTemplate.ts
1119
- var LESSON_PLAN_TEMPLATE = `
1120
- ---
1121
- id: "{{ID}}"
1122
- title: "{{TITLE}}"
1123
- type: "LESSON_5E"
1124
- created_by: "Curriculum OS Builder"
1125
- phase: "{{PHASE}}"
1126
- deliverable: "P3-T1"
1127
- version: "{{VERSION}}"
1128
- date: "{{DATE}}"
1129
- prerequisite: []
1130
- template_contract: "lesson-plan-v2"
1131
- template_required_sections:
1132
- - "A. Lesson Design Plan"
1133
- - "Learning Objectives & Evidence"
1134
- - "Activity Sequence"
1135
- - "Resource Map"
1136
- - "Assessment Map"
1137
- - "Artifact Contract"
1138
- - "B. Lesson Flow"
1139
- ---
1140
- <!-- INJECT_BODY -->
1141
-
1142
- # LESSON [{{LESSON_ID}}]: {{TITLE}} (5E Model)
1143
-
1144
- ## [REQUIRED] A. Lesson Design Plan
1145
-
1146
- ### 1. Learning Objectives & Evidence
1147
- - **Estimated Duration:** {{DURATION}}
1148
- - **Materials & Equipment:** {{MATERIALS_SUMMARY}}
1149
- - **Keywords / Core Concepts:** {{KEYWORDS}}
1150
-
1151
- | LO | Objective (Bloom's) | Student Evidence | Success Criteria |
1152
- |---|---|---|---|
1153
- {{LEARNING_OBJECTIVES_TABLE_ROWS}}
1154
-
1155
- ### 2. Activity Sequence
1156
- > This is the canonical activity contract. Satellite artifacts must expand this sequence and must not invent a different one.
1157
-
1158
- | Seq | 5E Phase | Activity Type | Actor | Purpose | Student Action | Teacher Move | Output/Evidence | LO | Time | Artifact Contract |
1159
- |---|---|---|---|---|---|---|---|---|---|---|
1160
- {{ACTIVITY_SEQUENCE_TABLE_ROWS}}
1161
-
1162
- ### 3. Resource Map
1163
- | Resource | Used In Activity | Purpose | Owner Artifact |
1164
- |---|---|---|---|
1165
- {{RESOURCE_MAP_TABLE_ROWS}}
1166
-
1167
- ### 4. Assessment Map
1168
- | Evidence | Assessed By | Criteria | Follow-up If Missing |
1169
- |---|---|---|---|
1170
- {{ASSESSMENT_MAP_TABLE_ROWS}}
1171
-
1172
- ### 5. Artifact Contract
1173
- - **ACT must expand:** {{ACT_CONTRACT}}
1174
- - **GUIDE must support:** {{GUIDE_CONTRACT}}
1175
- - **SLIDE must visualize:** {{SLIDE_CONTRACT}}
1176
- - **HANDOUT must provide:** {{HANDOUT_CONTRACT}}
1177
- - **WKS must practice:** {{WKS_CONTRACT}}
1178
- - **QUIZ must assess:** {{QUIZ_CONTRACT}}
1179
- - **EXT must extend:** {{EXT_CONTRACT}}
1180
-
1181
- ---
1182
-
1183
- ## [REQUIRED] B. Lesson Flow
1184
-
1185
- ### 1. ENGAGE \u2014 {{ENGAGE_DURATION}} mins
1186
- - **Hook Scenario:** {{HOOK_SCENARIO}}
1187
- - **Open Question:** {{HOOK_OPEN_QUESTION}}
1188
- - **Transition:** {{HOOK_TRANSITION}}
1189
-
1190
- ### 2. EXPLORE \u2014 {{EXPLORE_DURATION}} mins
1191
- - **Activity Reference:** {{EXPLORE_ACTIVITY_REF}}
1192
- - **Student Discovery:** {{EXPLORE_STUDENT_DISCOVERY}}
1193
-
1194
- ### 3. EXPLAIN \u2014 {{EXPLAIN_DURATION}} mins
1195
- - **Definitions:**
1196
- {{EXPLAIN_DEFINITIONS}}
1197
- - **Visual Illustration (REQUIRED):**
1198
- {{EXPLAIN_VISUAL_ILLUSTRATION}}
1199
-
1200
- ### 4. ELABORATE \u2014 {{ELABORATE_DURATION}} mins
1201
- - **Tiered Scaffolding:**
1202
- - \u{1F949} **Bronze:** {{DIFFERENTIATION_BRONZE}}
1203
- - \u{1F948} **Silver:** {{DIFFERENTIATION_SILVER}}
1204
- - \u{1F947} **Gold:** {{DIFFERENTIATION_GOLD}}
1205
-
1206
- > **ACT Contract**: Detailed operational instructions must expand the Activity Sequence above and must not change the planned evidence target.
1207
-
1208
- ### 5. EVALUATE \u2014 {{EVALUATE_DURATION}} mins
1209
- - **Exit Ticket:** {{EXIT_TICKET_CONTENT}}
1210
- - **Closing:** {{CLOSING_REMARKS}}
1211
-
1212
- > **QUIZ Contract**: Detailed assessment criteria and rubrics must assess the evidence and success criteria defined in the Lesson Design Plan.
1213
-
1214
- ---
1215
-
1216
- ## [OPTIONAL] Teacher Notes
1217
- - **Common Pitfalls:**
1218
- {{COMMON_PITFALLS}}
1219
- - **Troubleshooting:**
1220
- {{TROUBLESHOOTING_ROWS}}
1221
-
1222
- ---
1223
-
1224
- ## [REQUIRED] Artifact Linkage (Master Index)
1225
- > List all satellite files used in this lesson.
1226
-
1227
- | Artifact File | Role in the Classroom | When to Use |
1228
- |---|---|---|
1229
- | \`GUIDE_{{LESSON_ID}}.md\` | Detailed Teaching Script | Teacher preparation |
1230
- | \`SLIDE_{{LESSON_ID}}.md\` | Presentation Content | Throughout the session |
1231
- | \`HANDOUT_{{LESSON_ID}}.md\` | Theory Summary for Students | During EXPLAIN phase |
1232
- | \`ACT_{{LESSON_ID}}.md\` | Detailed Learning Activity Operations | During EXPLORE / ELABORATE / checkpoint phases |
1233
- | \`WKS_{{LESSON_ID}}.md\` | Individual Worksheet | Wrap-up or Homework |
1234
- | \`QUIZ_{{LESSON_ID}}.md\` | Assessment Rubric | During EVALUATE phase |
1235
- | \`EXT_{{LESSON_ID}}.md\` | Enrichment Materials | For "Gold" students |
1236
- `.trim();
1237
-
1238
- // src/templates/actTemplate.ts
1239
- var ACT_TEMPLATE = `
1240
- ---
1241
- id: "{{ID}}"
1242
- title: "{{TITLE}}"
1243
- type: "ACT"
1244
- created_by: "Curriculum OS Builder"
1245
- phase: "{{PHASE}}"
1246
- deliverable: "P3-T2"
1247
- version: "{{VERSION}}"
1248
- date: "{{DATE}}"
1249
- template_contract: "artifact-template-v1"
1250
- template_required_sections:
1251
- - "Computational Thinking Focus"
1252
- - "Materials & Setup"
1253
- - "Constraints & Safety"
1254
- - "Active Learning Workflow"
1255
- - "3-Tier Differentiation"
1256
- - "Reflection"
1257
- ---
1258
- <!-- INJECT_BODY -->
1259
-
1260
- # INQUIRY-BASED ACTIVITY: {{TITLE}}
1261
- _Milestone: {{MILESTONE_ID}} | Module: {{MODULE_NAME}} | Lesson: {{LESSON_ID}}_
1262
-
1263
- ## [REQUIRED] Computational Thinking Focus
1264
- - **Problem Statement (Real-world Scenario):** {{PROBLEM_STATEMENT}}
1265
- - **Decomposition:**
1266
- {{DECOMPOSITION_STEPS}}
1267
- - **Algorithm Design:** {{ALGORITHM_DESIGN}}
1268
-
1269
- ## [REQUIRED] Materials & Setup
1270
- - **Reference Material:** Students should use the **HANDOUT** for this lesson as their primary technical reference (lifeline).
1271
- - **Hardware/Software:**
1272
- <!-- [HARDWARE_BOM] -->
1273
- {{HARDWARE_ITEMS}}
1274
- <!-- [/HARDWARE_BOM] -->
1275
- - **Software:** {{SOFTWARE_ITEMS}}
1276
- - **Consumables:** {{CONSUMABLES}}
1277
- - **Other Resources:** {{OTHER_RESOURCES}}
1278
-
1279
- ## [REQUIRED] Constraints & Safety
1280
- - \u26A0\uFE0F **Technical/Safety:** {{SAFETY_WARNING}}
1281
- - \u{1F4A1} **Design Constraint:** {{DESIGN_CONSTRAINT}}
1282
-
1283
- ## [REQUIRED] Active Learning Workflow
1284
-
1285
- ### Phase 1: Planning & Design \u2014 {{PHASE1_DURATION}} mins
1286
- - **Student Task:** Hand-draw (or draft in words) the algorithm flowchart or connection architecture before touching the computer/devices.
1287
- - **Teacher Action:** Walk around to check the logic of each group. Ask inquiry questions:
1288
- {{PHASE1_INQUIRY_QUESTIONS}}
1289
-
1290
- ### Phase 2: Implementation & Discovery \u2014 {{PHASE2_DURATION}} mins
1291
- - **Student Task:** Apply the knowledge from the **HANDOUT** to realize the plan designed in Phase 1. Encourage self-inquiry and documentation lookup.
1292
- - **Teacher Action:** Avoid "hand-holding." Only intervene if a group has been stuck for more than 5 minutes.
1293
- {{PHASE2_GUIDANCE_BLOCK}}
1294
-
1295
- ### Phase 3: Debugging & Testing \u2014 {{PHASE3_DURATION}} mins
1296
- - **Testing:** Students run their system.
1297
- - **Error Analysis:** Ask students to record any error codes or unexpected behaviors and compare them with the Troubleshooting table in the Handout.
1298
- {{PHASE3_TESTING_STEPS}}
1299
-
1300
- ## [REQUIRED] 3-Tier Differentiation
1301
- > MUST design tasks in 3 tiers to support diverse learner groups. Bronze is the minimum requirement for all students.
1302
- - \u{1F949} **Bronze (Foundational):** {{DIFFERENTIATION_BRONZE}}
1303
- - \u{1F948} **Silver (Application):** {{DIFFERENTIATION_SILVER}}
1304
- - \u{1F947} **Gold (Enrichment/Creative):** {{DIFFERENTIATION_GOLD}}
1305
-
1306
- ## [REQUIRED] Reflection
1307
- - **Discussion Question:** {{REFLECTION_QUESTION}}
1308
- `.trim();
1309
-
1310
- // src/templates/codeLabTemplate.ts
1311
- var CODE_LAB_TEMPLATE = `
1312
- ---
1313
- id: "{{ID}}"
1314
- title: "{{TITLE}}"
1315
- type: "LAB"
1316
- created_by: "Curriculum OS Builder"
1317
- phase: "{{PHASE}}"
1318
- deliverable: "P3-T2"
1319
- version: "{{VERSION}}"
1320
- date: "{{DATE}}"
1321
- ---
1322
- <!-- INJECT_BODY -->
1323
-
1324
- # \u{1F468}\u200D\u{1F4BB} CODE LAB: {{TITLE}}
1325
- _Milestone: {{MILESTONE_ID}} | Tech Stack: {{TECH_STACK}}_
1326
-
1327
- ## \u{1F3AF} Overview
1328
- This lab focuses on the practical implementation of core technical concepts, bridging theory into working, robust, and testable code.
1329
-
1330
- ## \u{1F6E0}\uFE0F Environment & Setup
1331
- - **Language / Framework:** {{LANGUAGE_FRAMEWORK}}
1332
- - **IDE / Editor:** {{IDE_EDITOR}}
1333
- - **Required Libraries:** {{REQUIRED_LIBRARIES}}
1334
- - **Hardware / Connection Setup:** {{HARDWARE_ENV_CONNECTION}}
1335
-
1336
- ## \u{1F4DD} Lab Tasks (3-Tier Differentiation)
1337
-
1338
- ### \u{1F949} Bronze (Foundational) \u2014 {{BRONZE_MINS}} mins
1339
- **Objective:** {{BRONZE_OBJECTIVE}}
1340
- - **Task:** {{BRONZE_TASK}}
1341
- - **Requirement:** {{BRONZE_REQUIREMENT}}
1342
-
1343
- ### \u{1F948} Silver (Application) \u2014 {{SILVER_MINS}} mins
1344
- **Objective:** {{SILVER_OBJECTIVE}}
1345
- - **Task:** {{SILVER_TASK}}
1346
- - **Requirement:** {{SILVER_REQUIREMENT}}
1347
-
1348
- ### \u{1F947} Gold (Enrichment/Creative) \u2014 {{GOLD_MINS}} mins
1349
- **Objective:** {{GOLD_OBJECTIVE}}
1350
- - **Task:** {{GOLD_TASK}}
1351
- - **Requirement:** {{GOLD_REQUIREMENT}}
1352
-
1353
- ## \u{1F4BB} Technical Reference ([SME_MANDATE])
1354
- <!-- [SME_MANDATE] -->
1355
- > Any code provided in this section is verified for syntax accuracy and runtime execution.
1356
-
1357
- ### Starter Code Template
1358
- \`\`\`{{CODE_LANGUAGE}}
1359
- {{STARTER_CODE}}
1360
- \`\`\`
1361
-
1362
- ### Solution Code
1363
- \`\`\`{{CODE_LANGUAGE}}
1364
- {{SOLUTION_CODE}}
1365
- \`\`\`
1366
- <!-- [/SME_MANDATE] -->
1367
-
1368
- ## \u{1F50D} Troubleshooting & Debugging Matrix
1369
- | Issue | Potential Cause | Solution |
1370
- | :--- | :--- | :--- |
1371
- {{TROUBLESHOOTING_ROWS}}
1372
-
1373
- ## \u{1F3C1} Submission & Verification Checklist
1374
- {{CHECKLIST_ITEMS}}
1375
- `.trim();
1376
-
1377
- // src/templates/quizTemplate.ts
1378
- var QUIZ_TEMPLATE = `
1379
- ---
1380
- id: "{{ID}}"
1381
- title: "{{TITLE}}"
1382
- type: "QUIZ"
1383
- language: "{{LANGUAGE}}"
1384
- total_questions: {{TOTAL_QUESTIONS}}
1385
- passing_score_pct: {{PASSING_SCORE_PCT}}
1386
- ---
1387
-
1388
- # \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
1389
-
1390
- > \u23F1\uFE0F **Recommended Time:** ~10-15 mins
1391
- > \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
1392
- > \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
1393
-
1394
- ---
1395
-
1396
- {{QUESTIONS_SECTION}}
1397
-
1398
- ---
1399
-
1400
- ## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
1401
- <details>
1402
- <summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
1403
-
1404
- {{ANSWER_KEY_SECTION}}
1405
- </details>
1406
- `.trim();
1407
-
1408
- // src/templates/selfLabTemplate.ts
1409
- var SELF_LAB_TEMPLATE = `
1410
- ---
1411
- id: "{{ID}}"
1412
- title: "{{TITLE}}"
1413
- type: "SELF_LAB"
1414
- language: "{{LANGUAGE}}"
1415
- difficulty: "{{DIFFICULTY}}"
1416
- estimated_minutes: {{ESTIMATED_MINUTES}}
1417
- tech_stack: {{TECH_STACK}}
1418
- ---
1419
-
1420
- # \u{1F680} Self-Paced Hands-On Lab: {{TITLE}}
1421
-
1422
- > \u23F1\uFE0F **Estimated Duration:** ~{{ESTIMATED_MINUTES}} mins
1423
- > \u{1F3AF} **Difficulty Level:** {{DIFFICULTY_UPPER}}
1424
- > \u{1F9F0} **Tech Stack:** {{TECH_STACK_STR}}
1425
- > \u{1F4A1} **Self-Learner Notice:** You are in full control of this lab. Follow the progressive challenges below. If you get stuck at any point, use the **Progressive Hints System** to get unstuck without ruining the learning experience!
1426
-
1427
- ---
1428
-
1429
- ## \u{1F4CB} Mission Briefing & Environment Setup
1430
- {{MISSION_BRIEFING}}
1431
-
1432
- ### \u{1F6EB} Preflight Checklist
1433
- {{PREFLIGHT_CHECKLIST}}
1434
-
1435
- ---
1436
-
1437
- ## \u{1F3AF} Progressive Challenges (3-Tier Differentiation)
1438
-
1439
- ### \u{1F949} Challenge 1: Foundational Core (Bronze) \u2014 ~{{BRONZE_MINS}} mins
1440
- **Objective:** {{BRONZE_OBJECTIVE}}
1441
-
1442
- #### Tasks & Implementation Details:
1443
- {{BRONZE_TASKS}}
1444
-
1445
- #### \u{1F9EA} Self-Verification Command:
1446
- \`\`\`bash
1447
- {{BRONZE_VERIFY_COMMAND}}
1448
- \`\`\`
1449
- *Expected Terminal Output:*
1450
- \`\`\`text
1451
- {{BRONZE_EXPECTED_OUTPUT}}
1452
- \`\`\`
1453
-
1454
- #### \u{1F4A1} Progressive Hints (Expand only if stuck):
1455
- <details>
1456
- <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
1457
-
1458
- {{BRONZE_HINT_1}}
1459
- </details>
1460
-
1461
- <details>
1462
- <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
1463
-
1464
- \`\`\`{{CODE_LANGUAGE}}
1465
- {{BRONZE_HINT_2}}
1466
- \`\`\`
1467
- </details>
1468
-
1469
- <details>
1470
- <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
1471
-
1472
- \`\`\`{{CODE_LANGUAGE}}
1473
- {{BRONZE_HINT_3_CODE}}
1474
- \`\`\`
1475
-
1476
- **Why this solution works:**
1477
- {{BRONZE_HINT_3_EXPLANATION}}
1478
- </details>
1479
-
1480
- ---
1481
-
1482
- ### \u{1F948} Challenge 2: Logic & Error Handling (Silver) \u2014 ~{{SILVER_MINS}} mins
1483
- **Objective:** {{SILVER_OBJECTIVE}}
1484
-
1485
- #### Tasks & Implementation Details:
1486
- {{SILVER_TASKS}}
1487
-
1488
- #### \u{1F9EA} Self-Verification Command:
1489
- \`\`\`bash
1490
- {{SILVER_VERIFY_COMMAND}}
1491
- \`\`\`
1492
- *Expected Terminal Output:*
1493
- \`\`\`text
1494
- {{SILVER_EXPECTED_OUTPUT}}
1495
- \`\`\`
1496
-
1497
- #### \u{1F4A1} Progressive Hints (Expand only if stuck):
1498
- <details>
1499
- <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
1500
-
1501
- {{SILVER_HINT_1}}
1502
- </details>
1503
-
1504
- <details>
1505
- <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
1506
-
1507
- \`\`\`{{CODE_LANGUAGE}}
1508
- {{SILVER_HINT_2}}
1509
- \`\`\`
1510
- </details>
1511
-
1512
- <details>
1513
- <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
1514
-
1515
- \`\`\`{{CODE_LANGUAGE}}
1516
- {{SILVER_HINT_3_CODE}}
1517
- \`\`\`
1518
-
1519
- **Why this solution works:**
1520
- {{SILVER_HINT_3_EXPLANATION}}
1521
- </details>
1522
-
1523
- ---
1524
-
1525
- ### \u{1F947} Challenge 3: Edge Cases & Optimization (Gold) \u2014 ~{{GOLD_MINS}} mins
1526
- **Objective:** {{GOLD_OBJECTIVE}}
1527
-
1528
- #### Tasks & Implementation Details:
1529
- {{GOLD_TASKS}}
1530
-
1531
- #### \u{1F9EA} Self-Verification Command:
1532
- \`\`\`bash
1533
- {{GOLD_VERIFY_COMMAND}}
1534
- \`\`\`
1535
- *Expected Terminal Output:*
1536
- \`\`\`text
1537
- {{GOLD_EXPECTED_OUTPUT}}
1538
- \`\`\`
1539
-
1540
- #### \u{1F4A1} Progressive Hints (Expand only if stuck):
1541
- <details>
1542
- <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
1543
-
1544
- {{GOLD_HINT_1}}
1545
- </details>
1546
-
1547
- <details>
1548
- <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
1549
-
1550
- \`\`\`{{CODE_LANGUAGE}}
1551
- {{GOLD_HINT_2}}
1552
- \`\`\`
1553
- </details>
1554
-
1555
- <details>
1556
- <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
1557
-
1558
- \`\`\`{{CODE_LANGUAGE}}
1559
- {{GOLD_HINT_3_CODE}}
1560
- \`\`\`
1561
-
1562
- **Why this solution works:**
1563
- {{GOLD_HINT_3_EXPLANATION}}
1564
- </details>
1565
-
1566
- ---
1567
-
1568
- ## \u{1F50D} Self-Learner Troubleshooting Matrix
1569
- | Symptom / Error Message | Root Cause | Exact Fix |
1570
- | :--- | :--- | :--- |
1571
- {{TROUBLESHOOTING_ROWS}}
1572
-
1573
- ---
1574
-
1575
- ## \u{1F3C1} Final Lab Submission & Mastery Checklist
1576
- {{FINAL_CHECKLIST}}
1577
- `.trim();
1119
+ function stripTemplateFrontmatter(raw) {
1120
+ let body = raw;
1121
+ if (body.startsWith("---")) {
1122
+ const end = body.indexOf("\n---", 3);
1123
+ if (end !== -1) body = body.slice(end + 4);
1124
+ }
1125
+ return body.split("\n").filter((l) => l.trim() !== "<!-- INJECT_BODY -->").join("\n").replace(/^\s*\n/, "").trimEnd();
1126
+ }
1127
+ var KIT_TEMPLATE_FALLBACK_DIRS = [
1128
+ // Packaged with the npm bundle (dist/templates) — resolves from node_modules.
1129
+ "templates",
1130
+ // Repo checkout layouts.
1131
+ "docs/refs/templates"
1132
+ ];
1133
+ var _moduleDir = (() => {
1134
+ try {
1135
+ if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) }) !== "undefined" && typeof (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) === "string") {
1136
+ return path__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
1137
+ }
1138
+ } catch {
1139
+ }
1140
+ return typeof __dirname !== "undefined" ? __dirname : process.cwd();
1141
+ })();
1142
+ function candidateDirs(explicitDir) {
1143
+ const dirs = [];
1144
+ if (process.env.CURRICULUM_TEMPLATES_DIR) dirs.push(process.env.CURRICULUM_TEMPLATES_DIR);
1145
+ dirs.push(path__default.default.resolve(process.cwd(), "_templates"));
1146
+ for (const rel of KIT_TEMPLATE_FALLBACK_DIRS) {
1147
+ dirs.push(path__default.default.resolve(_moduleDir, rel));
1148
+ dirs.push(path__default.default.resolve(process.cwd(), rel));
1149
+ dirs.push(path__default.default.resolve(process.cwd(), "packages/curriculum-kit", rel));
1150
+ }
1151
+ return dirs;
1152
+ }
1153
+ function findTemplatePath(templateName, explicitDir) {
1154
+ for (const dir of candidateDirs()) {
1155
+ const p = path__default.default.join(dir, templateName);
1156
+ if (!fs2__default.default.existsSync(p)) continue;
1157
+ try {
1158
+ fs2__default.default.accessSync(p, fs2__default.default.constants.R_OK);
1159
+ return p;
1160
+ } catch {
1161
+ }
1162
+ }
1163
+ return null;
1164
+ }
1165
+ function loadAuthoringTemplate(templateName, templatesDir) {
1166
+ const p = findTemplatePath(templateName);
1167
+ if (!p) return "";
1168
+ try {
1169
+ return stripTemplateFrontmatter(fs2__default.default.readFileSync(p, "utf-8"));
1170
+ } catch {
1171
+ return "";
1172
+ }
1173
+ }
1578
1174
 
1579
1175
  // src/ai/prompts/lessonMasterPrompt.ts
1580
1176
  function buildLessonMasterPrompt(input) {
@@ -1628,7 +1224,7 @@ Build a deep, rigorous, and highly pedagogical Master Lesson Plan (LESSON) that
1628
1224
  # MANDATORY TEMPLATE STRUCTURE
1629
1225
  You MUST generate structured data that will render directly into this exact Markdown template:
1630
1226
  ---
1631
- ${LESSON_PLAN_TEMPLATE}
1227
+ ${loadAuthoringTemplate("LESSON_5E_template.md") ?? "[TEMPLATE FILE NOT FOUND: LESSON_5E_template.md]"}
1632
1228
  ---
1633
1229
 
1634
1230
  # INPUT PARAMETERS
@@ -1706,7 +1302,7 @@ Transform the exact pedagogical flow and activities from the Master Lesson Plan
1706
1302
  # MANDATORY TEMPLATE STRUCTURE
1707
1303
  You MUST generate data aligned with this Markdown template:
1708
1304
  ---
1709
- ${ACT_TEMPLATE}
1305
+ ${loadAuthoringTemplate("ACT_template.md") ?? "[TEMPLATE FILE NOT FOUND: ACT_template.md]"}
1710
1306
  ---
1711
1307
 
1712
1308
  # CANONICAL MASTER LESSON CONTEXT (SOURCE OF TRUTH)
@@ -1801,7 +1397,7 @@ Generate complete, verified source code that satisfies the lesson objectives and
1801
1397
  # MANDATORY TEMPLATE STRUCTURE
1802
1398
  You MUST generate data aligned with this Markdown template:
1803
1399
  ---
1804
- ${CODE_LAB_TEMPLATE}
1400
+ ${loadAuthoringTemplate("LAB_TEMPLATE.md") ?? "[TEMPLATE FILE NOT FOUND: LAB_TEMPLATE.md]"}
1805
1401
  ---
1806
1402
 
1807
1403
  # CANONICAL LESSON CONTEXT (SOURCE OF TRUTH)
@@ -2496,7 +2092,7 @@ Build a complete, engaging Self-Paced Hands-On Lab (SELF_LAB) for autonomous lea
2496
2092
  # MANDATORY TEMPLATE STRUCTURE
2497
2093
  You MUST generate data aligned with this Markdown template:
2498
2094
  ---
2499
- ${SELF_LAB_TEMPLATE}
2095
+ ${loadAuthoringTemplate("SELF_LAB_template.md") ?? "[TEMPLATE FILE NOT FOUND: SELF_LAB_template.md]"}
2500
2096
  ---
2501
2097
 
2502
2098
  # INPUT PARAMETERS
@@ -2633,7 +2229,7 @@ Use this mapping to determine which Bloom level each question truly targets. Mat
2633
2229
  # MANDATORY TEMPLATE STRUCTURE
2634
2230
  You MUST generate data aligned with this Markdown template:
2635
2231
  ---
2636
- ${QUIZ_TEMPLATE}
2232
+ ${loadAuthoringTemplate("QUIZ_v4.6_template.md") ?? "[TEMPLATE FILE NOT FOUND: QUIZ_v4.6_template.md]"}
2637
2233
  ---
2638
2234
 
2639
2235
  # INPUT PARAMETERS