@thanh01.pmt/curriculum-kit 1.4.20 → 1.4.22

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/index.mjs CHANGED
@@ -1501,7 +1501,8 @@ function buildSlideBatchPrompt(params) {
1501
1501
  skillPrompt,
1502
1502
  language = "Vietnamese",
1503
1503
  languageDirective = "",
1504
- headingDirective = ""
1504
+ headingDirective = "",
1505
+ groundContext = ""
1505
1506
  } = params;
1506
1507
  const slidesSpec = clusterSlides.map((s) => `
1507
1508
  - Slide ${s.slideIndex} [Phase: ${s.lessonPhase}] -> Layout: "${s.layoutId}"
@@ -1514,7 +1515,11 @@ function buildSlideBatchPrompt(params) {
1514
1515
  const systemPrompt = `
1515
1516
  ${skillPrompt}
1516
1517
 
1517
- ---
1518
+ ${groundContext ? `---
1519
+ ### PROJECT GROUND CONTEXT (framework, style guide, glossary, canonical knowledge \u2014 author from these):
1520
+ ${groundContext}
1521
+
1522
+ ---` : ""}
1518
1523
  ### OPERATIONAL GROUND RULES FOR CHUNK GENERATION:
1519
1524
  ${languageDirective}
1520
1525
  ${headingDirective}
@@ -1592,6 +1597,7 @@ __export(slideProductionWorkflow_exports, {
1592
1597
  HybridPipelineError: () => HybridPipelineError,
1593
1598
  SlideBlueprintArraySchema: () => SlideBlueprintArraySchema,
1594
1599
  SlideBlueprintItemSchema: () => SlideBlueprintItemSchema,
1600
+ emitUsage: () => emitUsage,
1595
1601
  executeSlideProductionWorkflow: () => executeSlideProductionWorkflow,
1596
1602
  extractJsonArray: () => extractJsonArray,
1597
1603
  validateHybridDeckSlides: () => validateHybridDeckSlides
@@ -1644,15 +1650,28 @@ function validateHybridDeckSlides(slides, blueprint) {
1644
1650
  });
1645
1651
  return v.slice(0, 10);
1646
1652
  }
1653
+ function emitUsage(usage, onProgress) {
1654
+ if (!onProgress || !usage) return;
1655
+ const promptTokens = usage.promptTokens ?? usage.inputTokens ?? 0;
1656
+ const completionTokens = usage.completionTokens ?? usage.outputTokens ?? 0;
1657
+ if (promptTokens === 0 && completionTokens === 0) return;
1658
+ onProgress("@illustrator", JSON.stringify({
1659
+ promptTokens,
1660
+ completionTokens,
1661
+ totalTokens: usage.totalTokens ?? promptTokens + completionTokens,
1662
+ reasoningTokens: usage.reasoningTokens ?? 0
1663
+ }), { type: "usage" });
1664
+ }
1647
1665
  async function inferTextJson(schema, systemPrompt, userPrompt, options, label) {
1648
1666
  const model = getAIModel(options.modelOptions);
1649
1667
  try {
1650
- const { text, finishReason } = await generateText({
1668
+ const { text, finishReason, usage } = await generateText({
1651
1669
  model,
1652
1670
  system: systemPrompt || void 0,
1653
1671
  prompt: userPrompt,
1654
1672
  maxOutputTokens: options.maxOutputTokens ?? 65536
1655
1673
  });
1674
+ emitUsage(usage, options.onProgress);
1656
1675
  const extracted = extractJsonArray(text);
1657
1676
  if (!("value" in extracted) || extracted.value === void 0) {
1658
1677
  console.warn(
@@ -1673,12 +1692,13 @@ async function inferTextJson(schema, systemPrompt, userPrompt, options, label) {
1673
1692
  async function inferStructured(schema, systemPrompt, userPrompt, options, label) {
1674
1693
  try {
1675
1694
  const model = getAIModel(options.modelOptions);
1676
- const { object } = await generateObject({
1695
+ const { object, usage } = await generateObject({
1677
1696
  model,
1678
1697
  schema,
1679
1698
  system: systemPrompt || void 0,
1680
1699
  prompt: userPrompt
1681
1700
  });
1701
+ emitUsage(usage, options.onProgress);
1682
1702
  const validated = schema.safeParse(object);
1683
1703
  if (validated.success) return validated.data;
1684
1704
  console.warn(
@@ -1693,7 +1713,9 @@ async function inferStructured(schema, systemPrompt, userPrompt, options, label)
1693
1713
  const messages = [
1694
1714
  { role: "user", content: [systemPrompt, userPrompt].filter(Boolean).join("\n\n") }
1695
1715
  ];
1696
- const raw = await runCurriculumAIInference(messages, options.satelliteContext || "", options.runnerOptions);
1716
+ const raw = await runCurriculumAIInference(messages, options.satelliteContext || "", options.runnerOptions, (token, type) => {
1717
+ if (type === "usage") options.onProgress?.("@illustrator", token, { type: "usage" });
1718
+ });
1697
1719
  const fenceMatch = raw.match(/```(?:json)?\s*([\s\S]*?)\s*```/i);
1698
1720
  const candidate = (fenceMatch ? fenceMatch[1] : raw).trim();
1699
1721
  let parsed;
@@ -1726,7 +1748,7 @@ function normalizeBlueprintItems(items) {
1726
1748
  }));
1727
1749
  }
1728
1750
  function buildHybridDeckPrompts(params) {
1729
- const { lessonFlow, blueprint, skillPrompt, language, languageDirective, headingDirective } = params;
1751
+ const { lessonFlow, blueprint, skillPrompt, language, languageDirective, headingDirective, groundContext } = params;
1730
1752
  const blueprintText = JSON.stringify(
1731
1753
  blueprint.map((s) => ({
1732
1754
  slideIndex: s.slideIndex,
@@ -1745,6 +1767,7 @@ function buildHybridDeckPrompts(params) {
1745
1767
  ${p.content}`).join("\n\n") : lessonFlow.rawContent;
1746
1768
  const systemPrompt = [
1747
1769
  skillPrompt,
1770
+ groundContext || "",
1748
1771
  languageDirective,
1749
1772
  headingDirective,
1750
1773
  `
@@ -1809,7 +1832,8 @@ async function runHybridPipeline(ctx) {
1809
1832
  skillPrompt,
1810
1833
  language,
1811
1834
  languageDirective,
1812
- headingDirective
1835
+ headingDirective,
1836
+ groundContext: options.groundContext
1813
1837
  });
1814
1838
  let slides = null;
1815
1839
  let lastViolations = [];
@@ -1958,7 +1982,8 @@ ${p.content}`).join("\n\n") : lessonFlow.rawContent.slice(0, 3500);
1958
1982
  skillPrompt,
1959
1983
  language,
1960
1984
  languageDirective,
1961
- headingDirective
1985
+ headingDirective,
1986
+ groundContext: options.groundContext
1962
1987
  });
1963
1988
  try {
1964
1989
  const batchSlides = await pRetry(
@@ -9300,6 +9325,21 @@ var STANDARD_SOT_FILES = [
9300
9325
  "ART_DIRECTION.md",
9301
9326
  "ALIGNMENT_MATRIX.md"
9302
9327
  ];
9328
+ function atomicWriteFileSync(targetPath, content) {
9329
+ const dir = path3.dirname(targetPath);
9330
+ if (!fs2.existsSync(dir)) fs2.mkdirSync(dir, { recursive: true });
9331
+ const tmpPath = path3.join(dir, `.${path3.basename(targetPath)}.${process.pid}.${Date.now()}.${crypto.randomBytes(4).toString("hex")}.tmp`);
9332
+ try {
9333
+ fs2.writeFileSync(tmpPath, content, "utf-8");
9334
+ fs2.renameSync(tmpPath, targetPath);
9335
+ } catch (err) {
9336
+ try {
9337
+ if (fs2.existsSync(tmpPath)) fs2.unlinkSync(tmpPath);
9338
+ } catch {
9339
+ }
9340
+ throw err;
9341
+ }
9342
+ }
9303
9343
  var FileSystemCurriculumAdapter = class {
9304
9344
  baseDir;
9305
9345
  constructor(options = {}) {
@@ -9438,7 +9478,7 @@ var FileSystemCurriculumAdapter = class {
9438
9478
  if (oldContent !== content) {
9439
9479
  const historyDir = path3.join(projectDir, ".history", relPath);
9440
9480
  fs2.mkdirSync(historyDir, { recursive: true });
9441
- fs2.writeFileSync(path3.join(historyDir, `${Date.now()}.md`), oldContent, "utf-8");
9481
+ atomicWriteFileSync(path3.join(historyDir, `${Date.now()}.md`), oldContent);
9442
9482
  const versions = fs2.readdirSync(historyDir).filter((f) => f.endsWith(".md")).sort();
9443
9483
  while (versions.length > 10) {
9444
9484
  fs2.unlinkSync(path3.join(historyDir, versions.shift()));
@@ -9448,19 +9488,15 @@ var FileSystemCurriculumAdapter = class {
9448
9488
  console.warn("[FileSystemCurriculumAdapter] version history snapshot failed:", histErr?.message || histErr);
9449
9489
  }
9450
9490
  }
9451
- fs2.writeFileSync(targetPath, content, "utf-8");
9491
+ atomicWriteFileSync(targetPath, content);
9452
9492
  const filename = path3.basename(relPath);
9453
9493
  const match = filename.match(/(LESSON|ACT|QUIZ|SLIDE|GUIDE|HANDOUT|WKS|EXT)_(U\d+_M\d+_L\d+)\.md/i);
9454
9494
  if (match) {
9455
9495
  const lessonId = match[2].toUpperCase();
9456
- const lessonsDir = path3.join(projectDir, "lessons", lessonId);
9457
- if (!fs2.existsSync(lessonsDir)) {
9458
- fs2.mkdirSync(lessonsDir, { recursive: true });
9459
- }
9460
- fs2.writeFileSync(path3.join(lessonsDir, filename), content, "utf-8");
9496
+ atomicWriteFileSync(path3.join(projectDir, "lessons", lessonId, filename), content);
9461
9497
  const legacyContentDir = path3.join(projectDir, "_content", lessonId);
9462
9498
  if (fs2.existsSync(legacyContentDir)) {
9463
- fs2.writeFileSync(path3.join(legacyContentDir, filename), content, "utf-8");
9499
+ atomicWriteFileSync(path3.join(legacyContentDir, filename), content);
9464
9500
  }
9465
9501
  }
9466
9502
  }
@@ -9551,7 +9587,7 @@ ${lessonTable}
9551
9587
  }
9552
9588
  const stateFile = path3.join(pipelineDir, "state.json");
9553
9589
  state.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
9554
- fs2.writeFileSync(stateFile, JSON.stringify(state, null, 2), "utf-8");
9590
+ atomicWriteFileSync(stateFile, JSON.stringify(state, null, 2));
9555
9591
  }
9556
9592
  async updateArtifactState(projectId, taskId, artifactType, update) {
9557
9593
  const current = await this.getPipelineState(projectId);
@@ -11251,6 +11287,13 @@ var DEFAULT_LESSON_PRIORITIES = [
11251
11287
  "Learning Objectives & Evidence",
11252
11288
  "Activity Sequence"
11253
11289
  ];
11290
+ var SATELLITE_LESSON_PRIORITIES = [
11291
+ "Artifact Contract",
11292
+ "A. Lesson Design Plan",
11293
+ "B. Lesson Flow",
11294
+ "Learning Objectives & Evidence",
11295
+ "Activity Sequence"
11296
+ ];
11254
11297
  var DEFAULT_KX_PRIORITIES = [
11255
11298
  "Key Terms",
11256
11299
  "Concept Narratives",
@@ -11464,6 +11507,21 @@ function normalizeHeading(str) {
11464
11507
  return str.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\w\s]/g, " ").replace(/\s+/g, " ").trim();
11465
11508
  }
11466
11509
  function findCanonicalFuzzy(norm) {
11510
+ if (norm.includes("toolchain") || norm.includes("moi truong phat trien") || norm.includes("cong cu") || norm.includes("version") || norm.includes("phan mem") || norm.includes("development environment") || norm.includes("technical overview") || norm.includes("kien truc")) {
11511
+ return "Technical Overview & Architecture Blueprint";
11512
+ }
11513
+ if (norm.includes("pinout") || norm.includes("phan cung") || norm.includes("hardware") || norm.includes("wiring") || norm.includes("ket noi")) {
11514
+ return "Hardware Pinout & Wiring Configuration Matrix";
11515
+ }
11516
+ if (norm.includes("pedagog") || norm.includes("phuong phap") || norm.includes("day hoc") || norm.includes("su pham")) {
11517
+ return "Core Pedagogical Concept Anchor & Real-World Domain Bridge";
11518
+ }
11519
+ if (norm.includes("standard") || norm.includes("tieu chuan") || norm.includes("csta") || norm.includes("cs2023") || norm.includes("chuan academic")) {
11520
+ return "Standards Alignment";
11521
+ }
11522
+ if (norm.includes("roadmap") || norm.includes("lo trinh") || norm.includes("milestone") || norm.includes("giai doan")) {
11523
+ return void 0;
11524
+ }
11467
11525
  if (norm.includes("symbol") || norm.includes("identifier ledger") || norm.includes("dinh danh")) {
11468
11526
  return "Symbol & Identifier Ledger";
11469
11527
  }
@@ -11600,7 +11658,7 @@ function buildSystemPrompt(targetLanguage = "vi", techStack, hardwarePlatform) {
11600
11658
  langDirective
11601
11659
  ].join("\n");
11602
11660
  }
11603
- function buildUserPrompt(session, plan, glossary, targetLanguage = "vi", slcMarkdown) {
11661
+ function buildUserPrompt(session, plan, glossary, targetLanguage = "vi", slcMarkdown, refPack) {
11604
11662
  const depthLines = session.depth_assignments.map((d) => "- " + d.node_id + " [" + d.depth.toUpperCase() + "]: " + DEPTH_RULES[d.depth]).join("\n");
11605
11663
  const termLines = glossary.map((g) => "- " + g.term + (g.definition ? " \u2014 " + g.definition : "") + (g.example ? " (example: " + g.example + ")" : "")).join("\n");
11606
11664
  const langCode = resolveTargetLanguageCode(targetLanguage);
@@ -11613,6 +11671,28 @@ function buildUserPrompt(session, plan, glossary, targetLanguage = "vi", slcMark
11613
11671
  const hQuestions = headings["Self-Check Questions"] || (langCode === "vi" ? "C\xE2u h\u1ECFi T\u1EF1 ki\u1EC3m tra" : "Self-Check Questions");
11614
11672
  const skeleton = `## ${hScope} / ## ${hTerms} / ## ${hNarratives} / ## ${hExamples} / ## ${hMistakes} / ## ${hQuestions}`;
11615
11673
  const headingDirective = buildHeadingDirective("KNOWLEDGE_EXPOSITION", slcMarkdown, targetLanguage);
11674
+ let refPackBlock = "";
11675
+ if (refPack && refPack.trim()) {
11676
+ const refExcerpt = buildSectionAwareExcerpt(refPack, {
11677
+ priorities: [
11678
+ "Technical Overview & Architecture Blueprint",
11679
+ "Hardware Pinout & Wiring Configuration Matrix",
11680
+ "Standards Alignment"
11681
+ ],
11682
+ budget: 2500
11683
+ }).excerpt;
11684
+ if (refExcerpt) {
11685
+ refPackBlock = [
11686
+ "",
11687
+ "[GROUND TRUTH \u2014 BINDING, from REFERENCE_PACK.md]:",
11688
+ "Tool versions, APIs, and platform facts below are CANONICAL. Do NOT",
11689
+ "contradict them; do NOT substitute versions from memory. If a fact you",
11690
+ "need is not stated here, stay generic rather than inventing specifics.",
11691
+ "",
11692
+ refExcerpt
11693
+ ].join("\n");
11694
+ }
11695
+ }
11616
11696
  return [
11617
11697
  "Session: " + session.id + " \u2014 " + session.title,
11618
11698
  "Objective: " + session.prose_objective,
@@ -11625,6 +11705,7 @@ function buildUserPrompt(session, plan, glossary, targetLanguage = "vi", slcMark
11625
11705
  "",
11626
11706
  "Glossary terms (definitions are canonical):",
11627
11707
  termLines || "(none provided \u2014 write definitions and mark them for glossary sync)",
11708
+ refPackBlock,
11628
11709
  "",
11629
11710
  "Section skeleton to fill (replace ONLY the {{placeholders}}):",
11630
11711
  skeleton,
@@ -11633,7 +11714,7 @@ function buildUserPrompt(session, plan, glossary, targetLanguage = "vi", slcMark
11633
11714
  ].filter(Boolean).join("\n");
11634
11715
  }
11635
11716
  async function ensureKnowledgeExposition(options) {
11636
- const { projectId, lessonCode, plan, glossary, llmFn, storage, techStack, hardwarePlatform } = options;
11717
+ const { projectId, lessonCode, plan, glossary, llmFn, storage, techStack, hardwarePlatform, refPack } = options;
11637
11718
  const session = plan.sessions.find((s) => s.id === lessonCode);
11638
11719
  if (!session) throw new Error("Session " + lessonCode + " not found in plan " + plan.plan_id);
11639
11720
  const existing = await storage.readArtifact(projectId, EXPOSITION_REL(lessonCode));
@@ -11647,9 +11728,11 @@ async function ensureKnowledgeExposition(options) {
11647
11728
  throw new ExpositionApprovalError("Approval hash " + plan.approval.plan_hash + " does not match current plan hash " + plan.plan_hash + " \u2014 re-approve after plan changes");
11648
11729
  }
11649
11730
  const targetLanguage = options.targetLanguage || plan.translation?.target_language || "vi";
11731
+ const originalSystemPrompt = buildSystemPrompt(targetLanguage, techStack, hardwarePlatform);
11732
+ const originalUserPrompt = buildUserPrompt(session, plan, glossary, targetLanguage, options.slcMarkdown, refPack);
11650
11733
  const content = (await llmFn(
11651
- buildSystemPrompt(targetLanguage, techStack, hardwarePlatform),
11652
- buildUserPrompt(session, plan, glossary, targetLanguage, options.slcMarkdown)
11734
+ originalSystemPrompt,
11735
+ originalUserPrompt
11653
11736
  )).trim();
11654
11737
  if (content.length < 200) {
11655
11738
  throw new Error("EXPOSITION too short for " + lessonCode + " (" + content.length + " chars) \u2014 refusing to save");
@@ -11682,8 +11765,16 @@ async function ensureKnowledgeExposition(options) {
11682
11765
  };
11683
11766
  let verdict = await judgeOnce(finalContent);
11684
11767
  if (verdict.verdict !== "APPROVED") {
11685
- const repairPrompt = finalContent + "\n\nJUDGE CRITIQUE (fix ALL issues, output the COMPLETE corrected document):\n" + verdict.critique;
11686
- finalContent = (await llmFn(buildSystemPrompt(), repairPrompt)).trim();
11768
+ const repairPrompt = [
11769
+ originalUserPrompt,
11770
+ "",
11771
+ "--- YOUR PREVIOUS DRAFT (REJECTED, fix ALL issues below) ---",
11772
+ finalContent,
11773
+ "",
11774
+ "--- JUDGE CRITIQUE (fix ALL issues, output the COMPLETE corrected document) ---",
11775
+ verdict.critique
11776
+ ].join("\n");
11777
+ finalContent = (await llmFn(originalSystemPrompt, repairPrompt)).trim();
11687
11778
  verdict = await judgeOnce(finalContent);
11688
11779
  }
11689
11780
  if (verdict.verdict !== "APPROVED") {
@@ -11724,12 +11815,27 @@ async function ensureExpositionForLesson(storage, projectId, lessonCode, options
11724
11815
  try {
11725
11816
  const lpRaw = await storage.readSotDocument(projectId, "LEARNER_PROFILE.md");
11726
11817
  if (lpRaw) {
11727
- const hwMatch = lpRaw.match(/(?:Student Equipment|Hardware|Platform|Thiết bị)[:\s*`]+([^\n\r]+)/i);
11728
- if (hwMatch && !hw) hw = hwMatch[1].trim();
11818
+ const hwPatterns = [
11819
+ /(?:Student Equipment|Hardware|Platform|Thiết bị|Thiết bị học tập)\s*(?:\(|:|\*)*\s*([^\n\r]+?)(?:\s*\*\*|[.).]?\s*$)/i,
11820
+ /(?:máy|device|machine)\s+([^,.;\n]{4,60}(?:M\d|Intel|PC|computer|mini)[^,.;\n]{0,30})/i
11821
+ ];
11822
+ for (const p of hwPatterns) {
11823
+ const m = lpRaw.match(p);
11824
+ if (m && !hw) {
11825
+ hw = m[1].trim();
11826
+ break;
11827
+ }
11828
+ }
11729
11829
  }
11730
11830
  } catch {
11731
11831
  }
11732
11832
  }
11833
+ let refPackContent;
11834
+ try {
11835
+ refPackContent = await storage.readSotDocument(projectId, "REFERENCE_PACK.md") || void 0;
11836
+ } catch {
11837
+ refPackContent = void 0;
11838
+ }
11733
11839
  const { runCurriculumAIInference: runCurriculumAIInference2 } = await Promise.resolve().then(() => (init_streamRunner(), streamRunner_exports));
11734
11840
  const targetLang = options.targetLanguage || plan.translation?.target_language || "vi";
11735
11841
  const result = await ensureKnowledgeExposition({
@@ -11741,6 +11847,7 @@ async function ensureExpositionForLesson(storage, projectId, lessonCode, options
11741
11847
  slcMarkdown: options.slcMarkdown,
11742
11848
  techStack: tech,
11743
11849
  hardwarePlatform: hw,
11850
+ refPack: refPackContent,
11744
11851
  llmFn: async (systemPrompt, userPrompt) => {
11745
11852
  const runnerOpts = options.customInference ? { customInference: options.customInference } : {};
11746
11853
  const out = await runCurriculumAIInference2(
@@ -26039,11 +26146,16 @@ async function produceSingleLesson(storage, projectId, lessonId, options = {}) {
26039
26146
  }).excerpt : "";
26040
26147
  let effectiveRefPack = refPack ? buildSectionAwareExcerpt(refPack, {
26041
26148
  priorities: [
26149
+ // Toolchain/version matrix FIRST — the most-frequently-hallucinated
26150
+ // facts are tool versions ("Xcode 15" vs ground truth "Xcode 16").
26151
+ // The bilingual fuzzy matcher in contextBuilder resolves these keys
26152
+ // even when the generated RefPack headings are Vietnamese.
26042
26153
  "Technical Overview & Architecture Blueprint",
26043
26154
  "Hardware Pinout & Wiring Configuration Matrix",
26155
+ "Standards Alignment",
26044
26156
  "Core Pedagogical Concept Anchor & Real-World Domain Bridge"
26045
26157
  ],
26046
- budget: 2500
26158
+ budget: 3500
26047
26159
  }).excerpt : "";
26048
26160
  const baseContextPrefix = `PROJECT & ACADEMIC CONTEXT:
26049
26161
  - Project ID: ${projectId}
@@ -26082,6 +26194,21 @@ ${renderHorizonPromptBlock(horizon)}`;
26082
26194
  } catch (hErr) {
26083
26195
  console.warn(`[produceSingleLesson] Notice: Curriculum Horizon extraction:`, hErr?.message || hErr);
26084
26196
  }
26197
+ const buildGroundTruthBlock = () => {
26198
+ const parts = [];
26199
+ if (expositionContext) {
26200
+ parts.push(`### KNOWLEDGE_EXPOSITION (CANONICAL KNOWLEDGE \u2014 teach from this, do not contradict)
26201
+ ${expositionContext}`);
26202
+ }
26203
+ if (effectiveRefPack) {
26204
+ parts.push(`### REFERENCE PACK GROUND TRUTH
26205
+ ${effectiveRefPack}`);
26206
+ }
26207
+ return parts.length > 0 ? `
26208
+
26209
+ [GROUND TRUTH]:
26210
+ ${parts.join("\n\n")}` : "";
26211
+ };
26085
26212
  const glossaryBlock = glossaryContext ? `
26086
26213
 
26087
26214
  [GLOSSARY TERMS (use these exact definitions)]:
@@ -26089,21 +26216,14 @@ ${glossaryContext}` : "";
26089
26216
  const standardsBlock = standardsContext ? `
26090
26217
 
26091
26218
  ${standardsContext}` : "";
26092
- const expositionBlock = expositionContext ? `
26093
-
26094
- [KNOWLEDGE_EXPOSITION (CANONICAL KNOWLEDGE \u2014 teach from this, do not contradict)]:
26095
- ${expositionContext}` : "";
26096
26219
  const sessionSliceBlock = sessionSliceContext ? `
26097
26220
 
26098
26221
  ${sessionSliceContext}` : "";
26099
- const assembleCommonContext = (ref, sg) => `${baseContextPrefix}
26222
+ const assembleCommonContext = (sg) => `${baseContextPrefix}
26100
26223
 
26101
26224
  [CONTENT STYLE GUIDE EXCERPT]:
26102
- ${sg}
26103
-
26104
- [REFERENCE PACK GROUND TRUTH]:
26105
- ${ref}${standardsBlock}${glossaryBlock}${expositionBlock}${sessionSliceBlock}${horizonBlock}`;
26106
- let commonContext = assembleCommonContext(effectiveRefPack, effectiveStyleGuide);
26225
+ ${sg}${standardsBlock}${glossaryBlock}${buildGroundTruthBlock()}${sessionSliceBlock}${horizonBlock}`;
26226
+ let commonContext = assembleCommonContext(effectiveStyleGuide);
26107
26227
  const MAX_COMPOSITE_PROMPT_CHARS = 3e4;
26108
26228
  const runnerOptions = options.customInference ? { customInference: options.customInference } : {};
26109
26229
  if (commonContext.length > MAX_COMPOSITE_PROMPT_CHARS && effectiveRefPack.length > 1e3) {
@@ -26114,14 +26234,14 @@ ${ref}${standardsBlock}${glossaryBlock}${expositionBlock}${sessionSliceBlock}${h
26114
26234
  ],
26115
26235
  budget: 1e3
26116
26236
  }).excerpt;
26117
- commonContext = assembleCommonContext(effectiveRefPack, effectiveStyleGuide);
26237
+ commonContext = assembleCommonContext(effectiveStyleGuide);
26118
26238
  }
26119
26239
  if (commonContext.length > MAX_COMPOSITE_PROMPT_CHARS && effectiveStyleGuide.length > 1e3) {
26120
26240
  effectiveStyleGuide = buildSectionAwareExcerpt(styleGuide, {
26121
26241
  priorities: ["Voice & Tone", "Standard Terminology (Glossary)"],
26122
26242
  budget: 1e3
26123
26243
  }).excerpt;
26124
- commonContext = assembleCommonContext(effectiveRefPack, effectiveStyleGuide);
26244
+ commonContext = assembleCommonContext(effectiveStyleGuide);
26125
26245
  }
26126
26246
  onProgress?.("@content", `[CONTEXT] Composite prompt ready (${commonContext.length} chars, adaptive budget <= ${MAX_COMPOSITE_PROMPT_CHARS})`, {
26127
26247
  type: "progress",
@@ -26472,7 +26592,7 @@ ${currentContent}` }],
26472
26592
  });
26473
26593
  }
26474
26594
  const lessonExcerptResult = buildSectionAwareExcerpt(lessonContent, {
26475
- priorities: DEFAULT_LESSON_PRIORITIES,
26595
+ priorities: SATELLITE_LESSON_PRIORITIES,
26476
26596
  budget: 12e3,
26477
26597
  sectionLanguageContract: slcMarkdown,
26478
26598
  artifactType: "LESSON"
@@ -26662,6 +26782,7 @@ ${buildHeadingDirective("QUIZ", slcMarkdown, targetLang)}`;
26662
26782
  } catch {
26663
26783
  }
26664
26784
  const { executeSlideProductionWorkflow: executeSlideProductionWorkflow2 } = await Promise.resolve().then(() => (init_slideProductionWorkflow(), slideProductionWorkflow_exports));
26785
+ const slideGroundContext = `${commonContext}${symbolLedgerBlock}`;
26665
26786
  const workflowResult = await executeSlideProductionWorkflow2({
26666
26787
  lessonMarkdown: lessonContent || "",
26667
26788
  lessonCode,
@@ -26670,6 +26791,7 @@ ${buildHeadingDirective("QUIZ", slcMarkdown, targetLang)}`;
26670
26791
  language: targetLang || "Vietnamese",
26671
26792
  languageDirective,
26672
26793
  headingDirective: buildHeadingDirective("SLIDE", slcMarkdown, targetLang),
26794
+ groundContext: slideGroundContext,
26673
26795
  satelliteContext,
26674
26796
  runnerOptions,
26675
26797
  onProgress: (agent, msg, meta) => {
@@ -26678,7 +26800,7 @@ ${buildHeadingDirective("QUIZ", slcMarkdown, targetLang)}`;
26678
26800
  });
26679
26801
  let deckJson = workflowResult.deckJson;
26680
26802
  const markdownWrapper = workflowResult.markdownWrapper;
26681
- let validation = presentationKitAi?.validateHtmlSlideDeck ? presentationKitAi.validateHtmlSlideDeck(deckJson, true) : deckJson && Array.isArray(deckJson.slides) ? { valid: true, score: 95, issues: [], slideCount: deckJson.slides.length} : { valid: false, score: 0, issues: [{ message: "Malformed JSON slide deck" }], slideCount: 0};
26803
+ let validation = presentationKitAi?.validateHtmlSlideDeck ? presentationKitAi.validateHtmlSlideDeck(deckJson, true) : deckJson && Array.isArray(deckJson.slides) ? { valid: true, score: 95, issues: [], slideCount: deckJson.slides.length} : { valid: false, score: 0, issues: [{ message: "Malformed JSON slide deck" }]};
26682
26804
  await storage.saveArtifact(projectId, slideRelPath, markdownWrapper);
26683
26805
  producedArtifacts.push(`SLIDE_${lessonCode}.md`);
26684
26806
  if (deckJson) {
@@ -26698,21 +26820,45 @@ ${buildHeadingDirective("QUIZ", slcMarkdown, targetLang)}`;
26698
26820
  }
26699
26821
  }
26700
26822
  }
26701
- const passed = Boolean(validation.valid && (validation.score ?? 100) >= 80);
26702
- const score = validation.score ?? (passed ? 95 : 50);
26703
- await storage.updateArtifactState(projectId, lessonCode, "SLIDE", {
26704
- state: passed ? "approved" : "rejected",
26705
- generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
26706
- contentHash: computeContentHash(markdownWrapper),
26707
- review: {
26708
- decision: passed ? "APPROVED" : "NEEDS_REVISION",
26709
- reviewedBy: "@agent-as-judge",
26710
- reviewedAt: (/* @__PURE__ */ new Date()).toISOString(),
26711
- score,
26712
- critique: passed ? `HTML Slide Deck passed strict schema validation (${score}/100, ${validation.slideCount ?? deckJson?.slides?.length ?? 0} slides). Auto-approved.` : `HTML Slide Deck failed schema validation: ${(validation.issues || []).map((i) => i.message).join("; ")}`
26713
- }
26714
- });
26715
- onProgress?.("@reviewer", passed ? `\u2705 SLIDE judge PASS (${score}/100) [html-deck schema validated]` : `\u26A0\uFE0F SLIDE judge NEEDS_REVISION (${score}/100) [html-deck schema issues]`);
26823
+ const structuralOk = Boolean(validation.valid && (validation.score ?? 100) >= 80);
26824
+ const structuralScore = validation.score ?? (structuralOk ? 95 : 50);
26825
+ const gateMode = gateModeFor(gates, "SLIDE");
26826
+ if (!structuralOk) {
26827
+ await storage.updateArtifactState(projectId, lessonCode, "SLIDE", {
26828
+ state: "rejected",
26829
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
26830
+ contentHash: computeContentHash(markdownWrapper),
26831
+ review: {
26832
+ decision: "NEEDS_REVISION",
26833
+ reviewedBy: "@heuristic-linter",
26834
+ reviewedAt: (/* @__PURE__ */ new Date()).toISOString(),
26835
+ score: structuralScore,
26836
+ critique: `HTML Slide Deck failed schema validation: ${(validation.issues || []).map((i) => i.message).join("; ")}`
26837
+ }
26838
+ });
26839
+ onProgress?.("@reviewer", `\u26A0\uFE0F SLIDE structural pre-check FAILED (${structuralScore}/100) [html-deck schema issues]`);
26840
+ } else {
26841
+ await storage.updateArtifactState(projectId, lessonCode, "SLIDE", {
26842
+ state: gateMode === "LLM_JUDGE" ? "pending" : "completed",
26843
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
26844
+ contentHash: computeContentHash(markdownWrapper)
26845
+ });
26846
+ onProgress?.("@reviewer", gateMode === "LLM_JUDGE" ? `\u2705 SLIDE structural pre-check PASS (${structuralScore}/100) \u2014 handing content review to LLM-as-Judge gate` : `\u2705 SLIDE structural pre-check PASS (${structuralScore}/100) [gate=${gateMode}, no LLM judge]`);
26847
+ const deckTextForJudge = Array.isArray(deckJson?.slides) ? deckJson.slides.map((s, i) => {
26848
+ const slotLines = Object.entries(s.slots || {}).map(([k, v]) => {
26849
+ if (Array.isArray(v)) return `- ${k}:
26850
+ ${v.map((item) => typeof item === "object" ? ` - ${JSON.stringify(item)}` : ` - ${item}`).join("\n")}`;
26851
+ if (v && typeof v === "object") return `- ${k}: ${JSON.stringify(v, null, 1)}`;
26852
+ return `- ${k}: ${v}`;
26853
+ }).join("\n");
26854
+ return `## Slide ${i + 1} [${s.layoutId}]
26855
+ ${slotLines}
26856
+
26857
+ Presenter Notes:
26858
+ ${s.notes || "(none)"}`;
26859
+ }).join("\n\n") : String(markdownWrapper);
26860
+ await judgeSat("SLIDE", deckTextForJudge);
26861
+ }
26716
26862
  } else {
26717
26863
  const canonicalSlideTemplate = loadCurriculumTemplate("SLIDE_template.md");
26718
26864
  const templateScaffold = canonicalSlideTemplate || `---
@@ -31715,6 +31861,6 @@ function renderMediaPlaceholder(entry) {
31715
31861
  return `> \u{1F5BC}\uFE0F [\u1EA2nh \u0111ang ch\u1EDD: ${entry.name} \u2014 s\u1EBD \u0111\u01B0\u1EE3c t\u1EA1o sau khi duy\u1EC7t media]`;
31716
31862
  }
31717
31863
 
31718
- export { ACT_TEMPLATE, ARTIFACT_DEPENDENCY_ROUTING, ARTIFACT_EXECUTION_ORDER, AcademicAuditor, ActiveLearningWorkflowSchema, ActivityLabSchema, ActivitySeqRowSchema, ActivityStepSchema, ArtifactContractRowSchema, AssessmentMapRowSchema, AssessmentObjectiveSchema, BELL_RINGER_TEMPLATE, BLOOM_ACTION_VERBS, BOM_TEMPLATE, BUNDLED_STANDARDS_PACK_IDS, BellRingerDaySchema, BellRingerSchema, BloomHintSchema, BloomLevelSchema, BloomTaxonomyEvaluator, BronzeTierSchema, CERConclusionSchema, CHOICE_BOARD_TEMPLATE, CODE_LAB_TEMPLATE, CURRICULUM_SLASH_COMMANDS, CardTierEnum, ChoiceBoardRubricRowSchema, ChoiceBoardSchema, ChoiceRuleSchema, ChoiceSquareSchema, ClassificationSchema, CodeHardwareFeasibilityEvaluator, CodeLabSchema, CodeSnippetSchema, CompetencyRubricRowSchema, ComputationalThinkingSchema, ConstructiveAlignmentEvaluator, CoreConceptSchema, CourseObjectiveSchema, CoverageReportSchema, CrossArtifactDriftEvaluator, CurriculumArtifactSchema, CurriculumError, CurriculumPlanSchema, CurriculumQualityReportSchema, DEFAULT_ARTIFACT_STREAM_IDLE_MS, DEFAULT_ARTIFACT_STREAM_TOTAL_MS, DEFAULT_ENABLED_PROVIDERS, DEFAULT_GATE_SETTINGS, DEFAULT_KX_PRIORITIES, DEFAULT_LESSON_PRIORITIES, DEFAULT_STREAM_IDLE_MS, DEFAULT_STREAM_TOTAL_MS, DEFAULT_VIETNAMESE_SECTION_HEADINGS, DependencyEdgeSchema, DepthAssignmentSchema, DepthLevelSchema, DeterministicPipelineRunner, DeterministicStructuralLinter, DiagnosticQuestionSchema, DiagnosticQuizSchema, EDPPhaseEnum, EXIT_TICKET_TEMPLATE, EXPOSITION_REL, EXT_TEMPLATE, EntryLevelSchema, ExitTicketBugHuntSchema, ExitTicketMetacognitionSchema, ExitTicketQuickItemSchema, ExitTicketRecallPromptSchema, ExitTicketSchema, ExperimentalDesignSchema, ExpositionApprovalError, ExtensionChallengeSchema, ExtensionSchema, FileSystemCurriculumAdapter, FiveEFlowPhaseSchema, FiveEInstructionalEvaluator, FiveEPhaseEnum, FrameworkMappingSchema, FrameworkPackManifestSchema, FrameworkPackSchema, FrameworkStatementSchema, GLOSSARY_TEMPLATE, GRAPHIC_ORGANIZER_TEMPLATE, GeneratedSlideArraySchema, GeneratedSlideSchema, GlossaryQuickRefRowSchema, GlossarySchema, GlossaryTermSchema, GoldTierSchema, GradeBandSchema, GraphicOrganizerItemSchema, GraphicOrganizerSchema, HANDOUT_TEMPLATE, HandoutSchema, HandoutSectionSchema, HybridBlueprintArraySchema, HybridBlueprintItemSchema, HybridDeckSlideArraySchema, HybridDeckSlideSchema, HybridPipelineError, InstructionSectionSchema, InstructionStepSchema, JudgeCriterionSchema, LAYER_IDLE_BUDGET_MS, LAYER_TOTAL_BUDGET_MS, LESSON_PLAN_TEMPLATE, LLMJudgeEngine, LabTierTaskSchema, LearningObjectiveInputSchema, LearningObjectiveRowSchema, LessonFlowPhaseSchema, LessonPlan5ESchema, LessonPlanEDPSchema, LessonPlanSchema, LessonSectionSchema, LocalWorkspaceManager, MappingKindSchema, MarpSlideSchema, MediaError, MediaLedger, MentorCheatsheetSchema, MilestoneInputSchema, MisconceptionEvaluator, MisconceptionSchema, ModelPolicyResolver, NVIDIA_MODELS, NodeKindSchema, OrganizerTypeEnum, PROJECT_INSTRUCTION_TEMPLATE, PhaseInputSchema, PlanConstraintsSchema, PlannerInputSchema, PlanningGraphSchema, PlanningNodeSchema, PrerequisiteDecisionEntrySchema, PrerequisiteDecisionSchema, ProductGoalSchema, ProgressiveHintsSchema, ProjectGraphSchema, ProjectInstructionSchema, ProjectProfileSchema, QUIZ_TEMPLATE, QualityAuditVerdictSchema, QuizOptionSchema, REVIEW_GAME_TEMPLATE, RUBRIC_TEMPLATE, RecordProvenanceSchema, ResourceMapRowSchema, ReviewGameExportRowSchema, ReviewGameQuestionSchema, ReviewGameSchema, RoadmapInputSchema, RotationStationSchema, RubricCriteriaSchema, RubricSchema, SCIENCE_LAB_TEMPLATE, SELF_LAB_TEMPLATE, SLIDE_CANONICAL_METHODOLOGY, SLIDE_LAYOUT_PRESETS, SLIDE_TEMPLATE, STANDARD_REF_REGEX, STANDARD_SOT_FILES, STATION_ROTATION_TEMPLATE, ScaffoldDecisionEntrySchema, ScaffoldDecisionSchema, ScienceLabSchema, ScoringRubricRowSchema, SelfLabSchema, SelfPacedBundleSchema, SelfPacedChallengeSchema, SessionPlanSchema, SilverTierSchema, SlideBlueprintArraySchema, SlideBlueprintItemSchema, SlideDeckSchema, StandardizedTermRowSchema, StandardsRegistryAdapter, StationRecordRowSchema, StationRotationSchema, StationTypeEnum, SupabaseCurriculumAdapter, TASK_CARDS_TEMPLATE, TEACHER_GUIDE_TEMPLATE, TIERED_PRACTICE_TEMPLATE, TaskCardSchema, TaskCardsSchema, TeacherGuideSchema, TeachingScriptPhaseSchema, TierLevelEnum, TierObjectiveSchema, TieredPracticeSchema, TranslationPolicySchema, TroubleshootingEntrySchema, TroubleshootingRowSchema, UnitPlanSchema, UserJourneySchema, WORKSHEET_TEMPLATE, WorksheetItemSchema, WorksheetItemTypeEnum, WorksheetPartSchema, WorksheetSchema, activityTools, analystTools, analyzeProjectCreationIntent, assertAcyclic, assessorTools, auditCurriculumQualityFlow, auditQualityReport, buildActivityPrompt, buildCodeLabPrompt, buildCurriculumContext, buildCurriculumPlan, buildDeliveryPackages, buildDiagnosticQuizPrompt, buildDomainLexiconGuardrail, buildExpositionContext, buildExpositionExcerpt, buildExtensionPrompt, buildHandoutPrompt, buildHeadingDirective, buildHtmlDeckSlidePrompt, buildImagePrompt, buildJudgePrompt, buildLanguageDirective, buildLessonExcerpt, buildLessonMasterPrompt, buildMarpMarkdownSlidePrompt, buildProjectInstructionPrompt, buildSectionAwareExcerpt, buildSelfLabPrompt, buildSessionSliceContext, buildSlidesPrompt, buildStandardStackMarkdown, buildStandardsContext, buildStandardsContextBlock, buildTeacherGuidePrompt, buildWorksheetPrompt, closeTruncatedJson, computeContentHash, computePackingSpec, conductPreliminaryResearch, contentTools, convertRoadmapToFoundationSot, createAiInferenceError, createContextMissingError, createCurriculumStorage, createIdleAbortController, createStreamAbortController, createStreamAbortSignal, createStreamChunkExtractor, curateMediaLedger, designerTools, detectProjectPedagogy, ensureExpositionForLesson, ensureKnowledgeExposition, evaluateStandardsCoverage, executeCurriculumCommand, executeSlideProductionWorkflow, exportAllProjectQuizzes, expositionCacheKey, extractCurriculumHorizon, extractJsonArray, extractScopeSequenceRows, extractSectionHeadingsFromSLC, extractSessionSlice, extractStandardRefs, extractStreamChunk, extractSymbolLedger, extractThoughtAndContent, findStandardStatement, formatQuizzesToCsv, fulfillMediaLedger, gateModeFor, generateActivityFlow, generateCodeLabFlow, generateDiagnosticQuizFlow, generateEducationalImage, generateExtensionFlow, generateHandoutFlow, generateLessonMasterFlow, generateMilestoneCurriculumBundle, generatePhase1SotArtifacts, generatePhase2SotArtifacts, generateProjectInstruction, generateProjectInstructionFlow, generateRoadmapCurriculum, generateSelfLabFlow, generateSelfPacedBundle, generateSingleArtifact, generateSlidesFlow, generateTeacherGuideFlow, generateWorksheetFlow, getAIModel, getArtifactMetadata, getDesignatedFallbackChain, getDesignatedFallbackConfig, getLessonMetadata, getProjectArtifactScope, getProjectStatusReport, getSlideLayoutPresetById, getSlideLayoutPresetsByCategory, getSmartResumeContext, glossaryTermsForSession, illustratorTools, importRoadmapToProject, ingestProjectGraphIntoProject, initializeProjectInStorage, injectMediaIntoMarkdown, isExpositionFresh, isModelAllowed, isProviderEnabled, isTranslationDue, lintAndSanitizeArtifact, lintCurriculumFramework, lintFrameworkPack, loadCurriculumTemplate, loadSotTemplate, normalizePlanningGraph, normalizeSlcContract, packagerTools, parseAllSessions, parseGateSettings, parseQuizMarkdown, parseRoadmapJsonToProjectPayload, produceBatchLessons, produceSingleLesson, publishToGitHub, publishToSupabase, rankGenCandidates, renderFrameworkFromPlan, renderHorizonPromptBlock, renderMediaPlaceholder, researcherTools, resolveGateSettings, resolveStandardsPacks, resolveStreamBudget, resolveTargetLanguageCode, resolveTranslationTargets, reviewerTools, runCurriculumAIInference, safeParseJson, searchEducationalImages, searchEducationalVideos, selectStatementsForLesson, serializeActivityToMarkdown, serializeCodeLabToMarkdown, serializeDiagnosticQuizToMarkdown, serializeHandoutToMarkdown, serializeLessonToMarkdown, serializeProjectInstructionToMarkdown, serializeSelfLabToMarkdown, slugifyProjectName, streamCurriculumAIInference, streamCurriculumAIInferenceWithTools, streamDiagnosticQuizFlow, streamLLMWithFallback, streamLayerPrefillWithFallback, streamLessonMasterFlow, streamSelfLabFlow, stripLlmJsonWrappers, targetLanguageDisplayName, techSmeTools, topoSort, uploadAssetToBucket, validateArtifactDependencies, validateCurriculumPlan, validateFrameworkPack, validateHorizonCompliance, validateHybridDeckSlides, validateMarkdownTables, validateMermaidSyntax, withAutoRepair };
31864
+ export { ACT_TEMPLATE, ARTIFACT_DEPENDENCY_ROUTING, ARTIFACT_EXECUTION_ORDER, AcademicAuditor, ActiveLearningWorkflowSchema, ActivityLabSchema, ActivitySeqRowSchema, ActivityStepSchema, ArtifactContractRowSchema, AssessmentMapRowSchema, AssessmentObjectiveSchema, BELL_RINGER_TEMPLATE, BLOOM_ACTION_VERBS, BOM_TEMPLATE, BUNDLED_STANDARDS_PACK_IDS, BellRingerDaySchema, BellRingerSchema, BloomHintSchema, BloomLevelSchema, BloomTaxonomyEvaluator, BronzeTierSchema, CERConclusionSchema, CHOICE_BOARD_TEMPLATE, CODE_LAB_TEMPLATE, CURRICULUM_SLASH_COMMANDS, CardTierEnum, ChoiceBoardRubricRowSchema, ChoiceBoardSchema, ChoiceRuleSchema, ChoiceSquareSchema, ClassificationSchema, CodeHardwareFeasibilityEvaluator, CodeLabSchema, CodeSnippetSchema, CompetencyRubricRowSchema, ComputationalThinkingSchema, ConstructiveAlignmentEvaluator, CoreConceptSchema, CourseObjectiveSchema, CoverageReportSchema, CrossArtifactDriftEvaluator, CurriculumArtifactSchema, CurriculumError, CurriculumPlanSchema, CurriculumQualityReportSchema, DEFAULT_ARTIFACT_STREAM_IDLE_MS, DEFAULT_ARTIFACT_STREAM_TOTAL_MS, DEFAULT_ENABLED_PROVIDERS, DEFAULT_GATE_SETTINGS, DEFAULT_KX_PRIORITIES, DEFAULT_LESSON_PRIORITIES, DEFAULT_STREAM_IDLE_MS, DEFAULT_STREAM_TOTAL_MS, DEFAULT_VIETNAMESE_SECTION_HEADINGS, DependencyEdgeSchema, DepthAssignmentSchema, DepthLevelSchema, DeterministicPipelineRunner, DeterministicStructuralLinter, DiagnosticQuestionSchema, DiagnosticQuizSchema, EDPPhaseEnum, EXIT_TICKET_TEMPLATE, EXPOSITION_REL, EXT_TEMPLATE, EntryLevelSchema, ExitTicketBugHuntSchema, ExitTicketMetacognitionSchema, ExitTicketQuickItemSchema, ExitTicketRecallPromptSchema, ExitTicketSchema, ExperimentalDesignSchema, ExpositionApprovalError, ExtensionChallengeSchema, ExtensionSchema, FileSystemCurriculumAdapter, FiveEFlowPhaseSchema, FiveEInstructionalEvaluator, FiveEPhaseEnum, FrameworkMappingSchema, FrameworkPackManifestSchema, FrameworkPackSchema, FrameworkStatementSchema, GLOSSARY_TEMPLATE, GRAPHIC_ORGANIZER_TEMPLATE, GeneratedSlideArraySchema, GeneratedSlideSchema, GlossaryQuickRefRowSchema, GlossarySchema, GlossaryTermSchema, GoldTierSchema, GradeBandSchema, GraphicOrganizerItemSchema, GraphicOrganizerSchema, HANDOUT_TEMPLATE, HandoutSchema, HandoutSectionSchema, HybridBlueprintArraySchema, HybridBlueprintItemSchema, HybridDeckSlideArraySchema, HybridDeckSlideSchema, HybridPipelineError, InstructionSectionSchema, InstructionStepSchema, JudgeCriterionSchema, LAYER_IDLE_BUDGET_MS, LAYER_TOTAL_BUDGET_MS, LESSON_PLAN_TEMPLATE, LLMJudgeEngine, LabTierTaskSchema, LearningObjectiveInputSchema, LearningObjectiveRowSchema, LessonFlowPhaseSchema, LessonPlan5ESchema, LessonPlanEDPSchema, LessonPlanSchema, LessonSectionSchema, LocalWorkspaceManager, MappingKindSchema, MarpSlideSchema, MediaError, MediaLedger, MentorCheatsheetSchema, MilestoneInputSchema, MisconceptionEvaluator, MisconceptionSchema, ModelPolicyResolver, NVIDIA_MODELS, NodeKindSchema, OrganizerTypeEnum, PROJECT_INSTRUCTION_TEMPLATE, PhaseInputSchema, PlanConstraintsSchema, PlannerInputSchema, PlanningGraphSchema, PlanningNodeSchema, PrerequisiteDecisionEntrySchema, PrerequisiteDecisionSchema, ProductGoalSchema, ProgressiveHintsSchema, ProjectGraphSchema, ProjectInstructionSchema, ProjectProfileSchema, QUIZ_TEMPLATE, QualityAuditVerdictSchema, QuizOptionSchema, REVIEW_GAME_TEMPLATE, RUBRIC_TEMPLATE, RecordProvenanceSchema, ResourceMapRowSchema, ReviewGameExportRowSchema, ReviewGameQuestionSchema, ReviewGameSchema, RoadmapInputSchema, RotationStationSchema, RubricCriteriaSchema, RubricSchema, SATELLITE_LESSON_PRIORITIES, SCIENCE_LAB_TEMPLATE, SELF_LAB_TEMPLATE, SLIDE_CANONICAL_METHODOLOGY, SLIDE_LAYOUT_PRESETS, SLIDE_TEMPLATE, STANDARD_REF_REGEX, STANDARD_SOT_FILES, STATION_ROTATION_TEMPLATE, ScaffoldDecisionEntrySchema, ScaffoldDecisionSchema, ScienceLabSchema, ScoringRubricRowSchema, SelfLabSchema, SelfPacedBundleSchema, SelfPacedChallengeSchema, SessionPlanSchema, SilverTierSchema, SlideBlueprintArraySchema, SlideBlueprintItemSchema, SlideDeckSchema, StandardizedTermRowSchema, StandardsRegistryAdapter, StationRecordRowSchema, StationRotationSchema, StationTypeEnum, SupabaseCurriculumAdapter, TASK_CARDS_TEMPLATE, TEACHER_GUIDE_TEMPLATE, TIERED_PRACTICE_TEMPLATE, TaskCardSchema, TaskCardsSchema, TeacherGuideSchema, TeachingScriptPhaseSchema, TierLevelEnum, TierObjectiveSchema, TieredPracticeSchema, TranslationPolicySchema, TroubleshootingEntrySchema, TroubleshootingRowSchema, UnitPlanSchema, UserJourneySchema, WORKSHEET_TEMPLATE, WorksheetItemSchema, WorksheetItemTypeEnum, WorksheetPartSchema, WorksheetSchema, activityTools, analystTools, analyzeProjectCreationIntent, assertAcyclic, assessorTools, atomicWriteFileSync, auditCurriculumQualityFlow, auditQualityReport, buildActivityPrompt, buildCodeLabPrompt, buildCurriculumContext, buildCurriculumPlan, buildDeliveryPackages, buildDiagnosticQuizPrompt, buildDomainLexiconGuardrail, buildExpositionContext, buildExpositionExcerpt, buildExtensionPrompt, buildHandoutPrompt, buildHeadingDirective, buildHtmlDeckSlidePrompt, buildImagePrompt, buildJudgePrompt, buildLanguageDirective, buildLessonExcerpt, buildLessonMasterPrompt, buildMarpMarkdownSlidePrompt, buildProjectInstructionPrompt, buildSectionAwareExcerpt, buildSelfLabPrompt, buildSessionSliceContext, buildSlidesPrompt, buildStandardStackMarkdown, buildStandardsContext, buildStandardsContextBlock, buildTeacherGuidePrompt, buildWorksheetPrompt, closeTruncatedJson, computeContentHash, computePackingSpec, conductPreliminaryResearch, contentTools, convertRoadmapToFoundationSot, createAiInferenceError, createContextMissingError, createCurriculumStorage, createIdleAbortController, createStreamAbortController, createStreamAbortSignal, createStreamChunkExtractor, curateMediaLedger, designerTools, detectProjectPedagogy, emitUsage, ensureExpositionForLesson, ensureKnowledgeExposition, evaluateStandardsCoverage, executeCurriculumCommand, executeSlideProductionWorkflow, exportAllProjectQuizzes, expositionCacheKey, extractCurriculumHorizon, extractJsonArray, extractScopeSequenceRows, extractSectionHeadingsFromSLC, extractSessionSlice, extractStandardRefs, extractStreamChunk, extractSymbolLedger, extractThoughtAndContent, findStandardStatement, formatQuizzesToCsv, fulfillMediaLedger, gateModeFor, generateActivityFlow, generateCodeLabFlow, generateDiagnosticQuizFlow, generateEducationalImage, generateExtensionFlow, generateHandoutFlow, generateLessonMasterFlow, generateMilestoneCurriculumBundle, generatePhase1SotArtifacts, generatePhase2SotArtifacts, generateProjectInstruction, generateProjectInstructionFlow, generateRoadmapCurriculum, generateSelfLabFlow, generateSelfPacedBundle, generateSingleArtifact, generateSlidesFlow, generateTeacherGuideFlow, generateWorksheetFlow, getAIModel, getArtifactMetadata, getDesignatedFallbackChain, getDesignatedFallbackConfig, getLessonMetadata, getProjectArtifactScope, getProjectStatusReport, getSlideLayoutPresetById, getSlideLayoutPresetsByCategory, getSmartResumeContext, glossaryTermsForSession, illustratorTools, importRoadmapToProject, ingestProjectGraphIntoProject, initializeProjectInStorage, injectMediaIntoMarkdown, isExpositionFresh, isModelAllowed, isProviderEnabled, isTranslationDue, lintAndSanitizeArtifact, lintCurriculumFramework, lintFrameworkPack, loadCurriculumTemplate, loadSotTemplate, normalizePlanningGraph, normalizeSlcContract, packagerTools, parseAllSessions, parseGateSettings, parseQuizMarkdown, parseRoadmapJsonToProjectPayload, produceBatchLessons, produceSingleLesson, publishToGitHub, publishToSupabase, rankGenCandidates, renderFrameworkFromPlan, renderHorizonPromptBlock, renderMediaPlaceholder, researcherTools, resolveGateSettings, resolveStandardsPacks, resolveStreamBudget, resolveTargetLanguageCode, resolveTranslationTargets, reviewerTools, runCurriculumAIInference, safeParseJson, searchEducationalImages, searchEducationalVideos, selectStatementsForLesson, serializeActivityToMarkdown, serializeCodeLabToMarkdown, serializeDiagnosticQuizToMarkdown, serializeHandoutToMarkdown, serializeLessonToMarkdown, serializeProjectInstructionToMarkdown, serializeSelfLabToMarkdown, slugifyProjectName, streamCurriculumAIInference, streamCurriculumAIInferenceWithTools, streamDiagnosticQuizFlow, streamLLMWithFallback, streamLayerPrefillWithFallback, streamLessonMasterFlow, streamSelfLabFlow, stripLlmJsonWrappers, targetLanguageDisplayName, techSmeTools, topoSort, uploadAssetToBucket, validateArtifactDependencies, validateCurriculumPlan, validateFrameworkPack, validateHorizonCompliance, validateHybridDeckSlides, validateMarkdownTables, validateMermaidSyntax, withAutoRepair };
31719
31865
  //# sourceMappingURL=index.mjs.map
31720
31866
  //# sourceMappingURL=index.mjs.map