@openrouter/sdk 1.5.56 → 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.
Files changed (103) 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/decisionsscorequestion.d.ts +4 -4
  16. package/esm/models/decisionsscorequestion.js +1 -5
  17. package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
  18. package/esm/models/imagegenerationproviderpreferences.js +1 -0
  19. package/esm/models/imagegenerationrequest.d.ts +1 -1
  20. package/esm/models/index.d.ts +6 -0
  21. package/esm/models/index.js +6 -0
  22. package/esm/models/mcpapprovalrequestitem.d.ts +7 -0
  23. package/esm/models/mcpapprovalrequestitem.js +19 -1
  24. package/esm/models/mcpcallitem.d.ts +17 -1
  25. package/esm/models/mcpcallitem.js +18 -0
  26. package/esm/models/mcpservertool.d.ts +78 -69
  27. package/esm/models/mcpservertool.js +135 -105
  28. package/esm/models/mcpservertoolopenrouter.d.ts +28 -0
  29. package/esm/models/mcpservertoolopenrouter.js +20 -0
  30. package/esm/models/mcpservertoolparameters.d.ts +152 -0
  31. package/esm/models/mcpservertoolparameters.js +134 -0
  32. package/esm/models/openairesponsestoolchoiceunion.d.ts +3 -2
  33. package/esm/models/openairesponsestoolchoiceunion.js +3 -0
  34. package/esm/models/operations/listbyokkeys.d.ts +1 -0
  35. package/esm/models/operations/listbyokkeys.js +1 -0
  36. package/esm/models/outputitemmcpapprovalrequest.d.ts +14 -0
  37. package/esm/models/outputitemmcpapprovalrequest.js +23 -0
  38. package/esm/models/outputitemmcpcall.d.ts +74 -0
  39. package/esm/models/outputitemmcpcall.js +94 -0
  40. package/esm/models/outputitemmcplisttools.d.ts +25 -0
  41. package/esm/models/outputitemmcplisttools.js +37 -0
  42. package/esm/models/outputitems.d.ts +3 -0
  43. package/esm/models/outputitems.js +2 -0
  44. package/esm/models/providername.d.ts +1 -0
  45. package/esm/models/providername.js +1 -0
  46. package/esm/models/provideroptions.d.ts +6 -0
  47. package/esm/models/provideroptions.js +1 -0
  48. package/esm/models/providerresponse.d.ts +1 -0
  49. package/esm/models/providerresponse.js +1 -0
  50. package/esm/models/responsesrequest.d.ts +9 -0
  51. package/esm/models/responsesrequest.js +3 -0
  52. package/esm/models/toolchoicemcp.d.ts +33 -0
  53. package/esm/models/toolchoicemcp.js +42 -0
  54. package/esm/models/toolsearchoutputitem.d.ts +5 -4
  55. package/esm/models/toolsearchoutputitem.js +3 -0
  56. package/esm/models/updateworkspacerequest.d.ts +1 -0
  57. package/esm/models/updateworkspacerequest.js +1 -0
  58. package/esm/models/videogenerationrequest.d.ts +6 -0
  59. package/esm/models/videogenerationrequest.js +1 -0
  60. package/esm/sdk/sdk.d.ts +0 -9
  61. package/esm/sdk/sdk.js +1 -7
  62. package/jsr.json +1 -1
  63. package/package.json +7 -7
  64. package/esm/funcs/call-model.d.ts +0 -67
  65. package/esm/funcs/call-model.js +0 -98
  66. package/esm/lib/anthropic-compat.d.ts +0 -51
  67. package/esm/lib/anthropic-compat.js +0 -222
  68. package/esm/lib/async-params.d.ts +0 -107
  69. package/esm/lib/async-params.js +0 -88
  70. package/esm/lib/chat-compat.d.ts +0 -47
  71. package/esm/lib/chat-compat.js +0 -111
  72. package/esm/lib/claude-constants.d.ts +0 -22
  73. package/esm/lib/claude-constants.js +0 -20
  74. package/esm/lib/claude-type-guards.d.ts +0 -10
  75. package/esm/lib/claude-type-guards.js +0 -70
  76. package/esm/lib/conversation-state.d.ts +0 -63
  77. package/esm/lib/conversation-state.js +0 -210
  78. package/esm/lib/model-result.d.ts +0 -373
  79. package/esm/lib/model-result.js +0 -1414
  80. package/esm/lib/next-turn-params.d.ts +0 -30
  81. package/esm/lib/next-turn-params.js +0 -135
  82. package/esm/lib/reusable-stream.d.ts +0 -39
  83. package/esm/lib/reusable-stream.js +0 -192
  84. package/esm/lib/stop-conditions.d.ts +0 -80
  85. package/esm/lib/stop-conditions.js +0 -104
  86. package/esm/lib/stream-transformers.d.ts +0 -118
  87. package/esm/lib/stream-transformers.js +0 -852
  88. package/esm/lib/stream-type-guards.d.ts +0 -49
  89. package/esm/lib/stream-type-guards.js +0 -85
  90. package/esm/lib/tool-context.d.ts +0 -68
  91. package/esm/lib/tool-context.js +0 -175
  92. package/esm/lib/tool-event-broadcaster.d.ts +0 -44
  93. package/esm/lib/tool-event-broadcaster.js +0 -146
  94. package/esm/lib/tool-executor.d.ts +0 -74
  95. package/esm/lib/tool-executor.js +0 -267
  96. package/esm/lib/tool-orchestrator.d.ts +0 -52
  97. package/esm/lib/tool-orchestrator.js +0 -180
  98. package/esm/lib/tool-types.d.ts +0 -573
  99. package/esm/lib/tool-types.js +0 -80
  100. package/esm/lib/tool.d.ts +0 -108
  101. package/esm/lib/tool.js +0 -74
  102. package/esm/lib/turn-context.d.ts +0 -52
  103. package/esm/lib/turn-context.js +0 -59
@@ -1,42 +1,45 @@
1
1
  import * as z from "zod/v4";
2
- import { ClosedEnum, OpenEnum } from "../types/enums.js";
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 AllowedTools = {
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 AllowedToolsUnion = Array<string> | AllowedTools;
10
- export declare const ConnectorId: {
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 RequireApprovalNever = ClosedEnum<typeof RequireApprovalNever>;
25
- export declare const RequireApprovalAlways: {
16
+ export type McpServerToolRequireApprovalNever = ClosedEnum<typeof McpServerToolRequireApprovalNever>;
17
+ export declare const McpServerToolRequireApprovalAlways: {
26
18
  readonly Always: "always";
27
19
  };
28
- export type RequireApprovalAlways = ClosedEnum<typeof RequireApprovalAlways>;
29
- export type Always = {
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 Never = {
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 RequireApproval = {
36
- always?: Always | undefined;
37
- never?: Never | undefined;
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 RequireApprovalUnion = RequireApproval | RequireApprovalAlways | RequireApprovalNever;
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> | AllowedTools | null | undefined;
51
+ allowedTools?: Array<string> | McpServerToolAllowedTools | null | undefined;
49
52
  authorization?: string | undefined;
50
- connectorId?: ConnectorId | undefined;
53
+ connectorId?: string | undefined;
51
54
  headers?: {
52
55
  [k: string]: string;
53
56
  } | null | undefined;
54
- requireApproval?: RequireApproval | RequireApprovalAlways | RequireApprovalNever | null | undefined;
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 AllowedTools$inboundSchema: z.ZodType<AllowedTools, unknown>;
67
+ export declare const McpServerToolAllowedTools$inboundSchema: z.ZodType<McpServerToolAllowedTools, unknown>;
62
68
  /** @internal */
63
- export type AllowedTools$Outbound = {
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 AllowedTools$outboundSchema: z.ZodType<AllowedTools$Outbound, AllowedTools>;
69
- export declare function allowedToolsToJSON(allowedTools: AllowedTools): string;
70
- export declare function allowedToolsFromJSON(jsonString: string): SafeParseResult<AllowedTools, SDKValidationError>;
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 type AllowedToolsUnion$Outbound = Array<string> | AllowedTools$Outbound;
79
+ export declare const McpServerToolAllowedToolsUnion$inboundSchema: z.ZodType<McpServerToolAllowedToolsUnion, unknown>;
75
80
  /** @internal */
76
- export declare const AllowedToolsUnion$outboundSchema: z.ZodType<AllowedToolsUnion$Outbound, AllowedToolsUnion>;
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 ConnectorId$inboundSchema: z.ZodType<ConnectorId, unknown>;
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 ConnectorId$outboundSchema: z.ZodType<string, ConnectorId>;
87
+ export declare const McpServerToolRequireApprovalNever$inboundSchema: z.ZodEnum<typeof McpServerToolRequireApprovalNever>;
83
88
  /** @internal */
84
- export declare const RequireApprovalNever$inboundSchema: z.ZodEnum<typeof RequireApprovalNever>;
89
+ export declare const McpServerToolRequireApprovalNever$outboundSchema: z.ZodEnum<typeof McpServerToolRequireApprovalNever>;
85
90
  /** @internal */
86
- export declare const RequireApprovalNever$outboundSchema: z.ZodEnum<typeof RequireApprovalNever>;
91
+ export declare const McpServerToolRequireApprovalAlways$inboundSchema: z.ZodEnum<typeof McpServerToolRequireApprovalAlways>;
87
92
  /** @internal */
88
- export declare const RequireApprovalAlways$inboundSchema: z.ZodEnum<typeof RequireApprovalAlways>;
93
+ export declare const McpServerToolRequireApprovalAlways$outboundSchema: z.ZodEnum<typeof McpServerToolRequireApprovalAlways>;
89
94
  /** @internal */
90
- export declare const RequireApprovalAlways$outboundSchema: z.ZodEnum<typeof RequireApprovalAlways>;
95
+ export declare const McpServerToolAlways$inboundSchema: z.ZodType<McpServerToolAlways, unknown>;
91
96
  /** @internal */
92
- export declare const Always$inboundSchema: z.ZodType<Always, unknown>;
93
- /** @internal */
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 Always$outboundSchema: z.ZodType<Always$Outbound, Always>;
99
- export declare function alwaysToJSON(always: Always): string;
100
- export declare function alwaysFromJSON(jsonString: string): SafeParseResult<Always, SDKValidationError>;
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 Never$inboundSchema: z.ZodType<Never, unknown>;
107
+ export declare const McpServerToolNever$inboundSchema: z.ZodType<McpServerToolNever, unknown>;
103
108
  /** @internal */
104
- export type Never$Outbound = {
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 Never$outboundSchema: z.ZodType<Never$Outbound, Never>;
109
- export declare function neverToJSON(never: Never): string;
110
- export declare function neverFromJSON(jsonString: string): SafeParseResult<Never, SDKValidationError>;
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 RequireApproval$inboundSchema: z.ZodType<RequireApproval, unknown>;
119
+ export declare const McpServerToolRequireApproval$inboundSchema: z.ZodType<McpServerToolRequireApproval, unknown>;
113
120
  /** @internal */
114
- export type RequireApproval$Outbound = {
115
- always?: Always$Outbound | undefined;
116
- never?: Never$Outbound | undefined;
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 RequireApproval$outboundSchema: z.ZodType<RequireApproval$Outbound, RequireApproval>;
120
- export declare function requireApprovalToJSON(requireApproval: RequireApproval): string;
121
- export declare function requireApprovalFromJSON(jsonString: string): SafeParseResult<RequireApproval, SDKValidationError>;
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 RequireApprovalUnion$inboundSchema: z.ZodType<RequireApprovalUnion, unknown>;
131
+ export declare const McpServerToolRequireApprovalUnion$inboundSchema: z.ZodType<McpServerToolRequireApprovalUnion, unknown>;
124
132
  /** @internal */
125
- export type RequireApprovalUnion$Outbound = RequireApproval$Outbound | string | string;
133
+ export type McpServerToolRequireApprovalUnion$Outbound = McpServerToolRequireApproval$Outbound | string | string;
126
134
  /** @internal */
127
- export declare const RequireApprovalUnion$outboundSchema: z.ZodType<RequireApprovalUnion$Outbound, RequireApprovalUnion>;
128
- export declare function requireApprovalUnionToJSON(requireApprovalUnion: RequireApprovalUnion): string;
129
- export declare function requireApprovalUnionFromJSON(jsonString: string): SafeParseResult<RequireApprovalUnion, SDKValidationError>;
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> | AllowedTools$Outbound | null | undefined;
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?: RequireApproval$Outbound | string | string | null | undefined;
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
- import * as openEnums from "../types/enums.js";
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 RequireApprovalAlways = {
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 AllowedTools$inboundSchema = z
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 AllowedTools$outboundSchema = z.object({
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 remap$(v, {
45
- readOnly: "read_only",
46
- toolNames: "tool_names",
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 allowedToolsToJSON(allowedTools) {
50
- return JSON.stringify(AllowedTools$outboundSchema.parse(allowedTools));
42
+ export function mcpServerToolAllowedToolsToJSON(mcpServerToolAllowedTools) {
43
+ return JSON.stringify(McpServerToolAllowedTools$outboundSchema.parse(mcpServerToolAllowedTools));
51
44
  }
52
- export function allowedToolsFromJSON(jsonString) {
53
- return safeParse(jsonString, (x) => AllowedTools$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AllowedTools' from JSON`);
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 AllowedToolsUnion$inboundSchema = z.union([z.array(z.string()), z.lazy(() => AllowedTools$inboundSchema)]);
49
+ export const McpServerToolAllowedToolsUnion$inboundSchema = z.union([
50
+ z.array(z.string()),
51
+ z.lazy(() => McpServerToolAllowedTools$inboundSchema),
52
+ ]);
57
53
  /** @internal */
58
- export const AllowedToolsUnion$outboundSchema = z.union([z.array(z.string()), z.lazy(() => AllowedTools$outboundSchema)]);
59
- export function allowedToolsUnionToJSON(allowedToolsUnion) {
60
- return JSON.stringify(AllowedToolsUnion$outboundSchema.parse(allowedToolsUnion));
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 allowedToolsUnionFromJSON(jsonString) {
63
- return safeParse(jsonString, (x) => AllowedToolsUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AllowedToolsUnion' from JSON`);
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 ConnectorId$inboundSchema = openEnums.inboundSchema(ConnectorId);
67
- /** @internal */
68
- export const ConnectorId$outboundSchema = openEnums.outboundSchema(ConnectorId);
65
+ export const McpServerToolRequireApprovalNever$inboundSchema = z.enum(McpServerToolRequireApprovalNever);
69
66
  /** @internal */
70
- export const RequireApprovalNever$inboundSchema = z.enum(RequireApprovalNever);
67
+ export const McpServerToolRequireApprovalNever$outboundSchema = McpServerToolRequireApprovalNever$inboundSchema;
71
68
  /** @internal */
72
- export const RequireApprovalNever$outboundSchema = RequireApprovalNever$inboundSchema;
69
+ export const McpServerToolRequireApprovalAlways$inboundSchema = z.enum(McpServerToolRequireApprovalAlways);
73
70
  /** @internal */
74
- export const RequireApprovalAlways$inboundSchema = z.enum(RequireApprovalAlways);
71
+ export const McpServerToolRequireApprovalAlways$outboundSchema = McpServerToolRequireApprovalAlways$inboundSchema;
75
72
  /** @internal */
76
- export const RequireApprovalAlways$outboundSchema = RequireApprovalAlways$inboundSchema;
77
- /** @internal */
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 Always$outboundSchema = z
87
- .object({
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 remap$(v, {
91
- toolNames: "tool_names",
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 alwaysToJSON(always) {
95
- return JSON.stringify(Always$outboundSchema.parse(always));
97
+ export function mcpServerToolAlwaysToJSON(mcpServerToolAlways) {
98
+ return JSON.stringify(McpServerToolAlways$outboundSchema.parse(mcpServerToolAlways));
96
99
  }
97
- export function alwaysFromJSON(jsonString) {
98
- return safeParse(jsonString, (x) => Always$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Always' from JSON`);
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 Never$inboundSchema = z.object({
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 Never$outboundSchema = z.object({
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 remap$(v, {
113
- toolNames: "tool_names",
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 neverToJSON(never) {
117
- return JSON.stringify(Never$outboundSchema.parse(never));
128
+ export function mcpServerToolNeverToJSON(mcpServerToolNever) {
129
+ return JSON.stringify(McpServerToolNever$outboundSchema.parse(mcpServerToolNever));
118
130
  }
119
- export function neverFromJSON(jsonString) {
120
- return safeParse(jsonString, (x) => Never$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Never' from JSON`);
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 RequireApproval$inboundSchema = z.object({
124
- always: z.lazy(() => Always$inboundSchema).optional(),
125
- never: z.lazy(() => Never$inboundSchema).optional(),
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 RequireApproval$outboundSchema = z.object({
129
- always: z.lazy(() => Always$outboundSchema).optional(),
130
- never: z.lazy(() => Never$outboundSchema).optional(),
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 requireApprovalToJSON(requireApproval) {
133
- return JSON.stringify(RequireApproval$outboundSchema.parse(requireApproval));
152
+ export function mcpServerToolRequireApprovalToJSON(mcpServerToolRequireApproval) {
153
+ return JSON.stringify(McpServerToolRequireApproval$outboundSchema.parse(mcpServerToolRequireApproval));
134
154
  }
135
- export function requireApprovalFromJSON(jsonString) {
136
- return safeParse(jsonString, (x) => RequireApproval$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequireApproval' from JSON`);
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 RequireApprovalUnion$inboundSchema = z.union([
140
- z.lazy(() => RequireApproval$inboundSchema),
141
- RequireApprovalAlways$inboundSchema,
142
- RequireApprovalNever$inboundSchema,
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 RequireApprovalUnion$outboundSchema = z.union([
146
- z.lazy(() => RequireApproval$outboundSchema),
147
- RequireApprovalAlways$outboundSchema,
148
- RequireApprovalNever$outboundSchema,
165
+ export const McpServerToolRequireApprovalUnion$outboundSchema = z.union([
166
+ z.lazy(() => McpServerToolRequireApproval$outboundSchema),
167
+ McpServerToolRequireApprovalAlways$outboundSchema,
168
+ McpServerToolRequireApprovalNever$outboundSchema,
149
169
  ]);
150
- export function requireApprovalUnionToJSON(requireApprovalUnion) {
151
- return JSON.stringify(RequireApprovalUnion$outboundSchema.parse(requireApprovalUnion));
170
+ export function mcpServerToolRequireApprovalUnionToJSON(mcpServerToolRequireApprovalUnion) {
171
+ return JSON.stringify(McpServerToolRequireApprovalUnion$outboundSchema.parse(mcpServerToolRequireApprovalUnion));
152
172
  }
153
- export function requireApprovalUnionFromJSON(jsonString) {
154
- return safeParse(jsonString, (x) => RequireApprovalUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RequireApprovalUnion' from JSON`);
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
- .object({
163
- allowed_tools: z.nullable(z.union([z.array(z.string()), z.lazy(() => AllowedTools$inboundSchema)])).optional(),
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: ConnectorId$inboundSchema.optional(),
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(() => RequireApproval$inboundSchema),
169
- RequireApprovalAlways$inboundSchema,
170
- RequireApprovalNever$inboundSchema,
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([z.array(z.string()), z.lazy(() => AllowedTools$outboundSchema)])).optional(),
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: ConnectorId$outboundSchema.optional(),
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(() => RequireApproval$outboundSchema),
194
- RequireApprovalAlways$outboundSchema,
195
- RequireApprovalNever$outboundSchema,
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 remap$(v, {
203
- allowedTools: "allowed_tools",
204
- connectorId: "connector_id",
205
- requireApproval: "require_approval",
206
- serverDescription: "server_description",
207
- serverLabel: "server_label",
208
- serverUrl: "server_url",
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