@orq-ai/node 4.1.0-rc.2 → 4.1.0-rc.4

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 (255) hide show
  1. package/bin/mcp-server.js +37427 -38283
  2. package/bin/mcp-server.js.map +72 -67
  3. package/docs/sdks/agents/README.md +10 -10
  4. package/docs/sdks/responses/README.md +5 -5
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/agentsCreate.d.ts +1 -1
  7. package/funcs/agentsCreate.d.ts.map +1 -1
  8. package/funcs/agentsCreate.js +2 -4
  9. package/funcs/agentsCreate.js.map +1 -1
  10. package/funcs/agentsResponsesCreate.d.ts +1 -1
  11. package/funcs/agentsResponsesCreate.d.ts.map +1 -1
  12. package/funcs/agentsResponsesCreate.js +4 -4
  13. package/funcs/agentsResponsesCreate.js.map +1 -1
  14. package/funcs/agentsRun.d.ts +1 -1
  15. package/funcs/agentsRun.d.ts.map +1 -1
  16. package/funcs/agentsRun.js +2 -4
  17. package/funcs/agentsRun.js.map +1 -1
  18. package/funcs/agentsStream.d.ts +1 -1
  19. package/funcs/agentsStream.d.ts.map +1 -1
  20. package/funcs/agentsStream.js +4 -4
  21. package/funcs/agentsStream.js.map +1 -1
  22. package/funcs/agentsStreamRun.d.ts +1 -1
  23. package/funcs/agentsStreamRun.d.ts.map +1 -1
  24. package/funcs/agentsStreamRun.js +2 -4
  25. package/funcs/agentsStreamRun.js.map +1 -1
  26. package/funcs/agentsUpdate.d.ts +1 -1
  27. package/funcs/agentsUpdate.d.ts.map +1 -1
  28. package/funcs/agentsUpdate.js +4 -4
  29. package/funcs/agentsUpdate.js.map +1 -1
  30. package/jsr.json +1 -1
  31. package/lib/config.d.ts +2 -2
  32. package/lib/config.js +2 -2
  33. package/mcp-server/mcp-server.js +1 -1
  34. package/mcp-server/server.js +1 -1
  35. package/mcp-server/tools/agentsCreate.d.ts +1 -1
  36. package/mcp-server/tools/agentsCreate.js +1 -1
  37. package/mcp-server/tools/agentsCreate.js.map +1 -1
  38. package/mcp-server/tools/agentsResponsesCreate.d.ts +1 -1
  39. package/mcp-server/tools/agentsResponsesCreate.d.ts.map +1 -1
  40. package/mcp-server/tools/agentsResponsesCreate.js +2 -3
  41. package/mcp-server/tools/agentsResponsesCreate.js.map +1 -1
  42. package/mcp-server/tools/agentsRun.d.ts +1 -1
  43. package/mcp-server/tools/agentsRun.js +1 -1
  44. package/mcp-server/tools/agentsRun.js.map +1 -1
  45. package/mcp-server/tools/agentsStream.d.ts +1 -1
  46. package/mcp-server/tools/agentsStream.js +2 -2
  47. package/mcp-server/tools/agentsStream.js.map +1 -1
  48. package/mcp-server/tools/agentsStreamRun.d.ts +1 -1
  49. package/mcp-server/tools/agentsStreamRun.js +1 -1
  50. package/mcp-server/tools/agentsStreamRun.js.map +1 -1
  51. package/mcp-server/tools/agentsUpdate.d.ts +1 -1
  52. package/mcp-server/tools/agentsUpdate.d.ts.map +1 -1
  53. package/mcp-server/tools/agentsUpdate.js +2 -3
  54. package/mcp-server/tools/agentsUpdate.js.map +1 -1
  55. package/models/components/datapart.d.ts +41 -0
  56. package/models/components/datapart.d.ts.map +1 -0
  57. package/models/components/datapart.js +69 -0
  58. package/models/components/datapart.js.map +1 -0
  59. package/models/components/filepart.d.ts +104 -0
  60. package/models/components/filepart.d.ts.map +1 -0
  61. package/models/components/filepart.js +134 -0
  62. package/models/components/filepart.js.map +1 -0
  63. package/models/components/index.d.ts +5 -0
  64. package/models/components/index.d.ts.map +1 -1
  65. package/models/components/index.js +5 -0
  66. package/models/components/index.js.map +1 -1
  67. package/models/components/invokedeploymentrequest.d.ts +8 -8
  68. package/models/components/invokedeploymentrequest.d.ts.map +1 -1
  69. package/models/components/invokedeploymentrequest.js +11 -12
  70. package/models/components/invokedeploymentrequest.js.map +1 -1
  71. package/models/components/textpart.d.ts +31 -0
  72. package/models/components/textpart.d.ts.map +1 -0
  73. package/models/components/textpart.js +67 -0
  74. package/models/components/textpart.js.map +1 -0
  75. package/models/components/toolcallpart.d.ts +45 -0
  76. package/models/components/toolcallpart.d.ts.map +1 -0
  77. package/models/components/toolcallpart.js +84 -0
  78. package/models/components/toolcallpart.js.map +1 -0
  79. package/models/components/toolresultpart.d.ts +39 -0
  80. package/models/components/toolresultpart.d.ts.map +1 -0
  81. package/models/components/toolresultpart.js +80 -0
  82. package/models/components/toolresultpart.js.map +1 -0
  83. package/models/operations/createagentresponserequest.d.ts +68 -44
  84. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  85. package/models/operations/createagentresponserequest.js +92 -47
  86. package/models/operations/createagentresponserequest.js.map +1 -1
  87. package/models/operations/createbudget.js +2 -2
  88. package/models/operations/createcontact.js +2 -2
  89. package/models/operations/createdataset.js +2 -2
  90. package/models/operations/createdatasetitem.js +8 -8
  91. package/models/operations/createdatasource.js +2 -2
  92. package/models/operations/createeval.js +28 -28
  93. package/models/operations/createprompt.d.ts +9 -11
  94. package/models/operations/createprompt.d.ts.map +1 -1
  95. package/models/operations/createprompt.js +9 -11
  96. package/models/operations/createprompt.js.map +1 -1
  97. package/models/operations/createtool.js +12 -12
  98. package/models/operations/deploymentinvoke.d.ts +9 -11
  99. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  100. package/models/operations/deploymentinvoke.js +9 -11
  101. package/models/operations/deploymentinvoke.js.map +1 -1
  102. package/models/operations/deployments.d.ts +9 -11
  103. package/models/operations/deployments.d.ts.map +1 -1
  104. package/models/operations/deployments.js +9 -11
  105. package/models/operations/deployments.js.map +1 -1
  106. package/models/operations/deploymentstream.d.ts +9 -11
  107. package/models/operations/deploymentstream.d.ts.map +1 -1
  108. package/models/operations/deploymentstream.js +9 -11
  109. package/models/operations/deploymentstream.js.map +1 -1
  110. package/models/operations/fileget.js +2 -2
  111. package/models/operations/filelist.js +2 -2
  112. package/models/operations/fileupload.js +2 -2
  113. package/models/operations/getallprompts.d.ts +9 -11
  114. package/models/operations/getallprompts.d.ts.map +1 -1
  115. package/models/operations/getallprompts.js +9 -11
  116. package/models/operations/getallprompts.js.map +1 -1
  117. package/models/operations/getalltools.js +12 -12
  118. package/models/operations/getbudget.js +2 -2
  119. package/models/operations/getevals.js +28 -28
  120. package/models/operations/getoneprompt.d.ts +9 -11
  121. package/models/operations/getoneprompt.d.ts.map +1 -1
  122. package/models/operations/getoneprompt.js +9 -11
  123. package/models/operations/getoneprompt.js.map +1 -1
  124. package/models/operations/getpromptversion.d.ts +9 -11
  125. package/models/operations/getpromptversion.d.ts.map +1 -1
  126. package/models/operations/getpromptversion.js +9 -11
  127. package/models/operations/getpromptversion.js.map +1 -1
  128. package/models/operations/invokeagent.d.ts +63 -283
  129. package/models/operations/invokeagent.d.ts.map +1 -1
  130. package/models/operations/invokeagent.js +73 -293
  131. package/models/operations/invokeagent.js.map +1 -1
  132. package/models/operations/listbudgets.js +2 -2
  133. package/models/operations/listcontacts.js +2 -2
  134. package/models/operations/listdatasetdatapoints.js +8 -8
  135. package/models/operations/listdatasets.js +2 -2
  136. package/models/operations/listdatasources.js +2 -2
  137. package/models/operations/listpromptversions.d.ts +9 -11
  138. package/models/operations/listpromptversions.d.ts.map +1 -1
  139. package/models/operations/listpromptversions.js +9 -11
  140. package/models/operations/listpromptversions.js.map +1 -1
  141. package/models/operations/retrievecontact.js +2 -2
  142. package/models/operations/retrievedatapoint.js +8 -8
  143. package/models/operations/retrievedataset.js +2 -2
  144. package/models/operations/retrievedatasource.js +2 -2
  145. package/models/operations/retrievetool.js +12 -12
  146. package/models/operations/runagent.d.ts +59 -279
  147. package/models/operations/runagent.d.ts.map +1 -1
  148. package/models/operations/runagent.js +72 -292
  149. package/models/operations/runagent.js.map +1 -1
  150. package/models/operations/streamagent.d.ts +214 -1005
  151. package/models/operations/streamagent.d.ts.map +1 -1
  152. package/models/operations/streamagent.js +229 -1019
  153. package/models/operations/streamagent.js.map +1 -1
  154. package/models/operations/streamrunagent.d.ts +215 -1006
  155. package/models/operations/streamrunagent.d.ts.map +1 -1
  156. package/models/operations/streamrunagent.js +236 -1026
  157. package/models/operations/streamrunagent.js.map +1 -1
  158. package/models/operations/updateagent.d.ts +2 -2
  159. package/models/operations/updateagent.d.ts.map +1 -1
  160. package/models/operations/updateagent.js +2 -4
  161. package/models/operations/updateagent.js.map +1 -1
  162. package/models/operations/updatebudget.js +2 -2
  163. package/models/operations/updatecontact.js +2 -2
  164. package/models/operations/updatedatapoint.js +8 -8
  165. package/models/operations/updatedataset.js +2 -2
  166. package/models/operations/updatedatasource.js +2 -2
  167. package/models/operations/updateeval.js +28 -28
  168. package/models/operations/updatememorystore.d.ts +9 -20
  169. package/models/operations/updatememorystore.d.ts.map +1 -1
  170. package/models/operations/updatememorystore.js +9 -14
  171. package/models/operations/updatememorystore.js.map +1 -1
  172. package/models/operations/updateprompt.d.ts +18 -22
  173. package/models/operations/updateprompt.d.ts.map +1 -1
  174. package/models/operations/updateprompt.js +18 -22
  175. package/models/operations/updateprompt.js.map +1 -1
  176. package/models/operations/updatetool.js +14 -14
  177. package/package.json +1 -1
  178. package/sdk/agents.d.ts +5 -5
  179. package/sdk/agents.d.ts.map +1 -1
  180. package/sdk/agents.js +4 -4
  181. package/sdk/agents.js.map +1 -1
  182. package/sdk/responses.d.ts +1 -1
  183. package/sdk/responses.d.ts.map +1 -1
  184. package/sdk/responses.js +2 -2
  185. package/sdk/responses.js.map +1 -1
  186. package/src/funcs/agentsCreate.ts +4 -8
  187. package/src/funcs/agentsResponsesCreate.ts +4 -4
  188. package/src/funcs/agentsRun.ts +4 -7
  189. package/src/funcs/agentsStream.ts +4 -4
  190. package/src/funcs/agentsStreamRun.ts +4 -9
  191. package/src/funcs/agentsUpdate.ts +4 -4
  192. package/src/lib/config.ts +2 -2
  193. package/src/mcp-server/mcp-server.ts +1 -1
  194. package/src/mcp-server/server.ts +1 -1
  195. package/src/mcp-server/tools/agentsCreate.ts +1 -1
  196. package/src/mcp-server/tools/agentsResponsesCreate.ts +2 -3
  197. package/src/mcp-server/tools/agentsRun.ts +1 -1
  198. package/src/mcp-server/tools/agentsStream.ts +2 -2
  199. package/src/mcp-server/tools/agentsStreamRun.ts +1 -1
  200. package/src/mcp-server/tools/agentsUpdate.ts +2 -3
  201. package/src/models/components/datapart.ts +71 -0
  202. package/src/models/components/filepart.ts +231 -0
  203. package/src/models/components/index.ts +5 -0
  204. package/src/models/components/invokedeploymentrequest.ts +34 -25
  205. package/src/models/components/textpart.ts +68 -0
  206. package/src/models/components/toolcallpart.ts +92 -0
  207. package/src/models/components/toolresultpart.ts +86 -0
  208. package/src/models/operations/createagentresponserequest.ts +194 -100
  209. package/src/models/operations/createbudget.ts +2 -2
  210. package/src/models/operations/createcontact.ts +2 -2
  211. package/src/models/operations/createdataset.ts +2 -2
  212. package/src/models/operations/createdatasetitem.ts +8 -8
  213. package/src/models/operations/createdatasource.ts +2 -2
  214. package/src/models/operations/createeval.ts +28 -28
  215. package/src/models/operations/createprompt.ts +9 -11
  216. package/src/models/operations/createtool.ts +12 -12
  217. package/src/models/operations/deploymentinvoke.ts +9 -11
  218. package/src/models/operations/deployments.ts +9 -11
  219. package/src/models/operations/deploymentstream.ts +9 -11
  220. package/src/models/operations/fileget.ts +2 -2
  221. package/src/models/operations/filelist.ts +2 -2
  222. package/src/models/operations/fileupload.ts +2 -2
  223. package/src/models/operations/getallprompts.ts +9 -11
  224. package/src/models/operations/getalltools.ts +12 -12
  225. package/src/models/operations/getbudget.ts +2 -2
  226. package/src/models/operations/getevals.ts +28 -28
  227. package/src/models/operations/getoneprompt.ts +9 -11
  228. package/src/models/operations/getpromptversion.ts +9 -11
  229. package/src/models/operations/invokeagent.ts +158 -682
  230. package/src/models/operations/listbudgets.ts +2 -2
  231. package/src/models/operations/listcontacts.ts +2 -2
  232. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  233. package/src/models/operations/listdatasets.ts +2 -2
  234. package/src/models/operations/listdatasources.ts +2 -2
  235. package/src/models/operations/listpromptversions.ts +9 -11
  236. package/src/models/operations/retrievecontact.ts +2 -2
  237. package/src/models/operations/retrievedatapoint.ts +8 -8
  238. package/src/models/operations/retrievedataset.ts +2 -2
  239. package/src/models/operations/retrievedatasource.ts +2 -2
  240. package/src/models/operations/retrievetool.ts +12 -12
  241. package/src/models/operations/runagent.ts +143 -697
  242. package/src/models/operations/streamagent.ts +2226 -4563
  243. package/src/models/operations/streamrunagent.ts +2189 -4615
  244. package/src/models/operations/updateagent.ts +4 -6
  245. package/src/models/operations/updatebudget.ts +2 -2
  246. package/src/models/operations/updatecontact.ts +2 -2
  247. package/src/models/operations/updatedatapoint.ts +8 -8
  248. package/src/models/operations/updatedataset.ts +2 -2
  249. package/src/models/operations/updatedatasource.ts +2 -2
  250. package/src/models/operations/updateeval.ts +28 -28
  251. package/src/models/operations/updatememorystore.ts +9 -20
  252. package/src/models/operations/updateprompt.ts +18 -22
  253. package/src/models/operations/updatetool.ts +14 -14
  254. package/src/sdk/agents.ts +7 -7
  255. package/src/sdk/responses.ts +2 -2
@@ -10,6 +10,7 @@ import {
10
10
  } from "../../lib/schemas.js";
11
11
  import { ClosedEnum } from "../../types/enums.js";
12
12
  import { Result as SafeParseResult } from "../../types/fp.js";
13
+ import * as components from "../components/index.js";
13
14
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
15
 
15
16
  /**
@@ -773,28 +774,28 @@ export type RunAgentRoleUserMessage = ClosedEnum<
773
774
  */
774
775
  export type RunAgentRole = RunAgentRoleUserMessage | RunAgentRoleToolMessage;
775
776
 
776
- export const RunAgentPublicMessagePartAgentsRequestKind = {
777
+ export const RunAgentPublicMessagePartAgentsKind = {
777
778
  ToolResult: "tool_result",
778
779
  } as const;
779
- export type RunAgentPublicMessagePartAgentsRequestKind = ClosedEnum<
780
- typeof RunAgentPublicMessagePartAgentsRequestKind
780
+ export type RunAgentPublicMessagePartAgentsKind = ClosedEnum<
781
+ typeof RunAgentPublicMessagePartAgentsKind
781
782
  >;
782
783
 
783
784
  /**
784
785
  * Tool execution result part. Use this ONLY when providing results for a pending tool call from the agent. The tool_call_id must match the ID from the agent's tool call request.
785
786
  */
786
787
  export type RunAgentPublicMessagePartToolResultPart = {
787
- kind: RunAgentPublicMessagePartAgentsRequestKind;
788
+ kind: RunAgentPublicMessagePartAgentsKind;
788
789
  toolCallId: string;
789
790
  result?: any | undefined;
790
791
  metadata?: { [k: string]: any } | undefined;
791
792
  };
792
793
 
793
- export const RunAgentPublicMessagePartAgentsKind = {
794
+ export const RunAgentPublicMessagePartKind = {
794
795
  File: "file",
795
796
  } as const;
796
- export type RunAgentPublicMessagePartAgentsKind = ClosedEnum<
797
- typeof RunAgentPublicMessagePartAgentsKind
797
+ export type RunAgentPublicMessagePartKind = ClosedEnum<
798
+ typeof RunAgentPublicMessagePartKind
798
799
  >;
799
800
 
800
801
  /**
@@ -841,31 +842,16 @@ export type RunAgentPublicMessagePartFile =
841
842
  * File attachment part. Use this to send files (images, documents, etc.) to the agent for processing.
842
843
  */
843
844
  export type RunAgentPublicMessagePartFilePart = {
844
- kind: RunAgentPublicMessagePartAgentsKind;
845
+ kind: RunAgentPublicMessagePartKind;
845
846
  file: RunAgentFileBinaryFormat | RunAgentFileFileInURIFormat;
846
847
  metadata?: { [k: string]: any } | undefined;
847
848
  };
848
849
 
849
- export const RunAgentPublicMessagePartKind = {
850
- Text: "text",
851
- } as const;
852
- export type RunAgentPublicMessagePartKind = ClosedEnum<
853
- typeof RunAgentPublicMessagePartKind
854
- >;
855
-
856
- /**
857
- * Text content part. Use this to send text messages to the agent.
858
- */
859
- export type RunAgentPublicMessagePartTextPart = {
860
- kind: RunAgentPublicMessagePartKind;
861
- text: string;
862
- };
863
-
864
850
  /**
865
851
  * Message part that can be provided by users. Use "text" for regular messages, "file" for attachments, or "tool_result" when responding to tool call requests.
866
852
  */
867
853
  export type RunAgentPublicMessagePart =
868
- | RunAgentPublicMessagePartTextPart
854
+ | components.TextPart
869
855
  | RunAgentPublicMessagePartFilePart
870
856
  | RunAgentPublicMessagePartToolResultPart;
871
857
 
@@ -885,7 +871,7 @@ export type RunAgentA2AMessage = {
885
871
  * A2A message parts (text, file, or tool_result only)
886
872
  */
887
873
  parts: Array<
888
- | RunAgentPublicMessagePartTextPart
874
+ | components.TextPart
889
875
  | RunAgentPublicMessagePartFilePart
890
876
  | RunAgentPublicMessagePartToolResultPart
891
877
  >;
@@ -1809,132 +1795,12 @@ export type RunAgentExtendedMessageRole = ClosedEnum<
1809
1795
  typeof RunAgentExtendedMessageRole
1810
1796
  >;
1811
1797
 
1812
- export const RunAgentPartsAgentsResponse200ApplicationJSONKind = {
1813
- ToolResult: "tool_result",
1814
- } as const;
1815
- export type RunAgentPartsAgentsResponse200ApplicationJSONKind = ClosedEnum<
1816
- typeof RunAgentPartsAgentsResponse200ApplicationJSONKind
1817
- >;
1818
-
1819
- /**
1820
- * The result of a tool execution. Contains the tool call ID for correlation and the result data from the tool invocation.
1821
- */
1822
- export type RunAgentPartsToolResultPart = {
1823
- kind: RunAgentPartsAgentsResponse200ApplicationJSONKind;
1824
- toolCallId: string;
1825
- result?: any | undefined;
1826
- metadata?: { [k: string]: any } | undefined;
1827
- };
1828
-
1829
- export const RunAgentPartsAgentsResponse200Kind = {
1830
- ToolCall: "tool_call",
1831
- } as const;
1832
- export type RunAgentPartsAgentsResponse200Kind = ClosedEnum<
1833
- typeof RunAgentPartsAgentsResponse200Kind
1834
- >;
1835
-
1836
- /**
1837
- * A tool invocation request from an agent. Contains the tool name, unique call ID, and arguments for the tool execution.
1838
- */
1839
- export type PartsToolCallPart = {
1840
- kind: RunAgentPartsAgentsResponse200Kind;
1841
- toolName: string;
1842
- toolCallId: string;
1843
- arguments: { [k: string]: any };
1844
- metadata?: { [k: string]: any } | undefined;
1845
- };
1846
-
1847
- export const RunAgentPartsAgentsResponseKind = {
1848
- File: "file",
1849
- } as const;
1850
- export type RunAgentPartsAgentsResponseKind = ClosedEnum<
1851
- typeof RunAgentPartsAgentsResponseKind
1852
- >;
1853
-
1854
- /**
1855
- * File in URI format. Check in the model's documentation for the supported mime types for the URI format
1856
- */
1857
- export type RunAgentFileAgentsFileInURIFormat = {
1858
- /**
1859
- * URL for the File content
1860
- */
1861
- uri: string;
1862
- /**
1863
- * Optional mimeType for the file
1864
- */
1865
- mimeType?: string | undefined;
1866
- /**
1867
- * Optional name for the file
1868
- */
1869
- name?: string | undefined;
1870
- };
1871
-
1872
- /**
1873
- * Binary in base64 format. Check in the model's documentation for the supported mime types for the binary format.
1874
- */
1875
- export type RunAgentFileAgentsBinaryFormat = {
1876
- /**
1877
- * base64 encoded content of the file
1878
- */
1879
- bytes: string;
1880
- /**
1881
- * Optional mimeType for the file
1882
- */
1883
- mimeType?: string | undefined;
1884
- /**
1885
- * Optional name for the file
1886
- */
1887
- name?: string | undefined;
1888
- };
1889
-
1890
- export type RunAgentPartsFile =
1891
- | RunAgentFileAgentsBinaryFormat
1892
- | RunAgentFileAgentsFileInURIFormat;
1893
-
1894
- /**
1895
- * A file content part that can contain either base64-encoded bytes or a URI reference. Used for images, documents, and other binary content in agent communications.
1896
- */
1897
- export type RunAgentPartsFilePart = {
1898
- kind: RunAgentPartsAgentsResponseKind;
1899
- file: RunAgentFileAgentsBinaryFormat | RunAgentFileAgentsFileInURIFormat;
1900
- metadata?: { [k: string]: any } | undefined;
1901
- };
1902
-
1903
- export const RunAgentPartsAgentsKind = {
1904
- Data: "data",
1905
- } as const;
1906
- export type RunAgentPartsAgentsKind = ClosedEnum<
1907
- typeof RunAgentPartsAgentsKind
1908
- >;
1909
-
1910
- /**
1911
- * A structured data part containing JSON-serializable key-value pairs. Used for passing structured information between agents and tools.
1912
- */
1913
- export type PartsDataPart = {
1914
- kind: RunAgentPartsAgentsKind;
1915
- data: { [k: string]: any };
1916
- metadata?: { [k: string]: any } | undefined;
1917
- };
1918
-
1919
- export const RunAgentPartsKind = {
1920
- Text: "text",
1921
- } as const;
1922
- export type RunAgentPartsKind = ClosedEnum<typeof RunAgentPartsKind>;
1923
-
1924
- /**
1925
- * A text content part containing plain text or markdown. Used for agent messages, user input, and text-based responses.
1926
- */
1927
- export type RunAgentPartsTextPart = {
1928
- kind: RunAgentPartsKind;
1929
- text: string;
1930
- };
1931
-
1932
1798
  export type RunAgentParts =
1933
- | PartsToolCallPart
1934
- | RunAgentPartsTextPart
1935
- | PartsDataPart
1936
- | RunAgentPartsFilePart
1937
- | RunAgentPartsToolResultPart;
1799
+ | (components.ToolCallPart & { kind: "tool_call" })
1800
+ | (components.TextPart & { kind: "text" })
1801
+ | (components.DataPart & { kind: "data" })
1802
+ | (components.FilePart & { kind: "file" })
1803
+ | (components.ToolResultPart & { kind: "tool_result" });
1938
1804
 
1939
1805
  /**
1940
1806
  * Optional A2A message providing additional context about the current status
@@ -1947,11 +1813,11 @@ export type RunAgentTaskStatusMessage = {
1947
1813
  */
1948
1814
  role: RunAgentExtendedMessageRole;
1949
1815
  parts: Array<
1950
- | PartsToolCallPart
1951
- | RunAgentPartsTextPart
1952
- | PartsDataPart
1953
- | RunAgentPartsFilePart
1954
- | RunAgentPartsToolResultPart
1816
+ | (components.ToolCallPart & { kind: "tool_call" })
1817
+ | (components.TextPart & { kind: "text" })
1818
+ | (components.DataPart & { kind: "data" })
1819
+ | (components.FilePart & { kind: "file" })
1820
+ | (components.ToolResultPart & { kind: "tool_result" })
1955
1821
  >;
1956
1822
  };
1957
1823
 
@@ -4009,13 +3875,13 @@ export function runAgentRoleFromJSON(
4009
3875
  }
4010
3876
 
4011
3877
  /** @internal */
4012
- export const RunAgentPublicMessagePartAgentsRequestKind$inboundSchema:
4013
- z.ZodNativeEnum<typeof RunAgentPublicMessagePartAgentsRequestKind> = z
4014
- .nativeEnum(RunAgentPublicMessagePartAgentsRequestKind);
3878
+ export const RunAgentPublicMessagePartAgentsKind$inboundSchema: z.ZodNativeEnum<
3879
+ typeof RunAgentPublicMessagePartAgentsKind
3880
+ > = z.nativeEnum(RunAgentPublicMessagePartAgentsKind);
4015
3881
  /** @internal */
4016
- export const RunAgentPublicMessagePartAgentsRequestKind$outboundSchema:
4017
- z.ZodNativeEnum<typeof RunAgentPublicMessagePartAgentsRequestKind> =
4018
- RunAgentPublicMessagePartAgentsRequestKind$inboundSchema;
3882
+ export const RunAgentPublicMessagePartAgentsKind$outboundSchema:
3883
+ z.ZodNativeEnum<typeof RunAgentPublicMessagePartAgentsKind> =
3884
+ RunAgentPublicMessagePartAgentsKind$inboundSchema;
4019
3885
 
4020
3886
  /** @internal */
4021
3887
  export const RunAgentPublicMessagePartToolResultPart$inboundSchema: z.ZodType<
@@ -4023,7 +3889,7 @@ export const RunAgentPublicMessagePartToolResultPart$inboundSchema: z.ZodType<
4023
3889
  z.ZodTypeDef,
4024
3890
  unknown
4025
3891
  > = z.object({
4026
- kind: RunAgentPublicMessagePartAgentsRequestKind$inboundSchema,
3892
+ kind: RunAgentPublicMessagePartAgentsKind$inboundSchema,
4027
3893
  tool_call_id: z.string(),
4028
3894
  result: z.any().optional(),
4029
3895
  metadata: z.record(z.any()).optional(),
@@ -4046,7 +3912,7 @@ export const RunAgentPublicMessagePartToolResultPart$outboundSchema: z.ZodType<
4046
3912
  z.ZodTypeDef,
4047
3913
  RunAgentPublicMessagePartToolResultPart
4048
3914
  > = z.object({
4049
- kind: RunAgentPublicMessagePartAgentsRequestKind$outboundSchema,
3915
+ kind: RunAgentPublicMessagePartAgentsKind$outboundSchema,
4050
3916
  toolCallId: z.string(),
4051
3917
  result: z.any().optional(),
4052
3918
  metadata: z.record(z.any()).optional(),
@@ -4083,13 +3949,13 @@ export function runAgentPublicMessagePartToolResultPartFromJSON(
4083
3949
  }
4084
3950
 
4085
3951
  /** @internal */
4086
- export const RunAgentPublicMessagePartAgentsKind$inboundSchema: z.ZodNativeEnum<
4087
- typeof RunAgentPublicMessagePartAgentsKind
4088
- > = z.nativeEnum(RunAgentPublicMessagePartAgentsKind);
3952
+ export const RunAgentPublicMessagePartKind$inboundSchema: z.ZodNativeEnum<
3953
+ typeof RunAgentPublicMessagePartKind
3954
+ > = z.nativeEnum(RunAgentPublicMessagePartKind);
4089
3955
  /** @internal */
4090
- export const RunAgentPublicMessagePartAgentsKind$outboundSchema:
4091
- z.ZodNativeEnum<typeof RunAgentPublicMessagePartAgentsKind> =
4092
- RunAgentPublicMessagePartAgentsKind$inboundSchema;
3956
+ export const RunAgentPublicMessagePartKind$outboundSchema: z.ZodNativeEnum<
3957
+ typeof RunAgentPublicMessagePartKind
3958
+ > = RunAgentPublicMessagePartKind$inboundSchema;
4093
3959
 
4094
3960
  /** @internal */
4095
3961
  export const RunAgentFileFileInURIFormat$inboundSchema: z.ZodType<
@@ -4232,7 +4098,7 @@ export const RunAgentPublicMessagePartFilePart$inboundSchema: z.ZodType<
4232
4098
  z.ZodTypeDef,
4233
4099
  unknown
4234
4100
  > = z.object({
4235
- kind: RunAgentPublicMessagePartAgentsKind$inboundSchema,
4101
+ kind: RunAgentPublicMessagePartKind$inboundSchema,
4236
4102
  file: z.union([
4237
4103
  z.lazy(() => RunAgentFileBinaryFormat$inboundSchema),
4238
4104
  z.lazy(() => RunAgentFileFileInURIFormat$inboundSchema),
@@ -4254,7 +4120,7 @@ export const RunAgentPublicMessagePartFilePart$outboundSchema: z.ZodType<
4254
4120
  z.ZodTypeDef,
4255
4121
  RunAgentPublicMessagePartFilePart
4256
4122
  > = z.object({
4257
- kind: RunAgentPublicMessagePartAgentsKind$outboundSchema,
4123
+ kind: RunAgentPublicMessagePartKind$outboundSchema,
4258
4124
  file: z.union([
4259
4125
  z.lazy(() => RunAgentFileBinaryFormat$outboundSchema),
4260
4126
  z.lazy(() => RunAgentFileFileInURIFormat$outboundSchema),
@@ -4281,72 +4147,19 @@ export function runAgentPublicMessagePartFilePartFromJSON(
4281
4147
  );
4282
4148
  }
4283
4149
 
4284
- /** @internal */
4285
- export const RunAgentPublicMessagePartKind$inboundSchema: z.ZodNativeEnum<
4286
- typeof RunAgentPublicMessagePartKind
4287
- > = z.nativeEnum(RunAgentPublicMessagePartKind);
4288
- /** @internal */
4289
- export const RunAgentPublicMessagePartKind$outboundSchema: z.ZodNativeEnum<
4290
- typeof RunAgentPublicMessagePartKind
4291
- > = RunAgentPublicMessagePartKind$inboundSchema;
4292
-
4293
- /** @internal */
4294
- export const RunAgentPublicMessagePartTextPart$inboundSchema: z.ZodType<
4295
- RunAgentPublicMessagePartTextPart,
4296
- z.ZodTypeDef,
4297
- unknown
4298
- > = z.object({
4299
- kind: RunAgentPublicMessagePartKind$inboundSchema,
4300
- text: z.string(),
4301
- });
4302
- /** @internal */
4303
- export type RunAgentPublicMessagePartTextPart$Outbound = {
4304
- kind: string;
4305
- text: string;
4306
- };
4307
-
4308
- /** @internal */
4309
- export const RunAgentPublicMessagePartTextPart$outboundSchema: z.ZodType<
4310
- RunAgentPublicMessagePartTextPart$Outbound,
4311
- z.ZodTypeDef,
4312
- RunAgentPublicMessagePartTextPart
4313
- > = z.object({
4314
- kind: RunAgentPublicMessagePartKind$outboundSchema,
4315
- text: z.string(),
4316
- });
4317
-
4318
- export function runAgentPublicMessagePartTextPartToJSON(
4319
- runAgentPublicMessagePartTextPart: RunAgentPublicMessagePartTextPart,
4320
- ): string {
4321
- return JSON.stringify(
4322
- RunAgentPublicMessagePartTextPart$outboundSchema.parse(
4323
- runAgentPublicMessagePartTextPart,
4324
- ),
4325
- );
4326
- }
4327
- export function runAgentPublicMessagePartTextPartFromJSON(
4328
- jsonString: string,
4329
- ): SafeParseResult<RunAgentPublicMessagePartTextPart, SDKValidationError> {
4330
- return safeParse(
4331
- jsonString,
4332
- (x) => RunAgentPublicMessagePartTextPart$inboundSchema.parse(JSON.parse(x)),
4333
- `Failed to parse 'RunAgentPublicMessagePartTextPart' from JSON`,
4334
- );
4335
- }
4336
-
4337
4150
  /** @internal */
4338
4151
  export const RunAgentPublicMessagePart$inboundSchema: z.ZodType<
4339
4152
  RunAgentPublicMessagePart,
4340
4153
  z.ZodTypeDef,
4341
4154
  unknown
4342
4155
  > = z.union([
4343
- z.lazy(() => RunAgentPublicMessagePartTextPart$inboundSchema),
4156
+ components.TextPart$inboundSchema,
4344
4157
  z.lazy(() => RunAgentPublicMessagePartFilePart$inboundSchema),
4345
4158
  z.lazy(() => RunAgentPublicMessagePartToolResultPart$inboundSchema),
4346
4159
  ]);
4347
4160
  /** @internal */
4348
4161
  export type RunAgentPublicMessagePart$Outbound =
4349
- | RunAgentPublicMessagePartTextPart$Outbound
4162
+ | components.TextPart$Outbound
4350
4163
  | RunAgentPublicMessagePartFilePart$Outbound
4351
4164
  | RunAgentPublicMessagePartToolResultPart$Outbound;
4352
4165
 
@@ -4356,7 +4169,7 @@ export const RunAgentPublicMessagePart$outboundSchema: z.ZodType<
4356
4169
  z.ZodTypeDef,
4357
4170
  RunAgentPublicMessagePart
4358
4171
  > = z.union([
4359
- z.lazy(() => RunAgentPublicMessagePartTextPart$outboundSchema),
4172
+ components.TextPart$outboundSchema,
4360
4173
  z.lazy(() => RunAgentPublicMessagePartFilePart$outboundSchema),
4361
4174
  z.lazy(() => RunAgentPublicMessagePartToolResultPart$outboundSchema),
4362
4175
  ]);
@@ -4391,7 +4204,7 @@ export const RunAgentA2AMessage$inboundSchema: z.ZodType<
4391
4204
  ]),
4392
4205
  parts: z.array(
4393
4206
  z.union([
4394
- z.lazy(() => RunAgentPublicMessagePartTextPart$inboundSchema),
4207
+ components.TextPart$inboundSchema,
4395
4208
  z.lazy(() => RunAgentPublicMessagePartFilePart$inboundSchema),
4396
4209
  z.lazy(() => RunAgentPublicMessagePartToolResultPart$inboundSchema),
4397
4210
  ]),
@@ -4402,7 +4215,7 @@ export type RunAgentA2AMessage$Outbound = {
4402
4215
  messageId?: string | undefined;
4403
4216
  role: string | string;
4404
4217
  parts: Array<
4405
- | RunAgentPublicMessagePartTextPart$Outbound
4218
+ | components.TextPart$Outbound
4406
4219
  | RunAgentPublicMessagePartFilePart$Outbound
4407
4220
  | RunAgentPublicMessagePartToolResultPart$Outbound
4408
4221
  >;
@@ -4421,7 +4234,7 @@ export const RunAgentA2AMessage$outboundSchema: z.ZodType<
4421
4234
  ]),
4422
4235
  parts: z.array(
4423
4236
  z.union([
4424
- z.lazy(() => RunAgentPublicMessagePartTextPart$outboundSchema),
4237
+ components.TextPart$outboundSchema,
4425
4238
  z.lazy(() => RunAgentPublicMessagePartFilePart$outboundSchema),
4426
4239
  z.lazy(() => RunAgentPublicMessagePartToolResultPart$outboundSchema),
4427
4240
  ]),
@@ -4790,7 +4603,7 @@ export function schemaFromJSON(
4790
4603
  /** @internal */
4791
4604
  export const Tools$inboundSchema: z.ZodType<Tools, z.ZodTypeDef, unknown> = z
4792
4605
  .object({
4793
- id: z.string().default("01KAWP2323ES7KCC47GEN9XX32"),
4606
+ id: z.string().default("01KAXGPSKKRBSE57K4PEH7FGJD"),
4794
4607
  name: z.string(),
4795
4608
  description: z.string().optional(),
4796
4609
  schema: z.lazy(() => Schema$inboundSchema),
@@ -4809,7 +4622,7 @@ export const Tools$outboundSchema: z.ZodType<
4809
4622
  z.ZodTypeDef,
4810
4623
  Tools
4811
4624
  > = z.object({
4812
- id: z.string().default("01KAWP2323ES7KCC47GEN9XX32"),
4625
+ id: z.string().default("01KAXGPSKKRBSE57K4PEH7FGJD"),
4813
4626
  name: z.string(),
4814
4627
  description: z.string().optional(),
4815
4628
  schema: z.lazy(() => Schema$outboundSchema),
@@ -6965,460 +6778,39 @@ export const RunAgentExtendedMessageRole$outboundSchema: z.ZodNativeEnum<
6965
6778
  typeof RunAgentExtendedMessageRole
6966
6779
  > = RunAgentExtendedMessageRole$inboundSchema;
6967
6780
 
6968
- /** @internal */
6969
- export const RunAgentPartsAgentsResponse200ApplicationJSONKind$inboundSchema:
6970
- z.ZodNativeEnum<typeof RunAgentPartsAgentsResponse200ApplicationJSONKind> = z
6971
- .nativeEnum(RunAgentPartsAgentsResponse200ApplicationJSONKind);
6972
- /** @internal */
6973
- export const RunAgentPartsAgentsResponse200ApplicationJSONKind$outboundSchema:
6974
- z.ZodNativeEnum<typeof RunAgentPartsAgentsResponse200ApplicationJSONKind> =
6975
- RunAgentPartsAgentsResponse200ApplicationJSONKind$inboundSchema;
6976
-
6977
- /** @internal */
6978
- export const RunAgentPartsToolResultPart$inboundSchema: z.ZodType<
6979
- RunAgentPartsToolResultPart,
6980
- z.ZodTypeDef,
6981
- unknown
6982
- > = z.object({
6983
- kind: RunAgentPartsAgentsResponse200ApplicationJSONKind$inboundSchema,
6984
- tool_call_id: z.string(),
6985
- result: z.any().optional(),
6986
- metadata: z.record(z.any()).optional(),
6987
- }).transform((v) => {
6988
- return remap$(v, {
6989
- "tool_call_id": "toolCallId",
6990
- });
6991
- });
6992
- /** @internal */
6993
- export type RunAgentPartsToolResultPart$Outbound = {
6994
- kind: string;
6995
- tool_call_id: string;
6996
- result?: any | undefined;
6997
- metadata?: { [k: string]: any } | undefined;
6998
- };
6999
-
7000
- /** @internal */
7001
- export const RunAgentPartsToolResultPart$outboundSchema: z.ZodType<
7002
- RunAgentPartsToolResultPart$Outbound,
7003
- z.ZodTypeDef,
7004
- RunAgentPartsToolResultPart
7005
- > = z.object({
7006
- kind: RunAgentPartsAgentsResponse200ApplicationJSONKind$outboundSchema,
7007
- toolCallId: z.string(),
7008
- result: z.any().optional(),
7009
- metadata: z.record(z.any()).optional(),
7010
- }).transform((v) => {
7011
- return remap$(v, {
7012
- toolCallId: "tool_call_id",
7013
- });
7014
- });
7015
-
7016
- export function runAgentPartsToolResultPartToJSON(
7017
- runAgentPartsToolResultPart: RunAgentPartsToolResultPart,
7018
- ): string {
7019
- return JSON.stringify(
7020
- RunAgentPartsToolResultPart$outboundSchema.parse(
7021
- runAgentPartsToolResultPart,
7022
- ),
7023
- );
7024
- }
7025
- export function runAgentPartsToolResultPartFromJSON(
7026
- jsonString: string,
7027
- ): SafeParseResult<RunAgentPartsToolResultPart, SDKValidationError> {
7028
- return safeParse(
7029
- jsonString,
7030
- (x) => RunAgentPartsToolResultPart$inboundSchema.parse(JSON.parse(x)),
7031
- `Failed to parse 'RunAgentPartsToolResultPart' from JSON`,
7032
- );
7033
- }
7034
-
7035
- /** @internal */
7036
- export const RunAgentPartsAgentsResponse200Kind$inboundSchema: z.ZodNativeEnum<
7037
- typeof RunAgentPartsAgentsResponse200Kind
7038
- > = z.nativeEnum(RunAgentPartsAgentsResponse200Kind);
7039
- /** @internal */
7040
- export const RunAgentPartsAgentsResponse200Kind$outboundSchema: z.ZodNativeEnum<
7041
- typeof RunAgentPartsAgentsResponse200Kind
7042
- > = RunAgentPartsAgentsResponse200Kind$inboundSchema;
7043
-
7044
- /** @internal */
7045
- export const PartsToolCallPart$inboundSchema: z.ZodType<
7046
- PartsToolCallPart,
7047
- z.ZodTypeDef,
7048
- unknown
7049
- > = z.object({
7050
- kind: RunAgentPartsAgentsResponse200Kind$inboundSchema,
7051
- tool_name: z.string(),
7052
- tool_call_id: z.string(),
7053
- arguments: z.record(z.any()),
7054
- metadata: z.record(z.any()).optional(),
7055
- }).transform((v) => {
7056
- return remap$(v, {
7057
- "tool_name": "toolName",
7058
- "tool_call_id": "toolCallId",
7059
- });
7060
- });
7061
- /** @internal */
7062
- export type PartsToolCallPart$Outbound = {
7063
- kind: string;
7064
- tool_name: string;
7065
- tool_call_id: string;
7066
- arguments: { [k: string]: any };
7067
- metadata?: { [k: string]: any } | undefined;
7068
- };
7069
-
7070
- /** @internal */
7071
- export const PartsToolCallPart$outboundSchema: z.ZodType<
7072
- PartsToolCallPart$Outbound,
7073
- z.ZodTypeDef,
7074
- PartsToolCallPart
7075
- > = z.object({
7076
- kind: RunAgentPartsAgentsResponse200Kind$outboundSchema,
7077
- toolName: z.string(),
7078
- toolCallId: z.string(),
7079
- arguments: z.record(z.any()),
7080
- metadata: z.record(z.any()).optional(),
7081
- }).transform((v) => {
7082
- return remap$(v, {
7083
- toolName: "tool_name",
7084
- toolCallId: "tool_call_id",
7085
- });
7086
- });
7087
-
7088
- export function partsToolCallPartToJSON(
7089
- partsToolCallPart: PartsToolCallPart,
7090
- ): string {
7091
- return JSON.stringify(
7092
- PartsToolCallPart$outboundSchema.parse(partsToolCallPart),
7093
- );
7094
- }
7095
- export function partsToolCallPartFromJSON(
7096
- jsonString: string,
7097
- ): SafeParseResult<PartsToolCallPart, SDKValidationError> {
7098
- return safeParse(
7099
- jsonString,
7100
- (x) => PartsToolCallPart$inboundSchema.parse(JSON.parse(x)),
7101
- `Failed to parse 'PartsToolCallPart' from JSON`,
7102
- );
7103
- }
7104
-
7105
- /** @internal */
7106
- export const RunAgentPartsAgentsResponseKind$inboundSchema: z.ZodNativeEnum<
7107
- typeof RunAgentPartsAgentsResponseKind
7108
- > = z.nativeEnum(RunAgentPartsAgentsResponseKind);
7109
- /** @internal */
7110
- export const RunAgentPartsAgentsResponseKind$outboundSchema: z.ZodNativeEnum<
7111
- typeof RunAgentPartsAgentsResponseKind
7112
- > = RunAgentPartsAgentsResponseKind$inboundSchema;
7113
-
7114
- /** @internal */
7115
- export const RunAgentFileAgentsFileInURIFormat$inboundSchema: z.ZodType<
7116
- RunAgentFileAgentsFileInURIFormat,
7117
- z.ZodTypeDef,
7118
- unknown
7119
- > = z.object({
7120
- uri: z.string(),
7121
- mimeType: z.string().optional(),
7122
- name: z.string().optional(),
7123
- });
7124
- /** @internal */
7125
- export type RunAgentFileAgentsFileInURIFormat$Outbound = {
7126
- uri: string;
7127
- mimeType?: string | undefined;
7128
- name?: string | undefined;
7129
- };
7130
-
7131
- /** @internal */
7132
- export const RunAgentFileAgentsFileInURIFormat$outboundSchema: z.ZodType<
7133
- RunAgentFileAgentsFileInURIFormat$Outbound,
7134
- z.ZodTypeDef,
7135
- RunAgentFileAgentsFileInURIFormat
7136
- > = z.object({
7137
- uri: z.string(),
7138
- mimeType: z.string().optional(),
7139
- name: z.string().optional(),
7140
- });
7141
-
7142
- export function runAgentFileAgentsFileInURIFormatToJSON(
7143
- runAgentFileAgentsFileInURIFormat: RunAgentFileAgentsFileInURIFormat,
7144
- ): string {
7145
- return JSON.stringify(
7146
- RunAgentFileAgentsFileInURIFormat$outboundSchema.parse(
7147
- runAgentFileAgentsFileInURIFormat,
7148
- ),
7149
- );
7150
- }
7151
- export function runAgentFileAgentsFileInURIFormatFromJSON(
7152
- jsonString: string,
7153
- ): SafeParseResult<RunAgentFileAgentsFileInURIFormat, SDKValidationError> {
7154
- return safeParse(
7155
- jsonString,
7156
- (x) => RunAgentFileAgentsFileInURIFormat$inboundSchema.parse(JSON.parse(x)),
7157
- `Failed to parse 'RunAgentFileAgentsFileInURIFormat' from JSON`,
7158
- );
7159
- }
7160
-
7161
- /** @internal */
7162
- export const RunAgentFileAgentsBinaryFormat$inboundSchema: z.ZodType<
7163
- RunAgentFileAgentsBinaryFormat,
7164
- z.ZodTypeDef,
7165
- unknown
7166
- > = z.object({
7167
- bytes: z.string(),
7168
- mimeType: z.string().optional(),
7169
- name: z.string().optional(),
7170
- });
7171
- /** @internal */
7172
- export type RunAgentFileAgentsBinaryFormat$Outbound = {
7173
- bytes: string;
7174
- mimeType?: string | undefined;
7175
- name?: string | undefined;
7176
- };
7177
-
7178
- /** @internal */
7179
- export const RunAgentFileAgentsBinaryFormat$outboundSchema: z.ZodType<
7180
- RunAgentFileAgentsBinaryFormat$Outbound,
7181
- z.ZodTypeDef,
7182
- RunAgentFileAgentsBinaryFormat
7183
- > = z.object({
7184
- bytes: z.string(),
7185
- mimeType: z.string().optional(),
7186
- name: z.string().optional(),
7187
- });
7188
-
7189
- export function runAgentFileAgentsBinaryFormatToJSON(
7190
- runAgentFileAgentsBinaryFormat: RunAgentFileAgentsBinaryFormat,
7191
- ): string {
7192
- return JSON.stringify(
7193
- RunAgentFileAgentsBinaryFormat$outboundSchema.parse(
7194
- runAgentFileAgentsBinaryFormat,
7195
- ),
7196
- );
7197
- }
7198
- export function runAgentFileAgentsBinaryFormatFromJSON(
7199
- jsonString: string,
7200
- ): SafeParseResult<RunAgentFileAgentsBinaryFormat, SDKValidationError> {
7201
- return safeParse(
7202
- jsonString,
7203
- (x) => RunAgentFileAgentsBinaryFormat$inboundSchema.parse(JSON.parse(x)),
7204
- `Failed to parse 'RunAgentFileAgentsBinaryFormat' from JSON`,
7205
- );
7206
- }
7207
-
7208
- /** @internal */
7209
- export const RunAgentPartsFile$inboundSchema: z.ZodType<
7210
- RunAgentPartsFile,
7211
- z.ZodTypeDef,
7212
- unknown
7213
- > = z.union([
7214
- z.lazy(() => RunAgentFileAgentsBinaryFormat$inboundSchema),
7215
- z.lazy(() => RunAgentFileAgentsFileInURIFormat$inboundSchema),
7216
- ]);
7217
- /** @internal */
7218
- export type RunAgentPartsFile$Outbound =
7219
- | RunAgentFileAgentsBinaryFormat$Outbound
7220
- | RunAgentFileAgentsFileInURIFormat$Outbound;
7221
-
7222
- /** @internal */
7223
- export const RunAgentPartsFile$outboundSchema: z.ZodType<
7224
- RunAgentPartsFile$Outbound,
7225
- z.ZodTypeDef,
7226
- RunAgentPartsFile
7227
- > = z.union([
7228
- z.lazy(() => RunAgentFileAgentsBinaryFormat$outboundSchema),
7229
- z.lazy(() => RunAgentFileAgentsFileInURIFormat$outboundSchema),
7230
- ]);
7231
-
7232
- export function runAgentPartsFileToJSON(
7233
- runAgentPartsFile: RunAgentPartsFile,
7234
- ): string {
7235
- return JSON.stringify(
7236
- RunAgentPartsFile$outboundSchema.parse(runAgentPartsFile),
7237
- );
7238
- }
7239
- export function runAgentPartsFileFromJSON(
7240
- jsonString: string,
7241
- ): SafeParseResult<RunAgentPartsFile, SDKValidationError> {
7242
- return safeParse(
7243
- jsonString,
7244
- (x) => RunAgentPartsFile$inboundSchema.parse(JSON.parse(x)),
7245
- `Failed to parse 'RunAgentPartsFile' from JSON`,
7246
- );
7247
- }
7248
-
7249
- /** @internal */
7250
- export const RunAgentPartsFilePart$inboundSchema: z.ZodType<
7251
- RunAgentPartsFilePart,
7252
- z.ZodTypeDef,
7253
- unknown
7254
- > = z.object({
7255
- kind: RunAgentPartsAgentsResponseKind$inboundSchema,
7256
- file: z.union([
7257
- z.lazy(() => RunAgentFileAgentsBinaryFormat$inboundSchema),
7258
- z.lazy(() => RunAgentFileAgentsFileInURIFormat$inboundSchema),
7259
- ]),
7260
- metadata: z.record(z.any()).optional(),
7261
- });
7262
- /** @internal */
7263
- export type RunAgentPartsFilePart$Outbound = {
7264
- kind: string;
7265
- file:
7266
- | RunAgentFileAgentsBinaryFormat$Outbound
7267
- | RunAgentFileAgentsFileInURIFormat$Outbound;
7268
- metadata?: { [k: string]: any } | undefined;
7269
- };
7270
-
7271
- /** @internal */
7272
- export const RunAgentPartsFilePart$outboundSchema: z.ZodType<
7273
- RunAgentPartsFilePart$Outbound,
7274
- z.ZodTypeDef,
7275
- RunAgentPartsFilePart
7276
- > = z.object({
7277
- kind: RunAgentPartsAgentsResponseKind$outboundSchema,
7278
- file: z.union([
7279
- z.lazy(() => RunAgentFileAgentsBinaryFormat$outboundSchema),
7280
- z.lazy(() => RunAgentFileAgentsFileInURIFormat$outboundSchema),
7281
- ]),
7282
- metadata: z.record(z.any()).optional(),
7283
- });
7284
-
7285
- export function runAgentPartsFilePartToJSON(
7286
- runAgentPartsFilePart: RunAgentPartsFilePart,
7287
- ): string {
7288
- return JSON.stringify(
7289
- RunAgentPartsFilePart$outboundSchema.parse(runAgentPartsFilePart),
7290
- );
7291
- }
7292
- export function runAgentPartsFilePartFromJSON(
7293
- jsonString: string,
7294
- ): SafeParseResult<RunAgentPartsFilePart, SDKValidationError> {
7295
- return safeParse(
7296
- jsonString,
7297
- (x) => RunAgentPartsFilePart$inboundSchema.parse(JSON.parse(x)),
7298
- `Failed to parse 'RunAgentPartsFilePart' from JSON`,
7299
- );
7300
- }
7301
-
7302
- /** @internal */
7303
- export const RunAgentPartsAgentsKind$inboundSchema: z.ZodNativeEnum<
7304
- typeof RunAgentPartsAgentsKind
7305
- > = z.nativeEnum(RunAgentPartsAgentsKind);
7306
- /** @internal */
7307
- export const RunAgentPartsAgentsKind$outboundSchema: z.ZodNativeEnum<
7308
- typeof RunAgentPartsAgentsKind
7309
- > = RunAgentPartsAgentsKind$inboundSchema;
7310
-
7311
- /** @internal */
7312
- export const PartsDataPart$inboundSchema: z.ZodType<
7313
- PartsDataPart,
7314
- z.ZodTypeDef,
7315
- unknown
7316
- > = z.object({
7317
- kind: RunAgentPartsAgentsKind$inboundSchema,
7318
- data: z.record(z.any()),
7319
- metadata: z.record(z.any()).optional(),
7320
- });
7321
- /** @internal */
7322
- export type PartsDataPart$Outbound = {
7323
- kind: string;
7324
- data: { [k: string]: any };
7325
- metadata?: { [k: string]: any } | undefined;
7326
- };
7327
-
7328
- /** @internal */
7329
- export const PartsDataPart$outboundSchema: z.ZodType<
7330
- PartsDataPart$Outbound,
7331
- z.ZodTypeDef,
7332
- PartsDataPart
7333
- > = z.object({
7334
- kind: RunAgentPartsAgentsKind$outboundSchema,
7335
- data: z.record(z.any()),
7336
- metadata: z.record(z.any()).optional(),
7337
- });
7338
-
7339
- export function partsDataPartToJSON(partsDataPart: PartsDataPart): string {
7340
- return JSON.stringify(PartsDataPart$outboundSchema.parse(partsDataPart));
7341
- }
7342
- export function partsDataPartFromJSON(
7343
- jsonString: string,
7344
- ): SafeParseResult<PartsDataPart, SDKValidationError> {
7345
- return safeParse(
7346
- jsonString,
7347
- (x) => PartsDataPart$inboundSchema.parse(JSON.parse(x)),
7348
- `Failed to parse 'PartsDataPart' from JSON`,
7349
- );
7350
- }
7351
-
7352
- /** @internal */
7353
- export const RunAgentPartsKind$inboundSchema: z.ZodNativeEnum<
7354
- typeof RunAgentPartsKind
7355
- > = z.nativeEnum(RunAgentPartsKind);
7356
- /** @internal */
7357
- export const RunAgentPartsKind$outboundSchema: z.ZodNativeEnum<
7358
- typeof RunAgentPartsKind
7359
- > = RunAgentPartsKind$inboundSchema;
7360
-
7361
- /** @internal */
7362
- export const RunAgentPartsTextPart$inboundSchema: z.ZodType<
7363
- RunAgentPartsTextPart,
7364
- z.ZodTypeDef,
7365
- unknown
7366
- > = z.object({
7367
- kind: RunAgentPartsKind$inboundSchema,
7368
- text: z.string(),
7369
- });
7370
- /** @internal */
7371
- export type RunAgentPartsTextPart$Outbound = {
7372
- kind: string;
7373
- text: string;
7374
- };
7375
-
7376
- /** @internal */
7377
- export const RunAgentPartsTextPart$outboundSchema: z.ZodType<
7378
- RunAgentPartsTextPart$Outbound,
7379
- z.ZodTypeDef,
7380
- RunAgentPartsTextPart
7381
- > = z.object({
7382
- kind: RunAgentPartsKind$outboundSchema,
7383
- text: z.string(),
7384
- });
7385
-
7386
- export function runAgentPartsTextPartToJSON(
7387
- runAgentPartsTextPart: RunAgentPartsTextPart,
7388
- ): string {
7389
- return JSON.stringify(
7390
- RunAgentPartsTextPart$outboundSchema.parse(runAgentPartsTextPart),
7391
- );
7392
- }
7393
- export function runAgentPartsTextPartFromJSON(
7394
- jsonString: string,
7395
- ): SafeParseResult<RunAgentPartsTextPart, SDKValidationError> {
7396
- return safeParse(
7397
- jsonString,
7398
- (x) => RunAgentPartsTextPart$inboundSchema.parse(JSON.parse(x)),
7399
- `Failed to parse 'RunAgentPartsTextPart' from JSON`,
7400
- );
7401
- }
7402
-
7403
6781
  /** @internal */
7404
6782
  export const RunAgentParts$inboundSchema: z.ZodType<
7405
6783
  RunAgentParts,
7406
6784
  z.ZodTypeDef,
7407
6785
  unknown
7408
6786
  > = z.union([
7409
- z.lazy(() => PartsToolCallPart$inboundSchema),
7410
- z.lazy(() => RunAgentPartsTextPart$inboundSchema),
7411
- z.lazy(() => PartsDataPart$inboundSchema),
7412
- z.lazy(() => RunAgentPartsFilePart$inboundSchema),
7413
- z.lazy(() => RunAgentPartsToolResultPart$inboundSchema),
6787
+ components.ToolCallPart$inboundSchema.and(
6788
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
6789
+ kind: v.kind,
6790
+ })),
6791
+ ),
6792
+ components.TextPart$inboundSchema.and(
6793
+ z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind })),
6794
+ ),
6795
+ components.DataPart$inboundSchema.and(
6796
+ z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind })),
6797
+ ),
6798
+ components.FilePart$inboundSchema.and(
6799
+ z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind })),
6800
+ ),
6801
+ components.ToolResultPart$inboundSchema.and(
6802
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
6803
+ kind: v.kind,
6804
+ })),
6805
+ ),
7414
6806
  ]);
7415
6807
  /** @internal */
7416
6808
  export type RunAgentParts$Outbound =
7417
- | PartsToolCallPart$Outbound
7418
- | RunAgentPartsTextPart$Outbound
7419
- | PartsDataPart$Outbound
7420
- | RunAgentPartsFilePart$Outbound
7421
- | RunAgentPartsToolResultPart$Outbound;
6809
+ | (components.ToolCallPart$Outbound & { kind: "tool_call" })
6810
+ | (components.TextPart$Outbound & { kind: "text" })
6811
+ | (components.DataPart$Outbound & { kind: "data" })
6812
+ | (components.FilePart$Outbound & { kind: "file" })
6813
+ | (components.ToolResultPart$Outbound & { kind: "tool_result" });
7422
6814
 
7423
6815
  /** @internal */
7424
6816
  export const RunAgentParts$outboundSchema: z.ZodType<
@@ -7426,11 +6818,25 @@ export const RunAgentParts$outboundSchema: z.ZodType<
7426
6818
  z.ZodTypeDef,
7427
6819
  RunAgentParts
7428
6820
  > = z.union([
7429
- z.lazy(() => PartsToolCallPart$outboundSchema),
7430
- z.lazy(() => RunAgentPartsTextPart$outboundSchema),
7431
- z.lazy(() => PartsDataPart$outboundSchema),
7432
- z.lazy(() => RunAgentPartsFilePart$outboundSchema),
7433
- z.lazy(() => RunAgentPartsToolResultPart$outboundSchema),
6821
+ components.ToolCallPart$outboundSchema.and(
6822
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
6823
+ kind: v.kind,
6824
+ })),
6825
+ ),
6826
+ components.TextPart$outboundSchema.and(
6827
+ z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind })),
6828
+ ),
6829
+ components.DataPart$outboundSchema.and(
6830
+ z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind })),
6831
+ ),
6832
+ components.FilePart$outboundSchema.and(
6833
+ z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind })),
6834
+ ),
6835
+ components.ToolResultPart$outboundSchema.and(
6836
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
6837
+ kind: v.kind,
6838
+ })),
6839
+ ),
7434
6840
  ]);
7435
6841
 
7436
6842
  export function runAgentPartsToJSON(runAgentParts: RunAgentParts): string {
@@ -7457,11 +6863,31 @@ export const RunAgentTaskStatusMessage$inboundSchema: z.ZodType<
7457
6863
  role: RunAgentExtendedMessageRole$inboundSchema,
7458
6864
  parts: z.array(
7459
6865
  z.union([
7460
- z.lazy(() => PartsToolCallPart$inboundSchema),
7461
- z.lazy(() => RunAgentPartsTextPart$inboundSchema),
7462
- z.lazy(() => PartsDataPart$inboundSchema),
7463
- z.lazy(() => RunAgentPartsFilePart$inboundSchema),
7464
- z.lazy(() => RunAgentPartsToolResultPart$inboundSchema),
6866
+ components.ToolCallPart$inboundSchema.and(
6867
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
6868
+ kind: v.kind,
6869
+ })),
6870
+ ),
6871
+ components.TextPart$inboundSchema.and(
6872
+ z.object({ kind: z.literal("text") }).transform((v) => ({
6873
+ kind: v.kind,
6874
+ })),
6875
+ ),
6876
+ components.DataPart$inboundSchema.and(
6877
+ z.object({ kind: z.literal("data") }).transform((v) => ({
6878
+ kind: v.kind,
6879
+ })),
6880
+ ),
6881
+ components.FilePart$inboundSchema.and(
6882
+ z.object({ kind: z.literal("file") }).transform((v) => ({
6883
+ kind: v.kind,
6884
+ })),
6885
+ ),
6886
+ components.ToolResultPart$inboundSchema.and(
6887
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
6888
+ kind: v.kind,
6889
+ })),
6890
+ ),
7465
6891
  ]),
7466
6892
  ),
7467
6893
  });
@@ -7471,11 +6897,11 @@ export type RunAgentTaskStatusMessage$Outbound = {
7471
6897
  messageId: string;
7472
6898
  role: string;
7473
6899
  parts: Array<
7474
- | PartsToolCallPart$Outbound
7475
- | RunAgentPartsTextPart$Outbound
7476
- | PartsDataPart$Outbound
7477
- | RunAgentPartsFilePart$Outbound
7478
- | RunAgentPartsToolResultPart$Outbound
6900
+ | (components.ToolCallPart$Outbound & { kind: "tool_call" })
6901
+ | (components.TextPart$Outbound & { kind: "text" })
6902
+ | (components.DataPart$Outbound & { kind: "data" })
6903
+ | (components.FilePart$Outbound & { kind: "file" })
6904
+ | (components.ToolResultPart$Outbound & { kind: "tool_result" })
7479
6905
  >;
7480
6906
  };
7481
6907
 
@@ -7490,11 +6916,31 @@ export const RunAgentTaskStatusMessage$outboundSchema: z.ZodType<
7490
6916
  role: RunAgentExtendedMessageRole$outboundSchema,
7491
6917
  parts: z.array(
7492
6918
  z.union([
7493
- z.lazy(() => PartsToolCallPart$outboundSchema),
7494
- z.lazy(() => RunAgentPartsTextPart$outboundSchema),
7495
- z.lazy(() => PartsDataPart$outboundSchema),
7496
- z.lazy(() => RunAgentPartsFilePart$outboundSchema),
7497
- z.lazy(() => RunAgentPartsToolResultPart$outboundSchema),
6919
+ components.ToolCallPart$outboundSchema.and(
6920
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
6921
+ kind: v.kind,
6922
+ })),
6923
+ ),
6924
+ components.TextPart$outboundSchema.and(
6925
+ z.object({ kind: z.literal("text") }).transform((v) => ({
6926
+ kind: v.kind,
6927
+ })),
6928
+ ),
6929
+ components.DataPart$outboundSchema.and(
6930
+ z.object({ kind: z.literal("data") }).transform((v) => ({
6931
+ kind: v.kind,
6932
+ })),
6933
+ ),
6934
+ components.FilePart$outboundSchema.and(
6935
+ z.object({ kind: z.literal("file") }).transform((v) => ({
6936
+ kind: v.kind,
6937
+ })),
6938
+ ),
6939
+ components.ToolResultPart$outboundSchema.and(
6940
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
6941
+ kind: v.kind,
6942
+ })),
6943
+ ),
7498
6944
  ]),
7499
6945
  ),
7500
6946
  });