@master/css-mcp 2.0.0-rc.88 → 2.0.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 +47 -22
- package/dist/bin/index.js +4 -5
- package/dist/classes.js +153 -168
- package/dist/compare.js +99 -83
- package/dist/context.d.ts +5 -10
- package/dist/context.js +28 -10
- package/dist/design-system-schema.js +97 -0
- package/dist/directives.js +59 -109
- package/dist/document.js +2 -10
- package/dist/format.js +67 -56
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -3
- package/dist/internal/src/workspace.js +70 -0
- package/dist/language.js +27 -23
- package/dist/lint.js +86 -96
- package/dist/manifest-query.js +40 -100
- package/dist/manifest-summary.js +15 -35
- package/dist/output-schema.js +207 -0
- package/dist/preview-write-lock.js +90 -0
- package/dist/project-comparison-schema.js +59 -0
- package/dist/project.js +77 -18
- package/dist/result.js +67 -8
- package/dist/scan.js +93 -73
- package/dist/semantic-schema.js +286 -0
- package/dist/server.d.ts +10 -9
- package/dist/server.js +123 -111
- package/dist/setup.js +28 -29
- package/dist/source-schema.js +141 -0
- package/dist/suggest.js +22 -0
- package/dist/tooling-session.js +27 -0
- package/package.json +63 -73
- package/LICENSE +0 -21
- package/dist/classes.d.ts +0 -236
- package/dist/compare.d.ts +0 -70
- package/dist/contributor.d.ts +0 -149
- package/dist/contributor.js +0 -499
- package/dist/directives.d.ts +0 -132
- package/dist/document.d.ts +0 -24
- package/dist/format.d.ts +0 -56
- package/dist/language.d.ts +0 -24
- package/dist/lint.d.ts +0 -55
- package/dist/manifest-query.d.ts +0 -148
- package/dist/manifest-summary.d.ts +0 -47
- package/dist/project.d.ts +0 -31
- package/dist/result.d.ts +0 -8
- package/dist/scan.d.ts +0 -156
- package/dist/setup.d.ts +0 -67
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
// src/semantic-schema.ts
|
|
3
|
+
const strings = z.array(z.string());
|
|
4
|
+
const range = z.object({
|
|
5
|
+
start: z.number(),
|
|
6
|
+
end: z.number()
|
|
7
|
+
});
|
|
8
|
+
const position = z.object({
|
|
9
|
+
line: z.number(),
|
|
10
|
+
character: z.number()
|
|
11
|
+
});
|
|
12
|
+
const diagnostic = z.object({
|
|
13
|
+
code: z.string().optional(),
|
|
14
|
+
phase: z.string().optional(),
|
|
15
|
+
severity: z.union([z.string(), z.number()]).optional(),
|
|
16
|
+
message: z.string(),
|
|
17
|
+
notes: strings.optional(),
|
|
18
|
+
alternatives: strings.optional(),
|
|
19
|
+
source: z.string().optional(),
|
|
20
|
+
range: z.union([range, z.object({
|
|
21
|
+
start: position,
|
|
22
|
+
end: position
|
|
23
|
+
})]).optional()
|
|
24
|
+
}).passthrough();
|
|
25
|
+
const matchStatus = z.enum([
|
|
26
|
+
"matched",
|
|
27
|
+
"unmatched",
|
|
28
|
+
"ambiguous",
|
|
29
|
+
"syntax-error"
|
|
30
|
+
]);
|
|
31
|
+
const cssStatus = z.enum([
|
|
32
|
+
"valid",
|
|
33
|
+
"invalid",
|
|
34
|
+
"unknown",
|
|
35
|
+
"not-checked"
|
|
36
|
+
]);
|
|
37
|
+
const browserSupport = z.enum([
|
|
38
|
+
"supported",
|
|
39
|
+
"unsupported",
|
|
40
|
+
"unknown",
|
|
41
|
+
"not-checked"
|
|
42
|
+
]);
|
|
43
|
+
const numeric = z.object({
|
|
44
|
+
value: z.number(),
|
|
45
|
+
unit: z.string().optional()
|
|
46
|
+
});
|
|
47
|
+
const variable = z.object({
|
|
48
|
+
key: z.string(),
|
|
49
|
+
name: z.string(),
|
|
50
|
+
namespace: z.string().optional(),
|
|
51
|
+
type: z.string(),
|
|
52
|
+
values: z.array(z.object({
|
|
53
|
+
path: strings,
|
|
54
|
+
value: z.string(),
|
|
55
|
+
inline: z.boolean().optional(),
|
|
56
|
+
static: z.boolean().optional()
|
|
57
|
+
})),
|
|
58
|
+
numeric: numeric.optional(),
|
|
59
|
+
dependencies: strings
|
|
60
|
+
});
|
|
61
|
+
const bound = z.object({
|
|
62
|
+
value: z.number(),
|
|
63
|
+
inclusive: z.boolean()
|
|
64
|
+
}).nullable();
|
|
65
|
+
const rule = z.object({
|
|
66
|
+
className: z.string(),
|
|
67
|
+
key: z.string(),
|
|
68
|
+
layer: z.enum([
|
|
69
|
+
"base",
|
|
70
|
+
"defaults",
|
|
71
|
+
"components",
|
|
72
|
+
"utilities"
|
|
73
|
+
]),
|
|
74
|
+
type: z.number(),
|
|
75
|
+
sortTier: z.number(),
|
|
76
|
+
text: z.string().optional(),
|
|
77
|
+
selectorText: z.string().optional(),
|
|
78
|
+
priority: z.object({
|
|
79
|
+
features: z.array(z.object({
|
|
80
|
+
domain: z.string(),
|
|
81
|
+
feature: z.string(),
|
|
82
|
+
unit: z.string(),
|
|
83
|
+
lower: bound,
|
|
84
|
+
upper: bound
|
|
85
|
+
})),
|
|
86
|
+
selector: z.number(),
|
|
87
|
+
conditions: strings.optional(),
|
|
88
|
+
sortKey: z.string().optional(),
|
|
89
|
+
valuePriority: z.number().optional(),
|
|
90
|
+
category: z.number(),
|
|
91
|
+
family: z.string().optional(),
|
|
92
|
+
coverage: z.number().optional(),
|
|
93
|
+
property: z.string().optional()
|
|
94
|
+
}),
|
|
95
|
+
nodes: z.array(z.object({ text: z.string() })).optional(),
|
|
96
|
+
variableNames: strings.optional()
|
|
97
|
+
});
|
|
98
|
+
const inspection = z.object({
|
|
99
|
+
className: z.string(),
|
|
100
|
+
matchStatus,
|
|
101
|
+
cssSyntaxStatus: cssStatus,
|
|
102
|
+
cssValueStatus: cssStatus,
|
|
103
|
+
browserSupport,
|
|
104
|
+
checks: z.array(z.object({
|
|
105
|
+
name: z.string(),
|
|
106
|
+
version: z.string(),
|
|
107
|
+
phase: z.string(),
|
|
108
|
+
scope: z.string()
|
|
109
|
+
})),
|
|
110
|
+
declarations: z.array(z.object({
|
|
111
|
+
property: z.string(),
|
|
112
|
+
value: z.string(),
|
|
113
|
+
status: cssStatus,
|
|
114
|
+
range: range.optional(),
|
|
115
|
+
error: z.string().optional()
|
|
116
|
+
}).passthrough()),
|
|
117
|
+
rules: z.array(rule),
|
|
118
|
+
variables: z.array(z.object({
|
|
119
|
+
key: z.string(),
|
|
120
|
+
variable
|
|
121
|
+
})),
|
|
122
|
+
diagnostics: z.array(diagnostic).optional()
|
|
123
|
+
}).passthrough();
|
|
124
|
+
const versions = z.object({
|
|
125
|
+
languageVersion: z.number(),
|
|
126
|
+
bindingAbiVersion: z.number(),
|
|
127
|
+
packageVersion: z.string()
|
|
128
|
+
}).passthrough();
|
|
129
|
+
const metadata = z.object({
|
|
130
|
+
context: z.enum(["project", "preset"]),
|
|
131
|
+
status: z.enum(["loaded", "error"]),
|
|
132
|
+
fingerprint: z.string().nullable(),
|
|
133
|
+
entries: strings,
|
|
134
|
+
dependencies: strings,
|
|
135
|
+
versions: versions.optional()
|
|
136
|
+
}).passthrough();
|
|
137
|
+
const envelopeMetadata = z.object({
|
|
138
|
+
versions: versions.nullable(),
|
|
139
|
+
context: z.enum(["project", "preset"]).nullable(),
|
|
140
|
+
manifestFingerprint: z.string().nullable(),
|
|
141
|
+
entries: strings,
|
|
142
|
+
dependencies: strings
|
|
143
|
+
});
|
|
144
|
+
const mixinSource = z.object({
|
|
145
|
+
file: z.string().optional(),
|
|
146
|
+
range,
|
|
147
|
+
loc: z.object({
|
|
148
|
+
start: z.object({
|
|
149
|
+
line: z.number(),
|
|
150
|
+
column: z.number()
|
|
151
|
+
}),
|
|
152
|
+
end: z.object({
|
|
153
|
+
line: z.number(),
|
|
154
|
+
column: z.number()
|
|
155
|
+
})
|
|
156
|
+
}).optional()
|
|
157
|
+
}).optional();
|
|
158
|
+
const mixinValue = z.lazy(() => z.array(z.discriminatedUnion("type", [z.object({
|
|
159
|
+
type: z.literal("text"),
|
|
160
|
+
value: z.string()
|
|
161
|
+
}), z.object({
|
|
162
|
+
type: z.literal("function"),
|
|
163
|
+
name: z.string(),
|
|
164
|
+
value: mixinValue
|
|
165
|
+
})])));
|
|
166
|
+
const mixinNode = z.lazy(() => z.discriminatedUnion("type", [
|
|
167
|
+
z.object({
|
|
168
|
+
type: z.literal("declaration"),
|
|
169
|
+
property: z.string(),
|
|
170
|
+
value: mixinValue,
|
|
171
|
+
source: mixinSource
|
|
172
|
+
}),
|
|
173
|
+
z.object({
|
|
174
|
+
type: z.literal("rule"),
|
|
175
|
+
selector: z.string(),
|
|
176
|
+
body: z.array(mixinNode)
|
|
177
|
+
}),
|
|
178
|
+
z.object({
|
|
179
|
+
type: z.literal("condition"),
|
|
180
|
+
condition: z.string(),
|
|
181
|
+
body: z.array(mixinNode)
|
|
182
|
+
}),
|
|
183
|
+
z.object({
|
|
184
|
+
type: z.literal("apply"),
|
|
185
|
+
name: z.string(),
|
|
186
|
+
arguments: z.array(mixinValue),
|
|
187
|
+
contents: z.array(mixinNode).optional(),
|
|
188
|
+
source: mixinSource
|
|
189
|
+
}),
|
|
190
|
+
z.object({
|
|
191
|
+
type: z.literal("contents"),
|
|
192
|
+
fallback: z.array(mixinNode)
|
|
193
|
+
})
|
|
194
|
+
]));
|
|
195
|
+
const mixin = z.object({
|
|
196
|
+
name: z.string(),
|
|
197
|
+
parameters: z.array(z.object({
|
|
198
|
+
name: z.string(),
|
|
199
|
+
syntax: z.enum([
|
|
200
|
+
"integer",
|
|
201
|
+
"number",
|
|
202
|
+
"string",
|
|
203
|
+
"custom-ident"
|
|
204
|
+
]).optional(),
|
|
205
|
+
default: z.string().optional(),
|
|
206
|
+
source: mixinSource
|
|
207
|
+
})),
|
|
208
|
+
body: z.array(mixinNode),
|
|
209
|
+
source: mixinSource
|
|
210
|
+
});
|
|
211
|
+
const mediaQuery = z.lazy(() => z.union([
|
|
212
|
+
z.object({ type: z.enum(["true", "false"]) }),
|
|
213
|
+
z.object({
|
|
214
|
+
type: z.literal("feature"),
|
|
215
|
+
value: z.string()
|
|
216
|
+
}),
|
|
217
|
+
z.object({
|
|
218
|
+
type: z.literal("media-type"),
|
|
219
|
+
name: z.string()
|
|
220
|
+
}),
|
|
221
|
+
z.object({
|
|
222
|
+
type: z.literal("not"),
|
|
223
|
+
query: mediaQuery
|
|
224
|
+
}),
|
|
225
|
+
z.object({
|
|
226
|
+
type: z.enum(["and", "or"]),
|
|
227
|
+
queries: z.array(mediaQuery)
|
|
228
|
+
})
|
|
229
|
+
]));
|
|
230
|
+
const manifestResults = z.object({
|
|
231
|
+
tokens: z.array(variable),
|
|
232
|
+
mixins: z.array(mixin),
|
|
233
|
+
utilities: z.array(mixin.extend({ kind: z.enum([
|
|
234
|
+
"static",
|
|
235
|
+
"token",
|
|
236
|
+
"function"
|
|
237
|
+
]) })),
|
|
238
|
+
customMedia: z.array(z.object({
|
|
239
|
+
name: z.string(),
|
|
240
|
+
expression: mediaQuery
|
|
241
|
+
})),
|
|
242
|
+
customContainers: z.array(z.object({
|
|
243
|
+
name: z.string(),
|
|
244
|
+
condition: z.string()
|
|
245
|
+
})),
|
|
246
|
+
families: z.array(z.object({
|
|
247
|
+
type: z.literal("token-family"),
|
|
248
|
+
utility: z.string(),
|
|
249
|
+
prefix: z.string(),
|
|
250
|
+
namespace: z.string(),
|
|
251
|
+
argument: z.enum(["value", "key"]),
|
|
252
|
+
properties: strings
|
|
253
|
+
}))
|
|
254
|
+
});
|
|
255
|
+
const change = z.object({
|
|
256
|
+
filePath: z.string(),
|
|
257
|
+
beforeHash: z.string().nullable(),
|
|
258
|
+
afterHash: z.string(),
|
|
259
|
+
beforeExists: z.boolean(),
|
|
260
|
+
beforeBytes: z.number(),
|
|
261
|
+
afterBytes: z.number(),
|
|
262
|
+
afterText: z.string(),
|
|
263
|
+
diff: z.string()
|
|
264
|
+
});
|
|
265
|
+
const completion = z.object({
|
|
266
|
+
label: z.string(),
|
|
267
|
+
kind: z.number().optional(),
|
|
268
|
+
detail: z.string().optional(),
|
|
269
|
+
insertText: z.string().optional(),
|
|
270
|
+
sortText: z.string().optional(),
|
|
271
|
+
documentation: z.union([z.string(), z.object({
|
|
272
|
+
kind: z.string(),
|
|
273
|
+
value: z.string()
|
|
274
|
+
})]).optional()
|
|
275
|
+
}).passthrough();
|
|
276
|
+
const classDiff = z.object({
|
|
277
|
+
added: strings,
|
|
278
|
+
removed: strings,
|
|
279
|
+
unchanged: strings
|
|
280
|
+
});
|
|
281
|
+
const ruleDiff = z.object({
|
|
282
|
+
added: strings,
|
|
283
|
+
removed: strings,
|
|
284
|
+
unchanged: z.number()
|
|
285
|
+
});
|
|
286
|
+
export { browserSupport, change, classDiff, completion, cssStatus, diagnostic, envelopeMetadata, inspection, manifestResults, matchStatus, metadata, mixin, range, rule, ruleDiff, strings, variable, versions };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
1
|
import MasterCSSMCPContext, { MasterCSSMCPContextOptions } from "./context.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
context: MasterCSSMCPContext;
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
declare class MasterCSSMCPServer {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(server: McpServer, context: MasterCSSMCPContext);
|
|
6
|
+
connect(transport: Parameters<McpServer['connect']>[0]): Promise<void>;
|
|
7
|
+
dispose(): Promise<void>;
|
|
8
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
7
9
|
}
|
|
8
|
-
declare function createMasterCSSMCPServer(options?: MasterCSSMCPContextOptions):
|
|
9
|
-
declare function
|
|
10
|
-
|
|
11
|
-
export { MasterCSSMCPServerInstance, createMasterCSSMCPServer, startStdioServer };
|
|
10
|
+
declare function createMasterCSSMCPServer(options?: MasterCSSMCPContextOptions): MasterCSSMCPServer;
|
|
11
|
+
declare function startMasterCSSMCPStdioServer(options?: MasterCSSMCPContextOptions): Promise<MasterCSSMCPServer>;
|
|
12
|
+
export { createMasterCSSMCPServer, startMasterCSSMCPStdioServer };
|