@a1st/aix-schema 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/dist/aix.d.ts +51 -0
- package/dist/aix.d.ts.map +1 -0
- package/dist/aix.js +39 -0
- package/dist/aix.js.map +1 -0
- package/dist/config.d.ts +12130 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +36 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +17 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +34 -0
- package/dist/core.js.map +1 -0
- package/dist/editors.d.ts +3288 -0
- package/dist/editors.d.ts.map +1 -0
- package/dist/editors.js +52 -0
- package/dist/editors.js.map +1 -0
- package/dist/factory.d.ts +7 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +15 -0
- package/dist/factory.js.map +1 -0
- package/dist/hooks.d.ts +106 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +50 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/jsonc.d.ts +10 -0
- package/dist/jsonc.d.ts.map +1 -0
- package/dist/jsonc.js +16 -0
- package/dist/jsonc.js.map +1 -0
- package/dist/mcp.d.ts +508 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +92 -0
- package/dist/mcp.js.map +1 -0
- package/dist/migrate.d.ts +11 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +24 -0
- package/dist/migrate.js.map +1 -0
- package/dist/normalize.d.ts +36 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/normalize.js +143 -0
- package/dist/normalize.js.map +1 -0
- package/dist/prompts.d.ts +297 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +50 -0
- package/dist/prompts.js.map +1 -0
- package/dist/references.d.ts +60 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +23 -0
- package/dist/references.js.map +1 -0
- package/dist/rules.d.ts +534 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +85 -0
- package/dist/rules.js.map +1 -0
- package/dist/skill.d.ts +38 -0
- package/dist/skill.d.ts.map +1 -0
- package/dist/skill.js +18 -0
- package/dist/skill.js.map +1 -0
- package/dist/skills.d.ts +183 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +26 -0
- package/dist/skills.js.map +1 -0
- package/dist/validate.d.ts +17 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +34 -0
- package/dist/validate.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +42 -0
- package/schema.json +1408 -0
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Environment variable value. Use ${VAR_NAME} for dynamic resolution.
|
|
4
|
+
*/
|
|
5
|
+
export declare const envVarSchema: z.ZodString;
|
|
6
|
+
/**
|
|
7
|
+
* Stdio MCP server transport config.
|
|
8
|
+
* Type is inferred from presence of `command` field.
|
|
9
|
+
*/
|
|
10
|
+
export declare const stdioConfigSchema: z.ZodObject<{
|
|
11
|
+
command: z.ZodString;
|
|
12
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
13
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
15
|
+
shell: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
command: string;
|
|
18
|
+
args?: string[] | undefined;
|
|
19
|
+
env?: Record<string, string> | undefined;
|
|
20
|
+
cwd?: string | undefined;
|
|
21
|
+
shell?: boolean | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
command: string;
|
|
24
|
+
args?: string[] | undefined;
|
|
25
|
+
env?: Record<string, string> | undefined;
|
|
26
|
+
cwd?: string | undefined;
|
|
27
|
+
shell?: boolean | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* HTTP MCP server transport config.
|
|
31
|
+
* Type is inferred from presence of `url` field without `command`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const httpConfigSchema: z.ZodObject<{
|
|
34
|
+
url: z.ZodString;
|
|
35
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
36
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
validateOrigin: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
url: string;
|
|
40
|
+
headers?: Record<string, string> | undefined;
|
|
41
|
+
timeout?: number | undefined;
|
|
42
|
+
validateOrigin?: boolean | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
url: string;
|
|
45
|
+
headers?: Record<string, string> | undefined;
|
|
46
|
+
timeout?: number | undefined;
|
|
47
|
+
validateOrigin?: boolean | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Tool filter - either an array of allowed tool names or include/exclude object
|
|
51
|
+
*/
|
|
52
|
+
export declare const toolFilterSchema: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
53
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
54
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
include?: string[] | undefined;
|
|
57
|
+
exclude?: string[] | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
include?: string[] | undefined;
|
|
60
|
+
exclude?: string[] | undefined;
|
|
61
|
+
}>]>;
|
|
62
|
+
/**
|
|
63
|
+
* Resource filter - either an array of allowed patterns or include/exclude object
|
|
64
|
+
*/
|
|
65
|
+
export declare const resourceFilterSchema: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
66
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
67
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
include?: string[] | undefined;
|
|
70
|
+
exclude?: string[] | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
include?: string[] | undefined;
|
|
73
|
+
exclude?: string[] | undefined;
|
|
74
|
+
}>]>;
|
|
75
|
+
/**
|
|
76
|
+
* Stdio MCP server config (command/args at top level).
|
|
77
|
+
*/
|
|
78
|
+
export declare const mcpServerConfigStdioSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
79
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
81
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
82
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
include?: string[] | undefined;
|
|
85
|
+
exclude?: string[] | undefined;
|
|
86
|
+
}, {
|
|
87
|
+
include?: string[] | undefined;
|
|
88
|
+
exclude?: string[] | undefined;
|
|
89
|
+
}>]>>;
|
|
90
|
+
disabledTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
91
|
+
resources: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
92
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
93
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
include?: string[] | undefined;
|
|
96
|
+
exclude?: string[] | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
include?: string[] | undefined;
|
|
99
|
+
exclude?: string[] | undefined;
|
|
100
|
+
}>]>>;
|
|
101
|
+
autoStart: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
restartOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
maxRestarts: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
}, {
|
|
105
|
+
command: z.ZodString;
|
|
106
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
107
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
108
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
109
|
+
shell: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
}>, "strip", z.ZodTypeAny, {
|
|
111
|
+
command: string;
|
|
112
|
+
enabled?: boolean | undefined;
|
|
113
|
+
args?: string[] | undefined;
|
|
114
|
+
env?: Record<string, string> | undefined;
|
|
115
|
+
cwd?: string | undefined;
|
|
116
|
+
shell?: boolean | undefined;
|
|
117
|
+
tools?: string[] | {
|
|
118
|
+
include?: string[] | undefined;
|
|
119
|
+
exclude?: string[] | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
disabledTools?: string[] | undefined;
|
|
122
|
+
resources?: string[] | {
|
|
123
|
+
include?: string[] | undefined;
|
|
124
|
+
exclude?: string[] | undefined;
|
|
125
|
+
} | undefined;
|
|
126
|
+
autoStart?: boolean | undefined;
|
|
127
|
+
restartOnFailure?: boolean | undefined;
|
|
128
|
+
maxRestarts?: number | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
command: string;
|
|
131
|
+
enabled?: boolean | undefined;
|
|
132
|
+
args?: string[] | undefined;
|
|
133
|
+
env?: Record<string, string> | undefined;
|
|
134
|
+
cwd?: string | undefined;
|
|
135
|
+
shell?: boolean | undefined;
|
|
136
|
+
tools?: string[] | {
|
|
137
|
+
include?: string[] | undefined;
|
|
138
|
+
exclude?: string[] | undefined;
|
|
139
|
+
} | undefined;
|
|
140
|
+
disabledTools?: string[] | undefined;
|
|
141
|
+
resources?: string[] | {
|
|
142
|
+
include?: string[] | undefined;
|
|
143
|
+
exclude?: string[] | undefined;
|
|
144
|
+
} | undefined;
|
|
145
|
+
autoStart?: boolean | undefined;
|
|
146
|
+
restartOnFailure?: boolean | undefined;
|
|
147
|
+
maxRestarts?: number | undefined;
|
|
148
|
+
}>;
|
|
149
|
+
/**
|
|
150
|
+
* HTTP MCP server config (url at top level).
|
|
151
|
+
*/
|
|
152
|
+
export declare const mcpServerConfigHttpSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
153
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
155
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
156
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
include?: string[] | undefined;
|
|
159
|
+
exclude?: string[] | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
include?: string[] | undefined;
|
|
162
|
+
exclude?: string[] | undefined;
|
|
163
|
+
}>]>>;
|
|
164
|
+
disabledTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
165
|
+
resources: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
166
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
167
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
include?: string[] | undefined;
|
|
170
|
+
exclude?: string[] | undefined;
|
|
171
|
+
}, {
|
|
172
|
+
include?: string[] | undefined;
|
|
173
|
+
exclude?: string[] | undefined;
|
|
174
|
+
}>]>>;
|
|
175
|
+
autoStart: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
restartOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
maxRestarts: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
}, {
|
|
179
|
+
url: z.ZodString;
|
|
180
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
181
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
validateOrigin: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
}>, "strip", z.ZodTypeAny, {
|
|
184
|
+
url: string;
|
|
185
|
+
enabled?: boolean | undefined;
|
|
186
|
+
headers?: Record<string, string> | undefined;
|
|
187
|
+
timeout?: number | undefined;
|
|
188
|
+
validateOrigin?: boolean | undefined;
|
|
189
|
+
tools?: string[] | {
|
|
190
|
+
include?: string[] | undefined;
|
|
191
|
+
exclude?: string[] | undefined;
|
|
192
|
+
} | undefined;
|
|
193
|
+
disabledTools?: string[] | undefined;
|
|
194
|
+
resources?: string[] | {
|
|
195
|
+
include?: string[] | undefined;
|
|
196
|
+
exclude?: string[] | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
autoStart?: boolean | undefined;
|
|
199
|
+
restartOnFailure?: boolean | undefined;
|
|
200
|
+
maxRestarts?: number | undefined;
|
|
201
|
+
}, {
|
|
202
|
+
url: string;
|
|
203
|
+
enabled?: boolean | undefined;
|
|
204
|
+
headers?: Record<string, string> | undefined;
|
|
205
|
+
timeout?: number | undefined;
|
|
206
|
+
validateOrigin?: boolean | undefined;
|
|
207
|
+
tools?: string[] | {
|
|
208
|
+
include?: string[] | undefined;
|
|
209
|
+
exclude?: string[] | undefined;
|
|
210
|
+
} | undefined;
|
|
211
|
+
disabledTools?: string[] | undefined;
|
|
212
|
+
resources?: string[] | {
|
|
213
|
+
include?: string[] | undefined;
|
|
214
|
+
exclude?: string[] | undefined;
|
|
215
|
+
} | undefined;
|
|
216
|
+
autoStart?: boolean | undefined;
|
|
217
|
+
restartOnFailure?: boolean | undefined;
|
|
218
|
+
maxRestarts?: number | undefined;
|
|
219
|
+
}>;
|
|
220
|
+
/**
|
|
221
|
+
* MCP server config.
|
|
222
|
+
* - Stdio: { command: "...", args: [...] }
|
|
223
|
+
* - HTTP: { url: "https://..." }
|
|
224
|
+
*/
|
|
225
|
+
export declare const mcpServerConfigSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
226
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
227
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
228
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
229
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
include?: string[] | undefined;
|
|
232
|
+
exclude?: string[] | undefined;
|
|
233
|
+
}, {
|
|
234
|
+
include?: string[] | undefined;
|
|
235
|
+
exclude?: string[] | undefined;
|
|
236
|
+
}>]>>;
|
|
237
|
+
disabledTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
238
|
+
resources: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
239
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
240
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
241
|
+
}, "strip", z.ZodTypeAny, {
|
|
242
|
+
include?: string[] | undefined;
|
|
243
|
+
exclude?: string[] | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
include?: string[] | undefined;
|
|
246
|
+
exclude?: string[] | undefined;
|
|
247
|
+
}>]>>;
|
|
248
|
+
autoStart: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
restartOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
maxRestarts: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
}, {
|
|
252
|
+
command: z.ZodString;
|
|
253
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
254
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
255
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
256
|
+
shell: z.ZodOptional<z.ZodBoolean>;
|
|
257
|
+
}>, "strip", z.ZodTypeAny, {
|
|
258
|
+
command: string;
|
|
259
|
+
enabled?: boolean | undefined;
|
|
260
|
+
args?: string[] | undefined;
|
|
261
|
+
env?: Record<string, string> | undefined;
|
|
262
|
+
cwd?: string | undefined;
|
|
263
|
+
shell?: boolean | undefined;
|
|
264
|
+
tools?: string[] | {
|
|
265
|
+
include?: string[] | undefined;
|
|
266
|
+
exclude?: string[] | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
disabledTools?: string[] | undefined;
|
|
269
|
+
resources?: string[] | {
|
|
270
|
+
include?: string[] | undefined;
|
|
271
|
+
exclude?: string[] | undefined;
|
|
272
|
+
} | undefined;
|
|
273
|
+
autoStart?: boolean | undefined;
|
|
274
|
+
restartOnFailure?: boolean | undefined;
|
|
275
|
+
maxRestarts?: number | undefined;
|
|
276
|
+
}, {
|
|
277
|
+
command: string;
|
|
278
|
+
enabled?: boolean | undefined;
|
|
279
|
+
args?: string[] | undefined;
|
|
280
|
+
env?: Record<string, string> | undefined;
|
|
281
|
+
cwd?: string | undefined;
|
|
282
|
+
shell?: boolean | undefined;
|
|
283
|
+
tools?: string[] | {
|
|
284
|
+
include?: string[] | undefined;
|
|
285
|
+
exclude?: string[] | undefined;
|
|
286
|
+
} | undefined;
|
|
287
|
+
disabledTools?: string[] | undefined;
|
|
288
|
+
resources?: string[] | {
|
|
289
|
+
include?: string[] | undefined;
|
|
290
|
+
exclude?: string[] | undefined;
|
|
291
|
+
} | undefined;
|
|
292
|
+
autoStart?: boolean | undefined;
|
|
293
|
+
restartOnFailure?: boolean | undefined;
|
|
294
|
+
maxRestarts?: number | undefined;
|
|
295
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
296
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
297
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
298
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
299
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
300
|
+
}, "strip", z.ZodTypeAny, {
|
|
301
|
+
include?: string[] | undefined;
|
|
302
|
+
exclude?: string[] | undefined;
|
|
303
|
+
}, {
|
|
304
|
+
include?: string[] | undefined;
|
|
305
|
+
exclude?: string[] | undefined;
|
|
306
|
+
}>]>>;
|
|
307
|
+
disabledTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
308
|
+
resources: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
309
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
310
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
311
|
+
}, "strip", z.ZodTypeAny, {
|
|
312
|
+
include?: string[] | undefined;
|
|
313
|
+
exclude?: string[] | undefined;
|
|
314
|
+
}, {
|
|
315
|
+
include?: string[] | undefined;
|
|
316
|
+
exclude?: string[] | undefined;
|
|
317
|
+
}>]>>;
|
|
318
|
+
autoStart: z.ZodOptional<z.ZodBoolean>;
|
|
319
|
+
restartOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
320
|
+
maxRestarts: z.ZodOptional<z.ZodNumber>;
|
|
321
|
+
}, {
|
|
322
|
+
url: z.ZodString;
|
|
323
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
324
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
325
|
+
validateOrigin: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
}>, "strip", z.ZodTypeAny, {
|
|
327
|
+
url: string;
|
|
328
|
+
enabled?: boolean | undefined;
|
|
329
|
+
headers?: Record<string, string> | undefined;
|
|
330
|
+
timeout?: number | undefined;
|
|
331
|
+
validateOrigin?: boolean | undefined;
|
|
332
|
+
tools?: string[] | {
|
|
333
|
+
include?: string[] | undefined;
|
|
334
|
+
exclude?: string[] | undefined;
|
|
335
|
+
} | undefined;
|
|
336
|
+
disabledTools?: string[] | undefined;
|
|
337
|
+
resources?: string[] | {
|
|
338
|
+
include?: string[] | undefined;
|
|
339
|
+
exclude?: string[] | undefined;
|
|
340
|
+
} | undefined;
|
|
341
|
+
autoStart?: boolean | undefined;
|
|
342
|
+
restartOnFailure?: boolean | undefined;
|
|
343
|
+
maxRestarts?: number | undefined;
|
|
344
|
+
}, {
|
|
345
|
+
url: string;
|
|
346
|
+
enabled?: boolean | undefined;
|
|
347
|
+
headers?: Record<string, string> | undefined;
|
|
348
|
+
timeout?: number | undefined;
|
|
349
|
+
validateOrigin?: boolean | undefined;
|
|
350
|
+
tools?: string[] | {
|
|
351
|
+
include?: string[] | undefined;
|
|
352
|
+
exclude?: string[] | undefined;
|
|
353
|
+
} | undefined;
|
|
354
|
+
disabledTools?: string[] | undefined;
|
|
355
|
+
resources?: string[] | {
|
|
356
|
+
include?: string[] | undefined;
|
|
357
|
+
exclude?: string[] | undefined;
|
|
358
|
+
} | undefined;
|
|
359
|
+
autoStart?: boolean | undefined;
|
|
360
|
+
restartOnFailure?: boolean | undefined;
|
|
361
|
+
maxRestarts?: number | undefined;
|
|
362
|
+
}>]>;
|
|
363
|
+
export declare const mcpSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
364
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
365
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
366
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
367
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
368
|
+
}, "strip", z.ZodTypeAny, {
|
|
369
|
+
include?: string[] | undefined;
|
|
370
|
+
exclude?: string[] | undefined;
|
|
371
|
+
}, {
|
|
372
|
+
include?: string[] | undefined;
|
|
373
|
+
exclude?: string[] | undefined;
|
|
374
|
+
}>]>>;
|
|
375
|
+
disabledTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
376
|
+
resources: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
377
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
378
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
379
|
+
}, "strip", z.ZodTypeAny, {
|
|
380
|
+
include?: string[] | undefined;
|
|
381
|
+
exclude?: string[] | undefined;
|
|
382
|
+
}, {
|
|
383
|
+
include?: string[] | undefined;
|
|
384
|
+
exclude?: string[] | undefined;
|
|
385
|
+
}>]>>;
|
|
386
|
+
autoStart: z.ZodOptional<z.ZodBoolean>;
|
|
387
|
+
restartOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
388
|
+
maxRestarts: z.ZodOptional<z.ZodNumber>;
|
|
389
|
+
}, {
|
|
390
|
+
command: z.ZodString;
|
|
391
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
392
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
393
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
394
|
+
shell: z.ZodOptional<z.ZodBoolean>;
|
|
395
|
+
}>, "strip", z.ZodTypeAny, {
|
|
396
|
+
command: string;
|
|
397
|
+
enabled?: boolean | undefined;
|
|
398
|
+
args?: string[] | undefined;
|
|
399
|
+
env?: Record<string, string> | undefined;
|
|
400
|
+
cwd?: string | undefined;
|
|
401
|
+
shell?: boolean | undefined;
|
|
402
|
+
tools?: string[] | {
|
|
403
|
+
include?: string[] | undefined;
|
|
404
|
+
exclude?: string[] | undefined;
|
|
405
|
+
} | undefined;
|
|
406
|
+
disabledTools?: string[] | undefined;
|
|
407
|
+
resources?: string[] | {
|
|
408
|
+
include?: string[] | undefined;
|
|
409
|
+
exclude?: string[] | undefined;
|
|
410
|
+
} | undefined;
|
|
411
|
+
autoStart?: boolean | undefined;
|
|
412
|
+
restartOnFailure?: boolean | undefined;
|
|
413
|
+
maxRestarts?: number | undefined;
|
|
414
|
+
}, {
|
|
415
|
+
command: string;
|
|
416
|
+
enabled?: boolean | undefined;
|
|
417
|
+
args?: string[] | undefined;
|
|
418
|
+
env?: Record<string, string> | undefined;
|
|
419
|
+
cwd?: string | undefined;
|
|
420
|
+
shell?: boolean | undefined;
|
|
421
|
+
tools?: string[] | {
|
|
422
|
+
include?: string[] | undefined;
|
|
423
|
+
exclude?: string[] | undefined;
|
|
424
|
+
} | undefined;
|
|
425
|
+
disabledTools?: string[] | undefined;
|
|
426
|
+
resources?: string[] | {
|
|
427
|
+
include?: string[] | undefined;
|
|
428
|
+
exclude?: string[] | undefined;
|
|
429
|
+
} | undefined;
|
|
430
|
+
autoStart?: boolean | undefined;
|
|
431
|
+
restartOnFailure?: boolean | undefined;
|
|
432
|
+
maxRestarts?: number | undefined;
|
|
433
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
434
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
435
|
+
tools: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
436
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
437
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
438
|
+
}, "strip", z.ZodTypeAny, {
|
|
439
|
+
include?: string[] | undefined;
|
|
440
|
+
exclude?: string[] | undefined;
|
|
441
|
+
}, {
|
|
442
|
+
include?: string[] | undefined;
|
|
443
|
+
exclude?: string[] | undefined;
|
|
444
|
+
}>]>>;
|
|
445
|
+
disabledTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
446
|
+
resources: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
|
|
447
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
448
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
449
|
+
}, "strip", z.ZodTypeAny, {
|
|
450
|
+
include?: string[] | undefined;
|
|
451
|
+
exclude?: string[] | undefined;
|
|
452
|
+
}, {
|
|
453
|
+
include?: string[] | undefined;
|
|
454
|
+
exclude?: string[] | undefined;
|
|
455
|
+
}>]>>;
|
|
456
|
+
autoStart: z.ZodOptional<z.ZodBoolean>;
|
|
457
|
+
restartOnFailure: z.ZodOptional<z.ZodBoolean>;
|
|
458
|
+
maxRestarts: z.ZodOptional<z.ZodNumber>;
|
|
459
|
+
}, {
|
|
460
|
+
url: z.ZodString;
|
|
461
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
462
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
463
|
+
validateOrigin: z.ZodOptional<z.ZodBoolean>;
|
|
464
|
+
}>, "strip", z.ZodTypeAny, {
|
|
465
|
+
url: string;
|
|
466
|
+
enabled?: boolean | undefined;
|
|
467
|
+
headers?: Record<string, string> | undefined;
|
|
468
|
+
timeout?: number | undefined;
|
|
469
|
+
validateOrigin?: boolean | undefined;
|
|
470
|
+
tools?: string[] | {
|
|
471
|
+
include?: string[] | undefined;
|
|
472
|
+
exclude?: string[] | undefined;
|
|
473
|
+
} | undefined;
|
|
474
|
+
disabledTools?: string[] | undefined;
|
|
475
|
+
resources?: string[] | {
|
|
476
|
+
include?: string[] | undefined;
|
|
477
|
+
exclude?: string[] | undefined;
|
|
478
|
+
} | undefined;
|
|
479
|
+
autoStart?: boolean | undefined;
|
|
480
|
+
restartOnFailure?: boolean | undefined;
|
|
481
|
+
maxRestarts?: number | undefined;
|
|
482
|
+
}, {
|
|
483
|
+
url: string;
|
|
484
|
+
enabled?: boolean | undefined;
|
|
485
|
+
headers?: Record<string, string> | undefined;
|
|
486
|
+
timeout?: number | undefined;
|
|
487
|
+
validateOrigin?: boolean | undefined;
|
|
488
|
+
tools?: string[] | {
|
|
489
|
+
include?: string[] | undefined;
|
|
490
|
+
exclude?: string[] | undefined;
|
|
491
|
+
} | undefined;
|
|
492
|
+
disabledTools?: string[] | undefined;
|
|
493
|
+
resources?: string[] | {
|
|
494
|
+
include?: string[] | undefined;
|
|
495
|
+
exclude?: string[] | undefined;
|
|
496
|
+
} | undefined;
|
|
497
|
+
autoStart?: boolean | undefined;
|
|
498
|
+
restartOnFailure?: boolean | undefined;
|
|
499
|
+
maxRestarts?: number | undefined;
|
|
500
|
+
}>]>, z.ZodLiteral<false>]>>;
|
|
501
|
+
export type StdioConfig = z.infer<typeof stdioConfigSchema>;
|
|
502
|
+
export type HttpConfig = z.infer<typeof httpConfigSchema>;
|
|
503
|
+
export type McpServerConfigStdio = z.infer<typeof mcpServerConfigStdioSchema>;
|
|
504
|
+
export type McpServerConfigHttp = z.infer<typeof mcpServerConfigHttpSchema>;
|
|
505
|
+
export type ToolFilter = z.infer<typeof toolFilterSchema>;
|
|
506
|
+
export type ResourceFilter = z.infer<typeof resourceFilterSchema>;
|
|
507
|
+
export type McpServerConfig = z.infer<typeof mcpServerConfigSchema>;
|
|
508
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,YAAY,aAE0D,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAK3B,CAAC;AAEH;;G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,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Environment variable value. Use ${VAR_NAME} for dynamic resolution.
|
|
4
|
+
*/
|
|
5
|
+
export const envVarSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.describe('Environment variable value. Use ${VAR_NAME} for dynamic resolution.');
|
|
8
|
+
/**
|
|
9
|
+
* Stdio MCP server transport config.
|
|
10
|
+
* Type is inferred from presence of `command` field.
|
|
11
|
+
*/
|
|
12
|
+
export const stdioConfigSchema = z.object({
|
|
13
|
+
command: z.string().describe('Command to execute'),
|
|
14
|
+
args: z.array(z.string()).optional().describe('Command arguments'),
|
|
15
|
+
env: z.record(envVarSchema).optional().describe('Environment variables'),
|
|
16
|
+
cwd: z.string().optional().describe('Working directory'),
|
|
17
|
+
shell: z.boolean().optional().describe('Run in shell'),
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* HTTP MCP server transport config.
|
|
21
|
+
* Type is inferred from presence of `url` field without `command`.
|
|
22
|
+
*/
|
|
23
|
+
export const httpConfigSchema = z.object({
|
|
24
|
+
url: z.string().url().describe('MCP endpoint URL (Streamable HTTP)'),
|
|
25
|
+
headers: z.record(envVarSchema).optional().describe('HTTP headers'),
|
|
26
|
+
timeout: z.number().positive().optional().describe('Connection timeout (ms)'),
|
|
27
|
+
validateOrigin: z.boolean().optional().describe('Validate Origin header (security)'),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Tool filter - either an array of allowed tool names or include/exclude object
|
|
31
|
+
*/
|
|
32
|
+
export const toolFilterSchema = z.union([
|
|
33
|
+
z.array(z.string()).describe('Allowed tool names'),
|
|
34
|
+
z.object({
|
|
35
|
+
include: z.array(z.string()).optional().describe('Tools to include'),
|
|
36
|
+
exclude: z.array(z.string()).optional().describe('Tools to exclude'),
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* Resource filter - either an array of allowed patterns or include/exclude object
|
|
41
|
+
*/
|
|
42
|
+
export const resourceFilterSchema = z.union([
|
|
43
|
+
z.array(z.string()).describe('Allowed resource patterns (glob)'),
|
|
44
|
+
z.object({
|
|
45
|
+
include: z.array(z.string()).optional().describe('Resource patterns to include'),
|
|
46
|
+
exclude: z.array(z.string()).optional().describe('Resource patterns to exclude'),
|
|
47
|
+
}),
|
|
48
|
+
]);
|
|
49
|
+
/**
|
|
50
|
+
* Common MCP server options (non-transport).
|
|
51
|
+
*/
|
|
52
|
+
const mcpServerOptionsSchema = z.object({
|
|
53
|
+
enabled: z.boolean().optional().describe('Whether server is active (default: true)'),
|
|
54
|
+
tools: toolFilterSchema.optional().describe('Tool access control'),
|
|
55
|
+
disabledTools: z.array(z.string()).optional().describe('Tools to disable (Windsurf format)'),
|
|
56
|
+
resources: resourceFilterSchema.optional().describe('Resource access control'),
|
|
57
|
+
autoStart: z.boolean().optional().describe('Start with editor (default: true)'),
|
|
58
|
+
restartOnFailure: z.boolean().optional().describe('Auto-restart on crash (default: true)'),
|
|
59
|
+
maxRestarts: z.number().int().positive().optional().describe('Max restart attempts (default: 3)'),
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Stdio MCP server config (command/args at top level).
|
|
63
|
+
*/
|
|
64
|
+
export const mcpServerConfigStdioSchema = mcpServerOptionsSchema.extend({
|
|
65
|
+
command: z.string().describe('Command to execute'),
|
|
66
|
+
args: z.array(z.string()).optional().describe('Command arguments'),
|
|
67
|
+
env: z.record(envVarSchema).optional().describe('Environment variables'),
|
|
68
|
+
cwd: z.string().optional().describe('Working directory'),
|
|
69
|
+
shell: z.boolean().optional().describe('Run in shell'),
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* HTTP MCP server config (url at top level).
|
|
73
|
+
*/
|
|
74
|
+
export const mcpServerConfigHttpSchema = mcpServerOptionsSchema.extend({
|
|
75
|
+
url: z.string().url().describe('MCP endpoint URL (Streamable HTTP)'),
|
|
76
|
+
headers: z.record(envVarSchema).optional().describe('HTTP headers'),
|
|
77
|
+
timeout: z.number().positive().optional().describe('Connection timeout (ms)'),
|
|
78
|
+
validateOrigin: z.boolean().optional().describe('Validate Origin header (security)'),
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* MCP server config.
|
|
82
|
+
* - Stdio: { command: "...", args: [...] }
|
|
83
|
+
* - HTTP: { url: "https://..." }
|
|
84
|
+
*/
|
|
85
|
+
export const mcpServerConfigSchema = z.union([
|
|
86
|
+
mcpServerConfigStdioSchema,
|
|
87
|
+
mcpServerConfigHttpSchema,
|
|
88
|
+
]);
|
|
89
|
+
export const mcpSchema = z
|
|
90
|
+
.record(z.string().min(1).describe('Server identifier'), z.union([mcpServerConfigSchema, z.literal(false)]))
|
|
91
|
+
.describe('Map of MCP server names to configurations (or false to disable)');
|
|
92
|
+
//# sourceMappingURL=mcp.js.map
|
package/dist/mcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KACzB,MAAM,EAAE;KACR,QAAQ,CAAC,qEAAqE,CAAC,CAAC;AAEpF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAClD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EA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H;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1C,0BAA0B;IAC1B,yBAAyB;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC;KACtB,MAAM,CACJ,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAC/C,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CACpD;KACA,QAAQ,CAAC,iEAAiE,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface MigrationResult {
|
|
2
|
+
migrated: boolean;
|
|
3
|
+
fromVersion: string;
|
|
4
|
+
toVersion: string;
|
|
5
|
+
config: unknown;
|
|
6
|
+
warnings: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function detectSchemaVersion(config: Record<string, unknown>): string;
|
|
9
|
+
export declare function needsMigration(config: Record<string, unknown>): boolean;
|
|
10
|
+
export declare function migrateConfig(config: Record<string, unknown>): MigrationResult;
|
|
11
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAU3E;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAIvE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe,CAY9E"}
|
package/dist/migrate.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SCHEMA_VERSION } from './version.js';
|
|
2
|
+
export function detectSchemaVersion(config) {
|
|
3
|
+
const schemaUrl = config.$schema;
|
|
4
|
+
if (!schemaUrl) {
|
|
5
|
+
return '1';
|
|
6
|
+
}
|
|
7
|
+
const match = schemaUrl.match(/\/v(\d+)\//);
|
|
8
|
+
return match?.[1] ?? '1';
|
|
9
|
+
}
|
|
10
|
+
export function needsMigration(config) {
|
|
11
|
+
const version = detectSchemaVersion(config);
|
|
12
|
+
return version !== SCHEMA_VERSION;
|
|
13
|
+
}
|
|
14
|
+
export function migrateConfig(config) {
|
|
15
|
+
const fromVersion = detectSchemaVersion(config), warnings = [], migrated = { ...config };
|
|
16
|
+
return {
|
|
17
|
+
migrated: fromVersion !== SCHEMA_VERSION,
|
|
18
|
+
fromVersion,
|
|
19
|
+
toVersion: SCHEMA_VERSION,
|
|
20
|
+
config: migrated,
|
|
21
|
+
warnings,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAU9C,MAAM,UAAU,mBAAmB,CAAC,MAA+B;IAChE,MAAM,SAAS,GAAG,MAAM,CAAC,OAA6B,CAAC;IAEvD,IAAI,CAAC,SAAS,EAAE,CAAC;QACd,OAAO,GAAG,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAE5C,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAA+B;IAC3D,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE5C,OAAO,OAAO,KAAK,cAAc,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAA+B;IAC1D,MAAM,WAAW,GAAG,mBAAmB,CAAC,MAAM,CAAC,EACzC,QAAQ,GAAa,EAAE,EACvB,QAAQ,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAE/B,OAAO;QACJ,QAAQ,EAAE,WAAW,KAAK,cAAc;QACxC,WAAW;QACX,SAAS,EAAE,cAAc;QACzB,MAAM,EAAE,QAAQ;QAChB,QAAQ;KACV,CAAC;AACL,CAAC"}
|