claude-presentation-master 4.3.0 → 4.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,237 +1,269 @@
1
1
  /**
2
2
  * Claude Presentation Master - Type Definitions
3
- *
4
- * Clean rewrite: All types for KB-driven presentation generation.
5
- * Every decision comes from the Knowledge Base - no hardcoded fallbacks.
6
- */
7
- /**
8
- * The 7 distinct presentation types, each with its own validation rules.
9
- * These come from KB path: presentation_types.<type>
10
- */
11
- type PresentationType = 'ted_keynote' | 'sales_pitch' | 'consulting_deck' | 'investment_banking' | 'investor_pitch' | 'technical_presentation' | 'all_hands';
12
- /**
13
- * Legacy mode for backwards compatibility
3
+ * @module types
14
4
  */
15
5
  type PresentationMode = 'keynote' | 'business';
16
6
  type OutputFormat = 'html' | 'pptx';
17
- type SlideType$1 = 'title' | 'title_impact' | 'agenda' | 'section_divider' | 'thank_you' | 'single_statement' | 'big_idea' | 'big_number' | 'full_image' | 'quote' | 'star_moment' | 'call_to_action' | 'three_points' | 'bullet_points' | 'two_column' | 'three_column' | 'comparison' | 'timeline' | 'process' | 'metrics_grid' | 'data_insight' | 'problem_statement' | 'solution_overview' | 'social_proof' | 'testimonial' | 'pricing' | 'demo_screenshot' | 'executive_summary_scr' | 'mece_breakdown' | 'recommendation' | 'risks_mitigation' | 'next_steps' | 'credentials' | 'valuation_summary' | 'football_field' | 'comparable_companies' | 'precedent_transactions' | 'dcf_summary' | 'waterfall_bridge' | 'sources_uses' | 'situation_overview' | 'risk_factors' | 'process_timeline';
7
+ type ThemeName = 'default' | 'light-corporate' | 'modern-tech' | 'minimal' | 'warm' | 'creative';
8
+ interface PresentationConfig {
9
+ /** Input content (Markdown, JSON, YAML, or plain text) */
10
+ content: string;
11
+ /** Content format */
12
+ contentType: 'markdown' | 'json' | 'yaml' | 'text';
13
+ /** Presentation mode: keynote (6-25 words/slide) or business (40-80 words/slide) */
14
+ mode: PresentationMode;
15
+ /** Output formats to generate */
16
+ format: OutputFormat[];
17
+ /** Visual theme */
18
+ theme?: ThemeName;
19
+ /** Minimum QA score required (0-100, default: 95) */
20
+ qaThreshold?: number;
21
+ /** Skip QA validation (NOT RECOMMENDED) */
22
+ skipQA?: boolean;
23
+ /** Presentation title */
24
+ title: string;
25
+ /** Author name */
26
+ author?: string;
27
+ /** Subject/description */
28
+ subject?: string;
29
+ /** Output directory */
30
+ output?: string;
31
+ /** Minify HTML output */
32
+ minify?: boolean;
33
+ /** Custom CSS to inject */
34
+ customCSS?: string;
35
+ /** Custom Handlebars templates */
36
+ customTemplates?: Record<string, string>;
37
+ }
38
+ type SlideType = 'title' | 'agenda' | 'section-divider' | 'thank-you' | 'big-idea' | 'single-statement' | 'big-number' | 'full-image' | 'quote' | 'two-column' | 'three-column' | 'bullet-points' | 'screenshot' | 'screenshot-left' | 'screenshot-right' | 'comparison' | 'timeline' | 'process' | 'metrics-grid' | 'pricing' | 'team' | 'features' | 'chart' | 'table' | 'social-proof' | 'case-study' | 'cta';
18
39
  interface Slide {
19
40
  /** Slide index (0-based) */
20
41
  index: number;
21
- /** Slide type from KB */
22
- type: SlideType$1;
23
- /** Slide content */
42
+ /** Slide type */
43
+ type: SlideType;
44
+ /** Slide data for template rendering */
24
45
  data: SlideData;
25
- /** Slide-level score (must be >= 95) */
26
- score?: SlideScore;
46
+ /** CSS classes to apply */
47
+ classes?: string[];
48
+ /** Custom styles */
49
+ styles?: Record<string, string>;
27
50
  /** Speaker notes */
28
51
  notes?: string;
29
52
  }
30
53
  interface SlideData {
31
- /** Main title (action title for consulting, emotional for keynote) */
54
+ /** Main title */
32
55
  title?: string;
33
56
  /** Subtitle */
34
57
  subtitle?: string;
35
- /** Body text */
58
+ /** Body content */
36
59
  body?: string;
37
60
  /** Bullet points */
38
61
  bullets?: string[];
39
- /** Key message / takeaway */
62
+ /** Key message */
40
63
  keyMessage?: string;
64
+ /** Images */
65
+ images?: ImageData[];
66
+ /** Metrics/KPIs */
67
+ metrics?: MetricData[];
41
68
  /** Quote text */
42
69
  quote?: string;
43
70
  /** Quote attribution */
44
71
  attribution?: string;
45
- /** Metrics for metrics_grid */
46
- metrics?: MetricData$1[];
47
- /** Source citation (required for consulting/IB) */
72
+ /** Source citation */
48
73
  source?: string;
49
- /** Callout text (for data slides) */
50
- callout?: string;
51
- /** Background image path (local file or URL) */
52
- image?: string;
53
74
  /** Additional custom data */
54
75
  [key: string]: unknown;
55
76
  }
56
- interface MetricData$1 {
77
+ interface ImageData {
78
+ src: string;
79
+ alt: string;
80
+ caption?: string;
81
+ }
82
+ interface MetricData {
57
83
  value: string | number;
58
84
  label: string;
59
85
  change?: string;
60
86
  trend?: 'up' | 'down' | 'neutral';
61
87
  }
62
- interface SlideScore {
63
- /** Total score (0-100) - must be >= 95 */
64
- total: number;
65
- /** Visual quality score (weighted per type) */
66
- visual: CategoryScore;
67
- /** Content quality score (weighted per type) */
68
- content: CategoryScore;
69
- /** Expert compliance score (weighted per type) */
70
- expert: CategoryScore;
71
- /** Accessibility score (weighted per type) */
72
- accessibility: CategoryScore;
73
- /** Did this slide pass? */
88
+ interface QAResults {
89
+ /** Visual quality results */
90
+ visual: VisualQAResults;
91
+ /** Content quality results */
92
+ content: ContentQAResults;
93
+ /** Expert methodology compliance */
94
+ expert: ExpertQAResults;
95
+ /** Accessibility compliance */
96
+ accessibility: AccessibilityResults;
97
+ /** Overall pass/fail */
74
98
  passed: boolean;
75
- /** Specific violations found */
76
- violations: Violation[];
77
- }
78
- interface CategoryScore {
79
- /** Raw score (0-100) */
80
- score: number;
81
- /** Weight for this category (from KB) */
82
- weight: number;
83
- /** Weighted contribution to total */
84
- weighted: number;
85
- /** Checks that passed */
86
- passed: string[];
87
- /** Checks that failed */
88
- failed: string[];
89
- }
90
- interface Violation {
91
- /** Severity level */
92
- severity: 'critical' | 'major' | 'minor';
93
- /** Category */
94
- category: 'visual' | 'content' | 'expert' | 'accessibility';
95
- /** KB path that was violated */
96
- kbPath: string;
97
- /** What was expected (from KB) */
98
- expected: string;
99
- /** What was found */
100
- actual: string;
101
- /** How to fix it */
102
- fix: string;
99
+ /** List of issues found */
100
+ issues: QAIssue[];
103
101
  }
104
- interface DeckScore {
105
- /** Overall deck score (0-100) */
106
- total: number;
107
- /** Individual slide scores */
108
- slideScores: SlideScore[];
109
- /** Holistic checks */
110
- holistic: HolisticScore;
111
- /** Did the deck pass? */
102
+ interface VisualQAResults {
103
+ /** Whitespace percentage (target: 35%+ keynote, 25%+ business) */
104
+ whitespacePercentage: number;
105
+ /** Layout balance score (0-1) */
106
+ layoutBalance: number;
107
+ /** Contrast ratio (target: 4.5+) */
108
+ contrastRatio: number;
109
+ /** Number of font families used (target: ≤2) */
110
+ fontFamilies: number;
111
+ /** Number of colors used */
112
+ colorCount: number;
113
+ /** Screenshots of each slide */
114
+ screenshots: Buffer[];
115
+ /** Per-slide visual scores */
116
+ perSlide: SlideVisualScore[];
117
+ }
118
+ interface SlideVisualScore {
119
+ slideIndex: number;
120
+ whitespace: number;
121
+ balance: number;
122
+ contrast: number;
112
123
  passed: boolean;
113
- /** Deck-level violations */
114
- violations: Violation[];
124
+ issues: string[];
115
125
  }
116
- interface HolisticScore {
117
- /** Narrative flow (Sparkline, SCQA) */
118
- narrativeFlow: number;
119
- /** Visual consistency */
120
- visualConsistency: number;
121
- /** Has required elements (STAR moment, CTA, etc.) */
122
- requiredElements: number;
123
- /** No anti-patterns */
124
- antiPatternFree: number;
126
+ interface ContentQAResults {
127
+ /** Per-slide content analysis */
128
+ perSlide: SlideContentScore[];
129
+ /** Glance test results */
130
+ glanceTest: GlanceTestResult[];
131
+ /** Signal-to-noise ratio results */
132
+ signalNoise: SignalNoiseResult[];
133
+ /** One idea per slide validation */
134
+ oneIdea: OneIdeaResult[];
135
+ }
136
+ interface SlideContentScore {
137
+ slideIndex: number;
138
+ wordCount: number;
139
+ withinLimit: boolean;
140
+ hasActionTitle: boolean;
141
+ issues: string[];
125
142
  }
126
- interface KBPresentationType {
127
- id: PresentationType;
128
- name: string;
129
- description: string;
130
- use_for: string[];
131
- primary_experts: string[];
132
- validation_rules: KBValidationRules;
133
- slide_types_allowed: string[];
134
- required_elements: string[];
135
- anti_patterns: string[];
136
- color_palette: string;
137
- typography: KBTypography;
138
- scoring_weights: KBScoringWeights;
143
+ interface GlanceTestResult {
144
+ slideIndex: number;
145
+ keyMessage: string;
146
+ wordCount: number;
147
+ readingTime: number;
148
+ passed: boolean;
149
+ recommendation?: string;
139
150
  }
140
- interface KBValidationRules {
141
- words_per_slide: {
142
- min: number;
143
- max: number;
144
- ideal: number;
145
- };
146
- whitespace: {
147
- min: number;
148
- ideal: number;
149
- max?: number;
150
- };
151
- bullets_per_slide: {
152
- max: number;
153
- };
154
- action_titles_required: boolean;
155
- sources_required: boolean;
156
- callouts_required?: boolean;
157
- dense_data_allowed?: boolean;
151
+ interface SignalNoiseResult {
152
+ slideIndex: number;
153
+ signalCount: number;
154
+ noiseCount: number;
155
+ signalRatio: number;
156
+ passed: boolean;
157
+ noiseElements: string[];
158
158
  }
159
- interface KBTypography {
160
- titles?: string;
161
- body?: string;
162
- action_title?: string;
163
- section_headers?: string;
164
- data_labels?: string;
165
- max_fonts: number;
159
+ interface OneIdeaResult {
160
+ slideIndex: number;
161
+ ideaCount: number;
162
+ mainIdea: string;
163
+ passed: boolean;
164
+ conflictingIdeas?: string[];
165
+ }
166
+ interface ExpertQAResults {
167
+ /** Nancy Duarte validation */
168
+ duarte: ExpertValidation;
169
+ /** Garr Reynolds validation */
170
+ reynolds: ExpertValidation;
171
+ /** Carmine Gallo validation */
172
+ gallo: ExpertValidation;
173
+ /** Chris Anderson validation */
174
+ anderson: ExpertValidation;
175
+ }
176
+ interface ExpertValidation {
177
+ expertName: string;
178
+ principlesChecked: string[];
179
+ passed: boolean;
180
+ score: number;
181
+ violations: string[];
182
+ }
183
+ interface AccessibilityResults {
184
+ /** WCAG compliance level achieved */
185
+ wcagLevel: 'A' | 'AA' | 'AAA' | 'FAIL';
186
+ /** Contrast issues found */
187
+ contrastIssues: ContrastIssue[];
188
+ /** Font size issues */
189
+ fontSizeIssues: FontSizeIssue[];
190
+ /** Focus state coverage */
191
+ focusCoverage: number;
192
+ /** Color-blind safety */
193
+ colorBlindSafe: boolean;
194
+ }
195
+ interface ContrastIssue {
196
+ slideIndex: number;
197
+ element: string;
198
+ foreground: string;
199
+ background: string;
200
+ ratio: number;
201
+ required: number;
166
202
  }
167
- interface KBScoringWeights {
168
- visual_quality: number;
169
- content_quality: number;
170
- expert_compliance: number;
171
- accessibility: number;
203
+ interface FontSizeIssue {
204
+ slideIndex: number;
205
+ element: string;
206
+ actualSize: number;
207
+ minimumSize: number;
208
+ }
209
+ interface QAIssue {
210
+ /** Issue severity */
211
+ severity: 'error' | 'warning' | 'info';
212
+ /** Issue category */
213
+ category: 'visual' | 'content' | 'expert' | 'accessibility';
214
+ /** Slide index (if applicable) */
215
+ slideIndex?: number;
216
+ /** Issue description */
217
+ message: string;
218
+ /** Suggested fix */
219
+ suggestion?: string;
172
220
  }
173
- interface KBScoringRubric {
174
- total_points: number;
175
- passing_threshold: number;
176
- categories: {
177
- visual_quality: KBScoringCategory;
178
- content_quality: KBScoringCategory;
179
- expert_compliance: KBScoringCategory;
180
- accessibility: KBScoringCategory;
221
+ interface PresentationResult {
222
+ /** Generated outputs */
223
+ outputs: {
224
+ html?: string;
225
+ pptx?: Buffer;
181
226
  };
227
+ /** QA validation results */
228
+ qaResults: QAResults;
229
+ /** Overall QA score (0-100) */
230
+ score: number;
231
+ /** Presentation metadata */
232
+ metadata: PresentationMetadata;
182
233
  }
183
- interface KBScoringCategory {
184
- weight: number;
185
- checks: Record<string, KBCheck>;
186
- }
187
- interface KBCheck {
188
- points: number;
189
- description: string;
190
- validation?: string;
191
- }
192
- interface KBExpert {
193
- name: string;
194
- core_principles: Record<string, KBPrinciple>;
195
- }
196
- interface KBPrinciple {
197
- description: string;
198
- rules?: string[];
199
- examples?: string[];
234
+ interface PresentationMetadata {
235
+ /** Presentation title */
236
+ title: string;
237
+ /** Author */
238
+ author: string;
239
+ /** Generation timestamp */
240
+ generatedAt: string;
241
+ /** Presentation mode */
242
+ mode: PresentationMode;
243
+ /** Total slide count */
244
+ slideCount: number;
245
+ /** Total word count */
246
+ wordCount: number;
247
+ /** Average words per slide */
248
+ avgWordsPerSlide: number;
249
+ /** Estimated presentation duration (minutes) */
250
+ estimatedDuration: number;
251
+ /** Themes/frameworks used */
252
+ frameworks: string[];
200
253
  }
201
254
  interface ContentAnalysis {
202
- /** Detected presentation type */
203
- detectedType: PresentationType;
204
- /** Extracted title */
205
- title: string;
206
- /** Sections found */
207
- sections: ContentSection[];
208
- /** Key messages */
255
+ /** SCQA structure extracted */
256
+ scqa: SCQAStructure;
257
+ /** Sparkline narrative arc */
258
+ sparkline: SparklineStructure;
259
+ /** Key messages identified */
209
260
  keyMessages: string[];
210
- /** Data points (metrics, percentages) */
211
- dataPoints: DataPoint[];
212
- /** SCQA structure if detected */
213
- scqa?: SCQAStructure;
214
- /** Sparkline moments */
215
- sparkline?: SparklineStructure;
216
- }
217
- interface ContentSection {
218
- /** Section header */
219
- header: string;
220
- /** Header level (1-6) */
221
- level: number;
222
- /** Raw content */
223
- content: string;
224
- /** Extracted bullets */
225
- bullets: string[];
226
- /** Metrics in this section */
227
- metrics: DataPoint[];
228
- }
229
- interface DataPoint {
230
- value: string;
231
- numericValue?: number;
232
- type: 'currency' | 'percentage' | 'number' | 'time';
233
- context: string;
234
- label?: string;
261
+ /** Generated action titles */
262
+ titles: string[];
263
+ /** STAR moments identified */
264
+ starMoments: string[];
265
+ /** Estimated slide count */
266
+ estimatedSlideCount: number;
235
267
  }
236
268
  interface SCQAStructure {
237
269
  situation: string;
@@ -242,1802 +274,936 @@ interface SCQAStructure {
242
274
  interface SparklineStructure {
243
275
  whatIs: string[];
244
276
  whatCouldBe: string[];
245
- starMoment?: string;
246
277
  callToAdventure: string;
247
278
  }
248
- interface PresentationResult {
249
- /** Generated outputs */
250
- outputs: {
251
- html?: string;
252
- pptx?: Buffer;
253
- };
254
- /** Slides generated */
255
- slides: Slide[];
256
- /** Final deck score */
257
- score: DeckScore;
258
- /** Metadata */
259
- metadata: PresentationMetadata;
279
+ declare class ValidationError extends Error {
280
+ errors: string[];
281
+ constructor(errors: string[], message?: string);
260
282
  }
261
- interface PresentationMetadata {
262
- title: string;
263
- author: string;
264
- presentationType: PresentationType;
265
- generatedAt: string;
266
- slideCount: number;
267
- totalWords: number;
268
- avgWordsPerSlide: number;
269
- kbVersion: string;
283
+ declare class QAFailureError extends Error {
284
+ score: number;
285
+ threshold: number;
286
+ qaResults: QAResults;
287
+ constructor(score: number, threshold: number, qaResults: QAResults, message?: string);
288
+ getIssues(): string[];
289
+ }
290
+ declare class TemplateNotFoundError extends Error {
291
+ templatePath: string;
292
+ constructor(templatePath: string, message?: string);
270
293
  }
271
294
 
272
295
  /**
273
- * KnowledgeGateway - Single Point of Access to the Knowledge Base
296
+ * Presentation Engine - Main Orchestrator
274
297
  *
275
- * CRITICAL DESIGN PRINCIPLE: NO FALLBACKS
276
- * If data is missing from KB, we FAIL with a clear error.
277
- * Every decision in this application comes from the KB.
298
+ * Coordinates content analysis, slide generation, and QA validation
299
+ * to produce world-class presentations.
278
300
  */
279
301
 
280
- /**
281
- * Result wrapper that includes KB path for debugging
282
- */
283
- interface KBResult<T> {
284
- value: T;
285
- kbPath: string;
286
- }
287
- /**
288
- * KnowledgeGateway - The ONLY way to access KB data
289
- */
290
- declare class KnowledgeGateway {
291
- private data;
292
- private loaded;
293
- private version;
294
- /**
295
- * Load the knowledge base from YAML.
296
- * MUST be called before any queries.
297
- */
298
- load(): Promise<void>;
299
- /**
300
- * Get KB version
301
- */
302
- getVersion(): string;
303
- /**
304
- * Get complete presentation type configuration.
305
- * @throws KBQueryError if type not found
306
- */
307
- getPresentationType(type: PresentationType): KBResult<KBPresentationType>;
308
- /**
309
- * Get validation rules for a presentation type.
310
- * @throws KBQueryError if rules not found
311
- */
312
- getValidationRules(type: PresentationType): KBResult<KBValidationRules>;
313
- /**
314
- * Get word limits for a presentation type.
315
- */
316
- getWordLimits(type: PresentationType): KBResult<{
317
- min: number;
318
- max: number;
319
- ideal: number;
320
- }>;
321
- /**
322
- * Get whitespace requirements.
323
- */
324
- getWhitespaceRules(type: PresentationType): KBResult<{
325
- min: number;
326
- ideal: number;
327
- max?: number;
328
- }>;
329
- /**
330
- * Get scoring weights for a presentation type.
331
- */
332
- getScoringWeights(type: PresentationType): KBResult<KBScoringWeights>;
333
- /**
334
- * Get allowed slide types for a presentation type.
335
- */
336
- getAllowedSlideTypes(type: PresentationType): KBResult<string[]>;
337
- /**
338
- * Get required elements for a presentation type.
339
- */
340
- getRequiredElements(type: PresentationType): KBResult<string[]>;
341
- /**
342
- * Get anti-patterns to avoid for a presentation type.
343
- */
344
- getAntiPatterns(type: PresentationType): KBResult<string[]>;
345
- /**
346
- * Get the scoring rubric.
347
- */
348
- getScoringRubric(): KBResult<KBScoringRubric>;
349
- /**
350
- * Get passing threshold (default: 95).
351
- */
352
- getPassingThreshold(): KBResult<number>;
353
- /**
354
- * Get expert methodology.
355
- */
356
- getExpert(name: string): KBResult<KBExpert>;
302
+ declare class PresentationEngine {
303
+ private contentAnalyzer;
304
+ private slideFactory;
305
+ private templateEngine;
306
+ private scoreCalculator;
307
+ private qaEngine;
308
+ private htmlGenerator;
309
+ private pptxGenerator;
310
+ constructor();
357
311
  /**
358
- * Get Nancy Duarte's glance test rules.
312
+ * Generate a presentation from content.
313
+ *
314
+ * @param config - Presentation configuration
315
+ * @returns Presentation result with outputs, QA results, and score
359
316
  */
360
- getGlanceTest(): KBResult<{
361
- description: string;
362
- word_limit: number;
363
- }>;
317
+ generate(config: PresentationConfig): Promise<PresentationResult>;
364
318
  /**
365
- * Get Duarte's Sparkline framework.
319
+ * Validate presentation configuration.
366
320
  */
367
- getSparkline(): KBResult<Record<string, unknown>>;
321
+ private validateConfig;
368
322
  /**
369
- * Get Minto's SCQA framework.
323
+ * Validate slide structure before generation.
370
324
  */
371
- getSCQA(): KBResult<Record<string, unknown>>;
325
+ private validateStructure;
372
326
  /**
373
- * Get Miller's Law (7±2 items).
327
+ * Count words in a slide.
374
328
  */
375
- getMillersLaw(): KBResult<{
376
- principle: string;
377
- application: string[];
378
- }>;
329
+ private countWords;
379
330
  /**
380
- * Get accessibility requirements.
331
+ * Build presentation metadata.
381
332
  */
382
- getAccessibilityRules(): KBResult<Record<string, unknown>>;
333
+ private buildMetadata;
383
334
  /**
384
- * Get contrast ratio requirements.
335
+ * Detect which expert frameworks were applied.
385
336
  */
386
- getContrastRequirements(): KBResult<{
387
- normal_text: string;
388
- large_text: string;
389
- }>;
337
+ private detectFrameworks;
338
+ }
339
+
340
+ /**
341
+ * Content Analyzer - Extracts Structure from Raw Content
342
+ *
343
+ * Uses expert methodologies to analyze content and extract:
344
+ * - SCQA structure (Barbara Minto)
345
+ * - Sparkline narrative arc (Nancy Duarte)
346
+ * - Key messages (Rule of Three)
347
+ * - STAR moments
348
+ * - Action titles
349
+ */
350
+
351
+ declare class ContentAnalyzer {
352
+ private readonly situationSignals;
353
+ private readonly complicationSignals;
354
+ private readonly questionSignals;
355
+ private readonly answerSignals;
356
+ private readonly whatIsSignals;
357
+ private readonly whatCouldBeSignals;
390
358
  /**
391
- * Get minimum font sizes.
359
+ * Analyze content and extract structural elements.
392
360
  */
393
- getFontSizeRequirements(): KBResult<Record<string, string>>;
361
+ analyze(content: string, contentType: string): Promise<ContentAnalysis>;
394
362
  /**
395
- * Get Tufte's data-ink ratio rules.
363
+ * Parse content based on its type.
396
364
  */
397
- getDataInkRules(): KBResult<Record<string, unknown>>;
365
+ private parseContent;
398
366
  /**
399
- * Get chartjunk to avoid.
367
+ * Parse markdown content to plain text (preserving structure hints).
400
368
  */
401
- getChartjunk(): KBResult<string[]>;
369
+ private parseMarkdown;
402
370
  /**
403
- * Get Cialdini's 6 Principles of Influence.
371
+ * Parse JSON content.
404
372
  */
405
- getCialdiniPrinciples(): KBResult<Record<string, unknown>>;
373
+ private parseJSON;
406
374
  /**
407
- * Get specific Cialdini principle by name.
375
+ * Parse YAML content.
408
376
  */
409
- getCialdiniPrinciple(name: string): KBResult<Record<string, unknown>>;
377
+ private parseYAML;
410
378
  /**
411
- * Get all Gestalt principles.
379
+ * Flatten object to text.
412
380
  */
413
- getGestaltPrinciples(): KBResult<Record<string, unknown>>;
381
+ private flattenObject;
414
382
  /**
415
- * Get specific Gestalt principle by name.
383
+ * Split text into paragraphs.
416
384
  */
417
- getGestaltPrinciple(name: string): KBResult<Record<string, unknown>>;
385
+ private splitIntoParagraphs;
418
386
  /**
419
- * Get Gestalt proximity principle (for layout checks).
387
+ * Split text into sentences.
420
388
  */
421
- getGestaltProximity(): KBResult<Record<string, unknown>>;
389
+ private splitIntoSentences;
422
390
  /**
423
- * Get Gestalt similarity principle (for consistency checks).
391
+ * Extract SCQA structure (Barbara Minto's Pyramid Principle).
424
392
  */
425
- getGestaltSimilarity(): KBResult<Record<string, unknown>>;
393
+ private extractSCQA;
426
394
  /**
427
- * Get Gestalt figure-ground principle (for visual impact checks).
395
+ * Extract Sparkline structure (Nancy Duarte).
428
396
  */
429
- getGestaltFigureGround(): KBResult<Record<string, unknown>>;
397
+ private extractSparkline;
430
398
  /**
431
- * Query any KB path directly.
432
- * @throws KBQueryError if path not found
399
+ * Extract key messages (max 3 - Rule of Three).
433
400
  */
434
- queryRequired<T>(path: string): KBResult<T>;
401
+ private extractKeyMessages;
435
402
  /**
436
- * Query any KB path directly (optional - returns null if not found).
403
+ * Generate action titles (McKinsey-style).
437
404
  */
438
- queryOptional<T>(path: string): KBResult<T | null>;
405
+ private generateActionTitles;
439
406
  /**
440
- * Ensure KB is loaded.
407
+ * Transform a statement into an action title.
441
408
  */
442
- private ensureLoaded;
409
+ private transformToActionTitle;
443
410
  /**
444
- * Query a dotted path in the KB.
411
+ * Identify STAR moments (Something They'll Always Remember).
445
412
  */
446
- private query;
413
+ private identifyStarMoments;
447
414
  /**
448
- * Create a KB query error.
415
+ * Estimate slide count based on content.
449
416
  */
450
- private error;
417
+ private estimateSlideCount;
418
+ private containsSignals;
419
+ private extractRelevantSentence;
420
+ private truncateToSentence;
421
+ private truncateToWords;
422
+ private capitalizeFirst;
451
423
  }
452
- /**
453
- * Get the singleton KnowledgeGateway instance.
454
- */
455
- declare function getKB(): KnowledgeGateway;
456
- /**
457
- * Initialize and return the KB (async).
458
- */
459
- declare function initKB(): Promise<KnowledgeGateway>;
460
424
 
461
425
  /**
462
- * ContentAnalyzer - Parse and Analyze Input Content
426
+ * Slide Factory - Creates Slides from Content Analysis
463
427
  *
464
- * Parses markdown/text input and extracts:
465
- * - Sections with headers
466
- * - Bullets and key points
467
- * - Data points (metrics, percentages, currencies)
468
- * - Detects presentation type from content signals
469
- * - Identifies SCQA structure if present
470
- * - Identifies Sparkline moments
428
+ * Generates slide structures based on:
429
+ * - Presentation mode (keynote vs business)
430
+ * - Content analysis results
431
+ * - Expert methodology recommendations
471
432
  */
472
433
 
473
- declare class ContentAnalyzer {
474
- private kb;
475
- private initialized;
434
+ declare class SlideFactory {
435
+ private readonly templates;
476
436
  constructor();
477
- initialize(): Promise<void>;
478
437
  /**
479
- * Analyze content and return structured analysis.
438
+ * Create slides from analyzed content.
480
439
  */
481
- analyze(content: string, contentType?: 'markdown' | 'text'): Promise<ContentAnalysis>;
440
+ createSlides(analysis: ContentAnalysis, mode: PresentationMode): Promise<Slide[]>;
482
441
  /**
483
- * Parse content into sections based on headers.
442
+ * Create a title slide.
484
443
  */
485
- private parseSections;
444
+ private createTitleSlide;
486
445
  /**
487
- * Extract title from content.
446
+ * Create an agenda slide.
488
447
  */
489
- private extractTitle;
448
+ private createAgendaSlide;
490
449
  /**
491
- * Extract bullet points from content.
492
- * Strips markdown formatting (**bold**, *italic*, `code`) from bullet text.
450
+ * Create a context/situation slide.
493
451
  */
494
- private extractBullets;
452
+ private createContextSlide;
453
+ /**
454
+ * Create a problem/complication slide.
455
+ */
456
+ private createProblemSlide;
495
457
  /**
496
- * Strip markdown formatting from text.
497
- * Converts **bold**, *italic*, `code`, [links](url) to plain text.
458
+ * Create a key message slide.
498
459
  */
499
- private stripMarkdown;
460
+ private createMessageSlide;
500
461
  /**
501
- * Extract data points (metrics, percentages, currencies, numbers).
462
+ * Create a STAR moment slide.
502
463
  */
503
- private extractDataPoints;
464
+ private createStarMomentSlide;
504
465
  /**
505
- * Get surrounding context for a data point.
466
+ * Create a solution/answer slide.
506
467
  */
507
- private getContext;
468
+ private createSolutionSlide;
508
469
  /**
509
- * Parse numeric value from string (handles M/B/K suffixes).
470
+ * Create a call-to-action slide.
510
471
  */
511
- private parseNumericValue;
472
+ private createCTASlide;
512
473
  /**
513
- * Extract key messages from sections.
474
+ * Create a thank you slide.
514
475
  */
515
- private extractKeyMessages;
476
+ private createThankYouSlide;
516
477
  /**
517
- * Detect presentation type based on content signals.
478
+ * Initialize slide templates with constraints.
518
479
  */
519
- private detectPresentationType;
480
+ private initializeTemplates;
520
481
  /**
521
- * Identify SCQA (Situation, Complication, Question, Answer) structure.
482
+ * Truncate text to max length at word boundary.
522
483
  */
523
- private identifySCQA;
484
+ private truncate;
524
485
  /**
525
- * Identify Sparkline (What Is / What Could Be) structure.
486
+ * Extract an action title from a message.
526
487
  */
527
- private identifySparkline;
488
+ private extractActionTitle;
489
+ /**
490
+ * Extract bullet points from text.
491
+ */
492
+ private extractBullets;
493
+ /**
494
+ * Remove a statistic from text.
495
+ */
496
+ private removeStatistic;
528
497
  }
529
- declare function getContentAnalyzer(): ContentAnalyzer;
530
- declare function initContentAnalyzer(): Promise<ContentAnalyzer>;
531
498
 
532
499
  /**
533
- * SlideGenerator - Generate Slides with Visual Intent
534
- *
535
- * Takes ContentAnalysis and generates slides with:
536
- * - Appropriate slide types based on content
537
- * - Visual intent (emphasis, layout hints)
538
- * - Respect for KB word limits and rules
539
- * - SCQA/Sparkline narrative structure when detected
500
+ * Template Engine - Handlebars Template Rendering
540
501
  *
541
- * DESIGN PHILOSOPHY:
542
- * - All type-specific rules (word limits, allowed slide types) come from KB
543
- * - Defensive fallbacks exist for edge cases (e.g., bullet limit defaults to 5)
544
- * - Slide structure decisions (agenda, section dividers) are algorithmic
502
+ * Renders slide data into HTML using Handlebars templates.
503
+ * Supports custom templates and helper functions.
545
504
  */
546
505
 
547
- declare class SlideGenerator {
548
- private kb;
549
- private vds;
550
- private initialized;
551
- private wordLimits;
552
- private bulletLimit;
553
- private allowedSlideTypes;
554
- private createdSlideTitles;
555
- private sectionDividerCount;
556
- private readonly maxSectionDividers;
506
+ interface TemplateConfig {
507
+ customTemplates?: Record<string, string>;
508
+ theme?: ThemeName;
509
+ }
510
+ declare class TemplateEngine {
511
+ private handlebars;
512
+ private templates;
513
+ private partials;
557
514
  constructor();
558
- initialize(): Promise<void>;
559
- /**
560
- * Generate slides from content analysis.
561
- */
562
- generate(analysis: ContentAnalysis, presentationType: PresentationType): Promise<Slide[]>;
563
- private loadRulesForType;
564
515
  /**
565
- * Create title slide.
516
+ * Render a slide to HTML.
566
517
  */
567
- private createTitleSlide;
568
- /**
569
- * Create agenda slide.
570
- */
571
- private createAgendaSlide;
572
- /**
573
- * Create SCQA slides (Situation, Complication, Question, Answer).
574
- */
575
- private createSCQASlides;
576
- /**
577
- * Create slides for a content section.
578
- */
579
- private createSectionSlides;
580
- /**
581
- * Create metrics grid slide from data points.
582
- */
583
- private createMetricsSlide;
584
- /**
585
- * Create metrics grid slide from a section.
586
- */
587
- private createMetricsGridSlide;
588
- /**
589
- * Create STAR moment slide (Something They'll Always Remember).
590
- */
591
- private createStarMomentSlide;
592
- /**
593
- * Create call to action slide.
594
- */
595
- private createCallToActionSlide;
596
- /**
597
- * Create thank you / closing slide.
598
- */
599
- private createThankYouSlide;
600
- /**
601
- * Determine the best slide type for a section.
602
- */
603
- private determineSlideType;
604
- /**
605
- * Check if presentation type favors minimal slides.
606
- */
607
- private isMinimalType;
518
+ render(slide: Slide, config?: TemplateConfig): string;
608
519
  /**
609
- * Strip all markdown syntax from text for clean slide content.
610
- * This is called on ALL text going into slides to prevent raw markdown.
520
+ * Render multiple slides.
611
521
  */
612
- private stripMarkdownSyntax;
522
+ renderAll(slides: Slide[], config?: TemplateConfig): string[];
613
523
  /**
614
- * Clean bullets - strip markdown and preserve COMPLETE, MEANINGFUL sentences.
615
- * Business presentations need full context. Never truncate mid-thought.
616
- * Reasonable limit: 20 words per bullet allows complete ideas.
524
+ * Prepare template context with computed properties.
617
525
  */
618
- private cleanBullets;
526
+ private prepareContext;
619
527
  /**
620
- * Truncate text to word limit, stripping markdown first.
621
- * Preserves complete sentences. Business content needs room to breathe.
528
+ * Build CSS class list for slide.
622
529
  */
623
- private truncateToWordLimit;
530
+ private buildClassList;
624
531
  /**
625
- * Extract a key statement from content (first sentence or bold text).
532
+ * Build inline style string.
626
533
  */
627
- private extractKeyStatement;
534
+ private buildStyleString;
628
535
  /**
629
- * Extract a key message from title and body for single_statement slides.
630
- * Returns a concise, impactful message that provides substance.
536
+ * Register Handlebars helpers.
631
537
  */
632
- private extractKeyMessage;
538
+ private registerHelpers;
633
539
  /**
634
- * Extract a label from context (nearby text around a data point).
635
- * CRITICAL: Strip all markdown table syntax first to avoid garbage labels.
540
+ * Register reusable partials.
636
541
  */
637
- private extractLabelFromContext;
542
+ private registerPartials;
638
543
  /**
639
- * Detect trend from context (up, down, neutral).
544
+ * Compile built-in templates.
640
545
  */
641
- private detectTrend;
546
+ private compileTemplates;
642
547
  /**
643
- * Split array into chunks.
548
+ * Render fallback for unknown slide types.
644
549
  */
645
- private chunkArray;
550
+ private renderFallback;
646
551
  /**
647
- * Generate meaningful titles for chunked bullet lists.
648
- * Instead of "Title (continued)", create contextual subtitles.
552
+ * Convert camelCase to kebab-case.
649
553
  */
650
- private generateChunkTitles;
651
- /**
652
- * Extract a meaningful subtitle from bullet content.
653
- */
654
- private extractSubtitleFromBullets;
554
+ private kebabCase;
655
555
  }
656
- declare function getSlideGenerator(): SlideGenerator;
657
- declare function initSlideGenerator(): Promise<SlideGenerator>;
658
556
 
659
557
  /**
660
- * SlideGenerator V2 - Simple, Correct, No Garbage
558
+ * Score Calculator - QA Score Computation
661
559
  *
662
- * Philosophy:
663
- * 1. Don't be clever - if it's hard, don't do it
664
- * 2. Preserve source truth - tables stay tables, bullets stay complete
665
- * 3. Fail loudly - reject garbage, don't score it 93/100
666
- * 4. Content is the hero - never truncate meaning
667
- *
668
- * This replaces the 945-line monster that produced garbage.
560
+ * Calculates presentation quality scores based on:
561
+ * - Visual quality (35%)
562
+ * - Content quality (30%)
563
+ * - Expert methodology compliance (25%)
564
+ * - Accessibility (10%)
669
565
  */
670
566
 
671
- interface SlideV2 {
672
- index: number;
673
- type: SlideType;
674
- title: string;
675
- content: SlideContent;
676
- notes?: string;
677
- }
678
- type SlideType = 'title' | 'section' | 'bullets' | 'table' | 'metrics' | 'statement' | 'call_to_action' | 'thank_you';
679
- interface SlideContent {
680
- bullets?: string[];
681
- table?: TableData;
682
- metrics?: MetricData[];
683
- statement?: string;
684
- subtext?: string;
685
- body?: string;
686
- source?: string;
687
- }
688
- interface TableData {
689
- headers: string[];
690
- rows: string[][];
691
- caption?: string;
692
- }
693
- interface MetricData {
694
- value: string;
695
- label: string;
696
- trend?: 'up' | 'down' | 'neutral';
567
+ interface ScoreBreakdown {
568
+ visual: number;
569
+ content: number;
570
+ expert: number;
571
+ accessibility: number;
572
+ total: number;
573
+ penalties: number;
574
+ details: ScoreDetail[];
697
575
  }
698
- interface ModeConfig {
699
- maxBulletsPerSlide: number;
700
- maxWordsPerSlide: number;
701
- minBulletsToKeep: number;
576
+ interface ScoreDetail {
577
+ category: string;
578
+ check: string;
579
+ score: number;
580
+ maxScore: number;
581
+ notes?: string;
702
582
  }
703
- declare class SlideGeneratorV2 {
704
- private config;
705
- private presentationType;
706
- /**
707
- * Create a slide generator with default configs.
708
- * For KB-driven configs, use createSlideGeneratorV2WithConfig() instead.
709
- */
710
- constructor(presentationType?: PresentationType);
583
+ declare class ScoreCalculator {
584
+ private readonly weights;
711
585
  /**
712
- * Override config with KB-loaded values at runtime.
586
+ * Calculate overall QA score from results.
713
587
  */
714
- setConfig(config: ModeConfig): void;
588
+ calculate(results: QAResults): number;
715
589
  /**
716
- * Get current config (useful for debugging).
590
+ * Get detailed score breakdown.
717
591
  */
718
- getConfig(): ModeConfig;
592
+ getBreakdown(results: QAResults): ScoreBreakdown;
719
593
  /**
720
- * Generate slides from markdown content.
721
- * Simple, correct, no garbage.
594
+ * Calculate visual quality score.
722
595
  */
723
- generate(markdown: string, title?: string): SlideV2[];
596
+ private calculateVisualScore;
724
597
  /**
725
- * Extract title from first H1 token.
598
+ * Calculate content quality score.
726
599
  */
727
- private extractTitle;
600
+ private calculateContentScore;
728
601
  /**
729
- * Split tokens into sections based on H2 headers.
602
+ * Calculate expert methodology compliance score.
730
603
  */
731
- private splitIntoSections;
604
+ private calculateExpertScore;
732
605
  /**
733
- * Process section content into slides.
734
- * RULES:
735
- * 1. Tables ALWAYS become table slides - NEVER extract to metrics
736
- * 2. Empty sections are SKIPPED - no blank divider slides
737
- * 3. H3 headings become individual slides with ACTION TITLES (critical for consulting)
738
- * 4. Sections with minimal content are combined into statement slides
606
+ * Calculate accessibility compliance score.
739
607
  */
740
- private processSectionContent;
608
+ private calculateAccessibilityScore;
741
609
  /**
742
- * Split tokens into subsections based on H3 headers.
743
- * H3 headers become ACTION TITLES for consulting decks.
610
+ * Calculate penalties from issues.
744
611
  */
745
- private splitIntoSubsections;
612
+ private calculatePenalties;
746
613
  /**
747
- * Process a subsection (H3) into a slide.
748
- * The H3 title IS the action title.
614
+ * Get human-readable grade from score.
749
615
  */
750
- private processSubsection;
616
+ getGrade(score: number): string;
751
617
  /**
752
- * Create a table slide - render the table as-is, no extraction.
618
+ * Get pass/fail status.
753
619
  */
754
- private createTableSlide;
620
+ isPassing(score: number, threshold?: number): boolean;
755
621
  /**
756
- * Create bullet slides from list content.
757
- * RULES:
758
- * 1. NEVER truncate bullets
759
- * 2. NEVER create slides with only 1-2 bullets (orphan slides)
760
- * 3. If there are fewer than minBulletsToKeep bullets, combine them into a statement slide
622
+ * Format score for display.
761
623
  */
762
- private createBulletSlides;
624
+ formatScore(score: number): string;
763
625
  /**
764
- * Split bullets into chunks without creating orphan slides.
765
- * If the last chunk would have fewer than minBullets, steal from previous chunk.
626
+ * Generate summary report.
766
627
  */
767
- private splitBulletsWithoutOrphans;
768
- /**
769
- * Get complete text from a list item, including nested content.
770
- * NEVER truncate.
771
- */
772
- private getCompleteItemText;
773
- /**
774
- * Check if section has significant paragraph content.
775
- */
776
- private hasSignificantParagraphs;
777
- /**
778
- * Create a content slide from paragraphs.
779
- */
780
- private createContentSlide;
781
- /**
782
- * Extract a key statement from tokens.
783
- */
784
- private extractStatement;
785
- /**
786
- * VALIDATE ALL SLIDES - Fail loudly on garbage.
787
- */
788
- private validateSlides;
628
+ generateReport(results: QAResults): string;
789
629
  }
790
- declare function createSlideGeneratorV2(type?: PresentationType): SlideGeneratorV2;
791
630
 
792
631
  /**
793
- * Renderer V2 - KB-Driven Visual Excellence
632
+ * QA Engine - Real Visual Quality Validation
794
633
  *
795
- * Renders slides to HTML and PDF with:
796
- * - Tables as actual tables (not mangled metrics)
797
- * - Complete bullets (never truncated)
798
- * - Clean professional CSS (no random stock photos)
799
- * - Color palettes loaded from Knowledge Base per presentation type
800
- * - Typography and spacing from KB
801
- * - Automatic PDF generation alongside HTML
634
+ * Unlike fake validation systems, this engine ACTUALLY tests:
635
+ * - Visual quality using Playwright screenshots + Canvas API
636
+ * - Layout balance and whitespace distribution
637
+ * - WCAG contrast compliance
638
+ * - Expert methodology adherence
802
639
  */
803
640
 
804
- type ThemeStyle = 'light' | 'dark';
805
- declare class RendererV2 {
806
- private theme;
807
- private presentationType;
808
- private kb;
809
- /**
810
- * Create renderer with theme loaded from Knowledge Base.
811
- * @param presentationType - The type of deck being created (determines palette)
812
- * @param kb - Knowledge Base gateway (optional, will use global if not provided)
813
- */
814
- constructor(presentationType?: PresentationType, kb?: KnowledgeGateway);
641
+ declare class QAEngine {
642
+ private browser;
815
643
  /**
816
- * Load theme configuration from Knowledge Base.
817
- * Falls back to hardcoded values only if KB fails.
644
+ * Validate a presentation.
818
645
  */
819
- private loadThemeFromKB;
646
+ validate(presentation: string | Buffer, options?: {
647
+ mode?: 'keynote' | 'business';
648
+ strictMode?: boolean;
649
+ threshold?: number;
650
+ }): Promise<QAResults>;
820
651
  /**
821
- * Default palette mapping per presentation type (used if KB doesn't specify).
652
+ * Calculate overall QA score.
822
653
  */
823
- private getDefaultPaletteName;
654
+ calculateScore(results: QAResults): number;
824
655
  /**
825
- * Render slides to complete HTML document.
656
+ * Create empty QA results (for when QA is skipped).
826
657
  */
827
- render(slides: SlideV2[], title?: string): string;
658
+ createEmptyResults(): QAResults;
659
+ private runVisualTests;
660
+ private runContentTests;
661
+ private runExpertTests;
662
+ private createExpertResult;
663
+ private runAccessibilityTests;
664
+ private calculateVisualScore;
665
+ private calculateContentScore;
666
+ private calculateExpertScore;
667
+ private calculateA11yScore;
668
+ private collectIssues;
669
+ private initBrowser;
670
+ private closeBrowser;
671
+ }
672
+
673
+ /**
674
+ * Reveal.js Generator - HTML Presentation Output
675
+ *
676
+ * Generates complete Reveal.js presentations with:
677
+ * - Responsive layouts
678
+ * - Animations
679
+ * - Speaker notes
680
+ * - Custom themes
681
+ * - Chart.js integration
682
+ * - Mermaid diagrams
683
+ */
684
+
685
+ declare class RevealJsGenerator {
686
+ private templateEngine;
687
+ private defaultRevealConfig;
688
+ constructor();
828
689
  /**
829
- * Render slides to both HTML and PDF files.
830
- * Always generates both formats for easy sharing.
690
+ * Generate complete Reveal.js HTML presentation.
831
691
  */
832
- renderToFiles(slides: SlideV2[], outputPath: string, title?: string): Promise<{
833
- htmlPath: string;
834
- pdfPath: string;
835
- }>;
692
+ generate(slides: Slide[], config: PresentationConfig): Promise<string>;
836
693
  /**
837
- * Render slides directly to PDF using Puppeteer.
838
- * Creates a printable PDF with one slide per page.
694
+ * Build the complete HTML document.
839
695
  */
840
- renderToPDF(slides: SlideV2[], outputPath: string, title?: string): Promise<Uint8Array>;
696
+ private buildDocument;
841
697
  /**
842
- * Render HTML optimized for PDF printing (no reveal.js, static pages).
698
+ * Get base styles for slides.
843
699
  */
844
- private renderForPrint;
700
+ private getBaseStyles;
845
701
  /**
846
- * Light theme print HTML (professional, white background).
702
+ * Get theme-specific styles.
847
703
  */
848
- private getLightPrintHTML;
704
+ private getThemeStyles;
849
705
  /**
850
- * Dark theme print HTML (legacy).
706
+ * Get animation styles.
851
707
  */
852
- private getDarkPrintHTML;
708
+ private getAnimationStyles;
853
709
  /**
854
- * Render slide content (shared between HTML and PDF renderers).
710
+ * Escape HTML entities.
855
711
  */
856
- private renderSlideContent;
712
+ private escapeHtml;
857
713
  /**
858
- * Render a single slide.
714
+ * Basic HTML minification.
859
715
  */
860
- private renderSlide;
716
+ private minifyHtml;
717
+ }
718
+
719
+ /**
720
+ * PowerPoint Generator - PPTX Presentation Output
721
+ *
722
+ * Generates PowerPoint presentations using PptxGenJS with:
723
+ * - Professional layouts
724
+ * - Embedded charts
725
+ * - Images
726
+ * - Consistent styling
727
+ */
728
+
729
+ declare class PowerPointGenerator {
730
+ private chartProvider;
861
731
  /**
862
- * Title slide - big, bold, centered.
732
+ * Generate a PowerPoint presentation.
863
733
  */
864
- private renderTitleSlide;
734
+ generate(slides: Slide[], config: PresentationConfig): Promise<Buffer>;
865
735
  /**
866
- * Section divider - transition slide.
736
+ * Add a slide to the presentation.
867
737
  */
868
- private renderSectionSlide;
738
+ private addSlide;
869
739
  /**
870
- * Bullet slide - the workhorse.
740
+ * Add title slide.
871
741
  */
872
- private renderBulletSlide;
742
+ private addTitleSlide;
873
743
  /**
874
- * Table slide - render tables properly.
744
+ * Add big idea / single statement slide.
875
745
  */
876
- private renderTableSlide;
746
+ private addBigIdeaSlide;
877
747
  /**
878
- * Render a table as clean HTML.
748
+ * Add big number slide.
879
749
  */
880
- private renderTable;
750
+ private addBigNumberSlide;
881
751
  /**
882
- * Metrics slide - big numbers with labels.
752
+ * Add quote slide.
883
753
  */
884
- private renderMetricsSlide;
754
+ private addQuoteSlide;
885
755
  /**
886
- * Statement slide - single powerful message.
756
+ * Add bullet points slide.
887
757
  */
888
- private renderStatementSlide;
758
+ private addBulletSlide;
889
759
  /**
890
- * Call to action slide.
760
+ * Add two-column slide.
891
761
  */
892
- private renderCTASlide;
762
+ private addTwoColumnSlide;
893
763
  /**
894
- * Thank you slide.
764
+ * Add metrics grid slide.
895
765
  */
896
- private renderThankYouSlide;
766
+ private addMetricsSlide;
897
767
  /**
898
- * Format bullet text - handle bold, arrows, etc.
768
+ * Add metrics to a slide at specified position.
899
769
  */
900
- private formatBulletText;
770
+ private addMetricsToSlide;
901
771
  /**
902
- * Escape HTML special characters.
772
+ * Add thank you slide.
903
773
  */
904
- private escapeHtml;
774
+ private addThankYouSlide;
905
775
  /**
906
- * Generate CSS with colors from Knowledge Base.
776
+ * Add agenda slide.
907
777
  */
908
- private getCSS;
778
+ private addAgendaSlide;
909
779
  /**
910
- * Generate CSS variables from KB palette.
780
+ * Add section divider slide.
911
781
  */
912
- private getCSSVariables;
782
+ private addSectionDividerSlide;
913
783
  /**
914
- * Lighten or darken a hex color.
784
+ * Add default slide (fallback).
915
785
  */
916
- private lightenColor;
786
+ private addDefaultSlide;
917
787
  /**
918
- * Light theme CSS (consulting style) with KB palette colors.
788
+ * Add image placeholder.
919
789
  */
920
- private getLightThemeCSS;
790
+ private addImagePlaceholder;
921
791
  /**
922
- * Dark theme CSS with KB palette colors.
792
+ * Convert layout position to PptxGenJS text props.
923
793
  */
924
- private getDarkThemeCSS;
794
+ private positionToProps;
925
795
  }
926
- /**
927
- * Create a renderer with theme matched to the presentation type.
928
- *
929
- * @param presentationType - Type of deck (consulting_deck, keynote, etc.)
930
- * @param themeOverride - Optional explicit theme to use instead of auto-mapping
931
- *
932
- * Theme mapping:
933
- * - consulting_deck, board_presentation, internal_update → McKinsey (white, professional)
934
- * - keynote, sales_pitch, technical → Dark (dramatic)
935
- * - training, workshop, all_hands → Minimal (clean, readable)
936
- * - product_demo, investor_pitch → Startup (modern dark)
937
- * - executive_briefing → Corporate (professional)
938
- */
939
- declare function createRendererV2(presentationType?: PresentationType, kb?: KnowledgeGateway): RendererV2;
940
796
 
941
797
  /**
942
- * VisualQAEngine - REAL Visual Quality Assurance
943
- *
944
- * This is NOT a rule checker. This SEES the actual rendered presentation.
798
+ * Image Provider - Pluggable Image Generation
945
799
  *
946
- * How it works:
947
- * 1. Playwright renders the HTML presentation
948
- * 2. Screenshots each slide at 1920x1080
949
- * 3. Analyzes screenshots with:
950
- * - Pixel-based whitespace calculation
951
- * - Color contrast checking (WCAG)
952
- * - Text density measurement
953
- * - Visual balance assessment
954
- * 4. Vision API for qualitative "would you present this?" check
955
- * 5. Scores against KB criteria
956
- * 6. Provides specific visual feedback
957
- * 7. Loops until 95+ or max iterations
958
- *
959
- * This is the REAL QA that evaluates what the audience SEES.
800
+ * Provides multiple strategies for obtaining images:
801
+ * - Local: User-provided paths/URLs
802
+ * - Placeholder: Uses picsum.photos (no API key)
803
+ * - Unsplash: Free API (50 req/hour, optional key)
804
+ * - AI: Claude Code integration (when available)
960
805
  */
961
-
962
- interface VisualSlideAnalysis {
963
- slideIndex: number;
964
- title: string;
965
- screenshot: Buffer;
966
- whitespacePercentage: number;
967
- textDensity: number;
968
- colorContrast: number;
969
- visualBalance: number;
970
- glanceTestPassed: boolean;
971
- hierarchyClear: boolean;
972
- professionalLook: boolean;
973
- score: number;
974
- issues: VisualIssue[];
975
- passed: boolean;
976
- }
977
- interface VisualIssue {
978
- severity: 'critical' | 'major' | 'minor';
979
- category: 'whitespace' | 'contrast' | 'density' | 'balance' | 'hierarchy' | 'professional';
980
- issue: string;
981
- measurement?: number;
982
- threshold?: number;
983
- fix: string;
806
+ interface ImageRequest {
807
+ /** Description of desired image */
808
+ description: string;
809
+ /** Desired width */
810
+ width?: number;
811
+ /** Desired height */
812
+ height?: number;
813
+ /** Style hints (e.g., 'professional', 'minimal', 'vibrant') */
814
+ style?: string;
815
+ /** Category for filtering (e.g., 'business', 'technology', 'nature') */
816
+ category?: string;
817
+ }
818
+ interface ImageResult {
819
+ /** URL or data URI of the image */
820
+ src: string;
821
+ /** Alt text for accessibility */
822
+ alt: string;
823
+ /** Attribution if required */
824
+ attribution?: string;
825
+ /** Whether this is a placeholder */
826
+ isPlaceholder?: boolean;
984
827
  }
985
- interface VisualDeckAnalysis {
986
- slides: VisualSlideAnalysis[];
987
- overallScore: number;
988
- passed: boolean;
989
- consistency: number;
990
- deckIssues: string[];
991
- summary: string;
828
+ interface ImageProvider {
829
+ /** Provider name */
830
+ name: string;
831
+ /** Check if provider is available */
832
+ isAvailable(): Promise<boolean>;
833
+ /** Get an image matching the request */
834
+ getImage(request: ImageRequest): Promise<ImageResult>;
835
+ /** Get multiple images */
836
+ getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
992
837
  }
993
- interface RemediationFeedback {
994
- slideIndex: number;
995
- currentScore: number;
996
- targetScore: number;
997
- specificFixes: string[];
998
- visualProblems: string[];
999
- }
1000
- interface QALoopResult {
1001
- finalScore: number;
1002
- passed: boolean;
1003
- iterations: number;
1004
- initialScore: number;
1005
- improvements: string[];
1006
- finalAnalysis: VisualDeckAnalysis;
1007
- }
1008
- declare class VisualQAEngine {
1009
- private kb;
1010
- private browser;
1011
- private initialized;
1012
- private minWhitespace;
1013
- private minContrast;
1014
- private maxWordsPerSlide;
1015
- private targetScore;
1016
- constructor();
1017
- /**
1018
- * Initialize Playwright browser.
1019
- */
1020
- initialize(): Promise<void>;
1021
- /**
1022
- * Load quality thresholds from Knowledge Base.
1023
- */
1024
- private loadKBThresholds;
1025
- /**
1026
- * Capture screenshots of all slides in a presentation.
1027
- */
1028
- captureSlides(html: string): Promise<Buffer[]>;
1029
- /**
1030
- * Analyze a single slide screenshot.
1031
- */
1032
- analyzeSlide(screenshot: Buffer, slideIndex: number, slideTitle: string, presentationType: PresentationType): Promise<VisualSlideAnalysis>;
1033
- /**
1034
- * Analyze entire deck visually.
1035
- */
1036
- analyzeDeck(html: string, slides: SlideV2[], presentationType: PresentationType): Promise<VisualDeckAnalysis>;
1037
- /**
1038
- * Generate remediation feedback for failing slides.
1039
- */
1040
- generateRemediationFeedback(analysis: VisualDeckAnalysis): RemediationFeedback[];
1041
- /**
1042
- * Run the full QA loop until passing or max iterations.
1043
- */
1044
- runQALoop(generateFn: () => Promise<{
1045
- html: string;
1046
- slides: SlideV2[];
1047
- }>, remediateFn: (feedback: RemediationFeedback[]) => Promise<void>, presentationType: PresentationType, maxIterations?: number): Promise<QALoopResult>;
1048
- /**
1049
- * Close browser and cleanup.
1050
- */
1051
- cleanup(): Promise<void>;
1052
- /**
1053
- * Measure whitespace percentage from screenshot.
1054
- * Uses actual pixel analysis.
1055
- */
1056
- private measureWhitespace;
1057
- /**
1058
- * Measure color contrast ratio.
1059
- */
1060
- private measureContrast;
1061
- /**
1062
- * Measure text density (approximation based on non-background pixels).
1063
- */
1064
- private measureTextDensity;
1065
- /**
1066
- * Measure visual balance (how evenly distributed is the content).
1067
- * Uses a 3x3 grid to properly detect centered layouts (common in keynotes).
1068
- */
1069
- private measureBalance;
1070
- /**
1071
- * Check if there's clear visual hierarchy.
1072
- */
1073
- private checkHierarchy;
1074
- private getTypeThresholds;
1075
- private detectBackgroundColor;
1076
- private detectTextColor;
1077
- private isSimilarColor;
1078
- private relativeLuminance;
1079
- private calculateConsistency;
1080
- private variance;
1081
- }
1082
- declare function getVisualQAEngine(): VisualQAEngine;
1083
- declare function initVisualQAEngine(): Promise<VisualQAEngine>;
1084
-
1085
838
  /**
1086
- * PresentationEngineV2 - Knowledge-Driven Excellence
1087
- *
1088
- * This engine orchestrates the ENTIRE presentation creation flow:
1089
- * 1. Analyze content to detect presentation type
1090
- * 2. Load design specs from Knowledge Base (YAML)
1091
- * 3. Generate slides following expert methodologies
1092
- * 4. Enhance with images (optional, needs API key)
1093
- * 5. Review ruthlessly (must score 95/100+)
1094
- * 6. Output ONLY if quality passes
1095
- *
1096
- * DESIGN PHILOSOPHY:
1097
- * - The Knowledge Base (YAML) is the single source of truth for all design decisions
1098
- * - Uses KnowledgeGateway.queryRequired() for critical paths (throws on missing data)
1099
- * - Defensive fallbacks exist only for:
1100
- * 1. Optional fields that may not exist in older KB versions
1101
- * 2. Type coercion safety (undefined → default string)
1102
- * 3. Map lookups that might fail for new palette names
1103
- * - Critical errors (missing presentation types, validation rules) will throw
839
+ * Local Image Provider - Uses user-provided images
1104
840
  */
1105
-
1106
- interface DesignSpecs {
1107
- wordsPerSlide: {
1108
- min: number;
1109
- max: number;
1110
- ideal: number;
1111
- };
1112
- whitespace: {
1113
- min: number;
1114
- max?: number;
1115
- ideal: number;
1116
- };
1117
- bulletPoints: {
1118
- max: number;
1119
- };
1120
- fonts: {
1121
- title: string;
1122
- body: string;
1123
- maxFonts: number;
1124
- };
1125
- theme: ThemeStyle;
1126
- structure: string;
1127
- experts: string[];
1128
- actionTitlesRequired: boolean;
1129
- sourcesRequired: boolean;
1130
- scoringWeights: {
1131
- visual_quality: number;
1132
- content_quality: number;
1133
- expert_compliance: number;
1134
- accessibility: number;
1135
- };
1136
- }
1137
- interface SlideReview {
1138
- slideIndex: number;
1139
- title: string;
1140
- score: number;
1141
- issues: string[];
1142
- suggestions: string[];
1143
- passed: boolean;
1144
- }
1145
- interface DeckReview {
1146
- overallScore: number;
1147
- slideReviews: SlideReview[];
1148
- deckIssues: string[];
1149
- flow: 'excellent' | 'good' | 'needs_work' | 'poor';
1150
- passed: boolean;
1151
- summary: string;
841
+ declare class LocalImageProvider implements ImageProvider {
842
+ name: string;
843
+ private images;
844
+ constructor(imageMap?: Record<string, string>);
845
+ isAvailable(): Promise<boolean>;
846
+ getImage(request: ImageRequest): Promise<ImageResult>;
847
+ getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
848
+ private getPlaceholderUrl;
849
+ /** Register an image for later use */
850
+ registerImage(name: string, src: string): void;
1152
851
  }
1153
- interface EngineOptions {
1154
- /** Override detected presentation type */
1155
- presentationType?: PresentationType;
1156
- /** Override theme selection */
1157
- themeOverride?: ThemeStyle;
1158
- /** API key for image generation (optional) */
1159
- imageApiKey?: string;
1160
- /** Minimum quality score (default: 95) */
1161
- minScore?: number;
1162
- /** Enable verbose logging */
1163
- verbose?: boolean;
1164
- /** Maximum remediation attempts per slide */
1165
- maxRemediationAttempts?: number;
1166
- /** Run visual QA analysis using Playwright screenshots (default: false) */
1167
- runVisualQA?: boolean;
1168
- /**
1169
- * Use V1's richer slide generation pipeline (default: true)
1170
- * V1 creates agenda, section dividers, SCQA structure, metrics, STAR moments, call-to-action
1171
- * V2 is minimalist - just sections parsed from markdown
1172
- */
1173
- useRichPipeline?: boolean;
852
+ /**
853
+ * Placeholder Image Provider - Uses picsum.photos (no API key needed)
854
+ */
855
+ declare class PlaceholderImageProvider implements ImageProvider {
856
+ name: string;
857
+ isAvailable(): Promise<boolean>;
858
+ getImage(request: ImageRequest): Promise<ImageResult>;
859
+ getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
860
+ private hashString;
1174
861
  }
1175
- interface EngineResult {
1176
- slides: SlideV2[];
1177
- html: string;
1178
- pdfPath?: string;
1179
- presentationType: PresentationType;
1180
- designSpecs: DesignSpecs;
1181
- review: DeckReview;
1182
- warnings: string[];
1183
- /** Visual QA analysis (only present if runVisualQA option is true) */
1184
- visualQA?: VisualDeckAnalysis;
862
+ /**
863
+ * Unsplash Image Provider - Uses Unsplash API (free tier: 50 req/hour)
864
+ */
865
+ declare class UnsplashImageProvider implements ImageProvider {
866
+ name: string;
867
+ private accessKey?;
868
+ private baseUrl;
869
+ constructor(accessKey?: string);
870
+ isAvailable(): Promise<boolean>;
871
+ getImage(request: ImageRequest): Promise<ImageResult>;
872
+ getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
873
+ private getSourceImage;
874
+ private delay;
1185
875
  }
1186
- declare class PresentationEngineV2 {
1187
- private options;
1188
- private kb;
1189
- constructor(options?: EngineOptions);
1190
- private log;
1191
- /**
1192
- * Generate a world-class presentation from markdown content.
1193
- * Follows knowledge base specs and demands 95+ quality score.
1194
- *
1195
- * CRITICAL: All specs come from the Knowledge Base YAML at runtime.
1196
- * No hardcoded fallbacks - if KB is missing data, we fail loudly.
1197
- */
1198
- generate(markdown: string, title?: string): Promise<EngineResult>;
1199
- /**
1200
- * Detect presentation type from content analysis.
1201
- */
1202
- private detectPresentationType;
1203
- /**
1204
- * Should we recommend images for this presentation?
1205
- */
1206
- private shouldRecommendImages;
1207
- /**
1208
- * Ruthlessly review the deck against knowledge base criteria.
1209
- */
1210
- private reviewDeck;
1211
- /**
1212
- * Review a single slide against quality criteria.
1213
- */
1214
- private reviewSlide;
1215
- /**
1216
- * Check if title is an action/insight title vs. just a topic.
1217
- */
1218
- private isActionTitle;
1219
- /**
1220
- * Assess the flow and narrative structure of the deck.
1221
- */
1222
- private assessFlow;
1223
- /**
1224
- * Attempt to remediate failing slides.
1225
- */
1226
- private remediateSlides;
1227
- /**
1228
- * Count words in a slide.
1229
- */
1230
- private countWords;
876
+ /**
877
+ * Composite Image Provider - Tries providers in order
878
+ */
879
+ declare class CompositeImageProvider implements ImageProvider {
880
+ name: string;
881
+ private providers;
882
+ constructor(providers: ImageProvider[]);
883
+ isAvailable(): Promise<boolean>;
884
+ getImage(request: ImageRequest): Promise<ImageResult>;
885
+ getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
1231
886
  }
1232
- declare function createPresentationEngineV2(options?: EngineOptions): PresentationEngineV2;
1233
887
  /**
1234
- * Generate a presentation with automatic type detection and ruthless quality control.
1235
- * Throws if quality score is below 95/100.
888
+ * Create default image provider chain
1236
889
  */
1237
- declare function generatePresentation(markdown: string, options?: EngineOptions & {
1238
- title?: string;
1239
- outputPath?: string;
1240
- }): Promise<EngineResult>;
890
+ declare function createDefaultImageProvider(options?: {
891
+ localImages?: Record<string, string>;
892
+ unsplashKey?: string;
893
+ }): ImageProvider;
1241
894
 
1242
895
  /**
1243
- * VisualDesignSystem - KB-Driven Visual Design Configuration
896
+ * Chart Provider - Pluggable Chart Generation
1244
897
  *
1245
- * CRITICAL: ALL design decisions come from the Knowledge Base.
1246
- * This module queries KB for colors, typography, gradients, layouts.
1247
- * NO hardcoded fallbacks.
898
+ * Provides multiple strategies for creating charts:
899
+ * - ChartJS: Embedded in HTML (no API needed)
900
+ * - QuickChart: Remote rendering (no API key needed)
901
+ * - Mermaid: Diagrams and flowcharts (no API needed)
1248
902
  */
1249
-
1250
- interface ColorPalette {
1251
- name: string;
1252
- background: string;
1253
- primary: string;
1254
- secondary: string;
1255
- accent: string;
1256
- text: string;
1257
- useCase: string;
1258
- contrastRatio: string;
1259
- }
1260
- interface Typography {
1261
- titles: string;
1262
- headlines?: string;
1263
- body: string;
1264
- maxFonts: number;
1265
- fontPairing?: string;
1266
- actionTitle?: string;
1267
- sectionHeaders?: string;
1268
- dataLabels?: string;
1269
- }
1270
- interface LayoutRules {
1271
- whitespace: string;
1272
- wordsPerSlide: string;
1273
- elementsPerSlide?: string;
1274
- requiresActionTitles?: boolean;
1275
- requiresSources?: boolean;
1276
- requiresCallouts?: boolean;
903
+ type ChartType = 'bar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'scatter' | 'bubble';
904
+ interface ChartDataset {
905
+ label: string;
906
+ data: number[];
907
+ backgroundColor?: string | string[];
908
+ borderColor?: string | string[];
909
+ borderWidth?: number;
910
+ }
911
+ interface ChartData {
912
+ labels: string[];
913
+ datasets: ChartDataset[];
914
+ }
915
+ interface ChartRequest {
916
+ /** Chart type */
917
+ type: ChartType;
918
+ /** Chart data */
919
+ data: ChartData;
920
+ /** Chart title */
921
+ title?: string;
922
+ /** Width in pixels */
923
+ width?: number;
924
+ /** Height in pixels */
925
+ height?: number;
926
+ /** Show legend */
927
+ showLegend?: boolean;
928
+ /** Animation enabled (HTML only) */
929
+ animated?: boolean;
930
+ /** Color palette to use */
931
+ palette?: 'default' | 'professional' | 'vibrant' | 'monochrome';
932
+ }
933
+ interface ChartResult {
934
+ /** HTML for embedding (Chart.js canvas) */
935
+ html?: string;
936
+ /** Image URL for static contexts (PPTX) */
937
+ imageUrl?: string;
938
+ /** Base64 data URI */
939
+ dataUri?: string;
940
+ /** Chart title for accessibility */
941
+ title: string;
1277
942
  }
1278
- interface GradientDefinition {
943
+ interface ChartProvider {
944
+ /** Provider name */
1279
945
  name: string;
1280
- css: string;
1281
- angle?: number;
1282
- stops: Array<{
1283
- color: string;
1284
- position: string;
1285
- }>;
946
+ /** Check if provider is available */
947
+ isAvailable(): Promise<boolean>;
948
+ /** Generate a chart */
949
+ generateChart(request: ChartRequest): Promise<ChartResult>;
1286
950
  }
1287
- interface SlideLayout {
951
+ /**
952
+ * Chart.js Provider - Generates embedded Chart.js HTML
953
+ * No API needed - runs in browser
954
+ */
955
+ declare class ChartJsProvider implements ChartProvider {
1288
956
  name: string;
1289
- purpose: string;
1290
- elements: string[];
1291
- wordLimit?: number;
1292
- grid?: {
1293
- columns: number;
1294
- rows?: number;
1295
- gap: string;
1296
- };
1297
- }
1298
- interface VisualTheme {
1299
- presentationType: PresentationType;
1300
- mode: 'keynote' | 'business';
1301
- palette: ColorPalette;
1302
- typography: Typography;
1303
- layout: LayoutRules;
1304
- gradients: GradientDefinition[];
1305
- cssVariables: Record<string, string>;
1306
- }
1307
- declare class VisualDesignSystem {
1308
- private kb;
1309
- private initialized;
1310
- constructor();
1311
- /**
1312
- * Initialize the design system (loads KB)
1313
- */
1314
- initialize(): Promise<void>;
1315
- /**
1316
- * Get complete visual theme for a presentation type.
1317
- */
1318
- getTheme(type: PresentationType): Promise<VisualTheme>;
1319
- /**
1320
- * Determine mode (keynote vs business) for a presentation type.
1321
- */
1322
- private getModeForType;
1323
- /**
1324
- * Get color palette for presentation type from KB.
1325
- */
1326
- private getPaletteForType;
1327
- /**
1328
- * Get typography rules for mode from KB.
1329
- */
1330
- private getTypographyForMode;
1331
- /**
1332
- * Get layout rules for mode from KB.
1333
- */
1334
- private getLayoutRulesForMode;
1335
- /**
1336
- * Get gradient definitions for presentation type.
1337
- */
1338
- private getGradientsForType;
1339
- /**
1340
- * Build CSS custom properties for the theme.
1341
- */
1342
- private buildCSSVariables;
1343
- /**
1344
- * Get slide layout templates from KB.
1345
- */
1346
- getSlideLayouts(type: PresentationType): Promise<SlideLayout[]>;
1347
- /**
1348
- * Generate complete CSS for the theme.
1349
- */
1350
- generateCSS(theme: VisualTheme): string;
1351
- private lightenColor;
1352
- private darkenColor;
1353
- private hexToRgb;
1354
- /**
1355
- * Get contrasting text color for a given background color.
1356
- * Returns white or black based on luminance.
1357
- */
1358
- private getContrastColor;
957
+ isAvailable(): Promise<boolean>;
958
+ generateChart(request: ChartRequest): Promise<ChartResult>;
1359
959
  }
1360
- declare function getVisualDesignSystem(): VisualDesignSystem;
1361
- declare function initVisualDesignSystem(): Promise<VisualDesignSystem>;
1362
-
1363
960
  /**
1364
- * SlideQualityReviewer - THE HEART OF THE QUALITATIVE REVIEW SYSTEM
1365
- *
1366
- * This is NOT a mechanical checker. It evaluates REAL quality.
1367
- * A slide ONLY passes at 95+ if:
1368
- * 1. You would personally present it without changes
1369
- * 2. It follows expert principles (Duarte, Reynolds, Tufte)
1370
- * 3. It looks professionally designed
1371
- * 4. It clearly communicates its message
1372
- * 5. It fits the overall presentation
1373
- *
1374
- * ALL rules come from the Knowledge Base. NO hardcoded fallbacks.
961
+ * QuickChart Provider - Uses quickchart.io for image generation
962
+ * No API key needed - free service
1375
963
  */
1376
-
1377
- type QualityLevel = 'excellent' | 'good' | 'acceptable' | 'poor' | 'failing';
1378
- interface QualitativeAssessment {
1379
- /** Score (0-100) */
1380
- score: number;
1381
- /** Quality level */
1382
- level: QualityLevel;
1383
- /** WHY this score - specific reasoning */
1384
- reasoning: string;
1385
- /** KB reference for this assessment */
1386
- kbReference?: string;
1387
- }
1388
- interface QualitativeSlideReview {
1389
- /** Overall qualitative score (0-100, must be >= 95) */
1390
- score: number;
1391
- /** Would you be proud to present this? */
1392
- wouldPresent: boolean;
1393
- /** Detailed qualitative assessments */
1394
- assessments: {
1395
- visualImpact: QualitativeAssessment;
1396
- contentClarity: QualitativeAssessment;
1397
- layoutBalance: QualitativeAssessment;
1398
- typographyHierarchy: QualitativeAssessment;
1399
- whitespaceUsage: QualitativeAssessment;
1400
- colorHarmony: QualitativeAssessment;
1401
- audienceAppropriate: QualitativeAssessment;
1402
- };
1403
- /** Specific issues found */
1404
- issues: QualityIssue[];
1405
- /** What would make this slide better */
1406
- improvements: string[];
1407
- }
1408
- interface QualityIssue {
1409
- severity: 'critical' | 'major' | 'minor';
1410
- category: 'visual' | 'content' | 'layout' | 'typography' | 'accessibility';
1411
- issue: string;
1412
- fix: string;
1413
- kbReference?: string;
1414
- }
1415
- declare class SlideQualityReviewer {
1416
- private kb;
1417
- private initialized;
1418
- private wordLimits;
1419
- private whitespaceRules;
1420
- private bulletLimit;
1421
- private glanceTestSeconds;
1422
- private assessmentWeights;
1423
- private _loggedWeights;
1424
- private hasCialdini;
1425
- private hasGestalt;
1426
- private hasTufteDataInk;
1427
- private chartjunkToAvoid;
1428
- constructor();
1429
- initialize(): Promise<void>;
1430
- /**
1431
- * Review a slide qualitatively.
1432
- */
1433
- review(slide: Slide, presentationType: PresentationType): Promise<QualitativeSlideReview>;
1434
- /**
1435
- * Convert qualitative review to SlideScore format.
1436
- */
1437
- toSlideScore(review: QualitativeSlideReview): SlideScore;
1438
- private loadRulesForType;
1439
- /**
1440
- * Visual Impact (25%): Does this slide command attention appropriately?
1441
- */
1442
- private assessVisualImpact;
1443
- /**
1444
- * Content Clarity (20%): Can you understand the message in 3 seconds?
1445
- */
1446
- private assessContentClarity;
1447
- /**
1448
- * Get all text content from a slide for analysis.
1449
- */
1450
- private getAllTextContent;
1451
- /**
1452
- * Layout Balance (15%): Is visual weight distributed appropriately?
1453
- */
1454
- private assessLayoutBalance;
1455
- /**
1456
- * Typography Hierarchy (15%): Is there clear primary/secondary/tertiary hierarchy?
1457
- */
1458
- private assessTypographyHierarchy;
1459
- /**
1460
- * Whitespace Usage (10%): Is whitespace used purposefully?
1461
- */
1462
- private assessWhitespaceUsage;
1463
- /**
1464
- * Color Harmony (10%): Do colors work together within the theme?
1465
- */
1466
- private assessColorHarmony;
1467
- /**
1468
- * Audience Appropriateness (5%): Is the visual style right for this audience?
1469
- */
1470
- private assessAudienceAppropriate;
1471
- private isMinimalType;
1472
- private isDenseType;
1473
- private countWords;
1474
- private countLongWords;
1475
- /**
1476
- * Detect raw markdown syntax that should have been rendered to HTML.
1477
- * Returns array of issue descriptions.
1478
- */
1479
- private detectRawMarkdown;
1480
- /**
1481
- * Check if slide type is appropriate for its content.
1482
- * Returns issue description if mismatched.
1483
- */
1484
- private checkSlideTypeMismatch;
1485
- private scoreToLevel;
1486
- private collectIssues;
1487
- private mapAssessmentToCategory;
1488
- private mapIssueCategory;
1489
- private generateImprovements;
1490
- private createCategoryScore;
964
+ declare class QuickChartProvider implements ChartProvider {
965
+ name: string;
966
+ private baseUrl;
967
+ isAvailable(): Promise<boolean>;
968
+ generateChart(request: ChartRequest): Promise<ChartResult>;
1491
969
  }
1492
- declare function getSlideQualityReviewer(): SlideQualityReviewer;
1493
- declare function initSlideQualityReviewer(): Promise<SlideQualityReviewer>;
1494
-
1495
970
  /**
1496
- * DeckQualityReviewer - HOLISTIC DECK QUALITY REVIEW
1497
- *
1498
- * After all slides pass individual review, this evaluates the deck as a whole:
1499
- * 1. Narrative Flow (30%) - Does it tell a coherent story?
1500
- * 2. Visual Consistency (25%) - Is the same theme applied throughout?
1501
- * 3. Pacing & Rhythm (20%) - Is there variety and appropriate density?
1502
- * 4. Opening & Closing (15%) - Are first/last slides the strongest?
1503
- * 5. Overall Impression (10%) - Would you hire/invest based on this?
1504
- *
1505
- * ALL rules come from the Knowledge Base. NO hardcoded fallbacks.
971
+ * Mermaid Provider - Generates diagrams using Mermaid.js
972
+ * No API needed - renders in browser
1506
973
  */
1507
-
1508
- type DeckQualityLevel = 'excellent' | 'good' | 'acceptable' | 'poor' | 'failing';
1509
- interface DeckAssessment {
1510
- /** Score (0-100) */
1511
- score: number;
1512
- /** Quality level */
1513
- level: DeckQualityLevel;
1514
- /** WHY this score - specific reasoning */
1515
- reasoning: string;
1516
- /** KB reference for this assessment */
1517
- kbReference?: string;
1518
- }
1519
- interface QualitativeDeckReview {
1520
- /** Overall deck score (0-100, must be >= 95) */
1521
- score: number;
1522
- /** Would this deck impress the target audience? */
1523
- wouldImpress: boolean;
1524
- /** Detailed assessments */
1525
- assessments: {
1526
- narrativeFlow: DeckAssessment;
1527
- visualConsistency: DeckAssessment;
1528
- pacingRhythm: DeckAssessment;
1529
- openingClosing: DeckAssessment;
1530
- overallImpression: DeckAssessment;
1531
- };
1532
- /** Individual slide reviews */
1533
- slideReviews: QualitativeSlideReview[];
1534
- /** Deck-level issues */
1535
- issues: DeckIssue[];
1536
- /** Deck-level improvements */
1537
- improvements: string[];
1538
- }
1539
- interface DeckIssue {
1540
- severity: 'critical' | 'major' | 'minor';
1541
- category: 'narrative' | 'visual' | 'pacing' | 'structure';
1542
- issue: string;
1543
- fix: string;
1544
- affectedSlides?: number[];
1545
- kbReference?: string;
1546
- }
1547
- declare class DeckQualityReviewer {
1548
- private kb;
1549
- private slideReviewer;
1550
- private initialized;
1551
- private requiredElements;
1552
- private antiPatterns;
1553
- private hasSparkline;
1554
- private hasSCQA;
1555
- constructor();
1556
- initialize(): Promise<void>;
1557
- /**
1558
- * Review the entire deck qualitatively.
1559
- */
1560
- review(slides: Slide[], presentationType: PresentationType): Promise<QualitativeDeckReview>;
1561
- /**
1562
- * Convert qualitative review to DeckScore format.
1563
- */
1564
- toDeckScore(review: QualitativeDeckReview): DeckScore;
1565
- private loadRulesForType;
1566
- /**
1567
- * Narrative Flow (30%): Does the presentation tell a coherent story?
1568
- */
1569
- private assessNarrativeFlow;
1570
- /**
1571
- * Visual Consistency (25%): Is the same theme applied throughout?
1572
- */
1573
- private assessVisualConsistency;
974
+ declare class MermaidProvider implements ChartProvider {
975
+ name: string;
976
+ isAvailable(): Promise<boolean>;
977
+ generateChart(request: ChartRequest): Promise<ChartResult>;
1574
978
  /**
1575
- * Pacing & Rhythm (20%): Is there variety in slide types and density?
979
+ * Generate a Mermaid diagram
1576
980
  */
1577
- private assessPacingRhythm;
981
+ generateDiagram(definition: string, title?: string): Promise<ChartResult>;
1578
982
  /**
1579
- * Opening & Closing (15%): Are the first and last slides the strongest?
983
+ * Generate flowchart from steps
1580
984
  */
1581
- private assessOpeningClosing;
985
+ generateFlowchart(steps: {
986
+ id: string;
987
+ label: string;
988
+ next?: string[];
989
+ }[]): string;
1582
990
  /**
1583
- * Overall Impression (10%): Would you hire/invest based on this?
991
+ * Generate timeline from events
1584
992
  */
1585
- private assessOverallImpression;
1586
- private scoreToLevel;
1587
- private calculateVariance;
1588
- private getMissingRequiredElements;
1589
- private collectDeckIssues;
1590
- private mapAssessmentToCategory;
1591
- private mapDeckCategory;
1592
- private generateDeckImprovements;
1593
- private calculateRequiredElementsScore;
1594
- private calculateAntiPatternScore;
993
+ generateTimeline(events: {
994
+ date: string;
995
+ title: string;
996
+ }[]): string;
1595
997
  }
1596
- declare function getDeckQualityReviewer(): DeckQualityReviewer;
1597
- declare function initDeckQualityReviewer(): Promise<DeckQualityReviewer>;
1598
-
1599
998
  /**
1600
- * Remediator - Fix Failing Slides
1601
- *
1602
- * When a slide fails qualitative review (< 95), this module attempts to fix it.
1603
- * Maximum 3 remediation attempts per slide.
1604
- *
1605
- * Remediation strategies are based on the specific quality issues identified:
1606
- * - Visual Impact: Increase title prominence, add visual elements
1607
- * - Content Clarity: Reduce word count, simplify messaging
1608
- * - Layout Balance: Redistribute content, improve alignment
1609
- * - Typography Hierarchy: Adjust text sizes, create clearer hierarchy
1610
- * - Whitespace Usage: Remove content or split slide
1611
- * - Color Harmony: Ensure colors match theme
1612
- * - Audience Appropriateness: Adjust density for audience
1613
- *
1614
- * ALL rules come from the Knowledge Base. NO hardcoded fallbacks.
999
+ * Composite Chart Provider
1615
1000
  */
1616
-
1617
- interface RemediationResult {
1618
- /** Was remediation successful? */
1619
- success: boolean;
1620
- /** Original slide */
1621
- originalSlide: Slide;
1622
- /** Remediated slide (or original if failed) */
1623
- remediatedSlide: Slide;
1624
- /** Number of attempts made */
1625
- attempts: number;
1626
- /** Final score after remediation */
1627
- finalScore: number;
1628
- /** Review after remediation */
1629
- finalReview: QualitativeSlideReview;
1630
- /** Actions taken during remediation */
1631
- actions: RemediationAction[];
1632
- /** Why remediation failed (if it did) */
1633
- failureReason?: string;
1634
- }
1635
- interface RemediationAction {
1636
- /** What was done */
1637
- action: string;
1638
- /** Which issue it addressed */
1639
- targetIssue: string;
1640
- /** Score before this action */
1641
- scoreBefore: number;
1642
- /** Score after this action */
1643
- scoreAfter: number;
1644
- /** Was this action effective? */
1645
- effective: boolean;
1646
- }
1647
- declare class Remediator {
1648
- private kb;
1649
- private reviewer;
1650
- private initialized;
1651
- private wordLimits;
1652
- private bulletLimit;
1653
- private maxAttempts;
1654
- private targetScore;
1001
+ declare class CompositeChartProvider implements ChartProvider {
1002
+ name: string;
1003
+ private htmlProvider;
1004
+ private imageProvider;
1005
+ private mermaidProvider;
1655
1006
  constructor();
1656
- initialize(): Promise<void>;
1657
- /**
1658
- * Attempt to remediate a failing slide.
1659
- */
1660
- remediate(slide: Slide, presentationType: PresentationType, initialReview: QualitativeSlideReview): Promise<RemediationResult>;
1661
- /**
1662
- * Batch remediate multiple slides.
1663
- */
1664
- remediateBatch(slides: Slide[], reviews: QualitativeSlideReview[], presentationType: PresentationType): Promise<RemediationResult[]>;
1665
- private loadRulesForType;
1666
- private prioritizeIssues;
1667
- private applyFix;
1668
- private fixVisualIssue;
1669
- private fixContentIssue;
1670
- private fixLayoutIssue;
1671
- private fixTypographyIssue;
1672
- private fixAccessibilityIssue;
1673
- private cloneSlide;
1674
- private truncateToWords;
1675
- private isMinimalType;
1676
- private countWords;
1007
+ isAvailable(): Promise<boolean>;
1008
+ generateChart(request: ChartRequest): Promise<ChartResult>;
1009
+ generateDiagram(definition: string, title?: string): Promise<ChartResult>;
1010
+ generateFlowchart(steps: {
1011
+ id: string;
1012
+ label: string;
1013
+ next?: string[];
1014
+ }[]): string;
1015
+ generateTimeline(events: {
1016
+ date: string;
1017
+ title: string;
1018
+ }[]): string;
1677
1019
  }
1678
- declare function getRemediator(): Remediator;
1679
- declare function initRemediator(): Promise<Remediator>;
1020
+ /**
1021
+ * Create default chart provider
1022
+ */
1023
+ declare function createDefaultChartProvider(): CompositeChartProvider;
1680
1024
 
1681
1025
  /**
1682
- * Renderer - Premium HTML/PPTX Output Generation
1026
+ * Knowledge Base - RuVector Expert Principles Loader
1683
1027
  *
1684
- * Renders slides to high-quality outputs:
1685
- * - HTML: Reveal.js with premium CSS from KB
1686
- * - PPTX: PowerPoint (future implementation)
1028
+ * Loads and provides access to the 6,300+ line expert knowledge base
1029
+ * containing methodologies from 40+ presentation experts.
1687
1030
  *
1688
- * ALL styling comes from the Knowledge Base and VisualDesignSystem.
1689
- * NO hardcoded styles.
1031
+ * This runs WITHOUT any API - it's static data bundled with the package.
1690
1032
  */
1691
-
1692
- interface RenderOptions {
1693
- /** Presentation title */
1694
- title: string;
1695
- /** Author name */
1696
- author?: string;
1697
- /** Presentation type */
1698
- presentationType: PresentationType;
1699
- /** Metadata */
1700
- metadata?: PresentationMetadata;
1701
- /** Local images to use as backgrounds */
1702
- images?: string[];
1703
- /** Base path for resolving relative image paths */
1704
- imageBasePath?: string;
1033
+ interface ExpertPrinciple {
1034
+ name: string;
1035
+ description: string;
1036
+ validation?: string[];
1037
+ examples?: string[];
1705
1038
  }
1706
- interface RenderResult {
1707
- html?: string;
1708
- pptx?: Buffer;
1039
+ interface ExpertMethodology {
1040
+ name: string;
1041
+ principles: ExpertPrinciple[];
1042
+ slideTypes?: string[];
1043
+ wordLimits?: {
1044
+ min?: number;
1045
+ max?: number;
1046
+ };
1709
1047
  }
1710
- declare class Renderer {
1711
- private kb;
1712
- private vds;
1713
- private initialized;
1714
- private readonly slideImageKeywords;
1715
- constructor();
1716
- initialize(): Promise<void>;
1717
- /**
1718
- * Render slides to specified formats.
1719
- */
1720
- render(slides: Slide[], formats: OutputFormat[], options: RenderOptions): Promise<RenderResult>;
1721
- private renderHTML;
1722
- private generateCSS;
1723
- private renderSlide;
1724
- private renderTitleSlide;
1725
- private renderSectionDivider;
1726
- private renderMetricsSlide;
1727
- private renderQuoteSlide;
1728
- private renderStarMomentSlide;
1729
- private renderCTASlide;
1730
- private renderThankYouSlide;
1731
- private renderTwoColumnSlide;
1732
- private renderThreeColumnSlide;
1733
- private renderContentSlide;
1734
- private renderPPTX;
1735
- private formatCSSVariables;
1736
- private escapeHTML;
1737
- /**
1738
- * Generate a background image URL based on slide type and content.
1739
- * Priority: 1) slide.data.image, 2) local images array, 3) NO RANDOM STOCK PHOTOS
1740
- *
1741
- * IMPORTANT: Random stock photos destroy credibility. A photo of flowers behind
1742
- * a financial slide makes you look incompetent. Only use images that are:
1743
- * - Explicitly provided by the user
1744
- * - Actually relevant to the content
1745
- * Otherwise, rely on clean gradients via CSS.
1746
- */
1747
- private getBackgroundImageUrl;
1748
- /**
1749
- * Resolve an image path - handles relative paths, absolute paths, and URLs.
1750
- */
1751
- private resolveImagePath;
1752
- /**
1753
- * Generate fallback image URL using Picsum with smart seeding.
1754
- */
1755
- private getFallbackImageUrl;
1048
+ interface AutomatedQA {
1049
+ scoringRubric: {
1050
+ totalPoints: number;
1051
+ passingThreshold: number;
1052
+ categories: Record<string, {
1053
+ weight: number;
1054
+ checks: Record<string, unknown>;
1055
+ }>;
1056
+ };
1057
+ }
1058
+ declare class KnowledgeBase {
1059
+ private data;
1060
+ private loaded;
1756
1061
  /**
1757
- * Convert markdown syntax to HTML.
1758
- * Handles: bold, italic, code, links, and basic formatting.
1759
- * Called BEFORE escapeHTML to preserve markdown-generated HTML tags.
1062
+ * Load the knowledge base from the bundled YAML file.
1760
1063
  */
1761
- private renderMarkdown;
1064
+ load(): Promise<void>;
1762
1065
  /**
1763
- * Clean up broken/truncated markdown that can't be properly rendered.
1764
- * Removes partial code blocks, inline tables, etc.
1066
+ * Get expert methodology by name.
1765
1067
  */
1766
- private cleanBrokenMarkdown;
1068
+ getExpert(name: string): ExpertMethodology | undefined;
1767
1069
  /**
1768
- * Render markdown tables to HTML tables.
1070
+ * Get all expert names.
1769
1071
  */
1770
- private renderMarkdownTables;
1072
+ getExpertNames(): string[];
1771
1073
  /**
1772
- * Build an HTML table from markdown table rows.
1074
+ * Get framework recommendation for audience.
1773
1075
  */
1774
- private buildHTMLTable;
1775
- }
1776
- declare function getRenderer(): Renderer;
1777
- declare function initRenderer(): Promise<Renderer>;
1778
-
1779
- /**
1780
- * NanoBanana Pro Image Generation Provider
1781
- *
1782
- * Integrates with Google Gemini's image generation capabilities via NanoBanana Pro.
1783
- * Generates high-quality hero images, concept illustrations, and visual assets
1784
- * for presentation slides.
1785
- *
1786
- * Requires: GOOGLE_AI_API_KEY environment variable
1787
- *
1788
- * Usage:
1789
- * const provider = createNanoBananaProvider();
1790
- * if (await provider.isAvailable()) {
1791
- * const imageUrl = await provider.generateHeroImage('AI revolution');
1792
- * }
1793
- */
1794
- interface ImageGenerationRequest {
1795
- /** The concept or topic to visualize */
1796
- concept: string;
1797
- /** Image style/type */
1798
- style: 'hero' | 'concept' | 'icon' | 'background' | 'diagram';
1799
- /** Presentation type for context */
1800
- presentationType?: string;
1801
- /** Aspect ratio */
1802
- aspectRatio?: '16:9' | '4:3' | '1:1' | '9:16';
1803
- /** Color scheme preference */
1804
- colorScheme?: 'dark' | 'light' | 'vibrant' | 'muted';
1805
- }
1806
- interface ImageGenerationResult {
1807
- /** Whether generation succeeded */
1808
- success: boolean;
1809
- /** Generated image URL or base64 data */
1810
- imageUrl?: string;
1811
- /** Base64 encoded image data */
1812
- imageData?: string;
1813
- /** MIME type of the image */
1814
- mimeType?: string;
1815
- /** Error message if failed */
1816
- error?: string;
1817
- /** Prompt used for generation */
1818
- promptUsed?: string;
1819
- }
1820
- interface NanoBananaConfig {
1821
- /** Google AI API key (defaults to GOOGLE_AI_API_KEY env var) */
1822
- apiKey?: string;
1823
- /** Model to use (defaults to gemini-2.0-flash-exp for image generation) */
1824
- model?: string;
1825
- /** Timeout in milliseconds */
1826
- timeout?: number;
1827
- /** Enable verbose logging */
1828
- verbose?: boolean;
1829
- }
1830
- /**
1831
- * NanoBanana Pro image generation provider.
1832
- * Uses Google Gemini's image generation capabilities.
1833
- */
1834
- declare class NanoBananaProvider {
1835
- readonly name = "NanoBanana Pro";
1836
- private apiKey;
1837
- private model;
1838
- private timeout;
1839
- private verbose;
1840
- constructor(config?: NanoBananaConfig);
1076
+ getFrameworkForAudience(audience: string): {
1077
+ primaryFramework: string;
1078
+ secondaryFramework?: string;
1079
+ slideTypes: string[];
1080
+ } | undefined;
1841
1081
  /**
1842
- * Check if NanoBanana is available (API key present).
1082
+ * Get framework recommendation for goal.
1843
1083
  */
1844
- isAvailable(): Promise<boolean>;
1084
+ getFrameworkForGoal(goal: string): {
1085
+ primaryFramework: string;
1086
+ secondaryFramework?: string;
1087
+ slideTypes: string[];
1088
+ } | undefined;
1845
1089
  /**
1846
- * Generate a hero image for a slide.
1090
+ * Get QA scoring rubric.
1847
1091
  */
1848
- generateHeroImage(concept: string): Promise<ImageGenerationResult>;
1092
+ getScoringRubric(): AutomatedQA['scoringRubric'] | undefined;
1849
1093
  /**
1850
- * Generate a concept illustration.
1094
+ * Get mode configuration (keynote or business).
1851
1095
  */
1852
- generateConceptImage(concept: string): Promise<ImageGenerationResult>;
1096
+ getModeConfig(mode: 'keynote' | 'business'): unknown;
1853
1097
  /**
1854
- * Generate an icon or symbol.
1098
+ * Get slide type configuration.
1855
1099
  */
1856
- generateIcon(concept: string): Promise<ImageGenerationResult>;
1100
+ getSlideType(type: string): unknown;
1857
1101
  /**
1858
- * Generate a background image.
1102
+ * Get the knowledge base version.
1859
1103
  */
1860
- generateBackground(concept: string, colorScheme?: 'dark' | 'light'): Promise<ImageGenerationResult>;
1104
+ getVersion(): string;
1861
1105
  /**
1862
- * Generate an image based on request parameters.
1106
+ * Validate a slide against expert principles.
1863
1107
  */
1864
- generate(request: ImageGenerationRequest): Promise<ImageGenerationResult>;
1108
+ validateAgainstExpert(expertName: string, slideData: {
1109
+ wordCount: number;
1110
+ hasActionTitle: boolean;
1111
+ bulletCount: number;
1112
+ }): {
1113
+ passed: boolean;
1114
+ violations: string[];
1115
+ };
1865
1116
  /**
1866
- * Build an optimized prompt for image generation.
1117
+ * Ensure knowledge base is loaded.
1867
1118
  */
1868
- private buildPrompt;
1119
+ private ensureLoaded;
1869
1120
  /**
1870
- * Call the Gemini API for image generation.
1121
+ * Get default data if YAML can't be loaded.
1871
1122
  */
1872
- private callGeminiAPI;
1123
+ private getDefaultData;
1873
1124
  }
1874
1125
  /**
1875
- * Create a new NanoBanana provider instance.
1126
+ * Get the knowledge base singleton.
1876
1127
  */
1877
- declare function createNanoBananaProvider(config?: NanoBananaConfig): NanoBananaProvider;
1128
+ declare function getKnowledgeBase(): KnowledgeBase;
1129
+
1878
1130
  /**
1879
- * Get a pre-built prompt for a specific image type.
1880
- * Useful for customization or debugging.
1131
+ * Claude Presentation Master
1132
+ *
1133
+ * Generate world-class presentations using expert methodologies from
1134
+ * Duarte, Reynolds, Gallo, and Anderson. Enforces rigorous quality
1135
+ * standards through real visual validation.
1136
+ *
1137
+ * @packageDocumentation
1138
+ * @module claude-presentation-master
1139
+ * @author Stuart Kerr <stuart@isovision.ai>
1140
+ * @license MIT
1881
1141
  */
1882
- declare function getNanoBananaPrompt(style: 'hero' | 'concept' | 'icon' | 'background' | 'diagram', concept: string, presentationType?: string): string;
1883
1142
 
1884
1143
  /**
1885
- * CodeQualityValidator - Detects Hardcoded Values in Source Code
1144
+ * Generate a presentation from content.
1886
1145
  *
1887
- * This validator scans TypeScript/JavaScript source files for hardcoded CSS values,
1888
- * colors, and dimensions that should be coming from the Knowledge Base.
1146
+ * @example
1147
+ * ```typescript
1148
+ * import { generate } from '@isovision/claude-presentation-master';
1889
1149
  *
1890
- * RATIONALE: ALL styling decisions must come from the KB. Hardcoded values:
1891
- * 1. Break the single-source-of-truth principle
1892
- * 2. Make theme changes inconsistent
1893
- * 3. Bypass QA validation
1894
- * 4. Create maintenance nightmares
1150
+ * const result = await generate({
1151
+ * content: '# My Presentation\n\n...',
1152
+ * contentType: 'markdown',
1153
+ * mode: 'keynote',
1154
+ * format: ['html', 'pptx'],
1155
+ * qaThreshold: 95,
1156
+ * title: 'My Amazing Presentation'
1157
+ * });
1895
1158
  *
1896
- * This validator catches these careless errors at build/test time.
1897
- */
1898
- interface HardcodedViolation {
1899
- file: string;
1900
- line: number;
1901
- column: number;
1902
- type: 'color' | 'dimension' | 'font' | 'shadow' | 'rgba' | 'gradient';
1903
- value: string;
1904
- context: string;
1905
- severity: 'error' | 'warning';
1906
- suggestion: string;
1907
- }
1908
- interface ValidationResult {
1909
- passed: boolean;
1910
- violations: HardcodedViolation[];
1911
- summary: {
1912
- totalFiles: number;
1913
- filesWithViolations: number;
1914
- totalViolations: number;
1915
- byType: Record<string, number>;
1916
- bySeverity: Record<string, number>;
1917
- };
1918
- }
1919
- declare class CodeQualityValidator {
1920
- private srcDir;
1921
- private violations;
1922
- constructor(srcDir: string);
1923
- /**
1924
- * Validate all TypeScript files in the source directory.
1925
- */
1926
- validate(): Promise<ValidationResult>;
1927
- /**
1928
- * Validate a single file for hardcoded values.
1929
- */
1930
- private validateFile;
1931
- private checkForHexColors;
1932
- private checkForRgbaColors;
1933
- private checkForDimensions;
1934
- private checkForGradients;
1935
- private findTypeScriptFiles;
1936
- private shouldSkipFile;
1937
- private isExemptLine;
1938
- private buildResult;
1939
- /**
1940
- * Format validation results for console output.
1941
- */
1942
- formatResults(result: ValidationResult): string;
1943
- }
1944
- /**
1945
- * Run code quality validation on the source directory.
1159
+ * console.log(`Score: ${result.score}/100`);
1160
+ * ```
1161
+ *
1162
+ * @param config - Presentation configuration
1163
+ * @returns Presentation result with outputs, QA results, and score
1164
+ * @throws {ValidationError} If input validation fails
1165
+ * @throws {QAFailureError} If QA score is below threshold
1946
1166
  */
1947
- declare function validateCodeQuality(srcDir: string): Promise<ValidationResult>;
1167
+ declare function generate(config: PresentationConfig): Promise<PresentationResult>;
1948
1168
  /**
1949
- * Run validation and print results to console.
1950
- */
1951
- declare function runCodeQualityCheck(srcDir: string): Promise<boolean>;
1952
-
1953
- /**
1954
- * Claude Presentation Master - Main API
1169
+ * Validate an existing presentation.
1170
+ *
1171
+ * @example
1172
+ * ```typescript
1173
+ * import { validate } from '@isovision/claude-presentation-master';
1174
+ * import fs from 'fs';
1955
1175
  *
1956
- * Entry point for the qualitative-first presentation engine.
1957
- * Every slide must score 95/100 based on REAL qualitative excellence.
1176
+ * const html = fs.readFileSync('presentation.html', 'utf-8');
1177
+ * const result = await validate(html, { mode: 'keynote' });
1958
1178
  *
1959
- * Flow:
1960
- * 1. ContentAnalyzer -> Parse and detect structure
1961
- * 2. SlideGenerator -> Generate slides with visual intent
1962
- * 3. SlideQualityReviewer -> Qualitative review per slide (must pass 95)
1963
- * 4. Remediator -> Fix failing slides (3 attempts max)
1964
- * 5. DeckQualityReviewer -> Holistic deck review (must pass 95)
1965
- * 6. Renderer -> Premium HTML/PPTX output
1179
+ * console.log(`Score: ${result.score}/100`);
1180
+ * console.log(`Passed: ${result.passed}`);
1181
+ * ```
1966
1182
  *
1967
- * DESIGN PHILOSOPHY:
1968
- * - The Knowledge Base (YAML) is the source of truth for all design decisions
1969
- * - Critical paths use queryRequired() which throws on missing data
1970
- * - Defensive fallbacks exist for optional fields and type safety
1971
- * - Both V1 (generate) and V2 (generatePresentation) APIs use the same KB
1183
+ * @param presentation - HTML string or file buffer
1184
+ * @param options - Validation options
1185
+ * @returns QA validation results
1972
1186
  */
1973
-
1974
- declare const VERSION = "4.2.0";
1975
- interface GenerateOptions {
1976
- /** Input content (Markdown, text, etc.) */
1977
- content: string;
1978
- /** Content type */
1979
- contentType?: 'markdown' | 'text';
1980
- /** Output formats to generate */
1981
- format?: OutputFormat[];
1982
- /** Output directory */
1983
- outputDir?: string;
1984
- /** Presentation title (optional, will be detected from content) */
1985
- title?: string;
1986
- /** Author name */
1987
- author?: string;
1988
- /** Explicit presentation type (optional, will be detected from content) */
1989
- presentationType?: PresentationType;
1990
- /** Legacy mode (maps to presentation type) */
1991
- mode?: PresentationMode;
1992
- /** Minimum score threshold (default: 95) */
1993
- qaThreshold?: number;
1994
- /** Skip remediation (fail fast) */
1995
- skipRemediation?: boolean;
1996
- /** Verbose logging */
1997
- verbose?: boolean;
1998
- /** Local images to use as backgrounds (paths relative to output or absolute URLs) */
1999
- images?: string[];
2000
- /** Base path for resolving relative image paths */
2001
- imageBasePath?: string;
2002
- }
2003
- interface GenerateResult {
2004
- /** Generated outputs */
2005
- outputs: {
2006
- html?: string;
2007
- pptx?: Buffer;
2008
- };
2009
- /** Final slides */
2010
- slides: Slide[];
2011
- /** Overall score (0-100) */
1187
+ declare function validate(presentation: string | Buffer, options?: {
1188
+ mode?: 'keynote' | 'business';
1189
+ threshold?: number;
1190
+ strictMode?: boolean;
1191
+ }): Promise<QAResults & {
2012
1192
  score: number;
2013
- /** Detailed deck score */
2014
- deckScore?: QualitativeDeckReview | undefined;
2015
- /** Metadata */
2016
- metadata: {
2017
- title: string;
2018
- author: string;
2019
- presentationType: PresentationType;
2020
- generatedAt: string;
2021
- slideCount: number;
2022
- totalWords: number;
2023
- avgWordsPerSlide: number;
2024
- };
2025
- /** Remediation results (if any slides were fixed) */
2026
- remediations?: RemediationResult[] | undefined;
2027
- /** Any warnings (non-fatal issues) */
2028
- warnings?: string[] | undefined;
2029
- }
1193
+ }>;
2030
1194
  /**
2031
- * Generate a presentation from content.
2032
- *
2033
- * This is the main entry point. It orchestrates:
2034
- * 1. Content analysis
2035
- * 2. Slide generation
2036
- * 3. Qualitative review (95/100 threshold)
2037
- * 4. Remediation (3 attempts per failing slide)
2038
- * 5. Deck-level review
2039
- * 6. Rendering to HTML/PPTX
1195
+ * Get the version of the package.
1196
+ */
1197
+ declare const VERSION = "1.0.0";
1198
+ /**
1199
+ * Default export for convenience.
2040
1200
  */
2041
- declare function generate(options: GenerateOptions): Promise<GenerateResult>;
1201
+ declare const _default: {
1202
+ generate: typeof generate;
1203
+ validate: typeof validate;
1204
+ PresentationEngine: typeof PresentationEngine;
1205
+ QAEngine: typeof QAEngine;
1206
+ VERSION: string;
1207
+ };
2042
1208
 
2043
- export { CodeQualityValidator, type ValidationResult as CodeValidationResult, type ContentAnalysis, ContentAnalyzer, DeckQualityReviewer, type DeckScore, type GenerateOptions, type GenerateResult, type HardcodedViolation, type ImageGenerationRequest, type ImageGenerationResult, KnowledgeGateway, type MetricData, type NanoBananaConfig, NanoBananaProvider, type OutputFormat, PresentationEngineV2, type PresentationMetadata, type PresentationMode, type PresentationResult, type PresentationType, type QALoopResult, type QualitativeDeckReview, type QualitativeSlideReview, type RemediationFeedback, type RemediationResult, Remediator, Renderer, RendererV2, type Slide, type SlideContent as SlideContentV2, SlideGenerator, SlideGeneratorV2, SlideQualityReviewer, type SlideScore, type SlideType as SlideTypeV2, type SlideV2, type TableData, VERSION, type Violation, type VisualDeckAnalysis, VisualDesignSystem, VisualQAEngine, type VisualSlideAnalysis, createNanoBananaProvider, createPresentationEngineV2, createRendererV2, createSlideGeneratorV2, generate, generatePresentation, getContentAnalyzer, getDeckQualityReviewer, getKB, getNanoBananaPrompt, getRemediator, getRenderer, getSlideGenerator, getSlideQualityReviewer, getVisualDesignSystem, getVisualQAEngine, initContentAnalyzer, initDeckQualityReviewer, initKB, initRemediator, initRenderer, initSlideGenerator, initSlideQualityReviewer, initVisualDesignSystem, initVisualQAEngine, runCodeQualityCheck, validateCodeQuality };
1209
+ export { type AccessibilityResults, type ChartData, type ChartDataset, ChartJsProvider, type ChartProvider, type ChartRequest, type ChartResult, type ChartType, CompositeChartProvider, CompositeImageProvider, type ContentAnalysis, ContentAnalyzer, type ContentQAResults, type ContrastIssue, type ExpertQAResults, type ExpertValidation, type FontSizeIssue, type GlanceTestResult, type ImageData, type ImageProvider, type ImageRequest, type ImageResult, KnowledgeBase, LocalImageProvider, MermaidProvider, type MetricData, type OneIdeaResult, type OutputFormat, PlaceholderImageProvider, PowerPointGenerator, type PresentationConfig, PresentationEngine, type PresentationMetadata, type PresentationMode, type PresentationResult, QAEngine, QAFailureError, type QAIssue, type QAResults, QuickChartProvider, RevealJsGenerator, type SCQAStructure, ScoreCalculator, type SignalNoiseResult, type Slide, type SlideContentScore, type SlideData, SlideFactory, type SlideType, type SlideVisualScore, type SparklineStructure, TemplateEngine, TemplateNotFoundError, type ThemeName, UnsplashImageProvider, VERSION, ValidationError, type VisualQAResults, createDefaultChartProvider, createDefaultImageProvider, _default as default, generate, getKnowledgeBase, validate };