@openrouter/sdk 1.5.55 → 1.5.57
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/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 +51 -4
- package/esm/models/imagegenerationrequest.js +32 -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 +5 -5
- 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
|
@@ -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));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { McpServerToolParameters, McpServerToolParameters$Outbound } from "./mcpservertoolparameters.js";
|
|
4
|
+
export declare const McpServerToolOpenRouterType: {
|
|
5
|
+
readonly OpenrouterMcp: "openrouter:mcp";
|
|
6
|
+
};
|
|
7
|
+
export type McpServerToolOpenRouterType = ClosedEnum<typeof McpServerToolOpenRouterType>;
|
|
8
|
+
/**
|
|
9
|
+
* OpenRouter built-in server tool: connects the model to a remote MCP server and runs its tools during the response
|
|
10
|
+
*/
|
|
11
|
+
export type McpServerToolOpenRouter = {
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for a remote MCP server tool.
|
|
14
|
+
*/
|
|
15
|
+
parameters: McpServerToolParameters;
|
|
16
|
+
type: McpServerToolOpenRouterType;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const McpServerToolOpenRouterType$outboundSchema: z.ZodEnum<typeof McpServerToolOpenRouterType>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type McpServerToolOpenRouter$Outbound = {
|
|
22
|
+
parameters: McpServerToolParameters$Outbound;
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const McpServerToolOpenRouter$outboundSchema: z.ZodType<McpServerToolOpenRouter$Outbound, McpServerToolOpenRouter>;
|
|
27
|
+
export declare function mcpServerToolOpenRouterToJSON(mcpServerToolOpenRouter: McpServerToolOpenRouter): string;
|
|
28
|
+
//# sourceMappingURL=mcpservertoolopenrouter.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: b5876373424f
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { McpServerToolParameters$outboundSchema, } from "./mcpservertoolparameters.js";
|
|
7
|
+
export const McpServerToolOpenRouterType = {
|
|
8
|
+
OpenrouterMcp: "openrouter:mcp",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const McpServerToolOpenRouterType$outboundSchema = z.enum(McpServerToolOpenRouterType);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const McpServerToolOpenRouter$outboundSchema = z.object({
|
|
14
|
+
parameters: McpServerToolParameters$outboundSchema,
|
|
15
|
+
type: McpServerToolOpenRouterType$outboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function mcpServerToolOpenRouterToJSON(mcpServerToolOpenRouter) {
|
|
18
|
+
return JSON.stringify(McpServerToolOpenRouter$outboundSchema.parse(mcpServerToolOpenRouter));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=mcpservertoolopenrouter.js.map
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
export type McpServerToolParametersAllowedTools = {
|
|
4
|
+
readOnly?: boolean | undefined;
|
|
5
|
+
toolNames?: Array<string> | undefined;
|
|
6
|
+
additionalProperties?: {
|
|
7
|
+
[k: string]: any;
|
|
8
|
+
} | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Restrict the tools exposed to the model to this list or filter.
|
|
12
|
+
*/
|
|
13
|
+
export type McpServerToolParametersAllowedToolsUnion = Array<string> | McpServerToolParametersAllowedTools;
|
|
14
|
+
export declare const McpServerToolParametersRequireApprovalNever: {
|
|
15
|
+
readonly Never: "never";
|
|
16
|
+
};
|
|
17
|
+
export type McpServerToolParametersRequireApprovalNever = ClosedEnum<typeof McpServerToolParametersRequireApprovalNever>;
|
|
18
|
+
export declare const McpServerToolParametersRequireApprovalAlways: {
|
|
19
|
+
readonly Always: "always";
|
|
20
|
+
};
|
|
21
|
+
export type McpServerToolParametersRequireApprovalAlways = ClosedEnum<typeof McpServerToolParametersRequireApprovalAlways>;
|
|
22
|
+
export type McpServerToolParametersAlways = {
|
|
23
|
+
readOnly?: boolean | undefined;
|
|
24
|
+
toolNames?: Array<string> | undefined;
|
|
25
|
+
additionalProperties?: {
|
|
26
|
+
[k: string]: any;
|
|
27
|
+
} | undefined;
|
|
28
|
+
};
|
|
29
|
+
export type McpServerToolParametersNever = {
|
|
30
|
+
readOnly?: boolean | undefined;
|
|
31
|
+
toolNames?: Array<string> | undefined;
|
|
32
|
+
additionalProperties?: {
|
|
33
|
+
[k: string]: any;
|
|
34
|
+
} | undefined;
|
|
35
|
+
};
|
|
36
|
+
export type McpServerToolParametersRequireApproval = {
|
|
37
|
+
always?: McpServerToolParametersAlways | undefined;
|
|
38
|
+
never?: McpServerToolParametersNever | undefined;
|
|
39
|
+
additionalProperties?: {
|
|
40
|
+
[k: string]: any;
|
|
41
|
+
} | undefined;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Approval policy for tool calls. Defaults to always: a call that needs approval ends the response with an mcp_approval_request item, answered with an mcp_approval_response on the next request.
|
|
45
|
+
*/
|
|
46
|
+
export type McpServerToolParametersRequireApprovalUnion = McpServerToolParametersRequireApproval | McpServerToolParametersRequireApprovalAlways | McpServerToolParametersRequireApprovalNever;
|
|
47
|
+
/**
|
|
48
|
+
* Configuration for a remote MCP server tool.
|
|
49
|
+
*/
|
|
50
|
+
export type McpServerToolParameters = {
|
|
51
|
+
/**
|
|
52
|
+
* Restrict the tools exposed to the model to this list or filter.
|
|
53
|
+
*/
|
|
54
|
+
allowedTools?: Array<string> | McpServerToolParametersAllowedTools | null | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* OAuth access token sent as the Authorization bearer to the server.
|
|
57
|
+
*/
|
|
58
|
+
authorization?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Provider-defined connector identifier, forwarded as written to providers that run MCP themselves.
|
|
61
|
+
*/
|
|
62
|
+
connectorId?: string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Extra headers sent on every request to the server.
|
|
65
|
+
*/
|
|
66
|
+
headers?: {
|
|
67
|
+
[k: string]: string;
|
|
68
|
+
} | null | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Approval policy for tool calls. Defaults to always: a call that needs approval ends the response with an mcp_approval_request item, answered with an mcp_approval_response on the next request.
|
|
71
|
+
*/
|
|
72
|
+
requireApproval?: McpServerToolParametersRequireApproval | McpServerToolParametersRequireApprovalAlways | McpServerToolParametersRequireApprovalNever | null | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Extra context about the server, shown to the model.
|
|
75
|
+
*/
|
|
76
|
+
serverDescription?: string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Label for this MCP server, used in mcp_list_tools and mcp_call items.
|
|
79
|
+
*/
|
|
80
|
+
serverLabel: string;
|
|
81
|
+
/**
|
|
82
|
+
* URL of the remote MCP server (streamable HTTP).
|
|
83
|
+
*/
|
|
84
|
+
serverUrl?: string | undefined;
|
|
85
|
+
};
|
|
86
|
+
/** @internal */
|
|
87
|
+
export type McpServerToolParametersAllowedTools$Outbound = {
|
|
88
|
+
read_only?: boolean | undefined;
|
|
89
|
+
tool_names?: Array<string> | undefined;
|
|
90
|
+
[additionalProperties: string]: unknown;
|
|
91
|
+
};
|
|
92
|
+
/** @internal */
|
|
93
|
+
export declare const McpServerToolParametersAllowedTools$outboundSchema: z.ZodType<McpServerToolParametersAllowedTools$Outbound, McpServerToolParametersAllowedTools>;
|
|
94
|
+
export declare function mcpServerToolParametersAllowedToolsToJSON(mcpServerToolParametersAllowedTools: McpServerToolParametersAllowedTools): string;
|
|
95
|
+
/** @internal */
|
|
96
|
+
export type McpServerToolParametersAllowedToolsUnion$Outbound = Array<string> | McpServerToolParametersAllowedTools$Outbound;
|
|
97
|
+
/** @internal */
|
|
98
|
+
export declare const McpServerToolParametersAllowedToolsUnion$outboundSchema: z.ZodType<McpServerToolParametersAllowedToolsUnion$Outbound, McpServerToolParametersAllowedToolsUnion>;
|
|
99
|
+
export declare function mcpServerToolParametersAllowedToolsUnionToJSON(mcpServerToolParametersAllowedToolsUnion: McpServerToolParametersAllowedToolsUnion): string;
|
|
100
|
+
/** @internal */
|
|
101
|
+
export declare const McpServerToolParametersRequireApprovalNever$outboundSchema: z.ZodEnum<typeof McpServerToolParametersRequireApprovalNever>;
|
|
102
|
+
/** @internal */
|
|
103
|
+
export declare const McpServerToolParametersRequireApprovalAlways$outboundSchema: z.ZodEnum<typeof McpServerToolParametersRequireApprovalAlways>;
|
|
104
|
+
/** @internal */
|
|
105
|
+
export type McpServerToolParametersAlways$Outbound = {
|
|
106
|
+
read_only?: boolean | undefined;
|
|
107
|
+
tool_names?: Array<string> | undefined;
|
|
108
|
+
[additionalProperties: string]: unknown;
|
|
109
|
+
};
|
|
110
|
+
/** @internal */
|
|
111
|
+
export declare const McpServerToolParametersAlways$outboundSchema: z.ZodType<McpServerToolParametersAlways$Outbound, McpServerToolParametersAlways>;
|
|
112
|
+
export declare function mcpServerToolParametersAlwaysToJSON(mcpServerToolParametersAlways: McpServerToolParametersAlways): string;
|
|
113
|
+
/** @internal */
|
|
114
|
+
export type McpServerToolParametersNever$Outbound = {
|
|
115
|
+
read_only?: boolean | undefined;
|
|
116
|
+
tool_names?: Array<string> | undefined;
|
|
117
|
+
[additionalProperties: string]: unknown;
|
|
118
|
+
};
|
|
119
|
+
/** @internal */
|
|
120
|
+
export declare const McpServerToolParametersNever$outboundSchema: z.ZodType<McpServerToolParametersNever$Outbound, McpServerToolParametersNever>;
|
|
121
|
+
export declare function mcpServerToolParametersNeverToJSON(mcpServerToolParametersNever: McpServerToolParametersNever): string;
|
|
122
|
+
/** @internal */
|
|
123
|
+
export type McpServerToolParametersRequireApproval$Outbound = {
|
|
124
|
+
always?: McpServerToolParametersAlways$Outbound | undefined;
|
|
125
|
+
never?: McpServerToolParametersNever$Outbound | undefined;
|
|
126
|
+
[additionalProperties: string]: unknown;
|
|
127
|
+
};
|
|
128
|
+
/** @internal */
|
|
129
|
+
export declare const McpServerToolParametersRequireApproval$outboundSchema: z.ZodType<McpServerToolParametersRequireApproval$Outbound, McpServerToolParametersRequireApproval>;
|
|
130
|
+
export declare function mcpServerToolParametersRequireApprovalToJSON(mcpServerToolParametersRequireApproval: McpServerToolParametersRequireApproval): string;
|
|
131
|
+
/** @internal */
|
|
132
|
+
export type McpServerToolParametersRequireApprovalUnion$Outbound = McpServerToolParametersRequireApproval$Outbound | string | string;
|
|
133
|
+
/** @internal */
|
|
134
|
+
export declare const McpServerToolParametersRequireApprovalUnion$outboundSchema: z.ZodType<McpServerToolParametersRequireApprovalUnion$Outbound, McpServerToolParametersRequireApprovalUnion>;
|
|
135
|
+
export declare function mcpServerToolParametersRequireApprovalUnionToJSON(mcpServerToolParametersRequireApprovalUnion: McpServerToolParametersRequireApprovalUnion): string;
|
|
136
|
+
/** @internal */
|
|
137
|
+
export type McpServerToolParameters$Outbound = {
|
|
138
|
+
allowed_tools?: Array<string> | McpServerToolParametersAllowedTools$Outbound | null | undefined;
|
|
139
|
+
authorization?: string | undefined;
|
|
140
|
+
connector_id?: string | undefined;
|
|
141
|
+
headers?: {
|
|
142
|
+
[k: string]: string;
|
|
143
|
+
} | null | undefined;
|
|
144
|
+
require_approval?: McpServerToolParametersRequireApproval$Outbound | string | string | null | undefined;
|
|
145
|
+
server_description?: string | undefined;
|
|
146
|
+
server_label: string;
|
|
147
|
+
server_url?: string | undefined;
|
|
148
|
+
};
|
|
149
|
+
/** @internal */
|
|
150
|
+
export declare const McpServerToolParameters$outboundSchema: z.ZodType<McpServerToolParameters$Outbound, McpServerToolParameters>;
|
|
151
|
+
export declare function mcpServerToolParametersToJSON(mcpServerToolParameters: McpServerToolParameters): string;
|
|
152
|
+
//# sourceMappingURL=mcpservertoolparameters.d.ts.map
|