claude-presentation-master 3.0.1 → 3.6.0

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,449 +1,237 @@
1
- import PptxGenJS from 'pptxgenjs';
2
-
3
1
  /**
4
2
  * Claude Presentation Master - Type Definitions
5
- * @module types
6
- */
7
- /**
8
- * Legacy presentation mode (for backwards compatibility)
9
- * @deprecated Use PresentationType for granular control
3
+ *
4
+ * Clean rewrite: All types for KB-driven presentation generation.
5
+ * Every decision comes from the Knowledge Base - no hardcoded fallbacks.
10
6
  */
11
- type PresentationMode = 'keynote' | 'business';
12
7
  /**
13
- * Granular presentation types with distinct validation rules.
14
- * Each type is a "swim lane" with its own word limits, expert methodologies,
15
- * and scoring weights. These are mutually exclusive.
8
+ * The 7 distinct presentation types, each with its own validation rules.
9
+ * These come from KB path: presentation_types.<type>
16
10
  */
17
11
  type PresentationType = 'ted_keynote' | 'sales_pitch' | 'consulting_deck' | 'investment_banking' | 'investor_pitch' | 'technical_presentation' | 'all_hands';
18
- type OutputFormat = 'html' | 'pptx';
19
- type ThemeName = 'default' | 'light-corporate' | 'modern-tech' | 'minimal' | 'warm' | 'creative';
20
- interface PresentationConfig {
21
- /** Input content (Markdown, JSON, YAML, or plain text) */
22
- content: string;
23
- /** Content format */
24
- contentType: 'markdown' | 'json' | 'yaml' | 'text';
25
- /**
26
- * Legacy presentation mode (backwards compatible)
27
- * @deprecated Use `presentationType` for granular control
28
- */
29
- mode: PresentationMode;
30
- /**
31
- * Granular presentation type with distinct validation rules.
32
- * If specified, this overrides `mode` for validation purposes.
33
- */
34
- presentationType?: PresentationType;
35
- /** Target audience (used for auto-detecting presentation type) */
36
- audience?: 'board_of_directors' | 'sales_prospect' | 'investors_vcs' | 'general_audience_keynote' | 'technical_team' | 'all_hands_meeting';
37
- /** Presentation goal (used for auto-detecting presentation type) */
38
- goal?: 'get_approval' | 'inform_educate' | 'persuade_sell' | 'inspire_motivate' | 'report_results' | 'raise_funding';
39
- /** Output formats to generate */
40
- format: OutputFormat[];
41
- /** Visual theme */
42
- theme?: ThemeName;
43
- /** Minimum QA score required (0-100, default: 95) */
44
- qaThreshold?: number;
45
- /** Skip QA validation (NOT RECOMMENDED) */
46
- skipQA?: boolean;
47
- /** Presentation title */
48
- title: string;
49
- /** Author name */
50
- author?: string;
51
- /** Subject/description */
52
- subject?: string;
53
- /** Output directory */
54
- output?: string;
55
- /** Minify HTML output */
56
- minify?: boolean;
57
- /** Custom CSS to inject */
58
- customCSS?: string;
59
- /** Custom Handlebars templates */
60
- customTemplates?: Record<string, string>;
61
- }
62
12
  /**
63
- * Validation rules specific to a presentation type.
64
- * Loaded from the knowledge base.
13
+ * Legacy mode for backwards compatibility
65
14
  */
66
- interface PresentationTypeRules {
67
- id: PresentationType;
68
- name: string;
69
- description: string;
70
- wordsPerSlide: {
71
- min: number;
72
- max: number;
73
- ideal: number;
74
- };
75
- whitespace: {
76
- min: number;
77
- ideal: number;
78
- max?: number;
79
- };
80
- bulletsPerSlide: {
81
- max: number;
82
- };
83
- actionTitlesRequired: boolean;
84
- sourcesRequired: boolean;
85
- scoringWeights: {
86
- visual_quality: number;
87
- content_quality: number;
88
- expert_compliance: number;
89
- accessibility: number;
90
- };
91
- }
92
- 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';
15
+ type PresentationMode = 'keynote' | 'business';
16
+ type OutputFormat = 'html' | 'pptx';
17
+ type SlideType = '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';
93
18
  interface Slide {
94
19
  /** Slide index (0-based) */
95
20
  index: number;
96
- /** Slide type */
21
+ /** Slide type from KB */
97
22
  type: SlideType;
98
- /** Slide data for template rendering */
23
+ /** Slide content */
99
24
  data: SlideData;
100
- /** CSS classes to apply */
101
- classes?: string[];
102
- /** Custom styles */
103
- styles?: Record<string, string>;
25
+ /** Slide-level score (must be >= 95) */
26
+ score?: SlideScore;
104
27
  /** Speaker notes */
105
28
  notes?: string;
106
29
  }
107
30
  interface SlideData {
108
- /** Main title */
31
+ /** Main title (action title for consulting, emotional for keynote) */
109
32
  title?: string;
110
33
  /** Subtitle */
111
34
  subtitle?: string;
112
- /** Body content */
35
+ /** Body text */
113
36
  body?: string;
114
37
  /** Bullet points */
115
38
  bullets?: string[];
116
- /** Key message */
39
+ /** Key message / takeaway */
117
40
  keyMessage?: string;
118
- /** Images */
119
- images?: ImageData[];
120
- /** Metrics/KPIs */
121
- metrics?: MetricData[];
122
41
  /** Quote text */
123
42
  quote?: string;
124
43
  /** Quote attribution */
125
44
  attribution?: string;
126
- /** Source citation */
45
+ /** Metrics for metrics_grid */
46
+ metrics?: MetricData[];
47
+ /** Source citation (required for consulting/IB) */
127
48
  source?: string;
49
+ /** Callout text (for data slides) */
50
+ callout?: string;
51
+ /** Background image path (local file or URL) */
52
+ image?: string;
128
53
  /** Additional custom data */
129
54
  [key: string]: unknown;
130
55
  }
131
- interface ImageData {
132
- src: string;
133
- alt: string;
134
- caption?: string;
135
- }
136
56
  interface MetricData {
137
57
  value: string | number;
138
58
  label: string;
139
59
  change?: string;
140
60
  trend?: 'up' | 'down' | 'neutral';
141
61
  }
142
- interface QAResults {
143
- /** Visual quality results */
144
- visual: VisualQAResults;
145
- /** Content quality results */
146
- content: ContentQAResults;
147
- /** Expert methodology compliance */
148
- expert: ExpertQAResults;
149
- /** Accessibility compliance */
150
- accessibility: AccessibilityResults;
151
- /** Semantic completeness (optional - requires source content) */
152
- semanticCompleteness?: SemanticCompletenessResult$1;
153
- /** Vision QA results (optional - requires Claude API key) */
154
- visionQA?: VisionQAResults;
155
- /** Overall pass/fail */
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? */
156
74
  passed: boolean;
157
- /** List of issues found */
158
- issues: QAIssue[];
75
+ /** Specific violations found */
76
+ violations: Violation[];
159
77
  }
160
- interface VisionQAResults {
161
- /** Per-slide AI visual analysis */
162
- slideAnalyses: VisionSlideAnalysis[];
163
- /** Presentation-level assessment */
164
- presentationLevel: {
165
- visual_consistency: number;
166
- story_arc: number;
167
- memorable_moments: number;
168
- professional_quality: number;
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;
103
+ }
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? */
112
+ passed: boolean;
113
+ /** Deck-level violations */
114
+ violations: Violation[];
115
+ }
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;
125
+ }
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;
139
+ }
140
+ interface KBValidationRules {
141
+ words_per_slide: {
142
+ min: number;
143
+ max: number;
144
+ ideal: number;
169
145
  };
170
- /** Overall score (1-10 scale) */
171
- overallScore: number;
172
- /** Slides that need improvement */
173
- weakSlides: number[];
174
- /** Slides that are excellent */
175
- strongSlides: number[];
176
- /** Critical issues detected */
177
- criticalIssues: string[];
178
- /** Pass/fail */
179
- pass: boolean;
180
- /** One-sentence verdict */
181
- verdict: string;
182
- }
183
- interface VisionSlideAnalysis {
184
- slideIndex: number;
185
- scores: {
186
- typography_hierarchy: number;
187
- layout_balance: number;
188
- color_harmony: number;
189
- professional_polish: number;
190
- message_clarity: number;
191
- content_density: number;
192
- visual_support: number;
193
- narrative_flow: number;
146
+ whitespace: {
147
+ min: number;
148
+ ideal: number;
149
+ max?: number;
194
150
  };
195
- overallScore: number;
196
- criticalIssues: string[];
197
- suggestions: string[];
198
- pass: boolean;
199
- }
200
- interface VisualQAResults {
201
- /** Whitespace percentage (target: 35%+ keynote, 25%+ business) */
202
- whitespacePercentage: number;
203
- /** Layout balance score (0-1) */
204
- layoutBalance: number;
205
- /** Contrast ratio (target: 4.5+) */
206
- contrastRatio: number;
207
- /** Number of font families used (target: ≤2) */
208
- fontFamilies: number;
209
- /** Number of colors used */
210
- colorCount: number;
211
- /** Screenshots of each slide */
212
- screenshots: Buffer[];
213
- /** Per-slide visual scores */
214
- perSlide: SlideVisualScore[];
215
- }
216
- interface SlideVisualScore {
217
- slideIndex: number;
218
- whitespace: number;
219
- balance: number;
220
- contrast: number;
221
- passed: boolean;
222
- issues: string[];
223
- }
224
- interface ContentQAResults {
225
- /** Per-slide content analysis */
226
- perSlide: SlideContentScore[];
227
- /** Glance test results */
228
- glanceTest: GlanceTestResult[];
229
- /** Signal-to-noise ratio results */
230
- signalNoise: SignalNoiseResult[];
231
- /** One idea per slide validation */
232
- oneIdea: OneIdeaResult[];
233
- }
234
- interface SlideContentScore {
235
- slideIndex: number;
236
- wordCount: number;
237
- withinLimit: boolean;
238
- hasActionTitle: boolean;
239
- issues: string[];
240
- }
241
- interface GlanceTestResult {
242
- slideIndex: number;
243
- keyMessage: string;
244
- wordCount: number;
245
- readingTime: number;
246
- passed: boolean;
247
- recommendation?: string;
248
- }
249
- interface SignalNoiseResult {
250
- slideIndex: number;
251
- signalCount: number;
252
- noiseCount: number;
253
- signalRatio: number;
254
- passed: boolean;
255
- noiseElements: string[];
256
- }
257
- interface OneIdeaResult {
258
- slideIndex: number;
259
- ideaCount: number;
260
- mainIdea: string;
261
- passed: boolean;
262
- conflictingIdeas?: string[];
263
- }
264
- interface ExpertQAResults {
265
- /** Nancy Duarte validation */
266
- duarte: ExpertValidation;
267
- /** Garr Reynolds validation */
268
- reynolds: ExpertValidation;
269
- /** Carmine Gallo validation */
270
- gallo: ExpertValidation;
271
- /** Chris Anderson validation */
272
- anderson: ExpertValidation;
273
- }
274
- interface ExpertValidation {
275
- expertName: string;
276
- principlesChecked: string[];
277
- passed: boolean;
278
- score: number;
279
- violations: string[];
280
- }
281
- interface AccessibilityResults {
282
- /** WCAG compliance level achieved */
283
- wcagLevel: 'A' | 'AA' | 'AAA' | 'FAIL';
284
- /** Contrast issues found */
285
- contrastIssues: ContrastIssue[];
286
- /** Font size issues */
287
- fontSizeIssues: FontSizeIssue[];
288
- /** Focus state coverage */
289
- focusCoverage: number;
290
- /** Color-blind safety */
291
- colorBlindSafe: boolean;
292
- }
293
- interface ContrastIssue {
294
- slideIndex: number;
295
- element: string;
296
- foreground: string;
297
- background: string;
298
- ratio: number;
299
- required: number;
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;
300
158
  }
301
- interface FontSizeIssue {
302
- slideIndex: number;
303
- element: string;
304
- actualSize: number;
305
- minimumSize: number;
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;
166
+ }
167
+ interface KBScoringWeights {
168
+ visual_quality: number;
169
+ content_quality: number;
170
+ expert_compliance: number;
171
+ accessibility: number;
306
172
  }
307
- interface QAIssue {
308
- /** Issue severity */
309
- severity: 'error' | 'warning' | 'info';
310
- /** Issue category */
311
- category: 'visual' | 'content' | 'expert' | 'accessibility' | 'semantic_completeness';
312
- /** Slide index (if applicable) */
313
- slideIndex?: number;
314
- /** Issue description */
315
- message: string;
316
- /** Suggested fix */
317
- suggestion?: string;
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;
181
+ };
318
182
  }
319
- interface SemanticCompletenessResult$1 {
320
- /** Coverage score (0-100) - percentage of source concepts found in output */
321
- coverageScore: number;
322
- /** Key concepts extracted from source content */
323
- sourceConcepts: ExtractedConcept$1[];
324
- /** Concepts that were found in the generated slides */
325
- foundConcepts: ExtractedConcept$1[];
326
- /** Concepts that were NOT found - potential content loss */
327
- missingConcepts: ExtractedConcept$1[];
328
- /** Whether semantic completeness passed (score >= threshold) */
329
- passed: boolean;
330
- /** Detailed issues */
331
- issues: QAIssue[];
183
+ interface KBScoringCategory {
184
+ weight: number;
185
+ checks: Record<string, KBCheck>;
332
186
  }
333
- interface ExtractedConcept$1 {
334
- /** The concept text (normalized) */
335
- text: string;
336
- /** Importance weight (1-10) based on context */
337
- importance: number;
338
- /** Category: heading, metric, key_term, entity, action */
339
- category: 'heading' | 'metric' | 'key_term' | 'entity' | 'action';
340
- /** Original text before normalization */
341
- original: string;
342
- /** Was it found in the output? */
343
- found?: boolean;
344
- /** Where it was found (slide indices) */
345
- foundIn?: number[];
187
+ interface KBCheck {
188
+ points: number;
189
+ description: string;
190
+ validation?: string;
346
191
  }
347
- interface PresentationResult {
348
- /** Generated outputs */
349
- outputs: {
350
- html?: string;
351
- pptx?: Buffer;
352
- };
353
- /** QA validation results */
354
- qaResults: QAResults;
355
- /** Overall QA score (0-100) */
356
- score: number;
357
- /** Presentation metadata */
358
- metadata: PresentationMetadata;
192
+ interface KBExpert {
193
+ name: string;
194
+ core_principles: Record<string, KBPrinciple>;
359
195
  }
360
- interface PresentationMetadata {
361
- /** Presentation title */
362
- title: string;
363
- /** Author */
364
- author: string;
365
- /** Generation timestamp */
366
- generatedAt: string;
367
- /** Presentation mode */
368
- mode: PresentationMode;
369
- /** Total slide count */
370
- slideCount: number;
371
- /** Total word count */
372
- wordCount: number;
373
- /** Average words per slide */
374
- avgWordsPerSlide: number;
375
- /** Estimated presentation duration (minutes) */
376
- estimatedDuration: number;
377
- /** Themes/frameworks used */
378
- frameworks: string[];
196
+ interface KBPrinciple {
197
+ description: string;
198
+ rules?: string[];
199
+ examples?: string[];
379
200
  }
380
201
  interface ContentAnalysis {
381
- /** SCQA structure extracted */
382
- scqa: SCQAStructure;
383
- /** Sparkline narrative arc */
384
- sparkline: SparklineStructure;
385
- /** Key messages identified */
202
+ /** Detected presentation type */
203
+ detectedType: PresentationType;
204
+ /** Extracted title */
205
+ title: string;
206
+ /** Sections found */
207
+ sections: ContentSection[];
208
+ /** Key messages */
386
209
  keyMessages: string[];
387
- /** Generated action titles */
388
- titles: string[];
389
- /** STAR moments identified */
390
- starMoments: string[];
391
- /** Estimated slide count */
392
- estimatedSlideCount: number;
393
- /** Extracted data points (metrics, percentages, financial data) */
394
- dataPoints: ExtractedDataPoint[];
395
- /** Extracted bullet content by section */
396
- sectionContent: ExtractedSection[];
397
- /** Financial metrics summary */
398
- financialSummary?: FinancialSummary | undefined;
399
- /** Comparison data (e.g., Year 1 vs Year 2) */
400
- comparisons?: ComparisonData[] | undefined;
401
- }
402
- /** Represents an extracted data point with context */
403
- interface ExtractedDataPoint {
404
- value: string;
405
- numericValue?: number;
406
- type: 'currency' | 'percentage' | 'number' | 'ratio' | 'time';
407
- context: string;
408
- label?: string;
409
- trend?: 'positive' | 'negative' | 'neutral';
410
- }
411
- /** Represents content from a section header */
412
- interface ExtractedSection {
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 */
413
219
  header: string;
220
+ /** Header level (1-6) */
414
221
  level: number;
222
+ /** Raw content */
415
223
  content: string;
224
+ /** Extracted bullets */
416
225
  bullets: string[];
417
- metrics: ExtractedDataPoint[];
418
- /** Parsed table data if section contains a table */
419
- tables?: ParsedTable[];
420
- }
421
- /** Represents a parsed markdown table */
422
- interface ParsedTable {
423
- headers: string[];
424
- rows: string[][];
425
- caption?: string;
226
+ /** Metrics in this section */
227
+ metrics: DataPoint[];
426
228
  }
427
- /** Financial summary for investment-type presentations */
428
- interface FinancialSummary {
429
- totalInvestment?: string;
430
- npv?: string;
431
- irr?: string;
432
- paybackPeriod?: string;
433
- roi?: string;
434
- annualSavings?: string[];
435
- revenueImpact?: string;
436
- }
437
- /** Comparison data for before/after or year-over-year analysis */
438
- interface ComparisonData {
439
- label: string;
440
- before?: string;
441
- after?: string;
442
- change?: string;
443
- periods?: Array<{
444
- period: string;
445
- value: string;
446
- }>;
229
+ interface DataPoint {
230
+ value: string;
231
+ numericValue?: number;
232
+ type: 'currency' | 'percentage' | 'number' | 'time';
233
+ context: string;
234
+ label?: string;
447
235
  }
448
236
  interface SCQAStructure {
449
237
  situation: string;
@@ -454,3345 +242,1200 @@ interface SCQAStructure {
454
242
  interface SparklineStructure {
455
243
  whatIs: string[];
456
244
  whatCouldBe: string[];
245
+ starMoment?: string;
457
246
  callToAdventure: string;
458
247
  }
459
- declare class ValidationError extends Error {
460
- errors: string[];
461
- constructor(errors: string[], message?: string);
462
- }
463
- declare class QAFailureError extends Error {
464
- score: number;
465
- threshold: number;
466
- qaResults: QAResults;
467
- constructor(score: number, threshold: number, qaResults: QAResults, message?: string);
468
- getIssues(): string[];
469
- }
470
- declare class TemplateNotFoundError extends Error {
471
- templatePath: string;
472
- constructor(templatePath: string, message?: string);
473
- }
474
-
475
- /**
476
- * Score Calculator - QA Score Computation
477
- *
478
- * Calculates presentation quality scores based on:
479
- * - Visual quality (35%)
480
- * - Content quality (30%)
481
- * - Expert methodology compliance (25%)
482
- * - Accessibility (10%)
483
- */
484
-
485
- interface ScoreBreakdown {
486
- visual: number;
487
- content: number;
488
- expert: number;
489
- accessibility: number;
490
- total: number;
491
- penalties: number;
492
- details: ScoreDetail[];
493
- }
494
- interface ScoreDetail {
495
- category: string;
496
- check: string;
497
- score: number;
498
- maxScore: number;
499
- notes?: string;
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;
500
260
  }
501
- declare class ScoreCalculator {
502
- private readonly weights;
503
- /**
504
- * Calculate overall QA score from results.
505
- */
506
- calculate(results: QAResults): number;
507
- /**
508
- * Get detailed score breakdown.
509
- */
510
- getBreakdown(results: QAResults): ScoreBreakdown;
511
- /**
512
- * Calculate visual quality score.
513
- */
514
- private calculateVisualScore;
515
- /**
516
- * Calculate content quality score.
517
- */
518
- private calculateContentScore;
519
- /**
520
- * Calculate expert methodology compliance score.
521
- */
522
- private calculateExpertScore;
523
- /**
524
- * Calculate accessibility compliance score.
525
- */
526
- private calculateAccessibilityScore;
527
- /**
528
- * Calculate penalties from issues.
529
- */
530
- private calculatePenalties;
531
- /**
532
- * Get human-readable grade from score.
533
- */
534
- getGrade(score: number): string;
535
- /**
536
- * Get pass/fail status.
537
- */
538
- isPassing(score: number, threshold?: number): boolean;
539
- /**
540
- * Format score for display.
541
- */
542
- formatScore(score: number): string;
543
- /**
544
- * Generate summary report.
545
- */
546
- generateReport(results: QAResults): string;
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;
547
270
  }
548
271
 
549
272
  /**
550
- * QA Engine - Real Visual Quality Validation
273
+ * KnowledgeGateway - Single Point of Access to the Knowledge Base
551
274
  *
552
- * Unlike fake validation systems, this engine ACTUALLY tests:
553
- * - Visual quality using Playwright screenshots + Canvas API
554
- * - Layout balance and whitespace distribution
555
- * - WCAG contrast compliance
556
- * - Expert methodology adherence (Duarte, Reynolds, Gallo, Anderson)
557
- * - Presentation effectiveness, completeness, and visual appeal
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.
558
278
  */
559
279
 
560
- declare class QAEngine {
561
- private browser;
562
- private typeDetector;
563
- /**
564
- * Validate a presentation.
565
- */
566
- validate(presentation: string | Buffer, options?: {
567
- mode?: 'keynote' | 'business';
568
- presentationType?: PresentationType;
569
- strictMode?: boolean;
570
- threshold?: number;
571
- }): Promise<QAResults>;
572
- /**
573
- * Calculate overall QA score.
574
- */
575
- calculateScore(results: QAResults): number;
576
- /**
577
- * Create empty QA results (for when QA is skipped).
578
- */
579
- createEmptyResults(): QAResults;
580
- private runVisualTests;
581
- private runContentTests;
582
- private runExpertTests;
583
- /**
584
- * Validate Nancy Duarte's principles from Slide:ology and Resonate
585
- * - Glance Test: 3 seconds to understand main point
586
- * - STAR Moments: Something They'll Always Remember
587
- * - Sparkline: Contrast between What Is and What Could Be
588
- */
589
- private validateDuartePrinciples;
590
- /**
591
- * Validate Garr Reynolds' principles from Presentation Zen
592
- * - Signal-to-Noise: Remove everything non-essential
593
- * - Simplicity: Amplification through simplification
594
- * - Picture Superiority: Visuals over text
595
- */
596
- private validateReynoldsPrinciples;
597
- /**
598
- * Validate Carmine Gallo's principles from Talk Like TED
599
- * - Rule of Three: Max 3 key points
600
- * - Emotional Connection: 65% stories/emotion
601
- * - Jaw-Dropping Moment: One unforgettable element
602
- */
603
- private validateGalloPrinciples;
604
- /**
605
- * Validate Chris Anderson's principles from TED Talks official guide
606
- * - One Idea: Single throughline per presentation
607
- * - Clarity: No jargon, simple explanations
608
- * - 3-5 Concepts: Limit complexity
609
- */
610
- private validateAndersonPrinciples;
611
- /**
612
- * Calculate variance in an array of numbers
613
- */
614
- private calculateVariance;
615
- private runAccessibilityTests;
616
- private calculateVisualScore;
617
- private calculateContentScore;
618
- private calculateExpertScore;
619
- private calculateA11yScore;
620
- private collectIssues;
621
- private initBrowser;
622
- private closeBrowser;
623
- }
624
-
625
280
  /**
626
- * PowerPoint Validator - PPTX Quality Validation
627
- *
628
- * Validates PowerPoint presentations for:
629
- * - Layout correctness
630
- * - Content quality (word counts, readability)
631
- * - Formatting consistency (fonts, colors)
632
- * - Accessibility compliance
633
- * - Expert methodology adherence
634
- *
635
- * THIS IS A MANDATORY VALIDATION - NO PPTX EXPORT WITHOUT PASSING
281
+ * Result wrapper that includes KB path for debugging
636
282
  */
637
-
638
- interface PPTXValidationResult {
639
- passed: boolean;
640
- score: number;
641
- issues: PPTXIssue[];
642
- perSlide: SlideValidationResult[];
643
- summary: ValidationSummary;
644
- }
645
- interface PPTXIssue {
646
- severity: 'error' | 'warning' | 'info';
647
- category: 'layout' | 'content' | 'formatting' | 'accessibility' | 'expert';
648
- slideIndex?: number;
649
- message: string;
650
- suggestion?: string;
651
- }
652
- interface SlideValidationResult {
653
- slideIndex: number;
654
- type: string;
655
- passed: boolean;
656
- score: number;
657
- issues: PPTXIssue[];
658
- metrics: {
659
- wordCount: number;
660
- hasTitle: boolean;
661
- hasContent: boolean;
662
- estimatedReadingTime: number;
663
- layoutScore: number;
664
- };
665
- }
666
- interface ValidationSummary {
667
- totalSlides: number;
668
- passedSlides: number;
669
- failedSlides: number;
670
- totalErrors: number;
671
- totalWarnings: number;
672
- categories: {
673
- layout: number;
674
- content: number;
675
- formatting: number;
676
- accessibility: number;
677
- expert: number;
678
- };
679
- }
680
- declare class PPTXValidator {
681
- private typeDetector;
682
- /**
683
- * Validate a set of slides before PPTX generation.
684
- * This validation is MANDATORY - export will fail if score < threshold.
685
- */
686
- validate(slides: Slide[], options: {
687
- mode: 'keynote' | 'business';
688
- presentationType?: PresentationType | undefined;
689
- threshold?: number;
690
- strictMode?: boolean;
691
- }): Promise<PPTXValidationResult>;
692
- /**
693
- * Validate a single slide.
694
- */
695
- private validateSlide;
696
- /**
697
- * Validate cross-slide consistency.
698
- */
699
- private validateCrossSlide;
700
- /**
701
- * Validate against expert methodologies.
702
- */
703
- private validateExpertMethodologies;
704
- /**
705
- * Count words in slide content.
706
- */
707
- private countWords;
708
- /**
709
- * Check if slide has meaningful content.
710
- */
711
- private hasContent;
712
- /**
713
- * Count distinct ideas on a slide.
714
- *
715
- * A slide with ONE idea can still have:
716
- * - A title (the main idea)
717
- * - A keyMessage (reinforcing the same idea)
718
- * - Multiple bullets (supporting evidence for the same idea)
719
- * - Body text (elaborating on the same idea)
720
- *
721
- * Multiple ideas are detected when:
722
- * - There's a quote AND substantial other content (quote should stand alone)
723
- * - The slide has both body AND many bullets (competing content blocks)
724
- * - Title introduces one concept but bullets introduce unrelated concepts
725
- */
726
- private countIdeas;
727
- /**
728
- * Calculate layout score for a slide.
729
- */
730
- private calculateLayoutScore;
731
- /**
732
- * Calculate overall validation score.
733
- */
734
- private calculateScore;
735
- /**
736
- * Build validation summary.
737
- */
738
- private buildSummary;
739
- /**
740
- * Convert PPTX validation result to standard QAResults format.
741
- */
742
- toQAResults(result: PPTXValidationResult, mode: 'keynote' | 'business', presentationType?: PresentationType): QAResults;
743
- private createExpertValidation;
744
- /**
745
- * Generate human-readable validation report.
746
- */
747
- generateReport(result: PPTXValidationResult): string;
283
+ interface KBResult<T> {
284
+ value: T;
285
+ kbPath: string;
748
286
  }
749
-
750
287
  /**
751
- * Auto-Remediation Engine
752
- *
753
- * Instead of blocking on QA failures, this engine automatically fixes issues
754
- * and iterates until the presentation passes quality thresholds.
755
- *
756
- * Philosophy: NEVER fail - always deliver a working, quality presentation.
757
- *
758
- * Remediation strategies:
759
- * - Too many words → Summarize/split slides
760
- * - Poor whitespace → Adjust layout
761
- * - Failed glance test → Shorten titles
762
- * - Too many bullets → Consolidate or split
763
- * - Missing structure → Add required slides
764
- * - Accessibility issues → Fix contrast/font sizes
288
+ * KnowledgeGateway - The ONLY way to access KB data
765
289
  */
766
-
767
- interface RemediationChange {
768
- slideIndex: number;
769
- type: RemediationType;
770
- description: string;
771
- before?: string;
772
- after?: string;
773
- }
774
- type RemediationType = 'word_reduction' | 'slide_split' | 'title_shortening' | 'bullet_consolidation' | 'layout_adjustment' | 'structure_addition' | 'font_size_increase' | 'content_enhancement' | 'whitespace_improvement';
775
- declare class AutoRemediation {
776
- private changes;
777
- private typeDetector;
778
- /**
779
- * Automatically remediate slides until they pass QA.
780
- */
781
- remediate(slides: Slide[], issues: QAIssue[] | PPTXIssue[], options: {
782
- mode: 'keynote' | 'business';
783
- presentationType?: PresentationType | undefined;
784
- targetScore: number;
785
- }): Promise<Slide[]>;
786
- /**
787
- * Get the changes that were applied during remediation.
788
- */
789
- getChanges(): RemediationChange[];
790
- /**
791
- * Remediate word count issues - both too many AND too few words.
792
- */
793
- private remediateWordCount;
794
- /**
795
- * Remediate glance test failures - title too long.
796
- */
797
- private remediateGlanceTest;
798
- /**
799
- * Remediate bullet point issues.
800
- */
801
- private remediateBullets;
802
- /**
803
- * Remediate multiple-ideas-per-slide violations.
804
- * Strategy: Consolidate content to focus on one main idea.
805
- */
806
- private remediateMultipleIdeas;
807
- /**
808
- * Remediate structural issues - missing title slide, conclusion, etc.
809
- */
810
- private remediateStructure;
811
- /**
812
- * Remediate accessibility issues.
813
- */
814
- private remediateAccessibility;
815
- /**
816
- * Enhance a sparse slide by adding substantive content.
817
- * Instead of generic filler, we expand existing content intelligently.
818
- */
819
- private enhanceSparseSlide;
820
- /**
821
- * Group issues by their primary type.
822
- */
823
- private groupIssuesByType;
824
- /**
825
- * Shorten text to approximately N words while preserving meaning.
826
- * CRITICAL: Never truncate mid-sentence - always return complete, meaningful phrases.
827
- */
828
- private shortenText;
829
- /**
830
- * Shorten a title to N words, keeping the key message.
831
- */
832
- private shortenTitle;
833
- /**
834
- * Consolidate bullets by combining related ones.
835
- */
836
- private consolidateBullets;
837
- /**
838
- * Reindex slides after insertion/deletion.
839
- */
840
- private reindexSlides;
841
- /**
842
- * Count words in a slide.
843
- */
844
- private countWords;
845
- /**
846
- * Deep clone slides array.
847
- */
848
- private deepClone;
849
- /**
850
- * Generate remediation report.
851
- */
852
- generateReport(): string;
853
- }
854
-
855
- /**
856
- * Hallucination Detector
857
- *
858
- * Verifies that all facts, statistics, and claims in the presentation
859
- * are sourced from the original content. ZERO TOLERANCE for hallucinations.
860
- *
861
- * Checks:
862
- * - Numbers and statistics must appear in source content
863
- * - Company names must be in source content
864
- * - Dates and timelines must be verifiable
865
- * - Quotes must be exact matches
866
- * - Claims must be supported by source material
867
- *
868
- * Philosophy: If it's not in the source, it shouldn't be in the presentation.
869
- */
870
-
871
- interface FactCheckResult {
872
- passed: boolean;
873
- score: number;
874
- totalFacts: number;
875
- verifiedFacts: number;
876
- unverifiedFacts: number;
877
- issues: FactCheckIssue[];
878
- warnings: FactCheckWarning[];
879
- }
880
- interface FactCheckIssue {
881
- slideIndex: number;
882
- slideTitle: string;
883
- fact: string;
884
- type: 'number' | 'statistic' | 'company' | 'date' | 'quote' | 'claim';
885
- severity: 'error' | 'warning';
886
- message: string;
887
- suggestion: string;
888
- }
889
- interface FactCheckWarning {
890
- slideIndex: number;
891
- message: string;
892
- }
893
- declare class HallucinationDetector {
894
- private numberPattern;
895
- private percentagePattern;
896
- private datePattern;
897
- private companyPattern;
898
- private quotePattern;
899
- private commonWords;
900
- /**
901
- * Check all slides against source content for hallucinations.
902
- */
903
- checkForHallucinations(slides: Slide[], sourceContent: string, analysis: ContentAnalysis): Promise<FactCheckResult>;
904
- /**
905
- * Generate a fact-check report.
906
- */
907
- generateReport(result: FactCheckResult): string;
908
- /**
909
- * Auto-remediate hallucinations by removing unverified facts.
910
- */
911
- remediate(slides: Slide[], result: FactCheckResult): Slide[];
912
- private normalizeText;
913
- private getSlideText;
914
- private extractNumbers;
915
- private extractCompanies;
916
- private extractDates;
917
- private isNumberInSource;
918
- private isCompanyInSource;
919
- private isDateInSource;
920
- private isCommonWord;
921
- private checkForUnsupportedClaims;
922
- private getPlaceholder;
923
- }
924
-
925
- /**
926
- * Presentation Engine - Main Orchestrator
927
- *
928
- * KNOWLEDGE-DRIVEN ARCHITECTURE
929
- *
930
- * This engine now routes ALL decisions through the KnowledgeOrchestrator.
931
- * The RuVector knowledge base IS the application brain.
932
- * This code is just plumbing that executes what the KB dictates.
933
- *
934
- * PHILOSOPHY: NEVER FAIL - ALWAYS DELIVER
935
- *
936
- * Instead of blocking on QA failures, this engine:
937
- * 1. Analyzes content using KB-driven narrative frameworks
938
- * 2. Builds slides using KB-driven expert methodologies
939
- * 3. Validates against 40+ expert principles from the KB
940
- * 4. Applies persuasion psychology from the KB
941
- * 5. Auto-remediates based on KB rules
942
- * 6. ALWAYS delivers a working, world-class presentation
943
- *
944
- * KB INTEGRATION:
945
- * - KnowledgeOrchestrator: Routes ALL decisions through KB
946
- * - NarrativeAnalyzer: Duarte Sparkline, STAR moments, SCQA
947
- * - ExpertValidator: Validates against ALL 40+ experts
948
- * - PersuasionEngine: Cialdini, Kahneman, Heath Brothers
949
- */
950
-
951
- declare class PresentationEngine {
952
- private contentAnalyzer;
953
- private slideFactory;
954
- private templateEngine;
955
- private scoreCalculator;
956
- private typeDetector;
957
- private strategyFactory;
958
- private qaEngine;
959
- private pptxValidator;
960
- private htmlLayoutValidator;
961
- private autoRemediation;
962
- private hallucinationDetector;
963
- private htmlGenerator;
964
- private pptxGenerator;
965
- private orchestrator;
966
- private narrativeAnalyzer;
967
- private expertValidator;
968
- private persuasionEngine;
969
- private kbQueryCount;
970
- constructor();
971
- /**
972
- * Generate a presentation from content.
973
- *
974
- * KNOWLEDGE-DRIVEN GENERATION:
975
- * - ALL decisions route through KnowledgeOrchestrator
976
- * - Narrative analysis via Duarte/Minto frameworks
977
- * - Expert validation against 40+ methodologies
978
- * - Persuasion psychology from Cialdini/Kahneman/Heath
979
- *
980
- * GUARANTEED DELIVERY:
981
- * - Validates presentation quality against KB rules
982
- * - Automatically fixes any issues found using KB guidance
983
- * - Iterates until quality threshold is met
984
- * - ALWAYS returns a working, world-class presentation
985
- *
986
- * @param config - Presentation configuration
987
- * @returns Presentation result with outputs, QA results, and score
988
- */
989
- generate(config: PresentationConfig): Promise<PresentationResult>;
990
- /**
991
- * Validate slides and automatically remediate until they pass.
992
- * Includes hallucination detection to ensure all facts are sourced.
993
- */
994
- private validateAndRemediate;
995
- /**
996
- * Validate presentation configuration.
997
- */
998
- private validateConfig;
999
- /**
1000
- * Count words in a slide.
1001
- */
1002
- private countWords;
1003
- /**
1004
- * Build presentation metadata.
1005
- */
1006
- private buildMetadata;
1007
- /**
1008
- * Detect which expert frameworks were applied.
1009
- */
1010
- private detectFrameworks;
1011
- /**
1012
- * Get QA Engine for external access.
1013
- */
1014
- getQAEngine(): QAEngine;
1015
- /**
1016
- * Get PPTX Validator for external access.
1017
- */
1018
- getPPTXValidator(): PPTXValidator;
1019
- /**
1020
- * Get Score Calculator for external access.
1021
- */
1022
- getScoreCalculator(): ScoreCalculator;
1023
- /**
1024
- * Get Auto Remediation for external access.
1025
- */
1026
- getAutoRemediation(): AutoRemediation;
1027
- /**
1028
- * Get Hallucination Detector for external access.
1029
- */
1030
- getHallucinationDetector(): HallucinationDetector;
1031
- }
1032
-
1033
- /**
1034
- * Content Analyzer - Extracts Structure AND Data from Raw Content
1035
- *
1036
- * Uses expert methodologies to analyze content and extract:
1037
- * - SCQA structure (Barbara Minto)
1038
- * - Sparkline narrative arc (Nancy Duarte)
1039
- * - Key messages (Rule of Three)
1040
- * - STAR moments
1041
- * - Action titles
1042
- * - **NEW**: Actual data points, metrics, financial figures
1043
- * - **NEW**: Section content with bullets
1044
- * - **NEW**: Comparison data
1045
- */
1046
-
1047
- declare class ContentAnalyzer {
1048
- private readonly situationSignals;
1049
- private readonly complicationSignals;
1050
- private readonly questionSignals;
1051
- private readonly answerSignals;
1052
- private readonly whatIsSignals;
1053
- private readonly whatCouldBeSignals;
1054
- /**
1055
- * Analyze content and extract structural elements AND data.
1056
- */
1057
- analyze(content: string, contentType: string): Promise<ContentAnalysis>;
1058
- /**
1059
- * Parse content and extract structured sections.
1060
- */
1061
- private parseContentStructured;
1062
- /**
1063
- * Parse markdown and extract structured sections with content.
1064
- */
1065
- private parseMarkdownStructured;
1066
- /**
1067
- * Extract markdown tables from content lines.
1068
- * Per RuVector knowledge base (Cole Nussbaumer Knaflic):
1069
- * Tables are for leave-behinds, keep minimal design.
1070
- */
1071
- private extractTablesFromLines;
1072
- /**
1073
- * Remove table markdown lines from content to prevent raw text display.
1074
- * Lines that are part of tables (start and end with |, or are separator lines).
1075
- */
1076
- private removeTableLinesFromContent;
1077
- /**
1078
- * Extract bullet points from content lines.
1079
- */
1080
- private extractBulletsFromLines;
1081
- /**
1082
- * Extract ALL data points from content.
1083
- */
1084
- private extractAllDataPoints;
1085
- /**
1086
- * Extract data points from a specific text block.
1087
- */
1088
- private extractDataPointsFromText;
1089
- /**
1090
- * Get context around a match.
1091
- */
1092
- private getContext;
1093
- /**
1094
- * Parse numeric value from string.
1095
- */
1096
- private parseNumericValue;
1097
- /**
1098
- * Detect trend from context.
1099
- */
1100
- private detectTrend;
1101
- /**
1102
- * Extract a label for the data point from context.
1103
- */
1104
- private extractLabel;
1105
- /**
1106
- * Extract financial summary from content.
1107
- */
1108
- private extractFinancialSummary;
1109
- /**
1110
- * Extract comparison data (year-over-year, before/after).
1111
- */
1112
- private extractComparisons;
1113
- /**
1114
- * Extract SCQA structure from sections and content.
1115
- */
1116
- private extractSCQA;
1117
- /**
1118
- * Extract first meaningful sentence from text.
1119
- */
1120
- private extractFirstMeaningfulSentence;
1121
- /**
1122
- * Extract Sparkline structure.
1123
- */
1124
- private extractSparkline;
1125
- /**
1126
- * Extract key messages from actual content.
1127
- */
1128
- private extractKeyMessages;
1129
- /**
1130
- * Generate action titles from key insights.
1131
- */
1132
- private generateActionTitles;
1133
- /**
1134
- * Transform a statement into an action title.
1135
- */
1136
- private transformToActionTitle;
1137
- /**
1138
- * Identify STAR moments (dramatic/memorable points).
1139
- */
1140
- private identifyStarMoments;
1141
- /**
1142
- * Estimate slide count based on content.
1143
- */
1144
- private estimateSlideCount;
1145
- private parseJSON;
1146
- private parseYAML;
1147
- private flattenObject;
1148
- private splitIntoParagraphs;
1149
- private splitIntoSentences;
1150
- private containsSignals;
1151
- private truncateToSentence;
1152
- private truncateToWords;
1153
- private capitalizeFirst;
1154
- private cleanText;
1155
- private isActionTitle;
1156
- }
1157
-
1158
- /**
1159
- * Slide Factory - Creates Slides from Content Analysis
1160
- *
1161
- * Generates slide structures based on:
1162
- * - Presentation mode (keynote vs business)
1163
- * - Presentation type (7 specialized strategies)
1164
- * - Content analysis results
1165
- * - Expert methodology recommendations
1166
- */
1167
-
1168
- declare class SlideFactory {
1169
- private readonly templates;
1170
- private readonly strategyFactory;
1171
- constructor();
1172
- /**
1173
- * Create slides from analyzed content.
1174
- * If presentationType is provided, uses the specialized strategy.
1175
- * Otherwise, falls back to mode-based generation.
1176
- */
1177
- createSlides(analysis: ContentAnalysis, mode: PresentationMode, presentationType?: PresentationType): Promise<Slide[]>;
1178
- /**
1179
- * Create a title slide.
1180
- */
1181
- private createTitleSlide;
1182
- /**
1183
- * Create an agenda slide.
1184
- */
1185
- private createAgendaSlide;
1186
- /**
1187
- * Create a context/situation slide.
1188
- */
1189
- private createContextSlide;
1190
- /**
1191
- * Create a problem/complication slide.
1192
- */
1193
- private createProblemSlide;
1194
- /**
1195
- * Create a key message slide.
1196
- */
1197
- private createMessageSlide;
1198
- /**
1199
- * Create a STAR moment slide.
1200
- */
1201
- private createStarMomentSlide;
1202
- /**
1203
- * Create a solution/answer slide.
1204
- */
1205
- private createSolutionSlide;
1206
- /**
1207
- * Create a call-to-action slide.
1208
- */
1209
- private createCTASlide;
1210
- /**
1211
- * Create a thank you slide.
1212
- */
1213
- private createThankYouSlide;
1214
- /**
1215
- * Initialize slide templates with constraints.
1216
- */
1217
- private initializeTemplates;
1218
- /**
1219
- * Truncate text to max length at word boundary.
1220
- */
1221
- private truncate;
1222
- /**
1223
- * Extract an action title from a message.
1224
- */
1225
- private extractActionTitle;
1226
- /**
1227
- * Extract bullet points from text.
1228
- */
1229
- private extractBullets;
1230
- /**
1231
- * Remove a statistic from text.
1232
- */
1233
- private removeStatistic;
1234
- }
1235
-
1236
- /**
1237
- * Template Engine - Handlebars Template Rendering
1238
- *
1239
- * Renders slide data into HTML using Handlebars templates.
1240
- * Supports custom templates and helper functions.
1241
- */
1242
-
1243
- interface TemplateConfig {
1244
- customTemplates?: Record<string, string>;
1245
- theme?: ThemeName;
1246
- }
1247
- declare class TemplateEngine {
1248
- private handlebars;
1249
- private templates;
1250
- private partials;
1251
- constructor();
1252
- /**
1253
- * Render a slide to HTML.
1254
- */
1255
- render(slide: Slide, config?: TemplateConfig): string;
1256
- /**
1257
- * Render multiple slides.
1258
- */
1259
- renderAll(slides: Slide[], config?: TemplateConfig): string[];
1260
- /**
1261
- * Prepare template context with computed properties.
1262
- */
1263
- private prepareContext;
1264
- /**
1265
- * Build CSS class list for slide.
1266
- */
1267
- private buildClassList;
1268
- /**
1269
- * Build inline style string.
1270
- */
1271
- private buildStyleString;
1272
- /**
1273
- * Register Handlebars helpers.
1274
- */
1275
- private registerHelpers;
1276
- /**
1277
- * Register reusable partials.
1278
- */
1279
- private registerPartials;
1280
- /**
1281
- * Compile built-in templates.
1282
- */
1283
- private compileTemplates;
1284
- /**
1285
- * Render fallback for unknown slide types.
1286
- */
1287
- private renderFallback;
1288
- /**
1289
- * Convert camelCase to kebab-case.
1290
- */
1291
- private kebabCase;
1292
- }
1293
-
1294
- /**
1295
- * Accessibility Validator - WCAG Compliance Testing
1296
- *
1297
- * Provides comprehensive accessibility validation using:
1298
- * - Axe-core for automated WCAG testing
1299
- * - Custom contrast ratio validation
1300
- * - Font size compliance
1301
- * - Keyboard navigation coverage
1302
- * - Color-blind safety checks
1303
- *
1304
- * MANDATORY: All presentations must meet WCAG AA minimum.
1305
- */
1306
-
1307
- interface A11yValidationResult {
1308
- passed: boolean;
1309
- wcagLevel: 'A' | 'AA' | 'AAA' | 'FAIL';
1310
- score: number;
1311
- issues: A11yIssue[];
1312
- axeResults?: AxeResult[];
1313
- contrastIssues: ContrastIssue[];
1314
- fontSizeIssues: FontSizeIssue[];
1315
- keyboardIssues: KeyboardIssue[];
1316
- colorBlindSafe: boolean;
1317
- }
1318
- interface A11yIssue {
1319
- severity: 'critical' | 'serious' | 'moderate' | 'minor';
1320
- type: 'contrast' | 'font-size' | 'keyboard' | 'aria' | 'structure' | 'color';
1321
- slideIndex?: number;
1322
- element?: string;
1323
- message: string;
1324
- wcagCriteria?: string;
1325
- suggestion?: string;
1326
- }
1327
- interface AxeResult {
1328
- id: string;
1329
- impact: 'critical' | 'serious' | 'moderate' | 'minor';
1330
- description: string;
1331
- nodes: number;
1332
- }
1333
- interface KeyboardIssue {
1334
- slideIndex: number;
1335
- element: string;
1336
- issue: string;
1337
- }
1338
- declare class AccessibilityValidator {
1339
- private browser;
1340
- /**
1341
- * Validate accessibility of an HTML presentation.
1342
- */
1343
- validate(html: string, options?: {
1344
- targetLevel?: 'A' | 'AA' | 'AAA';
1345
- projectionMode?: boolean;
1346
- }): Promise<A11yValidationResult>;
1347
- /**
1348
- * Check color contrast compliance.
1349
- */
1350
- private checkContrast;
1351
- /**
1352
- * Check font size compliance.
1353
- */
1354
- private checkFontSizes;
1355
- /**
1356
- * Check keyboard navigation accessibility.
1357
- */
1358
- private checkKeyboardNavigation;
1359
- /**
1360
- * Check document structure accessibility.
1361
- */
1362
- private checkStructure;
1363
- /**
1364
- * Check color-blind safety.
1365
- */
1366
- private checkColorBlindSafety;
1367
- /**
1368
- * Calculate contrast ratio between two colors.
1369
- */
1370
- private calculateContrastRatio;
1371
- /**
1372
- * Calculate relative luminance of a color.
1373
- */
1374
- private getRelativeLuminance;
1375
- /**
1376
- * Determine WCAG compliance level.
1377
- */
1378
- private determineWCAGLevel;
1379
- /**
1380
- * Calculate accessibility score.
1381
- */
1382
- private calculateScore;
1383
- /**
1384
- * Generate accessibility report.
1385
- */
1386
- generateReport(result: A11yValidationResult): string;
1387
- private initBrowser;
1388
- private closeBrowser;
1389
- }
1390
-
1391
- /**
1392
- * HTML Layout Validator - Bulletproof Viewport Enforcement
1393
- *
1394
- * This validator TESTS rendered HTML presentations to VERIFY:
1395
- * 1. No content overflows the slide boundaries
1396
- * 2. All text is readable (not clipped)
1397
- * 3. All elements fit within the viewport
1398
- * 4. No horizontal scrolling is needed
1399
- *
1400
- * PHILOSOPHY: VERIFY, DON'T GUESS
1401
- * - Uses Playwright to actually render the presentation
1402
- * - Measures real DOM elements
1403
- * - Checks computed styles
1404
- * - Takes screenshots as evidence
1405
- *
1406
- * THIS IS MANDATORY - No HTML export without passing layout validation
1407
- */
1408
- interface LayoutValidationResult {
1409
- passed: boolean;
1410
- score: number;
1411
- issues: LayoutIssue[];
1412
- perSlide: SlideLayoutResult[];
1413
- screenshots?: Buffer[];
1414
- }
1415
- interface LayoutIssue {
1416
- severity: 'error' | 'warning' | 'info';
1417
- slideIndex: number;
1418
- element?: string;
1419
- message: string;
1420
- suggestion: string;
1421
- measurements?: {
1422
- elementWidth?: number;
1423
- elementHeight?: number;
1424
- viewportWidth?: number;
1425
- viewportHeight?: number;
1426
- overflow?: {
1427
- x: number;
1428
- y: number;
1429
- };
1430
- };
1431
- }
1432
- interface SlideLayoutResult {
1433
- slideIndex: number;
1434
- passed: boolean;
1435
- score: number;
1436
- issues: LayoutIssue[];
1437
- measurements: {
1438
- contentHeight: number;
1439
- viewportHeight: number;
1440
- contentWidth: number;
1441
- viewportWidth: number;
1442
- overflowY: number;
1443
- overflowX: number;
1444
- hasScrollbar: boolean;
1445
- clippedElements: string[];
1446
- };
1447
- }
1448
- declare class HTMLLayoutValidator {
1449
- private playwright;
1450
- /**
1451
- * Validate HTML presentation layout using real browser rendering.
1452
- * This is the MANDATORY check before any HTML export.
1453
- */
1454
- validate(html: string): Promise<LayoutValidationResult>;
1455
- /**
1456
- * Validate a single slide's layout using Playwright.
1457
- */
1458
- private validateSlide;
1459
- /**
1460
- * Static HTML analysis fallback when Playwright isn't available.
1461
- * Analyzes CSS and HTML structure without rendering.
1462
- */
1463
- private validateStaticHTML;
1464
- /**
1465
- * Generate remediation suggestions for layout issues.
1466
- */
1467
- generateRemediationPlan(result: LayoutValidationResult): string[];
1468
- }
1469
-
1470
- /**
1471
- * Semantic Completeness Validator
1472
- *
1473
- * Ensures generated presentations retain the key concepts and topics
1474
- * from the original source content. This prevents loss of critical
1475
- * information during summarization/remediation.
1476
- *
1477
- * Key capabilities:
1478
- * - Extract key topics/concepts from source content
1479
- * - Compare source concepts against generated slides
1480
- * - Flag missing topics that should be covered
1481
- * - Provide coverage score (0-100)
1482
- */
1483
-
1484
- interface SemanticCompletenessResult {
1485
- /** Coverage score (0-100) - percentage of source concepts found in output */
1486
- coverageScore: number;
1487
- /** Key concepts extracted from source content */
1488
- sourceConcepts: ExtractedConcept[];
1489
- /** Concepts that were found in the generated slides */
1490
- foundConcepts: ExtractedConcept[];
1491
- /** Concepts that were NOT found - potential content loss */
1492
- missingConcepts: ExtractedConcept[];
1493
- /** Whether semantic completeness passed (score >= threshold) */
1494
- passed: boolean;
1495
- /** Detailed issues */
1496
- issues: SemanticIssue[];
1497
- }
1498
- interface ExtractedConcept {
1499
- /** The concept text (normalized) */
1500
- text: string;
1501
- /** Importance weight (1-10) based on context */
1502
- importance: number;
1503
- /** Category: heading, metric, key_term, entity, action */
1504
- category: 'heading' | 'metric' | 'key_term' | 'entity' | 'action';
1505
- /** Original text before normalization */
1506
- original: string;
1507
- /** Was it found in the output? */
1508
- found?: boolean;
1509
- /** Where it was found (slide indices) */
1510
- foundIn?: number[];
1511
- }
1512
- interface SemanticIssue {
1513
- severity: 'error' | 'warning' | 'info';
1514
- category: 'semantic_completeness';
1515
- message: string;
1516
- missingConcept?: string;
1517
- importance?: number;
1518
- suggestion?: string;
1519
- }
1520
- declare class SemanticCompletenessValidator {
1521
- /** Minimum coverage score to pass (default: 70%) */
1522
- private threshold;
1523
- constructor(threshold?: number);
1524
- /**
1525
- * Validate that generated slides contain the key concepts from source content.
1526
- */
1527
- validate(sourceContent: string, generatedSlides: Slide[]): SemanticCompletenessResult;
1528
- /**
1529
- * Extract key concepts from source content using NLP-like heuristics.
1530
- */
1531
- private extractConcepts;
1532
- /**
1533
- * Extract all text content from generated slides.
1534
- */
1535
- private extractSlideText;
1536
- /**
1537
- * Find a concept in the generated slides using fuzzy matching.
1538
- */
1539
- private findConceptInSlides;
1540
- /**
1541
- * Generate search variations for fuzzy matching.
1542
- */
1543
- private generateSearchVariations;
1544
- /**
1545
- * Normalize text for comparison.
1546
- */
1547
- private normalize;
1548
- /**
1549
- * Generate issues for missing concepts.
1550
- */
1551
- private generateIssues;
1552
- /**
1553
- * Get a human-readable summary of the validation.
1554
- */
1555
- getSummary(result: SemanticCompletenessResult): string;
1556
- }
1557
-
1558
- /**
1559
- * VisionQAEngine - AI-Driven Qualitative Visual Assessment
1560
- *
1561
- * Unlike rules-based QA (word counts, whitespace %), this engine uses
1562
- * Claude's multimodal capabilities to perform actual design quality assessment.
1563
- *
1564
- * Purpose: Stop giving 99/100 to presentations that look terrible.
1565
- *
1566
- * Features:
1567
- * - Per-slide visual analysis using Claude Vision
1568
- * - Presentation-level consistency and narrative assessment
1569
- * - Critical issue detection (raw markdown, broken images, empty slides)
1570
- * - Type-specific standards (TED vs consulting vs investment banking)
1571
- *
1572
- * @module VisionQAEngine
1573
- */
1574
-
1575
- interface SlideVisionAnalysis {
1576
- slideIndex: number;
1577
- scores: {
1578
- typography_hierarchy: number;
1579
- layout_balance: number;
1580
- color_harmony: number;
1581
- professional_polish: number;
1582
- message_clarity: number;
1583
- content_density: number;
1584
- visual_support: number;
1585
- narrative_flow: number;
1586
- };
1587
- overallScore: number;
1588
- criticalIssues: string[];
1589
- suggestions: string[];
1590
- pass: boolean;
1591
- rawResponse?: string | undefined;
1592
- }
1593
- interface PresentationVisionAnalysis {
1594
- slideAnalyses: SlideVisionAnalysis[];
1595
- presentationLevel: {
1596
- visual_consistency: number;
1597
- story_arc: number;
1598
- memorable_moments: number;
1599
- professional_quality: number;
1600
- };
1601
- overallScore: number;
1602
- weakSlides: number[];
1603
- strongSlides: number[];
1604
- criticalIssues: string[];
1605
- pass: boolean;
1606
- verdict: string;
1607
- }
1608
- interface VisionQAConfig {
1609
- /** Enable verbose logging */
1610
- verbose?: boolean;
1611
- /** Anthropic API key (defaults to ANTHROPIC_API_KEY env var) */
1612
- apiKey?: string;
1613
- /** Model to use for vision analysis */
1614
- model?: string;
1615
- /** Skip individual slide analysis (faster, overview only) */
1616
- overviewOnly?: boolean;
1617
- /** Maximum slides to analyze (for large decks) */
1618
- maxSlides?: number;
1619
- /** Minimum score required to pass (0-10 scale) */
1620
- passThreshold?: number;
1621
- }
1622
- declare class VisionQAEngine {
1623
- private client;
1624
- private kb;
1625
- private config;
1626
- constructor(config?: VisionQAConfig);
1627
- /**
1628
- * Initialize the engine (lazy - only when needed)
1629
- */
1630
- private initialize;
1631
- /**
1632
- * Analyze a single slide screenshot using Claude Vision
1633
- */
1634
- analyzeSlide(screenshot: Buffer, slideIndex: number, totalSlides: number, presentationType: PresentationType, slideType?: string): Promise<SlideVisionAnalysis>;
1635
- /**
1636
- * Analyze the full presentation using Claude Vision
1637
- */
1638
- analyzePresentationOverview(screenshots: Buffer[], presentationType: PresentationType, title: string): Promise<{
1639
- visual_consistency: number;
1640
- story_arc: number;
1641
- memorable_moments: number;
1642
- professional_quality: number;
1643
- overall_score: number;
1644
- weak_slides: number[];
1645
- strong_slides: number[];
1646
- critical_issues: string[];
1647
- pass: boolean;
1648
- verdict: string;
1649
- }>;
1650
- /**
1651
- * Run full vision QA analysis on a presentation
1652
- */
1653
- analyze(screenshots: Buffer[], presentationType: PresentationType, title: string, slideTypes?: string[]): Promise<PresentationVisionAnalysis>;
1654
- /**
1655
- * Convert vision analysis results to QA issues format
1656
- */
1657
- toQAIssues(analysis: PresentationVisionAnalysis): QAIssue[];
1658
- /**
1659
- * Calculate a QA score (0-100) from vision analysis
1660
- */
1661
- toQAScore(analysis: PresentationVisionAnalysis): number;
1662
- }
1663
- /**
1664
- * Get or create the VisionQAEngine singleton
1665
- */
1666
- declare function getVisionQAEngine(config?: VisionQAConfig): VisionQAEngine;
1667
- /**
1668
- * Create a new VisionQAEngine instance (non-singleton)
1669
- */
1670
- declare function createVisionQAEngine(config?: VisionQAConfig): VisionQAEngine;
1671
-
1672
- /**
1673
- * ConsensusValidator - Multi-Agent Consensus Validation
1674
- *
1675
- * Combines multiple validation perspectives to provide rigorous QA:
1676
- * - Rules-based validation (QAEngine)
1677
- * - AI vision-based assessment (VisionQAEngine)
1678
- * - Expert methodology validators (Duarte, Reynolds, Minto, etc.)
1679
- * - Presentation type-specific validators
1680
- *
1681
- * The consensus approach ensures:
1682
- * 1. No single validator can inflate scores artificially
1683
- * 2. Critical issues are caught across multiple perspectives
1684
- * 3. Type-specific standards are enforced
1685
- *
1686
- * @module ConsensusValidator
1687
- */
1688
-
1689
- /** Expert agent persona for validation */
1690
- type ExpertAgent = 'duarte' | 'reynolds' | 'minto' | 'tufte' | 'gallo' | 'anderson';
1691
- /** Individual agent's assessment */
1692
- interface AgentAssessment {
1693
- agent: ExpertAgent;
1694
- score: number;
1695
- passed: boolean;
1696
- criticalIssues: string[];
1697
- suggestions: string[];
1698
- verdict: string;
1699
- }
1700
- /** Consensus result from all agents */
1701
- interface ConsensusResult {
1702
- /** Individual agent assessments */
1703
- agentAssessments: AgentAssessment[];
1704
- /** Rules-based QA score (from QAEngine) */
1705
- rulesScore: number;
1706
- /** Vision AI assessment score (from VisionQAEngine) */
1707
- visionScore: number;
1708
- /** Vision analysis details (if available) */
1709
- visionAnalysis?: PresentationVisionAnalysis;
1710
- /** Final consensus score (weighted average) */
1711
- consensusScore: number;
1712
- /** All critical issues across validators */
1713
- criticalIssues: string[];
1714
- /** Aggregated suggestions */
1715
- suggestions: string[];
1716
- /** Pass/fail based on consensus */
1717
- passed: boolean;
1718
- /** Human-readable verdict */
1719
- verdict: string;
1720
- /** Confidence level (how much agreement between validators) */
1721
- confidence: 'high' | 'medium' | 'low';
1722
- /** Detailed breakdown by category */
1723
- breakdown: {
1724
- visual: number;
1725
- content: number;
1726
- structure: number;
1727
- methodology: number;
1728
- };
1729
- }
1730
- /** Configuration for consensus validation */
1731
- interface ConsensusConfig {
1732
- /** Enable verbose logging */
1733
- verbose?: boolean;
1734
- /** Anthropic API key (for vision analysis) */
1735
- apiKey?: string;
1736
- /** Enable vision-based AI assessment */
1737
- enableVision?: boolean;
1738
- /** Agents to include (default: all) */
1739
- agents?: ExpertAgent[];
1740
- /** Minimum agreement threshold (0-1, default: 0.6) */
1741
- agreementThreshold?: number;
1742
- /** Weights for final score calculation */
1743
- weights?: {
1744
- rules?: number;
1745
- vision?: number;
1746
- agents?: number;
1747
- };
1748
- /** Presentation type for specialized validation */
1749
- presentationType?: PresentationType;
1750
- }
1751
- declare class ConsensusValidator {
1752
- private client;
1753
- private visionEngine;
1754
- private kb;
1755
- private config;
1756
- constructor(config?: ConsensusConfig);
1757
- /**
1758
- * Initialize the validator (lazy - only when needed)
1759
- */
1760
- private initialize;
1761
- /**
1762
- * Run full consensus validation
1763
- */
1764
- validate(html: string, screenshots: Buffer[], rulesQAResults: QAResults, presentationType: PresentationType, title: string): Promise<ConsensusResult>;
1765
- /**
1766
- * Run all expert agents in parallel
1767
- */
1768
- private runExpertAgents;
1769
- /**
1770
- * Filter agents relevant to presentation type
1771
- */
1772
- private filterAgentsForType;
1773
- /**
1774
- * Run a single expert agent assessment
1775
- */
1776
- private runSingleAgent;
1777
- /**
1778
- * Build context for agent assessment
1779
- */
1780
- private buildAgentContext;
1781
- /**
1782
- * Sample screenshots evenly
1783
- */
1784
- private sampleScreenshots;
1785
- /**
1786
- * Calculate rules-based score
1787
- */
1788
- private calculateRulesScore;
1789
- private calculateVisualSubscore;
1790
- private calculateContentSubscore;
1791
- /**
1792
- * Calculate final consensus from all validators
1793
- */
1794
- private calculateConsensus;
1795
- /**
1796
- * Generate human-readable verdict
1797
- */
1798
- private generateVerdict;
1799
- /**
1800
- * Calculate standard deviation
1801
- */
1802
- private calculateStdDev;
1803
- /**
1804
- * Convert consensus result to QA issues format
1805
- */
1806
- toQAIssues(result: ConsensusResult): QAIssue[];
1807
- }
1808
- /**
1809
- * Get or create the ConsensusValidator singleton
1810
- */
1811
- declare function getConsensusValidator(config?: ConsensusConfig): ConsensusValidator;
1812
- /**
1813
- * Create a new ConsensusValidator instance (non-singleton)
1814
- */
1815
- declare function createConsensusValidator(config?: ConsensusConfig): ConsensusValidator;
1816
-
1817
- /**
1818
- * Presentation Type Detector
1819
- *
1820
- * Determines the appropriate presentation type based on:
1821
- * 1. Explicit presentationType configuration
1822
- * 2. Audience specification
1823
- * 3. Goal specification
1824
- * 4. Keyword analysis of content
1825
- * 5. Legacy mode fallback
1826
- *
1827
- * Each presentation type has distinct validation rules that do not conflict.
1828
- */
1829
-
1830
- /**
1831
- * Validation rules for each presentation type
1832
- */
1833
- declare const PRESENTATION_TYPE_RULES: Record<PresentationType, PresentationTypeRules>;
1834
- declare class TypeDetector {
1835
- /**
1836
- * Detect the presentation type from configuration.
1837
- * Priority:
1838
- * 1. Explicit presentationType
1839
- * 2. Audience mapping
1840
- * 3. Goal mapping
1841
- * 4. Content keyword analysis
1842
- * 5. Legacy mode fallback
1843
- */
1844
- detectType(config: PresentationConfig): PresentationType;
1845
- /**
1846
- * Detect presentation type from keyword analysis.
1847
- */
1848
- private detectFromKeywords;
1849
- /**
1850
- * Get validation rules for a presentation type.
1851
- */
1852
- getRules(type: PresentationType): PresentationTypeRules;
1853
- /**
1854
- * Get all available presentation types.
1855
- */
1856
- getAvailableTypes(): PresentationType[];
1857
- /**
1858
- * Map legacy mode to a presentation type.
1859
- */
1860
- modeToType(mode: 'keynote' | 'business'): PresentationType;
1861
- /**
1862
- * Map presentation type back to legacy mode for compatibility.
1863
- */
1864
- typeToMode(type: PresentationType): 'keynote' | 'business';
1865
- /**
1866
- * Get word limits for a presentation type.
1867
- */
1868
- getWordLimits(type: PresentationType): {
1869
- min: number;
1870
- max: number;
1871
- ideal: number;
1872
- };
1873
- /**
1874
- * Check if action titles are required for a type.
1875
- */
1876
- requiresActionTitles(type: PresentationType): boolean;
1877
- /**
1878
- * Check if sources are required for a type.
1879
- */
1880
- requiresSources(type: PresentationType): boolean;
1881
- /**
1882
- * Get scoring weights for a presentation type.
1883
- */
1884
- getScoringWeights(type: PresentationType): {
1885
- visual_quality: number;
1886
- content_quality: number;
1887
- expert_compliance: number;
1888
- accessibility: number;
1889
- };
1890
- }
1891
-
1892
- /**
1893
- * Execution Strategy Types
1894
- *
1895
- * Types for the presentation execution strategy system.
1896
- */
1897
-
1898
- /**
1899
- * A blueprint for a single slide in a presentation.
1900
- */
1901
- interface SlideBlueprint {
1902
- /** Unique identifier for this slide in the sequence */
1903
- id: string;
1904
- /** Human-readable name */
1905
- name: string;
1906
- /** Slide type to use */
1907
- type: SlideType;
1908
- /** Is this slide required or optional? */
1909
- required: boolean;
1910
- /** Purpose of this slide (for content guidance) */
1911
- purpose: string;
1912
- /** Data fields this slide needs */
1913
- requiredData: string[];
1914
- /** Optional data fields */
1915
- optionalData: string[];
1916
- /** Word count constraints */
1917
- wordLimits: {
1918
- min: number;
1919
- max: number;
1920
- ideal: number;
1921
- };
1922
- /** Expert principles that apply to this slide */
1923
- expertPrinciples: string[];
1924
- /** Visual design notes */
1925
- designNotes: string[];
1926
- /** Example content (for guidance) */
1927
- example?: {
1928
- title?: string;
1929
- subtitle?: string;
1930
- bullets?: string[];
1931
- body?: string;
1932
- };
1933
- }
1934
- /**
1935
- * A content transformation rule.
1936
- */
1937
- interface ContentTransform {
1938
- /** What to look for in the source content */
1939
- sourcePattern: string | RegExp;
1940
- /** How to transform it */
1941
- transform: (match: string, analysis: ContentAnalysis) => string;
1942
- /** Description of the transformation */
1943
- description: string;
1944
- }
1945
- /**
1946
- * An execution strategy for a presentation type.
1947
- */
1948
- interface ExecutionStrategy {
1949
- /** Presentation type this strategy is for */
1950
- type: PresentationType;
1951
- /** Human-readable name */
1952
- name: string;
1953
- /** Description */
1954
- description: string;
1955
- /** Expert methodologies to apply */
1956
- experts: {
1957
- primary: string;
1958
- secondary: string[];
1959
- };
1960
- /** The slide sequence (ordered list of blueprints) */
1961
- slideSequence: SlideBlueprint[];
1962
- /** Content transformation rules */
1963
- contentTransforms: ContentTransform[];
1964
- /** Quality benchmarks */
1965
- qualityBenchmarks: {
1966
- minScore: number;
1967
- criticalChecks: string[];
1968
- excellenceIndicators: string[];
1969
- };
1970
- /**
1971
- * Generate slides from content analysis.
1972
- */
1973
- generateSlides(analysis: ContentAnalysis): Promise<Slide[]>;
1974
- /**
1975
- * Validate slides against this strategy's requirements.
1976
- */
1977
- validateSlides(slides: Slide[]): {
1978
- passed: boolean;
1979
- score: number;
1980
- issues: string[];
1981
- suggestions: string[];
1982
- };
1983
- /**
1984
- * Apply expert methodology transformations.
1985
- */
1986
- applyExpertMethodology(slides: Slide[]): Slide[];
1987
- }
1988
-
1989
- /**
1990
- * Strategy Factory
1991
- *
1992
- * Selects the appropriate execution strategy based on presentation type.
1993
- * Each strategy encapsulates world-class expertise for its domain.
1994
- */
1995
-
1996
- /**
1997
- * Factory for creating presentation execution strategies.
1998
- */
1999
- declare class StrategyFactory {
2000
- private strategies;
2001
- constructor();
2002
- /**
2003
- * Get the execution strategy for a presentation type.
2004
- */
2005
- getStrategy(type: PresentationType): ExecutionStrategy;
2006
- /**
2007
- * Get all available strategies.
2008
- */
2009
- getAllStrategies(): ExecutionStrategy[];
2010
- /**
2011
- * Get strategy descriptions for user guidance.
2012
- */
2013
- getStrategyDescriptions(): Record<PresentationType, string>;
2014
- /**
2015
- * Get the primary expert for a presentation type.
2016
- */
2017
- getPrimaryExpert(type: PresentationType): string;
2018
- /**
2019
- * Get all experts for a presentation type.
2020
- */
2021
- getAllExperts(type: PresentationType): string[];
2022
- }
2023
-
2024
- /**
2025
- * Reveal.js Generator - HTML Presentation Output
2026
- *
2027
- * Generates complete Reveal.js presentations with:
2028
- * - Responsive layouts
2029
- * - Animations
2030
- * - Speaker notes
2031
- * - Custom themes
2032
- * - Chart.js integration
2033
- * - Mermaid diagrams
2034
- */
2035
-
2036
- declare class RevealJsGenerator {
2037
- private templateEngine;
2038
- private defaultRevealConfig;
2039
- constructor();
2040
- /**
2041
- * Generate complete Reveal.js HTML presentation.
2042
- */
2043
- generate(slides: Slide[], config: PresentationConfig): Promise<string>;
2044
- /**
2045
- * Build the complete HTML document.
2046
- */
2047
- private buildDocument;
2048
- /**
2049
- * Get base styles for slides.
2050
- *
2051
- * BULLETPROOF OVERFLOW PROTECTION:
2052
- * 1. All slides use height: 100vh to match viewport exactly
2053
- * 2. overflow: hidden on slide sections clips content at boundaries
2054
- * 3. All child elements use flex-shrink: 1 and min-height: 0 to allow shrinking
2055
- * 4. Tables use max-height with overflow: auto for scrolling if needed
2056
- * 5. Two-column layouts use smaller font sizes to prevent overflow
2057
- */
2058
- private getBaseStyles;
2059
- /**
2060
- * Get theme-specific styles.
2061
- */
2062
- private getThemeStyles;
2063
- /**
2064
- * Get animation styles.
2065
- */
2066
- private getAnimationStyles;
2067
- /**
2068
- * Escape HTML entities.
2069
- */
2070
- private escapeHtml;
2071
- /**
2072
- * Basic HTML minification.
2073
- */
2074
- private minifyHtml;
2075
- /**
2076
- * Get theme variables based on presentation type.
2077
- * Returns color scheme and typography for each type.
2078
- */
2079
- private getTypeThemeVars;
2080
- }
2081
-
2082
- /**
2083
- * PowerPoint Generator - PPTX Presentation Output
2084
- *
2085
- * Generates PowerPoint presentations using PptxGenJS with:
2086
- * - Professional layouts
2087
- * - Embedded charts
2088
- * - Images
2089
- * - Consistent styling
2090
- */
2091
-
2092
- type PptxSlide = ReturnType<PptxGenJS['addSlide']>;
2093
- declare const COLORS: {
2094
- primary: string;
2095
- secondary: string;
2096
- accent: string;
2097
- highlight: string;
2098
- white: string;
2099
- lightGray: string;
2100
- };
2101
- declare class PowerPointGenerator {
2102
- private chartProvider;
2103
- /**
2104
- * Generate a PowerPoint presentation.
2105
- */
2106
- generate(slides: Slide[], config: PresentationConfig): Promise<Buffer>;
2107
- /**
2108
- * Add a slide to the presentation.
2109
- */
2110
- private addSlide;
2111
- /**
2112
- * Add title slide with professional gradient background.
2113
- */
2114
- private addTitleSlide;
2115
- /**
2116
- * Add big idea / single statement slide.
2117
- */
2118
- private addBigIdeaSlide;
2119
- /**
2120
- * Add big number slide.
2121
- */
2122
- private addBigNumberSlide;
2123
- /**
2124
- * Add quote slide.
2125
- */
2126
- private addQuoteSlide;
2127
- /**
2128
- * Add bullet points slide with professional styling.
2129
- */
2130
- private addBulletSlide;
2131
- /**
2132
- * Add two-column slide with professional layout.
2133
- */
2134
- private addTwoColumnSlide;
2135
- /**
2136
- * Add professional metrics card to slide.
2137
- */
2138
- private addMetricsCard;
2139
- /**
2140
- * Add metrics grid slide.
2141
- */
2142
- private addMetricsSlide;
2143
- /**
2144
- * Add metrics to a slide at specified position.
2145
- */
2146
- private addMetricsToSlide;
2147
- /**
2148
- * Add thank you slide.
2149
- */
2150
- private addThankYouSlide;
2151
- /**
2152
- * Add agenda slide.
2153
- */
2154
- private addAgendaSlide;
2155
- /**
2156
- * Add section divider slide.
2157
- */
2158
- private addSectionDividerSlide;
2159
- /**
2160
- * Add default slide (fallback).
2161
- */
2162
- private addDefaultSlide;
2163
- /**
2164
- * Add image placeholder.
2165
- */
2166
- private addImagePlaceholder;
2167
- /**
2168
- * Convert layout position to PptxGenJS text props.
2169
- */
2170
- private positionToProps;
2171
- /**
2172
- * Add Football Field Valuation Chart (IB Standard)
2173
- * Shows valuation ranges across different methodologies
2174
- */
2175
- addFootballFieldChart(pptxSlide: PptxSlide, data: {
2176
- title: string;
2177
- methodologies: Array<{
2178
- name: string;
2179
- low: number;
2180
- mid: number;
2181
- high: number;
2182
- color?: string;
2183
- }>;
2184
- currentPrice?: number;
2185
- }, bounds: {
2186
- x: number;
2187
- y: number;
2188
- w: number;
2189
- h: number;
2190
- }, colors?: typeof COLORS): void;
2191
- /**
2192
- * Add Waterfall Chart (IB Standard)
2193
- * Shows incremental changes leading to a final value
2194
- */
2195
- addWaterfallChart(pptxSlide: PptxSlide, data: {
2196
- title: string;
2197
- startLabel: string;
2198
- startValue: number;
2199
- steps: Array<{
2200
- label: string;
2201
- value: number;
2202
- isTotal?: boolean;
2203
- }>;
2204
- endLabel?: string;
2205
- }, bounds: {
2206
- x: number;
2207
- y: number;
2208
- w: number;
2209
- h: number;
2210
- }, colors?: typeof COLORS): void;
2211
- /**
2212
- * Add Sources & Uses Table (IB Standard)
2213
- * Common in M&A presentations
2214
- */
2215
- addSourcesUsesTable(pptxSlide: PptxSlide, data: {
2216
- title: string;
2217
- sources: Array<{
2218
- label: string;
2219
- amount: number;
2220
- percentage?: number;
2221
- }>;
2222
- uses: Array<{
2223
- label: string;
2224
- amount: number;
2225
- percentage?: number;
2226
- }>;
2227
- }, bounds: {
2228
- x: number;
2229
- y: number;
2230
- w: number;
2231
- h: number;
2232
- }, colors?: typeof COLORS): void;
2233
- /**
2234
- * Add Comparable Companies Table (Comps - IB Standard)
2235
- */
2236
- addCompsTable(pptxSlide: PptxSlide, data: {
2237
- title: string;
2238
- columns: string[];
2239
- companies: Array<{
2240
- name: string;
2241
- values: (string | number)[];
2242
- highlight?: boolean;
2243
- }>;
2244
- medianRow?: boolean;
2245
- }, bounds: {
2246
- x: number;
2247
- y: number;
2248
- w: number;
2249
- h: number;
2250
- }, colors?: typeof COLORS): void;
2251
- }
2252
-
2253
- /**
2254
- * Image Provider - Pluggable Image Generation
2255
- *
2256
- * Provides multiple strategies for obtaining images:
2257
- * - Local: User-provided paths/URLs
2258
- * - Placeholder: Uses picsum.photos (no API key)
2259
- * - Unsplash: Free API (50 req/hour, optional key)
2260
- * - AI: Claude Code integration (when available)
2261
- */
2262
- interface ImageRequest {
2263
- /** Description of desired image */
2264
- description: string;
2265
- /** Desired width */
2266
- width?: number;
2267
- /** Desired height */
2268
- height?: number;
2269
- /** Style hints (e.g., 'professional', 'minimal', 'vibrant') */
2270
- style?: string;
2271
- /** Category for filtering (e.g., 'business', 'technology', 'nature') */
2272
- category?: string;
2273
- }
2274
- interface ImageResult {
2275
- /** URL or data URI of the image */
2276
- src: string;
2277
- /** Alt text for accessibility */
2278
- alt: string;
2279
- /** Attribution if required */
2280
- attribution?: string;
2281
- /** Whether this is a placeholder */
2282
- isPlaceholder?: boolean;
2283
- }
2284
- interface ImageProvider {
2285
- /** Provider name */
2286
- name: string;
2287
- /** Check if provider is available */
2288
- isAvailable(): Promise<boolean>;
2289
- /** Get an image matching the request */
2290
- getImage(request: ImageRequest): Promise<ImageResult>;
2291
- /** Get multiple images */
2292
- getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
2293
- }
2294
- /**
2295
- * Local Image Provider - Uses user-provided images
2296
- */
2297
- declare class LocalImageProvider implements ImageProvider {
2298
- name: string;
2299
- private images;
2300
- constructor(imageMap?: Record<string, string>);
2301
- isAvailable(): Promise<boolean>;
2302
- getImage(request: ImageRequest): Promise<ImageResult>;
2303
- getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
2304
- private getPlaceholderUrl;
2305
- /** Register an image for later use */
2306
- registerImage(name: string, src: string): void;
2307
- }
2308
- /**
2309
- * Placeholder Image Provider - Uses picsum.photos (no API key needed)
2310
- */
2311
- declare class PlaceholderImageProvider implements ImageProvider {
2312
- name: string;
2313
- isAvailable(): Promise<boolean>;
2314
- getImage(request: ImageRequest): Promise<ImageResult>;
2315
- getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
2316
- private hashString;
2317
- }
2318
- /**
2319
- * Unsplash Image Provider - Uses Unsplash API (free tier: 50 req/hour)
2320
- */
2321
- declare class UnsplashImageProvider implements ImageProvider {
2322
- name: string;
2323
- private accessKey?;
2324
- private baseUrl;
2325
- constructor(accessKey?: string);
2326
- isAvailable(): Promise<boolean>;
2327
- getImage(request: ImageRequest): Promise<ImageResult>;
2328
- getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
2329
- private getSourceImage;
2330
- private delay;
2331
- }
2332
- /**
2333
- * Composite Image Provider - Tries providers in order
2334
- */
2335
- declare class CompositeImageProvider implements ImageProvider {
2336
- name: string;
2337
- private providers;
2338
- constructor(providers: ImageProvider[]);
2339
- isAvailable(): Promise<boolean>;
2340
- getImage(request: ImageRequest): Promise<ImageResult>;
2341
- getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
2342
- }
2343
- /**
2344
- * Create default image provider chain
2345
- *
2346
- * Priority order:
2347
- * 1. Local images (user-provided)
2348
- * 2. NanoBanana Pro (AI generation, if GOOGLE_AI_API_KEY available)
2349
- * 3. Unsplash (if key available)
2350
- * 4. Placeholder (always available)
2351
- */
2352
- declare function createDefaultImageProvider(options?: {
2353
- localImages?: Record<string, string>;
2354
- unsplashKey?: string;
2355
- googleAiKey?: string;
2356
- enableAiGeneration?: boolean;
2357
- }): ImageProvider;
2358
-
2359
- /**
2360
- * Chart Provider - Pluggable Chart Generation
2361
- *
2362
- * Provides multiple strategies for creating charts:
2363
- * - ChartJS: Embedded in HTML (no API needed)
2364
- * - QuickChart: Remote rendering (no API key needed)
2365
- * - Mermaid: Diagrams and flowcharts (no API needed)
2366
- */
2367
- type ChartType = 'bar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'scatter' | 'bubble';
2368
- interface ChartDataset {
2369
- label: string;
2370
- data: number[];
2371
- backgroundColor?: string | string[];
2372
- borderColor?: string | string[];
2373
- borderWidth?: number;
2374
- }
2375
- interface ChartData {
2376
- labels: string[];
2377
- datasets: ChartDataset[];
2378
- }
2379
- interface ChartRequest {
2380
- /** Chart type */
2381
- type: ChartType;
2382
- /** Chart data */
2383
- data: ChartData;
2384
- /** Chart title */
2385
- title?: string;
2386
- /** Width in pixels */
2387
- width?: number;
2388
- /** Height in pixels */
2389
- height?: number;
2390
- /** Show legend */
2391
- showLegend?: boolean;
2392
- /** Animation enabled (HTML only) */
2393
- animated?: boolean;
2394
- /** Color palette to use */
2395
- palette?: 'default' | 'professional' | 'vibrant' | 'monochrome';
2396
- }
2397
- interface ChartResult {
2398
- /** HTML for embedding (Chart.js canvas) */
2399
- html?: string;
2400
- /** Image URL for static contexts (PPTX) */
2401
- imageUrl?: string;
2402
- /** Base64 data URI */
2403
- dataUri?: string;
2404
- /** Chart title for accessibility */
2405
- title: string;
2406
- }
2407
- interface ChartProvider {
2408
- /** Provider name */
2409
- name: string;
2410
- /** Check if provider is available */
2411
- isAvailable(): Promise<boolean>;
2412
- /** Generate a chart */
2413
- generateChart(request: ChartRequest): Promise<ChartResult>;
2414
- }
2415
- /**
2416
- * Chart.js Provider - Generates embedded Chart.js HTML
2417
- * No API needed - runs in browser
2418
- */
2419
- declare class ChartJsProvider implements ChartProvider {
2420
- name: string;
2421
- isAvailable(): Promise<boolean>;
2422
- generateChart(request: ChartRequest): Promise<ChartResult>;
2423
- }
2424
- /**
2425
- * QuickChart Provider - Uses quickchart.io for image generation
2426
- * No API key needed - free service
2427
- */
2428
- declare class QuickChartProvider implements ChartProvider {
2429
- name: string;
2430
- private baseUrl;
2431
- isAvailable(): Promise<boolean>;
2432
- generateChart(request: ChartRequest): Promise<ChartResult>;
2433
- }
2434
- /**
2435
- * Mermaid Provider - Generates diagrams using Mermaid.js
2436
- * No API needed - renders in browser
2437
- */
2438
- declare class MermaidProvider implements ChartProvider {
2439
- name: string;
2440
- isAvailable(): Promise<boolean>;
2441
- generateChart(request: ChartRequest): Promise<ChartResult>;
2442
- /**
2443
- * Generate a Mermaid diagram
2444
- */
2445
- generateDiagram(definition: string, title?: string): Promise<ChartResult>;
2446
- /**
2447
- * Generate flowchart from steps
2448
- */
2449
- generateFlowchart(steps: {
2450
- id: string;
2451
- label: string;
2452
- next?: string[];
2453
- }[]): string;
2454
- /**
2455
- * Generate timeline from events
2456
- */
2457
- generateTimeline(events: {
2458
- date: string;
2459
- title: string;
2460
- }[]): string;
2461
- }
2462
- /**
2463
- * Composite Chart Provider
2464
- */
2465
- declare class CompositeChartProvider implements ChartProvider {
2466
- name: string;
2467
- private htmlProvider;
2468
- private imageProvider;
2469
- private mermaidProvider;
2470
- constructor();
2471
- isAvailable(): Promise<boolean>;
2472
- generateChart(request: ChartRequest): Promise<ChartResult>;
2473
- generateDiagram(definition: string, title?: string): Promise<ChartResult>;
2474
- generateFlowchart(steps: {
2475
- id: string;
2476
- label: string;
2477
- next?: string[];
2478
- }[]): string;
2479
- generateTimeline(events: {
2480
- date: string;
2481
- title: string;
2482
- }[]): string;
2483
- }
2484
- /**
2485
- * Create default chart provider
2486
- */
2487
- declare function createDefaultChartProvider(): CompositeChartProvider;
2488
-
2489
- /**
2490
- * NanoBanana Pro Image Provider
2491
- *
2492
- * AI-powered image generation using Google's Gemini Image models:
2493
- * - Gemini 2.5 Flash Image ("Nano Banana") - Fast, 1K resolution
2494
- * - Gemini 3 Pro Image Preview ("Nano Banana Pro") - Professional, up to 4K resolution
2495
- *
2496
- * Perfect for generating:
2497
- * - Hero images for title slides
2498
- * - Abstract concept visualizations
2499
- * - Background imagery
2500
- * - Product/feature illustrations
2501
- *
2502
- * @see https://ai.google.dev/gemini-api/docs/image-generation
2503
- */
2504
-
2505
- /** Model options for NanoBanana image generation */
2506
- type NanoBananaModel = 'gemini-2.5-flash-image' | 'gemini-3-pro-image';
2507
- /** Image size options (Pro only supports 2K and 4K) */
2508
- type ImageSize = '1K' | '2K' | '4K';
2509
- /** Aspect ratio options */
2510
- type AspectRatio = '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '21:9';
2511
- /** Configuration for NanoBanana provider */
2512
- interface NanoBananaConfig {
2513
- /** Google AI API key (or set GOOGLE_AI_API_KEY env var) */
2514
- apiKey?: string;
2515
- /** Model to use (default: gemini-2.5-flash-image) */
2516
- model?: NanoBananaModel;
2517
- /** Default aspect ratio (default: 16:9 for presentations) */
2518
- aspectRatio?: AspectRatio;
2519
- /** Image size for Pro model (default: 2K) */
2520
- imageSize?: ImageSize;
2521
- /** Style modifiers to append to prompts */
2522
- styleModifiers?: string[];
2523
- /** Whether to include text in generated images */
2524
- allowText?: boolean;
2525
- }
2526
- /**
2527
- * NanoBanana Pro Image Provider
2528
- *
2529
- * Generates AI images using Google's Gemini Image models.
2530
- * Requires GOOGLE_AI_API_KEY environment variable or apiKey in config.
2531
- */
2532
- declare class NanoBananaProvider implements ImageProvider {
2533
- name: string;
2534
- private apiKey;
2535
- private model;
2536
- private aspectRatio;
2537
- private imageSize;
2538
- private styleModifiers;
2539
- private allowText;
2540
- private baseUrl;
2541
- constructor(config?: NanoBananaConfig);
2542
- isAvailable(): Promise<boolean>;
2543
- getImage(request: ImageRequest): Promise<ImageResult>;
2544
- getImages(requests: ImageRequest[]): Promise<ImageResult[]>;
2545
- /**
2546
- * Build an optimized prompt for presentation imagery
2547
- */
2548
- private buildPrompt;
2549
- /**
2550
- * Call the Gemini API for image generation
2551
- */
2552
- private callGeminiAPI;
2553
- /**
2554
- * Extract image result from Gemini response
2555
- */
2556
- private extractImageResult;
2557
- /**
2558
- * Get a fallback placeholder image
2559
- */
2560
- private getFallbackImage;
2561
- /**
2562
- * Generate a consistent hash from a string
2563
- */
2564
- private hashString;
2565
- /**
2566
- * Delay helper for rate limiting
2567
- */
2568
- private delay;
2569
- }
2570
- /**
2571
- * Create a NanoBanana provider with presentation-optimized defaults
2572
- */
2573
- declare function createNanoBananaProvider(config?: NanoBananaConfig): NanoBananaProvider;
2574
- /**
2575
- * Create prompt templates from the knowledge base
2576
- */
2577
- declare const NANOBANANA_PROMPT_TEMPLATES: {
2578
- /** Hero image for title/section slides */
2579
- readonly hero: (topic: string) => string;
2580
- /** Abstract concept visualization */
2581
- readonly concept: (concept: string) => string;
2582
- /** Feature/product illustration */
2583
- readonly feature: (feature: string) => string;
2584
- /** Background imagery */
2585
- readonly background: (theme: string) => string;
2586
- /** Data/metrics visualization enhancement */
2587
- readonly data: (metric: string) => string;
2588
- /** Team/people representation (abstract) */
2589
- readonly team: (context: string) => string;
2590
- /** Process/workflow visualization */
2591
- readonly process: (process: string) => string;
2592
- };
2593
- type PromptTemplate = keyof typeof NANOBANANA_PROMPT_TEMPLATES;
2594
- /**
2595
- * Get a pre-built prompt from templates
2596
- */
2597
- declare function getNanoBananaPrompt(template: PromptTemplate, value: string): string;
2598
-
2599
- /**
2600
- * Knowledge Base - RuVector Expert Principles Loader
2601
- *
2602
- * Loads and provides access to the 6,300+ line expert knowledge base
2603
- * containing methodologies from 40+ presentation experts.
2604
- *
2605
- * This runs WITHOUT any API - it's static data bundled with the package.
2606
- */
2607
- interface ExpertPrinciple {
2608
- name: string;
2609
- description: string;
2610
- validation?: string[];
2611
- examples?: string[];
2612
- }
2613
- interface ExpertMethodology {
2614
- name: string;
2615
- principles: ExpertPrinciple[];
2616
- slideTypes?: string[];
2617
- wordLimits?: {
2618
- min?: number;
2619
- max?: number;
2620
- };
2621
- }
2622
- interface AutomatedQA {
2623
- scoringRubric: {
2624
- totalPoints: number;
2625
- passingThreshold: number;
2626
- categories: Record<string, {
2627
- weight: number;
2628
- checks: Record<string, unknown>;
2629
- }>;
2630
- };
2631
- }
2632
- declare class KnowledgeBase {
290
+ declare class KnowledgeGateway {
2633
291
  private data;
2634
- private loaded;
2635
- /**
2636
- * Load the knowledge base from the bundled YAML file.
2637
- */
2638
- load(): Promise<void>;
2639
- /**
2640
- * Get expert methodology by name.
2641
- */
2642
- getExpert(name: string): ExpertMethodology | undefined;
2643
- /**
2644
- * Get all expert names.
2645
- */
2646
- getExpertNames(): string[];
2647
- /**
2648
- * Get framework recommendation for audience.
2649
- */
2650
- getFrameworkForAudience(audience: string): {
2651
- primaryFramework: string;
2652
- secondaryFramework?: string;
2653
- slideTypes: string[];
2654
- } | undefined;
2655
- /**
2656
- * Get framework recommendation for goal.
2657
- */
2658
- getFrameworkForGoal(goal: string): {
2659
- primaryFramework: string;
2660
- secondaryFramework?: string;
2661
- slideTypes: string[];
2662
- } | undefined;
2663
- /**
2664
- * Get QA scoring rubric.
2665
- */
2666
- getScoringRubric(): AutomatedQA['scoringRubric'] | undefined;
2667
- /**
2668
- * Get mode configuration (keynote or business).
2669
- */
2670
- getModeConfig(mode: 'keynote' | 'business'): unknown;
2671
- /**
2672
- * Get slide type configuration.
2673
- */
2674
- getSlideType(type: string): unknown;
2675
- /**
2676
- * Get the knowledge base version.
2677
- */
2678
- getVersion(): string;
2679
- /**
2680
- * Validate a slide against expert principles.
2681
- */
2682
- validateAgainstExpert(expertName: string, slideData: {
2683
- wordCount: number;
2684
- hasActionTitle: boolean;
2685
- bulletCount: number;
2686
- }): {
2687
- passed: boolean;
2688
- violations: string[];
2689
- };
2690
- /**
2691
- * Ensure knowledge base is loaded.
2692
- */
2693
- private ensureLoaded;
2694
- /**
2695
- * Get default data if YAML can't be loaded.
2696
- */
2697
- private getDefaultData;
2698
- }
2699
- /**
2700
- * Get the knowledge base singleton.
2701
- */
2702
- declare function getKnowledgeBase(): KnowledgeBase;
2703
-
2704
- /**
2705
- * KnowledgeOrchestrator - The Central Brain (Optimized v2.0)
2706
- *
2707
- * THIS IS THE HEART OF THE APPLICATION.
2708
- *
2709
- * Every single decision in the presentation engine flows through this orchestrator.
2710
- * It queries the RuVector knowledge base via KnowledgeService typed methods.
2711
- *
2712
- * DESIGN PRINCIPLE: The RuVector KB IS the application.
2713
- * This orchestrator simply executes what the KB dictates.
2714
- *
2715
- * KEY OPTIMIZATION (v2.0):
2716
- * - Uses KnowledgeService typed methods instead of raw property access
2717
- * - Memory-resident KB (loaded once, cached forever)
2718
- * - Optional logging (no console spam by default)
2719
- * - 95/100 KB utilization target
2720
- *
2721
- * The knowledge base contains 7,000+ lines of world-class expertise from:
2722
- * - Nancy Duarte (Sparkline, STAR moments)
2723
- * - Barbara Minto (Pyramid Principle, MECE, Action Titles)
2724
- * - Edward Tufte (Data-Ink Ratio, Chartjunk elimination)
2725
- * - Cole Nussbaumer Knaflic (Storytelling with Data)
2726
- * - Garr Reynolds (Presentation Zen)
2727
- * - Carmine Gallo (Talk Like TED)
2728
- * - Robert Cialdini (Persuasion Psychology)
2729
- * - Daniel Kahneman (Behavioral Economics)
2730
- * - Chip & Dan Heath (Made to Stick)
2731
- * - McKinsey, BCG, Bain (Consulting methodology)
2732
- * - Cognitive Science (Miller's Law, Chunking, Cognitive Load)
2733
- * - Gestalt Principles (Proximity, Similarity, Closure, Continuity)
2734
- * - WCAG Accessibility Standards
2735
- * - And 30+ more expert methodologies
2736
- */
2737
-
2738
- interface KBQueryLog {
2739
- timestamp: Date;
2740
- path: string;
2741
- query: string;
2742
- result: any;
2743
- appliedAs: string;
2744
- }
2745
- interface OrchestratorDecision<T> {
2746
- value: T;
2747
- kbPath: string;
2748
- kbSource: string;
2749
- reasoning: string;
2750
- }
2751
- interface OrchestratorConfig {
2752
- verbose?: boolean;
2753
- logQueries?: boolean;
2754
- }
2755
- /**
2756
- * KnowledgeOrchestrator - Routes ALL decisions through the knowledge base
2757
- *
2758
- * Uses KnowledgeService typed methods for reliable access to all 33 KB domains.
2759
- */
2760
- declare class KnowledgeOrchestrator {
2761
- private queryLog;
2762
- private initialized;
2763
- private config;
2764
- private kbVersion;
2765
- constructor(config?: OrchestratorConfig);
2766
- /**
2767
- * Initialize the orchestrator by loading the knowledge base
2768
- */
2769
- initialize(): Promise<void>;
2770
- /**
2771
- * Log a knowledge base query for verification
2772
- */
2773
- private log;
292
+ private loaded;
293
+ private version;
2774
294
  /**
2775
- * Safe JSON stringify that handles undefined
295
+ * Load the knowledge base from YAML.
296
+ * MUST be called before any queries.
2776
297
  */
2777
- private safeStringify;
298
+ load(): Promise<void>;
2778
299
  /**
2779
- * Get the full query log for verification
300
+ * Get KB version
2780
301
  */
2781
- getQueryLog(): KBQueryLog[];
302
+ getVersion(): string;
2782
303
  /**
2783
- * Get query statistics
304
+ * Get complete presentation type configuration.
305
+ * @throws KBQueryError if type not found
2784
306
  */
2785
- getQueryStats(): {
2786
- total: number;
2787
- byDomain: Record<string, number>;
2788
- };
307
+ getPresentationType(type: PresentationType): KBResult<KBPresentationType>;
2789
308
  /**
2790
- * Print query log summary (only if verbose)
309
+ * Get validation rules for a presentation type.
310
+ * @throws KBQueryError if rules not found
2791
311
  */
2792
- printQuerySummary(): void;
312
+ getValidationRules(type: PresentationType): KBResult<KBValidationRules>;
2793
313
  /**
2794
- * Get word limits for a presentation mode
2795
- * SOURCE: KnowledgeService.getModeRules(mode).characteristics.words_per_slide
314
+ * Get word limits for a presentation type.
2796
315
  */
2797
- getWordLimits(mode: PresentationMode): OrchestratorDecision<{
316
+ getWordLimits(type: PresentationType): KBResult<{
2798
317
  min: number;
2799
318
  max: number;
319
+ ideal: number;
2800
320
  }>;
2801
321
  /**
2802
- * Get whitespace requirements
2803
- * SOURCE: KnowledgeService.getModeRules(mode).characteristics.whitespace
322
+ * Get whitespace requirements.
2804
323
  */
2805
- getWhitespaceRequirement(mode: PresentationMode): OrchestratorDecision<number>;
324
+ getWhitespaceRules(type: PresentationType): KBResult<{
325
+ min: number;
326
+ ideal: number;
327
+ max?: number;
328
+ }>;
2806
329
  /**
2807
- * Get primary experts for a mode
2808
- * SOURCE: KnowledgeService.getModeRules(mode).experts
330
+ * Get scoring weights for a presentation type.
2809
331
  */
2810
- getPrimaryExperts(mode: PresentationMode): OrchestratorDecision<string[]>;
332
+ getScoringWeights(type: PresentationType): KBResult<KBScoringWeights>;
2811
333
  /**
2812
- * Get full mode configuration
2813
- * SOURCE: KnowledgeService.getModeRules(mode)
334
+ * Get allowed slide types for a presentation type.
2814
335
  */
2815
- getModeConfig(mode: PresentationMode): OrchestratorDecision<any>;
336
+ getAllowedSlideTypes(type: PresentationType): KBResult<string[]>;
2816
337
  /**
2817
- * Get presentation type configuration
2818
- * SOURCE: KnowledgeService.getTypeConfig(type)
338
+ * Get required elements for a presentation type.
2819
339
  */
2820
- getTypeConfig(type: PresentationType): OrchestratorDecision<any>;
340
+ getRequiredElements(type: PresentationType): KBResult<string[]>;
2821
341
  /**
2822
- * Get type detection signals
2823
- * SOURCE: KnowledgeService.getTypeDetection()
342
+ * Get anti-patterns to avoid for a presentation type.
2824
343
  */
2825
- getTypeDetection(): OrchestratorDecision<any>;
344
+ getAntiPatterns(type: PresentationType): KBResult<string[]>;
2826
345
  /**
2827
- * Get Miller's Law limit for items
2828
- * SOURCE: KnowledgeService.getMillersLaw()
346
+ * Get the scoring rubric.
2829
347
  */
2830
- getMillersLawLimit(): OrchestratorDecision<number>;
348
+ getScoringRubric(): KBResult<KBScoringRubric>;
2831
349
  /**
2832
- * Get chunking rules for information grouping
2833
- * SOURCE: KnowledgeService.getChunkingPrinciples()
350
+ * Get passing threshold (default: 95).
2834
351
  */
2835
- getChunkingRules(): OrchestratorDecision<string[]>;
352
+ getPassingThreshold(): KBResult<number>;
2836
353
  /**
2837
- * Get cognitive load reduction strategies
2838
- * SOURCE: KnowledgeService.getCognitiveLoadTheory()
354
+ * Get expert methodology.
2839
355
  */
2840
- getCognitiveLoadRules(): OrchestratorDecision<string[]>;
356
+ getExpert(name: string): KBResult<KBExpert>;
2841
357
  /**
2842
- * Get attention span guidance
2843
- * SOURCE: KnowledgeService.getAttentionSpan()
358
+ * Get Nancy Duarte's glance test rules.
2844
359
  */
2845
- getAttentionSpanGuidance(): OrchestratorDecision<{
2846
- maxSeconds: number;
2847
- rules: string[];
360
+ getGlanceTest(): KBResult<{
361
+ description: string;
362
+ word_limit: number;
2848
363
  }>;
2849
364
  /**
2850
- * Get all cognitive science rules
2851
- * SOURCE: KnowledgeService.getCognitiveRules()
365
+ * Get Duarte's Sparkline framework.
2852
366
  */
2853
- getAllCognitiveRules(): OrchestratorDecision<any>;
367
+ getSparkline(): KBResult<Record<string, unknown>>;
2854
368
  /**
2855
- * Get proximity principle for layout
2856
- * SOURCE: KnowledgeService.getGestaltPrinciple('proximity')
369
+ * Get Minto's SCQA framework.
2857
370
  */
2858
- getProximityPrinciple(): OrchestratorDecision<{
2859
- description: string;
2860
- application: string[];
2861
- }>;
371
+ getSCQA(): KBResult<Record<string, unknown>>;
2862
372
  /**
2863
- * Get similarity principle for styling
2864
- * SOURCE: KnowledgeService.getGestaltPrinciple('similarity')
373
+ * Get Miller's Law (7±2 items).
2865
374
  */
2866
- getSimilarityPrinciple(): OrchestratorDecision<{
2867
- description: string;
375
+ getMillersLaw(): KBResult<{
376
+ principle: string;
2868
377
  application: string[];
2869
378
  }>;
2870
379
  /**
2871
- * Get all Gestalt principles
2872
- * SOURCE: KnowledgeService.getGestaltPrinciples()
2873
- */
2874
- getAllGestaltPrinciples(): OrchestratorDecision<Record<string, any>>;
2875
- /**
2876
- * Get Tufte's data-ink ratio rules
2877
- * SOURCE: KnowledgeService.getDataVizExpert('edward_tufte')
2878
- */
2879
- getTufteDataInkRules(): OrchestratorDecision<string[]>;
2880
- /**
2881
- * Get chartjunk to avoid
2882
- * SOURCE: KnowledgeService.getDataVizExpert('edward_tufte')
2883
- */
2884
- getChartjunkToAvoid(): OrchestratorDecision<string[]>;
2885
- /**
2886
- * Get Knaflic's 6 key principles
2887
- * SOURCE: KnowledgeService.getDataVizExpert('cole_nussbaumer_knaflic')
2888
- */
2889
- getKnaflicPrinciples(): OrchestratorDecision<Record<string, any>>;
2890
- /**
2891
- * Select chart type based on purpose
2892
- * SOURCE: KnowledgeService.getChartSelectionGuide(purpose)
380
+ * Get accessibility requirements.
2893
381
  */
2894
- selectChartType(purpose: 'comparison' | 'composition' | 'distribution' | 'relationship', characteristics: {
2895
- categoryCount: number;
2896
- hasTimeSeries: boolean;
2897
- variableCount: number;
2898
- }): OrchestratorDecision<string>;
382
+ getAccessibilityRules(): KBResult<Record<string, unknown>>;
2899
383
  /**
2900
- * Get chart-specific rules
2901
- * SOURCE: KnowledgeService.getChartRules(chartType)
384
+ * Get contrast ratio requirements.
2902
385
  */
2903
- getChartRules(chartType: string): OrchestratorDecision<any>;
386
+ getContrastRequirements(): KBResult<{
387
+ normal_text: string;
388
+ large_text: string;
389
+ }>;
2904
390
  /**
2905
- * Get table styling rules
2906
- * SOURCE: KnowledgeService.getChartRules('tables')
391
+ * Get minimum font sizes.
2907
392
  */
2908
- getTableStylingRules(): OrchestratorDecision<string[]>;
393
+ getFontSizeRequirements(): KBResult<Record<string, string>>;
2909
394
  /**
2910
- * Get data label rules
2911
- * SOURCE: KnowledgeService.getDataLabelRules()
395
+ * Get Tufte's data-ink ratio rules.
2912
396
  */
2913
- getDataLabelRules(): OrchestratorDecision<any>;
397
+ getDataInkRules(): KBResult<Record<string, unknown>>;
2914
398
  /**
2915
- * Get Barbara Minto's Pyramid Principle
2916
- * SOURCE: KnowledgeService.getExpertPrinciples('barbara_minto')
399
+ * Get chartjunk to avoid.
2917
400
  */
2918
- getMintoPyramidPrinciple(): OrchestratorDecision<any>;
401
+ getChartjunk(): KBResult<string[]>;
2919
402
  /**
2920
- * Get action title requirements
2921
- * SOURCE: KnowledgeService.getExpertPrinciples('barbara_minto') + getModeRules('business')
403
+ * Get Cialdini's 6 Principles of Influence.
2922
404
  */
2923
- getActionTitleRequirements(): OrchestratorDecision<{
2924
- rules: string[];
2925
- examples: any;
2926
- }>;
405
+ getCialdiniPrinciples(): KBResult<Record<string, unknown>>;
2927
406
  /**
2928
- * Get MECE validation rules
2929
- * SOURCE: KnowledgeService.getExpertPrinciples('barbara_minto')
407
+ * Get specific Cialdini principle by name.
2930
408
  */
2931
- getMECERules(): OrchestratorDecision<any>;
409
+ getCialdiniPrinciple(name: string): KBResult<Record<string, unknown>>;
2932
410
  /**
2933
- * Get Nancy Duarte's principles
2934
- * SOURCE: KnowledgeService.getExpertPrinciples('nancy_duarte')
411
+ * Get all Gestalt principles.
2935
412
  */
2936
- getDuartePrinciples(): OrchestratorDecision<any>;
413
+ getGestaltPrinciples(): KBResult<Record<string, unknown>>;
2937
414
  /**
2938
- * Get Glance Test requirements
2939
- * SOURCE: KnowledgeService.getGlanceTest()
415
+ * Get specific Gestalt principle by name.
2940
416
  */
2941
- getGlanceTestRequirements(): OrchestratorDecision<{
2942
- maxSeconds: number;
2943
- rules: string[];
2944
- }>;
417
+ getGestaltPrinciple(name: string): KBResult<Record<string, unknown>>;
2945
418
  /**
2946
- * Get Garr Reynolds' principles (Presentation Zen)
2947
- * SOURCE: KnowledgeService.getExpertPrinciples('garr_reynolds')
419
+ * Get Gestalt proximity principle (for layout checks).
2948
420
  */
2949
- getReynoldsPrinciples(): OrchestratorDecision<any>;
421
+ getGestaltProximity(): KBResult<Record<string, unknown>>;
2950
422
  /**
2951
- * Get Carmine Gallo's principles (Talk Like TED)
2952
- * SOURCE: KnowledgeService.getExpertPrinciples('carmine_gallo')
423
+ * Get Gestalt similarity principle (for consistency checks).
2953
424
  */
2954
- getGalloPrinciples(): OrchestratorDecision<any>;
425
+ getGestaltSimilarity(): KBResult<Record<string, unknown>>;
2955
426
  /**
2956
- * Get Sparkline framework
2957
- * SOURCE: KnowledgeService.getSparklineFramework()
427
+ * Get Gestalt figure-ground principle (for visual impact checks).
2958
428
  */
2959
- getSparklineFramework(): OrchestratorDecision<any>;
429
+ getGestaltFigureGround(): KBResult<Record<string, unknown>>;
2960
430
  /**
2961
- * Get SCQA framework
2962
- * SOURCE: KnowledgeService.getSCQAFramework()
431
+ * Query any KB path directly.
432
+ * @throws KBQueryError if path not found
2963
433
  */
2964
- getSCQAFramework(): OrchestratorDecision<any>;
434
+ queryRequired<T>(path: string): KBResult<T>;
2965
435
  /**
2966
- * Get STAR moment guidance
2967
- * SOURCE: KnowledgeService.getExpertPrinciples('nancy_duarte')
436
+ * Query any KB path directly (optional - returns null if not found).
2968
437
  */
2969
- getSTARMomentGuidance(): OrchestratorDecision<any>;
438
+ queryOptional<T>(path: string): KBResult<T | null>;
2970
439
  /**
2971
- * Get all story frameworks
2972
- * SOURCE: KnowledgeService.getStoryFrameworks()
440
+ * Ensure KB is loaded.
2973
441
  */
2974
- getAllStoryFrameworks(): OrchestratorDecision<any>;
442
+ private ensureLoaded;
2975
443
  /**
2976
- * Get Cialdini's persuasion principles
2977
- * SOURCE: KnowledgeService.getCialdiniPrinciples()
444
+ * Query a dotted path in the KB.
2978
445
  */
2979
- getCialdiniPrinciples(): OrchestratorDecision<any>;
446
+ private query;
2980
447
  /**
2981
- * Get Kahneman insights
2982
- * SOURCE: KnowledgeService.getPersuasionPsychology()
448
+ * Create a KB query error.
2983
449
  */
2984
- getKahnemanInsights(): OrchestratorDecision<any>;
450
+ private error;
451
+ }
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
+
461
+ /**
462
+ * ContentAnalyzer - Parse and Analyze Input Content
463
+ *
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
471
+ */
472
+
473
+ declare class ContentAnalyzer {
474
+ private kb;
475
+ private initialized;
476
+ constructor();
477
+ initialize(): Promise<void>;
2985
478
  /**
2986
- * Get Heath Brothers' Made to Stick principles
2987
- * SOURCE: KnowledgeService.getPersuasionPsychology()
479
+ * Analyze content and return structured analysis.
2988
480
  */
2989
- getHeathBrothersPrinciples(): OrchestratorDecision<any>;
481
+ analyze(content: string, contentType?: 'markdown' | 'text'): Promise<ContentAnalysis>;
2990
482
  /**
2991
- * Get all persuasion psychology
2992
- * SOURCE: KnowledgeService.getPersuasionPsychology()
483
+ * Parse content into sections based on headers.
2993
484
  */
2994
- getAllPersuasionPsychology(): OrchestratorDecision<any>;
485
+ private parseSections;
2995
486
  /**
2996
- * Get color contrast requirements
2997
- * SOURCE: KnowledgeService.getContrastRequirements()
487
+ * Extract title from content.
2998
488
  */
2999
- getContrastRequirements(): OrchestratorDecision<any>;
489
+ private extractTitle;
3000
490
  /**
3001
- * Get font size requirements
3002
- * SOURCE: KnowledgeService.getFontSizeRequirements()
491
+ * Extract bullet points from content.
492
+ * Strips markdown formatting (**bold**, *italic*, `code`) from bullet text.
3003
493
  */
3004
- getFontSizeRequirements(): OrchestratorDecision<any>;
494
+ private extractBullets;
3005
495
  /**
3006
- * Get color blindness guidance
3007
- * SOURCE: KnowledgeService.getColorBlindnessGuidance()
496
+ * Strip markdown formatting from text.
497
+ * Converts **bold**, *italic*, `code`, [links](url) to plain text.
3008
498
  */
3009
- getColorBlindnessGuidance(): OrchestratorDecision<any>;
499
+ private stripMarkdown;
3010
500
  /**
3011
- * Get all accessibility rules
3012
- * SOURCE: KnowledgeService.getAccessibilityRules()
501
+ * Extract data points (metrics, percentages, currencies, numbers).
3013
502
  */
3014
- getAllAccessibilityRules(): OrchestratorDecision<any>;
503
+ private extractDataPoints;
3015
504
  /**
3016
- * Get typography rules
3017
- * SOURCE: KnowledgeService.getTypography()
505
+ * Get surrounding context for a data point.
3018
506
  */
3019
- getTypographyRules(): OrchestratorDecision<any>;
507
+ private getContext;
3020
508
  /**
3021
- * Get color system
3022
- * SOURCE: KnowledgeService.getColorSystem()
509
+ * Parse numeric value from string (handles M/B/K suffixes).
3023
510
  */
3024
- getColorSystem(): OrchestratorDecision<any>;
511
+ private parseNumericValue;
3025
512
  /**
3026
- * Get spacing system
3027
- * SOURCE: KnowledgeService.getSpacingSystem()
513
+ * Extract key messages from sections.
3028
514
  */
3029
- getSpacingSystem(): OrchestratorDecision<any>;
515
+ private extractKeyMessages;
3030
516
  /**
3031
- * Get layout rules
3032
- * SOURCE: KnowledgeService.getLayoutSystem()
517
+ * Detect presentation type based on content signals.
3033
518
  */
3034
- getLayoutRules(mode: PresentationMode): OrchestratorDecision<any>;
519
+ private detectPresentationType;
3035
520
  /**
3036
- * Get complete design system
3037
- * SOURCE: KnowledgeService.getDesignSystem()
521
+ * Identify SCQA (Situation, Complication, Question, Answer) structure.
3038
522
  */
3039
- getFullDesignSystem(): OrchestratorDecision<any>;
523
+ private identifySCQA;
3040
524
  /**
3041
- * Get Harvey balls guidance
3042
- * SOURCE: KnowledgeService.getHarveyBalls()
525
+ * Identify Sparkline (What Is / What Could Be) structure.
3043
526
  */
3044
- getHarveyBallsGuidance(): OrchestratorDecision<any>;
527
+ private identifySparkline;
528
+ }
529
+ declare function getContentAnalyzer(): ContentAnalyzer;
530
+ declare function initContentAnalyzer(): Promise<ContentAnalyzer>;
531
+
532
+ /**
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
540
+ *
541
+ * ALL decisions come from the Knowledge Base. NO hardcoded fallbacks.
542
+ */
543
+
544
+ declare class SlideGenerator {
545
+ private kb;
546
+ private vds;
547
+ private initialized;
548
+ private wordLimits;
549
+ private bulletLimit;
550
+ private allowedSlideTypes;
551
+ constructor();
552
+ initialize(): Promise<void>;
3045
553
  /**
3046
- * Get traffic light guidance
3047
- * SOURCE: KnowledgeService.getTrafficLights()
554
+ * Generate slides from content analysis.
3048
555
  */
3049
- getTrafficLightGuidance(): OrchestratorDecision<any>;
556
+ generate(analysis: ContentAnalysis, presentationType: PresentationType): Promise<Slide[]>;
557
+ private loadRulesForType;
3050
558
  /**
3051
- * Get icon usage guidance
3052
- * SOURCE: KnowledgeService.getIconGuidance()
559
+ * Create title slide.
3053
560
  */
3054
- getIconGuidance(): OrchestratorDecision<any>;
561
+ private createTitleSlide;
3055
562
  /**
3056
- * Get all consulting visuals
3057
- * SOURCE: KnowledgeService.getConsultingVisuals()
563
+ * Create agenda slide.
3058
564
  */
3059
- getAllConsultingVisuals(): OrchestratorDecision<any>;
565
+ private createAgendaSlide;
3060
566
  /**
3061
- * Get signal-to-noise ratio requirements
3062
- * SOURCE: KnowledgeService.getSignalToNoise()
567
+ * Create SCQA slides (Situation, Complication, Question, Answer).
3063
568
  */
3064
- getSignalToNoiseRequirements(): OrchestratorDecision<any>;
569
+ private createSCQASlides;
3065
570
  /**
3066
- * Get one-idea-per-slide requirements
3067
- * SOURCE: KnowledgeService.getOneIdeaPerSlide()
571
+ * Create slides for a content section.
3068
572
  */
3069
- getOneIdeaRequirements(): OrchestratorDecision<any>;
573
+ private createSectionSlides;
3070
574
  /**
3071
- * Get scoring weights
3072
- * SOURCE: KnowledgeService.getScoringWeights()
575
+ * Create metrics grid slide from data points.
3073
576
  */
3074
- getScoringWeights(): OrchestratorDecision<any>;
577
+ private createMetricsSlide;
3075
578
  /**
3076
- * Get all quality metrics
3077
- * SOURCE: KnowledgeService.getQualityMetrics()
579
+ * Create metrics grid slide from a section.
3078
580
  */
3079
- getAllQualityMetrics(): OrchestratorDecision<any>;
581
+ private createMetricsGridSlide;
3080
582
  /**
3081
- * Get anti-patterns to avoid
3082
- * SOURCE: KnowledgeService.getAntiPatterns()
583
+ * Create STAR moment slide (Something They'll Always Remember).
3083
584
  */
3084
- getAntiPatterns(): OrchestratorDecision<any>;
585
+ private createStarMomentSlide;
3085
586
  /**
3086
- * Get visual anti-patterns
3087
- * SOURCE: KnowledgeService.getVisualAntiPatterns()
587
+ * Create call to action slide.
3088
588
  */
3089
- getVisualAntiPatterns(): OrchestratorDecision<any[]>;
589
+ private createCallToActionSlide;
3090
590
  /**
3091
- * Get content anti-patterns
3092
- * SOURCE: KnowledgeService.getContentAntiPatterns()
591
+ * Create thank you / closing slide.
3093
592
  */
3094
- getContentAntiPatterns(): OrchestratorDecision<any[]>;
593
+ private createThankYouSlide;
3095
594
  /**
3096
- * Get slide templates for mode
3097
- * SOURCE: KnowledgeService.getAllSlideTemplates()
595
+ * Determine the best slide type for a section.
3098
596
  */
3099
- getSlideTemplates(mode: PresentationMode): OrchestratorDecision<any>;
597
+ private determineSlideType;
3100
598
  /**
3101
- * Get specific slide template
3102
- * SOURCE: KnowledgeService.getSlideTemplate(templateType)
599
+ * Check if presentation type favors minimal slides.
3103
600
  */
3104
- getSlideTemplate(templateType: string): OrchestratorDecision<any>;
601
+ private isMinimalType;
3105
602
  /**
3106
- * Get data integrity requirements
3107
- * SOURCE: KnowledgeService.getDataIntegrity()
603
+ * Strip all markdown syntax from text for clean slide content.
604
+ * This is called on ALL text going into slides to prevent raw markdown.
3108
605
  */
3109
- getDataIntegrityRules(): OrchestratorDecision<any>;
606
+ private stripMarkdownSyntax;
3110
607
  /**
3111
- * Get source documentation requirements
3112
- * SOURCE: KnowledgeService.getSourceDocumentation()
608
+ * Clean bullets - strip markdown and extract complete, meaningful phrases.
609
+ * CRITICAL: Never truncate mid-sentence. Keep bullets SHORT (3-5 words each).
610
+ * For sales_pitch with max 30 words: 4 bullets × 5 words = 20 words (leaves room for title)
3113
611
  */
3114
- getSourceDocumentationRules(): OrchestratorDecision<any>;
612
+ private cleanBullets;
3115
613
  /**
3116
- * Get verification checklist
3117
- * SOURCE: KnowledgeService.getVerificationChecklist()
614
+ * Truncate text to word limit, stripping markdown first.
615
+ * NEVER adds "..." - just takes the complete words that fit.
3118
616
  */
3119
- getVerificationChecklist(): OrchestratorDecision<any>;
617
+ private truncateToWordLimit;
3120
618
  /**
3121
- * Get HTML output configuration
3122
- * SOURCE: KnowledgeService.getHtmlConfig()
619
+ * Extract a key statement from content (first sentence or bold text).
3123
620
  */
3124
- getHtmlConfig(): OrchestratorDecision<any>;
621
+ private extractKeyStatement;
3125
622
  /**
3126
- * Get PPTX output configuration
3127
- * SOURCE: KnowledgeService.getPptxConfig()
623
+ * Extract a key message from title and body for single_statement slides.
624
+ * Returns a concise, impactful message that provides substance.
3128
625
  */
3129
- getPptxConfig(): OrchestratorDecision<any>;
626
+ private extractKeyMessage;
3130
627
  /**
3131
- * Get PPTX generation rules
3132
- * SOURCE: KnowledgeService.getPptxGeneration()
628
+ * Extract a label from context (nearby text around a data point).
3133
629
  */
3134
- getPptxGenerationRules(): OrchestratorDecision<any>;
630
+ private extractLabelFromContext;
3135
631
  /**
3136
- * Get ALL rules applicable to slide creation
3137
- * This is the master method that aggregates all relevant KB sections
632
+ * Detect trend from context (up, down, neutral).
3138
633
  */
3139
- getSlideCreationRules(mode: PresentationMode, type: PresentationType): Promise<{
3140
- wordLimits: OrchestratorDecision<{
3141
- min: number;
3142
- max: number;
3143
- }>;
3144
- millerLimit: OrchestratorDecision<number>;
3145
- glanceTest: OrchestratorDecision<{
3146
- maxSeconds: number;
3147
- rules: string[];
3148
- }>;
3149
- actionTitles: OrchestratorDecision<{
3150
- rules: string[];
3151
- examples: any;
3152
- }>;
3153
- tufteRules: OrchestratorDecision<string[]>;
3154
- chartjunk: OrchestratorDecision<string[]>;
3155
- gestalt: OrchestratorDecision<Record<string, any>>;
3156
- accessibility: {
3157
- contrast: OrchestratorDecision<any>;
3158
- fonts: OrchestratorDecision<any>;
3159
- };
3160
- antiPatterns: OrchestratorDecision<any>;
3161
- }>;
634
+ private detectTrend;
3162
635
  /**
3163
- * Get ALL narrative/persuasion rules
636
+ * Split array into chunks.
3164
637
  */
3165
- getNarrativeRules(): Promise<{
3166
- sparkline: OrchestratorDecision<any>;
3167
- scqa: OrchestratorDecision<any>;
3168
- starMoment: OrchestratorDecision<any>;
3169
- cialdini: OrchestratorDecision<any>;
3170
- kahneman: OrchestratorDecision<any>;
3171
- heath: OrchestratorDecision<any>;
3172
- }>;
638
+ private chunkArray;
3173
639
  /**
3174
- * Search the knowledge base by keyword
3175
- * SOURCE: KnowledgeService.search(keyword)
640
+ * Generate meaningful titles for chunked bullet lists.
641
+ * Instead of "Title (continued)", create contextual subtitles.
3176
642
  */
3177
- searchKB(keyword: string): OrchestratorDecision<any[]>;
643
+ private generateChunkTitles;
3178
644
  /**
3179
- * Get KB version and metadata
645
+ * Extract a meaningful subtitle from bullet content.
3180
646
  */
3181
- getKBMetadata(): OrchestratorDecision<any>;
647
+ private extractSubtitleFromBullets;
3182
648
  }
3183
- declare function getKnowledgeOrchestrator(config?: OrchestratorConfig): KnowledgeOrchestrator;
3184
- /**
3185
- * Create a new orchestrator instance (useful for testing with different configs)
3186
- */
3187
- declare function createKnowledgeOrchestrator(config?: OrchestratorConfig): KnowledgeOrchestrator;
649
+ declare function getSlideGenerator(): SlideGenerator;
650
+ declare function initSlideGenerator(): Promise<SlideGenerator>;
3188
651
 
3189
652
  /**
3190
- * NarrativeAnalyzer - Story Structure Analysis Engine
3191
- *
3192
- * THIS MODULE ANALYZES AND ENFORCES NARRATIVE STRUCTURE.
3193
- *
3194
- * ALL decisions flow through the KnowledgeOrchestrator - NO hardcoding.
3195
- *
3196
- * Implements expert frameworks from:
3197
- * - Nancy Duarte (Sparkline: What Is / What Could Be, STAR moments)
3198
- * - Barbara Minto (SCQA: Situation, Complication, Question, Answer)
3199
- * - Cole Nussbaumer Knaflic (Story structure: Beginning, Middle, End)
3200
- * - Carmine Gallo (Rule of Three, Emotional Connection)
3201
- * - Chris Anderson (One Idea, Gift Giving)
653
+ * VisualDesignSystem - KB-Driven Visual Design Configuration
3202
654
  *
3203
- * The knowledge base IS the brain. This code is just plumbing.
655
+ * CRITICAL: ALL design decisions come from the Knowledge Base.
656
+ * This module queries KB for colors, typography, gradients, layouts.
657
+ * NO hardcoded fallbacks.
3204
658
  */
3205
659
 
3206
- type SparklineStage = 'what_is' | 'what_could_be' | 'contrast' | 'star_moment' | 'new_bliss' | 'unknown';
3207
- type SCQAStage = 'situation' | 'complication' | 'question' | 'answer' | 'unknown';
3208
- type EmotionalPosition = 'opening_hook' | 'rising_tension' | 'climax' | 'resolution' | 'call_to_action';
3209
- interface SectionNarrativeAnalysis {
3210
- section: ExtractedSection;
3211
- sparklineStage: SparklineStage;
3212
- scqaStage: SCQAStage;
3213
- emotionalPosition: EmotionalPosition;
3214
- emotionalIntensity: number;
3215
- isSTARCandidate: boolean;
3216
- narrativeFunction: string;
3217
- kbSources: string[];
660
+ interface ColorPalette {
661
+ name: string;
662
+ background: string;
663
+ primary: string;
664
+ secondary: string;
665
+ accent: string;
666
+ text: string;
667
+ useCase: string;
668
+ contrastRatio: string;
669
+ }
670
+ interface Typography {
671
+ titles: string;
672
+ headlines?: string;
673
+ body: string;
674
+ maxFonts: number;
675
+ fontPairing?: string;
676
+ actionTitle?: string;
677
+ sectionHeaders?: string;
678
+ dataLabels?: string;
679
+ }
680
+ interface LayoutRules {
681
+ whitespace: string;
682
+ wordsPerSlide: string;
683
+ elementsPerSlide?: string;
684
+ requiresActionTitles?: boolean;
685
+ requiresSources?: boolean;
686
+ requiresCallouts?: boolean;
687
+ }
688
+ interface GradientDefinition {
689
+ name: string;
690
+ css: string;
691
+ angle?: number;
692
+ stops: Array<{
693
+ color: string;
694
+ position: string;
695
+ }>;
3218
696
  }
3219
- interface PresentationNarrativeAnalysis {
3220
- sections: SectionNarrativeAnalysis[];
3221
- sparklineFlow: SparklineStage[];
3222
- hasProperSparkline: boolean;
3223
- sparklineScore: number;
3224
- scqaFlow: SCQAStage[];
3225
- hasProperSCQA: boolean;
3226
- scqaScore: number;
3227
- starMomentIndex: number | null;
3228
- starMomentContent: string | null;
3229
- emotionalArc: EmotionalPosition[];
3230
- emotionalScore: number;
3231
- overallNarrativeScore: number;
3232
- recommendations: string[];
3233
- kbQueriesUsed: number;
697
+ interface SlideLayout {
698
+ name: string;
699
+ purpose: string;
700
+ elements: string[];
701
+ wordLimit?: number;
702
+ grid?: {
703
+ columns: number;
704
+ rows?: number;
705
+ gap: string;
706
+ };
3234
707
  }
3235
- /**
3236
- * NarrativeAnalyzer - Analyzes and enforces story structure
3237
- */
3238
- declare class NarrativeAnalyzer {
3239
- private orchestrator;
3240
- private sparklineKB;
3241
- private scqaKB;
3242
- private starMomentKB;
3243
- private knaflicKB;
3244
- private galloKB;
3245
- private andersonKB;
3246
- private queryCount;
708
+ interface VisualTheme {
709
+ presentationType: PresentationType;
710
+ mode: 'keynote' | 'business';
711
+ palette: ColorPalette;
712
+ typography: Typography;
713
+ layout: LayoutRules;
714
+ gradients: GradientDefinition[];
715
+ cssVariables: Record<string, string>;
716
+ }
717
+ declare class VisualDesignSystem {
718
+ private kb;
3247
719
  private initialized;
3248
720
  constructor();
3249
721
  /**
3250
- * Initialize by loading all narrative frameworks from KB
3251
- * OPTIMIZATION: Only initialize once - cached data is reused
722
+ * Initialize the design system (loads KB)
3252
723
  */
3253
724
  initialize(): Promise<void>;
3254
725
  /**
3255
- * Analyze the narrative structure of content
3256
- */
3257
- analyzeNarrative(analysis: ContentAnalysis, mode: PresentationMode): Promise<PresentationNarrativeAnalysis>;
3258
- /**
3259
- * Analyze a single section's narrative position
3260
- */
3261
- private analyzeSection;
3262
- /**
3263
- * Classify content into Sparkline stage
3264
- * Based on KB: story_frameworks.sparkline
3265
- */
3266
- private classifySparklineStage;
3267
- /**
3268
- * Classify content into SCQA stage
3269
- * Based on KB: story_frameworks.scqa, experts.barbara_minto.scqa_framework
3270
- */
3271
- private classifySCQAStage;
3272
- /**
3273
- * Classify emotional position and intensity
3274
- * Based on KB: persuasion_psychology, experts.nancy_duarte.core_principles
3275
- */
3276
- private classifyEmotionalPosition;
3277
- /**
3278
- * Check if section is a STAR moment candidate
3279
- * Based on KB: experts.nancy_duarte.core_teachings.star_moment
726
+ * Get complete visual theme for a presentation type.
3280
727
  */
3281
- private isSTARMomentCandidate;
728
+ getTheme(type: PresentationType): Promise<VisualTheme>;
3282
729
  /**
3283
- * Determine the narrative function of a section
730
+ * Determine mode (keynote vs business) for a presentation type.
3284
731
  */
3285
- private determineNarrativeFunction;
732
+ private getModeForType;
3286
733
  /**
3287
- * Find the best STAR moment in the presentation
734
+ * Get color palette for presentation type from KB.
3288
735
  */
3289
- private findSTARMoment;
736
+ private getPaletteForType;
3290
737
  /**
3291
- * Score the Sparkline flow
3292
- * Based on KB: story_frameworks.sparkline.stages
738
+ * Get typography rules for mode from KB.
3293
739
  */
3294
- private scoreSparklineFlow;
740
+ private getTypographyForMode;
3295
741
  /**
3296
- * Score the SCQA flow
3297
- * Based on KB: story_frameworks.scqa, experts.barbara_minto
742
+ * Get layout rules for mode from KB.
3298
743
  */
3299
- private scoreSCQAFlow;
744
+ private getLayoutRulesForMode;
3300
745
  /**
3301
- * Score the emotional arc
3302
- * Based on KB: persuasion_psychology, experts.nancy_duarte
746
+ * Get gradient definitions for presentation type.
3303
747
  */
3304
- private scoreEmotionalArc;
748
+ private getGradientsForType;
3305
749
  /**
3306
- * Generate recommendations for improving narrative
750
+ * Build CSS custom properties for the theme.
3307
751
  */
3308
- private generateRecommendations;
752
+ private buildCSSVariables;
3309
753
  /**
3310
- * Get recommended Sparkline structure for a presentation
3311
- * Based on KB: story_frameworks.sparkline
754
+ * Get slide layout templates from KB.
3312
755
  */
3313
- getRecommendedSparklineStructure(slideCount: number): SparklineStage[];
756
+ getSlideLayouts(type: PresentationType): Promise<SlideLayout[]>;
3314
757
  /**
3315
- * Get recommended SCQA structure based on mode
3316
- * Based on KB: story_frameworks.scqa, experts.barbara_minto
758
+ * Generate complete CSS for the theme.
3317
759
  */
3318
- getRecommendedSCQAStructure(slideCount: number, mode: PresentationMode): SCQAStage[];
760
+ generateCSS(theme: VisualTheme): string;
761
+ private lightenColor;
762
+ private darkenColor;
763
+ private hexToRgb;
3319
764
  /**
3320
- * Get total KB queries made
765
+ * Get contrasting text color for a given background color.
766
+ * Returns white or black based on luminance.
3321
767
  */
3322
- getQueryCount(): number;
768
+ private getContrastColor;
3323
769
  }
3324
- declare function getNarrativeAnalyzer(): NarrativeAnalyzer;
770
+ declare function getVisualDesignSystem(): VisualDesignSystem;
771
+ declare function initVisualDesignSystem(): Promise<VisualDesignSystem>;
3325
772
 
3326
773
  /**
3327
- * ExpertValidator - Validates Slides Against ALL Expert Methodologies
3328
- *
3329
- * THIS MODULE VALIDATES OUTPUT AGAINST THE COMPLETE KNOWLEDGE BASE.
3330
- *
3331
- * ALL validation rules come from the KB - NO hardcoded thresholds.
3332
- *
3333
- * Validates against 40+ expert methodologies including:
3334
- *
3335
- * DATA VISUALIZATION:
3336
- * - Edward Tufte (Data-Ink Ratio, Chartjunk elimination)
3337
- * - Cole Nussbaumer Knaflic (Storytelling with Data)
3338
- * - Scott Berinato (Good Charts)
3339
- *
3340
- * PRESENTATION DESIGN:
3341
- * - Nancy Duarte (Glance Test, STAR moments, Sparkline)
3342
- * - Garr Reynolds (Signal-to-Noise, Presentation Zen)
3343
- * - Carmine Gallo (Rule of Three, 18 minutes)
3344
- * - Chris Anderson (One Idea, Dead Laptop Test)
3345
- * - Guy Kawasaki (10/20/30 Rule)
3346
- *
3347
- * BUSINESS COMMUNICATION:
3348
- * - Barbara Minto (Pyramid Principle, MECE, Action Titles)
3349
- * - McKinsey/BCG/Bain (Consulting standards)
3350
- * - Analyst Academy (SCQA Framework)
3351
- *
3352
- * COGNITIVE SCIENCE:
3353
- * - George Miller (7±2 items)
3354
- * - John Sweller (Cognitive Load Theory)
3355
- * - Gestalt Psychology (Proximity, Similarity, etc.)
774
+ * SlideQualityReviewer - THE HEART OF THE QUALITATIVE REVIEW SYSTEM
3356
775
  *
3357
- * PERSUASION:
3358
- * - Robert Cialdini (6 Principles of Influence)
3359
- * - Daniel Kahneman (System 1/2)
3360
- * - Chip & Dan Heath (Made to Stick - SUCCESs)
776
+ * This is NOT a mechanical checker. It evaluates REAL quality.
777
+ * A slide ONLY passes at 95+ if:
778
+ * 1. You would personally present it without changes
779
+ * 2. It follows expert principles (Duarte, Reynolds, Tufte)
780
+ * 3. It looks professionally designed
781
+ * 4. It clearly communicates its message
782
+ * 5. It fits the overall presentation
3361
783
  *
3362
- * ACCESSIBILITY:
3363
- * - WCAG 2.1 Standards
3364
- *
3365
- * The knowledge base IS the brain. This code is just plumbing.
784
+ * ALL rules come from the Knowledge Base. NO hardcoded fallbacks.
3366
785
  */
3367
786
 
3368
- interface ValidationCheck {
3369
- expert: string;
3370
- principle: string;
3371
- kbPath: string;
3372
- passed: boolean;
787
+ type QualityLevel = 'excellent' | 'good' | 'acceptable' | 'poor' | 'failing';
788
+ interface QualitativeAssessment {
789
+ /** Score (0-100) */
3373
790
  score: number;
3374
- message: string;
3375
- remediation?: string | undefined;
3376
- }
3377
- interface SlideValidation {
3378
- slideIndex: number;
3379
- slideTitle: string;
3380
- checks: ValidationCheck[];
3381
- overallScore: number;
3382
- passed: boolean;
3383
- criticalFailures: string[];
791
+ /** Quality level */
792
+ level: QualityLevel;
793
+ /** WHY this score - specific reasoning */
794
+ reasoning: string;
795
+ /** KB reference for this assessment */
796
+ kbReference?: string;
3384
797
  }
3385
- interface PresentationValidation {
3386
- slides: SlideValidation[];
3387
- overallScore: number;
3388
- passed: boolean;
3389
- expertScores: Record<string, number>;
3390
- categoryScores: {
3391
- dataVisualization: number;
3392
- presentationDesign: number;
3393
- businessCommunication: number;
3394
- cognitiveScience: number;
3395
- persuasion: number;
3396
- accessibility: number;
798
+ interface QualitativeSlideReview {
799
+ /** Overall qualitative score (0-100, must be >= 95) */
800
+ score: number;
801
+ /** Would you be proud to present this? */
802
+ wouldPresent: boolean;
803
+ /** Detailed qualitative assessments */
804
+ assessments: {
805
+ visualImpact: QualitativeAssessment;
806
+ contentClarity: QualitativeAssessment;
807
+ layoutBalance: QualitativeAssessment;
808
+ typographyHierarchy: QualitativeAssessment;
809
+ whitespaceUsage: QualitativeAssessment;
810
+ colorHarmony: QualitativeAssessment;
811
+ audienceAppropriate: QualitativeAssessment;
3397
812
  };
3398
- kbQueriesUsed: number;
3399
- criticalIssues: string[];
3400
- recommendations: string[];
813
+ /** Specific issues found */
814
+ issues: QualityIssue[];
815
+ /** What would make this slide better */
816
+ improvements: string[];
817
+ }
818
+ interface QualityIssue {
819
+ severity: 'critical' | 'major' | 'minor';
820
+ category: 'visual' | 'content' | 'layout' | 'typography' | 'accessibility';
821
+ issue: string;
822
+ fix: string;
823
+ kbReference?: string;
3401
824
  }
3402
- /**
3403
- * ExpertValidator - Validates against all expert methodologies
3404
- */
3405
- declare class ExpertValidator {
3406
- private orchestrator;
3407
- private queryCount;
825
+ declare class SlideQualityReviewer {
826
+ private kb;
827
+ private initialized;
828
+ private wordLimits;
829
+ private whitespaceRules;
830
+ private bulletLimit;
831
+ private glanceTestSeconds;
832
+ private hasCialdini;
833
+ private hasGestalt;
834
+ private hasTufteDataInk;
835
+ private chartjunkToAvoid;
3408
836
  constructor();
3409
- /**
3410
- * Initialize the validator
3411
- */
3412
837
  initialize(): Promise<void>;
3413
838
  /**
3414
- * Validate an entire presentation
3415
- */
3416
- validatePresentation(slides: Slide[], mode: PresentationMode): Promise<PresentationValidation>;
3417
- /**
3418
- * Validate a single slide against all expert principles
3419
- */
3420
- private validateSlide;
3421
- /**
3422
- * Validate Tufte's Data-Ink Ratio
3423
- * KB: data_visualization_experts.edward_tufte.core_principles.data_ink_ratio
3424
- */
3425
- private validateTufteDataInk;
3426
- /**
3427
- * Validate Tufte's Chartjunk elimination
3428
- * KB: data_visualization_experts.edward_tufte.core_principles.chartjunk
839
+ * Review a slide qualitatively.
3429
840
  */
3430
- private validateTufteChartjunk;
841
+ review(slide: Slide, presentationType: PresentationType): Promise<QualitativeSlideReview>;
3431
842
  /**
3432
- * Validate Knaflic's principles
3433
- * KB: data_visualization_experts.cole_nussbaumer_knaflic.six_key_principles
843
+ * Convert qualitative review to SlideScore format.
3434
844
  */
3435
- private validateKnaflicPrinciples;
845
+ toSlideScore(review: QualitativeSlideReview): SlideScore;
846
+ private loadRulesForType;
3436
847
  /**
3437
- * Validate Duarte's Glance Test
3438
- * KB: quality_metrics.glance_test, experts.nancy_duarte
848
+ * Visual Impact (25%): Does this slide command attention appropriately?
3439
849
  */
3440
- private validateDuarteGlanceTest;
850
+ private assessVisualImpact;
3441
851
  /**
3442
- * Validate Reynolds' Signal-to-Noise ratio
3443
- * KB: experts.garr_reynolds.core_principles.signal_to_noise
852
+ * Content Clarity (20%): Can you understand the message in 3 seconds?
3444
853
  */
3445
- private validateReynoldsSignalNoise;
854
+ private assessContentClarity;
3446
855
  /**
3447
- * Validate Gallo's Rule of Three
3448
- * KB: experts.carmine_gallo.core_principles.rule_of_three
856
+ * Get all text content from a slide for analysis.
3449
857
  */
3450
- private validateGalloRuleOfThree;
858
+ private getAllTextContent;
3451
859
  /**
3452
- * Validate Anderson's One Idea principle
3453
- * KB: experts.chris_anderson.core_principles.one_idea
860
+ * Layout Balance (15%): Is visual weight distributed appropriately?
3454
861
  */
3455
- private validateAndersonOneIdea;
862
+ private assessLayoutBalance;
3456
863
  /**
3457
- * Validate Minto's Action Titles
3458
- * KB: experts.barbara_minto, presentation_modes.business
864
+ * Typography Hierarchy (15%): Is there clear primary/secondary/tertiary hierarchy?
3459
865
  */
3460
- private validateMintoActionTitles;
866
+ private assessTypographyHierarchy;
3461
867
  /**
3462
- * Validate Minto's MECE principle
3463
- * KB: experts.barbara_minto.mece_principle
868
+ * Whitespace Usage (10%): Is whitespace used purposefully?
3464
869
  */
3465
- private validateMintoMECE;
870
+ private assessWhitespaceUsage;
3466
871
  /**
3467
- * Validate Horizontal Logic (titles tell the story)
3468
- * KB: data_visualization_experts.cole_nussbaumer_knaflic.horizontal_vertical_logic
872
+ * Color Harmony (10%): Do colors work together within the theme?
3469
873
  */
3470
- private validateHorizontalLogic;
874
+ private assessColorHarmony;
3471
875
  /**
3472
- * Validate Miller's Law (7±2 items)
3473
- * KB: cognitive_science.millers_law
876
+ * Audience Appropriateness (5%): Is the visual style right for this audience?
3474
877
  */
3475
- private validateMillersLaw;
878
+ private assessAudienceAppropriate;
879
+ private isMinimalType;
880
+ private isDenseType;
881
+ private countWords;
882
+ private countLongWords;
3476
883
  /**
3477
- * Validate Cognitive Load
3478
- * KB: cognitive_science.cognitive_load_theory
884
+ * Detect raw markdown syntax that should have been rendered to HTML.
885
+ * Returns array of issue descriptions.
3479
886
  */
3480
- private validateCognitiveLoad;
887
+ private detectRawMarkdown;
3481
888
  /**
3482
- * Validate Gestalt Proximity principle
3483
- * KB: gestalt_principles.proximity
889
+ * Check if slide type is appropriate for its content.
890
+ * Returns issue description if mismatched.
3484
891
  */
3485
- private validateGestaltProximity;
892
+ private checkSlideTypeMismatch;
893
+ private scoreToLevel;
894
+ private collectIssues;
895
+ private mapAssessmentToCategory;
896
+ private mapIssueCategory;
897
+ private generateImprovements;
898
+ private createCategoryScore;
899
+ }
900
+ declare function getSlideQualityReviewer(): SlideQualityReviewer;
901
+ declare function initSlideQualityReviewer(): Promise<SlideQualityReviewer>;
902
+
903
+ /**
904
+ * DeckQualityReviewer - HOLISTIC DECK QUALITY REVIEW
905
+ *
906
+ * After all slides pass individual review, this evaluates the deck as a whole:
907
+ * 1. Narrative Flow (30%) - Does it tell a coherent story?
908
+ * 2. Visual Consistency (25%) - Is the same theme applied throughout?
909
+ * 3. Pacing & Rhythm (20%) - Is there variety and appropriate density?
910
+ * 4. Opening & Closing (15%) - Are first/last slides the strongest?
911
+ * 5. Overall Impression (10%) - Would you hire/invest based on this?
912
+ *
913
+ * ALL rules come from the Knowledge Base. NO hardcoded fallbacks.
914
+ */
915
+
916
+ type DeckQualityLevel = 'excellent' | 'good' | 'acceptable' | 'poor' | 'failing';
917
+ interface DeckAssessment {
918
+ /** Score (0-100) */
919
+ score: number;
920
+ /** Quality level */
921
+ level: DeckQualityLevel;
922
+ /** WHY this score - specific reasoning */
923
+ reasoning: string;
924
+ /** KB reference for this assessment */
925
+ kbReference?: string;
926
+ }
927
+ interface QualitativeDeckReview {
928
+ /** Overall deck score (0-100, must be >= 95) */
929
+ score: number;
930
+ /** Would this deck impress the target audience? */
931
+ wouldImpress: boolean;
932
+ /** Detailed assessments */
933
+ assessments: {
934
+ narrativeFlow: DeckAssessment;
935
+ visualConsistency: DeckAssessment;
936
+ pacingRhythm: DeckAssessment;
937
+ openingClosing: DeckAssessment;
938
+ overallImpression: DeckAssessment;
939
+ };
940
+ /** Individual slide reviews */
941
+ slideReviews: QualitativeSlideReview[];
942
+ /** Deck-level issues */
943
+ issues: DeckIssue[];
944
+ /** Deck-level improvements */
945
+ improvements: string[];
946
+ }
947
+ interface DeckIssue {
948
+ severity: 'critical' | 'major' | 'minor';
949
+ category: 'narrative' | 'visual' | 'pacing' | 'structure';
950
+ issue: string;
951
+ fix: string;
952
+ affectedSlides?: number[];
953
+ kbReference?: string;
954
+ }
955
+ declare class DeckQualityReviewer {
956
+ private kb;
957
+ private slideReviewer;
958
+ private initialized;
959
+ private requiredElements;
960
+ private antiPatterns;
961
+ private hasSparkline;
962
+ private hasSCQA;
963
+ constructor();
964
+ initialize(): Promise<void>;
3486
965
  /**
3487
- * Validate word count
3488
- * KB: presentation_modes.[mode].characteristics.words_per_slide
966
+ * Review the entire deck qualitatively.
3489
967
  */
3490
- private validateWordCount;
968
+ review(slides: Slide[], presentationType: PresentationType): Promise<QualitativeDeckReview>;
3491
969
  /**
3492
- * Validate accessibility basics
3493
- * KB: accessibility
970
+ * Convert qualitative review to DeckScore format.
3494
971
  */
3495
- private validateAccessibility;
972
+ toDeckScore(review: QualitativeDeckReview): DeckScore;
973
+ private loadRulesForType;
3496
974
  /**
3497
- * Get all text content from a slide
975
+ * Narrative Flow (30%): Does the presentation tell a coherent story?
3498
976
  */
3499
- private getSlideContent;
977
+ private assessNarrativeFlow;
3500
978
  /**
3501
- * Count words in a slide
979
+ * Visual Consistency (25%): Is the same theme applied throughout?
3502
980
  */
3503
- private countWords;
981
+ private assessVisualConsistency;
3504
982
  /**
3505
- * Calculate scores by expert
983
+ * Pacing & Rhythm (20%): Is there variety in slide types and density?
3506
984
  */
3507
- private calculateExpertScores;
985
+ private assessPacingRhythm;
3508
986
  /**
3509
- * Calculate category scores
987
+ * Opening & Closing (15%): Are the first and last slides the strongest?
3510
988
  */
3511
- private calculateCategoryScores;
3512
- private avgScore;
989
+ private assessOpeningClosing;
3513
990
  /**
3514
- * Aggregate critical issues across all slides
991
+ * Overall Impression (10%): Would you hire/invest based on this?
3515
992
  */
3516
- private aggregateCriticalIssues;
993
+ private assessOverallImpression;
994
+ private scoreToLevel;
995
+ private calculateVariance;
996
+ private getMissingRequiredElements;
997
+ private collectDeckIssues;
998
+ private mapAssessmentToCategory;
999
+ private mapDeckCategory;
1000
+ private generateDeckImprovements;
1001
+ private calculateRequiredElementsScore;
1002
+ private calculateAntiPatternScore;
1003
+ }
1004
+ declare function getDeckQualityReviewer(): DeckQualityReviewer;
1005
+ declare function initDeckQualityReviewer(): Promise<DeckQualityReviewer>;
1006
+
1007
+ /**
1008
+ * Remediator - Fix Failing Slides
1009
+ *
1010
+ * When a slide fails qualitative review (< 95), this module attempts to fix it.
1011
+ * Maximum 3 remediation attempts per slide.
1012
+ *
1013
+ * Remediation strategies are based on the specific quality issues identified:
1014
+ * - Visual Impact: Increase title prominence, add visual elements
1015
+ * - Content Clarity: Reduce word count, simplify messaging
1016
+ * - Layout Balance: Redistribute content, improve alignment
1017
+ * - Typography Hierarchy: Adjust text sizes, create clearer hierarchy
1018
+ * - Whitespace Usage: Remove content or split slide
1019
+ * - Color Harmony: Ensure colors match theme
1020
+ * - Audience Appropriateness: Adjust density for audience
1021
+ *
1022
+ * ALL rules come from the Knowledge Base. NO hardcoded fallbacks.
1023
+ */
1024
+
1025
+ interface RemediationResult {
1026
+ /** Was remediation successful? */
1027
+ success: boolean;
1028
+ /** Original slide */
1029
+ originalSlide: Slide;
1030
+ /** Remediated slide (or original if failed) */
1031
+ remediatedSlide: Slide;
1032
+ /** Number of attempts made */
1033
+ attempts: number;
1034
+ /** Final score after remediation */
1035
+ finalScore: number;
1036
+ /** Review after remediation */
1037
+ finalReview: QualitativeSlideReview;
1038
+ /** Actions taken during remediation */
1039
+ actions: RemediationAction[];
1040
+ /** Why remediation failed (if it did) */
1041
+ failureReason?: string;
1042
+ }
1043
+ interface RemediationAction {
1044
+ /** What was done */
1045
+ action: string;
1046
+ /** Which issue it addressed */
1047
+ targetIssue: string;
1048
+ /** Score before this action */
1049
+ scoreBefore: number;
1050
+ /** Score after this action */
1051
+ scoreAfter: number;
1052
+ /** Was this action effective? */
1053
+ effective: boolean;
1054
+ }
1055
+ declare class Remediator {
1056
+ private kb;
1057
+ private reviewer;
1058
+ private initialized;
1059
+ private wordLimits;
1060
+ private bulletLimit;
1061
+ private maxAttempts;
1062
+ private targetScore;
1063
+ constructor();
1064
+ initialize(): Promise<void>;
3517
1065
  /**
3518
- * Generate recommendations based on validation results
1066
+ * Attempt to remediate a failing slide.
3519
1067
  */
3520
- private generateRecommendations;
1068
+ remediate(slide: Slide, presentationType: PresentationType, initialReview: QualitativeSlideReview): Promise<RemediationResult>;
3521
1069
  /**
3522
- * Get query count
1070
+ * Batch remediate multiple slides.
3523
1071
  */
3524
- getQueryCount(): number;
1072
+ remediateBatch(slides: Slide[], reviews: QualitativeSlideReview[], presentationType: PresentationType): Promise<RemediationResult[]>;
1073
+ private loadRulesForType;
1074
+ private prioritizeIssues;
1075
+ private applyFix;
1076
+ private fixVisualIssue;
1077
+ private fixContentIssue;
1078
+ private fixLayoutIssue;
1079
+ private fixTypographyIssue;
1080
+ private fixAccessibilityIssue;
1081
+ private cloneSlide;
1082
+ private truncateToWords;
1083
+ private isMinimalType;
1084
+ private countWords;
3525
1085
  }
3526
- declare function getExpertValidator(): ExpertValidator;
1086
+ declare function getRemediator(): Remediator;
1087
+ declare function initRemediator(): Promise<Remediator>;
3527
1088
 
3528
1089
  /**
3529
- * PersuasionEngine - Applies Persuasion Psychology to Presentations
1090
+ * Renderer - Premium HTML/PPTX Output Generation
3530
1091
  *
3531
- * THIS MODULE ENHANCES PRESENTATIONS WITH PSYCHOLOGICAL PERSUASION.
1092
+ * Renders slides to high-quality outputs:
1093
+ * - HTML: Reveal.js with premium CSS from KB
1094
+ * - PPTX: PowerPoint (future implementation)
3532
1095
  *
3533
- * ALL decisions flow through the KnowledgeOrchestrator - NO hardcoding.
3534
- *
3535
- * Implements frameworks from:
3536
- *
3537
- * ROBERT CIALDINI - 6 Principles of Influence:
3538
- * - Reciprocity: Give value first
3539
- * - Commitment/Consistency: Build on prior agreements
3540
- * - Social Proof: Show what others are doing
3541
- * - Authority: Cite credible experts
3542
- * - Liking: Create rapport and common ground
3543
- * - Scarcity: Highlight limited opportunities
3544
- *
3545
- * DANIEL KAHNEMAN - Dual Process Theory:
3546
- * - System 1: Fast, intuitive, emotional
3547
- * - System 2: Slow, deliberate, rational
3548
- * - Cognitive biases and heuristics
3549
- *
3550
- * CHIP & DAN HEATH - Made to Stick (SUCCESs):
3551
- * - Simple: Find the core
3552
- * - Unexpected: Break patterns
3553
- * - Concrete: Use specific examples
3554
- * - Credible: Cite proof
3555
- * - Emotional: Appeal to feelings
3556
- * - Stories: Use narrative
3557
- *
3558
- * ARISTOTLE - Rhetoric:
3559
- * - Ethos: Credibility
3560
- * - Pathos: Emotion
3561
- * - Logos: Logic
3562
- *
3563
- * The knowledge base IS the brain. This code is just plumbing.
1096
+ * ALL styling comes from the Knowledge Base and VisualDesignSystem.
1097
+ * NO hardcoded styles.
3564
1098
  */
3565
1099
 
3566
- type CialdiniPrinciple = 'reciprocity' | 'commitment_consistency' | 'social_proof' | 'authority' | 'liking' | 'scarcity';
3567
- type KahnemanSystem = 'system_1' | 'system_2';
3568
- type HeathPrinciple = 'simple' | 'unexpected' | 'concrete' | 'credible' | 'emotional' | 'stories';
3569
- type AristotleAppeal = 'ethos' | 'pathos' | 'logos';
3570
- interface PersuasionOpportunity {
3571
- principle: CialdiniPrinciple | HeathPrinciple | AristotleAppeal;
3572
- source: string;
3573
- kbPath: string;
3574
- location: 'title' | 'subtitle' | 'bullet' | 'content';
3575
- originalText: string;
3576
- enhancedText: string;
3577
- reasoning: string;
3578
- confidence: number;
3579
- }
3580
- interface SectionPersuasionAnalysis {
3581
- section: ExtractedSection;
3582
- cialdiniOpportunities: Map<CialdiniPrinciple, PersuasionOpportunity[]>;
3583
- heathAlignment: Map<HeathPrinciple, number>;
3584
- kahnemanTarget: KahnemanSystem;
3585
- aristotleBalance: Record<AristotleAppeal, number>;
3586
- overallPersuasivenessScore: number;
3587
- recommendations: string[];
3588
- }
3589
- interface PresentationPersuasionAnalysis {
3590
- sections: SectionPersuasionAnalysis[];
3591
- cialdiniUsage: Record<CialdiniPrinciple, number>;
3592
- heathScore: number;
3593
- kahnemanBalance: {
3594
- system1: number;
3595
- system2: number;
3596
- };
3597
- aristotleBalance: Record<AristotleAppeal, number>;
3598
- overallPersuasivenessScore: number;
3599
- topOpportunities: PersuasionOpportunity[];
3600
- kbQueriesUsed: number;
1100
+ interface RenderOptions {
1101
+ /** Presentation title */
1102
+ title: string;
1103
+ /** Author name */
1104
+ author?: string;
1105
+ /** Presentation type */
1106
+ presentationType: PresentationType;
1107
+ /** Metadata */
1108
+ metadata?: PresentationMetadata;
1109
+ /** Local images to use as backgrounds */
1110
+ images?: string[];
1111
+ /** Base path for resolving relative image paths */
1112
+ imageBasePath?: string;
1113
+ }
1114
+ interface RenderResult {
1115
+ html?: string;
1116
+ pptx?: Buffer;
3601
1117
  }
3602
- /**
3603
- * PersuasionEngine - Applies persuasion psychology
3604
- */
3605
- declare class PersuasionEngine {
3606
- private orchestrator;
3607
- private cialdiniKB;
3608
- private kahnemanKB;
3609
- private heathKB;
3610
- private queryCount;
1118
+ declare class Renderer {
1119
+ private kb;
1120
+ private vds;
3611
1121
  private initialized;
1122
+ private readonly slideImageKeywords;
3612
1123
  constructor();
3613
- /**
3614
- * Initialize by loading all persuasion frameworks from KB
3615
- * OPTIMIZATION: Only initialize once - cached data is reused
3616
- */
3617
1124
  initialize(): Promise<void>;
3618
1125
  /**
3619
- * Analyze content for persuasion opportunities
3620
- */
3621
- analyzePersuasion(sections: ExtractedSection[], mode: PresentationMode): Promise<PresentationPersuasionAnalysis>;
3622
- /**
3623
- * Analyze a single section for persuasion
1126
+ * Render slides to specified formats.
3624
1127
  */
3625
- private analyzeSection;
1128
+ render(slides: Slide[], formats: OutputFormat[], options: RenderOptions): Promise<RenderResult>;
1129
+ private renderHTML;
1130
+ private generateCSS;
1131
+ private renderSlide;
1132
+ private renderTitleSlide;
1133
+ private renderSectionDivider;
1134
+ private renderMetricsSlide;
1135
+ private renderQuoteSlide;
1136
+ private renderStarMomentSlide;
1137
+ private renderCTASlide;
1138
+ private renderThankYouSlide;
1139
+ private renderTwoColumnSlide;
1140
+ private renderThreeColumnSlide;
1141
+ private renderContentSlide;
1142
+ private renderPPTX;
1143
+ private formatCSSVariables;
1144
+ private escapeHTML;
3626
1145
  /**
3627
- * Find Cialdini principle opportunities
3628
- * KB: persuasion_psychology.cialdini_principles
1146
+ * Generate a background image URL based on slide type and content.
1147
+ * Priority: 1) slide.data.image, 2) local images array, 3) Picsum fallback
3629
1148
  */
3630
- private findCialdiniOpportunities;
1149
+ private getBackgroundImageUrl;
3631
1150
  /**
3632
- * Analyze Heath Brothers' SUCCESs alignment
3633
- * KB: persuasion_psychology.heath_brothers
1151
+ * Resolve an image path - handles relative paths, absolute paths, and URLs.
3634
1152
  */
3635
- private analyzeHeathAlignment;
1153
+ private resolveImagePath;
3636
1154
  /**
3637
- * Determine Kahneman System target
3638
- * KB: persuasion_psychology.kahneman_systems
1155
+ * Generate fallback image URL using Picsum with smart seeding.
3639
1156
  */
3640
- private determineKahnemanTarget;
1157
+ private getFallbackImageUrl;
3641
1158
  /**
3642
- * Analyze Aristotle's rhetorical balance
3643
- * KB: persuasion_psychology.aristotle
1159
+ * Convert markdown syntax to HTML.
1160
+ * Handles: bold, italic, code, links, and basic formatting.
1161
+ * Called BEFORE escapeHTML to preserve markdown-generated HTML tags.
3644
1162
  */
3645
- private analyzeAristotleBalance;
1163
+ private renderMarkdown;
3646
1164
  /**
3647
- * Calculate section persuasiveness score
1165
+ * Clean up broken/truncated markdown that can't be properly rendered.
1166
+ * Removes partial code blocks, inline tables, etc.
3648
1167
  */
3649
- private calculateSectionPersuasiveness;
1168
+ private cleanBrokenMarkdown;
3650
1169
  /**
3651
- * Generate recommendations for a section
1170
+ * Render markdown tables to HTML tables.
3652
1171
  */
3653
- private generateSectionRecommendations;
1172
+ private renderMarkdownTables;
3654
1173
  /**
3655
- * Aggregate Cialdini usage across sections
1174
+ * Build an HTML table from markdown table rows.
3656
1175
  */
3657
- private aggregateCialdiniUsage;
1176
+ private buildHTMLTable;
1177
+ }
1178
+ declare function getRenderer(): Renderer;
1179
+ declare function initRenderer(): Promise<Renderer>;
1180
+
1181
+ /**
1182
+ * NanoBanana Pro Image Generation Provider
1183
+ *
1184
+ * Integrates with Google Gemini's image generation capabilities via NanoBanana Pro.
1185
+ * Generates high-quality hero images, concept illustrations, and visual assets
1186
+ * for presentation slides.
1187
+ *
1188
+ * Requires: GOOGLE_AI_API_KEY environment variable
1189
+ *
1190
+ * Usage:
1191
+ * const provider = createNanoBananaProvider();
1192
+ * if (await provider.isAvailable()) {
1193
+ * const imageUrl = await provider.generateHeroImage('AI revolution');
1194
+ * }
1195
+ */
1196
+ interface ImageGenerationRequest {
1197
+ /** The concept or topic to visualize */
1198
+ concept: string;
1199
+ /** Image style/type */
1200
+ style: 'hero' | 'concept' | 'icon' | 'background' | 'diagram';
1201
+ /** Presentation type for context */
1202
+ presentationType?: string;
1203
+ /** Aspect ratio */
1204
+ aspectRatio?: '16:9' | '4:3' | '1:1' | '9:16';
1205
+ /** Color scheme preference */
1206
+ colorScheme?: 'dark' | 'light' | 'vibrant' | 'muted';
1207
+ }
1208
+ interface ImageGenerationResult {
1209
+ /** Whether generation succeeded */
1210
+ success: boolean;
1211
+ /** Generated image URL or base64 data */
1212
+ imageUrl?: string;
1213
+ /** Base64 encoded image data */
1214
+ imageData?: string;
1215
+ /** MIME type of the image */
1216
+ mimeType?: string;
1217
+ /** Error message if failed */
1218
+ error?: string;
1219
+ /** Prompt used for generation */
1220
+ promptUsed?: string;
1221
+ }
1222
+ interface NanoBananaConfig {
1223
+ /** Google AI API key (defaults to GOOGLE_AI_API_KEY env var) */
1224
+ apiKey?: string;
1225
+ /** Model to use (defaults to gemini-2.0-flash-exp for image generation) */
1226
+ model?: string;
1227
+ /** Timeout in milliseconds */
1228
+ timeout?: number;
1229
+ /** Enable verbose logging */
1230
+ verbose?: boolean;
1231
+ }
1232
+ /**
1233
+ * NanoBanana Pro image generation provider.
1234
+ * Uses Google Gemini's image generation capabilities.
1235
+ */
1236
+ declare class NanoBananaProvider {
1237
+ readonly name = "NanoBanana Pro";
1238
+ private apiKey;
1239
+ private model;
1240
+ private timeout;
1241
+ private verbose;
1242
+ constructor(config?: NanoBananaConfig);
3658
1243
  /**
3659
- * Calculate overall Heath SUCCESs score
1244
+ * Check if NanoBanana is available (API key present).
3660
1245
  */
3661
- private calculateHeathScore;
1246
+ isAvailable(): Promise<boolean>;
3662
1247
  /**
3663
- * Calculate Kahneman balance
1248
+ * Generate a hero image for a slide.
3664
1249
  */
3665
- private calculateKahnemanBalance;
1250
+ generateHeroImage(concept: string): Promise<ImageGenerationResult>;
3666
1251
  /**
3667
- * Calculate Aristotle balance across presentation
1252
+ * Generate a concept illustration.
3668
1253
  */
3669
- private calculateAristotleBalance;
1254
+ generateConceptImage(concept: string): Promise<ImageGenerationResult>;
3670
1255
  /**
3671
- * Calculate overall persuasiveness score
1256
+ * Generate an icon or symbol.
3672
1257
  */
3673
- private calculateOverallPersuasiveness;
1258
+ generateIcon(concept: string): Promise<ImageGenerationResult>;
3674
1259
  /**
3675
- * Find top persuasion opportunities
1260
+ * Generate a background image.
3676
1261
  */
3677
- private findTopOpportunities;
1262
+ generateBackground(concept: string, colorScheme?: 'dark' | 'light'): Promise<ImageGenerationResult>;
3678
1263
  /**
3679
- * Get suggested persuasion enhancements for a slide
3680
- * Returns specific text suggestions based on KB principles
1264
+ * Generate an image based on request parameters.
3681
1265
  */
3682
- getSlideEnhancements(slide: Slide, mode: PresentationMode): Promise<{
3683
- enhancedTitle?: string | undefined;
3684
- enhancedBullets?: string[] | undefined;
3685
- persuasionTechniques: string[];
3686
- kbReferences: string[];
3687
- }>;
1266
+ generate(request: ImageGenerationRequest): Promise<ImageGenerationResult>;
3688
1267
  /**
3689
- * Get power words from KB
3690
- * KB: persuasion_psychology.power_words
1268
+ * Build an optimized prompt for image generation.
3691
1269
  */
3692
- getPowerWords(): Promise<{
3693
- urgency: string[];
3694
- exclusivity: string[];
3695
- emotion: string[];
3696
- authority: string[];
3697
- kbPath: string;
3698
- }>;
1270
+ private buildPrompt;
3699
1271
  /**
3700
- * Get query count
1272
+ * Call the Gemini API for image generation.
3701
1273
  */
3702
- getQueryCount(): number;
1274
+ private callGeminiAPI;
3703
1275
  }
3704
- declare function getPersuasionEngine(): PersuasionEngine;
3705
-
3706
1276
  /**
3707
- * Claude Presentation Master
3708
- *
3709
- * Generate world-class presentations using expert methodologies from
3710
- * Duarte, Reynolds, Gallo, and Anderson. Enforces rigorous quality
3711
- * standards through real visual validation.
3712
- *
3713
- * @packageDocumentation
3714
- * @module claude-presentation-master
3715
- * @author Stuart Kerr <stuart@isovision.ai>
3716
- * @license MIT
1277
+ * Create a new NanoBanana provider instance.
1278
+ */
1279
+ declare function createNanoBananaProvider(config?: NanoBananaConfig): NanoBananaProvider;
1280
+ /**
1281
+ * Get a pre-built prompt for a specific image type.
1282
+ * Useful for customization or debugging.
3717
1283
  */
1284
+ declare function getNanoBananaPrompt(style: 'hero' | 'concept' | 'icon' | 'background' | 'diagram', concept: string, presentationType?: string): string;
3718
1285
 
3719
1286
  /**
3720
- * Generate a presentation from content.
3721
- *
3722
- * @example
3723
- * ```typescript
3724
- * import { generate } from '@isovision/claude-presentation-master';
1287
+ * CodeQualityValidator - Detects Hardcoded Values in Source Code
3725
1288
  *
3726
- * const result = await generate({
3727
- * content: '# My Presentation\n\n...',
3728
- * contentType: 'markdown',
3729
- * mode: 'keynote',
3730
- * format: ['html', 'pptx'],
3731
- * qaThreshold: 95,
3732
- * title: 'My Amazing Presentation'
3733
- * });
1289
+ * This validator scans TypeScript/JavaScript source files for hardcoded CSS values,
1290
+ * colors, and dimensions that should be coming from the Knowledge Base.
3734
1291
  *
3735
- * console.log(`Score: ${result.score}/100`);
3736
- * ```
1292
+ * RATIONALE: ALL styling decisions must come from the KB. Hardcoded values:
1293
+ * 1. Break the single-source-of-truth principle
1294
+ * 2. Make theme changes inconsistent
1295
+ * 3. Bypass QA validation
1296
+ * 4. Create maintenance nightmares
3737
1297
  *
3738
- * @param config - Presentation configuration
3739
- * @returns Presentation result with outputs, QA results, and score
3740
- * @throws {ValidationError} If input validation fails
3741
- * @throws {QAFailureError} If QA score is below threshold
1298
+ * This validator catches these careless errors at build/test time.
1299
+ */
1300
+ interface HardcodedViolation {
1301
+ file: string;
1302
+ line: number;
1303
+ column: number;
1304
+ type: 'color' | 'dimension' | 'font' | 'shadow' | 'rgba' | 'gradient';
1305
+ value: string;
1306
+ context: string;
1307
+ severity: 'error' | 'warning';
1308
+ suggestion: string;
1309
+ }
1310
+ interface ValidationResult {
1311
+ passed: boolean;
1312
+ violations: HardcodedViolation[];
1313
+ summary: {
1314
+ totalFiles: number;
1315
+ filesWithViolations: number;
1316
+ totalViolations: number;
1317
+ byType: Record<string, number>;
1318
+ bySeverity: Record<string, number>;
1319
+ };
1320
+ }
1321
+ declare class CodeQualityValidator {
1322
+ private srcDir;
1323
+ private violations;
1324
+ constructor(srcDir: string);
1325
+ /**
1326
+ * Validate all TypeScript files in the source directory.
1327
+ */
1328
+ validate(): Promise<ValidationResult>;
1329
+ /**
1330
+ * Validate a single file for hardcoded values.
1331
+ */
1332
+ private validateFile;
1333
+ private checkForHexColors;
1334
+ private checkForRgbaColors;
1335
+ private checkForDimensions;
1336
+ private checkForGradients;
1337
+ private findTypeScriptFiles;
1338
+ private shouldSkipFile;
1339
+ private isExemptLine;
1340
+ private buildResult;
1341
+ /**
1342
+ * Format validation results for console output.
1343
+ */
1344
+ formatResults(result: ValidationResult): string;
1345
+ }
1346
+ /**
1347
+ * Run code quality validation on the source directory.
3742
1348
  */
3743
- declare function generate(config: PresentationConfig): Promise<PresentationResult>;
1349
+ declare function validateCodeQuality(srcDir: string): Promise<ValidationResult>;
3744
1350
  /**
3745
- * Validate an existing presentation.
3746
- *
3747
- * @example
3748
- * ```typescript
3749
- * import { validate } from '@isovision/claude-presentation-master';
3750
- * import fs from 'fs';
1351
+ * Run validation and print results to console.
1352
+ */
1353
+ declare function runCodeQualityCheck(srcDir: string): Promise<boolean>;
1354
+
1355
+ /**
1356
+ * Claude Presentation Master - Main API
3751
1357
  *
3752
- * const html = fs.readFileSync('presentation.html', 'utf-8');
3753
- * const result = await validate(html, { mode: 'keynote' });
1358
+ * Entry point for the qualitative-first presentation engine.
1359
+ * Every slide must score 95/100 based on REAL qualitative excellence.
3754
1360
  *
3755
- * console.log(`Score: ${result.score}/100`);
3756
- * console.log(`Passed: ${result.passed}`);
3757
- * ```
1361
+ * Flow:
1362
+ * 1. ContentAnalyzer -> Parse and detect structure
1363
+ * 2. SlideGenerator -> Generate slides with visual intent
1364
+ * 3. SlideQualityReviewer -> Qualitative review per slide (must pass 95)
1365
+ * 4. Remediator -> Fix failing slides (3 attempts max)
1366
+ * 5. DeckQualityReviewer -> Holistic deck review (must pass 95)
1367
+ * 6. Renderer -> Premium HTML/PPTX output
3758
1368
  *
3759
- * @param presentation - HTML string or file buffer
3760
- * @param options - Validation options
3761
- * @returns QA validation results
3762
- */
3763
- declare function validate(presentation: string | Buffer, options?: {
3764
- mode?: 'keynote' | 'business';
3765
- threshold?: number;
3766
- strictMode?: boolean;
3767
- }): Promise<QAResults & {
3768
- score: number;
3769
- }>;
3770
- /**
3771
- * Get the version of the package.
1369
+ * ALL decisions come from the Knowledge Base. NO hardcoded fallbacks.
3772
1370
  */
3773
- declare const VERSION = "3.0.1";
3774
1371
 
1372
+ declare const VERSION = "2.0.0";
1373
+ interface GenerateOptions {
1374
+ /** Input content (Markdown, text, etc.) */
1375
+ content: string;
1376
+ /** Content type */
1377
+ contentType?: 'markdown' | 'text';
1378
+ /** Output formats to generate */
1379
+ format?: OutputFormat[];
1380
+ /** Output directory */
1381
+ outputDir?: string;
1382
+ /** Presentation title (optional, will be detected from content) */
1383
+ title?: string;
1384
+ /** Author name */
1385
+ author?: string;
1386
+ /** Explicit presentation type (optional, will be detected from content) */
1387
+ presentationType?: PresentationType;
1388
+ /** Legacy mode (maps to presentation type) */
1389
+ mode?: PresentationMode;
1390
+ /** Minimum score threshold (default: 95) */
1391
+ qaThreshold?: number;
1392
+ /** Skip remediation (fail fast) */
1393
+ skipRemediation?: boolean;
1394
+ /** Verbose logging */
1395
+ verbose?: boolean;
1396
+ /** Local images to use as backgrounds (paths relative to output or absolute URLs) */
1397
+ images?: string[];
1398
+ /** Base path for resolving relative image paths */
1399
+ imageBasePath?: string;
1400
+ }
1401
+ interface GenerateResult {
1402
+ /** Generated outputs */
1403
+ outputs: {
1404
+ html?: string;
1405
+ pptx?: Buffer;
1406
+ };
1407
+ /** Final slides */
1408
+ slides: Slide[];
1409
+ /** Overall score (0-100) */
1410
+ score: number;
1411
+ /** Detailed deck score */
1412
+ deckScore?: QualitativeDeckReview | undefined;
1413
+ /** Metadata */
1414
+ metadata: {
1415
+ title: string;
1416
+ author: string;
1417
+ presentationType: PresentationType;
1418
+ generatedAt: string;
1419
+ slideCount: number;
1420
+ totalWords: number;
1421
+ avgWordsPerSlide: number;
1422
+ };
1423
+ /** Remediation results (if any slides were fixed) */
1424
+ remediations?: RemediationResult[] | undefined;
1425
+ /** Any warnings (non-fatal issues) */
1426
+ warnings?: string[] | undefined;
1427
+ }
3775
1428
  /**
3776
- * Default export for convenience.
1429
+ * Generate a presentation from content.
3777
1430
  *
3778
- * Now includes Knowledge-Driven Orchestration components:
3779
- * - getKnowledgeOrchestrator: Central brain that routes ALL decisions through KB
3780
- * - getNarrativeAnalyzer: Duarte Sparkline, STAR moments, SCQA analysis
3781
- * - getExpertValidator: Validates against 40+ expert methodologies
3782
- * - getPersuasionEngine: Cialdini, Kahneman, Heath Brothers
1431
+ * This is the main entry point. It orchestrates:
1432
+ * 1. Content analysis
1433
+ * 2. Slide generation
1434
+ * 3. Qualitative review (95/100 threshold)
1435
+ * 4. Remediation (3 attempts per failing slide)
1436
+ * 5. Deck-level review
1437
+ * 6. Rendering to HTML/PPTX
3783
1438
  */
3784
- declare const _default: {
3785
- generate: typeof generate;
3786
- validate: typeof validate;
3787
- PresentationEngine: typeof PresentationEngine;
3788
- QAEngine: typeof QAEngine;
3789
- PPTXValidator: typeof PPTXValidator;
3790
- AccessibilityValidator: typeof AccessibilityValidator;
3791
- VERSION: string;
3792
- getKnowledgeOrchestrator: typeof getKnowledgeOrchestrator;
3793
- getNarrativeAnalyzer: typeof getNarrativeAnalyzer;
3794
- getExpertValidator: typeof getExpertValidator;
3795
- getPersuasionEngine: typeof getPersuasionEngine;
3796
- };
1439
+ declare function generate(options: GenerateOptions): Promise<GenerateResult>;
3797
1440
 
3798
- export { type AccessibilityResults, AccessibilityValidator, type AgentAssessment, type AristotleAppeal, type AspectRatio, AutoRemediation, type ChartData, type ChartDataset, ChartJsProvider, type ChartProvider, type ChartRequest, type ChartResult, type ChartType, type CialdiniPrinciple, type ComparisonData, CompositeChartProvider, CompositeImageProvider, type ConsensusConfig, type ConsensusResult, ConsensusValidator, type ContentAnalysis, ContentAnalyzer, type ContentQAResults, type ContentTransform, type ContrastIssue, type EmotionalPosition, type ExecutionStrategy, type ExpertAgent, type ExpertQAResults, type ExpertValidation, ExpertValidator, type ExtractedConcept$1 as ExtractedConcept, type ExtractedDataPoint, type ExtractedSection, type FinancialSummary, type FontSizeIssue, type GlanceTestResult, HTMLLayoutValidator, HallucinationDetector, type HeathPrinciple, type ImageData, type ImageProvider, type ImageRequest, type ImageResult, type ImageSize, type KBQueryLog, type KahnemanSystem, KnowledgeBase, KnowledgeOrchestrator, LocalImageProvider, MermaidProvider, type MetricData, NANOBANANA_PROMPT_TEMPLATES, type NanoBananaConfig, type NanoBananaModel, NanoBananaProvider, NarrativeAnalyzer, type OneIdeaResult, type OrchestratorConfig, type OrchestratorDecision, type OutputFormat, PPTXValidator, PRESENTATION_TYPE_RULES, type ParsedTable, PersuasionEngine, type PersuasionOpportunity, PlaceholderImageProvider, PowerPointGenerator, type PresentationConfig, PresentationEngine, type PresentationMetadata, type PresentationMode, type PresentationNarrativeAnalysis, type PresentationPersuasionAnalysis, type PresentationResult, type PresentationType, type PresentationTypeRules, type PresentationValidation, type PresentationVisionAnalysis, type PromptTemplate, QAEngine, QAFailureError, type QAIssue, type QAResults, QuickChartProvider, RevealJsGenerator, type SCQAStage, type SCQAStructure, ScoreCalculator, type SectionNarrativeAnalysis, type SectionPersuasionAnalysis, type SemanticCompletenessResult$1 as SemanticCompletenessResult, SemanticCompletenessValidator, type SignalNoiseResult, type Slide, type SlideBlueprint, type SlideContentScore, type SlideData, SlideFactory, type SlideType, type SlideValidation, type SlideVisionAnalysis, type SlideVisualScore, type SparklineStage, type SparklineStructure, StrategyFactory, TemplateEngine, TemplateNotFoundError, type ThemeName, TypeDetector, UnsplashImageProvider, VERSION, type ValidationCheck, ValidationError, type VisionQAConfig, VisionQAEngine, type VisionQAResults, type VisionSlideAnalysis, type VisualQAResults, createConsensusValidator, createDefaultChartProvider, createDefaultImageProvider, createKnowledgeOrchestrator, createNanoBananaProvider, createVisionQAEngine, _default as default, generate, getConsensusValidator, getExpertValidator, getKnowledgeBase, getKnowledgeOrchestrator, getNanoBananaPrompt, getNarrativeAnalyzer, getPersuasionEngine, getVisionQAEngine, validate };
1441
+ export { CodeQualityValidator, type ValidationResult as CodeValidationResult, type ContentAnalysis, ContentAnalyzer, DeckQualityReviewer, type DeckScore, type GenerateOptions, type GenerateResult, type HardcodedViolation, type ImageGenerationRequest, type ImageGenerationResult, KnowledgeGateway, type NanoBananaConfig, NanoBananaProvider, type OutputFormat, type PresentationMetadata, type PresentationMode, type PresentationResult, type PresentationType, type QualitativeDeckReview, type QualitativeSlideReview, type RemediationResult, Remediator, Renderer, type Slide, SlideGenerator, SlideQualityReviewer, type SlideScore, VERSION, type Violation, VisualDesignSystem, createNanoBananaProvider, generate, getContentAnalyzer, getDeckQualityReviewer, getKB, getNanoBananaPrompt, getRemediator, getRenderer, getSlideGenerator, getSlideQualityReviewer, getVisualDesignSystem, initContentAnalyzer, initDeckQualityReviewer, initKB, initRemediator, initRenderer, initSlideGenerator, initSlideQualityReviewer, initVisualDesignSystem, runCodeQualityCheck, validateCodeQuality };