@openrouter/sdk 1.5.56 → 1.5.58
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/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/additionaltoolsitem.d.ts +5 -4
- package/esm/models/additionaltoolsitem.js +3 -0
- package/esm/models/alignmentresponsesrejected.d.ts +4 -1
- package/esm/models/alignmentresponsesrejected.js +6 -0
- package/esm/models/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/createworkspacerequest.d.ts +1 -0
- package/esm/models/createworkspacerequest.js +1 -0
- package/esm/models/decisionschoicequestion.d.ts +4 -4
- package/esm/models/decisionschoicequestion.js +1 -5
- package/esm/models/decisionsnoulquestion.d.ts +12 -12
- package/esm/models/decisionsnoulquestion.js +3 -7
- package/esm/models/decisionsresponse.d.ts +12 -0
- package/esm/models/decisionsresponse.js +5 -0
- package/esm/models/decisionsscorequestion.d.ts +4 -4
- package/esm/models/decisionsscorequestion.js +1 -5
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +1 -0
- package/esm/models/imagegenerationrequest.d.ts +1 -1
- package/esm/models/index.d.ts +6 -0
- package/esm/models/index.js +6 -0
- package/esm/models/mcpapprovalrequestitem.d.ts +7 -0
- package/esm/models/mcpapprovalrequestitem.js +19 -1
- package/esm/models/mcpcallitem.d.ts +17 -1
- package/esm/models/mcpcallitem.js +18 -0
- package/esm/models/mcpservertool.d.ts +78 -69
- package/esm/models/mcpservertool.js +135 -105
- package/esm/models/mcpservertoolopenrouter.d.ts +28 -0
- package/esm/models/mcpservertoolopenrouter.js +20 -0
- package/esm/models/mcpservertoolparameters.d.ts +152 -0
- package/esm/models/mcpservertoolparameters.js +134 -0
- package/esm/models/openairesponsestoolchoiceunion.d.ts +3 -2
- package/esm/models/openairesponsestoolchoiceunion.js +3 -0
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/outputitemmcpapprovalrequest.d.ts +14 -0
- package/esm/models/outputitemmcpapprovalrequest.js +23 -0
- package/esm/models/outputitemmcpcall.d.ts +74 -0
- package/esm/models/outputitemmcpcall.js +94 -0
- package/esm/models/outputitemmcplisttools.d.ts +25 -0
- package/esm/models/outputitemmcplisttools.js +37 -0
- package/esm/models/outputitems.d.ts +3 -0
- package/esm/models/outputitems.js +2 -0
- package/esm/models/providername.d.ts +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/provideroptions.d.ts +6 -0
- package/esm/models/provideroptions.js +1 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/responsesrequest.d.ts +9 -0
- package/esm/models/responsesrequest.js +3 -0
- package/esm/models/toolchoicemcp.d.ts +33 -0
- package/esm/models/toolchoicemcp.js +42 -0
- package/esm/models/toolsearchoutputitem.d.ts +5 -4
- package/esm/models/toolsearchoutputitem.js +3 -0
- package/esm/models/updateworkspacerequest.d.ts +1 -0
- package/esm/models/updateworkspacerequest.js +1 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +1 -0
- package/esm/sdk/sdk.d.ts +0 -9
- package/esm/sdk/sdk.js +1 -7
- package/jsr.json +1 -1
- package/package.json +8 -8
- package/esm/funcs/call-model.d.ts +0 -67
- package/esm/funcs/call-model.js +0 -98
- package/esm/lib/anthropic-compat.d.ts +0 -51
- package/esm/lib/anthropic-compat.js +0 -222
- package/esm/lib/async-params.d.ts +0 -107
- package/esm/lib/async-params.js +0 -88
- package/esm/lib/chat-compat.d.ts +0 -47
- package/esm/lib/chat-compat.js +0 -111
- package/esm/lib/claude-constants.d.ts +0 -22
- package/esm/lib/claude-constants.js +0 -20
- package/esm/lib/claude-type-guards.d.ts +0 -10
- package/esm/lib/claude-type-guards.js +0 -70
- package/esm/lib/conversation-state.d.ts +0 -63
- package/esm/lib/conversation-state.js +0 -210
- package/esm/lib/model-result.d.ts +0 -373
- package/esm/lib/model-result.js +0 -1414
- package/esm/lib/next-turn-params.d.ts +0 -30
- package/esm/lib/next-turn-params.js +0 -135
- package/esm/lib/reusable-stream.d.ts +0 -39
- package/esm/lib/reusable-stream.js +0 -192
- package/esm/lib/stop-conditions.d.ts +0 -80
- package/esm/lib/stop-conditions.js +0 -104
- package/esm/lib/stream-transformers.d.ts +0 -118
- package/esm/lib/stream-transformers.js +0 -852
- package/esm/lib/stream-type-guards.d.ts +0 -49
- package/esm/lib/stream-type-guards.js +0 -85
- package/esm/lib/tool-context.d.ts +0 -68
- package/esm/lib/tool-context.js +0 -175
- package/esm/lib/tool-event-broadcaster.d.ts +0 -44
- package/esm/lib/tool-event-broadcaster.js +0 -146
- package/esm/lib/tool-executor.d.ts +0 -74
- package/esm/lib/tool-executor.js +0 -267
- package/esm/lib/tool-orchestrator.d.ts +0 -52
- package/esm/lib/tool-orchestrator.js +0 -180
- package/esm/lib/tool-types.d.ts +0 -573
- package/esm/lib/tool-types.js +0 -80
- package/esm/lib/tool.d.ts +0 -108
- package/esm/lib/tool.js +0 -74
- package/esm/lib/turn-context.d.ts +0 -52
- package/esm/lib/turn-context.js +0 -59
|
@@ -5,40 +5,58 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
8
9
|
import { McpToolCallError$inboundSchema, McpToolCallError$outboundSchema, } from "./mcptoolcallerror.js";
|
|
10
|
+
export const McpCallItemStatus = {
|
|
11
|
+
InProgress: "in_progress",
|
|
12
|
+
Completed: "completed",
|
|
13
|
+
Incomplete: "incomplete",
|
|
14
|
+
Calling: "calling",
|
|
15
|
+
Failed: "failed",
|
|
16
|
+
};
|
|
9
17
|
export const McpCallItemType = {
|
|
10
18
|
McpCall: "mcp_call",
|
|
11
19
|
};
|
|
12
20
|
/** @internal */
|
|
21
|
+
export const McpCallItemStatus$inboundSchema = openEnums.inboundSchema(McpCallItemStatus);
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const McpCallItemStatus$outboundSchema = openEnums.outboundSchema(McpCallItemStatus);
|
|
24
|
+
/** @internal */
|
|
13
25
|
export const McpCallItemType$inboundSchema = z.enum(McpCallItemType);
|
|
14
26
|
/** @internal */
|
|
15
27
|
export const McpCallItemType$outboundSchema = McpCallItemType$inboundSchema;
|
|
16
28
|
/** @internal */
|
|
17
29
|
export const McpCallItem$inboundSchema = z
|
|
18
30
|
.object({
|
|
31
|
+
approval_request_id: z.nullable(z.string()).optional(),
|
|
19
32
|
arguments: z.string(),
|
|
20
33
|
error: z.nullable(McpToolCallError$inboundSchema).optional(),
|
|
21
34
|
id: z.string(),
|
|
22
35
|
name: z.string(),
|
|
23
36
|
output: z.nullable(z.string()).optional(),
|
|
24
37
|
server_label: z.string(),
|
|
38
|
+
status: McpCallItemStatus$inboundSchema.optional(),
|
|
25
39
|
type: McpCallItemType$inboundSchema,
|
|
26
40
|
}).transform((v) => {
|
|
27
41
|
return remap$(v, {
|
|
42
|
+
"approval_request_id": "approvalRequestId",
|
|
28
43
|
"server_label": "serverLabel",
|
|
29
44
|
});
|
|
30
45
|
});
|
|
31
46
|
/** @internal */
|
|
32
47
|
export const McpCallItem$outboundSchema = z.object({
|
|
48
|
+
approvalRequestId: z.nullable(z.string()).optional(),
|
|
33
49
|
arguments: z.string(),
|
|
34
50
|
error: z.nullable(McpToolCallError$outboundSchema).optional(),
|
|
35
51
|
id: z.string(),
|
|
36
52
|
name: z.string(),
|
|
37
53
|
output: z.nullable(z.string()).optional(),
|
|
38
54
|
serverLabel: z.string(),
|
|
55
|
+
status: McpCallItemStatus$outboundSchema.optional(),
|
|
39
56
|
type: McpCallItemType$outboundSchema,
|
|
40
57
|
}).transform((v) => {
|
|
41
58
|
return remap$(v, {
|
|
59
|
+
approvalRequestId: "approval_request_id",
|
|
42
60
|
serverLabel: "server_label",
|
|
43
61
|
});
|
|
44
62
|
});
|
|
@@ -1,42 +1,45 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export type
|
|
5
|
+
export type McpServerToolAllowedTools = {
|
|
6
6
|
readOnly?: boolean | undefined;
|
|
7
7
|
toolNames?: Array<string> | undefined;
|
|
8
|
+
additionalProperties?: {
|
|
9
|
+
[k: string]: any;
|
|
10
|
+
} | undefined;
|
|
8
11
|
};
|
|
9
|
-
export type
|
|
10
|
-
export declare const
|
|
11
|
-
readonly ConnectorDropbox: "connector_dropbox";
|
|
12
|
-
readonly ConnectorGmail: "connector_gmail";
|
|
13
|
-
readonly ConnectorGooglecalendar: "connector_googlecalendar";
|
|
14
|
-
readonly ConnectorGoogledrive: "connector_googledrive";
|
|
15
|
-
readonly ConnectorMicrosoftteams: "connector_microsoftteams";
|
|
16
|
-
readonly ConnectorOutlookcalendar: "connector_outlookcalendar";
|
|
17
|
-
readonly ConnectorOutlookemail: "connector_outlookemail";
|
|
18
|
-
readonly ConnectorSharepoint: "connector_sharepoint";
|
|
19
|
-
};
|
|
20
|
-
export type ConnectorId = OpenEnum<typeof ConnectorId>;
|
|
21
|
-
export declare const RequireApprovalNever: {
|
|
12
|
+
export type McpServerToolAllowedToolsUnion = Array<string> | McpServerToolAllowedTools;
|
|
13
|
+
export declare const McpServerToolRequireApprovalNever: {
|
|
22
14
|
readonly Never: "never";
|
|
23
15
|
};
|
|
24
|
-
export type
|
|
25
|
-
export declare const
|
|
16
|
+
export type McpServerToolRequireApprovalNever = ClosedEnum<typeof McpServerToolRequireApprovalNever>;
|
|
17
|
+
export declare const McpServerToolRequireApprovalAlways: {
|
|
26
18
|
readonly Always: "always";
|
|
27
19
|
};
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
20
|
+
export type McpServerToolRequireApprovalAlways = ClosedEnum<typeof McpServerToolRequireApprovalAlways>;
|
|
21
|
+
export type McpServerToolAlways = {
|
|
22
|
+
readOnly?: boolean | undefined;
|
|
30
23
|
toolNames?: Array<string> | undefined;
|
|
24
|
+
additionalProperties?: {
|
|
25
|
+
[k: string]: any;
|
|
26
|
+
} | undefined;
|
|
31
27
|
};
|
|
32
|
-
export type
|
|
28
|
+
export type McpServerToolNever = {
|
|
29
|
+
readOnly?: boolean | undefined;
|
|
33
30
|
toolNames?: Array<string> | undefined;
|
|
31
|
+
additionalProperties?: {
|
|
32
|
+
[k: string]: any;
|
|
33
|
+
} | undefined;
|
|
34
34
|
};
|
|
35
|
-
export type
|
|
36
|
-
always?:
|
|
37
|
-
never?:
|
|
35
|
+
export type McpServerToolRequireApproval = {
|
|
36
|
+
always?: McpServerToolAlways | undefined;
|
|
37
|
+
never?: McpServerToolNever | undefined;
|
|
38
|
+
additionalProperties?: {
|
|
39
|
+
[k: string]: any;
|
|
40
|
+
} | undefined;
|
|
38
41
|
};
|
|
39
|
-
export type
|
|
42
|
+
export type McpServerToolRequireApprovalUnion = McpServerToolRequireApproval | McpServerToolRequireApprovalAlways | McpServerToolRequireApprovalNever;
|
|
40
43
|
export declare const McpServerToolType: {
|
|
41
44
|
readonly Mcp: "mcp";
|
|
42
45
|
};
|
|
@@ -45,88 +48,93 @@ export type McpServerToolType = ClosedEnum<typeof McpServerToolType>;
|
|
|
45
48
|
* MCP (Model Context Protocol) tool configuration
|
|
46
49
|
*/
|
|
47
50
|
export type McpServerTool = {
|
|
48
|
-
allowedTools?: Array<string> |
|
|
51
|
+
allowedTools?: Array<string> | McpServerToolAllowedTools | null | undefined;
|
|
49
52
|
authorization?: string | undefined;
|
|
50
|
-
connectorId?:
|
|
53
|
+
connectorId?: string | undefined;
|
|
51
54
|
headers?: {
|
|
52
55
|
[k: string]: string;
|
|
53
56
|
} | null | undefined;
|
|
54
|
-
requireApproval?:
|
|
57
|
+
requireApproval?: McpServerToolRequireApproval | McpServerToolRequireApprovalAlways | McpServerToolRequireApprovalNever | null | undefined;
|
|
55
58
|
serverDescription?: string | undefined;
|
|
56
59
|
serverLabel: string;
|
|
57
60
|
serverUrl?: string | undefined;
|
|
58
61
|
type: McpServerToolType;
|
|
62
|
+
additionalProperties?: {
|
|
63
|
+
[k: string]: any;
|
|
64
|
+
} | undefined;
|
|
59
65
|
};
|
|
60
66
|
/** @internal */
|
|
61
|
-
export declare const
|
|
67
|
+
export declare const McpServerToolAllowedTools$inboundSchema: z.ZodType<McpServerToolAllowedTools, unknown>;
|
|
62
68
|
/** @internal */
|
|
63
|
-
export type
|
|
69
|
+
export type McpServerToolAllowedTools$Outbound = {
|
|
64
70
|
read_only?: boolean | undefined;
|
|
65
71
|
tool_names?: Array<string> | undefined;
|
|
72
|
+
[additionalProperties: string]: unknown;
|
|
66
73
|
};
|
|
67
74
|
/** @internal */
|
|
68
|
-
export declare const
|
|
69
|
-
export declare function
|
|
70
|
-
export declare function
|
|
71
|
-
/** @internal */
|
|
72
|
-
export declare const AllowedToolsUnion$inboundSchema: z.ZodType<AllowedToolsUnion, unknown>;
|
|
75
|
+
export declare const McpServerToolAllowedTools$outboundSchema: z.ZodType<McpServerToolAllowedTools$Outbound, McpServerToolAllowedTools>;
|
|
76
|
+
export declare function mcpServerToolAllowedToolsToJSON(mcpServerToolAllowedTools: McpServerToolAllowedTools): string;
|
|
77
|
+
export declare function mcpServerToolAllowedToolsFromJSON(jsonString: string): SafeParseResult<McpServerToolAllowedTools, SDKValidationError>;
|
|
73
78
|
/** @internal */
|
|
74
|
-
export
|
|
79
|
+
export declare const McpServerToolAllowedToolsUnion$inboundSchema: z.ZodType<McpServerToolAllowedToolsUnion, unknown>;
|
|
75
80
|
/** @internal */
|
|
76
|
-
export
|
|
77
|
-
export declare function allowedToolsUnionToJSON(allowedToolsUnion: AllowedToolsUnion): string;
|
|
78
|
-
export declare function allowedToolsUnionFromJSON(jsonString: string): SafeParseResult<AllowedToolsUnion, SDKValidationError>;
|
|
81
|
+
export type McpServerToolAllowedToolsUnion$Outbound = Array<string> | McpServerToolAllowedTools$Outbound;
|
|
79
82
|
/** @internal */
|
|
80
|
-
export declare const
|
|
83
|
+
export declare const McpServerToolAllowedToolsUnion$outboundSchema: z.ZodType<McpServerToolAllowedToolsUnion$Outbound, McpServerToolAllowedToolsUnion>;
|
|
84
|
+
export declare function mcpServerToolAllowedToolsUnionToJSON(mcpServerToolAllowedToolsUnion: McpServerToolAllowedToolsUnion): string;
|
|
85
|
+
export declare function mcpServerToolAllowedToolsUnionFromJSON(jsonString: string): SafeParseResult<McpServerToolAllowedToolsUnion, SDKValidationError>;
|
|
81
86
|
/** @internal */
|
|
82
|
-
export declare const
|
|
87
|
+
export declare const McpServerToolRequireApprovalNever$inboundSchema: z.ZodEnum<typeof McpServerToolRequireApprovalNever>;
|
|
83
88
|
/** @internal */
|
|
84
|
-
export declare const
|
|
89
|
+
export declare const McpServerToolRequireApprovalNever$outboundSchema: z.ZodEnum<typeof McpServerToolRequireApprovalNever>;
|
|
85
90
|
/** @internal */
|
|
86
|
-
export declare const
|
|
91
|
+
export declare const McpServerToolRequireApprovalAlways$inboundSchema: z.ZodEnum<typeof McpServerToolRequireApprovalAlways>;
|
|
87
92
|
/** @internal */
|
|
88
|
-
export declare const
|
|
93
|
+
export declare const McpServerToolRequireApprovalAlways$outboundSchema: z.ZodEnum<typeof McpServerToolRequireApprovalAlways>;
|
|
89
94
|
/** @internal */
|
|
90
|
-
export declare const
|
|
95
|
+
export declare const McpServerToolAlways$inboundSchema: z.ZodType<McpServerToolAlways, unknown>;
|
|
91
96
|
/** @internal */
|
|
92
|
-
export
|
|
93
|
-
|
|
94
|
-
export type Always$Outbound = {
|
|
97
|
+
export type McpServerToolAlways$Outbound = {
|
|
98
|
+
read_only?: boolean | undefined;
|
|
95
99
|
tool_names?: Array<string> | undefined;
|
|
100
|
+
[additionalProperties: string]: unknown;
|
|
96
101
|
};
|
|
97
102
|
/** @internal */
|
|
98
|
-
export declare const
|
|
99
|
-
export declare function
|
|
100
|
-
export declare function
|
|
103
|
+
export declare const McpServerToolAlways$outboundSchema: z.ZodType<McpServerToolAlways$Outbound, McpServerToolAlways>;
|
|
104
|
+
export declare function mcpServerToolAlwaysToJSON(mcpServerToolAlways: McpServerToolAlways): string;
|
|
105
|
+
export declare function mcpServerToolAlwaysFromJSON(jsonString: string): SafeParseResult<McpServerToolAlways, SDKValidationError>;
|
|
101
106
|
/** @internal */
|
|
102
|
-
export declare const
|
|
107
|
+
export declare const McpServerToolNever$inboundSchema: z.ZodType<McpServerToolNever, unknown>;
|
|
103
108
|
/** @internal */
|
|
104
|
-
export type
|
|
109
|
+
export type McpServerToolNever$Outbound = {
|
|
110
|
+
read_only?: boolean | undefined;
|
|
105
111
|
tool_names?: Array<string> | undefined;
|
|
112
|
+
[additionalProperties: string]: unknown;
|
|
106
113
|
};
|
|
107
114
|
/** @internal */
|
|
108
|
-
export declare const
|
|
109
|
-
export declare function
|
|
110
|
-
export declare function
|
|
115
|
+
export declare const McpServerToolNever$outboundSchema: z.ZodType<McpServerToolNever$Outbound, McpServerToolNever>;
|
|
116
|
+
export declare function mcpServerToolNeverToJSON(mcpServerToolNever: McpServerToolNever): string;
|
|
117
|
+
export declare function mcpServerToolNeverFromJSON(jsonString: string): SafeParseResult<McpServerToolNever, SDKValidationError>;
|
|
111
118
|
/** @internal */
|
|
112
|
-
export declare const
|
|
119
|
+
export declare const McpServerToolRequireApproval$inboundSchema: z.ZodType<McpServerToolRequireApproval, unknown>;
|
|
113
120
|
/** @internal */
|
|
114
|
-
export type
|
|
115
|
-
always?:
|
|
116
|
-
never?:
|
|
121
|
+
export type McpServerToolRequireApproval$Outbound = {
|
|
122
|
+
always?: McpServerToolAlways$Outbound | undefined;
|
|
123
|
+
never?: McpServerToolNever$Outbound | undefined;
|
|
124
|
+
[additionalProperties: string]: unknown;
|
|
117
125
|
};
|
|
118
126
|
/** @internal */
|
|
119
|
-
export declare const
|
|
120
|
-
export declare function
|
|
121
|
-
export declare function
|
|
127
|
+
export declare const McpServerToolRequireApproval$outboundSchema: z.ZodType<McpServerToolRequireApproval$Outbound, McpServerToolRequireApproval>;
|
|
128
|
+
export declare function mcpServerToolRequireApprovalToJSON(mcpServerToolRequireApproval: McpServerToolRequireApproval): string;
|
|
129
|
+
export declare function mcpServerToolRequireApprovalFromJSON(jsonString: string): SafeParseResult<McpServerToolRequireApproval, SDKValidationError>;
|
|
122
130
|
/** @internal */
|
|
123
|
-
export declare const
|
|
131
|
+
export declare const McpServerToolRequireApprovalUnion$inboundSchema: z.ZodType<McpServerToolRequireApprovalUnion, unknown>;
|
|
124
132
|
/** @internal */
|
|
125
|
-
export type
|
|
133
|
+
export type McpServerToolRequireApprovalUnion$Outbound = McpServerToolRequireApproval$Outbound | string | string;
|
|
126
134
|
/** @internal */
|
|
127
|
-
export declare const
|
|
128
|
-
export declare function
|
|
129
|
-
export declare function
|
|
135
|
+
export declare const McpServerToolRequireApprovalUnion$outboundSchema: z.ZodType<McpServerToolRequireApprovalUnion$Outbound, McpServerToolRequireApprovalUnion>;
|
|
136
|
+
export declare function mcpServerToolRequireApprovalUnionToJSON(mcpServerToolRequireApprovalUnion: McpServerToolRequireApprovalUnion): string;
|
|
137
|
+
export declare function mcpServerToolRequireApprovalUnionFromJSON(jsonString: string): SafeParseResult<McpServerToolRequireApprovalUnion, SDKValidationError>;
|
|
130
138
|
/** @internal */
|
|
131
139
|
export declare const McpServerToolType$inboundSchema: z.ZodEnum<typeof McpServerToolType>;
|
|
132
140
|
/** @internal */
|
|
@@ -135,17 +143,18 @@ export declare const McpServerToolType$outboundSchema: z.ZodEnum<typeof McpServe
|
|
|
135
143
|
export declare const McpServerTool$inboundSchema: z.ZodType<McpServerTool, unknown>;
|
|
136
144
|
/** @internal */
|
|
137
145
|
export type McpServerTool$Outbound = {
|
|
138
|
-
allowed_tools?: Array<string> |
|
|
146
|
+
allowed_tools?: Array<string> | McpServerToolAllowedTools$Outbound | null | undefined;
|
|
139
147
|
authorization?: string | undefined;
|
|
140
148
|
connector_id?: string | undefined;
|
|
141
149
|
headers?: {
|
|
142
150
|
[k: string]: string;
|
|
143
151
|
} | null | undefined;
|
|
144
|
-
require_approval?:
|
|
152
|
+
require_approval?: McpServerToolRequireApproval$Outbound | string | string | null | undefined;
|
|
145
153
|
server_description?: string | undefined;
|
|
146
154
|
server_label: string;
|
|
147
155
|
server_url?: string | undefined;
|
|
148
156
|
type: string;
|
|
157
|
+
[additionalProperties: string]: unknown;
|
|
149
158
|
};
|
|
150
159
|
/** @internal */
|
|
151
160
|
export declare const McpServerTool$outboundSchema: z.ZodType<McpServerTool$Outbound, McpServerTool>;
|
|
@@ -4,176 +4,198 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
|
|
9
|
-
export const ConnectorId = {
|
|
10
|
-
ConnectorDropbox: "connector_dropbox",
|
|
11
|
-
ConnectorGmail: "connector_gmail",
|
|
12
|
-
ConnectorGooglecalendar: "connector_googlecalendar",
|
|
13
|
-
ConnectorGoogledrive: "connector_googledrive",
|
|
14
|
-
ConnectorMicrosoftteams: "connector_microsoftteams",
|
|
15
|
-
ConnectorOutlookcalendar: "connector_outlookcalendar",
|
|
16
|
-
ConnectorOutlookemail: "connector_outlookemail",
|
|
17
|
-
ConnectorSharepoint: "connector_sharepoint",
|
|
18
|
-
};
|
|
19
|
-
export const RequireApprovalNever = {
|
|
7
|
+
import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schemas.js";
|
|
8
|
+
export const McpServerToolRequireApprovalNever = {
|
|
20
9
|
Never: "never",
|
|
21
10
|
};
|
|
22
|
-
export const
|
|
11
|
+
export const McpServerToolRequireApprovalAlways = {
|
|
23
12
|
Always: "always",
|
|
24
13
|
};
|
|
25
14
|
export const McpServerToolType = {
|
|
26
15
|
Mcp: "mcp",
|
|
27
16
|
};
|
|
28
17
|
/** @internal */
|
|
29
|
-
export const
|
|
30
|
-
.object({
|
|
18
|
+
export const McpServerToolAllowedTools$inboundSchema = collectExtraKeys$(z.object({
|
|
31
19
|
read_only: z.boolean().optional(),
|
|
32
20
|
tool_names: z.array(z.string()).optional(),
|
|
33
|
-
}).transform((v) => {
|
|
21
|
+
}).catchall(z.any()), "additionalProperties", true).transform((v) => {
|
|
34
22
|
return remap$(v, {
|
|
35
23
|
"read_only": "readOnly",
|
|
36
24
|
"tool_names": "toolNames",
|
|
37
25
|
});
|
|
38
26
|
});
|
|
39
27
|
/** @internal */
|
|
40
|
-
export const
|
|
28
|
+
export const McpServerToolAllowedTools$outboundSchema = z.object({
|
|
41
29
|
readOnly: z.boolean().optional(),
|
|
42
30
|
toolNames: z.array(z.string()).optional(),
|
|
31
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
43
32
|
}).transform((v) => {
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
return {
|
|
34
|
+
...v.additionalProperties,
|
|
35
|
+
...remap$(v, {
|
|
36
|
+
readOnly: "read_only",
|
|
37
|
+
toolNames: "tool_names",
|
|
38
|
+
additionalProperties: null,
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
48
41
|
});
|
|
49
|
-
export function
|
|
50
|
-
return JSON.stringify(
|
|
42
|
+
export function mcpServerToolAllowedToolsToJSON(mcpServerToolAllowedTools) {
|
|
43
|
+
return JSON.stringify(McpServerToolAllowedTools$outboundSchema.parse(mcpServerToolAllowedTools));
|
|
51
44
|
}
|
|
52
|
-
export function
|
|
53
|
-
return safeParse(jsonString, (x) =>
|
|
45
|
+
export function mcpServerToolAllowedToolsFromJSON(jsonString) {
|
|
46
|
+
return safeParse(jsonString, (x) => McpServerToolAllowedTools$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpServerToolAllowedTools' from JSON`);
|
|
54
47
|
}
|
|
55
48
|
/** @internal */
|
|
56
|
-
export const
|
|
49
|
+
export const McpServerToolAllowedToolsUnion$inboundSchema = z.union([
|
|
50
|
+
z.array(z.string()),
|
|
51
|
+
z.lazy(() => McpServerToolAllowedTools$inboundSchema),
|
|
52
|
+
]);
|
|
57
53
|
/** @internal */
|
|
58
|
-
export const
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
export const McpServerToolAllowedToolsUnion$outboundSchema = z.union([
|
|
55
|
+
z.array(z.string()),
|
|
56
|
+
z.lazy(() => McpServerToolAllowedTools$outboundSchema),
|
|
57
|
+
]);
|
|
58
|
+
export function mcpServerToolAllowedToolsUnionToJSON(mcpServerToolAllowedToolsUnion) {
|
|
59
|
+
return JSON.stringify(McpServerToolAllowedToolsUnion$outboundSchema.parse(mcpServerToolAllowedToolsUnion));
|
|
61
60
|
}
|
|
62
|
-
export function
|
|
63
|
-
return safeParse(jsonString, (x) =>
|
|
61
|
+
export function mcpServerToolAllowedToolsUnionFromJSON(jsonString) {
|
|
62
|
+
return safeParse(jsonString, (x) => McpServerToolAllowedToolsUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpServerToolAllowedToolsUnion' from JSON`);
|
|
64
63
|
}
|
|
65
64
|
/** @internal */
|
|
66
|
-
export const
|
|
67
|
-
/** @internal */
|
|
68
|
-
export const ConnectorId$outboundSchema = openEnums.outboundSchema(ConnectorId);
|
|
65
|
+
export const McpServerToolRequireApprovalNever$inboundSchema = z.enum(McpServerToolRequireApprovalNever);
|
|
69
66
|
/** @internal */
|
|
70
|
-
export const
|
|
67
|
+
export const McpServerToolRequireApprovalNever$outboundSchema = McpServerToolRequireApprovalNever$inboundSchema;
|
|
71
68
|
/** @internal */
|
|
72
|
-
export const
|
|
69
|
+
export const McpServerToolRequireApprovalAlways$inboundSchema = z.enum(McpServerToolRequireApprovalAlways);
|
|
73
70
|
/** @internal */
|
|
74
|
-
export const
|
|
71
|
+
export const McpServerToolRequireApprovalAlways$outboundSchema = McpServerToolRequireApprovalAlways$inboundSchema;
|
|
75
72
|
/** @internal */
|
|
76
|
-
export const
|
|
77
|
-
|
|
78
|
-
export const Always$inboundSchema = z.object({
|
|
73
|
+
export const McpServerToolAlways$inboundSchema = collectExtraKeys$(z.object({
|
|
74
|
+
read_only: z.boolean().optional(),
|
|
79
75
|
tool_names: z.array(z.string()).optional(),
|
|
80
|
-
}).transform((v) => {
|
|
76
|
+
}).catchall(z.any()), "additionalProperties", true).transform((v) => {
|
|
81
77
|
return remap$(v, {
|
|
78
|
+
"read_only": "readOnly",
|
|
82
79
|
"tool_names": "toolNames",
|
|
83
80
|
});
|
|
84
81
|
});
|
|
85
82
|
/** @internal */
|
|
86
|
-
export const
|
|
87
|
-
.
|
|
83
|
+
export const McpServerToolAlways$outboundSchema = z.object({
|
|
84
|
+
readOnly: z.boolean().optional(),
|
|
88
85
|
toolNames: z.array(z.string()).optional(),
|
|
86
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
89
87
|
}).transform((v) => {
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
return {
|
|
89
|
+
...v.additionalProperties,
|
|
90
|
+
...remap$(v, {
|
|
91
|
+
readOnly: "read_only",
|
|
92
|
+
toolNames: "tool_names",
|
|
93
|
+
additionalProperties: null,
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
93
96
|
});
|
|
94
|
-
export function
|
|
95
|
-
return JSON.stringify(
|
|
97
|
+
export function mcpServerToolAlwaysToJSON(mcpServerToolAlways) {
|
|
98
|
+
return JSON.stringify(McpServerToolAlways$outboundSchema.parse(mcpServerToolAlways));
|
|
96
99
|
}
|
|
97
|
-
export function
|
|
98
|
-
return safeParse(jsonString, (x) =>
|
|
100
|
+
export function mcpServerToolAlwaysFromJSON(jsonString) {
|
|
101
|
+
return safeParse(jsonString, (x) => McpServerToolAlways$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpServerToolAlways' from JSON`);
|
|
99
102
|
}
|
|
100
103
|
/** @internal */
|
|
101
|
-
export const
|
|
104
|
+
export const McpServerToolNever$inboundSchema = collectExtraKeys$(z.object({
|
|
105
|
+
read_only: z.boolean().optional(),
|
|
102
106
|
tool_names: z.array(z.string()).optional(),
|
|
103
|
-
}).transform((v) => {
|
|
107
|
+
}).catchall(z.any()), "additionalProperties", true).transform((v) => {
|
|
104
108
|
return remap$(v, {
|
|
109
|
+
"read_only": "readOnly",
|
|
105
110
|
"tool_names": "toolNames",
|
|
106
111
|
});
|
|
107
112
|
});
|
|
108
113
|
/** @internal */
|
|
109
|
-
export const
|
|
114
|
+
export const McpServerToolNever$outboundSchema = z.object({
|
|
115
|
+
readOnly: z.boolean().optional(),
|
|
110
116
|
toolNames: z.array(z.string()).optional(),
|
|
117
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
111
118
|
}).transform((v) => {
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
return {
|
|
120
|
+
...v.additionalProperties,
|
|
121
|
+
...remap$(v, {
|
|
122
|
+
readOnly: "read_only",
|
|
123
|
+
toolNames: "tool_names",
|
|
124
|
+
additionalProperties: null,
|
|
125
|
+
}),
|
|
126
|
+
};
|
|
115
127
|
});
|
|
116
|
-
export function
|
|
117
|
-
return JSON.stringify(
|
|
128
|
+
export function mcpServerToolNeverToJSON(mcpServerToolNever) {
|
|
129
|
+
return JSON.stringify(McpServerToolNever$outboundSchema.parse(mcpServerToolNever));
|
|
118
130
|
}
|
|
119
|
-
export function
|
|
120
|
-
return safeParse(jsonString, (x) =>
|
|
131
|
+
export function mcpServerToolNeverFromJSON(jsonString) {
|
|
132
|
+
return safeParse(jsonString, (x) => McpServerToolNever$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpServerToolNever' from JSON`);
|
|
121
133
|
}
|
|
122
134
|
/** @internal */
|
|
123
|
-
export const
|
|
124
|
-
always: z.lazy(() =>
|
|
125
|
-
never: z.lazy(() =>
|
|
126
|
-
});
|
|
135
|
+
export const McpServerToolRequireApproval$inboundSchema = collectExtraKeys$(z.object({
|
|
136
|
+
always: z.lazy(() => McpServerToolAlways$inboundSchema).optional(),
|
|
137
|
+
never: z.lazy(() => McpServerToolNever$inboundSchema).optional(),
|
|
138
|
+
}).catchall(z.any()), "additionalProperties", true);
|
|
127
139
|
/** @internal */
|
|
128
|
-
export const
|
|
129
|
-
always: z.lazy(() =>
|
|
130
|
-
never: z.lazy(() =>
|
|
140
|
+
export const McpServerToolRequireApproval$outboundSchema = z.object({
|
|
141
|
+
always: z.lazy(() => McpServerToolAlways$outboundSchema).optional(),
|
|
142
|
+
never: z.lazy(() => McpServerToolNever$outboundSchema).optional(),
|
|
143
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
144
|
+
}).transform((v) => {
|
|
145
|
+
return {
|
|
146
|
+
...v.additionalProperties,
|
|
147
|
+
...remap$(v, {
|
|
148
|
+
additionalProperties: null,
|
|
149
|
+
}),
|
|
150
|
+
};
|
|
131
151
|
});
|
|
132
|
-
export function
|
|
133
|
-
return JSON.stringify(
|
|
152
|
+
export function mcpServerToolRequireApprovalToJSON(mcpServerToolRequireApproval) {
|
|
153
|
+
return JSON.stringify(McpServerToolRequireApproval$outboundSchema.parse(mcpServerToolRequireApproval));
|
|
134
154
|
}
|
|
135
|
-
export function
|
|
136
|
-
return safeParse(jsonString, (x) =>
|
|
155
|
+
export function mcpServerToolRequireApprovalFromJSON(jsonString) {
|
|
156
|
+
return safeParse(jsonString, (x) => McpServerToolRequireApproval$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpServerToolRequireApproval' from JSON`);
|
|
137
157
|
}
|
|
138
158
|
/** @internal */
|
|
139
|
-
export const
|
|
140
|
-
z.lazy(() =>
|
|
141
|
-
|
|
142
|
-
|
|
159
|
+
export const McpServerToolRequireApprovalUnion$inboundSchema = z.union([
|
|
160
|
+
z.lazy(() => McpServerToolRequireApproval$inboundSchema),
|
|
161
|
+
McpServerToolRequireApprovalAlways$inboundSchema,
|
|
162
|
+
McpServerToolRequireApprovalNever$inboundSchema,
|
|
143
163
|
]);
|
|
144
164
|
/** @internal */
|
|
145
|
-
export const
|
|
146
|
-
z.lazy(() =>
|
|
147
|
-
|
|
148
|
-
|
|
165
|
+
export const McpServerToolRequireApprovalUnion$outboundSchema = z.union([
|
|
166
|
+
z.lazy(() => McpServerToolRequireApproval$outboundSchema),
|
|
167
|
+
McpServerToolRequireApprovalAlways$outboundSchema,
|
|
168
|
+
McpServerToolRequireApprovalNever$outboundSchema,
|
|
149
169
|
]);
|
|
150
|
-
export function
|
|
151
|
-
return JSON.stringify(
|
|
170
|
+
export function mcpServerToolRequireApprovalUnionToJSON(mcpServerToolRequireApprovalUnion) {
|
|
171
|
+
return JSON.stringify(McpServerToolRequireApprovalUnion$outboundSchema.parse(mcpServerToolRequireApprovalUnion));
|
|
152
172
|
}
|
|
153
|
-
export function
|
|
154
|
-
return safeParse(jsonString, (x) =>
|
|
173
|
+
export function mcpServerToolRequireApprovalUnionFromJSON(jsonString) {
|
|
174
|
+
return safeParse(jsonString, (x) => McpServerToolRequireApprovalUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'McpServerToolRequireApprovalUnion' from JSON`);
|
|
155
175
|
}
|
|
156
176
|
/** @internal */
|
|
157
177
|
export const McpServerToolType$inboundSchema = z.enum(McpServerToolType);
|
|
158
178
|
/** @internal */
|
|
159
179
|
export const McpServerToolType$outboundSchema = McpServerToolType$inboundSchema;
|
|
160
180
|
/** @internal */
|
|
161
|
-
export const McpServerTool$inboundSchema = z
|
|
162
|
-
.
|
|
163
|
-
|
|
181
|
+
export const McpServerTool$inboundSchema = collectExtraKeys$(z.object({
|
|
182
|
+
allowed_tools: z.nullable(z.union([
|
|
183
|
+
z.array(z.string()),
|
|
184
|
+
z.lazy(() => McpServerToolAllowedTools$inboundSchema),
|
|
185
|
+
])).optional(),
|
|
164
186
|
authorization: z.string().optional(),
|
|
165
|
-
connector_id:
|
|
187
|
+
connector_id: z.string().optional(),
|
|
166
188
|
headers: z.nullable(z.record(z.string(), z.string())).optional(),
|
|
167
189
|
require_approval: z.nullable(z.union([
|
|
168
|
-
z.lazy(() =>
|
|
169
|
-
|
|
170
|
-
|
|
190
|
+
z.lazy(() => McpServerToolRequireApproval$inboundSchema),
|
|
191
|
+
McpServerToolRequireApprovalAlways$inboundSchema,
|
|
192
|
+
McpServerToolRequireApprovalNever$inboundSchema,
|
|
171
193
|
])).optional(),
|
|
172
194
|
server_description: z.string().optional(),
|
|
173
195
|
server_label: z.string(),
|
|
174
196
|
server_url: z.string().optional(),
|
|
175
197
|
type: McpServerToolType$inboundSchema,
|
|
176
|
-
}).transform((v) => {
|
|
198
|
+
}).catchall(z.any()), "additionalProperties", true).transform((v) => {
|
|
177
199
|
return remap$(v, {
|
|
178
200
|
"allowed_tools": "allowedTools",
|
|
179
201
|
"connector_id": "connectorId",
|
|
@@ -185,28 +207,36 @@ export const McpServerTool$inboundSchema = z
|
|
|
185
207
|
});
|
|
186
208
|
/** @internal */
|
|
187
209
|
export const McpServerTool$outboundSchema = z.object({
|
|
188
|
-
allowedTools: z.nullable(z.union([
|
|
210
|
+
allowedTools: z.nullable(z.union([
|
|
211
|
+
z.array(z.string()),
|
|
212
|
+
z.lazy(() => McpServerToolAllowedTools$outboundSchema),
|
|
213
|
+
])).optional(),
|
|
189
214
|
authorization: z.string().optional(),
|
|
190
|
-
connectorId:
|
|
215
|
+
connectorId: z.string().optional(),
|
|
191
216
|
headers: z.nullable(z.record(z.string(), z.string())).optional(),
|
|
192
217
|
requireApproval: z.nullable(z.union([
|
|
193
|
-
z.lazy(() =>
|
|
194
|
-
|
|
195
|
-
|
|
218
|
+
z.lazy(() => McpServerToolRequireApproval$outboundSchema),
|
|
219
|
+
McpServerToolRequireApprovalAlways$outboundSchema,
|
|
220
|
+
McpServerToolRequireApprovalNever$outboundSchema,
|
|
196
221
|
])).optional(),
|
|
197
222
|
serverDescription: z.string().optional(),
|
|
198
223
|
serverLabel: z.string(),
|
|
199
224
|
serverUrl: z.string().optional(),
|
|
200
225
|
type: McpServerToolType$outboundSchema,
|
|
226
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
201
227
|
}).transform((v) => {
|
|
202
|
-
return
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
228
|
+
return {
|
|
229
|
+
...v.additionalProperties,
|
|
230
|
+
...remap$(v, {
|
|
231
|
+
allowedTools: "allowed_tools",
|
|
232
|
+
connectorId: "connector_id",
|
|
233
|
+
requireApproval: "require_approval",
|
|
234
|
+
serverDescription: "server_description",
|
|
235
|
+
serverLabel: "server_label",
|
|
236
|
+
serverUrl: "server_url",
|
|
237
|
+
additionalProperties: null,
|
|
238
|
+
}),
|
|
239
|
+
};
|
|
210
240
|
});
|
|
211
241
|
export function mcpServerToolToJSON(mcpServerTool) {
|
|
212
242
|
return JSON.stringify(McpServerTool$outboundSchema.parse(mcpServerTool));
|