xmcp 0.1.5 → 0.1.7

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.
Files changed (37) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/compiler/config/constants.d.ts +41 -0
  3. package/dist/compiler/{parse-xmcp-config.d.ts → config/index.d.ts} +49 -49
  4. package/dist/compiler/config/schemas/experimental/index.d.ts +91 -0
  5. package/dist/compiler/config/schemas/experimental/oauth.d.ts +74 -0
  6. package/dist/compiler/config/schemas/index.d.ts +6 -0
  7. package/dist/compiler/config/schemas/paths.d.ts +9 -0
  8. package/dist/compiler/config/schemas/transport/http.d.ts +82 -0
  9. package/dist/compiler/config/schemas/transport/stdio.d.ts +9 -0
  10. package/dist/compiler/config/schemas/webpack.d.ts +3 -0
  11. package/dist/index.d.ts +2 -6
  12. package/dist/index.js +1 -1
  13. package/dist/runtime/adapter-express.js +1 -1
  14. package/dist/runtime/adapter-nextjs.js +1 -1
  15. package/dist/runtime/http.js +1 -1
  16. package/dist/runtime/stdio.js +1 -1
  17. package/dist/types/tool.d.ts +32 -0
  18. package/package.json +1 -1
  19. package/dist/compiler/compiler-context.d.ts +0 -23
  20. package/dist/compiler/generate-env-code.d.ts +0 -1
  21. package/dist/compiler/generate-import-code.d.ts +0 -1
  22. package/dist/compiler/get-webpack-config/get-entries.d.ts +0 -3
  23. package/dist/compiler/get-webpack-config/get-externals.d.ts +0 -7
  24. package/dist/compiler/get-webpack-config/get-injected-variables.d.ts +0 -7
  25. package/dist/compiler/get-webpack-config/index.d.ts +0 -4
  26. package/dist/compiler/get-webpack-config/plugins.d.ts +0 -8
  27. package/dist/compiler/get-webpack-config/resolve-tsconfig-paths.d.ts +0 -9
  28. package/dist/compiler/index.d.ts +0 -6
  29. package/dist/compiler/on-first-build.d.ts +0 -3
  30. package/dist/compiler/start-http-server.d.ts +0 -1
  31. package/dist/utils/cli-icons.d.ts +0 -3
  32. package/dist/utils/constants.d.ts +0 -6
  33. package/dist/utils/file-watcher.d.ts +0 -18
  34. package/dist/utils/fs-utils.d.ts +0 -2
  35. package/dist/utils/path-validation.d.ts +0 -3
  36. package/dist/utils/spawn-process.d.ts +0 -9
  37. package/dist/utils/subscribable.d.ts +0 -12
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Default values for CORS config
3
+ */
4
+ export declare const DEFAULT_CORS_CONFIG: {
5
+ origin: string;
6
+ methods: string[];
7
+ allowedHeaders: string[];
8
+ exposedHeaders: string[];
9
+ credentials: boolean;
10
+ maxAge: number;
11
+ };
12
+ /**
13
+ * Default values for the HTTP transport
14
+ */
15
+ export declare const DEFAULT_HTTP_CONFIG: {
16
+ port: number;
17
+ host: string;
18
+ bodySizeLimit: number;
19
+ debug: boolean;
20
+ endpoint: string;
21
+ cors: {
22
+ origin: string;
23
+ methods: string[];
24
+ allowedHeaders: string[];
25
+ exposedHeaders: string[];
26
+ credentials: boolean;
27
+ maxAge: number;
28
+ };
29
+ };
30
+ /**
31
+ * Default values for the STDIO transport
32
+ */
33
+ export declare const DEFAULT_STDIO_CONFIG: {
34
+ debug: boolean;
35
+ };
36
+ /**
37
+ * Default values for the tools directory
38
+ */
39
+ export declare const DEFAULT_PATHS_CONFIG: {
40
+ tools: string;
41
+ };
@@ -1,17 +1,22 @@
1
1
  import { z } from "zod";
2
- import { type Configuration } from "webpack";
3
- export declare const DEFAULT_HTTP_PORT = 3002;
4
- export declare const DEFAULT_HTTP_BODY_SIZE_LIMIT: number;
5
- export declare const DEFAULT_HTTP_ENDPOINT = "/mcp";
6
- export declare const DEFAULT_HTTP_STATELESS = true;
7
- export declare const DEFAULT_TOOLS_DIR = "src/tools";
8
- declare const configSchema: z.ZodObject<{
9
- stdio: z.ZodOptional<z.ZodBoolean>;
10
- http: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
11
- port: z.ZodDefault<z.ZodNumber>;
12
- bodySizeLimit: z.ZodDefault<z.ZodNumber>;
2
+ import { Configuration } from "webpack";
3
+ /**
4
+ * xmcp Config schema
5
+ */
6
+ export declare const configSchema: z.ZodObject<{
7
+ stdio: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
13
8
  debug: z.ZodDefault<z.ZodBoolean>;
14
- endpoint: z.ZodDefault<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ debug: boolean;
11
+ }, {
12
+ debug?: boolean | undefined;
13
+ }>]>>>;
14
+ http: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodOptional<z.ZodDefault<z.ZodObject<{
15
+ port: z.ZodOptional<z.ZodNumber>;
16
+ host: z.ZodOptional<z.ZodString>;
17
+ bodySizeLimit: z.ZodOptional<z.ZodNumber>;
18
+ debug: z.ZodOptional<z.ZodBoolean>;
19
+ endpoint: z.ZodOptional<z.ZodString>;
15
20
  cors: z.ZodOptional<z.ZodObject<{
16
21
  origin: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean]>>;
17
22
  methods: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -35,10 +40,11 @@ declare const configSchema: z.ZodObject<{
35
40
  maxAge?: number | undefined;
36
41
  }>>;
37
42
  }, "strip", z.ZodTypeAny, {
38
- port: number;
39
- bodySizeLimit: number;
40
- debug: boolean;
41
- endpoint: string;
43
+ port?: number | undefined;
44
+ host?: string | undefined;
45
+ bodySizeLimit?: number | undefined;
46
+ debug?: boolean | undefined;
47
+ endpoint?: string | undefined;
42
48
  cors?: {
43
49
  origin?: string | boolean | string[] | undefined;
44
50
  methods?: string | string[] | undefined;
@@ -49,6 +55,7 @@ declare const configSchema: z.ZodObject<{
49
55
  } | undefined;
50
56
  }, {
51
57
  port?: number | undefined;
58
+ host?: string | undefined;
52
59
  bodySizeLimit?: number | undefined;
53
60
  debug?: boolean | undefined;
54
61
  endpoint?: string | undefined;
@@ -60,7 +67,7 @@ declare const configSchema: z.ZodObject<{
60
67
  credentials?: boolean | undefined;
61
68
  maxAge?: number | undefined;
62
69
  } | undefined;
63
- }>]>>;
70
+ }>>>]>>;
64
71
  experimental: z.ZodOptional<z.ZodObject<{
65
72
  oauth: z.ZodOptional<z.ZodObject<{
66
73
  endpoints: z.ZodObject<{
@@ -116,7 +123,6 @@ declare const configSchema: z.ZodObject<{
116
123
  }>>;
117
124
  adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs"]>>;
118
125
  }, "strip", z.ZodTypeAny, {
119
- adapter?: "express" | "nextjs" | undefined;
120
126
  oauth?: {
121
127
  endpoints: {
122
128
  authorizationUrl: string;
@@ -131,8 +137,8 @@ declare const configSchema: z.ZodObject<{
131
137
  defaultScopes: string[];
132
138
  serviceDocumentationUrl?: string | undefined;
133
139
  } | undefined;
134
- }, {
135
140
  adapter?: "express" | "nextjs" | undefined;
141
+ }, {
136
142
  oauth?: {
137
143
  endpoints: {
138
144
  authorizationUrl: string;
@@ -147,25 +153,26 @@ declare const configSchema: z.ZodObject<{
147
153
  pathPrefix?: string | undefined;
148
154
  defaultScopes?: string[] | undefined;
149
155
  } | undefined;
156
+ adapter?: "express" | "nextjs" | undefined;
150
157
  }>>;
151
- paths: z.ZodDefault<z.ZodOptional<z.ZodObject<{
158
+ paths: z.ZodOptional<z.ZodObject<{
152
159
  tools: z.ZodDefault<z.ZodString>;
153
160
  }, "strip", z.ZodTypeAny, {
154
161
  tools: string;
155
162
  }, {
156
163
  tools?: string | undefined;
157
- }>>>;
158
- webpack: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodAny>>;
164
+ }>>;
165
+ webpack: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodAny>>>;
159
166
  }, "strip", z.ZodTypeAny, {
160
- paths: {
161
- tools: string;
162
- };
163
- stdio?: boolean | undefined;
164
- http?: boolean | {
165
- port: number;
166
- bodySizeLimit: number;
167
+ stdio?: boolean | {
167
168
  debug: boolean;
168
- endpoint: string;
169
+ } | undefined;
170
+ http?: boolean | {
171
+ port?: number | undefined;
172
+ host?: string | undefined;
173
+ bodySizeLimit?: number | undefined;
174
+ debug?: boolean | undefined;
175
+ endpoint?: string | undefined;
169
176
  cors?: {
170
177
  origin?: string | boolean | string[] | undefined;
171
178
  methods?: string | string[] | undefined;
@@ -176,7 +183,6 @@ declare const configSchema: z.ZodObject<{
176
183
  } | undefined;
177
184
  } | undefined;
178
185
  experimental?: {
179
- adapter?: "express" | "nextjs" | undefined;
180
186
  oauth?: {
181
187
  endpoints: {
182
188
  authorizationUrl: string;
@@ -191,12 +197,19 @@ declare const configSchema: z.ZodObject<{
191
197
  defaultScopes: string[];
192
198
  serviceDocumentationUrl?: string | undefined;
193
199
  } | undefined;
200
+ adapter?: "express" | "nextjs" | undefined;
201
+ } | undefined;
202
+ paths?: {
203
+ tools: string;
194
204
  } | undefined;
195
205
  webpack?: ((args_0: any, ...args: unknown[]) => any) | undefined;
196
206
  }, {
197
- stdio?: boolean | undefined;
207
+ stdio?: boolean | {
208
+ debug?: boolean | undefined;
209
+ } | undefined;
198
210
  http?: boolean | {
199
211
  port?: number | undefined;
212
+ host?: string | undefined;
200
213
  bodySizeLimit?: number | undefined;
201
214
  debug?: boolean | undefined;
202
215
  endpoint?: string | undefined;
@@ -210,7 +223,6 @@ declare const configSchema: z.ZodObject<{
210
223
  } | undefined;
211
224
  } | undefined;
212
225
  experimental?: {
213
- adapter?: "express" | "nextjs" | undefined;
214
226
  oauth?: {
215
227
  endpoints: {
216
228
  authorizationUrl: string;
@@ -225,28 +237,16 @@ declare const configSchema: z.ZodObject<{
225
237
  pathPrefix?: string | undefined;
226
238
  defaultScopes?: string[] | undefined;
227
239
  } | undefined;
240
+ adapter?: "express" | "nextjs" | undefined;
228
241
  } | undefined;
229
242
  paths?: {
230
243
  tools?: string | undefined;
231
244
  } | undefined;
232
245
  webpack?: ((args_0: any, ...args: unknown[]) => any) | undefined;
233
246
  }>;
234
- type InputSchema = z.input<typeof configSchema>;
235
- type OutputSchema = z.output<typeof configSchema>;
236
- /** Config type for the user to provide */
237
- export type XmcpInputConfig = Omit<InputSchema, "webpack"> & {
238
- webpack?: (config: Configuration) => Configuration;
239
- };
240
- /** Config with defaults applied */
241
- export type XmcpParsedConfig = Omit<OutputSchema, "webpack"> & {
247
+ type WebpackConfig = {
242
248
  webpack?: (config: Configuration) => Configuration;
243
249
  };
244
- /**
245
- * Parse and validate xmcp config file
246
- */
247
- export declare function getConfig(): Promise<XmcpParsedConfig>;
248
- /**
249
- * Read config from file or return default
250
- */
251
- export declare function readConfig(): Promise<XmcpParsedConfig>;
250
+ export type XmcpConfigInputSchema = Omit<z.input<typeof configSchema>, "webpack"> & WebpackConfig;
251
+ export type XmcpConfigOuputSchema = Omit<z.output<typeof configSchema>, "webpack"> & WebpackConfig;
252
252
  export {};
@@ -0,0 +1,91 @@
1
+ import { z } from "zod";
2
+ export declare const adapterConfigSchema: z.ZodEnum<["express", "nextjs"]>;
3
+ export type AdapterConfig = z.infer<typeof adapterConfigSchema>;
4
+ export declare const experimentalConfigSchema: z.ZodObject<{
5
+ oauth: z.ZodOptional<z.ZodObject<{
6
+ endpoints: z.ZodObject<{
7
+ authorizationUrl: z.ZodString;
8
+ tokenUrl: z.ZodString;
9
+ revocationUrl: z.ZodOptional<z.ZodString>;
10
+ userInfoUrl: z.ZodOptional<z.ZodString>;
11
+ registerUrl: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ authorizationUrl: string;
14
+ tokenUrl: string;
15
+ registerUrl: string;
16
+ revocationUrl?: string | undefined;
17
+ userInfoUrl?: string | undefined;
18
+ }, {
19
+ authorizationUrl: string;
20
+ tokenUrl: string;
21
+ registerUrl: string;
22
+ revocationUrl?: string | undefined;
23
+ userInfoUrl?: string | undefined;
24
+ }>;
25
+ issuerUrl: z.ZodString;
26
+ baseUrl: z.ZodString;
27
+ serviceDocumentationUrl: z.ZodOptional<z.ZodString>;
28
+ pathPrefix: z.ZodDefault<z.ZodString>;
29
+ defaultScopes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ endpoints: {
32
+ authorizationUrl: string;
33
+ tokenUrl: string;
34
+ registerUrl: string;
35
+ revocationUrl?: string | undefined;
36
+ userInfoUrl?: string | undefined;
37
+ };
38
+ issuerUrl: string;
39
+ baseUrl: string;
40
+ pathPrefix: string;
41
+ defaultScopes: string[];
42
+ serviceDocumentationUrl?: string | undefined;
43
+ }, {
44
+ endpoints: {
45
+ authorizationUrl: string;
46
+ tokenUrl: string;
47
+ registerUrl: string;
48
+ revocationUrl?: string | undefined;
49
+ userInfoUrl?: string | undefined;
50
+ };
51
+ issuerUrl: string;
52
+ baseUrl: string;
53
+ serviceDocumentationUrl?: string | undefined;
54
+ pathPrefix?: string | undefined;
55
+ defaultScopes?: string[] | undefined;
56
+ }>>;
57
+ adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs"]>>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ oauth?: {
60
+ endpoints: {
61
+ authorizationUrl: string;
62
+ tokenUrl: string;
63
+ registerUrl: string;
64
+ revocationUrl?: string | undefined;
65
+ userInfoUrl?: string | undefined;
66
+ };
67
+ issuerUrl: string;
68
+ baseUrl: string;
69
+ pathPrefix: string;
70
+ defaultScopes: string[];
71
+ serviceDocumentationUrl?: string | undefined;
72
+ } | undefined;
73
+ adapter?: "express" | "nextjs" | undefined;
74
+ }, {
75
+ oauth?: {
76
+ endpoints: {
77
+ authorizationUrl: string;
78
+ tokenUrl: string;
79
+ registerUrl: string;
80
+ revocationUrl?: string | undefined;
81
+ userInfoUrl?: string | undefined;
82
+ };
83
+ issuerUrl: string;
84
+ baseUrl: string;
85
+ serviceDocumentationUrl?: string | undefined;
86
+ pathPrefix?: string | undefined;
87
+ defaultScopes?: string[] | undefined;
88
+ } | undefined;
89
+ adapter?: "express" | "nextjs" | undefined;
90
+ }>;
91
+ export type ExperimentalConfig = z.infer<typeof experimentalConfigSchema>;
@@ -0,0 +1,74 @@
1
+ import { z } from "zod";
2
+ export declare const oauthEndpointsSchema: z.ZodObject<{
3
+ authorizationUrl: z.ZodString;
4
+ tokenUrl: z.ZodString;
5
+ revocationUrl: z.ZodOptional<z.ZodString>;
6
+ userInfoUrl: z.ZodOptional<z.ZodString>;
7
+ registerUrl: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ authorizationUrl: string;
10
+ tokenUrl: string;
11
+ registerUrl: string;
12
+ revocationUrl?: string | undefined;
13
+ userInfoUrl?: string | undefined;
14
+ }, {
15
+ authorizationUrl: string;
16
+ tokenUrl: string;
17
+ registerUrl: string;
18
+ revocationUrl?: string | undefined;
19
+ userInfoUrl?: string | undefined;
20
+ }>;
21
+ export type OauthEndpoints = z.infer<typeof oauthEndpointsSchema>;
22
+ export declare const oauthConfigSchema: z.ZodObject<{
23
+ endpoints: z.ZodObject<{
24
+ authorizationUrl: z.ZodString;
25
+ tokenUrl: z.ZodString;
26
+ revocationUrl: z.ZodOptional<z.ZodString>;
27
+ userInfoUrl: z.ZodOptional<z.ZodString>;
28
+ registerUrl: z.ZodString;
29
+ }, "strip", z.ZodTypeAny, {
30
+ authorizationUrl: string;
31
+ tokenUrl: string;
32
+ registerUrl: string;
33
+ revocationUrl?: string | undefined;
34
+ userInfoUrl?: string | undefined;
35
+ }, {
36
+ authorizationUrl: string;
37
+ tokenUrl: string;
38
+ registerUrl: string;
39
+ revocationUrl?: string | undefined;
40
+ userInfoUrl?: string | undefined;
41
+ }>;
42
+ issuerUrl: z.ZodString;
43
+ baseUrl: z.ZodString;
44
+ serviceDocumentationUrl: z.ZodOptional<z.ZodString>;
45
+ pathPrefix: z.ZodDefault<z.ZodString>;
46
+ defaultScopes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ endpoints: {
49
+ authorizationUrl: string;
50
+ tokenUrl: string;
51
+ registerUrl: string;
52
+ revocationUrl?: string | undefined;
53
+ userInfoUrl?: string | undefined;
54
+ };
55
+ issuerUrl: string;
56
+ baseUrl: string;
57
+ pathPrefix: string;
58
+ defaultScopes: string[];
59
+ serviceDocumentationUrl?: string | undefined;
60
+ }, {
61
+ endpoints: {
62
+ authorizationUrl: string;
63
+ tokenUrl: string;
64
+ registerUrl: string;
65
+ revocationUrl?: string | undefined;
66
+ userInfoUrl?: string | undefined;
67
+ };
68
+ issuerUrl: string;
69
+ baseUrl: string;
70
+ serviceDocumentationUrl?: string | undefined;
71
+ pathPrefix?: string | undefined;
72
+ defaultScopes?: string[] | undefined;
73
+ }>;
74
+ export type OAuthConfig = z.infer<typeof oauthConfigSchema>;
@@ -0,0 +1,6 @@
1
+ export { httpTransportConfigSchema, corsConfigSchema, type HttpTransportConfig, type CorsConfig, } from "./transport/http";
2
+ export { stdioTransportConfigSchema, type StdioTransportConfig, } from "./transport/stdio";
3
+ export { oauthConfigSchema, type OAuthConfig } from "./experimental/oauth";
4
+ export { experimentalConfigSchema, type ExperimentalConfig, } from "./experimental";
5
+ export { pathsConfigSchema, type PathsConfig } from "./paths";
6
+ export { webpackConfigSchema, type WebpackConfig } from "./webpack";
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ export declare const pathsConfigSchema: z.ZodObject<{
3
+ tools: z.ZodDefault<z.ZodString>;
4
+ }, "strip", z.ZodTypeAny, {
5
+ tools: string;
6
+ }, {
7
+ tools?: string | undefined;
8
+ }>;
9
+ export type PathsConfig = z.infer<typeof pathsConfigSchema>;
@@ -0,0 +1,82 @@
1
+ import { z } from "zod";
2
+ export declare const corsConfigSchema: z.ZodObject<{
3
+ origin: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean]>>;
4
+ methods: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
5
+ allowedHeaders: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
6
+ exposedHeaders: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
7
+ credentials: z.ZodOptional<z.ZodBoolean>;
8
+ maxAge: z.ZodOptional<z.ZodNumber>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ origin?: string | boolean | string[] | undefined;
11
+ methods?: string | string[] | undefined;
12
+ allowedHeaders?: string | string[] | undefined;
13
+ exposedHeaders?: string | string[] | undefined;
14
+ credentials?: boolean | undefined;
15
+ maxAge?: number | undefined;
16
+ }, {
17
+ origin?: string | boolean | string[] | undefined;
18
+ methods?: string | string[] | undefined;
19
+ allowedHeaders?: string | string[] | undefined;
20
+ exposedHeaders?: string | string[] | undefined;
21
+ credentials?: boolean | undefined;
22
+ maxAge?: number | undefined;
23
+ }>;
24
+ export type CorsConfig = z.infer<typeof corsConfigSchema>;
25
+ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodOptional<z.ZodDefault<z.ZodObject<{
26
+ port: z.ZodOptional<z.ZodNumber>;
27
+ host: z.ZodOptional<z.ZodString>;
28
+ bodySizeLimit: z.ZodOptional<z.ZodNumber>;
29
+ debug: z.ZodOptional<z.ZodBoolean>;
30
+ endpoint: z.ZodOptional<z.ZodString>;
31
+ cors: z.ZodOptional<z.ZodObject<{
32
+ origin: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodBoolean]>>;
33
+ methods: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
34
+ allowedHeaders: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
35
+ exposedHeaders: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
36
+ credentials: z.ZodOptional<z.ZodBoolean>;
37
+ maxAge: z.ZodOptional<z.ZodNumber>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ origin?: string | boolean | string[] | undefined;
40
+ methods?: string | string[] | undefined;
41
+ allowedHeaders?: string | string[] | undefined;
42
+ exposedHeaders?: string | string[] | undefined;
43
+ credentials?: boolean | undefined;
44
+ maxAge?: number | undefined;
45
+ }, {
46
+ origin?: string | boolean | string[] | undefined;
47
+ methods?: string | string[] | undefined;
48
+ allowedHeaders?: string | string[] | undefined;
49
+ exposedHeaders?: string | string[] | undefined;
50
+ credentials?: boolean | undefined;
51
+ maxAge?: number | undefined;
52
+ }>>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ port?: number | undefined;
55
+ host?: string | undefined;
56
+ bodySizeLimit?: number | undefined;
57
+ debug?: boolean | undefined;
58
+ endpoint?: string | undefined;
59
+ cors?: {
60
+ origin?: string | boolean | string[] | undefined;
61
+ methods?: string | string[] | undefined;
62
+ allowedHeaders?: string | string[] | undefined;
63
+ exposedHeaders?: string | string[] | undefined;
64
+ credentials?: boolean | undefined;
65
+ maxAge?: number | undefined;
66
+ } | undefined;
67
+ }, {
68
+ port?: number | undefined;
69
+ host?: string | undefined;
70
+ bodySizeLimit?: number | undefined;
71
+ debug?: boolean | undefined;
72
+ endpoint?: string | undefined;
73
+ cors?: {
74
+ origin?: string | boolean | string[] | undefined;
75
+ methods?: string | string[] | undefined;
76
+ allowedHeaders?: string | string[] | undefined;
77
+ exposedHeaders?: string | string[] | undefined;
78
+ credentials?: boolean | undefined;
79
+ maxAge?: number | undefined;
80
+ } | undefined;
81
+ }>>>]>;
82
+ export type HttpTransportConfig = z.infer<typeof httpTransportConfigSchema>;
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ export declare const stdioTransportConfigSchema: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
3
+ debug: z.ZodDefault<z.ZodBoolean>;
4
+ }, "strip", z.ZodTypeAny, {
5
+ debug: boolean;
6
+ }, {
7
+ debug?: boolean | undefined;
8
+ }>]>>;
9
+ export type StdioTransportConfig = z.infer<typeof stdioTransportConfigSchema>;
@@ -0,0 +1,3 @@
1
+ import z from "zod";
2
+ export declare const webpackConfigSchema: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodAny>>;
3
+ export type WebpackConfig = z.infer<typeof webpackConfigSchema>;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
- import { type z } from "zod";
2
1
  export { type Middleware } from "./types/middleware";
3
- export type ToolSchema = Record<string, z.ZodType<unknown, z.ZodTypeDef, unknown>>;
4
- export type InferSchema<T extends ToolSchema> = {
5
- [K in keyof T]: z.infer<T[K]>;
6
- };
7
- export type { XmcpInputConfig as XmcpConfig } from "./compiler/parse-xmcp-config";
2
+ export type { ToolMetadata, ToolSchema, InferSchema } from "./types/tool";
3
+ export type { XmcpConfigOuputSchema as XmcpConfig } from "./compiler/config";
8
4
  export { apiKeyAuthMiddleware } from "./auth/api-key";
9
5
  export { jwtAuthMiddleware } from "./auth/jwt";
10
6
  export type { OAuthConfigOptions } from "./auth/oauth";