@orq-ai/node 4.1.0-rc.4 → 4.1.0-rc.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 (210) hide show
  1. package/bin/mcp-server.js +25494 -27422
  2. package/bin/mcp-server.js.map +64 -47
  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/components/actionreviewedstreamingevent.d.ts +76 -0
  10. package/models/components/actionreviewedstreamingevent.d.ts.map +1 -0
  11. package/models/components/actionreviewedstreamingevent.js +127 -0
  12. package/models/components/actionreviewedstreamingevent.js.map +1 -0
  13. package/models/components/actionreviewrequestedstreamingevent.d.ts +135 -0
  14. package/models/components/actionreviewrequestedstreamingevent.d.ts.map +1 -0
  15. package/models/components/actionreviewrequestedstreamingevent.js +180 -0
  16. package/models/components/actionreviewrequestedstreamingevent.js.map +1 -0
  17. package/models/components/agenterroredstreamingevent.d.ts +58 -0
  18. package/models/components/agenterroredstreamingevent.d.ts.map +1 -0
  19. package/models/components/agenterroredstreamingevent.js +91 -0
  20. package/models/components/agenterroredstreamingevent.js.map +1 -0
  21. package/models/components/agentexecutionstartedstreamingevent.d.ts +62 -0
  22. package/models/components/agentexecutionstartedstreamingevent.d.ts.map +1 -0
  23. package/models/components/agentexecutionstartedstreamingevent.js +103 -0
  24. package/models/components/agentexecutionstartedstreamingevent.js.map +1 -0
  25. package/models/components/agenthandedoffstreamingevent.d.ts +51 -0
  26. package/models/components/agenthandedoffstreamingevent.d.ts.map +1 -0
  27. package/models/components/agenthandedoffstreamingevent.js +96 -0
  28. package/models/components/agenthandedoffstreamingevent.js.map +1 -0
  29. package/models/components/agentinactivestreamingevent.d.ts +309 -0
  30. package/models/components/agentinactivestreamingevent.d.ts.map +1 -0
  31. package/models/components/agentinactivestreamingevent.js +385 -0
  32. package/models/components/agentinactivestreamingevent.js.map +1 -0
  33. package/models/components/agentmessagecreatedstreamingevent.d.ts +141 -0
  34. package/models/components/agentmessagecreatedstreamingevent.d.ts.map +1 -0
  35. package/models/components/agentmessagecreatedstreamingevent.js +190 -0
  36. package/models/components/agentmessagecreatedstreamingevent.js.map +1 -0
  37. package/models/components/agentstartedstreamingevent.d.ts +382 -0
  38. package/models/components/agentstartedstreamingevent.d.ts.map +1 -0
  39. package/models/components/agentstartedstreamingevent.js +441 -0
  40. package/models/components/agentstartedstreamingevent.js.map +1 -0
  41. package/models/components/agentthoughtstreamingevent.d.ts +542 -0
  42. package/models/components/agentthoughtstreamingevent.d.ts.map +1 -0
  43. package/models/components/agentthoughtstreamingevent.js +626 -0
  44. package/models/components/agentthoughtstreamingevent.js.map +1 -0
  45. package/models/components/errorstreamingevent.d.ts +51 -0
  46. package/models/components/errorstreamingevent.d.ts.map +1 -0
  47. package/models/components/errorstreamingevent.js +87 -0
  48. package/models/components/errorstreamingevent.js.map +1 -0
  49. package/models/components/executionnamedstreamingevent.d.ts +51 -0
  50. package/models/components/executionnamedstreamingevent.d.ts.map +1 -0
  51. package/models/components/executionnamedstreamingevent.js +96 -0
  52. package/models/components/executionnamedstreamingevent.js.map +1 -0
  53. package/models/components/executionreviewedstreamingevent.d.ts +45 -0
  54. package/models/components/executionreviewedstreamingevent.d.ts.map +1 -0
  55. package/models/components/executionreviewedstreamingevent.js +81 -0
  56. package/models/components/executionreviewedstreamingevent.js.map +1 -0
  57. package/models/components/executionreviewrequiredstreamingevent.d.ts +45 -0
  58. package/models/components/executionreviewrequiredstreamingevent.d.ts.map +1 -0
  59. package/models/components/executionreviewrequiredstreamingevent.js +82 -0
  60. package/models/components/executionreviewrequiredstreamingevent.js.map +1 -0
  61. package/models/components/filepart.d.ts +1 -1
  62. package/models/components/index.d.ts +17 -0
  63. package/models/components/index.d.ts.map +1 -1
  64. package/models/components/index.js +17 -0
  65. package/models/components/index.js.map +1 -1
  66. package/models/components/invokedeploymentrequest.d.ts +13 -13
  67. package/models/components/invokedeploymentrequest.d.ts.map +1 -1
  68. package/models/components/invokedeploymentrequest.js +17 -17
  69. package/models/components/invokedeploymentrequest.js.map +1 -1
  70. package/models/components/timeoutstreamingevent.d.ts +49 -0
  71. package/models/components/timeoutstreamingevent.d.ts.map +1 -0
  72. package/models/components/timeoutstreamingevent.js +85 -0
  73. package/models/components/timeoutstreamingevent.js.map +1 -0
  74. package/models/components/toolexecutionfailedstreamingevent.d.ts +144 -0
  75. package/models/components/toolexecutionfailedstreamingevent.d.ts.map +1 -0
  76. package/models/components/toolexecutionfailedstreamingevent.js +223 -0
  77. package/models/components/toolexecutionfailedstreamingevent.js.map +1 -0
  78. package/models/components/toolexecutionfinishedstreamingevent.d.ts +129 -0
  79. package/models/components/toolexecutionfinishedstreamingevent.d.ts.map +1 -0
  80. package/models/components/toolexecutionfinishedstreamingevent.js +205 -0
  81. package/models/components/toolexecutionfinishedstreamingevent.js.map +1 -0
  82. package/models/components/toolexecutionstartedstreamingevent.d.ts +139 -0
  83. package/models/components/toolexecutionstartedstreamingevent.d.ts.map +1 -0
  84. package/models/components/toolexecutionstartedstreamingevent.js +217 -0
  85. package/models/components/toolexecutionstartedstreamingevent.js.map +1 -0
  86. package/models/components/toolresultpart.d.ts +1 -1
  87. package/models/operations/createagentresponserequest.d.ts +4 -137
  88. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  89. package/models/operations/createagentresponserequest.js +9 -138
  90. package/models/operations/createagentresponserequest.js.map +1 -1
  91. package/models/operations/createbudget.js +2 -2
  92. package/models/operations/createcontact.js +2 -2
  93. package/models/operations/createdataset.js +2 -2
  94. package/models/operations/createdatasetitem.js +8 -8
  95. package/models/operations/createdatasource.js +2 -2
  96. package/models/operations/createeval.d.ts +80 -145
  97. package/models/operations/createeval.d.ts.map +1 -1
  98. package/models/operations/createeval.js +190 -266
  99. package/models/operations/createeval.js.map +1 -1
  100. package/models/operations/createtool.js +12 -12
  101. package/models/operations/fileget.js +2 -2
  102. package/models/operations/filelist.js +2 -2
  103. package/models/operations/fileupload.js +2 -2
  104. package/models/operations/getalltools.js +12 -12
  105. package/models/operations/getbudget.js +2 -2
  106. package/models/operations/getevals.d.ts +14 -79
  107. package/models/operations/getevals.d.ts.map +1 -1
  108. package/models/operations/getevals.js +49 -132
  109. package/models/operations/getevals.js.map +1 -1
  110. package/models/operations/invokeagent.d.ts +14 -147
  111. package/models/operations/invokeagent.d.ts.map +1 -1
  112. package/models/operations/invokeagent.js +19 -148
  113. package/models/operations/invokeagent.js.map +1 -1
  114. package/models/operations/listbudgets.js +2 -2
  115. package/models/operations/listcontacts.js +2 -2
  116. package/models/operations/listdatasetdatapoints.js +8 -8
  117. package/models/operations/listdatasets.js +2 -2
  118. package/models/operations/listdatasources.js +2 -2
  119. package/models/operations/listknowledgebases.d.ts +16 -16
  120. package/models/operations/listknowledgebases.d.ts.map +1 -1
  121. package/models/operations/listknowledgebases.js +27 -25
  122. package/models/operations/listknowledgebases.js.map +1 -1
  123. package/models/operations/retrievecontact.js +2 -2
  124. package/models/operations/retrievedatapoint.js +8 -8
  125. package/models/operations/retrievedataset.js +2 -2
  126. package/models/operations/retrievedatasource.js +2 -2
  127. package/models/operations/retrievetool.js +12 -12
  128. package/models/operations/runagent.d.ts +4 -137
  129. package/models/operations/runagent.d.ts.map +1 -1
  130. package/models/operations/runagent.js +17 -145
  131. package/models/operations/runagent.js.map +1 -1
  132. package/models/operations/streamagent.d.ts +241 -2491
  133. package/models/operations/streamagent.d.ts.map +1 -1
  134. package/models/operations/streamagent.js +172 -2826
  135. package/models/operations/streamagent.js.map +1 -1
  136. package/models/operations/streamrunagent.d.ts +889 -3139
  137. package/models/operations/streamrunagent.d.ts.map +1 -1
  138. package/models/operations/streamrunagent.js +175 -2825
  139. package/models/operations/streamrunagent.js.map +1 -1
  140. package/models/operations/updatebudget.js +2 -2
  141. package/models/operations/updatecontact.js +2 -2
  142. package/models/operations/updatedatapoint.js +8 -8
  143. package/models/operations/updatedataset.js +2 -2
  144. package/models/operations/updatedatasource.js +2 -2
  145. package/models/operations/updateeval.d.ts +14 -79
  146. package/models/operations/updateeval.d.ts.map +1 -1
  147. package/models/operations/updateeval.js +51 -134
  148. package/models/operations/updateeval.js.map +1 -1
  149. package/models/operations/updatetool.js +14 -14
  150. package/package.json +1 -1
  151. package/src/lib/config.ts +3 -3
  152. package/src/mcp-server/mcp-server.ts +1 -1
  153. package/src/mcp-server/server.ts +1 -1
  154. package/src/models/components/actionreviewedstreamingevent.ts +189 -0
  155. package/src/models/components/actionreviewrequestedstreamingevent.ts +326 -0
  156. package/src/models/components/agenterroredstreamingevent.ts +142 -0
  157. package/src/models/components/agentexecutionstartedstreamingevent.ts +145 -0
  158. package/src/models/components/agenthandedoffstreamingevent.ts +142 -0
  159. package/src/models/components/agentinactivestreamingevent.ts +857 -0
  160. package/src/models/components/agentmessagecreatedstreamingevent.ts +396 -0
  161. package/src/models/components/agentstartedstreamingevent.ts +909 -0
  162. package/src/models/components/agentthoughtstreamingevent.ts +1419 -0
  163. package/src/models/components/errorstreamingevent.ts +129 -0
  164. package/src/models/components/executionnamedstreamingevent.ts +142 -0
  165. package/src/models/components/executionreviewedstreamingevent.ts +122 -0
  166. package/src/models/components/executionreviewrequiredstreamingevent.ts +130 -0
  167. package/src/models/components/filepart.ts +1 -1
  168. package/src/models/components/index.ts +17 -0
  169. package/src/models/components/invokedeploymentrequest.ts +32 -27
  170. package/src/models/components/timeoutstreamingevent.ts +125 -0
  171. package/src/models/components/toolexecutionfailedstreamingevent.ts +406 -0
  172. package/src/models/components/toolexecutionfinishedstreamingevent.ts +373 -0
  173. package/src/models/components/toolexecutionstartedstreamingevent.ts +350 -0
  174. package/src/models/components/toolresultpart.ts +1 -1
  175. package/src/models/operations/createagentresponserequest.ts +20 -321
  176. package/src/models/operations/createbudget.ts +2 -2
  177. package/src/models/operations/createcontact.ts +2 -2
  178. package/src/models/operations/createdataset.ts +2 -2
  179. package/src/models/operations/createdatasetitem.ts +8 -8
  180. package/src/models/operations/createdatasource.ts +2 -2
  181. package/src/models/operations/createeval.ts +318 -615
  182. package/src/models/operations/createtool.ts +12 -12
  183. package/src/models/operations/fileget.ts +2 -2
  184. package/src/models/operations/filelist.ts +2 -2
  185. package/src/models/operations/fileupload.ts +2 -2
  186. package/src/models/operations/getalltools.ts +12 -12
  187. package/src/models/operations/getbudget.ts +2 -2
  188. package/src/models/operations/getevals.ts +52 -287
  189. package/src/models/operations/invokeagent.ts +36 -373
  190. package/src/models/operations/listbudgets.ts +2 -2
  191. package/src/models/operations/listcontacts.ts +2 -2
  192. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  193. package/src/models/operations/listdatasets.ts +2 -2
  194. package/src/models/operations/listdatasources.ts +2 -2
  195. package/src/models/operations/listknowledgebases.ts +82 -102
  196. package/src/models/operations/retrievecontact.ts +2 -2
  197. package/src/models/operations/retrievedatapoint.ts +8 -8
  198. package/src/models/operations/retrievedataset.ts +2 -2
  199. package/src/models/operations/retrievedatasource.ts +2 -2
  200. package/src/models/operations/retrievetool.ts +12 -12
  201. package/src/models/operations/runagent.ts +17 -365
  202. package/src/models/operations/streamagent.ts +794 -6985
  203. package/src/models/operations/streamrunagent.ts +3939 -9983
  204. package/src/models/operations/updatebudget.ts +2 -2
  205. package/src/models/operations/updatecontact.ts +2 -2
  206. package/src/models/operations/updatedatapoint.ts +8 -8
  207. package/src/models/operations/updatedataset.ts +2 -2
  208. package/src/models/operations/updatedatasource.ts +2 -2
  209. package/src/models/operations/updateeval.ts +52 -287
  210. package/src/models/operations/updatetool.ts +14 -14
@@ -0,0 +1,909 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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
+ import {
12
+ DataPart,
13
+ DataPart$inboundSchema,
14
+ DataPart$Outbound,
15
+ DataPart$outboundSchema,
16
+ } from "./datapart.js";
17
+ import {
18
+ FilePart,
19
+ FilePart$inboundSchema,
20
+ FilePart$Outbound,
21
+ FilePart$outboundSchema,
22
+ } from "./filepart.js";
23
+ import {
24
+ TextPart,
25
+ TextPart$inboundSchema,
26
+ TextPart$Outbound,
27
+ TextPart$outboundSchema,
28
+ } from "./textpart.js";
29
+ import {
30
+ ToolCallPart,
31
+ ToolCallPart$inboundSchema,
32
+ ToolCallPart$Outbound,
33
+ ToolCallPart$outboundSchema,
34
+ } from "./toolcallpart.js";
35
+ import {
36
+ ToolResultPart,
37
+ ToolResultPart$inboundSchema,
38
+ ToolResultPart$Outbound,
39
+ ToolResultPart$outboundSchema,
40
+ } from "./toolresultpart.js";
41
+
42
+ export const AgentStartedStreamingEventType = {
43
+ EventAgentsStarted: "event.agents.started",
44
+ } as const;
45
+ export type AgentStartedStreamingEventType = ClosedEnum<
46
+ typeof AgentStartedStreamingEventType
47
+ >;
48
+
49
+ /**
50
+ * Extended A2A message role
51
+ */
52
+ export const AgentStartedStreamingEventRole = {
53
+ User: "user",
54
+ Agent: "agent",
55
+ Tool: "tool",
56
+ System: "system",
57
+ } as const;
58
+ /**
59
+ * Extended A2A message role
60
+ */
61
+ export type AgentStartedStreamingEventRole = ClosedEnum<
62
+ typeof AgentStartedStreamingEventRole
63
+ >;
64
+
65
+ export type Parts =
66
+ | (ToolCallPart & { kind: "tool_call" })
67
+ | (TextPart & { kind: "text" })
68
+ | (DataPart & { kind: "data" })
69
+ | (FilePart & { kind: "file" })
70
+ | (ToolResultPart & { kind: "tool_result" });
71
+
72
+ export type InputMessage = {
73
+ messageId?: string | undefined;
74
+ /**
75
+ * Extended A2A message role
76
+ */
77
+ role: AgentStartedStreamingEventRole;
78
+ parts: Array<
79
+ | (ToolCallPart & { kind: "tool_call" })
80
+ | (TextPart & { kind: "text" })
81
+ | (DataPart & { kind: "data" })
82
+ | (FilePart & { kind: "file" })
83
+ | (ToolResultPart & { kind: "tool_result" })
84
+ >;
85
+ metadata?: { [k: string]: any } | undefined;
86
+ };
87
+
88
+ /**
89
+ * 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.
90
+ */
91
+ export const ToolApprovalRequired = {
92
+ All: "all",
93
+ RespectTool: "respect_tool",
94
+ None: "none",
95
+ } as const;
96
+ /**
97
+ * 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.
98
+ */
99
+ export type ToolApprovalRequired = ClosedEnum<typeof ToolApprovalRequired>;
100
+
101
+ export type AgentStartedStreamingEventConditions = {
102
+ /**
103
+ * The argument of the tool call to evaluate
104
+ */
105
+ condition: string;
106
+ /**
107
+ * The operator to use
108
+ */
109
+ operator: string;
110
+ /**
111
+ * The value to compare against
112
+ */
113
+ value: string;
114
+ };
115
+
116
+ export type Tools = {
117
+ /**
118
+ * The id of the resource
119
+ */
120
+ id: string;
121
+ /**
122
+ * Optional tool key for custom tools
123
+ */
124
+ key?: string | undefined;
125
+ actionType: string;
126
+ displayName?: string | undefined;
127
+ /**
128
+ * Optional tool description
129
+ */
130
+ description?: string | undefined;
131
+ requiresApproval?: boolean | undefined;
132
+ /**
133
+ * Nested tool ID for MCP tools (identifies specific tool within MCP server)
134
+ */
135
+ toolId?: string | undefined;
136
+ conditions?: Array<AgentStartedStreamingEventConditions> | undefined;
137
+ /**
138
+ * Tool execution timeout in seconds (default: 2 minutes, max: 10 minutes)
139
+ */
140
+ timeout?: number | undefined;
141
+ };
142
+
143
+ /**
144
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
145
+ */
146
+ export const ExecuteOn = {
147
+ Input: "input",
148
+ Output: "output",
149
+ } as const;
150
+ /**
151
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
152
+ */
153
+ export type ExecuteOn = ClosedEnum<typeof ExecuteOn>;
154
+
155
+ export type Evaluators = {
156
+ /**
157
+ * Unique key or identifier of the evaluator
158
+ */
159
+ id: string;
160
+ /**
161
+ * The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions.
162
+ */
163
+ sampleRate?: number | undefined;
164
+ /**
165
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
166
+ */
167
+ executeOn: ExecuteOn;
168
+ };
169
+
170
+ /**
171
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
172
+ */
173
+ export const AgentStartedStreamingEventExecuteOn = {
174
+ Input: "input",
175
+ Output: "output",
176
+ } as const;
177
+ /**
178
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
179
+ */
180
+ export type AgentStartedStreamingEventExecuteOn = ClosedEnum<
181
+ typeof AgentStartedStreamingEventExecuteOn
182
+ >;
183
+
184
+ export type Guardrails = {
185
+ /**
186
+ * Unique key or identifier of the evaluator
187
+ */
188
+ id: string;
189
+ /**
190
+ * The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions.
191
+ */
192
+ sampleRate?: number | undefined;
193
+ /**
194
+ * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
195
+ */
196
+ executeOn: AgentStartedStreamingEventExecuteOn;
197
+ };
198
+
199
+ export type Settings = {
200
+ /**
201
+ * Maximum iterations(llm calls) before the agent will stop executing.
202
+ */
203
+ maxIterations?: number | undefined;
204
+ /**
205
+ * Maximum time (in seconds) for the agent thinking process. This does not include the time for tool calls and sub agent calls. It will be loosely enforced, the in progress LLM calls will not be terminated and the last assistant message will be returned.
206
+ */
207
+ maxExecutionTime?: number | undefined;
208
+ /**
209
+ * 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.
210
+ */
211
+ toolApprovalRequired?: ToolApprovalRequired | undefined;
212
+ tools?: Array<Tools> | undefined;
213
+ /**
214
+ * Configuration for an evaluator applied to the agent
215
+ */
216
+ evaluators?: Array<Evaluators> | undefined;
217
+ /**
218
+ * Configuration for a guardrail applied to the agent
219
+ */
220
+ guardrails?: Array<Guardrails> | undefined;
221
+ };
222
+
223
+ export type AgentStartedStreamingEventData = {
224
+ workflowRunId: string;
225
+ integrationId?: string | undefined;
226
+ inputMessage: InputMessage;
227
+ modelId: string;
228
+ instructions: string;
229
+ systemPrompt: string;
230
+ settings?: Settings | undefined;
231
+ agentManifestId: string;
232
+ agentKey: string;
233
+ variables?: { [k: string]: any } | undefined;
234
+ toolExecutionId?: string | undefined;
235
+ isContinuation?: boolean | undefined;
236
+ stream?: boolean | undefined;
237
+ responseId?: string | undefined;
238
+ };
239
+
240
+ /**
241
+ * Emitted when the agent begins processing. Contains configuration details including the model, instructions, system prompt, and input message.
242
+ */
243
+ export type AgentStartedStreamingEvent = {
244
+ type: AgentStartedStreamingEventType;
245
+ /**
246
+ * ISO timestamp of the event
247
+ */
248
+ timestamp: string;
249
+ data: AgentStartedStreamingEventData;
250
+ };
251
+
252
+ /** @internal */
253
+ export const AgentStartedStreamingEventType$inboundSchema: z.ZodNativeEnum<
254
+ typeof AgentStartedStreamingEventType
255
+ > = z.nativeEnum(AgentStartedStreamingEventType);
256
+ /** @internal */
257
+ export const AgentStartedStreamingEventType$outboundSchema: z.ZodNativeEnum<
258
+ typeof AgentStartedStreamingEventType
259
+ > = AgentStartedStreamingEventType$inboundSchema;
260
+
261
+ /** @internal */
262
+ export const AgentStartedStreamingEventRole$inboundSchema: z.ZodNativeEnum<
263
+ typeof AgentStartedStreamingEventRole
264
+ > = z.nativeEnum(AgentStartedStreamingEventRole);
265
+ /** @internal */
266
+ export const AgentStartedStreamingEventRole$outboundSchema: z.ZodNativeEnum<
267
+ typeof AgentStartedStreamingEventRole
268
+ > = AgentStartedStreamingEventRole$inboundSchema;
269
+
270
+ /** @internal */
271
+ export const Parts$inboundSchema: z.ZodType<Parts, z.ZodTypeDef, unknown> = z
272
+ .union([
273
+ ToolCallPart$inboundSchema.and(
274
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
275
+ kind: v.kind,
276
+ })),
277
+ ),
278
+ TextPart$inboundSchema.and(
279
+ z.object({ kind: z.literal("text") }).transform((v) => ({
280
+ kind: v.kind,
281
+ })),
282
+ ),
283
+ DataPart$inboundSchema.and(
284
+ z.object({ kind: z.literal("data") }).transform((v) => ({
285
+ kind: v.kind,
286
+ })),
287
+ ),
288
+ FilePart$inboundSchema.and(
289
+ z.object({ kind: z.literal("file") }).transform((v) => ({
290
+ kind: v.kind,
291
+ })),
292
+ ),
293
+ ToolResultPart$inboundSchema.and(
294
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
295
+ kind: v.kind,
296
+ })),
297
+ ),
298
+ ]);
299
+ /** @internal */
300
+ export type Parts$Outbound =
301
+ | (ToolCallPart$Outbound & { kind: "tool_call" })
302
+ | (TextPart$Outbound & { kind: "text" })
303
+ | (DataPart$Outbound & { kind: "data" })
304
+ | (FilePart$Outbound & { kind: "file" })
305
+ | (ToolResultPart$Outbound & { kind: "tool_result" });
306
+
307
+ /** @internal */
308
+ export const Parts$outboundSchema: z.ZodType<
309
+ Parts$Outbound,
310
+ z.ZodTypeDef,
311
+ Parts
312
+ > = z.union([
313
+ ToolCallPart$outboundSchema.and(
314
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
315
+ kind: v.kind,
316
+ })),
317
+ ),
318
+ TextPart$outboundSchema.and(
319
+ z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind })),
320
+ ),
321
+ DataPart$outboundSchema.and(
322
+ z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind })),
323
+ ),
324
+ FilePart$outboundSchema.and(
325
+ z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind })),
326
+ ),
327
+ ToolResultPart$outboundSchema.and(
328
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
329
+ kind: v.kind,
330
+ })),
331
+ ),
332
+ ]);
333
+
334
+ export function partsToJSON(parts: Parts): string {
335
+ return JSON.stringify(Parts$outboundSchema.parse(parts));
336
+ }
337
+ export function partsFromJSON(
338
+ jsonString: string,
339
+ ): SafeParseResult<Parts, SDKValidationError> {
340
+ return safeParse(
341
+ jsonString,
342
+ (x) => Parts$inboundSchema.parse(JSON.parse(x)),
343
+ `Failed to parse 'Parts' from JSON`,
344
+ );
345
+ }
346
+
347
+ /** @internal */
348
+ export const InputMessage$inboundSchema: z.ZodType<
349
+ InputMessage,
350
+ z.ZodTypeDef,
351
+ unknown
352
+ > = z.object({
353
+ messageId: z.string().optional(),
354
+ role: AgentStartedStreamingEventRole$inboundSchema,
355
+ parts: z.array(
356
+ z.union([
357
+ ToolCallPart$inboundSchema.and(
358
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
359
+ kind: v.kind,
360
+ })),
361
+ ),
362
+ TextPart$inboundSchema.and(
363
+ z.object({ kind: z.literal("text") }).transform((v) => ({
364
+ kind: v.kind,
365
+ })),
366
+ ),
367
+ DataPart$inboundSchema.and(
368
+ z.object({ kind: z.literal("data") }).transform((v) => ({
369
+ kind: v.kind,
370
+ })),
371
+ ),
372
+ FilePart$inboundSchema.and(
373
+ z.object({ kind: z.literal("file") }).transform((v) => ({
374
+ kind: v.kind,
375
+ })),
376
+ ),
377
+ ToolResultPart$inboundSchema.and(
378
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
379
+ kind: v.kind,
380
+ })),
381
+ ),
382
+ ]),
383
+ ),
384
+ metadata: z.record(z.any()).optional(),
385
+ });
386
+ /** @internal */
387
+ export type InputMessage$Outbound = {
388
+ messageId?: string | undefined;
389
+ role: string;
390
+ parts: Array<
391
+ | (ToolCallPart$Outbound & { kind: "tool_call" })
392
+ | (TextPart$Outbound & { kind: "text" })
393
+ | (DataPart$Outbound & { kind: "data" })
394
+ | (FilePart$Outbound & { kind: "file" })
395
+ | (ToolResultPart$Outbound & { kind: "tool_result" })
396
+ >;
397
+ metadata?: { [k: string]: any } | undefined;
398
+ };
399
+
400
+ /** @internal */
401
+ export const InputMessage$outboundSchema: z.ZodType<
402
+ InputMessage$Outbound,
403
+ z.ZodTypeDef,
404
+ InputMessage
405
+ > = z.object({
406
+ messageId: z.string().optional(),
407
+ role: AgentStartedStreamingEventRole$outboundSchema,
408
+ parts: z.array(
409
+ z.union([
410
+ ToolCallPart$outboundSchema.and(
411
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
412
+ kind: v.kind,
413
+ })),
414
+ ),
415
+ TextPart$outboundSchema.and(
416
+ z.object({ kind: z.literal("text") }).transform((v) => ({
417
+ kind: v.kind,
418
+ })),
419
+ ),
420
+ DataPart$outboundSchema.and(
421
+ z.object({ kind: z.literal("data") }).transform((v) => ({
422
+ kind: v.kind,
423
+ })),
424
+ ),
425
+ FilePart$outboundSchema.and(
426
+ z.object({ kind: z.literal("file") }).transform((v) => ({
427
+ kind: v.kind,
428
+ })),
429
+ ),
430
+ ToolResultPart$outboundSchema.and(
431
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
432
+ kind: v.kind,
433
+ })),
434
+ ),
435
+ ]),
436
+ ),
437
+ metadata: z.record(z.any()).optional(),
438
+ });
439
+
440
+ export function inputMessageToJSON(inputMessage: InputMessage): string {
441
+ return JSON.stringify(InputMessage$outboundSchema.parse(inputMessage));
442
+ }
443
+ export function inputMessageFromJSON(
444
+ jsonString: string,
445
+ ): SafeParseResult<InputMessage, SDKValidationError> {
446
+ return safeParse(
447
+ jsonString,
448
+ (x) => InputMessage$inboundSchema.parse(JSON.parse(x)),
449
+ `Failed to parse 'InputMessage' from JSON`,
450
+ );
451
+ }
452
+
453
+ /** @internal */
454
+ export const ToolApprovalRequired$inboundSchema: z.ZodNativeEnum<
455
+ typeof ToolApprovalRequired
456
+ > = z.nativeEnum(ToolApprovalRequired);
457
+ /** @internal */
458
+ export const ToolApprovalRequired$outboundSchema: z.ZodNativeEnum<
459
+ typeof ToolApprovalRequired
460
+ > = ToolApprovalRequired$inboundSchema;
461
+
462
+ /** @internal */
463
+ export const AgentStartedStreamingEventConditions$inboundSchema: z.ZodType<
464
+ AgentStartedStreamingEventConditions,
465
+ z.ZodTypeDef,
466
+ unknown
467
+ > = z.object({
468
+ condition: z.string(),
469
+ operator: z.string(),
470
+ value: z.string(),
471
+ });
472
+ /** @internal */
473
+ export type AgentStartedStreamingEventConditions$Outbound = {
474
+ condition: string;
475
+ operator: string;
476
+ value: string;
477
+ };
478
+
479
+ /** @internal */
480
+ export const AgentStartedStreamingEventConditions$outboundSchema: z.ZodType<
481
+ AgentStartedStreamingEventConditions$Outbound,
482
+ z.ZodTypeDef,
483
+ AgentStartedStreamingEventConditions
484
+ > = z.object({
485
+ condition: z.string(),
486
+ operator: z.string(),
487
+ value: z.string(),
488
+ });
489
+
490
+ export function agentStartedStreamingEventConditionsToJSON(
491
+ agentStartedStreamingEventConditions: AgentStartedStreamingEventConditions,
492
+ ): string {
493
+ return JSON.stringify(
494
+ AgentStartedStreamingEventConditions$outboundSchema.parse(
495
+ agentStartedStreamingEventConditions,
496
+ ),
497
+ );
498
+ }
499
+ export function agentStartedStreamingEventConditionsFromJSON(
500
+ jsonString: string,
501
+ ): SafeParseResult<AgentStartedStreamingEventConditions, SDKValidationError> {
502
+ return safeParse(
503
+ jsonString,
504
+ (x) =>
505
+ AgentStartedStreamingEventConditions$inboundSchema.parse(JSON.parse(x)),
506
+ `Failed to parse 'AgentStartedStreamingEventConditions' from JSON`,
507
+ );
508
+ }
509
+
510
+ /** @internal */
511
+ export const Tools$inboundSchema: z.ZodType<Tools, z.ZodTypeDef, unknown> = z
512
+ .object({
513
+ id: z.string(),
514
+ key: z.string().optional(),
515
+ action_type: z.string(),
516
+ display_name: z.string().optional(),
517
+ description: z.string().optional(),
518
+ requires_approval: z.boolean().default(false),
519
+ tool_id: z.string().optional(),
520
+ conditions: z.array(
521
+ z.lazy(() => AgentStartedStreamingEventConditions$inboundSchema),
522
+ ).optional(),
523
+ timeout: z.number().default(120),
524
+ }).transform((v) => {
525
+ return remap$(v, {
526
+ "action_type": "actionType",
527
+ "display_name": "displayName",
528
+ "requires_approval": "requiresApproval",
529
+ "tool_id": "toolId",
530
+ });
531
+ });
532
+ /** @internal */
533
+ export type Tools$Outbound = {
534
+ id: string;
535
+ key?: string | undefined;
536
+ action_type: string;
537
+ display_name?: string | undefined;
538
+ description?: string | undefined;
539
+ requires_approval: boolean;
540
+ tool_id?: string | undefined;
541
+ conditions?: Array<AgentStartedStreamingEventConditions$Outbound> | undefined;
542
+ timeout: number;
543
+ };
544
+
545
+ /** @internal */
546
+ export const Tools$outboundSchema: z.ZodType<
547
+ Tools$Outbound,
548
+ z.ZodTypeDef,
549
+ Tools
550
+ > = z.object({
551
+ id: z.string(),
552
+ key: z.string().optional(),
553
+ actionType: z.string(),
554
+ displayName: z.string().optional(),
555
+ description: z.string().optional(),
556
+ requiresApproval: z.boolean().default(false),
557
+ toolId: z.string().optional(),
558
+ conditions: z.array(
559
+ z.lazy(() => AgentStartedStreamingEventConditions$outboundSchema),
560
+ ).optional(),
561
+ timeout: z.number().default(120),
562
+ }).transform((v) => {
563
+ return remap$(v, {
564
+ actionType: "action_type",
565
+ displayName: "display_name",
566
+ requiresApproval: "requires_approval",
567
+ toolId: "tool_id",
568
+ });
569
+ });
570
+
571
+ export function toolsToJSON(tools: Tools): string {
572
+ return JSON.stringify(Tools$outboundSchema.parse(tools));
573
+ }
574
+ export function toolsFromJSON(
575
+ jsonString: string,
576
+ ): SafeParseResult<Tools, SDKValidationError> {
577
+ return safeParse(
578
+ jsonString,
579
+ (x) => Tools$inboundSchema.parse(JSON.parse(x)),
580
+ `Failed to parse 'Tools' from JSON`,
581
+ );
582
+ }
583
+
584
+ /** @internal */
585
+ export const ExecuteOn$inboundSchema: z.ZodNativeEnum<typeof ExecuteOn> = z
586
+ .nativeEnum(ExecuteOn);
587
+ /** @internal */
588
+ export const ExecuteOn$outboundSchema: z.ZodNativeEnum<typeof ExecuteOn> =
589
+ ExecuteOn$inboundSchema;
590
+
591
+ /** @internal */
592
+ export const Evaluators$inboundSchema: z.ZodType<
593
+ Evaluators,
594
+ z.ZodTypeDef,
595
+ unknown
596
+ > = z.object({
597
+ id: z.string(),
598
+ sample_rate: z.number().default(50),
599
+ execute_on: ExecuteOn$inboundSchema,
600
+ }).transform((v) => {
601
+ return remap$(v, {
602
+ "sample_rate": "sampleRate",
603
+ "execute_on": "executeOn",
604
+ });
605
+ });
606
+ /** @internal */
607
+ export type Evaluators$Outbound = {
608
+ id: string;
609
+ sample_rate: number;
610
+ execute_on: string;
611
+ };
612
+
613
+ /** @internal */
614
+ export const Evaluators$outboundSchema: z.ZodType<
615
+ Evaluators$Outbound,
616
+ z.ZodTypeDef,
617
+ Evaluators
618
+ > = z.object({
619
+ id: z.string(),
620
+ sampleRate: z.number().default(50),
621
+ executeOn: ExecuteOn$outboundSchema,
622
+ }).transform((v) => {
623
+ return remap$(v, {
624
+ sampleRate: "sample_rate",
625
+ executeOn: "execute_on",
626
+ });
627
+ });
628
+
629
+ export function evaluatorsToJSON(evaluators: Evaluators): string {
630
+ return JSON.stringify(Evaluators$outboundSchema.parse(evaluators));
631
+ }
632
+ export function evaluatorsFromJSON(
633
+ jsonString: string,
634
+ ): SafeParseResult<Evaluators, SDKValidationError> {
635
+ return safeParse(
636
+ jsonString,
637
+ (x) => Evaluators$inboundSchema.parse(JSON.parse(x)),
638
+ `Failed to parse 'Evaluators' from JSON`,
639
+ );
640
+ }
641
+
642
+ /** @internal */
643
+ export const AgentStartedStreamingEventExecuteOn$inboundSchema: z.ZodNativeEnum<
644
+ typeof AgentStartedStreamingEventExecuteOn
645
+ > = z.nativeEnum(AgentStartedStreamingEventExecuteOn);
646
+ /** @internal */
647
+ export const AgentStartedStreamingEventExecuteOn$outboundSchema:
648
+ z.ZodNativeEnum<typeof AgentStartedStreamingEventExecuteOn> =
649
+ AgentStartedStreamingEventExecuteOn$inboundSchema;
650
+
651
+ /** @internal */
652
+ export const Guardrails$inboundSchema: z.ZodType<
653
+ Guardrails,
654
+ z.ZodTypeDef,
655
+ unknown
656
+ > = z.object({
657
+ id: z.string(),
658
+ sample_rate: z.number().default(50),
659
+ execute_on: AgentStartedStreamingEventExecuteOn$inboundSchema,
660
+ }).transform((v) => {
661
+ return remap$(v, {
662
+ "sample_rate": "sampleRate",
663
+ "execute_on": "executeOn",
664
+ });
665
+ });
666
+ /** @internal */
667
+ export type Guardrails$Outbound = {
668
+ id: string;
669
+ sample_rate: number;
670
+ execute_on: string;
671
+ };
672
+
673
+ /** @internal */
674
+ export const Guardrails$outboundSchema: z.ZodType<
675
+ Guardrails$Outbound,
676
+ z.ZodTypeDef,
677
+ Guardrails
678
+ > = z.object({
679
+ id: z.string(),
680
+ sampleRate: z.number().default(50),
681
+ executeOn: AgentStartedStreamingEventExecuteOn$outboundSchema,
682
+ }).transform((v) => {
683
+ return remap$(v, {
684
+ sampleRate: "sample_rate",
685
+ executeOn: "execute_on",
686
+ });
687
+ });
688
+
689
+ export function guardrailsToJSON(guardrails: Guardrails): string {
690
+ return JSON.stringify(Guardrails$outboundSchema.parse(guardrails));
691
+ }
692
+ export function guardrailsFromJSON(
693
+ jsonString: string,
694
+ ): SafeParseResult<Guardrails, SDKValidationError> {
695
+ return safeParse(
696
+ jsonString,
697
+ (x) => Guardrails$inboundSchema.parse(JSON.parse(x)),
698
+ `Failed to parse 'Guardrails' from JSON`,
699
+ );
700
+ }
701
+
702
+ /** @internal */
703
+ export const Settings$inboundSchema: z.ZodType<
704
+ Settings,
705
+ z.ZodTypeDef,
706
+ unknown
707
+ > = z.object({
708
+ max_iterations: z.number().int().default(100),
709
+ max_execution_time: z.number().int().default(300),
710
+ tool_approval_required: ToolApprovalRequired$inboundSchema.default(
711
+ "respect_tool",
712
+ ),
713
+ tools: z.array(z.lazy(() => Tools$inboundSchema)).optional(),
714
+ evaluators: z.array(z.lazy(() => Evaluators$inboundSchema)).optional(),
715
+ guardrails: z.array(z.lazy(() => Guardrails$inboundSchema)).optional(),
716
+ }).transform((v) => {
717
+ return remap$(v, {
718
+ "max_iterations": "maxIterations",
719
+ "max_execution_time": "maxExecutionTime",
720
+ "tool_approval_required": "toolApprovalRequired",
721
+ });
722
+ });
723
+ /** @internal */
724
+ export type Settings$Outbound = {
725
+ max_iterations: number;
726
+ max_execution_time: number;
727
+ tool_approval_required: string;
728
+ tools?: Array<Tools$Outbound> | undefined;
729
+ evaluators?: Array<Evaluators$Outbound> | undefined;
730
+ guardrails?: Array<Guardrails$Outbound> | undefined;
731
+ };
732
+
733
+ /** @internal */
734
+ export const Settings$outboundSchema: z.ZodType<
735
+ Settings$Outbound,
736
+ z.ZodTypeDef,
737
+ Settings
738
+ > = z.object({
739
+ maxIterations: z.number().int().default(100),
740
+ maxExecutionTime: z.number().int().default(300),
741
+ toolApprovalRequired: ToolApprovalRequired$outboundSchema.default(
742
+ "respect_tool",
743
+ ),
744
+ tools: z.array(z.lazy(() => Tools$outboundSchema)).optional(),
745
+ evaluators: z.array(z.lazy(() => Evaluators$outboundSchema)).optional(),
746
+ guardrails: z.array(z.lazy(() => Guardrails$outboundSchema)).optional(),
747
+ }).transform((v) => {
748
+ return remap$(v, {
749
+ maxIterations: "max_iterations",
750
+ maxExecutionTime: "max_execution_time",
751
+ toolApprovalRequired: "tool_approval_required",
752
+ });
753
+ });
754
+
755
+ export function settingsToJSON(settings: Settings): string {
756
+ return JSON.stringify(Settings$outboundSchema.parse(settings));
757
+ }
758
+ export function settingsFromJSON(
759
+ jsonString: string,
760
+ ): SafeParseResult<Settings, SDKValidationError> {
761
+ return safeParse(
762
+ jsonString,
763
+ (x) => Settings$inboundSchema.parse(JSON.parse(x)),
764
+ `Failed to parse 'Settings' from JSON`,
765
+ );
766
+ }
767
+
768
+ /** @internal */
769
+ export const AgentStartedStreamingEventData$inboundSchema: z.ZodType<
770
+ AgentStartedStreamingEventData,
771
+ z.ZodTypeDef,
772
+ unknown
773
+ > = z.object({
774
+ workflowRunId: z.string(),
775
+ integration_id: z.string().optional(),
776
+ inputMessage: z.lazy(() => InputMessage$inboundSchema),
777
+ modelId: z.string(),
778
+ instructions: z.string(),
779
+ system_prompt: z.string(),
780
+ settings: z.lazy(() => Settings$inboundSchema).optional(),
781
+ agent_manifest_id: z.string(),
782
+ agent_key: z.string(),
783
+ variables: z.record(z.any()).optional(),
784
+ tool_execution_id: z.string().optional(),
785
+ is_continuation: z.boolean().optional(),
786
+ stream: z.boolean().optional(),
787
+ responseId: z.string().optional(),
788
+ }).transform((v) => {
789
+ return remap$(v, {
790
+ "integration_id": "integrationId",
791
+ "system_prompt": "systemPrompt",
792
+ "agent_manifest_id": "agentManifestId",
793
+ "agent_key": "agentKey",
794
+ "tool_execution_id": "toolExecutionId",
795
+ "is_continuation": "isContinuation",
796
+ });
797
+ });
798
+ /** @internal */
799
+ export type AgentStartedStreamingEventData$Outbound = {
800
+ workflowRunId: string;
801
+ integration_id?: string | undefined;
802
+ inputMessage: InputMessage$Outbound;
803
+ modelId: string;
804
+ instructions: string;
805
+ system_prompt: string;
806
+ settings?: Settings$Outbound | undefined;
807
+ agent_manifest_id: string;
808
+ agent_key: string;
809
+ variables?: { [k: string]: any } | undefined;
810
+ tool_execution_id?: string | undefined;
811
+ is_continuation?: boolean | undefined;
812
+ stream?: boolean | undefined;
813
+ responseId?: string | undefined;
814
+ };
815
+
816
+ /** @internal */
817
+ export const AgentStartedStreamingEventData$outboundSchema: z.ZodType<
818
+ AgentStartedStreamingEventData$Outbound,
819
+ z.ZodTypeDef,
820
+ AgentStartedStreamingEventData
821
+ > = z.object({
822
+ workflowRunId: z.string(),
823
+ integrationId: z.string().optional(),
824
+ inputMessage: z.lazy(() => InputMessage$outboundSchema),
825
+ modelId: z.string(),
826
+ instructions: z.string(),
827
+ systemPrompt: z.string(),
828
+ settings: z.lazy(() => Settings$outboundSchema).optional(),
829
+ agentManifestId: z.string(),
830
+ agentKey: z.string(),
831
+ variables: z.record(z.any()).optional(),
832
+ toolExecutionId: z.string().optional(),
833
+ isContinuation: z.boolean().optional(),
834
+ stream: z.boolean().optional(),
835
+ responseId: z.string().optional(),
836
+ }).transform((v) => {
837
+ return remap$(v, {
838
+ integrationId: "integration_id",
839
+ systemPrompt: "system_prompt",
840
+ agentManifestId: "agent_manifest_id",
841
+ agentKey: "agent_key",
842
+ toolExecutionId: "tool_execution_id",
843
+ isContinuation: "is_continuation",
844
+ });
845
+ });
846
+
847
+ export function agentStartedStreamingEventDataToJSON(
848
+ agentStartedStreamingEventData: AgentStartedStreamingEventData,
849
+ ): string {
850
+ return JSON.stringify(
851
+ AgentStartedStreamingEventData$outboundSchema.parse(
852
+ agentStartedStreamingEventData,
853
+ ),
854
+ );
855
+ }
856
+ export function agentStartedStreamingEventDataFromJSON(
857
+ jsonString: string,
858
+ ): SafeParseResult<AgentStartedStreamingEventData, SDKValidationError> {
859
+ return safeParse(
860
+ jsonString,
861
+ (x) => AgentStartedStreamingEventData$inboundSchema.parse(JSON.parse(x)),
862
+ `Failed to parse 'AgentStartedStreamingEventData' from JSON`,
863
+ );
864
+ }
865
+
866
+ /** @internal */
867
+ export const AgentStartedStreamingEvent$inboundSchema: z.ZodType<
868
+ AgentStartedStreamingEvent,
869
+ z.ZodTypeDef,
870
+ unknown
871
+ > = z.object({
872
+ type: AgentStartedStreamingEventType$inboundSchema,
873
+ timestamp: z.string(),
874
+ data: z.lazy(() => AgentStartedStreamingEventData$inboundSchema),
875
+ });
876
+ /** @internal */
877
+ export type AgentStartedStreamingEvent$Outbound = {
878
+ type: string;
879
+ timestamp: string;
880
+ data: AgentStartedStreamingEventData$Outbound;
881
+ };
882
+
883
+ /** @internal */
884
+ export const AgentStartedStreamingEvent$outboundSchema: z.ZodType<
885
+ AgentStartedStreamingEvent$Outbound,
886
+ z.ZodTypeDef,
887
+ AgentStartedStreamingEvent
888
+ > = z.object({
889
+ type: AgentStartedStreamingEventType$outboundSchema,
890
+ timestamp: z.string(),
891
+ data: z.lazy(() => AgentStartedStreamingEventData$outboundSchema),
892
+ });
893
+
894
+ export function agentStartedStreamingEventToJSON(
895
+ agentStartedStreamingEvent: AgentStartedStreamingEvent,
896
+ ): string {
897
+ return JSON.stringify(
898
+ AgentStartedStreamingEvent$outboundSchema.parse(agentStartedStreamingEvent),
899
+ );
900
+ }
901
+ export function agentStartedStreamingEventFromJSON(
902
+ jsonString: string,
903
+ ): SafeParseResult<AgentStartedStreamingEvent, SDKValidationError> {
904
+ return safeParse(
905
+ jsonString,
906
+ (x) => AgentStartedStreamingEvent$inboundSchema.parse(JSON.parse(x)),
907
+ `Failed to parse 'AgentStartedStreamingEvent' from JSON`,
908
+ );
909
+ }