claude-presentation-master 2.1.1 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -148,11 +148,55 @@ interface QAResults {
148
148
  expert: ExpertQAResults;
149
149
  /** Accessibility compliance */
150
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;
151
155
  /** Overall pass/fail */
152
156
  passed: boolean;
153
157
  /** List of issues found */
154
158
  issues: QAIssue[];
155
159
  }
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;
169
+ };
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;
194
+ };
195
+ overallScore: number;
196
+ criticalIssues: string[];
197
+ suggestions: string[];
198
+ pass: boolean;
199
+ }
156
200
  interface VisualQAResults {
157
201
  /** Whitespace percentage (target: 35%+ keynote, 25%+ business) */
158
202
  whitespacePercentage: number;
@@ -264,7 +308,7 @@ interface QAIssue {
264
308
  /** Issue severity */
265
309
  severity: 'error' | 'warning' | 'info';
266
310
  /** Issue category */
267
- category: 'visual' | 'content' | 'expert' | 'accessibility';
311
+ category: 'visual' | 'content' | 'expert' | 'accessibility' | 'semantic_completeness';
268
312
  /** Slide index (if applicable) */
269
313
  slideIndex?: number;
270
314
  /** Issue description */
@@ -272,6 +316,34 @@ interface QAIssue {
272
316
  /** Suggested fix */
273
317
  suggestion?: string;
274
318
  }
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[];
332
+ }
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[];
346
+ }
275
347
  interface PresentationResult {
276
348
  /** Generated outputs */
277
349
  outputs: {
@@ -318,6 +390,60 @@ interface ContentAnalysis {
318
390
  starMoments: string[];
319
391
  /** Estimated slide count */
320
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 {
413
+ header: string;
414
+ level: number;
415
+ content: string;
416
+ 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;
426
+ }
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
+ }>;
321
447
  }
322
448
  interface SCQAStructure {
323
449
  situation: string;
@@ -427,16 +553,19 @@ declare class ScoreCalculator {
427
553
  * - Visual quality using Playwright screenshots + Canvas API
428
554
  * - Layout balance and whitespace distribution
429
555
  * - WCAG contrast compliance
430
- * - Expert methodology adherence
556
+ * - Expert methodology adherence (Duarte, Reynolds, Gallo, Anderson)
557
+ * - Presentation effectiveness, completeness, and visual appeal
431
558
  */
432
559
 
433
560
  declare class QAEngine {
434
561
  private browser;
562
+ private typeDetector;
435
563
  /**
436
564
  * Validate a presentation.
437
565
  */
438
566
  validate(presentation: string | Buffer, options?: {
439
567
  mode?: 'keynote' | 'business';
568
+ presentationType?: PresentationType;
440
569
  strictMode?: boolean;
441
570
  threshold?: number;
442
571
  }): Promise<QAResults>;
@@ -451,7 +580,38 @@ declare class QAEngine {
451
580
  private runVisualTests;
452
581
  private runContentTests;
453
582
  private runExpertTests;
454
- private createExpertResult;
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;
455
615
  private runAccessibilityTests;
456
616
  private calculateVisualScore;
457
617
  private calculateContentScore;
@@ -518,12 +678,14 @@ interface ValidationSummary {
518
678
  };
519
679
  }
520
680
  declare class PPTXValidator {
681
+ private typeDetector;
521
682
  /**
522
683
  * Validate a set of slides before PPTX generation.
523
684
  * This validation is MANDATORY - export will fail if score < threshold.
524
685
  */
525
686
  validate(slides: Slide[], options: {
526
687
  mode: 'keynote' | 'business';
688
+ presentationType?: PresentationType | undefined;
527
689
  threshold?: number;
528
690
  strictMode?: boolean;
529
691
  }): Promise<PPTXValidationResult>;
@@ -548,7 +710,18 @@ declare class PPTXValidator {
548
710
  */
549
711
  private hasContent;
550
712
  /**
551
- * Count distinct ideas in a slide.
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
552
725
  */
553
726
  private countIdeas;
554
727
  /**
@@ -566,7 +739,7 @@ declare class PPTXValidator {
566
739
  /**
567
740
  * Convert PPTX validation result to standard QAResults format.
568
741
  */
569
- toQAResults(result: PPTXValidationResult, mode: 'keynote' | 'business'): QAResults;
742
+ toQAResults(result: PPTXValidationResult, mode: 'keynote' | 'business', presentationType?: PresentationType): QAResults;
570
743
  private createExpertValidation;
571
744
  /**
572
745
  * Generate human-readable validation report.
@@ -601,11 +774,13 @@ interface RemediationChange {
601
774
  type RemediationType = 'word_reduction' | 'slide_split' | 'title_shortening' | 'bullet_consolidation' | 'layout_adjustment' | 'structure_addition' | 'font_size_increase' | 'content_enhancement' | 'whitespace_improvement';
602
775
  declare class AutoRemediation {
603
776
  private changes;
777
+ private typeDetector;
604
778
  /**
605
779
  * Automatically remediate slides until they pass QA.
606
780
  */
607
781
  remediate(slides: Slide[], issues: QAIssue[] | PPTXIssue[], options: {
608
782
  mode: 'keynote' | 'business';
783
+ presentationType?: PresentationType | undefined;
609
784
  targetScore: number;
610
785
  }): Promise<Slide[]>;
611
786
  /**
@@ -613,7 +788,7 @@ declare class AutoRemediation {
613
788
  */
614
789
  getChanges(): RemediationChange[];
615
790
  /**
616
- * Remediate word count issues - the most common problem.
791
+ * Remediate word count issues - both too many AND too few words.
617
792
  */
618
793
  private remediateWordCount;
619
794
  /**
@@ -624,6 +799,11 @@ declare class AutoRemediation {
624
799
  * Remediate bullet point issues.
625
800
  */
626
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;
627
807
  /**
628
808
  * Remediate structural issues - missing title slide, conclusion, etc.
629
809
  */
@@ -632,12 +812,18 @@ declare class AutoRemediation {
632
812
  * Remediate accessibility issues.
633
813
  */
634
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;
635
820
  /**
636
821
  * Group issues by their primary type.
637
822
  */
638
823
  private groupIssuesByType;
639
824
  /**
640
825
  * Shorten text to approximately N words while preserving meaning.
826
+ * CRITICAL: Never truncate mid-sentence - always return complete, meaningful phrases.
641
827
  */
642
828
  private shortenText;
643
829
  /**
@@ -710,6 +896,7 @@ declare class HallucinationDetector {
710
896
  private datePattern;
711
897
  private companyPattern;
712
898
  private quotePattern;
899
+ private commonWords;
713
900
  /**
714
901
  * Check all slides against source content for hallucinations.
715
902
  */
@@ -738,17 +925,27 @@ declare class HallucinationDetector {
738
925
  /**
739
926
  * Presentation Engine - Main Orchestrator
740
927
  *
741
- * Coordinates content analysis, slide generation, and QA validation
742
- * to produce world-class presentations.
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.
743
933
  *
744
934
  * PHILOSOPHY: NEVER FAIL - ALWAYS DELIVER
745
935
  *
746
936
  * Instead of blocking on QA failures, this engine:
747
- * 1. Validates the presentation
748
- * 2. If issues found, automatically remediates them
749
- * 3. Re-validates
750
- * 4. Repeats until it passes (max 5 iterations)
751
- * 5. ALWAYS delivers a working presentation
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
752
949
  */
753
950
 
754
951
  declare class PresentationEngine {
@@ -765,15 +962,26 @@ declare class PresentationEngine {
765
962
  private hallucinationDetector;
766
963
  private htmlGenerator;
767
964
  private pptxGenerator;
965
+ private orchestrator;
966
+ private narrativeAnalyzer;
967
+ private expertValidator;
968
+ private persuasionEngine;
969
+ private kbQueryCount;
768
970
  constructor();
769
971
  /**
770
972
  * Generate a presentation from content.
771
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
+ *
772
980
  * GUARANTEED DELIVERY:
773
- * - Validates presentation quality
774
- * - Automatically fixes any issues found
981
+ * - Validates presentation quality against KB rules
982
+ * - Automatically fixes any issues found using KB guidance
775
983
  * - Iterates until quality threshold is met
776
- * - ALWAYS returns a working presentation
984
+ * - ALWAYS returns a working, world-class presentation
777
985
  *
778
986
  * @param config - Presentation configuration
779
987
  * @returns Presentation result with outputs, QA results, and score
@@ -823,7 +1031,7 @@ declare class PresentationEngine {
823
1031
  }
824
1032
 
825
1033
  /**
826
- * Content Analyzer - Extracts Structure from Raw Content
1034
+ * Content Analyzer - Extracts Structure AND Data from Raw Content
827
1035
  *
828
1036
  * Uses expert methodologies to analyze content and extract:
829
1037
  * - SCQA structure (Barbara Minto)
@@ -831,6 +1039,9 @@ declare class PresentationEngine {
831
1039
  * - Key messages (Rule of Three)
832
1040
  * - STAR moments
833
1041
  * - Action titles
1042
+ * - **NEW**: Actual data points, metrics, financial figures
1043
+ * - **NEW**: Section content with bullets
1044
+ * - **NEW**: Comparison data
834
1045
  */
835
1046
 
836
1047
  declare class ContentAnalyzer {
@@ -841,51 +1052,82 @@ declare class ContentAnalyzer {
841
1052
  private readonly whatIsSignals;
842
1053
  private readonly whatCouldBeSignals;
843
1054
  /**
844
- * Analyze content and extract structural elements.
1055
+ * Analyze content and extract structural elements AND data.
845
1056
  */
846
1057
  analyze(content: string, contentType: string): Promise<ContentAnalysis>;
847
1058
  /**
848
- * Parse content based on its type.
1059
+ * Parse content and extract structured sections.
849
1060
  */
850
- private parseContent;
1061
+ private parseContentStructured;
851
1062
  /**
852
- * Parse markdown content to plain text (preserving structure hints).
1063
+ * Parse markdown and extract structured sections with content.
853
1064
  */
854
- private parseMarkdown;
1065
+ private parseMarkdownStructured;
855
1066
  /**
856
- * Parse JSON content.
1067
+ * Extract markdown tables from content lines.
1068
+ * Per RuVector knowledge base (Cole Nussbaumer Knaflic):
1069
+ * Tables are for leave-behinds, keep minimal design.
857
1070
  */
858
- private parseJSON;
1071
+ private extractTablesFromLines;
859
1072
  /**
860
- * Parse YAML content.
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).
861
1075
  */
862
- private parseYAML;
1076
+ private removeTableLinesFromContent;
863
1077
  /**
864
- * Flatten object to text.
1078
+ * Extract bullet points from content lines.
865
1079
  */
866
- private flattenObject;
1080
+ private extractBulletsFromLines;
867
1081
  /**
868
- * Split text into paragraphs.
1082
+ * Extract ALL data points from content.
869
1083
  */
870
- private splitIntoParagraphs;
1084
+ private extractAllDataPoints;
871
1085
  /**
872
- * Split text into sentences.
1086
+ * Extract data points from a specific text block.
873
1087
  */
874
- private splitIntoSentences;
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;
875
1113
  /**
876
- * Extract SCQA structure (Barbara Minto's Pyramid Principle).
1114
+ * Extract SCQA structure from sections and content.
877
1115
  */
878
1116
  private extractSCQA;
879
1117
  /**
880
- * Extract Sparkline structure (Nancy Duarte).
1118
+ * Extract first meaningful sentence from text.
1119
+ */
1120
+ private extractFirstMeaningfulSentence;
1121
+ /**
1122
+ * Extract Sparkline structure.
881
1123
  */
882
1124
  private extractSparkline;
883
1125
  /**
884
- * Extract key messages (max 3 - Rule of Three).
1126
+ * Extract key messages from actual content.
885
1127
  */
886
1128
  private extractKeyMessages;
887
1129
  /**
888
- * Generate action titles (McKinsey-style).
1130
+ * Generate action titles from key insights.
889
1131
  */
890
1132
  private generateActionTitles;
891
1133
  /**
@@ -893,18 +1135,24 @@ declare class ContentAnalyzer {
893
1135
  */
894
1136
  private transformToActionTitle;
895
1137
  /**
896
- * Identify STAR moments (Something They'll Always Remember).
1138
+ * Identify STAR moments (dramatic/memorable points).
897
1139
  */
898
1140
  private identifyStarMoments;
899
1141
  /**
900
1142
  * Estimate slide count based on content.
901
1143
  */
902
1144
  private estimateSlideCount;
1145
+ private parseJSON;
1146
+ private parseYAML;
1147
+ private flattenObject;
1148
+ private splitIntoParagraphs;
1149
+ private splitIntoSentences;
903
1150
  private containsSignals;
904
- private extractRelevantSentence;
905
1151
  private truncateToSentence;
906
1152
  private truncateToWords;
907
1153
  private capitalizeFirst;
1154
+ private cleanText;
1155
+ private isActionTitle;
908
1156
  }
909
1157
 
910
1158
  /**
@@ -1219,6 +1467,353 @@ declare class HTMLLayoutValidator {
1219
1467
  generateRemediationPlan(result: LayoutValidationResult): string[];
1220
1468
  }
1221
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
+
1222
1817
  /**
1223
1818
  * Presentation Type Detector
1224
1819
  *
@@ -1477,6 +2072,11 @@ declare class RevealJsGenerator {
1477
2072
  * Basic HTML minification.
1478
2073
  */
1479
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;
1480
2080
  }
1481
2081
 
1482
2082
  /**
@@ -1509,7 +2109,7 @@ declare class PowerPointGenerator {
1509
2109
  */
1510
2110
  private addSlide;
1511
2111
  /**
1512
- * Add title slide.
2112
+ * Add title slide with professional gradient background.
1513
2113
  */
1514
2114
  private addTitleSlide;
1515
2115
  /**
@@ -1525,13 +2125,17 @@ declare class PowerPointGenerator {
1525
2125
  */
1526
2126
  private addQuoteSlide;
1527
2127
  /**
1528
- * Add bullet points slide.
2128
+ * Add bullet points slide with professional styling.
1529
2129
  */
1530
2130
  private addBulletSlide;
1531
2131
  /**
1532
- * Add two-column slide.
2132
+ * Add two-column slide with professional layout.
1533
2133
  */
1534
2134
  private addTwoColumnSlide;
2135
+ /**
2136
+ * Add professional metrics card to slide.
2137
+ */
2138
+ private addMetricsCard;
1535
2139
  /**
1536
2140
  * Add metrics grid slide.
1537
2141
  */
@@ -1738,10 +2342,18 @@ declare class CompositeImageProvider implements ImageProvider {
1738
2342
  }
1739
2343
  /**
1740
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)
1741
2351
  */
1742
2352
  declare function createDefaultImageProvider(options?: {
1743
2353
  localImages?: Record<string, string>;
1744
2354
  unsplashKey?: string;
2355
+ googleAiKey?: string;
2356
+ enableAiGeneration?: boolean;
1745
2357
  }): ImageProvider;
1746
2358
 
1747
2359
  /**
@@ -1874,6 +2486,116 @@ declare class CompositeChartProvider implements ChartProvider {
1874
2486
  */
1875
2487
  declare function createDefaultChartProvider(): CompositeChartProvider;
1876
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
+
1877
2599
  /**
1878
2600
  * Knowledge Base - RuVector Expert Principles Loader
1879
2601
  *
@@ -1980,60 +2702,1062 @@ declare class KnowledgeBase {
1980
2702
  declare function getKnowledgeBase(): KnowledgeBase;
1981
2703
 
1982
2704
  /**
1983
- * Claude Presentation Master
1984
- *
1985
- * Generate world-class presentations using expert methodologies from
1986
- * Duarte, Reynolds, Gallo, and Anderson. Enforces rigorous quality
1987
- * standards through real visual validation.
2705
+ * KnowledgeOrchestrator - The Central Brain (Optimized v2.0)
1988
2706
  *
1989
- * @packageDocumentation
1990
- * @module claude-presentation-master
1991
- * @author Stuart Kerr <stuart@isovision.ai>
1992
- * @license MIT
1993
- */
1994
-
1995
- /**
1996
- * Generate a presentation from content.
2707
+ * THIS IS THE HEART OF THE APPLICATION.
1997
2708
  *
1998
- * @example
1999
- * ```typescript
2000
- * import { generate } from '@isovision/claude-presentation-master';
2709
+ * Every single decision in the presentation engine flows through this orchestrator.
2710
+ * It queries the RuVector knowledge base via KnowledgeService typed methods.
2001
2711
  *
2002
- * const result = await generate({
2003
- * content: '# My Presentation\n\n...',
2004
- * contentType: 'markdown',
2005
- * mode: 'keynote',
2006
- * format: ['html', 'pptx'],
2007
- * qaThreshold: 95,
2008
- * title: 'My Amazing Presentation'
2009
- * });
2712
+ * DESIGN PRINCIPLE: The RuVector KB IS the application.
2713
+ * This orchestrator simply executes what the KB dictates.
2010
2714
  *
2011
- * console.log(`Score: ${result.score}/100`);
2012
- * ```
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
2013
2720
  *
2014
- * @param config - Presentation configuration
2015
- * @returns Presentation result with outputs, QA results, and score
2016
- * @throws {ValidationError} If input validation fails
2017
- * @throws {QAFailureError} If QA score is below threshold
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
2018
2736
  */
2019
- declare function generate(config: PresentationConfig): Promise<PresentationResult>;
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
+ }
2020
2755
  /**
2021
- * Validate an existing presentation.
2022
- *
2023
- * @example
2024
- * ```typescript
2025
- * import { validate } from '@isovision/claude-presentation-master';
2026
- * import fs from 'fs';
2027
- *
2028
- * const html = fs.readFileSync('presentation.html', 'utf-8');
2029
- * const result = await validate(html, { mode: 'keynote' });
2030
- *
2031
- * console.log(`Score: ${result.score}/100`);
2032
- * console.log(`Passed: ${result.passed}`);
2033
- * ```
2756
+ * KnowledgeOrchestrator - Routes ALL decisions through the knowledge base
2034
2757
  *
2035
- * @param presentation - HTML string or file buffer
2036
- * @param options - Validation options
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;
2774
+ /**
2775
+ * Safe JSON stringify that handles undefined
2776
+ */
2777
+ private safeStringify;
2778
+ /**
2779
+ * Get the full query log for verification
2780
+ */
2781
+ getQueryLog(): KBQueryLog[];
2782
+ /**
2783
+ * Get query statistics
2784
+ */
2785
+ getQueryStats(): {
2786
+ total: number;
2787
+ byDomain: Record<string, number>;
2788
+ };
2789
+ /**
2790
+ * Print query log summary (only if verbose)
2791
+ */
2792
+ printQuerySummary(): void;
2793
+ /**
2794
+ * Get word limits for a presentation mode
2795
+ * SOURCE: KnowledgeService.getModeRules(mode).characteristics.words_per_slide
2796
+ */
2797
+ getWordLimits(mode: PresentationMode): OrchestratorDecision<{
2798
+ min: number;
2799
+ max: number;
2800
+ }>;
2801
+ /**
2802
+ * Get whitespace requirements
2803
+ * SOURCE: KnowledgeService.getModeRules(mode).characteristics.whitespace
2804
+ */
2805
+ getWhitespaceRequirement(mode: PresentationMode): OrchestratorDecision<number>;
2806
+ /**
2807
+ * Get primary experts for a mode
2808
+ * SOURCE: KnowledgeService.getModeRules(mode).experts
2809
+ */
2810
+ getPrimaryExperts(mode: PresentationMode): OrchestratorDecision<string[]>;
2811
+ /**
2812
+ * Get full mode configuration
2813
+ * SOURCE: KnowledgeService.getModeRules(mode)
2814
+ */
2815
+ getModeConfig(mode: PresentationMode): OrchestratorDecision<any>;
2816
+ /**
2817
+ * Get presentation type configuration
2818
+ * SOURCE: KnowledgeService.getTypeConfig(type)
2819
+ */
2820
+ getTypeConfig(type: PresentationType): OrchestratorDecision<any>;
2821
+ /**
2822
+ * Get type detection signals
2823
+ * SOURCE: KnowledgeService.getTypeDetection()
2824
+ */
2825
+ getTypeDetection(): OrchestratorDecision<any>;
2826
+ /**
2827
+ * Get Miller's Law limit for items
2828
+ * SOURCE: KnowledgeService.getMillersLaw()
2829
+ */
2830
+ getMillersLawLimit(): OrchestratorDecision<number>;
2831
+ /**
2832
+ * Get chunking rules for information grouping
2833
+ * SOURCE: KnowledgeService.getChunkingPrinciples()
2834
+ */
2835
+ getChunkingRules(): OrchestratorDecision<string[]>;
2836
+ /**
2837
+ * Get cognitive load reduction strategies
2838
+ * SOURCE: KnowledgeService.getCognitiveLoadTheory()
2839
+ */
2840
+ getCognitiveLoadRules(): OrchestratorDecision<string[]>;
2841
+ /**
2842
+ * Get attention span guidance
2843
+ * SOURCE: KnowledgeService.getAttentionSpan()
2844
+ */
2845
+ getAttentionSpanGuidance(): OrchestratorDecision<{
2846
+ maxSeconds: number;
2847
+ rules: string[];
2848
+ }>;
2849
+ /**
2850
+ * Get all cognitive science rules
2851
+ * SOURCE: KnowledgeService.getCognitiveRules()
2852
+ */
2853
+ getAllCognitiveRules(): OrchestratorDecision<any>;
2854
+ /**
2855
+ * Get proximity principle for layout
2856
+ * SOURCE: KnowledgeService.getGestaltPrinciple('proximity')
2857
+ */
2858
+ getProximityPrinciple(): OrchestratorDecision<{
2859
+ description: string;
2860
+ application: string[];
2861
+ }>;
2862
+ /**
2863
+ * Get similarity principle for styling
2864
+ * SOURCE: KnowledgeService.getGestaltPrinciple('similarity')
2865
+ */
2866
+ getSimilarityPrinciple(): OrchestratorDecision<{
2867
+ description: string;
2868
+ application: string[];
2869
+ }>;
2870
+ /**
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)
2893
+ */
2894
+ selectChartType(purpose: 'comparison' | 'composition' | 'distribution' | 'relationship', characteristics: {
2895
+ categoryCount: number;
2896
+ hasTimeSeries: boolean;
2897
+ variableCount: number;
2898
+ }): OrchestratorDecision<string>;
2899
+ /**
2900
+ * Get chart-specific rules
2901
+ * SOURCE: KnowledgeService.getChartRules(chartType)
2902
+ */
2903
+ getChartRules(chartType: string): OrchestratorDecision<any>;
2904
+ /**
2905
+ * Get table styling rules
2906
+ * SOURCE: KnowledgeService.getChartRules('tables')
2907
+ */
2908
+ getTableStylingRules(): OrchestratorDecision<string[]>;
2909
+ /**
2910
+ * Get data label rules
2911
+ * SOURCE: KnowledgeService.getDataLabelRules()
2912
+ */
2913
+ getDataLabelRules(): OrchestratorDecision<any>;
2914
+ /**
2915
+ * Get Barbara Minto's Pyramid Principle
2916
+ * SOURCE: KnowledgeService.getExpertPrinciples('barbara_minto')
2917
+ */
2918
+ getMintoPyramidPrinciple(): OrchestratorDecision<any>;
2919
+ /**
2920
+ * Get action title requirements
2921
+ * SOURCE: KnowledgeService.getExpertPrinciples('barbara_minto') + getModeRules('business')
2922
+ */
2923
+ getActionTitleRequirements(): OrchestratorDecision<{
2924
+ rules: string[];
2925
+ examples: any;
2926
+ }>;
2927
+ /**
2928
+ * Get MECE validation rules
2929
+ * SOURCE: KnowledgeService.getExpertPrinciples('barbara_minto')
2930
+ */
2931
+ getMECERules(): OrchestratorDecision<any>;
2932
+ /**
2933
+ * Get Nancy Duarte's principles
2934
+ * SOURCE: KnowledgeService.getExpertPrinciples('nancy_duarte')
2935
+ */
2936
+ getDuartePrinciples(): OrchestratorDecision<any>;
2937
+ /**
2938
+ * Get Glance Test requirements
2939
+ * SOURCE: KnowledgeService.getGlanceTest()
2940
+ */
2941
+ getGlanceTestRequirements(): OrchestratorDecision<{
2942
+ maxSeconds: number;
2943
+ rules: string[];
2944
+ }>;
2945
+ /**
2946
+ * Get Garr Reynolds' principles (Presentation Zen)
2947
+ * SOURCE: KnowledgeService.getExpertPrinciples('garr_reynolds')
2948
+ */
2949
+ getReynoldsPrinciples(): OrchestratorDecision<any>;
2950
+ /**
2951
+ * Get Carmine Gallo's principles (Talk Like TED)
2952
+ * SOURCE: KnowledgeService.getExpertPrinciples('carmine_gallo')
2953
+ */
2954
+ getGalloPrinciples(): OrchestratorDecision<any>;
2955
+ /**
2956
+ * Get Sparkline framework
2957
+ * SOURCE: KnowledgeService.getSparklineFramework()
2958
+ */
2959
+ getSparklineFramework(): OrchestratorDecision<any>;
2960
+ /**
2961
+ * Get SCQA framework
2962
+ * SOURCE: KnowledgeService.getSCQAFramework()
2963
+ */
2964
+ getSCQAFramework(): OrchestratorDecision<any>;
2965
+ /**
2966
+ * Get STAR moment guidance
2967
+ * SOURCE: KnowledgeService.getExpertPrinciples('nancy_duarte')
2968
+ */
2969
+ getSTARMomentGuidance(): OrchestratorDecision<any>;
2970
+ /**
2971
+ * Get all story frameworks
2972
+ * SOURCE: KnowledgeService.getStoryFrameworks()
2973
+ */
2974
+ getAllStoryFrameworks(): OrchestratorDecision<any>;
2975
+ /**
2976
+ * Get Cialdini's persuasion principles
2977
+ * SOURCE: KnowledgeService.getCialdiniPrinciples()
2978
+ */
2979
+ getCialdiniPrinciples(): OrchestratorDecision<any>;
2980
+ /**
2981
+ * Get Kahneman insights
2982
+ * SOURCE: KnowledgeService.getPersuasionPsychology()
2983
+ */
2984
+ getKahnemanInsights(): OrchestratorDecision<any>;
2985
+ /**
2986
+ * Get Heath Brothers' Made to Stick principles
2987
+ * SOURCE: KnowledgeService.getPersuasionPsychology()
2988
+ */
2989
+ getHeathBrothersPrinciples(): OrchestratorDecision<any>;
2990
+ /**
2991
+ * Get all persuasion psychology
2992
+ * SOURCE: KnowledgeService.getPersuasionPsychology()
2993
+ */
2994
+ getAllPersuasionPsychology(): OrchestratorDecision<any>;
2995
+ /**
2996
+ * Get color contrast requirements
2997
+ * SOURCE: KnowledgeService.getContrastRequirements()
2998
+ */
2999
+ getContrastRequirements(): OrchestratorDecision<any>;
3000
+ /**
3001
+ * Get font size requirements
3002
+ * SOURCE: KnowledgeService.getFontSizeRequirements()
3003
+ */
3004
+ getFontSizeRequirements(): OrchestratorDecision<any>;
3005
+ /**
3006
+ * Get color blindness guidance
3007
+ * SOURCE: KnowledgeService.getColorBlindnessGuidance()
3008
+ */
3009
+ getColorBlindnessGuidance(): OrchestratorDecision<any>;
3010
+ /**
3011
+ * Get all accessibility rules
3012
+ * SOURCE: KnowledgeService.getAccessibilityRules()
3013
+ */
3014
+ getAllAccessibilityRules(): OrchestratorDecision<any>;
3015
+ /**
3016
+ * Get typography rules
3017
+ * SOURCE: KnowledgeService.getTypography()
3018
+ */
3019
+ getTypographyRules(): OrchestratorDecision<any>;
3020
+ /**
3021
+ * Get color system
3022
+ * SOURCE: KnowledgeService.getColorSystem()
3023
+ */
3024
+ getColorSystem(): OrchestratorDecision<any>;
3025
+ /**
3026
+ * Get spacing system
3027
+ * SOURCE: KnowledgeService.getSpacingSystem()
3028
+ */
3029
+ getSpacingSystem(): OrchestratorDecision<any>;
3030
+ /**
3031
+ * Get layout rules
3032
+ * SOURCE: KnowledgeService.getLayoutSystem()
3033
+ */
3034
+ getLayoutRules(mode: PresentationMode): OrchestratorDecision<any>;
3035
+ /**
3036
+ * Get complete design system
3037
+ * SOURCE: KnowledgeService.getDesignSystem()
3038
+ */
3039
+ getFullDesignSystem(): OrchestratorDecision<any>;
3040
+ /**
3041
+ * Get Harvey balls guidance
3042
+ * SOURCE: KnowledgeService.getHarveyBalls()
3043
+ */
3044
+ getHarveyBallsGuidance(): OrchestratorDecision<any>;
3045
+ /**
3046
+ * Get traffic light guidance
3047
+ * SOURCE: KnowledgeService.getTrafficLights()
3048
+ */
3049
+ getTrafficLightGuidance(): OrchestratorDecision<any>;
3050
+ /**
3051
+ * Get icon usage guidance
3052
+ * SOURCE: KnowledgeService.getIconGuidance()
3053
+ */
3054
+ getIconGuidance(): OrchestratorDecision<any>;
3055
+ /**
3056
+ * Get all consulting visuals
3057
+ * SOURCE: KnowledgeService.getConsultingVisuals()
3058
+ */
3059
+ getAllConsultingVisuals(): OrchestratorDecision<any>;
3060
+ /**
3061
+ * Get signal-to-noise ratio requirements
3062
+ * SOURCE: KnowledgeService.getSignalToNoise()
3063
+ */
3064
+ getSignalToNoiseRequirements(): OrchestratorDecision<any>;
3065
+ /**
3066
+ * Get one-idea-per-slide requirements
3067
+ * SOURCE: KnowledgeService.getOneIdeaPerSlide()
3068
+ */
3069
+ getOneIdeaRequirements(): OrchestratorDecision<any>;
3070
+ /**
3071
+ * Get scoring weights
3072
+ * SOURCE: KnowledgeService.getScoringWeights()
3073
+ */
3074
+ getScoringWeights(): OrchestratorDecision<any>;
3075
+ /**
3076
+ * Get all quality metrics
3077
+ * SOURCE: KnowledgeService.getQualityMetrics()
3078
+ */
3079
+ getAllQualityMetrics(): OrchestratorDecision<any>;
3080
+ /**
3081
+ * Get anti-patterns to avoid
3082
+ * SOURCE: KnowledgeService.getAntiPatterns()
3083
+ */
3084
+ getAntiPatterns(): OrchestratorDecision<any>;
3085
+ /**
3086
+ * Get visual anti-patterns
3087
+ * SOURCE: KnowledgeService.getVisualAntiPatterns()
3088
+ */
3089
+ getVisualAntiPatterns(): OrchestratorDecision<any[]>;
3090
+ /**
3091
+ * Get content anti-patterns
3092
+ * SOURCE: KnowledgeService.getContentAntiPatterns()
3093
+ */
3094
+ getContentAntiPatterns(): OrchestratorDecision<any[]>;
3095
+ /**
3096
+ * Get slide templates for mode
3097
+ * SOURCE: KnowledgeService.getAllSlideTemplates()
3098
+ */
3099
+ getSlideTemplates(mode: PresentationMode): OrchestratorDecision<any>;
3100
+ /**
3101
+ * Get specific slide template
3102
+ * SOURCE: KnowledgeService.getSlideTemplate(templateType)
3103
+ */
3104
+ getSlideTemplate(templateType: string): OrchestratorDecision<any>;
3105
+ /**
3106
+ * Get data integrity requirements
3107
+ * SOURCE: KnowledgeService.getDataIntegrity()
3108
+ */
3109
+ getDataIntegrityRules(): OrchestratorDecision<any>;
3110
+ /**
3111
+ * Get source documentation requirements
3112
+ * SOURCE: KnowledgeService.getSourceDocumentation()
3113
+ */
3114
+ getSourceDocumentationRules(): OrchestratorDecision<any>;
3115
+ /**
3116
+ * Get verification checklist
3117
+ * SOURCE: KnowledgeService.getVerificationChecklist()
3118
+ */
3119
+ getVerificationChecklist(): OrchestratorDecision<any>;
3120
+ /**
3121
+ * Get HTML output configuration
3122
+ * SOURCE: KnowledgeService.getHtmlConfig()
3123
+ */
3124
+ getHtmlConfig(): OrchestratorDecision<any>;
3125
+ /**
3126
+ * Get PPTX output configuration
3127
+ * SOURCE: KnowledgeService.getPptxConfig()
3128
+ */
3129
+ getPptxConfig(): OrchestratorDecision<any>;
3130
+ /**
3131
+ * Get PPTX generation rules
3132
+ * SOURCE: KnowledgeService.getPptxGeneration()
3133
+ */
3134
+ getPptxGenerationRules(): OrchestratorDecision<any>;
3135
+ /**
3136
+ * Get ALL rules applicable to slide creation
3137
+ * This is the master method that aggregates all relevant KB sections
3138
+ */
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
+ }>;
3162
+ /**
3163
+ * Get ALL narrative/persuasion rules
3164
+ */
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
+ }>;
3173
+ /**
3174
+ * Search the knowledge base by keyword
3175
+ * SOURCE: KnowledgeService.search(keyword)
3176
+ */
3177
+ searchKB(keyword: string): OrchestratorDecision<any[]>;
3178
+ /**
3179
+ * Get KB version and metadata
3180
+ */
3181
+ getKBMetadata(): OrchestratorDecision<any>;
3182
+ }
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;
3188
+
3189
+ /**
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)
3202
+ *
3203
+ * The knowledge base IS the brain. This code is just plumbing.
3204
+ */
3205
+
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[];
3218
+ }
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;
3234
+ }
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;
3247
+ private initialized;
3248
+ constructor();
3249
+ /**
3250
+ * Initialize by loading all narrative frameworks from KB
3251
+ * OPTIMIZATION: Only initialize once - cached data is reused
3252
+ */
3253
+ initialize(): Promise<void>;
3254
+ /**
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
3280
+ */
3281
+ private isSTARMomentCandidate;
3282
+ /**
3283
+ * Determine the narrative function of a section
3284
+ */
3285
+ private determineNarrativeFunction;
3286
+ /**
3287
+ * Find the best STAR moment in the presentation
3288
+ */
3289
+ private findSTARMoment;
3290
+ /**
3291
+ * Score the Sparkline flow
3292
+ * Based on KB: story_frameworks.sparkline.stages
3293
+ */
3294
+ private scoreSparklineFlow;
3295
+ /**
3296
+ * Score the SCQA flow
3297
+ * Based on KB: story_frameworks.scqa, experts.barbara_minto
3298
+ */
3299
+ private scoreSCQAFlow;
3300
+ /**
3301
+ * Score the emotional arc
3302
+ * Based on KB: persuasion_psychology, experts.nancy_duarte
3303
+ */
3304
+ private scoreEmotionalArc;
3305
+ /**
3306
+ * Generate recommendations for improving narrative
3307
+ */
3308
+ private generateRecommendations;
3309
+ /**
3310
+ * Get recommended Sparkline structure for a presentation
3311
+ * Based on KB: story_frameworks.sparkline
3312
+ */
3313
+ getRecommendedSparklineStructure(slideCount: number): SparklineStage[];
3314
+ /**
3315
+ * Get recommended SCQA structure based on mode
3316
+ * Based on KB: story_frameworks.scqa, experts.barbara_minto
3317
+ */
3318
+ getRecommendedSCQAStructure(slideCount: number, mode: PresentationMode): SCQAStage[];
3319
+ /**
3320
+ * Get total KB queries made
3321
+ */
3322
+ getQueryCount(): number;
3323
+ }
3324
+ declare function getNarrativeAnalyzer(): NarrativeAnalyzer;
3325
+
3326
+ /**
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.)
3356
+ *
3357
+ * PERSUASION:
3358
+ * - Robert Cialdini (6 Principles of Influence)
3359
+ * - Daniel Kahneman (System 1/2)
3360
+ * - Chip & Dan Heath (Made to Stick - SUCCESs)
3361
+ *
3362
+ * ACCESSIBILITY:
3363
+ * - WCAG 2.1 Standards
3364
+ *
3365
+ * The knowledge base IS the brain. This code is just plumbing.
3366
+ */
3367
+
3368
+ interface ValidationCheck {
3369
+ expert: string;
3370
+ principle: string;
3371
+ kbPath: string;
3372
+ passed: boolean;
3373
+ 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[];
3384
+ }
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;
3397
+ };
3398
+ kbQueriesUsed: number;
3399
+ criticalIssues: string[];
3400
+ recommendations: string[];
3401
+ }
3402
+ /**
3403
+ * ExpertValidator - Validates against all expert methodologies
3404
+ */
3405
+ declare class ExpertValidator {
3406
+ private orchestrator;
3407
+ private queryCount;
3408
+ constructor();
3409
+ /**
3410
+ * Initialize the validator
3411
+ */
3412
+ initialize(): Promise<void>;
3413
+ /**
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
3429
+ */
3430
+ private validateTufteChartjunk;
3431
+ /**
3432
+ * Validate Knaflic's principles
3433
+ * KB: data_visualization_experts.cole_nussbaumer_knaflic.six_key_principles
3434
+ */
3435
+ private validateKnaflicPrinciples;
3436
+ /**
3437
+ * Validate Duarte's Glance Test
3438
+ * KB: quality_metrics.glance_test, experts.nancy_duarte
3439
+ */
3440
+ private validateDuarteGlanceTest;
3441
+ /**
3442
+ * Validate Reynolds' Signal-to-Noise ratio
3443
+ * KB: experts.garr_reynolds.core_principles.signal_to_noise
3444
+ */
3445
+ private validateReynoldsSignalNoise;
3446
+ /**
3447
+ * Validate Gallo's Rule of Three
3448
+ * KB: experts.carmine_gallo.core_principles.rule_of_three
3449
+ */
3450
+ private validateGalloRuleOfThree;
3451
+ /**
3452
+ * Validate Anderson's One Idea principle
3453
+ * KB: experts.chris_anderson.core_principles.one_idea
3454
+ */
3455
+ private validateAndersonOneIdea;
3456
+ /**
3457
+ * Validate Minto's Action Titles
3458
+ * KB: experts.barbara_minto, presentation_modes.business
3459
+ */
3460
+ private validateMintoActionTitles;
3461
+ /**
3462
+ * Validate Minto's MECE principle
3463
+ * KB: experts.barbara_minto.mece_principle
3464
+ */
3465
+ private validateMintoMECE;
3466
+ /**
3467
+ * Validate Horizontal Logic (titles tell the story)
3468
+ * KB: data_visualization_experts.cole_nussbaumer_knaflic.horizontal_vertical_logic
3469
+ */
3470
+ private validateHorizontalLogic;
3471
+ /**
3472
+ * Validate Miller's Law (7±2 items)
3473
+ * KB: cognitive_science.millers_law
3474
+ */
3475
+ private validateMillersLaw;
3476
+ /**
3477
+ * Validate Cognitive Load
3478
+ * KB: cognitive_science.cognitive_load_theory
3479
+ */
3480
+ private validateCognitiveLoad;
3481
+ /**
3482
+ * Validate Gestalt Proximity principle
3483
+ * KB: gestalt_principles.proximity
3484
+ */
3485
+ private validateGestaltProximity;
3486
+ /**
3487
+ * Validate word count
3488
+ * KB: presentation_modes.[mode].characteristics.words_per_slide
3489
+ */
3490
+ private validateWordCount;
3491
+ /**
3492
+ * Validate accessibility basics
3493
+ * KB: accessibility
3494
+ */
3495
+ private validateAccessibility;
3496
+ /**
3497
+ * Get all text content from a slide
3498
+ */
3499
+ private getSlideContent;
3500
+ /**
3501
+ * Count words in a slide
3502
+ */
3503
+ private countWords;
3504
+ /**
3505
+ * Calculate scores by expert
3506
+ */
3507
+ private calculateExpertScores;
3508
+ /**
3509
+ * Calculate category scores
3510
+ */
3511
+ private calculateCategoryScores;
3512
+ private avgScore;
3513
+ /**
3514
+ * Aggregate critical issues across all slides
3515
+ */
3516
+ private aggregateCriticalIssues;
3517
+ /**
3518
+ * Generate recommendations based on validation results
3519
+ */
3520
+ private generateRecommendations;
3521
+ /**
3522
+ * Get query count
3523
+ */
3524
+ getQueryCount(): number;
3525
+ }
3526
+ declare function getExpertValidator(): ExpertValidator;
3527
+
3528
+ /**
3529
+ * PersuasionEngine - Applies Persuasion Psychology to Presentations
3530
+ *
3531
+ * THIS MODULE ENHANCES PRESENTATIONS WITH PSYCHOLOGICAL PERSUASION.
3532
+ *
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.
3564
+ */
3565
+
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;
3601
+ }
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;
3611
+ private initialized;
3612
+ constructor();
3613
+ /**
3614
+ * Initialize by loading all persuasion frameworks from KB
3615
+ * OPTIMIZATION: Only initialize once - cached data is reused
3616
+ */
3617
+ initialize(): Promise<void>;
3618
+ /**
3619
+ * Analyze content for persuasion opportunities
3620
+ */
3621
+ analyzePersuasion(sections: ExtractedSection[], mode: PresentationMode): Promise<PresentationPersuasionAnalysis>;
3622
+ /**
3623
+ * Analyze a single section for persuasion
3624
+ */
3625
+ private analyzeSection;
3626
+ /**
3627
+ * Find Cialdini principle opportunities
3628
+ * KB: persuasion_psychology.cialdini_principles
3629
+ */
3630
+ private findCialdiniOpportunities;
3631
+ /**
3632
+ * Analyze Heath Brothers' SUCCESs alignment
3633
+ * KB: persuasion_psychology.heath_brothers
3634
+ */
3635
+ private analyzeHeathAlignment;
3636
+ /**
3637
+ * Determine Kahneman System target
3638
+ * KB: persuasion_psychology.kahneman_systems
3639
+ */
3640
+ private determineKahnemanTarget;
3641
+ /**
3642
+ * Analyze Aristotle's rhetorical balance
3643
+ * KB: persuasion_psychology.aristotle
3644
+ */
3645
+ private analyzeAristotleBalance;
3646
+ /**
3647
+ * Calculate section persuasiveness score
3648
+ */
3649
+ private calculateSectionPersuasiveness;
3650
+ /**
3651
+ * Generate recommendations for a section
3652
+ */
3653
+ private generateSectionRecommendations;
3654
+ /**
3655
+ * Aggregate Cialdini usage across sections
3656
+ */
3657
+ private aggregateCialdiniUsage;
3658
+ /**
3659
+ * Calculate overall Heath SUCCESs score
3660
+ */
3661
+ private calculateHeathScore;
3662
+ /**
3663
+ * Calculate Kahneman balance
3664
+ */
3665
+ private calculateKahnemanBalance;
3666
+ /**
3667
+ * Calculate Aristotle balance across presentation
3668
+ */
3669
+ private calculateAristotleBalance;
3670
+ /**
3671
+ * Calculate overall persuasiveness score
3672
+ */
3673
+ private calculateOverallPersuasiveness;
3674
+ /**
3675
+ * Find top persuasion opportunities
3676
+ */
3677
+ private findTopOpportunities;
3678
+ /**
3679
+ * Get suggested persuasion enhancements for a slide
3680
+ * Returns specific text suggestions based on KB principles
3681
+ */
3682
+ getSlideEnhancements(slide: Slide, mode: PresentationMode): Promise<{
3683
+ enhancedTitle?: string | undefined;
3684
+ enhancedBullets?: string[] | undefined;
3685
+ persuasionTechniques: string[];
3686
+ kbReferences: string[];
3687
+ }>;
3688
+ /**
3689
+ * Get power words from KB
3690
+ * KB: persuasion_psychology.power_words
3691
+ */
3692
+ getPowerWords(): Promise<{
3693
+ urgency: string[];
3694
+ exclusivity: string[];
3695
+ emotion: string[];
3696
+ authority: string[];
3697
+ kbPath: string;
3698
+ }>;
3699
+ /**
3700
+ * Get query count
3701
+ */
3702
+ getQueryCount(): number;
3703
+ }
3704
+ declare function getPersuasionEngine(): PersuasionEngine;
3705
+
3706
+ /**
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
3717
+ */
3718
+
3719
+ /**
3720
+ * Generate a presentation from content.
3721
+ *
3722
+ * @example
3723
+ * ```typescript
3724
+ * import { generate } from '@isovision/claude-presentation-master';
3725
+ *
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
+ * });
3734
+ *
3735
+ * console.log(`Score: ${result.score}/100`);
3736
+ * ```
3737
+ *
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
3742
+ */
3743
+ declare function generate(config: PresentationConfig): Promise<PresentationResult>;
3744
+ /**
3745
+ * Validate an existing presentation.
3746
+ *
3747
+ * @example
3748
+ * ```typescript
3749
+ * import { validate } from '@isovision/claude-presentation-master';
3750
+ * import fs from 'fs';
3751
+ *
3752
+ * const html = fs.readFileSync('presentation.html', 'utf-8');
3753
+ * const result = await validate(html, { mode: 'keynote' });
3754
+ *
3755
+ * console.log(`Score: ${result.score}/100`);
3756
+ * console.log(`Passed: ${result.passed}`);
3757
+ * ```
3758
+ *
3759
+ * @param presentation - HTML string or file buffer
3760
+ * @param options - Validation options
2037
3761
  * @returns QA validation results
2038
3762
  */
2039
3763
  declare function validate(presentation: string | Buffer, options?: {
@@ -2046,9 +3770,16 @@ declare function validate(presentation: string | Buffer, options?: {
2046
3770
  /**
2047
3771
  * Get the version of the package.
2048
3772
  */
2049
- declare const VERSION = "2.0.0";
3773
+ declare const VERSION = "3.0.1";
3774
+
2050
3775
  /**
2051
3776
  * Default export for convenience.
3777
+ *
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
2052
3783
  */
2053
3784
  declare const _default: {
2054
3785
  generate: typeof generate;
@@ -2058,6 +3789,10 @@ declare const _default: {
2058
3789
  PPTXValidator: typeof PPTXValidator;
2059
3790
  AccessibilityValidator: typeof AccessibilityValidator;
2060
3791
  VERSION: string;
3792
+ getKnowledgeOrchestrator: typeof getKnowledgeOrchestrator;
3793
+ getNarrativeAnalyzer: typeof getNarrativeAnalyzer;
3794
+ getExpertValidator: typeof getExpertValidator;
3795
+ getPersuasionEngine: typeof getPersuasionEngine;
2061
3796
  };
2062
3797
 
2063
- export { type AccessibilityResults, AccessibilityValidator, AutoRemediation, type ChartData, type ChartDataset, ChartJsProvider, type ChartProvider, type ChartRequest, type ChartResult, type ChartType, CompositeChartProvider, CompositeImageProvider, type ContentAnalysis, ContentAnalyzer, type ContentQAResults, type ContentTransform, type ContrastIssue, type ExecutionStrategy, type ExpertQAResults, type ExpertValidation, type FontSizeIssue, type GlanceTestResult, HTMLLayoutValidator, HallucinationDetector, type ImageData, type ImageProvider, type ImageRequest, type ImageResult, KnowledgeBase, LocalImageProvider, MermaidProvider, type MetricData, type OneIdeaResult, type OutputFormat, PPTXValidator, PRESENTATION_TYPE_RULES, PlaceholderImageProvider, PowerPointGenerator, type PresentationConfig, PresentationEngine, type PresentationMetadata, type PresentationMode, type PresentationResult, type PresentationType, type PresentationTypeRules, QAEngine, QAFailureError, type QAIssue, type QAResults, QuickChartProvider, RevealJsGenerator, type SCQAStructure, ScoreCalculator, type SignalNoiseResult, type Slide, type SlideBlueprint, type SlideContentScore, type SlideData, SlideFactory, type SlideType, type SlideVisualScore, type SparklineStructure, StrategyFactory, TemplateEngine, TemplateNotFoundError, type ThemeName, TypeDetector, UnsplashImageProvider, VERSION, ValidationError, type VisualQAResults, createDefaultChartProvider, createDefaultImageProvider, _default as default, generate, getKnowledgeBase, validate };
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 };