@atlaskit/ads-mcp 0.18.1 → 0.19.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 +15 -0
- package/README.md +2 -2
- package/dist/cjs/helpers/fuse-multi-term.js +130 -0
- package/dist/cjs/helpers/index.js +15 -1
- package/dist/cjs/index.js +28 -14
- package/dist/cjs/instructions.js +1 -1
- package/dist/cjs/tools/analyze-a11y/index.js +12 -12
- package/dist/cjs/tools/get-a11y-guidelines/index.js +3 -3
- package/dist/cjs/tools/{get-components → get-all-components}/index.js +6 -6
- 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-guidelines/index.js +4 -4
- package/dist/cjs/tools/get-lint-rules/index.js +5 -5
- package/dist/cjs/tools/i18n-conversion/index.js +3 -3
- package/dist/cjs/tools/migration-guides/index.js +3 -3
- package/dist/cjs/tools/plan/index.js +13 -17
- package/dist/cjs/tools/search-components/index.js +44 -65
- package/dist/cjs/tools/search-icons/index.js +42 -68
- package/dist/cjs/tools/search-tokens/index.js +56 -43
- package/dist/cjs/tools/suggest-a11y-fixes/index.js +7 -7
- package/dist/es2019/helpers/fuse-multi-term.js +98 -0
- package/dist/es2019/helpers/index.js +1 -0
- package/dist/es2019/index.js +81 -83
- package/dist/es2019/instructions.js +2 -1
- package/dist/es2019/tools/analyze-a11y/index.js +28 -12
- package/dist/es2019/tools/get-a11y-guidelines/index.js +10 -3
- package/dist/es2019/tools/{get-components → get-all-components}/index.js +9 -4
- package/dist/es2019/tools/get-all-icons/index.js +6 -1
- package/dist/es2019/tools/get-all-tokens/index.js +6 -1
- package/dist/es2019/tools/get-guidelines/index.js +20 -7
- package/dist/es2019/tools/get-lint-rules/index.js +12 -8
- package/dist/es2019/tools/i18n-conversion/index.js +10 -13
- package/dist/es2019/tools/migration-guides/index.js +10 -4
- package/dist/es2019/tools/plan/index.js +25 -25
- package/dist/es2019/tools/search-components/index.js +42 -56
- package/dist/es2019/tools/search-icons/index.js +37 -62
- package/dist/es2019/tools/search-tokens/index.js +54 -45
- package/dist/es2019/tools/suggest-a11y-fixes/index.js +16 -7
- package/dist/esm/helpers/fuse-multi-term.js +122 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/index.js +28 -14
- package/dist/esm/instructions.js +1 -1
- package/dist/esm/tools/analyze-a11y/index.js +12 -12
- package/dist/esm/tools/get-a11y-guidelines/index.js +3 -3
- package/dist/esm/tools/{get-components → get-all-components}/index.js +5 -5
- 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-guidelines/index.js +4 -4
- package/dist/esm/tools/get-lint-rules/index.js +5 -5
- package/dist/esm/tools/i18n-conversion/index.js +3 -3
- package/dist/esm/tools/migration-guides/index.js +3 -3
- package/dist/esm/tools/plan/index.js +13 -17
- package/dist/esm/tools/search-components/index.js +45 -66
- package/dist/esm/tools/search-icons/index.js +43 -69
- package/dist/esm/tools/search-tokens/index.js +57 -44
- package/dist/esm/tools/suggest-a11y-fixes/index.js +7 -7
- package/dist/types/helpers/fuse-multi-term.d.ts +45 -0
- package/dist/types/helpers/index.d.ts +1 -0
- package/dist/types/instructions.d.ts +1 -1
- package/dist/types/tools/{get-components → get-all-components}/index.d.ts +2 -2
- package/dist/types/tools/plan/index.d.ts +1 -4
- package/dist/types/tools/search-components/index.d.ts +1 -4
- package/dist/types/tools/search-icons/index.d.ts +1 -4
- package/dist/types/tools/search-tokens/index.d.ts +1 -4
- package/dist/types-ts4.5/helpers/fuse-multi-term.d.ts +45 -0
- package/dist/types-ts4.5/helpers/index.d.ts +1 -0
- package/dist/types-ts4.5/instructions.d.ts +1 -1
- package/dist/types-ts4.5/tools/{get-components → get-all-components}/index.d.ts +2 -2
- package/dist/types-ts4.5/tools/plan/index.d.ts +1 -4
- package/dist/types-ts4.5/tools/search-components/index.d.ts +1 -4
- package/dist/types-ts4.5/tools/search-icons/index.d.ts +1 -4
- package/dist/types-ts4.5/tools/search-tokens/index.d.ts +1 -4
- package/package.json +6 -6
- /package/dist/cjs/tools/{get-components → get-all-components}/components.codegen.js +0 -0
- /package/dist/cjs/tools/{get-components → get-all-components}/components.js +0 -0
- /package/dist/cjs/tools/{get-components → get-all-components}/load-all-components.js +0 -0
- /package/dist/cjs/tools/{get-components → get-all-components}/types.js +0 -0
- /package/dist/es2019/tools/{get-components → get-all-components}/components.codegen.js +0 -0
- /package/dist/es2019/tools/{get-components → get-all-components}/components.js +0 -0
- /package/dist/es2019/tools/{get-components → get-all-components}/load-all-components.js +0 -0
- /package/dist/es2019/tools/{get-components → get-all-components}/types.js +0 -0
- /package/dist/esm/tools/{get-components → get-all-components}/components.codegen.js +0 -0
- /package/dist/esm/tools/{get-components → get-all-components}/components.js +0 -0
- /package/dist/esm/tools/{get-components → get-all-components}/load-all-components.js +0 -0
- /package/dist/esm/tools/{get-components → get-all-components}/types.js +0 -0
- /package/dist/types/tools/{get-components → get-all-components}/components.codegen.d.ts +0 -0
- /package/dist/types/tools/{get-components → get-all-components}/components.d.ts +0 -0
- /package/dist/types/tools/{get-components → get-all-components}/load-all-components.d.ts +0 -0
- /package/dist/types/tools/{get-components → get-all-components}/types.d.ts +0 -0
- /package/dist/types-ts4.5/tools/{get-components → get-all-components}/components.codegen.d.ts +0 -0
- /package/dist/types-ts4.5/tools/{get-components → get-all-components}/components.d.ts +0 -0
- /package/dist/types-ts4.5/tools/{get-components → get-all-components}/load-all-components.d.ts +0 -0
- /package/dist/types-ts4.5/tools/{get-components → get-all-components}/types.d.ts +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
/**
|
|
6
|
+
* Allocation for multi-query Fuse search: each term alone, plus one spaced combined query.
|
|
7
|
+
*
|
|
8
|
+
* `poolMax = limit * termCount`. From each term we take up to `perTermTake` hits; the rest of the
|
|
9
|
+
* pool is filled from the spaced combined query.
|
|
10
|
+
*/
|
|
11
|
+
export function computeMultiTermFuseAllocation(limit, termCount) {
|
|
12
|
+
if (termCount <= 1) return {
|
|
13
|
+
perTermTake: 1,
|
|
14
|
+
combinedTake: 0,
|
|
15
|
+
totalTake: 1
|
|
16
|
+
};
|
|
17
|
+
var perTermTake = Math.max(Math.round(limit / termCount), 1);
|
|
18
|
+
var combinedTake = Math.max(limit * termCount - termCount * perTermTake, 1);
|
|
19
|
+
var totalTake = Math.max(perTermTake * termCount + combinedTake, 1);
|
|
20
|
+
return {
|
|
21
|
+
perTermTake: perTermTake,
|
|
22
|
+
combinedTake: combinedTake,
|
|
23
|
+
totalTake: totalTake
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Runs `search` for each term (top `perTermTake`) and for `terms.join(' ')` (top `combinedTake`),
|
|
28
|
+
* merges pools, sorts globally by Fuse score, then returns the first `limit` **distinct** keys
|
|
29
|
+
* (later duplicate keys are skipped).
|
|
30
|
+
*
|
|
31
|
+
* Default `tokenKey` uses `item.name` when present; pass an explicit `tokenKey` for types without
|
|
32
|
+
* `name` (e.g. icons keyed by `componentName`).
|
|
33
|
+
*/
|
|
34
|
+
export function mergeMultiTermFuseResults(_ref) {
|
|
35
|
+
var searchTerms = _ref.searchTerms,
|
|
36
|
+
limit = _ref.limit,
|
|
37
|
+
search = _ref.search,
|
|
38
|
+
_ref$tokenKey = _ref.tokenKey,
|
|
39
|
+
tokenKey = _ref$tokenKey === void 0 ? function (item) {
|
|
40
|
+
var _name;
|
|
41
|
+
return String((_name = item.name) !== null && _name !== void 0 ? _name : '');
|
|
42
|
+
} : _ref$tokenKey,
|
|
43
|
+
_ref$searchTermsJoin = _ref.searchTermsJoin,
|
|
44
|
+
searchTermsJoin = _ref$searchTermsJoin === void 0 ? ' ' : _ref$searchTermsJoin;
|
|
45
|
+
var n = searchTerms.length;
|
|
46
|
+
if (n === 0) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
if (n === 1) {
|
|
50
|
+
return takeFirstUniqueKeys(sortByScoreAsc(toScoredHits(search(searchTerms[0]), tokenKey)), limit);
|
|
51
|
+
}
|
|
52
|
+
var _computeMultiTermFuse = computeMultiTermFuseAllocation(limit, n),
|
|
53
|
+
perTermTake = _computeMultiTermFuse.perTermTake,
|
|
54
|
+
combinedTake = _computeMultiTermFuse.combinedTake,
|
|
55
|
+
totalTake = _computeMultiTermFuse.totalTake;
|
|
56
|
+
var termsCombined = searchTerms.join(searchTermsJoin);
|
|
57
|
+
var pool = [];
|
|
58
|
+
var _iterator = _createForOfIteratorHelper(searchTerms),
|
|
59
|
+
_step;
|
|
60
|
+
try {
|
|
61
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
62
|
+
var term = _step.value;
|
|
63
|
+
pool.push.apply(pool, _toConsumableArray(topRankedFromQuery(search, term, tokenKey, perTermTake)));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Combine the terms together and search as well.
|
|
67
|
+
} catch (err) {
|
|
68
|
+
_iterator.e(err);
|
|
69
|
+
} finally {
|
|
70
|
+
_iterator.f();
|
|
71
|
+
}
|
|
72
|
+
pool.push.apply(pool, _toConsumableArray(topRankedFromQuery(search, termsCombined, tokenKey, combinedTake)));
|
|
73
|
+
|
|
74
|
+
// Grab the top combinations of all queries' results.
|
|
75
|
+
return takeFirstUniqueKeys(sortByScoreAsc(pool), totalTake);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Best `take` hits for one Fuse query (ranked by score, then slice).
|
|
80
|
+
*/
|
|
81
|
+
function topRankedFromQuery(search, query, tokenKey, take) {
|
|
82
|
+
return sortByScoreAsc(toScoredHits(search(query), tokenKey)).slice(0, take);
|
|
83
|
+
}
|
|
84
|
+
function toScoredHits(fuseHits, tokenKey) {
|
|
85
|
+
return fuseHits.map(function (hit) {
|
|
86
|
+
var _hit$score;
|
|
87
|
+
return {
|
|
88
|
+
item: hit.item,
|
|
89
|
+
score: (_hit$score = hit.score) !== null && _hit$score !== void 0 ? _hit$score : Number.POSITIVE_INFINITY,
|
|
90
|
+
key: tokenKey(hit.item)
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function sortByScoreAsc(hits) {
|
|
95
|
+
return _toConsumableArray(hits).sort(function (a, b) {
|
|
96
|
+
return a.score - b.score;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function takeFirstUniqueKeys(sortedHits, limit) {
|
|
100
|
+
var seen = new Set();
|
|
101
|
+
var out = [];
|
|
102
|
+
var _iterator2 = _createForOfIteratorHelper(sortedHits),
|
|
103
|
+
_step2;
|
|
104
|
+
try {
|
|
105
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
106
|
+
var h = _step2.value;
|
|
107
|
+
if (seen.has(h.key)) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
seen.add(h.key);
|
|
111
|
+
out.push(h.item);
|
|
112
|
+
if (out.length >= limit) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
} catch (err) {
|
|
117
|
+
_iterator2.e(err);
|
|
118
|
+
} finally {
|
|
119
|
+
_iterator2.f();
|
|
120
|
+
}
|
|
121
|
+
return out;
|
|
122
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
3
|
import { zodToJsonSchema as zodToJsonSchemaHelper } from 'zod-to-json-schema';
|
|
4
|
+
export { computeMultiTermFuseAllocation, mergeMultiTermFuseResults } from './fuse-multi-term';
|
|
4
5
|
export var cleanQuery = function cleanQuery(query) {
|
|
5
6
|
return query.trim().toLowerCase().replace(/\s+/g, '');
|
|
6
7
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -10,14 +10,17 @@ import { validateToolArguments } from './helpers/validation';
|
|
|
10
10
|
import { instructions } from './instructions';
|
|
11
11
|
import { analyzeA11yInputSchema, analyzeA11yLocalhostInputSchema, analyzeA11yTool, analyzeLocalhostA11yTool, listAnalyzeA11yTool, listAnalyzeLocalhostA11yTool } from './tools/analyze-a11y';
|
|
12
12
|
import { getA11yGuidelinesInputSchema, getA11yGuidelinesTool, listGetA11yGuidelinesTool } from './tools/get-a11y-guidelines';
|
|
13
|
+
import { getAllComponentsTool, listGetAllComponentsTool } from './tools/get-all-components';
|
|
13
14
|
import { getAllIconsTool, listGetAllIconsTool } from './tools/get-all-icons';
|
|
14
15
|
import { getAllTokensTool, listGetAllTokensTool } from './tools/get-all-tokens';
|
|
15
|
-
import { getComponentsTool, listGetComponentsTool } from './tools/get-components';
|
|
16
16
|
import { getGuidelinesInputSchema, getGuidelinesTool, listGetGuidelinesTool } from './tools/get-guidelines';
|
|
17
17
|
import { getLintRulesInputSchema, getLintRulesTool, listGetLintRulesTool } from './tools/get-lint-rules';
|
|
18
18
|
import { i18nConversionInputSchema, i18nConversionTool, listI18nConversionTool } from './tools/i18n-conversion';
|
|
19
19
|
import { listMigrationGuidesTool, migrationGuidesInputSchema, migrationGuidesTool } from './tools/migration-guides';
|
|
20
20
|
import { listPlanTool, planInputSchema, planTool } from './tools/plan';
|
|
21
|
+
import { listSearchComponentsTool, searchComponentsInputSchema, searchComponentsTool } from './tools/search-components';
|
|
22
|
+
import { listSearchIconsTool, searchIconsInputSchema, searchIconsTool } from './tools/search-icons';
|
|
23
|
+
import { listSearchTokensTool, searchTokensInputSchema, searchTokensTool } from './tools/search-tokens';
|
|
21
24
|
import { listSuggestA11yFixesTool, suggestA11yFixesInputSchema, suggestA11yFixesTool } from './tools/suggest-a11y-fixes';
|
|
22
25
|
|
|
23
26
|
// eslint-disable-next-line import/no-extraneous-dependencies -- this uses require because not all node versions this package supports use the same import assertions/attributes
|
|
@@ -55,8 +58,8 @@ var generateLogger = function generateLogger(level) {
|
|
|
55
58
|
};
|
|
56
59
|
};
|
|
57
60
|
export var getToolRegistry = function getToolRegistry() {
|
|
58
|
-
var
|
|
59
|
-
|
|
61
|
+
var _ref;
|
|
62
|
+
return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, listAnalyzeA11yTool.name, {
|
|
60
63
|
handler: analyzeA11yTool,
|
|
61
64
|
inputSchema: analyzeA11yInputSchema,
|
|
62
65
|
tool: listAnalyzeA11yTool
|
|
@@ -68,14 +71,26 @@ export var getToolRegistry = function getToolRegistry() {
|
|
|
68
71
|
handler: getA11yGuidelinesTool,
|
|
69
72
|
inputSchema: getA11yGuidelinesInputSchema,
|
|
70
73
|
tool: listGetA11yGuidelinesTool
|
|
71
|
-
}),
|
|
72
|
-
handler:
|
|
74
|
+
}), listGetAllComponentsTool.name, {
|
|
75
|
+
handler: getAllComponentsTool,
|
|
73
76
|
inputSchema: null,
|
|
74
|
-
tool:
|
|
77
|
+
tool: listGetAllComponentsTool
|
|
75
78
|
}), listPlanTool.name, {
|
|
76
79
|
handler: planTool,
|
|
77
80
|
inputSchema: planInputSchema,
|
|
78
81
|
tool: listPlanTool
|
|
82
|
+
}), listSearchComponentsTool.name, {
|
|
83
|
+
handler: searchComponentsTool,
|
|
84
|
+
inputSchema: searchComponentsInputSchema,
|
|
85
|
+
tool: listSearchComponentsTool
|
|
86
|
+
}), listSearchIconsTool.name, {
|
|
87
|
+
handler: searchIconsTool,
|
|
88
|
+
inputSchema: searchIconsInputSchema,
|
|
89
|
+
tool: listSearchIconsTool
|
|
90
|
+
}), listSearchTokensTool.name, {
|
|
91
|
+
handler: searchTokensTool,
|
|
92
|
+
inputSchema: searchTokensInputSchema,
|
|
93
|
+
tool: listSearchTokensTool
|
|
79
94
|
}), listSuggestA11yFixesTool.name, {
|
|
80
95
|
handler: suggestA11yFixesTool,
|
|
81
96
|
inputSchema: suggestA11yFixesInputSchema,
|
|
@@ -84,7 +99,7 @@ export var getToolRegistry = function getToolRegistry() {
|
|
|
84
99
|
handler: migrationGuidesTool,
|
|
85
100
|
inputSchema: migrationGuidesInputSchema,
|
|
86
101
|
tool: listMigrationGuidesTool
|
|
87
|
-
}), listI18nConversionTool.name, {
|
|
102
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, listI18nConversionTool.name, {
|
|
88
103
|
handler: i18nConversionTool,
|
|
89
104
|
inputSchema: i18nConversionInputSchema,
|
|
90
105
|
tool: listI18nConversionTool
|
|
@@ -96,7 +111,7 @@ export var getToolRegistry = function getToolRegistry() {
|
|
|
96
111
|
handler: getAllTokensTool,
|
|
97
112
|
inputSchema: null,
|
|
98
113
|
tool: listGetAllTokensTool
|
|
99
|
-
}),
|
|
114
|
+
}), listGetAllIconsTool.name, {
|
|
100
115
|
handler: getAllIconsTool,
|
|
101
116
|
inputSchema: null,
|
|
102
117
|
tool: listGetAllIconsTool
|
|
@@ -104,11 +119,10 @@ export var getToolRegistry = function getToolRegistry() {
|
|
|
104
119
|
handler: getLintRulesTool,
|
|
105
120
|
inputSchema: getLintRulesInputSchema,
|
|
106
121
|
tool: listGetLintRulesTool
|
|
107
|
-
})
|
|
108
|
-
return baseTools;
|
|
122
|
+
});
|
|
109
123
|
};
|
|
110
124
|
server.setRequestHandler(ListToolsRequestSchema, /*#__PURE__*/function () {
|
|
111
|
-
var
|
|
125
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(request, extra) {
|
|
112
126
|
var toolRegistry, tools;
|
|
113
127
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
114
128
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -137,13 +151,13 @@ server.setRequestHandler(ListToolsRequestSchema, /*#__PURE__*/function () {
|
|
|
137
151
|
}, _callee);
|
|
138
152
|
}));
|
|
139
153
|
return function (_x, _x2) {
|
|
140
|
-
return
|
|
154
|
+
return _ref2.apply(this, arguments);
|
|
141
155
|
};
|
|
142
156
|
}());
|
|
143
157
|
|
|
144
158
|
// Handle tool execution
|
|
145
159
|
server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
146
|
-
var
|
|
160
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(request, extra) {
|
|
147
161
|
var toolRegistry, toolName, toolConfig, actionSubject, toolArguments, inputValidation, result, toolRegistryForError;
|
|
148
162
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
149
163
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -251,7 +265,7 @@ server.setRequestHandler(CallToolRequestSchema, /*#__PURE__*/function () {
|
|
|
251
265
|
}, _callee2, null, [[6, 20]]);
|
|
252
266
|
}));
|
|
253
267
|
return function (_x3, _x4) {
|
|
254
|
-
return
|
|
268
|
+
return _ref3.apply(this, arguments);
|
|
255
269
|
};
|
|
256
270
|
}());
|
|
257
271
|
function runServer() {
|
package/dist/esm/instructions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export var instructions = "\nYou are an expert in the Atlassian Design System (ADS).\nYou can search for tokens, icons, and components and return guidance on how to build user interfaces.\nYou have special accessibility knowledge and can ensure interfaces built with ADS components are accessible to all users.\nYou can analyze code for accessibility violations, provide specific fix suggestions, and offer guidance on accessibility best practices.\nThese tools will support you, but for deep research
|
|
1
|
+
export var instructions = "\nYou are an expert in the Atlassian Design System (ADS).\nYou can search for tokens, icons, and components and return guidance on how to build user interfaces.\nYou have special accessibility knowledge and can ensure interfaces built with ADS components are accessible to all users.\nYou can analyze code for accessibility violations, provide specific fix suggestions, and offer guidance on accessibility best practices.\nFor org-wide standards alongside ADS tools: pair Context Engine `get_accessibility_docs` with `ads_get_a11y_guidelines`, `get_content_standards_docs` with `ads_get_guidelines`, and `get_i18n_docs` with `ads_i18n_conversion_guide` (Traduki/i18n policy plus the bundled formatMessage refactor guide).\nThese tools will support you, but for deep research you may also fetch https://atlassian.design/llms.txt, https://atlassian.design/llms-a11y.txt, or https://atlassian.design/ directly.\n";
|
|
@@ -12,16 +12,16 @@ import puppeteer from 'puppeteer';
|
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import { zodToJsonSchema } from '../../helpers';
|
|
14
14
|
export var analyzeA11yInputSchema = z.object({
|
|
15
|
-
code: z.string().describe('React component
|
|
16
|
-
componentName: z.string().describe('
|
|
17
|
-
context: z.string().describe('
|
|
18
|
-
includePatternAnalysis: z.boolean().default(true).describe('
|
|
15
|
+
code: z.string().describe('Source code of a React component or JSX snippet to analyze (string content only—no file path).'),
|
|
16
|
+
componentName: z.string().optional().describe('Optional label for the component under review (for summaries and reports).'),
|
|
17
|
+
context: z.string().optional().describe('Optional: how the component is used (e.g. in a form, modal) to improve suggestions.'),
|
|
18
|
+
includePatternAnalysis: z.boolean().default(true).describe('When true (default), runs regex-based heuristics on the code string (e.g. unlabeled buttons, missing alt) in addition to other analysis.').optional()
|
|
19
19
|
});
|
|
20
20
|
export var listAnalyzeA11yTool = {
|
|
21
21
|
name: 'ads_analyze_a11y',
|
|
22
|
-
description:
|
|
22
|
+
description: "Analyzes a **string of React/JSX** code for likely accessibility issues (heuristics and/or axe-related paths) and returns hints that often **point to** `ads_suggest_a11y_fixes` or generic axe/WCAG-style context\u2014not every finding maps to a specific ADS component fix.\n\nWHEN TO USE:\nYou have component source as text and want automated checks or heuristics before or during a code review.\n\nLIMITATIONS:\n- Does not replace testing in a real browser with assistive technologies or full keyboard traversal.\n- For rendered UI, `ads_analyze_localhost_a11y` (live URL + axe) is preferable when available\u2014it is **only exposed when this MCP runs locally**, not in the remote MCP deployment.",
|
|
23
23
|
annotations: {
|
|
24
|
-
title: 'Analyze
|
|
24
|
+
title: 'Analyze accessibility (code string)',
|
|
25
25
|
readOnlyHint: true,
|
|
26
26
|
destructiveHint: false,
|
|
27
27
|
idempotentHint: true,
|
|
@@ -30,16 +30,16 @@ export var listAnalyzeA11yTool = {
|
|
|
30
30
|
inputSchema: zodToJsonSchema(analyzeA11yInputSchema)
|
|
31
31
|
};
|
|
32
32
|
export var analyzeA11yLocalhostInputSchema = z.object({
|
|
33
|
-
url: z.string().describe('
|
|
34
|
-
componentName: z.string().optional().describe('
|
|
35
|
-
context: z.string().optional().describe('
|
|
36
|
-
selector: z.string().optional().describe('CSS selector to
|
|
33
|
+
url: z.string().describe('Fully qualified page URL to load (e.g. `http://localhost:9000` or a dev URL). Must be reachable from this MCP process.'),
|
|
34
|
+
componentName: z.string().optional().describe('Optional label for reporting (e.g. feature or component under test).'),
|
|
35
|
+
context: z.string().optional().describe('Optional: route, user flow, or feature context for the analyzed page.'),
|
|
36
|
+
selector: z.string().optional().describe('Optional CSS selector to scope axe analysis to a subtree (e.g. `#my-form`, `[data-testid="panel"]`). Omit to analyze the whole document.')
|
|
37
37
|
});
|
|
38
38
|
export var listAnalyzeLocalhostA11yTool = {
|
|
39
39
|
name: 'ads_analyze_localhost_a11y',
|
|
40
|
-
description: "
|
|
40
|
+
description: "Loads a **live URL** in a headless browser, runs **axe-core**, and returns violations with follow-up hints (often suggesting `ads_suggest_a11y_fixes`). Output is anchored in **axe** rule text; remediation may be generic or ADS-biased depending on the violation.\n\n**Availability:** This tool is only registered when the ADS MCP runs **on your machine** (local MCP). It is **not** available in the **remote** MCP offering\u2014use `ads_analyze_a11y` on source text there instead.\n\nWHEN TO USE:\nYou have a running app or storybook page and need automated accessibility results on **rendered** UI\u2014especially local or staging URLs.\n\nLIMITATIONS:\n- Does not replace manual testing with assistive technologies or keyboard-only navigation.\n- Requires network access to the URL from the environment running the MCP.",
|
|
41
41
|
annotations: {
|
|
42
|
-
title: 'Analyze
|
|
42
|
+
title: 'Analyze accessibility (live URL)',
|
|
43
43
|
readOnlyHint: true,
|
|
44
44
|
destructiveHint: false,
|
|
45
45
|
idempotentHint: true,
|
|
@@ -10,13 +10,13 @@ import { zodToJsonSchema } from '../../helpers';
|
|
|
10
10
|
import { accessibilityGuidelines } from './guidelines';
|
|
11
11
|
var topics = Object.keys(accessibilityGuidelines);
|
|
12
12
|
export var getA11yGuidelinesInputSchema = z.object({
|
|
13
|
-
topic: z.string().optional().describe('
|
|
13
|
+
topic: z.string().optional().describe('ADS accessibility topic key. Omit to receive all topics and the full guideline bundle. Pass a valid key (see response \`availableTopics\`) or \`general\` for a focused overview when supported. Known topics: ' + topics.join(', ') + '.')
|
|
14
14
|
});
|
|
15
15
|
export var listGetA11yGuidelinesTool = {
|
|
16
16
|
name: 'ads_get_a11y_guidelines',
|
|
17
|
-
description:
|
|
17
|
+
description: "Returns Atlassian Design System (ADS) accessibility guidance: best practices and patterns for buttons, interactions, color contrast, forms, and other design-system topics shipped in this tool.\n\nUse this alongside the Context Engine MCP tool `get_accessibility_docs` for Atlassian-wide accessibility standards (e.g. A11YKB); this tool supplies ADS-specific component and pattern guidance.\n\nWHEN TO USE:\nYou MUST call this when generating or substantially changing a new interactive or visual user interface built with ADS, or when you need topic-specific ADS guidance (e.g. focus, forms, motion).\n\nDO NOT rely on generic web accessibility advice alone\u2014ADS conventions may differ. Use `get_accessibility_docs` for org-wide standards and this tool for ADS-topic guidance.",
|
|
18
18
|
annotations: {
|
|
19
|
-
title: 'Get
|
|
19
|
+
title: 'Get ADS accessibility guidelines',
|
|
20
20
|
readOnlyHint: true,
|
|
21
21
|
destructiveHint: false,
|
|
22
22
|
idempotentHint: true,
|
|
@@ -5,9 +5,9 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { zodToJsonSchema } from '../../helpers';
|
|
7
7
|
import { loadAllComponents } from './load-all-components';
|
|
8
|
-
export var
|
|
9
|
-
name: '
|
|
10
|
-
description: "
|
|
8
|
+
export var listGetAllComponentsTool = {
|
|
9
|
+
name: 'ads_get_all_components',
|
|
10
|
+
description: "Returns **every** Atlassian Design System component record as separate JSON text chunks (full catalog; large payload).\n\nWHEN TO USE:\nLast resort when `ads_plan` / `ads_search_components` is insufficient and you must enumerate all components. Prefer search for normal component picking.\n\nNo parameters.",
|
|
11
11
|
annotations: {
|
|
12
12
|
title: 'Get all ADS components',
|
|
13
13
|
readOnlyHint: true,
|
|
@@ -17,7 +17,7 @@ export var listGetComponentsTool = {
|
|
|
17
17
|
},
|
|
18
18
|
inputSchema: zodToJsonSchema(z.object({}))
|
|
19
19
|
};
|
|
20
|
-
export var
|
|
20
|
+
export var getAllComponentsTool = /*#__PURE__*/function () {
|
|
21
21
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
22
22
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
23
23
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -38,7 +38,7 @@ export var getComponentsTool = /*#__PURE__*/function () {
|
|
|
38
38
|
}
|
|
39
39
|
}, _callee);
|
|
40
40
|
}));
|
|
41
|
-
return function
|
|
41
|
+
return function getAllComponentsTool() {
|
|
42
42
|
return _ref.apply(this, arguments);
|
|
43
43
|
};
|
|
44
44
|
}();
|
|
@@ -7,7 +7,7 @@ import { zodToJsonSchema } from '../../helpers';
|
|
|
7
7
|
import { icons } from './icons';
|
|
8
8
|
export var listGetAllIconsTool = {
|
|
9
9
|
name: 'ads_get_all_icons',
|
|
10
|
-
description: "
|
|
10
|
+
description: "Returns **every** ADS icon record as separate JSON text chunks (full catalog; large payload).\n\nWHEN TO USE:\nLast resort when `ads_plan` / `ads_search_icons` is insufficient and you must enumerate all icons. Prefer search for normal icon picking.\n\nNo parameters.",
|
|
11
11
|
annotations: {
|
|
12
12
|
title: 'Get all ADS icons',
|
|
13
13
|
readOnlyHint: true,
|
|
@@ -8,7 +8,7 @@ import { zodToJsonSchema } from '../../helpers';
|
|
|
8
8
|
var inputSchema = z.object({});
|
|
9
9
|
export var listGetAllTokensTool = {
|
|
10
10
|
name: 'ads_get_all_tokens',
|
|
11
|
-
description: "
|
|
11
|
+
description: "Returns **every** ADS design token from bundled metadata (name, example value, usage guidelines)\u2014one JSON object per token, **very large** output.\n\nWHEN TO USE:\nLast resort when `ads_plan` / `ads_search_tokens` cannot answer the question and you need the full list (e.g. exhaustive audit). Prefer targeted search for normal development.\n\nNo parameters.",
|
|
12
12
|
annotations: {
|
|
13
13
|
title: 'Get all ADS tokens',
|
|
14
14
|
readOnlyHint: true,
|
|
@@ -7,14 +7,14 @@ import { z } from 'zod';
|
|
|
7
7
|
import { cleanQuery, zodToJsonSchema } from '../../helpers';
|
|
8
8
|
import { guidelinesStructuredContent } from './guidelines-structured-content.codegen';
|
|
9
9
|
export var getGuidelinesInputSchema = z.object({
|
|
10
|
-
terms: z.array(z.string()).default([]).describe('
|
|
11
|
-
limit: z.number().default(1).describe('
|
|
10
|
+
terms: z.array(z.string()).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(),
|
|
11
|
+
limit: z.number().default(1).describe('Max matches **per term** when `terms` is non-empty (default 1). Ignored when returning all guidelines.').optional()
|
|
12
12
|
});
|
|
13
13
|
export var listGetGuidelinesTool = {
|
|
14
14
|
name: 'ads_get_guidelines',
|
|
15
|
-
description: "
|
|
15
|
+
description: "Returns Atlassian Design System (ADS) **foundations** guidelines as Markdown: the bundled design-system-docs foundations set (not component API docs).\n\nTOPIC COVERAGE:\n- **Content & UX writing**: messaging types (empty state, error, success, warning, info, feature discovery), voice and tone, inclusive language, grammar and style, date/time copy handoff, vocabulary pointers.\n- **Visual foundations**: color (roles, accents, palette, charts, pickers), borders and radius, elevation and z-index, spacing and layout primitives (box/inline/stack), grid, iconography, logos.\n- **Design tokens**: concepts, themes, migration, using tokens in code and in Figma.\n- **Typography**: typefaces, scale, applying text styles and tokens.\n- **Accessibility overview**: building accessible apps and related foundations pages bundled here.\n\nWhen working with content, use this tool alongside the Context Engine MCP tool `get_content_standards_docs` for Atlassian-wide content standards (CDSTD/BAIT-style org guidance); this tool supplies ADS-specific foundations.\n\nWHAT YOU GET:\n- With `terms`: fuzzy search over keywords and content; concatenated Markdown for matches.\n- Without `terms` (or empty): the full guideline set as Markdown.\n\nWHEN TO USE:\nUse this when you are **building or updating a visual interface**, **writing or reviewing user-facing copy**, or need to **answer foundations questions** about ADS: content patterns, visual appearance, design tokens, typography, spacing, color, grid, motion, and related topics shipped in this bundle.\n\nIt is **not** for picking a component\u2019s props or package (use `ads_plan` / `ads_search_components`) or for interactive accessibility rules and patterns (use `ads_get_a11y_guidelines`, with Context Engine `get_accessibility_docs` for org-wide a11y standards).",
|
|
16
16
|
annotations: {
|
|
17
|
-
title: 'Get ADS guidelines',
|
|
17
|
+
title: 'Get ADS guidelines (content, a11y, visual design, design tokens, typography)',
|
|
18
18
|
readOnlyHint: true,
|
|
19
19
|
destructiveHint: false,
|
|
20
20
|
idempotentHint: true,
|
|
@@ -7,15 +7,15 @@ import { z } from 'zod';
|
|
|
7
7
|
import { cleanQuery, zodToJsonSchema } from '../../helpers';
|
|
8
8
|
import { lintRulesMcpStructuredContent } from './lint-rules-structured-content.codegen';
|
|
9
9
|
export var getLintRulesInputSchema = z.object({
|
|
10
|
-
terms: z.array(z.string()).default([]).describe('
|
|
11
|
-
limit: z.number().default(1).describe('
|
|
12
|
-
exactName: z.boolean().default(false).describe('
|
|
10
|
+
terms: z.array(z.string()).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(),
|
|
11
|
+
limit: z.number().default(1).describe('Max matches **per term** when searching (default 1). Not used when returning all rules.').optional(),
|
|
12
|
+
exactName: 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()
|
|
13
13
|
});
|
|
14
14
|
export var listGetLintRulesTool = {
|
|
15
15
|
name: 'ads_get_lint_rules',
|
|
16
|
-
description: "
|
|
16
|
+
description: "Returns documentation for **Constellation** (Atlassian Design System) ESLint rules shipped with this MCP\u2014rule purpose, examples, and fixes where available.\n\nWHAT YOU GET:\n- No `terms`: JSON array of all rule payloads.\n- With `terms`: fuzzy search (or exact rule name when `exactName` is true); JSON for one or more matching rules.\n\nWHEN TO USE:\nExplaining or fixing an ESLint message from ADS rules (e.g. `icon-label`, `ensure-proper-xcss-usage`, `no-deprecated-apis`), or browsing rule docs without opening the repo. Prefer this over guessing from rule id alone.\n\nThis tool does not run ESLint; it only returns bundled documentation.",
|
|
17
17
|
annotations: {
|
|
18
|
-
title: 'Get ADS
|
|
18
|
+
title: 'Get ADS ESLint rule docs',
|
|
19
19
|
readOnlyHint: true,
|
|
20
20
|
destructiveHint: false,
|
|
21
21
|
idempotentHint: true,
|
|
@@ -6,13 +6,13 @@ import { z } from 'zod';
|
|
|
6
6
|
import { zodToJsonSchema } from '../../helpers';
|
|
7
7
|
import { i18nConversionGuide } from './guide';
|
|
8
8
|
export var i18nConversionInputSchema = z.object({
|
|
9
|
-
guide: z.enum(['hardcoded-string-to-formatmessage']).describe('
|
|
9
|
+
guide: z.enum(['hardcoded-string-to-formatmessage']).describe('Which bundled guide to return. Currently only `hardcoded-string-to-formatmessage` (JSX literals → `formatMessage` / intl patterns).')
|
|
10
10
|
});
|
|
11
11
|
export var listI18nConversionTool = {
|
|
12
12
|
name: 'ads_i18n_conversion_guide',
|
|
13
|
-
description: "
|
|
13
|
+
description: "Returns a **bundled** step-by-step guide for replacing hardcoded UI strings with `formatMessage` (and related patterns) using @atlassian/jira-intl or react-intl-next: message constants, placeholders, descriptions, and scope/limitations for systematic refactors.\n\nWhen working with i18n or hardcoded UI strings, use this tool alongside the Context Engine MCP tool `get_i18n_docs` for Atlassian-wide Traduki / i18n standards (message definition, extraction, pluralisation, formatting, workflow); this tool supplies the concrete hardcoded-string \u2192 `formatMessage` playbook bundled in ADS MCP.\n\nWHEN TO USE / TYPICAL TRIGGERS:\n- Refactoring JSX or TS literals to i18n; \"fix hardcoded string(s)\", \"convert hardcoded string in [file]\", \"literal string in JSX\".\n- \"Convert to i18n\", \"convert to formatMessage\", \"translate this string\", \"internationalize this string\", \"i18n this string\".\n- \"Use formatMessage\", \"use FormattedMessage\", \"wrap in formatMessage\", \"fix literal string\".\n- ESLint: `Literal string in JSX content should be internationalized. Use FormattedMessage or intl.formatMessage()`.\n- ESLint: `@atlassian/i18n/no-literal-string-in-jsx`.",
|
|
14
14
|
annotations: {
|
|
15
|
-
title: 'i18n
|
|
15
|
+
title: 'i18n conversion guide',
|
|
16
16
|
readOnlyHint: true,
|
|
17
17
|
destructiveHint: false,
|
|
18
18
|
idempotentHint: true,
|
|
@@ -10,12 +10,12 @@ import { getAvailableMigrationIds, getAvailableMigrationsDescription, migrationR
|
|
|
10
10
|
var migrationIds = getAvailableMigrationIds();
|
|
11
11
|
var migrationDescriptions = getAvailableMigrationsDescription();
|
|
12
12
|
export var migrationGuidesInputSchema = z.object({
|
|
13
|
-
migration: z.enum(migrationIds).describe(
|
|
14
|
-
description: z.enum(migrationDescriptions).describe(
|
|
13
|
+
migration: z.enum(migrationIds).describe('Migration id from the registry. Must match the guide you want (see tool description list).'),
|
|
14
|
+
description: z.enum(migrationDescriptions).describe('Human-readable migration label that pairs with `migration` in the schema—choose the entry that matches the selected id.')
|
|
15
15
|
});
|
|
16
16
|
export var listMigrationGuidesTool = {
|
|
17
17
|
name: 'ads_migration_guides',
|
|
18
|
-
description: "
|
|
18
|
+
description: "Returns a structured Atlassian Design System (ADS) **migration guide** for a known package or API migration (before/after examples, best practices, links).\n\nWHEN TO USE:\nYou are upgrading or refactoring code between ADS packages or APIs and need the official migration pattern for a specific id listed below.\n\nPass **both** `migration` and `description` using a **matching pair** from the enum (schema enforces valid combinations).\n\nAvailable migrations:\n".concat(getAvailableMigrationsDescription()),
|
|
19
19
|
annotations: {
|
|
20
20
|
title: 'ADS Migration Guides',
|
|
21
21
|
readOnlyHint: true,
|
|
@@ -11,17 +11,16 @@ import { searchComponentsTool } from '../search-components';
|
|
|
11
11
|
import { searchIconsTool } from '../search-icons';
|
|
12
12
|
import { searchTokensTool } from '../search-tokens';
|
|
13
13
|
export var planInputSchema = z.object({
|
|
14
|
-
tokens: z.array(z.string()).describe('
|
|
15
|
-
icons: z.array(z.string()).describe('
|
|
16
|
-
components: z.array(z.string()).describe('
|
|
17
|
-
limit: z.number().default(
|
|
18
|
-
exactName: z.boolean().default(false).describe('Search tokens, icons, and components by their exact name match (use when you explicitly know the name and need more details)').optional()
|
|
14
|
+
tokens: z.array(z.string()).describe('Search terms for ADS design tokens (fuzzy by default). Use `[]` if you only need icons or components. Prefer **at least two** terms per non-empty list when you know what you need.'),
|
|
15
|
+
icons: z.array(z.string()).describe('Search terms for ADS icons. Use `[]` if you only need tokens or components. Prefer **at least two** terms per non-empty list when known.'),
|
|
16
|
+
components: z.array(z.string()).describe('Search terms for ADS components. Use `[]` if you only need tokens or icons. Prefer **at least two** terms per non-empty list when known.'),
|
|
17
|
+
limit: z.number().default(2).describe('Max matches **per term** for each non-empty list (default 2). Same limit applies to tokens, icons, and components searches.').optional()
|
|
19
18
|
});
|
|
20
19
|
export var listPlanTool = {
|
|
21
20
|
name: 'ads_plan',
|
|
22
|
-
description: "
|
|
21
|
+
description: "Runs **ads_search_tokens**, **ads_search_icons**, and **ads_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.\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 **component** packages/props in one pass. Also use when exploring ADS building blocks before you write code.\n\nAt least one of `tokens`, `icons`, or `components` must contain search terms (use `[]` for lists you do not need).\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}\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```",
|
|
23
22
|
annotations: {
|
|
24
|
-
title: '
|
|
23
|
+
title: 'Search ADS tokens, icons, and components to plan what to build',
|
|
25
24
|
readOnlyHint: true,
|
|
26
25
|
destructiveHint: false,
|
|
27
26
|
idempotentHint: true,
|
|
@@ -30,12 +29,12 @@ export var listPlanTool = {
|
|
|
30
29
|
inputSchema: zodToJsonSchema(planInputSchema)
|
|
31
30
|
};
|
|
32
31
|
export var planTool = /*#__PURE__*/function () {
|
|
33
|
-
var
|
|
34
|
-
var tokens_search, icons_search, components_search,
|
|
32
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
33
|
+
var tokens_search, icons_search, components_search, limit, results, searchPromises, getResultCount, consolidatedResult;
|
|
35
34
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
36
35
|
while (1) switch (_context.prev = _context.next) {
|
|
37
36
|
case 0:
|
|
38
|
-
tokens_search =
|
|
37
|
+
tokens_search = _ref.tokens, icons_search = _ref.icons, components_search = _ref.components, limit = _ref.limit;
|
|
39
38
|
if (!(!(tokens_search !== null && tokens_search !== void 0 && tokens_search.length) && !(icons_search !== null && icons_search !== void 0 && icons_search.length) && !(components_search !== null && components_search !== void 0 && components_search.length))) {
|
|
40
39
|
_context.next = 3;
|
|
41
40
|
break;
|
|
@@ -53,8 +52,7 @@ export var planTool = /*#__PURE__*/function () {
|
|
|
53
52
|
if (tokens_search !== null && tokens_search !== void 0 && tokens_search.length) {
|
|
54
53
|
searchPromises.push(searchTokensTool({
|
|
55
54
|
terms: tokens_search,
|
|
56
|
-
limit: limit
|
|
57
|
-
exactName: exactName
|
|
55
|
+
limit: limit
|
|
58
56
|
}).then(function (result) {
|
|
59
57
|
results.tokens = result;
|
|
60
58
|
}));
|
|
@@ -62,8 +60,7 @@ export var planTool = /*#__PURE__*/function () {
|
|
|
62
60
|
if (icons_search !== null && icons_search !== void 0 && icons_search.length) {
|
|
63
61
|
searchPromises.push(searchIconsTool({
|
|
64
62
|
terms: icons_search,
|
|
65
|
-
limit: limit
|
|
66
|
-
exactName: exactName
|
|
63
|
+
limit: limit
|
|
67
64
|
}).then(function (result) {
|
|
68
65
|
results.icons = result;
|
|
69
66
|
}));
|
|
@@ -71,8 +68,7 @@ export var planTool = /*#__PURE__*/function () {
|
|
|
71
68
|
if (components_search !== null && components_search !== void 0 && components_search.length) {
|
|
72
69
|
searchPromises.push(searchComponentsTool({
|
|
73
70
|
terms: components_search,
|
|
74
|
-
limit: limit
|
|
75
|
-
exactName: exactName
|
|
71
|
+
limit: limit
|
|
76
72
|
}).then(function (result) {
|
|
77
73
|
results.components = result;
|
|
78
74
|
}));
|
|
@@ -126,6 +122,6 @@ export var planTool = /*#__PURE__*/function () {
|
|
|
126
122
|
}, _callee);
|
|
127
123
|
}));
|
|
128
124
|
return function planTool(_x) {
|
|
129
|
-
return
|
|
125
|
+
return _ref2.apply(this, arguments);
|
|
130
126
|
};
|
|
131
127
|
}();
|