@maltjoy/mcp-server 0.1.1 → 0.2.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 +110 -11
- package/dist/doc/VJoyAvatar/metadata.json +1 -1
- package/dist/doc/VJoyButton/metadata.json +1 -1
- package/dist/doc/VJoyCollapseItem/metadata.json +1 -1
- package/dist/doc/VJoyHighlight/metadata.json +1 -1
- package/dist/doc/VJoyIcon/metadata.json +1 -1
- package/dist/doc/VJoyInput/metadata.json +1 -1
- package/dist/doc/VJoyLink/metadata.json +1 -1
- package/dist/doc/VJoyListItem/metadata.json +1 -1
- package/dist/doc/VJoyMenu/metadata.json +11 -4
- package/dist/doc/VJoyMenuItem/metadata.json +2 -2
- package/dist/doc/VJoyProductTour/metadata.json +1 -1
- package/dist/doc/VJoySelectableItem/metadata.json +1 -1
- package/dist/doc/VJoyTag/metadata.json +10 -9
- package/dist/doc/VJoyTagsInput/metadata.json +1 -0
- package/dist/doc/VJoyTagsList/metadata.json +112 -110
- package/dist/doc/VJoyWalkthrough/metadata.json +1 -1
- package/dist/doc/VJoyWalkthroughTrigger/metadata.json +1 -1
- package/dist/doc/css-classes.json +12 -0
- package/dist/doc/design-tokens.json +150 -148
- package/dist/doc/index.json +2 -2
- package/dist/index.js +31 -1
- package/dist/index.js.map +1 -1
- package/dist/parser.d.ts +3 -3
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +47 -236
- package/dist/parser.js.map +1 -1
- package/dist/tools/list-css-classes.js +1 -1
- package/dist/tools/list-css-classes.js.map +1 -1
- package/dist/tools/list-design-tokens.d.ts +8 -8
- package/dist/tools/list-design-tokens.d.ts.map +1 -1
- package/dist/tools/list-design-tokens.js +1 -1
- package/dist/tools/list-design-tokens.js.map +1 -1
- package/package.json +3 -3
package/dist/parser.js
CHANGED
|
@@ -4,41 +4,24 @@ import { dirname, join } from 'path';
|
|
|
4
4
|
const __filename = fileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = dirname(__filename);
|
|
6
6
|
/**
|
|
7
|
-
* Parse the Joy components documentation
|
|
8
|
-
* and extract component names from the
|
|
7
|
+
* Parse the Joy components documentation JSON file
|
|
8
|
+
* and extract component names from the index
|
|
9
9
|
*/
|
|
10
10
|
export function parseComponentNames() {
|
|
11
11
|
try {
|
|
12
|
-
// Path to the
|
|
13
|
-
const
|
|
14
|
-
const content = readFileSync(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// Start of Table of Contents
|
|
21
|
-
if (line.trim() === '## Table of Contents') {
|
|
22
|
-
inTableOfContents = true;
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
// End of Table of Contents (next section starts)
|
|
26
|
-
if (inTableOfContents && line.startsWith('---')) {
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
// Extract component names from TOC links
|
|
30
|
-
// Format: - [VJoyAdminBanner](#vjoyadminbanner)
|
|
31
|
-
if (inTableOfContents && line.startsWith('- [')) {
|
|
32
|
-
const match = line.match(/- \[([^\]]+)\]/);
|
|
33
|
-
if (match && match[1]) {
|
|
34
|
-
components.push(match[1]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
12
|
+
// Path to the JSON index file (relative to dist folder where compiled code runs)
|
|
13
|
+
const indexPath = join(__dirname, 'doc/index.json');
|
|
14
|
+
const content = readFileSync(indexPath, 'utf-8');
|
|
15
|
+
const data = JSON.parse(content);
|
|
16
|
+
// Extract component names from the components array
|
|
17
|
+
if (data.components && Array.isArray(data.components)) {
|
|
18
|
+
const names = data.components.map((comp) => comp.name);
|
|
19
|
+
return names;
|
|
37
20
|
}
|
|
38
|
-
return
|
|
21
|
+
return [];
|
|
39
22
|
}
|
|
40
23
|
catch (error) {
|
|
41
|
-
console.error('Error parsing component names:', error);
|
|
24
|
+
console.error('Error parsing component names:', error instanceof Error ? error.message : String(error));
|
|
42
25
|
return [];
|
|
43
26
|
}
|
|
44
27
|
}
|
|
@@ -49,40 +32,38 @@ export function getComponentCount() {
|
|
|
49
32
|
return parseComponentNames().length;
|
|
50
33
|
}
|
|
51
34
|
/**
|
|
52
|
-
* Parse and extract all information for a specific component
|
|
35
|
+
* Parse and extract all information for a specific component from JSON
|
|
53
36
|
*/
|
|
54
37
|
export function parseComponentInfo(componentName) {
|
|
55
38
|
try {
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
let startIndex = -1;
|
|
62
|
-
for (let i = 0; i < lines.length; i++) {
|
|
63
|
-
if (componentHeaderPattern.test(lines[i])) {
|
|
64
|
-
startIndex = i;
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (startIndex === -1) {
|
|
69
|
-
return null; // Component not found
|
|
70
|
-
}
|
|
71
|
-
// Find the end of the component section (next --- or next ## heading)
|
|
72
|
-
let endIndex = lines.length;
|
|
73
|
-
for (let i = startIndex + 1; i < lines.length; i++) {
|
|
74
|
-
if (lines[i].startsWith('## ') || lines[i].trim() === '---') {
|
|
75
|
-
endIndex = i;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const componentSection = lines.slice(startIndex, endIndex);
|
|
39
|
+
// Path to the component metadata JSON file (relative to dist folder where compiled code runs)
|
|
40
|
+
const componentPath = join(__dirname, 'doc', componentName, 'metadata.json');
|
|
41
|
+
const content = readFileSync(componentPath, 'utf-8');
|
|
42
|
+
const data = JSON.parse(content);
|
|
43
|
+
// Map JSON structure to ComponentInfo interface
|
|
80
44
|
return {
|
|
81
|
-
name: componentName,
|
|
82
|
-
props:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
45
|
+
name: data.displayName || componentName,
|
|
46
|
+
props: data.props.map((prop) => ({
|
|
47
|
+
name: prop.name,
|
|
48
|
+
type: prop.type,
|
|
49
|
+
required: prop.required,
|
|
50
|
+
default: prop.default || '-',
|
|
51
|
+
description: prop.description,
|
|
52
|
+
possibleValues: prop.possibleValues ? formatPossibleValues(prop.possibleValues) : undefined
|
|
53
|
+
})),
|
|
54
|
+
events: data.events.map((event) => ({
|
|
55
|
+
name: event.name,
|
|
56
|
+
description: event.description
|
|
57
|
+
})),
|
|
58
|
+
slots: data.slots.map((slot) => ({
|
|
59
|
+
name: slot.name,
|
|
60
|
+
description: slot.description
|
|
61
|
+
})),
|
|
62
|
+
exposedMembers: data.exposed ? data.exposed.map((exp) => ({
|
|
63
|
+
name: exp.name,
|
|
64
|
+
type: exp.type,
|
|
65
|
+
kind: exp.isMethod ? 'method' : 'property'
|
|
66
|
+
})) : []
|
|
86
67
|
};
|
|
87
68
|
}
|
|
88
69
|
catch (error) {
|
|
@@ -91,185 +72,15 @@ export function parseComponentInfo(componentName) {
|
|
|
91
72
|
}
|
|
92
73
|
}
|
|
93
74
|
/**
|
|
94
|
-
*
|
|
95
|
-
*/
|
|
96
|
-
function parseProps(lines) {
|
|
97
|
-
const props = [];
|
|
98
|
-
let inPropsSection = false;
|
|
99
|
-
let inTableBody = false;
|
|
100
|
-
let currentProp = null;
|
|
101
|
-
for (let i = 0; i < lines.length; i++) {
|
|
102
|
-
const line = lines[i];
|
|
103
|
-
if (line.trim() === '### Props') {
|
|
104
|
-
inPropsSection = true;
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
if (inPropsSection && line.startsWith('###')) {
|
|
108
|
-
break; // Next section
|
|
109
|
-
}
|
|
110
|
-
if (inPropsSection) {
|
|
111
|
-
// Skip the header row and separator
|
|
112
|
-
if (line.includes('| Name | Type | Required')) {
|
|
113
|
-
inTableBody = true;
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
if (line.includes('|------|------|')) {
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
if (inTableBody && line.startsWith('| `')) {
|
|
120
|
-
// Main property row
|
|
121
|
-
const match = line.match(/\| `([^`]+)` \| `([^`]+)` \| ([^|]+) \| ([^|]+) \| ([^|]+) \|/);
|
|
122
|
-
if (match) {
|
|
123
|
-
if (currentProp && currentProp.name) {
|
|
124
|
-
props.push(currentProp);
|
|
125
|
-
}
|
|
126
|
-
currentProp = {
|
|
127
|
-
name: match[1].trim(),
|
|
128
|
-
type: match[2].trim(),
|
|
129
|
-
required: match[3].trim().includes('✅'),
|
|
130
|
-
default: match[4].trim(),
|
|
131
|
-
description: match[5].trim()
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
else if (inTableBody && line.includes('*Possible values:*') && currentProp) {
|
|
136
|
-
// Possible values row
|
|
137
|
-
const match = line.match(/\*Possible values:\* `([^`]+)`/);
|
|
138
|
-
if (match) {
|
|
139
|
-
currentProp.possibleValues = match[1].trim();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else if (inTableBody && line.trim() === '') {
|
|
143
|
-
// Empty line might signal end of table
|
|
144
|
-
if (currentProp && currentProp.name) {
|
|
145
|
-
props.push(currentProp);
|
|
146
|
-
currentProp = null;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
// Add last prop if exists
|
|
152
|
-
if (currentProp && currentProp.name) {
|
|
153
|
-
props.push(currentProp);
|
|
154
|
-
}
|
|
155
|
-
return props;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Parse events from component section
|
|
159
|
-
*/
|
|
160
|
-
function parseEvents(lines) {
|
|
161
|
-
const events = [];
|
|
162
|
-
let inEventsSection = false;
|
|
163
|
-
let inTableBody = false;
|
|
164
|
-
for (const line of lines) {
|
|
165
|
-
if (line.trim() === '### Events') {
|
|
166
|
-
inEventsSection = true;
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
if (inEventsSection && line.startsWith('###')) {
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
if (inEventsSection) {
|
|
173
|
-
if (line.includes('*No events*')) {
|
|
174
|
-
break;
|
|
175
|
-
}
|
|
176
|
-
if (line.includes('| Event | Description |')) {
|
|
177
|
-
inTableBody = true;
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
180
|
-
if (line.includes('|------|-------------|')) {
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
if (inTableBody && line.startsWith('| `')) {
|
|
184
|
-
const match = line.match(/\| `([^`]+)` \| ([^|]+) \|/);
|
|
185
|
-
if (match) {
|
|
186
|
-
events.push({
|
|
187
|
-
name: match[1].trim(),
|
|
188
|
-
description: match[2].trim()
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return events;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Parse slots from component section
|
|
75
|
+
* Format possible values for display
|
|
198
76
|
*/
|
|
199
|
-
function
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
let inTableBody = false;
|
|
203
|
-
for (const line of lines) {
|
|
204
|
-
if (line.trim() === '### Slots') {
|
|
205
|
-
inSlotsSection = true;
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
if (inSlotsSection && line.startsWith('###')) {
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
if (inSlotsSection) {
|
|
212
|
-
if (line.includes('*No slots*')) {
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
if (line.includes('| Slot | Description |')) {
|
|
216
|
-
inTableBody = true;
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
if (line.includes('|------|-------------|')) {
|
|
220
|
-
continue;
|
|
221
|
-
}
|
|
222
|
-
if (inTableBody && line.startsWith('| `')) {
|
|
223
|
-
const match = line.match(/\| `([^`]+)` \| ([^|]+) \|/);
|
|
224
|
-
if (match) {
|
|
225
|
-
slots.push({
|
|
226
|
-
name: match[1].trim(),
|
|
227
|
-
description: match[2].trim()
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
77
|
+
function formatPossibleValues(values) {
|
|
78
|
+
if (typeof values === 'string') {
|
|
79
|
+
return values;
|
|
232
80
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Parse exposed members from component section
|
|
237
|
-
*/
|
|
238
|
-
function parseExposedMembers(lines) {
|
|
239
|
-
const members = [];
|
|
240
|
-
let inExposedSection = false;
|
|
241
|
-
let inTableBody = false;
|
|
242
|
-
for (const line of lines) {
|
|
243
|
-
if (line.includes('### Exposed Methods & Properties')) {
|
|
244
|
-
inExposedSection = true;
|
|
245
|
-
continue;
|
|
246
|
-
}
|
|
247
|
-
if (inExposedSection && line.startsWith('###')) {
|
|
248
|
-
break;
|
|
249
|
-
}
|
|
250
|
-
if (inExposedSection) {
|
|
251
|
-
if (line.includes('*No exposed')) {
|
|
252
|
-
break;
|
|
253
|
-
}
|
|
254
|
-
if (line.includes('| Name | Type | Kind |')) {
|
|
255
|
-
inTableBody = true;
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
if (line.includes('|------|------|------|')) {
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
if (inTableBody && line.startsWith('| `')) {
|
|
262
|
-
const match = line.match(/\| `([^`]+)` \| `([^`]+)` \| ([^|]+) \|/);
|
|
263
|
-
if (match) {
|
|
264
|
-
members.push({
|
|
265
|
-
name: match[1].trim(),
|
|
266
|
-
type: match[2].trim(),
|
|
267
|
-
kind: match[3].trim()
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
81
|
+
if (Array.isArray(values)) {
|
|
82
|
+
return values.join(', ');
|
|
272
83
|
}
|
|
273
|
-
return
|
|
84
|
+
return String(values);
|
|
274
85
|
}
|
|
275
86
|
//# sourceMappingURL=parser.js.map
|
package/dist/parser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":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leListCssClasses() {
|
|
15
|
-
const cssClassesFilePath = resolve(__dirname, '
|
|
15
|
+
const cssClassesFilePath = resolve(__dirname, '../../dist/doc/css-classes.json');
|
|
16
16
|
const fileContent = readFileSync(cssClassesFilePath, 'utf-8');
|
|
17
17
|
return JSON.parse(fileContent);
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-css-classes.js","sourceRoot":"","sources":["../../src/tools/list-css-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,yHAAyH;IACtI,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAWF,MAAM,UAAU,oBAAoB;IAClC,MAAM,kBAAkB,GAAG,OAAO,CAAC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"list-css-classes.js","sourceRoot":"","sources":["../../src/tools/list-css-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,yHAAyH;IACtI,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAWF,MAAM,UAAU,oBAAoB;IAClC,MAAM,kBAAkB,GAAG,OAAO,CAAC,SAAS,EAAE,iCAAiC,CAAC,CAAC;IACjF,MAAM,WAAW,GAAG,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAuB,CAAC;AACvD,CAAC"}
|
|
@@ -8,14 +8,14 @@ export declare const listDesignTokensTool: {
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export interface DesignTokensByDomain {
|
|
11
|
-
colors: string
|
|
12
|
-
spacing: string
|
|
13
|
-
typography: string
|
|
14
|
-
radius: string
|
|
15
|
-
elevation: string
|
|
16
|
-
zIndex: string
|
|
17
|
-
transitions: string
|
|
18
|
-
forms: string
|
|
11
|
+
colors: Record<string, string>;
|
|
12
|
+
spacing: Record<string, string>;
|
|
13
|
+
typography: Record<string, string>;
|
|
14
|
+
radius: Record<string, string>;
|
|
15
|
+
elevation: Record<string, string>;
|
|
16
|
+
zIndex: Record<string, string>;
|
|
17
|
+
transitions: Record<string, string>;
|
|
18
|
+
forms: Record<string, string>;
|
|
19
19
|
}
|
|
20
20
|
export declare function handleListDesignTokens(): DesignTokensByDomain;
|
|
21
21
|
//# sourceMappingURL=list-design-tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-design-tokens.d.ts","sourceRoot":"","sources":["../../src/tools/list-design-tokens.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB;;;;;;;;CAQhC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"list-design-tokens.d.ts","sourceRoot":"","sources":["../../src/tools/list-design-tokens.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB;;;;;;;;CAQhC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,wBAAgB,sBAAsB,IAAI,oBAAoB,CAI7D"}
|
|
@@ -12,7 +12,7 @@ export const listDesignTokensTool = {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
export function handleListDesignTokens() {
|
|
15
|
-
const tokensFilePath = resolve(__dirname, '
|
|
15
|
+
const tokensFilePath = resolve(__dirname, '../../dist/doc/design-tokens.json');
|
|
16
16
|
const fileContent = readFileSync(tokensFilePath, 'utf-8');
|
|
17
17
|
return JSON.parse(fileContent);
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-design-tokens.js","sourceRoot":"","sources":["../../src/tools/list-design-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,iKAAiK;IAC9K,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAaF,MAAM,UAAU,sBAAsB;IACpC,MAAM,cAAc,GAAG,OAAO,CAAC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"list-design-tokens.js","sourceRoot":"","sources":["../../src/tools/list-design-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,iKAAiK;IAC9K,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAaF,MAAM,UAAU,sBAAsB;IACpC,MAAM,cAAc,GAAG,OAAO,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAC;IAC/E,MAAM,WAAW,GAAG,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAyB,CAAC;AACzD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maltjoy/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server for Joy Design System - exposes Vue3 components information",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsc",
|
|
14
|
+
"build": "tsc && npm run generate:components-docs:json",
|
|
15
15
|
"dev": "tsc --watch",
|
|
16
16
|
"start": "node dist/index.js",
|
|
17
17
|
"generate:components-docs:json": "node src/json-metadata-generator.mjs",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"author": "Maltjoy",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@modelcontextprotocol/sdk": "
|
|
30
|
+
"@modelcontextprotocol/sdk": "1.25.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "20.14.2",
|