xmcp 1.8.0 → 1.10.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 +36 -12
- package/dist/client.js +1 -1
- package/dist/config/index.d.ts +14 -0
- package/dist/config/schemas/paths.d.ts +6 -0
- package/dist/config/schemas/transport/http.d.ts +16 -0
- package/dist/config/utils.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime/adapter-express.js +23 -23
- package/dist/runtime/adapter-fastify.js +23 -23
- package/dist/runtime/adapter-fetch-cloudflare.js +19 -19
- package/dist/runtime/adapter-fetch.js +14 -14
- package/dist/runtime/adapter-nestjs.js +17 -17
- package/dist/runtime/adapter-nextjs.js +23 -23
- package/dist/runtime/cloudflare-worker.js +26 -26
- package/dist/runtime/http.js +30 -30
- package/dist/runtime/stdio.js +16 -16
- package/dist/runtime/transports/http/base-streamable-http.d.ts +1 -0
- package/dist/runtime/utils/server.d.ts +1 -0
- package/dist/runtime/utils/skills.d.ts +11 -0
- package/dist/runtime/vercel.js +30 -30
- package/dist/types/skill.d.ts +26 -0
- package/package.json +3 -3
package/dist/config/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
26
26
|
bodySizeLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
27
27
|
debug: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
28
28
|
endpoint: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
29
|
+
maxSubscriptions: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
29
30
|
cors: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
30
31
|
origin: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean]>>>;
|
|
31
32
|
methods: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
@@ -68,6 +69,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
68
69
|
bodySizeLimit?: number | undefined;
|
|
69
70
|
debug?: boolean | undefined;
|
|
70
71
|
endpoint?: string | undefined;
|
|
72
|
+
maxSubscriptions?: number | undefined;
|
|
71
73
|
cors?: {
|
|
72
74
|
origin: string | boolean | string[];
|
|
73
75
|
methods: string | string[];
|
|
@@ -82,6 +84,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
82
84
|
bodySizeLimit?: number | undefined;
|
|
83
85
|
debug?: boolean | undefined;
|
|
84
86
|
endpoint?: string | undefined;
|
|
87
|
+
maxSubscriptions?: number | undefined;
|
|
85
88
|
cors?: {
|
|
86
89
|
origin?: string | boolean | string[] | undefined;
|
|
87
90
|
methods?: string | string[] | undefined;
|
|
@@ -104,12 +107,14 @@ export declare const configSchema: z.ZodObject<{
|
|
|
104
107
|
credentials: boolean;
|
|
105
108
|
maxAge: number;
|
|
106
109
|
};
|
|
110
|
+
maxSubscriptions?: number | undefined;
|
|
107
111
|
}, {
|
|
108
112
|
port?: number | undefined;
|
|
109
113
|
host?: string | undefined;
|
|
110
114
|
bodySizeLimit?: number | undefined;
|
|
111
115
|
debug?: boolean | undefined;
|
|
112
116
|
endpoint?: string | undefined;
|
|
117
|
+
maxSubscriptions?: number | undefined;
|
|
113
118
|
cors?: {
|
|
114
119
|
origin?: string | boolean | string[] | undefined;
|
|
115
120
|
methods?: string | string[] | undefined;
|
|
@@ -133,22 +138,27 @@ export declare const configSchema: z.ZodObject<{
|
|
|
133
138
|
tools: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
|
|
134
139
|
prompts: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
|
|
135
140
|
resources: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
|
|
141
|
+
skills: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
|
|
136
142
|
}, "strip", z.ZodTypeAny, {
|
|
137
143
|
tools?: string | boolean | undefined;
|
|
138
144
|
prompts?: string | boolean | undefined;
|
|
139
145
|
resources?: string | boolean | undefined;
|
|
146
|
+
skills?: string | boolean | undefined;
|
|
140
147
|
}, {
|
|
141
148
|
tools?: string | boolean | undefined;
|
|
142
149
|
prompts?: string | boolean | undefined;
|
|
143
150
|
resources?: string | boolean | undefined;
|
|
151
|
+
skills?: string | boolean | undefined;
|
|
144
152
|
}>, {
|
|
145
153
|
tools: string | boolean;
|
|
146
154
|
prompts: string | boolean;
|
|
147
155
|
resources: string | boolean;
|
|
156
|
+
skills: string | boolean;
|
|
148
157
|
}, {
|
|
149
158
|
tools?: string | boolean | undefined;
|
|
150
159
|
prompts?: string | boolean | undefined;
|
|
151
160
|
resources?: string | boolean | undefined;
|
|
161
|
+
skills?: string | boolean | undefined;
|
|
152
162
|
}>>;
|
|
153
163
|
bundler: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodAny>>>;
|
|
154
164
|
template: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
@@ -294,6 +304,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
294
304
|
credentials: boolean;
|
|
295
305
|
maxAge: number;
|
|
296
306
|
};
|
|
307
|
+
maxSubscriptions?: number | undefined;
|
|
297
308
|
} | undefined;
|
|
298
309
|
experimental?: {
|
|
299
310
|
adapter?: "express" | "nextjs" | "nestjs" | "fastify" | "tanstack" | "hono" | "sveltekit" | "nuxt" | "react-router" | "astro" | undefined;
|
|
@@ -303,6 +314,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
303
314
|
tools: string | boolean;
|
|
304
315
|
prompts: string | boolean;
|
|
305
316
|
resources: string | boolean;
|
|
317
|
+
skills: string | boolean;
|
|
306
318
|
} | undefined;
|
|
307
319
|
bundler?: ((args_0: any, ...args: unknown[]) => any) | undefined;
|
|
308
320
|
template?: {
|
|
@@ -344,6 +356,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
344
356
|
bodySizeLimit?: number | undefined;
|
|
345
357
|
debug?: boolean | undefined;
|
|
346
358
|
endpoint?: string | undefined;
|
|
359
|
+
maxSubscriptions?: number | undefined;
|
|
347
360
|
cors?: {
|
|
348
361
|
origin?: string | boolean | string[] | undefined;
|
|
349
362
|
methods?: string | string[] | undefined;
|
|
@@ -361,6 +374,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
361
374
|
tools?: string | boolean | undefined;
|
|
362
375
|
prompts?: string | boolean | undefined;
|
|
363
376
|
resources?: string | boolean | undefined;
|
|
377
|
+
skills?: string | boolean | undefined;
|
|
364
378
|
} | undefined;
|
|
365
379
|
bundler?: ((args_0: any, ...args: unknown[]) => any) | undefined;
|
|
366
380
|
template?: {
|
|
@@ -3,26 +3,32 @@ export declare const pathsConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3
3
|
tools: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
|
|
4
4
|
prompts: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
|
|
5
5
|
resources: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
|
|
6
|
+
skills: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
|
|
6
7
|
}, "strip", z.ZodTypeAny, {
|
|
7
8
|
tools?: string | boolean | undefined;
|
|
8
9
|
prompts?: string | boolean | undefined;
|
|
9
10
|
resources?: string | boolean | undefined;
|
|
11
|
+
skills?: string | boolean | undefined;
|
|
10
12
|
}, {
|
|
11
13
|
tools?: string | boolean | undefined;
|
|
12
14
|
prompts?: string | boolean | undefined;
|
|
13
15
|
resources?: string | boolean | undefined;
|
|
16
|
+
skills?: string | boolean | undefined;
|
|
14
17
|
}>, {
|
|
15
18
|
tools: string | boolean;
|
|
16
19
|
prompts: string | boolean;
|
|
17
20
|
resources: string | boolean;
|
|
21
|
+
skills: string | boolean;
|
|
18
22
|
}, {
|
|
19
23
|
tools?: string | boolean | undefined;
|
|
20
24
|
prompts?: string | boolean | undefined;
|
|
21
25
|
resources?: string | boolean | undefined;
|
|
26
|
+
skills?: string | boolean | undefined;
|
|
22
27
|
}>;
|
|
23
28
|
export type PathsConfig = z.infer<typeof pathsConfigSchema>;
|
|
24
29
|
export declare const DEFAULT_PATHS: {
|
|
25
30
|
readonly tools: "src/tools";
|
|
26
31
|
readonly prompts: "src/prompts";
|
|
27
32
|
readonly resources: "src/resources";
|
|
33
|
+
readonly skills: "src/skills";
|
|
28
34
|
};
|
|
@@ -42,6 +42,7 @@ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodE
|
|
|
42
42
|
bodySizeLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
43
43
|
debug: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
44
44
|
endpoint: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
45
|
+
maxSubscriptions: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
45
46
|
cors: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
46
47
|
origin: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean]>>>;
|
|
47
48
|
methods: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
@@ -84,6 +85,7 @@ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodE
|
|
|
84
85
|
bodySizeLimit?: number | undefined;
|
|
85
86
|
debug?: boolean | undefined;
|
|
86
87
|
endpoint?: string | undefined;
|
|
88
|
+
maxSubscriptions?: number | undefined;
|
|
87
89
|
cors?: {
|
|
88
90
|
origin: string | boolean | string[];
|
|
89
91
|
methods: string | string[];
|
|
@@ -98,6 +100,7 @@ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodE
|
|
|
98
100
|
bodySizeLimit?: number | undefined;
|
|
99
101
|
debug?: boolean | undefined;
|
|
100
102
|
endpoint?: string | undefined;
|
|
103
|
+
maxSubscriptions?: number | undefined;
|
|
101
104
|
cors?: {
|
|
102
105
|
origin?: string | boolean | string[] | undefined;
|
|
103
106
|
methods?: string | string[] | undefined;
|
|
@@ -120,12 +123,14 @@ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodE
|
|
|
120
123
|
credentials: boolean;
|
|
121
124
|
maxAge: number;
|
|
122
125
|
};
|
|
126
|
+
maxSubscriptions?: number | undefined;
|
|
123
127
|
}, {
|
|
124
128
|
port?: number | undefined;
|
|
125
129
|
host?: string | undefined;
|
|
126
130
|
bodySizeLimit?: number | undefined;
|
|
127
131
|
debug?: boolean | undefined;
|
|
128
132
|
endpoint?: string | undefined;
|
|
133
|
+
maxSubscriptions?: number | undefined;
|
|
129
134
|
cors?: {
|
|
130
135
|
origin?: string | boolean | string[] | undefined;
|
|
131
136
|
methods?: string | string[] | undefined;
|
|
@@ -141,6 +146,7 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
141
146
|
bodySizeLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
142
147
|
debug: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
143
148
|
endpoint: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
149
|
+
maxSubscriptions: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
144
150
|
cors: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
145
151
|
origin: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean]>>>;
|
|
146
152
|
methods: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
@@ -183,6 +189,7 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
183
189
|
bodySizeLimit?: number | undefined;
|
|
184
190
|
debug?: boolean | undefined;
|
|
185
191
|
endpoint?: string | undefined;
|
|
192
|
+
maxSubscriptions?: number | undefined;
|
|
186
193
|
cors?: {
|
|
187
194
|
origin: string | boolean | string[];
|
|
188
195
|
methods: string | string[];
|
|
@@ -197,6 +204,7 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
197
204
|
bodySizeLimit?: number | undefined;
|
|
198
205
|
debug?: boolean | undefined;
|
|
199
206
|
endpoint?: string | undefined;
|
|
207
|
+
maxSubscriptions?: number | undefined;
|
|
200
208
|
cors?: {
|
|
201
209
|
origin?: string | boolean | string[] | undefined;
|
|
202
210
|
methods?: string | string[] | undefined;
|
|
@@ -219,12 +227,14 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
219
227
|
credentials: boolean;
|
|
220
228
|
maxAge: number;
|
|
221
229
|
};
|
|
230
|
+
maxSubscriptions?: number | undefined;
|
|
222
231
|
}, {
|
|
223
232
|
port?: number | undefined;
|
|
224
233
|
host?: string | undefined;
|
|
225
234
|
bodySizeLimit?: number | undefined;
|
|
226
235
|
debug?: boolean | undefined;
|
|
227
236
|
endpoint?: string | undefined;
|
|
237
|
+
maxSubscriptions?: number | undefined;
|
|
228
238
|
cors?: {
|
|
229
239
|
origin?: string | boolean | string[] | undefined;
|
|
230
240
|
methods?: string | string[] | undefined;
|
|
@@ -239,6 +249,7 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
239
249
|
bodySizeLimit?: number | undefined;
|
|
240
250
|
debug?: boolean | undefined;
|
|
241
251
|
endpoint?: string | undefined;
|
|
252
|
+
maxSubscriptions?: number | undefined;
|
|
242
253
|
cors?: {
|
|
243
254
|
origin?: string | boolean | string[] | undefined;
|
|
244
255
|
methods?: string | string[] | undefined;
|
|
@@ -253,6 +264,7 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
253
264
|
bodySizeLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
254
265
|
debug: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
255
266
|
endpoint: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
267
|
+
maxSubscriptions: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
256
268
|
cors: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
257
269
|
origin: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean]>>>;
|
|
258
270
|
methods: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
@@ -295,6 +307,7 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
295
307
|
bodySizeLimit?: number | undefined;
|
|
296
308
|
debug?: boolean | undefined;
|
|
297
309
|
endpoint?: string | undefined;
|
|
310
|
+
maxSubscriptions?: number | undefined;
|
|
298
311
|
cors?: {
|
|
299
312
|
origin: string | boolean | string[];
|
|
300
313
|
methods: string | string[];
|
|
@@ -309,6 +322,7 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
309
322
|
bodySizeLimit?: number | undefined;
|
|
310
323
|
debug?: boolean | undefined;
|
|
311
324
|
endpoint?: string | undefined;
|
|
325
|
+
maxSubscriptions?: number | undefined;
|
|
312
326
|
cors?: {
|
|
313
327
|
origin?: string | boolean | string[] | undefined;
|
|
314
328
|
methods?: string | string[] | undefined;
|
|
@@ -331,12 +345,14 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
|
|
|
331
345
|
credentials: boolean;
|
|
332
346
|
maxAge: number;
|
|
333
347
|
};
|
|
348
|
+
maxSubscriptions?: number | undefined;
|
|
334
349
|
}, {
|
|
335
350
|
port?: number | undefined;
|
|
336
351
|
host?: string | undefined;
|
|
337
352
|
bodySizeLimit?: number | undefined;
|
|
338
353
|
debug?: boolean | undefined;
|
|
339
354
|
endpoint?: string | undefined;
|
|
355
|
+
maxSubscriptions?: number | undefined;
|
|
340
356
|
cors?: {
|
|
341
357
|
origin?: string | boolean | string[] | undefined;
|
|
342
358
|
methods?: string | string[] | undefined;
|
package/dist/config/utils.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type ResolvedPathsConfig = {
|
|
|
12
12
|
tools: string | null;
|
|
13
13
|
prompts: string | null;
|
|
14
14
|
resources: string | null;
|
|
15
|
+
skills: string | null;
|
|
15
16
|
};
|
|
16
17
|
export declare function getResolvedPathsConfig(userConfig: XmcpConfigOutputSchema): ResolvedPathsConfig;
|
|
17
18
|
export type ResolvedStdioConfig = Extract<z.output<typeof stdioTransportConfigSchema>, object> | null;
|
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod/v3"));else if("function"==typeof define&&define.amd)define(["zod/v3"],t);else{var o="object"==typeof exports?t(require("zod/v3")):t(e["zod/v3"]);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,e=>(()=>{"use strict";var t={4953(t){t.exports=e}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{getResolvedHttpConfig:()=>A,configSchema:()=>
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod/v3"));else if("function"==typeof define&&define.amd)define(["zod/v3"],t);else{var o="object"==typeof exports?t(require("zod/v3")):t(e["zod/v3"]);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,e=>(()=>{"use strict";var t={4953(t){t.exports=e}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.r(n),r.d(n,{getResolvedHttpConfig:()=>A,configSchema:()=>G,getResolvedStdioConfig:()=>R,getResolvedTypescriptConfig:()=>q,getResolvedCorsConfig:()=>E,getResolvedPathsConfig:()=>P,getResolvedExperimentalConfig:()=>_,getResolvedTemplateConfig:()=>M});var e=r(4953),t=r.n(e);let o=["x-mcp-client-name","x-mcp-client-version","x-mcp-client-title","x-mcp-client-website-url","x-mcp-client-description"],s={origin:"*",methods:["GET","POST"],allowedHeaders:["Content-Type","Authorization","mcp-session-id","mcp-protocol-version","mcp-method","mcp-name",...o],exposedHeaders:["Content-Type","Authorization","mcp-session-id"],credentials:!1,maxAge:86400},l=e.z.object({origin:e.z.union([e.z.string(),e.z.array(e.z.string()),e.z.boolean()]).default(s.origin),methods:e.z.union([e.z.string(),e.z.array(e.z.string())]).default([...s.methods]),allowedHeaders:e.z.union([e.z.string(),e.z.array(e.z.string())]).default([...s.allowedHeaders]),exposedHeaders:e.z.union([e.z.string(),e.z.array(e.z.string())]).default([...s.exposedHeaders]),credentials:e.z.boolean().default(s.credentials),maxAge:e.z.number().default(s.maxAge)}),i=l.parse({}),a=l.partial().transform(e=>{let t=Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t)),r={...i,...t};if(Array.isArray(r.allowedHeaders)){let e=new Set(r.allowedHeaders);for(let t of(e.add("mcp-session-id"),e.add("mcp-protocol-version"),e.add("mcp-method"),e.add("mcp-name"),o))e.add(t);r.allowedHeaders=Array.from(e)}if(Array.isArray(r.exposedHeaders)){let e=new Set(r.exposedHeaders);e.add("mcp-session-id"),r.exposedHeaders=Array.from(e)}return r}),p=e.z.object({port:e.z.number().default(3001),host:e.z.string().default("127.0.0.1"),bodySizeLimit:e.z.number().default(0xa00000),debug:e.z.boolean().default(!1),endpoint:e.z.string().default("/mcp"),maxSubscriptions:e.z.number().int().min(0).optional(),cors:a}),u=p.partial().transform(e=>{let t=p.parse({cors:{}}),o=Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t));return{...t,...o}}),d=e.z.union([e.z.boolean(),u]);d.transform(e=>"boolean"==typeof e?e?{}:null:e).pipe(e.z.union([e.z.literal(null),u]));let c=e.z.object({debug:e.z.boolean().default(!1),silent:e.z.boolean().default(!1)}),f=c.partial().transform(e=>{let t=c.parse({}),o=Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t));return{...t,...o}}),m=e.z.union([e.z.boolean(),f]).optional(),z=e.z.enum(["express","nextjs","nestjs","fastify","tanstack","hono","sveltekit","nuxt","react-router","astro"]),b=e.z.object({adapter:z.optional(),inferToolSchemas:e.z.boolean().optional()}),g=e.z.object({tools:e.z.union([e.z.boolean(),e.z.string()]).default(!0),prompts:e.z.union([e.z.boolean(),e.z.string()]).default(!0),resources:e.z.union([e.z.boolean(),e.z.string()]).default(!0),skills:e.z.union([e.z.boolean(),e.z.string()]).default(!0)}),y=g.partial().transform(e=>{let t=g.parse({}),o=Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t));return{...t,...o}}),j="src/tools",v="src/prompts",x="src/resources",h="src/skills",O=t().function().args(t().any()).returns(t().any()).optional(),k=e.z.object({name:e.z.string().default("xmcp server"),description:e.z.string().default("This MCP server was bootstrapped with xmcp."),icons:e.z.array(e.z.object({src:e.z.string(),mimeType:e.z.string().optional(),sizes:e.z.array(e.z.string()).optional(),theme:e.z.enum(["light","dark"]).optional()})).optional(),instructions:e.z.string().optional(),homePage:e.z.string().optional()}),H=k.partial().transform(e=>{let t=k.parse({}),o=Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t));return{...t,...o}}),S=e.z.object({skipTypeCheck:e.z.boolean().default(!1)}),w=S.partial().transform(e=>{let t=S.parse({}),o=Object.fromEntries(Object.entries(e).filter(([e,t])=>void 0!==t));return{...t,...o}}),C=e.z.object({names:e.z.array(e.z.string().min(1)).optional(),tags:e.z.array(e.z.string().min(1)).optional()}).strict(),T=e.z.object({include:C.optional(),exclude:C.optional()}).strict();function A(e){if("boolean"==typeof e){if(!e)return null;let t=d.parse({});return"object"!=typeof t||null===t?null:t}if("object"==typeof e&&null!==e){let t=d.parse(e);return"object"!=typeof t||null===t?null:t}return null}function E(e){return a.parse(e?.cors??{})}function P(e){let t=e?.paths;if(!t)return{tools:j,prompts:v,resources:x,skills:h};let o={tools:j,prompts:v,resources:x,skills:h};return"boolean"==typeof t.tools?o.tools=t.tools?j:null:"string"==typeof t.tools&&(o.tools=t.tools),"boolean"==typeof t.prompts?o.prompts=t.prompts?v:null:"string"==typeof t.prompts&&(o.prompts=t.prompts),"boolean"==typeof t.resources?o.resources=t.resources?x:null:"string"==typeof t.resources&&(o.resources=t.resources),"boolean"==typeof t.skills?o.skills=t.skills?h:null:"string"==typeof t.skills&&(o.skills=t.skills),o}function R(e){let t=e?.stdio;if("boolean"==typeof t){if(!t)return null;let e=m.parse({});return"object"!=typeof e||null===e?null:e}if(t){let e=m.parse(t);return"object"!=typeof e||null===e?null:e}let o=m.parse({});return"object"!=typeof o||null===o?null:o}function M(e){let t=e?.template;return H.parse(t??{})}function _(e){let t=e?.experimental;return{adapter:t?.adapter}}function q(e){let t=e?.typescript;return w.parse(t??{})}let G=e.z.object({stdio:m.optional(),http:d.optional(),experimental:b.optional(),paths:y.optional(),bundler:O.optional(),template:H.optional(),typescript:w.optional(),observability:e.z.object({enabled:e.z.boolean()}).optional(),components:T.optional()})})(),n})());
|