@atlaskit/ads-mcp 1.12.16 → 1.13.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 +27 -0
- package/dist/cjs/helpers/search-terms-schema.js +11 -0
- package/dist/cjs/helpers/validation.js +1 -1
- package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
- package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
- package/dist/cjs/tools/get-guidelines/get-guidelines-input-schema.js +2 -1
- package/dist/cjs/tools/get-lint-rules/get-lint-rules-input-schema.js +2 -1
- package/dist/cjs/tools/plan/list-plan-tool.js +1 -1
- package/dist/cjs/tools/plan/plan-input-schema.js +5 -4
- package/dist/cjs/tools/plan/plan-tool.js +27 -13
- package/dist/cjs/tools/search-atlaskit-components/search-atlaskit-components-input-schema.js +2 -1
- package/dist/cjs/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +2 -1
- package/dist/cjs/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +2 -1
- package/dist/cjs/tools/search-components/search-components-input-schema.js +2 -1
- package/dist/cjs/tools/search-icons/search-icons-input-schema.js +2 -1
- package/dist/cjs/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/es2019/helpers/search-terms-schema.js +3 -0
- package/dist/es2019/helpers/validation.js +1 -1
- package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
- package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
- package/dist/es2019/tools/get-guidelines/get-guidelines-input-schema.js +2 -1
- package/dist/es2019/tools/get-lint-rules/get-lint-rules-input-schema.js +2 -1
- package/dist/es2019/tools/plan/list-plan-tool.js +1 -1
- package/dist/es2019/tools/plan/plan-input-schema.js +5 -4
- package/dist/es2019/tools/plan/plan-tool.js +21 -13
- package/dist/es2019/tools/search-atlaskit-components/search-atlaskit-components-input-schema.js +2 -1
- package/dist/es2019/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +2 -1
- package/dist/es2019/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +2 -1
- package/dist/es2019/tools/search-components/search-components-input-schema.js +2 -1
- package/dist/es2019/tools/search-icons/search-icons-input-schema.js +2 -1
- package/dist/es2019/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/esm/helpers/search-terms-schema.js +5 -0
- package/dist/esm/helpers/validation.js +1 -1
- package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
- package/dist/esm/tools/get-guidelines/get-guidelines-input-schema.js +2 -1
- package/dist/esm/tools/get-lint-rules/get-lint-rules-input-schema.js +2 -1
- package/dist/esm/tools/plan/list-plan-tool.js +1 -1
- package/dist/esm/tools/plan/plan-input-schema.js +5 -4
- package/dist/esm/tools/plan/plan-tool.js +27 -13
- package/dist/esm/tools/search-atlaskit-components/search-atlaskit-components-input-schema.js +2 -1
- package/dist/esm/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +2 -1
- package/dist/esm/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +2 -1
- package/dist/esm/tools/search-components/search-components-input-schema.js +2 -1
- package/dist/esm/tools/search-icons/search-icons-input-schema.js +2 -1
- package/dist/esm/tools/search-tokens/search-tokens-input-schema.js +2 -1
- package/dist/types/helpers/search-terms-schema.d.ts +5 -0
- package/dist/types/helpers/validation.d.ts +2 -2
- package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +1 -1
- package/dist/types/tools/get-guidelines/get-guidelines-input-schema.d.ts +2 -1
- package/dist/types/tools/get-lint-rules/get-lint-rules-input-schema.d.ts +2 -1
- package/dist/types/tools/plan/plan-input-schema.d.ts +10 -18
- package/dist/types/tools/plan/plan-tool.d.ts +2 -2
- package/dist/types/tools/search-atlaskit-components/search-atlaskit-components-input-schema.d.ts +3 -2
- package/dist/types/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.d.ts +3 -2
- package/dist/types/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.d.ts +3 -2
- package/dist/types/tools/search-components/search-components-input-schema.d.ts +3 -2
- package/dist/types/tools/search-icons/search-icons-input-schema.d.ts +3 -2
- package/dist/types/tools/search-tokens/search-tokens-input-schema.d.ts +3 -2
- package/package.json +2 -2
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getGuidelinesInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
var getGuidelinesInputSchema = exports.getGuidelinesInputSchema = _zod.z.object({
|
|
9
|
-
terms:
|
|
10
|
+
terms: _searchTermsSchema.searchTermsSchema.default([]).describe('Search terms matched against guideline keywords and body (fuzzy). Examples: `["empty state", "voice tone"]`, `["color tokens", "spacing"]`, `["elevation", "grid"]`. Omit or use an empty array to return **all** guidelines as Markdown.').optional(),
|
|
10
11
|
limit: _zod.z.number().default(1).describe('Max matches **per term** when `terms` is non-empty (default 1). Ignored when returning all guidelines.').optional()
|
|
11
12
|
});
|
|
@@ -5,10 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getLintRulesInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
9
10
|
|
|
10
11
|
var getLintRulesInputSchema = exports.getLintRulesInputSchema = _zod.z.object({
|
|
11
|
-
terms:
|
|
12
|
+
terms: _searchTermsSchema.searchTermsSchema.default([]).describe('Search terms matched against rule name, description, and docs body (fuzzy unless \`exactName\` is true). Example: `["icon-label", "xcss", "design token"]`. Omit or empty: return **all** rules as JSON.').optional(),
|
|
12
13
|
limit: _zod.z.number().default(1).describe('Max matches **per term** when searching (default 1). Not used when returning all rules.').optional(),
|
|
13
14
|
exactName: _zod.z.boolean().default(false).describe('If true, resolve each term by **exact** ESLint rule name (case-insensitive). If false, fuzzy search across name, description, and content.').optional()
|
|
14
15
|
});
|
|
@@ -10,7 +10,7 @@ var _planInputSchema = require("./plan-input-schema");
|
|
|
10
10
|
|
|
11
11
|
var listPlanTool = exports.listPlanTool = {
|
|
12
12
|
name: 'ads_plan',
|
|
13
|
-
description: "Runs **ads_search_tokens**, **ads_search_icons**, **ads_search_components**, and optionally **atlaskit_search_components** in one call and returns a single JSON payload (each section only if that list was non-empty). Use this as the default way to discover ADS **tokens**, **icons**, and **components** for a UI task. Component results preserve optional `designSource.figmaUrl`; for Figma work, follow the canonical-source and property-verification guidance in `ads_search_components`.\n\nWHEN TO USE:\n**Implementing or iterating on a UI**\u2014new screen, feature, or polish\u2014and you need candidate **token** names, **icon** imports, and **ADS component** packages/props in one pass. Also use when exploring ADS building blocks before you write code.\n\nADS-FIRST ROUTING:\nUse `components` for canonical ADS components. Use `atlaskitComponents` only as explicit fallback research for public `@atlaskit/*` packages outside the ADS catalog, or after ADS component search has no useful match. This tool does not auto-populate `atlaskitComponents` from `components`.\n\
|
|
13
|
+
description: "Runs **ads_search_tokens**, **ads_search_icons**, **ads_search_components**, and optionally **atlaskit_search_components** in one call and returns a single JSON payload (each section only if that list was non-empty). Use this as the default way to discover ADS **tokens**, **icons**, and **components** for a UI task. Component results preserve optional `designSource.figmaUrl`; for Figma work, follow the canonical-source and property-verification guidance in `ads_search_components`.\n\nWHEN TO USE:\n**Implementing or iterating on a UI**\u2014new screen, feature, or polish\u2014and you need candidate **token** names, **icon** imports, and **ADS component** packages/props in one pass. Also use when exploring ADS building blocks before you write code.\n\nADS-FIRST ROUTING:\nUse `components` for canonical ADS components. Use `atlaskitComponents` only as explicit fallback research for public `@atlaskit/*` packages outside the ADS catalog, or after ADS component search has no useful match. This tool does not auto-populate `atlaskitComponents` from `components`.\n\nEach of `tokens`, `icons`, `components`, and `atlaskitComponents` accepts a search term or an array of terms. A string is treated as one search term, equivalent to a one-item array. Omit unused fields or use `[]`; omitted fields default to empty arrays. At least one field must contain a nonblank search term. Categories containing only blank terms are skipped.\n\nPrefer supplying **multiple** terms per non-empty array when you know them\u2014broader queries improve recall. Some queries return no rows where metadata is thin; try alternate wording.\n\nThis is equivalent to calling the individual search tools; there are no extra merge semantics beyond concatenating results.\n\nExample request:\n```json\n{\n\t\"tokens\": [\"spacing\", \"inverted text\", \"background primary\", \"animation\"],\n\t\"icons\": [\"search\", \"folder\", \"user\"],\n\t\"components\": [\"button\", \"input\", \"select\", \"heading\"],\n\t\"atlaskitComponents\": [\"editor-core\", \"onboarding\", \"page-layout\"]\n}\n```\n\nExample token usage:\n```tsx\nimport { token } from '@atlaskit/tokens';\nconst styles = css({ color: token('color.text'), padding: token('space.100') });\n```\n\nExample icon usage:\n```tsx\nimport AddIcon from '@atlaskit/icon/core/add';\n<AddIcon label=\"Add work item\" size=\"small\" />\n```",
|
|
14
14
|
annotations: {
|
|
15
15
|
title: 'Search ADS tokens, icons, and components to plan what to build',
|
|
16
16
|
readOnlyHint: true,
|
|
@@ -5,12 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.planInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
9
10
|
|
|
10
11
|
var planInputSchema = exports.planInputSchema = _zod.z.object({
|
|
11
|
-
tokens:
|
|
12
|
-
icons:
|
|
13
|
-
components:
|
|
14
|
-
atlaskitComponents:
|
|
12
|
+
tokens: _searchTermsSchema.searchTermsSchema.default([]).describe('A search term or array of terms for ADS design tokens (fuzzy by default). Omit or use `[]` if you only need icons or components. Prefer **at least two** terms per non-empty list when you know what you need.'),
|
|
13
|
+
icons: _searchTermsSchema.searchTermsSchema.default([]).describe('A search term or array of terms for ADS icons. Omit or use `[]` if you only need tokens or components. Prefer **at least two** terms per non-empty list when known.'),
|
|
14
|
+
components: _searchTermsSchema.searchTermsSchema.default([]).describe('A search term or array of terms for canonical ADS components. Omit or use `[]` if you only need tokens, icons, or explicit Atlaskit fallback research. Prefer **at least two** terms per non-empty list when known.'),
|
|
15
|
+
atlaskitComponents: _searchTermsSchema.searchTermsSchema.default([]).describe('A search term or array of terms for public `@atlaskit/*` components outside the ADS catalog. Use only as explicit fallback research when ADS component search is not enough; this is not auto-populated from `components`. Omit or use `[]` if you only need canonical ADS components. Prefer **at least two** terms per non-empty list when known.'),
|
|
15
16
|
limit: _zod.z.number().default(2).describe('Max matches **per term** for each non-empty list (default 2). Same limit applies to tokens, icons, ADS components, and explicit Atlaskit component fallback searches.').optional()
|
|
16
17
|
});
|
|
@@ -8,23 +8,37 @@ exports.planTool = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _validation = require("../../helpers/validation");
|
|
11
12
|
var _searchAtlaskitComponentsTool = require("../search-atlaskit-components/search-atlaskit-components-tool");
|
|
12
13
|
var _searchComponentsTool = require("../search-components/search-components-tool");
|
|
13
14
|
var _searchIconsTool = require("../search-icons/search-icons-tool");
|
|
14
15
|
var _searchTokensTool = require("../search-tokens/search-tokens-tool");
|
|
16
|
+
var _planInputSchema = require("./plan-input-schema");
|
|
15
17
|
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; }
|
|
16
18
|
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) { (0, _defineProperty2.default)(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; } /* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
19
|
+
var hasSearchTerms = function hasSearchTerms(terms) {
|
|
20
|
+
return terms.some(function (term) {
|
|
21
|
+
return term.trim().length > 0;
|
|
22
|
+
});
|
|
23
|
+
};
|
|
17
24
|
var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
18
|
-
var
|
|
19
|
-
var tokens_search, icons_search, components_search, atlaskit_components_search, limit, results, searchPromises, getResultCount, consolidatedResult;
|
|
25
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(args) {
|
|
26
|
+
var validation, _validation$data, tokens_search, icons_search, components_search, atlaskit_components_search, limit, results, searchPromises, getResultCount, consolidatedResult;
|
|
20
27
|
return _regenerator.default.wrap(function (_context) {
|
|
21
28
|
while (1) switch (_context.prev = _context.next) {
|
|
22
29
|
case 0:
|
|
23
|
-
|
|
24
|
-
if (
|
|
30
|
+
validation = (0, _validation.validateToolArguments)(_planInputSchema.planInputSchema, args);
|
|
31
|
+
if (validation.success) {
|
|
25
32
|
_context.next = 1;
|
|
26
33
|
break;
|
|
27
34
|
}
|
|
35
|
+
return _context.abrupt("return", validation.error);
|
|
36
|
+
case 1:
|
|
37
|
+
_validation$data = validation.data, tokens_search = _validation$data.tokens, icons_search = _validation$data.icons, components_search = _validation$data.components, atlaskit_components_search = _validation$data.atlaskitComponents, limit = _validation$data.limit; // Require at least one category with a nonblank search term.
|
|
38
|
+
if (!(!hasSearchTerms(tokens_search) && !hasSearchTerms(icons_search) && !hasSearchTerms(components_search) && !hasSearchTerms(atlaskit_components_search))) {
|
|
39
|
+
_context.next = 2;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
28
42
|
return _context.abrupt("return", {
|
|
29
43
|
isError: true,
|
|
30
44
|
content: [{
|
|
@@ -32,10 +46,10 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
32
46
|
text: 'Error: At least one search type (tokens, icons, components, or atlaskitComponents) must be provided with search terms'
|
|
33
47
|
}]
|
|
34
48
|
});
|
|
35
|
-
case
|
|
49
|
+
case 2:
|
|
36
50
|
results = {}; // Execute searches in parallel
|
|
37
51
|
searchPromises = [];
|
|
38
|
-
if (tokens_search
|
|
52
|
+
if (hasSearchTerms(tokens_search)) {
|
|
39
53
|
searchPromises.push((0, _searchTokensTool.searchTokensTool)({
|
|
40
54
|
terms: tokens_search,
|
|
41
55
|
limit: limit
|
|
@@ -43,7 +57,7 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
43
57
|
results.tokens = result;
|
|
44
58
|
}));
|
|
45
59
|
}
|
|
46
|
-
if (icons_search
|
|
60
|
+
if (hasSearchTerms(icons_search)) {
|
|
47
61
|
searchPromises.push((0, _searchIconsTool.searchIconsTool)({
|
|
48
62
|
terms: icons_search,
|
|
49
63
|
limit: limit
|
|
@@ -51,7 +65,7 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
51
65
|
results.icons = result;
|
|
52
66
|
}));
|
|
53
67
|
}
|
|
54
|
-
if (components_search
|
|
68
|
+
if (hasSearchTerms(components_search)) {
|
|
55
69
|
searchPromises.push((0, _searchComponentsTool.searchComponentsTool)({
|
|
56
70
|
terms: components_search,
|
|
57
71
|
limit: limit
|
|
@@ -59,7 +73,7 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
59
73
|
results.components = result;
|
|
60
74
|
}));
|
|
61
75
|
}
|
|
62
|
-
if (atlaskit_components_search
|
|
76
|
+
if (hasSearchTerms(atlaskit_components_search)) {
|
|
63
77
|
searchPromises.push((0, _searchAtlaskitComponentsTool.searchAtlaskitComponentsTool)({
|
|
64
78
|
terms: atlaskit_components_search,
|
|
65
79
|
limit: limit
|
|
@@ -69,9 +83,9 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
69
83
|
}
|
|
70
84
|
|
|
71
85
|
// Wait for all searches to complete
|
|
72
|
-
_context.next =
|
|
86
|
+
_context.next = 3;
|
|
73
87
|
return Promise.all(searchPromises);
|
|
74
|
-
case
|
|
88
|
+
case 3:
|
|
75
89
|
// Helper function to safely count results
|
|
76
90
|
getResultCount = function getResultCount(result) {
|
|
77
91
|
var _result$content;
|
|
@@ -112,13 +126,13 @@ var planTool = exports.planTool = /*#__PURE__*/function () {
|
|
|
112
126
|
text: JSON.stringify(consolidatedResult, null, 2)
|
|
113
127
|
}]
|
|
114
128
|
});
|
|
115
|
-
case
|
|
129
|
+
case 4:
|
|
116
130
|
case "end":
|
|
117
131
|
return _context.stop();
|
|
118
132
|
}
|
|
119
133
|
}, _callee);
|
|
120
134
|
}));
|
|
121
135
|
return function planTool(_x) {
|
|
122
|
-
return
|
|
136
|
+
return _ref.apply(this, arguments);
|
|
123
137
|
};
|
|
124
138
|
}();
|
package/dist/cjs/tools/search-atlaskit-components/search-atlaskit-components-input-schema.js
CHANGED
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.searchAtlaskitComponentsInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
var searchAtlaskitComponentsInputSchema = exports.searchAtlaskitComponentsInputSchema = _zod.z.object({
|
|
9
|
-
terms:
|
|
10
|
+
terms: _searchTermsSchema.searchTermsSchema.describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, examples). Example: `["button", "modal", "select"]`.'),
|
|
10
11
|
limit: _zod.z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
11
12
|
});
|
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.searchAtlaskitHooksInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
var searchAtlaskitHooksInputSchema = exports.searchAtlaskitHooksInputSchema = _zod.z.object({
|
|
9
|
-
terms:
|
|
10
|
+
terms: _searchTermsSchema.searchTermsSchema.describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, usageGuidelines). Example: `["analytics", "storage", "layering"]`.'),
|
|
10
11
|
limit: _zod.z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
11
12
|
});
|
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.searchAtlaskitUtilitiesInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
var searchAtlaskitUtilitiesInputSchema = exports.searchAtlaskitUtilitiesInputSchema = _zod.z.object({
|
|
9
|
-
terms:
|
|
10
|
+
terms: _searchTermsSchema.searchTermsSchema.describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, usageGuidelines). Example: `["debounce", "a11y", "storage"]`.'),
|
|
10
11
|
limit: _zod.z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
11
12
|
});
|
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.searchComponentsInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
9
10
|
|
|
10
11
|
var searchComponentsInputSchema = exports.searchComponentsInputSchema = _zod.z.object({
|
|
11
|
-
terms:
|
|
12
|
+
terms: _searchTermsSchema.searchTermsSchema.describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, examples). Example: `["button", "modal", "select"]`.'),
|
|
12
13
|
limit: _zod.z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
13
14
|
});
|
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.searchIconsInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
9
10
|
|
|
10
11
|
var searchIconsInputSchema = exports.searchIconsInputSchema = _zod.z.object({
|
|
11
|
-
terms:
|
|
12
|
+
terms: _searchTermsSchema.searchTermsSchema.describe('Required: one or more terms; fuzzy match on icon **componentName**, **iconName**, **keywords**, **categorization**, **type**, and **usage**. Example: `["search", "folder", "user"]`.'),
|
|
12
13
|
limit: _zod.z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
13
14
|
});
|
|
@@ -5,10 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.searchTokensInputSchema = void 0;
|
|
7
7
|
var _zod = require("zod");
|
|
8
|
+
var _searchTermsSchema = require("../../helpers/search-terms-schema");
|
|
8
9
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
9
10
|
|
|
10
11
|
var searchTokensInputSchema = exports.searchTokensInputSchema = _zod.z.object({
|
|
11
|
-
terms:
|
|
12
|
+
terms: _searchTermsSchema.searchTermsSchema.describe('Required: one or more terms; fuzzy match on token **name**, **description**, **exampleValue**, **usageGuidelines.usage**, and **usageGuidelines.cssProperties**. Example: `["spacing", "color.text", "background"]`.'),
|
|
12
13
|
limit: _zod.z.number().default(2).describe('Max matches **per term** (default 2).').optional(),
|
|
13
14
|
includeMetadata: _zod.z.boolean().default(false).describe('Include the token description and usage guidelines in each result (default false).').optional()
|
|
14
15
|
});
|
|
@@ -6,7 +6,7 @@ import { zodToJsonSchema } from './zod-to-json-schema';
|
|
|
6
6
|
*
|
|
7
7
|
* @param schema - The Zod schema to validate against
|
|
8
8
|
* @param args - The arguments to validate
|
|
9
|
-
* @returns { success: true; data:
|
|
9
|
+
* @returns { success: true; data: Output } if validation succeeds, { success: false; error: ValidationErrorResult } if validation fails
|
|
10
10
|
*/
|
|
11
11
|
export function validateToolArguments(schema, args) {
|
|
12
12
|
const result = schema.safeParse(args);
|