@czi-sds/mcp 0.3.0 → 0.5.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/data/component-props/Accordion.json +14 -15
- package/data/component-props/Alert.json +2 -44
- package/data/component-props/Autocomplete.json +14 -32
- package/data/component-props/Banner.json +11 -12
- package/data/component-props/Button.json +17 -82
- package/data/component-props/ButtonDropdown.json +26 -0
- package/data/component-props/ButtonIcon.json +4 -60
- package/data/component-props/ButtonToggle.json +2 -66
- package/data/component-props/Callout.json +11 -65
- package/data/component-props/CellBasic.json +28 -56
- package/data/component-props/CellComponent.json +4 -32
- package/data/component-props/CellHeader.json +13 -49
- package/data/component-props/ComplexFilter.json +24 -4
- package/data/component-props/ContentCard.json +66 -2
- package/data/component-props/Dialog.json +26 -0
- package/data/component-props/Dropdown.json +29 -67
- package/data/component-props/DropdownMenu.json +16 -56
- package/data/component-props/HeatmapChart.json +6 -87
- package/data/component-props/Icon.json +3 -8
- package/data/component-props/InputCheckbox.json +5 -53
- package/data/component-props/InputDropdown.json +11 -33
- package/data/component-props/InputRadio.json +5 -53
- package/data/component-props/InputSearch.json +6 -70
- package/data/component-props/InputSlider.json +21 -35
- package/data/component-props/InputText.json +7 -63
- package/data/component-props/InputToggle.json +5 -54
- package/data/component-props/Link.json +18 -0
- package/data/component-props/LoadingIndicator.json +1 -2
- package/data/component-props/MenuItem.json +11 -41
- package/data/component-props/MenuSelect.json +4 -67
- package/data/component-props/NavigationFooter.json +0 -8
- package/data/component-props/NavigationHeader.json +14 -65
- package/data/component-props/NavigationJumpTo.json +0 -40
- package/data/component-props/Notification.json +14 -58
- package/data/component-props/Pagination.json +8 -33
- package/data/component-props/Panel.json +4 -54
- package/data/component-props/SegmentedControl.json +0 -55
- package/data/component-props/TableRow.json +10 -38
- package/data/component-props/Tabs.json +18 -0
- package/data/component-props/Tag.json +10 -56
- package/data/component-props/TagFilter.json +0 -47
- package/data/component-props/Tooltip.json +12 -61
- package/data/component-props/TooltipCondensed.json +18 -0
- package/data/component-props/TooltipTable.json +0 -4
- package/data/resources/figma-rules.md +101 -0
- package/data/resources/sds-component-rules.md +189 -0
- package/data/resources/zeroheight-rules.md +180 -0
- package/data/zeroheight-cache.json +1 -1
- package/data/zeroheight-exports/Accordion.md +167 -125
- package/data/zeroheight-exports/Banner.md +71 -48
- package/data/zeroheight-exports/Borders.md +72 -73
- package/data/zeroheight-exports/Buttons.md +375 -330
- package/data/zeroheight-exports/Callout.md +138 -116
- package/data/zeroheight-exports/Colors.md +254 -255
- package/data/zeroheight-exports/Content-Card.md +36 -37
- package/data/zeroheight-exports/Contributing-to-SDS.md +34 -35
- package/data/zeroheight-exports/Control-Inputs.md +289 -234
- package/data/zeroheight-exports/Corners.md +63 -64
- package/data/zeroheight-exports/Cover-page.md +0 -1
- package/data/zeroheight-exports/Dialog.md +237 -179
- package/data/zeroheight-exports/Downloads.md +10 -11
- package/data/zeroheight-exports/Drop-Shadows.md +40 -41
- package/data/zeroheight-exports/Dropdown-Input.md +158 -127
- package/data/zeroheight-exports/Dropdown-Menu.md +814 -718
- package/data/zeroheight-exports/Element-Status-Tracker.md +191 -192
- package/data/zeroheight-exports/Field-Inputs.md +149 -130
- package/data/zeroheight-exports/Filters.md +114 -94
- package/data/zeroheight-exports/Getting-Started.md +112 -249
- package/data/zeroheight-exports/Hero.md +43 -37
- package/data/zeroheight-exports/Icons.md +205 -206
- package/data/zeroheight-exports/Intent.md +6 -7
- package/data/zeroheight-exports/Introduction-to-Bases.md +8 -9
- package/data/zeroheight-exports/Introduction-to-Cells.md +11 -12
- package/data/zeroheight-exports/Introduction-to-DNA.md +8 -9
- package/data/zeroheight-exports/Introduction-to-Genes.md +8 -9
- package/data/zeroheight-exports/Introduction.md +52 -53
- package/data/zeroheight-exports/Link.md +50 -37
- package/data/zeroheight-exports/Lists.md +78 -63
- package/data/zeroheight-exports/Loading-Indicator.md +7 -8
- package/data/zeroheight-exports/Navigation.md +163 -142
- package/data/zeroheight-exports/Notification.md +132 -102
- package/data/zeroheight-exports/Panel.md +231 -115
- package/data/zeroheight-exports/README.md +1 -1
- package/data/zeroheight-exports/Responsive-Design.md +35 -32
- package/data/zeroheight-exports/Search-Input.md +9 -10
- package/data/zeroheight-exports/Search.md +87 -104
- package/data/zeroheight-exports/Segmented-Control.md +68 -45
- package/data/zeroheight-exports/Spacing.md +210 -211
- package/data/zeroheight-exports/Table.md +414 -302
- package/data/zeroheight-exports/Tabs.md +126 -98
- package/data/zeroheight-exports/Tags.md +148 -118
- package/data/zeroheight-exports/Text-Link.md +32 -33
- package/data/zeroheight-exports/Theming.md +48 -29
- package/data/zeroheight-exports/Tooltips.md +253 -237
- package/data/zeroheight-exports/Typography.md +463 -464
- package/dist/stdio.js +136 -135
- package/package.json +3 -4
- package/data/component-props/Chip.json +0 -73
- package/data/component-props/List.json +0 -43
- package/data/component-props/Menu.json +0 -48
- package/data/component-props/Table.json +0 -26
- package/data/component-props-storybook/Accordion-storybook.json +0 -45
- package/data/component-props-storybook/Alert-storybook.json +0 -30
- package/data/component-props-storybook/Autocomplete-storybook.json +0 -67
- package/data/component-props-storybook/Banner-storybook.json +0 -78
- package/data/component-props-storybook/Button-storybook.json +0 -115
- package/data/component-props-storybook/ButtonDropdown-storybook.json +0 -73
- package/data/component-props-storybook/ButtonIcon-storybook.json +0 -60
- package/data/component-props-storybook/ButtonToggle-storybook.json +0 -68
- package/data/component-props-storybook/Callout-storybook.json +0 -90
- package/data/component-props-storybook/CellBasic-storybook.json +0 -138
- package/data/component-props-storybook/CellComponent-storybook.json +0 -48
- package/data/component-props-storybook/CellHeader-storybook.json +0 -71
- package/data/component-props-storybook/Chip-storybook.json +0 -26
- package/data/component-props-storybook/ComplexFilter-storybook.json +0 -60
- package/data/component-props-storybook/ContentCard-storybook.json +0 -175
- package/data/component-props-storybook/Dialog-storybook.json +0 -56
- package/data/component-props-storybook/Dropdown-storybook.json +0 -93
- package/data/component-props-storybook/DropdownMenu-storybook.json +0 -73
- package/data/component-props-storybook/HeatmapChart-storybook.json +0 -55
- package/data/component-props-storybook/Icon-storybook.json +0 -75
- package/data/component-props-storybook/InputCheckbox-storybook.json +0 -57
- package/data/component-props-storybook/InputDropdown-storybook.json +0 -80
- package/data/component-props-storybook/InputRadio-storybook.json +0 -56
- package/data/component-props-storybook/InputSearch-storybook.json +0 -55
- package/data/component-props-storybook/InputSlider-storybook.json +0 -55
- package/data/component-props-storybook/InputText-storybook.json +0 -59
- package/data/component-props-storybook/InputToggle-storybook.json +0 -42
- package/data/component-props-storybook/Link-storybook.json +0 -50
- package/data/component-props-storybook/List-storybook.json +0 -26
- package/data/component-props-storybook/LoadingIndicator-storybook.json +0 -34
- package/data/component-props-storybook/Menu-storybook.json +0 -26
- package/data/component-props-storybook/MenuItem-storybook.json +0 -74
- package/data/component-props-storybook/MenuSelect-storybook.json +0 -38
- package/data/component-props-storybook/NavigationFooter-storybook.json +0 -67
- package/data/component-props-storybook/NavigationHeader-storybook.json +0 -115
- package/data/component-props-storybook/NavigationJumpTo-storybook.json +0 -41
- package/data/component-props-storybook/Notification-storybook.json +0 -89
- package/data/component-props-storybook/Pagination-storybook.json +0 -50
- package/data/component-props-storybook/Panel-storybook.json +0 -52
- package/data/component-props-storybook/SegmentedControl-storybook.json +0 -30
- package/data/component-props-storybook/Table-storybook.json +0 -26
- package/data/component-props-storybook/TableHeader-storybook.json +0 -26
- package/data/component-props-storybook/TableRow-storybook.json +0 -62
- package/data/component-props-storybook/Tabs-storybook.json +0 -45
- package/data/component-props-storybook/Tag-storybook.json +0 -78
- package/data/component-props-storybook/TagFilter-storybook.json +0 -30
- package/data/component-props-storybook/Tooltip-storybook.json +0 -85
- package/data/component-props-storybook/TooltipCondensed-storybook.json +0 -38
- package/data/component-props-storybook/TooltipTable-storybook.json +0 -47
package/dist/stdio.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import fs from 'fs';
|
|
6
|
-
import path from 'path';
|
|
5
|
+
import fs, { readFileSync } from 'fs';
|
|
6
|
+
import path, { dirname as dirname$1, join } from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
|
|
9
9
|
var server = new McpServer({
|
|
@@ -11,7 +11,10 @@ var server = new McpServer({
|
|
|
11
11
|
version: "0.1.0",
|
|
12
12
|
capabilities: {
|
|
13
13
|
prompts: {},
|
|
14
|
-
resources: {
|
|
14
|
+
resources: {
|
|
15
|
+
subscribe: true,
|
|
16
|
+
listChanged: true
|
|
17
|
+
},
|
|
15
18
|
tools: {}
|
|
16
19
|
}
|
|
17
20
|
});
|
|
@@ -81,48 +84,6 @@ async function fetchComponentProps(component) {
|
|
|
81
84
|
);
|
|
82
85
|
}
|
|
83
86
|
}
|
|
84
|
-
async function fetchComponentPropsStorybook(component) {
|
|
85
|
-
try {
|
|
86
|
-
const propsPaths = [
|
|
87
|
-
path.join(
|
|
88
|
-
dirname,
|
|
89
|
-
`../../data/component-props-storybook/${component}-storybook.json`
|
|
90
|
-
),
|
|
91
|
-
// From src/lib in dev
|
|
92
|
-
path.join(
|
|
93
|
-
dirname,
|
|
94
|
-
`../data/component-props-storybook/${component}-storybook.json`
|
|
95
|
-
),
|
|
96
|
-
// From dist in prod
|
|
97
|
-
path.join(
|
|
98
|
-
process.cwd(),
|
|
99
|
-
`data/component-props-storybook/${component}-storybook.json`
|
|
100
|
-
)
|
|
101
|
-
// From current working directory
|
|
102
|
-
];
|
|
103
|
-
let propsPath = "";
|
|
104
|
-
for (const p of propsPaths) {
|
|
105
|
-
if (fs.existsSync(p)) {
|
|
106
|
-
propsPath = p;
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (!propsPath) {
|
|
111
|
-
return {
|
|
112
|
-
[component]: {
|
|
113
|
-
message: "Props information not available for this component. Run 'yarn generate:component-props' to generate props data.",
|
|
114
|
-
props: {}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
const fileContent = fs.readFileSync(propsPath, "utf-8");
|
|
119
|
-
return JSON.parse(fileContent);
|
|
120
|
-
} catch (error) {
|
|
121
|
-
throw new Error(
|
|
122
|
-
`Failed to load props for ${component}: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
87
|
async function fetchTailwindTokens() {
|
|
127
88
|
try {
|
|
128
89
|
const possiblePaths = [
|
|
@@ -234,56 +195,6 @@ var listComponentsTool = {
|
|
|
234
195
|
});
|
|
235
196
|
}
|
|
236
197
|
};
|
|
237
|
-
var getComponentPropsStorybookTool = {
|
|
238
|
-
name: "get_component_props_storybook",
|
|
239
|
-
description: "Get detailed properties of a specific SDS component using Storybook analysis. Unlike the regular get-component-props tool, which uses TypeScript analysis, this tool retrieves the properties, attributes, design related props for a component (like sdsStyle, sdsType, sdsSize, etc.), and configuration options available for a given SDS component from Storybook.",
|
|
240
|
-
async ctx() {
|
|
241
|
-
try {
|
|
242
|
-
const componentList = await getAllComponentNames();
|
|
243
|
-
return {
|
|
244
|
-
componentList: [
|
|
245
|
-
...componentList.components,
|
|
246
|
-
...componentList["data-viz"]
|
|
247
|
-
]
|
|
248
|
-
};
|
|
249
|
-
} catch (error) {
|
|
250
|
-
throw new Error(
|
|
251
|
-
`Failed to initialize component props tool: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
exec(server2, { ctx, name, description }) {
|
|
256
|
-
server2.tool(
|
|
257
|
-
name,
|
|
258
|
-
description,
|
|
259
|
-
{
|
|
260
|
-
component: z.enum(ctx.componentList).describe("The name of the SDS component to get properties for")
|
|
261
|
-
},
|
|
262
|
-
async ({ component }) => {
|
|
263
|
-
try {
|
|
264
|
-
const json = await fetchComponentPropsStorybook(component);
|
|
265
|
-
return {
|
|
266
|
-
content: [
|
|
267
|
-
{
|
|
268
|
-
type: "text",
|
|
269
|
-
text: JSON.stringify(json)
|
|
270
|
-
}
|
|
271
|
-
]
|
|
272
|
-
};
|
|
273
|
-
} catch (error) {
|
|
274
|
-
return {
|
|
275
|
-
content: [
|
|
276
|
-
{
|
|
277
|
-
type: "text",
|
|
278
|
-
text: `Failed to get component props for ${component}: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
279
|
-
}
|
|
280
|
-
]
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
198
|
|
|
288
199
|
// src/lib/tailwind-guidance.ts
|
|
289
200
|
var TAILWIND_TOKEN_GUIDANCE = {
|
|
@@ -637,56 +548,56 @@ var dirname2 = path.dirname(filename2);
|
|
|
637
548
|
function mapComponentToFile(componentName, exportedFiles) {
|
|
638
549
|
const componentToFileMap = {
|
|
639
550
|
// Button components
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
551
|
+
Button: "Buttons",
|
|
552
|
+
ButtonDropdown: "Buttons",
|
|
553
|
+
ButtonIcon: "Buttons",
|
|
554
|
+
ButtonToggle: "Buttons",
|
|
644
555
|
// Table components
|
|
645
|
-
|
|
646
|
-
|
|
556
|
+
TableHeader: "Table",
|
|
557
|
+
TableRow: "Table",
|
|
647
558
|
// Input components
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
559
|
+
InputCheckbox: "Control-Inputs",
|
|
560
|
+
InputRadio: "Control-Inputs",
|
|
561
|
+
InputToggle: "Control-Inputs",
|
|
562
|
+
InputText: "Field-Inputs",
|
|
563
|
+
InputDropdown: "Dropdown-Input",
|
|
564
|
+
InputSearch: "Search-Input",
|
|
565
|
+
InputSlider: "Control-Inputs",
|
|
655
566
|
// Dropdown components
|
|
656
|
-
|
|
657
|
-
|
|
567
|
+
Dropdown: "Dropdown-Menu",
|
|
568
|
+
DropdownMenu: "Dropdown-Menu",
|
|
658
569
|
// Content components
|
|
659
|
-
|
|
660
|
-
|
|
570
|
+
ContentCard: "Content-Card",
|
|
571
|
+
LoadingIndicator: "Loading-Indicator",
|
|
661
572
|
// Navigation components
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
573
|
+
NavigationFooter: "Navigation",
|
|
574
|
+
NavigationHeader: "Navigation",
|
|
575
|
+
NavigationJumpTo: "Navigation",
|
|
665
576
|
// Control components
|
|
666
|
-
|
|
577
|
+
SegmentedControl: "Segmented-Control",
|
|
667
578
|
// List and menu components
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
579
|
+
List: "Lists",
|
|
580
|
+
Menu: "Dropdown-Menu",
|
|
581
|
+
MenuItem: "Dropdown-Menu",
|
|
582
|
+
MenuSelect: "Dropdown-Menu",
|
|
672
583
|
// Tag components
|
|
673
|
-
|
|
674
|
-
|
|
584
|
+
Tag: "Tags",
|
|
585
|
+
TagFilter: "Tags",
|
|
675
586
|
// Tooltip components
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
587
|
+
Tooltip: "Tooltips",
|
|
588
|
+
TooltipCondensed: "Tooltips",
|
|
589
|
+
TooltipTable: "Tooltips",
|
|
679
590
|
// Table Cell components
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
591
|
+
CellBasic: "Table",
|
|
592
|
+
CellComponent: "Table",
|
|
593
|
+
CellHeader: "Table",
|
|
683
594
|
// Filter components
|
|
684
|
-
|
|
595
|
+
ComplexFilter: "Filters",
|
|
685
596
|
// Other components
|
|
686
|
-
|
|
687
|
-
|
|
597
|
+
Icon: "Icons",
|
|
598
|
+
Chip: "Tags",
|
|
688
599
|
// Chips are often similar to tags
|
|
689
|
-
|
|
600
|
+
Pagination: "Navigation"
|
|
690
601
|
// Pagination is often part of navigation
|
|
691
602
|
};
|
|
692
603
|
const mappedFile = componentToFileMap[componentName];
|
|
@@ -716,7 +627,9 @@ function getExportedFiles() {
|
|
|
716
627
|
}
|
|
717
628
|
}
|
|
718
629
|
if (!exportDir) {
|
|
719
|
-
console.warn(
|
|
630
|
+
console.warn(
|
|
631
|
+
"Export directory not found in any expected location. Please run Zeroheight export first."
|
|
632
|
+
);
|
|
720
633
|
return [];
|
|
721
634
|
}
|
|
722
635
|
const files = fs.readdirSync(exportDir).filter((file) => file.endsWith(".md") && file !== "README.md").map((file) => file.replace(".md", ""));
|
|
@@ -743,7 +656,10 @@ var getComponentDocsTool = {
|
|
|
743
656
|
...componentList["data-viz"]
|
|
744
657
|
];
|
|
745
658
|
const exportedFiles = getExportedFiles();
|
|
746
|
-
const componentsWithDocs = getComponentsWithDocs(
|
|
659
|
+
const componentsWithDocs = getComponentsWithDocs(
|
|
660
|
+
allComponents,
|
|
661
|
+
exportedFiles
|
|
662
|
+
);
|
|
747
663
|
return {
|
|
748
664
|
componentsWithDocs,
|
|
749
665
|
exportedFiles
|
|
@@ -823,7 +739,6 @@ ${documentation}`
|
|
|
823
739
|
// src/tools/index.ts
|
|
824
740
|
var tools = [
|
|
825
741
|
getComponentPropsTool,
|
|
826
|
-
getComponentPropsStorybookTool,
|
|
827
742
|
getComponentDocsTool,
|
|
828
743
|
listComponentsTool,
|
|
829
744
|
getTailwindTokensTool
|
|
@@ -847,10 +762,96 @@ var initializeTools = async (server2, config) => {
|
|
|
847
762
|
})
|
|
848
763
|
);
|
|
849
764
|
};
|
|
765
|
+
var FILENAME = fileURLToPath(import.meta.url);
|
|
766
|
+
var DIRNAME = dirname$1(FILENAME);
|
|
767
|
+
var dataDir = join(DIRNAME, "../../data/resources");
|
|
768
|
+
var MIME_TYPE_MARKDOWN = "text/markdown";
|
|
769
|
+
var UNKNOWN_ERROR = "Unknown error";
|
|
770
|
+
function initializeResources(server2) {
|
|
771
|
+
server2.resource(
|
|
772
|
+
"Figma to Code Translation Rules",
|
|
773
|
+
"sds://rules/figma",
|
|
774
|
+
{
|
|
775
|
+
mimeType: MIME_TYPE_MARKDOWN,
|
|
776
|
+
description: "Rules for translating Figma designs to SDS code"
|
|
777
|
+
},
|
|
778
|
+
async () => {
|
|
779
|
+
try {
|
|
780
|
+
const filePath = join(dataDir, "figma-rules.md");
|
|
781
|
+
const content = readFileSync(filePath, "utf-8");
|
|
782
|
+
return {
|
|
783
|
+
contents: [
|
|
784
|
+
{
|
|
785
|
+
uri: "sds://rules/figma",
|
|
786
|
+
mimeType: MIME_TYPE_MARKDOWN,
|
|
787
|
+
text: content
|
|
788
|
+
}
|
|
789
|
+
]
|
|
790
|
+
};
|
|
791
|
+
} catch (err) {
|
|
792
|
+
const message = err instanceof Error ? err.message : UNKNOWN_ERROR;
|
|
793
|
+
throw new Error("Failed to read Figma rules: " + message);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
);
|
|
797
|
+
server2.resource(
|
|
798
|
+
"SDS Component Usage Rules",
|
|
799
|
+
"sds://rules/components",
|
|
800
|
+
{
|
|
801
|
+
mimeType: MIME_TYPE_MARKDOWN,
|
|
802
|
+
description: "Guidelines for using SDS components correctly"
|
|
803
|
+
},
|
|
804
|
+
async () => {
|
|
805
|
+
try {
|
|
806
|
+
const filePath = join(dataDir, "sds-component-rules.md");
|
|
807
|
+
const content = readFileSync(filePath, "utf-8");
|
|
808
|
+
return {
|
|
809
|
+
contents: [
|
|
810
|
+
{
|
|
811
|
+
uri: "sds://rules/components",
|
|
812
|
+
mimeType: MIME_TYPE_MARKDOWN,
|
|
813
|
+
text: content
|
|
814
|
+
}
|
|
815
|
+
]
|
|
816
|
+
};
|
|
817
|
+
} catch (err) {
|
|
818
|
+
const message = err instanceof Error ? err.message : UNKNOWN_ERROR;
|
|
819
|
+
throw new Error("Failed to read component rules: " + message);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
);
|
|
823
|
+
server2.resource(
|
|
824
|
+
"Zeroheight Documentation Rules",
|
|
825
|
+
"sds://rules/zeroheight",
|
|
826
|
+
{
|
|
827
|
+
mimeType: MIME_TYPE_MARKDOWN,
|
|
828
|
+
description: "Rules for following Zeroheight documentation"
|
|
829
|
+
},
|
|
830
|
+
async () => {
|
|
831
|
+
try {
|
|
832
|
+
const filePath = join(dataDir, "zeroheight-rules.md");
|
|
833
|
+
const content = readFileSync(filePath, "utf-8");
|
|
834
|
+
return {
|
|
835
|
+
contents: [
|
|
836
|
+
{
|
|
837
|
+
uri: "sds://rules/zeroheight",
|
|
838
|
+
mimeType: MIME_TYPE_MARKDOWN,
|
|
839
|
+
text: content
|
|
840
|
+
}
|
|
841
|
+
]
|
|
842
|
+
};
|
|
843
|
+
} catch (err) {
|
|
844
|
+
const message = err instanceof Error ? err.message : UNKNOWN_ERROR;
|
|
845
|
+
throw new Error("Failed to read Zeroheight rules: " + message);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
850
|
|
|
851
851
|
// src/stdio.ts
|
|
852
852
|
async function main() {
|
|
853
853
|
await initializeTools(server, {});
|
|
854
|
+
initializeResources(server);
|
|
854
855
|
const transport = new StdioServerTransport();
|
|
855
856
|
await server.connect(transport);
|
|
856
857
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@czi-sds/mcp",
|
|
3
3
|
"description": "The official MCP server for SDS",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"main": "dist/stdio.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -22,9 +22,8 @@
|
|
|
22
22
|
"generate:tailwind-tokens": "mkdir -p data && cp ../components/src/common/styles-dictionary/json/tailwind.json data/tailwind.json && echo '✓ Copied tailwind.json to data folder'",
|
|
23
23
|
"generate:components-list": "tsx scripts/generate-component-list.ts",
|
|
24
24
|
"generate:component-props": "tsx scripts/generate-component-props.ts",
|
|
25
|
-
"generate:component-props-storybook": "tsx scripts/generate-component-props-from-storybook.ts",
|
|
26
25
|
"generate:zeroheight-export": "tsx scripts/export-zeroheight-pages.ts",
|
|
27
|
-
"generate:all": "yarn generate:tailwind-tokens && yarn generate:components-list && yarn generate:component-props && yarn generate:
|
|
26
|
+
"generate:all": "yarn generate:tailwind-tokens && yarn generate:components-list && yarn generate:component-props && yarn generate:zeroheight-export",
|
|
28
27
|
"prebuild": "yarn generate:all",
|
|
29
28
|
"build": "yarn prebuild && tsup && chmod 755 dist/stdio.js",
|
|
30
29
|
"dev": "tsup --watch",
|
|
@@ -63,5 +62,5 @@
|
|
|
63
62
|
"tsx": "^4.20.3",
|
|
64
63
|
"typescript": "^5.9.2"
|
|
65
64
|
},
|
|
66
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "0d113d49faf2a30e2a557450cf2deaecf830656b"
|
|
67
66
|
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Chip": {
|
|
3
|
-
"props": {
|
|
4
|
-
"size": {
|
|
5
|
-
"type": "\"small\" | \"medium\"",
|
|
6
|
-
"isRequired": false,
|
|
7
|
-
"description": "The size of the component.",
|
|
8
|
-
"defaultValue": "medium"
|
|
9
|
-
},
|
|
10
|
-
"status": {
|
|
11
|
-
"type": "\"success\" | \"error\" | \"warning\" | \"info\" | \"pending\" | \"beta\"",
|
|
12
|
-
"isRequired": false
|
|
13
|
-
},
|
|
14
|
-
"isRounded": {
|
|
15
|
-
"type": "\"false\" | \"true\"",
|
|
16
|
-
"isRequired": false
|
|
17
|
-
},
|
|
18
|
-
"children": {
|
|
19
|
-
"type": "null",
|
|
20
|
-
"isRequired": false,
|
|
21
|
-
"description": "This prop isn't supported.\nUse the `component` prop if you need to change the children structure."
|
|
22
|
-
},
|
|
23
|
-
"color": {
|
|
24
|
-
"type": "\"success\" | \"error\" | \"warning\" | \"info\" | \"default\" | \"primary\" | \"secondary\"",
|
|
25
|
-
"isRequired": false,
|
|
26
|
-
"description": "The color of the component.\nIt supports both default and custom theme colors, which can be added as shown in the\n[palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).",
|
|
27
|
-
"defaultValue": "default"
|
|
28
|
-
},
|
|
29
|
-
"disabled": {
|
|
30
|
-
"type": "\"false\" | \"true\"",
|
|
31
|
-
"isRequired": false,
|
|
32
|
-
"description": "If `true`, the component is disabled.",
|
|
33
|
-
"defaultValue": false
|
|
34
|
-
},
|
|
35
|
-
"icon": {
|
|
36
|
-
"type": "ReactElement",
|
|
37
|
-
"isRequired": false,
|
|
38
|
-
"description": "Icon element."
|
|
39
|
-
},
|
|
40
|
-
"label": {
|
|
41
|
-
"type": "ReactNode",
|
|
42
|
-
"isRequired": false,
|
|
43
|
-
"description": "The content of the component."
|
|
44
|
-
},
|
|
45
|
-
"variant": {
|
|
46
|
-
"type": "\"filled\" | \"outlined\"",
|
|
47
|
-
"isRequired": false,
|
|
48
|
-
"description": "The variant to use.",
|
|
49
|
-
"defaultValue": "filled"
|
|
50
|
-
},
|
|
51
|
-
"className": {
|
|
52
|
-
"type": "string",
|
|
53
|
-
"isRequired": false
|
|
54
|
-
},
|
|
55
|
-
"style": {
|
|
56
|
-
"type": "CSSProperties",
|
|
57
|
-
"isRequired": false
|
|
58
|
-
},
|
|
59
|
-
"id": {
|
|
60
|
-
"type": "string",
|
|
61
|
-
"isRequired": false
|
|
62
|
-
},
|
|
63
|
-
"onChange": {
|
|
64
|
-
"type": "FormEventHandler<HTMLDivElement>",
|
|
65
|
-
"isRequired": false
|
|
66
|
-
},
|
|
67
|
-
"onClick": {
|
|
68
|
-
"type": "function",
|
|
69
|
-
"isRequired": false
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"List": {
|
|
3
|
-
"props": {
|
|
4
|
-
"component": {
|
|
5
|
-
"type": "\"symbol\" | \"object\" | \"style\" | \"ul\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"article\" | \"aside\" | \"audio\" | \"b\" | \"base\" | \"bdi\" | \"bdo\" | \"big\" | \"blockquote\" | \"body\" | \"br\" | \"button\" | \"canvas\" | \"caption\" | \"center\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"data\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"form\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"head\" | \"header\" | \"hgroup\" | \"hr\" | \"html\" | \"i\" | \"iframe\" | \"img\" | \"input\" | \"ins\" | \"kbd\" | \"keygen\" | \"label\" | \"legend\" | \"li\" | \"link\" | \"main\" | \"map\" | \"mark\" | \"menu\" | \"menuitem\" | \"meta\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"output\" | \"p\" | \"param\" | \"picture\" | \"pre\" | \"progress\" | \"q\" | \"rp\" | \"rt\" | \"ruby\" | \"s\" | \"samp\" | \"search\" | \"slot\" | \"script\" | \"section\" | \"select\" | \"small\" | \"source\" | \"span\" | \"strong\" | \"sub\" | \"summary\" | \"sup\" | \"table\" | \"template\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"time\" | \"title\" | \"tr\" | \"track\" | \"u\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"svg\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"desc\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"filter\" | \"foreignObject\" | \"g\" | \"image\" | \"line\" | \"linearGradient\" | \"marker\" | \"mask\" | \"metadata\" | \"mpath\" | \"path\" | \"pattern\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"set\" | \"stop\" | \"switch\" | \"text\" | \"textPath\" | \"tspan\" | \"use\" | \"view\" | \"ComponentClass",
|
|
6
|
-
"isRequired": false
|
|
7
|
-
},
|
|
8
|
-
"marginBottom": {
|
|
9
|
-
"type": "\"s\" | \"xxxs\" | \"xxs\" | \"xs\" | \"m\" | \"l\"",
|
|
10
|
-
"isRequired": false
|
|
11
|
-
},
|
|
12
|
-
"ordered": {
|
|
13
|
-
"type": "\"false\" | \"true\"",
|
|
14
|
-
"isRequired": false
|
|
15
|
-
},
|
|
16
|
-
"children": {
|
|
17
|
-
"type": "ReactNode",
|
|
18
|
-
"isRequired": false,
|
|
19
|
-
"description": "The content of the component."
|
|
20
|
-
},
|
|
21
|
-
"className": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"isRequired": false
|
|
24
|
-
},
|
|
25
|
-
"style": {
|
|
26
|
-
"type": "CSSProperties",
|
|
27
|
-
"isRequired": false
|
|
28
|
-
},
|
|
29
|
-
"id": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"isRequired": false
|
|
32
|
-
},
|
|
33
|
-
"onChange": {
|
|
34
|
-
"type": "FormEventHandler<HTMLUListElement>",
|
|
35
|
-
"isRequired": false
|
|
36
|
-
},
|
|
37
|
-
"onClick": {
|
|
38
|
-
"type": "function",
|
|
39
|
-
"isRequired": false
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Menu": {
|
|
3
|
-
"props": {
|
|
4
|
-
"children": {
|
|
5
|
-
"type": "ReactNode",
|
|
6
|
-
"isRequired": false,
|
|
7
|
-
"description": "Menu contents, normally `MenuItem`s."
|
|
8
|
-
},
|
|
9
|
-
"onClose": {
|
|
10
|
-
"type": "\"backdropClick\" | \"escapeKeyDown\"",
|
|
11
|
-
"isRequired": false,
|
|
12
|
-
"description": "Callback fired when the component requests to be closed.\n@param event The event source of the callback.\n@param reason Can be: `\"escapeKeyDown\"`, `\"backdropClick\"`, `\"tabKeyDown\"`."
|
|
13
|
-
},
|
|
14
|
-
"open": {
|
|
15
|
-
"type": "\"false\" | \"true\"",
|
|
16
|
-
"isRequired": true,
|
|
17
|
-
"description": "If `true`, the component is shown."
|
|
18
|
-
},
|
|
19
|
-
"variant": {
|
|
20
|
-
"type": "\"menu\" | \"selectedMenu\"",
|
|
21
|
-
"isRequired": false,
|
|
22
|
-
"description": "The variant to use. Use `menu` to prevent selected items from impacting the initial focus.",
|
|
23
|
-
"defaultValue": "selectedMenu"
|
|
24
|
-
},
|
|
25
|
-
"className": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"isRequired": false,
|
|
28
|
-
"description": "@ignore"
|
|
29
|
-
},
|
|
30
|
-
"style": {
|
|
31
|
-
"type": "CSSProperties",
|
|
32
|
-
"isRequired": false
|
|
33
|
-
},
|
|
34
|
-
"id": {
|
|
35
|
-
"type": "string",
|
|
36
|
-
"isRequired": false
|
|
37
|
-
},
|
|
38
|
-
"onChange": {
|
|
39
|
-
"type": "FormEventHandler<HTMLDivElement>",
|
|
40
|
-
"isRequired": false
|
|
41
|
-
},
|
|
42
|
-
"onClick": {
|
|
43
|
-
"type": "function",
|
|
44
|
-
"isRequired": false
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Table": {
|
|
3
|
-
"props": {
|
|
4
|
-
"className": {
|
|
5
|
-
"type": "string",
|
|
6
|
-
"isRequired": false
|
|
7
|
-
},
|
|
8
|
-
"id": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"isRequired": false
|
|
11
|
-
},
|
|
12
|
-
"style": {
|
|
13
|
-
"type": "CSSProperties",
|
|
14
|
-
"isRequired": false
|
|
15
|
-
},
|
|
16
|
-
"onChange": {
|
|
17
|
-
"type": "FormEventHandler<HTMLTableElement>",
|
|
18
|
-
"isRequired": false
|
|
19
|
-
},
|
|
20
|
-
"onClick": {
|
|
21
|
-
"type": "function",
|
|
22
|
-
"isRequired": false
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Accordion": {
|
|
3
|
-
"props": {
|
|
4
|
-
"defaultExpanded": {
|
|
5
|
-
"type": "boolean",
|
|
6
|
-
"isRequired": false
|
|
7
|
-
},
|
|
8
|
-
"id": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"isRequired": true
|
|
11
|
-
},
|
|
12
|
-
"subtitle": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"isRequired": false
|
|
15
|
-
},
|
|
16
|
-
"togglePosition": {
|
|
17
|
-
"type": "\"right\" | \"left\"",
|
|
18
|
-
"isRequired": false,
|
|
19
|
-
"options": [
|
|
20
|
-
"right",
|
|
21
|
-
"left"
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
"useDivider": {
|
|
25
|
-
"type": "boolean",
|
|
26
|
-
"isRequired": false
|
|
27
|
-
},
|
|
28
|
-
"className": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"isRequired": false,
|
|
31
|
-
"description": "Standard React className prop"
|
|
32
|
-
},
|
|
33
|
-
"style": {
|
|
34
|
-
"type": "CSSProperties",
|
|
35
|
-
"isRequired": false,
|
|
36
|
-
"description": "Standard React style prop"
|
|
37
|
-
},
|
|
38
|
-
"children": {
|
|
39
|
-
"type": "ReactNode",
|
|
40
|
-
"isRequired": false,
|
|
41
|
-
"description": "Standard React children prop"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Alert": {
|
|
3
|
-
"props": {
|
|
4
|
-
"text": {
|
|
5
|
-
"type": "string",
|
|
6
|
-
"isRequired": true
|
|
7
|
-
},
|
|
8
|
-
"className": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"isRequired": false,
|
|
11
|
-
"description": "Standard React className prop"
|
|
12
|
-
},
|
|
13
|
-
"style": {
|
|
14
|
-
"type": "CSSProperties",
|
|
15
|
-
"isRequired": false,
|
|
16
|
-
"description": "Standard React style prop"
|
|
17
|
-
},
|
|
18
|
-
"children": {
|
|
19
|
-
"type": "ReactNode",
|
|
20
|
-
"isRequired": false,
|
|
21
|
-
"description": "Standard React children prop"
|
|
22
|
-
},
|
|
23
|
-
"id": {
|
|
24
|
-
"type": "string",
|
|
25
|
-
"isRequired": false,
|
|
26
|
-
"description": "Standard React id prop"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|