@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,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comparison tools
|
|
3
|
+
* Implements: compare_accessibility, track_accessibility
|
|
4
|
+
*/
|
|
5
|
+
import type { CompareAccessibilityInput, ComparisonResult, TrackAccessibilityInput, TrackAccessibilityResult } from '../types/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* compare_accessibility - Before/after comparison with diff visualization
|
|
8
|
+
*
|
|
9
|
+
* Compares two accessibility audits to identify issues that were fixed,
|
|
10
|
+
* introduced, or remain. Provides score improvement and visual diff summary.
|
|
11
|
+
*
|
|
12
|
+
* @param input - Comparison input (before/after results or URLs, format)
|
|
13
|
+
* @returns Comparison result with fixed, introduced, and remaining issues
|
|
14
|
+
*/
|
|
15
|
+
export declare function compareAccessibility(input: CompareAccessibilityInput): Promise<ComparisonResult>;
|
|
16
|
+
/**
|
|
17
|
+
* track_accessibility - Historical tracking with trend analysis
|
|
18
|
+
*
|
|
19
|
+
* Tracks accessibility metrics over time, providing trend analysis,
|
|
20
|
+
* predictions, and recommendations. Stores audit results in memory for
|
|
21
|
+
* historical comparison.
|
|
22
|
+
*
|
|
23
|
+
* @param input - Tracking input (URL, timeframe, metric)
|
|
24
|
+
* @returns Tracking result with historical data, trends, and recommendations
|
|
25
|
+
*/
|
|
26
|
+
export declare function trackAccessibility(input: TrackAccessibilityInput): Promise<TrackAccessibilityResult>;
|
|
27
|
+
//# sourceMappingURL=comparison.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../src/tools/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAEV,yBAAyB,EACzB,gBAAgB,EAEhB,uBAAuB,EACvB,wBAAwB,EAKzB,MAAM,mBAAmB,CAAA;AAkL1B;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,gBAAgB,CAAC,CAoE3B;AAmRD;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CAkFnC"}
|
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comparison tools
|
|
3
|
+
* Implements: compare_accessibility, track_accessibility
|
|
4
|
+
*/
|
|
5
|
+
import { resolveBasicAuth } from '../core/basic-auth.js';
|
|
6
|
+
import { normalizeAuditResult } from '../core/normalize-audit-result.js';
|
|
7
|
+
import { auditUrl } from './audit.js';
|
|
8
|
+
/**
|
|
9
|
+
* Create a unique identifier for an issue based on its key properties
|
|
10
|
+
* This helps identify the same issue across different audits
|
|
11
|
+
*/
|
|
12
|
+
function createIssueKey(issue) {
|
|
13
|
+
// Use ruleId, xpath, and element to create a unique key
|
|
14
|
+
// This helps identify the same issue even if other properties change
|
|
15
|
+
return `${issue.ruleId}:${issue.xpath}:${issue.element}`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Compare two sets of issues to find differences
|
|
19
|
+
*/
|
|
20
|
+
function compareIssues(beforeIssues, afterIssues) {
|
|
21
|
+
const beforeMap = new Map();
|
|
22
|
+
const afterMap = new Map();
|
|
23
|
+
// Index issues by their unique key
|
|
24
|
+
beforeIssues.forEach((issue) => {
|
|
25
|
+
const key = createIssueKey(issue);
|
|
26
|
+
beforeMap.set(key, issue);
|
|
27
|
+
});
|
|
28
|
+
afterIssues.forEach((issue) => {
|
|
29
|
+
const key = createIssueKey(issue);
|
|
30
|
+
afterMap.set(key, issue);
|
|
31
|
+
});
|
|
32
|
+
// Find fixed issues (in before but not in after)
|
|
33
|
+
const fixed = [];
|
|
34
|
+
beforeMap.forEach((issue, key) => {
|
|
35
|
+
if (!afterMap.has(key)) {
|
|
36
|
+
fixed.push(issue);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
// Find introduced issues (in after but not in before)
|
|
40
|
+
const introduced = [];
|
|
41
|
+
afterMap.forEach((issue, key) => {
|
|
42
|
+
if (!beforeMap.has(key)) {
|
|
43
|
+
introduced.push(issue);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
// Find remaining issues (in both before and after)
|
|
47
|
+
const remaining = [];
|
|
48
|
+
afterMap.forEach((issue, key) => {
|
|
49
|
+
if (beforeMap.has(key)) {
|
|
50
|
+
remaining.push(issue);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return { fixed, introduced, remaining };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Generate a visual diff summary
|
|
57
|
+
*/
|
|
58
|
+
function generateDiffSummary(fixed, introduced, remaining, scoreImprovement) {
|
|
59
|
+
const parts = [];
|
|
60
|
+
parts.push('## Accessibility Comparison Summary\n');
|
|
61
|
+
// Score improvement
|
|
62
|
+
if (scoreImprovement > 0) {
|
|
63
|
+
parts.push(`✅ **Score improved by ${scoreImprovement} points**\n`);
|
|
64
|
+
}
|
|
65
|
+
else if (scoreImprovement < 0) {
|
|
66
|
+
parts.push(`⚠️ **Score decreased by ${Math.abs(scoreImprovement)} points**\n`);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
parts.push(`➡️ **Score unchanged**\n`);
|
|
70
|
+
}
|
|
71
|
+
// Fixed issues
|
|
72
|
+
if (fixed.length > 0) {
|
|
73
|
+
parts.push(`\n### ✅ Fixed Issues (${fixed.length})`);
|
|
74
|
+
parts.push(`\nGreat progress! ${fixed.length} issue(s) have been resolved:\n`);
|
|
75
|
+
// Group by rule ID
|
|
76
|
+
const ruleGroups = new Map();
|
|
77
|
+
fixed.forEach((issue) => {
|
|
78
|
+
if (!ruleGroups.has(issue.ruleId)) {
|
|
79
|
+
ruleGroups.set(issue.ruleId, []);
|
|
80
|
+
}
|
|
81
|
+
ruleGroups.get(issue.ruleId).push(issue);
|
|
82
|
+
});
|
|
83
|
+
ruleGroups.forEach((groupIssues) => {
|
|
84
|
+
const firstIssue = groupIssues[0];
|
|
85
|
+
parts.push(`- **${firstIssue.description}** (${groupIssues.length} instance${groupIssues.length !== 1 ? 's' : ''})`);
|
|
86
|
+
parts.push(` - Impact: ${firstIssue.impact}`);
|
|
87
|
+
parts.push(` - WCAG Level: ${firstIssue.wcagLevel}`);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
parts.push(`\n### ✅ Fixed Issues (0)`);
|
|
92
|
+
parts.push(`\nNo issues were fixed in this comparison.\n`);
|
|
93
|
+
}
|
|
94
|
+
// Introduced issues
|
|
95
|
+
if (introduced.length > 0) {
|
|
96
|
+
parts.push(`\n### ⚠️ Introduced Issues (${introduced.length})`);
|
|
97
|
+
parts.push(`\n⚠️ ${introduced.length} new issue(s) were introduced:\n`);
|
|
98
|
+
const ruleGroups = new Map();
|
|
99
|
+
introduced.forEach((issue) => {
|
|
100
|
+
if (!ruleGroups.has(issue.ruleId)) {
|
|
101
|
+
ruleGroups.set(issue.ruleId, []);
|
|
102
|
+
}
|
|
103
|
+
ruleGroups.get(issue.ruleId).push(issue);
|
|
104
|
+
});
|
|
105
|
+
ruleGroups.forEach((groupIssues) => {
|
|
106
|
+
const firstIssue = groupIssues[0];
|
|
107
|
+
parts.push(`- **${firstIssue.description}** (${groupIssues.length} instance${groupIssues.length !== 1 ? 's' : ''})`);
|
|
108
|
+
parts.push(` - Impact: ${firstIssue.impact}`);
|
|
109
|
+
parts.push(` - WCAG Level: ${firstIssue.wcagLevel}`);
|
|
110
|
+
parts.push(` - Element: ${firstIssue.element}`);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
parts.push(`\n### ⚠️ Introduced Issues (0)`);
|
|
115
|
+
parts.push(`\nNo new issues were introduced. Great job!\n`);
|
|
116
|
+
}
|
|
117
|
+
// Remaining issues
|
|
118
|
+
if (remaining.length > 0) {
|
|
119
|
+
parts.push(`\n### 🔄 Remaining Issues (${remaining.length})`);
|
|
120
|
+
parts.push(`\n${remaining.length} issue(s) still need to be addressed:\n`);
|
|
121
|
+
// Show top 10 remaining issues by priority
|
|
122
|
+
const topRemaining = remaining
|
|
123
|
+
.sort((a, b) => b.priority - a.priority)
|
|
124
|
+
.slice(0, 10);
|
|
125
|
+
topRemaining.forEach((issue) => {
|
|
126
|
+
parts.push(`- **${issue.description}**`);
|
|
127
|
+
parts.push(` - Impact: ${issue.impact}`);
|
|
128
|
+
parts.push(` - WCAG Level: ${issue.wcagLevel}`);
|
|
129
|
+
parts.push(` - Element: ${issue.element}`);
|
|
130
|
+
});
|
|
131
|
+
if (remaining.length > 10) {
|
|
132
|
+
parts.push(`\n... and ${remaining.length - 10} more issue(s)`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
parts.push(`\n### 🔄 Remaining Issues (0)`);
|
|
137
|
+
parts.push(`\n🎉 All issues have been resolved!\n`);
|
|
138
|
+
}
|
|
139
|
+
// Overall assessment
|
|
140
|
+
parts.push(`\n### 📊 Overall Assessment`);
|
|
141
|
+
if (fixed.length > introduced.length && scoreImprovement > 0) {
|
|
142
|
+
parts.push(`\n✅ **Positive progress!** More issues were fixed than introduced, and the accessibility score improved.`);
|
|
143
|
+
}
|
|
144
|
+
else if (introduced.length > fixed.length) {
|
|
145
|
+
parts.push(`\n⚠️ **Attention needed!** More issues were introduced than fixed. Consider reviewing recent changes.`);
|
|
146
|
+
}
|
|
147
|
+
else if (fixed.length > 0 && introduced.length === 0) {
|
|
148
|
+
parts.push(`\n✅ **Excellent progress!** Issues were fixed without introducing new ones.`);
|
|
149
|
+
}
|
|
150
|
+
else if (fixed.length === 0 && introduced.length === 0 && remaining.length > 0) {
|
|
151
|
+
parts.push(`\n➡️ **No changes.** The accessibility status remains the same.`);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
parts.push(`\n📊 **Status update:** Review the details above for specific changes.`);
|
|
155
|
+
}
|
|
156
|
+
return parts.join('\n');
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* compare_accessibility - Before/after comparison with diff visualization
|
|
160
|
+
*
|
|
161
|
+
* Compares two accessibility audits to identify issues that were fixed,
|
|
162
|
+
* introduced, or remain. Provides score improvement and visual diff summary.
|
|
163
|
+
*
|
|
164
|
+
* @param input - Comparison input (before/after results or URLs, format)
|
|
165
|
+
* @returns Comparison result with fixed, introduced, and remaining issues
|
|
166
|
+
*/
|
|
167
|
+
export async function compareAccessibility(input) {
|
|
168
|
+
const { before, after, format = 'summary', basicAuthUsername, basicAuthPassword, } = input;
|
|
169
|
+
// Get audit results - if strings, run audits first (with optional Basic Auth, same as audit_url)
|
|
170
|
+
let beforeResult;
|
|
171
|
+
let afterResult;
|
|
172
|
+
if (typeof before === 'string') {
|
|
173
|
+
const { urlWithoutAuth, basicAuthUsername: u, basicAuthPassword: p } = resolveBasicAuth(before, basicAuthUsername, basicAuthPassword);
|
|
174
|
+
beforeResult = await auditUrl({ url: urlWithoutAuth, basicAuthUsername: u, basicAuthPassword: p });
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
const normalized = normalizeAuditResult(before);
|
|
178
|
+
beforeResult = normalized ?? before;
|
|
179
|
+
}
|
|
180
|
+
if (typeof after === 'string') {
|
|
181
|
+
const { urlWithoutAuth, basicAuthUsername: u, basicAuthPassword: p } = resolveBasicAuth(after, basicAuthUsername, basicAuthPassword);
|
|
182
|
+
afterResult = await auditUrl({ url: urlWithoutAuth, basicAuthUsername: u, basicAuthPassword: p });
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
const normalized = normalizeAuditResult(after);
|
|
186
|
+
afterResult = normalized ?? after;
|
|
187
|
+
}
|
|
188
|
+
const beforeIssues = Array.isArray(beforeResult?.prioritizedIssues) ? beforeResult.prioritizedIssues : [];
|
|
189
|
+
const afterIssues = Array.isArray(afterResult?.prioritizedIssues) ? afterResult.prioritizedIssues : [];
|
|
190
|
+
// Compare issues
|
|
191
|
+
const { fixed, introduced, remaining } = compareIssues(beforeIssues, afterIssues);
|
|
192
|
+
// Calculate score improvement
|
|
193
|
+
const beforeScore = beforeResult?.summary?.score ?? 0;
|
|
194
|
+
const afterScore = afterResult?.summary?.score ?? 0;
|
|
195
|
+
const scoreImprovement = afterScore - beforeScore;
|
|
196
|
+
// Generate summary based on format
|
|
197
|
+
let summary;
|
|
198
|
+
if (format === 'diff' || format === 'detailed') {
|
|
199
|
+
summary = generateDiffSummary(fixed, introduced, remaining, scoreImprovement);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
// Summary format - concise version
|
|
203
|
+
summary = `Score: ${beforeScore} → ${afterScore} (${scoreImprovement > 0 ? '+' : ''}${scoreImprovement}). `;
|
|
204
|
+
summary += `Fixed: ${fixed.length}, Introduced: ${introduced.length}, Remaining: ${remaining.length}`;
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
issuesFixed: fixed,
|
|
208
|
+
issuesIntroduced: introduced,
|
|
209
|
+
scoreImprovement,
|
|
210
|
+
remainingIssues: remaining,
|
|
211
|
+
summary,
|
|
212
|
+
format,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
// ============================================================================
|
|
216
|
+
// Historical Tracking Implementation
|
|
217
|
+
// ============================================================================
|
|
218
|
+
/**
|
|
219
|
+
* In-memory storage for historical audit data
|
|
220
|
+
* Key: URL, Value: Array of audit results with timestamps
|
|
221
|
+
*/
|
|
222
|
+
const historicalDataStore = new Map();
|
|
223
|
+
/**
|
|
224
|
+
* Calculate days from timeframe string
|
|
225
|
+
*/
|
|
226
|
+
function getDaysFromTimeframe(timeframe) {
|
|
227
|
+
switch (timeframe) {
|
|
228
|
+
case '7d':
|
|
229
|
+
return 7;
|
|
230
|
+
case '30d':
|
|
231
|
+
return 30;
|
|
232
|
+
case '90d':
|
|
233
|
+
return 90;
|
|
234
|
+
case 'all':
|
|
235
|
+
return null; // All data
|
|
236
|
+
default:
|
|
237
|
+
return 30; // Default to 30 days
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Filter historical data by timeframe
|
|
242
|
+
*/
|
|
243
|
+
function filterByTimeframe(data, timeframe) {
|
|
244
|
+
const days = getDaysFromTimeframe(timeframe);
|
|
245
|
+
if (days === null) {
|
|
246
|
+
return data;
|
|
247
|
+
}
|
|
248
|
+
const cutoffDate = new Date();
|
|
249
|
+
cutoffDate.setDate(cutoffDate.getDate() - days);
|
|
250
|
+
return data.filter((entry) => {
|
|
251
|
+
const entryDate = new Date(entry.timestamp);
|
|
252
|
+
return entryDate >= cutoffDate;
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Extract metric value from audit result
|
|
257
|
+
*/
|
|
258
|
+
function extractMetric(result, metric) {
|
|
259
|
+
switch (metric) {
|
|
260
|
+
case 'score':
|
|
261
|
+
return result.summary.score;
|
|
262
|
+
case 'issues':
|
|
263
|
+
return result.summary.totalIssues;
|
|
264
|
+
case 'wcag-compliance':
|
|
265
|
+
// Return average WCAG compliance
|
|
266
|
+
return (result.summary.wcagCompliance.A +
|
|
267
|
+
result.summary.wcagCompliance.AA +
|
|
268
|
+
result.summary.wcagCompliance.AAA) / 3;
|
|
269
|
+
default:
|
|
270
|
+
return result.summary.score;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Calculate trend from data points
|
|
275
|
+
*/
|
|
276
|
+
function calculateTrend(dataPoints) {
|
|
277
|
+
if (dataPoints.length < 2) {
|
|
278
|
+
return 'stable';
|
|
279
|
+
}
|
|
280
|
+
// Sort by timestamp (oldest first)
|
|
281
|
+
const sorted = [...dataPoints].sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
|
|
282
|
+
// Calculate trend based on first and last values
|
|
283
|
+
const firstValue = sorted[0].value;
|
|
284
|
+
const lastValue = sorted[sorted.length - 1].value;
|
|
285
|
+
const difference = lastValue - firstValue;
|
|
286
|
+
const percentChange = (difference / firstValue) * 100;
|
|
287
|
+
// For score and wcag-compliance: higher is better
|
|
288
|
+
// For issues: lower is better
|
|
289
|
+
// We'll determine this based on the metric type in the calling function
|
|
290
|
+
if (Math.abs(percentChange) < 2) {
|
|
291
|
+
return 'stable';
|
|
292
|
+
}
|
|
293
|
+
// For score and wcag-compliance, positive change is improving
|
|
294
|
+
// For issues, negative change is improving
|
|
295
|
+
// Since we don't know the metric here, we'll use a general approach
|
|
296
|
+
// The caller will adjust based on metric type
|
|
297
|
+
return difference > 0 ? 'improving' : 'declining';
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Calculate trend with metric awareness
|
|
301
|
+
*/
|
|
302
|
+
function calculateTrendForMetric(dataPoints, metric) {
|
|
303
|
+
const trend = calculateTrend(dataPoints);
|
|
304
|
+
// For 'issues' metric, lower is better, so reverse the trend
|
|
305
|
+
if (metric === 'issues') {
|
|
306
|
+
if (trend === 'improving')
|
|
307
|
+
return 'declining';
|
|
308
|
+
if (trend === 'declining')
|
|
309
|
+
return 'improving';
|
|
310
|
+
return 'stable';
|
|
311
|
+
}
|
|
312
|
+
// For 'score' and 'wcag-compliance', higher is better
|
|
313
|
+
return trend;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Generate predictions using simple linear regression
|
|
317
|
+
*/
|
|
318
|
+
function generatePrediction(dataPoints) {
|
|
319
|
+
if (dataPoints.length < 3) {
|
|
320
|
+
return undefined; // Need at least 3 points for prediction
|
|
321
|
+
}
|
|
322
|
+
// Sort by timestamp (oldest first)
|
|
323
|
+
const sorted = [...dataPoints].sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
|
|
324
|
+
// Simple linear regression
|
|
325
|
+
const n = sorted.length;
|
|
326
|
+
let sumX = 0;
|
|
327
|
+
let sumY = 0;
|
|
328
|
+
let sumXY = 0;
|
|
329
|
+
let sumX2 = 0;
|
|
330
|
+
sorted.forEach((point, index) => {
|
|
331
|
+
const x = index;
|
|
332
|
+
const y = point.value;
|
|
333
|
+
sumX += x;
|
|
334
|
+
sumY += y;
|
|
335
|
+
sumXY += x * y;
|
|
336
|
+
sumX2 += x * x;
|
|
337
|
+
});
|
|
338
|
+
const slope = (n * sumXY - sumX * sumY) / (n * sumX2 - sumX * sumX);
|
|
339
|
+
const intercept = (sumY - slope * sumX) / n;
|
|
340
|
+
// Predict next value (one step ahead)
|
|
341
|
+
const nextValue = slope * n + intercept;
|
|
342
|
+
// Calculate confidence based on data variance
|
|
343
|
+
const meanY = sumY / n;
|
|
344
|
+
let variance = 0;
|
|
345
|
+
sorted.forEach((point) => {
|
|
346
|
+
variance += Math.pow(point.value - meanY, 2);
|
|
347
|
+
});
|
|
348
|
+
variance /= n;
|
|
349
|
+
const stdDev = Math.sqrt(variance);
|
|
350
|
+
// Confidence decreases with higher variance
|
|
351
|
+
// Max confidence is 0.9 (90%), min is 0.3 (30%)
|
|
352
|
+
const confidence = Math.max(0.3, Math.min(0.9, 1 - (stdDev / (meanY || 1))));
|
|
353
|
+
return {
|
|
354
|
+
nextValue: Math.round(nextValue * 100) / 100,
|
|
355
|
+
confidence: Math.round(confidence * 100) / 100,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Generate recommendations based on trend and data
|
|
360
|
+
*/
|
|
361
|
+
function generateRecommendations(trend, metric, currentValue, dataPoints) {
|
|
362
|
+
const recommendations = [];
|
|
363
|
+
if (trend === 'declining') {
|
|
364
|
+
if (metric === 'score') {
|
|
365
|
+
recommendations.push('Accessibility score is declining. Review recent changes and prioritize fixing critical issues.');
|
|
366
|
+
recommendations.push('Focus on quick wins - issues that are easy to fix but have high impact.');
|
|
367
|
+
}
|
|
368
|
+
else if (metric === 'issues') {
|
|
369
|
+
recommendations.push('Number of accessibility issues is increasing. Audit recent code changes for accessibility regressions.');
|
|
370
|
+
recommendations.push('Consider implementing automated accessibility testing in your CI/CD pipeline.');
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
recommendations.push('WCAG compliance is declining. Review and fix violations, starting with Level A requirements.');
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
else if (trend === 'improving') {
|
|
377
|
+
if (metric === 'score') {
|
|
378
|
+
recommendations.push('Great progress! Continue monitoring and addressing remaining issues.');
|
|
379
|
+
recommendations.push('Consider setting up regular accessibility audits to maintain improvements.');
|
|
380
|
+
}
|
|
381
|
+
else if (metric === 'issues') {
|
|
382
|
+
recommendations.push('Excellent! Issues are decreasing. Keep up the good work!');
|
|
383
|
+
recommendations.push('Focus on preventing new issues by training the team on accessibility best practices.');
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
recommendations.push('WCAG compliance is improving. Continue working toward higher compliance levels.');
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
recommendations.push('Accessibility status is stable. Consider proactive improvements to reach higher standards.');
|
|
391
|
+
recommendations.push('Review remaining issues and prioritize fixes based on impact and user needs.');
|
|
392
|
+
}
|
|
393
|
+
// Add metric-specific recommendations
|
|
394
|
+
if (metric === 'score' && currentValue < 70) {
|
|
395
|
+
recommendations.push('Score is below 70. Prioritize critical and serious issues to improve accessibility significantly.');
|
|
396
|
+
}
|
|
397
|
+
if (metric === 'issues' && currentValue > 20) {
|
|
398
|
+
recommendations.push('High number of issues detected. Consider a systematic approach: fix critical issues first, then work through by category.');
|
|
399
|
+
}
|
|
400
|
+
if (dataPoints.length < 3) {
|
|
401
|
+
recommendations.push('More historical data will improve trend analysis and predictions. Run regular audits to build a baseline.');
|
|
402
|
+
}
|
|
403
|
+
return recommendations;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Generate text-based trend visualization
|
|
407
|
+
*/
|
|
408
|
+
function generateTrendVisualization(dataPoints, metric) {
|
|
409
|
+
if (dataPoints.length === 0) {
|
|
410
|
+
return 'No data available for visualization.';
|
|
411
|
+
}
|
|
412
|
+
// Sort by timestamp
|
|
413
|
+
const sorted = [...dataPoints].sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
|
|
414
|
+
// Find min and max values for scaling
|
|
415
|
+
const values = sorted.map((p) => p.value);
|
|
416
|
+
const minValue = Math.min(...values);
|
|
417
|
+
const maxValue = Math.max(...values);
|
|
418
|
+
const range = maxValue - minValue || 1;
|
|
419
|
+
// Create simple ASCII chart
|
|
420
|
+
const lines = [];
|
|
421
|
+
lines.push(`\nTrend Visualization (${metric}):`);
|
|
422
|
+
lines.push('');
|
|
423
|
+
// Use 20 characters width for the chart
|
|
424
|
+
const chartWidth = 20;
|
|
425
|
+
sorted.forEach((point) => {
|
|
426
|
+
const date = new Date(point.timestamp);
|
|
427
|
+
const dateStr = date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
|
|
428
|
+
const normalizedValue = (point.value - minValue) / range;
|
|
429
|
+
const barLength = Math.round(normalizedValue * chartWidth);
|
|
430
|
+
const bar = '█'.repeat(barLength) + '░'.repeat(chartWidth - barLength);
|
|
431
|
+
lines.push(`${dateStr.padEnd(12)} │${bar} ${point.value.toFixed(1)}`);
|
|
432
|
+
});
|
|
433
|
+
return lines.join('\n');
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* track_accessibility - Historical tracking with trend analysis
|
|
437
|
+
*
|
|
438
|
+
* Tracks accessibility metrics over time, providing trend analysis,
|
|
439
|
+
* predictions, and recommendations. Stores audit results in memory for
|
|
440
|
+
* historical comparison.
|
|
441
|
+
*
|
|
442
|
+
* @param input - Tracking input (URL, timeframe, metric)
|
|
443
|
+
* @returns Tracking result with historical data, trends, and recommendations
|
|
444
|
+
*/
|
|
445
|
+
export async function trackAccessibility(input) {
|
|
446
|
+
const { url, timeframe = '30d', metric = 'score', basicAuthUsername, basicAuthPassword, } = input;
|
|
447
|
+
const { urlWithoutAuth, basicAuthUsername: u, basicAuthPassword: p } = resolveBasicAuth(url, basicAuthUsername, basicAuthPassword);
|
|
448
|
+
// Run current audit (with optional Basic Auth, same as audit_url)
|
|
449
|
+
const currentResult = await auditUrl({ url: urlWithoutAuth, basicAuthUsername: u, basicAuthPassword: p });
|
|
450
|
+
// Get current metric value
|
|
451
|
+
const currentValue = extractMetric(currentResult, metric);
|
|
452
|
+
// Store in historical data (key by urlWithoutAuth for consistency)
|
|
453
|
+
if (!historicalDataStore.has(urlWithoutAuth)) {
|
|
454
|
+
historicalDataStore.set(urlWithoutAuth, []);
|
|
455
|
+
}
|
|
456
|
+
const historicalData = historicalDataStore.get(urlWithoutAuth);
|
|
457
|
+
// Add current result
|
|
458
|
+
historicalData.push({
|
|
459
|
+
timestamp: currentResult.metadata?.timestamp || new Date().toISOString(),
|
|
460
|
+
result: currentResult,
|
|
461
|
+
});
|
|
462
|
+
// Filter by timeframe
|
|
463
|
+
const filteredData = filterByTimeframe(historicalData, timeframe);
|
|
464
|
+
// Extract metric values as trend data points
|
|
465
|
+
const dataPoints = filteredData.map((entry) => ({
|
|
466
|
+
timestamp: entry.timestamp,
|
|
467
|
+
value: extractMetric(entry.result, metric),
|
|
468
|
+
metadata: {
|
|
469
|
+
totalIssues: entry.result.summary.totalIssues,
|
|
470
|
+
score: entry.result.summary.score,
|
|
471
|
+
},
|
|
472
|
+
}));
|
|
473
|
+
// Calculate trend
|
|
474
|
+
const trend = calculateTrendForMetric(dataPoints, metric);
|
|
475
|
+
// Generate prediction
|
|
476
|
+
const prediction = generatePrediction(dataPoints);
|
|
477
|
+
// Generate recommendations
|
|
478
|
+
const recommendations = generateRecommendations(trend, metric, currentValue, dataPoints);
|
|
479
|
+
// Generate trend visualization
|
|
480
|
+
const visualization = generateTrendVisualization(dataPoints, metric);
|
|
481
|
+
// Create trend data
|
|
482
|
+
const trendData = {
|
|
483
|
+
dataPoints,
|
|
484
|
+
trend,
|
|
485
|
+
prediction,
|
|
486
|
+
recommendations,
|
|
487
|
+
visualization,
|
|
488
|
+
};
|
|
489
|
+
return {
|
|
490
|
+
url: urlWithoutAuth,
|
|
491
|
+
historicalData: trendData,
|
|
492
|
+
currentValue,
|
|
493
|
+
trend,
|
|
494
|
+
predictions: prediction,
|
|
495
|
+
recommendations,
|
|
496
|
+
visualization,
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
//# sourceMappingURL=comparison.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../src/tools/comparison.ts"],"names":[],"mappings":"AAAA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AE,EAAE,CAAC,CAAC;QAChE,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC;QAC1C,QAAQ,EAAE;YACR,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW;YAC7C,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK;SAClC;KACF,CAAC,CAAC,CAAA;IAEH,kBAAkB;IAClB,MAAM,KAAK,GAAG,uBAAuB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IAEzD,sBAAsB;IACtB,MAAM,UAAU,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAA;IAEjD,2BAA2B;IAC3B,MAAM,eAAe,GAAG,uBAAuB,CAC7C,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,CACX,CAAA;IAED,+BAA+B;IAC/B,MAAM,aAAa,GAAG,0BAA0B,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IAEpE,oBAAoB;IACpB,MAAM,SAAS,GAAc;QAC3B,UAAU;QACV,KAAK;QACL,UAAU;QACV,eAAe;QACf,aAAa;KACd,CAAA;IAED,OAAO;QACL,GAAG,EAAE,cAAc;QACnB,cAAc,EAAE,SAAS;QACzB,YAAY;QACZ,KAAK;QACL,WAAW,EAAE,UAAU;QACvB,eAAe;QACf,aAAa;KACd,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export tools for audit results
|
|
3
|
+
* Implements: export_to_csv, export_to_excel, export_to_json, export_to_html_report
|
|
4
|
+
*/
|
|
5
|
+
import type { ExportToCsvInput, ExportToCsvResult, ExportToExcelInput, ExportToExcelResult, ExportToJsonInput, ExportToJsonResult, ExportToHtmlInput, ExportToHtmlResult } from '../types/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* export_to_csv - Export audit results to CSV format
|
|
8
|
+
*
|
|
9
|
+
* Exports audit results to CSV format for spreadsheet analysis, including
|
|
10
|
+
* metadata section and detailed violation rows.
|
|
11
|
+
*
|
|
12
|
+
* @param input - Export configuration
|
|
13
|
+
* @returns CSV content as string
|
|
14
|
+
*/
|
|
15
|
+
export declare function exportToCsv(input: ExportToCsvInput): Promise<ExportToCsvResult>;
|
|
16
|
+
/**
|
|
17
|
+
* export_to_excel - Export audit results to Excel/XLSX format
|
|
18
|
+
*
|
|
19
|
+
* Exports audit results to Excel format with formatting. Requires xlsx package.
|
|
20
|
+
*
|
|
21
|
+
* @param input - Export configuration
|
|
22
|
+
* @returns Excel file content (base64 encoded)
|
|
23
|
+
*/
|
|
24
|
+
export declare function exportToExcel(input: ExportToExcelInput): Promise<ExportToExcelResult>;
|
|
25
|
+
/**
|
|
26
|
+
* export_to_json - Export audit results as structured JSON
|
|
27
|
+
*
|
|
28
|
+
* Exports audit results as structured JSON with optional raw results.
|
|
29
|
+
*
|
|
30
|
+
* @param input - Export configuration
|
|
31
|
+
* @returns JSON string
|
|
32
|
+
*/
|
|
33
|
+
export declare function exportToJson(input: ExportToJsonInput): Promise<ExportToJsonResult>;
|
|
34
|
+
/**
|
|
35
|
+
* export_to_html_report - Generate standalone HTML report
|
|
36
|
+
*
|
|
37
|
+
* Generates a standalone HTML report with styling and optional charts.
|
|
38
|
+
*
|
|
39
|
+
* @param input - Export configuration
|
|
40
|
+
* @returns HTML string with embedded CSS/JS
|
|
41
|
+
*/
|
|
42
|
+
export declare function exportToHtmlReport(input: ExportToHtmlInput): Promise<ExportToHtmlResult>;
|
|
43
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/tools/export.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAEV,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AA2D1B;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,iBAAiB,CAAC,CAkI5B;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CA6I9B;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,kBAAkB,CAAC,CAkD7B;AA8ZD;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,kBAAkB,CAAC,CAgC7B"}
|