claude-presentation-master 6.1.1 → 7.2.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/README.md +298 -562
- package/bin/auto-fix-presentation.cjs +446 -0
- package/bin/cli.js +101 -32
- package/bin/qa-presentation.cjs +279 -0
- package/bin/score-presentation.cjs +488 -0
- package/dist/index.d.mts +838 -74
- package/dist/index.d.ts +838 -74
- package/dist/index.js +3203 -522
- package/dist/index.mjs +3195 -523
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module types
|
|
4
4
|
*/
|
|
5
5
|
type PresentationMode$1 = 'keynote' | 'business';
|
|
6
|
-
type OutputFormat = 'html' | 'pptx';
|
|
6
|
+
type OutputFormat = 'html' | 'pptx' | 'pdf';
|
|
7
7
|
type ThemeName = 'default' | 'light-corporate' | 'modern-tech' | 'minimal' | 'warm' | 'creative';
|
|
8
8
|
type PresentationType$1 = 'ted_keynote' | 'sales_pitch' | 'consulting_deck' | 'investment_banking' | 'investor_pitch' | 'technical_presentation' | 'all_hands';
|
|
9
9
|
interface PresentationConfig {
|
|
@@ -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,12 @@ 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;
|
|
48
|
+
/** Generate PDF alongside HTML (default: true when format includes 'html') */
|
|
49
|
+
generatePdf?: boolean;
|
|
40
50
|
}
|
|
41
51
|
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
52
|
interface Slide {
|
|
@@ -88,6 +98,26 @@ interface MetricData {
|
|
|
88
98
|
change?: string;
|
|
89
99
|
trend?: 'up' | 'down' | 'neutral';
|
|
90
100
|
}
|
|
101
|
+
/** Legacy slide format for backwards compatibility */
|
|
102
|
+
interface LegacySlide {
|
|
103
|
+
index: number;
|
|
104
|
+
type: string;
|
|
105
|
+
title: string;
|
|
106
|
+
content: {
|
|
107
|
+
subtitle?: string | undefined;
|
|
108
|
+
statement?: string | undefined;
|
|
109
|
+
body?: string | undefined;
|
|
110
|
+
bullets?: string[] | undefined;
|
|
111
|
+
metrics?: MetricData[] | undefined;
|
|
112
|
+
quote?: {
|
|
113
|
+
text: string;
|
|
114
|
+
attribution?: string | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
callToAction?: string | undefined;
|
|
117
|
+
};
|
|
118
|
+
notes?: string | undefined;
|
|
119
|
+
template: string;
|
|
120
|
+
}
|
|
91
121
|
interface QAResults {
|
|
92
122
|
/** Visual quality results */
|
|
93
123
|
visual: VisualQAResults;
|
|
@@ -149,7 +179,7 @@ interface GlanceTestResult {
|
|
|
149
179
|
wordCount: number;
|
|
150
180
|
readingTime: number;
|
|
151
181
|
passed: boolean;
|
|
152
|
-
recommendation?: string;
|
|
182
|
+
recommendation?: string | undefined;
|
|
153
183
|
}
|
|
154
184
|
interface SignalNoiseResult {
|
|
155
185
|
slideIndex: number;
|
|
@@ -164,7 +194,7 @@ interface OneIdeaResult {
|
|
|
164
194
|
ideaCount: number;
|
|
165
195
|
mainIdea: string;
|
|
166
196
|
passed: boolean;
|
|
167
|
-
conflictingIdeas?: string[];
|
|
197
|
+
conflictingIdeas?: string[] | undefined;
|
|
168
198
|
}
|
|
169
199
|
interface ExpertQAResults {
|
|
170
200
|
/** Nancy Duarte validation */
|
|
@@ -221,11 +251,47 @@ interface QAIssue {
|
|
|
221
251
|
/** Suggested fix */
|
|
222
252
|
suggestion?: string;
|
|
223
253
|
}
|
|
254
|
+
/** Result from 7-dimension QA scoring */
|
|
255
|
+
interface SevenDimensionQAResult {
|
|
256
|
+
passed: boolean;
|
|
257
|
+
score: number;
|
|
258
|
+
visual: {
|
|
259
|
+
whitespacePercentage: number;
|
|
260
|
+
layoutBalance: number;
|
|
261
|
+
colorContrast: number;
|
|
262
|
+
};
|
|
263
|
+
content: {
|
|
264
|
+
perSlide: SlideContentScore[];
|
|
265
|
+
issues: Array<{
|
|
266
|
+
dimension: string;
|
|
267
|
+
message: string;
|
|
268
|
+
slideIndex?: number;
|
|
269
|
+
}>;
|
|
270
|
+
};
|
|
271
|
+
accessibility: {
|
|
272
|
+
wcagLevel: string;
|
|
273
|
+
issues: Array<{
|
|
274
|
+
dimension: string;
|
|
275
|
+
message: string;
|
|
276
|
+
slideIndex?: number;
|
|
277
|
+
}>;
|
|
278
|
+
};
|
|
279
|
+
issues: Array<{
|
|
280
|
+
severity: string;
|
|
281
|
+
message: string;
|
|
282
|
+
slideIndex?: number;
|
|
283
|
+
dimension: string;
|
|
284
|
+
}>;
|
|
285
|
+
dimensions: Record<string, number>;
|
|
286
|
+
iterations: unknown[];
|
|
287
|
+
report: string;
|
|
288
|
+
}
|
|
224
289
|
interface PresentationResult {
|
|
225
290
|
/** Generated outputs */
|
|
226
291
|
outputs: {
|
|
227
292
|
html?: string;
|
|
228
293
|
pptx?: Buffer;
|
|
294
|
+
pdf?: Buffer;
|
|
229
295
|
};
|
|
230
296
|
/** QA validation results */
|
|
231
297
|
qaResults: QAResults;
|
|
@@ -243,16 +309,29 @@ interface PresentationMetadata {
|
|
|
243
309
|
generatedAt: string;
|
|
244
310
|
/** Presentation mode */
|
|
245
311
|
mode: PresentationMode$1;
|
|
312
|
+
/** Detected/specified presentation type */
|
|
313
|
+
presentationType?: PresentationType$1;
|
|
246
314
|
/** Total slide count */
|
|
247
315
|
slideCount: number;
|
|
248
316
|
/** Total word count */
|
|
249
317
|
wordCount: number;
|
|
318
|
+
/** Total words (alias for wordCount) */
|
|
319
|
+
totalWords?: number;
|
|
250
320
|
/** Average words per slide */
|
|
251
321
|
avgWordsPerSlide: number;
|
|
252
322
|
/** Estimated presentation duration (minutes) */
|
|
253
323
|
estimatedDuration: number;
|
|
254
324
|
/** Themes/frameworks used */
|
|
255
325
|
frameworks: string[];
|
|
326
|
+
/** QA iterations used */
|
|
327
|
+
qaIterations?: number;
|
|
328
|
+
/** Max iterations configured */
|
|
329
|
+
qaMaxIterations?: number;
|
|
330
|
+
/** 7-dimension scores */
|
|
331
|
+
dimensionScores?: Record<string, {
|
|
332
|
+
score: number;
|
|
333
|
+
weight: number;
|
|
334
|
+
}>;
|
|
256
335
|
}
|
|
257
336
|
interface ContentSection$1 {
|
|
258
337
|
/** Section header text */
|
|
@@ -322,22 +401,122 @@ declare class TemplateNotFoundError extends Error {
|
|
|
322
401
|
templatePath: string;
|
|
323
402
|
constructor(templatePath: string, message?: string);
|
|
324
403
|
}
|
|
404
|
+
/**
|
|
405
|
+
* Content pattern detected from a section
|
|
406
|
+
* Used to match content to appropriate slide types
|
|
407
|
+
*/
|
|
408
|
+
interface ContentPattern {
|
|
409
|
+
/** Section has a big number ($X, X%, Xx) */
|
|
410
|
+
hasBigNumber: boolean;
|
|
411
|
+
/** Extracted big number value */
|
|
412
|
+
bigNumberValue?: string;
|
|
413
|
+
/** Section has comparison language (vs, before/after) */
|
|
414
|
+
hasComparison: boolean;
|
|
415
|
+
/** Section has timeline markers (Phase, Week, Q1) */
|
|
416
|
+
hasTimeline: boolean;
|
|
417
|
+
/** Section has process/steps (Step 1, Pillar) */
|
|
418
|
+
hasProcess: boolean;
|
|
419
|
+
/** Section has 3+ metrics */
|
|
420
|
+
hasMetrics: boolean;
|
|
421
|
+
/** Section is a quote */
|
|
422
|
+
hasQuote: boolean;
|
|
423
|
+
/** Section has code blocks */
|
|
424
|
+
hasCode: boolean;
|
|
425
|
+
/** Number of bullets in section */
|
|
426
|
+
bulletCount: number;
|
|
427
|
+
/** Word count of section */
|
|
428
|
+
wordCount: number;
|
|
429
|
+
/** Primary detected pattern name */
|
|
430
|
+
primaryPattern: 'big_number' | 'comparison' | 'timeline' | 'process' | 'metrics' | 'quote' | 'code' | 'bullets' | 'prose';
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Validation rules from KB for a presentation type
|
|
434
|
+
*/
|
|
435
|
+
interface ValidationRules {
|
|
436
|
+
wordsPerSlide: {
|
|
437
|
+
min: number;
|
|
438
|
+
max: number;
|
|
439
|
+
ideal: number;
|
|
440
|
+
};
|
|
441
|
+
whitespace: {
|
|
442
|
+
min: number;
|
|
443
|
+
ideal: number;
|
|
444
|
+
};
|
|
445
|
+
bulletsPerSlide: {
|
|
446
|
+
max: number;
|
|
447
|
+
};
|
|
448
|
+
slidesPerIdea?: number;
|
|
449
|
+
actionTitlesRequired: boolean;
|
|
450
|
+
sourcesRequired: boolean;
|
|
451
|
+
calloutsRequired?: boolean;
|
|
452
|
+
denseDataAllowed?: boolean;
|
|
453
|
+
codeBlocksAllowed?: boolean;
|
|
454
|
+
diagramsRequired?: boolean;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Typography specifications from KB
|
|
458
|
+
*/
|
|
459
|
+
interface TypographyRules {
|
|
460
|
+
titles: string;
|
|
461
|
+
body: string;
|
|
462
|
+
maxFonts: number;
|
|
463
|
+
actionTitle?: string;
|
|
464
|
+
sectionHeaders?: string;
|
|
465
|
+
dataLabels?: string;
|
|
466
|
+
code?: string;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Scoring weights from KB for QA
|
|
470
|
+
*/
|
|
471
|
+
interface ScoringWeights {
|
|
472
|
+
visualQuality: number;
|
|
473
|
+
contentQuality: number;
|
|
474
|
+
expertCompliance: number;
|
|
475
|
+
accessibility: number;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Result of validating a slide against KB rules
|
|
479
|
+
*/
|
|
480
|
+
interface SlideValidationResult {
|
|
481
|
+
valid: boolean;
|
|
482
|
+
violations: string[];
|
|
483
|
+
warnings: string[];
|
|
484
|
+
wordCount: number;
|
|
485
|
+
bulletCount: number;
|
|
486
|
+
slideType: string;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Story structure from KB
|
|
490
|
+
*/
|
|
491
|
+
interface StoryStructure {
|
|
492
|
+
framework: 'scqa' | 'sparkline' | 'pyramid' | 'hero_journey';
|
|
493
|
+
requiredElements: string[];
|
|
494
|
+
optionalElements: string[];
|
|
495
|
+
antiPatterns: string[];
|
|
496
|
+
}
|
|
325
497
|
|
|
326
498
|
/**
|
|
327
499
|
* Presentation Engine - Main Orchestrator
|
|
328
500
|
*
|
|
329
501
|
* Coordinates content analysis, slide generation, and QA validation
|
|
330
502
|
* to produce world-class presentations.
|
|
503
|
+
*
|
|
504
|
+
* Features:
|
|
505
|
+
* - KB-driven slide generation
|
|
506
|
+
* - 7-dimension quality scoring
|
|
507
|
+
* - Iterative auto-fix loop until threshold met
|
|
508
|
+
* - Comprehensive audit trail
|
|
331
509
|
*/
|
|
332
510
|
|
|
333
511
|
declare class PresentationEngine {
|
|
334
512
|
private contentAnalyzer;
|
|
335
|
-
private slideFactory;
|
|
336
513
|
private templateEngine;
|
|
337
514
|
private scoreCalculator;
|
|
338
515
|
private qaEngine;
|
|
339
516
|
private htmlGenerator;
|
|
340
517
|
private pptxGenerator;
|
|
518
|
+
private pdfGenerator;
|
|
519
|
+
private kb;
|
|
341
520
|
constructor();
|
|
342
521
|
/**
|
|
343
522
|
* Generate a presentation from content.
|
|
@@ -346,6 +525,10 @@ declare class PresentationEngine {
|
|
|
346
525
|
* @returns Presentation result with outputs, QA results, and score
|
|
347
526
|
*/
|
|
348
527
|
generate(config: PresentationConfig): Promise<PresentationResult>;
|
|
528
|
+
/**
|
|
529
|
+
* Build QA results structure from 7-dimension scoring.
|
|
530
|
+
*/
|
|
531
|
+
private buildQAResultsFrom7Dimension;
|
|
349
532
|
/**
|
|
350
533
|
* Validate presentation configuration.
|
|
351
534
|
*/
|
|
@@ -431,6 +614,7 @@ interface ColorPalette {
|
|
|
431
614
|
contrast_ratio: string;
|
|
432
615
|
}
|
|
433
616
|
type PresentationType = 'ted_keynote' | 'sales_pitch' | 'consulting_deck' | 'investment_banking' | 'investor_pitch' | 'technical_presentation' | 'all_hands';
|
|
617
|
+
type KnowledgeBaseData = Record<string, any>;
|
|
434
618
|
declare class KnowledgeGateway {
|
|
435
619
|
private kb;
|
|
436
620
|
private loaded;
|
|
@@ -505,11 +689,11 @@ declare class KnowledgeGateway {
|
|
|
505
689
|
/**
|
|
506
690
|
* Get story framework by name
|
|
507
691
|
*/
|
|
508
|
-
getStoryFramework(name: 'sparkline' | 'scqa' | 'pyramid' | 'scr'):
|
|
692
|
+
getStoryFramework(name: 'sparkline' | 'scqa' | 'pyramid' | 'scr'): unknown;
|
|
509
693
|
/**
|
|
510
694
|
* Get expert principles by name
|
|
511
695
|
*/
|
|
512
|
-
getExpertPrinciples(expertName: string):
|
|
696
|
+
getExpertPrinciples(expertName: string): unknown;
|
|
513
697
|
/**
|
|
514
698
|
* Get Duarte's glance test requirements
|
|
515
699
|
*/
|
|
@@ -533,7 +717,7 @@ declare class KnowledgeGateway {
|
|
|
533
717
|
/**
|
|
534
718
|
* Get chart selection guidance
|
|
535
719
|
*/
|
|
536
|
-
getChartGuidance(purpose: 'comparison' | 'composition' | 'distribution' | 'relationship'):
|
|
720
|
+
getChartGuidance(purpose: 'comparison' | 'composition' | 'distribution' | 'relationship'): unknown;
|
|
537
721
|
/**
|
|
538
722
|
* Get charts to avoid
|
|
539
723
|
*/
|
|
@@ -541,7 +725,7 @@ declare class KnowledgeGateway {
|
|
|
541
725
|
/**
|
|
542
726
|
* Get investment banking pitch book structure
|
|
543
727
|
*/
|
|
544
|
-
getIBPitchBookStructure(type: 'ma_sell_side' | 'ma_buy_side' | 'ipo_pitchbook'):
|
|
728
|
+
getIBPitchBookStructure(type: 'ma_sell_side' | 'ma_buy_side' | 'ipo_pitchbook'): unknown;
|
|
545
729
|
/**
|
|
546
730
|
* Check if knowledge base is loaded
|
|
547
731
|
*/
|
|
@@ -549,7 +733,190 @@ declare class KnowledgeGateway {
|
|
|
549
733
|
/**
|
|
550
734
|
* Get the full knowledge base (for advanced queries)
|
|
551
735
|
*/
|
|
552
|
-
getRawKB():
|
|
736
|
+
getRawKB(): KnowledgeBaseData;
|
|
737
|
+
/**
|
|
738
|
+
* Get allowed slide types for a specific presentation type.
|
|
739
|
+
* CRITICAL: SlideFactory must ONLY use types from this list.
|
|
740
|
+
*/
|
|
741
|
+
getAllowedSlideTypes(type: PresentationType): string[];
|
|
742
|
+
/**
|
|
743
|
+
* Get validation rules for a specific presentation type.
|
|
744
|
+
* Returns word limits, bullet limits, whitespace requirements, etc.
|
|
745
|
+
*/
|
|
746
|
+
getValidationRules(type: PresentationType): {
|
|
747
|
+
wordsPerSlide: {
|
|
748
|
+
min: number;
|
|
749
|
+
max: number;
|
|
750
|
+
ideal: number;
|
|
751
|
+
};
|
|
752
|
+
whitespace: {
|
|
753
|
+
min: number;
|
|
754
|
+
ideal: number;
|
|
755
|
+
};
|
|
756
|
+
bulletsPerSlide: {
|
|
757
|
+
max: number;
|
|
758
|
+
};
|
|
759
|
+
actionTitlesRequired: boolean;
|
|
760
|
+
sourcesRequired: boolean;
|
|
761
|
+
calloutsRequired?: boolean;
|
|
762
|
+
denseDataAllowed?: boolean;
|
|
763
|
+
codeBlocksAllowed?: boolean;
|
|
764
|
+
diagramsRequired?: boolean;
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* Get required elements that MUST be in the deck for this type.
|
|
768
|
+
*/
|
|
769
|
+
getRequiredElements(type: PresentationType): string[];
|
|
770
|
+
/**
|
|
771
|
+
* Get anti-patterns to avoid for this presentation type.
|
|
772
|
+
*/
|
|
773
|
+
getAntiPatternsForType(type: PresentationType): string[];
|
|
774
|
+
/**
|
|
775
|
+
* Get typography specifications for this presentation type.
|
|
776
|
+
*/
|
|
777
|
+
getTypographyForType(type: PresentationType): {
|
|
778
|
+
titles: string;
|
|
779
|
+
body: string;
|
|
780
|
+
maxFonts: number;
|
|
781
|
+
actionTitle?: string;
|
|
782
|
+
sectionHeaders?: string;
|
|
783
|
+
dataLabels?: string;
|
|
784
|
+
code?: string;
|
|
785
|
+
};
|
|
786
|
+
/**
|
|
787
|
+
* Get CSS variables recipe for this presentation type.
|
|
788
|
+
*/
|
|
789
|
+
getCSSVariablesForType(type: PresentationType): string;
|
|
790
|
+
/**
|
|
791
|
+
* Get scoring weights for QA evaluation for this type.
|
|
792
|
+
*/
|
|
793
|
+
getScoringWeights(type: PresentationType): {
|
|
794
|
+
visualQuality: number;
|
|
795
|
+
contentQuality: number;
|
|
796
|
+
expertCompliance: number;
|
|
797
|
+
accessibility: number;
|
|
798
|
+
};
|
|
799
|
+
/**
|
|
800
|
+
* Get story structure framework for this presentation type.
|
|
801
|
+
*/
|
|
802
|
+
getStoryStructure(type: PresentationType): {
|
|
803
|
+
framework: string;
|
|
804
|
+
requiredElements: string[];
|
|
805
|
+
optionalElements: string[];
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* Map a content pattern to the best allowed slide type.
|
|
809
|
+
* CRITICAL: This is how SlideFactory decides which slide type to use.
|
|
810
|
+
*/
|
|
811
|
+
mapContentPatternToSlideType(pattern: {
|
|
812
|
+
primaryPattern: string;
|
|
813
|
+
hasBigNumber?: boolean;
|
|
814
|
+
hasComparison?: boolean;
|
|
815
|
+
hasTimeline?: boolean;
|
|
816
|
+
hasProcess?: boolean;
|
|
817
|
+
hasMetrics?: boolean;
|
|
818
|
+
hasQuote?: boolean;
|
|
819
|
+
hasCode?: boolean;
|
|
820
|
+
bulletCount?: number;
|
|
821
|
+
}, allowedTypes: string[]): string;
|
|
822
|
+
/**
|
|
823
|
+
* Get a specific slide template by name from the KB.
|
|
824
|
+
*/
|
|
825
|
+
getSlideTemplateByName(name: string): {
|
|
826
|
+
name: string;
|
|
827
|
+
purpose: string;
|
|
828
|
+
elements?: string[];
|
|
829
|
+
components?: string[];
|
|
830
|
+
wordLimit: number;
|
|
831
|
+
} | undefined;
|
|
832
|
+
/**
|
|
833
|
+
* Get slide defaults for structural slides (titles, messages, labels).
|
|
834
|
+
* CRITICAL: SlideFactory must use these instead of hardcoded strings.
|
|
835
|
+
*/
|
|
836
|
+
getSlideDefaults(type: PresentationType): {
|
|
837
|
+
agenda: {
|
|
838
|
+
title: string;
|
|
839
|
+
};
|
|
840
|
+
thankYou: {
|
|
841
|
+
title: string;
|
|
842
|
+
subtitle: string;
|
|
843
|
+
};
|
|
844
|
+
cta: {
|
|
845
|
+
title: string;
|
|
846
|
+
message: string;
|
|
847
|
+
fallback: string;
|
|
848
|
+
};
|
|
849
|
+
metricsGrid: {
|
|
850
|
+
title: string;
|
|
851
|
+
maxMetrics: number;
|
|
852
|
+
};
|
|
853
|
+
code: {
|
|
854
|
+
label: string;
|
|
855
|
+
maxChars: number;
|
|
856
|
+
};
|
|
857
|
+
comparison: {
|
|
858
|
+
leftLabel: string;
|
|
859
|
+
rightLabel: string;
|
|
860
|
+
optionLabels: string[];
|
|
861
|
+
};
|
|
862
|
+
column: {
|
|
863
|
+
labelTemplate: string;
|
|
864
|
+
};
|
|
865
|
+
subtitle: {
|
|
866
|
+
maxWords: number;
|
|
867
|
+
};
|
|
868
|
+
context: {
|
|
869
|
+
maxWords: number;
|
|
870
|
+
};
|
|
871
|
+
step: {
|
|
872
|
+
maxWords: number;
|
|
873
|
+
};
|
|
874
|
+
columnContent: {
|
|
875
|
+
maxWords: number;
|
|
876
|
+
};
|
|
877
|
+
};
|
|
878
|
+
/**
|
|
879
|
+
* Get SCQA framework titles from KB (for business mode).
|
|
880
|
+
*/
|
|
881
|
+
getSCQATitles(type: PresentationType): {
|
|
882
|
+
situation: string;
|
|
883
|
+
complication: string;
|
|
884
|
+
question: string;
|
|
885
|
+
answer: string;
|
|
886
|
+
};
|
|
887
|
+
/**
|
|
888
|
+
* Get Sparkline framework titles from KB (for keynote mode).
|
|
889
|
+
*/
|
|
890
|
+
getSparklineTitles(type: PresentationType): {
|
|
891
|
+
whatIs: string;
|
|
892
|
+
whatCouldBe: string;
|
|
893
|
+
callToAdventure: string;
|
|
894
|
+
newBliss: string;
|
|
895
|
+
};
|
|
896
|
+
/**
|
|
897
|
+
* Get insight markers for detecting action titles.
|
|
898
|
+
* These are words/phrases that indicate an insight vs a topic.
|
|
899
|
+
*/
|
|
900
|
+
getInsightMarkers(): string[];
|
|
901
|
+
/**
|
|
902
|
+
* Get word limit for a specific slide element type.
|
|
903
|
+
*/
|
|
904
|
+
getWordLimitForElement(type: PresentationType, element: 'title' | 'subtitle' | 'bullet' | 'body' | 'quote' | 'step'): number;
|
|
905
|
+
/**
|
|
906
|
+
* Validate a slide against KB rules for the given presentation type.
|
|
907
|
+
*/
|
|
908
|
+
validateSlideAgainstKB(slide: {
|
|
909
|
+
type: string;
|
|
910
|
+
wordCount: number;
|
|
911
|
+
bulletCount: number;
|
|
912
|
+
hasActionTitle?: boolean;
|
|
913
|
+
hasSource?: boolean;
|
|
914
|
+
}, type: PresentationType): {
|
|
915
|
+
valid: boolean;
|
|
916
|
+
violations: string[];
|
|
917
|
+
warnings: string[];
|
|
918
|
+
fixes: Record<string, any>;
|
|
919
|
+
};
|
|
553
920
|
}
|
|
554
921
|
/**
|
|
555
922
|
* Get or create the KnowledgeGateway instance
|
|
@@ -619,6 +986,7 @@ declare class ContentAnalyzer {
|
|
|
619
986
|
analyze(content: string, contentType: string): Promise<ContentAnalysis>;
|
|
620
987
|
/**
|
|
621
988
|
* Parse content based on type
|
|
989
|
+
* CRITICAL: Strip code blocks FIRST to prevent code from becoming slides
|
|
622
990
|
*/
|
|
623
991
|
private parseContent;
|
|
624
992
|
/**
|
|
@@ -635,6 +1003,7 @@ declare class ContentAnalyzer {
|
|
|
635
1003
|
private extractSections;
|
|
636
1004
|
/**
|
|
637
1005
|
* Extract SCQA structure (Barbara Minto)
|
|
1006
|
+
* CRITICAL: Answer must be clean prose, NOT bullet points
|
|
638
1007
|
*/
|
|
639
1008
|
private extractSCQA;
|
|
640
1009
|
/**
|
|
@@ -662,9 +1031,17 @@ declare class ContentAnalyzer {
|
|
|
662
1031
|
private extractKeyMessages;
|
|
663
1032
|
/**
|
|
664
1033
|
* Extract data points (metrics with values)
|
|
665
|
-
*
|
|
1034
|
+
* REWRITTEN: Proper markdown table parsing and meaningful label extraction
|
|
666
1035
|
*/
|
|
667
1036
|
private extractDataPoints;
|
|
1037
|
+
/**
|
|
1038
|
+
* Extract metrics from a parsed markdown table
|
|
1039
|
+
*/
|
|
1040
|
+
private extractMetricsFromTable;
|
|
1041
|
+
/**
|
|
1042
|
+
* Clean a metric label to ensure it's complete and meaningful
|
|
1043
|
+
*/
|
|
1044
|
+
private cleanMetricLabel;
|
|
668
1045
|
/**
|
|
669
1046
|
* Extract a meaningful label from a line containing a metric
|
|
670
1047
|
*/
|
|
@@ -678,119 +1055,228 @@ declare class ContentAnalyzer {
|
|
|
678
1055
|
* CRITICAL: Must strip headers, CTA text, and fragments
|
|
679
1056
|
*/
|
|
680
1057
|
private extractFirstSentence;
|
|
1058
|
+
/**
|
|
1059
|
+
* Extract metrics from natural language text
|
|
1060
|
+
* Handles formats like "40% productivity loss", "$2.5M investment"
|
|
1061
|
+
*/
|
|
1062
|
+
private extractMetricsFromText;
|
|
681
1063
|
}
|
|
682
1064
|
|
|
683
1065
|
/**
|
|
684
|
-
*
|
|
1066
|
+
* SlideFactory - 100% KB-Driven Slide Creation (v7.1.0)
|
|
685
1067
|
*
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
*
|
|
689
|
-
*
|
|
1068
|
+
* CRITICAL: This factory creates slides using ONLY the Knowledge Base.
|
|
1069
|
+
* ZERO hardcoded values. Every string and number comes from KB queries.
|
|
1070
|
+
*
|
|
1071
|
+
* All decisions flow from:
|
|
1072
|
+
* - kb.getSlideDefaults(type) → structural slide titles/labels
|
|
1073
|
+
* - kb.getSCQATitles(type) → SCQA framework titles
|
|
1074
|
+
* - kb.getSparklineTitles(type) → Sparkline framework titles
|
|
1075
|
+
* - kb.getValidationRules(type) → word limits, bullet limits
|
|
1076
|
+
* - kb.getAllowedSlideTypes(type) → which slide types can be used
|
|
1077
|
+
* - kb.getInsightMarkers() → action title detection
|
|
1078
|
+
* - kb.getTypographyForType(type) → font specifications
|
|
1079
|
+
* - kb.getRecommendedPalette(type) → color palette
|
|
1080
|
+
* - kb.getAntiPatternsForType(type) → what to avoid
|
|
1081
|
+
* - kb.getRequiredElements(type) → mandatory slides
|
|
1082
|
+
* - kb.getDuarteGlanceTest() → 3-second test limits
|
|
1083
|
+
* - kb.getMillersLaw() → 7±2 items rule
|
|
1084
|
+
*
|
|
1085
|
+
* @version 7.1.0
|
|
690
1086
|
*/
|
|
691
1087
|
|
|
1088
|
+
/**
|
|
1089
|
+
* KB-Driven SlideFactory (v7.1.0)
|
|
1090
|
+
*
|
|
1091
|
+
* Usage:
|
|
1092
|
+
* const factory = new SlideFactory(kb, 'consulting_deck');
|
|
1093
|
+
* const slides = await factory.createSlides(analysis);
|
|
1094
|
+
*/
|
|
692
1095
|
declare class SlideFactory {
|
|
693
|
-
private
|
|
1096
|
+
private kb;
|
|
1097
|
+
private presentationType;
|
|
1098
|
+
private classifier;
|
|
1099
|
+
private config;
|
|
694
1100
|
private usedContent;
|
|
695
|
-
|
|
1101
|
+
private usedTitles;
|
|
1102
|
+
constructor(kb: KnowledgeGateway, type: PresentationType);
|
|
696
1103
|
/**
|
|
697
|
-
*
|
|
1104
|
+
* Load ALL configuration from KB - ZERO hardcoded values after this.
|
|
698
1105
|
*/
|
|
699
|
-
private
|
|
1106
|
+
private loadKBConfig;
|
|
700
1107
|
/**
|
|
701
|
-
* Create slides from
|
|
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
|
|
1108
|
+
* Create all slides from content analysis.
|
|
1109
|
+
* This is the main entry point - orchestrates the entire slide creation process.
|
|
713
1110
|
*/
|
|
714
|
-
createSlides(analysis: ContentAnalysis$1
|
|
1111
|
+
createSlides(analysis: ContentAnalysis$1): Promise<Slide[]>;
|
|
1112
|
+
private createSlideByType;
|
|
1113
|
+
private createTitleSlide;
|
|
1114
|
+
private createAgendaSlide;
|
|
1115
|
+
private createThankYouSlide;
|
|
1116
|
+
private addSCQASlides;
|
|
1117
|
+
private addSparklineSlides;
|
|
1118
|
+
private createBigNumberSlide;
|
|
1119
|
+
private createComparisonSlide;
|
|
1120
|
+
private createTimelineSlide;
|
|
1121
|
+
private createProcessSlide;
|
|
1122
|
+
private createThreeColumnSlide;
|
|
1123
|
+
private createTwoColumnSlide;
|
|
1124
|
+
private createQuoteSlide;
|
|
1125
|
+
private createMetricsGridSlide;
|
|
1126
|
+
private createBulletSlide;
|
|
1127
|
+
private createSingleStatementSlide;
|
|
1128
|
+
private createCodeSlide;
|
|
1129
|
+
private createCTASlide;
|
|
1130
|
+
private validateAndFixSlides;
|
|
715
1131
|
/**
|
|
716
|
-
*
|
|
1132
|
+
* Check that required elements exist in the deck (from KB)
|
|
717
1133
|
*/
|
|
718
|
-
private
|
|
1134
|
+
private checkRequiredElements;
|
|
719
1135
|
/**
|
|
720
|
-
*
|
|
1136
|
+
* Check for anti-patterns from KB
|
|
721
1137
|
*/
|
|
722
|
-
private
|
|
1138
|
+
private checkAntiPatterns;
|
|
723
1139
|
/**
|
|
724
|
-
*
|
|
1140
|
+
* Create a title for a slide - uses action titles for business mode per KB
|
|
725
1141
|
*/
|
|
726
|
-
private
|
|
1142
|
+
private createTitle;
|
|
727
1143
|
/**
|
|
728
|
-
* Create
|
|
1144
|
+
* Create an action title (Minto/McKinsey style)
|
|
1145
|
+
* Title should communicate the conclusion, not the topic
|
|
729
1146
|
*/
|
|
730
|
-
private
|
|
1147
|
+
private createActionTitle;
|
|
731
1148
|
/**
|
|
732
|
-
*
|
|
1149
|
+
* Check if text contains an insight (not just a topic) - uses KB markers
|
|
733
1150
|
*/
|
|
734
|
-
private
|
|
1151
|
+
private isInsightful;
|
|
735
1152
|
/**
|
|
736
|
-
*
|
|
1153
|
+
* Check if a title is an action title
|
|
737
1154
|
*/
|
|
738
|
-
private
|
|
1155
|
+
private isActionTitle;
|
|
739
1156
|
/**
|
|
740
|
-
*
|
|
1157
|
+
* Count words in a slide
|
|
741
1158
|
*/
|
|
742
|
-
private
|
|
1159
|
+
private countWords;
|
|
743
1160
|
/**
|
|
744
|
-
*
|
|
1161
|
+
* Truncate text to word limit at sentence boundaries
|
|
745
1162
|
*/
|
|
746
|
-
private
|
|
1163
|
+
private truncateText;
|
|
747
1164
|
/**
|
|
748
|
-
*
|
|
1165
|
+
* Clean text by removing content markers and normalizing
|
|
749
1166
|
*/
|
|
750
|
-
private
|
|
1167
|
+
private cleanText;
|
|
751
1168
|
/**
|
|
752
|
-
*
|
|
1169
|
+
* Clean metric labels (strip table syntax)
|
|
753
1170
|
*/
|
|
754
|
-
private
|
|
1171
|
+
private cleanMetricLabel;
|
|
755
1172
|
/**
|
|
756
|
-
*
|
|
1173
|
+
* Normalize a key for deduplication
|
|
757
1174
|
*/
|
|
758
|
-
private
|
|
1175
|
+
private normalizeKey;
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Create a SlideFactory instance (convenience function)
|
|
1179
|
+
*/
|
|
1180
|
+
declare function createSlideFactory(kb: KnowledgeGateway, type: PresentationType): SlideFactory;
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Content Pattern Classifier
|
|
1184
|
+
*
|
|
1185
|
+
* Analyzes content sections to detect patterns that determine slide type selection.
|
|
1186
|
+
* This classifier is used by SlideFactory to match content to KB-allowed slide types.
|
|
1187
|
+
*
|
|
1188
|
+
* @version 7.0.0
|
|
1189
|
+
*/
|
|
1190
|
+
|
|
1191
|
+
declare class ContentPatternClassifier {
|
|
1192
|
+
private readonly patterns;
|
|
759
1193
|
/**
|
|
760
|
-
*
|
|
1194
|
+
* Classify a content section to determine its primary pattern.
|
|
1195
|
+
* Returns a ContentPattern object used by SlideFactory to select slide type.
|
|
761
1196
|
*/
|
|
762
|
-
|
|
1197
|
+
classify(section: ContentSection$1): ContentPattern;
|
|
763
1198
|
/**
|
|
764
|
-
*
|
|
1199
|
+
* Check if bullets appear to be numbered/ordered items
|
|
765
1200
|
*/
|
|
766
|
-
private
|
|
1201
|
+
private hasNumberedItems;
|
|
767
1202
|
/**
|
|
768
|
-
*
|
|
1203
|
+
* Extract the big number value from content for display
|
|
769
1204
|
*/
|
|
770
|
-
|
|
1205
|
+
extractBigNumber(content: string): {
|
|
1206
|
+
value: string;
|
|
1207
|
+
context: string;
|
|
1208
|
+
} | null;
|
|
771
1209
|
/**
|
|
772
|
-
*
|
|
773
|
-
* CRITICAL: Must strip all formatting to prevent garbage in slides
|
|
1210
|
+
* Extract comparison elements from content
|
|
774
1211
|
*/
|
|
775
|
-
|
|
1212
|
+
extractComparison(section: ContentSection$1): {
|
|
1213
|
+
left: string;
|
|
1214
|
+
right: string;
|
|
1215
|
+
} | null;
|
|
1216
|
+
/**
|
|
1217
|
+
* Extract timeline/process steps from content
|
|
1218
|
+
*/
|
|
1219
|
+
extractSteps(section: ContentSection$1): Array<{
|
|
1220
|
+
label: string;
|
|
1221
|
+
description: string;
|
|
1222
|
+
}>;
|
|
1223
|
+
/**
|
|
1224
|
+
* Determine if content is suitable for a three-column layout
|
|
1225
|
+
* (3 pillars, 3 key points, etc.)
|
|
1226
|
+
*/
|
|
1227
|
+
isSuitableForThreeColumn(section: ContentSection$1): boolean;
|
|
776
1228
|
/**
|
|
777
|
-
*
|
|
778
|
-
* CRITICAL: Never cut mid-number (99.5% should not become 99.)
|
|
1229
|
+
* Check if content should be displayed as a quote slide
|
|
779
1230
|
*/
|
|
780
|
-
|
|
1231
|
+
isQuoteContent(section: ContentSection$1): {
|
|
1232
|
+
isQuote: boolean;
|
|
1233
|
+
attribution?: string;
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
/**
|
|
1238
|
+
* SlideGenerator - Orchestrates slide creation using KB-driven SlideFactory
|
|
1239
|
+
*
|
|
1240
|
+
* This generator orchestrates the slide creation process:
|
|
1241
|
+
* - Initializes KnowledgeGateway
|
|
1242
|
+
* - Creates SlideFactory with KB and presentation type
|
|
1243
|
+
* - Delegates all slide creation to SlideFactory
|
|
1244
|
+
* - SlideFactory handles all KB queries for slide decisions
|
|
1245
|
+
*
|
|
1246
|
+
* @version 7.0.0 - Now uses KB-driven SlideFactory
|
|
1247
|
+
*/
|
|
1248
|
+
|
|
1249
|
+
declare class SlideGenerator {
|
|
1250
|
+
private kb;
|
|
1251
|
+
private factory;
|
|
1252
|
+
private mode;
|
|
1253
|
+
private presentationType;
|
|
1254
|
+
initialize(): Promise<void>;
|
|
781
1255
|
/**
|
|
782
|
-
*
|
|
1256
|
+
* Generate slides from analyzed content using KB-driven SlideFactory.
|
|
1257
|
+
*
|
|
1258
|
+
* @version 7.0.0 - Now delegates ALL slide creation to SlideFactory
|
|
1259
|
+
* SlideFactory queries KB for every decision:
|
|
1260
|
+
* - Allowed slide types per presentation type
|
|
1261
|
+
* - Word limits per type
|
|
1262
|
+
* - Bullet limits per type
|
|
1263
|
+
* - Content pattern to slide type mapping
|
|
1264
|
+
* - Slide validation against KB rules
|
|
783
1265
|
*/
|
|
784
|
-
|
|
1266
|
+
generate(analysis: ContentAnalysis$1, type?: PresentationType): Promise<LegacySlide[]>;
|
|
785
1267
|
/**
|
|
786
|
-
*
|
|
1268
|
+
* Convert new Slide format to legacy format for backwards compatibility
|
|
787
1269
|
*/
|
|
788
|
-
private
|
|
1270
|
+
private convertToLegacyFormat;
|
|
789
1271
|
/**
|
|
790
|
-
*
|
|
1272
|
+
* Map slide type to template name for backwards compatibility
|
|
791
1273
|
*/
|
|
792
|
-
private
|
|
1274
|
+
private mapTypeToTemplate;
|
|
793
1275
|
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Initialize and return a SlideGenerator instance
|
|
1278
|
+
*/
|
|
1279
|
+
declare function initSlideGenerator(): Promise<SlideGenerator>;
|
|
794
1280
|
|
|
795
1281
|
/**
|
|
796
1282
|
* Template Engine - Handlebars Template Rendering
|
|
@@ -937,6 +1423,15 @@ declare class ScoreCalculator {
|
|
|
937
1423
|
* CRITICAL: All thresholds come from the knowledge base
|
|
938
1424
|
*/
|
|
939
1425
|
|
|
1426
|
+
interface RevealApi {
|
|
1427
|
+
getTotalSlides?: () => number;
|
|
1428
|
+
slide?: (index: number) => void;
|
|
1429
|
+
}
|
|
1430
|
+
declare global {
|
|
1431
|
+
interface Window {
|
|
1432
|
+
Reveal?: RevealApi;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
940
1435
|
declare class QAEngine {
|
|
941
1436
|
private browser;
|
|
942
1437
|
private kb;
|
|
@@ -977,6 +1472,263 @@ declare class QAEngine {
|
|
|
977
1472
|
private closeBrowser;
|
|
978
1473
|
}
|
|
979
1474
|
|
|
1475
|
+
/**
|
|
1476
|
+
* Seven-Dimension Presentation Scorer
|
|
1477
|
+
*
|
|
1478
|
+
* Comprehensive scoring across all quality dimensions using Knowledge Base rules.
|
|
1479
|
+
* Each dimension scored 0-100, overall score is weighted average.
|
|
1480
|
+
*
|
|
1481
|
+
* Dimensions:
|
|
1482
|
+
* 1. Layout (15%) - Whitespace, visual balance, slide structure
|
|
1483
|
+
* 2. Contrast (15%) - WCAG compliance, text readability
|
|
1484
|
+
* 3. Graphics (10%) - Image quality, placement, relevance
|
|
1485
|
+
* 4. Content (20%) - Word limits, bullet counts, structure
|
|
1486
|
+
* 5. Clarity (15%) - Message focus, information density
|
|
1487
|
+
* 6. Effectiveness (15%) - Expert methodology compliance
|
|
1488
|
+
* 7. Consistency (10%) - Style uniformity, design coherence
|
|
1489
|
+
*/
|
|
1490
|
+
|
|
1491
|
+
interface DimensionScore {
|
|
1492
|
+
name: string;
|
|
1493
|
+
score: number;
|
|
1494
|
+
weight: number;
|
|
1495
|
+
issues: DimensionIssue[];
|
|
1496
|
+
details: Record<string, unknown>;
|
|
1497
|
+
}
|
|
1498
|
+
interface DimensionIssue {
|
|
1499
|
+
slideIndex: number;
|
|
1500
|
+
dimension: string;
|
|
1501
|
+
severity: 'error' | 'warning' | 'info';
|
|
1502
|
+
message: string;
|
|
1503
|
+
currentValue?: unknown;
|
|
1504
|
+
expectedValue?: unknown;
|
|
1505
|
+
autoFixable: boolean;
|
|
1506
|
+
fixSuggestion?: string;
|
|
1507
|
+
}
|
|
1508
|
+
interface SevenDimensionResult {
|
|
1509
|
+
overallScore: number;
|
|
1510
|
+
dimensions: {
|
|
1511
|
+
layout: DimensionScore;
|
|
1512
|
+
contrast: DimensionScore;
|
|
1513
|
+
graphics: DimensionScore;
|
|
1514
|
+
content: DimensionScore;
|
|
1515
|
+
clarity: DimensionScore;
|
|
1516
|
+
effectiveness: DimensionScore;
|
|
1517
|
+
consistency: DimensionScore;
|
|
1518
|
+
};
|
|
1519
|
+
issues: DimensionIssue[];
|
|
1520
|
+
passed: boolean;
|
|
1521
|
+
threshold: number;
|
|
1522
|
+
}
|
|
1523
|
+
declare class SevenDimensionScorer {
|
|
1524
|
+
private kb;
|
|
1525
|
+
private mode;
|
|
1526
|
+
private presentationType;
|
|
1527
|
+
constructor(mode: 'keynote' | 'business', presentationType: PresentationType);
|
|
1528
|
+
/**
|
|
1529
|
+
* Score a presentation across all 7 dimensions.
|
|
1530
|
+
*/
|
|
1531
|
+
score(slides: Slide[], html: string, threshold?: number): Promise<SevenDimensionResult>;
|
|
1532
|
+
/**
|
|
1533
|
+
* Score layout dimension (whitespace, visual balance, structure)
|
|
1534
|
+
*/
|
|
1535
|
+
private scoreLayout;
|
|
1536
|
+
/**
|
|
1537
|
+
* Score contrast dimension (WCAG compliance, readability)
|
|
1538
|
+
*/
|
|
1539
|
+
private scoreContrast;
|
|
1540
|
+
/**
|
|
1541
|
+
* Score graphics dimension (images, placement, relevance)
|
|
1542
|
+
*/
|
|
1543
|
+
private scoreGraphics;
|
|
1544
|
+
/**
|
|
1545
|
+
* Score content dimension (word limits, bullet counts, structure)
|
|
1546
|
+
* This is critical - must use KB rules exactly.
|
|
1547
|
+
*/
|
|
1548
|
+
private scoreContent;
|
|
1549
|
+
/**
|
|
1550
|
+
* Score clarity dimension (message focus, information density)
|
|
1551
|
+
*/
|
|
1552
|
+
private scoreClarity;
|
|
1553
|
+
/**
|
|
1554
|
+
* Score effectiveness dimension (expert methodology compliance)
|
|
1555
|
+
*/
|
|
1556
|
+
private scoreEffectiveness;
|
|
1557
|
+
/**
|
|
1558
|
+
* Score consistency dimension (style uniformity, design coherence)
|
|
1559
|
+
*/
|
|
1560
|
+
private scoreConsistency;
|
|
1561
|
+
/**
|
|
1562
|
+
* Count words in a slide.
|
|
1563
|
+
*/
|
|
1564
|
+
private countWords;
|
|
1565
|
+
/**
|
|
1566
|
+
* Get a formatted report of the scoring results.
|
|
1567
|
+
*/
|
|
1568
|
+
formatReport(result: SevenDimensionResult): string;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* AutoFix Engine
|
|
1573
|
+
*
|
|
1574
|
+
* KB-driven automatic fixing of presentation issues.
|
|
1575
|
+
* Uses Knowledge Base rules to determine correct values and apply fixes.
|
|
1576
|
+
*
|
|
1577
|
+
* Key Principles:
|
|
1578
|
+
* 1. All fixes are driven by KB rules, not hardcoded values
|
|
1579
|
+
* 2. Fixes are applied to slide data, not raw HTML (for reliability)
|
|
1580
|
+
* 3. Each fix is logged for transparency
|
|
1581
|
+
* 4. Only auto-fixable issues are addressed
|
|
1582
|
+
*/
|
|
1583
|
+
|
|
1584
|
+
interface FixResult {
|
|
1585
|
+
slideIndex: number;
|
|
1586
|
+
dimension: string;
|
|
1587
|
+
originalValue: unknown;
|
|
1588
|
+
newValue: unknown;
|
|
1589
|
+
description: string;
|
|
1590
|
+
applied: boolean;
|
|
1591
|
+
}
|
|
1592
|
+
interface AutoFixResult {
|
|
1593
|
+
slidesFixed: Slide[];
|
|
1594
|
+
fixesApplied: FixResult[];
|
|
1595
|
+
fixesSkipped: FixResult[];
|
|
1596
|
+
summary: string;
|
|
1597
|
+
}
|
|
1598
|
+
declare class AutoFixEngine {
|
|
1599
|
+
private kb;
|
|
1600
|
+
private mode;
|
|
1601
|
+
private presentationType;
|
|
1602
|
+
constructor(mode: 'keynote' | 'business', presentationType: PresentationType);
|
|
1603
|
+
/**
|
|
1604
|
+
* Apply automatic fixes to slides based on scoring results.
|
|
1605
|
+
*/
|
|
1606
|
+
fix(slides: Slide[], scoringResult: SevenDimensionResult): Promise<AutoFixResult>;
|
|
1607
|
+
/**
|
|
1608
|
+
* Apply a single fix based on the issue.
|
|
1609
|
+
*/
|
|
1610
|
+
private applyFix;
|
|
1611
|
+
/**
|
|
1612
|
+
* Fix content-related issues (word count, bullet count).
|
|
1613
|
+
*/
|
|
1614
|
+
private fixContentIssue;
|
|
1615
|
+
/**
|
|
1616
|
+
* Fix clarity-related issues (key message length, title length).
|
|
1617
|
+
*/
|
|
1618
|
+
private fixClarityIssue;
|
|
1619
|
+
/**
|
|
1620
|
+
* Fix layout-related issues.
|
|
1621
|
+
*/
|
|
1622
|
+
private fixLayoutIssue;
|
|
1623
|
+
/**
|
|
1624
|
+
* Fix consistency-related issues.
|
|
1625
|
+
*/
|
|
1626
|
+
private fixConsistencyIssue;
|
|
1627
|
+
/**
|
|
1628
|
+
* Fix contrast-related issues.
|
|
1629
|
+
* Note: These are CSS fixes, typically handled at generation time.
|
|
1630
|
+
*/
|
|
1631
|
+
private fixContrastIssue;
|
|
1632
|
+
/**
|
|
1633
|
+
* Condense text to approximately maxWords.
|
|
1634
|
+
* Uses smart truncation that preserves meaning.
|
|
1635
|
+
*/
|
|
1636
|
+
private condenseText;
|
|
1637
|
+
/**
|
|
1638
|
+
* Convert text to Title Case.
|
|
1639
|
+
*/
|
|
1640
|
+
private toTitleCase;
|
|
1641
|
+
/**
|
|
1642
|
+
* Count words in a slide.
|
|
1643
|
+
*/
|
|
1644
|
+
private countWords;
|
|
1645
|
+
/**
|
|
1646
|
+
* Count elements in a slide.
|
|
1647
|
+
*/
|
|
1648
|
+
private countElements;
|
|
1649
|
+
/**
|
|
1650
|
+
* Generate a summary of fixes applied.
|
|
1651
|
+
*/
|
|
1652
|
+
private generateSummary;
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* Create an AutoFixEngine instance.
|
|
1656
|
+
*/
|
|
1657
|
+
declare function createAutoFixEngine(mode: 'keynote' | 'business', presentationType: PresentationType): AutoFixEngine;
|
|
1658
|
+
|
|
1659
|
+
/**
|
|
1660
|
+
* Iterative QA Engine
|
|
1661
|
+
*
|
|
1662
|
+
* Orchestrates the generate-score-fix-regenerate loop until quality threshold is met.
|
|
1663
|
+
* This is the core integration that makes the NPM tool self-correcting.
|
|
1664
|
+
*
|
|
1665
|
+
* Process:
|
|
1666
|
+
* 1. Generate initial presentation
|
|
1667
|
+
* 2. Score across 7 dimensions
|
|
1668
|
+
* 3. If score < threshold AND iterations < max:
|
|
1669
|
+
* a. Apply auto-fixes to slides
|
|
1670
|
+
* b. Regenerate HTML
|
|
1671
|
+
* c. Re-score
|
|
1672
|
+
* d. Repeat until threshold met or max iterations
|
|
1673
|
+
* 4. Return final result with full audit trail
|
|
1674
|
+
*/
|
|
1675
|
+
|
|
1676
|
+
interface IterationRecord {
|
|
1677
|
+
iteration: number;
|
|
1678
|
+
score: number;
|
|
1679
|
+
dimensionScores: {
|
|
1680
|
+
layout: number;
|
|
1681
|
+
contrast: number;
|
|
1682
|
+
graphics: number;
|
|
1683
|
+
content: number;
|
|
1684
|
+
clarity: number;
|
|
1685
|
+
effectiveness: number;
|
|
1686
|
+
consistency: number;
|
|
1687
|
+
};
|
|
1688
|
+
fixesApplied: number;
|
|
1689
|
+
timestamp: Date;
|
|
1690
|
+
}
|
|
1691
|
+
interface IterativeQAResult {
|
|
1692
|
+
finalScore: number;
|
|
1693
|
+
passed: boolean;
|
|
1694
|
+
threshold: number;
|
|
1695
|
+
iterations: IterationRecord[];
|
|
1696
|
+
totalIterations: number;
|
|
1697
|
+
maxIterations: number;
|
|
1698
|
+
slides: Slide[];
|
|
1699
|
+
html: string;
|
|
1700
|
+
finalScoring: SevenDimensionResult;
|
|
1701
|
+
autoFixSummary: string;
|
|
1702
|
+
report: string;
|
|
1703
|
+
}
|
|
1704
|
+
interface IterativeQAOptions {
|
|
1705
|
+
minScore: number;
|
|
1706
|
+
maxIterations: number;
|
|
1707
|
+
verbose: boolean;
|
|
1708
|
+
}
|
|
1709
|
+
declare class IterativeQAEngine {
|
|
1710
|
+
private kb;
|
|
1711
|
+
private scorer;
|
|
1712
|
+
private fixer;
|
|
1713
|
+
private generator;
|
|
1714
|
+
private mode;
|
|
1715
|
+
private presentationType;
|
|
1716
|
+
private config;
|
|
1717
|
+
constructor(mode: 'keynote' | 'business', presentationType: PresentationType, config: PresentationConfig);
|
|
1718
|
+
/**
|
|
1719
|
+
* Run the iterative QA process.
|
|
1720
|
+
*/
|
|
1721
|
+
run(initialSlides: Slide[], initialHtml: string, options?: Partial<IterativeQAOptions>): Promise<IterativeQAResult>;
|
|
1722
|
+
/**
|
|
1723
|
+
* Generate a comprehensive report.
|
|
1724
|
+
*/
|
|
1725
|
+
private generateReport;
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Create an IterativeQAEngine instance.
|
|
1729
|
+
*/
|
|
1730
|
+
declare function createIterativeQAEngine(mode: 'keynote' | 'business', presentationType: PresentationType, config: PresentationConfig): IterativeQAEngine;
|
|
1731
|
+
|
|
980
1732
|
/**
|
|
981
1733
|
* Reveal.js Generator - HTML Presentation Output
|
|
982
1734
|
*
|
|
@@ -1020,6 +1772,18 @@ declare class RevealJsGenerator {
|
|
|
1020
1772
|
* Lighten a hex color
|
|
1021
1773
|
*/
|
|
1022
1774
|
private lightenColor;
|
|
1775
|
+
/**
|
|
1776
|
+
* Check if a palette is "dark mode" (dark background, light text)
|
|
1777
|
+
*/
|
|
1778
|
+
private isDarkPalette;
|
|
1779
|
+
/**
|
|
1780
|
+
* Get relative luminance of a hex color (0-1, 0=black, 1=white)
|
|
1781
|
+
*/
|
|
1782
|
+
private getLuminance;
|
|
1783
|
+
/**
|
|
1784
|
+
* Darken a hex color
|
|
1785
|
+
*/
|
|
1786
|
+
private darkenColor;
|
|
1023
1787
|
/**
|
|
1024
1788
|
* Get theme-specific styles - KB-DRIVEN
|
|
1025
1789
|
*/
|
|
@@ -1411,7 +2175,7 @@ declare function validate(presentation: string | Buffer, options?: {
|
|
|
1411
2175
|
/**
|
|
1412
2176
|
* Get the version of the package.
|
|
1413
2177
|
*/
|
|
1414
|
-
declare const VERSION = "
|
|
2178
|
+
declare const VERSION = "7.1.0";
|
|
1415
2179
|
/**
|
|
1416
2180
|
* Default export for convenience.
|
|
1417
2181
|
*/
|
|
@@ -1423,4 +2187,4 @@ declare const _default: {
|
|
|
1423
2187
|
VERSION: string;
|
|
1424
2188
|
};
|
|
1425
2189
|
|
|
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 };
|
|
2190
|
+
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, type LegacySlide, 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 SevenDimensionQAResult, 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 };
|