claude-presentation-master 6.1.0 → 7.2.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
@@ -21,6 +21,10 @@ interface PresentationConfig {
21
21
  theme?: ThemeName;
22
22
  /** Minimum QA score required (0-100, default: 95) */
23
23
  qaThreshold?: number;
24
+ /** Maximum iterations for auto-fix loop (default: 5) */
25
+ maxIterations?: number;
26
+ /** Use iterative QA with 7-dimension scoring and auto-fix (default: true) */
27
+ useIterativeQA?: boolean;
24
28
  /** Skip QA validation (NOT RECOMMENDED) */
25
29
  skipQA?: boolean;
26
30
  /** Presentation title */
@@ -37,6 +41,10 @@ interface PresentationConfig {
37
41
  customCSS?: string;
38
42
  /** Custom Handlebars templates */
39
43
  customTemplates?: Record<string, string>;
44
+ /** Local images available for use */
45
+ images?: string[];
46
+ /** Base path for resolving image paths */
47
+ imageBasePath?: string;
40
48
  }
41
49
  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';
42
50
  interface Slide {
@@ -243,16 +251,29 @@ interface PresentationMetadata {
243
251
  generatedAt: string;
244
252
  /** Presentation mode */
245
253
  mode: PresentationMode$1;
254
+ /** Detected/specified presentation type */
255
+ presentationType?: PresentationType$1;
246
256
  /** Total slide count */
247
257
  slideCount: number;
248
258
  /** Total word count */
249
259
  wordCount: number;
260
+ /** Total words (alias for wordCount) */
261
+ totalWords?: number;
250
262
  /** Average words per slide */
251
263
  avgWordsPerSlide: number;
252
264
  /** Estimated presentation duration (minutes) */
253
265
  estimatedDuration: number;
254
266
  /** Themes/frameworks used */
255
267
  frameworks: string[];
268
+ /** QA iterations used */
269
+ qaIterations?: number;
270
+ /** Max iterations configured */
271
+ qaMaxIterations?: number;
272
+ /** 7-dimension scores */
273
+ dimensionScores?: Record<string, {
274
+ score: number;
275
+ weight: number;
276
+ }>;
256
277
  }
257
278
  interface ContentSection$1 {
258
279
  /** Section header text */
@@ -322,22 +343,121 @@ declare class TemplateNotFoundError extends Error {
322
343
  templatePath: string;
323
344
  constructor(templatePath: string, message?: string);
324
345
  }
346
+ /**
347
+ * Content pattern detected from a section
348
+ * Used to match content to appropriate slide types
349
+ */
350
+ interface ContentPattern {
351
+ /** Section has a big number ($X, X%, Xx) */
352
+ hasBigNumber: boolean;
353
+ /** Extracted big number value */
354
+ bigNumberValue?: string;
355
+ /** Section has comparison language (vs, before/after) */
356
+ hasComparison: boolean;
357
+ /** Section has timeline markers (Phase, Week, Q1) */
358
+ hasTimeline: boolean;
359
+ /** Section has process/steps (Step 1, Pillar) */
360
+ hasProcess: boolean;
361
+ /** Section has 3+ metrics */
362
+ hasMetrics: boolean;
363
+ /** Section is a quote */
364
+ hasQuote: boolean;
365
+ /** Section has code blocks */
366
+ hasCode: boolean;
367
+ /** Number of bullets in section */
368
+ bulletCount: number;
369
+ /** Word count of section */
370
+ wordCount: number;
371
+ /** Primary detected pattern name */
372
+ primaryPattern: 'big_number' | 'comparison' | 'timeline' | 'process' | 'metrics' | 'quote' | 'code' | 'bullets' | 'prose';
373
+ }
374
+ /**
375
+ * Validation rules from KB for a presentation type
376
+ */
377
+ interface ValidationRules {
378
+ wordsPerSlide: {
379
+ min: number;
380
+ max: number;
381
+ ideal: number;
382
+ };
383
+ whitespace: {
384
+ min: number;
385
+ ideal: number;
386
+ };
387
+ bulletsPerSlide: {
388
+ max: number;
389
+ };
390
+ slidesPerIdea?: number;
391
+ actionTitlesRequired: boolean;
392
+ sourcesRequired: boolean;
393
+ calloutsRequired?: boolean;
394
+ denseDataAllowed?: boolean;
395
+ codeBlocksAllowed?: boolean;
396
+ diagramsRequired?: boolean;
397
+ }
398
+ /**
399
+ * Typography specifications from KB
400
+ */
401
+ interface TypographyRules {
402
+ titles: string;
403
+ body: string;
404
+ maxFonts: number;
405
+ actionTitle?: string;
406
+ sectionHeaders?: string;
407
+ dataLabels?: string;
408
+ code?: string;
409
+ }
410
+ /**
411
+ * Scoring weights from KB for QA
412
+ */
413
+ interface ScoringWeights {
414
+ visualQuality: number;
415
+ contentQuality: number;
416
+ expertCompliance: number;
417
+ accessibility: number;
418
+ }
419
+ /**
420
+ * Result of validating a slide against KB rules
421
+ */
422
+ interface SlideValidationResult {
423
+ valid: boolean;
424
+ violations: string[];
425
+ warnings: string[];
426
+ wordCount: number;
427
+ bulletCount: number;
428
+ slideType: string;
429
+ }
430
+ /**
431
+ * Story structure from KB
432
+ */
433
+ interface StoryStructure {
434
+ framework: 'scqa' | 'sparkline' | 'pyramid' | 'hero_journey';
435
+ requiredElements: string[];
436
+ optionalElements: string[];
437
+ antiPatterns: string[];
438
+ }
325
439
 
326
440
  /**
327
441
  * Presentation Engine - Main Orchestrator
328
442
  *
329
443
  * Coordinates content analysis, slide generation, and QA validation
330
444
  * to produce world-class presentations.
445
+ *
446
+ * Features:
447
+ * - KB-driven slide generation
448
+ * - 7-dimension quality scoring
449
+ * - Iterative auto-fix loop until threshold met
450
+ * - Comprehensive audit trail
331
451
  */
332
452
 
333
453
  declare class PresentationEngine {
334
454
  private contentAnalyzer;
335
- private slideFactory;
336
455
  private templateEngine;
337
456
  private scoreCalculator;
338
457
  private qaEngine;
339
458
  private htmlGenerator;
340
459
  private pptxGenerator;
460
+ private kb;
341
461
  constructor();
342
462
  /**
343
463
  * Generate a presentation from content.
@@ -346,6 +466,10 @@ declare class PresentationEngine {
346
466
  * @returns Presentation result with outputs, QA results, and score
347
467
  */
348
468
  generate(config: PresentationConfig): Promise<PresentationResult>;
469
+ /**
470
+ * Build QA results structure from 7-dimension scoring.
471
+ */
472
+ private buildQAResultsFrom7Dimension;
349
473
  /**
350
474
  * Validate presentation configuration.
351
475
  */
@@ -550,6 +674,189 @@ declare class KnowledgeGateway {
550
674
  * Get the full knowledge base (for advanced queries)
551
675
  */
552
676
  getRawKB(): any;
677
+ /**
678
+ * Get allowed slide types for a specific presentation type.
679
+ * CRITICAL: SlideFactory must ONLY use types from this list.
680
+ */
681
+ getAllowedSlideTypes(type: PresentationType): string[];
682
+ /**
683
+ * Get validation rules for a specific presentation type.
684
+ * Returns word limits, bullet limits, whitespace requirements, etc.
685
+ */
686
+ getValidationRules(type: PresentationType): {
687
+ wordsPerSlide: {
688
+ min: number;
689
+ max: number;
690
+ ideal: number;
691
+ };
692
+ whitespace: {
693
+ min: number;
694
+ ideal: number;
695
+ };
696
+ bulletsPerSlide: {
697
+ max: number;
698
+ };
699
+ actionTitlesRequired: boolean;
700
+ sourcesRequired: boolean;
701
+ calloutsRequired?: boolean;
702
+ denseDataAllowed?: boolean;
703
+ codeBlocksAllowed?: boolean;
704
+ diagramsRequired?: boolean;
705
+ };
706
+ /**
707
+ * Get required elements that MUST be in the deck for this type.
708
+ */
709
+ getRequiredElements(type: PresentationType): string[];
710
+ /**
711
+ * Get anti-patterns to avoid for this presentation type.
712
+ */
713
+ getAntiPatternsForType(type: PresentationType): string[];
714
+ /**
715
+ * Get typography specifications for this presentation type.
716
+ */
717
+ getTypographyForType(type: PresentationType): {
718
+ titles: string;
719
+ body: string;
720
+ maxFonts: number;
721
+ actionTitle?: string;
722
+ sectionHeaders?: string;
723
+ dataLabels?: string;
724
+ code?: string;
725
+ };
726
+ /**
727
+ * Get CSS variables recipe for this presentation type.
728
+ */
729
+ getCSSVariablesForType(type: PresentationType): string;
730
+ /**
731
+ * Get scoring weights for QA evaluation for this type.
732
+ */
733
+ getScoringWeights(type: PresentationType): {
734
+ visualQuality: number;
735
+ contentQuality: number;
736
+ expertCompliance: number;
737
+ accessibility: number;
738
+ };
739
+ /**
740
+ * Get story structure framework for this presentation type.
741
+ */
742
+ getStoryStructure(type: PresentationType): {
743
+ framework: string;
744
+ requiredElements: string[];
745
+ optionalElements: string[];
746
+ };
747
+ /**
748
+ * Map a content pattern to the best allowed slide type.
749
+ * CRITICAL: This is how SlideFactory decides which slide type to use.
750
+ */
751
+ mapContentPatternToSlideType(pattern: {
752
+ primaryPattern: string;
753
+ hasBigNumber?: boolean;
754
+ hasComparison?: boolean;
755
+ hasTimeline?: boolean;
756
+ hasProcess?: boolean;
757
+ hasMetrics?: boolean;
758
+ hasQuote?: boolean;
759
+ hasCode?: boolean;
760
+ bulletCount?: number;
761
+ }, allowedTypes: string[]): string;
762
+ /**
763
+ * Get a specific slide template by name from the KB.
764
+ */
765
+ getSlideTemplateByName(name: string): {
766
+ name: string;
767
+ purpose: string;
768
+ elements?: string[];
769
+ components?: string[];
770
+ wordLimit: number;
771
+ } | undefined;
772
+ /**
773
+ * Get slide defaults for structural slides (titles, messages, labels).
774
+ * CRITICAL: SlideFactory must use these instead of hardcoded strings.
775
+ */
776
+ getSlideDefaults(type: PresentationType): {
777
+ agenda: {
778
+ title: string;
779
+ };
780
+ thankYou: {
781
+ title: string;
782
+ subtitle: string;
783
+ };
784
+ cta: {
785
+ title: string;
786
+ message: string;
787
+ fallback: string;
788
+ };
789
+ metricsGrid: {
790
+ title: string;
791
+ maxMetrics: number;
792
+ };
793
+ code: {
794
+ label: string;
795
+ maxChars: number;
796
+ };
797
+ comparison: {
798
+ leftLabel: string;
799
+ rightLabel: string;
800
+ optionLabels: string[];
801
+ };
802
+ column: {
803
+ labelTemplate: string;
804
+ };
805
+ subtitle: {
806
+ maxWords: number;
807
+ };
808
+ context: {
809
+ maxWords: number;
810
+ };
811
+ step: {
812
+ maxWords: number;
813
+ };
814
+ columnContent: {
815
+ maxWords: number;
816
+ };
817
+ };
818
+ /**
819
+ * Get SCQA framework titles from KB (for business mode).
820
+ */
821
+ getSCQATitles(type: PresentationType): {
822
+ situation: string;
823
+ complication: string;
824
+ question: string;
825
+ answer: string;
826
+ };
827
+ /**
828
+ * Get Sparkline framework titles from KB (for keynote mode).
829
+ */
830
+ getSparklineTitles(type: PresentationType): {
831
+ whatIs: string;
832
+ whatCouldBe: string;
833
+ callToAdventure: string;
834
+ newBliss: string;
835
+ };
836
+ /**
837
+ * Get insight markers for detecting action titles.
838
+ * These are words/phrases that indicate an insight vs a topic.
839
+ */
840
+ getInsightMarkers(): string[];
841
+ /**
842
+ * Get word limit for a specific slide element type.
843
+ */
844
+ getWordLimitForElement(type: PresentationType, element: 'title' | 'subtitle' | 'bullet' | 'body' | 'quote' | 'step'): number;
845
+ /**
846
+ * Validate a slide against KB rules for the given presentation type.
847
+ */
848
+ validateSlideAgainstKB(slide: {
849
+ type: string;
850
+ wordCount: number;
851
+ bulletCount: number;
852
+ hasActionTitle?: boolean;
853
+ hasSource?: boolean;
854
+ }, type: PresentationType): {
855
+ valid: boolean;
856
+ violations: string[];
857
+ warnings: string[];
858
+ fixes: Record<string, any>;
859
+ };
553
860
  }
554
861
  /**
555
862
  * Get or create the KnowledgeGateway instance
@@ -619,6 +926,7 @@ declare class ContentAnalyzer {
619
926
  analyze(content: string, contentType: string): Promise<ContentAnalysis>;
620
927
  /**
621
928
  * Parse content based on type
929
+ * CRITICAL: Strip code blocks FIRST to prevent code from becoming slides
622
930
  */
623
931
  private parseContent;
624
932
  /**
@@ -635,6 +943,7 @@ declare class ContentAnalyzer {
635
943
  private extractSections;
636
944
  /**
637
945
  * Extract SCQA structure (Barbara Minto)
946
+ * CRITICAL: Answer must be clean prose, NOT bullet points
638
947
  */
639
948
  private extractSCQA;
640
949
  /**
@@ -662,9 +971,17 @@ declare class ContentAnalyzer {
662
971
  private extractKeyMessages;
663
972
  /**
664
973
  * Extract data points (metrics with values)
665
- * IMPROVED: Smarter label extraction that understands markdown tables
974
+ * REWRITTEN: Proper markdown table parsing and meaningful label extraction
666
975
  */
667
976
  private extractDataPoints;
977
+ /**
978
+ * Extract metrics from a parsed markdown table
979
+ */
980
+ private extractMetricsFromTable;
981
+ /**
982
+ * Clean a metric label to ensure it's complete and meaningful
983
+ */
984
+ private cleanMetricLabel;
668
985
  /**
669
986
  * Extract a meaningful label from a line containing a metric
670
987
  */
@@ -681,116 +998,220 @@ declare class ContentAnalyzer {
681
998
  }
682
999
 
683
1000
  /**
684
- * Slide Factory - Creates Slides from Content Analysis
1001
+ * SlideFactory - 100% KB-Driven Slide Creation (v7.1.0)
685
1002
  *
686
- * Generates slide structures based on:
687
- * - Presentation mode (keynote vs business)
688
- * - Content analysis results
689
- * - Expert methodology recommendations
1003
+ * CRITICAL: This factory creates slides using ONLY the Knowledge Base.
1004
+ * ZERO hardcoded values. Every string and number comes from KB queries.
1005
+ *
1006
+ * All decisions flow from:
1007
+ * - kb.getSlideDefaults(type) → structural slide titles/labels
1008
+ * - kb.getSCQATitles(type) → SCQA framework titles
1009
+ * - kb.getSparklineTitles(type) → Sparkline framework titles
1010
+ * - kb.getValidationRules(type) → word limits, bullet limits
1011
+ * - kb.getAllowedSlideTypes(type) → which slide types can be used
1012
+ * - kb.getInsightMarkers() → action title detection
1013
+ * - kb.getTypographyForType(type) → font specifications
1014
+ * - kb.getRecommendedPalette(type) → color palette
1015
+ * - kb.getAntiPatternsForType(type) → what to avoid
1016
+ * - kb.getRequiredElements(type) → mandatory slides
1017
+ * - kb.getDuarteGlanceTest() → 3-second test limits
1018
+ * - kb.getMillersLaw() → 7±2 items rule
1019
+ *
1020
+ * @version 7.1.0
690
1021
  */
691
1022
 
1023
+ /**
1024
+ * KB-Driven SlideFactory (v7.1.0)
1025
+ *
1026
+ * Usage:
1027
+ * const factory = new SlideFactory(kb, 'consulting_deck');
1028
+ * const slides = await factory.createSlides(analysis);
1029
+ */
692
1030
  declare class SlideFactory {
693
- private readonly templates;
1031
+ private kb;
1032
+ private presentationType;
1033
+ private classifier;
1034
+ private config;
694
1035
  private usedContent;
695
- constructor();
1036
+ private usedTitles;
1037
+ constructor(kb: KnowledgeGateway, type: PresentationType);
696
1038
  /**
697
- * Check if content has already been used (deduplication)
1039
+ * Load ALL configuration from KB - ZERO hardcoded values after this.
698
1040
  */
699
- private isContentUsed;
1041
+ private loadKBConfig;
700
1042
  /**
701
- * Create slides from analyzed content.
702
- *
703
- * ARCHITECTURE (per KB expert methodologies):
704
- * 1. Title slide - always first
705
- * 2. Agenda slide - business mode only with 3+ sections
706
- * 3. SCQA slides - Situation, Complication (per Minto)
707
- * 4. Content slides - from sections with bullets/content
708
- * 5. Metrics slide - if data points exist
709
- * 6. Solution slide - SCQA answer
710
- * 7. STAR moments - only if high-quality (per Duarte)
711
- * 8. CTA slide - if call to action exists
712
- * 9. Thank you slide - always last
1043
+ * Create all slides from content analysis.
1044
+ * This is the main entry point - orchestrates the entire slide creation process.
713
1045
  */
714
- createSlides(analysis: ContentAnalysis$1, mode: PresentationMode$1): Promise<Slide[]>;
1046
+ createSlides(analysis: ContentAnalysis$1): Promise<Slide[]>;
1047
+ private createSlideByType;
1048
+ private createTitleSlide;
1049
+ private createAgendaSlide;
1050
+ private createThankYouSlide;
1051
+ private addSCQASlides;
1052
+ private addSparklineSlides;
1053
+ private createBigNumberSlide;
1054
+ private createComparisonSlide;
1055
+ private createTimelineSlide;
1056
+ private createProcessSlide;
1057
+ private createThreeColumnSlide;
1058
+ private createTwoColumnSlide;
1059
+ private createQuoteSlide;
1060
+ private createMetricsGridSlide;
1061
+ private createBulletSlide;
1062
+ private createSingleStatementSlide;
1063
+ private createCodeSlide;
1064
+ private createCTASlide;
1065
+ private validateAndFixSlides;
715
1066
  /**
716
- * Create a slide from a section with bullets
1067
+ * Check that required elements exist in the deck (from KB)
717
1068
  */
718
- private createSectionBulletSlide;
1069
+ private checkRequiredElements;
719
1070
  /**
720
- * Create a slide from a section with body content
1071
+ * Check for anti-patterns from KB
721
1072
  */
722
- private createSectionContentSlide;
1073
+ private checkAntiPatterns;
723
1074
  /**
724
- * Extract first sentence from text
1075
+ * Create a title for a slide - uses action titles for business mode per KB
725
1076
  */
726
- private extractFirstSentence;
1077
+ private createTitle;
727
1078
  /**
728
- * Create a metrics slide from data points
1079
+ * Create an action title (Minto/McKinsey style)
1080
+ * Title should communicate the conclusion, not the topic
729
1081
  */
730
- private createMetricsSlide;
1082
+ private createActionTitle;
731
1083
  /**
732
- * Create a title slide.
1084
+ * Check if text contains an insight (not just a topic) - uses KB markers
733
1085
  */
734
- private createTitleSlide;
1086
+ private isInsightful;
735
1087
  /**
736
- * Create an agenda slide.
1088
+ * Check if a title is an action title
737
1089
  */
738
- private createAgendaSlide;
1090
+ private isActionTitle;
739
1091
  /**
740
- * Create a context/situation slide.
1092
+ * Count words in a slide
741
1093
  */
742
- private createContextSlide;
1094
+ private countWords;
743
1095
  /**
744
- * Create a problem/complication slide.
1096
+ * Truncate text to word limit at sentence boundaries
745
1097
  */
746
- private createProblemSlide;
1098
+ private truncateText;
747
1099
  /**
748
- * Create a key message slide.
1100
+ * Clean text by removing content markers and normalizing
749
1101
  */
750
- private createMessageSlide;
1102
+ private cleanText;
751
1103
  /**
752
- * Create a STAR moment slide.
1104
+ * Clean metric labels (strip table syntax)
753
1105
  */
754
- private createStarMomentSlide;
1106
+ private cleanMetricLabel;
755
1107
  /**
756
- * Create a solution/answer slide.
1108
+ * Normalize a key for deduplication
757
1109
  */
758
- private createSolutionSlide;
1110
+ private normalizeKey;
1111
+ }
1112
+ /**
1113
+ * Create a SlideFactory instance (convenience function)
1114
+ */
1115
+ declare function createSlideFactory(kb: KnowledgeGateway, type: PresentationType): SlideFactory;
1116
+
1117
+ /**
1118
+ * Content Pattern Classifier
1119
+ *
1120
+ * Analyzes content sections to detect patterns that determine slide type selection.
1121
+ * This classifier is used by SlideFactory to match content to KB-allowed slide types.
1122
+ *
1123
+ * @version 7.0.0
1124
+ */
1125
+
1126
+ declare class ContentPatternClassifier {
1127
+ private readonly patterns;
759
1128
  /**
760
- * Create a call-to-action slide.
1129
+ * Classify a content section to determine its primary pattern.
1130
+ * Returns a ContentPattern object used by SlideFactory to select slide type.
761
1131
  */
762
- private createCTASlide;
1132
+ classify(section: ContentSection$1): ContentPattern;
763
1133
  /**
764
- * Create a thank you slide.
1134
+ * Check if bullets appear to be numbered/ordered items
765
1135
  */
766
- private createThankYouSlide;
1136
+ private hasNumberedItems;
1137
+ /**
1138
+ * Extract the big number value from content for display
1139
+ */
1140
+ extractBigNumber(content: string): {
1141
+ value: string;
1142
+ context: string;
1143
+ } | null;
767
1144
  /**
768
- * Initialize slide templates with constraints.
1145
+ * Extract comparison elements from content
769
1146
  */
770
- private initializeTemplates;
1147
+ extractComparison(section: ContentSection$1): {
1148
+ left: string;
1149
+ right: string;
1150
+ } | null;
771
1151
  /**
772
- * Clean text by removing all markdown and content markers.
773
- * CRITICAL: Must strip all formatting to prevent garbage in slides
1152
+ * Extract timeline/process steps from content
774
1153
  */
775
- private cleanText;
1154
+ extractSteps(section: ContentSection$1): Array<{
1155
+ label: string;
1156
+ description: string;
1157
+ }>;
1158
+ /**
1159
+ * Determine if content is suitable for a three-column layout
1160
+ * (3 pillars, 3 key points, etc.)
1161
+ */
1162
+ isSuitableForThreeColumn(section: ContentSection$1): boolean;
776
1163
  /**
777
- * Truncate text to max length at sentence boundary when possible.
778
- * CRITICAL: Never cut mid-number (99.5% should not become 99.)
1164
+ * Check if content should be displayed as a quote slide
779
1165
  */
780
- private truncate;
1166
+ isQuoteContent(section: ContentSection$1): {
1167
+ isQuote: boolean;
1168
+ attribution?: string;
1169
+ };
1170
+ }
1171
+
1172
+ /**
1173
+ * SlideGenerator - Orchestrates slide creation using KB-driven SlideFactory
1174
+ *
1175
+ * This generator orchestrates the slide creation process:
1176
+ * - Initializes KnowledgeGateway
1177
+ * - Creates SlideFactory with KB and presentation type
1178
+ * - Delegates all slide creation to SlideFactory
1179
+ * - SlideFactory handles all KB queries for slide decisions
1180
+ *
1181
+ * @version 7.0.0 - Now uses KB-driven SlideFactory
1182
+ */
1183
+
1184
+ declare class SlideGenerator {
1185
+ private kb;
1186
+ private factory;
1187
+ private mode;
1188
+ private presentationType;
1189
+ initialize(): Promise<void>;
781
1190
  /**
782
- * Extract an action title from a message.
1191
+ * Generate slides from analyzed content using KB-driven SlideFactory.
1192
+ *
1193
+ * @version 7.0.0 - Now delegates ALL slide creation to SlideFactory
1194
+ * SlideFactory queries KB for every decision:
1195
+ * - Allowed slide types per presentation type
1196
+ * - Word limits per type
1197
+ * - Bullet limits per type
1198
+ * - Content pattern to slide type mapping
1199
+ * - Slide validation against KB rules
783
1200
  */
784
- private extractActionTitle;
1201
+ generate(analysis: ContentAnalysis$1, type?: PresentationType): Promise<Slide[]>;
785
1202
  /**
786
- * Extract bullet points from text.
1203
+ * Convert new Slide format to legacy format for backwards compatibility
787
1204
  */
788
- private extractBullets;
1205
+ private convertToLegacyFormat;
789
1206
  /**
790
- * Remove a statistic from text and clean thoroughly.
1207
+ * Map slide type to template name for backwards compatibility
791
1208
  */
792
- private removeStatistic;
1209
+ private mapTypeToTemplate;
793
1210
  }
1211
+ /**
1212
+ * Initialize and return a SlideGenerator instance
1213
+ */
1214
+ declare function initSlideGenerator(): Promise<SlideGenerator>;
794
1215
 
795
1216
  /**
796
1217
  * Template Engine - Handlebars Template Rendering
@@ -977,6 +1398,263 @@ declare class QAEngine {
977
1398
  private closeBrowser;
978
1399
  }
979
1400
 
1401
+ /**
1402
+ * Seven-Dimension Presentation Scorer
1403
+ *
1404
+ * Comprehensive scoring across all quality dimensions using Knowledge Base rules.
1405
+ * Each dimension scored 0-100, overall score is weighted average.
1406
+ *
1407
+ * Dimensions:
1408
+ * 1. Layout (15%) - Whitespace, visual balance, slide structure
1409
+ * 2. Contrast (15%) - WCAG compliance, text readability
1410
+ * 3. Graphics (10%) - Image quality, placement, relevance
1411
+ * 4. Content (20%) - Word limits, bullet counts, structure
1412
+ * 5. Clarity (15%) - Message focus, information density
1413
+ * 6. Effectiveness (15%) - Expert methodology compliance
1414
+ * 7. Consistency (10%) - Style uniformity, design coherence
1415
+ */
1416
+
1417
+ interface DimensionScore {
1418
+ name: string;
1419
+ score: number;
1420
+ weight: number;
1421
+ issues: DimensionIssue[];
1422
+ details: Record<string, unknown>;
1423
+ }
1424
+ interface DimensionIssue {
1425
+ slideIndex: number;
1426
+ dimension: string;
1427
+ severity: 'error' | 'warning' | 'info';
1428
+ message: string;
1429
+ currentValue?: unknown;
1430
+ expectedValue?: unknown;
1431
+ autoFixable: boolean;
1432
+ fixSuggestion?: string;
1433
+ }
1434
+ interface SevenDimensionResult {
1435
+ overallScore: number;
1436
+ dimensions: {
1437
+ layout: DimensionScore;
1438
+ contrast: DimensionScore;
1439
+ graphics: DimensionScore;
1440
+ content: DimensionScore;
1441
+ clarity: DimensionScore;
1442
+ effectiveness: DimensionScore;
1443
+ consistency: DimensionScore;
1444
+ };
1445
+ issues: DimensionIssue[];
1446
+ passed: boolean;
1447
+ threshold: number;
1448
+ }
1449
+ declare class SevenDimensionScorer {
1450
+ private kb;
1451
+ private mode;
1452
+ private presentationType;
1453
+ constructor(mode: 'keynote' | 'business', presentationType: PresentationType);
1454
+ /**
1455
+ * Score a presentation across all 7 dimensions.
1456
+ */
1457
+ score(slides: Slide[], html: string, threshold?: number): Promise<SevenDimensionResult>;
1458
+ /**
1459
+ * Score layout dimension (whitespace, visual balance, structure)
1460
+ */
1461
+ private scoreLayout;
1462
+ /**
1463
+ * Score contrast dimension (WCAG compliance, readability)
1464
+ */
1465
+ private scoreContrast;
1466
+ /**
1467
+ * Score graphics dimension (images, placement, relevance)
1468
+ */
1469
+ private scoreGraphics;
1470
+ /**
1471
+ * Score content dimension (word limits, bullet counts, structure)
1472
+ * This is critical - must use KB rules exactly.
1473
+ */
1474
+ private scoreContent;
1475
+ /**
1476
+ * Score clarity dimension (message focus, information density)
1477
+ */
1478
+ private scoreClarity;
1479
+ /**
1480
+ * Score effectiveness dimension (expert methodology compliance)
1481
+ */
1482
+ private scoreEffectiveness;
1483
+ /**
1484
+ * Score consistency dimension (style uniformity, design coherence)
1485
+ */
1486
+ private scoreConsistency;
1487
+ /**
1488
+ * Count words in a slide.
1489
+ */
1490
+ private countWords;
1491
+ /**
1492
+ * Get a formatted report of the scoring results.
1493
+ */
1494
+ formatReport(result: SevenDimensionResult): string;
1495
+ }
1496
+
1497
+ /**
1498
+ * AutoFix Engine
1499
+ *
1500
+ * KB-driven automatic fixing of presentation issues.
1501
+ * Uses Knowledge Base rules to determine correct values and apply fixes.
1502
+ *
1503
+ * Key Principles:
1504
+ * 1. All fixes are driven by KB rules, not hardcoded values
1505
+ * 2. Fixes are applied to slide data, not raw HTML (for reliability)
1506
+ * 3. Each fix is logged for transparency
1507
+ * 4. Only auto-fixable issues are addressed
1508
+ */
1509
+
1510
+ interface FixResult {
1511
+ slideIndex: number;
1512
+ dimension: string;
1513
+ originalValue: unknown;
1514
+ newValue: unknown;
1515
+ description: string;
1516
+ applied: boolean;
1517
+ }
1518
+ interface AutoFixResult {
1519
+ slidesFixed: Slide[];
1520
+ fixesApplied: FixResult[];
1521
+ fixesSkipped: FixResult[];
1522
+ summary: string;
1523
+ }
1524
+ declare class AutoFixEngine {
1525
+ private kb;
1526
+ private mode;
1527
+ private presentationType;
1528
+ constructor(mode: 'keynote' | 'business', presentationType: PresentationType);
1529
+ /**
1530
+ * Apply automatic fixes to slides based on scoring results.
1531
+ */
1532
+ fix(slides: Slide[], scoringResult: SevenDimensionResult): Promise<AutoFixResult>;
1533
+ /**
1534
+ * Apply a single fix based on the issue.
1535
+ */
1536
+ private applyFix;
1537
+ /**
1538
+ * Fix content-related issues (word count, bullet count).
1539
+ */
1540
+ private fixContentIssue;
1541
+ /**
1542
+ * Fix clarity-related issues (key message length, title length).
1543
+ */
1544
+ private fixClarityIssue;
1545
+ /**
1546
+ * Fix layout-related issues.
1547
+ */
1548
+ private fixLayoutIssue;
1549
+ /**
1550
+ * Fix consistency-related issues.
1551
+ */
1552
+ private fixConsistencyIssue;
1553
+ /**
1554
+ * Fix contrast-related issues.
1555
+ * Note: These are CSS fixes, typically handled at generation time.
1556
+ */
1557
+ private fixContrastIssue;
1558
+ /**
1559
+ * Condense text to approximately maxWords.
1560
+ * Uses smart truncation that preserves meaning.
1561
+ */
1562
+ private condenseText;
1563
+ /**
1564
+ * Convert text to Title Case.
1565
+ */
1566
+ private toTitleCase;
1567
+ /**
1568
+ * Count words in a slide.
1569
+ */
1570
+ private countWords;
1571
+ /**
1572
+ * Count elements in a slide.
1573
+ */
1574
+ private countElements;
1575
+ /**
1576
+ * Generate a summary of fixes applied.
1577
+ */
1578
+ private generateSummary;
1579
+ }
1580
+ /**
1581
+ * Create an AutoFixEngine instance.
1582
+ */
1583
+ declare function createAutoFixEngine(mode: 'keynote' | 'business', presentationType: PresentationType): AutoFixEngine;
1584
+
1585
+ /**
1586
+ * Iterative QA Engine
1587
+ *
1588
+ * Orchestrates the generate-score-fix-regenerate loop until quality threshold is met.
1589
+ * This is the core integration that makes the NPM tool self-correcting.
1590
+ *
1591
+ * Process:
1592
+ * 1. Generate initial presentation
1593
+ * 2. Score across 7 dimensions
1594
+ * 3. If score < threshold AND iterations < max:
1595
+ * a. Apply auto-fixes to slides
1596
+ * b. Regenerate HTML
1597
+ * c. Re-score
1598
+ * d. Repeat until threshold met or max iterations
1599
+ * 4. Return final result with full audit trail
1600
+ */
1601
+
1602
+ interface IterationRecord {
1603
+ iteration: number;
1604
+ score: number;
1605
+ dimensionScores: {
1606
+ layout: number;
1607
+ contrast: number;
1608
+ graphics: number;
1609
+ content: number;
1610
+ clarity: number;
1611
+ effectiveness: number;
1612
+ consistency: number;
1613
+ };
1614
+ fixesApplied: number;
1615
+ timestamp: Date;
1616
+ }
1617
+ interface IterativeQAResult {
1618
+ finalScore: number;
1619
+ passed: boolean;
1620
+ threshold: number;
1621
+ iterations: IterationRecord[];
1622
+ totalIterations: number;
1623
+ maxIterations: number;
1624
+ slides: Slide[];
1625
+ html: string;
1626
+ finalScoring: SevenDimensionResult;
1627
+ autoFixSummary: string;
1628
+ report: string;
1629
+ }
1630
+ interface IterativeQAOptions {
1631
+ minScore: number;
1632
+ maxIterations: number;
1633
+ verbose: boolean;
1634
+ }
1635
+ declare class IterativeQAEngine {
1636
+ private kb;
1637
+ private scorer;
1638
+ private fixer;
1639
+ private generator;
1640
+ private mode;
1641
+ private presentationType;
1642
+ private config;
1643
+ constructor(mode: 'keynote' | 'business', presentationType: PresentationType, config: PresentationConfig);
1644
+ /**
1645
+ * Run the iterative QA process.
1646
+ */
1647
+ run(initialSlides: Slide[], initialHtml: string, options?: Partial<IterativeQAOptions>): Promise<IterativeQAResult>;
1648
+ /**
1649
+ * Generate a comprehensive report.
1650
+ */
1651
+ private generateReport;
1652
+ }
1653
+ /**
1654
+ * Create an IterativeQAEngine instance.
1655
+ */
1656
+ declare function createIterativeQAEngine(mode: 'keynote' | 'business', presentationType: PresentationType, config: PresentationConfig): IterativeQAEngine;
1657
+
980
1658
  /**
981
1659
  * Reveal.js Generator - HTML Presentation Output
982
1660
  *
@@ -1411,7 +2089,7 @@ declare function validate(presentation: string | Buffer, options?: {
1411
2089
  /**
1412
2090
  * Get the version of the package.
1413
2091
  */
1414
- declare const VERSION = "6.0.0";
2092
+ declare const VERSION = "7.1.0";
1415
2093
  /**
1416
2094
  * Default export for convenience.
1417
2095
  */
@@ -1423,4 +2101,4 @@ declare const _default: {
1423
2101
  VERSION: string;
1424
2102
  };
1425
2103
 
1426
- export { type AccessibilityResults, type ChartData, type ChartDataset, ChartJsProvider, type ChartProvider, type ChartRequest, type ChartResult, type ChartType, type ColorPalette, CompositeChartProvider, CompositeImageProvider, type ContentAnalysis$1 as ContentAnalysis, ContentAnalyzer, type ContentQAResults, type ContentSection$1 as ContentSection, type ContrastIssue, type ExpertQAResults, type ExpertValidation, type FontSizeIssue, type GlanceTestResult, type ImageData, type ImageProvider, type ImageRequest, type ImageResult, KnowledgeGateway, LocalImageProvider, MermaidProvider, type MetricData, type OneIdeaResult, type OutputFormat, PlaceholderImageProvider, PowerPointGenerator, type PresentationConfig, PresentationEngine, type PresentationMetadata, type PresentationMode$1 as PresentationMode, type PresentationResult, type PresentationType, QAEngine, QAFailureError, type QAIssue, type QAResults, QuickChartProvider, RevealJsGenerator, type SCQAStructure, ScoreCalculator, type SignalNoiseResult, type Slide, type SlideContentScore, type SlideData, SlideFactory, type SlideTemplate, type SlideType, type SlideVisualScore, type SparklineStructure, TemplateEngine, TemplateNotFoundError, type ThemeName, UnsplashImageProvider, VERSION, ValidationError, type VisualQAResults, createDefaultChartProvider, createDefaultImageProvider, _default as default, generate, getKnowledgeGateway, validate };
2104
+ export { type AccessibilityResults, AutoFixEngine, type AutoFixResult, type ChartData, type ChartDataset, ChartJsProvider, type ChartProvider, type ChartRequest, type ChartResult, type ChartType, type ColorPalette, CompositeChartProvider, CompositeImageProvider, type ContentAnalysis$1 as ContentAnalysis, ContentAnalyzer, type ContentPattern, ContentPatternClassifier, type ContentQAResults, type ContentSection$1 as ContentSection, type ContrastIssue, type DimensionIssue, type DimensionScore, type ExpertQAResults, type ExpertValidation, type FixResult, type FontSizeIssue, type GlanceTestResult, type ImageData, type ImageProvider, type ImageRequest, type ImageResult, type IterationRecord, IterativeQAEngine, type IterativeQAOptions, type IterativeQAResult, KnowledgeGateway, LocalImageProvider, MermaidProvider, type MetricData, type OneIdeaResult, type OutputFormat, PlaceholderImageProvider, PowerPointGenerator, type PresentationConfig, PresentationEngine, type PresentationMetadata, type PresentationMode$1 as PresentationMode, type PresentationResult, type PresentationType, QAEngine, QAFailureError, type QAIssue, type QAResults, QuickChartProvider, RevealJsGenerator, type SCQAStructure, ScoreCalculator, type ScoringWeights, type SevenDimensionResult, SevenDimensionScorer, type SignalNoiseResult, type Slide, type SlideContentScore, type SlideData, SlideFactory, SlideGenerator, type SlideTemplate, type SlideType, type SlideValidationResult, type SlideVisualScore, type SparklineStructure, type StoryStructure, TemplateEngine, TemplateNotFoundError, type ThemeName, type TypographyRules, UnsplashImageProvider, VERSION, ValidationError, type ValidationRules, type VisualQAResults, createAutoFixEngine, createDefaultChartProvider, createDefaultImageProvider, createIterativeQAEngine, createSlideFactory, _default as default, generate, getKnowledgeGateway, initSlideGenerator, validate };