@atlaskit/ads-mcp 1.7.4 → 1.8.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.
- package/CHANGELOG.md +39 -0
- package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
- package/dist/cjs/tools/search-tokens/list-search-tokens-tool.js +1 -1
- package/dist/cjs/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/cjs/tools/search-tokens/search-tokens-tool.js +9 -6
- package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
- package/dist/es2019/tools/search-tokens/list-search-tokens-tool.js +1 -1
- package/dist/es2019/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/es2019/tools/search-tokens/search-tokens-tool.js +6 -2
- package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/tools/search-tokens/list-search-tokens-tool.js +1 -1
- package/dist/esm/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/esm/tools/search-tokens/search-tokens-tool.js +9 -4
- package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
- package/dist/types/tools/search-tokens/search-tokens-input-schema.d.ts +3 -0
- package/dist/types/tools/search-tokens/search-tokens-tool.d.ts +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { zodToJsonSchema } from '../../helpers/zod-to-json-schema';
|
|
|
4
4
|
import { searchTokensInputSchema } from './search-tokens-input-schema';
|
|
5
5
|
export var listSearchTokensTool = {
|
|
6
6
|
name: 'ads_search_tokens',
|
|
7
|
-
description: "Searches Atlassian Design System **design tokens** from bundled metadata. Returns JSON objects with **name** and **exampleValue** for each match (search also considers description, usage guidelines, and CSS property hints in metadata).\n\nWHEN TO USE:\n**Styling or theming in code**\u2014you need the right `token('\u2026')` names for colors, space, typography, etc. Use during layout and visual work when tokens must match ADS. Prefer `ads_plan` when you also need icons and components in the same step.\n\nExample:\n```tsx\nimport { token } from '@atlaskit/tokens';\nconst styles = css({ color: token('color.text'), padding: token('space.100') });\n```",
|
|
7
|
+
description: "Searches Atlassian Design System **design tokens** from bundled metadata. Returns compact JSON objects with **name** and **exampleValue** for each match by default (search also considers description, usage guidelines, and CSS property hints in metadata). Set **includeMetadata** to include usage guidelines in each result.\n\nWHEN TO USE:\n**Styling or theming in code**\u2014you need the right `token('\u2026')` names for colors, space, typography, etc. Use during layout and visual work when tokens must match ADS. Prefer `ads_plan` when you also need icons and components in the same step.\n\nExample:\n```tsx\nimport { token } from '@atlaskit/tokens';\nconst styles = css({ color: token('color.text'), padding: token('space.100') });\n```",
|
|
8
8
|
annotations: {
|
|
9
9
|
title: 'Search ADS tokens',
|
|
10
10
|
readOnlyHint: true,
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export var searchTokensInputSchema = z.object({
|
|
4
4
|
terms: z.array(z.string()).describe('Required: one or more terms; fuzzy match on token **name**, **description**, **exampleValue**, **usageGuidelines.usage**, and **usageGuidelines.cssProperties**. Example: `["spacing", "color.text", "background"]`.'),
|
|
5
|
-
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
5
|
+
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional(),
|
|
6
|
+
includeMetadata: z.boolean().default(false).describe('Include usage guidelines in each result (default false).').optional()
|
|
6
7
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
7
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
5
8
|
|
|
6
9
|
import Fuse from 'fuse.js';
|
|
@@ -9,11 +12,11 @@ import { mergeMultiTermFuseResults } from '../../helpers';
|
|
|
9
12
|
import { cleanQuery } from '../../helpers/clean-query';
|
|
10
13
|
export var searchTokensTool = /*#__PURE__*/function () {
|
|
11
14
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
12
|
-
var terms, _ref$limit, limit, searchTerms, fuse, matchedItems, matchedTokens;
|
|
15
|
+
var terms, _ref$limit, limit, _ref$includeMetadata, includeMetadata, searchTerms, fuse, matchedItems, matchedTokens;
|
|
13
16
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
14
17
|
while (1) switch (_context.prev = _context.next) {
|
|
15
18
|
case 0:
|
|
16
|
-
terms = _ref.terms, _ref$limit = _ref.limit, limit = _ref$limit === void 0 ? 2 : _ref$limit;
|
|
19
|
+
terms = _ref.terms, _ref$limit = _ref.limit, limit = _ref$limit === void 0 ? 2 : _ref$limit, _ref$includeMetadata = _ref.includeMetadata, includeMetadata = _ref$includeMetadata === void 0 ? false : _ref$includeMetadata;
|
|
17
20
|
// Unique cleaned terms (order preserved) so duplicates don't concatenate into a bogus query.
|
|
18
21
|
searchTerms = _toConsumableArray(new Set(terms.filter(Boolean).map(cleanQuery)));
|
|
19
22
|
if (searchTerms.length) {
|
|
@@ -64,10 +67,12 @@ export var searchTokensTool = /*#__PURE__*/function () {
|
|
|
64
67
|
searchTermsJoin: '.'
|
|
65
68
|
});
|
|
66
69
|
matchedTokens = matchedItems.map(function (item) {
|
|
67
|
-
return {
|
|
70
|
+
return _objectSpread({
|
|
68
71
|
name: item.name,
|
|
69
72
|
exampleValue: item.exampleValue
|
|
70
|
-
}
|
|
73
|
+
}, includeMetadata ? {
|
|
74
|
+
usageGuidelines: item.usageGuidelines
|
|
75
|
+
} : {});
|
|
71
76
|
});
|
|
72
77
|
if (matchedTokens.length) {
|
|
73
78
|
_context.next = 2;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Structured content components from design-system *.docs.tsx files
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::4eede40535fe2615c63cd634f470d3f3>>
|
|
7
7
|
* @codegenCommand yarn workspace @af/ads-ai-tooling codegen
|
|
8
8
|
*/
|
|
9
9
|
import type { ComponentMcpPayload } from './types';
|
|
@@ -2,10 +2,13 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const searchTokensInputSchema: z.ZodObject<{
|
|
3
3
|
terms: z.ZodArray<z.ZodString, 'many'>;
|
|
4
4
|
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
5
|
+
includeMetadata: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
5
6
|
}, 'strip', z.ZodTypeAny, {
|
|
6
7
|
terms: string[];
|
|
7
8
|
limit?: number | undefined;
|
|
9
|
+
includeMetadata?: boolean | undefined;
|
|
8
10
|
}, {
|
|
9
11
|
terms: string[];
|
|
10
12
|
limit?: number | undefined;
|
|
13
|
+
includeMetadata?: boolean | undefined;
|
|
11
14
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
import { type z } from 'zod';
|
|
3
3
|
import { type searchTokensInputSchema } from './search-tokens-input-schema';
|
|
4
|
-
export declare const searchTokensTool: ({ terms, limit, }: z.infer<typeof searchTokensInputSchema>) => Promise<CallToolResult>;
|
|
4
|
+
export declare const searchTokensTool: ({ terms, limit, includeMetadata, }: z.infer<typeof searchTokensInputSchema>) => Promise<CallToolResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/ads-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@atlaskit/icon": "^37.3.0",
|
|
25
25
|
"@atlaskit/icon-lab": "^7.5.0",
|
|
26
26
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
27
|
-
"@atlaskit/tokens": "^16.
|
|
27
|
+
"@atlaskit/tokens": "^16.7.0",
|
|
28
28
|
"@axe-core/playwright": "^4.11.1",
|
|
29
29
|
"@axe-core/puppeteer": "^4.11.1",
|
|
30
30
|
"@babel/runtime": "^7.0.0",
|