@thanh01.pmt/curriculum-kit 1.4.40 → 1.4.42

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 (105) hide show
  1. package/dist/ai/index.cjs +31 -31
  2. package/dist/ai/index.cjs.map +1 -1
  3. package/dist/ai/index.mjs +31 -31
  4. package/dist/ai/index.mjs.map +1 -1
  5. package/dist/index.cjs +290 -2027
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +84 -142
  8. package/dist/index.d.ts +84 -142
  9. package/dist/index.mjs +286 -2007
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/pipeline/index.cjs +31 -31
  12. package/dist/pipeline/index.cjs.map +1 -1
  13. package/dist/pipeline/index.mjs +31 -31
  14. package/dist/pipeline/index.mjs.map +1 -1
  15. package/dist/templates/ACT_template.md +58 -0
  16. package/dist/templates/ALIGNMENT_MATRIX_template.md +45 -0
  17. package/dist/templates/ART_DIRECTION_template.md +43 -0
  18. package/dist/templates/ASSET_MANIFEST_template.md +27 -0
  19. package/dist/templates/BASELINE_STANDARD.md +37 -0
  20. package/dist/templates/BELL_RINGER_template.md +108 -0
  21. package/dist/templates/CHANGELOG_template.md +19 -0
  22. package/dist/templates/CHOICE_BOARD_template.md +64 -0
  23. package/dist/templates/CODE_template.md +70 -0
  24. package/dist/templates/CONTENT_CONTINUITY_template.md +38 -0
  25. package/dist/templates/CONTENT_STYLE_GUIDE_template.md +49 -0
  26. package/dist/templates/CURRICULUM_FRAMEWORK_template.md +63 -0
  27. package/dist/templates/DEPENDENCY_MAP_template.md +65 -0
  28. package/dist/templates/EXIT_TICKET_template.md +85 -0
  29. package/dist/templates/EXT_template.md +35 -0
  30. package/dist/templates/GLOSSARY_template.md +108 -0
  31. package/dist/templates/GRAPHIC_ORGANIZER_template.md +100 -0
  32. package/dist/templates/GUIDE_template.md +56 -0
  33. package/dist/templates/HANDOUT_template.md +61 -0
  34. package/dist/templates/HANDOVER_DOCUMENT_template.md +69 -0
  35. package/dist/templates/KNOWLEDGE_EXPOSITION_template.md +56 -0
  36. package/dist/templates/LEARNER_PROFILE_template.md +51 -0
  37. package/dist/templates/LESSONS_LEARNED_template.md +49 -0
  38. package/dist/templates/LESSON_5E_template.md +127 -0
  39. package/dist/templates/LESSON_EDP_template.md +104 -0
  40. package/dist/templates/LESSON_GENERAL_template.md +117 -0
  41. package/dist/templates/OUTPUT_CONSTRAINTS_template.md +38 -0
  42. package/dist/templates/PACKAGING_SPEC_template.md +56 -0
  43. package/dist/templates/PILOT_FEEDBACK_template.md +49 -0
  44. package/dist/templates/PROJECT_BRIEF_template.md +45 -0
  45. package/dist/templates/PROJECT_STATUS_template.md +64 -0
  46. package/dist/templates/QUIZ_template.md +58 -0
  47. package/dist/templates/QUIZ_v4.6_template.md +65 -0
  48. package/dist/templates/REFERENCE_PACK_template.md +26 -0
  49. package/dist/templates/REVIEW_GAME_template.md +79 -0
  50. package/dist/templates/RUBRIC_template.md +54 -0
  51. package/dist/templates/SCIENCE_LAB_template.md +88 -0
  52. package/dist/templates/SLIDE_template.md +389 -0
  53. package/dist/templates/STATION_ROTATION_template.md +80 -0
  54. package/dist/templates/TASK_CARDS_template.md +111 -0
  55. package/dist/templates/TIERED_PRACTICE_template.md +114 -0
  56. package/dist/templates/UPDATE_ROADMAP_template.md +53 -0
  57. package/dist/templates/WKS_template.md +71 -0
  58. package/dist/workflow/index.cjs +99 -79
  59. package/dist/workflow/index.cjs.map +1 -1
  60. package/dist/workflow/index.mjs +97 -77
  61. package/dist/workflow/index.mjs.map +1 -1
  62. package/docs/refs/templates/ACT_template.md +58 -0
  63. package/docs/refs/templates/ALIGNMENT_MATRIX_template.md +45 -0
  64. package/docs/refs/templates/ART_DIRECTION_template.md +43 -0
  65. package/docs/refs/templates/ASSET_MANIFEST_template.md +27 -0
  66. package/docs/refs/templates/BASELINE_STANDARD.md +37 -0
  67. package/docs/refs/templates/BELL_RINGER_template.md +108 -0
  68. package/docs/refs/templates/CHANGELOG_template.md +19 -0
  69. package/docs/refs/templates/CHOICE_BOARD_template.md +64 -0
  70. package/docs/refs/templates/CODE_template.md +70 -0
  71. package/docs/refs/templates/CONTENT_CONTINUITY_template.md +38 -0
  72. package/docs/refs/templates/CONTENT_STYLE_GUIDE_template.md +49 -0
  73. package/docs/refs/templates/CURRICULUM_FRAMEWORK_template.md +63 -0
  74. package/docs/refs/templates/DEPENDENCY_MAP_template.md +65 -0
  75. package/docs/refs/templates/EXIT_TICKET_template.md +85 -0
  76. package/docs/refs/templates/EXT_template.md +35 -0
  77. package/docs/refs/templates/GLOSSARY_template.md +108 -0
  78. package/docs/refs/templates/GRAPHIC_ORGANIZER_template.md +100 -0
  79. package/docs/refs/templates/GUIDE_template.md +56 -0
  80. package/docs/refs/templates/HANDOUT_template.md +61 -0
  81. package/docs/refs/templates/HANDOVER_DOCUMENT_template.md +69 -0
  82. package/docs/refs/templates/KNOWLEDGE_EXPOSITION_template.md +56 -0
  83. package/docs/refs/templates/LEARNER_PROFILE_template.md +51 -0
  84. package/docs/refs/templates/LESSONS_LEARNED_template.md +49 -0
  85. package/docs/refs/templates/LESSON_5E_template.md +127 -0
  86. package/docs/refs/templates/LESSON_EDP_template.md +104 -0
  87. package/docs/refs/templates/LESSON_GENERAL_template.md +117 -0
  88. package/docs/refs/templates/OUTPUT_CONSTRAINTS_template.md +38 -0
  89. package/docs/refs/templates/PACKAGING_SPEC_template.md +56 -0
  90. package/docs/refs/templates/PILOT_FEEDBACK_template.md +49 -0
  91. package/docs/refs/templates/PROJECT_BRIEF_template.md +45 -0
  92. package/docs/refs/templates/PROJECT_STATUS_template.md +64 -0
  93. package/docs/refs/templates/QUIZ_template.md +58 -0
  94. package/docs/refs/templates/QUIZ_v4.6_template.md +65 -0
  95. package/docs/refs/templates/REFERENCE_PACK_template.md +26 -0
  96. package/docs/refs/templates/REVIEW_GAME_template.md +79 -0
  97. package/docs/refs/templates/RUBRIC_template.md +54 -0
  98. package/docs/refs/templates/SCIENCE_LAB_template.md +88 -0
  99. package/docs/refs/templates/SLIDE_template.md +389 -0
  100. package/docs/refs/templates/STATION_ROTATION_template.md +80 -0
  101. package/docs/refs/templates/TASK_CARDS_template.md +111 -0
  102. package/docs/refs/templates/TIERED_PRACTICE_template.md +114 -0
  103. package/docs/refs/templates/UPDATE_ROADMAP_template.md +53 -0
  104. package/docs/refs/templates/WKS_template.md +71 -0
  105. package/package.json +6 -4
@@ -1,5 +1,5 @@
1
- import fs from 'fs';
2
- import path4 from 'path';
1
+ import fs5 from 'fs';
2
+ import path from 'path';
3
3
  import { createGoogleGenerativeAI } from '@ai-sdk/google';
4
4
  import { createOpenAI } from '@ai-sdk/openai';
5
5
  import { createDeepSeek } from '@ai-sdk/deepseek';
@@ -9,8 +9,8 @@ import { defineHook, getStepMetadata, RetryableError, sleep } from 'workflow';
9
9
  import fs2 from 'fs/promises';
10
10
  import { Octokit } from '@octokit/rest';
11
11
  import { createClient } from '@supabase/supabase-js';
12
- import { fileURLToPath } from 'url';
13
12
  import 'crypto';
13
+ import { fileURLToPath } from 'url';
14
14
 
15
15
  var __getOwnPropNames = Object.getOwnPropertyNames;
16
16
  var __esm = (fn, res) => function __init() {
@@ -141,18 +141,18 @@ function resolveApiKey(keyName, explicitKey) {
141
141
  try {
142
142
  const currentDir = process.cwd();
143
143
  const envPaths = [
144
- path4.resolve(currentDir, ".env.local"),
145
- path4.resolve(currentDir, ".env"),
146
- path4.resolve(currentDir, "apps/web/.env.local"),
147
- path4.resolve(currentDir, "packages/learnwell-platform/.env"),
148
- path4.resolve(currentDir, "..", ".env.local"),
149
- path4.resolve(currentDir, "..", ".env"),
150
- path4.resolve(currentDir, "../..", ".env.local"),
151
- path4.resolve(currentDir, "../..", ".env")
144
+ path.resolve(currentDir, ".env.local"),
145
+ path.resolve(currentDir, ".env"),
146
+ path.resolve(currentDir, "apps/web/.env.local"),
147
+ path.resolve(currentDir, "packages/learnwell-platform/.env"),
148
+ path.resolve(currentDir, "..", ".env.local"),
149
+ path.resolve(currentDir, "..", ".env"),
150
+ path.resolve(currentDir, "../..", ".env.local"),
151
+ path.resolve(currentDir, "../..", ".env")
152
152
  ];
153
153
  for (const envPath of envPaths) {
154
- if (fs.existsSync(envPath)) {
155
- const content = fs.readFileSync(envPath, "utf-8");
154
+ if (fs5.existsSync(envPath)) {
155
+ const content = fs5.readFileSync(envPath, "utf-8");
156
156
  for (const line of content.split("\n")) {
157
157
  const trimmed = line.trim();
158
158
  if (trimmed && !trimmed.startsWith("#") && trimmed.startsWith(keyName + "=")) {
@@ -3004,6 +3004,37 @@ This lab focuses on the practical implementation of core technical concepts, bri
3004
3004
  {{CHECKLIST_ITEMS}}
3005
3005
  `.trim();
3006
3006
 
3007
+ // src/templates/quizTemplate.ts
3008
+ var QUIZ_TEMPLATE = `
3009
+ ---
3010
+ id: "{{ID}}"
3011
+ title: "{{TITLE}}"
3012
+ type: "QUIZ"
3013
+ language: "{{LANGUAGE}}"
3014
+ total_questions: {{TOTAL_QUESTIONS}}
3015
+ passing_score_pct: {{PASSING_SCORE_PCT}}
3016
+ ---
3017
+
3018
+ # \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
3019
+
3020
+ > \u23F1\uFE0F **Recommended Time:** ~10-15 mins
3021
+ > \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
3022
+ > \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
3023
+
3024
+ ---
3025
+
3026
+ {{QUESTIONS_SECTION}}
3027
+
3028
+ ---
3029
+
3030
+ ## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
3031
+ <details>
3032
+ <summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
3033
+
3034
+ {{ANSWER_KEY_SECTION}}
3035
+ </details>
3036
+ `.trim();
3037
+
3007
3038
  // src/templates/selfLabTemplate.ts
3008
3039
  var SELF_LAB_TEMPLATE = `
3009
3040
  ---
@@ -3175,37 +3206,6 @@ tech_stack: {{TECH_STACK}}
3175
3206
  {{FINAL_CHECKLIST}}
3176
3207
  `.trim();
3177
3208
 
3178
- // src/templates/quizTemplate.ts
3179
- var QUIZ_TEMPLATE = `
3180
- ---
3181
- id: "{{ID}}"
3182
- title: "{{TITLE}}"
3183
- type: "QUIZ"
3184
- language: "{{LANGUAGE}}"
3185
- total_questions: {{TOTAL_QUESTIONS}}
3186
- passing_score_pct: {{PASSING_SCORE_PCT}}
3187
- ---
3188
-
3189
- # \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
3190
-
3191
- > \u23F1\uFE0F **Recommended Time:** ~10-15 mins
3192
- > \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
3193
- > \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
3194
-
3195
- ---
3196
-
3197
- {{QUESTIONS_SECTION}}
3198
-
3199
- ---
3200
-
3201
- ## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
3202
- <details>
3203
- <summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
3204
-
3205
- {{ANSWER_KEY_SECTION}}
3206
- </details>
3207
- `.trim();
3208
-
3209
3209
  // src/ai/prompts/lessonMasterPrompt.ts
3210
3210
  function buildLessonMasterPrompt(input) {
3211
3211
  const { milestone, language, topic, targetAudience, contextContinuity, standardsContext } = input;
@@ -4956,10 +4956,10 @@ ${answerKeySection}
4956
4956
  var LocalWorkspaceManager = class {
4957
4957
  baseDir;
4958
4958
  constructor(baseDir) {
4959
- this.baseDir = baseDir || path4.resolve(process.cwd(), "output", "workspace-jobs");
4959
+ this.baseDir = baseDir || path.resolve(process.cwd(), "output", "workspace-jobs");
4960
4960
  }
4961
4961
  getJobDirectory(jobId) {
4962
- return path4.join(this.baseDir, jobId);
4962
+ return path.join(this.baseDir, jobId);
4963
4963
  }
4964
4964
  async initJobWorkspace(jobId, initialInfo) {
4965
4965
  const jobDir = this.getJobDirectory(jobId);
@@ -4982,9 +4982,9 @@ var LocalWorkspaceManager = class {
4982
4982
  }
4983
4983
  async saveArtifact(jobId, milestoneSlug, filename, content, artifactType) {
4984
4984
  const jobDir = this.getJobDirectory(jobId);
4985
- const targetDir = path4.join(jobDir, milestoneSlug);
4985
+ const targetDir = path.join(jobDir, milestoneSlug);
4986
4986
  await fs2.mkdir(targetDir, { recursive: true });
4987
- const filePath = path4.join(targetDir, filename);
4987
+ const filePath = path.join(targetDir, filename);
4988
4988
  await fs2.writeFile(filePath, content, "utf-8");
4989
4989
  const stat = await fs2.stat(filePath);
4990
4990
  const manifest = await this.getManifest(jobId);
@@ -4992,7 +4992,7 @@ var LocalWorkspaceManager = class {
4992
4992
  manifest.artifacts.push({
4993
4993
  milestoneId: milestoneSlug,
4994
4994
  artifactType,
4995
- filePath: path4.relative(jobDir, filePath),
4995
+ filePath: path.relative(jobDir, filePath),
4996
4996
  sizeBytes: stat.size,
4997
4997
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4998
4998
  });
@@ -5002,7 +5002,7 @@ var LocalWorkspaceManager = class {
5002
5002
  return filePath;
5003
5003
  }
5004
5004
  async getManifest(jobId) {
5005
- const manifestPath = path4.join(this.getJobDirectory(jobId), "manifest.json");
5005
+ const manifestPath = path.join(this.getJobDirectory(jobId), "manifest.json");
5006
5006
  try {
5007
5007
  const data = await fs2.readFile(manifestPath, "utf-8");
5008
5008
  return JSON.parse(data);
@@ -5011,7 +5011,7 @@ var LocalWorkspaceManager = class {
5011
5011
  }
5012
5012
  }
5013
5013
  async saveManifest(jobId, manifest) {
5014
- const manifestPath = path4.join(this.getJobDirectory(jobId), "manifest.json");
5014
+ const manifestPath = path.join(this.getJobDirectory(jobId), "manifest.json");
5015
5015
  manifest.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
5016
5016
  await fs2.writeFile(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
5017
5017
  }
@@ -5052,12 +5052,12 @@ async function publishToGitHub(options) {
5052
5052
  async function scanDir(currentDir) {
5053
5053
  const entries = await fs2.readdir(currentDir, { withFileTypes: true });
5054
5054
  for (const entry of entries) {
5055
- const fullPath = path4.join(currentDir, entry.name);
5055
+ const fullPath = path.join(currentDir, entry.name);
5056
5056
  if (entry.isDirectory()) {
5057
5057
  await scanDir(fullPath);
5058
5058
  } else if (entry.isFile() && !entry.name.startsWith(".")) {
5059
5059
  const content = await fs2.readFile(fullPath, "utf-8");
5060
- const relPath = path4.relative(options.localJobDir, fullPath);
5060
+ const relPath = path.relative(options.localJobDir, fullPath);
5061
5061
  filesToUpload.push({ path: relPath, content });
5062
5062
  }
5063
5063
  }
@@ -19777,32 +19777,52 @@ z.object({
19777
19777
  assessmentMap: z.array(z.record(z.string())).default([]),
19778
19778
  tieredScaffolding: z.object({ bronze: z.string().default(""), silver: z.string().default(""), gold: z.string().default("") }).default({ bronze: "", silver: "", gold: "" })
19779
19779
  });
19780
-
19781
- // src/services/lessonProductionService.ts
19782
- var __filename$1 = typeof import.meta?.url === "string" && typeof fileURLToPath === "function" ? fileURLToPath(import.meta.url) : "";
19783
- var _resolvedDir = __filename$1 ? path4.dirname(__filename$1) : typeof __dirname !== "undefined" ? __dirname : process.cwd();
19784
- function loadCurriculumTemplate(templateName) {
19785
- const candidatePaths = [
19786
- path4.resolve("/Users/tonypham/MEGA/WebApp/WIP/learnwell-platform/packages/curriculum-kit/docs/refs/templates", templateName),
19787
- path4.resolve(process.cwd(), "packages/curriculum-kit/docs/refs/templates", templateName),
19788
- path4.resolve(process.cwd(), "_templates", templateName),
19789
- path4.resolve(process.cwd(), "docs/refs/templates", templateName),
19790
- path4.resolve(_resolvedDir, "../docs/refs/templates", templateName),
19791
- path4.resolve(_resolvedDir, "../../docs/refs/templates", templateName),
19792
- path4.resolve(_resolvedDir, "../../../docs/refs/templates", templateName),
19793
- path4.resolve("/Users/tonypham/MEGA/WebApp/content-gen/the-ultimate-curriculum-agent-os/_templates", templateName),
19794
- path4.resolve(_resolvedDir, "../../../../the-ultimate-curriculum-agent-os/_templates", templateName)
19795
- ];
19796
- for (const p of candidatePaths) {
19797
- if (fs.existsSync(p)) {
19798
- try {
19799
- return fs.readFileSync(p, "utf-8");
19800
- } catch {
19801
- }
19780
+ var KIT_TEMPLATE_FALLBACK_DIRS = [
19781
+ // Packaged with the npm bundle (dist/templates) — resolves from node_modules.
19782
+ "templates",
19783
+ // Repo checkout layouts.
19784
+ "docs/refs/templates"
19785
+ ];
19786
+ var _moduleDir = (() => {
19787
+ try {
19788
+ if (typeof import.meta !== "undefined" && typeof import.meta.url === "string") {
19789
+ return path.dirname(fileURLToPath(import.meta.url));
19802
19790
  }
19791
+ } catch {
19792
+ }
19793
+ return typeof __dirname !== "undefined" ? __dirname : process.cwd();
19794
+ })();
19795
+ function candidateDirs(explicitDir) {
19796
+ const dirs = [];
19797
+ if (process.env.CURRICULUM_TEMPLATES_DIR) dirs.push(process.env.CURRICULUM_TEMPLATES_DIR);
19798
+ dirs.push(path.resolve(process.cwd(), "_templates"));
19799
+ for (const rel of KIT_TEMPLATE_FALLBACK_DIRS) {
19800
+ dirs.push(path.resolve(_moduleDir, rel));
19801
+ dirs.push(path.resolve(process.cwd(), rel));
19802
+ dirs.push(path.resolve(process.cwd(), "packages/curriculum-kit", rel));
19803
+ }
19804
+ return dirs;
19805
+ }
19806
+ function findTemplatePath(templateName, explicitDir) {
19807
+ for (const dir of candidateDirs()) {
19808
+ const p = path.join(dir, templateName);
19809
+ if (!fs5.existsSync(p)) continue;
19810
+ try {
19811
+ fs5.accessSync(p, fs5.constants.R_OK);
19812
+ return p;
19813
+ } catch {
19814
+ }
19815
+ }
19816
+ return null;
19817
+ }
19818
+ function loadCurriculumTemplate(templateName, templatesDir) {
19819
+ const p = findTemplatePath(templateName);
19820
+ if (!p) return "";
19821
+ try {
19822
+ return fs5.readFileSync(p, "utf-8");
19823
+ } catch {
19824
+ return "";
19803
19825
  }
19804
- console.warn(`[curriculum-kit:loadCurriculumTemplate] \u26A0\uFE0F Template "${templateName}" not found across candidate paths. Falling back to inline structural scaffolding.`);
19805
- return "";
19806
19826
  }
19807
19827
 
19808
19828
  // src/services/singleArtifactService.ts