@thanh01.pmt/curriculum-kit 1.4.42 → 1.4.44
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/ai/index.cjs +66 -470
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.mjs +64 -469
- package/dist/ai/index.mjs.map +1 -1
- package/dist/index.cjs +237 -688
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -31
- package/dist/index.d.ts +12 -31
- package/dist/index.mjs +235 -682
- package/dist/index.mjs.map +1 -1
- package/dist/pipeline/index.cjs +66 -470
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.mjs +64 -469
- package/dist/pipeline/index.mjs.map +1 -1
- package/dist/templates/LAB_TEMPLATE.md +61 -0
- package/dist/templates/SELF_LAB_template.md +167 -0
- package/dist/workflow/index.cjs +84 -528
- package/dist/workflow/index.cjs.map +1 -1
- package/dist/workflow/index.mjs +82 -526
- package/dist/workflow/index.mjs.map +1 -1
- package/docs/refs/templates/LAB_TEMPLATE.md +61 -0
- package/docs/refs/templates/SELF_LAB_template.md +167 -0
- 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
|
|
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
|
|
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 (
|
|
137
|
-
const content =
|
|
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
|
-
|
|
1119
|
-
|
|
1120
|
-
---
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
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
|
-
${
|
|
2232
|
+
${loadAuthoringTemplate("QUIZ_v4.6_template.md") ?? "[TEMPLATE FILE NOT FOUND: QUIZ_v4.6_template.md]"}
|
|
2637
2233
|
---
|
|
2638
2234
|
|
|
2639
2235
|
# INPUT PARAMETERS
|