@thanh01.pmt/presentation-kit 0.2.10 → 0.2.12
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 +519 -7
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +236 -4
- package/dist/ai/index.d.ts +236 -4
- package/dist/ai/index.js +498 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/chunk-3VGV5KYZ.js +3446 -0
- package/dist/chunk-3VGV5KYZ.js.map +1 -0
- package/dist/chunk-53GLUCYC.cjs +3464 -0
- package/dist/chunk-53GLUCYC.cjs.map +1 -0
- package/dist/{click-css-BP9oqy_1.d.cts → click-css-Ch_jyWaw.d.cts} +1 -1
- package/dist/{click-css-BbhqdtGr.d.ts → click-css-CktIYP3H.d.ts} +1 -1
- package/dist/index.cjs +30 -10
- package/dist/index.d.cts +21 -5
- package/dist/index.d.ts +21 -5
- package/dist/index.js +2 -2
- package/dist/{presets-B_TY4i2a.d.ts → presets-BUzebXzj.d.ts} +1 -1
- package/dist/{presets-BIw_4ZXR.d.cts → presets-Bkh6NzWf.d.cts} +1 -1
- package/dist/react/index.cjs +351 -90
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +25 -5
- package/dist/react/index.d.ts +25 -5
- package/dist/react/index.js +297 -41
- package/dist/react/index.js.map +1 -1
- package/dist/{types-C1121XLt.d.cts → types-8AVYoEUn.d.cts} +67 -1
- package/dist/{types-C1121XLt.d.ts → types-8AVYoEUn.d.ts} +67 -1
- package/package.json +2 -2
- package/dist/chunk-3Q4RMZVQ.cjs +0 -867
- package/dist/chunk-3Q4RMZVQ.cjs.map +0 -1
- package/dist/chunk-V6X7D44H.js +0 -854
- package/dist/chunk-V6X7D44H.js.map +0 -1
package/dist/ai/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SLIDE_LAYOUT_PRESETS, getSlideLayoutPresetsByCategory, getSlideLayoutPresetById, serializeLayoutToComment, updateSlideLayoutInMarkdown, splitMarkdownSlides } from '../chunk-
|
|
1
|
+
import { SLIDE_LAYOUT_PRESETS, getSlideLayoutPresetsByCategory, getSlideLayoutPresetById, serializeLayoutToComment, updateSlideLayoutInMarkdown, splitMarkdownSlides, HTML_SLIDE_PRESETS, HTML_THEMES, compileHtmlDeck } from '../chunk-3VGV5KYZ.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
var listSlidePresetsSchema = z.object({
|
|
@@ -410,8 +410,504 @@ When a precise coordinate layout is specified, include the clean YAML block at t
|
|
|
410
410
|
pos: [670, 150, 530, 510]
|
|
411
411
|
-->
|
|
412
412
|
\`\`\`
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## 7. STEP REVEAL & PROGRESSIVE DISCLOSURE
|
|
417
|
+
When presenting lists, comparisons, or multi-phase concepts, support sequential reveals:
|
|
418
|
+
- Annotate lists or elements with \`<!-- v-click -->\` or apply class \`.step-reveal\` / \`[data-step]\`.
|
|
419
|
+
- Clicking or pressing forward arrow reveals items sequentially before transitioning to the next slide.
|
|
420
|
+
- Keep list items concise (< 15 words) to maintain visual rhythm during progressive steps.
|
|
413
421
|
`;
|
|
422
|
+
var validateSlideDeckSchema = z.object({
|
|
423
|
+
format: z.enum(["auto", "html", "markdown"]).default("auto").describe('Deck format to validate: "html", "markdown", or "auto"'),
|
|
424
|
+
markdown: z.string().optional().describe("Raw Markdown / Marp slide presentation content"),
|
|
425
|
+
htmlDeck: z.object({
|
|
426
|
+
title: z.string().optional(),
|
|
427
|
+
subtitle: z.string().optional(),
|
|
428
|
+
theme: z.string().optional(),
|
|
429
|
+
slides: z.array(z.object({
|
|
430
|
+
layoutId: z.string(),
|
|
431
|
+
slots: z.record(z.any()),
|
|
432
|
+
notes: z.string().optional()
|
|
433
|
+
})).optional()
|
|
434
|
+
}).optional().describe("Structured HTML deck data matching HtmlDeckData"),
|
|
435
|
+
strict: z.boolean().default(false).describe("If true, warnings cause valid to be false")
|
|
436
|
+
});
|
|
437
|
+
function countWords(str) {
|
|
438
|
+
if (!str) return 0;
|
|
439
|
+
return str.trim().split(/\s+/).filter(Boolean).length;
|
|
440
|
+
}
|
|
441
|
+
function validateHtmlSlideDeck(deck, strict = false) {
|
|
442
|
+
const issues = [];
|
|
443
|
+
const suggestions = [];
|
|
444
|
+
const slides = deck.slides || [];
|
|
445
|
+
const slideCount = slides.length;
|
|
446
|
+
if (slideCount === 0) {
|
|
447
|
+
return {
|
|
448
|
+
success: false,
|
|
449
|
+
valid: false,
|
|
450
|
+
score: 0,
|
|
451
|
+
format: "html",
|
|
452
|
+
slideCount: 0,
|
|
453
|
+
notesCoveragePercent: 0,
|
|
454
|
+
issues: [{
|
|
455
|
+
slideIndex: 0,
|
|
456
|
+
severity: "error",
|
|
457
|
+
rule: "EMPTY_DECK",
|
|
458
|
+
message: "Presentation deck contains no slides."
|
|
459
|
+
}],
|
|
460
|
+
suggestions: ["Add at least one slide (e.g. hero-cover) to the deck."]
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
let notesCount = 0;
|
|
464
|
+
let hasCover = false;
|
|
465
|
+
let hasQuiz = false;
|
|
466
|
+
let hasSummary = false;
|
|
467
|
+
slides.forEach((slide, idx) => {
|
|
468
|
+
const slideNumber = idx + 1;
|
|
469
|
+
const layoutId = slide.layoutId;
|
|
470
|
+
const preset = HTML_SLIDE_PRESETS[layoutId];
|
|
471
|
+
if (!preset) {
|
|
472
|
+
issues.push({
|
|
473
|
+
slideIndex: slideNumber,
|
|
474
|
+
severity: "error",
|
|
475
|
+
rule: "INVALID_LAYOUT_PRESET",
|
|
476
|
+
message: `Unknown layoutId "${slide.layoutId}". Available presets: ${Object.keys(HTML_SLIDE_PRESETS).join(", ")}`
|
|
477
|
+
});
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
if (preset.category === "cover" && idx === 0) hasCover = true;
|
|
481
|
+
if (preset.id === "checkpoint-quiz") hasQuiz = true;
|
|
482
|
+
if (preset.id === "summary-takeaways") hasSummary = true;
|
|
483
|
+
for (const slotDef of preset.slots) {
|
|
484
|
+
if (slotDef.required) {
|
|
485
|
+
const val = slide.slots?.[slotDef.name];
|
|
486
|
+
if (val === void 0 || val === null || typeof val === "string" && val.trim() === "") {
|
|
487
|
+
issues.push({
|
|
488
|
+
slideIndex: slideNumber,
|
|
489
|
+
severity: "error",
|
|
490
|
+
rule: "MISSING_REQUIRED_SLOT",
|
|
491
|
+
message: `Slide ${slideNumber} (${layoutId}) is missing required slot "${slotDef.name}" (${slotDef.label}).`
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
const slots = slide.slots || {};
|
|
497
|
+
for (const [key, val] of Object.entries(slots)) {
|
|
498
|
+
if (typeof val === "string") {
|
|
499
|
+
const words = countWords(val);
|
|
500
|
+
if (key !== "code" && words > 50) {
|
|
501
|
+
issues.push({
|
|
502
|
+
slideIndex: slideNumber,
|
|
503
|
+
severity: "warning",
|
|
504
|
+
rule: "ZERO_SCROLL_WORD_BUDGET",
|
|
505
|
+
message: `Slot "${key}" on slide ${slideNumber} has ${words} words. Recommended max is 35-40 words to prevent vertical scrolling.`
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
} else if (Array.isArray(val)) {
|
|
509
|
+
if (val.length > 5) {
|
|
510
|
+
issues.push({
|
|
511
|
+
slideIndex: slideNumber,
|
|
512
|
+
severity: "warning",
|
|
513
|
+
rule: "EXCESSIVE_LIST_ITEMS",
|
|
514
|
+
message: `List slot "${key}" on slide ${slideNumber} has ${val.length} items. Keep to 3-4 items for optimal readability.`
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
val.forEach((item, itemIdx) => {
|
|
518
|
+
if (typeof item === "string") {
|
|
519
|
+
const w = countWords(item);
|
|
520
|
+
if (w > 20) {
|
|
521
|
+
issues.push({
|
|
522
|
+
slideIndex: slideNumber,
|
|
523
|
+
severity: "warning",
|
|
524
|
+
rule: "BULLET_WORD_BUDGET",
|
|
525
|
+
message: `Bullet #${itemIdx + 1} in "${key}" on slide ${slideNumber} is ${w} words. Keep bullet points concise (< 15 words).`
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
if (slide.notes && slide.notes.trim().length > 0) {
|
|
533
|
+
notesCount++;
|
|
534
|
+
const notes = slide.notes.trim();
|
|
535
|
+
const hasQuestion = notes.includes("?") || /cold-?call|question/i.test(notes);
|
|
536
|
+
const hasTip = /scaffold|tip|analogy|hint/i.test(notes);
|
|
537
|
+
if (!hasQuestion || !hasTip) {
|
|
538
|
+
issues.push({
|
|
539
|
+
slideIndex: slideNumber,
|
|
540
|
+
severity: "warning",
|
|
541
|
+
rule: "INCOMPLETE_PRESENTER_NOTES",
|
|
542
|
+
message: `Presenter notes for slide ${slideNumber} should follow the 3-part contract: Talk Track, Cold-Call Question, and Scaffolding Tip.`
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
} else {
|
|
546
|
+
issues.push({
|
|
547
|
+
slideIndex: slideNumber,
|
|
548
|
+
severity: "error",
|
|
549
|
+
rule: "MISSING_PRESENTER_NOTES",
|
|
550
|
+
message: `Slide ${slideNumber} is missing presenter notes. 100% presenter notes coverage is required.`
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
if (slideCount >= 3 && !hasCover) {
|
|
555
|
+
issues.push({
|
|
556
|
+
slideIndex: 1,
|
|
557
|
+
severity: "warning",
|
|
558
|
+
rule: "MISSING_HERO_COVER",
|
|
559
|
+
message: 'Slide 1 should ideally use the "hero-cover" layout preset to introduce the topic and objectives.'
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
if (slideCount >= 6 && !hasQuiz) {
|
|
563
|
+
issues.push({
|
|
564
|
+
slideIndex: Math.floor(slideCount / 2),
|
|
565
|
+
severity: "warning",
|
|
566
|
+
rule: "MISSING_FORMATIVE_CHECKPOINT",
|
|
567
|
+
message: `Deck has ${slideCount} slides but lacks a "checkpoint-quiz" for mid-lesson active recall.`
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
if (slideCount >= 4 && !hasSummary) {
|
|
571
|
+
issues.push({
|
|
572
|
+
slideIndex: slideCount,
|
|
573
|
+
severity: "warning",
|
|
574
|
+
rule: "MISSING_SUMMARY_SLIDE",
|
|
575
|
+
message: 'Deck lacks a "summary-takeaways" wrap-up slide at the conclusion of the presentation.'
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
const notesCoveragePercent = Math.round(notesCount / slideCount * 100);
|
|
579
|
+
const errorCount = issues.filter((i) => i.severity === "error").length;
|
|
580
|
+
const warningCount = issues.filter((i) => i.severity === "warning").length;
|
|
581
|
+
let score = 100 - errorCount * 15 - warningCount * 4;
|
|
582
|
+
score = Math.max(0, Math.min(100, score));
|
|
583
|
+
const valid = strict ? issues.length === 0 : errorCount === 0;
|
|
584
|
+
if (errorCount > 0) {
|
|
585
|
+
suggestions.push(`Resolve ${errorCount} blocking error(s) before presenting or publishing.`);
|
|
586
|
+
}
|
|
587
|
+
if (notesCoveragePercent < 100) {
|
|
588
|
+
suggestions.push(`Increase presenter notes coverage from ${notesCoveragePercent}% to 100%.`);
|
|
589
|
+
}
|
|
590
|
+
if (!hasQuiz && slideCount >= 6) {
|
|
591
|
+
suggestions.push("Add an interactive checkpoint quiz around the midpoint of the lesson.");
|
|
592
|
+
}
|
|
593
|
+
return {
|
|
594
|
+
success: true,
|
|
595
|
+
valid,
|
|
596
|
+
score,
|
|
597
|
+
format: "html",
|
|
598
|
+
slideCount,
|
|
599
|
+
notesCoveragePercent,
|
|
600
|
+
issues,
|
|
601
|
+
suggestions
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
function validateMarkdownSlideDeck(markdown, strict = false) {
|
|
605
|
+
const issues = [];
|
|
606
|
+
const suggestions = [];
|
|
607
|
+
if (!markdown || markdown.trim().length === 0) {
|
|
608
|
+
return {
|
|
609
|
+
success: false,
|
|
610
|
+
valid: false,
|
|
611
|
+
score: 0,
|
|
612
|
+
format: "markdown",
|
|
613
|
+
slideCount: 0,
|
|
614
|
+
notesCoveragePercent: 0,
|
|
615
|
+
issues: [{
|
|
616
|
+
slideIndex: 0,
|
|
617
|
+
severity: "error",
|
|
618
|
+
rule: "EMPTY_MARKDOWN",
|
|
619
|
+
message: "Markdown slide presentation is empty."
|
|
620
|
+
}],
|
|
621
|
+
suggestions: ['Provide Markdown slide content delimited by "---".']
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
const rawSlides = markdown.split(/\n---\n/);
|
|
625
|
+
const slideCount = rawSlides.length;
|
|
626
|
+
let notesCount = 0;
|
|
627
|
+
rawSlides.forEach((slideContent, idx) => {
|
|
628
|
+
const slideNumber = idx + 1;
|
|
629
|
+
const trimmed = slideContent.trim();
|
|
630
|
+
const notesMatch = trimmed.match(/<!--\s*(?:Presenter Notes:?[\s\S]*?|[\s\S]*?notes[\s\S]*?)-->/i);
|
|
631
|
+
if (notesMatch) {
|
|
632
|
+
notesCount++;
|
|
633
|
+
const noteBody = notesMatch[0];
|
|
634
|
+
const hasQuestion = noteBody.includes("?") || /cold-?call|question/i.test(noteBody);
|
|
635
|
+
const hasTip = /scaffold|tip|analogy|hint/i.test(noteBody);
|
|
636
|
+
if (!hasQuestion || !hasTip) {
|
|
637
|
+
issues.push({
|
|
638
|
+
slideIndex: slideNumber,
|
|
639
|
+
severity: "warning",
|
|
640
|
+
rule: "INCOMPLETE_PRESENTER_NOTES",
|
|
641
|
+
message: `Presenter notes on slide ${slideNumber} should include Talk Track, a Cold-Call Question, and a Scaffolding Tip.`
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
} else {
|
|
645
|
+
issues.push({
|
|
646
|
+
slideIndex: slideNumber,
|
|
647
|
+
severity: "error",
|
|
648
|
+
rule: "MISSING_PRESENTER_NOTES",
|
|
649
|
+
message: `Slide ${slideNumber} is missing presenter notes comments (<!-- Presenter Notes: ... -->).`
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
const codeBlockTokens = trimmed.match(/```/g);
|
|
653
|
+
if (codeBlockTokens && codeBlockTokens.length % 2 !== 0) {
|
|
654
|
+
issues.push({
|
|
655
|
+
slideIndex: slideNumber,
|
|
656
|
+
severity: "error",
|
|
657
|
+
rule: "UNCLOSED_CODE_BLOCK",
|
|
658
|
+
message: `Slide ${slideNumber} contains unclosed code fence backticks (\`\`\`).`
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
const cleanBody = trimmed.replace(/<!--[\s\S]*?-->/g, "").replace(/```[\s\S]*?```/g, "");
|
|
662
|
+
const words = countWords(cleanBody);
|
|
663
|
+
if (words > 100) {
|
|
664
|
+
issues.push({
|
|
665
|
+
slideIndex: slideNumber,
|
|
666
|
+
severity: "warning",
|
|
667
|
+
rule: "ZERO_SCROLL_WORD_BUDGET",
|
|
668
|
+
message: `Slide ${slideNumber} body has ${words} words. Keep within 40-70 words per slide to prevent vertical scroll.`
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
const notesCoveragePercent = Math.round(notesCount / slideCount * 100);
|
|
673
|
+
const errorCount = issues.filter((i) => i.severity === "error").length;
|
|
674
|
+
const warningCount = issues.filter((i) => i.severity === "warning").length;
|
|
675
|
+
let score = 100 - errorCount * 15 - warningCount * 4;
|
|
676
|
+
score = Math.max(0, Math.min(100, score));
|
|
677
|
+
const valid = strict ? issues.length === 0 : errorCount === 0;
|
|
678
|
+
return {
|
|
679
|
+
success: true,
|
|
680
|
+
valid,
|
|
681
|
+
score,
|
|
682
|
+
format: "markdown",
|
|
683
|
+
slideCount,
|
|
684
|
+
notesCoveragePercent,
|
|
685
|
+
issues,
|
|
686
|
+
suggestions
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
function executeValidateSlideDeck(input) {
|
|
690
|
+
const format = input.format || "auto";
|
|
691
|
+
if (format === "html" || format === "auto" && input.htmlDeck && input.htmlDeck.slides) {
|
|
692
|
+
return validateHtmlSlideDeck(input.htmlDeck || { slides: [] }, input.strict);
|
|
693
|
+
}
|
|
694
|
+
if (format === "markdown" || format === "auto" && input.markdown) {
|
|
695
|
+
return validateMarkdownSlideDeck(input.markdown || "", input.strict);
|
|
696
|
+
}
|
|
697
|
+
return {
|
|
698
|
+
success: false,
|
|
699
|
+
valid: false,
|
|
700
|
+
score: 0,
|
|
701
|
+
format: "html",
|
|
702
|
+
slideCount: 0,
|
|
703
|
+
notesCoveragePercent: 0,
|
|
704
|
+
issues: [{
|
|
705
|
+
slideIndex: 0,
|
|
706
|
+
severity: "error",
|
|
707
|
+
rule: "INVALID_INPUT",
|
|
708
|
+
message: "Neither htmlDeck nor markdown was supplied for slide deck validation."
|
|
709
|
+
}],
|
|
710
|
+
suggestions: ['Provide either "htmlDeck" object or "markdown" string in the validation parameters.']
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
var handleValidateSlideDeck = executeValidateSlideDeck;
|
|
714
|
+
var listHtmlSlidePresetsSchema = z.object({
|
|
715
|
+
category: z.enum(["all", "cover", "content", "split", "grid", "timeline", "callout", "assessment"]).optional().describe("Optional category filter for HTML layout presets")
|
|
716
|
+
});
|
|
717
|
+
var htmlSlideSlotDataSchema = z.object({
|
|
718
|
+
layoutId: z.enum([
|
|
719
|
+
"hero-cover",
|
|
720
|
+
"split-concept-code",
|
|
721
|
+
"two-columns-compare",
|
|
722
|
+
"three-cards-grid",
|
|
723
|
+
"timeline-steps",
|
|
724
|
+
"metric-callout",
|
|
725
|
+
"checkpoint-quiz",
|
|
726
|
+
"summary-takeaways"
|
|
727
|
+
]).describe("Layout preset ID"),
|
|
728
|
+
slots: z.record(z.any()).describe("Key-value slot dictionary matching the chosen layout requirements"),
|
|
729
|
+
notes: z.string().optional().describe("Presenter speech track or teaching guide for this slide")
|
|
730
|
+
});
|
|
731
|
+
var generateHtmlDeckSchema = z.object({
|
|
732
|
+
title: z.string().describe("Title of the presentation / lesson deck"),
|
|
733
|
+
subtitle: z.string().optional().describe("Subtitle or target audience / grade"),
|
|
734
|
+
theme: z.enum(["blue-professional", "editorial-forest", "cobalt-grid", "studio", "monochrome"]).default("blue-professional").describe("Visual theme palette"),
|
|
735
|
+
slides: z.array(htmlSlideSlotDataSchema).min(1).describe("List of slides with designated layouts and slot contents")
|
|
736
|
+
});
|
|
737
|
+
var createHtmlSlideSchema = z.object({
|
|
738
|
+
layoutId: z.enum([
|
|
739
|
+
"hero-cover",
|
|
740
|
+
"split-concept-code",
|
|
741
|
+
"two-columns-compare",
|
|
742
|
+
"three-cards-grid",
|
|
743
|
+
"timeline-steps",
|
|
744
|
+
"metric-callout",
|
|
745
|
+
"checkpoint-quiz",
|
|
746
|
+
"summary-takeaways"
|
|
747
|
+
]).describe("Layout preset ID"),
|
|
748
|
+
slots: z.record(z.any()).describe("Key-value content slots"),
|
|
749
|
+
notes: z.string().optional().describe("Speaker talk track or question prompts")
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
// src/ai/html/prompt.ts
|
|
753
|
+
var SLIDE_HTML_PROMPT_CONTRACT = `
|
|
754
|
+
# \u{1F3A8} HTML SLIDE ENGINE \u2014 AGENT GENERATION CONTRACT
|
|
755
|
+
|
|
756
|
+
You are an expert Presentation Designer and Curriculum Architect producing professional, high-impact slide decks.
|
|
757
|
+
Instead of generating free-form HTML or brittle Markdown hacks, you MUST fill structured content into pre-tested **Layout Presets**.
|
|
758
|
+
|
|
759
|
+
## Available Layout Presets & Required Slots:
|
|
760
|
+
|
|
761
|
+
1. **hero-cover** (Cover / Title Slide)
|
|
762
|
+
- \`tag\` (string): e.g. "Unit 01 \xB7 Lesson 02"
|
|
763
|
+
- \`title\` (string): Main bold headline
|
|
764
|
+
- \`subtitle\` (string): Subtitle or 1-sentence learning objective
|
|
765
|
+
- \`author\` (string): Instructor / Organization
|
|
766
|
+
- \`date\` (string): Course term or date
|
|
767
|
+
|
|
768
|
+
2. **split-concept-code** (Theory + Code Snippet)
|
|
769
|
+
- \`tag\` (string): Section topic tag
|
|
770
|
+
- \`title\` (string): Topic heading
|
|
771
|
+
- \`points\` (string[]): 3 to 4 concise bullet takeaways
|
|
772
|
+
- \`code\` (string): Executable source code
|
|
773
|
+
- \`language\` (string): Language name (e.g. "python", "typescript", "swift")
|
|
774
|
+
- \`codeNote\` (string, optional): One-line hint or execution output
|
|
775
|
+
|
|
776
|
+
3. **two-columns-compare** (Comparison / Pros vs Cons)
|
|
777
|
+
- \`tag\` (string): Topic tag
|
|
778
|
+
- \`title\` (string): Headline
|
|
779
|
+
- \`col1Title\` (string): e.g. "Synchronous I/O"
|
|
780
|
+
- \`col1Items\` (string[]): 3 to 4 points
|
|
781
|
+
- \`col2Title\` (string): e.g. "Asynchronous I/O"
|
|
782
|
+
- \`col2Items\` (string[]): 3 to 4 points
|
|
783
|
+
|
|
784
|
+
4. **three-cards-grid** (3 Core Pillars / Architecture)
|
|
785
|
+
- \`tag\` (string): e.g. "Core Principles"
|
|
786
|
+
- \`title\` (string): Overview headline
|
|
787
|
+
- \`cards\` (array of objects): Exactly 3 cards:
|
|
788
|
+
- \`badge\`: e.g. "01", "LAYER 1"
|
|
789
|
+
- \`title\`: Card headline
|
|
790
|
+
- \`desc\`: 1-2 sentence description
|
|
791
|
+
- \`footer\` (optional): Key takeaway
|
|
792
|
+
|
|
793
|
+
5. **timeline-steps** (Algorithm / Execution Pipeline)
|
|
794
|
+
- \`tag\` (string): e.g. "Workflow"
|
|
795
|
+
- \`title\` (string): Headline
|
|
796
|
+
- \`steps\` (array of objects): 3 to 5 steps:
|
|
797
|
+
- \`stepNum\` (number/string): 1, 2, 3...
|
|
798
|
+
- \`title\`: Step name
|
|
799
|
+
- \`desc\`: What happens at this step
|
|
800
|
+
|
|
801
|
+
6. **metric-callout** (Key Theorem / Benchmark Statistic)
|
|
802
|
+
- \`tag\` (string): e.g. "Time Complexity"
|
|
803
|
+
- \`metric\` (string): Big stat (e.g. "O(log N)", "99.99%", "10x")
|
|
804
|
+
- \`metricLabel\` (string): e.g. "Lookup Efficiency"
|
|
805
|
+
- \`title\` (string): Main takeaway
|
|
806
|
+
- \`desc\` (string): Contextual explanation
|
|
807
|
+
|
|
808
|
+
7. **checkpoint-quiz** (Interactive Checkpoint)
|
|
809
|
+
- \`tag\` (string): e.g. "Quick Knowledge Check"
|
|
810
|
+
- \`question\` (string): Clear question prompt
|
|
811
|
+
- \`options\` (array of objects): 2 to 4 options:
|
|
812
|
+
- \`label\`: "A", "B", "C", "D"
|
|
813
|
+
- \`text\`: Option text
|
|
814
|
+
- \`explanation\` (string): Explanatory rationale
|
|
815
|
+
|
|
816
|
+
8. **summary-takeaways** (Wrap-Up / Next Steps)
|
|
817
|
+
- \`tag\` (string): e.g. "Recap"
|
|
818
|
+
- \`title\` (string): Wrap-up headline
|
|
819
|
+
- \`takeaways\` (string[]): 3 to 4 memorable bullet points
|
|
820
|
+
- \`nextStep\` (string): Teaser for the next lesson or project
|
|
821
|
+
|
|
822
|
+
## Aesthetic & Quality Invariants ("Anti-AI-Slop"):
|
|
823
|
+
- **Brevity is King (Zero-Scroll Invariant):** Each slide is calibrated for a 1920\xD71080 canvas. Maximum **35\u201340 words** per card or column; maximum **15 words** per bullet item. Never write dense multi-sentence paragraphs that cause vertical scrolling.
|
|
824
|
+
- **Pedagogical Pacing:** Start with \`hero-cover\`, alternate between \`split-concept-code\`, \`two-columns-compare\` and \`three-cards-grid\`, insert a \`checkpoint-quiz\` midway, and finish with \`summary-takeaways\`.
|
|
825
|
+
- **Theme Selection:**
|
|
826
|
+
- \`blue-professional\`: General academic, clean engineering, trustworthy.
|
|
827
|
+
- \`cobalt-grid\`: Advanced tech, algorithms, robotics, cybersecurity.
|
|
828
|
+
- \`editorial-forest\`: Thoughtful design, literature, ethics, science.
|
|
829
|
+
- \`studio\`: Minimalist product design, modern software.
|
|
830
|
+
- \`monochrome\`: Pure high-contrast dark mode.
|
|
831
|
+
|
|
832
|
+
## \u{1FA84} Step Reveal & Progressive Disclosure:
|
|
833
|
+
- The presentation shell supports sequential step reveal via mouse click or Space/Arrow keys.
|
|
834
|
+
- Bullet lists (\`points\`, \`col1Items\`, \`col2Items\`), cards in \`three-cards-grid\`, and steps in \`timeline-steps\` reveal progressively one by one before navigating to the next slide.
|
|
835
|
+
- In custom HTML slots, you can attach \`class="step-reveal"\`, \`data-step\`, \`data-reveal\`, or \`data-auto-reveal="true"\` on parent containers to enable click-by-click stepped appearance.
|
|
836
|
+
|
|
837
|
+
## \u{1F399}\uFE0F Mandatory 3-Part Presenter Notes Contract:
|
|
838
|
+
Every single slide MUST include the \`notes\` property structured with these 3 explicit components:
|
|
839
|
+
1. **Talk Track:** 2-3 sentences of exact conversational speaking script for the teacher/presenter.
|
|
840
|
+
2. **Cold-Call Check Question:** 1 diagnostic question to check understanding with a named student or attendee.
|
|
841
|
+
3. **Scaffolding Tip:** 1 intuitive analogy or troubleshooting hint in case learners struggle with the concept.
|
|
842
|
+
|
|
843
|
+
Example Notes:
|
|
844
|
+
\`\`\`markdown
|
|
845
|
+
Talk Track: Here we contrast synchronous blocking I/O with asynchronous event-driven handling. Notice how threads remain idle while waiting for network responses.
|
|
846
|
+
Cold-Call: "Jordan, looking at the left column, what happens to thread pool throughput when network latency quadruples?"
|
|
847
|
+
Scaffolding Tip: Compare it to ordering coffee at a counter (async buzzer) versus waiting at the register until the cup is brewed (sync blocking).
|
|
848
|
+
\`\`\`
|
|
849
|
+
`;
|
|
850
|
+
|
|
851
|
+
// src/ai/html/tools.ts
|
|
852
|
+
function handleListHtmlSlidePresets(input) {
|
|
853
|
+
const category = input.category || "all";
|
|
854
|
+
const presets = Object.values(HTML_SLIDE_PRESETS).filter((p) => category === "all" || p.category === category).map((p) => ({
|
|
855
|
+
id: p.id,
|
|
856
|
+
name: p.name,
|
|
857
|
+
category: p.category,
|
|
858
|
+
description: p.description,
|
|
859
|
+
slots: p.slots.map((s) => ({
|
|
860
|
+
name: s.name,
|
|
861
|
+
label: s.label,
|
|
862
|
+
type: s.type,
|
|
863
|
+
required: Boolean(s.required),
|
|
864
|
+
description: s.description
|
|
865
|
+
}))
|
|
866
|
+
}));
|
|
867
|
+
return {
|
|
868
|
+
success: true,
|
|
869
|
+
presets,
|
|
870
|
+
availableThemes: Object.keys(HTML_THEMES)
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
function handleGenerateHtmlDeck(input) {
|
|
874
|
+
try {
|
|
875
|
+
const result = compileHtmlDeck(input);
|
|
876
|
+
return {
|
|
877
|
+
success: true,
|
|
878
|
+
title: result.title,
|
|
879
|
+
slideCount: result.slideCount,
|
|
880
|
+
theme: result.theme.id,
|
|
881
|
+
html: result.html
|
|
882
|
+
};
|
|
883
|
+
} catch (err) {
|
|
884
|
+
return {
|
|
885
|
+
success: false,
|
|
886
|
+
error: err.message || "Failed to compile HTML slide deck"
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
function handleCreateHtmlSlide(input) {
|
|
891
|
+
const preset = HTML_SLIDE_PRESETS[input.layoutId];
|
|
892
|
+
if (!preset) {
|
|
893
|
+
return {
|
|
894
|
+
success: false,
|
|
895
|
+
error: `Unknown layout preset: ${input.layoutId}`
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
return {
|
|
899
|
+
success: true,
|
|
900
|
+
slide: {
|
|
901
|
+
layoutId: input.layoutId,
|
|
902
|
+
slots: input.slots,
|
|
903
|
+
notes: input.notes
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
var executeListHtmlSlidePresets = handleListHtmlSlidePresets;
|
|
908
|
+
var executeGenerateHtmlDeck = handleGenerateHtmlDeck;
|
|
909
|
+
var executeCreateHtmlSlide = handleCreateHtmlSlide;
|
|
414
910
|
|
|
415
|
-
export { SLIDE_DESIGN_PROMPT_CONTRACT, applySlideLayoutSchema, createSlideFromPresetSchema, executeApplySlideLayout, executeCreateSlideFromPreset, executeGenerateDeckOutline, executeListSlidePresets, executeUpdatePresenterNotes, generateDeckOutlineSchema, listSlidePresetsSchema, updatePresenterNotesSchema };
|
|
911
|
+
export { SLIDE_DESIGN_PROMPT_CONTRACT, SLIDE_HTML_PROMPT_CONTRACT, applySlideLayoutSchema, createHtmlSlideSchema, createSlideFromPresetSchema, executeApplySlideLayout, executeCreateHtmlSlide, executeCreateSlideFromPreset, executeGenerateDeckOutline, executeGenerateHtmlDeck, executeListHtmlSlidePresets, executeListSlidePresets, executeUpdatePresenterNotes, executeValidateSlideDeck, generateDeckOutlineSchema, generateHtmlDeckSchema, handleCreateHtmlSlide, handleGenerateHtmlDeck, handleListHtmlSlidePresets, handleValidateSlideDeck, htmlSlideSlotDataSchema, listHtmlSlidePresetsSchema, listSlidePresetsSchema, updatePresenterNotesSchema, validateHtmlSlideDeck, validateMarkdownSlideDeck, validateSlideDeckSchema };
|
|
416
912
|
//# sourceMappingURL=index.js.map
|
|
417
913
|
//# sourceMappingURL=index.js.map
|