afterburn-cli 1.0.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.
Files changed (188) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +281 -0
  3. package/dist/ai/gemini-client.d.ts +21 -0
  4. package/dist/ai/gemini-client.js +105 -0
  5. package/dist/ai/gemini-client.js.map +1 -0
  6. package/dist/ai/index.d.ts +1 -0
  7. package/dist/ai/index.js +3 -0
  8. package/dist/ai/index.js.map +1 -0
  9. package/dist/analysis/diagnosis-schema.d.ts +106 -0
  10. package/dist/analysis/diagnosis-schema.js +54 -0
  11. package/dist/analysis/diagnosis-schema.js.map +1 -0
  12. package/dist/analysis/error-analyzer.d.ts +9 -0
  13. package/dist/analysis/error-analyzer.js +573 -0
  14. package/dist/analysis/error-analyzer.js.map +1 -0
  15. package/dist/analysis/index.d.ts +4 -0
  16. package/dist/analysis/index.js +6 -0
  17. package/dist/analysis/index.js.map +1 -0
  18. package/dist/analysis/source-mapper.d.ts +19 -0
  19. package/dist/analysis/source-mapper.js +329 -0
  20. package/dist/analysis/source-mapper.js.map +1 -0
  21. package/dist/analysis/ui-auditor.d.ts +9 -0
  22. package/dist/analysis/ui-auditor.js +104 -0
  23. package/dist/analysis/ui-auditor.js.map +1 -0
  24. package/dist/artifacts/artifact-storage.d.ts +44 -0
  25. package/dist/artifacts/artifact-storage.js +99 -0
  26. package/dist/artifacts/artifact-storage.js.map +1 -0
  27. package/dist/artifacts/index.d.ts +1 -0
  28. package/dist/artifacts/index.js +3 -0
  29. package/dist/artifacts/index.js.map +1 -0
  30. package/dist/browser/browser-manager.d.ts +45 -0
  31. package/dist/browser/browser-manager.js +88 -0
  32. package/dist/browser/browser-manager.js.map +1 -0
  33. package/dist/browser/challenge-detector.d.ts +10 -0
  34. package/dist/browser/challenge-detector.js +58 -0
  35. package/dist/browser/challenge-detector.js.map +1 -0
  36. package/dist/browser/cookie-dismisser.d.ts +18 -0
  37. package/dist/browser/cookie-dismisser.js +76 -0
  38. package/dist/browser/cookie-dismisser.js.map +1 -0
  39. package/dist/browser/index.d.ts +4 -0
  40. package/dist/browser/index.js +6 -0
  41. package/dist/browser/index.js.map +1 -0
  42. package/dist/browser/stealth-browser.d.ts +13 -0
  43. package/dist/browser/stealth-browser.js +59 -0
  44. package/dist/browser/stealth-browser.js.map +1 -0
  45. package/dist/cli/commander-cli.d.ts +2 -0
  46. package/dist/cli/commander-cli.js +150 -0
  47. package/dist/cli/commander-cli.js.map +1 -0
  48. package/dist/cli/doctor.d.ts +34 -0
  49. package/dist/cli/doctor.js +124 -0
  50. package/dist/cli/doctor.js.map +1 -0
  51. package/dist/cli/first-run.d.ts +6 -0
  52. package/dist/cli/first-run.js +58 -0
  53. package/dist/cli/first-run.js.map +1 -0
  54. package/dist/cli/index.d.ts +3 -0
  55. package/dist/cli/index.js +5 -0
  56. package/dist/cli/index.js.map +1 -0
  57. package/dist/cli/progress.d.ts +11 -0
  58. package/dist/cli/progress.js +30 -0
  59. package/dist/cli/progress.js.map +1 -0
  60. package/dist/core/engine.d.ts +33 -0
  61. package/dist/core/engine.js +269 -0
  62. package/dist/core/engine.js.map +1 -0
  63. package/dist/core/index.d.ts +3 -0
  64. package/dist/core/index.js +4 -0
  65. package/dist/core/index.js.map +1 -0
  66. package/dist/core/validation.d.ts +52 -0
  67. package/dist/core/validation.js +228 -0
  68. package/dist/core/validation.js.map +1 -0
  69. package/dist/discovery/crawler.d.ts +58 -0
  70. package/dist/discovery/crawler.js +240 -0
  71. package/dist/discovery/crawler.js.map +1 -0
  72. package/dist/discovery/discovery-pipeline.d.ts +22 -0
  73. package/dist/discovery/discovery-pipeline.js +256 -0
  74. package/dist/discovery/discovery-pipeline.js.map +1 -0
  75. package/dist/discovery/element-mapper.d.ts +21 -0
  76. package/dist/discovery/element-mapper.js +422 -0
  77. package/dist/discovery/element-mapper.js.map +1 -0
  78. package/dist/discovery/index.d.ts +8 -0
  79. package/dist/discovery/index.js +8 -0
  80. package/dist/discovery/index.js.map +1 -0
  81. package/dist/discovery/link-validator.d.ts +15 -0
  82. package/dist/discovery/link-validator.js +137 -0
  83. package/dist/discovery/link-validator.js.map +1 -0
  84. package/dist/discovery/sitemap-builder.d.ts +19 -0
  85. package/dist/discovery/sitemap-builder.js +166 -0
  86. package/dist/discovery/sitemap-builder.js.map +1 -0
  87. package/dist/discovery/spa-detector.d.ts +12 -0
  88. package/dist/discovery/spa-detector.js +271 -0
  89. package/dist/discovery/spa-detector.js.map +1 -0
  90. package/dist/execution/error-detector.d.ts +10 -0
  91. package/dist/execution/error-detector.js +87 -0
  92. package/dist/execution/error-detector.js.map +1 -0
  93. package/dist/execution/evidence-capture.d.ts +8 -0
  94. package/dist/execution/evidence-capture.js +37 -0
  95. package/dist/execution/evidence-capture.js.map +1 -0
  96. package/dist/execution/index.d.ts +5 -0
  97. package/dist/execution/index.js +7 -0
  98. package/dist/execution/index.js.map +1 -0
  99. package/dist/execution/step-handlers.d.ts +48 -0
  100. package/dist/execution/step-handlers.js +349 -0
  101. package/dist/execution/step-handlers.js.map +1 -0
  102. package/dist/execution/test-data.d.ts +50 -0
  103. package/dist/execution/test-data.js +160 -0
  104. package/dist/execution/test-data.js.map +1 -0
  105. package/dist/execution/workflow-executor.d.ts +56 -0
  106. package/dist/execution/workflow-executor.js +331 -0
  107. package/dist/execution/workflow-executor.js.map +1 -0
  108. package/dist/index.d.ts +2 -0
  109. package/dist/index.js +5 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/mcp/entry.d.ts +2 -0
  112. package/dist/mcp/entry.js +5 -0
  113. package/dist/mcp/entry.js.map +1 -0
  114. package/dist/mcp/index.d.ts +2 -0
  115. package/dist/mcp/index.js +4 -0
  116. package/dist/mcp/index.js.map +1 -0
  117. package/dist/mcp/server.d.ts +3 -0
  118. package/dist/mcp/server.js +19 -0
  119. package/dist/mcp/server.js.map +1 -0
  120. package/dist/mcp/tools.d.ts +2 -0
  121. package/dist/mcp/tools.js +162 -0
  122. package/dist/mcp/tools.js.map +1 -0
  123. package/dist/planning/heuristic-planner.d.ts +7 -0
  124. package/dist/planning/heuristic-planner.js +238 -0
  125. package/dist/planning/heuristic-planner.js.map +1 -0
  126. package/dist/planning/index.d.ts +3 -0
  127. package/dist/planning/index.js +5 -0
  128. package/dist/planning/index.js.map +1 -0
  129. package/dist/planning/plan-schema.d.ts +74 -0
  130. package/dist/planning/plan-schema.js +39 -0
  131. package/dist/planning/plan-schema.js.map +1 -0
  132. package/dist/planning/workflow-planner.d.ts +39 -0
  133. package/dist/planning/workflow-planner.js +211 -0
  134. package/dist/planning/workflow-planner.js.map +1 -0
  135. package/dist/reports/health-scorer.d.ts +14 -0
  136. package/dist/reports/health-scorer.js +88 -0
  137. package/dist/reports/health-scorer.js.map +1 -0
  138. package/dist/reports/html-generator.d.ts +10 -0
  139. package/dist/reports/html-generator.js +155 -0
  140. package/dist/reports/html-generator.js.map +1 -0
  141. package/dist/reports/index.d.ts +4 -0
  142. package/dist/reports/index.js +6 -0
  143. package/dist/reports/index.js.map +1 -0
  144. package/dist/reports/markdown-generator.d.ts +10 -0
  145. package/dist/reports/markdown-generator.js +334 -0
  146. package/dist/reports/markdown-generator.js.map +1 -0
  147. package/dist/reports/priority-ranker.d.ts +22 -0
  148. package/dist/reports/priority-ranker.js +608 -0
  149. package/dist/reports/priority-ranker.js.map +1 -0
  150. package/dist/screenshots/dual-format.d.ts +14 -0
  151. package/dist/screenshots/dual-format.js +59 -0
  152. package/dist/screenshots/dual-format.js.map +1 -0
  153. package/dist/screenshots/index.d.ts +2 -0
  154. package/dist/screenshots/index.js +4 -0
  155. package/dist/screenshots/index.js.map +1 -0
  156. package/dist/screenshots/screenshot-manager.d.ts +33 -0
  157. package/dist/screenshots/screenshot-manager.js +86 -0
  158. package/dist/screenshots/screenshot-manager.js.map +1 -0
  159. package/dist/testing/accessibility-auditor.d.ts +23 -0
  160. package/dist/testing/accessibility-auditor.js +44 -0
  161. package/dist/testing/accessibility-auditor.js.map +1 -0
  162. package/dist/testing/index.d.ts +4 -0
  163. package/dist/testing/index.js +5 -0
  164. package/dist/testing/index.js.map +1 -0
  165. package/dist/testing/meta-auditor.d.ts +16 -0
  166. package/dist/testing/meta-auditor.js +268 -0
  167. package/dist/testing/meta-auditor.js.map +1 -0
  168. package/dist/testing/performance-monitor.d.ts +15 -0
  169. package/dist/testing/performance-monitor.js +64 -0
  170. package/dist/testing/performance-monitor.js.map +1 -0
  171. package/dist/types/artifacts.d.ts +58 -0
  172. package/dist/types/artifacts.js +3 -0
  173. package/dist/types/artifacts.js.map +1 -0
  174. package/dist/types/discovery.d.ts +124 -0
  175. package/dist/types/discovery.js +3 -0
  176. package/dist/types/discovery.js.map +1 -0
  177. package/dist/types/execution.d.ts +154 -0
  178. package/dist/types/execution.js +3 -0
  179. package/dist/types/execution.js.map +1 -0
  180. package/dist/types/index.d.ts +2 -0
  181. package/dist/types/index.js +4 -0
  182. package/dist/types/index.js.map +1 -0
  183. package/dist/utils/sanitizer.d.ts +25 -0
  184. package/dist/utils/sanitizer.js +98 -0
  185. package/dist/utils/sanitizer.js.map +1 -0
  186. package/package.json +86 -0
  187. package/templates/report.hbs +202 -0
  188. package/templates/styles/report.css +607 -0
@@ -0,0 +1,573 @@
1
+ // LLM-powered error diagnosis with pattern-matching fallback
2
+ import { GeminiClient } from '../ai/gemini-client.js';
3
+ import { ErrorDiagnosisSchema, ErrorDiagnosisBatchSchema } from './diagnosis-schema.js';
4
+ import { redactSensitiveData, redactSensitiveUrl } from '../utils/sanitizer.js';
5
+ /**
6
+ * Main export: Analyze all errors from ExecutionArtifact and produce plain English diagnoses
7
+ */
8
+ export async function analyzeErrors(artifact, options) {
9
+ const apiKey = options?.apiKey || process.env.GEMINI_API_KEY;
10
+ const aiEnabled = options?.aiEnabled ?? (apiKey ? true : false);
11
+ const diagnosedErrors = [];
12
+ // Collect all errors from the artifact
13
+ const failedSteps = artifact.workflowResults.flatMap((workflow) => workflow.stepResults.filter((step) => step.status === 'failed'));
14
+ // Use LLM diagnosis if API key available AND AI is explicitly enabled, otherwise fallback
15
+ // Note: dead buttons and broken forms are handled directly by priority-ranker.ts
16
+ // from the execution artifact — no need to inject them here as DiagnosedErrors.
17
+ if (apiKey && aiEnabled) {
18
+ try {
19
+ const llmDiagnoses = await diagnoseWithLLM(artifact, failedSteps, apiKey);
20
+ diagnosedErrors.push(...llmDiagnoses);
21
+ }
22
+ catch (error) {
23
+ console.warn('LLM diagnosis failed, falling back to pattern matching:', error);
24
+ const fallbackDiagnoses = fallbackDiagnosis(artifact, failedSteps);
25
+ diagnosedErrors.push(...fallbackDiagnoses);
26
+ }
27
+ }
28
+ else {
29
+ const fallbackDiagnoses = fallbackDiagnosis(artifact, failedSteps);
30
+ diagnosedErrors.push(...fallbackDiagnoses);
31
+ }
32
+ return diagnosedErrors;
33
+ }
34
+ /**
35
+ * LLM-powered error diagnosis using Gemini
36
+ */
37
+ async function diagnoseWithLLM(artifact, failedSteps, apiKey) {
38
+ const gemini = new GeminiClient(apiKey);
39
+ const diagnosedErrors = [];
40
+ // Diagnose each failed step with evidence
41
+ for (const step of failedSteps) {
42
+ if (!step.evidence || !step.error)
43
+ continue;
44
+ const prompt = buildEvidencePrompt(step, step.evidence);
45
+ const diagnosis = await gemini.generateStructured(prompt, ErrorDiagnosisSchema);
46
+ diagnosedErrors.push({
47
+ ...diagnosis,
48
+ originalError: step.error, // CRITICAL: preserve original error for source mapping
49
+ screenshotRef: step.evidence.screenshotRef?.pngPath,
50
+ });
51
+ }
52
+ // Diagnose aggregate errors (console errors, network failures not tied to specific steps)
53
+ const aggregateErrors = collectAggregateErrors(artifact, failedSteps);
54
+ if (aggregateErrors.length > 0) {
55
+ const aggregatePrompt = buildAggregatePrompt(artifact.targetUrl, aggregateErrors);
56
+ const aggregateDiagnoses = await diagnoseBatch(gemini, aggregatePrompt, aggregateErrors);
57
+ diagnosedErrors.push(...aggregateDiagnoses);
58
+ }
59
+ return diagnosedErrors;
60
+ }
61
+ /**
62
+ * Build evidence-based prompt for a single failed step
63
+ */
64
+ function buildEvidencePrompt(step, evidence) {
65
+ // Redact sensitive data from URLs and error messages
66
+ const safeUrl = redactSensitiveUrl(evidence.pageUrl);
67
+ const safeError = redactSensitiveData(step.error || '');
68
+ const consoleErrors = evidence.consoleErrors.length > 0
69
+ ? evidence.consoleErrors.map(e => redactSensitiveData(e)).join('\n')
70
+ : 'None';
71
+ const networkFailures = evidence.networkFailures.length > 0
72
+ ? evidence.networkFailures.map((f) => `${f.status} ${redactSensitiveUrl(f.url)}`).join('\n')
73
+ : 'None';
74
+ return `Analyze this browser error and diagnose the root cause:
75
+
76
+ Page URL: ${safeUrl}
77
+ Action attempted: ${step.action} on ${step.selector}
78
+ Error message: ${safeError}
79
+
80
+ Console Errors:
81
+ ${consoleErrors}
82
+
83
+ Network Failures:
84
+ ${networkFailures}
85
+
86
+ Provide a plain English diagnosis. The audience is non-technical "vibe coders" who build with AI tools.
87
+ Focus on WHAT went wrong and HOW to fix it, not technical jargon.`;
88
+ }
89
+ /**
90
+ * Collect errors not tied to specific workflow steps
91
+ */
92
+ function collectAggregateErrors(artifact, failedSteps) {
93
+ const aggregateErrors = [];
94
+ const diagnosedStepErrors = new Set(failedSteps.map((s) => s.error));
95
+ // Deduplicate: the same resource/error appears across multiple workflows visiting the same pages
96
+ const seen = new Set();
97
+ // Collect all broken image URLs first so we can skip duplicate network failure entries
98
+ const brokenImageUrls = new Set();
99
+ for (const workflow of artifact.workflowResults) {
100
+ for (const brokenImage of workflow.errors.brokenImages) {
101
+ brokenImageUrls.add(brokenImage.url);
102
+ }
103
+ }
104
+ // Collect console errors not already diagnosed
105
+ for (const workflow of artifact.workflowResults) {
106
+ for (const consoleError of workflow.errors.consoleErrors) {
107
+ if (!diagnosedStepErrors.has(consoleError.message)) {
108
+ const key = `console:${consoleError.message}`;
109
+ if (seen.has(key))
110
+ continue;
111
+ seen.add(key);
112
+ aggregateErrors.push({
113
+ type: 'console',
114
+ message: `Console error on ${consoleError.url}: ${consoleError.message}`,
115
+ });
116
+ }
117
+ }
118
+ // Collect network failures not already diagnosed
119
+ // Skip network failures for URLs already reported as broken images (avoids double-counting)
120
+ for (const networkFailure of workflow.errors.networkFailures) {
121
+ if (brokenImageUrls.has(networkFailure.url))
122
+ continue;
123
+ const failureMsg = `${networkFailure.status} ${networkFailure.url}`;
124
+ if (!diagnosedStepErrors.has(failureMsg)) {
125
+ const key = `network:${networkFailure.status}-${networkFailure.url}`;
126
+ if (seen.has(key))
127
+ continue;
128
+ seen.add(key);
129
+ aggregateErrors.push({
130
+ type: 'network',
131
+ message: `Network failure: ${failureMsg} (${networkFailure.method} ${networkFailure.resourceType})`,
132
+ });
133
+ }
134
+ }
135
+ // Collect broken images
136
+ for (const brokenImage of workflow.errors.brokenImages) {
137
+ const key = `image:${brokenImage.url}`;
138
+ if (seen.has(key))
139
+ continue;
140
+ seen.add(key);
141
+ aggregateErrors.push({
142
+ type: 'image',
143
+ message: `Image failed to load: ${brokenImage.url} (status ${brokenImage.status})`,
144
+ });
145
+ }
146
+ }
147
+ return aggregateErrors;
148
+ }
149
+ /**
150
+ * Build aggregate prompt for multiple errors
151
+ */
152
+ function buildAggregatePrompt(targetUrl, errors) {
153
+ const errorList = errors.map((e) => `- ${e.message}`).join('\n');
154
+ return `These errors were detected during testing of ${targetUrl}:
155
+
156
+ ${errorList}
157
+
158
+ For each error, provide a plain English diagnosis. The audience is non-technical "vibe coders" who build with AI tools.
159
+ Focus on WHAT went wrong and HOW to fix it, not technical jargon.`;
160
+ }
161
+ /**
162
+ * Diagnose batch of aggregate errors in a single LLM call.
163
+ * Falls back to per-error calls if the batch response is invalid.
164
+ */
165
+ async function diagnoseBatch(gemini, prompt, errors) {
166
+ // Try batch diagnosis first — one LLM call for all errors
167
+ try {
168
+ const batchResult = await gemini.generateStructured(prompt, ErrorDiagnosisBatchSchema);
169
+ if (batchResult.diagnoses && batchResult.diagnoses.length === errors.length) {
170
+ return errors.map((error, i) => {
171
+ const d = batchResult.diagnoses[i];
172
+ return {
173
+ summary: d.plainEnglish,
174
+ rootCause: d.rootCause,
175
+ errorType: classifyErrorType(error.type),
176
+ confidence: severityToConfidence(d.severity),
177
+ suggestedFix: d.suggestedFix,
178
+ originalError: error.message,
179
+ };
180
+ });
181
+ }
182
+ // Wrong count — fall through to per-error fallback
183
+ console.warn(`Batch diagnosis returned ${batchResult.diagnoses?.length ?? 0} results for ${errors.length} errors, falling back to individual calls`);
184
+ }
185
+ catch (batchError) {
186
+ console.warn('Batch diagnosis failed, falling back to individual calls:', batchError);
187
+ }
188
+ // Fallback: diagnose each error individually
189
+ const diagnosedErrors = [];
190
+ for (const error of errors) {
191
+ const individualPrompt = `Analyze this browser error and diagnose the root cause:
192
+
193
+ ${error.message}
194
+
195
+ Provide a plain English diagnosis. The audience is non-technical "vibe coders" who build with AI tools.
196
+ Focus on WHAT went wrong and HOW to fix it, not technical jargon.`;
197
+ try {
198
+ const diagnosis = await gemini.generateStructured(individualPrompt, ErrorDiagnosisSchema);
199
+ diagnosedErrors.push({
200
+ ...diagnosis,
201
+ originalError: error.message,
202
+ });
203
+ }
204
+ catch (err) {
205
+ console.warn('Failed to diagnose aggregate error:', err);
206
+ }
207
+ }
208
+ return diagnosedErrors;
209
+ }
210
+ /** Map aggregate error type to ErrorDiagnosis errorType */
211
+ function classifyErrorType(type) {
212
+ switch (type) {
213
+ case 'console': return 'javascript';
214
+ case 'network': return 'network';
215
+ case 'image': return 'network';
216
+ default: return 'unknown';
217
+ }
218
+ }
219
+ /** Map LLM severity to confidence level */
220
+ function severityToConfidence(severity) {
221
+ return severity;
222
+ }
223
+ /**
224
+ * Fallback diagnosis using pattern matching (when GEMINI_API_KEY not available)
225
+ */
226
+ function fallbackDiagnosis(artifact, failedSteps) {
227
+ const diagnosedErrors = [];
228
+ // Diagnose failed steps
229
+ for (const step of failedSteps) {
230
+ if (!step.error)
231
+ continue;
232
+ const diagnosis = patternMatchError(step.error);
233
+ diagnosedErrors.push({
234
+ ...diagnosis,
235
+ originalError: step.error,
236
+ screenshotRef: step.evidence?.screenshotRef?.pngPath,
237
+ pageUrl: step.evidence?.pageUrl || undefined,
238
+ });
239
+ }
240
+ // Diagnose aggregate console errors, network failures, and broken images
241
+ // Deduplicate: the same resource/error appears across multiple workflows visiting the same pages
242
+ const seen = new Set();
243
+ // Collect all broken image URLs first so we can skip duplicate network failure entries
244
+ const brokenImageUrls = new Set();
245
+ for (const workflow of artifact.workflowResults) {
246
+ for (const brokenImage of workflow.errors.brokenImages) {
247
+ brokenImageUrls.add(brokenImage.url);
248
+ }
249
+ }
250
+ for (const workflow of artifact.workflowResults) {
251
+ for (const consoleError of workflow.errors.consoleErrors) {
252
+ const key = `console:${consoleError.message}`;
253
+ if (seen.has(key))
254
+ continue;
255
+ seen.add(key);
256
+ const diagnosis = patternMatchError(consoleError.message);
257
+ diagnosedErrors.push({
258
+ ...diagnosis,
259
+ originalError: consoleError.message,
260
+ pageUrl: consoleError.url || undefined,
261
+ });
262
+ }
263
+ // Diagnose network failures
264
+ // Skip network failures for URLs already reported as broken images (avoids double-counting)
265
+ for (const networkFailure of workflow.errors.networkFailures) {
266
+ if (brokenImageUrls.has(networkFailure.url))
267
+ continue;
268
+ const key = `network:${networkFailure.status}-${networkFailure.url}`;
269
+ if (seen.has(key))
270
+ continue;
271
+ seen.add(key);
272
+ const diagnosis = patternMatchNetworkFailure(networkFailure.status, networkFailure.url);
273
+ diagnosedErrors.push({
274
+ ...diagnosis,
275
+ originalError: `${networkFailure.status} ${networkFailure.url}`,
276
+ pageUrl: networkFailure.url || undefined,
277
+ });
278
+ }
279
+ // Diagnose broken images
280
+ for (const brokenImage of workflow.errors.brokenImages) {
281
+ const key = `image:${brokenImage.url}`;
282
+ if (seen.has(key))
283
+ continue;
284
+ seen.add(key);
285
+ const imgFilename = brokenImage.url.split('/').pop() || brokenImage.url;
286
+ diagnosedErrors.push({
287
+ summary: `Image "${imgFilename}" failed to load (${brokenImage.status})`,
288
+ rootCause: `The image at ${brokenImage.url} returned status ${brokenImage.status}`,
289
+ errorType: 'network',
290
+ confidence: 'high',
291
+ suggestedFix: `Check if "${imgFilename}" exists in your images folder. If the file was renamed or moved, update the <img src> to match.`,
292
+ originalError: `Broken image: ${brokenImage.url} (status ${brokenImage.status})`,
293
+ pageUrl: brokenImage.url || undefined,
294
+ });
295
+ }
296
+ }
297
+ return diagnosedErrors;
298
+ }
299
+ /**
300
+ * Pattern match error messages to produce basic diagnoses
301
+ */
302
+ function patternMatchError(errorMessage) {
303
+ const msg = errorMessage.toLowerCase();
304
+ // Navigation errors -> high priority 'navigation' type
305
+ if (msg.includes('net::err_') || msg.includes('page crashed') || msg.includes('navigation failed')) {
306
+ return {
307
+ summary: 'Page navigation failed',
308
+ rootCause: 'The page could not load — it may be down, too slow, or the URL is wrong',
309
+ errorType: 'navigation',
310
+ confidence: 'high',
311
+ suggestedFix: 'Check that the URL is correct and the server is responding',
312
+ technicalDetails: errorMessage,
313
+ };
314
+ }
315
+ // Navigation timeouts (page.goto timeout) -> high priority
316
+ if (msg.includes('timeout') && (msg.includes('navigation') || msg.includes('goto') || msg.includes('waiting for page'))) {
317
+ return {
318
+ summary: 'Page took too long to load',
319
+ rootCause: 'The page did not finish loading within the timeout — the server may be slow or unresponsive',
320
+ errorType: 'navigation',
321
+ confidence: 'high',
322
+ suggestedFix: 'Check that the server is running and responding. For slow-loading pages, try increasing the timeout.',
323
+ technicalDetails: errorMessage,
324
+ };
325
+ }
326
+ // Element wait timeouts (selector not found within timeout) -> medium priority DOM issue
327
+ if (msg.includes('timeout') && !msg.includes('navigation')) {
328
+ // Extract selector from "Timeout 10000ms exceeded. Waiting for selector '...'"
329
+ const selectorMatch = errorMessage.match(/selector ['"]([^'"]+)['"]/i);
330
+ const selectorName = selectorMatch ? selectorMatch[1] : 'an element';
331
+ return {
332
+ summary: `Could not find ${selectorName} on the page`,
333
+ rootCause: 'The element was not found within the time limit — it may not exist, have a different selector, or be loaded later',
334
+ errorType: 'dom',
335
+ confidence: 'medium',
336
+ suggestedFix: 'Check if the element exists in the HTML and is visible. It may have a different CSS selector or load dynamically.',
337
+ technicalDetails: errorMessage,
338
+ };
339
+ }
340
+ // Authentication errors -> high priority 'authentication' type
341
+ if (msg.includes('401') || msg.includes('403') || msg.includes('unauthorized') || msg.includes('forbidden') || msg.includes('authentication')) {
342
+ return {
343
+ summary: 'Access denied — authentication required or forbidden',
344
+ rootCause: 'The server rejected the request due to missing or invalid credentials',
345
+ errorType: 'authentication',
346
+ confidence: 'high',
347
+ suggestedFix: 'Check if login credentials are required. Use --email and --password flags for authenticated testing.',
348
+ technicalDetails: errorMessage,
349
+ };
350
+ }
351
+ // Form submission errors -> high priority 'form' type
352
+ if (msg.includes('form') && (msg.includes('submit') || msg.includes('validation') || msg.includes('failed'))) {
353
+ return {
354
+ summary: 'Form submission failed',
355
+ rootCause: 'The form could not be submitted — it may have validation errors or a broken action endpoint',
356
+ errorType: 'form',
357
+ confidence: 'medium',
358
+ suggestedFix: 'Check form validation rules and ensure the form action URL is correct',
359
+ technicalDetails: errorMessage,
360
+ };
361
+ }
362
+ // TypeError patterns — extract property name for specific fix
363
+ if (msg.includes('typeerror')) {
364
+ // Try to extract the specific property: "cannot read properties of null (reading 'X')"
365
+ const propMatch = errorMessage.match(/reading '(\w+)'/i) || errorMessage.match(/property '(\w+)'/i);
366
+ const nullMatch = errorMessage.match(/of (null|undefined)/i);
367
+ const specificProp = propMatch ? `.${propMatch[1]}` : '';
368
+ const nullType = nullMatch ? nullMatch[1] : 'null or undefined';
369
+ return {
370
+ summary: `Tried to use ${specificProp || 'a property'} on something that is ${nullType}`,
371
+ rootCause: `The code calls ${specificProp || 'a property/method'} on a value that is ${nullType}. This usually means an element wasn't found or data hasn't loaded yet.`,
372
+ errorType: 'javascript',
373
+ confidence: 'medium',
374
+ suggestedFix: specificProp
375
+ ? `Add a null check before accessing ${specificProp}: use "if (variable) { variable${specificProp} }" or optional chaining "variable?${specificProp}"`
376
+ : 'Add a null check before accessing the property, or make sure the variable is initialized first',
377
+ technicalDetails: errorMessage,
378
+ };
379
+ }
380
+ // ReferenceError patterns — extract the undefined name
381
+ if (msg.includes('referenceerror')) {
382
+ const nameMatch = errorMessage.match(/(\w+) is not defined/i);
383
+ const undefinedName = nameMatch ? nameMatch[1] : null;
384
+ return {
385
+ summary: undefinedName
386
+ ? `"${undefinedName}" is not defined — the code references something that doesn't exist`
387
+ : 'Used a variable or function that wasn\'t defined',
388
+ rootCause: undefinedName
389
+ ? `The code tries to use "${undefinedName}" but it was never declared. This could be a typo, a missing script tag, or a missing import.`
390
+ : 'The code references something that hasn\'t been declared',
391
+ errorType: 'javascript',
392
+ confidence: 'medium',
393
+ suggestedFix: undefinedName
394
+ ? `Make sure "${undefinedName}" is defined before this line runs. Check for typos, missing <script> tags, or missing imports.`
395
+ : 'Make sure all variables and functions are defined before using them',
396
+ technicalDetails: errorMessage,
397
+ };
398
+ }
399
+ // SyntaxError patterns
400
+ if (msg.includes('syntaxerror')) {
401
+ return {
402
+ summary: 'There\'s a syntax error in the code',
403
+ rootCause: 'The JavaScript code has invalid syntax that prevents it from running',
404
+ errorType: 'javascript',
405
+ confidence: 'medium',
406
+ suggestedFix: 'Check for missing brackets, semicolons, or unexpected characters in the code',
407
+ technicalDetails: errorMessage,
408
+ };
409
+ }
410
+ // RangeError patterns
411
+ if (msg.includes('rangeerror')) {
412
+ return {
413
+ summary: 'The code got stuck in an infinite loop or used too much memory',
414
+ rootCause: 'A value is out of the allowed range, often caused by infinite recursion or oversized arrays',
415
+ errorType: 'javascript',
416
+ confidence: 'medium',
417
+ suggestedFix: 'Check for recursive function calls without a proper exit condition',
418
+ technicalDetails: errorMessage,
419
+ };
420
+ }
421
+ // Network error patterns
422
+ if (msg.includes('networkerror') || msg.includes('fetch')) {
423
+ return {
424
+ summary: 'Failed to connect to the server',
425
+ rootCause: 'The application couldn\'t reach the backend server or API',
426
+ errorType: 'network',
427
+ confidence: 'medium',
428
+ suggestedFix: 'Check your internet connection and verify the server is running',
429
+ technicalDetails: errorMessage,
430
+ };
431
+ }
432
+ // CORS error patterns
433
+ if (msg.includes('cors') || msg.includes('cross-origin') || msg.includes('access-control-allow-origin')) {
434
+ return {
435
+ summary: 'Cross-origin request blocked (CORS error)',
436
+ rootCause: 'The browser blocked a request to a different domain because the server doesn\'t allow it',
437
+ errorType: 'network',
438
+ confidence: 'high',
439
+ suggestedFix: 'Add the correct CORS headers on the server (Access-Control-Allow-Origin)',
440
+ technicalDetails: errorMessage,
441
+ };
442
+ }
443
+ // SecurityError / mixed content patterns
444
+ if (msg.includes('securityerror') || msg.includes('mixed content') || msg.includes('blocked:mixed')) {
445
+ return {
446
+ summary: 'Security error — blocked insecure content',
447
+ rootCause: 'The page tried to load insecure (HTTP) content on a secure (HTTPS) page',
448
+ errorType: 'network',
449
+ confidence: 'high',
450
+ suggestedFix: 'Change all resource URLs from http:// to https://',
451
+ technicalDetails: errorMessage,
452
+ };
453
+ }
454
+ // Content Security Policy (CSP) patterns
455
+ if (msg.includes('content security policy') || msg.includes('csp') || msg.includes('refused to')) {
456
+ return {
457
+ summary: 'Content blocked by security policy',
458
+ rootCause: 'The page\'s Content Security Policy is blocking a script, style, or resource from loading',
459
+ errorType: 'network',
460
+ confidence: 'medium',
461
+ suggestedFix: 'Update the Content-Security-Policy header to allow the blocked resource',
462
+ technicalDetails: errorMessage,
463
+ };
464
+ }
465
+ // Deprecation warnings
466
+ if (msg.includes('deprecated') || msg.includes('deprecation')) {
467
+ return {
468
+ summary: 'Code uses a deprecated feature that may stop working',
469
+ rootCause: 'The code relies on a browser API or pattern that is being phased out',
470
+ errorType: 'javascript',
471
+ confidence: 'medium',
472
+ suggestedFix: 'Update the code to use the recommended modern alternative',
473
+ technicalDetails: errorMessage,
474
+ };
475
+ }
476
+ // Default fallback: surface original error message instead of generic text
477
+ const cleanedMessage = errorMessage.trim().replace(/\n/g, ' ');
478
+ const truncatedMessage = cleanedMessage.length > 120
479
+ ? cleanedMessage.slice(0, 120) + '...'
480
+ : cleanedMessage;
481
+ const summary = truncatedMessage
482
+ ? `JavaScript error: ${truncatedMessage}`
483
+ : 'An unknown error occurred';
484
+ // Cap total summary at 150 chars
485
+ const cappedSummary = summary.length > 150 ? summary.slice(0, 147) + '...' : summary;
486
+ // Try to extract actionable fix from the error message itself
487
+ let suggestedFix;
488
+ if (cleanedMessage.includes('404') || cleanedMessage.includes('Not Found')) {
489
+ suggestedFix = 'A resource returned 404 — check if the file path or API endpoint URL is correct and the resource exists on the server.';
490
+ }
491
+ else if (cleanedMessage.includes('500') || cleanedMessage.includes('Internal Server Error')) {
492
+ suggestedFix = 'The server returned a 500 error — check your server logs for the stack trace and fix the backend code.';
493
+ }
494
+ else if (cleanedMessage.includes('Failed to load') || cleanedMessage.includes('failed to fetch')) {
495
+ suggestedFix = 'A resource or API call failed to load — verify the URL is correct and the server is running.';
496
+ }
497
+ else {
498
+ suggestedFix = 'Open your browser DevTools (F12), go to the Console tab, reproduce the error, and check the stack trace for the source file and line number.';
499
+ }
500
+ return {
501
+ summary: cappedSummary,
502
+ rootCause: 'Set GEMINI_API_KEY for AI-powered root cause analysis',
503
+ errorType: 'unknown',
504
+ confidence: 'medium',
505
+ suggestedFix,
506
+ technicalDetails: errorMessage,
507
+ };
508
+ }
509
+ /**
510
+ * Pattern match network failures by status code
511
+ */
512
+ function patternMatchNetworkFailure(status, url) {
513
+ const resourceName = url.split('/').pop()?.split('?')[0] || url;
514
+ if (status === 404) {
515
+ return {
516
+ summary: `"${resourceName}" not found (404)`,
517
+ rootCause: `The URL ${url} doesn't exist on the server`,
518
+ errorType: 'network',
519
+ confidence: 'high',
520
+ suggestedFix: `Check if "${resourceName}" exists at the expected path, or update the URL that references it`,
521
+ technicalDetails: `HTTP 404: ${url}`,
522
+ };
523
+ }
524
+ if (status === 403) {
525
+ return {
526
+ summary: 'Permission denied',
527
+ rootCause: `Access to ${url} is forbidden`,
528
+ errorType: 'authentication',
529
+ confidence: 'high',
530
+ suggestedFix: 'Check if you need to be logged in or have specific permissions',
531
+ technicalDetails: `HTTP 403: ${url}`,
532
+ };
533
+ }
534
+ if (status === 401) {
535
+ return {
536
+ summary: 'Authentication required',
537
+ rootCause: `Access to ${url} requires authentication`,
538
+ errorType: 'authentication',
539
+ confidence: 'high',
540
+ suggestedFix: 'Log in with valid credentials',
541
+ technicalDetails: `HTTP 401: ${url}`,
542
+ };
543
+ }
544
+ if (status >= 500) {
545
+ return {
546
+ summary: 'Server error',
547
+ rootCause: `The server encountered an error processing ${url}`,
548
+ errorType: 'network',
549
+ confidence: 'high',
550
+ suggestedFix: 'Contact the website administrator or try again later',
551
+ technicalDetails: `HTTP ${status}: ${url}`,
552
+ };
553
+ }
554
+ if (status >= 400) {
555
+ return {
556
+ summary: 'Request error',
557
+ rootCause: `The request to ${url} was invalid`,
558
+ errorType: 'network',
559
+ confidence: 'medium',
560
+ suggestedFix: 'Check the request parameters and URL format',
561
+ technicalDetails: `HTTP ${status}: ${url}`,
562
+ };
563
+ }
564
+ return {
565
+ summary: `Network request to ${resourceName} failed (HTTP ${status})`,
566
+ rootCause: `The server returned an unexpected status ${status} for ${url}`,
567
+ errorType: 'network',
568
+ confidence: 'medium',
569
+ suggestedFix: `Check if "${resourceName}" is working correctly — the server returned HTTP ${status}`,
570
+ technicalDetails: `HTTP ${status}: ${url}`,
571
+ };
572
+ }
573
+ //# sourceMappingURL=error-analyzer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-analyzer.js","sourceRoot":"","sources":["../../src/analysis/error-analyzer.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAkB,oBAAoB,EAAE,yBAAyB,EAAkB,MAAM,uBAAuB,CAAC;AACxH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAA2B,EAC3B,O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G,EAAE;KAC3C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './diagnosis-schema.js';
2
+ export * from './error-analyzer.js';
3
+ export * from './source-mapper.js';
4
+ export * from './ui-auditor.js';
@@ -0,0 +1,6 @@
1
+ // Phase 4 Analysis & Diagnosis exports
2
+ export * from './diagnosis-schema.js';
3
+ export * from './error-analyzer.js';
4
+ export * from './source-mapper.js';
5
+ export * from './ui-auditor.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/analysis/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { SourceLocation } from './diagnosis-schema.js';
2
+ /**
3
+ * Map a single error message to source code location
4
+ * Returns null if source path invalid, timeout occurs, or no match found
5
+ *
6
+ * Uses a cancelled flag so that when the timeout fires, the ts-morph scanning
7
+ * loop exits early and the Project reference is released for GC. Without this,
8
+ * Promise.race would leave the AST work running and consuming CPU/memory
9
+ * indefinitely on large codebases.
10
+ */
11
+ export declare function mapErrorToSource(errorMessage: string, sourcePath: string): Promise<SourceLocation | null>;
12
+ /**
13
+ * Map multiple errors to source locations in a single batch.
14
+ * Shares 10-second timeout across all searches for efficiency.
15
+ * Uses cancellation flag to stop work when timeout fires (same pattern as mapErrorToSource).
16
+ */
17
+ export declare function mapMultipleErrors(errors: Array<{
18
+ message: string;
19
+ }>, sourcePath: string): Promise<Map<string, SourceLocation>>;