@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,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared HTTP Basic Auth utilities for tools that use URLs.
|
|
3
|
+
* Use when auditing or fetching URLs that require Basic Authentication.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Parse Basic Auth credentials from URL if present (e.g. https://user:password@host/path).
|
|
7
|
+
* Returns URL with credentials stripped and optional username/password.
|
|
8
|
+
*/
|
|
9
|
+
export function parseUrlCredentials(url) {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = new URL(url);
|
|
12
|
+
if (parsed.username || parsed.password) {
|
|
13
|
+
const username = decodeURIComponent(parsed.username);
|
|
14
|
+
const password = decodeURIComponent(parsed.password);
|
|
15
|
+
parsed.username = '';
|
|
16
|
+
parsed.password = '';
|
|
17
|
+
return { urlWithoutAuth: parsed.toString(), username, password };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// ignore invalid URL
|
|
22
|
+
}
|
|
23
|
+
return { urlWithoutAuth: url };
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build the Authorization header value for HTTP Basic Auth.
|
|
27
|
+
* Returns "Basic <base64(user:password)>" or null if either credential is missing.
|
|
28
|
+
*/
|
|
29
|
+
export function getBasicAuthHeader(username, password) {
|
|
30
|
+
if (username == null || password == null)
|
|
31
|
+
return null;
|
|
32
|
+
const encoded = Buffer.from(`${username}:${password}`, 'utf8').toString('base64');
|
|
33
|
+
return `Basic ${encoded}`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve URL and Basic Auth from a URL (possibly with user:password@host) and optional
|
|
37
|
+
* explicit username/password. Explicit params override credentials embedded in the URL.
|
|
38
|
+
* Returns normalized URL without auth and credentials suitable for passing to auditUrl etc.
|
|
39
|
+
*/
|
|
40
|
+
export function resolveBasicAuth(url, explicitUsername, explicitPassword) {
|
|
41
|
+
const parsed = parseUrlCredentials(url);
|
|
42
|
+
const basicAuthUsername = explicitUsername ?? parsed.username;
|
|
43
|
+
const basicAuthPassword = explicitPassword ?? parsed.password;
|
|
44
|
+
const basicAuthHeader = getBasicAuthHeader(basicAuthUsername, basicAuthPassword);
|
|
45
|
+
return {
|
|
46
|
+
urlWithoutAuth: parsed.urlWithoutAuth,
|
|
47
|
+
basicAuthUsername,
|
|
48
|
+
basicA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gBAAgB,CAC9B,GAAW,EACX,gBAAyB,EACzB,gBAAyB;IAOzB,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAA;IACvC,MAAM,iBAAiB,GAAG,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAA;IAC7D,MAAM,iBAAiB,GAAG,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAA;IAC7D,MAAM,eAAe,GAAG,kBAAkB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;IAChF,OAAO;QACL,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,iBAAiB;QACjB,iBAAiB;QACjB,eAAe;KAChB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP server configuration from environment variables.
|
|
3
|
+
* Compatible with joe-watkins/accessibility-testing-mcp style config.
|
|
4
|
+
*
|
|
5
|
+
* Configure via MCP config "env" section, e.g.:
|
|
6
|
+
* "env": {
|
|
7
|
+
* "A11Y_ENGINE": "axe",
|
|
8
|
+
* "WCAG_LEVEL": "2.2_AA",
|
|
9
|
+
* "BEST_PRACTICES": "true",
|
|
10
|
+
* "SCREEN_SIZES": "1280x1024,320x640",
|
|
11
|
+
* "HEADLESS_BROWSER": "true"
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export type WcagLevel = '2.0_A' | '2.0_AA' | '2.0_AAA' | '2.1_A' | '2.1_AA' | '2.1_AAA' | '2.2_A' | '2.2_AA' | '2.2_AAA';
|
|
15
|
+
export type A11yEngine = 'axe' | 'ace';
|
|
16
|
+
export interface ScreenSize {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
label: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ServerConfig {
|
|
22
|
+
engine: A11yEngine;
|
|
23
|
+
wcagLevel: WcagLevel;
|
|
24
|
+
includeBestPractices: boolean;
|
|
25
|
+
screenSizes: ScreenSize[];
|
|
26
|
+
headless: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Reset config cache (for testing only). */
|
|
29
|
+
export declare function __resetConfigCache(): void;
|
|
30
|
+
export declare function loadConfig(): ServerConfig;
|
|
31
|
+
/**
|
|
32
|
+
* Get the current server config (loads from env if not yet loaded).
|
|
33
|
+
*/
|
|
34
|
+
export declare function getConfig(): ServerConfig;
|
|
35
|
+
/**
|
|
36
|
+
* Get axe-core tags for the configured WCAG level and best-practices setting.
|
|
37
|
+
* Used when the tool input does not specify tags.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getAxeTagsFromConfig(): string[];
|
|
40
|
+
/**
|
|
41
|
+
* Get ACE policy name for the configured WCAG level (for accessibility-checker).
|
|
42
|
+
*/
|
|
43
|
+
export declare function getAcePolicyFromConfig(): string;
|
|
44
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,QAAQ,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,SAAS,CAAA;AAEb,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,CAAA;AAEtC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAyDD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,UAAU,CAAA;IAClB,SAAS,EAAE,SAAS,CAAA;IACpB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAgED,6CAA6C;AAC7C,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,wBAAgB,UAAU,IAAI,YAAY,CAoBzC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,YAAY,CAExC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAO/C;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP server configuration from environment variables.
|
|
3
|
+
* Compatible with joe-watkins/accessibility-testing-mcp style config.
|
|
4
|
+
*
|
|
5
|
+
* Configure via MCP config "env" section, e.g.:
|
|
6
|
+
* "env": {
|
|
7
|
+
* "A11Y_ENGINE": "axe",
|
|
8
|
+
* "WCAG_LEVEL": "2.2_AA",
|
|
9
|
+
* "BEST_PRACTICES": "true",
|
|
10
|
+
* "SCREEN_SIZES": "1280x1024,320x640",
|
|
11
|
+
* "HEADLESS_BROWSER": "true"
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
/** Mapping from WCAG level to axe-core tags (and ACE policy for future use) */
|
|
15
|
+
const WCAG_LEVEL_MAP = {
|
|
16
|
+
'2.0_A': { axeTags: ['wcag2a'], acePolicy: 'WCAG_2_0' },
|
|
17
|
+
'2.0_AA': { axeTags: ['wcag2a', 'wcag2aa'], acePolicy: 'WCAG_2_0' },
|
|
18
|
+
'2.0_AAA': {
|
|
19
|
+
axeTags: ['wcag2a', 'wcag2aa', 'wcag2aaa'],
|
|
20
|
+
acePolicy: 'WCAG_2_0',
|
|
21
|
+
},
|
|
22
|
+
'2.1_A': { axeTags: ['wcag2a', 'wcag21a'], acePolicy: 'WCAG_2_1' },
|
|
23
|
+
'2.1_AA': {
|
|
24
|
+
axeTags: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'],
|
|
25
|
+
acePolicy: 'WCAG_2_1',
|
|
26
|
+
},
|
|
27
|
+
'2.1_AAA': {
|
|
28
|
+
axeTags: [
|
|
29
|
+
'wcag2a',
|
|
30
|
+
'wcag2aa',
|
|
31
|
+
'wcag2aaa',
|
|
32
|
+
'wcag21a',
|
|
33
|
+
'wcag21aa',
|
|
34
|
+
'wcag21aaa',
|
|
35
|
+
],
|
|
36
|
+
acePolicy: 'WCAG_2_1',
|
|
37
|
+
},
|
|
38
|
+
'2.2_A': { axeTags: ['wcag2a', 'wcag21a', 'wcag22a'], acePolicy: 'WCAG_2_2' },
|
|
39
|
+
'2.2_AA': {
|
|
40
|
+
axeTags: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22a', 'wcag22aa'],
|
|
41
|
+
acePolicy: 'WCAG_2_2',
|
|
42
|
+
},
|
|
43
|
+
'2.2_AAA': {
|
|
44
|
+
axeTags: [
|
|
45
|
+
'wcag2a',
|
|
46
|
+
'wcag2aa',
|
|
47
|
+
'wcag2aaa',
|
|
48
|
+
'wcag21a',
|
|
49
|
+
'wcag21aa',
|
|
50
|
+
'wcag21aaa',
|
|
51
|
+
'wcag22a',
|
|
52
|
+
'wcag22aa',
|
|
53
|
+
'wcag22aaa',
|
|
54
|
+
],
|
|
55
|
+
acePolicy: 'WCAG_2_2',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
const DEFAULT_ENGINE = 'ace';
|
|
59
|
+
const DEFAULT_WCAG_LEVEL = '2.2_AA';
|
|
60
|
+
const DEFAULT_BEST_PRACTICES = true;
|
|
61
|
+
const DEFAULT_SCREEN_SIZES = [
|
|
62
|
+
{ width: 1280, height: 1024, label: '1280x1024' },
|
|
63
|
+
];
|
|
64
|
+
function parseWcagLevel(input) {
|
|
65
|
+
if (!input)
|
|
66
|
+
return DEFAULT_WCAG_LEVEL;
|
|
67
|
+
const normalized = input
|
|
68
|
+
.trim()
|
|
69
|
+
.toLowerCase()
|
|
70
|
+
.replace(/wcag\s*/gi, '')
|
|
71
|
+
.replace(/\s+/g, '_')
|
|
72
|
+
.replace(/level\s*/gi, '')
|
|
73
|
+
.replace(/_+/g, '_');
|
|
74
|
+
const match = normalized.match(/^(\d)\.?(\d)?[_\s]*(a{1,3})$/i);
|
|
75
|
+
if (match) {
|
|
76
|
+
const major = match[1];
|
|
77
|
+
const minor = match[2] ?? '0';
|
|
78
|
+
const level = match[3].toUpperCase();
|
|
79
|
+
const key = `${major}.${minor}_${level}`;
|
|
80
|
+
if (key in WCAG_LEVEL_MAP)
|
|
81
|
+
return key;
|
|
82
|
+
}
|
|
83
|
+
const directKey = input.trim();
|
|
84
|
+
if (directKey in WCAG_LEVEL_MAP)
|
|
85
|
+
return directKey;
|
|
86
|
+
console.error(`Invalid WCAG_LEVEL "${input}", using default "${DEFAULT_WCAG_LEVEL}"`);
|
|
87
|
+
return DEFAULT_WCAG_LEVEL;
|
|
88
|
+
}
|
|
89
|
+
function parseScreenSizes(input) {
|
|
90
|
+
if (!input)
|
|
91
|
+
return DEFAULT_SCREEN_SIZES;
|
|
92
|
+
const sizes = [];
|
|
93
|
+
const parts = input
|
|
94
|
+
.split(',')
|
|
95
|
+
.map((s) => s.trim())
|
|
96
|
+
.filter((s) => s.length > 0);
|
|
97
|
+
for (const part of parts) {
|
|
98
|
+
const match = part.match(/^(\d+)x(\d+)$/i);
|
|
99
|
+
if (match) {
|
|
100
|
+
sizes.push({
|
|
101
|
+
width: parseInt(match[1], 10),
|
|
102
|
+
height: parseInt(match[2], 10),
|
|
103
|
+
label: part,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
console.error(`Invalid screen size format "${part}", expected "WIDTHxHEIGHT"`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return sizes.length > 0 ? sizes : DEFAULT_SCREEN_SIZES;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Load configuration from environment variables.
|
|
114
|
+
* Call once at startup; result is cached.
|
|
115
|
+
*/
|
|
116
|
+
let cachedConfig = null;
|
|
117
|
+
/** Reset config cache (for testing only). */
|
|
118
|
+
export function __resetConfigCache() {
|
|
119
|
+
cachedConfig = null;
|
|
120
|
+
}
|
|
121
|
+
export function loadConfig() {
|
|
122
|
+
if (cachedConfig)
|
|
123
|
+
return cachedConfig;
|
|
124
|
+
const engine = process.env.A11Y_ENGINE?.toLowerCase() || DEFAULT_ENGINE;
|
|
125
|
+
const wcagLevel = parseWcagLevel(process.env.WCAG_LEVEL);
|
|
126
|
+
const includeBestPractices = process.env.BEST_PRACTICES !== 'false' && DEFAULT_BEST_PRACTICES;
|
|
127
|
+
const screenSizes = parseScreenSizes(process.env.SCREEN_SIZES);
|
|
128
|
+
// Default: headless=true (no browser window); set HEADLESS_BROWSER=false to show
|
|
129
|
+
const headless = process.env.HEADLESS_BROWSER !== 'false';
|
|
130
|
+
cachedConfig = {
|
|
131
|
+
engine: engine === 'ace' ? 'ace' : 'axe',
|
|
132
|
+
wcagLevel,
|
|
133
|
+
includeBestPractices,
|
|
134
|
+
screenSizes,
|
|
135
|
+
headless,
|
|
136
|
+
};
|
|
137
|
+
return cachedConfig;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get the current server config (loads from env if not yet loaded).
|
|
141
|
+
*/
|
|
142
|
+
export function getConfig() {
|
|
143
|
+
return loadConfig();
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get axe-core tags for the configured WCAG level and best-practices setting.
|
|
147
|
+
* Used when the tool input does not specify tags.
|
|
148
|
+
*/
|
|
149
|
+
export function getAxeTagsFromConfig() {
|
|
150
|
+
const config = getConfig();
|
|
151
|
+
const tags = [...WCAG_LEVEL_MAP[config.wcagLevel].axeTags];
|
|
152
|
+
if (config.includeBestPractices) {
|
|
153
|
+
tags.push('best-practice');
|
|
154
|
+
}
|
|
155
|
+
return tags;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get ACE policy name for the configured WCAG level (for accessibility-checker).
|
|
159
|
+
*/
|
|
160
|
+
export function getAcePolicyFromConfig() {
|
|
161
|
+
return WCAG_LEVEL_MAP[getConfig().wcagLevel].acePolicy;
|
|
162
|
+
}
|
|
163
|
+
//# sourceMapp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CAAA;IAC1E,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACxD,MAAM,oBAAoB,GACxB,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,OAAO,IAAI,sBAAsB,CAAA;IAClE,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9D,iFAAiF;IACjF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,OAAO,CAAA;IAEzD,YAAY,GAAG;QACb,MAAM,EAAE,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;QACxC,SAAS;QACT,oBAAoB;QACpB,WAAW;QACX,QAAQ;KACT,CAAA;IACD,OAAO,YAAY,CAAA;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,EAAE,CAAA;AACrB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,IAAI,GAAG,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAA;IAC1D,IAAI,MAAM,CAAC,oBAAoB,EAAE,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAC5B,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,cAAc,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,SAAS,CAAA;AACxD,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Handler - Comprehensive error handling with retry logic and graceful degradation
|
|
3
|
+
* Provides utilities for handling errors throughout the accessibility audit system
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Error categories for better error handling
|
|
7
|
+
*/
|
|
8
|
+
export declare enum ErrorCategory {
|
|
9
|
+
NETWORK = "network",
|
|
10
|
+
TIMEOUT = "timeout",
|
|
11
|
+
VALIDATION = "validation",
|
|
12
|
+
BROWSER = "browser",
|
|
13
|
+
ACCESSIBILITY = "accessibility",
|
|
14
|
+
SESSION = "session",
|
|
15
|
+
UNKNOWN = "unknown"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Error with category and retry information
|
|
19
|
+
*/
|
|
20
|
+
export interface CategorizedError extends Error {
|
|
21
|
+
category: ErrorCategory;
|
|
22
|
+
retryable: boolean;
|
|
23
|
+
retryCount?: number;
|
|
24
|
+
originalError?: Error;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Retry configuration
|
|
28
|
+
*/
|
|
29
|
+
export interface RetryConfig {
|
|
30
|
+
maxRetries: number;
|
|
31
|
+
initialDelay: number;
|
|
32
|
+
maxDelay: number;
|
|
33
|
+
backoffMultiplier: number;
|
|
34
|
+
retryableErrors?: ErrorCategory[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Convert any thrown value to a readable string for logging/MCP.
|
|
38
|
+
* Avoids "[object Object]" when error is a plain object (e.g. from Playwright or reject(obj)).
|
|
39
|
+
*/
|
|
40
|
+
export declare function toErrorMessage(error: unknown): string;
|
|
41
|
+
/**
|
|
42
|
+
* Categorize an error based on its message and type
|
|
43
|
+
*/
|
|
44
|
+
export declare function categorizeError(error: unknown): CategorizedError;
|
|
45
|
+
/**
|
|
46
|
+
* Retry a function with exponential backoff
|
|
47
|
+
*/
|
|
48
|
+
export declare function retryWithBackoff<T>(fn: () => Promise<T>, config?: Partial<RetryConfig>): Promise<T>;
|
|
49
|
+
/**
|
|
50
|
+
* Format error message for user-friendly display
|
|
51
|
+
*/
|
|
52
|
+
export declare function formatErrorMessage(error: unknown, context?: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Handle errors gracefully and return a user-friendly error object
|
|
55
|
+
*/
|
|
56
|
+
export declare function handleErrorGracefully(error: unknown, context?: string): {
|
|
57
|
+
error: string;
|
|
58
|
+
category: ErrorCategory;
|
|
59
|
+
retryable: boolean;
|
|
60
|
+
suggestion?: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Check if an error is transient (can be retried)
|
|
64
|
+
*/
|
|
65
|
+
export declare function isTransientError(error: unknown): boolean;
|
|
66
|
+
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/core/error-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,KAAK;IAC7C,QAAQ,EAAE,aAAa,CAAA;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,KAAK,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,aAAa,EAAE,CAAA;CAClC;AAiBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA2BrD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAoHhE;AAyBD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAChC,OAAO,CAAC,CAAC,CAAC,CAoCZ;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAwCR;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,MAAM,GACf;IACD,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,aAAa,CAAA;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAuBA;AAwBD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGxD"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Handler - Comprehensive error handling with retry logic and graceful degradation
|
|
3
|
+
* Provides utilities for handling errors throughout the accessibility audit system
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Error categories for better error handling
|
|
7
|
+
*/
|
|
8
|
+
export var ErrorCategory;
|
|
9
|
+
(function (ErrorCategory) {
|
|
10
|
+
ErrorCategory["NETWORK"] = "network";
|
|
11
|
+
ErrorCategory["TIMEOUT"] = "timeout";
|
|
12
|
+
ErrorCategory["VALIDATION"] = "validation";
|
|
13
|
+
ErrorCategory["BROWSER"] = "browser";
|
|
14
|
+
ErrorCategory["ACCESSIBILITY"] = "accessibility";
|
|
15
|
+
ErrorCategory["SESSION"] = "session";
|
|
16
|
+
ErrorCategory["UNKNOWN"] = "unknown";
|
|
17
|
+
})(ErrorCategory || (ErrorCategory = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Default retry configuration
|
|
20
|
+
*/
|
|
21
|
+
const DEFAULT_RETRY_CONFIG = {
|
|
22
|
+
maxRetries: 3,
|
|
23
|
+
initialDelay: 1000, // 1 second
|
|
24
|
+
maxDelay: 10000, // 10 seconds
|
|
25
|
+
backoffMultiplier: 2,
|
|
26
|
+
retryableErrors: [
|
|
27
|
+
ErrorCategory.NETWORK,
|
|
28
|
+
ErrorCategory.TIMEOUT,
|
|
29
|
+
ErrorCategory.BROWSER,
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Convert any thrown value to a readable string for logging/MCP.
|
|
34
|
+
* Avoids "[object Object]" when error is a plain object (e.g. from Playwright or reject(obj)).
|
|
35
|
+
*/
|
|
36
|
+
export function toErrorMessage(error) {
|
|
37
|
+
if (error === null)
|
|
38
|
+
return 'null';
|
|
39
|
+
if (error === undefined)
|
|
40
|
+
return 'undefined';
|
|
41
|
+
if (error instanceof Error) {
|
|
42
|
+
return error.message || error.name || String(error);
|
|
43
|
+
}
|
|
44
|
+
if (typeof error === 'object') {
|
|
45
|
+
const obj = error;
|
|
46
|
+
const msg = typeof obj.message === 'string'
|
|
47
|
+
? obj.message
|
|
48
|
+
: typeof obj.msg === 'string'
|
|
49
|
+
? obj.msg
|
|
50
|
+
: typeof obj.error === 'string'
|
|
51
|
+
? obj.error
|
|
52
|
+
: typeof obj.reason === 'string'
|
|
53
|
+
? obj.reason
|
|
54
|
+
: null;
|
|
55
|
+
if (msg)
|
|
56
|
+
return msg;
|
|
57
|
+
try {
|
|
58
|
+
const json = JSON.stringify(error);
|
|
59
|
+
return json.length > 500 ? json.slice(0, 497) + '...' : json;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return Object.prototype.toString.call(error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return String(error);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Categorize an error based on its message and type
|
|
69
|
+
*/
|
|
70
|
+
export function categorizeError(error) {
|
|
71
|
+
const errorMessage = toErrorMessage(error);
|
|
72
|
+
const errorStack = error instanceof Error ? error.stack : undefined;
|
|
73
|
+
// Network errors
|
|
74
|
+
if (errorMessage.includes('net::') ||
|
|
75
|
+
errorMessage.includes('ECONNREFUSED') ||
|
|
76
|
+
errorMessage.includes('ENOTFOUND') ||
|
|
77
|
+
errorMessage.includes('ETIMEDOUT') ||
|
|
78
|
+
errorMessage.includes('network') ||
|
|
79
|
+
errorMessage.includes('fetch')) {
|
|
80
|
+
return {
|
|
81
|
+
name: 'NetworkError',
|
|
82
|
+
message: `Network error: ${errorMessage}`,
|
|
83
|
+
category: ErrorCategory.NETWORK,
|
|
84
|
+
retryable: true,
|
|
85
|
+
originalError: error instanceof Error ? error : undefined,
|
|
86
|
+
stack: errorStack,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
// Timeout errors
|
|
90
|
+
if (errorMessage.includes('timeout') ||
|
|
91
|
+
errorMessage.includes('Timeout') ||
|
|
92
|
+
errorMessage.includes('Navigation timeout') ||
|
|
93
|
+
errorMessage.includes('waiting for')) {
|
|
94
|
+
return {
|
|
95
|
+
name: 'TimeoutError',
|
|
96
|
+
message: `Operation timed out: ${errorMessage}`,
|
|
97
|
+
category: ErrorCategory.TIMEOUT,
|
|
98
|
+
retryable: true,
|
|
99
|
+
originalError: error instanceof Error ? error : undefined,
|
|
100
|
+
stack: errorStack,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// Browser errors
|
|
104
|
+
if (errorMessage.includes('browser') ||
|
|
105
|
+
errorMessage.includes('Browser') ||
|
|
106
|
+
errorMessage.includes('page') ||
|
|
107
|
+
errorMessage.includes('context') ||
|
|
108
|
+
errorMessage.includes('Target closed')) {
|
|
109
|
+
return {
|
|
110
|
+
name: 'BrowserError',
|
|
111
|
+
message: `Browser error: ${errorMessage}`,
|
|
112
|
+
category: ErrorCategory.BROWSER,
|
|
113
|
+
retryable: true,
|
|
114
|
+
originalError: error instanceof Error ? error : undefined,
|
|
115
|
+
stack: errorStack,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
// Accessibility errors
|
|
119
|
+
if (errorMessage.includes('accessibility') ||
|
|
120
|
+
errorMessage.includes('Accessibility')) {
|
|
121
|
+
return {
|
|
122
|
+
name: 'AccessibilityError',
|
|
123
|
+
message: `Accessibility analysis error: ${errorMessage}`,
|
|
124
|
+
category: ErrorCategory.ACCESSIBILITY,
|
|
125
|
+
retryable: true,
|
|
126
|
+
originalError: error instanceof Error ? error : undefined,
|
|
127
|
+
stack: errorStack,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
// Session errors
|
|
131
|
+
if (errorMessage.includes('session') ||
|
|
132
|
+
errorMessage.includes('Session') ||
|
|
133
|
+
errorMessage.includes('authentication') ||
|
|
134
|
+
errorMessage.includes('login')) {
|
|
135
|
+
return {
|
|
136
|
+
name: 'SessionError',
|
|
137
|
+
message: `Session error: ${errorMessage}`,
|
|
138
|
+
category: ErrorCategory.SESSION,
|
|
139
|
+
retryable: false, // Session errors usually shouldn't be retried
|
|
140
|
+
originalError: error instanceof Error ? error : undefined,
|
|
141
|
+
stack: errorStack,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
// Validation errors
|
|
145
|
+
if (errorMessage.includes('required') ||
|
|
146
|
+
errorMessage.includes('invalid') ||
|
|
147
|
+
errorMessage.includes('must be') ||
|
|
148
|
+
errorMessage.includes('Validation')) {
|
|
149
|
+
return {
|
|
150
|
+
name: 'ValidationError',
|
|
151
|
+
message: `Validation error: ${errorMessage}`,
|
|
152
|
+
category: ErrorCategory.VALIDATION,
|
|
153
|
+
retryable: false, // Validation errors shouldn't be retried
|
|
154
|
+
originalError: error instanceof Error ? error : undefined,
|
|
155
|
+
stack: errorStack,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
// Unknown error
|
|
159
|
+
return {
|
|
160
|
+
name: 'UnknownError',
|
|
161
|
+
message: `Unexpected error: ${errorMessage}`,
|
|
162
|
+
category: ErrorCategory.UNKNOWN,
|
|
163
|
+
retryable: false,
|
|
164
|
+
originalError: error instanceof Error ? error : undefined,
|
|
165
|
+
stack: errorStack,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Sleep utility for retry delays
|
|
170
|
+
*/
|
|
171
|
+
function sleep(ms) {
|
|
172
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Calculate delay for retry attempt with exponential backoff
|
|
176
|
+
*/
|
|
177
|
+
function calculateRetryDelay(attempt, config) {
|
|
178
|
+
const delay = Math.min(config.initialDelay * Math.pow(config.backoffMultiplier, attempt), config.maxDelay);
|
|
179
|
+
// Add jitter to prevent thundering herd
|
|
180
|
+
const jitter = Math.random() * 0.3 * delay;
|
|
181
|
+
return Math.round(delay + jitter);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Retry a function with exponential backoff
|
|
185
|
+
*/
|
|
186
|
+
export async function retryWithBackoff(fn, config = {}) {
|
|
187
|
+
const retryConfig = { ...DEFAULT_RETRY_CONFIG, ...config };
|
|
188
|
+
let lastError;
|
|
189
|
+
for (let attempt = 0; attempt <= retryConfig.maxRetries; attempt++) {
|
|
190
|
+
try {
|
|
191
|
+
return await fn();
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
const categorizedError = categorizeError(error);
|
|
195
|
+
lastError = categorizedError;
|
|
196
|
+
// Check if error is retryable
|
|
197
|
+
const isRetryable = categorizedError.retryable &&
|
|
198
|
+
(retryConfig.retryableErrors?.includes(categorizedError.category) ??
|
|
199
|
+
true);
|
|
200
|
+
// If not retryable or max retries reached, throw
|
|
201
|
+
if (!isRetryable || attempt >= retryConfig.maxRetries) {
|
|
202
|
+
throw categorizedError;
|
|
203
|
+
}
|
|
204
|
+
// Calculate delay and wait
|
|
205
|
+
const delay = calculateRetryDelay(attempt, retryConfig);
|
|
206
|
+
categorizedError.retryCount = attempt + 1;
|
|
207
|
+
console.log(`Retry attempt ${attempt + 1}/${retryConfig.maxRetries} after ${delay}ms: ${categorizedError.message}`);
|
|
208
|
+
await sleep(delay);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// This should never be reached, but TypeScript needs it
|
|
212
|
+
throw lastError || new Error('Retry failed');
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Format error message for user-friendly display
|
|
216
|
+
*/
|
|
217
|
+
export function formatErrorMessage(error, context) {
|
|
218
|
+
const categorizedError = categorizeError(error);
|
|
219
|
+
const contextPrefix = context ? `[${context}] ` : '';
|
|
220
|
+
// Build user-friendly message
|
|
221
|
+
let message = `${contextPrefix}${categorizedError.message}`;
|
|
222
|
+
// Add retry information if applicable
|
|
223
|
+
if (categorizedError.retryCount) {
|
|
224
|
+
message += ` (retried ${categorizedError.retryCount} time(s))`;
|
|
225
|
+
}
|
|
226
|
+
// Add suggestions based on error category
|
|
227
|
+
switch (categorizedError.category) {
|
|
228
|
+
case ErrorCategory.NETWORK:
|
|
229
|
+
message +=
|
|
230
|
+
'\n\nSuggestion: Check your internet connection and ensure the URL is accessible.';
|
|
231
|
+
break;
|
|
232
|
+
case ErrorCategory.TIMEOUT:
|
|
233
|
+
message +=
|
|
234
|
+
'\n\nSuggestion: The page may be loading slowly. Try increasing the timeout or checking the page load speed.';
|
|
235
|
+
break;
|
|
236
|
+
case ErrorCategory.BROWSER:
|
|
237
|
+
message +=
|
|
238
|
+
'\n\nSuggestion: There may be an issue with the browser instance. Try again or check system resources.';
|
|
239
|
+
break;
|
|
240
|
+
case ErrorCategory.ACCESSIBILITY:
|
|
241
|
+
message +=
|
|
242
|
+
'\n\nSuggestion: There may be an issue with the accessibility analysis engine. Try again or check the page structure.';
|
|
243
|
+
break;
|
|
244
|
+
case ErrorCategory.SESSION:
|
|
245
|
+
message +=
|
|
246
|
+
'\n\nSuggestion: The session may have expired. Please create a new session.';
|
|
247
|
+
break;
|
|
248
|
+
case ErrorCategory.VALIDATION:
|
|
249
|
+
message += '\n\nSuggestion: Please check your input parameters and try again.';
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
return message;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Handle errors gracefully and return a user-friendly error object
|
|
256
|
+
*/
|
|
257
|
+
export function handleErrorGracefully(error, context) {
|
|
258
|
+
const categorizedError = categorizeError(error);
|
|
259
|
+
const formattedMessage = formatErrorMessage(error, context);
|
|
260
|
+
// Ensure error is always a string for MCP/serialization (no [object Object])
|
|
261
|
+
const errorString = typeof formattedMessage === 'string'
|
|
262
|
+
? formattedMessage
|
|
263
|
+
: (typeof categorizedError?.message === 'string'
|
|
264
|
+
? categorizedError.message
|
|
265
|
+
: toErrorMessage(error));
|
|
266
|
+
const suggestion = categorizedError.category === ErrorCategory.BROWSER &&
|
|
267
|
+
categorizedError.message.toLowerCase().includes('failed to launch the browser process')
|
|
268
|
+
? 'Install system dependencies for Chromium: run `npx playwright install --with-deps` (Linux/Docker). Then try again.'
|
|
269
|
+
: getErrorSuggestion(categorizedError.category);
|
|
270
|
+
return {
|
|
271
|
+
error: errorString,
|
|
272
|
+
category: categorizedError.category,
|
|
273
|
+
retryable: categorizedError.retryable,
|
|
274
|
+
suggestion,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Get suggestion based on error category
|
|
279
|
+
*/
|
|
280
|
+
function getErrorSuggestion(category) {
|
|
281
|
+
switch (category) {
|
|
282
|
+
case ErrorCategory.NETWORK:
|
|
283
|
+
return 'Check your internet connection and ensure the URL is accessible.';
|
|
284
|
+
case ErrorCategory.TIMEOUT:
|
|
285
|
+
return 'The page may be loading slowly. Try increasing the timeout.';
|
|
286
|
+
case ErrorCategory.BROWSER:
|
|
287
|
+
return 'There may be an issue with the browser instance. Try again.';
|
|
288
|
+
case ErrorCategory.ACCESSIBILITY:
|
|
289
|
+
return 'There may be an issue with the accessibility analysis engine. Try again.';
|
|
290
|
+
case ErrorCategory.SESSION:
|
|
291
|
+
return 'The session may have expired. Please create a new session.';
|
|
292
|
+
case ErrorCategory.VALIDATION:
|
|
293
|
+
return 'Please check your input parameters and try again.';
|
|
294
|
+
default:
|
|
295
|
+
return 'An unexpected error occurred. Please try again.';
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Check if an error is transient (can be retried)
|
|
300
|
+
*/
|
|
301
|
+
export function isTransientError(error) {
|
|
302
|
+
const categorizedError = categorizeError(error);
|
|
303
|
+
return categorizedError.retryable;
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=error-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/core/error-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,aAQX;AARD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,0CAAyB,CAAA;IACzB,oCAAmB,CAAA;IACnB,gDAA+B,CAAA;IAC/B,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EARW,aAAa,KAAb,aAAa,QAQxB;AAuBD;;GAEG;AACH,MAAM,oBAAoB,GAAgB;IACxC,UAAU,EAAE,CAAC;IACb,YAAY,EAAE,IAAI,EAAE,WAAW;IAC/B,QAAQ,EAAE,KAAK,EAAE,aAAa;IAC9B,iBAAiB,EAAE,CAAC;IACpB,eAAe,EAAE;QACf,aAAa,CAAC,OAAO;QACrB,aAAa,CAAC,OAAO;QACrB,aAAa,CAAC,OAAO;KACtB;CACF,CAAA;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAA;IACjC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAA;IAC3C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA;IACrD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