@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
package/dist/esm/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
5
5
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
7
|
import { CallToolRequestSchema, ListToolsRequestSchema, McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { sendOperationalEvent } from './helpers/analytics';
|
|
10
9
|
import { validateToolArguments } from './helpers/validation';
|
|
11
10
|
import { instructions } from './instructions';
|
|
@@ -15,9 +14,7 @@ import { getAllIconsTool, listGetAllIconsTool } from './tools/get-all-icons';
|
|
|
15
14
|
import { getAllTokensTool, listGetAllTokensTool } from './tools/get-all-tokens';
|
|
16
15
|
import { getComponentsTool, listGetComponentsTool } from './tools/get-components';
|
|
17
16
|
import { getGuidelinesInputSchema, getGuidelinesTool, listGetGuidelinesTool } from './tools/get-guidelines';
|
|
18
|
-
import { getIconsInputSchema, getIconsTool, listGetIconsTool } from './tools/get-icons';
|
|
19
17
|
import { getLintRulesInputSchema, getLintRulesTool, listGetLintRulesTool } from './tools/get-lint-rules';
|
|
20
|
-
import { getTokensInputSchema, getTokensTool, listGetTokensTool } from './tools/get-tokens';
|
|
21
18
|
import { i18nConversionInputSchema, i18nConversionTool, listI18nConversionTool } from './tools/i18n-conversion';
|
|
22
19
|
import { listMigrationGuidesTool, migrationGuidesInputSchema, migrationGuidesTool } from './tools/migration-guides';
|
|
23
20
|
import { listPlanTool, planInputSchema, planTool } from './tools/plan';
|
|
@@ -58,7 +55,8 @@ var generateLogger = function generateLogger(level) {
|
|
|
58
55
|
};
|
|
59
56
|
};
|
|
60
57
|
export var getToolRegistry = function getToolRegistry() {
|
|
61
|
-
var
|
|
58
|
+
var _baseTools;
|
|
59
|
+
var baseTools = (_baseTools = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_baseTools, listAnalyzeA11yTool.name, {
|
|
62
60
|
handler: analyzeA11yTool,
|
|
63
61
|
inputSchema: analyzeA11yInputSchema,
|
|
64
62
|
tool: listAnalyzeA11yTool
|
|
@@ -90,42 +88,23 @@ export var getToolRegistry = function getToolRegistry() {
|
|
|
90
88
|
handler: i18nConversionTool,
|
|
91
89
|
inputSchema: i18nConversionInputSchema,
|
|
92
90
|
tool: listI18nConversionTool
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
tool: listGetLintRulesTool
|
|
111
|
-
};
|
|
112
|
-
baseTools[listGetGuidelinesTool.name] = {
|
|
113
|
-
handler: getGuidelinesTool,
|
|
114
|
-
inputSchema: getGuidelinesInputSchema,
|
|
115
|
-
tool: listGetGuidelinesTool
|
|
116
|
-
};
|
|
117
|
-
} else {
|
|
118
|
-
baseTools[listGetAllTokensTool.name] = {
|
|
119
|
-
handler: getAllTokensTool,
|
|
120
|
-
inputSchema: null,
|
|
121
|
-
tool: listGetAllTokensTool
|
|
122
|
-
};
|
|
123
|
-
baseTools[listGetAllIconsTool.name] = {
|
|
124
|
-
handler: getAllIconsTool,
|
|
125
|
-
inputSchema: null,
|
|
126
|
-
tool: listGetAllIconsTool
|
|
127
|
-
};
|
|
128
|
-
}
|
|
91
|
+
}), listGetGuidelinesTool.name, {
|
|
92
|
+
handler: getGuidelinesTool,
|
|
93
|
+
inputSchema: getGuidelinesInputSchema,
|
|
94
|
+
tool: listGetGuidelinesTool
|
|
95
|
+
}), listGetAllTokensTool.name, {
|
|
96
|
+
handler: getAllTokensTool,
|
|
97
|
+
inputSchema: null,
|
|
98
|
+
tool: listGetAllTokensTool
|
|
99
|
+
}), _defineProperty(_defineProperty(_baseTools, listGetAllIconsTool.name, {
|
|
100
|
+
handler: getAllIconsTool,
|
|
101
|
+
inputSchema: null,
|
|
102
|
+
tool: listGetAllIconsTool
|
|
103
|
+
}), listGetLintRulesTool.name, {
|
|
104
|
+
handler: getLintRulesTool,
|
|
105
|
+
inputSchema: getLintRulesInputSchema,
|
|
106
|
+
tool: listGetLintRulesTool
|
|
107
|
+
}));
|
|
129
108
|
return baseTools;
|
|
130
109
|
};
|
|
131
110
|
server.setRequestHandler(ListToolsRequestSchema, /*#__PURE__*/function () {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import metadata from '@atlaskit/icon-lab/metadata';
|
|
4
|
+
import { coreIconMetadata } from '@atlaskit/icon/metadata';
|
|
5
|
+
|
|
6
|
+
// https://hello.atlassian.net/wiki/spaces/DST/pages/6558719954/Icon+content+type
|
|
7
|
+
|
|
8
|
+
export var icons = [].concat(_toConsumableArray(Object.entries(coreIconMetadata).map(function (_ref) {
|
|
9
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
10
|
+
_key = _ref2[0],
|
|
11
|
+
icon = _ref2[1];
|
|
12
|
+
return {
|
|
13
|
+
componentName: icon.componentName,
|
|
14
|
+
package: icon.package,
|
|
15
|
+
categorization: icon.categorization,
|
|
16
|
+
keywords: icon.keywords,
|
|
17
|
+
status: icon.status,
|
|
18
|
+
usage: icon.usage,
|
|
19
|
+
shouldRecommendSmallIcon: icon.shouldRecommendSmallIcon,
|
|
20
|
+
team: icon.team
|
|
21
|
+
};
|
|
22
|
+
})), _toConsumableArray(Object.entries(metadata).map(function (_ref3) {
|
|
23
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
24
|
+
_key = _ref4[0],
|
|
25
|
+
icon = _ref4[1];
|
|
26
|
+
return {
|
|
27
|
+
componentName: icon.componentName,
|
|
28
|
+
package: icon.package,
|
|
29
|
+
categorization: icon.categorization,
|
|
30
|
+
//???
|
|
31
|
+
keywords: icon.keywords,
|
|
32
|
+
status: icon.status,
|
|
33
|
+
usage: icon.usage,
|
|
34
|
+
shouldRecommendSmallIcon: icon.shouldRecommendSmallIcon,
|
|
35
|
+
team: icon.team
|
|
36
|
+
};
|
|
37
|
+
})));
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
3
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
5
4
|
|
|
6
5
|
import { z } from 'zod';
|
|
7
|
-
import { coreIconMetadata } from '@atlaskit/icon/metadata';
|
|
8
6
|
import { zodToJsonSchema } from '../../helpers';
|
|
9
|
-
|
|
10
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
11
|
-
_key = _ref2[0],
|
|
12
|
-
icon = _ref2[1];
|
|
13
|
-
return {
|
|
14
|
-
componentName: icon.componentName,
|
|
15
|
-
package: icon.package,
|
|
16
|
-
categorization: icon.categorization,
|
|
17
|
-
keywords: icon.keywords,
|
|
18
|
-
status: icon.status,
|
|
19
|
-
usage: icon.usage,
|
|
20
|
-
shouldRecommendSmallIcon: icon.shouldRecommendSmallIcon
|
|
21
|
-
};
|
|
22
|
-
});
|
|
7
|
+
import { icons } from './icons';
|
|
23
8
|
export var listGetAllIconsTool = {
|
|
24
9
|
name: 'ads_get_all_icons',
|
|
25
10
|
description: "Fetch all Atlassian Design System icons. Only use when `ads_search_icons` does not return what you're looking for.",
|
|
@@ -33,7 +18,7 @@ export var listGetAllIconsTool = {
|
|
|
33
18
|
inputSchema: zodToJsonSchema(z.object({}))
|
|
34
19
|
};
|
|
35
20
|
export var getAllIconsTool = /*#__PURE__*/function () {
|
|
36
|
-
var
|
|
21
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
37
22
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
38
23
|
while (1) switch (_context.prev = _context.next) {
|
|
39
24
|
case 0:
|
|
@@ -54,6 +39,6 @@ export var getAllIconsTool = /*#__PURE__*/function () {
|
|
|
54
39
|
}, _callee);
|
|
55
40
|
}));
|
|
56
41
|
return function getAllIconsTool() {
|
|
57
|
-
return
|
|
42
|
+
return _ref.apply(this, arguments);
|
|
58
43
|
};
|
|
59
44
|
}();
|
|
@@ -3,8 +3,8 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
4
4
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { tokens } from '@atlaskit/tokens/token-metadata';
|
|
7
6
|
import { zodToJsonSchema } from '../../helpers';
|
|
7
|
+
import { tokens } from './tokens';
|
|
8
8
|
var inputSchema = z.object({});
|
|
9
9
|
export var listGetAllTokensTool = {
|
|
10
10
|
name: 'ads_get_all_tokens',
|
|
@@ -29,10 +29,7 @@ export var getAllTokensTool = /*#__PURE__*/function () {
|
|
|
29
29
|
// NOTE: Ideally one day the MCP would support structured content…
|
|
30
30
|
// eg. `type: 'object', data: token`
|
|
31
31
|
type: 'text',
|
|
32
|
-
text: JSON.stringify(
|
|
33
|
-
name: token.name,
|
|
34
|
-
exampleValue: token.exampleValue
|
|
35
|
-
}, null, 2)
|
|
32
|
+
text: JSON.stringify(token, null, 2)
|
|
36
33
|
};
|
|
37
34
|
})
|
|
38
35
|
});
|
|
@@ -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 var tokens = tokenMetadata.map(function (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
|
+
});
|