@dallask/a11y-mcp-srv 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.
- package/LICENSE +21 -0
- package/NOTICE +9 -0
- package/README.md +1328 -0
- package/bin/server.js +8 -0
- package/dist/core/accessibility-runner.d.ts +123 -0
- package/dist/core/accessibility-runner.d.ts.map +1 -0
- package/dist/core/accessibility-runner.js +465 -0
- package/dist/core/accessibility-runner.js.map +1 -0
- package/dist/core/basic-auth.d.ts +35 -0
- package/dist/core/basic-auth.d.ts.map +1 -0
- package/dist/core/basic-auth.js +52 -0
- package/dist/core/basic-auth.js.map +1 -0
- package/dist/core/config.d.ts +44 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +163 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/error-handler.d.ts +66 -0
- package/dist/core/error-handler.d.ts.map +1 -0
- package/dist/core/error-handler.js +305 -0
- package/dist/core/error-handler.js.map +1 -0
- package/dist/core/normalize-audit-result.d.ts +18 -0
- package/dist/core/normalize-audit-result.d.ts.map +1 -0
- package/dist/core/normalize-audit-result.js +118 -0
- package/dist/core/normalize-audit-result.js.map +1 -0
- package/dist/core/playwright-bootstrap.d.ts +21 -0
- package/dist/core/playwright-bootstrap.d.ts.map +1 -0
- package/dist/core/playwright-bootstrap.js +144 -0
- package/dist/core/playwright-bootstrap.js.map +1 -0
- package/dist/core/progress-streamer.d.ts +44 -0
- package/dist/core/progress-streamer.d.ts.map +1 -0
- package/dist/core/progress-streamer.js +160 -0
- package/dist/core/progress-streamer.js.map +1 -0
- package/dist/core/result-processor.d.ts +86 -0
- package/dist/core/result-processor.d.ts.map +1 -0
- package/dist/core/result-processor.js +475 -0
- package/dist/core/result-processor.js.map +1 -0
- package/dist/core/session-manager.d.ts +73 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +243 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1439 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/aggregate.d.ts +26 -0
- package/dist/tools/aggregate.d.ts.map +1 -0
- package/dist/tools/aggregate.js +340 -0
- package/dist/tools/aggregate.js.map +1 -0
- package/dist/tools/analysis.d.ts +68 -0
- package/dist/tools/analysis.d.ts.map +1 -0
- package/dist/tools/analysis.js +1199 -0
- package/dist/tools/analysis.js.map +1 -0
- package/dist/tools/audit.d.ts +38 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +472 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/comparison.d.ts +27 -0
- package/dist/tools/comparison.d.ts.map +1 -0
- package/dist/tools/comparison.js +499 -0
- package/dist/tools/comparison.js.map +1 -0
- package/dist/tools/export.d.ts +43 -0
- package/dist/tools/export.d.ts.map +1 -0
- package/dist/tools/export.js +746 -0
- package/dist/tools/export.js.map +1 -0
- package/dist/tools/filter.d.ts +26 -0
- package/dist/tools/filter.d.ts.map +1 -0
- package/dist/tools/filter.js +244 -0
- package/dist/tools/filter.js.map +1 -0
- package/dist/tools/session.d.ts +26 -0
- package/dist/tools/session.d.ts.map +1 -0
- package/dist/tools/session.js +228 -0
- package/dist/tools/session.js.map +1 -0
- package/dist/tools/visualize.d.ts +26 -0
- package/dist/tools/visualize.d.ts.map +1 -0
- package/dist/tools/visualize.js +942 -0
- package/dist/tools/visualize.js.map +1 -0
- package/dist/types/index.d.ts +792 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +24 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result Processor - Formats accessibility results into conversational, actionable format
|
|
3
|
+
* Converts raw accessibility results into structured, prioritized, and human-readable format
|
|
4
|
+
*/
|
|
5
|
+
import { IMPACT_ORDER } from '../types/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Derive full WCAG label from engine tags (e.g. wcag22aa -> "WCAG 2.2 AA").
|
|
8
|
+
* Used for display and for audit fallback.
|
|
9
|
+
*/
|
|
10
|
+
export function getWcagLabelFromTags(tags) {
|
|
11
|
+
if (!tags || tags.length === 0)
|
|
12
|
+
return 'N/A';
|
|
13
|
+
const level = tags.some((t) => t.endsWith('aaa')) ? 'AAA'
|
|
14
|
+
: tags.some((t) => t.endsWith('aa')) ? 'AA'
|
|
15
|
+
: tags.some((t) => t.endsWith('a')) ? 'A'
|
|
16
|
+
: null;
|
|
17
|
+
if (!level)
|
|
18
|
+
return 'N/A';
|
|
19
|
+
if (tags.some((t) => t.startsWith('wcag22')))
|
|
20
|
+
return `WCAG 2.2 ${level}`;
|
|
21
|
+
if (tags.some((t) => t.startsWith('wcag21')))
|
|
22
|
+
return `WCAG 2.1 ${level}`;
|
|
23
|
+
if (tags.some((t) => t.startsWith('wcag2')))
|
|
24
|
+
return `WCAG 2.0 ${level}`;
|
|
25
|
+
return `WCAG ${level}`;
|
|
26
|
+
}
|
|
27
|
+
/** True if wcagLevel string matches the given level (A, AA, AAA); supports full label e.g. "WCAG 2.2 AA". */
|
|
28
|
+
export function wcagLevelMatches(level, target) {
|
|
29
|
+
if (target === 'AAA')
|
|
30
|
+
return level === 'AAA' || level.endsWith(' AAA');
|
|
31
|
+
if (target === 'AA')
|
|
32
|
+
return level === 'AA' || (level.endsWith(' AA') && !level.endsWith(' AAA'));
|
|
33
|
+
return level === 'A' || (level.endsWith(' A') && !level.endsWith(' AA'));
|
|
34
|
+
}
|
|
35
|
+
/** Numeric order for sorting by WCAG level (A=3, AA=2, AAA=1). Supports full label e.g. "WCAG 2.2 AA". */
|
|
36
|
+
export function wcagLevelOrder(level) {
|
|
37
|
+
if (wcagLevelMatches(level, 'A'))
|
|
38
|
+
return 3;
|
|
39
|
+
if (wcagLevelMatches(level, 'AA'))
|
|
40
|
+
return 2;
|
|
41
|
+
if (wcagLevelMatches(level, 'AAA'))
|
|
42
|
+
return 1;
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* ResultProcessor class - Formats and processes accessibility results
|
|
47
|
+
*/
|
|
48
|
+
export class ResultProcessor {
|
|
49
|
+
/**
|
|
50
|
+
* Get WCAG level for display (full label e.g. "WCAG 2.2 AA"). Uses tags when present, else audit fallback.
|
|
51
|
+
*/
|
|
52
|
+
getWCAGLevel(tags, auditWcagLabel) {
|
|
53
|
+
if (tags && tags.length > 0)
|
|
54
|
+
return getWcagLabelFromTags(tags);
|
|
55
|
+
return auditWcagLabel ?? 'N/A';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Determine impact level from engine-reported impact (axe or ACE native levels).
|
|
59
|
+
*/
|
|
60
|
+
getImpactLevel(_category, _ruleId, ruleData) {
|
|
61
|
+
return ruleData?.impact ?? 'moderate';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get impact rank for ordering (higher = worse). Uses IMPACT_ORDER.
|
|
65
|
+
*/
|
|
66
|
+
impactRank(impact) {
|
|
67
|
+
return IMPACT_ORDER[impact.toLowerCase()] ?? 2;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Calculate priority score for an issue (higher = more important)
|
|
71
|
+
*/
|
|
72
|
+
calculatePriority(issue) {
|
|
73
|
+
let priority = 0;
|
|
74
|
+
// Impact weighting (axe: critical/serious/moderate/minor; ACE: violation/potentialviolation/...)
|
|
75
|
+
priority += this.impactRank(issue.impact) * 25;
|
|
76
|
+
// WCAG level weighting (AAA > AA > A); support full label e.g. "WCAG 2.2 AA"
|
|
77
|
+
const level = issue.wcagLevel;
|
|
78
|
+
if (level.endsWith('AAA'))
|
|
79
|
+
priority += 30;
|
|
80
|
+
else if (level.endsWith('AA'))
|
|
81
|
+
priority += 20;
|
|
82
|
+
else if (level.endsWith('A'))
|
|
83
|
+
priority += 10;
|
|
84
|
+
return priority;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Generate fix suggestion for an issue
|
|
88
|
+
*/
|
|
89
|
+
generateFixSuggestion(ruleId, _category, element, xpath, domInfo) {
|
|
90
|
+
const currentCode = domInfo?.innerHTML || element || xpath;
|
|
91
|
+
let suggested = currentCode;
|
|
92
|
+
let explanation = '';
|
|
93
|
+
// Generate fix suggestions based on rule type
|
|
94
|
+
if (ruleId.includes('alt_missing') || ruleId.includes('alt_link_missing')) {
|
|
95
|
+
suggested = currentCode.replace(/<img([^>]*)>/i, '<img$1 alt="Descriptive text here">');
|
|
96
|
+
explanation = 'Add descriptive alt text to image elements. Alt text should describe the image content or function.';
|
|
97
|
+
}
|
|
98
|
+
else if (ruleId.includes('label_missing') || ruleId.includes('label_empty')) {
|
|
99
|
+
if (currentCode.includes('<input')) {
|
|
100
|
+
suggested = currentCode.replace(/<input([^>]*)>/i, '<label for="input-id">Label text</label><input id="input-id"$1>');
|
|
101
|
+
explanation = 'Add a label element associated with the input using the "for" attribute matching the input "id".';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else if (ruleId === 'contrast') {
|
|
105
|
+
explanation = 'Improve color contrast ratio. Text should have a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (WCAG AA).';
|
|
106
|
+
}
|
|
107
|
+
else if (ruleId.includes('heading')) {
|
|
108
|
+
explanation = 'Ensure headings are not empty and follow a logical hierarchy (h1 → h2 → h3, etc.).';
|
|
109
|
+
}
|
|
110
|
+
else if (ruleId.includes('link_empty')) {
|
|
111
|
+
explanation = 'Add descriptive link text. Links should clearly indicate their destination or purpose.';
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
explanation = `Fix ${ruleId} issue. See accessibility documentation for specific guidance.`;
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
current: currentCode.substring(0, 200), // Limit length
|
|
118
|
+
suggested: suggested.substring(0, 200),
|
|
119
|
+
explanation,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Generate user impact description from engine-native impact level.
|
|
124
|
+
*/
|
|
125
|
+
generateUserImpact(_ruleId, impact) {
|
|
126
|
+
const rank = this.impactRank(impact);
|
|
127
|
+
if (rank >= 5) {
|
|
128
|
+
return 'This is a definite or likely accessibility failure that prevents users with disabilities from accessing content or functionality.';
|
|
129
|
+
}
|
|
130
|
+
if (rank >= 4) {
|
|
131
|
+
return 'This potential issue needs manual review — it may significantly impact users with disabilities.';
|
|
132
|
+
}
|
|
133
|
+
if (rank >= 3) {
|
|
134
|
+
return 'This is a best-practice recommendation that improves accessibility for users with disabilities.';
|
|
135
|
+
}
|
|
136
|
+
return 'This may cause minor inconveniences for some users.';
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Process accessibility violations into prioritized issues
|
|
140
|
+
*/
|
|
141
|
+
processViolations(violations, _appliedFilters, options) {
|
|
142
|
+
const issues = [];
|
|
143
|
+
const auditWcagLabel = options?.auditWcagLabel;
|
|
144
|
+
Object.entries(violations).forEach(([categoryKey, category]) => {
|
|
145
|
+
if (!category || !category.items) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
Object.entries(category.items).forEach(([ruleId, ruleData]) => {
|
|
149
|
+
if (!ruleData || ruleData.count === 0) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
// Process each instance of the violation
|
|
153
|
+
const xpaths = ruleData.xpaths || [];
|
|
154
|
+
const domInfoArray = ruleData.domInfo || [];
|
|
155
|
+
xpaths.forEach((xpath, index) => {
|
|
156
|
+
const domInfo = domInfoArray[index];
|
|
157
|
+
const element = domInfo
|
|
158
|
+
? `${domInfo.tagName || 'Unknown'}${domInfo.id ? `#${domInfo.id}` : ''}${domInfo.className ? `.${domInfo.className.replace(/\s+/g, '.')}` : ''}`
|
|
159
|
+
: xpath;
|
|
160
|
+
// Build a selector that identifies the exact element: tag + optional id + optional classes.
|
|
161
|
+
// Never leave empty: use tag when no class/id so the column always has a value.
|
|
162
|
+
const tag = domInfo?.tagName || 'element';
|
|
163
|
+
const idPart = domInfo?.id ? `#${domInfo.id}` : '';
|
|
164
|
+
const classPart = domInfo?.className != null && domInfo.className !== ''
|
|
165
|
+
? '.' + String(domInfo.className).trim().replace(/\s+/g, '.')
|
|
166
|
+
: '';
|
|
167
|
+
const classSelector = tag + idPart + classPart;
|
|
168
|
+
const tags = ruleData.tags || [];
|
|
169
|
+
const wcagLevel = this.getWCAGLevel(tags, auditWcagLabel);
|
|
170
|
+
const impact = this.getImpactLevel(categoryKey, ruleId, ruleData);
|
|
171
|
+
const fix = this.generateFixSuggestion(ruleId, categoryKey, element, xpath, domInfo);
|
|
172
|
+
const userImpact = this.generateUserImpact(ruleId, impact);
|
|
173
|
+
const issue = {
|
|
174
|
+
ruleId,
|
|
175
|
+
impact,
|
|
176
|
+
description: ruleData.description || ruleId,
|
|
177
|
+
wcagLevel,
|
|
178
|
+
tags,
|
|
179
|
+
element,
|
|
180
|
+
xpath,
|
|
181
|
+
classSelector,
|
|
182
|
+
fix,
|
|
183
|
+
userImpact,
|
|
184
|
+
priority: 0, // Will be calculated after all issues are collected
|
|
185
|
+
category: categoryKey,
|
|
186
|
+
helpUrl: `https://webaim.org/resources/help/`,
|
|
187
|
+
};
|
|
188
|
+
issues.push(issue);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
// Calculate priorities
|
|
193
|
+
issues.forEach((issue) => {
|
|
194
|
+
issue.priority = this.calculatePriority(issue);
|
|
195
|
+
});
|
|
196
|
+
// Sort by priority (highest first)
|
|
197
|
+
issues.sort((a, b) => b.priority - a.priority);
|
|
198
|
+
return issues;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Calculate accessibility score (0-100)
|
|
202
|
+
*/
|
|
203
|
+
calculateScore(issues) {
|
|
204
|
+
if (issues.length === 0) {
|
|
205
|
+
return 100;
|
|
206
|
+
}
|
|
207
|
+
// Base score starts at 100
|
|
208
|
+
let score = 100;
|
|
209
|
+
// Deduct points based on impact (axe/ACE native levels via IMPACT_ORDER)
|
|
210
|
+
issues.forEach((issue) => {
|
|
211
|
+
const rank = this.impactRank(issue.impact);
|
|
212
|
+
if (rank >= 5)
|
|
213
|
+
score -= 5;
|
|
214
|
+
else if (rank >= 4)
|
|
215
|
+
score -= 3;
|
|
216
|
+
else if (rank >= 3)
|
|
217
|
+
score -= 1;
|
|
218
|
+
else
|
|
219
|
+
score -= 0.5;
|
|
220
|
+
});
|
|
221
|
+
// Ensure score doesn't go below 0
|
|
222
|
+
return Math.max(0, Math.round(score));
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Calculate WCAG compliance percentages
|
|
226
|
+
*/
|
|
227
|
+
calculateWCAGCompliance(issues) {
|
|
228
|
+
const levelA = issues.filter((i) => wcagLevelMatches(i.wcagLevel, 'A'));
|
|
229
|
+
const levelAA = issues.filter((i) => wcagLevelMatches(i.wcagLevel, 'AA'));
|
|
230
|
+
const levelAAA = issues.filter((i) => wcagLevelMatches(i.wcagLevel, 'AAA'));
|
|
231
|
+
// Calculate compliance as percentage (100% - violation percentage)
|
|
232
|
+
// This is a simplified calculation - in reality, we'd need to know total criteria
|
|
233
|
+
const totalIssues = issues.length;
|
|
234
|
+
const complianceA = totalIssues > 0 ? Math.max(0, 100 - (levelA.length / totalIssues) * 100) : 100;
|
|
235
|
+
const complianceAA = totalIssues > 0 ? Math.max(0, 100 - (levelAA.length / totalIssues) * 100) : 100;
|
|
236
|
+
const complianceAAA = totalIssues > 0 ? Math.max(0, 100 - (levelAAA.length / totalIssues) * 100) : 100;
|
|
237
|
+
return {
|
|
238
|
+
A: Math.round(complianceA),
|
|
239
|
+
AA: Math.round(complianceAA),
|
|
240
|
+
AAA: Math.round(complianceAAA),
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Generate summary statistics
|
|
245
|
+
*/
|
|
246
|
+
generateSummary(issues, score, wcagCompliance) {
|
|
247
|
+
const byCategory = {};
|
|
248
|
+
const byImpact = {};
|
|
249
|
+
issues.forEach((issue) => {
|
|
250
|
+
// Count by category
|
|
251
|
+
const category = issue.category || 'unknown';
|
|
252
|
+
byCategory[category] = (byCategory[category] || 0) + 1;
|
|
253
|
+
// Count by impact
|
|
254
|
+
byImpact[issue.impact] = (byImpact[issue.impact] || 0) + 1;
|
|
255
|
+
});
|
|
256
|
+
return {
|
|
257
|
+
totalIssues: issues.length,
|
|
258
|
+
score,
|
|
259
|
+
wcagCompliance,
|
|
260
|
+
byCategory,
|
|
261
|
+
byImpact,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Identify quick wins (easy fixes with high impact)
|
|
266
|
+
*/
|
|
267
|
+
identifyQuickWins(issues) {
|
|
268
|
+
const quickWins = [];
|
|
269
|
+
// Group issues by rule ID
|
|
270
|
+
const ruleGroups = new Map();
|
|
271
|
+
issues.forEach((issue) => {
|
|
272
|
+
if (!ruleGroups.has(issue.ruleId)) {
|
|
273
|
+
ruleGroups.set(issue.ruleId, []);
|
|
274
|
+
}
|
|
275
|
+
ruleGroups.get(issue.ruleId).push(issue);
|
|
276
|
+
});
|
|
277
|
+
ruleGroups.forEach((groupIssues, ruleId) => {
|
|
278
|
+
// Quick wins are issues that:
|
|
279
|
+
// 1. Have high impact (axe: critical/serious; ACE: violation/potentialviolation)
|
|
280
|
+
// 2. Are easy to fix (have clear fix suggestions)
|
|
281
|
+
// 3. Affect multiple elements (batch fix opportunity)
|
|
282
|
+
const highImpactIssues = groupIssues.filter((i) => this.impactRank(i.impact) >= 5);
|
|
283
|
+
if (highImpactIssues.length > 0 && groupIssues.length > 1) {
|
|
284
|
+
const firstIssue = groupIssues[0];
|
|
285
|
+
quickWins.push({
|
|
286
|
+
ruleId,
|
|
287
|
+
description: firstIssue.description,
|
|
288
|
+
impact: firstIssue.impact,
|
|
289
|
+
fix: firstIssue.fix,
|
|
290
|
+
estimatedTime: `${Math.ceil(groupIssues.length * 2)} minutes`,
|
|
291
|
+
affectedElements: groupIssues.length,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
// Sort by impact and number of affected elements
|
|
296
|
+
quickWins.sort((a, b) => {
|
|
297
|
+
const impactDiff = this.impactRank(b.impact) - this.impactRank(a.impact);
|
|
298
|
+
if (impactDiff !== 0)
|
|
299
|
+
return impactDiff;
|
|
300
|
+
return b.affectedElements - a.affectedElements;
|
|
301
|
+
});
|
|
302
|
+
return quickWins.slice(0, 10); // Top 10 quick wins
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Identify critical blockers (must fix before launch)
|
|
306
|
+
*/
|
|
307
|
+
identifyCriticalBlockers(issues) {
|
|
308
|
+
const blockers = [];
|
|
309
|
+
// Group by rule ID
|
|
310
|
+
const ruleGroups = new Map();
|
|
311
|
+
issues.forEach((issue) => {
|
|
312
|
+
if (!ruleGroups.has(issue.ruleId)) {
|
|
313
|
+
ruleGroups.set(issue.ruleId, []);
|
|
314
|
+
}
|
|
315
|
+
ruleGroups.get(issue.ruleId).push(issue);
|
|
316
|
+
});
|
|
317
|
+
ruleGroups.forEach((groupIssues, ruleId) => {
|
|
318
|
+
// Critical blockers: high impact (axe critical/serious; ACE violation/potentialviolation) or WCAG Level A
|
|
319
|
+
const highImpactIssues = groupIssues.filter((i) => this.impactRank(i.impact) >= 5);
|
|
320
|
+
const levelAIssues = groupIssues.filter((i) => wcagLevelMatches(i.wcagLevel, 'A'));
|
|
321
|
+
if (highImpactIssues.length > 0 || levelAIssues.length > 0) {
|
|
322
|
+
const firstIssue = groupIssues[0];
|
|
323
|
+
blockers.push({
|
|
324
|
+
ruleId,
|
|
325
|
+
description: firstIssue.description,
|
|
326
|
+
impact: firstIssue.impact,
|
|
327
|
+
userImpact: firstIssue.userImpact,
|
|
328
|
+
affectedElements: groupIssues.length,
|
|
329
|
+
wcagLevel: firstIssue.wcagLevel,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
// Sort by WCAG level (A first) then impact rank
|
|
334
|
+
blockers.sort((a, b) => {
|
|
335
|
+
const levelDiff = wcagLevelOrder(b.wcagLevel) - wcagLevelOrder(a.wcagLevel);
|
|
336
|
+
if (levelDiff !== 0)
|
|
337
|
+
return levelDiff;
|
|
338
|
+
return this.impactRank(b.impact) - this.impactRank(a.impact);
|
|
339
|
+
});
|
|
340
|
+
return blockers;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Generate conversational summary
|
|
344
|
+
*/
|
|
345
|
+
generateConversationalSummary(summary, _issues, quickWins, blockers, appliedFilters) {
|
|
346
|
+
const parts = [];
|
|
347
|
+
// Opening
|
|
348
|
+
if (summary.totalIssues === 0) {
|
|
349
|
+
const totalBefore = appliedFilters?.originalIssueCount;
|
|
350
|
+
if (totalBefore != null && totalBefore > 0) {
|
|
351
|
+
const tagList = (appliedFilters?.tags ?? []).join(', ');
|
|
352
|
+
return `Tag filter applied: ${totalBefore} issue${totalBefore !== 1 ? 's' : ''} found, but 0 match your selected tags (${tagList}). Try running without tags to see all issues.`;
|
|
353
|
+
}
|
|
354
|
+
return "🎉 Excellent! No accessibility issues found. This page meets WCAG accessibility standards.";
|
|
355
|
+
}
|
|
356
|
+
parts.push(`Found ${summary.totalIssues} accessibility issue${summary.totalIssues !== 1 ? 's' : ''} on this page.`);
|
|
357
|
+
const totalBefore = appliedFilters?.originalIssueCount;
|
|
358
|
+
if (totalBefore != null && totalBefore > summary.totalIssues) {
|
|
359
|
+
parts.push(`(${totalBefore} issues before tag filter; showing those matching your selected tags.)`);
|
|
360
|
+
}
|
|
361
|
+
// Score
|
|
362
|
+
if (summary.score >= 80) {
|
|
363
|
+
parts.push(`Accessibility score: ${summary.score}/100 (Good)`);
|
|
364
|
+
}
|
|
365
|
+
else if (summary.score >= 60) {
|
|
366
|
+
parts.push(`Accessibility score: ${summary.score}/100 (Needs Improvement)`);
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
parts.push(`Accessibility score: ${summary.score}/100 (Critical)`);
|
|
370
|
+
}
|
|
371
|
+
// Critical blockers
|
|
372
|
+
if (blockers.length > 0) {
|
|
373
|
+
parts.push(`\n🚨 ${blockers.length} critical blocker${blockers.length !== 1 ? 's' : ''} must be fixed before launch.`);
|
|
374
|
+
}
|
|
375
|
+
// Quick wins
|
|
376
|
+
if (quickWins.length > 0) {
|
|
377
|
+
parts.push(`\n✨ ${quickWins.length} quick win${quickWins.length !== 1 ? 's' : ''} available - these are easy fixes that will have high impact.`);
|
|
378
|
+
}
|
|
379
|
+
// Severity breakdown aligned with IBM Equal Access browser tool
|
|
380
|
+
if (summary.byImpact['violation']) {
|
|
381
|
+
parts.push(`\n🚫 Violations: ${summary.byImpact['violation']}`);
|
|
382
|
+
}
|
|
383
|
+
if (summary.byImpact['needs-review']) {
|
|
384
|
+
parts.push(`⚠️ Needs review: ${summary.byImpact['needs-review']}`);
|
|
385
|
+
}
|
|
386
|
+
if (summary.byImpact['recommendation']) {
|
|
387
|
+
parts.push(`ℹ️ Recommendations: ${summary.byImpact['recommendation']}`);
|
|
388
|
+
}
|
|
389
|
+
if (summary.byImpact['minor']) {
|
|
390
|
+
parts.push(`Minor: ${summary.byImpact['minor']}`);
|
|
391
|
+
}
|
|
392
|
+
// WCAG compliance
|
|
393
|
+
parts.push(`\nWCAG Compliance: Level A: ${summary.wcagCompliance.A}%, Level AA: ${summary.wcagCompliance.AA}%, Level AAA: ${summary.wcagCompliance.AAA}%`);
|
|
394
|
+
// Category breakdown
|
|
395
|
+
const categoryEntries = Object.entries(summary.byCategory);
|
|
396
|
+
if (categoryEntries.length > 0) {
|
|
397
|
+
parts.push(`\nIssues by category: ${categoryEntries.map(([cat, count]) => `${cat}: ${count}`).join(', ')}`);
|
|
398
|
+
}
|
|
399
|
+
return parts.join('\n');
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Generate a markdown table summarising all prioritised issues.
|
|
403
|
+
* Columns: Severity | Rule ID | Description | WCAG | Element / XPath | Fix hint
|
|
404
|
+
*/
|
|
405
|
+
generateIssuesTable(issues) {
|
|
406
|
+
if (issues.length === 0) {
|
|
407
|
+
return '| Severity | Rule | Description | WCAG | Element |\n|---|---|---|---|---|\n| — | — | No issues found | — | — |';
|
|
408
|
+
}
|
|
409
|
+
const severityIcon = (impact) => {
|
|
410
|
+
const rank = IMPACT_ORDER[impact.toLowerCase()] ?? 2;
|
|
411
|
+
if (rank >= 5)
|
|
412
|
+
return `🚫 ${impact}`;
|
|
413
|
+
if (rank >= 4)
|
|
414
|
+
return `⚠️ ${impact}`;
|
|
415
|
+
if (rank >= 3)
|
|
416
|
+
return `ℹ️ ${impact}`;
|
|
417
|
+
return impact;
|
|
418
|
+
};
|
|
419
|
+
const truncate = (s, max = 80) => s.length > max ? s.substring(0, max - 1) + '…' : s;
|
|
420
|
+
const escape = (s) => s.replace(/\|/g, '\\|').replace(/\n/g, ' ');
|
|
421
|
+
const header = '| # | Severity | Rule ID | Description | WCAG | Element |';
|
|
422
|
+
const divider = '|---|---|---|---|---|---|';
|
|
423
|
+
const rows = issues.map((issue, i) => {
|
|
424
|
+
const num = String(i + 1);
|
|
425
|
+
const severity = severityIcon(issue.impact);
|
|
426
|
+
const ruleId = `\`${escape(issue.ruleId)}\``;
|
|
427
|
+
const description = escape(truncate(issue.description));
|
|
428
|
+
const wcag = issue.wcagLevel || 'N/A';
|
|
429
|
+
// Use selector from domInfo if available, fall back to xpath
|
|
430
|
+
const element = escape(truncate(issue.xpath || issue.element || '—', 60));
|
|
431
|
+
return `| ${num} | ${severity} | ${ruleId} | ${description} | ${wcag} | ${element} |`;
|
|
432
|
+
});
|
|
433
|
+
return [header, divider, ...rows].join('\n');
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Process accessibility results into structured audit result
|
|
437
|
+
*/
|
|
438
|
+
process(accessibilityResults, appliedFilters, options) {
|
|
439
|
+
// Use filtered results if available, otherwise use original
|
|
440
|
+
const violations = accessibilityResults.violations;
|
|
441
|
+
// Process violations into prioritized issues
|
|
442
|
+
const issues = this.processViolations(violations, appliedFilters, options);
|
|
443
|
+
// Calculate metrics
|
|
444
|
+
const score = this.calculateScore(issues);
|
|
445
|
+
const wcagCompliance = this.calculateWCAGCompliance(issues);
|
|
446
|
+
const summary = this.generateSummary(issues, score, wcagCompliance);
|
|
447
|
+
// Identify quick wins and blockers
|
|
448
|
+
const quickWins = this.identifyQuickWins(issues);
|
|
449
|
+
const criticalBlockers = this.identifyCriticalBlockers(issues);
|
|
450
|
+
// Generate conversational summary
|
|
451
|
+
const conversationalSummary = this.generateConversationalSummary(summary, issues, quickWins, criticalBlockers, appliedFilters);
|
|
452
|
+
// Extract metadata
|
|
453
|
+
const metadata = {
|
|
454
|
+
testEngine: accessibilityResults.testEngine,
|
|
455
|
+
testRunner: accessibilityResults.testRunner,
|
|
456
|
+
testEnvironment: accessibilityResults.testEnvironment,
|
|
457
|
+
timestamp: accessibilityResults.timestamp,
|
|
458
|
+
url: accessibilityResults.url,
|
|
459
|
+
};
|
|
460
|
+
// Generate issues table
|
|
461
|
+
const issuesTable = this.generateIssuesTable(issues);
|
|
462
|
+
return {
|
|
463
|
+
summary,
|
|
464
|
+
prioritizedIssues: issues,
|
|
465
|
+
appliedFilters,
|
|
466
|
+
conversationalSummary,
|
|
467
|
+
issuesTable,
|
|
468
|
+
quickWins,
|
|
469
|
+
criticalBlockers,
|
|
470
|
+
metadata,
|
|
471
|
+
rawResults: accessibilityResults,
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
//# sourceMappingURL=result-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result-processor.js","sourceRoot":"","sources":["../../src/core/result-processor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAQhD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAc;IACjD,IAAI,CAAC,IAAI,IAAI,IAAI,CAA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,WAAW;YACX,SAAS;YACT,gBAAgB;YAChB,QAAQ;YACR,UAAU,EAAE,oBAAoB;SACjC,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Manager - Handles authenticated session storage and management
|
|
3
|
+
* Manages session creation, validation, and cleanup for authenticated audits
|
|
4
|
+
*/
|
|
5
|
+
import { type BrowserContext } from 'playwright';
|
|
6
|
+
import type { Session, SessionConfig, SessionResult } from '../types/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* SessionManager class - Manages authenticated browser sessions
|
|
9
|
+
*/
|
|
10
|
+
export declare class SessionManager {
|
|
11
|
+
private sessions;
|
|
12
|
+
private contexts;
|
|
13
|
+
private cleanupInterval;
|
|
14
|
+
private readonly defaultSessionDuration;
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Start periodic cleanup of expired sessions
|
|
18
|
+
*/
|
|
19
|
+
private startCleanupInterval;
|
|
20
|
+
/**
|
|
21
|
+
* Stop cleanup interval (useful for testing or shutdown)
|
|
22
|
+
*/
|
|
23
|
+
stopCleanupInterval(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Generate a unique session ID
|
|
26
|
+
*/
|
|
27
|
+
private generateSessionId;
|
|
28
|
+
/**
|
|
29
|
+
* Get default login selectors
|
|
30
|
+
*/
|
|
31
|
+
private getDefaultLoginSelectors;
|
|
32
|
+
/**
|
|
33
|
+
* Perform login on a page
|
|
34
|
+
*/
|
|
35
|
+
private performLogin;
|
|
36
|
+
/**
|
|
37
|
+
* Create a new authenticated session
|
|
38
|
+
*/
|
|
39
|
+
createSession(context: BrowserContext, config: SessionConfig): Promise<SessionResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Get a session by ID
|
|
42
|
+
*/
|
|
43
|
+
getSession(sessionId: string): Session | null;
|
|
44
|
+
/**
|
|
45
|
+
* Get browser context for a session
|
|
46
|
+
*/
|
|
47
|
+
getContext(sessionId: string): BrowserContext | null;
|
|
48
|
+
/**
|
|
49
|
+
* Validate that a session is active and valid
|
|
50
|
+
*/
|
|
51
|
+
validateSession(sessionId: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Invalidate a session
|
|
54
|
+
*/
|
|
55
|
+
invalidateSession(sessionId: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* Clean up expired sessions
|
|
58
|
+
*/
|
|
59
|
+
cleanupExpiredSessions(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Get all active sessions
|
|
62
|
+
*/
|
|
63
|
+
getActiveSessions(): Session[];
|
|
64
|
+
/**
|
|
65
|
+
* Get session count
|
|
66
|
+
*/
|
|
67
|
+
getSessionCount(): number;
|
|
68
|
+
/**
|
|
69
|
+
* Clear all sessions (useful for testing or shutdown)
|
|
70
|
+
*/
|
|
71
|
+
clearAllSessions(): void;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=session-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../src/core/session-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,YAAY,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAA;AAE9F;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,QAAQ,CAAyC;IACzD,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAiB;;IAOxD;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;OAEG;IACI,mBAAmB,IAAI,IAAI;IAOlC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAOzB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;OAEG;YACW,YAAY;IAkD1B;;OAEG;IACG,aAAa,CACjB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,aAAa,CAAC;IA0EzB;;OAEG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IAe7C;;OAEG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IASpD;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAK3C;;OAEG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAU1C;;OAEG;IACH,sBAAsB,IAAI,IAAI;IAmB9B;;OAEG;IACH,iBAAiB,IAAI,OAAO,EAAE;IAK9B;;OAEG;IACH,eAAe,IAAI,MAAM;IAKzB;;OAEG;IACH,gBAAgB,IAAI,IAAI;CAKzB"}
|