@orq-ai/node 3.12.4 → 3.12.5

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 (196) hide show
  1. package/bin/mcp-server.js +112 -112
  2. package/bin/mcp-server.js.map +30 -30
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +3 -3
  6. package/lib/config.js +3 -3
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/server.js +1 -1
  9. package/models/operations/createbudget.js +2 -2
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/createdataset.js +2 -2
  12. package/models/operations/createdatasetitem.js +2 -2
  13. package/models/operations/createdatasource.js +2 -2
  14. package/models/operations/createeval.js +16 -16
  15. package/models/operations/fileget.js +2 -2
  16. package/models/operations/filelist.js +2 -2
  17. package/models/operations/fileupload.js +2 -2
  18. package/models/operations/getbudget.js +2 -2
  19. package/models/operations/getevals.js +28 -28
  20. package/models/operations/listbudgets.js +2 -2
  21. package/models/operations/listcontacts.js +2 -2
  22. package/models/operations/listdatasetdatapoints.js +2 -2
  23. package/models/operations/listdatasets.js +2 -2
  24. package/models/operations/listdatasources.js +2 -2
  25. package/models/operations/retrievecontact.js +2 -2
  26. package/models/operations/retrievedatapoint.js +2 -2
  27. package/models/operations/retrievedataset.js +2 -2
  28. package/models/operations/retrievedatasource.js +2 -2
  29. package/models/operations/updatebudget.js +2 -2
  30. package/models/operations/updatecontact.js +2 -2
  31. package/models/operations/updatedatapoint.js +2 -2
  32. package/models/operations/updatedataset.js +2 -2
  33. package/models/operations/updatedatasource.js +2 -2
  34. package/models/operations/updateeval.js +16 -16
  35. package/package.json +1 -1
  36. package/packages/orq-rc/FUNCTIONS.md +9 -19
  37. package/packages/orq-rc/README.md +180 -181
  38. package/packages/orq-rc/docs/sdks/agents/README.md +702 -0
  39. package/packages/orq-rc/docs/sdks/budgets/README.md +5 -5
  40. package/packages/orq-rc/docs/sdks/memorystores/README.md +1172 -0
  41. package/packages/orq-rc/docs/sdks/orq/README.md +81 -0
  42. package/packages/orq-rc/examples/package-lock.json +1 -1
  43. package/packages/orq-rc/examples/postV2AgentsInternal.example.ts +30 -0
  44. package/packages/orq-rc/jsr.json +1 -1
  45. package/packages/orq-rc/package-lock.json +2 -2
  46. package/packages/orq-rc/package.json +1 -1
  47. package/packages/orq-rc/src/funcs/agentsList.ts +167 -0
  48. package/packages/orq-rc/src/funcs/agentsListActions.ts +169 -0
  49. package/packages/orq-rc/src/funcs/agentsRetrieve.ts +175 -0
  50. package/packages/orq-rc/src/funcs/agentsRetrieveAction.ts +173 -0
  51. package/packages/orq-rc/src/funcs/agentsRetrieveTask.ts +179 -0
  52. package/packages/orq-rc/src/funcs/agentsReviewAction.ts +177 -0
  53. package/packages/orq-rc/src/funcs/agentsRun.ts +163 -0
  54. package/packages/orq-rc/src/funcs/agentsStreamRun.ts +187 -0
  55. package/packages/orq-rc/src/funcs/budgetsCreate.ts +1 -1
  56. package/packages/orq-rc/src/funcs/budgetsGet.ts +2 -2
  57. package/packages/orq-rc/src/funcs/budgetsList.ts +2 -2
  58. package/packages/orq-rc/src/funcs/memoryStoresCreate.ts +171 -0
  59. package/packages/orq-rc/src/funcs/memoryStoresCreateDocument.ts +175 -0
  60. package/packages/orq-rc/src/funcs/memoryStoresCreateMemory.ts +170 -0
  61. package/packages/orq-rc/src/funcs/memoryStoresDelete.ts +168 -0
  62. package/packages/orq-rc/src/funcs/memoryStoresDeleteDocument.ts +184 -0
  63. package/packages/orq-rc/src/funcs/memoryStoresDeleteMemory.ts +179 -0
  64. package/packages/orq-rc/src/funcs/memoryStoresList.ts +178 -0
  65. package/packages/orq-rc/src/funcs/memoryStoresListDocuments.ts +181 -0
  66. package/packages/orq-rc/src/funcs/memoryStoresListMemories.ts +176 -0
  67. package/packages/orq-rc/src/funcs/memoryStoresRetrieve.ts +177 -0
  68. package/packages/orq-rc/src/funcs/memoryStoresRetrieveDocument.ts +178 -0
  69. package/packages/orq-rc/src/funcs/memoryStoresRetrieveMemory.ts +173 -0
  70. package/packages/orq-rc/src/funcs/memoryStoresUpdate.ts +168 -0
  71. package/packages/orq-rc/src/funcs/memoryStoresUpdateDocument.ts +179 -0
  72. package/packages/orq-rc/src/funcs/memoryStoresUpdateMemory.ts +174 -0
  73. package/packages/orq-rc/src/funcs/postV2AgentsInternal.ts +159 -0
  74. package/packages/orq-rc/src/lib/config.ts +3 -3
  75. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  76. package/packages/orq-rc/src/mcp-server/server.ts +49 -1
  77. package/packages/orq-rc/src/mcp-server/tools/agentsList.ts +37 -0
  78. package/packages/orq-rc/src/mcp-server/tools/agentsListActions.ts +35 -0
  79. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieve.ts +37 -0
  80. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveAction.ts +35 -0
  81. package/packages/orq-rc/src/mcp-server/tools/agentsRetrieveTask.ts +37 -0
  82. package/packages/orq-rc/src/mcp-server/tools/agentsReviewAction.ts +37 -0
  83. package/packages/orq-rc/src/mcp-server/tools/agentsRun.ts +37 -0
  84. package/packages/orq-rc/src/mcp-server/tools/agentsStreamRun.ts +37 -0
  85. package/packages/orq-rc/src/mcp-server/tools/budgetsCreate.ts +1 -1
  86. package/packages/orq-rc/src/mcp-server/tools/budgetsGet.ts +2 -2
  87. package/packages/orq-rc/src/mcp-server/tools/budgetsList.ts +2 -2
  88. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreate.ts +35 -0
  89. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateDocument.ts +37 -0
  90. package/packages/orq-rc/src/mcp-server/tools/memoryStoresCreateMemory.ts +37 -0
  91. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDelete.ts +35 -0
  92. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteDocument.ts +40 -0
  93. package/packages/orq-rc/src/mcp-server/tools/memoryStoresDeleteMemory.ts +40 -0
  94. package/packages/orq-rc/src/mcp-server/tools/memoryStoresList.ts +37 -0
  95. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListDocuments.ts +37 -0
  96. package/packages/orq-rc/src/mcp-server/tools/memoryStoresListMemories.ts +37 -0
  97. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieve.ts +37 -0
  98. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveDocument.ts +37 -0
  99. package/packages/orq-rc/src/mcp-server/tools/memoryStoresRetrieveMemory.ts +37 -0
  100. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdate.ts +37 -0
  101. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateDocument.ts +37 -0
  102. package/packages/orq-rc/src/mcp-server/tools/memoryStoresUpdateMemory.ts +37 -0
  103. package/packages/orq-rc/src/mcp-server/tools/postV2AgentsInternal.ts +33 -0
  104. package/packages/orq-rc/src/models/errors/getagent.ts +80 -0
  105. package/packages/orq-rc/src/models/errors/getagenttask.ts +80 -0
  106. package/packages/orq-rc/src/models/errors/index.ts +3 -0
  107. package/packages/orq-rc/src/models/errors/streamrunagent.ts +80 -0
  108. package/packages/orq-rc/src/models/operations/createbudget.ts +57 -58
  109. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  110. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  111. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
  112. package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
  113. package/packages/orq-rc/src/models/operations/createeval.ts +6383 -1075
  114. package/packages/orq-rc/src/models/operations/creatememory.ts +265 -0
  115. package/packages/orq-rc/src/models/operations/creatememorydocument.ts +284 -0
  116. package/packages/orq-rc/src/models/operations/creatememorystore.ts +1956 -0
  117. package/packages/orq-rc/src/models/operations/deletememory.ts +87 -0
  118. package/packages/orq-rc/src/models/operations/deletememorydocument.ts +98 -0
  119. package/packages/orq-rc/src/models/operations/deletememorystore.ts +78 -0
  120. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +36 -27
  121. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +31 -24
  122. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  123. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  124. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  125. package/packages/orq-rc/src/models/operations/getagent.ts +1171 -0
  126. package/packages/orq-rc/src/models/operations/getagenttask.ts +257 -0
  127. package/packages/orq-rc/src/models/operations/getallmemories.ts +315 -0
  128. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +335 -0
  129. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +1241 -0
  130. package/packages/orq-rc/src/models/operations/getbudget.ts +2 -11
  131. package/packages/orq-rc/src/models/operations/getevals.ts +1362 -1166
  132. package/packages/orq-rc/src/models/operations/index.ts +24 -0
  133. package/packages/orq-rc/src/models/operations/listactions.ts +517 -0
  134. package/packages/orq-rc/src/models/operations/listagents.ts +1335 -0
  135. package/packages/orq-rc/src/models/operations/listbudgets.ts +5 -15
  136. package/packages/orq-rc/src/models/operations/listchunks.ts +21 -21
  137. package/packages/orq-rc/src/models/operations/listcontacts.ts +44 -37
  138. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
  139. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  140. package/packages/orq-rc/src/models/operations/listdatasources.ts +29 -22
  141. package/packages/orq-rc/src/models/operations/postv2agentsinternal.ts +103 -0
  142. package/packages/orq-rc/src/models/operations/retrieveaction.ts +419 -0
  143. package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
  144. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
  145. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  146. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
  147. package/packages/orq-rc/src/models/operations/retrievememory.ts +198 -0
  148. package/packages/orq-rc/src/models/operations/retrievememorydocument.ts +217 -0
  149. package/packages/orq-rc/src/models/operations/retrievememorystore.ts +1124 -0
  150. package/packages/orq-rc/src/models/operations/reviewaction.ts +258 -0
  151. package/packages/orq-rc/src/models/operations/runagent.ts +3428 -0
  152. package/packages/orq-rc/src/models/operations/streamrunagent.ts +3361 -0
  153. package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -11
  154. package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
  155. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
  156. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  157. package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
  158. package/packages/orq-rc/src/models/operations/updateeval.ts +6627 -1224
  159. package/packages/orq-rc/src/models/operations/updatememory.ts +274 -0
  160. package/packages/orq-rc/src/models/operations/updatememorydocument.ts +293 -0
  161. package/packages/orq-rc/src/models/operations/updatememorystore.ts +1348 -0
  162. package/packages/orq-rc/src/models/operations/updateprompt.ts +64 -19
  163. package/packages/orq-rc/src/sdk/agents.ts +148 -0
  164. package/packages/orq-rc/src/sdk/budgets.ts +5 -5
  165. package/packages/orq-rc/src/sdk/memorystores.ts +286 -0
  166. package/packages/orq-rc/src/sdk/sdk.ts +27 -1
  167. package/src/lib/config.ts +3 -3
  168. package/src/mcp-server/mcp-server.ts +1 -1
  169. package/src/mcp-server/server.ts +1 -1
  170. package/src/models/operations/createbudget.ts +2 -2
  171. package/src/models/operations/createcontact.ts +2 -2
  172. package/src/models/operations/createdataset.ts +2 -2
  173. package/src/models/operations/createdatasetitem.ts +2 -2
  174. package/src/models/operations/createdatasource.ts +2 -2
  175. package/src/models/operations/createeval.ts +16 -16
  176. package/src/models/operations/fileget.ts +2 -2
  177. package/src/models/operations/filelist.ts +2 -2
  178. package/src/models/operations/fileupload.ts +2 -2
  179. package/src/models/operations/getbudget.ts +2 -2
  180. package/src/models/operations/getevals.ts +28 -28
  181. package/src/models/operations/listbudgets.ts +2 -2
  182. package/src/models/operations/listcontacts.ts +2 -2
  183. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  184. package/src/models/operations/listdatasets.ts +2 -2
  185. package/src/models/operations/listdatasources.ts +2 -2
  186. package/src/models/operations/retrievecontact.ts +2 -2
  187. package/src/models/operations/retrievedatapoint.ts +2 -2
  188. package/src/models/operations/retrievedataset.ts +2 -2
  189. package/src/models/operations/retrievedatasource.ts +2 -2
  190. package/src/models/operations/updatebudget.ts +2 -2
  191. package/src/models/operations/updatecontact.ts +2 -2
  192. package/src/models/operations/updatedatapoint.ts +2 -2
  193. package/src/models/operations/updatedataset.ts +2 -2
  194. package/src/models/operations/updatedatasource.ts +2 -2
  195. package/src/models/operations/updateeval.ts +16 -16
  196. package/packages/orq-rc/examples/contactsCreate.example.ts +0 -42
@@ -0,0 +1,3361 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export const StreamRunAgentRole2 = {
13
+ Tool: "tool",
14
+ } as const;
15
+ export type StreamRunAgentRole2 = ClosedEnum<typeof StreamRunAgentRole2>;
16
+
17
+ export const StreamRunAgentRole1 = {
18
+ User: "user",
19
+ } as const;
20
+ export type StreamRunAgentRole1 = ClosedEnum<typeof StreamRunAgentRole1>;
21
+
22
+ /**
23
+ * Message role (user or tool for continuing executions)
24
+ */
25
+ export type StreamRunAgentRole = StreamRunAgentRole1 | StreamRunAgentRole2;
26
+
27
+ export const StreamRunAgentPartsAgentsRequestRequestBodyMessageKind = {
28
+ ToolResult: "tool_result",
29
+ } as const;
30
+ export type StreamRunAgentPartsAgentsRequestRequestBodyMessageKind = ClosedEnum<
31
+ typeof StreamRunAgentPartsAgentsRequestRequestBodyMessageKind
32
+ >;
33
+
34
+ export type Parts5 = {
35
+ kind: StreamRunAgentPartsAgentsRequestRequestBodyMessageKind;
36
+ toolCallId: string;
37
+ result?: any | undefined;
38
+ metadata?: { [k: string]: any } | undefined;
39
+ };
40
+
41
+ export const StreamRunAgentPartsAgentsRequestRequestBodyKind = {
42
+ ToolCall: "tool_call",
43
+ } as const;
44
+ export type StreamRunAgentPartsAgentsRequestRequestBodyKind = ClosedEnum<
45
+ typeof StreamRunAgentPartsAgentsRequestRequestBodyKind
46
+ >;
47
+
48
+ export type StreamRunAgentParts4 = {
49
+ kind: StreamRunAgentPartsAgentsRequestRequestBodyKind;
50
+ toolName: string;
51
+ toolCallId: string;
52
+ arguments: { [k: string]: any };
53
+ metadata?: { [k: string]: any } | undefined;
54
+ };
55
+
56
+ export const StreamRunAgentPartsAgentsRequestKind = {
57
+ File: "file",
58
+ } as const;
59
+ export type StreamRunAgentPartsAgentsRequestKind = ClosedEnum<
60
+ typeof StreamRunAgentPartsAgentsRequestKind
61
+ >;
62
+
63
+ export type StreamRunAgentFile2 = {
64
+ /**
65
+ * URL for the File content
66
+ */
67
+ uri: string;
68
+ /**
69
+ * Optional mimeType for the file
70
+ */
71
+ mimeType?: string | undefined;
72
+ /**
73
+ * Optional name for the file
74
+ */
75
+ name?: string | undefined;
76
+ };
77
+
78
+ export type StreamRunAgentFile1 = {
79
+ /**
80
+ * base64 encoded content of the file
81
+ */
82
+ bytes: string;
83
+ /**
84
+ * Optional mimeType for the file
85
+ */
86
+ mimeType?: string | undefined;
87
+ /**
88
+ * Optional name for the file
89
+ */
90
+ name?: string | undefined;
91
+ };
92
+
93
+ export type StreamRunAgentPartsFile = StreamRunAgentFile1 | StreamRunAgentFile2;
94
+
95
+ export type StreamRunAgentParts3 = {
96
+ kind: StreamRunAgentPartsAgentsRequestKind;
97
+ file: StreamRunAgentFile1 | StreamRunAgentFile2;
98
+ metadata?: { [k: string]: any } | undefined;
99
+ };
100
+
101
+ export const StreamRunAgentPartsAgentsKind = {
102
+ Data: "data",
103
+ } as const;
104
+ export type StreamRunAgentPartsAgentsKind = ClosedEnum<
105
+ typeof StreamRunAgentPartsAgentsKind
106
+ >;
107
+
108
+ export type StreamRunAgentParts2 = {
109
+ kind: StreamRunAgentPartsAgentsKind;
110
+ data?: any | undefined;
111
+ metadata?: { [k: string]: any } | undefined;
112
+ };
113
+
114
+ export const StreamRunAgentPartsKind = {
115
+ Text: "text",
116
+ } as const;
117
+ export type StreamRunAgentPartsKind = ClosedEnum<
118
+ typeof StreamRunAgentPartsKind
119
+ >;
120
+
121
+ export type StreamRunAgentParts1 = {
122
+ kind: StreamRunAgentPartsKind;
123
+ text: string;
124
+ };
125
+
126
+ export type StreamRunAgentParts =
127
+ | StreamRunAgentParts4
128
+ | StreamRunAgentParts1
129
+ | StreamRunAgentParts3
130
+ | Parts5
131
+ | StreamRunAgentParts2;
132
+
133
+ /**
134
+ * The A2A format message containing the task for the agent to perform.
135
+ */
136
+ export type StreamRunAgentMessage = {
137
+ /**
138
+ * Optional A2A message ID in ULID format
139
+ */
140
+ messageId?: string | undefined;
141
+ /**
142
+ * Message role (user or tool for continuing executions)
143
+ */
144
+ role: StreamRunAgentRole1 | StreamRunAgentRole2;
145
+ /**
146
+ * A2A message parts
147
+ */
148
+ parts: Array<
149
+ | StreamRunAgentParts4
150
+ | StreamRunAgentParts1
151
+ | StreamRunAgentParts3
152
+ | Parts5
153
+ | StreamRunAgentParts2
154
+ >;
155
+ /**
156
+ * Optional message metadata
157
+ */
158
+ metadata?: { [k: string]: any } | undefined;
159
+ };
160
+
161
+ export type StreamRunAgentTeamOfAgents = {
162
+ id: string;
163
+ /**
164
+ * The role of the agent in this context. This is used to give extra information to the leader to help it decide which agent to hand off to.
165
+ */
166
+ role?: string | undefined;
167
+ };
168
+
169
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings12Type = {
170
+ Function: "function",
171
+ } as const;
172
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettings12Type =
173
+ ClosedEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodySettings12Type>;
174
+
175
+ export type StreamRunAgentToolsFunction = {
176
+ name: string;
177
+ description?: string | undefined;
178
+ strict?: boolean | undefined;
179
+ parameters?: { [k: string]: any } | undefined;
180
+ };
181
+
182
+ export type Tools12 = {
183
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings12Type;
184
+ id?: string | undefined;
185
+ key: string;
186
+ displayName?: string | undefined;
187
+ description?: string | undefined;
188
+ requiresApproval?: boolean | undefined;
189
+ function: StreamRunAgentToolsFunction;
190
+ };
191
+
192
+ /**
193
+ * The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version.
194
+ */
195
+ export const ToolsStatus = {
196
+ Live: "live",
197
+ Draft: "draft",
198
+ Pending: "pending",
199
+ Published: "published",
200
+ } as const;
201
+ /**
202
+ * The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version.
203
+ */
204
+ export type ToolsStatus = ClosedEnum<typeof ToolsStatus>;
205
+
206
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings11Type = {
207
+ Http: "http",
208
+ } as const;
209
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettings11Type =
210
+ ClosedEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodySettings11Type>;
211
+
212
+ /**
213
+ * The HTTP method to use.
214
+ */
215
+ export const ToolsMethod = {
216
+ Get: "GET",
217
+ Post: "POST",
218
+ Put: "PUT",
219
+ Delete: "DELETE",
220
+ } as const;
221
+ /**
222
+ * The HTTP method to use.
223
+ */
224
+ export type ToolsMethod = ClosedEnum<typeof ToolsMethod>;
225
+
226
+ /**
227
+ * The blueprint for the HTTP request. The `arguments` field will be used to replace the placeholders in the `url`, `headers`, `body`, and `arguments` fields.
228
+ */
229
+ export type ToolsBlueprint = {
230
+ /**
231
+ * The URL to send the request to.
232
+ */
233
+ url: string;
234
+ /**
235
+ * The HTTP method to use.
236
+ */
237
+ method: ToolsMethod;
238
+ /**
239
+ * The headers to send with the request.
240
+ */
241
+ headers?: { [k: string]: string } | undefined;
242
+ /**
243
+ * The body to send with the request.
244
+ */
245
+ body?: { [k: string]: any } | undefined;
246
+ };
247
+
248
+ /**
249
+ * The type of the argument.
250
+ */
251
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType = {
252
+ String: "string",
253
+ Number: "number",
254
+ Boolean: "boolean",
255
+ } as const;
256
+ /**
257
+ * The type of the argument.
258
+ */
259
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType =
260
+ ClosedEnum<
261
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType
262
+ >;
263
+
264
+ /**
265
+ * The default value of the argument.
266
+ */
267
+ export type ToolsDefaultValue = string | number | boolean;
268
+
269
+ export type ToolsArguments = {
270
+ /**
271
+ * The type of the argument.
272
+ */
273
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType;
274
+ /**
275
+ * A description of the argument.
276
+ */
277
+ description: string;
278
+ /**
279
+ * Whether to send the argument to the model. If set to false, the argument will not be sent to the model and needs to be provided by the user or it will be left blank.
280
+ */
281
+ sendToModel?: boolean | undefined;
282
+ /**
283
+ * The default value of the argument.
284
+ */
285
+ defaultValue?: string | number | boolean | undefined;
286
+ };
287
+
288
+ export type ToolsHttp = {
289
+ /**
290
+ * The blueprint for the HTTP request. The `arguments` field will be used to replace the placeholders in the `url`, `headers`, `body`, and `arguments` fields.
291
+ */
292
+ blueprint: ToolsBlueprint;
293
+ /**
294
+ * The arguments to send with the request. The keys will be used to replace the placeholders in the `blueprint` field.
295
+ */
296
+ arguments?: { [k: string]: ToolsArguments } | undefined;
297
+ };
298
+
299
+ export type Tools11 = {
300
+ id?: string | undefined;
301
+ /**
302
+ * The path where the entity is stored in the project structure. The first element of the path always represents the project name. Any subsequent path element after the project will be created as a folder in the project if it does not exists.
303
+ */
304
+ path: string;
305
+ /**
306
+ * Unique key of the tool as it will be displayed in the UI
307
+ */
308
+ key: string;
309
+ /**
310
+ * The name of the tool as it will be displayed in the UI. This is optional and if not provided, the `key` will be used.
311
+ */
312
+ displayName: string;
313
+ /**
314
+ * A description of the tool, used by the model to choose when and how to call the tool. We do recommend using the `description` field as accurate as possible to give enough context to the model to make the right decision.
315
+ */
316
+ description: string;
317
+ /**
318
+ * The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version.
319
+ */
320
+ status?: ToolsStatus | undefined;
321
+ versionHash?: string | undefined;
322
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings11Type;
323
+ http: ToolsHttp;
324
+ requiresApproval?: boolean | undefined;
325
+ };
326
+
327
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings10Type = {
328
+ CurrentDate: "current_date",
329
+ } as const;
330
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettings10Type =
331
+ ClosedEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodySettings10Type>;
332
+
333
+ export type Tools10 = {
334
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings10Type;
335
+ requiresApproval?: boolean | undefined;
336
+ };
337
+
338
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings9Type = {
339
+ QueryKnowledgeBase: "query_knowledge_base",
340
+ } as const;
341
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettings9Type =
342
+ ClosedEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodySettings9Type>;
343
+
344
+ export type Tools9 = {
345
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings9Type;
346
+ requiresApproval?: boolean | undefined;
347
+ };
348
+
349
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings8Type = {
350
+ RetrieveKnowledgeBases: "retrieve_knowledge_bases",
351
+ } as const;
352
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettings8Type =
353
+ ClosedEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodySettings8Type>;
354
+
355
+ export type Tools8 = {
356
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings8Type;
357
+ requiresApproval?: boolean | undefined;
358
+ };
359
+
360
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings7Type = {
361
+ RetrieveMemoryStores: "retrieve_memory_stores",
362
+ } as const;
363
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettings7Type =
364
+ ClosedEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodySettings7Type>;
365
+
366
+ export type Tools7 = {
367
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings7Type;
368
+ requiresApproval?: boolean | undefined;
369
+ };
370
+
371
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings6Type = {
372
+ WriteMemoryStore: "write_memory_store",
373
+ } as const;
374
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettings6Type =
375
+ ClosedEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodySettings6Type>;
376
+
377
+ export type Tools6 = {
378
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings6Type;
379
+ requiresApproval?: boolean | undefined;
380
+ };
381
+
382
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettingsType = {
383
+ QueryMemoryStore: "query_memory_store",
384
+ } as const;
385
+ export type StreamRunAgentToolsAgentsRequestRequestBodySettingsType =
386
+ ClosedEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodySettingsType>;
387
+
388
+ export type StreamRunAgentTools5 = {
389
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettingsType;
390
+ requiresApproval?: boolean | undefined;
391
+ };
392
+
393
+ export const StreamRunAgentToolsAgentsRequestRequestBodyType = {
394
+ RetrieveAgents: "retrieve_agents",
395
+ } as const;
396
+ export type StreamRunAgentToolsAgentsRequestRequestBodyType = ClosedEnum<
397
+ typeof StreamRunAgentToolsAgentsRequestRequestBodyType
398
+ >;
399
+
400
+ export type StreamRunAgentTools4 = {
401
+ type: StreamRunAgentToolsAgentsRequestRequestBodyType;
402
+ requiresApproval?: boolean | undefined;
403
+ };
404
+
405
+ export const StreamRunAgentToolsAgentsRequestType = {
406
+ CallSubAgent: "call_sub_agent",
407
+ } as const;
408
+ export type StreamRunAgentToolsAgentsRequestType = ClosedEnum<
409
+ typeof StreamRunAgentToolsAgentsRequestType
410
+ >;
411
+
412
+ export type StreamRunAgentTools3 = {
413
+ type: StreamRunAgentToolsAgentsRequestType;
414
+ requiresApproval?: boolean | undefined;
415
+ };
416
+
417
+ export const StreamRunAgentToolsAgentsType = {
418
+ WebScraper: "web_scraper",
419
+ } as const;
420
+ export type StreamRunAgentToolsAgentsType = ClosedEnum<
421
+ typeof StreamRunAgentToolsAgentsType
422
+ >;
423
+
424
+ export type StreamRunAgentTools2 = {
425
+ type: StreamRunAgentToolsAgentsType;
426
+ requiresApproval?: boolean | undefined;
427
+ };
428
+
429
+ export const StreamRunAgentToolsType = {
430
+ GoogleSearch: "google_search",
431
+ } as const;
432
+ export type StreamRunAgentToolsType = ClosedEnum<
433
+ typeof StreamRunAgentToolsType
434
+ >;
435
+
436
+ export type StreamRunAgentTools1 = {
437
+ type: StreamRunAgentToolsType;
438
+ requiresApproval?: boolean | undefined;
439
+ };
440
+
441
+ export type StreamRunAgentTools =
442
+ | Tools11
443
+ | Tools12
444
+ | StreamRunAgentTools1
445
+ | StreamRunAgentTools2
446
+ | StreamRunAgentTools3
447
+ | StreamRunAgentTools4
448
+ | StreamRunAgentTools5
449
+ | Tools6
450
+ | Tools7
451
+ | Tools8
452
+ | Tools9
453
+ | Tools10;
454
+
455
+ /**
456
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
457
+ */
458
+ export const StreamRunAgentToolApprovalRequired = {
459
+ All: "all",
460
+ RespectTool: "respect_tool",
461
+ None: "none",
462
+ } as const;
463
+ /**
464
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
465
+ */
466
+ export type StreamRunAgentToolApprovalRequired = ClosedEnum<
467
+ typeof StreamRunAgentToolApprovalRequired
468
+ >;
469
+
470
+ export type StreamRunAgentSettings = {
471
+ tools: Array<
472
+ | Tools11
473
+ | Tools12
474
+ | StreamRunAgentTools1
475
+ | StreamRunAgentTools2
476
+ | StreamRunAgentTools3
477
+ | StreamRunAgentTools4
478
+ | StreamRunAgentTools5
479
+ | Tools6
480
+ | Tools7
481
+ | Tools8
482
+ | Tools9
483
+ | Tools10
484
+ >;
485
+ /**
486
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
487
+ */
488
+ toolApprovalRequired?: StreamRunAgentToolApprovalRequired | undefined;
489
+ /**
490
+ * Maximum iterations before the agent must provide its best answer.
491
+ */
492
+ maxIterations?: number | undefined;
493
+ /**
494
+ * Maximum time (in seconds) for task execution.
495
+ */
496
+ maxExecutionTime?: number | undefined;
497
+ };
498
+
499
+ export type StreamRunAgentRequestBody = {
500
+ /**
501
+ * A unique identifier for the agent. This key must be unique within the same workspace and cannot be reused. When executing the agent, this key determines if the agent already exists. If the agent version differs, a new version is created at the end of the execution, except for the task. All agent parameters are evaluated to decide if a new version is needed. To prevent new version creation and update the latest version instead, use the `prevent_version_creation` parameter in the settings.
502
+ */
503
+ key: string;
504
+ /**
505
+ * Optional task ID to continue an existing agent execution. When provided, the agent will continue the conversation from the existing task state. The task must be in an inactive state to continue.
506
+ */
507
+ taskId?: string | undefined;
508
+ /**
509
+ * The language model that powers the agent. Currently, private models are not supported.
510
+ */
511
+ model: string;
512
+ /**
513
+ * Optional array of fallback model IDs to use when the primary model fails. Models are tried in order. All models must support tool calling capabilities.
514
+ */
515
+ fallbackModels?: Array<string> | undefined;
516
+ /**
517
+ * Specifies the agent's function and area of expertise.
518
+ */
519
+ role: string;
520
+ /**
521
+ * Provides context and purpose for the agent. Combined with the system prompt template to generate the agent's instructions.
522
+ */
523
+ instructions: string;
524
+ /**
525
+ * The A2A format message containing the task for the agent to perform.
526
+ */
527
+ message: StreamRunAgentMessage;
528
+ /**
529
+ * Optional variables for template replacement in system prompt, instructions, and messages
530
+ */
531
+ variables?: { [k: string]: any } | undefined;
532
+ /**
533
+ * Optional context ID that maps to thread_id
534
+ */
535
+ contextId?: string | undefined;
536
+ /**
537
+ * An external id for the agent execution. This can be used to associate a specific user with the agent execution.
538
+ */
539
+ externalId?: string | undefined;
540
+ /**
541
+ * The path where the entity is stored in the project structure. The first element of the path always represents the project name. Any subsequent path element after the project will be created as a folder in the project if it does not exists.
542
+ */
543
+ path: string;
544
+ /**
545
+ * A brief summary of the agent's purpose.
546
+ */
547
+ description?: string | undefined;
548
+ /**
549
+ * Optional URL to an icon for the agent
550
+ */
551
+ iconUrl?: string | undefined;
552
+ /**
553
+ * A custom system prompt template for the agent. If omitted, the default template is used.
554
+ */
555
+ systemPrompt?: string | undefined;
556
+ memoryStores?: Array<string> | undefined;
557
+ knowledgeBases?: Array<string> | undefined;
558
+ /**
559
+ * The agents that are accessible to this orchestrator. The main agent can hand off to these agents to perform tasks.
560
+ */
561
+ teamOfAgents?: Array<StreamRunAgentTeamOfAgents> | undefined;
562
+ settings: StreamRunAgentSettings;
563
+ /**
564
+ * Stream timeout in seconds (1-3600). Default: 1800 (30 minutes)
565
+ */
566
+ streamTimeoutSeconds?: number | undefined;
567
+ };
568
+
569
+ /**
570
+ * SSE stream of agent events
571
+ */
572
+ export type StreamRunAgentResponseBody = {
573
+ /**
574
+ * JSON-encoded event data
575
+ */
576
+ data: string;
577
+ };
578
+
579
+ /** @internal */
580
+ export const StreamRunAgentRole2$inboundSchema: z.ZodNativeEnum<
581
+ typeof StreamRunAgentRole2
582
+ > = z.nativeEnum(StreamRunAgentRole2);
583
+
584
+ /** @internal */
585
+ export const StreamRunAgentRole2$outboundSchema: z.ZodNativeEnum<
586
+ typeof StreamRunAgentRole2
587
+ > = StreamRunAgentRole2$inboundSchema;
588
+
589
+ /**
590
+ * @internal
591
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
592
+ */
593
+ export namespace StreamRunAgentRole2$ {
594
+ /** @deprecated use `StreamRunAgentRole2$inboundSchema` instead. */
595
+ export const inboundSchema = StreamRunAgentRole2$inboundSchema;
596
+ /** @deprecated use `StreamRunAgentRole2$outboundSchema` instead. */
597
+ export const outboundSchema = StreamRunAgentRole2$outboundSchema;
598
+ }
599
+
600
+ /** @internal */
601
+ export const StreamRunAgentRole1$inboundSchema: z.ZodNativeEnum<
602
+ typeof StreamRunAgentRole1
603
+ > = z.nativeEnum(StreamRunAgentRole1);
604
+
605
+ /** @internal */
606
+ export const StreamRunAgentRole1$outboundSchema: z.ZodNativeEnum<
607
+ typeof StreamRunAgentRole1
608
+ > = StreamRunAgentRole1$inboundSchema;
609
+
610
+ /**
611
+ * @internal
612
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
613
+ */
614
+ export namespace StreamRunAgentRole1$ {
615
+ /** @deprecated use `StreamRunAgentRole1$inboundSchema` instead. */
616
+ export const inboundSchema = StreamRunAgentRole1$inboundSchema;
617
+ /** @deprecated use `StreamRunAgentRole1$outboundSchema` instead. */
618
+ export const outboundSchema = StreamRunAgentRole1$outboundSchema;
619
+ }
620
+
621
+ /** @internal */
622
+ export const StreamRunAgentRole$inboundSchema: z.ZodType<
623
+ StreamRunAgentRole,
624
+ z.ZodTypeDef,
625
+ unknown
626
+ > = z.union([
627
+ StreamRunAgentRole1$inboundSchema,
628
+ StreamRunAgentRole2$inboundSchema,
629
+ ]);
630
+
631
+ /** @internal */
632
+ export type StreamRunAgentRole$Outbound = string | string;
633
+
634
+ /** @internal */
635
+ export const StreamRunAgentRole$outboundSchema: z.ZodType<
636
+ StreamRunAgentRole$Outbound,
637
+ z.ZodTypeDef,
638
+ StreamRunAgentRole
639
+ > = z.union([
640
+ StreamRunAgentRole1$outboundSchema,
641
+ StreamRunAgentRole2$outboundSchema,
642
+ ]);
643
+
644
+ /**
645
+ * @internal
646
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
647
+ */
648
+ export namespace StreamRunAgentRole$ {
649
+ /** @deprecated use `StreamRunAgentRole$inboundSchema` instead. */
650
+ export const inboundSchema = StreamRunAgentRole$inboundSchema;
651
+ /** @deprecated use `StreamRunAgentRole$outboundSchema` instead. */
652
+ export const outboundSchema = StreamRunAgentRole$outboundSchema;
653
+ /** @deprecated use `StreamRunAgentRole$Outbound` instead. */
654
+ export type Outbound = StreamRunAgentRole$Outbound;
655
+ }
656
+
657
+ export function streamRunAgentRoleToJSON(
658
+ streamRunAgentRole: StreamRunAgentRole,
659
+ ): string {
660
+ return JSON.stringify(
661
+ StreamRunAgentRole$outboundSchema.parse(streamRunAgentRole),
662
+ );
663
+ }
664
+
665
+ export function streamRunAgentRoleFromJSON(
666
+ jsonString: string,
667
+ ): SafeParseResult<StreamRunAgentRole, SDKValidationError> {
668
+ return safeParse(
669
+ jsonString,
670
+ (x) => StreamRunAgentRole$inboundSchema.parse(JSON.parse(x)),
671
+ `Failed to parse 'StreamRunAgentRole' from JSON`,
672
+ );
673
+ }
674
+
675
+ /** @internal */
676
+ export const StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$inboundSchema:
677
+ z.ZodNativeEnum<
678
+ typeof StreamRunAgentPartsAgentsRequestRequestBodyMessageKind
679
+ > = z.nativeEnum(StreamRunAgentPartsAgentsRequestRequestBodyMessageKind);
680
+
681
+ /** @internal */
682
+ export const StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$outboundSchema:
683
+ z.ZodNativeEnum<
684
+ typeof StreamRunAgentPartsAgentsRequestRequestBodyMessageKind
685
+ > = StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$inboundSchema;
686
+
687
+ /**
688
+ * @internal
689
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
690
+ */
691
+ export namespace StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$ {
692
+ /** @deprecated use `StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$inboundSchema` instead. */
693
+ export const inboundSchema =
694
+ StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$inboundSchema;
695
+ /** @deprecated use `StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$outboundSchema` instead. */
696
+ export const outboundSchema =
697
+ StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$outboundSchema;
698
+ }
699
+
700
+ /** @internal */
701
+ export const Parts5$inboundSchema: z.ZodType<Parts5, z.ZodTypeDef, unknown> = z
702
+ .object({
703
+ kind: StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$inboundSchema,
704
+ tool_call_id: z.string(),
705
+ result: z.any().optional(),
706
+ metadata: z.record(z.any()).optional(),
707
+ }).transform((v) => {
708
+ return remap$(v, {
709
+ "tool_call_id": "toolCallId",
710
+ });
711
+ });
712
+
713
+ /** @internal */
714
+ export type Parts5$Outbound = {
715
+ kind: string;
716
+ tool_call_id: string;
717
+ result?: any | undefined;
718
+ metadata?: { [k: string]: any } | undefined;
719
+ };
720
+
721
+ /** @internal */
722
+ export const Parts5$outboundSchema: z.ZodType<
723
+ Parts5$Outbound,
724
+ z.ZodTypeDef,
725
+ Parts5
726
+ > = z.object({
727
+ kind: StreamRunAgentPartsAgentsRequestRequestBodyMessageKind$outboundSchema,
728
+ toolCallId: z.string(),
729
+ result: z.any().optional(),
730
+ metadata: z.record(z.any()).optional(),
731
+ }).transform((v) => {
732
+ return remap$(v, {
733
+ toolCallId: "tool_call_id",
734
+ });
735
+ });
736
+
737
+ /**
738
+ * @internal
739
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
740
+ */
741
+ export namespace Parts5$ {
742
+ /** @deprecated use `Parts5$inboundSchema` instead. */
743
+ export const inboundSchema = Parts5$inboundSchema;
744
+ /** @deprecated use `Parts5$outboundSchema` instead. */
745
+ export const outboundSchema = Parts5$outboundSchema;
746
+ /** @deprecated use `Parts5$Outbound` instead. */
747
+ export type Outbound = Parts5$Outbound;
748
+ }
749
+
750
+ export function parts5ToJSON(parts5: Parts5): string {
751
+ return JSON.stringify(Parts5$outboundSchema.parse(parts5));
752
+ }
753
+
754
+ export function parts5FromJSON(
755
+ jsonString: string,
756
+ ): SafeParseResult<Parts5, SDKValidationError> {
757
+ return safeParse(
758
+ jsonString,
759
+ (x) => Parts5$inboundSchema.parse(JSON.parse(x)),
760
+ `Failed to parse 'Parts5' from JSON`,
761
+ );
762
+ }
763
+
764
+ /** @internal */
765
+ export const StreamRunAgentPartsAgentsRequestRequestBodyKind$inboundSchema:
766
+ z.ZodNativeEnum<typeof StreamRunAgentPartsAgentsRequestRequestBodyKind> = z
767
+ .nativeEnum(StreamRunAgentPartsAgentsRequestRequestBodyKind);
768
+
769
+ /** @internal */
770
+ export const StreamRunAgentPartsAgentsRequestRequestBodyKind$outboundSchema:
771
+ z.ZodNativeEnum<typeof StreamRunAgentPartsAgentsRequestRequestBodyKind> =
772
+ StreamRunAgentPartsAgentsRequestRequestBodyKind$inboundSchema;
773
+
774
+ /**
775
+ * @internal
776
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
777
+ */
778
+ export namespace StreamRunAgentPartsAgentsRequestRequestBodyKind$ {
779
+ /** @deprecated use `StreamRunAgentPartsAgentsRequestRequestBodyKind$inboundSchema` instead. */
780
+ export const inboundSchema =
781
+ StreamRunAgentPartsAgentsRequestRequestBodyKind$inboundSchema;
782
+ /** @deprecated use `StreamRunAgentPartsAgentsRequestRequestBodyKind$outboundSchema` instead. */
783
+ export const outboundSchema =
784
+ StreamRunAgentPartsAgentsRequestRequestBodyKind$outboundSchema;
785
+ }
786
+
787
+ /** @internal */
788
+ export const StreamRunAgentParts4$inboundSchema: z.ZodType<
789
+ StreamRunAgentParts4,
790
+ z.ZodTypeDef,
791
+ unknown
792
+ > = z.object({
793
+ kind: StreamRunAgentPartsAgentsRequestRequestBodyKind$inboundSchema,
794
+ tool_name: z.string(),
795
+ tool_call_id: z.string(),
796
+ arguments: z.record(z.any()),
797
+ metadata: z.record(z.any()).optional(),
798
+ }).transform((v) => {
799
+ return remap$(v, {
800
+ "tool_name": "toolName",
801
+ "tool_call_id": "toolCallId",
802
+ });
803
+ });
804
+
805
+ /** @internal */
806
+ export type StreamRunAgentParts4$Outbound = {
807
+ kind: string;
808
+ tool_name: string;
809
+ tool_call_id: string;
810
+ arguments: { [k: string]: any };
811
+ metadata?: { [k: string]: any } | undefined;
812
+ };
813
+
814
+ /** @internal */
815
+ export const StreamRunAgentParts4$outboundSchema: z.ZodType<
816
+ StreamRunAgentParts4$Outbound,
817
+ z.ZodTypeDef,
818
+ StreamRunAgentParts4
819
+ > = z.object({
820
+ kind: StreamRunAgentPartsAgentsRequestRequestBodyKind$outboundSchema,
821
+ toolName: z.string(),
822
+ toolCallId: z.string(),
823
+ arguments: z.record(z.any()),
824
+ metadata: z.record(z.any()).optional(),
825
+ }).transform((v) => {
826
+ return remap$(v, {
827
+ toolName: "tool_name",
828
+ toolCallId: "tool_call_id",
829
+ });
830
+ });
831
+
832
+ /**
833
+ * @internal
834
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
835
+ */
836
+ export namespace StreamRunAgentParts4$ {
837
+ /** @deprecated use `StreamRunAgentParts4$inboundSchema` instead. */
838
+ export const inboundSchema = StreamRunAgentParts4$inboundSchema;
839
+ /** @deprecated use `StreamRunAgentParts4$outboundSchema` instead. */
840
+ export const outboundSchema = StreamRunAgentParts4$outboundSchema;
841
+ /** @deprecated use `StreamRunAgentParts4$Outbound` instead. */
842
+ export type Outbound = StreamRunAgentParts4$Outbound;
843
+ }
844
+
845
+ export function streamRunAgentParts4ToJSON(
846
+ streamRunAgentParts4: StreamRunAgentParts4,
847
+ ): string {
848
+ return JSON.stringify(
849
+ StreamRunAgentParts4$outboundSchema.parse(streamRunAgentParts4),
850
+ );
851
+ }
852
+
853
+ export function streamRunAgentParts4FromJSON(
854
+ jsonString: string,
855
+ ): SafeParseResult<StreamRunAgentParts4, SDKValidationError> {
856
+ return safeParse(
857
+ jsonString,
858
+ (x) => StreamRunAgentParts4$inboundSchema.parse(JSON.parse(x)),
859
+ `Failed to parse 'StreamRunAgentParts4' from JSON`,
860
+ );
861
+ }
862
+
863
+ /** @internal */
864
+ export const StreamRunAgentPartsAgentsRequestKind$inboundSchema:
865
+ z.ZodNativeEnum<typeof StreamRunAgentPartsAgentsRequestKind> = z.nativeEnum(
866
+ StreamRunAgentPartsAgentsRequestKind,
867
+ );
868
+
869
+ /** @internal */
870
+ export const StreamRunAgentPartsAgentsRequestKind$outboundSchema:
871
+ z.ZodNativeEnum<typeof StreamRunAgentPartsAgentsRequestKind> =
872
+ StreamRunAgentPartsAgentsRequestKind$inboundSchema;
873
+
874
+ /**
875
+ * @internal
876
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
877
+ */
878
+ export namespace StreamRunAgentPartsAgentsRequestKind$ {
879
+ /** @deprecated use `StreamRunAgentPartsAgentsRequestKind$inboundSchema` instead. */
880
+ export const inboundSchema =
881
+ StreamRunAgentPartsAgentsRequestKind$inboundSchema;
882
+ /** @deprecated use `StreamRunAgentPartsAgentsRequestKind$outboundSchema` instead. */
883
+ export const outboundSchema =
884
+ StreamRunAgentPartsAgentsRequestKind$outboundSchema;
885
+ }
886
+
887
+ /** @internal */
888
+ export const StreamRunAgentFile2$inboundSchema: z.ZodType<
889
+ StreamRunAgentFile2,
890
+ z.ZodTypeDef,
891
+ unknown
892
+ > = z.object({
893
+ uri: z.string(),
894
+ mimeType: z.string().optional(),
895
+ name: z.string().optional(),
896
+ });
897
+
898
+ /** @internal */
899
+ export type StreamRunAgentFile2$Outbound = {
900
+ uri: string;
901
+ mimeType?: string | undefined;
902
+ name?: string | undefined;
903
+ };
904
+
905
+ /** @internal */
906
+ export const StreamRunAgentFile2$outboundSchema: z.ZodType<
907
+ StreamRunAgentFile2$Outbound,
908
+ z.ZodTypeDef,
909
+ StreamRunAgentFile2
910
+ > = z.object({
911
+ uri: z.string(),
912
+ mimeType: z.string().optional(),
913
+ name: z.string().optional(),
914
+ });
915
+
916
+ /**
917
+ * @internal
918
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
919
+ */
920
+ export namespace StreamRunAgentFile2$ {
921
+ /** @deprecated use `StreamRunAgentFile2$inboundSchema` instead. */
922
+ export const inboundSchema = StreamRunAgentFile2$inboundSchema;
923
+ /** @deprecated use `StreamRunAgentFile2$outboundSchema` instead. */
924
+ export const outboundSchema = StreamRunAgentFile2$outboundSchema;
925
+ /** @deprecated use `StreamRunAgentFile2$Outbound` instead. */
926
+ export type Outbound = StreamRunAgentFile2$Outbound;
927
+ }
928
+
929
+ export function streamRunAgentFile2ToJSON(
930
+ streamRunAgentFile2: StreamRunAgentFile2,
931
+ ): string {
932
+ return JSON.stringify(
933
+ StreamRunAgentFile2$outboundSchema.parse(streamRunAgentFile2),
934
+ );
935
+ }
936
+
937
+ export function streamRunAgentFile2FromJSON(
938
+ jsonString: string,
939
+ ): SafeParseResult<StreamRunAgentFile2, SDKValidationError> {
940
+ return safeParse(
941
+ jsonString,
942
+ (x) => StreamRunAgentFile2$inboundSchema.parse(JSON.parse(x)),
943
+ `Failed to parse 'StreamRunAgentFile2' from JSON`,
944
+ );
945
+ }
946
+
947
+ /** @internal */
948
+ export const StreamRunAgentFile1$inboundSchema: z.ZodType<
949
+ StreamRunAgentFile1,
950
+ z.ZodTypeDef,
951
+ unknown
952
+ > = z.object({
953
+ bytes: z.string(),
954
+ mimeType: z.string().optional(),
955
+ name: z.string().optional(),
956
+ });
957
+
958
+ /** @internal */
959
+ export type StreamRunAgentFile1$Outbound = {
960
+ bytes: string;
961
+ mimeType?: string | undefined;
962
+ name?: string | undefined;
963
+ };
964
+
965
+ /** @internal */
966
+ export const StreamRunAgentFile1$outboundSchema: z.ZodType<
967
+ StreamRunAgentFile1$Outbound,
968
+ z.ZodTypeDef,
969
+ StreamRunAgentFile1
970
+ > = z.object({
971
+ bytes: z.string(),
972
+ mimeType: z.string().optional(),
973
+ name: z.string().optional(),
974
+ });
975
+
976
+ /**
977
+ * @internal
978
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
979
+ */
980
+ export namespace StreamRunAgentFile1$ {
981
+ /** @deprecated use `StreamRunAgentFile1$inboundSchema` instead. */
982
+ export const inboundSchema = StreamRunAgentFile1$inboundSchema;
983
+ /** @deprecated use `StreamRunAgentFile1$outboundSchema` instead. */
984
+ export const outboundSchema = StreamRunAgentFile1$outboundSchema;
985
+ /** @deprecated use `StreamRunAgentFile1$Outbound` instead. */
986
+ export type Outbound = StreamRunAgentFile1$Outbound;
987
+ }
988
+
989
+ export function streamRunAgentFile1ToJSON(
990
+ streamRunAgentFile1: StreamRunAgentFile1,
991
+ ): string {
992
+ return JSON.stringify(
993
+ StreamRunAgentFile1$outboundSchema.parse(streamRunAgentFile1),
994
+ );
995
+ }
996
+
997
+ export function streamRunAgentFile1FromJSON(
998
+ jsonString: string,
999
+ ): SafeParseResult<StreamRunAgentFile1, SDKValidationError> {
1000
+ return safeParse(
1001
+ jsonString,
1002
+ (x) => StreamRunAgentFile1$inboundSchema.parse(JSON.parse(x)),
1003
+ `Failed to parse 'StreamRunAgentFile1' from JSON`,
1004
+ );
1005
+ }
1006
+
1007
+ /** @internal */
1008
+ export const StreamRunAgentPartsFile$inboundSchema: z.ZodType<
1009
+ StreamRunAgentPartsFile,
1010
+ z.ZodTypeDef,
1011
+ unknown
1012
+ > = z.union([
1013
+ z.lazy(() => StreamRunAgentFile1$inboundSchema),
1014
+ z.lazy(() => StreamRunAgentFile2$inboundSchema),
1015
+ ]);
1016
+
1017
+ /** @internal */
1018
+ export type StreamRunAgentPartsFile$Outbound =
1019
+ | StreamRunAgentFile1$Outbound
1020
+ | StreamRunAgentFile2$Outbound;
1021
+
1022
+ /** @internal */
1023
+ export const StreamRunAgentPartsFile$outboundSchema: z.ZodType<
1024
+ StreamRunAgentPartsFile$Outbound,
1025
+ z.ZodTypeDef,
1026
+ StreamRunAgentPartsFile
1027
+ > = z.union([
1028
+ z.lazy(() => StreamRunAgentFile1$outboundSchema),
1029
+ z.lazy(() => StreamRunAgentFile2$outboundSchema),
1030
+ ]);
1031
+
1032
+ /**
1033
+ * @internal
1034
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1035
+ */
1036
+ export namespace StreamRunAgentPartsFile$ {
1037
+ /** @deprecated use `StreamRunAgentPartsFile$inboundSchema` instead. */
1038
+ export const inboundSchema = StreamRunAgentPartsFile$inboundSchema;
1039
+ /** @deprecated use `StreamRunAgentPartsFile$outboundSchema` instead. */
1040
+ export const outboundSchema = StreamRunAgentPartsFile$outboundSchema;
1041
+ /** @deprecated use `StreamRunAgentPartsFile$Outbound` instead. */
1042
+ export type Outbound = StreamRunAgentPartsFile$Outbound;
1043
+ }
1044
+
1045
+ export function streamRunAgentPartsFileToJSON(
1046
+ streamRunAgentPartsFile: StreamRunAgentPartsFile,
1047
+ ): string {
1048
+ return JSON.stringify(
1049
+ StreamRunAgentPartsFile$outboundSchema.parse(streamRunAgentPartsFile),
1050
+ );
1051
+ }
1052
+
1053
+ export function streamRunAgentPartsFileFromJSON(
1054
+ jsonString: string,
1055
+ ): SafeParseResult<StreamRunAgentPartsFile, SDKValidationError> {
1056
+ return safeParse(
1057
+ jsonString,
1058
+ (x) => StreamRunAgentPartsFile$inboundSchema.parse(JSON.parse(x)),
1059
+ `Failed to parse 'StreamRunAgentPartsFile' from JSON`,
1060
+ );
1061
+ }
1062
+
1063
+ /** @internal */
1064
+ export const StreamRunAgentParts3$inboundSchema: z.ZodType<
1065
+ StreamRunAgentParts3,
1066
+ z.ZodTypeDef,
1067
+ unknown
1068
+ > = z.object({
1069
+ kind: StreamRunAgentPartsAgentsRequestKind$inboundSchema,
1070
+ file: z.union([
1071
+ z.lazy(() => StreamRunAgentFile1$inboundSchema),
1072
+ z.lazy(() => StreamRunAgentFile2$inboundSchema),
1073
+ ]),
1074
+ metadata: z.record(z.any()).optional(),
1075
+ });
1076
+
1077
+ /** @internal */
1078
+ export type StreamRunAgentParts3$Outbound = {
1079
+ kind: string;
1080
+ file: StreamRunAgentFile1$Outbound | StreamRunAgentFile2$Outbound;
1081
+ metadata?: { [k: string]: any } | undefined;
1082
+ };
1083
+
1084
+ /** @internal */
1085
+ export const StreamRunAgentParts3$outboundSchema: z.ZodType<
1086
+ StreamRunAgentParts3$Outbound,
1087
+ z.ZodTypeDef,
1088
+ StreamRunAgentParts3
1089
+ > = z.object({
1090
+ kind: StreamRunAgentPartsAgentsRequestKind$outboundSchema,
1091
+ file: z.union([
1092
+ z.lazy(() => StreamRunAgentFile1$outboundSchema),
1093
+ z.lazy(() => StreamRunAgentFile2$outboundSchema),
1094
+ ]),
1095
+ metadata: z.record(z.any()).optional(),
1096
+ });
1097
+
1098
+ /**
1099
+ * @internal
1100
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1101
+ */
1102
+ export namespace StreamRunAgentParts3$ {
1103
+ /** @deprecated use `StreamRunAgentParts3$inboundSchema` instead. */
1104
+ export const inboundSchema = StreamRunAgentParts3$inboundSchema;
1105
+ /** @deprecated use `StreamRunAgentParts3$outboundSchema` instead. */
1106
+ export const outboundSchema = StreamRunAgentParts3$outboundSchema;
1107
+ /** @deprecated use `StreamRunAgentParts3$Outbound` instead. */
1108
+ export type Outbound = StreamRunAgentParts3$Outbound;
1109
+ }
1110
+
1111
+ export function streamRunAgentParts3ToJSON(
1112
+ streamRunAgentParts3: StreamRunAgentParts3,
1113
+ ): string {
1114
+ return JSON.stringify(
1115
+ StreamRunAgentParts3$outboundSchema.parse(streamRunAgentParts3),
1116
+ );
1117
+ }
1118
+
1119
+ export function streamRunAgentParts3FromJSON(
1120
+ jsonString: string,
1121
+ ): SafeParseResult<StreamRunAgentParts3, SDKValidationError> {
1122
+ return safeParse(
1123
+ jsonString,
1124
+ (x) => StreamRunAgentParts3$inboundSchema.parse(JSON.parse(x)),
1125
+ `Failed to parse 'StreamRunAgentParts3' from JSON`,
1126
+ );
1127
+ }
1128
+
1129
+ /** @internal */
1130
+ export const StreamRunAgentPartsAgentsKind$inboundSchema: z.ZodNativeEnum<
1131
+ typeof StreamRunAgentPartsAgentsKind
1132
+ > = z.nativeEnum(StreamRunAgentPartsAgentsKind);
1133
+
1134
+ /** @internal */
1135
+ export const StreamRunAgentPartsAgentsKind$outboundSchema: z.ZodNativeEnum<
1136
+ typeof StreamRunAgentPartsAgentsKind
1137
+ > = StreamRunAgentPartsAgentsKind$inboundSchema;
1138
+
1139
+ /**
1140
+ * @internal
1141
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1142
+ */
1143
+ export namespace StreamRunAgentPartsAgentsKind$ {
1144
+ /** @deprecated use `StreamRunAgentPartsAgentsKind$inboundSchema` instead. */
1145
+ export const inboundSchema = StreamRunAgentPartsAgentsKind$inboundSchema;
1146
+ /** @deprecated use `StreamRunAgentPartsAgentsKind$outboundSchema` instead. */
1147
+ export const outboundSchema = StreamRunAgentPartsAgentsKind$outboundSchema;
1148
+ }
1149
+
1150
+ /** @internal */
1151
+ export const StreamRunAgentParts2$inboundSchema: z.ZodType<
1152
+ StreamRunAgentParts2,
1153
+ z.ZodTypeDef,
1154
+ unknown
1155
+ > = z.object({
1156
+ kind: StreamRunAgentPartsAgentsKind$inboundSchema,
1157
+ data: z.any().optional(),
1158
+ metadata: z.record(z.any()).optional(),
1159
+ });
1160
+
1161
+ /** @internal */
1162
+ export type StreamRunAgentParts2$Outbound = {
1163
+ kind: string;
1164
+ data?: any | undefined;
1165
+ metadata?: { [k: string]: any } | undefined;
1166
+ };
1167
+
1168
+ /** @internal */
1169
+ export const StreamRunAgentParts2$outboundSchema: z.ZodType<
1170
+ StreamRunAgentParts2$Outbound,
1171
+ z.ZodTypeDef,
1172
+ StreamRunAgentParts2
1173
+ > = z.object({
1174
+ kind: StreamRunAgentPartsAgentsKind$outboundSchema,
1175
+ data: z.any().optional(),
1176
+ metadata: z.record(z.any()).optional(),
1177
+ });
1178
+
1179
+ /**
1180
+ * @internal
1181
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1182
+ */
1183
+ export namespace StreamRunAgentParts2$ {
1184
+ /** @deprecated use `StreamRunAgentParts2$inboundSchema` instead. */
1185
+ export const inboundSchema = StreamRunAgentParts2$inboundSchema;
1186
+ /** @deprecated use `StreamRunAgentParts2$outboundSchema` instead. */
1187
+ export const outboundSchema = StreamRunAgentParts2$outboundSchema;
1188
+ /** @deprecated use `StreamRunAgentParts2$Outbound` instead. */
1189
+ export type Outbound = StreamRunAgentParts2$Outbound;
1190
+ }
1191
+
1192
+ export function streamRunAgentParts2ToJSON(
1193
+ streamRunAgentParts2: StreamRunAgentParts2,
1194
+ ): string {
1195
+ return JSON.stringify(
1196
+ StreamRunAgentParts2$outboundSchema.parse(streamRunAgentParts2),
1197
+ );
1198
+ }
1199
+
1200
+ export function streamRunAgentParts2FromJSON(
1201
+ jsonString: string,
1202
+ ): SafeParseResult<StreamRunAgentParts2, SDKValidationError> {
1203
+ return safeParse(
1204
+ jsonString,
1205
+ (x) => StreamRunAgentParts2$inboundSchema.parse(JSON.parse(x)),
1206
+ `Failed to parse 'StreamRunAgentParts2' from JSON`,
1207
+ );
1208
+ }
1209
+
1210
+ /** @internal */
1211
+ export const StreamRunAgentPartsKind$inboundSchema: z.ZodNativeEnum<
1212
+ typeof StreamRunAgentPartsKind
1213
+ > = z.nativeEnum(StreamRunAgentPartsKind);
1214
+
1215
+ /** @internal */
1216
+ export const StreamRunAgentPartsKind$outboundSchema: z.ZodNativeEnum<
1217
+ typeof StreamRunAgentPartsKind
1218
+ > = StreamRunAgentPartsKind$inboundSchema;
1219
+
1220
+ /**
1221
+ * @internal
1222
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1223
+ */
1224
+ export namespace StreamRunAgentPartsKind$ {
1225
+ /** @deprecated use `StreamRunAgentPartsKind$inboundSchema` instead. */
1226
+ export const inboundSchema = StreamRunAgentPartsKind$inboundSchema;
1227
+ /** @deprecated use `StreamRunAgentPartsKind$outboundSchema` instead. */
1228
+ export const outboundSchema = StreamRunAgentPartsKind$outboundSchema;
1229
+ }
1230
+
1231
+ /** @internal */
1232
+ export const StreamRunAgentParts1$inboundSchema: z.ZodType<
1233
+ StreamRunAgentParts1,
1234
+ z.ZodTypeDef,
1235
+ unknown
1236
+ > = z.object({
1237
+ kind: StreamRunAgentPartsKind$inboundSchema,
1238
+ text: z.string(),
1239
+ });
1240
+
1241
+ /** @internal */
1242
+ export type StreamRunAgentParts1$Outbound = {
1243
+ kind: string;
1244
+ text: string;
1245
+ };
1246
+
1247
+ /** @internal */
1248
+ export const StreamRunAgentParts1$outboundSchema: z.ZodType<
1249
+ StreamRunAgentParts1$Outbound,
1250
+ z.ZodTypeDef,
1251
+ StreamRunAgentParts1
1252
+ > = z.object({
1253
+ kind: StreamRunAgentPartsKind$outboundSchema,
1254
+ text: z.string(),
1255
+ });
1256
+
1257
+ /**
1258
+ * @internal
1259
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1260
+ */
1261
+ export namespace StreamRunAgentParts1$ {
1262
+ /** @deprecated use `StreamRunAgentParts1$inboundSchema` instead. */
1263
+ export const inboundSchema = StreamRunAgentParts1$inboundSchema;
1264
+ /** @deprecated use `StreamRunAgentParts1$outboundSchema` instead. */
1265
+ export const outboundSchema = StreamRunAgentParts1$outboundSchema;
1266
+ /** @deprecated use `StreamRunAgentParts1$Outbound` instead. */
1267
+ export type Outbound = StreamRunAgentParts1$Outbound;
1268
+ }
1269
+
1270
+ export function streamRunAgentParts1ToJSON(
1271
+ streamRunAgentParts1: StreamRunAgentParts1,
1272
+ ): string {
1273
+ return JSON.stringify(
1274
+ StreamRunAgentParts1$outboundSchema.parse(streamRunAgentParts1),
1275
+ );
1276
+ }
1277
+
1278
+ export function streamRunAgentParts1FromJSON(
1279
+ jsonString: string,
1280
+ ): SafeParseResult<StreamRunAgentParts1, SDKValidationError> {
1281
+ return safeParse(
1282
+ jsonString,
1283
+ (x) => StreamRunAgentParts1$inboundSchema.parse(JSON.parse(x)),
1284
+ `Failed to parse 'StreamRunAgentParts1' from JSON`,
1285
+ );
1286
+ }
1287
+
1288
+ /** @internal */
1289
+ export const StreamRunAgentParts$inboundSchema: z.ZodType<
1290
+ StreamRunAgentParts,
1291
+ z.ZodTypeDef,
1292
+ unknown
1293
+ > = z.union([
1294
+ z.lazy(() => StreamRunAgentParts4$inboundSchema),
1295
+ z.lazy(() => StreamRunAgentParts1$inboundSchema),
1296
+ z.lazy(() => StreamRunAgentParts3$inboundSchema),
1297
+ z.lazy(() => Parts5$inboundSchema),
1298
+ z.lazy(() => StreamRunAgentParts2$inboundSchema),
1299
+ ]);
1300
+
1301
+ /** @internal */
1302
+ export type StreamRunAgentParts$Outbound =
1303
+ | StreamRunAgentParts4$Outbound
1304
+ | StreamRunAgentParts1$Outbound
1305
+ | StreamRunAgentParts3$Outbound
1306
+ | Parts5$Outbound
1307
+ | StreamRunAgentParts2$Outbound;
1308
+
1309
+ /** @internal */
1310
+ export const StreamRunAgentParts$outboundSchema: z.ZodType<
1311
+ StreamRunAgentParts$Outbound,
1312
+ z.ZodTypeDef,
1313
+ StreamRunAgentParts
1314
+ > = z.union([
1315
+ z.lazy(() => StreamRunAgentParts4$outboundSchema),
1316
+ z.lazy(() => StreamRunAgentParts1$outboundSchema),
1317
+ z.lazy(() => StreamRunAgentParts3$outboundSchema),
1318
+ z.lazy(() => Parts5$outboundSchema),
1319
+ z.lazy(() => StreamRunAgentParts2$outboundSchema),
1320
+ ]);
1321
+
1322
+ /**
1323
+ * @internal
1324
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1325
+ */
1326
+ export namespace StreamRunAgentParts$ {
1327
+ /** @deprecated use `StreamRunAgentParts$inboundSchema` instead. */
1328
+ export const inboundSchema = StreamRunAgentParts$inboundSchema;
1329
+ /** @deprecated use `StreamRunAgentParts$outboundSchema` instead. */
1330
+ export const outboundSchema = StreamRunAgentParts$outboundSchema;
1331
+ /** @deprecated use `StreamRunAgentParts$Outbound` instead. */
1332
+ export type Outbound = StreamRunAgentParts$Outbound;
1333
+ }
1334
+
1335
+ export function streamRunAgentPartsToJSON(
1336
+ streamRunAgentParts: StreamRunAgentParts,
1337
+ ): string {
1338
+ return JSON.stringify(
1339
+ StreamRunAgentParts$outboundSchema.parse(streamRunAgentParts),
1340
+ );
1341
+ }
1342
+
1343
+ export function streamRunAgentPartsFromJSON(
1344
+ jsonString: string,
1345
+ ): SafeParseResult<StreamRunAgentParts, SDKValidationError> {
1346
+ return safeParse(
1347
+ jsonString,
1348
+ (x) => StreamRunAgentParts$inboundSchema.parse(JSON.parse(x)),
1349
+ `Failed to parse 'StreamRunAgentParts' from JSON`,
1350
+ );
1351
+ }
1352
+
1353
+ /** @internal */
1354
+ export const StreamRunAgentMessage$inboundSchema: z.ZodType<
1355
+ StreamRunAgentMessage,
1356
+ z.ZodTypeDef,
1357
+ unknown
1358
+ > = z.object({
1359
+ messageId: z.string().optional(),
1360
+ role: z.union([
1361
+ StreamRunAgentRole1$inboundSchema,
1362
+ StreamRunAgentRole2$inboundSchema,
1363
+ ]),
1364
+ parts: z.array(
1365
+ z.union([
1366
+ z.lazy(() => StreamRunAgentParts4$inboundSchema),
1367
+ z.lazy(() => StreamRunAgentParts1$inboundSchema),
1368
+ z.lazy(() => StreamRunAgentParts3$inboundSchema),
1369
+ z.lazy(() => Parts5$inboundSchema),
1370
+ z.lazy(() => StreamRunAgentParts2$inboundSchema),
1371
+ ]),
1372
+ ),
1373
+ metadata: z.record(z.any()).optional(),
1374
+ });
1375
+
1376
+ /** @internal */
1377
+ export type StreamRunAgentMessage$Outbound = {
1378
+ messageId?: string | undefined;
1379
+ role: string | string;
1380
+ parts: Array<
1381
+ | StreamRunAgentParts4$Outbound
1382
+ | StreamRunAgentParts1$Outbound
1383
+ | StreamRunAgentParts3$Outbound
1384
+ | Parts5$Outbound
1385
+ | StreamRunAgentParts2$Outbound
1386
+ >;
1387
+ metadata?: { [k: string]: any } | undefined;
1388
+ };
1389
+
1390
+ /** @internal */
1391
+ export const StreamRunAgentMessage$outboundSchema: z.ZodType<
1392
+ StreamRunAgentMessage$Outbound,
1393
+ z.ZodTypeDef,
1394
+ StreamRunAgentMessage
1395
+ > = z.object({
1396
+ messageId: z.string().optional(),
1397
+ role: z.union([
1398
+ StreamRunAgentRole1$outboundSchema,
1399
+ StreamRunAgentRole2$outboundSchema,
1400
+ ]),
1401
+ parts: z.array(
1402
+ z.union([
1403
+ z.lazy(() => StreamRunAgentParts4$outboundSchema),
1404
+ z.lazy(() => StreamRunAgentParts1$outboundSchema),
1405
+ z.lazy(() => StreamRunAgentParts3$outboundSchema),
1406
+ z.lazy(() => Parts5$outboundSchema),
1407
+ z.lazy(() => StreamRunAgentParts2$outboundSchema),
1408
+ ]),
1409
+ ),
1410
+ metadata: z.record(z.any()).optional(),
1411
+ });
1412
+
1413
+ /**
1414
+ * @internal
1415
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1416
+ */
1417
+ export namespace StreamRunAgentMessage$ {
1418
+ /** @deprecated use `StreamRunAgentMessage$inboundSchema` instead. */
1419
+ export const inboundSchema = StreamRunAgentMessage$inboundSchema;
1420
+ /** @deprecated use `StreamRunAgentMessage$outboundSchema` instead. */
1421
+ export const outboundSchema = StreamRunAgentMessage$outboundSchema;
1422
+ /** @deprecated use `StreamRunAgentMessage$Outbound` instead. */
1423
+ export type Outbound = StreamRunAgentMessage$Outbound;
1424
+ }
1425
+
1426
+ export function streamRunAgentMessageToJSON(
1427
+ streamRunAgentMessage: StreamRunAgentMessage,
1428
+ ): string {
1429
+ return JSON.stringify(
1430
+ StreamRunAgentMessage$outboundSchema.parse(streamRunAgentMessage),
1431
+ );
1432
+ }
1433
+
1434
+ export function streamRunAgentMessageFromJSON(
1435
+ jsonString: string,
1436
+ ): SafeParseResult<StreamRunAgentMessage, SDKValidationError> {
1437
+ return safeParse(
1438
+ jsonString,
1439
+ (x) => StreamRunAgentMessage$inboundSchema.parse(JSON.parse(x)),
1440
+ `Failed to parse 'StreamRunAgentMessage' from JSON`,
1441
+ );
1442
+ }
1443
+
1444
+ /** @internal */
1445
+ export const StreamRunAgentTeamOfAgents$inboundSchema: z.ZodType<
1446
+ StreamRunAgentTeamOfAgents,
1447
+ z.ZodTypeDef,
1448
+ unknown
1449
+ > = z.object({
1450
+ _id: z.string(),
1451
+ role: z.string().optional(),
1452
+ }).transform((v) => {
1453
+ return remap$(v, {
1454
+ "_id": "id",
1455
+ });
1456
+ });
1457
+
1458
+ /** @internal */
1459
+ export type StreamRunAgentTeamOfAgents$Outbound = {
1460
+ _id: string;
1461
+ role?: string | undefined;
1462
+ };
1463
+
1464
+ /** @internal */
1465
+ export const StreamRunAgentTeamOfAgents$outboundSchema: z.ZodType<
1466
+ StreamRunAgentTeamOfAgents$Outbound,
1467
+ z.ZodTypeDef,
1468
+ StreamRunAgentTeamOfAgents
1469
+ > = z.object({
1470
+ id: z.string(),
1471
+ role: z.string().optional(),
1472
+ }).transform((v) => {
1473
+ return remap$(v, {
1474
+ id: "_id",
1475
+ });
1476
+ });
1477
+
1478
+ /**
1479
+ * @internal
1480
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1481
+ */
1482
+ export namespace StreamRunAgentTeamOfAgents$ {
1483
+ /** @deprecated use `StreamRunAgentTeamOfAgents$inboundSchema` instead. */
1484
+ export const inboundSchema = StreamRunAgentTeamOfAgents$inboundSchema;
1485
+ /** @deprecated use `StreamRunAgentTeamOfAgents$outboundSchema` instead. */
1486
+ export const outboundSchema = StreamRunAgentTeamOfAgents$outboundSchema;
1487
+ /** @deprecated use `StreamRunAgentTeamOfAgents$Outbound` instead. */
1488
+ export type Outbound = StreamRunAgentTeamOfAgents$Outbound;
1489
+ }
1490
+
1491
+ export function streamRunAgentTeamOfAgentsToJSON(
1492
+ streamRunAgentTeamOfAgents: StreamRunAgentTeamOfAgents,
1493
+ ): string {
1494
+ return JSON.stringify(
1495
+ StreamRunAgentTeamOfAgents$outboundSchema.parse(streamRunAgentTeamOfAgents),
1496
+ );
1497
+ }
1498
+
1499
+ export function streamRunAgentTeamOfAgentsFromJSON(
1500
+ jsonString: string,
1501
+ ): SafeParseResult<StreamRunAgentTeamOfAgents, SDKValidationError> {
1502
+ return safeParse(
1503
+ jsonString,
1504
+ (x) => StreamRunAgentTeamOfAgents$inboundSchema.parse(JSON.parse(x)),
1505
+ `Failed to parse 'StreamRunAgentTeamOfAgents' from JSON`,
1506
+ );
1507
+ }
1508
+
1509
+ /** @internal */
1510
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$inboundSchema:
1511
+ z.ZodNativeEnum<
1512
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings12Type
1513
+ > = z.nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodySettings12Type);
1514
+
1515
+ /** @internal */
1516
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$outboundSchema:
1517
+ z.ZodNativeEnum<
1518
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings12Type
1519
+ > = StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$inboundSchema;
1520
+
1521
+ /**
1522
+ * @internal
1523
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1524
+ */
1525
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$ {
1526
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$inboundSchema` instead. */
1527
+ export const inboundSchema =
1528
+ StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$inboundSchema;
1529
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$outboundSchema` instead. */
1530
+ export const outboundSchema =
1531
+ StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$outboundSchema;
1532
+ }
1533
+
1534
+ /** @internal */
1535
+ export const StreamRunAgentToolsFunction$inboundSchema: z.ZodType<
1536
+ StreamRunAgentToolsFunction,
1537
+ z.ZodTypeDef,
1538
+ unknown
1539
+ > = z.object({
1540
+ name: z.string(),
1541
+ description: z.string().optional(),
1542
+ strict: z.boolean().optional(),
1543
+ parameters: z.record(z.any()).optional(),
1544
+ });
1545
+
1546
+ /** @internal */
1547
+ export type StreamRunAgentToolsFunction$Outbound = {
1548
+ name: string;
1549
+ description?: string | undefined;
1550
+ strict?: boolean | undefined;
1551
+ parameters?: { [k: string]: any } | undefined;
1552
+ };
1553
+
1554
+ /** @internal */
1555
+ export const StreamRunAgentToolsFunction$outboundSchema: z.ZodType<
1556
+ StreamRunAgentToolsFunction$Outbound,
1557
+ z.ZodTypeDef,
1558
+ StreamRunAgentToolsFunction
1559
+ > = z.object({
1560
+ name: z.string(),
1561
+ description: z.string().optional(),
1562
+ strict: z.boolean().optional(),
1563
+ parameters: z.record(z.any()).optional(),
1564
+ });
1565
+
1566
+ /**
1567
+ * @internal
1568
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1569
+ */
1570
+ export namespace StreamRunAgentToolsFunction$ {
1571
+ /** @deprecated use `StreamRunAgentToolsFunction$inboundSchema` instead. */
1572
+ export const inboundSchema = StreamRunAgentToolsFunction$inboundSchema;
1573
+ /** @deprecated use `StreamRunAgentToolsFunction$outboundSchema` instead. */
1574
+ export const outboundSchema = StreamRunAgentToolsFunction$outboundSchema;
1575
+ /** @deprecated use `StreamRunAgentToolsFunction$Outbound` instead. */
1576
+ export type Outbound = StreamRunAgentToolsFunction$Outbound;
1577
+ }
1578
+
1579
+ export function streamRunAgentToolsFunctionToJSON(
1580
+ streamRunAgentToolsFunction: StreamRunAgentToolsFunction,
1581
+ ): string {
1582
+ return JSON.stringify(
1583
+ StreamRunAgentToolsFunction$outboundSchema.parse(
1584
+ streamRunAgentToolsFunction,
1585
+ ),
1586
+ );
1587
+ }
1588
+
1589
+ export function streamRunAgentToolsFunctionFromJSON(
1590
+ jsonString: string,
1591
+ ): SafeParseResult<StreamRunAgentToolsFunction, SDKValidationError> {
1592
+ return safeParse(
1593
+ jsonString,
1594
+ (x) => StreamRunAgentToolsFunction$inboundSchema.parse(JSON.parse(x)),
1595
+ `Failed to parse 'StreamRunAgentToolsFunction' from JSON`,
1596
+ );
1597
+ }
1598
+
1599
+ /** @internal */
1600
+ export const Tools12$inboundSchema: z.ZodType<Tools12, z.ZodTypeDef, unknown> =
1601
+ z.object({
1602
+ type:
1603
+ StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$inboundSchema,
1604
+ _id: z.string().optional(),
1605
+ key: z.string(),
1606
+ display_name: z.string().optional(),
1607
+ description: z.string().optional(),
1608
+ requires_approval: z.boolean().default(false),
1609
+ function: z.lazy(() => StreamRunAgentToolsFunction$inboundSchema),
1610
+ }).transform((v) => {
1611
+ return remap$(v, {
1612
+ "_id": "id",
1613
+ "display_name": "displayName",
1614
+ "requires_approval": "requiresApproval",
1615
+ });
1616
+ });
1617
+
1618
+ /** @internal */
1619
+ export type Tools12$Outbound = {
1620
+ type: string;
1621
+ _id?: string | undefined;
1622
+ key: string;
1623
+ display_name?: string | undefined;
1624
+ description?: string | undefined;
1625
+ requires_approval: boolean;
1626
+ function: StreamRunAgentToolsFunction$Outbound;
1627
+ };
1628
+
1629
+ /** @internal */
1630
+ export const Tools12$outboundSchema: z.ZodType<
1631
+ Tools12$Outbound,
1632
+ z.ZodTypeDef,
1633
+ Tools12
1634
+ > = z.object({
1635
+ type:
1636
+ StreamRunAgentToolsAgentsRequestRequestBodySettings12Type$outboundSchema,
1637
+ id: z.string().optional(),
1638
+ key: z.string(),
1639
+ displayName: z.string().optional(),
1640
+ description: z.string().optional(),
1641
+ requiresApproval: z.boolean().default(false),
1642
+ function: z.lazy(() => StreamRunAgentToolsFunction$outboundSchema),
1643
+ }).transform((v) => {
1644
+ return remap$(v, {
1645
+ id: "_id",
1646
+ displayName: "display_name",
1647
+ requiresApproval: "requires_approval",
1648
+ });
1649
+ });
1650
+
1651
+ /**
1652
+ * @internal
1653
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1654
+ */
1655
+ export namespace Tools12$ {
1656
+ /** @deprecated use `Tools12$inboundSchema` instead. */
1657
+ export const inboundSchema = Tools12$inboundSchema;
1658
+ /** @deprecated use `Tools12$outboundSchema` instead. */
1659
+ export const outboundSchema = Tools12$outboundSchema;
1660
+ /** @deprecated use `Tools12$Outbound` instead. */
1661
+ export type Outbound = Tools12$Outbound;
1662
+ }
1663
+
1664
+ export function tools12ToJSON(tools12: Tools12): string {
1665
+ return JSON.stringify(Tools12$outboundSchema.parse(tools12));
1666
+ }
1667
+
1668
+ export function tools12FromJSON(
1669
+ jsonString: string,
1670
+ ): SafeParseResult<Tools12, SDKValidationError> {
1671
+ return safeParse(
1672
+ jsonString,
1673
+ (x) => Tools12$inboundSchema.parse(JSON.parse(x)),
1674
+ `Failed to parse 'Tools12' from JSON`,
1675
+ );
1676
+ }
1677
+
1678
+ /** @internal */
1679
+ export const ToolsStatus$inboundSchema: z.ZodNativeEnum<typeof ToolsStatus> = z
1680
+ .nativeEnum(ToolsStatus);
1681
+
1682
+ /** @internal */
1683
+ export const ToolsStatus$outboundSchema: z.ZodNativeEnum<typeof ToolsStatus> =
1684
+ ToolsStatus$inboundSchema;
1685
+
1686
+ /**
1687
+ * @internal
1688
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1689
+ */
1690
+ export namespace ToolsStatus$ {
1691
+ /** @deprecated use `ToolsStatus$inboundSchema` instead. */
1692
+ export const inboundSchema = ToolsStatus$inboundSchema;
1693
+ /** @deprecated use `ToolsStatus$outboundSchema` instead. */
1694
+ export const outboundSchema = ToolsStatus$outboundSchema;
1695
+ }
1696
+
1697
+ /** @internal */
1698
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$inboundSchema:
1699
+ z.ZodNativeEnum<
1700
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings11Type
1701
+ > = z.nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodySettings11Type);
1702
+
1703
+ /** @internal */
1704
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$outboundSchema:
1705
+ z.ZodNativeEnum<
1706
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings11Type
1707
+ > = StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$inboundSchema;
1708
+
1709
+ /**
1710
+ * @internal
1711
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1712
+ */
1713
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$ {
1714
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$inboundSchema` instead. */
1715
+ export const inboundSchema =
1716
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$inboundSchema;
1717
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$outboundSchema` instead. */
1718
+ export const outboundSchema =
1719
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$outboundSchema;
1720
+ }
1721
+
1722
+ /** @internal */
1723
+ export const ToolsMethod$inboundSchema: z.ZodNativeEnum<typeof ToolsMethod> = z
1724
+ .nativeEnum(ToolsMethod);
1725
+
1726
+ /** @internal */
1727
+ export const ToolsMethod$outboundSchema: z.ZodNativeEnum<typeof ToolsMethod> =
1728
+ ToolsMethod$inboundSchema;
1729
+
1730
+ /**
1731
+ * @internal
1732
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1733
+ */
1734
+ export namespace ToolsMethod$ {
1735
+ /** @deprecated use `ToolsMethod$inboundSchema` instead. */
1736
+ export const inboundSchema = ToolsMethod$inboundSchema;
1737
+ /** @deprecated use `ToolsMethod$outboundSchema` instead. */
1738
+ export const outboundSchema = ToolsMethod$outboundSchema;
1739
+ }
1740
+
1741
+ /** @internal */
1742
+ export const ToolsBlueprint$inboundSchema: z.ZodType<
1743
+ ToolsBlueprint,
1744
+ z.ZodTypeDef,
1745
+ unknown
1746
+ > = z.object({
1747
+ url: z.string(),
1748
+ method: ToolsMethod$inboundSchema,
1749
+ headers: z.record(z.string()).optional(),
1750
+ body: z.record(z.any()).optional(),
1751
+ });
1752
+
1753
+ /** @internal */
1754
+ export type ToolsBlueprint$Outbound = {
1755
+ url: string;
1756
+ method: string;
1757
+ headers?: { [k: string]: string } | undefined;
1758
+ body?: { [k: string]: any } | undefined;
1759
+ };
1760
+
1761
+ /** @internal */
1762
+ export const ToolsBlueprint$outboundSchema: z.ZodType<
1763
+ ToolsBlueprint$Outbound,
1764
+ z.ZodTypeDef,
1765
+ ToolsBlueprint
1766
+ > = z.object({
1767
+ url: z.string(),
1768
+ method: ToolsMethod$outboundSchema,
1769
+ headers: z.record(z.string()).optional(),
1770
+ body: z.record(z.any()).optional(),
1771
+ });
1772
+
1773
+ /**
1774
+ * @internal
1775
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1776
+ */
1777
+ export namespace ToolsBlueprint$ {
1778
+ /** @deprecated use `ToolsBlueprint$inboundSchema` instead. */
1779
+ export const inboundSchema = ToolsBlueprint$inboundSchema;
1780
+ /** @deprecated use `ToolsBlueprint$outboundSchema` instead. */
1781
+ export const outboundSchema = ToolsBlueprint$outboundSchema;
1782
+ /** @deprecated use `ToolsBlueprint$Outbound` instead. */
1783
+ export type Outbound = ToolsBlueprint$Outbound;
1784
+ }
1785
+
1786
+ export function toolsBlueprintToJSON(toolsBlueprint: ToolsBlueprint): string {
1787
+ return JSON.stringify(ToolsBlueprint$outboundSchema.parse(toolsBlueprint));
1788
+ }
1789
+
1790
+ export function toolsBlueprintFromJSON(
1791
+ jsonString: string,
1792
+ ): SafeParseResult<ToolsBlueprint, SDKValidationError> {
1793
+ return safeParse(
1794
+ jsonString,
1795
+ (x) => ToolsBlueprint$inboundSchema.parse(JSON.parse(x)),
1796
+ `Failed to parse 'ToolsBlueprint' from JSON`,
1797
+ );
1798
+ }
1799
+
1800
+ /** @internal */
1801
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$inboundSchema:
1802
+ z.ZodNativeEnum<
1803
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType
1804
+ > = z.nativeEnum(
1805
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType,
1806
+ );
1807
+
1808
+ /** @internal */
1809
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$outboundSchema:
1810
+ z.ZodNativeEnum<
1811
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType
1812
+ > =
1813
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$inboundSchema;
1814
+
1815
+ /**
1816
+ * @internal
1817
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1818
+ */
1819
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$ {
1820
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$inboundSchema` instead. */
1821
+ export const inboundSchema =
1822
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$inboundSchema;
1823
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$outboundSchema` instead. */
1824
+ export const outboundSchema =
1825
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$outboundSchema;
1826
+ }
1827
+
1828
+ /** @internal */
1829
+ export const ToolsDefaultValue$inboundSchema: z.ZodType<
1830
+ ToolsDefaultValue,
1831
+ z.ZodTypeDef,
1832
+ unknown
1833
+ > = z.union([z.string(), z.number(), z.boolean()]);
1834
+
1835
+ /** @internal */
1836
+ export type ToolsDefaultValue$Outbound = string | number | boolean;
1837
+
1838
+ /** @internal */
1839
+ export const ToolsDefaultValue$outboundSchema: z.ZodType<
1840
+ ToolsDefaultValue$Outbound,
1841
+ z.ZodTypeDef,
1842
+ ToolsDefaultValue
1843
+ > = z.union([z.string(), z.number(), z.boolean()]);
1844
+
1845
+ /**
1846
+ * @internal
1847
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1848
+ */
1849
+ export namespace ToolsDefaultValue$ {
1850
+ /** @deprecated use `ToolsDefaultValue$inboundSchema` instead. */
1851
+ export const inboundSchema = ToolsDefaultValue$inboundSchema;
1852
+ /** @deprecated use `ToolsDefaultValue$outboundSchema` instead. */
1853
+ export const outboundSchema = ToolsDefaultValue$outboundSchema;
1854
+ /** @deprecated use `ToolsDefaultValue$Outbound` instead. */
1855
+ export type Outbound = ToolsDefaultValue$Outbound;
1856
+ }
1857
+
1858
+ export function toolsDefaultValueToJSON(
1859
+ toolsDefaultValue: ToolsDefaultValue,
1860
+ ): string {
1861
+ return JSON.stringify(
1862
+ ToolsDefaultValue$outboundSchema.parse(toolsDefaultValue),
1863
+ );
1864
+ }
1865
+
1866
+ export function toolsDefaultValueFromJSON(
1867
+ jsonString: string,
1868
+ ): SafeParseResult<ToolsDefaultValue, SDKValidationError> {
1869
+ return safeParse(
1870
+ jsonString,
1871
+ (x) => ToolsDefaultValue$inboundSchema.parse(JSON.parse(x)),
1872
+ `Failed to parse 'ToolsDefaultValue' from JSON`,
1873
+ );
1874
+ }
1875
+
1876
+ /** @internal */
1877
+ export const ToolsArguments$inboundSchema: z.ZodType<
1878
+ ToolsArguments,
1879
+ z.ZodTypeDef,
1880
+ unknown
1881
+ > = z.object({
1882
+ type:
1883
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$inboundSchema,
1884
+ description: z.string(),
1885
+ send_to_model: z.boolean().default(true),
1886
+ default_value: z.union([z.string(), z.number(), z.boolean()]).optional(),
1887
+ }).transform((v) => {
1888
+ return remap$(v, {
1889
+ "send_to_model": "sendToModel",
1890
+ "default_value": "defaultValue",
1891
+ });
1892
+ });
1893
+
1894
+ /** @internal */
1895
+ export type ToolsArguments$Outbound = {
1896
+ type: string;
1897
+ description: string;
1898
+ send_to_model: boolean;
1899
+ default_value?: string | number | boolean | undefined;
1900
+ };
1901
+
1902
+ /** @internal */
1903
+ export const ToolsArguments$outboundSchema: z.ZodType<
1904
+ ToolsArguments$Outbound,
1905
+ z.ZodTypeDef,
1906
+ ToolsArguments
1907
+ > = z.object({
1908
+ type:
1909
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11HttpType$outboundSchema,
1910
+ description: z.string(),
1911
+ sendToModel: z.boolean().default(true),
1912
+ defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(),
1913
+ }).transform((v) => {
1914
+ return remap$(v, {
1915
+ sendToModel: "send_to_model",
1916
+ defaultValue: "default_value",
1917
+ });
1918
+ });
1919
+
1920
+ /**
1921
+ * @internal
1922
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1923
+ */
1924
+ export namespace ToolsArguments$ {
1925
+ /** @deprecated use `ToolsArguments$inboundSchema` instead. */
1926
+ export const inboundSchema = ToolsArguments$inboundSchema;
1927
+ /** @deprecated use `ToolsArguments$outboundSchema` instead. */
1928
+ export const outboundSchema = ToolsArguments$outboundSchema;
1929
+ /** @deprecated use `ToolsArguments$Outbound` instead. */
1930
+ export type Outbound = ToolsArguments$Outbound;
1931
+ }
1932
+
1933
+ export function toolsArgumentsToJSON(toolsArguments: ToolsArguments): string {
1934
+ return JSON.stringify(ToolsArguments$outboundSchema.parse(toolsArguments));
1935
+ }
1936
+
1937
+ export function toolsArgumentsFromJSON(
1938
+ jsonString: string,
1939
+ ): SafeParseResult<ToolsArguments, SDKValidationError> {
1940
+ return safeParse(
1941
+ jsonString,
1942
+ (x) => ToolsArguments$inboundSchema.parse(JSON.parse(x)),
1943
+ `Failed to parse 'ToolsArguments' from JSON`,
1944
+ );
1945
+ }
1946
+
1947
+ /** @internal */
1948
+ export const ToolsHttp$inboundSchema: z.ZodType<
1949
+ ToolsHttp,
1950
+ z.ZodTypeDef,
1951
+ unknown
1952
+ > = z.object({
1953
+ blueprint: z.lazy(() => ToolsBlueprint$inboundSchema),
1954
+ arguments: z.record(z.lazy(() => ToolsArguments$inboundSchema)).optional(),
1955
+ });
1956
+
1957
+ /** @internal */
1958
+ export type ToolsHttp$Outbound = {
1959
+ blueprint: ToolsBlueprint$Outbound;
1960
+ arguments?: { [k: string]: ToolsArguments$Outbound } | undefined;
1961
+ };
1962
+
1963
+ /** @internal */
1964
+ export const ToolsHttp$outboundSchema: z.ZodType<
1965
+ ToolsHttp$Outbound,
1966
+ z.ZodTypeDef,
1967
+ ToolsHttp
1968
+ > = z.object({
1969
+ blueprint: z.lazy(() => ToolsBlueprint$outboundSchema),
1970
+ arguments: z.record(z.lazy(() => ToolsArguments$outboundSchema)).optional(),
1971
+ });
1972
+
1973
+ /**
1974
+ * @internal
1975
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1976
+ */
1977
+ export namespace ToolsHttp$ {
1978
+ /** @deprecated use `ToolsHttp$inboundSchema` instead. */
1979
+ export const inboundSchema = ToolsHttp$inboundSchema;
1980
+ /** @deprecated use `ToolsHttp$outboundSchema` instead. */
1981
+ export const outboundSchema = ToolsHttp$outboundSchema;
1982
+ /** @deprecated use `ToolsHttp$Outbound` instead. */
1983
+ export type Outbound = ToolsHttp$Outbound;
1984
+ }
1985
+
1986
+ export function toolsHttpToJSON(toolsHttp: ToolsHttp): string {
1987
+ return JSON.stringify(ToolsHttp$outboundSchema.parse(toolsHttp));
1988
+ }
1989
+
1990
+ export function toolsHttpFromJSON(
1991
+ jsonString: string,
1992
+ ): SafeParseResult<ToolsHttp, SDKValidationError> {
1993
+ return safeParse(
1994
+ jsonString,
1995
+ (x) => ToolsHttp$inboundSchema.parse(JSON.parse(x)),
1996
+ `Failed to parse 'ToolsHttp' from JSON`,
1997
+ );
1998
+ }
1999
+
2000
+ /** @internal */
2001
+ export const Tools11$inboundSchema: z.ZodType<Tools11, z.ZodTypeDef, unknown> =
2002
+ z.object({
2003
+ _id: z.string().default("01K4PX8V361B9S15XZTQESJ7M6"),
2004
+ path: z.string(),
2005
+ key: z.string(),
2006
+ display_name: z.string(),
2007
+ description: z.string(),
2008
+ status: ToolsStatus$inboundSchema.default("live"),
2009
+ version_hash: z.string().optional(),
2010
+ type:
2011
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$inboundSchema,
2012
+ http: z.lazy(() => ToolsHttp$inboundSchema),
2013
+ requires_approval: z.boolean().default(false),
2014
+ }).transform((v) => {
2015
+ return remap$(v, {
2016
+ "_id": "id",
2017
+ "display_name": "displayName",
2018
+ "version_hash": "versionHash",
2019
+ "requires_approval": "requiresApproval",
2020
+ });
2021
+ });
2022
+
2023
+ /** @internal */
2024
+ export type Tools11$Outbound = {
2025
+ _id: string;
2026
+ path: string;
2027
+ key: string;
2028
+ display_name: string;
2029
+ description: string;
2030
+ status: string;
2031
+ version_hash?: string | undefined;
2032
+ type: string;
2033
+ http: ToolsHttp$Outbound;
2034
+ requires_approval: boolean;
2035
+ };
2036
+
2037
+ /** @internal */
2038
+ export const Tools11$outboundSchema: z.ZodType<
2039
+ Tools11$Outbound,
2040
+ z.ZodTypeDef,
2041
+ Tools11
2042
+ > = z.object({
2043
+ id: z.string().default("01K4PX8V361B9S15XZTQESJ7M6"),
2044
+ path: z.string(),
2045
+ key: z.string(),
2046
+ displayName: z.string(),
2047
+ description: z.string(),
2048
+ status: ToolsStatus$outboundSchema.default("live"),
2049
+ versionHash: z.string().optional(),
2050
+ type:
2051
+ StreamRunAgentToolsAgentsRequestRequestBodySettings11Type$outboundSchema,
2052
+ http: z.lazy(() => ToolsHttp$outboundSchema),
2053
+ requiresApproval: z.boolean().default(false),
2054
+ }).transform((v) => {
2055
+ return remap$(v, {
2056
+ id: "_id",
2057
+ displayName: "display_name",
2058
+ versionHash: "version_hash",
2059
+ requiresApproval: "requires_approval",
2060
+ });
2061
+ });
2062
+
2063
+ /**
2064
+ * @internal
2065
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2066
+ */
2067
+ export namespace Tools11$ {
2068
+ /** @deprecated use `Tools11$inboundSchema` instead. */
2069
+ export const inboundSchema = Tools11$inboundSchema;
2070
+ /** @deprecated use `Tools11$outboundSchema` instead. */
2071
+ export const outboundSchema = Tools11$outboundSchema;
2072
+ /** @deprecated use `Tools11$Outbound` instead. */
2073
+ export type Outbound = Tools11$Outbound;
2074
+ }
2075
+
2076
+ export function tools11ToJSON(tools11: Tools11): string {
2077
+ return JSON.stringify(Tools11$outboundSchema.parse(tools11));
2078
+ }
2079
+
2080
+ export function tools11FromJSON(
2081
+ jsonString: string,
2082
+ ): SafeParseResult<Tools11, SDKValidationError> {
2083
+ return safeParse(
2084
+ jsonString,
2085
+ (x) => Tools11$inboundSchema.parse(JSON.parse(x)),
2086
+ `Failed to parse 'Tools11' from JSON`,
2087
+ );
2088
+ }
2089
+
2090
+ /** @internal */
2091
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$inboundSchema:
2092
+ z.ZodNativeEnum<
2093
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings10Type
2094
+ > = z.nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodySettings10Type);
2095
+
2096
+ /** @internal */
2097
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$outboundSchema:
2098
+ z.ZodNativeEnum<
2099
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings10Type
2100
+ > = StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$inboundSchema;
2101
+
2102
+ /**
2103
+ * @internal
2104
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2105
+ */
2106
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$ {
2107
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$inboundSchema` instead. */
2108
+ export const inboundSchema =
2109
+ StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$inboundSchema;
2110
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$outboundSchema` instead. */
2111
+ export const outboundSchema =
2112
+ StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$outboundSchema;
2113
+ }
2114
+
2115
+ /** @internal */
2116
+ export const Tools10$inboundSchema: z.ZodType<Tools10, z.ZodTypeDef, unknown> =
2117
+ z.object({
2118
+ type:
2119
+ StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$inboundSchema,
2120
+ requires_approval: z.boolean().default(false),
2121
+ }).transform((v) => {
2122
+ return remap$(v, {
2123
+ "requires_approval": "requiresApproval",
2124
+ });
2125
+ });
2126
+
2127
+ /** @internal */
2128
+ export type Tools10$Outbound = {
2129
+ type: string;
2130
+ requires_approval: boolean;
2131
+ };
2132
+
2133
+ /** @internal */
2134
+ export const Tools10$outboundSchema: z.ZodType<
2135
+ Tools10$Outbound,
2136
+ z.ZodTypeDef,
2137
+ Tools10
2138
+ > = z.object({
2139
+ type:
2140
+ StreamRunAgentToolsAgentsRequestRequestBodySettings10Type$outboundSchema,
2141
+ requiresApproval: z.boolean().default(false),
2142
+ }).transform((v) => {
2143
+ return remap$(v, {
2144
+ requiresApproval: "requires_approval",
2145
+ });
2146
+ });
2147
+
2148
+ /**
2149
+ * @internal
2150
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2151
+ */
2152
+ export namespace Tools10$ {
2153
+ /** @deprecated use `Tools10$inboundSchema` instead. */
2154
+ export const inboundSchema = Tools10$inboundSchema;
2155
+ /** @deprecated use `Tools10$outboundSchema` instead. */
2156
+ export const outboundSchema = Tools10$outboundSchema;
2157
+ /** @deprecated use `Tools10$Outbound` instead. */
2158
+ export type Outbound = Tools10$Outbound;
2159
+ }
2160
+
2161
+ export function tools10ToJSON(tools10: Tools10): string {
2162
+ return JSON.stringify(Tools10$outboundSchema.parse(tools10));
2163
+ }
2164
+
2165
+ export function tools10FromJSON(
2166
+ jsonString: string,
2167
+ ): SafeParseResult<Tools10, SDKValidationError> {
2168
+ return safeParse(
2169
+ jsonString,
2170
+ (x) => Tools10$inboundSchema.parse(JSON.parse(x)),
2171
+ `Failed to parse 'Tools10' from JSON`,
2172
+ );
2173
+ }
2174
+
2175
+ /** @internal */
2176
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$inboundSchema:
2177
+ z.ZodNativeEnum<
2178
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings9Type
2179
+ > = z.nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodySettings9Type);
2180
+
2181
+ /** @internal */
2182
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$outboundSchema:
2183
+ z.ZodNativeEnum<
2184
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings9Type
2185
+ > = StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$inboundSchema;
2186
+
2187
+ /**
2188
+ * @internal
2189
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2190
+ */
2191
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$ {
2192
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$inboundSchema` instead. */
2193
+ export const inboundSchema =
2194
+ StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$inboundSchema;
2195
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$outboundSchema` instead. */
2196
+ export const outboundSchema =
2197
+ StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$outboundSchema;
2198
+ }
2199
+
2200
+ /** @internal */
2201
+ export const Tools9$inboundSchema: z.ZodType<Tools9, z.ZodTypeDef, unknown> = z
2202
+ .object({
2203
+ type:
2204
+ StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$inboundSchema,
2205
+ requires_approval: z.boolean().default(false),
2206
+ }).transform((v) => {
2207
+ return remap$(v, {
2208
+ "requires_approval": "requiresApproval",
2209
+ });
2210
+ });
2211
+
2212
+ /** @internal */
2213
+ export type Tools9$Outbound = {
2214
+ type: string;
2215
+ requires_approval: boolean;
2216
+ };
2217
+
2218
+ /** @internal */
2219
+ export const Tools9$outboundSchema: z.ZodType<
2220
+ Tools9$Outbound,
2221
+ z.ZodTypeDef,
2222
+ Tools9
2223
+ > = z.object({
2224
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings9Type$outboundSchema,
2225
+ requiresApproval: z.boolean().default(false),
2226
+ }).transform((v) => {
2227
+ return remap$(v, {
2228
+ requiresApproval: "requires_approval",
2229
+ });
2230
+ });
2231
+
2232
+ /**
2233
+ * @internal
2234
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2235
+ */
2236
+ export namespace Tools9$ {
2237
+ /** @deprecated use `Tools9$inboundSchema` instead. */
2238
+ export const inboundSchema = Tools9$inboundSchema;
2239
+ /** @deprecated use `Tools9$outboundSchema` instead. */
2240
+ export const outboundSchema = Tools9$outboundSchema;
2241
+ /** @deprecated use `Tools9$Outbound` instead. */
2242
+ export type Outbound = Tools9$Outbound;
2243
+ }
2244
+
2245
+ export function tools9ToJSON(tools9: Tools9): string {
2246
+ return JSON.stringify(Tools9$outboundSchema.parse(tools9));
2247
+ }
2248
+
2249
+ export function tools9FromJSON(
2250
+ jsonString: string,
2251
+ ): SafeParseResult<Tools9, SDKValidationError> {
2252
+ return safeParse(
2253
+ jsonString,
2254
+ (x) => Tools9$inboundSchema.parse(JSON.parse(x)),
2255
+ `Failed to parse 'Tools9' from JSON`,
2256
+ );
2257
+ }
2258
+
2259
+ /** @internal */
2260
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$inboundSchema:
2261
+ z.ZodNativeEnum<
2262
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings8Type
2263
+ > = z.nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodySettings8Type);
2264
+
2265
+ /** @internal */
2266
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$outboundSchema:
2267
+ z.ZodNativeEnum<
2268
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings8Type
2269
+ > = StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$inboundSchema;
2270
+
2271
+ /**
2272
+ * @internal
2273
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2274
+ */
2275
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$ {
2276
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$inboundSchema` instead. */
2277
+ export const inboundSchema =
2278
+ StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$inboundSchema;
2279
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$outboundSchema` instead. */
2280
+ export const outboundSchema =
2281
+ StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$outboundSchema;
2282
+ }
2283
+
2284
+ /** @internal */
2285
+ export const Tools8$inboundSchema: z.ZodType<Tools8, z.ZodTypeDef, unknown> = z
2286
+ .object({
2287
+ type:
2288
+ StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$inboundSchema,
2289
+ requires_approval: z.boolean().default(false),
2290
+ }).transform((v) => {
2291
+ return remap$(v, {
2292
+ "requires_approval": "requiresApproval",
2293
+ });
2294
+ });
2295
+
2296
+ /** @internal */
2297
+ export type Tools8$Outbound = {
2298
+ type: string;
2299
+ requires_approval: boolean;
2300
+ };
2301
+
2302
+ /** @internal */
2303
+ export const Tools8$outboundSchema: z.ZodType<
2304
+ Tools8$Outbound,
2305
+ z.ZodTypeDef,
2306
+ Tools8
2307
+ > = z.object({
2308
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings8Type$outboundSchema,
2309
+ requiresApproval: z.boolean().default(false),
2310
+ }).transform((v) => {
2311
+ return remap$(v, {
2312
+ requiresApproval: "requires_approval",
2313
+ });
2314
+ });
2315
+
2316
+ /**
2317
+ * @internal
2318
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2319
+ */
2320
+ export namespace Tools8$ {
2321
+ /** @deprecated use `Tools8$inboundSchema` instead. */
2322
+ export const inboundSchema = Tools8$inboundSchema;
2323
+ /** @deprecated use `Tools8$outboundSchema` instead. */
2324
+ export const outboundSchema = Tools8$outboundSchema;
2325
+ /** @deprecated use `Tools8$Outbound` instead. */
2326
+ export type Outbound = Tools8$Outbound;
2327
+ }
2328
+
2329
+ export function tools8ToJSON(tools8: Tools8): string {
2330
+ return JSON.stringify(Tools8$outboundSchema.parse(tools8));
2331
+ }
2332
+
2333
+ export function tools8FromJSON(
2334
+ jsonString: string,
2335
+ ): SafeParseResult<Tools8, SDKValidationError> {
2336
+ return safeParse(
2337
+ jsonString,
2338
+ (x) => Tools8$inboundSchema.parse(JSON.parse(x)),
2339
+ `Failed to parse 'Tools8' from JSON`,
2340
+ );
2341
+ }
2342
+
2343
+ /** @internal */
2344
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$inboundSchema:
2345
+ z.ZodNativeEnum<
2346
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings7Type
2347
+ > = z.nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodySettings7Type);
2348
+
2349
+ /** @internal */
2350
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$outboundSchema:
2351
+ z.ZodNativeEnum<
2352
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings7Type
2353
+ > = StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$inboundSchema;
2354
+
2355
+ /**
2356
+ * @internal
2357
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2358
+ */
2359
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$ {
2360
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$inboundSchema` instead. */
2361
+ export const inboundSchema =
2362
+ StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$inboundSchema;
2363
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$outboundSchema` instead. */
2364
+ export const outboundSchema =
2365
+ StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$outboundSchema;
2366
+ }
2367
+
2368
+ /** @internal */
2369
+ export const Tools7$inboundSchema: z.ZodType<Tools7, z.ZodTypeDef, unknown> = z
2370
+ .object({
2371
+ type:
2372
+ StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$inboundSchema,
2373
+ requires_approval: z.boolean().default(false),
2374
+ }).transform((v) => {
2375
+ return remap$(v, {
2376
+ "requires_approval": "requiresApproval",
2377
+ });
2378
+ });
2379
+
2380
+ /** @internal */
2381
+ export type Tools7$Outbound = {
2382
+ type: string;
2383
+ requires_approval: boolean;
2384
+ };
2385
+
2386
+ /** @internal */
2387
+ export const Tools7$outboundSchema: z.ZodType<
2388
+ Tools7$Outbound,
2389
+ z.ZodTypeDef,
2390
+ Tools7
2391
+ > = z.object({
2392
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings7Type$outboundSchema,
2393
+ requiresApproval: z.boolean().default(false),
2394
+ }).transform((v) => {
2395
+ return remap$(v, {
2396
+ requiresApproval: "requires_approval",
2397
+ });
2398
+ });
2399
+
2400
+ /**
2401
+ * @internal
2402
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2403
+ */
2404
+ export namespace Tools7$ {
2405
+ /** @deprecated use `Tools7$inboundSchema` instead. */
2406
+ export const inboundSchema = Tools7$inboundSchema;
2407
+ /** @deprecated use `Tools7$outboundSchema` instead. */
2408
+ export const outboundSchema = Tools7$outboundSchema;
2409
+ /** @deprecated use `Tools7$Outbound` instead. */
2410
+ export type Outbound = Tools7$Outbound;
2411
+ }
2412
+
2413
+ export function tools7ToJSON(tools7: Tools7): string {
2414
+ return JSON.stringify(Tools7$outboundSchema.parse(tools7));
2415
+ }
2416
+
2417
+ export function tools7FromJSON(
2418
+ jsonString: string,
2419
+ ): SafeParseResult<Tools7, SDKValidationError> {
2420
+ return safeParse(
2421
+ jsonString,
2422
+ (x) => Tools7$inboundSchema.parse(JSON.parse(x)),
2423
+ `Failed to parse 'Tools7' from JSON`,
2424
+ );
2425
+ }
2426
+
2427
+ /** @internal */
2428
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$inboundSchema:
2429
+ z.ZodNativeEnum<
2430
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings6Type
2431
+ > = z.nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodySettings6Type);
2432
+
2433
+ /** @internal */
2434
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$outboundSchema:
2435
+ z.ZodNativeEnum<
2436
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettings6Type
2437
+ > = StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$inboundSchema;
2438
+
2439
+ /**
2440
+ * @internal
2441
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2442
+ */
2443
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$ {
2444
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$inboundSchema` instead. */
2445
+ export const inboundSchema =
2446
+ StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$inboundSchema;
2447
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$outboundSchema` instead. */
2448
+ export const outboundSchema =
2449
+ StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$outboundSchema;
2450
+ }
2451
+
2452
+ /** @internal */
2453
+ export const Tools6$inboundSchema: z.ZodType<Tools6, z.ZodTypeDef, unknown> = z
2454
+ .object({
2455
+ type:
2456
+ StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$inboundSchema,
2457
+ requires_approval: z.boolean().default(false),
2458
+ }).transform((v) => {
2459
+ return remap$(v, {
2460
+ "requires_approval": "requiresApproval",
2461
+ });
2462
+ });
2463
+
2464
+ /** @internal */
2465
+ export type Tools6$Outbound = {
2466
+ type: string;
2467
+ requires_approval: boolean;
2468
+ };
2469
+
2470
+ /** @internal */
2471
+ export const Tools6$outboundSchema: z.ZodType<
2472
+ Tools6$Outbound,
2473
+ z.ZodTypeDef,
2474
+ Tools6
2475
+ > = z.object({
2476
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettings6Type$outboundSchema,
2477
+ requiresApproval: z.boolean().default(false),
2478
+ }).transform((v) => {
2479
+ return remap$(v, {
2480
+ requiresApproval: "requires_approval",
2481
+ });
2482
+ });
2483
+
2484
+ /**
2485
+ * @internal
2486
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2487
+ */
2488
+ export namespace Tools6$ {
2489
+ /** @deprecated use `Tools6$inboundSchema` instead. */
2490
+ export const inboundSchema = Tools6$inboundSchema;
2491
+ /** @deprecated use `Tools6$outboundSchema` instead. */
2492
+ export const outboundSchema = Tools6$outboundSchema;
2493
+ /** @deprecated use `Tools6$Outbound` instead. */
2494
+ export type Outbound = Tools6$Outbound;
2495
+ }
2496
+
2497
+ export function tools6ToJSON(tools6: Tools6): string {
2498
+ return JSON.stringify(Tools6$outboundSchema.parse(tools6));
2499
+ }
2500
+
2501
+ export function tools6FromJSON(
2502
+ jsonString: string,
2503
+ ): SafeParseResult<Tools6, SDKValidationError> {
2504
+ return safeParse(
2505
+ jsonString,
2506
+ (x) => Tools6$inboundSchema.parse(JSON.parse(x)),
2507
+ `Failed to parse 'Tools6' from JSON`,
2508
+ );
2509
+ }
2510
+
2511
+ /** @internal */
2512
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettingsType$inboundSchema:
2513
+ z.ZodNativeEnum<
2514
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettingsType
2515
+ > = z.nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodySettingsType);
2516
+
2517
+ /** @internal */
2518
+ export const StreamRunAgentToolsAgentsRequestRequestBodySettingsType$outboundSchema:
2519
+ z.ZodNativeEnum<
2520
+ typeof StreamRunAgentToolsAgentsRequestRequestBodySettingsType
2521
+ > = StreamRunAgentToolsAgentsRequestRequestBodySettingsType$inboundSchema;
2522
+
2523
+ /**
2524
+ * @internal
2525
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2526
+ */
2527
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodySettingsType$ {
2528
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettingsType$inboundSchema` instead. */
2529
+ export const inboundSchema =
2530
+ StreamRunAgentToolsAgentsRequestRequestBodySettingsType$inboundSchema;
2531
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodySettingsType$outboundSchema` instead. */
2532
+ export const outboundSchema =
2533
+ StreamRunAgentToolsAgentsRequestRequestBodySettingsType$outboundSchema;
2534
+ }
2535
+
2536
+ /** @internal */
2537
+ export const StreamRunAgentTools5$inboundSchema: z.ZodType<
2538
+ StreamRunAgentTools5,
2539
+ z.ZodTypeDef,
2540
+ unknown
2541
+ > = z.object({
2542
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettingsType$inboundSchema,
2543
+ requires_approval: z.boolean().default(false),
2544
+ }).transform((v) => {
2545
+ return remap$(v, {
2546
+ "requires_approval": "requiresApproval",
2547
+ });
2548
+ });
2549
+
2550
+ /** @internal */
2551
+ export type StreamRunAgentTools5$Outbound = {
2552
+ type: string;
2553
+ requires_approval: boolean;
2554
+ };
2555
+
2556
+ /** @internal */
2557
+ export const StreamRunAgentTools5$outboundSchema: z.ZodType<
2558
+ StreamRunAgentTools5$Outbound,
2559
+ z.ZodTypeDef,
2560
+ StreamRunAgentTools5
2561
+ > = z.object({
2562
+ type: StreamRunAgentToolsAgentsRequestRequestBodySettingsType$outboundSchema,
2563
+ requiresApproval: z.boolean().default(false),
2564
+ }).transform((v) => {
2565
+ return remap$(v, {
2566
+ requiresApproval: "requires_approval",
2567
+ });
2568
+ });
2569
+
2570
+ /**
2571
+ * @internal
2572
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2573
+ */
2574
+ export namespace StreamRunAgentTools5$ {
2575
+ /** @deprecated use `StreamRunAgentTools5$inboundSchema` instead. */
2576
+ export const inboundSchema = StreamRunAgentTools5$inboundSchema;
2577
+ /** @deprecated use `StreamRunAgentTools5$outboundSchema` instead. */
2578
+ export const outboundSchema = StreamRunAgentTools5$outboundSchema;
2579
+ /** @deprecated use `StreamRunAgentTools5$Outbound` instead. */
2580
+ export type Outbound = StreamRunAgentTools5$Outbound;
2581
+ }
2582
+
2583
+ export function streamRunAgentTools5ToJSON(
2584
+ streamRunAgentTools5: StreamRunAgentTools5,
2585
+ ): string {
2586
+ return JSON.stringify(
2587
+ StreamRunAgentTools5$outboundSchema.parse(streamRunAgentTools5),
2588
+ );
2589
+ }
2590
+
2591
+ export function streamRunAgentTools5FromJSON(
2592
+ jsonString: string,
2593
+ ): SafeParseResult<StreamRunAgentTools5, SDKValidationError> {
2594
+ return safeParse(
2595
+ jsonString,
2596
+ (x) => StreamRunAgentTools5$inboundSchema.parse(JSON.parse(x)),
2597
+ `Failed to parse 'StreamRunAgentTools5' from JSON`,
2598
+ );
2599
+ }
2600
+
2601
+ /** @internal */
2602
+ export const StreamRunAgentToolsAgentsRequestRequestBodyType$inboundSchema:
2603
+ z.ZodNativeEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodyType> = z
2604
+ .nativeEnum(StreamRunAgentToolsAgentsRequestRequestBodyType);
2605
+
2606
+ /** @internal */
2607
+ export const StreamRunAgentToolsAgentsRequestRequestBodyType$outboundSchema:
2608
+ z.ZodNativeEnum<typeof StreamRunAgentToolsAgentsRequestRequestBodyType> =
2609
+ StreamRunAgentToolsAgentsRequestRequestBodyType$inboundSchema;
2610
+
2611
+ /**
2612
+ * @internal
2613
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2614
+ */
2615
+ export namespace StreamRunAgentToolsAgentsRequestRequestBodyType$ {
2616
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodyType$inboundSchema` instead. */
2617
+ export const inboundSchema =
2618
+ StreamRunAgentToolsAgentsRequestRequestBodyType$inboundSchema;
2619
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestRequestBodyType$outboundSchema` instead. */
2620
+ export const outboundSchema =
2621
+ StreamRunAgentToolsAgentsRequestRequestBodyType$outboundSchema;
2622
+ }
2623
+
2624
+ /** @internal */
2625
+ export const StreamRunAgentTools4$inboundSchema: z.ZodType<
2626
+ StreamRunAgentTools4,
2627
+ z.ZodTypeDef,
2628
+ unknown
2629
+ > = z.object({
2630
+ type: StreamRunAgentToolsAgentsRequestRequestBodyType$inboundSchema,
2631
+ requires_approval: z.boolean().default(false),
2632
+ }).transform((v) => {
2633
+ return remap$(v, {
2634
+ "requires_approval": "requiresApproval",
2635
+ });
2636
+ });
2637
+
2638
+ /** @internal */
2639
+ export type StreamRunAgentTools4$Outbound = {
2640
+ type: string;
2641
+ requires_approval: boolean;
2642
+ };
2643
+
2644
+ /** @internal */
2645
+ export const StreamRunAgentTools4$outboundSchema: z.ZodType<
2646
+ StreamRunAgentTools4$Outbound,
2647
+ z.ZodTypeDef,
2648
+ StreamRunAgentTools4
2649
+ > = z.object({
2650
+ type: StreamRunAgentToolsAgentsRequestRequestBodyType$outboundSchema,
2651
+ requiresApproval: z.boolean().default(false),
2652
+ }).transform((v) => {
2653
+ return remap$(v, {
2654
+ requiresApproval: "requires_approval",
2655
+ });
2656
+ });
2657
+
2658
+ /**
2659
+ * @internal
2660
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2661
+ */
2662
+ export namespace StreamRunAgentTools4$ {
2663
+ /** @deprecated use `StreamRunAgentTools4$inboundSchema` instead. */
2664
+ export const inboundSchema = StreamRunAgentTools4$inboundSchema;
2665
+ /** @deprecated use `StreamRunAgentTools4$outboundSchema` instead. */
2666
+ export const outboundSchema = StreamRunAgentTools4$outboundSchema;
2667
+ /** @deprecated use `StreamRunAgentTools4$Outbound` instead. */
2668
+ export type Outbound = StreamRunAgentTools4$Outbound;
2669
+ }
2670
+
2671
+ export function streamRunAgentTools4ToJSON(
2672
+ streamRunAgentTools4: StreamRunAgentTools4,
2673
+ ): string {
2674
+ return JSON.stringify(
2675
+ StreamRunAgentTools4$outboundSchema.parse(streamRunAgentTools4),
2676
+ );
2677
+ }
2678
+
2679
+ export function streamRunAgentTools4FromJSON(
2680
+ jsonString: string,
2681
+ ): SafeParseResult<StreamRunAgentTools4, SDKValidationError> {
2682
+ return safeParse(
2683
+ jsonString,
2684
+ (x) => StreamRunAgentTools4$inboundSchema.parse(JSON.parse(x)),
2685
+ `Failed to parse 'StreamRunAgentTools4' from JSON`,
2686
+ );
2687
+ }
2688
+
2689
+ /** @internal */
2690
+ export const StreamRunAgentToolsAgentsRequestType$inboundSchema:
2691
+ z.ZodNativeEnum<typeof StreamRunAgentToolsAgentsRequestType> = z.nativeEnum(
2692
+ StreamRunAgentToolsAgentsRequestType,
2693
+ );
2694
+
2695
+ /** @internal */
2696
+ export const StreamRunAgentToolsAgentsRequestType$outboundSchema:
2697
+ z.ZodNativeEnum<typeof StreamRunAgentToolsAgentsRequestType> =
2698
+ StreamRunAgentToolsAgentsRequestType$inboundSchema;
2699
+
2700
+ /**
2701
+ * @internal
2702
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2703
+ */
2704
+ export namespace StreamRunAgentToolsAgentsRequestType$ {
2705
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestType$inboundSchema` instead. */
2706
+ export const inboundSchema =
2707
+ StreamRunAgentToolsAgentsRequestType$inboundSchema;
2708
+ /** @deprecated use `StreamRunAgentToolsAgentsRequestType$outboundSchema` instead. */
2709
+ export const outboundSchema =
2710
+ StreamRunAgentToolsAgentsRequestType$outboundSchema;
2711
+ }
2712
+
2713
+ /** @internal */
2714
+ export const StreamRunAgentTools3$inboundSchema: z.ZodType<
2715
+ StreamRunAgentTools3,
2716
+ z.ZodTypeDef,
2717
+ unknown
2718
+ > = z.object({
2719
+ type: StreamRunAgentToolsAgentsRequestType$inboundSchema,
2720
+ requires_approval: z.boolean().default(false),
2721
+ }).transform((v) => {
2722
+ return remap$(v, {
2723
+ "requires_approval": "requiresApproval",
2724
+ });
2725
+ });
2726
+
2727
+ /** @internal */
2728
+ export type StreamRunAgentTools3$Outbound = {
2729
+ type: string;
2730
+ requires_approval: boolean;
2731
+ };
2732
+
2733
+ /** @internal */
2734
+ export const StreamRunAgentTools3$outboundSchema: z.ZodType<
2735
+ StreamRunAgentTools3$Outbound,
2736
+ z.ZodTypeDef,
2737
+ StreamRunAgentTools3
2738
+ > = z.object({
2739
+ type: StreamRunAgentToolsAgentsRequestType$outboundSchema,
2740
+ requiresApproval: z.boolean().default(false),
2741
+ }).transform((v) => {
2742
+ return remap$(v, {
2743
+ requiresApproval: "requires_approval",
2744
+ });
2745
+ });
2746
+
2747
+ /**
2748
+ * @internal
2749
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2750
+ */
2751
+ export namespace StreamRunAgentTools3$ {
2752
+ /** @deprecated use `StreamRunAgentTools3$inboundSchema` instead. */
2753
+ export const inboundSchema = StreamRunAgentTools3$inboundSchema;
2754
+ /** @deprecated use `StreamRunAgentTools3$outboundSchema` instead. */
2755
+ export const outboundSchema = StreamRunAgentTools3$outboundSchema;
2756
+ /** @deprecated use `StreamRunAgentTools3$Outbound` instead. */
2757
+ export type Outbound = StreamRunAgentTools3$Outbound;
2758
+ }
2759
+
2760
+ export function streamRunAgentTools3ToJSON(
2761
+ streamRunAgentTools3: StreamRunAgentTools3,
2762
+ ): string {
2763
+ return JSON.stringify(
2764
+ StreamRunAgentTools3$outboundSchema.parse(streamRunAgentTools3),
2765
+ );
2766
+ }
2767
+
2768
+ export function streamRunAgentTools3FromJSON(
2769
+ jsonString: string,
2770
+ ): SafeParseResult<StreamRunAgentTools3, SDKValidationError> {
2771
+ return safeParse(
2772
+ jsonString,
2773
+ (x) => StreamRunAgentTools3$inboundSchema.parse(JSON.parse(x)),
2774
+ `Failed to parse 'StreamRunAgentTools3' from JSON`,
2775
+ );
2776
+ }
2777
+
2778
+ /** @internal */
2779
+ export const StreamRunAgentToolsAgentsType$inboundSchema: z.ZodNativeEnum<
2780
+ typeof StreamRunAgentToolsAgentsType
2781
+ > = z.nativeEnum(StreamRunAgentToolsAgentsType);
2782
+
2783
+ /** @internal */
2784
+ export const StreamRunAgentToolsAgentsType$outboundSchema: z.ZodNativeEnum<
2785
+ typeof StreamRunAgentToolsAgentsType
2786
+ > = StreamRunAgentToolsAgentsType$inboundSchema;
2787
+
2788
+ /**
2789
+ * @internal
2790
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2791
+ */
2792
+ export namespace StreamRunAgentToolsAgentsType$ {
2793
+ /** @deprecated use `StreamRunAgentToolsAgentsType$inboundSchema` instead. */
2794
+ export const inboundSchema = StreamRunAgentToolsAgentsType$inboundSchema;
2795
+ /** @deprecated use `StreamRunAgentToolsAgentsType$outboundSchema` instead. */
2796
+ export const outboundSchema = StreamRunAgentToolsAgentsType$outboundSchema;
2797
+ }
2798
+
2799
+ /** @internal */
2800
+ export const StreamRunAgentTools2$inboundSchema: z.ZodType<
2801
+ StreamRunAgentTools2,
2802
+ z.ZodTypeDef,
2803
+ unknown
2804
+ > = z.object({
2805
+ type: StreamRunAgentToolsAgentsType$inboundSchema,
2806
+ requires_approval: z.boolean().default(false),
2807
+ }).transform((v) => {
2808
+ return remap$(v, {
2809
+ "requires_approval": "requiresApproval",
2810
+ });
2811
+ });
2812
+
2813
+ /** @internal */
2814
+ export type StreamRunAgentTools2$Outbound = {
2815
+ type: string;
2816
+ requires_approval: boolean;
2817
+ };
2818
+
2819
+ /** @internal */
2820
+ export const StreamRunAgentTools2$outboundSchema: z.ZodType<
2821
+ StreamRunAgentTools2$Outbound,
2822
+ z.ZodTypeDef,
2823
+ StreamRunAgentTools2
2824
+ > = z.object({
2825
+ type: StreamRunAgentToolsAgentsType$outboundSchema,
2826
+ requiresApproval: z.boolean().default(false),
2827
+ }).transform((v) => {
2828
+ return remap$(v, {
2829
+ requiresApproval: "requires_approval",
2830
+ });
2831
+ });
2832
+
2833
+ /**
2834
+ * @internal
2835
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2836
+ */
2837
+ export namespace StreamRunAgentTools2$ {
2838
+ /** @deprecated use `StreamRunAgentTools2$inboundSchema` instead. */
2839
+ export const inboundSchema = StreamRunAgentTools2$inboundSchema;
2840
+ /** @deprecated use `StreamRunAgentTools2$outboundSchema` instead. */
2841
+ export const outboundSchema = StreamRunAgentTools2$outboundSchema;
2842
+ /** @deprecated use `StreamRunAgentTools2$Outbound` instead. */
2843
+ export type Outbound = StreamRunAgentTools2$Outbound;
2844
+ }
2845
+
2846
+ export function streamRunAgentTools2ToJSON(
2847
+ streamRunAgentTools2: StreamRunAgentTools2,
2848
+ ): string {
2849
+ return JSON.stringify(
2850
+ StreamRunAgentTools2$outboundSchema.parse(streamRunAgentTools2),
2851
+ );
2852
+ }
2853
+
2854
+ export function streamRunAgentTools2FromJSON(
2855
+ jsonString: string,
2856
+ ): SafeParseResult<StreamRunAgentTools2, SDKValidationError> {
2857
+ return safeParse(
2858
+ jsonString,
2859
+ (x) => StreamRunAgentTools2$inboundSchema.parse(JSON.parse(x)),
2860
+ `Failed to parse 'StreamRunAgentTools2' from JSON`,
2861
+ );
2862
+ }
2863
+
2864
+ /** @internal */
2865
+ export const StreamRunAgentToolsType$inboundSchema: z.ZodNativeEnum<
2866
+ typeof StreamRunAgentToolsType
2867
+ > = z.nativeEnum(StreamRunAgentToolsType);
2868
+
2869
+ /** @internal */
2870
+ export const StreamRunAgentToolsType$outboundSchema: z.ZodNativeEnum<
2871
+ typeof StreamRunAgentToolsType
2872
+ > = StreamRunAgentToolsType$inboundSchema;
2873
+
2874
+ /**
2875
+ * @internal
2876
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2877
+ */
2878
+ export namespace StreamRunAgentToolsType$ {
2879
+ /** @deprecated use `StreamRunAgentToolsType$inboundSchema` instead. */
2880
+ export const inboundSchema = StreamRunAgentToolsType$inboundSchema;
2881
+ /** @deprecated use `StreamRunAgentToolsType$outboundSchema` instead. */
2882
+ export const outboundSchema = StreamRunAgentToolsType$outboundSchema;
2883
+ }
2884
+
2885
+ /** @internal */
2886
+ export const StreamRunAgentTools1$inboundSchema: z.ZodType<
2887
+ StreamRunAgentTools1,
2888
+ z.ZodTypeDef,
2889
+ unknown
2890
+ > = z.object({
2891
+ type: StreamRunAgentToolsType$inboundSchema,
2892
+ requires_approval: z.boolean().default(false),
2893
+ }).transform((v) => {
2894
+ return remap$(v, {
2895
+ "requires_approval": "requiresApproval",
2896
+ });
2897
+ });
2898
+
2899
+ /** @internal */
2900
+ export type StreamRunAgentTools1$Outbound = {
2901
+ type: string;
2902
+ requires_approval: boolean;
2903
+ };
2904
+
2905
+ /** @internal */
2906
+ export const StreamRunAgentTools1$outboundSchema: z.ZodType<
2907
+ StreamRunAgentTools1$Outbound,
2908
+ z.ZodTypeDef,
2909
+ StreamRunAgentTools1
2910
+ > = z.object({
2911
+ type: StreamRunAgentToolsType$outboundSchema,
2912
+ requiresApproval: z.boolean().default(false),
2913
+ }).transform((v) => {
2914
+ return remap$(v, {
2915
+ requiresApproval: "requires_approval",
2916
+ });
2917
+ });
2918
+
2919
+ /**
2920
+ * @internal
2921
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2922
+ */
2923
+ export namespace StreamRunAgentTools1$ {
2924
+ /** @deprecated use `StreamRunAgentTools1$inboundSchema` instead. */
2925
+ export const inboundSchema = StreamRunAgentTools1$inboundSchema;
2926
+ /** @deprecated use `StreamRunAgentTools1$outboundSchema` instead. */
2927
+ export const outboundSchema = StreamRunAgentTools1$outboundSchema;
2928
+ /** @deprecated use `StreamRunAgentTools1$Outbound` instead. */
2929
+ export type Outbound = StreamRunAgentTools1$Outbound;
2930
+ }
2931
+
2932
+ export function streamRunAgentTools1ToJSON(
2933
+ streamRunAgentTools1: StreamRunAgentTools1,
2934
+ ): string {
2935
+ return JSON.stringify(
2936
+ StreamRunAgentTools1$outboundSchema.parse(streamRunAgentTools1),
2937
+ );
2938
+ }
2939
+
2940
+ export function streamRunAgentTools1FromJSON(
2941
+ jsonString: string,
2942
+ ): SafeParseResult<StreamRunAgentTools1, SDKValidationError> {
2943
+ return safeParse(
2944
+ jsonString,
2945
+ (x) => StreamRunAgentTools1$inboundSchema.parse(JSON.parse(x)),
2946
+ `Failed to parse 'StreamRunAgentTools1' from JSON`,
2947
+ );
2948
+ }
2949
+
2950
+ /** @internal */
2951
+ export const StreamRunAgentTools$inboundSchema: z.ZodType<
2952
+ StreamRunAgentTools,
2953
+ z.ZodTypeDef,
2954
+ unknown
2955
+ > = z.union([
2956
+ z.lazy(() => Tools11$inboundSchema),
2957
+ z.lazy(() => Tools12$inboundSchema),
2958
+ z.lazy(() => StreamRunAgentTools1$inboundSchema),
2959
+ z.lazy(() => StreamRunAgentTools2$inboundSchema),
2960
+ z.lazy(() => StreamRunAgentTools3$inboundSchema),
2961
+ z.lazy(() => StreamRunAgentTools4$inboundSchema),
2962
+ z.lazy(() => StreamRunAgentTools5$inboundSchema),
2963
+ z.lazy(() => Tools6$inboundSchema),
2964
+ z.lazy(() => Tools7$inboundSchema),
2965
+ z.lazy(() => Tools8$inboundSchema),
2966
+ z.lazy(() => Tools9$inboundSchema),
2967
+ z.lazy(() => Tools10$inboundSchema),
2968
+ ]);
2969
+
2970
+ /** @internal */
2971
+ export type StreamRunAgentTools$Outbound =
2972
+ | Tools11$Outbound
2973
+ | Tools12$Outbound
2974
+ | StreamRunAgentTools1$Outbound
2975
+ | StreamRunAgentTools2$Outbound
2976
+ | StreamRunAgentTools3$Outbound
2977
+ | StreamRunAgentTools4$Outbound
2978
+ | StreamRunAgentTools5$Outbound
2979
+ | Tools6$Outbound
2980
+ | Tools7$Outbound
2981
+ | Tools8$Outbound
2982
+ | Tools9$Outbound
2983
+ | Tools10$Outbound;
2984
+
2985
+ /** @internal */
2986
+ export const StreamRunAgentTools$outboundSchema: z.ZodType<
2987
+ StreamRunAgentTools$Outbound,
2988
+ z.ZodTypeDef,
2989
+ StreamRunAgentTools
2990
+ > = z.union([
2991
+ z.lazy(() => Tools11$outboundSchema),
2992
+ z.lazy(() => Tools12$outboundSchema),
2993
+ z.lazy(() => StreamRunAgentTools1$outboundSchema),
2994
+ z.lazy(() => StreamRunAgentTools2$outboundSchema),
2995
+ z.lazy(() => StreamRunAgentTools3$outboundSchema),
2996
+ z.lazy(() => StreamRunAgentTools4$outboundSchema),
2997
+ z.lazy(() => StreamRunAgentTools5$outboundSchema),
2998
+ z.lazy(() => Tools6$outboundSchema),
2999
+ z.lazy(() => Tools7$outboundSchema),
3000
+ z.lazy(() => Tools8$outboundSchema),
3001
+ z.lazy(() => Tools9$outboundSchema),
3002
+ z.lazy(() => Tools10$outboundSchema),
3003
+ ]);
3004
+
3005
+ /**
3006
+ * @internal
3007
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3008
+ */
3009
+ export namespace StreamRunAgentTools$ {
3010
+ /** @deprecated use `StreamRunAgentTools$inboundSchema` instead. */
3011
+ export const inboundSchema = StreamRunAgentTools$inboundSchema;
3012
+ /** @deprecated use `StreamRunAgentTools$outboundSchema` instead. */
3013
+ export const outboundSchema = StreamRunAgentTools$outboundSchema;
3014
+ /** @deprecated use `StreamRunAgentTools$Outbound` instead. */
3015
+ export type Outbound = StreamRunAgentTools$Outbound;
3016
+ }
3017
+
3018
+ export function streamRunAgentToolsToJSON(
3019
+ streamRunAgentTools: StreamRunAgentTools,
3020
+ ): string {
3021
+ return JSON.stringify(
3022
+ StreamRunAgentTools$outboundSchema.parse(streamRunAgentTools),
3023
+ );
3024
+ }
3025
+
3026
+ export function streamRunAgentToolsFromJSON(
3027
+ jsonString: string,
3028
+ ): SafeParseResult<StreamRunAgentTools, SDKValidationError> {
3029
+ return safeParse(
3030
+ jsonString,
3031
+ (x) => StreamRunAgentTools$inboundSchema.parse(JSON.parse(x)),
3032
+ `Failed to parse 'StreamRunAgentTools' from JSON`,
3033
+ );
3034
+ }
3035
+
3036
+ /** @internal */
3037
+ export const StreamRunAgentToolApprovalRequired$inboundSchema: z.ZodNativeEnum<
3038
+ typeof StreamRunAgentToolApprovalRequired
3039
+ > = z.nativeEnum(StreamRunAgentToolApprovalRequired);
3040
+
3041
+ /** @internal */
3042
+ export const StreamRunAgentToolApprovalRequired$outboundSchema: z.ZodNativeEnum<
3043
+ typeof StreamRunAgentToolApprovalRequired
3044
+ > = StreamRunAgentToolApprovalRequired$inboundSchema;
3045
+
3046
+ /**
3047
+ * @internal
3048
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3049
+ */
3050
+ export namespace StreamRunAgentToolApprovalRequired$ {
3051
+ /** @deprecated use `StreamRunAgentToolApprovalRequired$inboundSchema` instead. */
3052
+ export const inboundSchema = StreamRunAgentToolApprovalRequired$inboundSchema;
3053
+ /** @deprecated use `StreamRunAgentToolApprovalRequired$outboundSchema` instead. */
3054
+ export const outboundSchema =
3055
+ StreamRunAgentToolApprovalRequired$outboundSchema;
3056
+ }
3057
+
3058
+ /** @internal */
3059
+ export const StreamRunAgentSettings$inboundSchema: z.ZodType<
3060
+ StreamRunAgentSettings,
3061
+ z.ZodTypeDef,
3062
+ unknown
3063
+ > = z.object({
3064
+ tools: z.array(
3065
+ z.union([
3066
+ z.lazy(() => Tools11$inboundSchema),
3067
+ z.lazy(() => Tools12$inboundSchema),
3068
+ z.lazy(() => StreamRunAgentTools1$inboundSchema),
3069
+ z.lazy(() => StreamRunAgentTools2$inboundSchema),
3070
+ z.lazy(() => StreamRunAgentTools3$inboundSchema),
3071
+ z.lazy(() => StreamRunAgentTools4$inboundSchema),
3072
+ z.lazy(() => StreamRunAgentTools5$inboundSchema),
3073
+ z.lazy(() => Tools6$inboundSchema),
3074
+ z.lazy(() => Tools7$inboundSchema),
3075
+ z.lazy(() => Tools8$inboundSchema),
3076
+ z.lazy(() => Tools9$inboundSchema),
3077
+ z.lazy(() => Tools10$inboundSchema),
3078
+ ]),
3079
+ ),
3080
+ tool_approval_required: StreamRunAgentToolApprovalRequired$inboundSchema
3081
+ .default("none"),
3082
+ max_iterations: z.number().default(15),
3083
+ max_execution_time: z.number().default(120),
3084
+ }).transform((v) => {
3085
+ return remap$(v, {
3086
+ "tool_approval_required": "toolApprovalRequired",
3087
+ "max_iterations": "maxIterations",
3088
+ "max_execution_time": "maxExecutionTime",
3089
+ });
3090
+ });
3091
+
3092
+ /** @internal */
3093
+ export type StreamRunAgentSettings$Outbound = {
3094
+ tools: Array<
3095
+ | Tools11$Outbound
3096
+ | Tools12$Outbound
3097
+ | StreamRunAgentTools1$Outbound
3098
+ | StreamRunAgentTools2$Outbound
3099
+ | StreamRunAgentTools3$Outbound
3100
+ | StreamRunAgentTools4$Outbound
3101
+ | StreamRunAgentTools5$Outbound
3102
+ | Tools6$Outbound
3103
+ | Tools7$Outbound
3104
+ | Tools8$Outbound
3105
+ | Tools9$Outbound
3106
+ | Tools10$Outbound
3107
+ >;
3108
+ tool_approval_required: string;
3109
+ max_iterations: number;
3110
+ max_execution_time: number;
3111
+ };
3112
+
3113
+ /** @internal */
3114
+ export const StreamRunAgentSettings$outboundSchema: z.ZodType<
3115
+ StreamRunAgentSettings$Outbound,
3116
+ z.ZodTypeDef,
3117
+ StreamRunAgentSettings
3118
+ > = z.object({
3119
+ tools: z.array(
3120
+ z.union([
3121
+ z.lazy(() => Tools11$outboundSchema),
3122
+ z.lazy(() => Tools12$outboundSchema),
3123
+ z.lazy(() => StreamRunAgentTools1$outboundSchema),
3124
+ z.lazy(() => StreamRunAgentTools2$outboundSchema),
3125
+ z.lazy(() => StreamRunAgentTools3$outboundSchema),
3126
+ z.lazy(() => StreamRunAgentTools4$outboundSchema),
3127
+ z.lazy(() => StreamRunAgentTools5$outboundSchema),
3128
+ z.lazy(() => Tools6$outboundSchema),
3129
+ z.lazy(() => Tools7$outboundSchema),
3130
+ z.lazy(() => Tools8$outboundSchema),
3131
+ z.lazy(() => Tools9$outboundSchema),
3132
+ z.lazy(() => Tools10$outboundSchema),
3133
+ ]),
3134
+ ),
3135
+ toolApprovalRequired: StreamRunAgentToolApprovalRequired$outboundSchema
3136
+ .default("none"),
3137
+ maxIterations: z.number().default(15),
3138
+ maxExecutionTime: z.number().default(120),
3139
+ }).transform((v) => {
3140
+ return remap$(v, {
3141
+ toolApprovalRequired: "tool_approval_required",
3142
+ maxIterations: "max_iterations",
3143
+ maxExecutionTime: "max_execution_time",
3144
+ });
3145
+ });
3146
+
3147
+ /**
3148
+ * @internal
3149
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3150
+ */
3151
+ export namespace StreamRunAgentSettings$ {
3152
+ /** @deprecated use `StreamRunAgentSettings$inboundSchema` instead. */
3153
+ export const inboundSchema = StreamRunAgentSettings$inboundSchema;
3154
+ /** @deprecated use `StreamRunAgentSettings$outboundSchema` instead. */
3155
+ export const outboundSchema = StreamRunAgentSettings$outboundSchema;
3156
+ /** @deprecated use `StreamRunAgentSettings$Outbound` instead. */
3157
+ export type Outbound = StreamRunAgentSettings$Outbound;
3158
+ }
3159
+
3160
+ export function streamRunAgentSettingsToJSON(
3161
+ streamRunAgentSettings: StreamRunAgentSettings,
3162
+ ): string {
3163
+ return JSON.stringify(
3164
+ StreamRunAgentSettings$outboundSchema.parse(streamRunAgentSettings),
3165
+ );
3166
+ }
3167
+
3168
+ export function streamRunAgentSettingsFromJSON(
3169
+ jsonString: string,
3170
+ ): SafeParseResult<StreamRunAgentSettings, SDKValidationError> {
3171
+ return safeParse(
3172
+ jsonString,
3173
+ (x) => StreamRunAgentSettings$inboundSchema.parse(JSON.parse(x)),
3174
+ `Failed to parse 'StreamRunAgentSettings' from JSON`,
3175
+ );
3176
+ }
3177
+
3178
+ /** @internal */
3179
+ export const StreamRunAgentRequestBody$inboundSchema: z.ZodType<
3180
+ StreamRunAgentRequestBody,
3181
+ z.ZodTypeDef,
3182
+ unknown
3183
+ > = z.object({
3184
+ key: z.string(),
3185
+ taskId: z.string().optional(),
3186
+ model: z.string(),
3187
+ fallback_models: z.array(z.string()).optional(),
3188
+ role: z.string(),
3189
+ instructions: z.string(),
3190
+ message: z.lazy(() => StreamRunAgentMessage$inboundSchema),
3191
+ variables: z.record(z.any()).optional(),
3192
+ contextId: z.string().optional(),
3193
+ external_id: z.string().optional(),
3194
+ path: z.string(),
3195
+ description: z.string().optional(),
3196
+ iconUrl: z.string().optional(),
3197
+ system_prompt: z.string().optional(),
3198
+ memory_stores: z.array(z.string()).optional(),
3199
+ knowledge_bases: z.array(z.string()).optional(),
3200
+ team_of_agents: z.array(
3201
+ z.lazy(() => StreamRunAgentTeamOfAgents$inboundSchema),
3202
+ ).optional(),
3203
+ settings: z.lazy(() => StreamRunAgentSettings$inboundSchema),
3204
+ stream_timeout_seconds: z.number().optional(),
3205
+ }).transform((v) => {
3206
+ return remap$(v, {
3207
+ "fallback_models": "fallbackModels",
3208
+ "external_id": "externalId",
3209
+ "system_prompt": "systemPrompt",
3210
+ "memory_stores": "memoryStores",
3211
+ "knowledge_bases": "knowledgeBases",
3212
+ "team_of_agents": "teamOfAgents",
3213
+ "stream_timeout_seconds": "streamTimeoutSeconds",
3214
+ });
3215
+ });
3216
+
3217
+ /** @internal */
3218
+ export type StreamRunAgentRequestBody$Outbound = {
3219
+ key: string;
3220
+ taskId?: string | undefined;
3221
+ model: string;
3222
+ fallback_models?: Array<string> | undefined;
3223
+ role: string;
3224
+ instructions: string;
3225
+ message: StreamRunAgentMessage$Outbound;
3226
+ variables?: { [k: string]: any } | undefined;
3227
+ contextId?: string | undefined;
3228
+ external_id?: string | undefined;
3229
+ path: string;
3230
+ description?: string | undefined;
3231
+ iconUrl?: string | undefined;
3232
+ system_prompt?: string | undefined;
3233
+ memory_stores?: Array<string> | undefined;
3234
+ knowledge_bases?: Array<string> | undefined;
3235
+ team_of_agents?: Array<StreamRunAgentTeamOfAgents$Outbound> | undefined;
3236
+ settings: StreamRunAgentSettings$Outbound;
3237
+ stream_timeout_seconds?: number | undefined;
3238
+ };
3239
+
3240
+ /** @internal */
3241
+ export const StreamRunAgentRequestBody$outboundSchema: z.ZodType<
3242
+ StreamRunAgentRequestBody$Outbound,
3243
+ z.ZodTypeDef,
3244
+ StreamRunAgentRequestBody
3245
+ > = z.object({
3246
+ key: z.string(),
3247
+ taskId: z.string().optional(),
3248
+ model: z.string(),
3249
+ fallbackModels: z.array(z.string()).optional(),
3250
+ role: z.string(),
3251
+ instructions: z.string(),
3252
+ message: z.lazy(() => StreamRunAgentMessage$outboundSchema),
3253
+ variables: z.record(z.any()).optional(),
3254
+ contextId: z.string().optional(),
3255
+ externalId: z.string().optional(),
3256
+ path: z.string(),
3257
+ description: z.string().optional(),
3258
+ iconUrl: z.string().optional(),
3259
+ systemPrompt: z.string().optional(),
3260
+ memoryStores: z.array(z.string()).optional(),
3261
+ knowledgeBases: z.array(z.string()).optional(),
3262
+ teamOfAgents: z.array(z.lazy(() => StreamRunAgentTeamOfAgents$outboundSchema))
3263
+ .optional(),
3264
+ settings: z.lazy(() => StreamRunAgentSettings$outboundSchema),
3265
+ streamTimeoutSeconds: z.number().optional(),
3266
+ }).transform((v) => {
3267
+ return remap$(v, {
3268
+ fallbackModels: "fallback_models",
3269
+ externalId: "external_id",
3270
+ systemPrompt: "system_prompt",
3271
+ memoryStores: "memory_stores",
3272
+ knowledgeBases: "knowledge_bases",
3273
+ teamOfAgents: "team_of_agents",
3274
+ streamTimeoutSeconds: "stream_timeout_seconds",
3275
+ });
3276
+ });
3277
+
3278
+ /**
3279
+ * @internal
3280
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3281
+ */
3282
+ export namespace StreamRunAgentRequestBody$ {
3283
+ /** @deprecated use `StreamRunAgentRequestBody$inboundSchema` instead. */
3284
+ export const inboundSchema = StreamRunAgentRequestBody$inboundSchema;
3285
+ /** @deprecated use `StreamRunAgentRequestBody$outboundSchema` instead. */
3286
+ export const outboundSchema = StreamRunAgentRequestBody$outboundSchema;
3287
+ /** @deprecated use `StreamRunAgentRequestBody$Outbound` instead. */
3288
+ export type Outbound = StreamRunAgentRequestBody$Outbound;
3289
+ }
3290
+
3291
+ export function streamRunAgentRequestBodyToJSON(
3292
+ streamRunAgentRequestBody: StreamRunAgentRequestBody,
3293
+ ): string {
3294
+ return JSON.stringify(
3295
+ StreamRunAgentRequestBody$outboundSchema.parse(streamRunAgentRequestBody),
3296
+ );
3297
+ }
3298
+
3299
+ export function streamRunAgentRequestBodyFromJSON(
3300
+ jsonString: string,
3301
+ ): SafeParseResult<StreamRunAgentRequestBody, SDKValidationError> {
3302
+ return safeParse(
3303
+ jsonString,
3304
+ (x) => StreamRunAgentRequestBody$inboundSchema.parse(JSON.parse(x)),
3305
+ `Failed to parse 'StreamRunAgentRequestBody' from JSON`,
3306
+ );
3307
+ }
3308
+
3309
+ /** @internal */
3310
+ export const StreamRunAgentResponseBody$inboundSchema: z.ZodType<
3311
+ StreamRunAgentResponseBody,
3312
+ z.ZodTypeDef,
3313
+ unknown
3314
+ > = z.object({
3315
+ data: z.string(),
3316
+ });
3317
+
3318
+ /** @internal */
3319
+ export type StreamRunAgentResponseBody$Outbound = {
3320
+ data: string;
3321
+ };
3322
+
3323
+ /** @internal */
3324
+ export const StreamRunAgentResponseBody$outboundSchema: z.ZodType<
3325
+ StreamRunAgentResponseBody$Outbound,
3326
+ z.ZodTypeDef,
3327
+ StreamRunAgentResponseBody
3328
+ > = z.object({
3329
+ data: z.string(),
3330
+ });
3331
+
3332
+ /**
3333
+ * @internal
3334
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3335
+ */
3336
+ export namespace StreamRunAgentResponseBody$ {
3337
+ /** @deprecated use `StreamRunAgentResponseBody$inboundSchema` instead. */
3338
+ export const inboundSchema = StreamRunAgentResponseBody$inboundSchema;
3339
+ /** @deprecated use `StreamRunAgentResponseBody$outboundSchema` instead. */
3340
+ export const outboundSchema = StreamRunAgentResponseBody$outboundSchema;
3341
+ /** @deprecated use `StreamRunAgentResponseBody$Outbound` instead. */
3342
+ export type Outbound = StreamRunAgentResponseBody$Outbound;
3343
+ }
3344
+
3345
+ export function streamRunAgentResponseBodyToJSON(
3346
+ streamRunAgentResponseBody: StreamRunAgentResponseBody,
3347
+ ): string {
3348
+ return JSON.stringify(
3349
+ StreamRunAgentResponseBody$outboundSchema.parse(streamRunAgentResponseBody),
3350
+ );
3351
+ }
3352
+
3353
+ export function streamRunAgentResponseBodyFromJSON(
3354
+ jsonString: string,
3355
+ ): SafeParseResult<StreamRunAgentResponseBody, SDKValidationError> {
3356
+ return safeParse(
3357
+ jsonString,
3358
+ (x) => StreamRunAgentResponseBody$inboundSchema.parse(JSON.parse(x)),
3359
+ `Failed to parse 'StreamRunAgentResponseBody' from JSON`,
3360
+ );
3361
+ }