@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
2
3
|
export const getGuidelinesInputSchema = z.object({
|
|
3
|
-
terms:
|
|
4
|
+
terms: 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(),
|
|
4
5
|
limit: z.number().default(1).describe('Max matches **per term** when `terms` is non-empty (default 1). Ignored when returning all guidelines.').optional()
|
|
5
6
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
4
5
|
export const getLintRulesInputSchema = z.object({
|
|
5
|
-
terms:
|
|
6
|
+
terms: 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(),
|
|
6
7
|
limit: z.number().default(1).describe('Max matches **per term** when searching (default 1). Not used when returning all rules.').optional(),
|
|
7
8
|
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()
|
|
8
9
|
});
|
|
@@ -12,7 +12,7 @@ WHEN TO USE:
|
|
|
12
12
|
ADS-FIRST ROUTING:
|
|
13
13
|
Use \`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\`.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Each 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.
|
|
16
16
|
|
|
17
17
|
Prefer supplying **multiple** terms per non-empty array when you know them—broader queries improve recall. Some queries return no rows where metadata is thin; try alternate wording.
|
|
18
18
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
4
5
|
export const planInputSchema = z.object({
|
|
5
|
-
tokens:
|
|
6
|
-
icons:
|
|
7
|
-
components:
|
|
8
|
-
atlaskitComponents:
|
|
6
|
+
tokens: 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.'),
|
|
7
|
+
icons: 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.'),
|
|
8
|
+
components: 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.'),
|
|
9
|
+
atlaskitComponents: 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.'),
|
|
9
10
|
limit: 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()
|
|
10
11
|
});
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
|
+
import { validateToolArguments } from '../../helpers/validation';
|
|
3
4
|
import { searchAtlaskitComponentsTool } from '../search-atlaskit-components/search-atlaskit-components-tool';
|
|
4
5
|
import { searchComponentsTool } from '../search-components/search-components-tool';
|
|
5
6
|
import { searchIconsTool } from '../search-icons/search-icons-tool';
|
|
6
7
|
import { searchTokensTool } from '../search-tokens/search-tokens-tool';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
import { planInputSchema } from './plan-input-schema';
|
|
9
|
+
const hasSearchTerms = terms => terms.some(term => term.trim().length > 0);
|
|
10
|
+
export const planTool = async args => {
|
|
11
|
+
const validation = validateToolArguments(planInputSchema, args);
|
|
12
|
+
if (!validation.success) {
|
|
13
|
+
return validation.error;
|
|
14
|
+
}
|
|
15
|
+
const {
|
|
16
|
+
tokens: tokens_search,
|
|
17
|
+
icons: icons_search,
|
|
18
|
+
components: components_search,
|
|
19
|
+
atlaskitComponents: atlaskit_components_search,
|
|
20
|
+
limit
|
|
21
|
+
} = validation.data;
|
|
22
|
+
// Require at least one category with a nonblank search term.
|
|
23
|
+
if (!hasSearchTerms(tokens_search) && !hasSearchTerms(icons_search) && !hasSearchTerms(components_search) && !hasSearchTerms(atlaskit_components_search)) {
|
|
16
24
|
return {
|
|
17
25
|
isError: true,
|
|
18
26
|
content: [{
|
|
@@ -25,7 +33,7 @@ export const planTool = async ({
|
|
|
25
33
|
|
|
26
34
|
// Execute searches in parallel
|
|
27
35
|
const searchPromises = [];
|
|
28
|
-
if (tokens_search
|
|
36
|
+
if (hasSearchTerms(tokens_search)) {
|
|
29
37
|
searchPromises.push(searchTokensTool({
|
|
30
38
|
terms: tokens_search,
|
|
31
39
|
limit
|
|
@@ -33,7 +41,7 @@ export const planTool = async ({
|
|
|
33
41
|
results.tokens = result;
|
|
34
42
|
}));
|
|
35
43
|
}
|
|
36
|
-
if (icons_search
|
|
44
|
+
if (hasSearchTerms(icons_search)) {
|
|
37
45
|
searchPromises.push(searchIconsTool({
|
|
38
46
|
terms: icons_search,
|
|
39
47
|
limit
|
|
@@ -41,7 +49,7 @@ export const planTool = async ({
|
|
|
41
49
|
results.icons = result;
|
|
42
50
|
}));
|
|
43
51
|
}
|
|
44
|
-
if (components_search
|
|
52
|
+
if (hasSearchTerms(components_search)) {
|
|
45
53
|
searchPromises.push(searchComponentsTool({
|
|
46
54
|
terms: components_search,
|
|
47
55
|
limit
|
|
@@ -49,7 +57,7 @@ export const planTool = async ({
|
|
|
49
57
|
results.components = result;
|
|
50
58
|
}));
|
|
51
59
|
}
|
|
52
|
-
if (atlaskit_components_search
|
|
60
|
+
if (hasSearchTerms(atlaskit_components_search)) {
|
|
53
61
|
searchPromises.push(searchAtlaskitComponentsTool({
|
|
54
62
|
terms: atlaskit_components_search,
|
|
55
63
|
limit
|
package/dist/es2019/tools/search-atlaskit-components/search-atlaskit-components-input-schema.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
2
3
|
export const searchAtlaskitComponentsInputSchema = z.object({
|
|
3
|
-
terms:
|
|
4
|
+
terms: searchTermsSchema.describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, examples). Example: `["button", "modal", "select"]`.'),
|
|
4
5
|
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
5
6
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
2
3
|
export const searchAtlaskitHooksInputSchema = z.object({
|
|
3
|
-
terms:
|
|
4
|
+
terms: searchTermsSchema.describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, usageGuidelines). Example: `["analytics", "storage", "layering"]`.'),
|
|
4
5
|
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
5
6
|
});
|
package/dist/es2019/tools/search-atlaskit-utilities/search-atlaskit-utilities-input-schema.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
2
3
|
export const searchAtlaskitUtilitiesInputSchema = z.object({
|
|
3
|
-
terms:
|
|
4
|
+
terms: searchTermsSchema.describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, usageGuidelines). Example: `["debounce", "a11y", "storage"]`.'),
|
|
4
5
|
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
5
6
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
4
5
|
export const searchComponentsInputSchema = z.object({
|
|
5
|
-
terms:
|
|
6
|
+
terms: searchTermsSchema.describe('Required: one or more search terms (fuzzy over name, package, category, description, keywords, examples). Example: `["button", "modal", "select"]`.'),
|
|
6
7
|
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
7
8
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
4
5
|
export const searchIconsInputSchema = z.object({
|
|
5
|
-
terms:
|
|
6
|
+
terms: searchTermsSchema.describe('Required: one or more terms; fuzzy match on icon **componentName**, **iconName**, **keywords**, **categorization**, **type**, and **usage**. Example: `["search", "folder", "user"]`.'),
|
|
6
7
|
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional()
|
|
7
8
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/* eslint-disable-next-line import/extensions -- MCP SDK requires .js extensions for ESM imports */
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { searchTermsSchema } from '../../helpers/search-terms-schema';
|
|
4
5
|
export const searchTokensInputSchema = z.object({
|
|
5
|
-
terms:
|
|
6
|
+
terms: searchTermsSchema.describe('Required: one or more terms; fuzzy match on token **name**, **description**, **exampleValue**, **usageGuidelines.usage**, and **usageGuidelines.cssProperties**. Example: `["spacing", "color.text", "background"]`.'),
|
|
6
7
|
limit: z.number().default(2).describe('Max matches **per term** (default 2).').optional(),
|
|
7
8
|
includeMetadata: z.boolean().default(false).describe('Include the token description and usage guidelines in each result (default false).').optional()
|
|
8
9
|
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Treat a scalar as one array entry; preserve existing array contents and order.
|
|
3
|
+
export var searchTermsSchema = z.union([z.string(), z.array(z.string())]).transform(function (terms) {
|
|
4
|
+
return typeof terms === 'string' ? [terms] : terms;
|
|
5
|
+
});
|
|
@@ -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
|
var result = schema.safeParse(args);
|