@thanh01.pmt/presentation-kit 0.2.15 → 0.2.16
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 +145 -16
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +15 -15
- package/dist/ai/index.d.ts +15 -15
- package/dist/ai/index.js +132 -3
- package/dist/ai/index.js.map +1 -1
- package/dist/{chunk-YPYAP4TF.js → chunk-7QHDWDSB.js} +218 -4
- package/dist/chunk-7QHDWDSB.js.map +1 -0
- package/dist/{chunk-SUGKWGJJ.cjs → chunk-JNTRKKJX.cjs} +218 -3
- package/dist/chunk-JNTRKKJX.cjs.map +1 -0
- package/dist/index.cjs +19 -15
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -2
- package/dist/react/index.cjs +5 -5
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-SUGKWGJJ.cjs.map +0 -1
- package/dist/chunk-YPYAP4TF.js.map +0 -1
package/dist/ai/index.d.ts
CHANGED
|
@@ -215,20 +215,20 @@ declare const validateSlideDeckSchema: z.ZodObject<{
|
|
|
215
215
|
slots: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
216
216
|
notes: z.ZodOptional<z.ZodString>;
|
|
217
217
|
}, "strip", z.ZodTypeAny, {
|
|
218
|
-
layoutId: string;
|
|
219
218
|
slots: Record<string, any>;
|
|
219
|
+
layoutId: string;
|
|
220
220
|
notes?: string | undefined;
|
|
221
221
|
}, {
|
|
222
|
-
layoutId: string;
|
|
223
222
|
slots: Record<string, any>;
|
|
223
|
+
layoutId: string;
|
|
224
224
|
notes?: string | undefined;
|
|
225
225
|
}>, "many">>;
|
|
226
226
|
}, "strip", z.ZodTypeAny, {
|
|
227
227
|
title?: string | undefined;
|
|
228
228
|
subtitle?: string | undefined;
|
|
229
229
|
slides?: {
|
|
230
|
-
layoutId: string;
|
|
231
230
|
slots: Record<string, any>;
|
|
231
|
+
layoutId: string;
|
|
232
232
|
notes?: string | undefined;
|
|
233
233
|
}[] | undefined;
|
|
234
234
|
theme?: string | undefined;
|
|
@@ -236,8 +236,8 @@ declare const validateSlideDeckSchema: z.ZodObject<{
|
|
|
236
236
|
title?: string | undefined;
|
|
237
237
|
subtitle?: string | undefined;
|
|
238
238
|
slides?: {
|
|
239
|
-
layoutId: string;
|
|
240
239
|
slots: Record<string, any>;
|
|
240
|
+
layoutId: string;
|
|
241
241
|
notes?: string | undefined;
|
|
242
242
|
}[] | undefined;
|
|
243
243
|
theme?: string | undefined;
|
|
@@ -251,8 +251,8 @@ declare const validateSlideDeckSchema: z.ZodObject<{
|
|
|
251
251
|
title?: string | undefined;
|
|
252
252
|
subtitle?: string | undefined;
|
|
253
253
|
slides?: {
|
|
254
|
-
layoutId: string;
|
|
255
254
|
slots: Record<string, any>;
|
|
255
|
+
layoutId: string;
|
|
256
256
|
notes?: string | undefined;
|
|
257
257
|
}[] | undefined;
|
|
258
258
|
theme?: string | undefined;
|
|
@@ -264,8 +264,8 @@ declare const validateSlideDeckSchema: z.ZodObject<{
|
|
|
264
264
|
title?: string | undefined;
|
|
265
265
|
subtitle?: string | undefined;
|
|
266
266
|
slides?: {
|
|
267
|
-
layoutId: string;
|
|
268
267
|
slots: Record<string, any>;
|
|
268
|
+
layoutId: string;
|
|
269
269
|
notes?: string | undefined;
|
|
270
270
|
}[] | undefined;
|
|
271
271
|
theme?: string | undefined;
|
|
@@ -324,12 +324,12 @@ declare const htmlSlideSlotDataSchema: z.ZodObject<{
|
|
|
324
324
|
slots: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
325
325
|
notes: z.ZodOptional<z.ZodString>;
|
|
326
326
|
}, "strip", z.ZodTypeAny, {
|
|
327
|
-
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
328
327
|
slots: Record<string, any>;
|
|
328
|
+
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
329
329
|
notes?: string | undefined;
|
|
330
330
|
}, {
|
|
331
|
-
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
332
331
|
slots: Record<string, any>;
|
|
332
|
+
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
333
333
|
notes?: string | undefined;
|
|
334
334
|
}>;
|
|
335
335
|
declare const generateHtmlDeckSchema: z.ZodObject<{
|
|
@@ -341,19 +341,19 @@ declare const generateHtmlDeckSchema: z.ZodObject<{
|
|
|
341
341
|
slots: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
342
342
|
notes: z.ZodOptional<z.ZodString>;
|
|
343
343
|
}, "strip", z.ZodTypeAny, {
|
|
344
|
-
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
345
344
|
slots: Record<string, any>;
|
|
345
|
+
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
346
346
|
notes?: string | undefined;
|
|
347
347
|
}, {
|
|
348
|
-
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
349
348
|
slots: Record<string, any>;
|
|
349
|
+
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
350
350
|
notes?: string | undefined;
|
|
351
351
|
}>, "many">;
|
|
352
352
|
}, "strip", z.ZodTypeAny, {
|
|
353
353
|
title: string;
|
|
354
354
|
slides: {
|
|
355
|
-
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
356
355
|
slots: Record<string, any>;
|
|
356
|
+
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
357
357
|
notes?: string | undefined;
|
|
358
358
|
}[];
|
|
359
359
|
theme: "blue-professional" | "editorial-forest" | "cobalt-grid" | "studio" | "monochrome";
|
|
@@ -361,8 +361,8 @@ declare const generateHtmlDeckSchema: z.ZodObject<{
|
|
|
361
361
|
}, {
|
|
362
362
|
title: string;
|
|
363
363
|
slides: {
|
|
364
|
-
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
365
364
|
slots: Record<string, any>;
|
|
365
|
+
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
366
366
|
notes?: string | undefined;
|
|
367
367
|
}[];
|
|
368
368
|
subtitle?: string | undefined;
|
|
@@ -373,16 +373,16 @@ declare const createHtmlSlideSchema: z.ZodObject<{
|
|
|
373
373
|
slots: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
374
374
|
notes: z.ZodOptional<z.ZodString>;
|
|
375
375
|
}, "strip", z.ZodTypeAny, {
|
|
376
|
-
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
377
376
|
slots: Record<string, any>;
|
|
377
|
+
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
378
378
|
notes?: string | undefined;
|
|
379
379
|
}, {
|
|
380
|
-
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
381
380
|
slots: Record<string, any>;
|
|
381
|
+
layoutId: "hero-cover" | "split-concept-code" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
|
|
382
382
|
notes?: string | undefined;
|
|
383
383
|
}>;
|
|
384
384
|
|
|
385
|
-
declare const SLIDE_HTML_PROMPT_CONTRACT = "\n# \uD83C\uDFA8 HTML SLIDE ENGINE \u2014 AGENT GENERATION CONTRACT\n\nYou are an expert Presentation Designer and Curriculum Architect producing professional, high-impact slide decks.\nInstead of generating free-form HTML or brittle Markdown hacks, you MUST fill structured content into pre-tested **Layout Presets**.\n\n## Available Layout Presets & Required Slots:\n\n1. **hero-cover** (Cover / Title Slide)\n - `tag` (string): e.g. \"Unit 01 \u00B7 Lesson 02\"\n - `title` (string): Main bold headline\n - `subtitle` (string): Subtitle or 1-sentence learning objective\n - `author` (string): Instructor / Organization\n - `date` (string): Course term or date\n\n2. **split-concept-code** (Theory + Code Snippet)\n - `tag` (string): Section topic tag\n - `title` (string): Topic heading\n - `points` (string[]): 3 to 4 concise bullet takeaways\n - `code` (string): Executable source code\n - `language` (string): Language name (e.g. \"python\", \"typescript\", \"swift\")\n - `codeNote` (string, optional): One-line hint or execution output\n\n3. **two-columns-compare** (Comparison / Pros vs Cons)\n - `tag` (string): Topic tag\n - `title` (string): Headline\n - `col1Title` (string): e.g. \"Synchronous I/O\"\n - `col1Items` (string[]): 3 to 4 points\n - `col2Title` (string): e.g. \"Asynchronous I/O\"\n - `col2Items` (string[]): 3 to 4 points\n\n4. **three-cards-grid** (3 Core Pillars / Architecture)\n - `tag` (string): e.g. \"Core Principles\"\n - `title` (string): Overview headline\n - `cards` (array of objects): Exactly 3 cards:\n - `badge`: e.g. \"01\", \"LAYER 1\"\n - `title`: Card headline\n - `desc`: 1-2 sentence description\n - `footer` (optional): Key takeaway\n\n5. **timeline-steps** (Algorithm / Execution Pipeline)\n - `tag` (string): e.g. \"Workflow\"\n - `title` (string): Headline\n - `steps` (array of objects): 3 to 5 steps:\n - `stepNum` (number/string): 1, 2, 3...\n - `title`: Step name\n - `desc`: What happens at this step\n\n6. **metric-callout** (Key Theorem / Benchmark Statistic)\n - `tag` (string): e.g. \"Time Complexity\"\n - `metric` (string): Big stat (e.g. \"O(log N)\", \"99.99%\", \"10x\")\n - `metricLabel` (string): e.g. \"Lookup Efficiency\"\n - `title` (string): Main takeaway\n - `desc` (string): Contextual explanation\n\n7. **checkpoint-quiz** (Interactive Checkpoint)\n - `tag` (string): e.g. \"Quick Knowledge Check\"\n - `question` (string): Clear question prompt\n - `options` (array of objects): 2 to 4 options:\n - `label`: \"A\", \"B\", \"C\", \"D\"\n - `text`: Option text\n - `explanation` (string): Explanatory rationale\n\n8. **summary-takeaways** (Wrap-Up / Next Steps)\n - `tag` (string): e.g. \"Recap\"\n - `title` (string): Wrap-up headline\n - `takeaways` (string[]): 3 to 4 memorable bullet points\n - `nextStep` (string): Teaser for the next lesson or project\n\n## Aesthetic & Quality Invariants (\"Anti-AI-Slop\"):\n- **Brevity is King (Zero-Scroll Invariant):** Each slide is calibrated for a 1920\u00D71080 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.\n- **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`.\n- **Theme Selection:**\n - `blue-professional`: General academic, clean engineering, trustworthy.\n - `cobalt-grid`: Advanced tech, algorithms, robotics, cybersecurity.\n - `editorial-forest`: Thoughtful design, literature, ethics, science.\n - `studio`: Minimalist product design, modern software.\n - `monochrome`: Pure high-contrast dark mode.\n\n## \uD83E\uDE84 Step Reveal & Progressive Disclosure:\n- The presentation shell supports sequential step reveal via mouse click or Space/Arrow keys.\n- 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.\n- 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.\n\n## \uD83C\uDF99\uFE0F Mandatory 3-Part Presenter Notes Contract:\nEvery single slide MUST include the `notes` property structured with these 3 explicit components:\n1. **Talk Track:** 2-3 sentences of exact conversational speaking script for the teacher/presenter.\n2. **Cold-Call Check Question:** 1 diagnostic question to check understanding with a named student or attendee.\n3. **Scaffolding Tip:** 1 intuitive analogy or troubleshooting hint in case learners struggle with the concept.\n\nExample Notes:\n```markdown\nTalk Track: Here we contrast synchronous blocking I/O with asynchronous event-driven handling. Notice how threads remain idle while waiting for network responses.\nCold-Call: \"Jordan, looking at the left column, what happens to thread pool throughput when network latency quadruples?\"\nScaffolding Tip: Compare it to ordering coffee at a counter (async buzzer) versus waiting at the register until the cup is brewed (sync blocking).\n```\n";
|
|
385
|
+
declare const SLIDE_HTML_PROMPT_CONTRACT = "\n# \uD83C\uDFA8 HTML SLIDE ENGINE \u2014 AGENT GENERATION CONTRACT\n\nYou are an expert Presentation Designer and Curriculum Architect producing professional, high-impact slide decks.\nInstead of generating free-form HTML or brittle Markdown hacks, you MUST fill structured content into pre-tested **Layout Presets**.\n\n## Available Layout Presets & Required Slots:\n\n1. **hero-cover** (Cover / Title Slide)\n - `tag` (string): e.g. \"Unit 01 \u00B7 Lesson 02\"\n - `title` (string): Main bold headline\n - `subtitle` (string): Subtitle or 1-sentence learning objective\n - `author` (string): Instructor / Organization\n - `date` (string): Course term or date\n\n2. **split-concept-code** (Theory + Code Snippet)\n - `tag` (string): Section topic tag\n - `title` (string): Topic heading\n - `points` (string[]): 3 to 4 concise bullet takeaways\n - `code` (string): Executable source code\n - `language` (string): Language name (e.g. \"python\", \"typescript\", \"swift\")\n - `codeNote` (string, optional): One-line hint or execution output\n\n3. **two-columns-compare** (Comparison / Pros vs Cons)\n - `tag` (string): Topic tag\n - `title` (string): Headline\n - `col1Title` (string): e.g. \"Synchronous I/O\"\n - `col1Items` (string[]): 3 to 4 points\n - `col2Title` (string): e.g. \"Asynchronous I/O\"\n - `col2Items` (string[]): 3 to 4 points\n\n4. **three-cards-grid** (3 Core Pillars / Architecture)\n - `tag` (string): e.g. \"Core Principles\"\n - `title` (string): Overview headline\n - `cards` (array of objects): Exactly 3 cards:\n - `badge`: e.g. \"01\", \"LAYER 1\"\n - `title`: Card headline\n - `desc`: 1-2 sentence description\n - `footer` (optional): Key takeaway\n\n5. **timeline-steps** (Algorithm / Execution Pipeline)\n - `tag` (string): e.g. \"Workflow\"\n - `title` (string): Headline\n - `steps` (array of objects): 3 to 5 steps:\n - `stepNum` (number/string): 1, 2, 3...\n - `title`: Step name\n - `desc`: What happens at this step\n\n6. **metric-callout** (Key Theorem / Benchmark Statistic)\n - `tag` (string): e.g. \"Time Complexity\"\n - `metric` (string): Big stat (e.g. \"O(log N)\", \"99.99%\", \"10x\")\n - `metricLabel` (string): e.g. \"Lookup Efficiency\"\n - `title` (string): Main takeaway\n - `desc` (string): Contextual explanation\n\n7. **checkpoint-quiz** (Interactive Checkpoint)\n - `tag` (string): e.g. \"Quick Knowledge Check\"\n - `question` (string): Clear question prompt\n - `options` (array of objects): 2 to 4 options:\n - `label`: \"A\", \"B\", \"C\", \"D\"\n - `text`: Option text\n - `explanation` (string): Explanatory rationale\n\n8. **summary-takeaways** (Wrap-Up / Next Steps)\n - `tag` (string): e.g. \"Recap\"\n - `title` (string): Wrap-up headline\n - `takeaways` (string[]): 3 to 4 memorable bullet points\n - `nextStep` (string): Teaser for the next lesson or project\n\n## Aesthetic & Quality Invariants (\"Anti-AI-Slop\"):\n- **Brevity is King (Zero-Scroll Invariant):** Each slide is calibrated for a 1920\u00D71080 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.\n- **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`.\n- **Theme Selection:**\n - `blue-professional`: General academic, clean engineering, trustworthy.\n - `cobalt-grid`: Advanced tech, algorithms, robotics, cybersecurity.\n - `editorial-forest`: Thoughtful design, literature, ethics, science.\n - `studio`: Minimalist product design, modern software.\n - `monochrome`: Pure high-contrast dark mode.\n\n## \uD83E\uDE84 Step Reveal & Progressive Disclosure:\n- The presentation shell supports sequential step reveal via mouse click or Space/Arrow keys.\n- 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.\n- 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.\n\n## \uD83C\uDF99\uFE0F Mandatory 3-Part Presenter Notes Contract:\nEvery single slide MUST include the `notes` property structured with these 3 explicit components:\n1. **Talk Track:** 2-3 sentences of exact conversational speaking script for the teacher/presenter.\n2. **Cold-Call Check Question:** 1 diagnostic question to check understanding with a named student or attendee.\n3. **Scaffolding Tip:** 1 intuitive analogy or troubleshooting hint in case learners struggle with the concept.\n\nExample Notes:\n```markdown\nTalk Track: Here we contrast synchronous blocking I/O with asynchronous event-driven handling. Notice how threads remain idle while waiting for network responses.\nCold-Call: \"Jordan, looking at the left column, what happens to thread pool throughput when network latency quadruples?\"\nScaffolding Tip: Compare it to ordering coffee at a counter (async buzzer) versus waiting at the register until the cup is brewed (sync blocking).\n```\n\n## \uD83E\uDDF1 MANDATORY JSON DECK OUTPUT STRUCTURE & SCHEMA:\nYou MUST output a single valid JSON object.\nCRITICAL: All layout data MUST be placed inside the `slots` object of each slide. Never put raw unstructured strings like `content: \"...\"`!\n\n```json\n{\n \"title\": \"Full Lesson Presentation Title\",\n \"theme\": \"blue-professional\",\n \"slides\": [\n {\n \"id\": 1,\n \"layoutId\": \"hero-cover\",\n \"slots\": {\n \"tag\": \"Unit 01 \u00B7 Lesson 01\",\n \"title\": \"macOS & Xcode Environment Setup\",\n \"subtitle\": \"Master the Apple developer toolchain and build your first SwiftUI application lifecycle\",\n \"author\": \"Curriculum OS\",\n \"date\": \"2026\"\n },\n \"notes\": \"Talk Track: Welcome everyone. Today we establish our core iOS development environment...\\nCold-Call: 'Alex, why do we need Xcode Command Line Tools?'\\nScaffolding Tip: Think of Xcode as the full workshop and the SDK as the raw materials.\"\n },\n {\n \"id\": 2,\n \"layoutId\": \"split-concept-code\",\n \"slots\": {\n \"tag\": \"Architecture & Syntax\",\n \"title\": \"SwiftUI App Entry Point\",\n \"points\": [\n \"@main attribute designates the entry point of the app\",\n \"App protocol defines the structure and scene hierarchy\",\n \"WindowGroup manages the root view lifecycle across platforms\"\n ],\n \"code\": \"import SwiftUI\\n\\n@main\\nstruct MyApp: App {\\n var body: some Scene {\\n WindowGroup {\\n ContentView()\\n }\\n }\\n}\",\n \"language\": \"swift\",\n \"codeNote\": \"Notice how Scene encapsulates WindowGroup automatically\"\n },\n \"notes\": \"Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ...\"\n },\n {\n \"id\": 3,\n \"layoutId\": \"three-cards-grid\",\n \"slots\": {\n \"tag\": \"Core Pillars\",\n \"title\": \"Three Pillars of App State\",\n \"cards\": [\n { \"badge\": \"01\", \"title\": \"Active State\", \"desc\": \"App is in foreground and responding to user events directly.\" },\n { \"badge\": \"02\", \"title\": \"Inactive State\", \"desc\": \"App is transitioning, interrupted by system dialogs or Control Center.\" },\n { \"badge\": \"03\", \"title\": \"Background State\", \"desc\": \"Executing background tasks or preparing for memory suspension.\" }\n ]\n },\n \"notes\": \"Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ...\"\n },\n {\n \"id\": 4,\n \"layoutId\": \"timeline-steps\",\n \"slots\": {\n \"tag\": \"Step-by-Step\",\n \"title\": \"Xcode Setup Workflow\",\n \"steps\": [\n { \"stepNum\": 1, \"title\": \"Download Xcode\", \"desc\": \"Install latest Xcode from the Mac App Store\" },\n { \"stepNum\": 2, \"title\": \"Command Line Tools\", \"desc\": \"Run xcode-select --install in Terminal\" },\n { \"stepNum\": 3, \"title\": \"Select Simulators\", \"desc\": \"Download iOS 18+ runtime simulators\" },\n { \"stepNum\": 4, \"title\": \"Verify Build\", \"desc\": \"Create a new SwiftUI project and press Cmd+R\" }\n ]\n },\n \"notes\": \"Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ...\"\n },\n {\n \"id\": 5,\n \"layoutId\": \"two-columns-compare\",\n \"slots\": {\n \"tag\": \"Comparison\",\n \"title\": \"SwiftUI vs UIKit Architecture\",\n \"col1Title\": \"SwiftUI (Declarative)\",\n \"col1Items\": [\n \"State drives the UI automatically\",\n \"Lightweight immutable structs\",\n \"Cross-platform unified API\"\n ],\n \"col2Title\": \"UIKit (Imperative)\",\n \"col2Items\": [\n \"Manual view controller manipulation\",\n \"Heavyweight class hierarchies\",\n \"Explicit event-driven updates\"\n ]\n },\n \"notes\": \"Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ...\"\n },\n {\n \"id\": 6,\n \"layoutId\": \"checkpoint-quiz\",\n \"slots\": {\n \"tag\": \"Knowledge Check\",\n \"question\": \"Which SwiftUI modifier is used to observe external observable state objects?\",\n \"options\": [\n { \"label\": \"A\", \"text\": \"@State\" },\n { \"label\": \"B\", \"text\": \"@StateObject / @ObservedObject\" },\n { \"label\": \"C\", \"text\": \"@Binding\" },\n { \"label\": \"D\", \"text\": \"@Environment\" }\n ],\n \"explanation\": \"@StateObject manages the lifecycle of reference-type ObservableObjects, while @State is for value types.\"\n },\n \"notes\": \"Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ...\"\n },\n {\n \"id\": 7,\n \"layoutId\": \"summary-takeaways\",\n \"slots\": {\n \"tag\": \"Recap & Next\",\n \"title\": \"Lesson Summary & Key Takeaways\",\n \"takeaways\": [\n \"Configured complete developer toolchain with Xcode 16+\",\n \"Understood SwiftUI declarative lifecycle and @main entry point\",\n \"Mastered App State transitions between active, inactive, and background\"\n ],\n \"nextStep\": \"Lesson 02: State Management & Reactive Data Flow with @State and @Binding\"\n },\n \"notes\": \"Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ...\"\n }\n ]\n}\n```\n\n## \uD83D\uDEAB STRICT ANTI-SLOP CONSTRAINTS:\n1. NEVER output a raw unstructured string like `content: \"...\"` or `content: \"Concept: ... Code snippet: ...\"`. All slide content MUST be placed inside the `slots` object with its specific keys (`points`, `code`, `cards`, `steps`, `options`, `takeaways`).\n2. NEVER use ellipsis `...` or placeholder comments in `code`. Every code snippet MUST be real, fully typed, syntax-valid, and pedagogical.\n3. NEVER leave `slots` empty `{}`.\n4. Output 6 to 8 substantive, rich slides covering the lesson plan thoroughly.\n";
|
|
386
386
|
|
|
387
387
|
declare function handleListHtmlSlidePresets(input: {
|
|
388
388
|
category?: string;
|
package/dist/ai/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SLIDE_LAYOUT_PRESETS, getSlideLayoutPresetsByCategory, getSlideLayoutPresetById, serializeLayoutToComment, updateSlideLayoutInMarkdown, splitMarkdownSlides, HTML_SLIDE_PRESETS, HTML_THEMES, compileHtmlDeck } from '../chunk-
|
|
1
|
+
import { SLIDE_LAYOUT_PRESETS, getSlideLayoutPresetsByCategory, getSlideLayoutPresetById, serializeLayoutToComment, updateSlideLayoutInMarkdown, splitMarkdownSlides, HTML_SLIDE_PRESETS, normalizeSlideSlots, HTML_THEMES, compileHtmlDeck } from '../chunk-7QHDWDSB.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
var listSlidePresetsSchema = z.object({
|
|
@@ -480,9 +480,10 @@ function validateHtmlSlideDeck(deck, strict = false) {
|
|
|
480
480
|
if (preset.category === "cover" && idx === 0) hasCover = true;
|
|
481
481
|
if (preset.id === "checkpoint-quiz") hasQuiz = true;
|
|
482
482
|
if (preset.id === "summary-takeaways") hasSummary = true;
|
|
483
|
+
const slots = normalizeSlideSlots(slide);
|
|
483
484
|
for (const slotDef of preset.slots) {
|
|
484
485
|
if (slotDef.required) {
|
|
485
|
-
const val =
|
|
486
|
+
const val = slots[slotDef.name];
|
|
486
487
|
if (val === void 0 || val === null || typeof val === "string" && val.trim() === "") {
|
|
487
488
|
issues.push({
|
|
488
489
|
slideIndex: slideNumber,
|
|
@@ -493,7 +494,6 @@ function validateHtmlSlideDeck(deck, strict = false) {
|
|
|
493
494
|
}
|
|
494
495
|
}
|
|
495
496
|
}
|
|
496
|
-
const slots = slide.slots || {};
|
|
497
497
|
for (const [key, val] of Object.entries(slots)) {
|
|
498
498
|
if (typeof val === "string") {
|
|
499
499
|
const words = countWords(val);
|
|
@@ -865,6 +865,135 @@ Talk Track: Here we contrast synchronous blocking I/O with asynchronous event-dr
|
|
|
865
865
|
Cold-Call: "Jordan, looking at the left column, what happens to thread pool throughput when network latency quadruples?"
|
|
866
866
|
Scaffolding Tip: Compare it to ordering coffee at a counter (async buzzer) versus waiting at the register until the cup is brewed (sync blocking).
|
|
867
867
|
\`\`\`
|
|
868
|
+
|
|
869
|
+
## \u{1F9F1} MANDATORY JSON DECK OUTPUT STRUCTURE & SCHEMA:
|
|
870
|
+
You MUST output a single valid JSON object.
|
|
871
|
+
CRITICAL: All layout data MUST be placed inside the \`slots\` object of each slide. Never put raw unstructured strings like \`content: "..."\`!
|
|
872
|
+
|
|
873
|
+
\`\`\`json
|
|
874
|
+
{
|
|
875
|
+
"title": "Full Lesson Presentation Title",
|
|
876
|
+
"theme": "blue-professional",
|
|
877
|
+
"slides": [
|
|
878
|
+
{
|
|
879
|
+
"id": 1,
|
|
880
|
+
"layoutId": "hero-cover",
|
|
881
|
+
"slots": {
|
|
882
|
+
"tag": "Unit 01 \xB7 Lesson 01",
|
|
883
|
+
"title": "macOS & Xcode Environment Setup",
|
|
884
|
+
"subtitle": "Master the Apple developer toolchain and build your first SwiftUI application lifecycle",
|
|
885
|
+
"author": "Curriculum OS",
|
|
886
|
+
"date": "2026"
|
|
887
|
+
},
|
|
888
|
+
"notes": "Talk Track: Welcome everyone. Today we establish our core iOS development environment...\\nCold-Call: 'Alex, why do we need Xcode Command Line Tools?'\\nScaffolding Tip: Think of Xcode as the full workshop and the SDK as the raw materials."
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
"id": 2,
|
|
892
|
+
"layoutId": "split-concept-code",
|
|
893
|
+
"slots": {
|
|
894
|
+
"tag": "Architecture & Syntax",
|
|
895
|
+
"title": "SwiftUI App Entry Point",
|
|
896
|
+
"points": [
|
|
897
|
+
"@main attribute designates the entry point of the app",
|
|
898
|
+
"App protocol defines the structure and scene hierarchy",
|
|
899
|
+
"WindowGroup manages the root view lifecycle across platforms"
|
|
900
|
+
],
|
|
901
|
+
"code": "import SwiftUI\\n\\n@main\\nstruct MyApp: App {\\n var body: some Scene {\\n WindowGroup {\\n ContentView()\\n }\\n }\\n}",
|
|
902
|
+
"language": "swift",
|
|
903
|
+
"codeNote": "Notice how Scene encapsulates WindowGroup automatically"
|
|
904
|
+
},
|
|
905
|
+
"notes": "Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ..."
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
"id": 3,
|
|
909
|
+
"layoutId": "three-cards-grid",
|
|
910
|
+
"slots": {
|
|
911
|
+
"tag": "Core Pillars",
|
|
912
|
+
"title": "Three Pillars of App State",
|
|
913
|
+
"cards": [
|
|
914
|
+
{ "badge": "01", "title": "Active State", "desc": "App is in foreground and responding to user events directly." },
|
|
915
|
+
{ "badge": "02", "title": "Inactive State", "desc": "App is transitioning, interrupted by system dialogs or Control Center." },
|
|
916
|
+
{ "badge": "03", "title": "Background State", "desc": "Executing background tasks or preparing for memory suspension." }
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
"notes": "Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ..."
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"id": 4,
|
|
923
|
+
"layoutId": "timeline-steps",
|
|
924
|
+
"slots": {
|
|
925
|
+
"tag": "Step-by-Step",
|
|
926
|
+
"title": "Xcode Setup Workflow",
|
|
927
|
+
"steps": [
|
|
928
|
+
{ "stepNum": 1, "title": "Download Xcode", "desc": "Install latest Xcode from the Mac App Store" },
|
|
929
|
+
{ "stepNum": 2, "title": "Command Line Tools", "desc": "Run xcode-select --install in Terminal" },
|
|
930
|
+
{ "stepNum": 3, "title": "Select Simulators", "desc": "Download iOS 18+ runtime simulators" },
|
|
931
|
+
{ "stepNum": 4, "title": "Verify Build", "desc": "Create a new SwiftUI project and press Cmd+R" }
|
|
932
|
+
]
|
|
933
|
+
},
|
|
934
|
+
"notes": "Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ..."
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"id": 5,
|
|
938
|
+
"layoutId": "two-columns-compare",
|
|
939
|
+
"slots": {
|
|
940
|
+
"tag": "Comparison",
|
|
941
|
+
"title": "SwiftUI vs UIKit Architecture",
|
|
942
|
+
"col1Title": "SwiftUI (Declarative)",
|
|
943
|
+
"col1Items": [
|
|
944
|
+
"State drives the UI automatically",
|
|
945
|
+
"Lightweight immutable structs",
|
|
946
|
+
"Cross-platform unified API"
|
|
947
|
+
],
|
|
948
|
+
"col2Title": "UIKit (Imperative)",
|
|
949
|
+
"col2Items": [
|
|
950
|
+
"Manual view controller manipulation",
|
|
951
|
+
"Heavyweight class hierarchies",
|
|
952
|
+
"Explicit event-driven updates"
|
|
953
|
+
]
|
|
954
|
+
},
|
|
955
|
+
"notes": "Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ..."
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
"id": 6,
|
|
959
|
+
"layoutId": "checkpoint-quiz",
|
|
960
|
+
"slots": {
|
|
961
|
+
"tag": "Knowledge Check",
|
|
962
|
+
"question": "Which SwiftUI modifier is used to observe external observable state objects?",
|
|
963
|
+
"options": [
|
|
964
|
+
{ "label": "A", "text": "@State" },
|
|
965
|
+
{ "label": "B", "text": "@StateObject / @ObservedObject" },
|
|
966
|
+
{ "label": "C", "text": "@Binding" },
|
|
967
|
+
{ "label": "D", "text": "@Environment" }
|
|
968
|
+
],
|
|
969
|
+
"explanation": "@StateObject manages the lifecycle of reference-type ObservableObjects, while @State is for value types."
|
|
970
|
+
},
|
|
971
|
+
"notes": "Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ..."
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
"id": 7,
|
|
975
|
+
"layoutId": "summary-takeaways",
|
|
976
|
+
"slots": {
|
|
977
|
+
"tag": "Recap & Next",
|
|
978
|
+
"title": "Lesson Summary & Key Takeaways",
|
|
979
|
+
"takeaways": [
|
|
980
|
+
"Configured complete developer toolchain with Xcode 16+",
|
|
981
|
+
"Understood SwiftUI declarative lifecycle and @main entry point",
|
|
982
|
+
"Mastered App State transitions between active, inactive, and background"
|
|
983
|
+
],
|
|
984
|
+
"nextStep": "Lesson 02: State Management & Reactive Data Flow with @State and @Binding"
|
|
985
|
+
},
|
|
986
|
+
"notes": "Talk Track: ...\\nCold-Call: ...\\nScaffolding Tip: ..."
|
|
987
|
+
}
|
|
988
|
+
]
|
|
989
|
+
}
|
|
990
|
+
\`\`\`
|
|
991
|
+
|
|
992
|
+
## \u{1F6AB} STRICT ANTI-SLOP CONSTRAINTS:
|
|
993
|
+
1. NEVER output a raw unstructured string like \`content: "..."\` or \`content: "Concept: ... Code snippet: ..."\`. All slide content MUST be placed inside the \`slots\` object with its specific keys (\`points\`, \`code\`, \`cards\`, \`steps\`, \`options\`, \`takeaways\`).
|
|
994
|
+
2. NEVER use ellipsis \`...\` or placeholder comments in \`code\`. Every code snippet MUST be real, fully typed, syntax-valid, and pedagogical.
|
|
995
|
+
3. NEVER leave \`slots\` empty \`{}\`.
|
|
996
|
+
4. Output 6 to 8 substantive, rich slides covering the lesson plan thoroughly.
|
|
868
997
|
`;
|
|
869
998
|
|
|
870
999
|
// src/ai/html/tools.ts
|