@atlaskit/ads-mcp 0.17.1 → 0.17.3
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 +13 -0
- package/README.md +88 -0
- package/dist/cjs/index.js +19 -40
- package/dist/cjs/tools/get-all-icons/icons.js +43 -0
- package/dist/cjs/tools/get-all-icons/index.js +4 -19
- package/dist/cjs/tools/get-all-tokens/index.js +3 -6
- package/dist/cjs/tools/get-all-tokens/tokens.js +18 -0
- package/dist/cjs/tools/get-components/components.codegen.js +8 -0
- package/dist/cjs/tools/get-components/components.js +423 -235
- package/dist/cjs/tools/get-components/index.js +2 -2
- package/dist/cjs/tools/get-components/load-all-components.js +16 -0
- package/dist/cjs/tools/get-guidelines/guidelines-structured-content.codegen.js +72 -6
- package/dist/cjs/tools/get-lint-rules/lint-rules-structured-content.codegen.js +111 -7
- package/dist/cjs/tools/search-components/index.js +13 -12
- package/dist/cjs/tools/search-icons/index.js +7 -24
- package/dist/es2019/index.js +13 -31
- package/dist/es2019/tools/get-all-icons/icons.js +25 -0
- package/dist/es2019/tools/get-all-icons/index.js +1 -10
- package/dist/es2019/tools/get-all-tokens/index.js +2 -5
- package/dist/es2019/tools/get-all-tokens/tokens.js +13 -0
- package/dist/es2019/tools/get-components/components.codegen.js +8 -0
- package/dist/es2019/tools/get-components/components.js +423 -235
- package/dist/es2019/tools/get-components/index.js +11 -9
- package/dist/es2019/tools/get-components/load-all-components.js +10 -0
- package/dist/es2019/tools/get-guidelines/guidelines-structured-content.codegen.js +72 -6
- package/dist/es2019/tools/get-lint-rules/lint-rules-structured-content.codegen.js +111 -7
- package/dist/es2019/tools/search-components/index.js +2 -1
- package/dist/es2019/tools/search-icons/index.js +1 -10
- package/dist/esm/index.js +19 -40
- package/dist/esm/tools/get-all-icons/icons.js +37 -0
- package/dist/esm/tools/get-all-icons/index.js +3 -18
- package/dist/esm/tools/get-all-tokens/index.js +2 -5
- package/dist/esm/tools/get-all-tokens/tokens.js +13 -0
- package/dist/esm/tools/get-components/components.codegen.js +8 -0
- package/dist/esm/tools/get-components/components.js +423 -235
- package/dist/esm/tools/get-components/index.js +2 -2
- package/dist/esm/tools/get-components/load-all-components.js +10 -0
- package/dist/esm/tools/get-guidelines/guidelines-structured-content.codegen.js +72 -6
- package/dist/esm/tools/get-lint-rules/lint-rules-structured-content.codegen.js +111 -7
- package/dist/esm/tools/search-components/index.js +9 -8
- package/dist/esm/tools/search-icons/index.js +3 -20
- package/dist/types/tools/get-all-icons/icons.d.ts +11 -0
- package/dist/types/tools/get-all-tokens/tokens.d.ts +7 -0
- package/dist/types/tools/get-components/components.codegen.d.ts +10 -0
- package/dist/types/tools/get-components/components.d.ts +1 -1
- package/dist/types/tools/get-components/load-all-components.d.ts +2 -0
- package/dist/types/tools/get-components/types.d.ts +20 -14
- package/dist/types/tools/get-guidelines/guidelines-structured-content.codegen.d.ts +1 -1
- package/dist/types/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +1 -1
- package/dist/types-ts4.5/tools/get-all-icons/icons.d.ts +11 -0
- package/dist/types-ts4.5/tools/get-all-tokens/tokens.d.ts +7 -0
- package/dist/types-ts4.5/tools/get-components/components.codegen.d.ts +10 -0
- package/dist/types-ts4.5/tools/get-components/components.d.ts +1 -1
- package/dist/types-ts4.5/tools/get-components/load-all-components.d.ts +2 -0
- package/dist/types-ts4.5/tools/get-components/types.d.ts +20 -14
- package/dist/types-ts4.5/tools/get-guidelines/guidelines-structured-content.codegen.d.ts +1 -1
- package/dist/types-ts4.5/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +1 -1
- package/package.json +5 -3
- package/dist/cjs/tools/get-icons/icon-mcp-structured-content.codegen.js +0 -8
- package/dist/cjs/tools/get-icons/icon-structured-content.codegen.js +0 -8
- package/dist/cjs/tools/get-icons/index.js +0 -135
- package/dist/cjs/tools/get-tokens/index.js +0 -125
- package/dist/cjs/tools/get-tokens/token-mcp-structured-content.codegen.js +0 -2356
- package/dist/cjs/tools/get-tokens/token-structured-content.codegen.js +0 -2356
- package/dist/es2019/tools/get-icons/icon-mcp-structured-content.codegen.js +0 -8
- package/dist/es2019/tools/get-icons/icon-structured-content.codegen.js +0 -8
- package/dist/es2019/tools/get-icons/index.js +0 -110
- package/dist/es2019/tools/get-tokens/index.js +0 -100
- package/dist/es2019/tools/get-tokens/token-mcp-structured-content.codegen.js +0 -2350
- package/dist/es2019/tools/get-tokens/token-structured-content.codegen.js +0 -2350
- package/dist/esm/tools/get-icons/icon-mcp-structured-content.codegen.js +0 -8
- package/dist/esm/tools/get-icons/icon-structured-content.codegen.js +0 -8
- package/dist/esm/tools/get-icons/index.js +0 -128
- package/dist/esm/tools/get-tokens/index.js +0 -118
- package/dist/esm/tools/get-tokens/token-mcp-structured-content.codegen.js +0 -2350
- package/dist/esm/tools/get-tokens/token-structured-content.codegen.js +0 -2350
- package/dist/types/tools/get-icons/icon-mcp-structured-content.codegen.d.ts +0 -13
- package/dist/types/tools/get-icons/icon-structured-content.codegen.d.ts +0 -13
- package/dist/types/tools/get-icons/index.d.ts +0 -35
- package/dist/types/tools/get-tokens/index.d.ts +0 -35
- package/dist/types/tools/get-tokens/token-mcp-structured-content.codegen.d.ts +0 -13
- package/dist/types/tools/get-tokens/token-structured-content.codegen.d.ts +0 -13
- package/dist/types-ts4.5/tools/get-icons/icon-mcp-structured-content.codegen.d.ts +0 -13
- package/dist/types-ts4.5/tools/get-icons/icon-structured-content.codegen.d.ts +0 -13
- package/dist/types-ts4.5/tools/get-icons/index.d.ts +0 -35
- package/dist/types-ts4.5/tools/get-tokens/index.d.ts +0 -35
- package/dist/types-ts4.5/tools/get-tokens/token-mcp-structured-content.codegen.d.ts +0 -13
- package/dist/types-ts4.5/tools/get-tokens/token-structured-content.codegen.d.ts +0 -13
|
@@ -10,7 +10,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
10
10
|
var _fuse = _interopRequireDefault(require("fuse.js"));
|
|
11
11
|
var _zod = require("zod");
|
|
12
12
|
var _helpers = require("../../helpers");
|
|
13
|
-
var
|
|
13
|
+
var _loadAllComponents = require("../get-components/load-all-components");
|
|
14
14
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
15
15
|
|
|
16
16
|
var searchComponentsInputSchema = exports.searchComponentsInputSchema = _zod.z.object({
|
|
@@ -42,7 +42,7 @@ var cleanComponentResult = function cleanComponentResult(result) {
|
|
|
42
42
|
};
|
|
43
43
|
var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function () {
|
|
44
44
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
|
|
45
|
-
var terms, _params$limit, limit, _params$exactName, exactName, searchTerms, exactNameMatches, fuse, results, uniqueResults;
|
|
45
|
+
var terms, _params$limit, limit, _params$exactName, exactName, searchTerms, components, exactNameMatches, fuse, results, uniqueResults;
|
|
46
46
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
47
47
|
while (1) switch (_context.prev = _context.next) {
|
|
48
48
|
case 0:
|
|
@@ -60,18 +60,19 @@ var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function
|
|
|
60
60
|
}]
|
|
61
61
|
});
|
|
62
62
|
case 4:
|
|
63
|
+
components = (0, _loadAllComponents.loadAllComponents)();
|
|
63
64
|
if (!exactName) {
|
|
64
|
-
_context.next =
|
|
65
|
+
_context.next = 9;
|
|
65
66
|
break;
|
|
66
67
|
}
|
|
67
68
|
// for each search term, search for the exact match
|
|
68
69
|
exactNameMatches = searchTerms.map(function (term) {
|
|
69
|
-
return
|
|
70
|
+
return components.find(function (component) {
|
|
70
71
|
return component.name.toLowerCase() === term.toLowerCase();
|
|
71
72
|
});
|
|
72
73
|
}).filter(Boolean);
|
|
73
74
|
if (!(exactNameMatches.length > 0)) {
|
|
74
|
-
_context.next =
|
|
75
|
+
_context.next = 9;
|
|
75
76
|
break;
|
|
76
77
|
}
|
|
77
78
|
return _context.abrupt("return", {
|
|
@@ -80,9 +81,9 @@ var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function
|
|
|
80
81
|
text: JSON.stringify(exactNameMatches.map(cleanComponentResult))
|
|
81
82
|
}]
|
|
82
83
|
});
|
|
83
|
-
case
|
|
84
|
+
case 9:
|
|
84
85
|
// use Fuse.js to fuzzy-search through the components
|
|
85
|
-
fuse = new _fuse.default(
|
|
86
|
+
fuse = new _fuse.default(components, {
|
|
86
87
|
keys: [{
|
|
87
88
|
name: 'name',
|
|
88
89
|
weight: 3
|
|
@@ -103,7 +104,7 @@ var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function
|
|
|
103
104
|
}); // every search term, search for the results
|
|
104
105
|
results = searchTerms.map(function (term) {
|
|
105
106
|
// always search exact match from the components first
|
|
106
|
-
var exactNameMatch =
|
|
107
|
+
var exactNameMatch = components.find(function (component) {
|
|
107
108
|
return component.name.toLowerCase() === term.toLowerCase();
|
|
108
109
|
});
|
|
109
110
|
if (exactNameMatch) {
|
|
@@ -114,19 +115,19 @@ var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function
|
|
|
114
115
|
return fuse.search(term).slice(0, limit);
|
|
115
116
|
}).flat();
|
|
116
117
|
if (results.length) {
|
|
117
|
-
_context.next =
|
|
118
|
+
_context.next = 13;
|
|
118
119
|
break;
|
|
119
120
|
}
|
|
120
121
|
return _context.abrupt("return", {
|
|
121
122
|
isError: true,
|
|
122
123
|
content: [{
|
|
123
124
|
type: 'text',
|
|
124
|
-
text: "Error: No components found for '".concat(terms.join(', '), "'. Available components: ").concat(
|
|
125
|
+
text: "Error: No components found for '".concat(terms.join(', '), "'. Available components: ").concat(components.map(function (c) {
|
|
125
126
|
return c.name;
|
|
126
127
|
}).join(', '))
|
|
127
128
|
}]
|
|
128
129
|
});
|
|
129
|
-
case
|
|
130
|
+
case 13:
|
|
130
131
|
// Remove duplicates based on component name
|
|
131
132
|
uniqueResults = results.filter(function (result, index, arr) {
|
|
132
133
|
return arr.findIndex(function (r) {
|
|
@@ -141,7 +142,7 @@ var searchComponentsTool = exports.searchComponentsTool = /*#__PURE__*/function
|
|
|
141
142
|
}).map(cleanComponentResult))
|
|
142
143
|
}]
|
|
143
144
|
});
|
|
144
|
-
case
|
|
145
|
+
case 15:
|
|
145
146
|
case "end":
|
|
146
147
|
return _context.stop();
|
|
147
148
|
}
|
|
@@ -7,11 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.searchIconsTool = exports.searchIconsInputSchema = exports.listSearchIconsTool = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
10
|
var _fuse = _interopRequireDefault(require("fuse.js"));
|
|
12
11
|
var _zod = require("zod");
|
|
13
|
-
var _metadata = require("@atlaskit/icon/metadata");
|
|
14
12
|
var _helpers = require("../../helpers");
|
|
13
|
+
var _icons = require("../get-all-icons/icons");
|
|
15
14
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
16
15
|
|
|
17
16
|
var searchIconsInputSchema = exports.searchIconsInputSchema = _zod.z.object({
|
|
@@ -19,22 +18,6 @@ var searchIconsInputSchema = exports.searchIconsInputSchema = _zod.z.object({
|
|
|
19
18
|
limit: _zod.z.number().default(1).describe('Maximum number of results per search term in the array (default: 1)').optional(),
|
|
20
19
|
exactName: _zod.z.boolean().default(false).describe('Enable to explicitly search icons by the exact name match (when you know the name, but need more details)').optional()
|
|
21
20
|
});
|
|
22
|
-
var icons = Object.entries(_metadata.coreIconMetadata).map(function (_ref) {
|
|
23
|
-
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
24
|
-
_key = _ref2[0],
|
|
25
|
-
icon = _ref2[1];
|
|
26
|
-
return {
|
|
27
|
-
componentName: icon.componentName,
|
|
28
|
-
package: icon.package,
|
|
29
|
-
categorization: icon.categorization,
|
|
30
|
-
keywords: icon.keywords,
|
|
31
|
-
status: icon.status,
|
|
32
|
-
usage: icon.usage,
|
|
33
|
-
shouldRecommendSmallIcon: icon.shouldRecommendSmallIcon
|
|
34
|
-
};
|
|
35
|
-
}).filter(function (icon) {
|
|
36
|
-
return icon.status === 'published';
|
|
37
|
-
});
|
|
38
21
|
var listSearchIconsTool = exports.listSearchIconsTool = {
|
|
39
22
|
name: 'ads_search_icons',
|
|
40
23
|
description: "Search for Atlassian Design System icons.\n\nExample icon usage:\n```tsx\nimport AddIcon from '@atlaskit/icon/core/add';\n<AddIcon label=\"Add work item\" size=\"small\" />\n```",
|
|
@@ -48,7 +31,7 @@ var listSearchIconsTool = exports.listSearchIconsTool = {
|
|
|
48
31
|
inputSchema: (0, _helpers.zodToJsonSchema)(searchIconsInputSchema)
|
|
49
32
|
};
|
|
50
33
|
var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
51
|
-
var
|
|
34
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) {
|
|
52
35
|
var terms, _params$limit, limit, _params$exactName, exactName, searchTerms, exactNameMatches, fuse, results, uniqueResults, matchedIcons;
|
|
53
36
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
54
37
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -73,7 +56,7 @@ var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
|
73
56
|
}
|
|
74
57
|
// for each search term, search for the exact match
|
|
75
58
|
exactNameMatches = searchTerms.map(function (term) {
|
|
76
|
-
return icons.find(function (icon) {
|
|
59
|
+
return _icons.icons.find(function (icon) {
|
|
77
60
|
return icon.componentName.toLowerCase() === term.toLowerCase();
|
|
78
61
|
});
|
|
79
62
|
}).filter(Boolean);
|
|
@@ -89,7 +72,7 @@ var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
|
89
72
|
});
|
|
90
73
|
case 8:
|
|
91
74
|
// use Fuse.js to fuzzy-search through the icons
|
|
92
|
-
fuse = new _fuse.default(icons, {
|
|
75
|
+
fuse = new _fuse.default(_icons.icons, {
|
|
93
76
|
keys: [{
|
|
94
77
|
name: 'componentName',
|
|
95
78
|
weight: 3
|
|
@@ -113,7 +96,7 @@ var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
|
113
96
|
}); // every search term, search for the results
|
|
114
97
|
results = searchTerms.map(function (term) {
|
|
115
98
|
// always search exact match from the icons
|
|
116
|
-
var exactNameMatch = icons.find(function (icon) {
|
|
99
|
+
var exactNameMatch = _icons.icons.find(function (icon) {
|
|
117
100
|
return icon.componentName.toLowerCase() === term.toLowerCase();
|
|
118
101
|
});
|
|
119
102
|
if (exactNameMatch) {
|
|
@@ -131,7 +114,7 @@ var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
|
131
114
|
isError: true,
|
|
132
115
|
content: [{
|
|
133
116
|
type: 'text',
|
|
134
|
-
text: "Error: No icons found for '".concat(terms.join(', '), "'. Available icons: ").concat(icons.map(function (i) {
|
|
117
|
+
text: "Error: No icons found for '".concat(terms.join(', '), "'. Available icons: ").concat(_icons.icons.map(function (i) {
|
|
135
118
|
return i.componentName;
|
|
136
119
|
}).join(', '))
|
|
137
120
|
}]
|
|
@@ -163,6 +146,6 @@ var searchIconsTool = exports.searchIconsTool = /*#__PURE__*/function () {
|
|
|
163
146
|
}, _callee);
|
|
164
147
|
}));
|
|
165
148
|
return function searchIconsTool(_x) {
|
|
166
|
-
return
|
|
149
|
+
return _ref.apply(this, arguments);
|
|
167
150
|
};
|
|
168
151
|
}();
|
package/dist/es2019/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { sendOperationalEvent } from './helpers/analytics';
|
|
7
6
|
import { validateToolArguments } from './helpers/validation';
|
|
8
7
|
import { instructions } from './instructions';
|
|
@@ -12,9 +11,7 @@ import { getAllIconsTool, listGetAllIconsTool } from './tools/get-all-icons';
|
|
|
12
11
|
import { getAllTokensTool, listGetAllTokensTool } from './tools/get-all-tokens';
|
|
13
12
|
import { getComponentsTool, listGetComponentsTool } from './tools/get-components';
|
|
14
13
|
import { getGuidelinesInputSchema, getGuidelinesTool, listGetGuidelinesTool } from './tools/get-guidelines';
|
|
15
|
-
import { getIconsInputSchema, getIconsTool, listGetIconsTool } from './tools/get-icons';
|
|
16
14
|
import { getLintRulesInputSchema, getLintRulesTool, listGetLintRulesTool } from './tools/get-lint-rules';
|
|
17
|
-
import { getTokensInputSchema, getTokensTool, listGetTokensTool } from './tools/get-tokens';
|
|
18
15
|
import { i18nConversionInputSchema, i18nConversionTool, listI18nConversionTool } from './tools/i18n-conversion';
|
|
19
16
|
import { listMigrationGuidesTool, migrationGuidesInputSchema, migrationGuidesTool } from './tools/migration-guides';
|
|
20
17
|
import { listPlanTool, planInputSchema, planTool } from './tools/plan';
|
|
@@ -106,43 +103,28 @@ export const getToolRegistry = () => {
|
|
|
106
103
|
handler: i18nConversionTool,
|
|
107
104
|
inputSchema: i18nConversionInputSchema,
|
|
108
105
|
tool: listI18nConversionTool
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// Conditionally add token and icon tools based on feature flag
|
|
113
|
-
if (fg('design_system_mcp_structured_content')) {
|
|
114
|
-
baseTools[listGetTokensTool.name] = {
|
|
115
|
-
handler: getTokensTool,
|
|
116
|
-
inputSchema: getTokensInputSchema,
|
|
117
|
-
tool: listGetTokensTool
|
|
118
|
-
};
|
|
119
|
-
baseTools[listGetIconsTool.name] = {
|
|
120
|
-
handler: getIconsTool,
|
|
121
|
-
inputSchema: getIconsInputSchema,
|
|
122
|
-
tool: listGetIconsTool
|
|
123
|
-
};
|
|
124
|
-
baseTools[listGetLintRulesTool.name] = {
|
|
125
|
-
handler: getLintRulesTool,
|
|
126
|
-
inputSchema: getLintRulesInputSchema,
|
|
127
|
-
tool: listGetLintRulesTool
|
|
128
|
-
};
|
|
129
|
-
baseTools[listGetGuidelinesTool.name] = {
|
|
106
|
+
},
|
|
107
|
+
[listGetGuidelinesTool.name]: {
|
|
130
108
|
handler: getGuidelinesTool,
|
|
131
109
|
inputSchema: getGuidelinesInputSchema,
|
|
132
110
|
tool: listGetGuidelinesTool
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
baseTools[listGetAllTokensTool.name] = {
|
|
111
|
+
},
|
|
112
|
+
[listGetAllTokensTool.name]: {
|
|
136
113
|
handler: getAllTokensTool,
|
|
137
114
|
inputSchema: null,
|
|
138
115
|
tool: listGetAllTokensTool
|
|
139
|
-
}
|
|
140
|
-
|
|
116
|
+
},
|
|
117
|
+
[listGetAllIconsTool.name]: {
|
|
141
118
|
handler: getAllIconsTool,
|
|
142
119
|
inputSchema: null,
|
|
143
120
|
tool: listGetAllIconsTool
|
|
144
|
-
}
|
|
145
|
-
|
|
121
|
+
},
|
|
122
|
+
[listGetLintRulesTool.name]: {
|
|
123
|
+
handler: getLintRulesTool,
|
|
124
|
+
inputSchema: getLintRulesInputSchema,
|
|
125
|
+
tool: listGetLintRulesTool
|
|
126
|
+
}
|
|
127
|
+
};
|
|
146
128
|
return baseTools;
|
|
147
129
|
};
|
|
148
130
|
server.setRequestHandler(ListToolsRequestSchema, async (request, extra) => {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import metadata from '@atlaskit/icon-lab/metadata';
|
|
2
|
+
import { coreIconMetadata } from '@atlaskit/icon/metadata';
|
|
3
|
+
|
|
4
|
+
// https://hello.atlassian.net/wiki/spaces/DST/pages/6558719954/Icon+content+type
|
|
5
|
+
|
|
6
|
+
export const icons = [...Object.entries(coreIconMetadata).map(([_key, icon]) => ({
|
|
7
|
+
componentName: icon.componentName,
|
|
8
|
+
package: icon.package,
|
|
9
|
+
categorization: icon.categorization,
|
|
10
|
+
keywords: icon.keywords,
|
|
11
|
+
status: icon.status,
|
|
12
|
+
usage: icon.usage,
|
|
13
|
+
shouldRecommendSmallIcon: icon.shouldRecommendSmallIcon,
|
|
14
|
+
team: icon.team
|
|
15
|
+
})), ...Object.entries(metadata).map(([_key, icon]) => ({
|
|
16
|
+
componentName: icon.componentName,
|
|
17
|
+
package: icon.package,
|
|
18
|
+
categorization: icon.categorization,
|
|
19
|
+
//???
|
|
20
|
+
keywords: icon.keywords,
|
|
21
|
+
status: icon.status,
|
|
22
|
+
usage: icon.usage,
|
|
23
|
+
shouldRecommendSmallIcon: icon.shouldRecommendSmallIcon,
|
|
24
|
+
team: icon.team
|
|
25
|
+
}))];
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { coreIconMetadata } from '@atlaskit/icon/metadata';
|
|
5
4
|
import { zodToJsonSchema } from '../../helpers';
|
|
6
|
-
|
|
7
|
-
componentName: icon.componentName,
|
|
8
|
-
package: icon.package,
|
|
9
|
-
categorization: icon.categorization,
|
|
10
|
-
keywords: icon.keywords,
|
|
11
|
-
status: icon.status,
|
|
12
|
-
usage: icon.usage,
|
|
13
|
-
shouldRecommendSmallIcon: icon.shouldRecommendSmallIcon
|
|
14
|
-
}));
|
|
5
|
+
import { icons } from './icons';
|
|
15
6
|
export const listGetAllIconsTool = {
|
|
16
7
|
name: 'ads_get_all_icons',
|
|
17
8
|
description: "Fetch all Atlassian Design System icons. Only use when `ads_search_icons` does not return what you're looking for.",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { tokens } from '@atlaskit/tokens/token-metadata';
|
|
5
4
|
import { zodToJsonSchema } from '../../helpers';
|
|
5
|
+
import { tokens } from './tokens';
|
|
6
6
|
const inputSchema = z.object({});
|
|
7
7
|
export const listGetAllTokensTool = {
|
|
8
8
|
name: 'ads_get_all_tokens',
|
|
@@ -21,9 +21,6 @@ export const getAllTokensTool = async () => ({
|
|
|
21
21
|
// NOTE: Ideally one day the MCP would support structured content…
|
|
22
22
|
// eg. `type: 'object', data: token`
|
|
23
23
|
type: 'text',
|
|
24
|
-
text: JSON.stringify(
|
|
25
|
-
name: token.name,
|
|
26
|
-
exampleValue: token.exampleValue
|
|
27
|
-
}, null, 2)
|
|
24
|
+
text: JSON.stringify(token, null, 2)
|
|
28
25
|
}))
|
|
29
26
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { tokens as tokenMetadata } from '@atlaskit/tokens/token-metadata';
|
|
2
|
+
|
|
3
|
+
// https://hello.atlassian.net/wiki/spaces/DST/pages/6558592429/Token+content+type
|
|
4
|
+
|
|
5
|
+
export const tokens = tokenMetadata.map(metadata => {
|
|
6
|
+
var _metadata$exampleValu;
|
|
7
|
+
return {
|
|
8
|
+
name: metadata.name,
|
|
9
|
+
path: metadata.path,
|
|
10
|
+
description: metadata.description,
|
|
11
|
+
exampleValue: String((_metadata$exampleValu = metadata.exampleValue) !== null && _metadata$exampleValu !== void 0 ? _metadata$exampleValu : '')
|
|
12
|
+
};
|
|
13
|
+
});
|