@atlaskit/ads-mcp 0.21.0 → 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/CHANGELOG.md +33 -0
- package/a11y-fixes/package.json +1 -8
- package/a11y-guidelines/package.json +1 -8
- package/dist/cjs/index.js +23 -23
- package/dist/cjs/tools/analyze-a11y/analyze-a11y-tool.js +10 -10
- package/dist/cjs/tools/analyze-a11y/analyze-localhost-a11y-tool.js +28 -28
- package/dist/cjs/tools/get-a11y-guidelines/get-a11y-guidelines-tool.js +4 -4
- package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
- package/dist/cjs/tools/get-all-components/get-all-components-tool.js +1 -1
- package/dist/cjs/tools/get-all-icons/get-all-icons-tool.js +1 -1
- package/dist/cjs/tools/get-all-tokens/get-all-tokens-tool.js +1 -1
- package/dist/cjs/tools/get-atlaskit-components/get-atlaskit-components-tool.js +2 -2
- package/dist/cjs/tools/get-guidelines/get-guidelines-tool.js +4 -4
- package/dist/cjs/tools/get-lint-rules/get-lint-rules-tool.js +6 -6
- package/dist/cjs/tools/i18n-conversion/i18n-conversion-tool.js +1 -1
- package/dist/cjs/tools/migration-guides/migration-guides-tool.js +4 -4
- package/dist/cjs/tools/plan/plan-tool.js +6 -6
- package/dist/cjs/tools/search-atlaskit-components/search-atlaskit-components-tool.js +6 -6
- package/dist/cjs/tools/search-components/search-components-tool.js +6 -6
- package/dist/cjs/tools/search-icons/search-icons-tool.js +6 -6
- package/dist/cjs/tools/search-tokens/search-tokens-tool.js +6 -6
- package/dist/cjs/tools/suggest-a11y-fixes/suggest-a11y-fixes-tool.js +4 -4
- package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/index.js +23 -23
- package/dist/esm/tools/analyze-a11y/analyze-a11y-tool.js +10 -10
- package/dist/esm/tools/analyze-a11y/analyze-localhost-a11y-tool.js +28 -28
- package/dist/esm/tools/get-a11y-guidelines/get-a11y-guidelines-tool.js +4 -4
- package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/tools/get-all-components/get-all-components-tool.js +1 -1
- package/dist/esm/tools/get-all-icons/get-all-icons-tool.js +1 -1
- package/dist/esm/tools/get-all-tokens/get-all-tokens-tool.js +1 -1
- package/dist/esm/tools/get-atlaskit-components/get-atlaskit-components-tool.js +2 -2
- package/dist/esm/tools/get-guidelines/get-guidelines-tool.js +4 -4
- package/dist/esm/tools/get-lint-rules/get-lint-rules-tool.js +6 -6
- package/dist/esm/tools/i18n-conversion/i18n-conversion-tool.js +1 -1
- package/dist/esm/tools/migration-guides/migration-guides-tool.js +4 -4
- package/dist/esm/tools/plan/plan-tool.js +6 -6
- package/dist/esm/tools/search-atlaskit-components/search-atlaskit-components-tool.js +6 -6
- package/dist/esm/tools/search-components/search-components-tool.js +6 -6
- package/dist/esm/tools/search-icons/search-icons-tool.js +6 -6
- package/dist/esm/tools/search-tokens/search-tokens-tool.js +6 -6
- package/dist/esm/tools/suggest-a11y-fixes/suggest-a11y-fixes-tool.js +4 -4
- package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
- package/i18n-conversion-guide/package.json +1 -8
- package/migration-registry/package.json +1 -8
- package/package.json +5 -13
- package/tools/analyze-a11y/package.json +1 -8
- package/tools/get-a11y-guidelines/package.json +1 -8
- package/tools/get-all-components/package.json +1 -8
- package/tools/get-all-icons/package.json +1 -8
- package/tools/get-all-tokens/package.json +1 -8
- package/tools/get-guidelines/package.json +1 -8
- package/tools/get-lint-rules/package.json +1 -8
- package/tools/i18n-conversion/package.json +1 -8
- package/tools/migration-guides/package.json +1 -8
- package/tools/plan/package.json +1 -8
- package/tools/search-components/package.json +1 -8
- package/tools/search-icons/package.json +1 -8
- package/tools/search-tokens/package.json +1 -8
- package/tools/suggest-a11y-fixes/package.json +1 -8
- package/dist/types-ts4.5/entry-points/a11y-fixes.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/a11y-guidelines.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/analyze-a11y.d.ts +0 -5
- package/dist/types-ts4.5/entry-points/get-a11y-guidelines.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/get-all-components.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/get-all-icons.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/get-all-tokens.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/get-atlaskit-components.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/get-guidelines.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/get-lint-rules.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/i18n-conversion-guide.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/i18n-conversion.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/migration-guides.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/migration-registry.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/plan.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/search-atlaskit-components.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/search-components.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/search-icons.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/search-tokens.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/suggest-a11y-fixes.d.ts +0 -3
- package/dist/types-ts4.5/helpers/agent.d.ts +0 -3
- package/dist/types-ts4.5/helpers/analytics.d.ts +0 -21
- package/dist/types-ts4.5/helpers/clean-query.d.ts +0 -1
- package/dist/types-ts4.5/helpers/compute-multi-term-fuse-allocation.d.ts +0 -14
- package/dist/types-ts4.5/helpers/config-path.d.ts +0 -7
- package/dist/types-ts4.5/helpers/fuse-multi-term.d.ts +0 -26
- package/dist/types-ts4.5/helpers/index.d.ts +0 -3
- package/dist/types-ts4.5/helpers/send-operational-event.d.ts +0 -13
- package/dist/types-ts4.5/helpers/staff-id.d.ts +0 -1
- package/dist/types-ts4.5/helpers/validation.d.ts +0 -26
- package/dist/types-ts4.5/helpers/zod-to-json-schema.d.ts +0 -3
- package/dist/types-ts4.5/index.d.ts +0 -7
- package/dist/types-ts4.5/instructions.d.ts +0 -1
- package/dist/types-ts4.5/tools/analyze-a11y/analyze-a11y-input-schema.d.ts +0 -17
- package/dist/types-ts4.5/tools/analyze-a11y/analyze-a11y-localhost-input-schema.d.ts +0 -17
- package/dist/types-ts4.5/tools/analyze-a11y/analyze-a11y-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/analyze-a11y/analyze-localhost-a11y-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/analyze-a11y/generate-ads-fix-for-violation.d.ts +0 -1
- package/dist/types-ts4.5/tools/analyze-a11y/list-analyze-a11y-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/analyze-a11y/list-analyze-localhost-a11y-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-a11y-guidelines/get-a11y-guidelines-input-schema.d.ts +0 -8
- package/dist/types-ts4.5/tools/get-a11y-guidelines/get-a11y-guidelines-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/get-a11y-guidelines/guidelines.d.ts +0 -102
- package/dist/types-ts4.5/tools/get-a11y-guidelines/list-get-a11y-guidelines-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-all-components/components.codegen.d.ts +0 -10
- package/dist/types-ts4.5/tools/get-all-components/components.d.ts +0 -10
- package/dist/types-ts4.5/tools/get-all-components/get-all-components-tool.d.ts +0 -6
- package/dist/types-ts4.5/tools/get-all-components/list-get-all-components-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-all-components/load-all-components.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-all-components/types.d.ts +0 -26
- package/dist/types-ts4.5/tools/get-all-icons/get-all-icons-tool.d.ts +0 -6
- package/dist/types-ts4.5/tools/get-all-icons/icons.d.ts +0 -11
- package/dist/types-ts4.5/tools/get-all-icons/list-get-all-icons-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-all-tokens/get-all-tokens-tool.d.ts +0 -6
- package/dist/types-ts4.5/tools/get-all-tokens/list-get-all-tokens-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +0 -10
- package/dist/types-ts4.5/tools/get-atlaskit-components/get-atlaskit-components-tool.d.ts +0 -6
- package/dist/types-ts4.5/tools/get-atlaskit-components/list-get-atlaskit-components-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-guidelines/get-guidelines-input-schema.d.ts +0 -5
- package/dist/types-ts4.5/tools/get-guidelines/get-guidelines-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/get-guidelines/guidelines-structured-content.codegen.d.ts +0 -13
- package/dist/types-ts4.5/tools/get-guidelines/list-get-guidelines-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-lint-rules/get-lint-rules-input-schema.d.ts +0 -6
- package/dist/types-ts4.5/tools/get-lint-rules/get-lint-rules-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +0 -13
- package/dist/types-ts4.5/tools/get-lint-rules/list-get-lint-rules-tool.d.ts +0 -19
- package/dist/types-ts4.5/tools/i18n-conversion/guide.d.ts +0 -5
- package/dist/types-ts4.5/tools/i18n-conversion/i18n-conversion-input-schema.d.ts +0 -10
- package/dist/types-ts4.5/tools/i18n-conversion/i18n-conversion-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/i18n-conversion/list-i18n-conversion-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/i18n-conversion/types.d.ts +0 -22
- package/dist/types-ts4.5/tools/migration-guides/get-available-migration-ids.d.ts +0 -12
- package/dist/types-ts4.5/tools/migration-guides/get-available-migrations-description.d.ts +0 -13
- package/dist/types-ts4.5/tools/migration-guides/list-migration-guides-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migration-guides-input-schema.d.ts +0 -15
- package/dist/types-ts4.5/tools/migration-guides/migration-guides-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/migration-guides/migration-registry.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migrations/onboarding-jira-spotlight.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migrations/onboarding-multi-step.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migrations/onboarding-single-step.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migrations/onboarding-with-motion.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/types.d.ts +0 -23
- package/dist/types-ts4.5/tools/plan/list-plan-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/plan/plan-input-schema.d.ts +0 -20
- package/dist/types-ts4.5/tools/plan/plan-tool.d.ts +0 -15
- package/dist/types-ts4.5/tools/search-atlaskit-components/list-search-atlaskit-components-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/search-atlaskit-components/search-atlaskit-components-input-schema.d.ts +0 -11
- package/dist/types-ts4.5/tools/search-atlaskit-components/search-atlaskit-components-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/search-components/list-search-components-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/search-components/search-components-input-schema.d.ts +0 -11
- package/dist/types-ts4.5/tools/search-components/search-components-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/search-icons/list-search-icons-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/search-icons/search-icons-input-schema.d.ts +0 -11
- package/dist/types-ts4.5/tools/search-icons/search-icons-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/search-tokens/list-search-tokens-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/search-tokens/search-tokens-input-schema.d.ts +0 -11
- package/dist/types-ts4.5/tools/search-tokens/search-tokens-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/fixes.d.ts +0 -17
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/keywords.d.ts +0 -12
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/list-suggest-a11y-fixes-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/suggest-a11y-fixes-input-schema.d.ts +0 -17
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/suggest-a11y-fixes-tool.d.ts +0 -8
package/dist/esm/index.js
CHANGED
|
@@ -166,7 +166,7 @@ export var getToolRegistry = function getToolRegistry() {
|
|
|
166
166
|
server.setRequestHandler(ListToolsRequestSchema, /*#__PURE__*/function () {
|
|
167
167
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(request, extra) {
|
|
168
168
|
var toolRegistry, tools;
|
|
169
|
-
return _regeneratorRuntime.wrap(function
|
|
169
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
170
170
|
while (1) switch (_context.prev = _context.next) {
|
|
171
171
|
case 0:
|
|
172
172
|
toolRegistry = getToolRegistry();
|
|
@@ -186,7 +186,7 @@ server.setRequestHandler(ListToolsRequestSchema, /*#__PURE__*/function () {
|
|
|
186
186
|
return _context.abrupt("return", {
|
|
187
187
|
tools: tools
|
|
188
188
|
});
|
|
189
|
-
case
|
|
189
|
+
case 1:
|
|
190
190
|
case "end":
|
|
191
191
|
return _context.stop();
|
|
192
192
|
}
|
|
@@ -200,8 +200,8 @@ server.setRequestHandler(ListToolsRequestSchema, /*#__PURE__*/function () {
|
|
|
200
200
|
// Handle tool execution
|
|
201
201
|
server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
202
202
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(request, extra) {
|
|
203
|
-
var toolRegistry, toolName, toolConfig, actionSubject, toolArguments, inputValidation, result, toolRegistryForError;
|
|
204
|
-
return _regeneratorRuntime.wrap(function
|
|
203
|
+
var toolRegistry, toolName, toolConfig, actionSubject, toolArguments, inputValidation, result, toolRegistryForError, _t;
|
|
204
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
205
205
|
while (1) switch (_context2.prev = _context2.next) {
|
|
206
206
|
case 0:
|
|
207
207
|
toolRegistry = getToolRegistry();
|
|
@@ -219,17 +219,17 @@ server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
221
|
if (!toolConfig) {
|
|
222
|
-
_context2.next =
|
|
222
|
+
_context2.next = 6;
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
225
|
-
_context2.prev =
|
|
225
|
+
_context2.prev = 1;
|
|
226
226
|
if (!toolConfig.inputSchema) {
|
|
227
|
-
_context2.next =
|
|
227
|
+
_context2.next = 3;
|
|
228
228
|
break;
|
|
229
229
|
}
|
|
230
230
|
inputValidation = validateToolArguments(toolConfig.inputSchema, request.params.arguments);
|
|
231
231
|
if (inputValidation.success) {
|
|
232
|
-
_context2.next =
|
|
232
|
+
_context2.next = 2;
|
|
233
233
|
break;
|
|
234
234
|
}
|
|
235
235
|
sendOperationalEvent({
|
|
@@ -245,12 +245,12 @@ server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
return _context2.abrupt("return", inputValidation.error);
|
|
248
|
-
case
|
|
248
|
+
case 2:
|
|
249
249
|
toolArguments = inputValidation.data;
|
|
250
|
-
case
|
|
251
|
-
_context2.next =
|
|
250
|
+
case 3:
|
|
251
|
+
_context2.next = 4;
|
|
252
252
|
return toolConfig.handler(toolArguments);
|
|
253
|
-
case
|
|
253
|
+
case 4:
|
|
254
254
|
result = _context2.sent;
|
|
255
255
|
// Track successful tool execution
|
|
256
256
|
sendOperationalEvent({
|
|
@@ -264,9 +264,9 @@ server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
return _context2.abrupt("return", result);
|
|
267
|
-
case
|
|
268
|
-
_context2.prev =
|
|
269
|
-
|
|
267
|
+
case 5:
|
|
268
|
+
_context2.prev = 5;
|
|
269
|
+
_t = _context2["catch"](1);
|
|
270
270
|
// Track tool execution error
|
|
271
271
|
sendOperationalEvent({
|
|
272
272
|
action: 'failed',
|
|
@@ -276,7 +276,7 @@ server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
|
276
276
|
toolName: toolName,
|
|
277
277
|
request: request,
|
|
278
278
|
extra: extra,
|
|
279
|
-
errorMessage:
|
|
279
|
+
errorMessage: _t instanceof Error ? _t.message : 'Unknown error'
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
282
|
|
|
@@ -284,8 +284,8 @@ server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
|
284
284
|
We don't use console.error here:
|
|
285
285
|
- when used alone, without the throw new McpError, it causes "Client error for command...", which will loop back to this catch
|
|
286
286
|
*/
|
|
287
|
-
throw new McpError(-32000, "Failed to execute '".concat(toolName, "' tool: ").concat(
|
|
288
|
-
case
|
|
287
|
+
throw new McpError(-32000, "Failed to execute '".concat(toolName, "' tool: ").concat(_t instanceof Error ? _t.message : 'Unknown error'));
|
|
288
|
+
case 6:
|
|
289
289
|
// Track tool not found error
|
|
290
290
|
sendOperationalEvent({
|
|
291
291
|
action: 'notFound',
|
|
@@ -300,11 +300,11 @@ server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
|
300
300
|
toolRegistryForError = getToolRegistry();
|
|
301
301
|
console.error("Tool '".concat(request.params.name, "' not found, only the following tools are available: ").concat(Object.keys(toolRegistryForError).join(', ')));
|
|
302
302
|
return _context2.abrupt("return");
|
|
303
|
-
case
|
|
303
|
+
case 7:
|
|
304
304
|
case "end":
|
|
305
305
|
return _context2.stop();
|
|
306
306
|
}
|
|
307
|
-
}, _callee2, null, [[
|
|
307
|
+
}, _callee2, null, [[1, 5]]);
|
|
308
308
|
}));
|
|
309
309
|
return function (_x3, _x4) {
|
|
310
310
|
return _ref2.apply(this, arguments);
|
|
@@ -316,7 +316,7 @@ function runServer() {
|
|
|
316
316
|
function _runServer() {
|
|
317
317
|
_runServer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
318
318
|
var transport;
|
|
319
|
-
return _regeneratorRuntime.wrap(function
|
|
319
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
320
320
|
while (1) switch (_context3.prev = _context3.next) {
|
|
321
321
|
case 0:
|
|
322
322
|
/**
|
|
@@ -332,9 +332,9 @@ function _runServer() {
|
|
|
332
332
|
actionSubject: 'ads.mcp.initialize'
|
|
333
333
|
});
|
|
334
334
|
transport = new StdioServerTransport();
|
|
335
|
-
_context3.next =
|
|
335
|
+
_context3.next = 1;
|
|
336
336
|
return server.connect(transport);
|
|
337
|
-
case
|
|
337
|
+
case 1:
|
|
338
338
|
case "end":
|
|
339
339
|
return _context3.stop();
|
|
340
340
|
}
|
|
@@ -73,20 +73,20 @@ function mapAxeViolationsToADSFixes(violations) {
|
|
|
73
73
|
}
|
|
74
74
|
export var analyzeA11yTool = /*#__PURE__*/function () {
|
|
75
75
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
76
|
-
var code, componentName, context, _params$includePatter, includePatternAnalysis, violations, suggestions, axeResults, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, results, adsViolations, relevantGuidelines, summary;
|
|
77
|
-
return _regeneratorRuntime.wrap(function
|
|
76
|
+
var code, componentName, context, _params$includePatter, includePatternAnalysis, violations, suggestions, axeResults, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, results, adsViolations, relevantGuidelines, summary, _t;
|
|
77
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
78
78
|
while (1) switch (_context.prev = _context.next) {
|
|
79
79
|
case 0:
|
|
80
80
|
code = params.code, componentName = params.componentName, context = params.context, _params$includePatter = params.includePatternAnalysis, includePatternAnalysis = _params$includePatter === void 0 ? true : _params$includePatter;
|
|
81
81
|
violations = [];
|
|
82
82
|
suggestions = [];
|
|
83
83
|
axeResults = {};
|
|
84
|
-
_context.prev =
|
|
85
|
-
_context.next =
|
|
84
|
+
_context.prev = 1;
|
|
85
|
+
_context.next = 2;
|
|
86
86
|
return axe.run({
|
|
87
87
|
fromFrames: ['iframe', 'html']
|
|
88
88
|
});
|
|
89
|
-
case
|
|
89
|
+
case 2:
|
|
90
90
|
results = _context.sent;
|
|
91
91
|
// Process axe-core results
|
|
92
92
|
if (results.violations && results.violations.length > 0) {
|
|
@@ -172,9 +172,9 @@ export var analyzeA11yTool = /*#__PURE__*/function () {
|
|
|
172
172
|
}, null, 2)
|
|
173
173
|
}]
|
|
174
174
|
});
|
|
175
|
-
case
|
|
176
|
-
_context.prev =
|
|
177
|
-
|
|
175
|
+
case 3:
|
|
176
|
+
_context.prev = 3;
|
|
177
|
+
_t = _context["catch"](1);
|
|
178
178
|
// Fallback to pattern-based analysis if axe-core fails
|
|
179
179
|
// console.warn('Axe-core analysis failed, falling back to pattern analysis:', error);
|
|
180
180
|
|
|
@@ -223,11 +223,11 @@ export var analyzeA11yTool = /*#__PURE__*/function () {
|
|
|
223
223
|
}, null, 2)
|
|
224
224
|
}]
|
|
225
225
|
});
|
|
226
|
-
case
|
|
226
|
+
case 4:
|
|
227
227
|
case "end":
|
|
228
228
|
return _context.stop();
|
|
229
229
|
}
|
|
230
|
-
}, _callee, null, [[
|
|
230
|
+
}, _callee, null, [[1, 3]]);
|
|
231
231
|
}));
|
|
232
232
|
return function analyzeA11yTool(_x) {
|
|
233
233
|
return _ref.apply(this, arguments);
|
|
@@ -38,59 +38,59 @@ function mapAxeViolationsToADSFixes(violations) {
|
|
|
38
38
|
}
|
|
39
39
|
export var analyzeLocalhostA11yTool = /*#__PURE__*/function () {
|
|
40
40
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
41
|
-
var url, componentName, context, selector, violations, suggestions, axeResults, browser, page, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, elementExists, availableElements, axePuppeteer, results, adsViolations, relevantGuidelines, summary;
|
|
42
|
-
return _regeneratorRuntime.wrap(function
|
|
41
|
+
var url, componentName, context, selector, violations, suggestions, axeResults, browser, page, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, elementExists, availableElements, axePuppeteer, results, adsViolations, relevantGuidelines, summary, _t;
|
|
42
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
43
43
|
while (1) switch (_context.prev = _context.next) {
|
|
44
44
|
case 0:
|
|
45
45
|
url = params.url, componentName = params.componentName, context = params.context, selector = params.selector;
|
|
46
46
|
violations = [];
|
|
47
47
|
suggestions = [];
|
|
48
48
|
axeResults = {};
|
|
49
|
-
_context.next =
|
|
49
|
+
_context.next = 1;
|
|
50
50
|
return puppeteer.launch();
|
|
51
|
-
case
|
|
51
|
+
case 1:
|
|
52
52
|
browser = _context.sent;
|
|
53
|
-
_context.next =
|
|
53
|
+
_context.next = 2;
|
|
54
54
|
return browser.newPage();
|
|
55
|
-
case
|
|
55
|
+
case 2:
|
|
56
56
|
page = _context.sent;
|
|
57
|
-
_context.prev =
|
|
58
|
-
_context.next =
|
|
57
|
+
_context.prev = 3;
|
|
58
|
+
_context.next = 4;
|
|
59
59
|
return page.goto(url, {
|
|
60
60
|
waitUntil: 'networkidle0'
|
|
61
61
|
});
|
|
62
|
-
case
|
|
62
|
+
case 4:
|
|
63
63
|
if (!selector) {
|
|
64
|
-
_context.next =
|
|
64
|
+
_context.next = 7;
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
|
-
_context.next =
|
|
67
|
+
_context.next = 5;
|
|
68
68
|
return page.$(selector);
|
|
69
|
-
case
|
|
69
|
+
case 5:
|
|
70
70
|
elementExists = _context.sent;
|
|
71
71
|
if (elementExists) {
|
|
72
|
-
_context.next =
|
|
72
|
+
_context.next = 7;
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
|
-
_context.next =
|
|
75
|
+
_context.next = 6;
|
|
76
76
|
return page.evaluate(function () {
|
|
77
77
|
var elements = Array.from(document.querySelectorAll('[id]'));
|
|
78
78
|
return elements.map(function (el) {
|
|
79
79
|
return "#".concat(el.id);
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
|
-
case
|
|
82
|
+
case 6:
|
|
83
83
|
availableElements = _context.sent;
|
|
84
84
|
throw new Error("Element with selector \"".concat(selector, "\" not found on the page after waiting. Available elements: ").concat(availableElements.join(', ')));
|
|
85
|
-
case
|
|
85
|
+
case 7:
|
|
86
86
|
// Run axe-core accessibility analysis
|
|
87
87
|
axePuppeteer = new AxePuppeteer(page); // If selector is provided, analyze only that element
|
|
88
88
|
if (selector) {
|
|
89
89
|
axePuppeteer.include(selector);
|
|
90
90
|
}
|
|
91
|
-
_context.next =
|
|
91
|
+
_context.next = 8;
|
|
92
92
|
return axePuppeteer.analyze();
|
|
93
|
-
case
|
|
93
|
+
case 8:
|
|
94
94
|
results = _context.sent;
|
|
95
95
|
if (results.violations && results.violations.length > 0) {
|
|
96
96
|
adsViolations = mapAxeViolationsToADSFixes(results.violations);
|
|
@@ -146,9 +146,9 @@ export var analyzeLocalhostA11yTool = /*#__PURE__*/function () {
|
|
|
146
146
|
incomplete: ((_axeResults$incomplet = axeResults.incomplete) === null || _axeResults$incomplet === void 0 ? void 0 : _axeResults$incomplet.length) || 0
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
|
-
_context.next =
|
|
149
|
+
_context.next = 9;
|
|
150
150
|
return browser.close();
|
|
151
|
-
case
|
|
151
|
+
case 9:
|
|
152
152
|
return _context.abrupt("return", {
|
|
153
153
|
content: [{
|
|
154
154
|
type: 'text',
|
|
@@ -162,12 +162,12 @@ export var analyzeLocalhostA11yTool = /*#__PURE__*/function () {
|
|
|
162
162
|
}, null, 2)
|
|
163
163
|
}]
|
|
164
164
|
});
|
|
165
|
-
case
|
|
166
|
-
_context.prev =
|
|
167
|
-
|
|
168
|
-
_context.next =
|
|
165
|
+
case 10:
|
|
166
|
+
_context.prev = 10;
|
|
167
|
+
_t = _context["catch"](3);
|
|
168
|
+
_context.next = 11;
|
|
169
169
|
return browser.close();
|
|
170
|
-
case
|
|
170
|
+
case 11:
|
|
171
171
|
return _context.abrupt("return", {
|
|
172
172
|
content: [{
|
|
173
173
|
type: 'text',
|
|
@@ -190,16 +190,16 @@ export var analyzeLocalhostA11yTool = /*#__PURE__*/function () {
|
|
|
190
190
|
},
|
|
191
191
|
violations: violations,
|
|
192
192
|
suggestions: [],
|
|
193
|
-
error: String(
|
|
193
|
+
error: String(_t),
|
|
194
194
|
recommendations: ['Use ADS components for better accessibility out of the box', 'Reference https://atlassian.design/llms-a11y.txt for detailed guidelines', 'Test with keyboard navigation and screen readers', 'Use automated accessibility testing tools']
|
|
195
195
|
}, null, 2)
|
|
196
196
|
}]
|
|
197
197
|
});
|
|
198
|
-
case
|
|
198
|
+
case 12:
|
|
199
199
|
case "end":
|
|
200
200
|
return _context.stop();
|
|
201
201
|
}
|
|
202
|
-
}, _callee, null, [[
|
|
202
|
+
}, _callee, null, [[3, 10]]);
|
|
203
203
|
}));
|
|
204
204
|
return function analyzeLocalhostA11yTool(_x) {
|
|
205
205
|
return _ref.apply(this, arguments);
|
|
@@ -10,12 +10,12 @@ var topics = Object.keys(accessibilityGuidelines);
|
|
|
10
10
|
export var getA11yGuidelinesTool = /*#__PURE__*/function () {
|
|
11
11
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
12
12
|
var topic, guidelines;
|
|
13
|
-
return _regeneratorRuntime.wrap(function
|
|
13
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
14
14
|
while (1) switch (_context.prev = _context.next) {
|
|
15
15
|
case 0:
|
|
16
16
|
topic = _ref.topic;
|
|
17
17
|
if (!(topic && accessibilityGuidelines[topic])) {
|
|
18
|
-
_context.next =
|
|
18
|
+
_context.next = 1;
|
|
19
19
|
break;
|
|
20
20
|
}
|
|
21
21
|
guidelines = accessibilityGuidelines[topic];
|
|
@@ -29,7 +29,7 @@ export var getA11yGuidelinesTool = /*#__PURE__*/function () {
|
|
|
29
29
|
}), null, 2)
|
|
30
30
|
}]
|
|
31
31
|
});
|
|
32
|
-
case
|
|
32
|
+
case 1:
|
|
33
33
|
return _context.abrupt("return", {
|
|
34
34
|
content: [{
|
|
35
35
|
type: 'text',
|
|
@@ -41,7 +41,7 @@ export var getA11yGuidelinesTool = /*#__PURE__*/function () {
|
|
|
41
41
|
}, null, 2)
|
|
42
42
|
}]
|
|
43
43
|
});
|
|
44
|
-
case
|
|
44
|
+
case 2:
|
|
45
45
|
case "end":
|
|
46
46
|
return _context.stop();
|
|
47
47
|
}
|