@thanh01.pmt/curriculum-kit 1.4.15 → 1.4.17
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/LICENSE +21 -0
- package/dist/index.cjs +366 -201
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +114 -5
- package/dist/index.d.ts +114 -5
- package/dist/index.mjs +366 -201
- package/dist/index.mjs.map +1 -1
- package/dist/workflow/index.cjs +62 -14
- package/dist/workflow/index.cjs.map +1 -1
- package/dist/workflow/index.mjs +62 -14
- package/dist/workflow/index.mjs.map +1 -1
- package/package.json +23 -23
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import fs2 from 'fs';
|
|
2
2
|
import path3 from 'path';
|
|
3
|
-
import { jsonrepair } from 'jsonrepair';
|
|
4
|
-
import { z } from 'zod';
|
|
5
3
|
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
|
6
4
|
import { createOpenAI } from '@ai-sdk/openai';
|
|
7
5
|
import { createDeepSeek } from '@ai-sdk/deepseek';
|
|
6
|
+
import { z } from 'zod';
|
|
8
7
|
import { generateObject, streamObject, streamText } from 'ai';
|
|
8
|
+
import pRetry from 'p-retry';
|
|
9
|
+
import { jsonrepair } from 'jsonrepair';
|
|
9
10
|
import pLimit from 'p-limit';
|
|
10
11
|
import fsPromises from 'fs/promises';
|
|
11
12
|
import crypto, { createHash } from 'crypto';
|
|
@@ -878,6 +879,132 @@ var init_streamRunner = __esm({
|
|
|
878
879
|
DEFAULT_ARTIFACT_STREAM_TOTAL_MS = 48e4;
|
|
879
880
|
}
|
|
880
881
|
});
|
|
882
|
+
function getAIModel(options = {}) {
|
|
883
|
+
const designated = getDesignatedFallbackConfig();
|
|
884
|
+
const defaultProvider = process.env.DEFAULT_AI_PROVIDER || process.env.LLM_PROVIDER || detectDefaultProvider();
|
|
885
|
+
let provider = (options.provider || defaultProvider).toLowerCase();
|
|
886
|
+
if (!isProviderEnabled(provider)) {
|
|
887
|
+
console.warn(`[provider-factory] Provider "${provider}" is disabled via environment toggle. Falling back to designated provider "${designated.provider}".`);
|
|
888
|
+
provider = designated.provider;
|
|
889
|
+
}
|
|
890
|
+
let resolvedModelName = options.modelName || process.env.DEFAULT_AI_MODEL || process.env.LLM_MODEL || DEFAULT_MODELS[provider] || designated.model;
|
|
891
|
+
if (!isModelAllowed(resolvedModelName)) {
|
|
892
|
+
console.warn(`[provider-factory] Model "${resolvedModelName}" is not permitted by ALLOWED_AI_MODELS. Using designated model "${designated.model}".`);
|
|
893
|
+
resolvedModelName = designated.model;
|
|
894
|
+
}
|
|
895
|
+
if (provider === "nvidia") {
|
|
896
|
+
const apiKey = options.apiKey || process.env.NVIDIA_API_KEY || "";
|
|
897
|
+
const nvidia = createOpenAI({
|
|
898
|
+
apiKey,
|
|
899
|
+
baseURL: options.baseURL || "https://integrate.api.nvidia.com/v1"
|
|
900
|
+
});
|
|
901
|
+
return nvidia.chat(resolvedModelName || "nvidia/nemotron-3-ultra-550b-a55b:free");
|
|
902
|
+
}
|
|
903
|
+
if (provider === "openrouter") {
|
|
904
|
+
const apiKey = options.apiKey || process.env.OPENROUTER_API_KEY || process.env.OPENAI_API_KEY || "";
|
|
905
|
+
const openrouter = createOpenAI({
|
|
906
|
+
apiKey,
|
|
907
|
+
baseURL: options.baseURL || "https://openrouter.ai/api/v1"
|
|
908
|
+
});
|
|
909
|
+
return openrouter.chat(resolvedModelName || "@preset/coding-free");
|
|
910
|
+
}
|
|
911
|
+
if (provider === "alibaba" || provider === "dashscope") {
|
|
912
|
+
const effectiveKey = options.apiKey || process.env.ALIBABA_API_KEY || process.env.DASHSCOPE_API_KEY || process.env.SAAS_ALIBABA_API_KEY || process.env.SAAS_DASHSCOPE_API_KEY || "";
|
|
913
|
+
let defaultBaseURL = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1";
|
|
914
|
+
if (effectiveKey.startsWith("sk-sp-")) {
|
|
915
|
+
defaultBaseURL = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1";
|
|
916
|
+
}
|
|
917
|
+
const rawUrl = options.baseURL || process.env.ALIBABA_BASE_URL || process.env.DASHSCOPE_BASE_URL || defaultBaseURL;
|
|
918
|
+
const cleanBaseURL = rawUrl.replace(/^["']|["']$/g, "").trim();
|
|
919
|
+
const alibaba = createOpenAI({
|
|
920
|
+
apiKey: effectiveKey,
|
|
921
|
+
baseURL: cleanBaseURL
|
|
922
|
+
// Passthrough: no forced format injection — the Vercel AI SDK's generateObject
|
|
923
|
+
// already instructs the model to return JSON via its schema definition.
|
|
924
|
+
// Injecting 'Output format: JSON.' into markdown-based lesson prompts caused
|
|
925
|
+
// model confusion (mixed markdown + JSON output).
|
|
926
|
+
});
|
|
927
|
+
return alibaba.chat(resolvedModelName);
|
|
928
|
+
}
|
|
929
|
+
if (provider === "google") {
|
|
930
|
+
const apiKey = options.apiKey || process.env.GOOGLE_GENERATIVE_AI_API_KEY || process.env.GEMINI_API_KEY || "";
|
|
931
|
+
const google = createGoogleGenerativeAI({ apiKey });
|
|
932
|
+
return google(resolvedModelName);
|
|
933
|
+
}
|
|
934
|
+
if (provider === "deepseek") {
|
|
935
|
+
const apiKey = options.apiKey || process.env.DEEPSEEK_API_KEY || process.env.SAAS_DEEPSEEK_API_KEY || "";
|
|
936
|
+
const deepseek = createDeepSeek({ apiKey });
|
|
937
|
+
return deepseek(resolvedModelName);
|
|
938
|
+
}
|
|
939
|
+
if (provider === "openai") {
|
|
940
|
+
const apiKey = options.apiKey || process.env.OPENAI_API_KEY || "";
|
|
941
|
+
const openai = createOpenAI({
|
|
942
|
+
apiKey,
|
|
943
|
+
baseURL: options.baseURL || process.env.OPENAI_BASE_URL
|
|
944
|
+
});
|
|
945
|
+
return openai.chat(resolvedModelName);
|
|
946
|
+
}
|
|
947
|
+
if (provider === "ollama") {
|
|
948
|
+
const apiKey = options.apiKey || process.env.OLLAMA_API_KEY || "ollama";
|
|
949
|
+
const baseURL = options.baseURL || process.env.OLLAMA_BASE_URL || process.env.OPENAI_BASE_URL || "http://127.0.0.1:11434/v1";
|
|
950
|
+
const ollama = createOpenAI({
|
|
951
|
+
apiKey,
|
|
952
|
+
baseURL
|
|
953
|
+
});
|
|
954
|
+
return ollama.chat(resolvedModelName || "qwen2.5:latest");
|
|
955
|
+
}
|
|
956
|
+
const fallback = createOpenAI({
|
|
957
|
+
apiKey: options.apiKey || process.env.OPENAI_API_KEY || "",
|
|
958
|
+
baseURL: options.baseURL || process.env.OPENAI_BASE_URL
|
|
959
|
+
});
|
|
960
|
+
return fallback.chat(resolvedModelName);
|
|
961
|
+
}
|
|
962
|
+
function detectDefaultProvider() {
|
|
963
|
+
if (process.env.NVIDIA_API_KEY && isProviderEnabled("nvidia")) {
|
|
964
|
+
return "nvidia";
|
|
965
|
+
}
|
|
966
|
+
if (process.env.OPENROUTER_API_KEY && isProviderEnabled("openrouter")) {
|
|
967
|
+
return "openrouter";
|
|
968
|
+
}
|
|
969
|
+
if ((process.env.ALIBABA_API_KEY || process.env.DASHSCOPE_API_KEY || process.env.SAAS_ALIBABA_API_KEY) && isProviderEnabled("alibaba")) {
|
|
970
|
+
return "alibaba";
|
|
971
|
+
}
|
|
972
|
+
if ((process.env.GOOGLE_GENERATIVE_AI_API_KEY || process.env.GEMINI_API_KEY) && (isProviderEnabled("gemini") || isProviderEnabled("google"))) {
|
|
973
|
+
return "google";
|
|
974
|
+
}
|
|
975
|
+
if ((process.env.DEEPSEEK_API_KEY || process.env.SAAS_DEEPSEEK_API_KEY) && isProviderEnabled("deepseek")) {
|
|
976
|
+
return "deepseek";
|
|
977
|
+
}
|
|
978
|
+
if (process.env.OPENAI_API_KEY && process.env.OPENAI_API_KEY !== "ollama" && isProviderEnabled("openai")) {
|
|
979
|
+
return "openai";
|
|
980
|
+
}
|
|
981
|
+
return getDesignatedFallbackConfig().provider;
|
|
982
|
+
}
|
|
983
|
+
var DEFAULT_MODELS, NVIDIA_MODELS;
|
|
984
|
+
var init_provider_factory = __esm({
|
|
985
|
+
"src/ai/provider-factory.ts"() {
|
|
986
|
+
init_streamRunner();
|
|
987
|
+
DEFAULT_MODELS = {
|
|
988
|
+
nvidia: "nvidia/nemotron-3-ultra-550b-a55b:free",
|
|
989
|
+
openrouter: "@preset/coding-free",
|
|
990
|
+
alibaba: "qwen3.7-plus",
|
|
991
|
+
dashscope: "qwen3.7-plus",
|
|
992
|
+
google: "gemini-1.5-flash",
|
|
993
|
+
deepseek: "deepseek-chat",
|
|
994
|
+
openai: "gpt-4o-mini",
|
|
995
|
+
ollama: "deepseek-v4-flash:0731"
|
|
996
|
+
};
|
|
997
|
+
NVIDIA_MODELS = {
|
|
998
|
+
codingFast: "nvidia/nemotron-3.5-lightning-30b-a3b",
|
|
999
|
+
reasoningUltra: "nvidia/nemotron-3-ultra-550b-a55b:free",
|
|
1000
|
+
superMoE: "nvidia/nemotron-3-super-120b-a12b",
|
|
1001
|
+
llamaNemotron: "nvidia/llama-3.1-nemotron-70b-instruct",
|
|
1002
|
+
translation: "nvidia/riva-translate-4b-instruct-v2",
|
|
1003
|
+
embedding: "nvidia/nemotron-3-embed-1b",
|
|
1004
|
+
visionLlama: "meta/llama-3.2-11b-vision-instruct"
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
881
1008
|
|
|
882
1009
|
// src/pipeline/artifactLinter.ts
|
|
883
1010
|
var artifactLinter_exports = {};
|
|
@@ -1289,8 +1416,9 @@ ${p.content.slice(0, 500)}...`
|
|
|
1289
1416
|
const countGuidance = targetSlideCount ? `The target is approximately ${targetSlideCount} slides.` : `Determine the organic, optimal number of slides based directly on the canonical LESSON plan: every instructional move, concept explanation, code walkthrough, activity phase, and quiz checkpoint must receive adequate slide coverage without artificial cramming or stretching.`;
|
|
1290
1417
|
const outputGuidance = targetSlideCount ? `Output ONLY a valid JSON array of ${targetSlideCount} objects.` : `Output ONLY a valid JSON array of objects (one object per planned slide).`;
|
|
1291
1418
|
return `
|
|
1292
|
-
You are @illustrator, Chief Slide Architect
|
|
1293
|
-
Your task is to analyze the canonical LESSON plan and architect an authoritative, high-fidelity **SLIDE BLUEPRINT
|
|
1419
|
+
You are @illustrator, Chief Slide Architect.
|
|
1420
|
+
Your task is to analyze the canonical LESSON plan ("${lessonFlow.lessonTitle}") and architect an authoritative, high-fidelity **SLIDE BLUEPRINT** (a slide-by-slide presentation deck outline for this single lesson).
|
|
1421
|
+
IMPORTANT: Do NOT output a course outline or lessons list. You are designing presentation SLIDES for this lesson.
|
|
1294
1422
|
${countGuidance}
|
|
1295
1423
|
|
|
1296
1424
|
### \u{1F3DB}\uFE0F PEDAGOGICAL GROUND TRUTH (FROM CANONICAL LESSON):
|
|
@@ -1455,12 +1583,52 @@ var init_slideBatchPrompt = __esm({
|
|
|
1455
1583
|
// src/services/slideProductionWorkflow.ts
|
|
1456
1584
|
var slideProductionWorkflow_exports = {};
|
|
1457
1585
|
__export(slideProductionWorkflow_exports, {
|
|
1586
|
+
GeneratedSlideArraySchema: () => GeneratedSlideArraySchema,
|
|
1587
|
+
GeneratedSlideSchema: () => GeneratedSlideSchema,
|
|
1588
|
+
SlideBlueprintArraySchema: () => SlideBlueprintArraySchema,
|
|
1589
|
+
SlideBlueprintItemSchema: () => SlideBlueprintItemSchema,
|
|
1458
1590
|
executeSlideProductionWorkflow: () => executeSlideProductionWorkflow
|
|
1459
1591
|
});
|
|
1460
|
-
function
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1592
|
+
async function inferStructured(schema, systemPrompt, userPrompt, options, label) {
|
|
1593
|
+
try {
|
|
1594
|
+
const model = getAIModel(options.modelOptions);
|
|
1595
|
+
const { object } = await generateObject({
|
|
1596
|
+
model,
|
|
1597
|
+
schema,
|
|
1598
|
+
system: systemPrompt || void 0,
|
|
1599
|
+
prompt: userPrompt
|
|
1600
|
+
});
|
|
1601
|
+
const validated = schema.safeParse(object);
|
|
1602
|
+
if (validated.success) return validated.data;
|
|
1603
|
+
console.warn(
|
|
1604
|
+
`[SlideProductionWorkflow] AI SDK output failed schema validation for ${label}:`,
|
|
1605
|
+
validated.error?.message
|
|
1606
|
+
);
|
|
1607
|
+
} catch (aiSdkErr) {
|
|
1608
|
+
console.warn(`[SlideProductionWorkflow] AI SDK generateObject failed for ${label}:`, aiSdkErr?.message || aiSdkErr);
|
|
1609
|
+
}
|
|
1610
|
+
if (options.allowLegacyFallback === false) return null;
|
|
1611
|
+
try {
|
|
1612
|
+
const messages = [
|
|
1613
|
+
{ role: "user", content: [systemPrompt, userPrompt].filter(Boolean).join("\n\n") }
|
|
1614
|
+
];
|
|
1615
|
+
const raw = await runCurriculumAIInference(messages, options.satelliteContext || "", options.runnerOptions);
|
|
1616
|
+
const fenceMatch = raw.match(/```(?:json)?\s*([\s\S]*?)\s*```/i);
|
|
1617
|
+
const candidate = (fenceMatch ? fenceMatch[1] : raw).trim();
|
|
1618
|
+
let parsed;
|
|
1619
|
+
try {
|
|
1620
|
+
parsed = JSON.parse(candidate);
|
|
1621
|
+
} catch {
|
|
1622
|
+
parsed = JSON.parse(jsonrepair(candidate));
|
|
1623
|
+
}
|
|
1624
|
+
const result = schema.safeParse(parsed);
|
|
1625
|
+
if (result.success) return result.data;
|
|
1626
|
+
console.warn(`[SlideProductionWorkflow] Legacy fallback output failed schema validation for ${label}:`, result.error?.message);
|
|
1627
|
+
return null;
|
|
1628
|
+
} catch (legacyErr) {
|
|
1629
|
+
console.warn(`[SlideProductionWorkflow] Legacy fallback failed for ${label}:`, legacyErr?.message || legacyErr);
|
|
1630
|
+
return null;
|
|
1631
|
+
}
|
|
1464
1632
|
}
|
|
1465
1633
|
async function executeSlideProductionWorkflow(options) {
|
|
1466
1634
|
const {
|
|
@@ -1472,8 +1640,7 @@ async function executeSlideProductionWorkflow(options) {
|
|
|
1472
1640
|
language = "Vietnamese",
|
|
1473
1641
|
languageDirective = "",
|
|
1474
1642
|
headingDirective = "",
|
|
1475
|
-
|
|
1476
|
-
runnerOptions,
|
|
1643
|
+
maxRetries = 3,
|
|
1477
1644
|
onProgress
|
|
1478
1645
|
} = options;
|
|
1479
1646
|
let presentationKitSkills = null;
|
|
@@ -1489,41 +1656,44 @@ async function executeSlideProductionWorkflow(options) {
|
|
|
1489
1656
|
const countLabel = targetSlideCount ? `${targetSlideCount} ` : "h\u1EEFu c\u01A1 ";
|
|
1490
1657
|
onProgress?.("@illustrator", `[1/4] Ph\xE2n t\xEDch m\u1EA1ch b\xE0i gi\u1EA3ng LESSON & L\u1EADp D\xE0n \xFD ${countLabel}Slides...`);
|
|
1491
1658
|
const lessonFlow = parseLessonFlow(lessonMarkdown);
|
|
1492
|
-
const
|
|
1659
|
+
const getStylePreset = presentationKitSkills?.getStylePreset;
|
|
1660
|
+
const stylePreset = getStylePreset ? getStylePreset(stylePresetId) : { name: "Blue Professional" };
|
|
1493
1661
|
const blueprintPrompt = buildSlideBlueprintPrompt({
|
|
1494
1662
|
lessonFlow,
|
|
1495
1663
|
targetSlideCount,
|
|
1496
1664
|
stylePresetName: stylePreset?.name || "Blue Professional"
|
|
1497
1665
|
});
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
clusterTitle: `Cluster ${Math.floor(i / 5) + 1}`,
|
|
1519
|
-
lessonPhase: lessonFlow.phases[Math.min(i, lessonFlow.phases.length - 1)]?.phaseName || "Content",
|
|
1520
|
-
layoutId: i === 0 ? "hero-cover" : i === fallbackCount - 1 ? "summary-takeaways" : "split-concept-code",
|
|
1521
|
-
title: `Slide ${i + 1}: ${lessonTitle}`,
|
|
1522
|
-
pedagogicalGoal: `Teach step ${i + 1} of ${lessonTitle}`,
|
|
1523
|
-
contentFocus: ["Key point 1", "Key point 2", "Key point 3"]
|
|
1666
|
+
const blueprintItems = await pRetry(
|
|
1667
|
+
async () => {
|
|
1668
|
+
const items = await inferStructured(
|
|
1669
|
+
SlideBlueprintArraySchema,
|
|
1670
|
+
"",
|
|
1671
|
+
blueprintPrompt,
|
|
1672
|
+
options,
|
|
1673
|
+
"blueprint"
|
|
1674
|
+
);
|
|
1675
|
+
if (!items || items.length === 0) {
|
|
1676
|
+
throw new Error("Blueprint generation returned empty or schema-invalid output");
|
|
1677
|
+
}
|
|
1678
|
+
return items.sort((a, b) => a.slideIndex - b.slideIndex).map((item, idx) => ({
|
|
1679
|
+
...item,
|
|
1680
|
+
slideIndex: idx + 1,
|
|
1681
|
+
clusterId: item.clusterId || Math.floor(idx / 5) + 1,
|
|
1682
|
+
clusterTitle: item.clusterTitle || "Cluster",
|
|
1683
|
+
lessonPhase: item.lessonPhase || "Content",
|
|
1684
|
+
pedagogicalGoal: item.pedagogicalGoal || "",
|
|
1685
|
+
contentFocus: item.contentFocus || []
|
|
1524
1686
|
}));
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
retries: maxRetries - 1,
|
|
1690
|
+
onFailedAttempt: (err) => {
|
|
1691
|
+
onProgress?.("@illustrator", `\u26A0\uFE0F Blueprint attempt ${err.attemptNumber}/${maxRetries} failed \u2014 retrying...`, {
|
|
1692
|
+
type: "warning"
|
|
1693
|
+
});
|
|
1694
|
+
}
|
|
1525
1695
|
}
|
|
1526
|
-
|
|
1696
|
+
);
|
|
1527
1697
|
const clustersMap = /* @__PURE__ */ new Map();
|
|
1528
1698
|
for (const item of blueprintItems) {
|
|
1529
1699
|
const cId = item.clusterId || Math.floor((item.slideIndex - 1) / 5) + 1;
|
|
@@ -1531,17 +1701,16 @@ async function executeSlideProductionWorkflow(options) {
|
|
|
1531
1701
|
clustersMap.get(cId).push(item);
|
|
1532
1702
|
}
|
|
1533
1703
|
const clusters = Array.from(clustersMap.entries()).sort(([a], [b]) => a - b);
|
|
1534
|
-
const allGeneratedSlides = [];
|
|
1535
1704
|
const skillPrompt = presentationKitSkills?.getFrontendSlidesSkillPrompt ? presentationKitSkills.getFrontendSlidesSkillPrompt({ stylePresetId }) : "";
|
|
1705
|
+
const allGeneratedSlides = [];
|
|
1706
|
+
const failedClusters = [];
|
|
1536
1707
|
let clusterIdx = 0;
|
|
1537
1708
|
for (const [cId, clusterSlides] of clusters) {
|
|
1538
1709
|
clusterIdx++;
|
|
1539
1710
|
const clusterTitle = clusterSlides[0]?.clusterTitle || `Giai \u0111o\u1EA1n ${clusterIdx}`;
|
|
1540
1711
|
onProgress?.("@illustrator", `[2/4] Sinh chi ti\u1EBFt C\u1EE5m ${clusterIdx}/${clusters.length}: "${clusterTitle}" (${clusterSlides.length} slides)...`);
|
|
1541
1712
|
const clusterPhaseNames = new Set(clusterSlides.map((s) => s.lessonPhase.toLowerCase()));
|
|
1542
|
-
const matchingPhases = lessonFlow.phases.filter(
|
|
1543
|
-
(p) => clusterPhaseNames.has(p.phaseName.toLowerCase())
|
|
1544
|
-
);
|
|
1713
|
+
const matchingPhases = lessonFlow.phases.filter((p) => clusterPhaseNames.has(p.phaseName.toLowerCase()));
|
|
1545
1714
|
const lessonExcerpt = matchingPhases.length > 0 ? matchingPhases.map((p) => `### ${p.phaseName}
|
|
1546
1715
|
${p.content}`).join("\n\n") : lessonFlow.rawContent.slice(0, 3500);
|
|
1547
1716
|
const { systemPrompt, userPrompt } = buildSlideBatchPrompt({
|
|
@@ -1555,44 +1724,41 @@ ${p.content}`).join("\n\n") : lessonFlow.rawContent.slice(0, 3500);
|
|
|
1555
1724
|
languageDirective,
|
|
1556
1725
|
headingDirective
|
|
1557
1726
|
});
|
|
1558
|
-
const rawBatch = await runCurriculumAIInference(
|
|
1559
|
-
[
|
|
1560
|
-
{ role: "system", content: systemPrompt },
|
|
1561
|
-
{ role: "user", content: userPrompt }
|
|
1562
|
-
],
|
|
1563
|
-
satelliteContext,
|
|
1564
|
-
runnerOptions,
|
|
1565
|
-
(chunk, type) => {
|
|
1566
|
-
onProgress?.("@illustrator", chunk, { type: type || "content", artifactType: "SLIDE" });
|
|
1567
|
-
}
|
|
1568
|
-
);
|
|
1569
|
-
let batchSlides = [];
|
|
1570
1727
|
try {
|
|
1571
|
-
batchSlides =
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1728
|
+
const batchSlides = await pRetry(
|
|
1729
|
+
async () => {
|
|
1730
|
+
const slides = await inferStructured(
|
|
1731
|
+
GeneratedSlideArraySchema,
|
|
1732
|
+
systemPrompt,
|
|
1733
|
+
userPrompt,
|
|
1734
|
+
options,
|
|
1735
|
+
`cluster-${cId}`
|
|
1736
|
+
);
|
|
1737
|
+
if (!slides || slides.length === 0) {
|
|
1738
|
+
throw new Error(`Cluster ${cId} returned empty or schema-invalid output`);
|
|
1739
|
+
}
|
|
1740
|
+
return slides;
|
|
1741
|
+
},
|
|
1742
|
+
{
|
|
1743
|
+
retries: maxRetries - 1,
|
|
1744
|
+
onFailedAttempt: (err) => {
|
|
1745
|
+
onProgress?.("@illustrator", `\u26A0\uFE0F C\u1EE5m ${clusterIdx} l\u1EA7n ${err.attemptNumber}/${maxRetries} l\u1ED7i \u2014 retry ri\xEAng c\u1EE5m n\xE0y...`, {
|
|
1746
|
+
type: "warning"
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
);
|
|
1593
1751
|
allGeneratedSlides.push(...batchSlides);
|
|
1752
|
+
} catch (clusterErr) {
|
|
1753
|
+
failedClusters.push(cId);
|
|
1754
|
+
console.error(`[SlideProductionWorkflow] Cluster ${cId} permanently failed after ${maxRetries} attempts:`, clusterErr?.message || clusterErr);
|
|
1594
1755
|
}
|
|
1595
1756
|
}
|
|
1757
|
+
if (failedClusters.length > 0) {
|
|
1758
|
+
throw new Error(
|
|
1759
|
+
`[SlideProductionWorkflow] Failed to generate ${failedClusters.length}/${clusters.length} cluster(s) (clusterId: ${failedClusters.join(", ")}) after ${maxRetries} attempts each. Aborting to prevent placeholder/degraded slide output. Review provider keys/model availability and retry.`
|
|
1760
|
+
);
|
|
1761
|
+
}
|
|
1596
1762
|
onProgress?.("@illustrator", `[3/4] Chu\u1EA9n h\xF3a b\u1ED1 c\u1EE5c v\xE0 bi\xEAn d\u1ECBch 1920\xD71080 Stage Deck (${allGeneratedSlides.length} slides)...`);
|
|
1597
1763
|
const normalizer = presentationKitCore?.normalizeSlideSlots;
|
|
1598
1764
|
const normalizedSlides = allGeneratedSlides.map((s, idx) => {
|
|
@@ -1615,7 +1781,7 @@ SCAFFOLDING: Ensure proper syntax and indentation.`
|
|
|
1615
1781
|
compiledHtml = compiled.html;
|
|
1616
1782
|
}
|
|
1617
1783
|
} catch (compErr) {
|
|
1618
|
-
console.warn(`[SlideProductionWorkflow] Failed compiling HTML deck:`, compErr);
|
|
1784
|
+
console.warn(`[SlideProductionWorkflow] Failed compiling HTML deck:`, compErr?.message || compErr);
|
|
1619
1785
|
}
|
|
1620
1786
|
}
|
|
1621
1787
|
const markdownWrapper = `---
|
|
@@ -1634,7 +1800,7 @@ date: "${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}"
|
|
|
1634
1800
|
${JSON.stringify(deckJson, null, 2)}
|
|
1635
1801
|
\`\`\`
|
|
1636
1802
|
`;
|
|
1637
|
-
onProgress?.("@illustrator", `[4/4] Ho\xE0n t\u1EA5t b\u1ED9 tr\xECnh chi\u1EBFu HTML
|
|
1803
|
+
onProgress?.("@illustrator", `[4/4] Ho\xE0n t\u1EA5t b\u1ED9 tr\xECnh chi\u1EBFu HTML \u0111\u1EA1t chu\u1EA9n Fixed 16:9 Stage!`);
|
|
1638
1804
|
return {
|
|
1639
1805
|
deckJson,
|
|
1640
1806
|
compiledHtml,
|
|
@@ -1643,12 +1809,45 @@ ${JSON.stringify(deckJson, null, 2)}
|
|
|
1643
1809
|
slideCount: normalizedSlides.length
|
|
1644
1810
|
};
|
|
1645
1811
|
}
|
|
1812
|
+
var SlideBlueprintItemSchema, SlideBlueprintArraySchema, GeneratedSlideSchema, GeneratedSlideArraySchema;
|
|
1646
1813
|
var init_slideProductionWorkflow = __esm({
|
|
1647
1814
|
"src/services/slideProductionWorkflow.ts"() {
|
|
1648
1815
|
init_lessonFlowParser();
|
|
1649
1816
|
init_slideBlueprintPrompt();
|
|
1650
1817
|
init_slideBatchPrompt();
|
|
1818
|
+
init_provider_factory();
|
|
1651
1819
|
init_streamRunner();
|
|
1820
|
+
SlideBlueprintItemSchema = z.object({
|
|
1821
|
+
slideIndex: z.number().int().min(1),
|
|
1822
|
+
clusterId: z.number().int().min(1).default(1),
|
|
1823
|
+
clusterTitle: z.string().default("Cluster"),
|
|
1824
|
+
lessonPhase: z.string().default("Content"),
|
|
1825
|
+
layoutId: z.enum([
|
|
1826
|
+
"hero-cover",
|
|
1827
|
+
"split-concept-code",
|
|
1828
|
+
"two-columns-compare",
|
|
1829
|
+
"three-cards-grid",
|
|
1830
|
+
"timeline-steps",
|
|
1831
|
+
"metric-callout",
|
|
1832
|
+
"checkpoint-quiz",
|
|
1833
|
+
"tiered-practice-3cards",
|
|
1834
|
+
"summary-takeaways"
|
|
1835
|
+
]),
|
|
1836
|
+
title: z.string().min(1),
|
|
1837
|
+
pedagogicalGoal: z.string().default(""),
|
|
1838
|
+
contentFocus: z.array(z.string()).default([]),
|
|
1839
|
+
codeSnippetIntent: z.string().optional(),
|
|
1840
|
+
visualIntent: z.string().optional()
|
|
1841
|
+
});
|
|
1842
|
+
SlideBlueprintArraySchema = z.array(SlideBlueprintItemSchema);
|
|
1843
|
+
GeneratedSlideSchema = z.object({
|
|
1844
|
+
id: z.string().optional(),
|
|
1845
|
+
layoutId: z.string(),
|
|
1846
|
+
title: z.string().min(1),
|
|
1847
|
+
slots: z.record(z.any()).default({}),
|
|
1848
|
+
notes: z.string().default("")
|
|
1849
|
+
});
|
|
1850
|
+
GeneratedSlideArraySchema = z.array(GeneratedSlideSchema);
|
|
1652
1851
|
}
|
|
1653
1852
|
});
|
|
1654
1853
|
var LearningObjectiveRowSchema = z.object({
|
|
@@ -3175,128 +3374,8 @@ var RoadmapInputSchema = z.object({
|
|
|
3175
3374
|
phases: z.array(PhaseInputSchema).default([])
|
|
3176
3375
|
});
|
|
3177
3376
|
|
|
3178
|
-
// src/ai/
|
|
3179
|
-
|
|
3180
|
-
var DEFAULT_MODELS = {
|
|
3181
|
-
nvidia: "nvidia/nemotron-3-ultra-550b-a55b:free",
|
|
3182
|
-
openrouter: "@preset/coding-free",
|
|
3183
|
-
alibaba: "qwen3.7-plus",
|
|
3184
|
-
dashscope: "qwen3.7-plus",
|
|
3185
|
-
google: "gemini-1.5-flash",
|
|
3186
|
-
deepseek: "deepseek-chat",
|
|
3187
|
-
openai: "gpt-4o-mini",
|
|
3188
|
-
ollama: "deepseek-v4-flash:0731"
|
|
3189
|
-
};
|
|
3190
|
-
var NVIDIA_MODELS = {
|
|
3191
|
-
codingFast: "nvidia/nemotron-3.5-lightning-30b-a3b",
|
|
3192
|
-
reasoningUltra: "nvidia/nemotron-3-ultra-550b-a55b:free",
|
|
3193
|
-
superMoE: "nvidia/nemotron-3-super-120b-a12b",
|
|
3194
|
-
llamaNemotron: "nvidia/llama-3.1-nemotron-70b-instruct",
|
|
3195
|
-
translation: "nvidia/riva-translate-4b-instruct-v2",
|
|
3196
|
-
embedding: "nvidia/nemotron-3-embed-1b",
|
|
3197
|
-
visionLlama: "meta/llama-3.2-11b-vision-instruct"
|
|
3198
|
-
};
|
|
3199
|
-
function getAIModel(options = {}) {
|
|
3200
|
-
const designated = getDesignatedFallbackConfig();
|
|
3201
|
-
const defaultProvider = process.env.DEFAULT_AI_PROVIDER || process.env.LLM_PROVIDER || detectDefaultProvider();
|
|
3202
|
-
let provider = (options.provider || defaultProvider).toLowerCase();
|
|
3203
|
-
if (!isProviderEnabled(provider)) {
|
|
3204
|
-
console.warn(`[provider-factory] Provider "${provider}" is disabled via environment toggle. Falling back to designated provider "${designated.provider}".`);
|
|
3205
|
-
provider = designated.provider;
|
|
3206
|
-
}
|
|
3207
|
-
let resolvedModelName = options.modelName || process.env.DEFAULT_AI_MODEL || process.env.LLM_MODEL || DEFAULT_MODELS[provider] || designated.model;
|
|
3208
|
-
if (!isModelAllowed(resolvedModelName)) {
|
|
3209
|
-
console.warn(`[provider-factory] Model "${resolvedModelName}" is not permitted by ALLOWED_AI_MODELS. Using designated model "${designated.model}".`);
|
|
3210
|
-
resolvedModelName = designated.model;
|
|
3211
|
-
}
|
|
3212
|
-
if (provider === "nvidia") {
|
|
3213
|
-
const apiKey = options.apiKey || process.env.NVIDIA_API_KEY || "";
|
|
3214
|
-
const nvidia = createOpenAI({
|
|
3215
|
-
apiKey,
|
|
3216
|
-
baseURL: options.baseURL || "https://integrate.api.nvidia.com/v1"
|
|
3217
|
-
});
|
|
3218
|
-
return nvidia.chat(resolvedModelName || "nvidia/nemotron-3-ultra-550b-a55b:free");
|
|
3219
|
-
}
|
|
3220
|
-
if (provider === "openrouter") {
|
|
3221
|
-
const apiKey = options.apiKey || process.env.OPENROUTER_API_KEY || process.env.OPENAI_API_KEY || "";
|
|
3222
|
-
const openrouter = createOpenAI({
|
|
3223
|
-
apiKey,
|
|
3224
|
-
baseURL: options.baseURL || "https://openrouter.ai/api/v1"
|
|
3225
|
-
});
|
|
3226
|
-
return openrouter.chat(resolvedModelName || "@preset/coding-free");
|
|
3227
|
-
}
|
|
3228
|
-
if (provider === "alibaba" || provider === "dashscope") {
|
|
3229
|
-
const effectiveKey = options.apiKey || process.env.ALIBABA_API_KEY || process.env.DASHSCOPE_API_KEY || process.env.SAAS_ALIBABA_API_KEY || process.env.SAAS_DASHSCOPE_API_KEY || "";
|
|
3230
|
-
let defaultBaseURL = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1";
|
|
3231
|
-
if (effectiveKey.startsWith("sk-sp-")) {
|
|
3232
|
-
defaultBaseURL = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1";
|
|
3233
|
-
}
|
|
3234
|
-
const rawUrl = options.baseURL || process.env.ALIBABA_BASE_URL || process.env.DASHSCOPE_BASE_URL || defaultBaseURL;
|
|
3235
|
-
const cleanBaseURL = rawUrl.replace(/^["']|["']$/g, "").trim();
|
|
3236
|
-
const alibaba = createOpenAI({
|
|
3237
|
-
apiKey: effectiveKey,
|
|
3238
|
-
baseURL: cleanBaseURL
|
|
3239
|
-
// Passthrough: no forced format injection — the Vercel AI SDK's generateObject
|
|
3240
|
-
// already instructs the model to return JSON via its schema definition.
|
|
3241
|
-
// Injecting 'Output format: JSON.' into markdown-based lesson prompts caused
|
|
3242
|
-
// model confusion (mixed markdown + JSON output).
|
|
3243
|
-
});
|
|
3244
|
-
return alibaba.chat(resolvedModelName);
|
|
3245
|
-
}
|
|
3246
|
-
if (provider === "google") {
|
|
3247
|
-
const apiKey = options.apiKey || process.env.GOOGLE_GENERATIVE_AI_API_KEY || process.env.GEMINI_API_KEY || "";
|
|
3248
|
-
const google = createGoogleGenerativeAI({ apiKey });
|
|
3249
|
-
return google(resolvedModelName);
|
|
3250
|
-
}
|
|
3251
|
-
if (provider === "deepseek") {
|
|
3252
|
-
const apiKey = options.apiKey || process.env.DEEPSEEK_API_KEY || process.env.SAAS_DEEPSEEK_API_KEY || "";
|
|
3253
|
-
const deepseek = createDeepSeek({ apiKey });
|
|
3254
|
-
return deepseek(resolvedModelName);
|
|
3255
|
-
}
|
|
3256
|
-
if (provider === "openai") {
|
|
3257
|
-
const apiKey = options.apiKey || process.env.OPENAI_API_KEY || "";
|
|
3258
|
-
const openai = createOpenAI({
|
|
3259
|
-
apiKey,
|
|
3260
|
-
baseURL: options.baseURL || process.env.OPENAI_BASE_URL
|
|
3261
|
-
});
|
|
3262
|
-
return openai.chat(resolvedModelName);
|
|
3263
|
-
}
|
|
3264
|
-
if (provider === "ollama") {
|
|
3265
|
-
const apiKey = options.apiKey || process.env.OLLAMA_API_KEY || "ollama";
|
|
3266
|
-
const baseURL = options.baseURL || process.env.OLLAMA_BASE_URL || process.env.OPENAI_BASE_URL || "http://127.0.0.1:11434/v1";
|
|
3267
|
-
const ollama = createOpenAI({
|
|
3268
|
-
apiKey,
|
|
3269
|
-
baseURL
|
|
3270
|
-
});
|
|
3271
|
-
return ollama.chat(resolvedModelName || "qwen2.5:latest");
|
|
3272
|
-
}
|
|
3273
|
-
const fallback = createOpenAI({
|
|
3274
|
-
apiKey: options.apiKey || process.env.OPENAI_API_KEY || "",
|
|
3275
|
-
baseURL: options.baseURL || process.env.OPENAI_BASE_URL
|
|
3276
|
-
});
|
|
3277
|
-
return fallback.chat(resolvedModelName);
|
|
3278
|
-
}
|
|
3279
|
-
function detectDefaultProvider() {
|
|
3280
|
-
if (process.env.NVIDIA_API_KEY && isProviderEnabled("nvidia")) {
|
|
3281
|
-
return "nvidia";
|
|
3282
|
-
}
|
|
3283
|
-
if (process.env.OPENROUTER_API_KEY && isProviderEnabled("openrouter")) {
|
|
3284
|
-
return "openrouter";
|
|
3285
|
-
}
|
|
3286
|
-
if ((process.env.ALIBABA_API_KEY || process.env.DASHSCOPE_API_KEY || process.env.SAAS_ALIBABA_API_KEY) && isProviderEnabled("alibaba")) {
|
|
3287
|
-
return "alibaba";
|
|
3288
|
-
}
|
|
3289
|
-
if ((process.env.GOOGLE_GENERATIVE_AI_API_KEY || process.env.GEMINI_API_KEY) && (isProviderEnabled("gemini") || isProviderEnabled("google"))) {
|
|
3290
|
-
return "google";
|
|
3291
|
-
}
|
|
3292
|
-
if ((process.env.DEEPSEEK_API_KEY || process.env.SAAS_DEEPSEEK_API_KEY) && isProviderEnabled("deepseek")) {
|
|
3293
|
-
return "deepseek";
|
|
3294
|
-
}
|
|
3295
|
-
if (process.env.OPENAI_API_KEY && process.env.OPENAI_API_KEY !== "ollama" && isProviderEnabled("openai")) {
|
|
3296
|
-
return "openai";
|
|
3297
|
-
}
|
|
3298
|
-
return getDesignatedFallbackConfig().provider;
|
|
3299
|
-
}
|
|
3377
|
+
// src/ai/index.ts
|
|
3378
|
+
init_provider_factory();
|
|
3300
3379
|
|
|
3301
3380
|
// src/templates/lessonTemplate.ts
|
|
3302
3381
|
var LESSON_PLAN_TEMPLATE = `
|
|
@@ -6422,6 +6501,9 @@ Return a single valid JSON object matching DiagnosticQuizSchema with these exact
|
|
|
6422
6501
|
}
|
|
6423
6502
|
`.trim();
|
|
6424
6503
|
}
|
|
6504
|
+
|
|
6505
|
+
// src/ai/flows/generateLessonMasterFlow.ts
|
|
6506
|
+
init_provider_factory();
|
|
6425
6507
|
async function generateLessonMasterFlow(input) {
|
|
6426
6508
|
const model = getAIModel(input.modelOptions);
|
|
6427
6509
|
const prompt = buildLessonMasterPrompt({
|
|
@@ -6441,6 +6523,9 @@ Respond with a valid JSON object matching the schema.`
|
|
|
6441
6523
|
});
|
|
6442
6524
|
return object;
|
|
6443
6525
|
}
|
|
6526
|
+
|
|
6527
|
+
// src/ai/flows/generateActivityFlow.ts
|
|
6528
|
+
init_provider_factory();
|
|
6444
6529
|
async function generateActivityFlow(input) {
|
|
6445
6530
|
const model = getAIModel(input.modelOptions);
|
|
6446
6531
|
const prompt = buildActivityPrompt({
|
|
@@ -6458,6 +6543,9 @@ Respond with a valid JSON object matching the schema.`
|
|
|
6458
6543
|
});
|
|
6459
6544
|
return object;
|
|
6460
6545
|
}
|
|
6546
|
+
|
|
6547
|
+
// src/ai/flows/generateCodeLabFlow.ts
|
|
6548
|
+
init_provider_factory();
|
|
6461
6549
|
async function generateCodeLabFlow(input) {
|
|
6462
6550
|
const model = getAIModel(input.modelOptions);
|
|
6463
6551
|
const prompt = buildCodeLabPrompt({
|
|
@@ -6475,6 +6563,9 @@ Respond with a valid JSON object matching the schema.`
|
|
|
6475
6563
|
});
|
|
6476
6564
|
return object;
|
|
6477
6565
|
}
|
|
6566
|
+
|
|
6567
|
+
// src/ai/flows/generateWorksheetFlow.ts
|
|
6568
|
+
init_provider_factory();
|
|
6478
6569
|
async function generateWorksheetFlow(input) {
|
|
6479
6570
|
const model = getAIModel(input.modelOptions);
|
|
6480
6571
|
const prompt = buildWorksheetPrompt({
|
|
@@ -6488,6 +6579,9 @@ async function generateWorksheetFlow(input) {
|
|
|
6488
6579
|
});
|
|
6489
6580
|
return object;
|
|
6490
6581
|
}
|
|
6582
|
+
|
|
6583
|
+
// src/ai/flows/generateHandoutFlow.ts
|
|
6584
|
+
init_provider_factory();
|
|
6491
6585
|
async function generateHandoutFlow(input) {
|
|
6492
6586
|
const model = getAIModel(input.modelOptions);
|
|
6493
6587
|
const prompt = buildHandoutPrompt({
|
|
@@ -6503,6 +6597,9 @@ Respond with a valid JSON object matching the schema.`
|
|
|
6503
6597
|
});
|
|
6504
6598
|
return object;
|
|
6505
6599
|
}
|
|
6600
|
+
|
|
6601
|
+
// src/ai/flows/generateSlidesFlow.ts
|
|
6602
|
+
init_provider_factory();
|
|
6506
6603
|
async function generateSlidesFlow(input) {
|
|
6507
6604
|
const model = getAIModel(input.modelOptions);
|
|
6508
6605
|
const prompt = buildSlidesPrompt({
|
|
@@ -6517,6 +6614,9 @@ async function generateSlidesFlow(input) {
|
|
|
6517
6614
|
});
|
|
6518
6615
|
return object;
|
|
6519
6616
|
}
|
|
6617
|
+
|
|
6618
|
+
// src/ai/flows/generateTeacherGuideFlow.ts
|
|
6619
|
+
init_provider_factory();
|
|
6520
6620
|
async function generateTeacherGuideFlow(input) {
|
|
6521
6621
|
const model = getAIModel(input.modelOptions);
|
|
6522
6622
|
const prompt = buildTeacherGuidePrompt({
|
|
@@ -6531,6 +6631,9 @@ async function generateTeacherGuideFlow(input) {
|
|
|
6531
6631
|
});
|
|
6532
6632
|
return object;
|
|
6533
6633
|
}
|
|
6634
|
+
|
|
6635
|
+
// src/ai/flows/generateExtensionFlow.ts
|
|
6636
|
+
init_provider_factory();
|
|
6534
6637
|
async function generateExtensionFlow(input) {
|
|
6535
6638
|
const model = getAIModel(input.modelOptions);
|
|
6536
6639
|
const prompt = buildExtensionPrompt({
|
|
@@ -6545,6 +6648,9 @@ async function generateExtensionFlow(input) {
|
|
|
6545
6648
|
});
|
|
6546
6649
|
return object;
|
|
6547
6650
|
}
|
|
6651
|
+
|
|
6652
|
+
// src/ai/flows/auditCurriculumQualityFlow.ts
|
|
6653
|
+
init_provider_factory();
|
|
6548
6654
|
async function auditCurriculumQualityFlow(input) {
|
|
6549
6655
|
const model = getAIModel(input.modelOptions);
|
|
6550
6656
|
const prompt = buildJudgePrompt({
|
|
@@ -6564,6 +6670,9 @@ Respond with a valid JSON object matching the schema.`
|
|
|
6564
6670
|
});
|
|
6565
6671
|
return object;
|
|
6566
6672
|
}
|
|
6673
|
+
|
|
6674
|
+
// src/ai/flows/generateProjectInstructionFlow.ts
|
|
6675
|
+
init_provider_factory();
|
|
6567
6676
|
async function generateProjectInstructionFlow(input) {
|
|
6568
6677
|
const model = getAIModel(input.modelOptions);
|
|
6569
6678
|
const prompt = buildProjectInstructionPrompt({
|
|
@@ -6584,6 +6693,9 @@ Respond with a valid JSON object matching the schema.`
|
|
|
6584
6693
|
});
|
|
6585
6694
|
return object;
|
|
6586
6695
|
}
|
|
6696
|
+
|
|
6697
|
+
// src/ai/flows/generateSelfLabFlow.ts
|
|
6698
|
+
init_provider_factory();
|
|
6587
6699
|
async function generateSelfLabFlow(input) {
|
|
6588
6700
|
const model = getAIModel(input.modelOptions);
|
|
6589
6701
|
const prompt = buildSelfLabPrompt({
|
|
@@ -6602,6 +6714,9 @@ Respond with a valid JSON object matching the schema.`
|
|
|
6602
6714
|
});
|
|
6603
6715
|
return object;
|
|
6604
6716
|
}
|
|
6717
|
+
|
|
6718
|
+
// src/ai/flows/generateDiagnosticQuizFlow.ts
|
|
6719
|
+
init_provider_factory();
|
|
6605
6720
|
async function generateDiagnosticQuizFlow(input) {
|
|
6606
6721
|
const model = getAIModel(input.modelOptions);
|
|
6607
6722
|
const prompt = buildDiagnosticQuizPrompt({
|
|
@@ -6619,6 +6734,9 @@ Respond with a valid JSON object matching the schema.`
|
|
|
6619
6734
|
});
|
|
6620
6735
|
return object;
|
|
6621
6736
|
}
|
|
6737
|
+
|
|
6738
|
+
// src/ai/flows/streamLessonMasterFlow.ts
|
|
6739
|
+
init_provider_factory();
|
|
6622
6740
|
async function streamLessonMasterFlow(input) {
|
|
6623
6741
|
const model = getAIModel(input.modelOptions);
|
|
6624
6742
|
const prompt = buildLessonMasterPrompt({
|
|
@@ -6636,6 +6754,9 @@ async function streamLessonMasterFlow(input) {
|
|
|
6636
6754
|
Respond with a valid JSON object matching the schema.`
|
|
6637
6755
|
});
|
|
6638
6756
|
}
|
|
6757
|
+
|
|
6758
|
+
// src/ai/flows/streamSelfLabFlow.ts
|
|
6759
|
+
init_provider_factory();
|
|
6639
6760
|
async function streamSelfLabFlow(input) {
|
|
6640
6761
|
const model = getAIModel(input.modelOptions);
|
|
6641
6762
|
const prompt = buildSelfLabPrompt({
|
|
@@ -6652,6 +6773,9 @@ async function streamSelfLabFlow(input) {
|
|
|
6652
6773
|
Respond with a valid JSON object matching the schema.`
|
|
6653
6774
|
});
|
|
6654
6775
|
}
|
|
6776
|
+
|
|
6777
|
+
// src/ai/flows/streamDiagnosticQuizFlow.ts
|
|
6778
|
+
init_provider_factory();
|
|
6655
6779
|
async function streamDiagnosticQuizFlow(input) {
|
|
6656
6780
|
const model = getAIModel(input.modelOptions);
|
|
6657
6781
|
const prompt = buildDiagnosticQuizPrompt({
|
|
@@ -11333,6 +11457,17 @@ function packUnitSessions(group, nodeById, spec, warnings) {
|
|
|
11333
11457
|
const node = nodeById.get(id);
|
|
11334
11458
|
const isKnowledge = node.kind === "concept";
|
|
11335
11459
|
if (node.estimated_minutes > spec.contentBudget) {
|
|
11460
|
+
if (node.estimated_minutes <= spec.sessionDurationMinutes || node.estimated_minutes <= spec.contentBudget * 1.25) {
|
|
11461
|
+
if (current.entries.length > 0) flush();
|
|
11462
|
+
const entry = { id, minutes: spec.contentBudget, part: 1, totalParts: 1 };
|
|
11463
|
+
if (isKnowledge) current.knowledgeMinutes += entry.minutes;
|
|
11464
|
+
else current.practiceMinutes += entry.minutes;
|
|
11465
|
+
current.entries.push(entry);
|
|
11466
|
+
current.nodeIds.push(id);
|
|
11467
|
+
current.oversized = false;
|
|
11468
|
+
flush();
|
|
11469
|
+
continue;
|
|
11470
|
+
}
|
|
11336
11471
|
const parts = [];
|
|
11337
11472
|
let remaining = node.estimated_minutes;
|
|
11338
11473
|
while (remaining > 0) {
|
|
@@ -11501,6 +11636,35 @@ async function buildCurriculumPlan(rawGraph, options) {
|
|
|
11501
11636
|
const unitIndexByGroup = new Map(groups.map((g, i) => [g.key, i]));
|
|
11502
11637
|
const packed = [];
|
|
11503
11638
|
for (const g of groups) packed.push(...packUnitSessions(g, nodeById, spec, warnings));
|
|
11639
|
+
if (constraints.total_sessions && packed.length > constraints.total_sessions) {
|
|
11640
|
+
warnings.push(`Initial packing produced ${packed.length} sessions, coalescing to satisfy total_sessions constraint (${constraints.total_sessions})`);
|
|
11641
|
+
for (let i = 0; i < packed.length - 1 && packed.length > constraints.total_sessions; i++) {
|
|
11642
|
+
const curr = packed[i];
|
|
11643
|
+
const next = packed[i + 1];
|
|
11644
|
+
if (curr.groupId === next.groupId) {
|
|
11645
|
+
const currMins = curr.knowledgeMinutes + curr.practiceMinutes;
|
|
11646
|
+
const nextMins = next.knowledgeMinutes + next.practiceMinutes;
|
|
11647
|
+
const totalContent = currMins + nextMins;
|
|
11648
|
+
if (currMins <= 45 || nextMins <= 45 || totalContent <= spec.contentBudget * 1.5) {
|
|
11649
|
+
const scale = totalContent > spec.contentBudget ? spec.contentBudget / totalContent : 1;
|
|
11650
|
+
curr.nodeIds.push(...next.nodeIds);
|
|
11651
|
+
for (const e of next.entries) {
|
|
11652
|
+
e.minutes = Math.max(5, Math.round(e.minutes * scale));
|
|
11653
|
+
curr.entries.push(e);
|
|
11654
|
+
}
|
|
11655
|
+
for (const e of curr.entries) {
|
|
11656
|
+
e.minutes = Math.max(5, Math.round(e.minutes * scale));
|
|
11657
|
+
}
|
|
11658
|
+
const scaledKnowledge = Math.round((curr.knowledgeMinutes + next.knowledgeMinutes) * scale);
|
|
11659
|
+
curr.knowledgeMinutes = scaledKnowledge;
|
|
11660
|
+
curr.practiceMinutes = Math.max(0, spec.contentBudget - scaledKnowledge);
|
|
11661
|
+
curr.oversized = false;
|
|
11662
|
+
packed.splice(i + 1, 1);
|
|
11663
|
+
i--;
|
|
11664
|
+
}
|
|
11665
|
+
}
|
|
11666
|
+
}
|
|
11667
|
+
}
|
|
11504
11668
|
packed.map(
|
|
11505
11669
|
(_, i) => "U" + pad2(Math.min(units.length, 99)).replace("U", "U")
|
|
11506
11670
|
/* placeholder replaced below */
|
|
@@ -27721,6 +27885,7 @@ var DeterministicPipelineRunner = class {
|
|
|
27721
27885
|
|
|
27722
27886
|
// src/services/prefillService.ts
|
|
27723
27887
|
init_streamRunner();
|
|
27888
|
+
init_provider_factory();
|
|
27724
27889
|
var DEFAULT_STREAM_IDLE_MS = 18e4;
|
|
27725
27890
|
var DEFAULT_STREAM_TOTAL_MS = 48e4;
|
|
27726
27891
|
var LAYER_IDLE_BUDGET_MS = {
|
|
@@ -30823,6 +30988,6 @@ function renderMediaPlaceholder(entry) {
|
|
|
30823
30988
|
return `> \u{1F5BC}\uFE0F [\u1EA2nh \u0111ang ch\u1EDD: ${entry.name} \u2014 s\u1EBD \u0111\u01B0\u1EE3c t\u1EA1o sau khi duy\u1EC7t media]`;
|
|
30824
30989
|
}
|
|
30825
30990
|
|
|
30826
|
-
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, GlossaryQuickRefRowSchema, GlossarySchema, GlossaryTermSchema, GoldTierSchema, GradeBandSchema, GraphicOrganizerItemSchema, GraphicOrganizerSchema, HANDOUT_TEMPLATE, HandoutSchema, HandoutSectionSchema, 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, 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, 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, extractScopeSequenceRows, extractSectionHeadingsFromSLC, extractSessionSlice, extractStandardRefs, extractStreamChunk, 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, parseGateSettings, parseQuizMarkdown, parseRoadmapJsonToProjectPayload, produceBatchLessons, produceSingleLesson, publishToGitHub, publishToSupabase, rankGenCandidates, renderFrameworkFromPlan, 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, validateMarkdownTables, validateMermaidSyntax, withAutoRepair };
|
|
30991
|
+
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, 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, 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, extractScopeSequenceRows, extractSectionHeadingsFromSLC, extractSessionSlice, extractStandardRefs, extractStreamChunk, 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, parseGateSettings, parseQuizMarkdown, parseRoadmapJsonToProjectPayload, produceBatchLessons, produceSingleLesson, publishToGitHub, publishToSupabase, rankGenCandidates, renderFrameworkFromPlan, 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, validateMarkdownTables, validateMermaidSyntax, withAutoRepair };
|
|
30827
30992
|
//# sourceMappingURL=index.mjs.map
|
|
30828
30993
|
//# sourceMappingURL=index.mjs.map
|