xmcp 0.5.5 → 0.5.6
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/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime/http.js +8 -8
- package/dist/types/tool.d.ts +6 -3
- package/package.json +1 -1
package/dist/types/tool.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod/v3";
|
|
2
|
+
import type { ZodType as ZodTypeV4, infer as inferV4 } from "zod";
|
|
2
3
|
import { OpenAIMetadata } from "./openai-meta";
|
|
3
4
|
export interface ToolAnnotations {
|
|
4
5
|
/** Human-readable title for the tool */
|
|
@@ -27,7 +28,8 @@ export interface ToolMetadata {
|
|
|
27
28
|
[key: string]: unknown;
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
type CompatibleZodType = z.ZodTypeAny | ZodTypeV4<unknown>;
|
|
32
|
+
export type ToolSchema = Record<string, CompatibleZodType>;
|
|
31
33
|
/**
|
|
32
34
|
* Extra arguments passed to MCP tool functions.
|
|
33
35
|
*/
|
|
@@ -81,6 +83,7 @@ export interface ToolExtraArguments {
|
|
|
81
83
|
[key: string]: unknown;
|
|
82
84
|
}) => Promise<z.infer<U>>;
|
|
83
85
|
}
|
|
84
|
-
export type InferSchema<T extends
|
|
85
|
-
[K in keyof T]: z.infer<T[K]
|
|
86
|
+
export type InferSchema<T extends Record<string, unknown>> = {
|
|
87
|
+
[K in keyof T]: T[K] extends z.ZodTypeAny ? z.infer<T[K]> : T[K] extends ZodTypeV4<unknown> ? inferV4<T[K]> : never;
|
|
86
88
|
};
|
|
89
|
+
export {};
|