@atlaskit/ads-mcp 1.0.0 → 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 +11 -0
- 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/tools/get-atlaskit-hooks/get-atlaskit-hooks-tool.d.ts +6 -0
- package/dist/types/tools/get-atlaskit-hooks/list-get-atlaskit-hooks-tool.d.ts +2 -0
- 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/tools/get-atlaskit-utilities/get-atlaskit-utilities-tool.d.ts +6 -0
- package/dist/types/tools/get-atlaskit-utilities/list-get-atlaskit-utilities-tool.d.ts +2 -0
- 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/tools/search-atlaskit-hooks/list-search-atlaskit-hooks-tool.d.ts +2 -0
- package/dist/types/tools/search-atlaskit-hooks/search-atlaskit-hooks-input-schema.d.ts +11 -0
- package/dist/types/tools/search-atlaskit-hooks/search-atlaskit-hooks-tool.d.ts +4 -0
- package/dist/types/tools/search-atlaskit-utilities/list-search-atlaskit-utilities-tool.d.ts +2 -0
- package/dist/types/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.d.ts +11 -0
- 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/package.json +3 -3
|
@@ -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
|
};
|