@thanh01.pmt/curriculum-kit 1.4.41 → 1.4.43

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 (115) hide show
  1. package/dist/ai/index.cjs +31 -31
  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 +31 -31
  6. package/dist/ai/index.mjs.map +1 -1
  7. package/dist/index.cjs +301 -2034
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +100 -154
  10. package/dist/index.d.ts +100 -154
  11. package/dist/index.mjs +297 -2014
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/pipeline/index.cjs +31 -31
  14. package/dist/pipeline/index.cjs.map +1 -1
  15. package/dist/pipeline/index.mjs +31 -31
  16. package/dist/pipeline/index.mjs.map +1 -1
  17. package/dist/schemas/index.d.cts +1052 -1052
  18. package/dist/schemas/index.d.ts +1052 -1052
  19. package/dist/standards/index.d.cts +2 -2
  20. package/dist/standards/index.d.ts +2 -2
  21. package/dist/{standardsCoverageGate-CLnq0d0s.d.cts → standardsCoverageGate-49pJq5t8.d.cts} +12 -12
  22. package/dist/{standardsCoverageGate-CLnq0d0s.d.ts → standardsCoverageGate-49pJq5t8.d.ts} +12 -12
  23. package/dist/templates/ACT_template.md +58 -0
  24. package/dist/templates/ALIGNMENT_MATRIX_template.md +45 -0
  25. package/dist/templates/ART_DIRECTION_template.md +43 -0
  26. package/dist/templates/ASSET_MANIFEST_template.md +27 -0
  27. package/dist/templates/BASELINE_STANDARD.md +37 -0
  28. package/dist/templates/BELL_RINGER_template.md +108 -0
  29. package/dist/templates/CHANGELOG_template.md +19 -0
  30. package/dist/templates/CHOICE_BOARD_template.md +64 -0
  31. package/dist/templates/CODE_template.md +70 -0
  32. package/dist/templates/CONTENT_CONTINUITY_template.md +38 -0
  33. package/dist/templates/CONTENT_STYLE_GUIDE_template.md +49 -0
  34. package/dist/templates/CURRICULUM_FRAMEWORK_template.md +63 -0
  35. package/dist/templates/DEPENDENCY_MAP_template.md +65 -0
  36. package/dist/templates/EXIT_TICKET_template.md +85 -0
  37. package/dist/templates/EXT_template.md +35 -0
  38. package/dist/templates/GLOSSARY_template.md +108 -0
  39. package/dist/templates/GRAPHIC_ORGANIZER_template.md +100 -0
  40. package/dist/templates/GUIDE_template.md +56 -0
  41. package/dist/templates/HANDOUT_template.md +61 -0
  42. package/dist/templates/HANDOVER_DOCUMENT_template.md +69 -0
  43. package/dist/templates/KNOWLEDGE_EXPOSITION_template.md +56 -0
  44. package/dist/templates/LEARNER_PROFILE_template.md +51 -0
  45. package/dist/templates/LESSONS_LEARNED_template.md +49 -0
  46. package/dist/templates/LESSON_5E_template.md +127 -0
  47. package/dist/templates/LESSON_EDP_template.md +104 -0
  48. package/dist/templates/LESSON_GENERAL_template.md +117 -0
  49. package/dist/templates/OUTPUT_CONSTRAINTS_template.md +38 -0
  50. package/dist/templates/PACKAGING_SPEC_template.md +56 -0
  51. package/dist/templates/PILOT_FEEDBACK_template.md +49 -0
  52. package/dist/templates/PROJECT_BRIEF_template.md +45 -0
  53. package/dist/templates/PROJECT_STATUS_template.md +64 -0
  54. package/dist/templates/QUIZ_template.md +58 -0
  55. package/dist/templates/QUIZ_v4.6_template.md +65 -0
  56. package/dist/templates/REFERENCE_PACK_template.md +26 -0
  57. package/dist/templates/REVIEW_GAME_template.md +79 -0
  58. package/dist/templates/RUBRIC_template.md +54 -0
  59. package/dist/templates/SCIENCE_LAB_template.md +88 -0
  60. package/dist/templates/SLIDE_template.md +389 -0
  61. package/dist/templates/STATION_ROTATION_template.md +80 -0
  62. package/dist/templates/TASK_CARDS_template.md +111 -0
  63. package/dist/templates/TIERED_PRACTICE_template.md +114 -0
  64. package/dist/templates/UPDATE_ROADMAP_template.md +53 -0
  65. package/dist/templates/WKS_template.md +71 -0
  66. package/dist/workflow/index.cjs +99 -79
  67. package/dist/workflow/index.cjs.map +1 -1
  68. package/dist/workflow/index.d.cts +1 -1
  69. package/dist/workflow/index.d.ts +1 -1
  70. package/dist/workflow/index.mjs +97 -77
  71. package/dist/workflow/index.mjs.map +1 -1
  72. package/docs/refs/templates/ACT_template.md +58 -0
  73. package/docs/refs/templates/ALIGNMENT_MATRIX_template.md +45 -0
  74. package/docs/refs/templates/ART_DIRECTION_template.md +43 -0
  75. package/docs/refs/templates/ASSET_MANIFEST_template.md +27 -0
  76. package/docs/refs/templates/BASELINE_STANDARD.md +37 -0
  77. package/docs/refs/templates/BELL_RINGER_template.md +108 -0
  78. package/docs/refs/templates/CHANGELOG_template.md +19 -0
  79. package/docs/refs/templates/CHOICE_BOARD_template.md +64 -0
  80. package/docs/refs/templates/CODE_template.md +70 -0
  81. package/docs/refs/templates/CONTENT_CONTINUITY_template.md +38 -0
  82. package/docs/refs/templates/CONTENT_STYLE_GUIDE_template.md +49 -0
  83. package/docs/refs/templates/CURRICULUM_FRAMEWORK_template.md +63 -0
  84. package/docs/refs/templates/DEPENDENCY_MAP_template.md +65 -0
  85. package/docs/refs/templates/EXIT_TICKET_template.md +85 -0
  86. package/docs/refs/templates/EXT_template.md +35 -0
  87. package/docs/refs/templates/GLOSSARY_template.md +108 -0
  88. package/docs/refs/templates/GRAPHIC_ORGANIZER_template.md +100 -0
  89. package/docs/refs/templates/GUIDE_template.md +56 -0
  90. package/docs/refs/templates/HANDOUT_template.md +61 -0
  91. package/docs/refs/templates/HANDOVER_DOCUMENT_template.md +69 -0
  92. package/docs/refs/templates/KNOWLEDGE_EXPOSITION_template.md +56 -0
  93. package/docs/refs/templates/LEARNER_PROFILE_template.md +51 -0
  94. package/docs/refs/templates/LESSONS_LEARNED_template.md +49 -0
  95. package/docs/refs/templates/LESSON_5E_template.md +127 -0
  96. package/docs/refs/templates/LESSON_EDP_template.md +104 -0
  97. package/docs/refs/templates/LESSON_GENERAL_template.md +117 -0
  98. package/docs/refs/templates/OUTPUT_CONSTRAINTS_template.md +38 -0
  99. package/docs/refs/templates/PACKAGING_SPEC_template.md +56 -0
  100. package/docs/refs/templates/PILOT_FEEDBACK_template.md +49 -0
  101. package/docs/refs/templates/PROJECT_BRIEF_template.md +45 -0
  102. package/docs/refs/templates/PROJECT_STATUS_template.md +64 -0
  103. package/docs/refs/templates/QUIZ_template.md +58 -0
  104. package/docs/refs/templates/QUIZ_v4.6_template.md +65 -0
  105. package/docs/refs/templates/REFERENCE_PACK_template.md +26 -0
  106. package/docs/refs/templates/REVIEW_GAME_template.md +79 -0
  107. package/docs/refs/templates/RUBRIC_template.md +54 -0
  108. package/docs/refs/templates/SCIENCE_LAB_template.md +88 -0
  109. package/docs/refs/templates/SLIDE_template.md +389 -0
  110. package/docs/refs/templates/STATION_ROTATION_template.md +80 -0
  111. package/docs/refs/templates/TASK_CARDS_template.md +111 -0
  112. package/docs/refs/templates/TIERED_PRACTICE_template.md +114 -0
  113. package/docs/refs/templates/UPDATE_ROADMAP_template.md +53 -0
  114. package/docs/refs/templates/WKS_template.md +71 -0
  115. package/package.json +5 -3
@@ -0,0 +1,53 @@
1
+ ---
2
+ id: "{{ID}}"
3
+ title: "{{TITLE}}"
4
+ type: "UPDATE_ROADMAP"
5
+ created_by: "Curriculum OS Builder"
6
+ phase: "{{PHASE}}"
7
+ deliverable: "{{DELIVERABLE_CODE}}"
8
+ version: "{{VERSION}}"
9
+ date: "{{DATE}}"
10
+ ---
11
+
12
+ # CURRICULUM UPDATE ROADMAP
13
+
14
+ _Project: [Course Name / PRJ Code] | Current Version: v[1.0]_
15
+
16
+ ## 1. Update Triggers
17
+ _To avoid time-consuming minor updates, the team will only proceed with updates when the following conditions are met:_
18
+
19
+ - **[PATCH] Hotfix (Local Correction):**
20
+ - *Trigger:* Client reports bugs in code, dangerous/non-functional circuit diagrams, or severe typos.
21
+ - *SLA:* Handled within [X] working days.
22
+ - **[MINOR] Update v1.x (Pedagogical Refinement):**
23
+ - *Trigger:* Accumulated `PILOT_FEEDBACK` from at least [X] sessions, or after [Y] months of real-world implementation.
24
+ - *Scope:* Tone adjustment, example changes, activity swaps (No change to Learning Objectives).
25
+ - **[MAJOR] Update v2.x (Comprehensive Upgrade):**
26
+ - *Trigger:* Client renews contract for a new school year, major changes in national standards, or hardware/software upgrades (e.g., Scratch 3.0 to 4.0).
27
+ - *Scope:* Re-run process from Phase 1 (Learner Profile & Framework).
28
+
29
+ ---
30
+
31
+ ## 2. Planned Releases
32
+
33
+ ### 📌 Short-term: Update v1.1 (Post-Pilot)
34
+ - **Estimated Release:** [Month/Year, e.g., After Semester 1 ends]
35
+ - **Goal:** Patch difficulty gaps based on actual student feedback. Optimize practical timing.
36
+ - **Main Agent(s):** `@reviewer` (Feedback harvesting), `@content`, `@activity`.
37
+ - **Estimated Duration:** [X] days.
38
+
39
+ ### 📌 Long-term: Version v2.0 (Next Academic Year)
40
+ - **Estimated Release:** [Month/Year, e.g., Preparation for the next academic year]
41
+ - **Goal (Planned):**
42
+ - Upgrade platform from [Old Platform] to [New Platform].
43
+ - Add [X] new Modules on [AI/IoT/etc.].
44
+ - Expand target audience from [Grade X] to [Grade Y].
45
+ - **Main Agent(s):** `@analyst` and `@designer` to rework the Framework.
46
+ - **Estimated Duration:** [X] weeks.
47
+
48
+ ---
49
+
50
+ ## 3. Resources & Archiving
51
+ - The current version (v[1.0]) will be permanently archived at: `_snapshots/S2_v1.0_delivered_[DATE]/`.
52
+ - Clients using v1.0 can continue usage without mandatory upgrades unless hardware requirements change.
53
+ - All change histories are tracked in `CHANGELOG.md`.
@@ -0,0 +1,71 @@
1
+ ---
2
+ id: "{{ID}}"
3
+ title: "{{TITLE}}"
4
+ type: "WKS"
5
+ created_by: "Curriculum OS Builder"
6
+ phase: "{{PHASE}}"
7
+ deliverable: "P3-T7"
8
+ version: "{{VERSION}}"
9
+ date: "{{DATE}}"
10
+ template_contract: "artifact-template-v1"
11
+ template_required_sections:
12
+ - "Part 1: Knowledge Check"
13
+ - "Part 2: Concept Tracing & Diagram Fill-in"
14
+ - "Part 3: Code Analysis & Bug Hunting Challenge"
15
+ - "Part 4: Synthesis & Problem-Solving Application"
16
+ - "Part 5: Self-Reflection & Learning Log"
17
+ ---
18
+
19
+ # WORKSHEET: [LESSON TITLE]
20
+
21
+ **Student Name:** _______________________ **Class:** _______________ **Date:** _______________
22
+
23
+ > **For Students:** This document guides you step-by-step through the practical tasks. Read carefully, fill in the blanks, and mark the checkbox [x] once completed. If you encounter errors, refer back to your **HANDOUT**.
24
+
25
+ ## [REQUIRED] Part 1: Knowledge Check
26
+ > Warm-up — prior-knowledge retrieval. Link back to the previous lesson.
27
+
28
+ 1. **Fill in the blanks:**
29
+ - [Statement with _______________ blanks tied to prior lesson keywords.]
30
+
31
+ 2. **Match the concept:**
32
+ | Concept | Link | Meaning |
33
+ |---|---|---|
34
+ | 1. [Concept A] | 1 - __ | a. [Meaning A] |
35
+ | 2. [Concept B] | 2 - __ | b. [Meaning B] |
36
+
37
+ ## [REQUIRED] Part 2: Concept Tracing & Diagram Fill-in
38
+ > Trace data/control flow through this lesson's core mechanism. Fill the
39
+ > Mermaid/ASCII diagram blanks.
40
+
41
+ ```mermaid
42
+ graph LR
43
+ A[[[Fill: stage 1]]] --> B[[[Fill: stage 2]]]
44
+ B --> C[[[Fill: stage 3]]]
45
+ ```
46
+
47
+ - **Trace question:** [What flows from stage to stage? What transforms?]
48
+
49
+ ## [REQUIRED] Part 3: Code Analysis & Bug Hunting Challenge
50
+ > One complete, runnable snippet containing a real bug from this lesson's
51
+ > Common Mistakes. Students locate, explain, and fix it.
52
+
53
+ ```[language]
54
+ // [Snippet with an embedded lesson bug]
55
+ ```
56
+
57
+ - **Bug located at line:** ______
58
+ - **Why it fails:** [Student explanation]
59
+ - **Fix:** [Student correction]
60
+
61
+ ## [REQUIRED] Part 4: Synthesis & Problem-Solving Application
62
+ > Apply the lesson's skill to a fresh scenario — not a copy of the lab task.
63
+
64
+ - **Scenario:** [New situation requiring the same skill]
65
+ - **Your solution:** [Workspace / code area]
66
+
67
+ ## [REQUIRED] Part 5: Self-Reflection & Learning Log
68
+ - **I can now…** [Can-do statements mirroring the LESSON LO evidence — checkbox each]
69
+ - [ ] [Can-do statement 1]
70
+ - [ ] [Can-do statement 2]
71
+ - **Muddiest point:** [What is still unclear?]
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var fs = require('fs');
4
- var path4 = require('path');
3
+ var fs5 = require('fs');
4
+ var path = require('path');
5
5
  var google = require('@ai-sdk/google');
6
6
  var openai = require('@ai-sdk/openai');
7
7
  var deepseek = require('@ai-sdk/deepseek');
@@ -11,14 +11,14 @@ var workflow = require('workflow');
11
11
  var fs2 = require('fs/promises');
12
12
  var rest = require('@octokit/rest');
13
13
  var supabaseJs = require('@supabase/supabase-js');
14
- var url = require('url');
15
14
  require('crypto');
15
+ var url = require('url');
16
16
 
17
17
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
18
18
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
19
19
 
20
- var fs__default = /*#__PURE__*/_interopDefault(fs);
21
- var path4__default = /*#__PURE__*/_interopDefault(path4);
20
+ var fs5__default = /*#__PURE__*/_interopDefault(fs5);
21
+ var path__default = /*#__PURE__*/_interopDefault(path);
22
22
  var fs2__default = /*#__PURE__*/_interopDefault(fs2);
23
23
 
24
24
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -150,18 +150,18 @@ function resolveApiKey(keyName, explicitKey) {
150
150
  try {
151
151
  const currentDir = process.cwd();
152
152
  const envPaths = [
153
- path4__default.default.resolve(currentDir, ".env.local"),
154
- path4__default.default.resolve(currentDir, ".env"),
155
- path4__default.default.resolve(currentDir, "apps/web/.env.local"),
156
- path4__default.default.resolve(currentDir, "packages/learnwell-platform/.env"),
157
- path4__default.default.resolve(currentDir, "..", ".env.local"),
158
- path4__default.default.resolve(currentDir, "..", ".env"),
159
- path4__default.default.resolve(currentDir, "../..", ".env.local"),
160
- path4__default.default.resolve(currentDir, "../..", ".env")
153
+ path__default.default.resolve(currentDir, ".env.local"),
154
+ path__default.default.resolve(currentDir, ".env"),
155
+ path__default.default.resolve(currentDir, "apps/web/.env.local"),
156
+ path__default.default.resolve(currentDir, "packages/learnwell-platform/.env"),
157
+ path__default.default.resolve(currentDir, "..", ".env.local"),
158
+ path__default.default.resolve(currentDir, "..", ".env"),
159
+ path__default.default.resolve(currentDir, "../..", ".env.local"),
160
+ path__default.default.resolve(currentDir, "../..", ".env")
161
161
  ];
162
162
  for (const envPath of envPaths) {
163
- if (fs__default.default.existsSync(envPath)) {
164
- const content = fs__default.default.readFileSync(envPath, "utf-8");
163
+ if (fs5__default.default.existsSync(envPath)) {
164
+ const content = fs5__default.default.readFileSync(envPath, "utf-8");
165
165
  for (const line of content.split("\n")) {
166
166
  const trimmed = line.trim();
167
167
  if (trimmed && !trimmed.startsWith("#") && trimmed.startsWith(keyName + "=")) {
@@ -3013,6 +3013,37 @@ This lab focuses on the practical implementation of core technical concepts, bri
3013
3013
  {{CHECKLIST_ITEMS}}
3014
3014
  `.trim();
3015
3015
 
3016
+ // src/templates/quizTemplate.ts
3017
+ var QUIZ_TEMPLATE = `
3018
+ ---
3019
+ id: "{{ID}}"
3020
+ title: "{{TITLE}}"
3021
+ type: "QUIZ"
3022
+ language: "{{LANGUAGE}}"
3023
+ total_questions: {{TOTAL_QUESTIONS}}
3024
+ passing_score_pct: {{PASSING_SCORE_PCT}}
3025
+ ---
3026
+
3027
+ # \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
3028
+
3029
+ > \u23F1\uFE0F **Recommended Time:** ~10-15 mins
3030
+ > \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
3031
+ > \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
3032
+
3033
+ ---
3034
+
3035
+ {{QUESTIONS_SECTION}}
3036
+
3037
+ ---
3038
+
3039
+ ## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
3040
+ <details>
3041
+ <summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
3042
+
3043
+ {{ANSWER_KEY_SECTION}}
3044
+ </details>
3045
+ `.trim();
3046
+
3016
3047
  // src/templates/selfLabTemplate.ts
3017
3048
  var SELF_LAB_TEMPLATE = `
3018
3049
  ---
@@ -3184,37 +3215,6 @@ tech_stack: {{TECH_STACK}}
3184
3215
  {{FINAL_CHECKLIST}}
3185
3216
  `.trim();
3186
3217
 
3187
- // src/templates/quizTemplate.ts
3188
- var QUIZ_TEMPLATE = `
3189
- ---
3190
- id: "{{ID}}"
3191
- title: "{{TITLE}}"
3192
- type: "QUIZ"
3193
- language: "{{LANGUAGE}}"
3194
- total_questions: {{TOTAL_QUESTIONS}}
3195
- passing_score_pct: {{PASSING_SCORE_PCT}}
3196
- ---
3197
-
3198
- # \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
3199
-
3200
- > \u23F1\uFE0F **Recommended Time:** ~10-15 mins
3201
- > \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
3202
- > \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
3203
-
3204
- ---
3205
-
3206
- {{QUESTIONS_SECTION}}
3207
-
3208
- ---
3209
-
3210
- ## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
3211
- <details>
3212
- <summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
3213
-
3214
- {{ANSWER_KEY_SECTION}}
3215
- </details>
3216
- `.trim();
3217
-
3218
3218
  // src/ai/prompts/lessonMasterPrompt.ts
3219
3219
  function buildLessonMasterPrompt(input) {
3220
3220
  const { milestone, language, topic, targetAudience, contextContinuity, standardsContext } = input;
@@ -4965,10 +4965,10 @@ ${answerKeySection}
4965
4965
  var LocalWorkspaceManager = class {
4966
4966
  baseDir;
4967
4967
  constructor(baseDir) {
4968
- this.baseDir = baseDir || path4__default.default.resolve(process.cwd(), "output", "workspace-jobs");
4968
+ this.baseDir = baseDir || path__default.default.resolve(process.cwd(), "output", "workspace-jobs");
4969
4969
  }
4970
4970
  getJobDirectory(jobId) {
4971
- return path4__default.default.join(this.baseDir, jobId);
4971
+ return path__default.default.join(this.baseDir, jobId);
4972
4972
  }
4973
4973
  async initJobWorkspace(jobId, initialInfo) {
4974
4974
  const jobDir = this.getJobDirectory(jobId);
@@ -4991,9 +4991,9 @@ var LocalWorkspaceManager = class {
4991
4991
  }
4992
4992
  async saveArtifact(jobId, milestoneSlug, filename, content, artifactType) {
4993
4993
  const jobDir = this.getJobDirectory(jobId);
4994
- const targetDir = path4__default.default.join(jobDir, milestoneSlug);
4994
+ const targetDir = path__default.default.join(jobDir, milestoneSlug);
4995
4995
  await fs2__default.default.mkdir(targetDir, { recursive: true });
4996
- const filePath = path4__default.default.join(targetDir, filename);
4996
+ const filePath = path__default.default.join(targetDir, filename);
4997
4997
  await fs2__default.default.writeFile(filePath, content, "utf-8");
4998
4998
  const stat = await fs2__default.default.stat(filePath);
4999
4999
  const manifest = await this.getManifest(jobId);
@@ -5001,7 +5001,7 @@ var LocalWorkspaceManager = class {
5001
5001
  manifest.artifacts.push({
5002
5002
  milestoneId: milestoneSlug,
5003
5003
  artifactType,
5004
- filePath: path4__default.default.relative(jobDir, filePath),
5004
+ filePath: path__default.default.relative(jobDir, filePath),
5005
5005
  sizeBytes: stat.size,
5006
5006
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
5007
5007
  });
@@ -5011,7 +5011,7 @@ var LocalWorkspaceManager = class {
5011
5011
  return filePath;
5012
5012
  }
5013
5013
  async getManifest(jobId) {
5014
- const manifestPath = path4__default.default.join(this.getJobDirectory(jobId), "manifest.json");
5014
+ const manifestPath = path__default.default.join(this.getJobDirectory(jobId), "manifest.json");
5015
5015
  try {
5016
5016
  const data = await fs2__default.default.readFile(manifestPath, "utf-8");
5017
5017
  return JSON.parse(data);
@@ -5020,7 +5020,7 @@ var LocalWorkspaceManager = class {
5020
5020
  }
5021
5021
  }
5022
5022
  async saveManifest(jobId, manifest) {
5023
- const manifestPath = path4__default.default.join(this.getJobDirectory(jobId), "manifest.json");
5023
+ const manifestPath = path__default.default.join(this.getJobDirectory(jobId), "manifest.json");
5024
5024
  manifest.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
5025
5025
  await fs2__default.default.writeFile(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
5026
5026
  }
@@ -5061,12 +5061,12 @@ async function publishToGitHub(options) {
5061
5061
  async function scanDir(currentDir) {
5062
5062
  const entries = await fs2__default.default.readdir(currentDir, { withFileTypes: true });
5063
5063
  for (const entry of entries) {
5064
- const fullPath = path4__default.default.join(currentDir, entry.name);
5064
+ const fullPath = path__default.default.join(currentDir, entry.name);
5065
5065
  if (entry.isDirectory()) {
5066
5066
  await scanDir(fullPath);
5067
5067
  } else if (entry.isFile() && !entry.name.startsWith(".")) {
5068
5068
  const content = await fs2__default.default.readFile(fullPath, "utf-8");
5069
- const relPath = path4__default.default.relative(options.localJobDir, fullPath);
5069
+ const relPath = path__default.default.relative(options.localJobDir, fullPath);
5070
5070
  filesToUpload.push({ path: relPath, content });
5071
5071
  }
5072
5072
  }
@@ -19786,32 +19786,52 @@ zod.z.object({
19786
19786
  assessmentMap: zod.z.array(zod.z.record(zod.z.string())).default([]),
19787
19787
  tieredScaffolding: zod.z.object({ bronze: zod.z.string().default(""), silver: zod.z.string().default(""), gold: zod.z.string().default("") }).default({ bronze: "", silver: "", gold: "" })
19788
19788
  });
19789
-
19790
- // src/services/lessonProductionService.ts
19791
- var __filename$1 = 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" && typeof url.fileURLToPath === "function" ? 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))) : "";
19792
- var _resolvedDir = __filename$1 ? path4__default.default.dirname(__filename$1) : typeof __dirname !== "undefined" ? __dirname : process.cwd();
19793
- function loadCurriculumTemplate(templateName) {
19794
- const candidatePaths = [
19795
- path4__default.default.resolve("/Users/tonypham/MEGA/WebApp/WIP/learnwell-platform/packages/curriculum-kit/docs/refs/templates", templateName),
19796
- path4__default.default.resolve(process.cwd(), "packages/curriculum-kit/docs/refs/templates", templateName),
19797
- path4__default.default.resolve(process.cwd(), "_templates", templateName),
19798
- path4__default.default.resolve(process.cwd(), "docs/refs/templates", templateName),
19799
- path4__default.default.resolve(_resolvedDir, "../docs/refs/templates", templateName),
19800
- path4__default.default.resolve(_resolvedDir, "../../docs/refs/templates", templateName),
19801
- path4__default.default.resolve(_resolvedDir, "../../../docs/refs/templates", templateName),
19802
- path4__default.default.resolve("/Users/tonypham/MEGA/WebApp/content-gen/the-ultimate-curriculum-agent-os/_templates", templateName),
19803
- path4__default.default.resolve(_resolvedDir, "../../../../the-ultimate-curriculum-agent-os/_templates", templateName)
19804
- ];
19805
- for (const p of candidatePaths) {
19806
- if (fs__default.default.existsSync(p)) {
19807
- try {
19808
- return fs__default.default.readFileSync(p, "utf-8");
19809
- } catch {
19810
- }
19789
+ var KIT_TEMPLATE_FALLBACK_DIRS = [
19790
+ // Packaged with the npm bundle (dist/templates) — resolves from node_modules.
19791
+ "templates",
19792
+ // Repo checkout layouts.
19793
+ "docs/refs/templates"
19794
+ ];
19795
+ var _moduleDir = (() => {
19796
+ try {
19797
+ 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") {
19798
+ 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))));
19811
19799
  }
19800
+ } catch {
19801
+ }
19802
+ return typeof __dirname !== "undefined" ? __dirname : process.cwd();
19803
+ })();
19804
+ function candidateDirs(explicitDir) {
19805
+ const dirs = [];
19806
+ if (process.env.CURRICULUM_TEMPLATES_DIR) dirs.push(process.env.CURRICULUM_TEMPLATES_DIR);
19807
+ dirs.push(path__default.default.resolve(process.cwd(), "_templates"));
19808
+ for (const rel of KIT_TEMPLATE_FALLBACK_DIRS) {
19809
+ dirs.push(path__default.default.resolve(_moduleDir, rel));
19810
+ dirs.push(path__default.default.resolve(process.cwd(), rel));
19811
+ dirs.push(path__default.default.resolve(process.cwd(), "packages/curriculum-kit", rel));
19812
+ }
19813
+ return dirs;
19814
+ }
19815
+ function findTemplatePath(templateName, explicitDir) {
19816
+ for (const dir of candidateDirs()) {
19817
+ const p = path__default.default.join(dir, templateName);
19818
+ if (!fs5__default.default.existsSync(p)) continue;
19819
+ try {
19820
+ fs5__default.default.accessSync(p, fs5__default.default.constants.R_OK);
19821
+ return p;
19822
+ } catch {
19823
+ }
19824
+ }
19825
+ return null;
19826
+ }
19827
+ function loadCurriculumTemplate(templateName, templatesDir) {
19828
+ const p = findTemplatePath(templateName);
19829
+ if (!p) return "";
19830
+ try {
19831
+ return fs5__default.default.readFileSync(p, "utf-8");
19832
+ } catch {
19833
+ return "";
19812
19834
  }
19813
- console.warn(`[curriculum-kit:loadCurriculumTemplate] \u26A0\uFE0F Template "${templateName}" not found across candidate paths. Falling back to inline structural scaffolding.`);
19814
- return "";
19815
19835
  }
19816
19836
 
19817
19837
  // src/services/singleArtifactService.ts