@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.
Files changed (105) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/additionaltoolsitem.d.ts +5 -4
  4. package/esm/models/additionaltoolsitem.js +3 -0
  5. package/esm/models/alignmentresponsesrejected.d.ts +4 -1
  6. package/esm/models/alignmentresponsesrejected.js +6 -0
  7. package/esm/models/byokproviderslug.d.ts +1 -0
  8. package/esm/models/byokproviderslug.js +1 -0
  9. package/esm/models/createworkspacerequest.d.ts +1 -0
  10. package/esm/models/createworkspacerequest.js +1 -0
  11. package/esm/models/decisionschoicequestion.d.ts +4 -4
  12. package/esm/models/decisionschoicequestion.js +1 -5
  13. package/esm/models/decisionsnoulquestion.d.ts +12 -12
  14. package/esm/models/decisionsnoulquestion.js +3 -7
  15. package/esm/models/decisionsresponse.d.ts +12 -0
  16. package/esm/models/decisionsresponse.js +5 -0
  17. package/esm/models/decisionsscorequestion.d.ts +4 -4
  18. package/esm/models/decisionsscorequestion.js +1 -5
  19. package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
  20. package/esm/models/imagegenerationproviderpreferences.js +1 -0
  21. package/esm/models/imagegenerationrequest.d.ts +1 -1
  22. package/esm/models/index.d.ts +6 -0
  23. package/esm/models/index.js +6 -0
  24. package/esm/models/mcpapprovalrequestitem.d.ts +7 -0
  25. package/esm/models/mcpapprovalrequestitem.js +19 -1
  26. package/esm/models/mcpcallitem.d.ts +17 -1
  27. package/esm/models/mcpcallitem.js +18 -0
  28. package/esm/models/mcpservertool.d.ts +78 -69
  29. package/esm/models/mcpservertool.js +135 -105
  30. package/esm/models/mcpservertoolopenrouter.d.ts +28 -0
  31. package/esm/models/mcpservertoolopenrouter.js +20 -0
  32. package/esm/models/mcpservertoolparameters.d.ts +152 -0
  33. package/esm/models/mcpservertoolparameters.js +134 -0
  34. package/esm/models/openairesponsestoolchoiceunion.d.ts +3 -2
  35. package/esm/models/openairesponsestoolchoiceunion.js +3 -0
  36. package/esm/models/operations/listbyokkeys.d.ts +1 -0
  37. package/esm/models/operations/listbyokkeys.js +1 -0
  38. package/esm/models/outputitemmcpapprovalrequest.d.ts +14 -0
  39. package/esm/models/outputitemmcpapprovalrequest.js +23 -0
  40. package/esm/models/outputitemmcpcall.d.ts +74 -0
  41. package/esm/models/outputitemmcpcall.js +94 -0
  42. package/esm/models/outputitemmcplisttools.d.ts +25 -0
  43. package/esm/models/outputitemmcplisttools.js +37 -0
  44. package/esm/models/outputitems.d.ts +3 -0
  45. package/esm/models/outputitems.js +2 -0
  46. package/esm/models/providername.d.ts +1 -0
  47. package/esm/models/providername.js +1 -0
  48. package/esm/models/provideroptions.d.ts +6 -0
  49. package/esm/models/provideroptions.js +1 -0
  50. package/esm/models/providerresponse.d.ts +1 -0
  51. package/esm/models/providerresponse.js +1 -0
  52. package/esm/models/responsesrequest.d.ts +9 -0
  53. package/esm/models/responsesrequest.js +3 -0
  54. package/esm/models/toolchoicemcp.d.ts +33 -0
  55. package/esm/models/toolchoicemcp.js +42 -0
  56. package/esm/models/toolsearchoutputitem.d.ts +5 -4
  57. package/esm/models/toolsearchoutputitem.js +3 -0
  58. package/esm/models/updateworkspacerequest.d.ts +1 -0
  59. package/esm/models/updateworkspacerequest.js +1 -0
  60. package/esm/models/videogenerationrequest.d.ts +6 -0
  61. package/esm/models/videogenerationrequest.js +1 -0
  62. package/esm/sdk/sdk.d.ts +0 -9
  63. package/esm/sdk/sdk.js +1 -7
  64. package/jsr.json +1 -1
  65. package/package.json +8 -8
  66. package/esm/funcs/call-model.d.ts +0 -67
  67. package/esm/funcs/call-model.js +0 -98
  68. package/esm/lib/anthropic-compat.d.ts +0 -51
  69. package/esm/lib/anthropic-compat.js +0 -222
  70. package/esm/lib/async-params.d.ts +0 -107
  71. package/esm/lib/async-params.js +0 -88
  72. package/esm/lib/chat-compat.d.ts +0 -47
  73. package/esm/lib/chat-compat.js +0 -111
  74. package/esm/lib/claude-constants.d.ts +0 -22
  75. package/esm/lib/claude-constants.js +0 -20
  76. package/esm/lib/claude-type-guards.d.ts +0 -10
  77. package/esm/lib/claude-type-guards.js +0 -70
  78. package/esm/lib/conversation-state.d.ts +0 -63
  79. package/esm/lib/conversation-state.js +0 -210
  80. package/esm/lib/model-result.d.ts +0 -373
  81. package/esm/lib/model-result.js +0 -1414
  82. package/esm/lib/next-turn-params.d.ts +0 -30
  83. package/esm/lib/next-turn-params.js +0 -135
  84. package/esm/lib/reusable-stream.d.ts +0 -39
  85. package/esm/lib/reusable-stream.js +0 -192
  86. package/esm/lib/stop-conditions.d.ts +0 -80
  87. package/esm/lib/stop-conditions.js +0 -104
  88. package/esm/lib/stream-transformers.d.ts +0 -118
  89. package/esm/lib/stream-transformers.js +0 -852
  90. package/esm/lib/stream-type-guards.d.ts +0 -49
  91. package/esm/lib/stream-type-guards.js +0 -85
  92. package/esm/lib/tool-context.d.ts +0 -68
  93. package/esm/lib/tool-context.js +0 -175
  94. package/esm/lib/tool-event-broadcaster.d.ts +0 -44
  95. package/esm/lib/tool-event-broadcaster.js +0 -146
  96. package/esm/lib/tool-executor.d.ts +0 -74
  97. package/esm/lib/tool-executor.js +0 -267
  98. package/esm/lib/tool-orchestrator.d.ts +0 -52
  99. package/esm/lib/tool-orchestrator.js +0 -180
  100. package/esm/lib/tool-types.d.ts +0 -573
  101. package/esm/lib/tool-types.js +0 -80
  102. package/esm/lib/tool.d.ts +0 -108
  103. package/esm/lib/tool.js +0 -74
  104. package/esm/lib/turn-context.d.ts +0 -52
  105. package/esm/lib/turn-context.js +0 -59
@@ -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
@@ -0,0 +1,134 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: e667706c2ed9
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ export const McpServerToolParametersRequireApprovalNever = {
8
+ Never: "never",
9
+ };
10
+ export const McpServerToolParametersRequireApprovalAlways = {
11
+ Always: "always",
12
+ };
13
+ /** @internal */
14
+ export const McpServerToolParametersAllowedTools$outboundSchema = z.object({
15
+ readOnly: z.boolean().optional(),
16
+ toolNames: z.array(z.string()).optional(),
17
+ additionalProperties: z.record(z.string(), z.any()).optional(),
18
+ }).transform((v) => {
19
+ return {
20
+ ...v.additionalProperties,
21
+ ...remap$(v, {
22
+ readOnly: "read_only",
23
+ toolNames: "tool_names",
24
+ additionalProperties: null,
25
+ }),
26
+ };
27
+ });
28
+ export function mcpServerToolParametersAllowedToolsToJSON(mcpServerToolParametersAllowedTools) {
29
+ return JSON.stringify(McpServerToolParametersAllowedTools$outboundSchema.parse(mcpServerToolParametersAllowedTools));
30
+ }
31
+ /** @internal */
32
+ export const McpServerToolParametersAllowedToolsUnion$outboundSchema = z.union([
33
+ z.array(z.string()),
34
+ z.lazy(() => McpServerToolParametersAllowedTools$outboundSchema),
35
+ ]);
36
+ export function mcpServerToolParametersAllowedToolsUnionToJSON(mcpServerToolParametersAllowedToolsUnion) {
37
+ return JSON.stringify(McpServerToolParametersAllowedToolsUnion$outboundSchema.parse(mcpServerToolParametersAllowedToolsUnion));
38
+ }
39
+ /** @internal */
40
+ export const McpServerToolParametersRequireApprovalNever$outboundSchema = z.enum(McpServerToolParametersRequireApprovalNever);
41
+ /** @internal */
42
+ export const McpServerToolParametersRequireApprovalAlways$outboundSchema = z.enum(McpServerToolParametersRequireApprovalAlways);
43
+ /** @internal */
44
+ export const McpServerToolParametersAlways$outboundSchema = z.object({
45
+ readOnly: z.boolean().optional(),
46
+ toolNames: z.array(z.string()).optional(),
47
+ additionalProperties: z.record(z.string(), z.any()).optional(),
48
+ }).transform((v) => {
49
+ return {
50
+ ...v.additionalProperties,
51
+ ...remap$(v, {
52
+ readOnly: "read_only",
53
+ toolNames: "tool_names",
54
+ additionalProperties: null,
55
+ }),
56
+ };
57
+ });
58
+ export function mcpServerToolParametersAlwaysToJSON(mcpServerToolParametersAlways) {
59
+ return JSON.stringify(McpServerToolParametersAlways$outboundSchema.parse(mcpServerToolParametersAlways));
60
+ }
61
+ /** @internal */
62
+ export const McpServerToolParametersNever$outboundSchema = z.object({
63
+ readOnly: z.boolean().optional(),
64
+ toolNames: z.array(z.string()).optional(),
65
+ additionalProperties: z.record(z.string(), z.any()).optional(),
66
+ }).transform((v) => {
67
+ return {
68
+ ...v.additionalProperties,
69
+ ...remap$(v, {
70
+ readOnly: "read_only",
71
+ toolNames: "tool_names",
72
+ additionalProperties: null,
73
+ }),
74
+ };
75
+ });
76
+ export function mcpServerToolParametersNeverToJSON(mcpServerToolParametersNever) {
77
+ return JSON.stringify(McpServerToolParametersNever$outboundSchema.parse(mcpServerToolParametersNever));
78
+ }
79
+ /** @internal */
80
+ export const McpServerToolParametersRequireApproval$outboundSchema = z.object({
81
+ always: z.lazy(() => McpServerToolParametersAlways$outboundSchema).optional(),
82
+ never: z.lazy(() => McpServerToolParametersNever$outboundSchema).optional(),
83
+ additionalProperties: z.record(z.string(), z.any()).optional(),
84
+ }).transform((v) => {
85
+ return {
86
+ ...v.additionalProperties,
87
+ ...remap$(v, {
88
+ additionalProperties: null,
89
+ }),
90
+ };
91
+ });
92
+ export function mcpServerToolParametersRequireApprovalToJSON(mcpServerToolParametersRequireApproval) {
93
+ return JSON.stringify(McpServerToolParametersRequireApproval$outboundSchema.parse(mcpServerToolParametersRequireApproval));
94
+ }
95
+ /** @internal */
96
+ export const McpServerToolParametersRequireApprovalUnion$outboundSchema = z.union([
97
+ z.lazy(() => McpServerToolParametersRequireApproval$outboundSchema),
98
+ McpServerToolParametersRequireApprovalAlways$outboundSchema,
99
+ McpServerToolParametersRequireApprovalNever$outboundSchema,
100
+ ]);
101
+ export function mcpServerToolParametersRequireApprovalUnionToJSON(mcpServerToolParametersRequireApprovalUnion) {
102
+ return JSON.stringify(McpServerToolParametersRequireApprovalUnion$outboundSchema.parse(mcpServerToolParametersRequireApprovalUnion));
103
+ }
104
+ /** @internal */
105
+ export const McpServerToolParameters$outboundSchema = z.object({
106
+ allowedTools: z.nullable(z.union([
107
+ z.array(z.string()),
108
+ z.lazy(() => McpServerToolParametersAllowedTools$outboundSchema),
109
+ ])).optional(),
110
+ authorization: z.string().optional(),
111
+ connectorId: z.string().optional(),
112
+ headers: z.nullable(z.record(z.string(), z.string())).optional(),
113
+ requireApproval: z.nullable(z.union([
114
+ z.lazy(() => McpServerToolParametersRequireApproval$outboundSchema),
115
+ McpServerToolParametersRequireApprovalAlways$outboundSchema,
116
+ McpServerToolParametersRequireApprovalNever$outboundSchema,
117
+ ])).optional(),
118
+ serverDescription: z.string().optional(),
119
+ serverLabel: z.string(),
120
+ serverUrl: z.string().optional(),
121
+ }).transform((v) => {
122
+ return remap$(v, {
123
+ allowedTools: "allowed_tools",
124
+ connectorId: "connector_id",
125
+ requireApproval: "require_approval",
126
+ serverDescription: "server_description",
127
+ serverLabel: "server_label",
128
+ serverUrl: "server_url",
129
+ });
130
+ });
131
+ export function mcpServerToolParametersToJSON(mcpServerToolParameters) {
132
+ return JSON.stringify(McpServerToolParameters$outboundSchema.parse(mcpServerToolParameters));
133
+ }
134
+ //# sourceMappingURL=mcpservertoolparameters.js.map
@@ -3,6 +3,7 @@ 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
5
  import { ToolChoiceAllowed, ToolChoiceAllowed$Outbound } from "./toolchoiceallowed.js";
6
+ import { ToolChoiceMcp, ToolChoiceMcp$Outbound } from "./toolchoicemcp.js";
6
7
  export declare const OpenAIResponsesToolChoiceTypeShell: {
7
8
  readonly Shell: "shell";
8
9
  };
@@ -49,7 +50,7 @@ export declare const OpenAIResponsesToolChoiceAuto: {
49
50
  readonly Auto: "auto";
50
51
  };
51
52
  export type OpenAIResponsesToolChoiceAuto = ClosedEnum<typeof OpenAIResponsesToolChoiceAuto>;
52
- export type OpenAIResponsesToolChoiceUnion = ToolChoiceAllowed | OpenAIResponsesToolChoiceFunction | OpenAIResponsesToolChoice | OpenAIResponsesToolChoiceApplyPatch | OpenAIResponsesToolChoiceShell | OpenAIResponsesToolChoiceAuto | OpenAIResponsesToolChoiceNone | OpenAIResponsesToolChoiceRequired;
53
+ export type OpenAIResponsesToolChoiceUnion = ToolChoiceAllowed | OpenAIResponsesToolChoiceFunction | ToolChoiceMcp | OpenAIResponsesToolChoice | OpenAIResponsesToolChoiceApplyPatch | OpenAIResponsesToolChoiceShell | OpenAIResponsesToolChoiceAuto | OpenAIResponsesToolChoiceNone | OpenAIResponsesToolChoiceRequired;
53
54
  /** @internal */
54
55
  export declare const OpenAIResponsesToolChoiceTypeShell$inboundSchema: z.ZodEnum<typeof OpenAIResponsesToolChoiceTypeShell>;
55
56
  /** @internal */
@@ -134,7 +135,7 @@ export declare const OpenAIResponsesToolChoiceAuto$outboundSchema: z.ZodEnum<typ
134
135
  /** @internal */
135
136
  export declare const OpenAIResponsesToolChoiceUnion$inboundSchema: z.ZodType<OpenAIResponsesToolChoiceUnion, unknown>;
136
137
  /** @internal */
137
- export type OpenAIResponsesToolChoiceUnion$Outbound = ToolChoiceAllowed$Outbound | OpenAIResponsesToolChoiceFunction$Outbound | OpenAIResponsesToolChoice$Outbound | OpenAIResponsesToolChoiceApplyPatch$Outbound | OpenAIResponsesToolChoiceShell$Outbound | string | string | string;
138
+ export type OpenAIResponsesToolChoiceUnion$Outbound = ToolChoiceAllowed$Outbound | OpenAIResponsesToolChoiceFunction$Outbound | ToolChoiceMcp$Outbound | OpenAIResponsesToolChoice$Outbound | OpenAIResponsesToolChoiceApplyPatch$Outbound | OpenAIResponsesToolChoiceShell$Outbound | string | string | string;
138
139
  /** @internal */
139
140
  export declare const OpenAIResponsesToolChoiceUnion$outboundSchema: z.ZodType<OpenAIResponsesToolChoiceUnion$Outbound, OpenAIResponsesToolChoiceUnion>;
140
141
  export declare function openAIResponsesToolChoiceUnionToJSON(openAIResponsesToolChoiceUnion: OpenAIResponsesToolChoiceUnion): string;
@@ -5,6 +5,7 @@
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
7
  import { ToolChoiceAllowed$inboundSchema, ToolChoiceAllowed$outboundSchema, } from "./toolchoiceallowed.js";
8
+ import { ToolChoiceMcp$inboundSchema, ToolChoiceMcp$outboundSchema, } from "./toolchoicemcp.js";
8
9
  export const OpenAIResponsesToolChoiceTypeShell = {
9
10
  Shell: "shell",
10
11
  };
@@ -146,6 +147,7 @@ export const OpenAIResponsesToolChoiceAuto$outboundSchema = OpenAIResponsesToolC
146
147
  export const OpenAIResponsesToolChoiceUnion$inboundSchema = z.union([
147
148
  ToolChoiceAllowed$inboundSchema,
148
149
  z.lazy(() => OpenAIResponsesToolChoiceFunction$inboundSchema),
150
+ ToolChoiceMcp$inboundSchema,
149
151
  z.lazy(() => OpenAIResponsesToolChoice$inboundSchema),
150
152
  z.lazy(() => OpenAIResponsesToolChoiceApplyPatch$inboundSchema),
151
153
  z.lazy(() => OpenAIResponsesToolChoiceShell$inboundSchema),
@@ -157,6 +159,7 @@ export const OpenAIResponsesToolChoiceUnion$inboundSchema = z.union([
157
159
  export const OpenAIResponsesToolChoiceUnion$outboundSchema = z.union([
158
160
  ToolChoiceAllowed$outboundSchema,
159
161
  z.lazy(() => OpenAIResponsesToolChoiceFunction$outboundSchema),
162
+ ToolChoiceMcp$outboundSchema,
160
163
  z.lazy(() => OpenAIResponsesToolChoice$outboundSchema),
161
164
  z.lazy(() => OpenAIResponsesToolChoiceApplyPatch$outboundSchema),
162
165
  z.lazy(() => OpenAIResponsesToolChoiceShell$outboundSchema),
@@ -124,6 +124,7 @@ export declare const Provider: {
124
124
  readonly Reka: "reka";
125
125
  readonly Relace: "relace";
126
126
  readonly Respan: "respan";
127
+ readonly River: "river";
127
128
  readonly Runway: "runway";
128
129
  readonly SailResearch: "sail-research";
129
130
  readonly Sakana: "sakana";
@@ -107,6 +107,7 @@ export const Provider = {
107
107
  Reka: "reka",
108
108
  Relace: "relace",
109
109
  Respan: "respan",
110
+ River: "river",
110
111
  Runway: "runway",
111
112
  SailResearch: "sail-research",
112
113
  Sakana: "sakana",
@@ -0,0 +1,14 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ export type OutputItemMcpApprovalRequest = {
5
+ arguments: string;
6
+ id: string;
7
+ name: string;
8
+ serverLabel: string;
9
+ type: "mcp_approval_request";
10
+ };
11
+ /** @internal */
12
+ export declare const OutputItemMcpApprovalRequest$inboundSchema: z.ZodType<OutputItemMcpApprovalRequest, unknown>;
13
+ export declare function outputItemMcpApprovalRequestFromJSON(jsonString: string): SafeParseResult<OutputItemMcpApprovalRequest, SDKValidationError>;
14
+ //# sourceMappingURL=outputitemmcpapprovalrequest.d.ts.map
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 09f3a53c2bdb
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ /** @internal */
9
+ export const OutputItemMcpApprovalRequest$inboundSchema = z.object({
10
+ arguments: z.string(),
11
+ id: z.string(),
12
+ name: z.string(),
13
+ server_label: z.string(),
14
+ type: z.literal("mcp_approval_request"),
15
+ }).transform((v) => {
16
+ return remap$(v, {
17
+ "server_label": "serverLabel",
18
+ });
19
+ });
20
+ export function outputItemMcpApprovalRequestFromJSON(jsonString) {
21
+ return safeParse(jsonString, (x) => OutputItemMcpApprovalRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputItemMcpApprovalRequest' from JSON`);
22
+ }
23
+ //# sourceMappingURL=outputitemmcpapprovalrequest.js.map
@@ -0,0 +1,74 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
+ import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ export declare const ErrorTypeHTTPError: {
6
+ readonly HttpError: "http_error";
7
+ };
8
+ export type ErrorTypeHTTPError = ClosedEnum<typeof ErrorTypeHTTPError>;
9
+ export type ErrorHTTPError = {
10
+ code: number;
11
+ message: string;
12
+ type: ErrorTypeHTTPError;
13
+ };
14
+ export declare const ErrorTypeMcpToolExecutionError: {
15
+ readonly McpToolExecutionError: "mcp_tool_execution_error";
16
+ };
17
+ export type ErrorTypeMcpToolExecutionError = ClosedEnum<typeof ErrorTypeMcpToolExecutionError>;
18
+ export type ErrorMcpToolExecutionError = {
19
+ content?: any | undefined;
20
+ type: ErrorTypeMcpToolExecutionError;
21
+ };
22
+ export declare const ErrorTypeMcpProtocolError: {
23
+ readonly McpProtocolError: "mcp_protocol_error";
24
+ };
25
+ export type ErrorTypeMcpProtocolError = ClosedEnum<typeof ErrorTypeMcpProtocolError>;
26
+ export type ErrorMcpProtocolError = {
27
+ code: number;
28
+ message: string;
29
+ type: ErrorTypeMcpProtocolError;
30
+ };
31
+ export type ErrorT = ErrorMcpProtocolError | ErrorHTTPError | ErrorMcpToolExecutionError | string;
32
+ export declare const OutputItemMcpCallStatus: {
33
+ readonly InProgress: "in_progress";
34
+ readonly Completed: "completed";
35
+ readonly Incomplete: "incomplete";
36
+ readonly Calling: "calling";
37
+ readonly Failed: "failed";
38
+ };
39
+ export type OutputItemMcpCallStatus = OpenEnum<typeof OutputItemMcpCallStatus>;
40
+ export type OutputItemMcpCall = {
41
+ approvalRequestId?: string | null | undefined;
42
+ arguments: string;
43
+ error?: ErrorMcpProtocolError | ErrorHTTPError | ErrorMcpToolExecutionError | string | null | undefined;
44
+ id: string;
45
+ name: string;
46
+ output?: string | null | undefined;
47
+ serverLabel: string;
48
+ status?: OutputItemMcpCallStatus | undefined;
49
+ type: "mcp_call";
50
+ };
51
+ /** @internal */
52
+ export declare const ErrorTypeHTTPError$inboundSchema: z.ZodEnum<typeof ErrorTypeHTTPError>;
53
+ /** @internal */
54
+ export declare const ErrorHTTPError$inboundSchema: z.ZodType<ErrorHTTPError, unknown>;
55
+ export declare function errorHTTPErrorFromJSON(jsonString: string): SafeParseResult<ErrorHTTPError, SDKValidationError>;
56
+ /** @internal */
57
+ export declare const ErrorTypeMcpToolExecutionError$inboundSchema: z.ZodEnum<typeof ErrorTypeMcpToolExecutionError>;
58
+ /** @internal */
59
+ export declare const ErrorMcpToolExecutionError$inboundSchema: z.ZodType<ErrorMcpToolExecutionError, unknown>;
60
+ export declare function errorMcpToolExecutionErrorFromJSON(jsonString: string): SafeParseResult<ErrorMcpToolExecutionError, SDKValidationError>;
61
+ /** @internal */
62
+ export declare const ErrorTypeMcpProtocolError$inboundSchema: z.ZodEnum<typeof ErrorTypeMcpProtocolError>;
63
+ /** @internal */
64
+ export declare const ErrorMcpProtocolError$inboundSchema: z.ZodType<ErrorMcpProtocolError, unknown>;
65
+ export declare function errorMcpProtocolErrorFromJSON(jsonString: string): SafeParseResult<ErrorMcpProtocolError, SDKValidationError>;
66
+ /** @internal */
67
+ export declare const ErrorT$inboundSchema: z.ZodType<ErrorT, unknown>;
68
+ export declare function errorFromJSON(jsonString: string): SafeParseResult<ErrorT, SDKValidationError>;
69
+ /** @internal */
70
+ export declare const OutputItemMcpCallStatus$inboundSchema: z.ZodType<OutputItemMcpCallStatus, unknown>;
71
+ /** @internal */
72
+ export declare const OutputItemMcpCall$inboundSchema: z.ZodType<OutputItemMcpCall, unknown>;
73
+ export declare function outputItemMcpCallFromJSON(jsonString: string): SafeParseResult<OutputItemMcpCall, SDKValidationError>;
74
+ //# sourceMappingURL=outputitemmcpcall.d.ts.map
@@ -0,0 +1,94 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 49ccb6659e1f
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import * as openEnums from "../types/enums.js";
9
+ export const ErrorTypeHTTPError = {
10
+ HttpError: "http_error",
11
+ };
12
+ export const ErrorTypeMcpToolExecutionError = {
13
+ McpToolExecutionError: "mcp_tool_execution_error",
14
+ };
15
+ export const ErrorTypeMcpProtocolError = {
16
+ McpProtocolError: "mcp_protocol_error",
17
+ };
18
+ export const OutputItemMcpCallStatus = {
19
+ InProgress: "in_progress",
20
+ Completed: "completed",
21
+ Incomplete: "incomplete",
22
+ Calling: "calling",
23
+ Failed: "failed",
24
+ };
25
+ /** @internal */
26
+ export const ErrorTypeHTTPError$inboundSchema = z.enum(ErrorTypeHTTPError);
27
+ /** @internal */
28
+ export const ErrorHTTPError$inboundSchema = z.object({
29
+ code: z.int(),
30
+ message: z.string(),
31
+ type: ErrorTypeHTTPError$inboundSchema,
32
+ });
33
+ export function errorHTTPErrorFromJSON(jsonString) {
34
+ return safeParse(jsonString, (x) => ErrorHTTPError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorHTTPError' from JSON`);
35
+ }
36
+ /** @internal */
37
+ export const ErrorTypeMcpToolExecutionError$inboundSchema = z.enum(ErrorTypeMcpToolExecutionError);
38
+ /** @internal */
39
+ export const ErrorMcpToolExecutionError$inboundSchema = z.object({
40
+ content: z.any().optional(),
41
+ type: ErrorTypeMcpToolExecutionError$inboundSchema,
42
+ });
43
+ export function errorMcpToolExecutionErrorFromJSON(jsonString) {
44
+ return safeParse(jsonString, (x) => ErrorMcpToolExecutionError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorMcpToolExecutionError' from JSON`);
45
+ }
46
+ /** @internal */
47
+ export const ErrorTypeMcpProtocolError$inboundSchema = z.enum(ErrorTypeMcpProtocolError);
48
+ /** @internal */
49
+ export const ErrorMcpProtocolError$inboundSchema = z.object({
50
+ code: z.int(),
51
+ message: z.string(),
52
+ type: ErrorTypeMcpProtocolError$inboundSchema,
53
+ });
54
+ export function errorMcpProtocolErrorFromJSON(jsonString) {
55
+ return safeParse(jsonString, (x) => ErrorMcpProtocolError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorMcpProtocolError' from JSON`);
56
+ }
57
+ /** @internal */
58
+ export const ErrorT$inboundSchema = z.union([
59
+ z.lazy(() => ErrorMcpProtocolError$inboundSchema),
60
+ z.lazy(() => ErrorHTTPError$inboundSchema),
61
+ z.lazy(() => ErrorMcpToolExecutionError$inboundSchema),
62
+ z.string(),
63
+ ]);
64
+ export function errorFromJSON(jsonString) {
65
+ return safeParse(jsonString, (x) => ErrorT$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorT' from JSON`);
66
+ }
67
+ /** @internal */
68
+ export const OutputItemMcpCallStatus$inboundSchema = openEnums.inboundSchema(OutputItemMcpCallStatus);
69
+ /** @internal */
70
+ export const OutputItemMcpCall$inboundSchema = z.object({
71
+ approval_request_id: z.nullable(z.string()).optional(),
72
+ arguments: z.string(),
73
+ error: z.nullable(z.union([
74
+ z.lazy(() => ErrorMcpProtocolError$inboundSchema),
75
+ z.lazy(() => ErrorHTTPError$inboundSchema),
76
+ z.lazy(() => ErrorMcpToolExecutionError$inboundSchema),
77
+ z.string(),
78
+ ])).optional(),
79
+ id: z.string(),
80
+ name: z.string(),
81
+ output: z.nullable(z.string()).optional(),
82
+ server_label: z.string(),
83
+ status: OutputItemMcpCallStatus$inboundSchema.optional(),
84
+ type: z.literal("mcp_call"),
85
+ }).transform((v) => {
86
+ return remap$(v, {
87
+ "approval_request_id": "approvalRequestId",
88
+ "server_label": "serverLabel",
89
+ });
90
+ });
91
+ export function outputItemMcpCallFromJSON(jsonString) {
92
+ return safeParse(jsonString, (x) => OutputItemMcpCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputItemMcpCall' from JSON`);
93
+ }
94
+ //# sourceMappingURL=outputitemmcpcall.js.map
@@ -0,0 +1,25 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ export type OutputItemMcpListToolsTool = {
5
+ annotations?: any | undefined;
6
+ description?: string | null | undefined;
7
+ inputSchema: {
8
+ [k: string]: any;
9
+ };
10
+ name: string;
11
+ };
12
+ export type OutputItemMcpListTools = {
13
+ error?: string | null | undefined;
14
+ id: string;
15
+ serverLabel: string;
16
+ tools: Array<OutputItemMcpListToolsTool>;
17
+ type: "mcp_list_tools";
18
+ };
19
+ /** @internal */
20
+ export declare const OutputItemMcpListToolsTool$inboundSchema: z.ZodType<OutputItemMcpListToolsTool, unknown>;
21
+ export declare function outputItemMcpListToolsToolFromJSON(jsonString: string): SafeParseResult<OutputItemMcpListToolsTool, SDKValidationError>;
22
+ /** @internal */
23
+ export declare const OutputItemMcpListTools$inboundSchema: z.ZodType<OutputItemMcpListTools, unknown>;
24
+ export declare function outputItemMcpListToolsFromJSON(jsonString: string): SafeParseResult<OutputItemMcpListTools, SDKValidationError>;
25
+ //# sourceMappingURL=outputitemmcplisttools.d.ts.map