@atlaskit/ads-mcp 0.7.2 → 0.8.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 +14 -0
- package/README.md +63 -2
- package/dist/cjs/helpers/analytics.js +98 -0
- package/dist/cjs/index.js +142 -28
- package/dist/cjs/tools/analyze-a11y/index.js +38 -38
- package/dist/cjs/tools/get-a11y-guidelines/index.js +4 -4
- package/dist/cjs/tools/get-all-icons/index.js +1 -1
- package/dist/cjs/tools/get-all-tokens/index.js +1 -1
- package/dist/cjs/tools/get-components/components.js +2 -2
- package/dist/cjs/tools/get-components/index.js +1 -1
- package/dist/cjs/tools/plan/index.js +6 -6
- package/dist/cjs/tools/search-components/index.js +9 -9
- package/dist/cjs/tools/search-icons/index.js +9 -9
- package/dist/cjs/tools/search-tokens/index.js +5 -5
- package/dist/cjs/tools/suggest-a11y-fixes/index.js +4 -4
- package/dist/es2019/helpers/analytics.js +88 -0
- package/dist/es2019/index.js +118 -15
- package/dist/es2019/tools/get-components/components.js +2 -2
- package/dist/esm/helpers/analytics.js +90 -0
- package/dist/esm/index.js +143 -29
- package/dist/esm/tools/analyze-a11y/index.js +38 -38
- package/dist/esm/tools/get-a11y-guidelines/index.js +4 -4
- package/dist/esm/tools/get-all-icons/index.js +1 -1
- package/dist/esm/tools/get-all-tokens/index.js +1 -1
- package/dist/esm/tools/get-components/components.js +2 -2
- package/dist/esm/tools/get-components/index.js +1 -1
- package/dist/esm/tools/plan/index.js +6 -6
- package/dist/esm/tools/search-components/index.js +9 -9
- package/dist/esm/tools/search-icons/index.js +9 -9
- package/dist/esm/tools/search-tokens/index.js +5 -5
- package/dist/esm/tools/suggest-a11y-fixes/index.js +4 -4
- package/dist/types/helpers/analytics.d.ts +28 -0
- package/dist/types/tools/get-components/components.d.ts +1 -1
- package/dist/types-ts4.5/helpers/analytics.d.ts +28 -0
- package/dist/types-ts4.5/tools/get-components/components.d.ts +1 -1
- package/package.json +4 -1
|
@@ -43,13 +43,13 @@ export var listSearchIconsTool = {
|
|
|
43
43
|
export var searchIconsTool = /*#__PURE__*/function () {
|
|
44
44
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
45
45
|
var terms, _params$limit, limit, _params$exactName, exactName, searchTerms, exactNameMatches, fuse, results, uniqueResults, matchedIcons;
|
|
46
|
-
return _regeneratorRuntime.wrap(function
|
|
46
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
47
47
|
while (1) switch (_context.prev = _context.next) {
|
|
48
48
|
case 0:
|
|
49
49
|
terms = params.terms, _params$limit = params.limit, limit = _params$limit === void 0 ? 1 : _params$limit, _params$exactName = params.exactName, exactName = _params$exactName === void 0 ? false : _params$exactName;
|
|
50
50
|
searchTerms = terms.filter(Boolean).map(cleanQuery);
|
|
51
51
|
if (searchTerms.length) {
|
|
52
|
-
_context.next =
|
|
52
|
+
_context.next = 1;
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
return _context.abrupt("return", {
|
|
@@ -59,9 +59,9 @@ export var searchIconsTool = /*#__PURE__*/function () {
|
|
|
59
59
|
text: "Error: Required parameter 'terms' is missing or empty"
|
|
60
60
|
}]
|
|
61
61
|
});
|
|
62
|
-
case
|
|
62
|
+
case 1:
|
|
63
63
|
if (!exactName) {
|
|
64
|
-
_context.next =
|
|
64
|
+
_context.next = 2;
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
// for each search term, search for the exact match
|
|
@@ -71,7 +71,7 @@ export var searchIconsTool = /*#__PURE__*/function () {
|
|
|
71
71
|
});
|
|
72
72
|
}).filter(Boolean);
|
|
73
73
|
if (!(exactNameMatches.length > 0)) {
|
|
74
|
-
_context.next =
|
|
74
|
+
_context.next = 2;
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
return _context.abrupt("return", {
|
|
@@ -80,7 +80,7 @@ export var searchIconsTool = /*#__PURE__*/function () {
|
|
|
80
80
|
text: JSON.stringify(exactNameMatches)
|
|
81
81
|
}]
|
|
82
82
|
});
|
|
83
|
-
case
|
|
83
|
+
case 2:
|
|
84
84
|
// use Fuse.js to fuzzy-search through the icons
|
|
85
85
|
fuse = new Fuse(icons, {
|
|
86
86
|
keys: [{
|
|
@@ -117,7 +117,7 @@ export var searchIconsTool = /*#__PURE__*/function () {
|
|
|
117
117
|
return fuse.search(term).slice(0, limit);
|
|
118
118
|
}).flat();
|
|
119
119
|
if (results.length) {
|
|
120
|
-
_context.next =
|
|
120
|
+
_context.next = 3;
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
return _context.abrupt("return", {
|
|
@@ -129,7 +129,7 @@ export var searchIconsTool = /*#__PURE__*/function () {
|
|
|
129
129
|
}).join(', '))
|
|
130
130
|
}]
|
|
131
131
|
});
|
|
132
|
-
case
|
|
132
|
+
case 3:
|
|
133
133
|
// Remove duplicates based on componentName
|
|
134
134
|
uniqueResults = results.filter(function (result, index, arr) {
|
|
135
135
|
return arr.findIndex(function (r) {
|
|
@@ -149,7 +149,7 @@ export var searchIconsTool = /*#__PURE__*/function () {
|
|
|
149
149
|
text: JSON.stringify(matchedIcons)
|
|
150
150
|
}]
|
|
151
151
|
});
|
|
152
|
-
case
|
|
152
|
+
case 4:
|
|
153
153
|
case "end":
|
|
154
154
|
return _context.stop();
|
|
155
155
|
}
|
|
@@ -25,13 +25,13 @@ export var listSearchTokensTool = {
|
|
|
25
25
|
export var searchTokensTool = /*#__PURE__*/function () {
|
|
26
26
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
27
27
|
var terms, _params$limit, limit, _params$exactName, exactName, searchTerms, exactNameMatches, fuse, results, uniqueResults, matchedTokens;
|
|
28
|
-
return _regeneratorRuntime.wrap(function
|
|
28
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
|
30
30
|
case 0:
|
|
31
31
|
terms = params.terms, _params$limit = params.limit, limit = _params$limit === void 0 ? 1 : _params$limit, _params$exactName = params.exactName, exactName = _params$exactName === void 0 ? false : _params$exactName;
|
|
32
32
|
searchTerms = terms.filter(Boolean).map(cleanQuery);
|
|
33
33
|
if (!exactName) {
|
|
34
|
-
_context.next =
|
|
34
|
+
_context.next = 1;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
37
|
// for each search term, search for the exact match
|
|
@@ -41,7 +41,7 @@ export var searchTokensTool = /*#__PURE__*/function () {
|
|
|
41
41
|
});
|
|
42
42
|
}).filter(Boolean);
|
|
43
43
|
if (!(exactNameMatches.length > 0)) {
|
|
44
|
-
_context.next =
|
|
44
|
+
_context.next = 1;
|
|
45
45
|
break;
|
|
46
46
|
}
|
|
47
47
|
return _context.abrupt("return", {
|
|
@@ -55,7 +55,7 @@ export var searchTokensTool = /*#__PURE__*/function () {
|
|
|
55
55
|
}))
|
|
56
56
|
}]
|
|
57
57
|
});
|
|
58
|
-
case
|
|
58
|
+
case 1:
|
|
59
59
|
// use Fuse.js to fuzzy-search for the tokens
|
|
60
60
|
fuse = new Fuse(tokens, {
|
|
61
61
|
keys: [{
|
|
@@ -90,7 +90,7 @@ export var searchTokensTool = /*#__PURE__*/function () {
|
|
|
90
90
|
text: JSON.stringify(matchedTokens)
|
|
91
91
|
}]
|
|
92
92
|
});
|
|
93
|
-
case
|
|
93
|
+
case 2:
|
|
94
94
|
case "end":
|
|
95
95
|
return _context.stop();
|
|
96
96
|
}
|
|
@@ -111,13 +111,13 @@ function findBestMatchingFix(violation) {
|
|
|
111
111
|
export var suggestA11yFixesTool = /*#__PURE__*/function () {
|
|
112
112
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
|
113
113
|
var violation, component, context, match, _match, key, fix;
|
|
114
|
-
return _regeneratorRuntime.wrap(function
|
|
114
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
115
115
|
while (1) switch (_context.prev = _context.next) {
|
|
116
116
|
case 0:
|
|
117
117
|
violation = params.violation, component = params.component, context = params.context; // Use improved matching logic
|
|
118
118
|
match = findBestMatchingFix(violation);
|
|
119
119
|
if (!match) {
|
|
120
|
-
_context.next =
|
|
120
|
+
_context.next = 1;
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
_match = _slicedToArray(match, 2), key = _match[0], fix = _match[1];
|
|
@@ -135,7 +135,7 @@ export var suggestA11yFixesTool = /*#__PURE__*/function () {
|
|
|
135
135
|
}), null, 2)
|
|
136
136
|
}]
|
|
137
137
|
});
|
|
138
|
-
case
|
|
138
|
+
case 1:
|
|
139
139
|
return _context.abrupt("return", {
|
|
140
140
|
content: [{
|
|
141
141
|
type: 'text',
|
|
@@ -166,7 +166,7 @@ export var suggestA11yFixesTool = /*#__PURE__*/function () {
|
|
|
166
166
|
}, null, 2)
|
|
167
167
|
}]
|
|
168
168
|
});
|
|
169
|
-
case
|
|
169
|
+
case 2:
|
|
170
170
|
case "end":
|
|
171
171
|
return _context.stop();
|
|
172
172
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const staffId: string;
|
|
2
|
+
/**
|
|
3
|
+
* This is a user-passed value via environment to define what agent we may be running in.
|
|
4
|
+
* This could be anything, do not rely on it!
|
|
5
|
+
* @default `'unknown'`
|
|
6
|
+
*/
|
|
7
|
+
type AGENT = 'cursor' | 'vscode' | 'rovodev' | 'codelassian' | string;
|
|
8
|
+
export declare const agent: AGENT;
|
|
9
|
+
/**
|
|
10
|
+
* The path to the MCP config file that is being used to run the MCP server
|
|
11
|
+
* e.g. 'mcp.json', 'jira/.cursor/mcp.json', 'platform/.vscode/mcp.json' or 'unknown'
|
|
12
|
+
* This could be anything, do not rely on it!
|
|
13
|
+
* @default `'unknown'`
|
|
14
|
+
*/
|
|
15
|
+
export declare const configPath: string;
|
|
16
|
+
interface OperationalEventOptions {
|
|
17
|
+
action: string;
|
|
18
|
+
actionSubject: string;
|
|
19
|
+
actionSubjectId?: string;
|
|
20
|
+
attributes?: Record<string, any>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Send an operational event to analytics
|
|
24
|
+
* Wraps the analytics client and handles errors gracefully
|
|
25
|
+
* If analytics client is not available, this function is a no-op
|
|
26
|
+
*/
|
|
27
|
+
export declare function sendOperationalEvent({ action, actionSubject, actionSubjectId, attributes, }: OperationalEventOptions): void;
|
|
28
|
+
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates TypeScript components data for AI tooling from offerings.json files
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::1792e8b918fbdc85769f6ddf38970c58>>
|
|
7
7
|
* @codegenCommand yarn workspace @af/ads-ai-tooling codegen:prototyping
|
|
8
8
|
*/
|
|
9
9
|
import type { Component } from './types';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const staffId: string;
|
|
2
|
+
/**
|
|
3
|
+
* This is a user-passed value via environment to define what agent we may be running in.
|
|
4
|
+
* This could be anything, do not rely on it!
|
|
5
|
+
* @default `'unknown'`
|
|
6
|
+
*/
|
|
7
|
+
type AGENT = 'cursor' | 'vscode' | 'rovodev' | 'codelassian' | string;
|
|
8
|
+
export declare const agent: AGENT;
|
|
9
|
+
/**
|
|
10
|
+
* The path to the MCP config file that is being used to run the MCP server
|
|
11
|
+
* e.g. 'mcp.json', 'jira/.cursor/mcp.json', 'platform/.vscode/mcp.json' or 'unknown'
|
|
12
|
+
* This could be anything, do not rely on it!
|
|
13
|
+
* @default `'unknown'`
|
|
14
|
+
*/
|
|
15
|
+
export declare const configPath: string;
|
|
16
|
+
interface OperationalEventOptions {
|
|
17
|
+
action: string;
|
|
18
|
+
actionSubject: string;
|
|
19
|
+
actionSubjectId?: string;
|
|
20
|
+
attributes?: Record<string, any>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Send an operational event to analytics
|
|
24
|
+
* Wraps the analytics client and handles errors gracefully
|
|
25
|
+
* If analytics client is not available, this function is a no-op
|
|
26
|
+
*/
|
|
27
|
+
export declare function sendOperationalEvent({ action, actionSubject, actionSubjectId, attributes, }: OperationalEventOptions): void;
|
|
28
|
+
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates TypeScript components data for AI tooling from offerings.json files
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::1792e8b918fbdc85769f6ddf38970c58>>
|
|
7
7
|
* @codegenCommand yarn workspace @af/ads-ai-tooling codegen:prototyping
|
|
8
8
|
*/
|
|
9
9
|
import type { Component } from './types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/ads-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "The official Atlassian Design System MCP server to develop apps and user interfaces matching the Atlassian style.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
"zod": "^3.23.8",
|
|
41
41
|
"zod-to-json-schema": "^3.24.5"
|
|
42
42
|
},
|
|
43
|
+
"optionalDependencies": {
|
|
44
|
+
"@atlassiansox/analytics-node-client": "^4.0.0"
|
|
45
|
+
},
|
|
43
46
|
"devDependencies": {
|
|
44
47
|
"ts-node": "^10.9.1"
|
|
45
48
|
}
|