@atlaskit/ads-mcp 0.21.1 → 1.1.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 +37 -0
- package/a11y-fixes/package.json +1 -8
- package/a11y-guidelines/package.json +1 -8
- package/dist/cjs/index.js +27 -1
- package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
- package/dist/cjs/tools/get-all-components/types.js +5 -1
- package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +19 -6
- package/dist/cjs/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +206 -0
- package/dist/cjs/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.js +40 -0
- package/dist/cjs/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.js +22 -0
- package/dist/cjs/tools/get-atlaskit-hooks/types.js +5 -0
- package/dist/cjs/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +836 -0
- package/dist/cjs/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.js +40 -0
- package/dist/cjs/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.js +22 -0
- package/dist/cjs/tools/get-atlaskit-utilities/types.js +5 -0
- package/dist/cjs/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -4
- package/dist/cjs/tools/get-lint-rules/lint-rules-structured-content.codegen.js +31 -11
- package/dist/cjs/tools/i18n-conversion/guide.js +7 -7
- package/dist/cjs/tools/i18n-conversion/list-i18n-conversion-tool.js +1 -1
- package/dist/cjs/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.js +22 -0
- package/dist/cjs/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +11 -0
- package/dist/cjs/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.js +109 -0
- package/dist/cjs/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.js +22 -0
- package/dist/cjs/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +11 -0
- package/dist/cjs/tools/search-atlaskit-utilities/search-atlaskit-utilities-tool.js +111 -0
- package/dist/cjs/tools/types.js +1 -0
- package/dist/es2019/index.js +30 -0
- package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
- package/dist/es2019/tools/get-all-components/types.js +1 -0
- package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +19 -6
- package/dist/es2019/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +200 -0
- package/dist/es2019/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.js +14 -0
- package/dist/es2019/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.js +21 -0
- package/dist/es2019/tools/get-atlaskit-hooks/types.js +1 -0
- package/dist/es2019/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +830 -0
- package/dist/es2019/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.js +14 -0
- package/dist/es2019/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.js +21 -0
- package/dist/es2019/tools/get-atlaskit-utilities/types.js +1 -0
- package/dist/es2019/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -4
- package/dist/es2019/tools/get-lint-rules/lint-rules-structured-content.codegen.js +31 -11
- package/dist/es2019/tools/i18n-conversion/guide.js +7 -7
- package/dist/es2019/tools/i18n-conversion/list-i18n-conversion-tool.js +1 -1
- package/dist/es2019/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.js +19 -0
- package/dist/es2019/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +5 -0
- package/dist/es2019/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.js +79 -0
- package/dist/es2019/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.js +19 -0
- package/dist/es2019/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +5 -0
- package/dist/es2019/tools/search-atlaskit-utilities/search-atlaskit-utilities-tool.js +81 -0
- package/dist/es2019/tools/types.js +0 -0
- package/dist/esm/index.js +27 -1
- package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/tools/get-all-components/types.js +1 -0
- package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +19 -6
- package/dist/esm/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +200 -0
- package/dist/esm/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.js +32 -0
- package/dist/esm/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.js +16 -0
- package/dist/esm/tools/get-atlaskit-hooks/types.js +1 -0
- package/dist/esm/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +830 -0
- package/dist/esm/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.js +32 -0
- package/dist/esm/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.js +16 -0
- package/dist/esm/tools/get-atlaskit-utilities/types.js +1 -0
- package/dist/esm/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -4
- package/dist/esm/tools/get-lint-rules/lint-rules-structured-content.codegen.js +31 -11
- package/dist/esm/tools/i18n-conversion/guide.js +7 -7
- package/dist/esm/tools/i18n-conversion/list-i18n-conversion-tool.js +1 -1
- package/dist/esm/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.js +16 -0
- package/dist/esm/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.js +5 -0
- package/dist/esm/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.js +102 -0
- package/dist/esm/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.js +16 -0
- package/dist/esm/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js +5 -0
- package/dist/esm/tools/search-atlaskit-utilities/search-atlaskit-utilities-tool.js +106 -0
- package/dist/esm/tools/types.js +0 -0
- package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
- package/dist/types/tools/get-all-components/types.d.ts +2 -1
- package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.d.ts +10 -0
- package/dist/{types-ts4.5/tools/get-all-tokens/get-all-tokens-tool.d.ts → types/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.d.ts} +1 -1
- package/dist/{types-ts4.5/tools/analyze-a11y/list-analyze-a11y-tool.d.ts → types/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.d.ts} +1 -1
- package/dist/types/tools/get-atlaskit-hooks/types.d.ts +14 -0
- package/dist/types/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.d.ts +10 -0
- package/dist/{types-ts4.5/tools/get-all-components/get-all-components-tool.d.ts → types/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.d.ts} +1 -1
- package/dist/{types-ts4.5/tools/analyze-a11y/list-analyze-localhost-a11y-tool.d.ts → types/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.d.ts} +1 -1
- package/dist/types/tools/get-atlaskit-utilities/types.d.ts +41 -0
- 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/list-get-all-icons-tool.d.ts → types/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.d.ts} +1 -1
- package/dist/{types-ts4.5/tools/search-tokens/search-tokens-input-schema.d.ts → types/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.d.ts} +1 -1
- package/dist/types/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.d.ts +4 -0
- package/dist/{types-ts4.5/tools/get-a11y-guidelines/list-get-a11y-guidelines-tool.d.ts → types/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.d.ts} +1 -1
- package/dist/{types-ts4.5/tools/search-components/search-components-input-schema.d.ts → types/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.d.ts} +1 -1
- package/dist/types/tools/search-atlaskit-utilities/search-atlaskit-utilities-tool.d.ts +4 -0
- package/dist/types/tools/types.d.ts +12 -0
- package/i18n-conversion-guide/package.json +1 -8
- package/migration-registry/package.json +1 -8
- package/package.json +5 -13
- package/tools/analyze-a11y/package.json +1 -8
- package/tools/get-a11y-guidelines/package.json +1 -8
- package/tools/get-all-components/package.json +1 -8
- package/tools/get-all-icons/package.json +1 -8
- package/tools/get-all-tokens/package.json +1 -8
- package/tools/get-guidelines/package.json +1 -8
- package/tools/get-lint-rules/package.json +1 -8
- package/tools/i18n-conversion/package.json +1 -8
- package/tools/migration-guides/package.json +1 -8
- package/tools/plan/package.json +1 -8
- package/tools/search-components/package.json +1 -8
- package/tools/search-icons/package.json +1 -8
- package/tools/search-tokens/package.json +1 -8
- package/tools/suggest-a11y-fixes/package.json +1 -8
- package/dist/types-ts4.5/entry-points/a11y-fixes.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/a11y-guidelines.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/analyze-a11y.d.ts +0 -5
- package/dist/types-ts4.5/entry-points/get-a11y-guidelines.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/get-all-components.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/get-all-icons.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/get-all-tokens.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/get-atlaskit-components.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/get-guidelines.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/get-lint-rules.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/i18n-conversion-guide.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/i18n-conversion.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/migration-guides.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/migration-registry.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/plan.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/search-atlaskit-components.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/search-components.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/search-icons.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/search-tokens.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/suggest-a11y-fixes.d.ts +0 -3
- package/dist/types-ts4.5/helpers/agent.d.ts +0 -3
- package/dist/types-ts4.5/helpers/analytics.d.ts +0 -21
- package/dist/types-ts4.5/helpers/clean-query.d.ts +0 -1
- package/dist/types-ts4.5/helpers/compute-multi-term-fuse-allocation.d.ts +0 -14
- package/dist/types-ts4.5/helpers/config-path.d.ts +0 -7
- package/dist/types-ts4.5/helpers/fuse-multi-term.d.ts +0 -26
- package/dist/types-ts4.5/helpers/index.d.ts +0 -3
- package/dist/types-ts4.5/helpers/send-operational-event.d.ts +0 -13
- package/dist/types-ts4.5/helpers/staff-id.d.ts +0 -1
- package/dist/types-ts4.5/helpers/validation.d.ts +0 -26
- package/dist/types-ts4.5/helpers/zod-to-json-schema.d.ts +0 -3
- package/dist/types-ts4.5/index.d.ts +0 -7
- package/dist/types-ts4.5/instructions.d.ts +0 -1
- package/dist/types-ts4.5/tools/analyze-a11y/analyze-a11y-input-schema.d.ts +0 -17
- package/dist/types-ts4.5/tools/analyze-a11y/analyze-a11y-localhost-input-schema.d.ts +0 -17
- package/dist/types-ts4.5/tools/analyze-a11y/analyze-a11y-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/analyze-a11y/analyze-localhost-a11y-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/analyze-a11y/generate-ads-fix-for-violation.d.ts +0 -1
- package/dist/types-ts4.5/tools/get-a11y-guidelines/get-a11y-guidelines-input-schema.d.ts +0 -8
- package/dist/types-ts4.5/tools/get-a11y-guidelines/get-a11y-guidelines-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/get-a11y-guidelines/guidelines.d.ts +0 -102
- package/dist/types-ts4.5/tools/get-all-components/components.codegen.d.ts +0 -10
- package/dist/types-ts4.5/tools/get-all-components/components.d.ts +0 -10
- package/dist/types-ts4.5/tools/get-all-components/list-get-all-components-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-all-components/load-all-components.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-all-components/types.d.ts +0 -26
- package/dist/types-ts4.5/tools/get-all-icons/get-all-icons-tool.d.ts +0 -6
- package/dist/types-ts4.5/tools/get-all-icons/icons.d.ts +0 -11
- package/dist/types-ts4.5/tools/get-all-tokens/list-get-all-tokens-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +0 -10
- package/dist/types-ts4.5/tools/get-atlaskit-components/get-atlaskit-components-tool.d.ts +0 -6
- package/dist/types-ts4.5/tools/get-atlaskit-components/list-get-atlaskit-components-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-guidelines/get-guidelines-input-schema.d.ts +0 -5
- package/dist/types-ts4.5/tools/get-guidelines/get-guidelines-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/get-guidelines/guidelines-structured-content.codegen.d.ts +0 -13
- package/dist/types-ts4.5/tools/get-guidelines/list-get-guidelines-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/get-lint-rules/get-lint-rules-input-schema.d.ts +0 -6
- package/dist/types-ts4.5/tools/get-lint-rules/get-lint-rules-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +0 -13
- package/dist/types-ts4.5/tools/get-lint-rules/list-get-lint-rules-tool.d.ts +0 -19
- package/dist/types-ts4.5/tools/i18n-conversion/guide.d.ts +0 -5
- package/dist/types-ts4.5/tools/i18n-conversion/i18n-conversion-input-schema.d.ts +0 -10
- package/dist/types-ts4.5/tools/i18n-conversion/i18n-conversion-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/i18n-conversion/list-i18n-conversion-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/i18n-conversion/types.d.ts +0 -22
- package/dist/types-ts4.5/tools/migration-guides/get-available-migration-ids.d.ts +0 -12
- package/dist/types-ts4.5/tools/migration-guides/get-available-migrations-description.d.ts +0 -13
- package/dist/types-ts4.5/tools/migration-guides/list-migration-guides-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migration-guides-input-schema.d.ts +0 -15
- package/dist/types-ts4.5/tools/migration-guides/migration-guides-tool.d.ts +0 -8
- package/dist/types-ts4.5/tools/migration-guides/migration-registry.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migrations/onboarding-jira-spotlight.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migrations/onboarding-multi-step.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migrations/onboarding-single-step.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/migrations/onboarding-with-motion.d.ts +0 -2
- package/dist/types-ts4.5/tools/migration-guides/types.d.ts +0 -23
- package/dist/types-ts4.5/tools/plan/list-plan-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/plan/plan-input-schema.d.ts +0 -20
- package/dist/types-ts4.5/tools/plan/plan-tool.d.ts +0 -15
- package/dist/types-ts4.5/tools/search-atlaskit-components/list-search-atlaskit-components-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/search-atlaskit-components/search-atlaskit-components-input-schema.d.ts +0 -11
- package/dist/types-ts4.5/tools/search-atlaskit-components/search-atlaskit-components-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/search-components/list-search-components-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/search-components/search-components-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/search-icons/list-search-icons-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/search-icons/search-icons-input-schema.d.ts +0 -11
- package/dist/types-ts4.5/tools/search-icons/search-icons-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/search-tokens/list-search-tokens-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/search-tokens/search-tokens-tool.d.ts +0 -4
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/fixes.d.ts +0 -17
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/keywords.d.ts +0 -12
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/list-suggest-a11y-fixes-tool.d.ts +0 -2
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/suggest-a11y-fixes-input-schema.d.ts +0 -17
- package/dist/types-ts4.5/tools/suggest-a11y-fixes/suggest-a11y-fixes-tool.d.ts +0 -8
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
|
+
|
|
3
|
+
import Fuse from 'fuse.js';
|
|
4
|
+
import { cleanQuery, mergeMultiTermFuseResults } from '../../helpers';
|
|
5
|
+
import { atlaskitHooks } from '../get-atlaskit-hooks/atlaskit-hooks.codegen';
|
|
6
|
+
const buildHookResult = result => {
|
|
7
|
+
return {
|
|
8
|
+
name: result.name,
|
|
9
|
+
package: result.package,
|
|
10
|
+
description: result.description,
|
|
11
|
+
usageGuidelines: result.usageGuidelines,
|
|
12
|
+
keywords: result.keywords,
|
|
13
|
+
category: result.category,
|
|
14
|
+
parameters: result.parameters,
|
|
15
|
+
returns: result.returns
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const searchAtlaskitHooksTool = async ({
|
|
19
|
+
terms,
|
|
20
|
+
limit = 2
|
|
21
|
+
}) => {
|
|
22
|
+
const searchTerms = [...new Set(terms.filter(Boolean).map(cleanQuery))];
|
|
23
|
+
if (!searchTerms.length) {
|
|
24
|
+
return {
|
|
25
|
+
content: [{
|
|
26
|
+
type: 'text',
|
|
27
|
+
text: '[]'
|
|
28
|
+
}]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const hooks = atlaskitHooks;
|
|
32
|
+
const fuse = new Fuse(hooks, {
|
|
33
|
+
keys: [{
|
|
34
|
+
name: 'name',
|
|
35
|
+
weight: 5
|
|
36
|
+
}, {
|
|
37
|
+
name: 'package',
|
|
38
|
+
weight: 3
|
|
39
|
+
}, {
|
|
40
|
+
name: 'category',
|
|
41
|
+
weight: 2
|
|
42
|
+
}, {
|
|
43
|
+
name: 'description',
|
|
44
|
+
weight: 2
|
|
45
|
+
}, {
|
|
46
|
+
name: 'keywords',
|
|
47
|
+
weight: 2
|
|
48
|
+
}, {
|
|
49
|
+
name: 'usageGuidelines',
|
|
50
|
+
weight: 2
|
|
51
|
+
}],
|
|
52
|
+
threshold: 0.4,
|
|
53
|
+
distance: 80,
|
|
54
|
+
minMatchCharLength: 3,
|
|
55
|
+
ignoreFieldNorm: true,
|
|
56
|
+
includeScore: true
|
|
57
|
+
});
|
|
58
|
+
const matchedItems = mergeMultiTermFuseResults({
|
|
59
|
+
searchTerms,
|
|
60
|
+
limit,
|
|
61
|
+
search: query => fuse.search(query, {
|
|
62
|
+
limit: limit * searchTerms.length
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
if (!matchedItems.length) {
|
|
66
|
+
return {
|
|
67
|
+
content: [{
|
|
68
|
+
type: 'text',
|
|
69
|
+
text: `Error: No Atlaskit hooks found for '${terms.join(', ')}'.`
|
|
70
|
+
}]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
content: [{
|
|
75
|
+
type: 'text',
|
|
76
|
+
text: JSON.stringify(matchedItems.map(buildHookResult))
|
|
77
|
+
}]
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
|
+
|
|
3
|
+
import { zodToJsonSchema } from '../../helpers';
|
|
4
|
+
import { searchAtlaskitUtilitiesInputSchema } from './search-atlaskit-utilities-input-schema';
|
|
5
|
+
export const listSearchAtlaskitUtilitiesTool = {
|
|
6
|
+
name: 'atlaskit_search_utilities',
|
|
7
|
+
description: `Search for atlaskit utilities (functions, constants, types) by name, package, category, description, or keywords.
|
|
8
|
+
|
|
9
|
+
WHEN TO USE:
|
|
10
|
+
Use this when you want to find a utility but don't know its exact name or package.`,
|
|
11
|
+
annotations: {
|
|
12
|
+
title: 'Search Atlaskit utilities',
|
|
13
|
+
readOnlyHint: true,
|
|
14
|
+
destructiveHint: false,
|
|
15
|
+
idempotentHint: true,
|
|
16
|
+
openWorldHint: true
|
|
17
|
+
},
|
|
18
|
+
inputSchema: zodToJsonSchema(searchAtlaskitUtilitiesInputSchema)
|
|
19
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const searchAtlaskitUtilitiesInputSchema = z.object({
|
|
3
|
+
terms: z.array(z.string()).describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, usageGuidelines). Example: `["debounce", "a11y", "storage"]`.'),
|
|
4
|
+
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
5
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
|
+
|
|
3
|
+
import Fuse from 'fuse.js';
|
|
4
|
+
import { cleanQuery, mergeMultiTermFuseResults } from '../../helpers';
|
|
5
|
+
import { atlaskitUtilities } from '../get-atlaskit-utilities/atlaskit-utilities.codegen';
|
|
6
|
+
const buildUtilityResult = result => {
|
|
7
|
+
return {
|
|
8
|
+
name: result.name,
|
|
9
|
+
package: result.package,
|
|
10
|
+
description: result.description,
|
|
11
|
+
usageGuidelines: result.usageGuidelines,
|
|
12
|
+
keywords: result.keywords,
|
|
13
|
+
category: result.category,
|
|
14
|
+
kind: result.kind,
|
|
15
|
+
...(result.kind === 'function' ? {
|
|
16
|
+
signature: result.signature
|
|
17
|
+
} : {})
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export const searchAtlaskitUtilitiesTool = async ({
|
|
21
|
+
terms,
|
|
22
|
+
limit = 2
|
|
23
|
+
}) => {
|
|
24
|
+
const searchTerms = [...new Set(terms.filter(Boolean).map(cleanQuery))];
|
|
25
|
+
if (!searchTerms.length) {
|
|
26
|
+
return {
|
|
27
|
+
content: [{
|
|
28
|
+
type: 'text',
|
|
29
|
+
text: '[]'
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const utilities = atlaskitUtilities;
|
|
34
|
+
const fuse = new Fuse(utilities, {
|
|
35
|
+
keys: [{
|
|
36
|
+
name: 'name',
|
|
37
|
+
weight: 5
|
|
38
|
+
}, {
|
|
39
|
+
name: 'package',
|
|
40
|
+
weight: 3
|
|
41
|
+
}, {
|
|
42
|
+
name: 'category',
|
|
43
|
+
weight: 2
|
|
44
|
+
}, {
|
|
45
|
+
name: 'description',
|
|
46
|
+
weight: 2
|
|
47
|
+
}, {
|
|
48
|
+
name: 'keywords',
|
|
49
|
+
weight: 2
|
|
50
|
+
}, {
|
|
51
|
+
name: 'usageGuidelines',
|
|
52
|
+
weight: 2
|
|
53
|
+
}],
|
|
54
|
+
threshold: 0.4,
|
|
55
|
+
distance: 80,
|
|
56
|
+
minMatchCharLength: 3,
|
|
57
|
+
ignoreFieldNorm: true,
|
|
58
|
+
includeScore: true
|
|
59
|
+
});
|
|
60
|
+
const matchedItems = mergeMultiTermFuseResults({
|
|
61
|
+
searchTerms,
|
|
62
|
+
limit,
|
|
63
|
+
search: query => fuse.search(query, {
|
|
64
|
+
limit: limit * searchTerms.length
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
if (!matchedItems.length) {
|
|
68
|
+
return {
|
|
69
|
+
content: [{
|
|
70
|
+
type: 'text',
|
|
71
|
+
text: `Error: No Atlaskit utilities found for '${terms.join(', ')}'.`
|
|
72
|
+
}]
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
content: [{
|
|
77
|
+
type: 'text',
|
|
78
|
+
text: JSON.stringify(matchedItems.map(buildUtilityResult))
|
|
79
|
+
}]
|
|
80
|
+
};
|
|
81
|
+
};
|
|
File without changes
|
package/dist/esm/index.js
CHANGED
|
@@ -25,6 +25,10 @@ import { getAllTokensTool } from './tools/get-all-tokens/get-all-tokens-tool';
|
|
|
25
25
|
import { listGetAllTokensTool } from './tools/get-all-tokens/list-get-all-tokens-tool';
|
|
26
26
|
import { getAtlaskitComponentsTool } from './tools/get-atlaskit-components/get-atlaskit-components-tool';
|
|
27
27
|
import { listGetAtlaskitComponentsTool } from './tools/get-atlaskit-components/list-get-atlaskit-components-tool';
|
|
28
|
+
import { getAtlaskitHooksTool } from './tools/get-atlaskit-hooks/get-atlaskit-hooks-tool';
|
|
29
|
+
import { listGetAtlaskitHooksTool } from './tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool';
|
|
30
|
+
import { getAtlaskitUtilitiesTool } from './tools/get-atlaskit-utilities/get-atlaskit-utilities-tool';
|
|
31
|
+
import { listGetAtlaskitUtilitiesTool } from './tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool';
|
|
28
32
|
import { getGuidelinesInputSchema } from './tools/get-guidelines/get-guidelines-input-schema';
|
|
29
33
|
import { getGuidelinesTool } from './tools/get-guidelines/get-guidelines-tool';
|
|
30
34
|
import { listGetGuidelinesTool } from './tools/get-guidelines/list-get-guidelines-tool';
|
|
@@ -43,6 +47,12 @@ import { planTool } from './tools/plan/plan-tool';
|
|
|
43
47
|
import { listSearchAtlaskitComponentsTool } from './tools/search-atlaskit-components/list-search-atlaskit-components-tool';
|
|
44
48
|
import { searchAtlaskitComponentsInputSchema } from './tools/search-atlaskit-components/search-atlaskit-components-input-schema';
|
|
45
49
|
import { searchAtlaskitComponentsTool } from './tools/search-atlaskit-components/search-atlaskit-components-tool';
|
|
50
|
+
import { listSearchAtlaskitHooksTool } from './tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool';
|
|
51
|
+
import { searchAtlaskitHooksInputSchema } from './tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema';
|
|
52
|
+
import { searchAtlaskitHooksTool } from './tools/search-atlaskit-hooks/search-atlaskit-hooks-tool';
|
|
53
|
+
import { listSearchAtlaskitUtilitiesTool } from './tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool';
|
|
54
|
+
import { searchAtlaskitUtilitiesInputSchema } from './tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema';
|
|
55
|
+
import { searchAtlaskitUtilitiesTool } from './tools/search-atlaskit-utilities/search-atlaskit-utilities-tool';
|
|
46
56
|
import { listSearchComponentsTool } from './tools/search-components/list-search-components-tool';
|
|
47
57
|
import { searchComponentsInputSchema } from './tools/search-components/search-components-input-schema';
|
|
48
58
|
import { searchComponentsTool } from './tools/search-components/search-components-tool';
|
|
@@ -132,7 +142,7 @@ export var getToolRegistry = function getToolRegistry() {
|
|
|
132
142
|
handler: migrationGuidesTool,
|
|
133
143
|
inputSchema: migrationGuidesInputSchema,
|
|
134
144
|
tool: listMigrationGuidesTool
|
|
135
|
-
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_registry, listI18nConversionTool.name, {
|
|
145
|
+
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_registry, listI18nConversionTool.name, {
|
|
136
146
|
handler: i18nConversionTool,
|
|
137
147
|
inputSchema: i18nConversionInputSchema,
|
|
138
148
|
tool: listI18nConversionTool
|
|
@@ -160,6 +170,22 @@ export var getToolRegistry = function getToolRegistry() {
|
|
|
160
170
|
handler: searchAtlaskitComponentsTool,
|
|
161
171
|
inputSchema: searchAtlaskitComponentsInputSchema,
|
|
162
172
|
tool: listSearchAtlaskitComponentsTool
|
|
173
|
+
}), listGetAtlaskitUtilitiesTool.name, {
|
|
174
|
+
handler: getAtlaskitUtilitiesTool,
|
|
175
|
+
inputSchema: null,
|
|
176
|
+
tool: listGetAtlaskitUtilitiesTool
|
|
177
|
+
}), listSearchAtlaskitUtilitiesTool.name, {
|
|
178
|
+
handler: searchAtlaskitUtilitiesTool,
|
|
179
|
+
inputSchema: searchAtlaskitUtilitiesInputSchema,
|
|
180
|
+
tool: listSearchAtlaskitUtilitiesTool
|
|
181
|
+
}), listGetAtlaskitHooksTool.name, {
|
|
182
|
+
handler: getAtlaskitHooksTool,
|
|
183
|
+
inputSchema: null,
|
|
184
|
+
tool: listGetAtlaskitHooksTool
|
|
185
|
+
}), _defineProperty(_registry, listSearchAtlaskitHooksTool.name, {
|
|
186
|
+
handler: searchAtlaskitHooksTool,
|
|
187
|
+
inputSchema: searchAtlaskitHooksInputSchema,
|
|
188
|
+
tool: listSearchAtlaskitHooksTool
|
|
163
189
|
}));
|
|
164
190
|
return registry;
|
|
165
191
|
};
|