hoomanjs 1.38.0 → 1.38.1
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type McpTransport } from "./types.js";
|
|
3
3
|
declare const McpServersFileSchema: z.ZodObject<{
|
|
4
|
-
mcpServers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
mcpServers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
5
|
type: z.ZodLiteral<"stdio">;
|
|
6
6
|
command: z.ZodString;
|
|
7
7
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -43,7 +43,7 @@ declare const McpServersFileSchema: z.ZodObject<{
|
|
|
43
43
|
callbackPort: z.ZodOptional<z.ZodInt>;
|
|
44
44
|
tokenParamName: z.ZodOptional<z.ZodString>;
|
|
45
45
|
}, z.core.$strip>>;
|
|
46
|
-
}, z.core.$strip>], "type"
|
|
46
|
+
}, z.core.$strip>], "type">>>>;
|
|
47
47
|
}, z.core.$strip>;
|
|
48
48
|
export type McpServersFile = z.infer<typeof McpServersFileSchema>;
|
|
49
49
|
export type ConfigOptions = {
|
package/dist/core/mcp/types.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare const SseSchema: z.ZodObject<{
|
|
|
47
47
|
tokenParamName: z.ZodOptional<z.ZodString>;
|
|
48
48
|
}, z.core.$strip>>;
|
|
49
49
|
}, z.core.$strip>;
|
|
50
|
-
export declare const McpTransportSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
50
|
+
export declare const McpTransportSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
51
51
|
type: z.ZodLiteral<"stdio">;
|
|
52
52
|
command: z.ZodString;
|
|
53
53
|
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -89,7 +89,7 @@ export declare const McpTransportSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
89
89
|
callbackPort: z.ZodOptional<z.ZodInt>;
|
|
90
90
|
tokenParamName: z.ZodOptional<z.ZodString>;
|
|
91
91
|
}, z.core.$strip>>;
|
|
92
|
-
}, z.core.$strip>], "type"
|
|
92
|
+
}, z.core.$strip>], "type">>;
|
|
93
93
|
export type Stdio = z.infer<typeof StdioSchema>;
|
|
94
94
|
export type StreamableHttp = z.infer<typeof StreamableHttpSchema>;
|
|
95
95
|
export type Sse = z.infer<typeof SseSchema>;
|
package/dist/core/mcp/types.js
CHANGED
|
@@ -23,9 +23,26 @@ export const SseSchema = z.object({
|
|
|
23
23
|
headers: headersOrEnvVarsSchema,
|
|
24
24
|
oauth: McpOAuthConfigSchema.optional(),
|
|
25
25
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Infer the transport `type` when omitted so shorthand entries work:
|
|
28
|
+
* a `command` implies `stdio`, a `url` implies `streamable-http`. Entries that
|
|
29
|
+
* already declare `type` are left untouched.
|
|
30
|
+
*/
|
|
31
|
+
function inferTransportType(value) {
|
|
32
|
+
if (value === null ||
|
|
33
|
+
typeof value !== "object" ||
|
|
34
|
+
Array.isArray(value) ||
|
|
35
|
+
"type" in value) {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
const record = value;
|
|
39
|
+
if (typeof record.command === "string") {
|
|
40
|
+
return { ...record, type: "stdio" };
|
|
41
|
+
}
|
|
42
|
+
if (typeof record.url === "string") {
|
|
43
|
+
return { ...record, type: "streamable-http" };
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
export const McpTransportSchema = z.preprocess(inferTransportType, z.discriminatedUnion("type", [StdioSchema, Stream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