@triptease/design-system-mcp 0.0.3
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 +26 -0
- package/README.md +340 -0
- package/dist/package.json +41 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +39 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/manifests/components/entries/badge.d.ts +27 -0
- package/dist/src/manifests/components/entries/badge.js +43 -0
- package/dist/src/manifests/components/entries/badge.js.map +1 -0
- package/dist/src/manifests/components/entries/barChart.d.ts +73 -0
- package/dist/src/manifests/components/entries/barChart.js +125 -0
- package/dist/src/manifests/components/entries/barChart.js.map +1 -0
- package/dist/src/manifests/components/entries/button.d.ts +40 -0
- package/dist/src/manifests/components/entries/button.js +59 -0
- package/dist/src/manifests/components/entries/button.js.map +1 -0
- package/dist/src/manifests/components/entries/card.d.ts +20 -0
- package/dist/src/manifests/components/entries/card.js +34 -0
- package/dist/src/manifests/components/entries/card.js.map +1 -0
- package/dist/src/manifests/components/entries/checkbox.d.ts +31 -0
- package/dist/src/manifests/components/entries/checkbox.js +64 -0
- package/dist/src/manifests/components/entries/checkbox.js.map +1 -0
- package/dist/src/manifests/components/entries/combobox.d.ts +64 -0
- package/dist/src/manifests/components/entries/combobox.js +176 -0
- package/dist/src/manifests/components/entries/combobox.js.map +1 -0
- package/dist/src/manifests/components/entries/datePicker.d.ts +34 -0
- package/dist/src/manifests/components/entries/datePicker.js +67 -0
- package/dist/src/manifests/components/entries/datePicker.js.map +1 -0
- package/dist/src/manifests/components/entries/dateRangePicker.d.ts +34 -0
- package/dist/src/manifests/components/entries/dateRangePicker.js +110 -0
- package/dist/src/manifests/components/entries/dateRangePicker.js.map +1 -0
- package/dist/src/manifests/components/entries/dialog.d.ts +38 -0
- package/dist/src/manifests/components/entries/dialog.js +73 -0
- package/dist/src/manifests/components/entries/dialog.js.map +1 -0
- package/dist/src/manifests/components/entries/lineChart.d.ts +76 -0
- package/dist/src/manifests/components/entries/lineChart.js +141 -0
- package/dist/src/manifests/components/entries/lineChart.js.map +1 -0
- package/dist/src/manifests/components/entries/numberinput.d.ts +52 -0
- package/dist/src/manifests/components/entries/numberinput.js +64 -0
- package/dist/src/manifests/components/entries/numberinput.js.map +1 -0
- package/dist/src/manifests/components/entries/radio.d.ts +31 -0
- package/dist/src/manifests/components/entries/radio.js +50 -0
- package/dist/src/manifests/components/entries/radio.js.map +1 -0
- package/dist/src/manifests/components/entries/select.d.ts +16 -0
- package/dist/src/manifests/components/entries/select.js +23 -0
- package/dist/src/manifests/components/entries/select.js.map +1 -0
- package/dist/src/manifests/components/entries/table.d.ts +16 -0
- package/dist/src/manifests/components/entries/table.js +43 -0
- package/dist/src/manifests/components/entries/table.js.map +1 -0
- package/dist/src/manifests/components/entries/textarea.d.ts +40 -0
- package/dist/src/manifests/components/entries/textarea.js +54 -0
- package/dist/src/manifests/components/entries/textarea.js.map +1 -0
- package/dist/src/manifests/components/entries/textinput.d.ts +40 -0
- package/dist/src/manifests/components/entries/textinput.js +53 -0
- package/dist/src/manifests/components/entries/textinput.js.map +1 -0
- package/dist/src/manifests/components/entries/toggle.d.ts +23 -0
- package/dist/src/manifests/components/entries/toggle.js +30 -0
- package/dist/src/manifests/components/entries/toggle.js.map +1 -0
- package/dist/src/manifests/components/entries/typography.d.ts +23 -0
- package/dist/src/manifests/components/entries/typography.js +32 -0
- package/dist/src/manifests/components/entries/typography.js.map +1 -0
- package/dist/src/manifests/components/index.d.ts +2 -0
- package/dist/src/manifests/components/index.js +39 -0
- package/dist/src/manifests/components/index.js.map +1 -0
- package/dist/src/manifests/components/types.d.ts +56 -0
- package/dist/src/manifests/components/types.js +2 -0
- package/dist/src/manifests/components/types.js.map +1 -0
- package/dist/src/tools/getCSSTokens/handler.d.ts +6 -0
- package/dist/src/tools/getCSSTokens/handler.js +29 -0
- package/dist/src/tools/getCSSTokens/handler.js.map +1 -0
- package/dist/src/tools/getCSSTokens/index.d.ts +12 -0
- package/dist/src/tools/getCSSTokens/index.js +14 -0
- package/dist/src/tools/getCSSTokens/index.js.map +1 -0
- package/dist/src/tools/getCSSTokens/utils.d.ts +5 -0
- package/dist/src/tools/getCSSTokens/utils.js +25 -0
- package/dist/src/tools/getCSSTokens/utils.js.map +1 -0
- package/dist/src/tools/getComponentDocs/handler.d.ts +6 -0
- package/dist/src/tools/getComponentDocs/handler.js +27 -0
- package/dist/src/tools/getComponentDocs/handler.js.map +1 -0
- package/dist/src/tools/getComponentDocs/index.d.ts +12 -0
- package/dist/src/tools/getComponentDocs/index.js +14 -0
- package/dist/src/tools/getComponentDocs/index.js.map +1 -0
- package/dist/src/tools/getSetupGuide/handler.d.ts +6 -0
- package/dist/src/tools/getSetupGuide/handler.js +50 -0
- package/dist/src/tools/getSetupGuide/handler.js.map +1 -0
- package/dist/src/tools/getSetupGuide/index.d.ts +12 -0
- package/dist/src/tools/getSetupGuide/index.js +17 -0
- package/dist/src/tools/getSetupGuide/index.js.map +1 -0
- package/dist/src/tools/getSetupGuide/setupGuides.d.ts +12 -0
- package/dist/src/tools/getSetupGuide/setupGuides.js +49 -0
- package/dist/src/tools/getSetupGuide/setupGuides.js.map +1 -0
- package/dist/src/tools/listCSSTokens/handler.d.ts +3 -0
- package/dist/src/tools/listCSSTokens/handler.js +20 -0
- package/dist/src/tools/listCSSTokens/handler.js.map +1 -0
- package/dist/src/tools/listCSSTokens/index.d.ts +8 -0
- package/dist/src/tools/listCSSTokens/index.js +10 -0
- package/dist/src/tools/listCSSTokens/index.js.map +1 -0
- package/dist/src/tools/listComponents/handler.d.ts +3 -0
- package/dist/src/tools/listComponents/handler.js +18 -0
- package/dist/src/tools/listComponents/handler.js.map +1 -0
- package/dist/src/tools/listComponents/index.d.ts +9 -0
- package/dist/src/tools/listComponents/index.js +11 -0
- package/dist/src/tools/listComponents/index.js.map +1 -0
- package/dist/src/tools/searchComponents/handler.d.ts +6 -0
- package/dist/src/tools/searchComponents/handler.js +29 -0
- package/dist/src/tools/searchComponents/handler.js.map +1 -0
- package/dist/src/tools/searchComponents/index.d.ts +12 -0
- package/dist/src/tools/searchComponents/index.js +14 -0
- package/dist/src/tools/searchComponents/index.js.map +1 -0
- package/dist/src/utils/buildCDNUrls.d.ts +3 -0
- package/dist/src/utils/buildCDNUrls.js +6 -0
- package/dist/src/utils/buildCDNUrls.js.map +1 -0
- package/package.json +43 -0
- package/src/index.ts +46 -0
- package/src/manifests/components/entries/badge.ts +45 -0
- package/src/manifests/components/entries/barChart.ts +132 -0
- package/src/manifests/components/entries/button.ts +61 -0
- package/src/manifests/components/entries/card.ts +35 -0
- package/src/manifests/components/entries/checkbox.ts +68 -0
- package/src/manifests/components/entries/combobox.ts +184 -0
- package/src/manifests/components/entries/datePicker.ts +73 -0
- package/src/manifests/components/entries/dateRangePicker.ts +118 -0
- package/src/manifests/components/entries/dialog.ts +77 -0
- package/src/manifests/components/entries/lineChart.ts +150 -0
- package/src/manifests/components/entries/numberinput.ts +66 -0
- package/src/manifests/components/entries/radio.ts +53 -0
- package/src/manifests/components/entries/select.ts +24 -0
- package/src/manifests/components/entries/table.ts +44 -0
- package/src/manifests/components/entries/textarea.ts +56 -0
- package/src/manifests/components/entries/textinput.ts +55 -0
- package/src/manifests/components/entries/toggle.ts +31 -0
- package/src/manifests/components/entries/typography.ts +33 -0
- package/src/manifests/components/index.ts +41 -0
- package/src/manifests/components/types.ts +64 -0
- package/src/tools/getCSSTokens/__snapshots__/handler.test.ts.snap +78 -0
- package/src/tools/getCSSTokens/handler.test.ts +39 -0
- package/src/tools/getCSSTokens/handler.ts +36 -0
- package/src/tools/getCSSTokens/index.ts +15 -0
- package/src/tools/getCSSTokens/utils.ts +31 -0
- package/src/tools/getComponentDocs/__snapshots__/handler.test.ts.snap +23 -0
- package/src/tools/getComponentDocs/handler.test.ts +14 -0
- package/src/tools/getComponentDocs/handler.ts +34 -0
- package/src/tools/getComponentDocs/index.ts +15 -0
- package/src/tools/getSetupGuide/__snapshots__/handler.test.ts.snap +34 -0
- package/src/tools/getSetupGuide/handler.test.ts +20 -0
- package/src/tools/getSetupGuide/handler.ts +59 -0
- package/src/tools/getSetupGuide/index.ts +20 -0
- package/src/tools/getSetupGuide/setupGuides.ts +62 -0
- package/src/tools/listCSSTokens/__snapshots__/handler.test.ts.snap +12 -0
- package/src/tools/listCSSTokens/handler.test.ts +9 -0
- package/src/tools/listCSSTokens/handler.ts +32 -0
- package/src/tools/listCSSTokens/index.ts +12 -0
- package/src/tools/listComponents/__snapshots__/handler.test.ts.snap +12 -0
- package/src/tools/listComponents/handler.test.ts +9 -0
- package/src/tools/listComponents/handler.ts +20 -0
- package/src/tools/listComponents/index.ts +12 -0
- package/src/tools/searchComponents/__snapshots__/handler.test.ts.snap +23 -0
- package/src/tools/searchComponents/handler.test.ts +14 -0
- package/src/tools/searchComponents/handler.ts +36 -0
- package/src/tools/searchComponents/index.ts +15 -0
- package/src/utils/buildCDNUrls.ts +7 -0
- package/tsconfig.json +12 -0
- package/vitest.config.ts +6 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { setupGuides } from './setupGuides.js';
|
|
2
|
+
export default (args) => {
|
|
3
|
+
if (!args.type) {
|
|
4
|
+
const allGuides = Object.entries(setupGuides).map(([key, guide]) => ({
|
|
5
|
+
type: key,
|
|
6
|
+
name: guide.name,
|
|
7
|
+
description: guide.description,
|
|
8
|
+
guide,
|
|
9
|
+
}));
|
|
10
|
+
return {
|
|
11
|
+
content: [
|
|
12
|
+
{
|
|
13
|
+
type: 'text',
|
|
14
|
+
text: JSON.stringify({
|
|
15
|
+
message: 'Multiple setup options available. Choose based on user preference or project requirements.',
|
|
16
|
+
options: allGuides,
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const guideType = args.type.toLowerCase();
|
|
23
|
+
const guide = setupGuides[guideType];
|
|
24
|
+
if (!guide) {
|
|
25
|
+
return {
|
|
26
|
+
content: [
|
|
27
|
+
{
|
|
28
|
+
type: 'text',
|
|
29
|
+
text: JSON.stringify({
|
|
30
|
+
error: `Setup guide '${guideType}' not found`,
|
|
31
|
+
available: Object.keys(setupGuides).map((key) => ({
|
|
32
|
+
key,
|
|
33
|
+
name: setupGuides[key].name,
|
|
34
|
+
description: setupGuides[key].description,
|
|
35
|
+
})),
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: JSON.stringify(guide, null, 2),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tools/getSetupGuide/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAO/C,eAAe,CAAC,IAAuB,EAAkB,EAAE;IACzD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YACnE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,KAAK;SACN,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,OAAO,EAAE,4FAA4F;wBACrG,OAAO,EAAE,SAAS;qBACnB,CAAC;iBACH;aACF;SACF,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IAErC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,gBAAgB,SAAS,aAAa;wBAC7C,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;4BAChD,GAAG;4BACH,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI;4BAC3B,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,WAAW;yBAC1C,CAAC,CAAC;qBACJ,CAAC;iBACH;aACF;SACF,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;aACrC;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { setupGuides } from './setupGuides.js';\nimport { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\n\nexport interface GetSetupGuideArgs {\n type?: string;\n}\n\nexport default (args: GetSetupGuideArgs): CallToolResult => {\n if (!args.type) {\n const allGuides = Object.entries(setupGuides).map(([key, guide]) => ({\n type: key,\n name: guide.name,\n description: guide.description,\n guide,\n }));\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify({\n message: 'Multiple setup options available. Choose based on user preference or project requirements.',\n options: allGuides,\n }),\n },\n ],\n };\n }\n\n const guideType = args.type.toLowerCase();\n const guide = setupGuides[guideType];\n\n if (!guide) {\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify({\n error: `Setup guide '${guideType}' not found`,\n available: Object.keys(setupGuides).map((key) => ({\n key,\n name: setupGuides[key].name,\n description: setupGuides[key].description,\n })),\n }),\n },\n ],\n };\n }\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(guide, null, 2),\n },\n ],\n };\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const toolDefinition: {
|
|
3
|
+
name: string;
|
|
4
|
+
config: {
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"npm">, z.ZodLiteral<"cdn">]>>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
handler: (args: import("./handler.js").GetSetupGuideArgs) => import("@modelcontextprotocol/sdk/types.js").CallToolResult;
|
|
11
|
+
};
|
|
12
|
+
export default toolDefinition;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import handler from './handler.js';
|
|
3
|
+
const toolDefinition = {
|
|
4
|
+
name: 'get_setup_guide',
|
|
5
|
+
config: {
|
|
6
|
+
description: 'Get setup and installation instructions for integrating the design system into your project',
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: z
|
|
9
|
+
.union([z.literal('npm'), z.literal('cdn')])
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Optional: npm for npm/yarn/bun installation, cdn for CDN link. If omitted, returns both options so you can present them to the user.'),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
handler: handler,
|
|
15
|
+
};
|
|
16
|
+
export default toolDefinition;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/getSetupGuide/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE;QACN,WAAW,EAAE,6FAA6F;QAC1G,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;iBACJ,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;iBAC3C,QAAQ,EAAE;iBACV,QAAQ,CACP,sIAAsI,CACvI;SACJ;KACF;IACD,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { z } from 'zod';\nimport handler from './handler.js';\n\nconst toolDefinition = {\n name: 'get_setup_guide',\n config: {\n description: 'Get setup and installation instructions for integrating the design system into your project',\n inputSchema: {\n type: z\n .union([z.literal('npm'), z.literal('cdn')])\n .optional()\n .describe(\n 'Optional: npm for npm/yarn/bun installation, cdn for CDN link. If omitted, returns both options so you can present them to the user.'\n ),\n },\n },\n handler: handler,\n};\n\nexport default toolDefinition;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SetupGuide {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
steps: Array<{
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
code?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
}>;
|
|
10
|
+
notes?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare const setupGuides: Record<string, SetupGuide>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import packageJson from '../../../package.json' with { type: 'json' };
|
|
2
|
+
const stylesheetVersion = packageJson.dependencies['@triptease/stylesheet'];
|
|
3
|
+
export const setupGuides = {
|
|
4
|
+
npm: {
|
|
5
|
+
name: 'NPM Stylesheet Setup',
|
|
6
|
+
description: 'Setup instructions for using the stylesheet package via npm.',
|
|
7
|
+
steps: [
|
|
8
|
+
{
|
|
9
|
+
title: 'Install the stylesheet package',
|
|
10
|
+
description: 'Choose your package manager:',
|
|
11
|
+
code: `# NPM
|
|
12
|
+
npm install @triptease/stylesheet
|
|
13
|
+
|
|
14
|
+
# Yarn
|
|
15
|
+
yarn add @triptease/stylesheet
|
|
16
|
+
|
|
17
|
+
# Bun
|
|
18
|
+
bun add @triptease/stylesheet`,
|
|
19
|
+
language: 'bash',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: 'Import the stylesheet',
|
|
23
|
+
description: 'Add this import to your application entry point:',
|
|
24
|
+
code: `import '@triptease/stylesheet';`,
|
|
25
|
+
language: 'typescript',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
notes: [`Current version: @triptease/stylesheet@${stylesheetVersion}`],
|
|
29
|
+
},
|
|
30
|
+
cdn: {
|
|
31
|
+
name: 'CDN Stylesheet Setup',
|
|
32
|
+
description: 'Setup instructions for using the stylesheet via CDN.',
|
|
33
|
+
steps: [
|
|
34
|
+
{
|
|
35
|
+
title: 'Add stylesheet link to HTML',
|
|
36
|
+
description: 'Include this in the <head> of your HTML document:',
|
|
37
|
+
code: `<head>
|
|
38
|
+
<!-- Specific version (recommended) -->
|
|
39
|
+
<link rel="stylesheet" href="https://cdn.design-system.triptease.io/${stylesheetVersion}/triptease.css">
|
|
40
|
+
|
|
41
|
+
<!-- Or, latest version (dangerous - breaking changes may occur) -->
|
|
42
|
+
<link rel="stylesheet" href="https://cdn.design-system.triptease.io/triptease.css">
|
|
43
|
+
</head>`,
|
|
44
|
+
language: 'html',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=setupGuides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupGuides.js","sourceRoot":"","sources":["../../../../src/tools/getSetupGuide/setupGuides.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAElE,MAAM,iBAAiB,GAAG,WAAW,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;AAc5E,MAAM,CAAC,MAAM,WAAW,GAA+B;IACrD,GAAG,EAAE;QACH,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,8DAA8D;QAC3E,KAAK,EAAE;YACL;gBACE,KAAK,EAAE,gCAAgC;gBACvC,WAAW,EAAE,8BAA8B;gBAC3C,IAAI,EAAE;;;;;;;8BAOgB;gBACtB,QAAQ,EAAE,MAAM;aACjB;YACD;gBACE,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,kDAAkD;gBAC/D,IAAI,EAAE,iCAAiC;gBACvC,QAAQ,EAAE,YAAY;aACvB;SACF;QACD,KAAK,EAAE,CAAC,0CAA0C,iBAAiB,EAAE,CAAC;KACvE;IACD,GAAG,EAAE;QACH,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,sDAAsD;QACnE,KAAK,EAAE;YACL;gBACE,KAAK,EAAE,6BAA6B;gBACpC,WAAW,EAAE,mDAAmD;gBAChE,IAAI,EAAE;;0EAE4D,iBAAiB;;;;QAInF;gBACA,QAAQ,EAAE,MAAM;aACjB;SACF;KACF;CACF,CAAC","sourcesContent":["import packageJson from '@/../package.json' with { type: 'json' };\n\nconst stylesheetVersion = packageJson.dependencies['@triptease/stylesheet'];\n\nexport interface SetupGuide {\n name: string;\n description: string;\n steps: Array<{\n title: string;\n description?: string;\n code?: string;\n language?: string;\n }>;\n notes?: string[];\n}\n\nexport const setupGuides: Record<string, SetupGuide> = {\n npm: {\n name: 'NPM Stylesheet Setup',\n description: 'Setup instructions for using the stylesheet package via npm.',\n steps: [\n {\n title: 'Install the stylesheet package',\n description: 'Choose your package manager:',\n code: `# NPM\nnpm install @triptease/stylesheet\n\n# Yarn\nyarn add @triptease/stylesheet\n\n# Bun\nbun add @triptease/stylesheet`,\n language: 'bash',\n },\n {\n title: 'Import the stylesheet',\n description: 'Add this import to your application entry point:',\n code: `import '@triptease/stylesheet';`,\n language: 'typescript',\n },\n ],\n notes: [`Current version: @triptease/stylesheet@${stylesheetVersion}`],\n },\n cdn: {\n name: 'CDN Stylesheet Setup',\n description: 'Setup instructions for using the stylesheet via CDN.',\n steps: [\n {\n title: 'Add stylesheet link to HTML',\n description: 'Include this in the <head> of your HTML document:',\n code: `<head>\n <!-- Specific version (recommended) -->\n <link rel=\"stylesheet\" href=\"https://cdn.design-system.triptease.io/${stylesheetVersion}/triptease.css\">\n\n <!-- Or, latest version (dangerous - breaking changes may occur) -->\n <link rel=\"stylesheet\" href=\"https://cdn.design-system.triptease.io/triptease.css\">\n</head>`,\n language: 'html',\n },\n ],\n },\n};\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import designTokens from '@triptease/stylesheet/tokens' with { type: 'json' };
|
|
2
|
+
import { buildTokens } from '../../tools/getCSSTokens/utils.js';
|
|
3
|
+
export default () => {
|
|
4
|
+
const tokens = buildTokens(designTokens);
|
|
5
|
+
const categories = Object.keys(tokens);
|
|
6
|
+
const result = {};
|
|
7
|
+
for (const category of categories) {
|
|
8
|
+
const tokenCount = tokens[category].length;
|
|
9
|
+
result[category] = { count: tokenCount };
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
content: [
|
|
13
|
+
{
|
|
14
|
+
type: 'text',
|
|
15
|
+
text: JSON.stringify(result),
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tools/listCSSTokens/handler.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,8BAA8B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAU5D,eAAe,GAAmB,EAAE;IAClC,MAAM,MAAM,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IAEzC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,MAAM,GAAe,EAAE,CAAC;IAE9B,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAClC,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC;QAC3C,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;aAC7B;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport designTokens from '@triptease/stylesheet/tokens' with { type: 'json' };\nimport { buildTokens } from '@/tools/getCSSTokens/utils.js';\n\ninterface Summary {\n count: number;\n}\n\ninterface SummaryMap {\n [category: string]: Summary;\n}\n\nexport default (): CallToolResult => {\n const tokens = buildTokens(designTokens);\n\n const categories = Object.keys(tokens);\n const result: SummaryMap = {};\n\n for (const category of categories) {\n const tokenCount = tokens[category].length;\n result[category] = { count: tokenCount };\n }\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(result),\n },\n ],\n };\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import handler from './handler.js';
|
|
2
|
+
const toolDefinition = {
|
|
3
|
+
name: 'list_css_tokens',
|
|
4
|
+
config: {
|
|
5
|
+
description: 'Returns a summary of all available CSS tokens with a count of how many tokens exist in each category. Category names are used when using the get_css_tokens tool.',
|
|
6
|
+
},
|
|
7
|
+
handler: handler,
|
|
8
|
+
};
|
|
9
|
+
export default toolDefinition;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/listCSSTokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE;QACN,WAAW,EACT,mKAAmK;KACtK;IACD,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import handler from './handler.js';\n\nconst toolDefinition = {\n name: 'list_css_tokens',\n config: {\n description:\n 'Returns a summary of all available CSS tokens with a count of how many tokens exist in each category. Category names are used when using the get_css_tokens tool.',\n },\n handler: handler,\n};\n\nexport default toolDefinition;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { componentManifest } from '../../manifests/components/index.js';
|
|
2
|
+
export default () => {
|
|
3
|
+
const components = Object.entries(componentManifest).map(([key, comp]) => ({
|
|
4
|
+
key,
|
|
5
|
+
name: comp.name,
|
|
6
|
+
description: comp.description,
|
|
7
|
+
element: comp.element,
|
|
8
|
+
}));
|
|
9
|
+
return {
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: 'text',
|
|
13
|
+
text: JSON.stringify({ components }),
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tools/listComponents/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,eAAe,GAAmB,EAAE;IAClC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACzE,GAAG;QACH,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAC,CAAC;IAEJ,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC;aACrC;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport { componentManifest } from '@/manifests/components/index.js';\n\nexport default (): CallToolResult => {\n const components = Object.entries(componentManifest).map(([key, comp]) => ({\n key,\n name: comp.name,\n description: comp.description,\n element: comp.element,\n }));\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify({ components }),\n },\n ],\n };\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import handler from './handler.js';
|
|
2
|
+
const toolDefinition = {
|
|
3
|
+
name: 'list_components',
|
|
4
|
+
config: {
|
|
5
|
+
description: 'List all available design system componentManifest',
|
|
6
|
+
inputSchema: {},
|
|
7
|
+
},
|
|
8
|
+
handler,
|
|
9
|
+
};
|
|
10
|
+
export default toolDefinition;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/listComponents/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE;QACN,WAAW,EAAE,oDAAoD;QACjE,WAAW,EAAE,EAAE;KAChB;IACD,OAAO;CACR,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import handler from './handler.js';\n\nconst toolDefinition = {\n name: 'list_components',\n config: {\n description: 'List all available design system componentManifest',\n inputSchema: {},\n },\n handler,\n};\n\nexport default toolDefinition;\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { componentManifest } from '../../manifests/components/index.js';
|
|
2
|
+
export default (args) => {
|
|
3
|
+
const query = args.query.toLowerCase();
|
|
4
|
+
const results = [];
|
|
5
|
+
for (const [key, comp] of Object.entries(componentManifest)) {
|
|
6
|
+
const searchText = `${key} ${comp.name} ${comp.description}`.toLowerCase();
|
|
7
|
+
if (searchText.includes(query)) {
|
|
8
|
+
results.push({
|
|
9
|
+
key,
|
|
10
|
+
name: comp.name,
|
|
11
|
+
description: comp.description,
|
|
12
|
+
element: comp.element,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
content: [
|
|
18
|
+
{
|
|
19
|
+
type: 'text',
|
|
20
|
+
text: JSON.stringify({
|
|
21
|
+
query,
|
|
22
|
+
count: results.length,
|
|
23
|
+
results,
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/tools/searchComponents/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAMpE,eAAe,CAAC,IAA0B,EAAkB,EAAE;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,EAAE,CAAC;IAEnB,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC5D,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;QAC3E,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,IAAI,CAAC;gBACX,GAAG;gBACH,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,KAAK;oBACL,KAAK,EAAE,OAAO,CAAC,MAAM;oBACrB,OAAO;iBACR,CAAC;aACH;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport { componentManifest } from '@/manifests/components/index.js';\n\nexport interface SearchComponentsArgs {\n query: string;\n}\n\nexport default (args: SearchComponentsArgs): CallToolResult => {\n const query = args.query.toLowerCase();\n const results = [];\n\n for (const [key, comp] of Object.entries(componentManifest)) {\n const searchText = `${key} ${comp.name} ${comp.description}`.toLowerCase();\n if (searchText.includes(query)) {\n results.push({\n key,\n name: comp.name,\n description: comp.description,\n element: comp.element,\n });\n }\n }\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify({\n query,\n count: results.length,\n results,\n }),\n },\n ],\n };\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const toolDefinition: {
|
|
3
|
+
name: string;
|
|
4
|
+
config: {
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
query: z.ZodString;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
handler: (args: import("./handler.js").SearchComponentsArgs) => import("@modelcontextprotocol/sdk/types.js").CallToolResult;
|
|
11
|
+
};
|
|
12
|
+
export default toolDefinition;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import handler from './handler.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const toolDefinition = {
|
|
4
|
+
name: 'search_components',
|
|
5
|
+
config: {
|
|
6
|
+
description: 'Search for componentManifest by keyword or usage',
|
|
7
|
+
inputSchema: {
|
|
8
|
+
query: z.string().describe('Search query'),
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
handler,
|
|
12
|
+
};
|
|
13
|
+
export default toolDefinition;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/searchComponents/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE;QACN,WAAW,EAAE,kDAAkD;QAC/D,WAAW,EAAE;YACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;SAC3C;KACF;IACD,OAAO;CACR,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import handler from './handler.js';\nimport { z } from 'zod';\n\nconst toolDefinition = {\n name: 'search_components',\n config: {\n description: 'Search for componentManifest by keyword or usage',\n inputSchema: {\n query: z.string().describe('Search query'),\n },\n },\n handler,\n};\n\nexport default toolDefinition;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const buildCDNUrl = (componentName, version) => {
|
|
2
|
+
return `https://cdn.design-system.triptease.io/${componentName}/${version}/${componentName}.js`;
|
|
3
|
+
};
|
|
4
|
+
const buildMajorVersion = (version) => `${version.split('.')[0]}.x.x`;
|
|
5
|
+
export { buildCDNUrl, buildMajorVersion };
|
|
6
|
+
//# sourceMappingURL=buildCDNUrls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCDNUrls.js","sourceRoot":"","sources":["../../../src/utils/buildCDNUrls.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,CAAC,aAAqB,EAAE,OAAe,EAAE,EAAE;IAC7D,OAAO,0CAA0C,aAAa,IAAI,OAAO,IAAI,aAAa,KAAK,CAAC;AAClG,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;AAE7E,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["const buildCDNUrl = (componentName: string, version: string) => {\n return `https://cdn.design-system.triptease.io/${componentName}/${version}/${componentName}.js`;\n};\n\nconst buildMajorVersion = (version: string) => `${version.split('.')[0]}.x.x`\n\nexport { buildCDNUrl, buildMajorVersion };\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@triptease/design-system-mcp",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "MCP server for Triptease design system documentation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": "./dist/index.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "rm -rf dist && tsc && tsc-alias",
|
|
10
|
+
"dev": "tsc --watch",
|
|
11
|
+
"start": "node dist/index.js",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:watch": "vitest"
|
|
14
|
+
},
|
|
15
|
+
"author": "Triptease",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
22
|
+
"@triptease/stylesheet": "1.4.1",
|
|
23
|
+
"@triptease/tt-bar-chart": "1.0.2",
|
|
24
|
+
"@triptease/tt-combobox": "5.6.5",
|
|
25
|
+
"@triptease/tt-data-point": "1.0.1",
|
|
26
|
+
"@triptease/tt-dataset": "1.0.2",
|
|
27
|
+
"@triptease/tt-date-picker": "6.1.2",
|
|
28
|
+
"@triptease/tt-date-range-picker": "6.2.3",
|
|
29
|
+
"@triptease/tt-dialog": "5.1.1",
|
|
30
|
+
"@triptease/tt-highlight": "1.0.1",
|
|
31
|
+
"@triptease/tt-line-chart": "1.0.7",
|
|
32
|
+
"zod": "^4.3.6"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"tsc-alias": "^1.8.16",
|
|
36
|
+
"typescript": "^5.7.2",
|
|
37
|
+
"vite-tsconfig-paths": "^6.0.5",
|
|
38
|
+
"vitest": "^4.0.18"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import packageJson from '@/../package.json' with { type: 'json' };
|
|
5
|
+
|
|
6
|
+
import getComponentDocsTool from '@/tools/getComponentDocs/index.js';
|
|
7
|
+
import listComponentsTool from '@/tools/listComponents/index.js';
|
|
8
|
+
import getDesignTokensTool from '@/tools/getCSSTokens/index.js';
|
|
9
|
+
import searchComponentsTool from '@/tools/searchComponents/index.js';
|
|
10
|
+
import getSetupGuideTool from '@/tools/getSetupGuide/index.js';
|
|
11
|
+
import listCSSTokens from '@/tools/listCSSTokens/index.js';
|
|
12
|
+
|
|
13
|
+
// Initialize MCP server
|
|
14
|
+
const server = new McpServer(
|
|
15
|
+
{
|
|
16
|
+
name: 'Triptease Design System MCP Server',
|
|
17
|
+
version: packageJson.version,
|
|
18
|
+
description: packageJson.description,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
capabilities: {
|
|
22
|
+
tools: {},
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
// Register getComponentDocsTool definitions
|
|
28
|
+
server.registerTool(getComponentDocsTool.name, getComponentDocsTool.config, getComponentDocsTool.handler);
|
|
29
|
+
server.registerTool(listComponentsTool.name, listComponentsTool.config, listComponentsTool.handler);
|
|
30
|
+
server.registerTool(getDesignTokensTool.name, getDesignTokensTool.config, getDesignTokensTool.handler);
|
|
31
|
+
server.registerTool(searchComponentsTool.name, searchComponentsTool.config, searchComponentsTool.handler);
|
|
32
|
+
server.registerTool(getSetupGuideTool.name, getSetupGuideTool.config, getSetupGuideTool.handler);
|
|
33
|
+
server.registerTool(listCSSTokens.name, listCSSTokens.config, listCSSTokens.handler);
|
|
34
|
+
|
|
35
|
+
// Start the server
|
|
36
|
+
async function main() {
|
|
37
|
+
const transport = new StdioServerTransport();
|
|
38
|
+
await server.connect(transport);
|
|
39
|
+
console.info('Server started');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
main().catch((error) => {
|
|
43
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
44
|
+
console.error(errorMessage);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ComponentManifest } from '@/manifests/components/types.js';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
badge: {
|
|
5
|
+
name: 'Badge',
|
|
6
|
+
description: 'Status indicator or label badge for highlighting small pieces of information',
|
|
7
|
+
element: 'span',
|
|
8
|
+
usageGuidance: {
|
|
9
|
+
whenToUse: [
|
|
10
|
+
'Display notification counts or unread items',
|
|
11
|
+
'Show status (new, updated, beta)',
|
|
12
|
+
'Label or categorize content',
|
|
13
|
+
'Highlight key metrics or data points',
|
|
14
|
+
],
|
|
15
|
+
avoid: [
|
|
16
|
+
'For interactive elements (use buttons instead)',
|
|
17
|
+
'As primary navigation (consider tabs or links)',
|
|
18
|
+
'For lengthy text (keep content brief)',
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
classes: {
|
|
22
|
+
badge: 'Base badge class (required)',
|
|
23
|
+
},
|
|
24
|
+
dataAttributes: {
|
|
25
|
+
'data-theme': {
|
|
26
|
+
type: 'enum',
|
|
27
|
+
values: ['primary', 'success', 'danger', 'warning', 'info', 'subtle'],
|
|
28
|
+
description:
|
|
29
|
+
'Badge color theme with semantic meaning. Use success for positive states (active, completed), danger for errors or destructive actions, warning for caution, info for neutral information, subtle for de-emphasized content.',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
examples: [
|
|
33
|
+
{
|
|
34
|
+
title: 'Status badges',
|
|
35
|
+
description: 'Use semantic themes to indicate status or state',
|
|
36
|
+
code: `<div>
|
|
37
|
+
<span class="badge" data-theme="success">Active</span>
|
|
38
|
+
<span class="badge" data-theme="danger">Failed</span>
|
|
39
|
+
<span class="badge" data-theme="warning">Pending</span>
|
|
40
|
+
<span class="badge" data-theme="info">Draft</span>
|
|
41
|
+
</div>`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
} satisfies ComponentManifest;
|