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