@atlaskit/ads-mcp 0.21.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/index.js +23 -23
  3. package/dist/cjs/tools/analyze-a11y/analyze-a11y-tool.js +10 -10
  4. package/dist/cjs/tools/analyze-a11y/analyze-localhost-a11y-tool.js +28 -28
  5. package/dist/cjs/tools/get-a11y-guidelines/get-a11y-guidelines-tool.js +4 -4
  6. package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
  7. package/dist/cjs/tools/get-all-components/get-all-components-tool.js +1 -1
  8. package/dist/cjs/tools/get-all-icons/get-all-icons-tool.js +1 -1
  9. package/dist/cjs/tools/get-all-tokens/get-all-tokens-tool.js +1 -1
  10. package/dist/cjs/tools/get-atlaskit-components/get-atlaskit-components-tool.js +2 -2
  11. package/dist/cjs/tools/get-guidelines/get-guidelines-tool.js +4 -4
  12. package/dist/cjs/tools/get-lint-rules/get-lint-rules-tool.js +6 -6
  13. package/dist/cjs/tools/i18n-conversion/i18n-conversion-tool.js +1 -1
  14. package/dist/cjs/tools/migration-guides/migration-guides-tool.js +4 -4
  15. package/dist/cjs/tools/plan/plan-tool.js +6 -6
  16. package/dist/cjs/tools/search-atlaskit-components/search-atlaskit-components-tool.js +6 -6
  17. package/dist/cjs/tools/search-components/search-components-tool.js +6 -6
  18. package/dist/cjs/tools/search-icons/search-icons-tool.js +6 -6
  19. package/dist/cjs/tools/search-tokens/search-tokens-tool.js +6 -6
  20. package/dist/cjs/tools/suggest-a11y-fixes/suggest-a11y-fixes-tool.js +4 -4
  21. package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
  22. package/dist/esm/index.js +23 -23
  23. package/dist/esm/tools/analyze-a11y/analyze-a11y-tool.js +10 -10
  24. package/dist/esm/tools/analyze-a11y/analyze-localhost-a11y-tool.js +28 -28
  25. package/dist/esm/tools/get-a11y-guidelines/get-a11y-guidelines-tool.js +4 -4
  26. package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
  27. package/dist/esm/tools/get-all-components/get-all-components-tool.js +1 -1
  28. package/dist/esm/tools/get-all-icons/get-all-icons-tool.js +1 -1
  29. package/dist/esm/tools/get-all-tokens/get-all-tokens-tool.js +1 -1
  30. package/dist/esm/tools/get-atlaskit-components/get-atlaskit-components-tool.js +2 -2
  31. package/dist/esm/tools/get-guidelines/get-guidelines-tool.js +4 -4
  32. package/dist/esm/tools/get-lint-rules/get-lint-rules-tool.js +6 -6
  33. package/dist/esm/tools/i18n-conversion/i18n-conversion-tool.js +1 -1
  34. package/dist/esm/tools/migration-guides/migration-guides-tool.js +4 -4
  35. package/dist/esm/tools/plan/plan-tool.js +6 -6
  36. package/dist/esm/tools/search-atlaskit-components/search-atlaskit-components-tool.js +6 -6
  37. package/dist/esm/tools/search-components/search-components-tool.js +6 -6
  38. package/dist/esm/tools/search-icons/search-icons-tool.js +6 -6
  39. package/dist/esm/tools/search-tokens/search-tokens-tool.js +6 -6
  40. package/dist/esm/tools/suggest-a11y-fixes/suggest-a11y-fixes-tool.js +4 -4
  41. package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
  42. package/dist/types-ts4.5/tools/get-all-components/components.codegen.d.ts +1 -1
  43. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/ads-mcp
2
2
 
3
+ ## 0.21.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0467affd8dd16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0467affd8dd16) -
8
+ Minor component prop updates from DateTimePicker and DropdownMenu
9
+
3
10
  ## 0.21.0
4
11
 
5
12
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -173,7 +173,7 @@ var getToolRegistry = exports.getToolRegistry = function getToolRegistry() {
173
173
  server.setRequestHandler(_types.ListToolsRequestSchema, /*#__PURE__*/function () {
174
174
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(request, extra) {
175
175
  var toolRegistry, tools;
176
- return _regenerator.default.wrap(function _callee$(_context) {
176
+ return _regenerator.default.wrap(function (_context) {
177
177
  while (1) switch (_context.prev = _context.next) {
178
178
  case 0:
179
179
  toolRegistry = getToolRegistry();
@@ -193,7 +193,7 @@ server.setRequestHandler(_types.ListToolsRequestSchema, /*#__PURE__*/function ()
193
193
  return _context.abrupt("return", {
194
194
  tools: tools
195
195
  });
196
- case 4:
196
+ case 1:
197
197
  case "end":
198
198
  return _context.stop();
199
199
  }
@@ -207,8 +207,8 @@ server.setRequestHandler(_types.ListToolsRequestSchema, /*#__PURE__*/function ()
207
207
  // Handle tool execution
208
208
  server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function () {
209
209
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(request, extra) {
210
- var toolRegistry, toolName, toolConfig, actionSubject, toolArguments, inputValidation, result, toolRegistryForError;
211
- return _regenerator.default.wrap(function _callee2$(_context2) {
210
+ var toolRegistry, toolName, toolConfig, actionSubject, toolArguments, inputValidation, result, toolRegistryForError, _t;
211
+ return _regenerator.default.wrap(function (_context2) {
212
212
  while (1) switch (_context2.prev = _context2.next) {
213
213
  case 0:
214
214
  toolRegistry = getToolRegistry();
@@ -226,17 +226,17 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
226
226
  }
227
227
  });
228
228
  if (!toolConfig) {
229
- _context2.next = 24;
229
+ _context2.next = 6;
230
230
  break;
231
231
  }
232
- _context2.prev = 6;
232
+ _context2.prev = 1;
233
233
  if (!toolConfig.inputSchema) {
234
- _context2.next = 13;
234
+ _context2.next = 3;
235
235
  break;
236
236
  }
237
237
  inputValidation = (0, _validation.validateToolArguments)(toolConfig.inputSchema, request.params.arguments);
238
238
  if (inputValidation.success) {
239
- _context2.next = 12;
239
+ _context2.next = 2;
240
240
  break;
241
241
  }
242
242
  (0, _sendOperationalEvent.sendOperationalEvent)({
@@ -252,12 +252,12 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
252
252
  }
253
253
  });
254
254
  return _context2.abrupt("return", inputValidation.error);
255
- case 12:
255
+ case 2:
256
256
  toolArguments = inputValidation.data;
257
- case 13:
258
- _context2.next = 15;
257
+ case 3:
258
+ _context2.next = 4;
259
259
  return toolConfig.handler(toolArguments);
260
- case 15:
260
+ case 4:
261
261
  result = _context2.sent;
262
262
  // Track successful tool execution
263
263
  (0, _sendOperationalEvent.sendOperationalEvent)({
@@ -271,9 +271,9 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
271
271
  }
272
272
  });
273
273
  return _context2.abrupt("return", result);
274
- case 20:
275
- _context2.prev = 20;
276
- _context2.t0 = _context2["catch"](6);
274
+ case 5:
275
+ _context2.prev = 5;
276
+ _t = _context2["catch"](1);
277
277
  // Track tool execution error
278
278
  (0, _sendOperationalEvent.sendOperationalEvent)({
279
279
  action: 'failed',
@@ -283,7 +283,7 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
283
283
  toolName: toolName,
284
284
  request: request,
285
285
  extra: extra,
286
- errorMessage: _context2.t0 instanceof Error ? _context2.t0.message : 'Unknown error'
286
+ errorMessage: _t instanceof Error ? _t.message : 'Unknown error'
287
287
  }
288
288
  });
289
289
 
@@ -291,8 +291,8 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
291
291
  We don't use console.error here:
292
292
  - when used alone, without the throw new McpError, it causes "Client error for command...", which will loop back to this catch
293
293
  */
294
- throw new _types.McpError(-32000, "Failed to execute '".concat(toolName, "' tool: ").concat(_context2.t0 instanceof Error ? _context2.t0.message : 'Unknown error'));
295
- case 24:
294
+ throw new _types.McpError(-32000, "Failed to execute '".concat(toolName, "' tool: ").concat(_t instanceof Error ? _t.message : 'Unknown error'));
295
+ case 6:
296
296
  // Track tool not found error
297
297
  (0, _sendOperationalEvent.sendOperationalEvent)({
298
298
  action: 'notFound',
@@ -307,11 +307,11 @@ server.setRequestHandler(_types.CallToolRequestSchema, /*#__PURE__*/function ()
307
307
  toolRegistryForError = getToolRegistry();
308
308
  console.error("Tool '".concat(request.params.name, "' not found, only the following tools are available: ").concat(Object.keys(toolRegistryForError).join(', ')));
309
309
  return _context2.abrupt("return");
310
- case 28:
310
+ case 7:
311
311
  case "end":
312
312
  return _context2.stop();
313
313
  }
314
- }, _callee2, null, [[6, 20]]);
314
+ }, _callee2, null, [[1, 5]]);
315
315
  }));
316
316
  return function (_x3, _x4) {
317
317
  return _ref2.apply(this, arguments);
@@ -323,7 +323,7 @@ function runServer() {
323
323
  function _runServer() {
324
324
  _runServer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
325
325
  var transport;
326
- return _regenerator.default.wrap(function _callee3$(_context3) {
326
+ return _regenerator.default.wrap(function (_context3) {
327
327
  while (1) switch (_context3.prev = _context3.next) {
328
328
  case 0:
329
329
  /**
@@ -339,9 +339,9 @@ function _runServer() {
339
339
  actionSubject: 'ads.mcp.initialize'
340
340
  });
341
341
  transport = new _stdio.StdioServerTransport();
342
- _context3.next = 7;
342
+ _context3.next = 1;
343
343
  return server.connect(transport);
344
- case 7:
344
+ case 1:
345
345
  case "end":
346
346
  return _context3.stop();
347
347
  }
@@ -80,20 +80,20 @@ function mapAxeViolationsToADSFixes(violations) {
80
80
  }
81
81
  var analyzeA11yTool = exports.analyzeA11yTool = /*#__PURE__*/function () {
82
82
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
83
- var code, componentName, context, _params$includePatter, includePatternAnalysis, violations, suggestions, axeResults, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, results, adsViolations, relevantGuidelines, summary;
84
- return _regenerator.default.wrap(function _callee$(_context) {
83
+ var code, componentName, context, _params$includePatter, includePatternAnalysis, violations, suggestions, axeResults, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, results, adsViolations, relevantGuidelines, summary, _t;
84
+ return _regenerator.default.wrap(function (_context) {
85
85
  while (1) switch (_context.prev = _context.next) {
86
86
  case 0:
87
87
  code = params.code, componentName = params.componentName, context = params.context, _params$includePatter = params.includePatternAnalysis, includePatternAnalysis = _params$includePatter === void 0 ? true : _params$includePatter;
88
88
  violations = [];
89
89
  suggestions = [];
90
90
  axeResults = {};
91
- _context.prev = 4;
92
- _context.next = 7;
91
+ _context.prev = 1;
92
+ _context.next = 2;
93
93
  return _axeCore.default.run({
94
94
  fromFrames: ['iframe', 'html']
95
95
  });
96
- case 7:
96
+ case 2:
97
97
  results = _context.sent;
98
98
  // Process axe-core results
99
99
  if (results.violations && results.violations.length > 0) {
@@ -179,9 +179,9 @@ var analyzeA11yTool = exports.analyzeA11yTool = /*#__PURE__*/function () {
179
179
  }, null, 2)
180
180
  }]
181
181
  });
182
- case 20:
183
- _context.prev = 20;
184
- _context.t0 = _context["catch"](4);
182
+ case 3:
183
+ _context.prev = 3;
184
+ _t = _context["catch"](1);
185
185
  // Fallback to pattern-based analysis if axe-core fails
186
186
  // console.warn('Axe-core analysis failed, falling back to pattern analysis:', error);
187
187
 
@@ -230,11 +230,11 @@ var analyzeA11yTool = exports.analyzeA11yTool = /*#__PURE__*/function () {
230
230
  }, null, 2)
231
231
  }]
232
232
  });
233
- case 24:
233
+ case 4:
234
234
  case "end":
235
235
  return _context.stop();
236
236
  }
237
- }, _callee, null, [[4, 20]]);
237
+ }, _callee, null, [[1, 3]]);
238
238
  }));
239
239
  return function analyzeA11yTool(_x) {
240
240
  return _ref.apply(this, arguments);
@@ -45,59 +45,59 @@ function mapAxeViolationsToADSFixes(violations) {
45
45
  }
46
46
  var analyzeLocalhostA11yTool = exports.analyzeLocalhostA11yTool = /*#__PURE__*/function () {
47
47
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
48
- var url, componentName, context, selector, violations, suggestions, axeResults, browser, page, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, elementExists, availableElements, axePuppeteer, results, adsViolations, relevantGuidelines, summary;
49
- return _regenerator.default.wrap(function _callee$(_context) {
48
+ var url, componentName, context, selector, violations, suggestions, axeResults, browser, page, _axeResults$violation, _axeResults$passes, _axeResults$incomplet, elementExists, availableElements, axePuppeteer, results, adsViolations, relevantGuidelines, summary, _t;
49
+ return _regenerator.default.wrap(function (_context) {
50
50
  while (1) switch (_context.prev = _context.next) {
51
51
  case 0:
52
52
  url = params.url, componentName = params.componentName, context = params.context, selector = params.selector;
53
53
  violations = [];
54
54
  suggestions = [];
55
55
  axeResults = {};
56
- _context.next = 6;
56
+ _context.next = 1;
57
57
  return _puppeteer2.default.launch();
58
- case 6:
58
+ case 1:
59
59
  browser = _context.sent;
60
- _context.next = 9;
60
+ _context.next = 2;
61
61
  return browser.newPage();
62
- case 9:
62
+ case 2:
63
63
  page = _context.sent;
64
- _context.prev = 10;
65
- _context.next = 13;
64
+ _context.prev = 3;
65
+ _context.next = 4;
66
66
  return page.goto(url, {
67
67
  waitUntil: 'networkidle0'
68
68
  });
69
- case 13:
69
+ case 4:
70
70
  if (!selector) {
71
- _context.next = 22;
71
+ _context.next = 7;
72
72
  break;
73
73
  }
74
- _context.next = 16;
74
+ _context.next = 5;
75
75
  return page.$(selector);
76
- case 16:
76
+ case 5:
77
77
  elementExists = _context.sent;
78
78
  if (elementExists) {
79
- _context.next = 22;
79
+ _context.next = 7;
80
80
  break;
81
81
  }
82
- _context.next = 20;
82
+ _context.next = 6;
83
83
  return page.evaluate(function () {
84
84
  var elements = Array.from(document.querySelectorAll('[id]'));
85
85
  return elements.map(function (el) {
86
86
  return "#".concat(el.id);
87
87
  });
88
88
  });
89
- case 20:
89
+ case 6:
90
90
  availableElements = _context.sent;
91
91
  throw new Error("Element with selector \"".concat(selector, "\" not found on the page after waiting. Available elements: ").concat(availableElements.join(', ')));
92
- case 22:
92
+ case 7:
93
93
  // Run axe-core accessibility analysis
94
94
  axePuppeteer = new _puppeteer.AxePuppeteer(page); // If selector is provided, analyze only that element
95
95
  if (selector) {
96
96
  axePuppeteer.include(selector);
97
97
  }
98
- _context.next = 26;
98
+ _context.next = 8;
99
99
  return axePuppeteer.analyze();
100
- case 26:
100
+ case 8:
101
101
  results = _context.sent;
102
102
  if (results.violations && results.violations.length > 0) {
103
103
  adsViolations = mapAxeViolationsToADSFixes(results.violations);
@@ -153,9 +153,9 @@ var analyzeLocalhostA11yTool = exports.analyzeLocalhostA11yTool = /*#__PURE__*/f
153
153
  incomplete: ((_axeResults$incomplet = axeResults.incomplete) === null || _axeResults$incomplet === void 0 ? void 0 : _axeResults$incomplet.length) || 0
154
154
  }
155
155
  };
156
- _context.next = 37;
156
+ _context.next = 9;
157
157
  return browser.close();
158
- case 37:
158
+ case 9:
159
159
  return _context.abrupt("return", {
160
160
  content: [{
161
161
  type: 'text',
@@ -169,12 +169,12 @@ var analyzeLocalhostA11yTool = exports.analyzeLocalhostA11yTool = /*#__PURE__*/f
169
169
  }, null, 2)
170
170
  }]
171
171
  });
172
- case 40:
173
- _context.prev = 40;
174
- _context.t0 = _context["catch"](10);
175
- _context.next = 44;
172
+ case 10:
173
+ _context.prev = 10;
174
+ _t = _context["catch"](3);
175
+ _context.next = 11;
176
176
  return browser.close();
177
- case 44:
177
+ case 11:
178
178
  return _context.abrupt("return", {
179
179
  content: [{
180
180
  type: 'text',
@@ -197,16 +197,16 @@ var analyzeLocalhostA11yTool = exports.analyzeLocalhostA11yTool = /*#__PURE__*/f
197
197
  },
198
198
  violations: violations,
199
199
  suggestions: [],
200
- error: String(_context.t0),
200
+ error: String(_t),
201
201
  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']
202
202
  }, null, 2)
203
203
  }]
204
204
  });
205
- case 45:
205
+ case 12:
206
206
  case "end":
207
207
  return _context.stop();
208
208
  }
209
- }, _callee, null, [[10, 40]]);
209
+ }, _callee, null, [[3, 10]]);
210
210
  }));
211
211
  return function analyzeLocalhostA11yTool(_x) {
212
212
  return _ref.apply(this, arguments);
@@ -15,12 +15,12 @@ var topics = Object.keys(_guidelines.accessibilityGuidelines);
15
15
  var getA11yGuidelinesTool = exports.getA11yGuidelinesTool = /*#__PURE__*/function () {
16
16
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
17
17
  var topic, guidelines;
18
- return _regenerator.default.wrap(function _callee$(_context) {
18
+ return _regenerator.default.wrap(function (_context) {
19
19
  while (1) switch (_context.prev = _context.next) {
20
20
  case 0:
21
21
  topic = _ref.topic;
22
22
  if (!(topic && _guidelines.accessibilityGuidelines[topic])) {
23
- _context.next = 4;
23
+ _context.next = 1;
24
24
  break;
25
25
  }
26
26
  guidelines = _guidelines.accessibilityGuidelines[topic];
@@ -34,7 +34,7 @@ var getA11yGuidelinesTool = exports.getA11yGuidelinesTool = /*#__PURE__*/functio
34
34
  }), null, 2)
35
35
  }]
36
36
  });
37
- case 4:
37
+ case 1:
38
38
  return _context.abrupt("return", {
39
39
  content: [{
40
40
  type: 'text',
@@ -46,7 +46,7 @@ var getA11yGuidelinesTool = exports.getA11yGuidelinesTool = /*#__PURE__*/functio
46
46
  }, null, 2)
47
47
  }]
48
48
  });
49
- case 5:
49
+ case 2:
50
50
  case "end":
51
51
  return _context.stop();
52
52
  }