@wordpress/design-system-mcp 0.15.0 → 0.17.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/README.md +15 -6
- package/build-module/data.mjs +81 -50
- package/build-module/data.mjs.map +1 -7
- package/build-module/find-each.mjs +25 -0
- package/build-module/find-each.mjs.map +1 -0
- package/build-module/format.mjs +65 -53
- package/build-module/format.mjs.map +1 -7
- package/build-module/index.mjs +25 -23
- package/build-module/index.mjs.map +1 -7
- package/build-module/parse-components.mjs +135 -82
- package/build-module/parse-components.mjs.map +1 -7
- package/build-module/parse-patterns.mjs +44 -0
- package/build-module/parse-patterns.mjs.map +1 -0
- package/build-module/tools/get-component-details.mjs +32 -66
- package/build-module/tools/get-component-details.mjs.map +1 -7
- package/build-module/tools/get-components.mjs +20 -26
- package/build-module/tools/get-components.mjs.map +1 -7
- package/build-module/tools/get-design-tokens.mjs +19 -26
- package/build-module/tools/get-design-tokens.mjs.map +1 -7
- package/build-module/tools/get-pattern-details.mjs +38 -0
- package/build-module/tools/get-pattern-details.mjs.map +1 -0
- package/build-module/tools/get-patterns.mjs +23 -0
- package/build-module/tools/get-patterns.mjs.map +1 -0
- package/build-module/tools/index.mjs +18 -10
- package/build-module/tools/index.mjs.map +1 -7
- package/build-module/types.mjs +0 -1
- package/build-types/data.d.ts +14 -1
- package/build-types/data.d.ts.map +1 -1
- package/build-types/find-each.d.ts +13 -0
- package/build-types/find-each.d.ts.map +1 -0
- package/build-types/format.d.ts +8 -1
- package/build-types/format.d.ts.map +1 -1
- package/build-types/index.d.ts +1 -0
- package/build-types/index.d.ts.map +1 -1
- package/build-types/parse-patterns.d.ts +10 -0
- package/build-types/parse-patterns.d.ts.map +1 -0
- package/build-types/tools/get-component-details.d.ts.map +1 -1
- package/build-types/tools/get-pattern-details.d.ts +26 -0
- package/build-types/tools/get-pattern-details.d.ts.map +1 -0
- package/build-types/tools/get-patterns.d.ts +8 -0
- package/build-types/tools/get-patterns.d.ts.map +1 -0
- package/build-types/tools/index.d.ts.map +1 -1
- package/build-types/types.d.ts +11 -0
- package/build-types/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/build-module/types.mjs.map +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pattern-details.mjs","names":[],"sources":["../../src/tools/get-pattern-details.ts"],"sourcesContent":["import type { McpServer } from '@modelcontextprotocol/server';\nimport { z } from 'zod';\nimport { getPatternDetail } from '../data.ts';\nimport { findEach } from '../find-each.ts';\n\nconst inputSchema = z.object( {\n\tslug: z\n\t\t.union( [\n\t\t\tz.string().min( 1 ),\n\t\t\tz.array( z.string().min( 1 ) ).min( 1 ).max( 10 ),\n\t\t] )\n\t\t.describe(\n\t\t\t'A pattern slug, or an array of pattern slugs to fetch in a single call (e.g. \"destructive-actions\" or [\"destructive-actions\", \"error-messages\"]).'\n\t\t),\n} );\n\nexport async function handler( { slug }: z.infer< typeof inputSchema > ) {\n\tconst { found, missing } = await findEach( slug, getPatternDetail );\n\tconst list = missing.map( ( key ) => `\"${ key }\"` ).join( ', ' );\n\n\tif ( found.length === 0 ) {\n\t\treturn {\n\t\t\tcontent: [\n\t\t\t\t{\n\t\t\t\t\ttype: 'text' as const,\n\t\t\t\t\ttext: `No patterns were found for: ${ list }. Call get_patterns for the available slugs.`,\n\t\t\t\t},\n\t\t\t],\n\t\t\tisError: true,\n\t\t};\n\t}\n\n\tlet text = found\n\t\t.map( ( pattern ) => pattern.content )\n\t\t.join( '\\n\\n---\\n\\n' );\n\tif ( missing.length > 0 ) {\n\t\ttext += `\\n\\n---\\n\\n_No patterns were found for: ${ list }._`;\n\t}\n\n\treturn {\n\t\tcontent: [\n\t\t\t{\n\t\t\t\ttype: 'text' as const,\n\t\t\t\ttext,\n\t\t\t},\n\t\t],\n\t};\n}\n\n/**\n * Register the get_pattern_details tool.\n *\n * @param server - The MCP server instance.\n */\nexport function register( server: McpServer ): void {\n\tserver.registerTool(\n\t\t'get_pattern_details',\n\t\t{\n\t\t\ttitle: 'Get Pattern Details',\n\t\t\tdescription:\n\t\t\t\t'Get the full guidance for one or more WordPress Design System patterns. A pattern explains which components to choose for a kind of interaction and how to configure them. Use the slugs listed by get_patterns. Pass multiple slugs to fetch several patterns in a single call instead of making repeated calls.',\n\t\t\tinputSchema,\n\t\t\tannotations: {\n\t\t\t\treadOnlyHint: true,\n\t\t\t},\n\t\t},\n\t\thandler\n\t);\n}\n"],"mappings":";;;;AAKA,MAAM,cAAc,EAAE,OAAQ,EAC7B,MAAM,EACJ,MAAO,CACP,EAAE,OAAO,CAAC,CAAC,IAAK,CAAE,GAClB,EAAE,MAAO,EAAE,OAAO,CAAC,CAAC,IAAK,CAAE,CAAE,CAAC,CAAC,IAAK,CAAE,CAAC,CAAC,IAAK,EAAG,CACjD,CAAE,CAAC,CACF,SACA,yJACD,EACF,CAAE;AAEF,eAAsB,QAAS,EAAE,QAAwC;CACxE,MAAM,EAAE,OAAO,YAAY,MAAM,SAAU,MAAM,gBAAiB;CAClE,MAAM,OAAO,QAAQ,KAAO,QAAS,IAAK,IAAK,EAAG,CAAC,CAAC,KAAM,IAAK;CAE/D,IAAK,MAAM,WAAW,GACrB,OAAO;EACN,SAAS,CACR;GACC,MAAM;GACN,MAAM,+BAAgC,KAAM;EAC7C,CACD;EACA,SAAS;CACV;CAGD,IAAI,OAAO,MACT,KAAO,YAAa,QAAQ,OAAQ,CAAC,CACrC,KAAM,aAAc;CACtB,IAAK,QAAQ,SAAS,GACrB,QAAQ,2CAA4C,KAAM;CAG3D,OAAO,EACN,SAAS,CACR;EACC,MAAM;EACN;CACD,CACD,EACD;AACD;;;;;;AAOA,SAAgB,SAAU,QAA0B;CACnD,OAAO,aACN,uBACA;EACC,OAAO;EACP,aACC;EACD;EACA,aAAa,EACZ,cAAc,KACf;CACD,GACA,OACD;AACD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getPatterns } from "../data.mjs";
|
|
2
|
+
import { formatPatterns } from "../format.mjs";
|
|
3
|
+
// packages/design-system-mcp/src/tools/get-patterns.ts
|
|
4
|
+
/**
|
|
5
|
+
* Register the get_patterns tool.
|
|
6
|
+
*
|
|
7
|
+
* @param server - The MCP server instance.
|
|
8
|
+
*/
|
|
9
|
+
function register(server) {
|
|
10
|
+
server.registerTool("get_patterns", {
|
|
11
|
+
title: "Get Patterns",
|
|
12
|
+
description: "List the WordPress Design System patterns, each with a short description. A pattern explains how to approach a specific kind of interaction, such as confirming a destructive action or saving a form. Check this list before building an interface or a user flow. The list does not cover every interaction: use a pattern only when it fits the situation, and otherwise work from the components.",
|
|
13
|
+
annotations: { readOnlyHint: true }
|
|
14
|
+
}, async () => {
|
|
15
|
+
return { content: [{
|
|
16
|
+
type: "text",
|
|
17
|
+
text: formatPatterns(await getPatterns())
|
|
18
|
+
}] };
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export { register };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=get-patterns.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-patterns.mjs","names":[],"sources":["../../src/tools/get-patterns.ts"],"sourcesContent":["import type { McpServer } from '@modelcontextprotocol/server';\nimport { getPatterns } from '../data.ts';\nimport { formatPatterns } from '../format.ts';\n\n/**\n * Register the get_patterns tool.\n *\n * @param server - The MCP server instance.\n */\nexport function register( server: McpServer ): void {\n\tserver.registerTool(\n\t\t'get_patterns',\n\t\t{\n\t\t\ttitle: 'Get Patterns',\n\t\t\tdescription:\n\t\t\t\t'List the WordPress Design System patterns, each with a short description. A pattern explains how to approach a specific kind of interaction, such as confirming a destructive action or saving a form. Check this list before building an interface or a user flow. The list does not cover every interaction: use a pattern only when it fits the situation, and otherwise work from the components.',\n\t\t\tannotations: {\n\t\t\t\treadOnlyHint: true,\n\t\t\t},\n\t\t},\n\t\tasync () => {\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\ttext: formatPatterns( await getPatterns() ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t);\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,SAAU,QAA0B;CACnD,OAAO,aACN,gBACA;EACC,OAAO;EACP,aACC;EACD,aAAa,EACZ,cAAc,KACf;CACD,GACA,YAAY;EACX,OAAO,EACN,SAAS,CACR;GACC,MAAM;GACN,MAAM,eAAgB,MAAM,YAAY,CAAE;EAC3C,CACD,EACD;CACD,CACD;AACD"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import { register } from "./get-components.mjs";
|
|
2
|
+
import { register as register$1 } from "./get-component-details.mjs";
|
|
3
|
+
import { register as register$2 } from "./get-design-tokens.mjs";
|
|
4
|
+
import { register as register$3 } from "./get-patterns.mjs";
|
|
5
|
+
import { register as register$4 } from "./get-pattern-details.mjs";
|
|
1
6
|
// packages/design-system-mcp/src/tools/index.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Register all MCP tools on the server.
|
|
9
|
+
*
|
|
10
|
+
* @param server - The MCP server instance.
|
|
11
|
+
*/
|
|
5
12
|
function registerTools(server) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
register(server);
|
|
14
|
+
register$1(server);
|
|
15
|
+
register$2(server);
|
|
16
|
+
register$3(server);
|
|
17
|
+
register$4(server);
|
|
9
18
|
}
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=index.mjs.map
|
|
19
|
+
export { registerTools };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tools/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { McpServer } from '@modelcontextprotocol/server';\nimport { register as getComponents } from './get-components.ts';\nimport { register as getComponentDetails } from './get-component-details.ts';\nimport { register as getDesignTokens } from './get-design-tokens.ts';\n\n/**\n * Register all MCP tools on the server.\n *\n * @param server - The MCP server instance.\n */\nexport function registerTools( server: McpServer ): void {\n\tgetComponents( server );\n\tgetComponentDetails( server );\n\tgetDesignTokens( server );\n}\n"],
|
|
5
|
-
"mappings": ";AACA,SAAS,YAAY,qBAAqB;AAC1C,SAAS,YAAY,2BAA2B;AAChD,SAAS,YAAY,uBAAuB;AAOrC,SAAS,cAAe,QAA0B;AACxD,gBAAe,MAAO;AACtB,sBAAqB,MAAO;AAC5B,kBAAiB,MAAO;AACzB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["import type { McpServer } from '@modelcontextprotocol/server';\nimport { register as getComponents } from './get-components.ts';\nimport { register as getComponentDetails } from './get-component-details.ts';\nimport { register as getDesignTokens } from './get-design-tokens.ts';\nimport { register as getPatterns } from './get-patterns.ts';\nimport { register as getPatternDetails } from './get-pattern-details.ts';\n\n/**\n * Register all MCP tools on the server.\n *\n * @param server - The MCP server instance.\n */\nexport function registerTools( server: McpServer ): void {\n\tgetComponents( server );\n\tgetComponentDetails( server );\n\tgetDesignTokens( server );\n\tgetPatterns( server );\n\tgetPatternDetails( server );\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAAgB,cAAe,QAA0B;CACxD,SAAe,MAAO;CACtB,WAAqB,MAAO;CAC5B,WAAiB,MAAO;CACxB,WAAa,MAAO;CACpB,WAAmB,MAAO;AAC3B"}
|
package/build-module/types.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.mjs.map
|
package/build-types/data.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, ComponentDetail } from './types.ts';
|
|
1
|
+
import type { Component, ComponentDetail, Pattern } from './types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Clear cached data. Intended for testing.
|
|
4
4
|
*/
|
|
@@ -24,4 +24,17 @@ export declare function getComponentDetail(name: string): Promise<ComponentDetai
|
|
|
24
24
|
export declare function getDesignTokens(): Promise<{
|
|
25
25
|
content: string;
|
|
26
26
|
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the design system patterns from the Storybook docs manifest.
|
|
29
|
+
*
|
|
30
|
+
* @return The patterns.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getPatterns(): Promise<Pattern[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Get a single pattern document by slug, including its markdown content.
|
|
35
|
+
*
|
|
36
|
+
* @param slug - The pattern slug (case-insensitive).
|
|
37
|
+
* @return The pattern detail, or null if there is no such pattern.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getPatternDetail(slug: string): Promise<Pattern | null>;
|
|
27
40
|
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,SAAS,EACT,eAAe,EAGf,OAAO,EACP,MAAM,YAAY,CAAC;AAkBpB;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAIjC;AAsCD;;;;GAIG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAE,SAAS,EAAE,CAAE,CAG5D;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACvC,IAAI,EAAE,MAAM,GACV,OAAO,CAAE,eAAe,GAAG,IAAI,CAAE,CAGnC;AAED;;;;GAIG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAE,CAatE;AAED;;;;GAIG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAE,OAAO,EAAE,CAAE,CAmBxD;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACrC,IAAI,EAAE,MAAM,GACV,OAAO,CAAE,OAAO,GAAG,IAAI,CAAE,CAM3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Look up each of one or more keys, and separate the items found from the keys
|
|
3
|
+
* that have no item.
|
|
4
|
+
*
|
|
5
|
+
* @param keys - The key, or keys, to look up.
|
|
6
|
+
* @param find - Returns the item for a key, or null if there is none.
|
|
7
|
+
* @return The items found, and the keys without an item.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findEach<T>(keys: string | string[], find: (key: string) => Promise<T | null>): Promise<{
|
|
10
|
+
found: T[];
|
|
11
|
+
missing: string[];
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=find-each.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-each.d.ts","sourceRoot":"","sources":["../src/find-each.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAE,CAAC,EAChC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EACvB,IAAI,EAAE,CAAE,GAAG,EAAE,MAAM,KAAM,OAAO,CAAE,CAAC,GAAG,IAAI,CAAE,GAC1C,OAAO,CAAE;IAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAE,CAe9C"}
|
package/build-types/format.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, ComponentDetail } from './types.ts';
|
|
1
|
+
import type { Component, ComponentDetail, Pattern } from './types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Format the component list as markdown.
|
|
4
4
|
*
|
|
@@ -13,4 +13,11 @@ export declare function formatComponents(components: Component[]): string;
|
|
|
13
13
|
* @return Formatted markdown.
|
|
14
14
|
*/
|
|
15
15
|
export declare function formatComponentDetail(detail: ComponentDetail): string;
|
|
16
|
+
/**
|
|
17
|
+
* Format the pattern list as markdown.
|
|
18
|
+
*
|
|
19
|
+
* @param patterns - The patterns to format.
|
|
20
|
+
* @return Formatted markdown.
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatPatterns(patterns: Pattern[]): string;
|
|
16
23
|
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAuBtE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAE,UAAU,EAAE,SAAS,EAAE,GAAI,MAAM,CAQlE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAE,MAAM,EAAE,eAAe,GAAI,MAAM,CAgDvE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAE,QAAQ,EAAE,OAAO,EAAE,GAAI,MAAM,CAmB5D"}
|
package/build-types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
2
|
export { parseComponents, parseComponentDetail } from './parse-components.ts';
|
|
3
|
+
export { parsePatterns } from './parse-patterns.ts';
|
|
3
4
|
export declare function createServer(): McpServer;
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,wBAAgB,YAAY,cA2B3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ManifestDoc, Pattern } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Parse the design system patterns from the entries of a Storybook docs
|
|
4
|
+
* manifest.
|
|
5
|
+
*
|
|
6
|
+
* @param docs - The manifest entries, keyed by docs ID.
|
|
7
|
+
* @return The patterns.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parsePatterns(docs: Record<string, ManifestDoc>): Pattern[];
|
|
10
|
+
//# sourceMappingURL=parse-patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-patterns.d.ts","sourceRoot":"","sources":["../src/parse-patterns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAwCvD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC5B,IAAI,EAAE,MAAM,CAAE,MAAM,EAAE,WAAW,CAAE,GACjC,OAAO,EAAE,CAIX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-component-details.d.ts","sourceRoot":"","sources":["../../src/tools/get-component-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-component-details.d.ts","sourceRoot":"","sources":["../../src/tools/get-component-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,WAAW;;iBASd,CAAC;AAEJ,wBAAsB,OAAO,CAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAE,OAAO,WAAW,CAAE;;cAQ3D,MAAM;;;;;;;cAgBP,MAAM;;;GAKf;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAE,MAAM,EAAE,SAAS,GAAI,IAAI,CAclD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
slug: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare function handler({ slug }: z.infer<typeof inputSchema>): Promise<{
|
|
7
|
+
content: {
|
|
8
|
+
type: 'text';
|
|
9
|
+
text: string;
|
|
10
|
+
}[];
|
|
11
|
+
isError: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
isError?: undefined;
|
|
14
|
+
content: {
|
|
15
|
+
type: 'text';
|
|
16
|
+
text: string;
|
|
17
|
+
}[];
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Register the get_pattern_details tool.
|
|
21
|
+
*
|
|
22
|
+
* @param server - The MCP server instance.
|
|
23
|
+
*/
|
|
24
|
+
export declare function register(server: McpServer): void;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=get-pattern-details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pattern-details.d.ts","sourceRoot":"","sources":["../../src/tools/get-pattern-details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,WAAW;;iBASd,CAAC;AAEJ,wBAAsB,OAAO,CAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAE,OAAO,WAAW,CAAE;;cAQ3D,MAAM;;;;;;;cAkBP,MAAM;;;GAKf;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAE,MAAM,EAAE,SAAS,GAAI,IAAI,CAclD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-patterns.d.ts","sourceRoot":"","sources":["../../src/tools/get-patterns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI9D;;;;GAIG;AACH,wBAAgB,QAAQ,CAAE,MAAM,EAAE,SAAS,GAAI,IAAI,CAsBlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAO9D;;;;GAIG;AACH,wBAAgB,aAAa,CAAE,MAAM,EAAE,SAAS,GAAI,IAAI,CAMvD"}
|
package/build-types/types.d.ts
CHANGED
|
@@ -49,4 +49,15 @@ export interface ComponentDetail {
|
|
|
49
49
|
description?: string;
|
|
50
50
|
}>;
|
|
51
51
|
}
|
|
52
|
+
export interface ManifestDoc {
|
|
53
|
+
id: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
content?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface Pattern {
|
|
58
|
+
slug: string;
|
|
59
|
+
title: string;
|
|
60
|
+
description: string;
|
|
61
|
+
content: string;
|
|
62
|
+
}
|
|
52
63
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 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AAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,OAAO,EAAE,KAAK,CAAE;QACf,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,CAAE,CAAC;CACJ;AAED,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/design-system-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "MCP server for the WordPress Design System.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^24.13.3",
|
|
49
|
-
"vitest": "^5.0
|
|
49
|
+
"vitest": "^5.1.0"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "1000cdf1dffd5b5e69f75cc4360aa76db8252264"
|
|
55
55
|
}
|