@thanh01.pmt/curriculum-kit 1.4.10 → 1.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.cjs +5 -0
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.mjs +5 -0
- package/dist/ai/index.mjs.map +1 -1
- package/dist/index.cjs +24 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +24 -2
- package/dist/index.mjs.map +1 -1
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.mjs.map +1 -1
- package/dist/workflow/index.cjs.map +1 -1
- package/dist/workflow/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -5448,6 +5448,11 @@ Every slide MUST include notes with:
|
|
|
5448
5448
|
- Cold-Call: 1 check question
|
|
5449
5449
|
- Scaffolding Tip: 1 analogy or hint
|
|
5450
5450
|
|
|
5451
|
+
### \u26A0\uFE0F STRICT SLIDE FORMATTING INVARIANTS:
|
|
5452
|
+
1. Every slide MUST store its content fields inside "slots": { ... }. NEVER put "title", "content", or points at the top level of a slide!
|
|
5453
|
+
2. All code slots MUST contain real, executable, high-fidelity code. Never use placeholders like "<CODE>" or "...".
|
|
5454
|
+
3. All point and card slots MUST contain concrete, rich pedagogical explanations. Never use placeholder dots or empty cards.
|
|
5455
|
+
|
|
5451
5456
|
### Output JSON Format:
|
|
5452
5457
|
\`\`\`json
|
|
5453
5458
|
{
|
|
@@ -25315,10 +25320,15 @@ ${buildHeadingDirective("QUIZ", slcMarkdown, targetLang)}`;
|
|
|
25315
25320
|
const isHtmlEngine = options.slidesEngine === "html";
|
|
25316
25321
|
if (isHtmlEngine) {
|
|
25317
25322
|
let presentationKitAi = null;
|
|
25323
|
+
let presentationKitCore = null;
|
|
25318
25324
|
try {
|
|
25319
25325
|
presentationKitAi = await import('@thanh01.pmt/presentation-kit/ai');
|
|
25320
25326
|
} catch {
|
|
25321
25327
|
}
|
|
25328
|
+
try {
|
|
25329
|
+
presentationKitCore = await import('@thanh01.pmt/presentation-kit');
|
|
25330
|
+
} catch {
|
|
25331
|
+
}
|
|
25322
25332
|
const slidePrompt = buildHtmlDeckSlidePrompt({
|
|
25323
25333
|
lessonCode,
|
|
25324
25334
|
lessonTitle,
|
|
@@ -25353,12 +25363,21 @@ ${glossaryContext}` : void 0,
|
|
|
25353
25363
|
const candidate = fenceMatch ? fenceMatch[1] : str;
|
|
25354
25364
|
return candidate.trim();
|
|
25355
25365
|
};
|
|
25366
|
+
const normalizeDeckSlides = (deck) => {
|
|
25367
|
+
const normalizer = presentationKitCore?.normalizeSlideSlots || presentationKitAi?.normalizeSlideSlots;
|
|
25368
|
+
if (deck && Array.isArray(deck.slides) && normalizer) {
|
|
25369
|
+
deck.slides = deck.slides.map((s) => normalizer(s));
|
|
25370
|
+
}
|
|
25371
|
+
return deck;
|
|
25372
|
+
};
|
|
25356
25373
|
try {
|
|
25357
25374
|
deckJson = JSON.parse(extractCleanJson(rawSlide));
|
|
25375
|
+
deckJson = normalizeDeckSlides(deckJson);
|
|
25358
25376
|
} catch {
|
|
25359
25377
|
try {
|
|
25360
25378
|
const { jsonrepair: jsonrepair2 } = await import('jsonrepair');
|
|
25361
25379
|
deckJson = JSON.parse(jsonrepair2(extractCleanJson(rawSlide)));
|
|
25380
|
+
deckJson = normalizeDeckSlides(deckJson);
|
|
25362
25381
|
} catch {
|
|
25363
25382
|
}
|
|
25364
25383
|
}
|
|
@@ -25380,11 +25399,13 @@ Fix ALL issues and output the complete corrected JSON object strictly matching t
|
|
|
25380
25399
|
);
|
|
25381
25400
|
try {
|
|
25382
25401
|
deckJson = JSON.parse(extractCleanJson(repairedRaw));
|
|
25402
|
+
deckJson = normalizeDeckSlides(deckJson);
|
|
25383
25403
|
validation = presentationKitAi.validateHtmlSlideDeck(deckJson, true);
|
|
25384
25404
|
} catch {
|
|
25385
25405
|
try {
|
|
25386
25406
|
const { jsonrepair: jsonrepair2 } = await import('jsonrepair');
|
|
25387
25407
|
deckJson = JSON.parse(jsonrepair2(extractCleanJson(repairedRaw)));
|
|
25408
|
+
deckJson = normalizeDeckSlides(deckJson);
|
|
25388
25409
|
validation = presentationKitAi.validateHtmlSlideDeck(deckJson, true);
|
|
25389
25410
|
} catch {
|
|
25390
25411
|
}
|
|
@@ -25412,9 +25433,10 @@ ${JSON.stringify(deckJson || {}, null, 2)}
|
|
|
25412
25433
|
const deckJsonStr = JSON.stringify(deckJson, null, 2);
|
|
25413
25434
|
await storage.saveArtifact(projectId, `_content/${unitCode}/SLIDE_${lessonCode}.deck.json`, deckJsonStr);
|
|
25414
25435
|
producedArtifacts.push(`SLIDE_${lessonCode}.deck.json`);
|
|
25415
|
-
|
|
25436
|
+
const compiler = presentationKitCore?.compileHtmlDeck || presentationKitAi?.compileHtmlDeck;
|
|
25437
|
+
if (compiler) {
|
|
25416
25438
|
try {
|
|
25417
|
-
const compiled =
|
|
25439
|
+
const compiled = compiler(deckJson);
|
|
25418
25440
|
if (compiled?.html) {
|
|
25419
25441
|
await storage.saveArtifact(projectId, `_content/${unitCode}/SLIDE_${lessonCode}.html`, compiled.html);
|
|
25420
25442
|
producedArtifacts.push(`SLIDE_${lessonCode}.html`);
|