@orq-ai/node 4.1.0-rc.0 → 4.1.0-rc.11

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 (412) hide show
  1. package/README.md +22 -18
  2. package/bin/mcp-server.js +35857 -37966
  3. package/bin/mcp-server.js.map +100 -74
  4. package/docs/sdks/agents/README.md +10 -10
  5. package/docs/sdks/evals/README.md +103 -1
  6. package/docs/sdks/responses/README.md +5 -5
  7. package/examples/package-lock.json +1 -1
  8. package/funcs/agentsCreate.d.ts +1 -1
  9. package/funcs/agentsCreate.d.ts.map +1 -1
  10. package/funcs/agentsCreate.js +2 -4
  11. package/funcs/agentsCreate.js.map +1 -1
  12. package/funcs/agentsResponsesCreate.d.ts +1 -1
  13. package/funcs/agentsResponsesCreate.d.ts.map +1 -1
  14. package/funcs/agentsResponsesCreate.js +4 -4
  15. package/funcs/agentsResponsesCreate.js.map +1 -1
  16. package/funcs/agentsRun.d.ts +1 -1
  17. package/funcs/agentsRun.d.ts.map +1 -1
  18. package/funcs/agentsRun.js +2 -4
  19. package/funcs/agentsRun.js.map +1 -1
  20. package/funcs/agentsStream.d.ts +1 -1
  21. package/funcs/agentsStream.d.ts.map +1 -1
  22. package/funcs/agentsStream.js +4 -4
  23. package/funcs/agentsStream.js.map +1 -1
  24. package/funcs/agentsStreamRun.d.ts +1 -1
  25. package/funcs/agentsStreamRun.d.ts.map +1 -1
  26. package/funcs/agentsStreamRun.js +2 -4
  27. package/funcs/agentsStreamRun.js.map +1 -1
  28. package/funcs/agentsUpdate.d.ts +1 -1
  29. package/funcs/agentsUpdate.d.ts.map +1 -1
  30. package/funcs/agentsUpdate.js +4 -4
  31. package/funcs/agentsUpdate.js.map +1 -1
  32. package/funcs/evalsInvoke.d.ts +15 -0
  33. package/funcs/evalsInvoke.d.ts.map +1 -0
  34. package/funcs/evalsInvoke.js +121 -0
  35. package/funcs/evalsInvoke.js.map +1 -0
  36. package/jsr.json +1 -1
  37. package/lib/config.d.ts +3 -3
  38. package/lib/config.js +3 -3
  39. package/lib/config.js.map +1 -1
  40. package/mcp-server/mcp-server.js +1 -1
  41. package/mcp-server/mcp-server.js.map +1 -1
  42. package/mcp-server/server.d.ts.map +1 -1
  43. package/mcp-server/server.js +3 -1
  44. package/mcp-server/server.js.map +1 -1
  45. package/mcp-server/tools/agentsCreate.d.ts +1 -1
  46. package/mcp-server/tools/agentsCreate.js +1 -1
  47. package/mcp-server/tools/agentsCreate.js.map +1 -1
  48. package/mcp-server/tools/agentsResponsesCreate.d.ts +1 -1
  49. package/mcp-server/tools/agentsResponsesCreate.d.ts.map +1 -1
  50. package/mcp-server/tools/agentsResponsesCreate.js +2 -3
  51. package/mcp-server/tools/agentsResponsesCreate.js.map +1 -1
  52. package/mcp-server/tools/agentsRun.d.ts +1 -1
  53. package/mcp-server/tools/agentsRun.js +1 -1
  54. package/mcp-server/tools/agentsRun.js.map +1 -1
  55. package/mcp-server/tools/agentsStream.d.ts +1 -1
  56. package/mcp-server/tools/agentsStream.js +2 -2
  57. package/mcp-server/tools/agentsStream.js.map +1 -1
  58. package/mcp-server/tools/agentsStreamRun.d.ts +1 -1
  59. package/mcp-server/tools/agentsStreamRun.js +1 -1
  60. package/mcp-server/tools/agentsStreamRun.js.map +1 -1
  61. package/mcp-server/tools/agentsUpdate.d.ts +1 -1
  62. package/mcp-server/tools/agentsUpdate.d.ts.map +1 -1
  63. package/mcp-server/tools/agentsUpdate.js +2 -3
  64. package/mcp-server/tools/agentsUpdate.js.map +1 -1
  65. package/mcp-server/tools/evalsInvoke.d.ts +8 -0
  66. package/mcp-server/tools/evalsInvoke.d.ts.map +1 -0
  67. package/mcp-server/tools/evalsInvoke.js +62 -0
  68. package/mcp-server/tools/evalsInvoke.js.map +1 -0
  69. package/models/components/actionreviewedstreamingevent.d.ts +76 -0
  70. package/models/components/actionreviewedstreamingevent.d.ts.map +1 -0
  71. package/models/components/actionreviewedstreamingevent.js +127 -0
  72. package/models/components/actionreviewedstreamingevent.js.map +1 -0
  73. package/models/components/actionreviewrequestedstreamingevent.d.ts +135 -0
  74. package/models/components/actionreviewrequestedstreamingevent.d.ts.map +1 -0
  75. package/models/components/actionreviewrequestedstreamingevent.js +180 -0
  76. package/models/components/actionreviewrequestedstreamingevent.js.map +1 -0
  77. package/models/components/agenterroredstreamingevent.d.ts +58 -0
  78. package/models/components/agenterroredstreamingevent.d.ts.map +1 -0
  79. package/models/components/agenterroredstreamingevent.js +91 -0
  80. package/models/components/agenterroredstreamingevent.js.map +1 -0
  81. package/models/components/agentexecutionstartedstreamingevent.d.ts +62 -0
  82. package/models/components/agentexecutionstartedstreamingevent.d.ts.map +1 -0
  83. package/models/components/agentexecutionstartedstreamingevent.js +103 -0
  84. package/models/components/agentexecutionstartedstreamingevent.js.map +1 -0
  85. package/models/components/agenthandedoffstreamingevent.d.ts +51 -0
  86. package/models/components/agenthandedoffstreamingevent.d.ts.map +1 -0
  87. package/models/components/agenthandedoffstreamingevent.js +96 -0
  88. package/models/components/agenthandedoffstreamingevent.js.map +1 -0
  89. package/models/components/agentinactivestreamingevent.d.ts +309 -0
  90. package/models/components/agentinactivestreamingevent.d.ts.map +1 -0
  91. package/models/components/agentinactivestreamingevent.js +385 -0
  92. package/models/components/agentinactivestreamingevent.js.map +1 -0
  93. package/models/components/agentmessagecreatedstreamingevent.d.ts +141 -0
  94. package/models/components/agentmessagecreatedstreamingevent.d.ts.map +1 -0
  95. package/models/components/agentmessagecreatedstreamingevent.js +190 -0
  96. package/models/components/agentmessagecreatedstreamingevent.js.map +1 -0
  97. package/models/components/agentstartedstreamingevent.d.ts +382 -0
  98. package/models/components/agentstartedstreamingevent.d.ts.map +1 -0
  99. package/models/components/agentstartedstreamingevent.js +441 -0
  100. package/models/components/agentstartedstreamingevent.js.map +1 -0
  101. package/models/components/agentthoughtstreamingevent.d.ts +542 -0
  102. package/models/components/agentthoughtstreamingevent.d.ts.map +1 -0
  103. package/models/components/agentthoughtstreamingevent.js +626 -0
  104. package/models/components/agentthoughtstreamingevent.js.map +1 -0
  105. package/models/components/datapart.d.ts +41 -0
  106. package/models/components/datapart.d.ts.map +1 -0
  107. package/models/components/datapart.js +69 -0
  108. package/models/components/datapart.js.map +1 -0
  109. package/models/components/errorstreamingevent.d.ts +51 -0
  110. package/models/components/errorstreamingevent.d.ts.map +1 -0
  111. package/models/components/errorstreamingevent.js +87 -0
  112. package/models/components/errorstreamingevent.js.map +1 -0
  113. package/models/components/executionnamedstreamingevent.d.ts +51 -0
  114. package/models/components/executionnamedstreamingevent.d.ts.map +1 -0
  115. package/models/components/executionnamedstreamingevent.js +96 -0
  116. package/models/components/executionnamedstreamingevent.js.map +1 -0
  117. package/models/components/executionreviewedstreamingevent.d.ts +45 -0
  118. package/models/components/executionreviewedstreamingevent.d.ts.map +1 -0
  119. package/models/components/executionreviewedstreamingevent.js +81 -0
  120. package/models/components/executionreviewedstreamingevent.js.map +1 -0
  121. package/models/components/executionreviewrequiredstreamingevent.d.ts +45 -0
  122. package/models/components/executionreviewrequiredstreamingevent.d.ts.map +1 -0
  123. package/models/components/executionreviewrequiredstreamingevent.js +82 -0
  124. package/models/components/executionreviewrequiredstreamingevent.js.map +1 -0
  125. package/models/components/filepart.d.ts +104 -0
  126. package/models/components/filepart.d.ts.map +1 -0
  127. package/models/components/filepart.js +134 -0
  128. package/models/components/filepart.js.map +1 -0
  129. package/models/components/index.d.ts +22 -0
  130. package/models/components/index.d.ts.map +1 -1
  131. package/models/components/index.js +22 -0
  132. package/models/components/index.js.map +1 -1
  133. package/models/components/invokedeploymentrequest.d.ts +21 -21
  134. package/models/components/invokedeploymentrequest.d.ts.map +1 -1
  135. package/models/components/invokedeploymentrequest.js +27 -28
  136. package/models/components/invokedeploymentrequest.js.map +1 -1
  137. package/models/components/textpart.d.ts +31 -0
  138. package/models/components/textpart.d.ts.map +1 -0
  139. package/models/components/textpart.js +67 -0
  140. package/models/components/textpart.js.map +1 -0
  141. package/models/components/timeoutstreamingevent.d.ts +49 -0
  142. package/models/components/timeoutstreamingevent.d.ts.map +1 -0
  143. package/models/components/timeoutstreamingevent.js +85 -0
  144. package/models/components/timeoutstreamingevent.js.map +1 -0
  145. package/models/components/toolcallpart.d.ts +45 -0
  146. package/models/components/toolcallpart.d.ts.map +1 -0
  147. package/models/components/toolcallpart.js +84 -0
  148. package/models/components/toolcallpart.js.map +1 -0
  149. package/models/components/toolexecutionfailedstreamingevent.d.ts +144 -0
  150. package/models/components/toolexecutionfailedstreamingevent.d.ts.map +1 -0
  151. package/models/components/toolexecutionfailedstreamingevent.js +223 -0
  152. package/models/components/toolexecutionfailedstreamingevent.js.map +1 -0
  153. package/models/components/toolexecutionfinishedstreamingevent.d.ts +129 -0
  154. package/models/components/toolexecutionfinishedstreamingevent.d.ts.map +1 -0
  155. package/models/components/toolexecutionfinishedstreamingevent.js +205 -0
  156. package/models/components/toolexecutionfinishedstreamingevent.js.map +1 -0
  157. package/models/components/toolexecutionstartedstreamingevent.d.ts +139 -0
  158. package/models/components/toolexecutionstartedstreamingevent.d.ts.map +1 -0
  159. package/models/components/toolexecutionstartedstreamingevent.js +217 -0
  160. package/models/components/toolexecutionstartedstreamingevent.js.map +1 -0
  161. package/models/components/toolresultpart.d.ts +39 -0
  162. package/models/components/toolresultpart.d.ts.map +1 -0
  163. package/models/components/toolresultpart.js +80 -0
  164. package/models/components/toolresultpart.js.map +1 -0
  165. package/models/errors/index.d.ts +1 -0
  166. package/models/errors/index.d.ts.map +1 -1
  167. package/models/errors/index.js +1 -0
  168. package/models/errors/index.js.map +1 -1
  169. package/models/errors/invokeeval.d.ts +55 -0
  170. package/models/errors/invokeeval.d.ts.map +1 -0
  171. package/models/errors/invokeeval.js +106 -0
  172. package/models/errors/invokeeval.js.map +1 -0
  173. package/models/operations/createagentrequest.d.ts +3 -0
  174. package/models/operations/createagentrequest.d.ts.map +1 -1
  175. package/models/operations/createagentrequest.js.map +1 -1
  176. package/models/operations/createagentresponserequest.d.ts +58 -167
  177. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  178. package/models/operations/createagentresponserequest.js +89 -173
  179. package/models/operations/createagentresponserequest.js.map +1 -1
  180. package/models/operations/createbudget.js +2 -2
  181. package/models/operations/createcontact.js +2 -2
  182. package/models/operations/createdataset.js +2 -2
  183. package/models/operations/createdatasetitem.js +8 -8
  184. package/models/operations/createdatasource.js +2 -2
  185. package/models/operations/createeval.d.ts +80 -145
  186. package/models/operations/createeval.d.ts.map +1 -1
  187. package/models/operations/createeval.js +190 -266
  188. package/models/operations/createeval.js.map +1 -1
  189. package/models/operations/createprompt.d.ts +9 -11
  190. package/models/operations/createprompt.d.ts.map +1 -1
  191. package/models/operations/createprompt.js +9 -11
  192. package/models/operations/createprompt.js.map +1 -1
  193. package/models/operations/createtool.js +12 -12
  194. package/models/operations/deploymentgetconfig.d.ts +241 -241
  195. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  196. package/models/operations/deploymentgetconfig.js +346 -351
  197. package/models/operations/deploymentgetconfig.js.map +1 -1
  198. package/models/operations/deploymentinvoke.d.ts +24 -26
  199. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  200. package/models/operations/deploymentinvoke.js +26 -28
  201. package/models/operations/deploymentinvoke.js.map +1 -1
  202. package/models/operations/deployments.d.ts +24 -26
  203. package/models/operations/deployments.d.ts.map +1 -1
  204. package/models/operations/deployments.js +26 -28
  205. package/models/operations/deployments.js.map +1 -1
  206. package/models/operations/deploymentstream.d.ts +25 -27
  207. package/models/operations/deploymentstream.d.ts.map +1 -1
  208. package/models/operations/deploymentstream.js +30 -34
  209. package/models/operations/deploymentstream.js.map +1 -1
  210. package/models/operations/fileget.js +2 -2
  211. package/models/operations/filelist.js +2 -2
  212. package/models/operations/fileupload.js +2 -2
  213. package/models/operations/getallprompts.d.ts +9 -11
  214. package/models/operations/getallprompts.d.ts.map +1 -1
  215. package/models/operations/getallprompts.js +9 -11
  216. package/models/operations/getallprompts.js.map +1 -1
  217. package/models/operations/getalltools.js +12 -12
  218. package/models/operations/getbudget.js +2 -2
  219. package/models/operations/getevals.d.ts +14 -79
  220. package/models/operations/getevals.d.ts.map +1 -1
  221. package/models/operations/getevals.js +49 -132
  222. package/models/operations/getevals.js.map +1 -1
  223. package/models/operations/getoneprompt.d.ts +9 -11
  224. package/models/operations/getoneprompt.d.ts.map +1 -1
  225. package/models/operations/getoneprompt.js +9 -11
  226. package/models/operations/getoneprompt.js.map +1 -1
  227. package/models/operations/getpromptversion.d.ts +9 -11
  228. package/models/operations/getpromptversion.d.ts.map +1 -1
  229. package/models/operations/getpromptversion.js +9 -11
  230. package/models/operations/getpromptversion.js.map +1 -1
  231. package/models/operations/index.d.ts +1 -0
  232. package/models/operations/index.d.ts.map +1 -1
  233. package/models/operations/index.js +1 -0
  234. package/models/operations/index.js.map +1 -1
  235. package/models/operations/invokeagent.d.ts +63 -416
  236. package/models/operations/invokeagent.d.ts.map +1 -1
  237. package/models/operations/invokeagent.js +80 -429
  238. package/models/operations/invokeagent.js.map +1 -1
  239. package/models/operations/invokeeval.d.ts +719 -0
  240. package/models/operations/invokeeval.d.ts.map +1 -0
  241. package/models/operations/invokeeval.js +954 -0
  242. package/models/operations/invokeeval.js.map +1 -0
  243. package/models/operations/listagents.d.ts +3 -0
  244. package/models/operations/listagents.d.ts.map +1 -1
  245. package/models/operations/listagents.js.map +1 -1
  246. package/models/operations/listbudgets.js +2 -2
  247. package/models/operations/listcontacts.js +2 -2
  248. package/models/operations/listdatasetdatapoints.js +8 -8
  249. package/models/operations/listdatasets.js +2 -2
  250. package/models/operations/listdatasources.js +2 -2
  251. package/models/operations/listknowledgebases.d.ts +16 -16
  252. package/models/operations/listknowledgebases.d.ts.map +1 -1
  253. package/models/operations/listknowledgebases.js +27 -25
  254. package/models/operations/listknowledgebases.js.map +1 -1
  255. package/models/operations/listpromptversions.d.ts +9 -11
  256. package/models/operations/listpromptversions.d.ts.map +1 -1
  257. package/models/operations/listpromptversions.js +9 -11
  258. package/models/operations/listpromptversions.js.map +1 -1
  259. package/models/operations/retrieveagentrequest.d.ts +3 -0
  260. package/models/operations/retrieveagentrequest.d.ts.map +1 -1
  261. package/models/operations/retrieveagentrequest.js.map +1 -1
  262. package/models/operations/retrievecontact.js +2 -2
  263. package/models/operations/retrievedatapoint.js +8 -8
  264. package/models/operations/retrievedataset.js +2 -2
  265. package/models/operations/retrievedatasource.js +2 -2
  266. package/models/operations/retrievetool.js +12 -12
  267. package/models/operations/runagent.d.ts +49 -402
  268. package/models/operations/runagent.d.ts.map +1 -1
  269. package/models/operations/runagent.js +70 -418
  270. package/models/operations/runagent.js.map +1 -1
  271. package/models/operations/streamagent.d.ts +240 -3281
  272. package/models/operations/streamagent.d.ts.map +1 -1
  273. package/models/operations/streamagent.js +160 -3604
  274. package/models/operations/streamagent.js.map +1 -1
  275. package/models/operations/streamrunagent.d.ts +888 -3929
  276. package/models/operations/streamrunagent.d.ts.map +1 -1
  277. package/models/operations/streamrunagent.js +165 -3605
  278. package/models/operations/streamrunagent.js.map +1 -1
  279. package/models/operations/updateagent.d.ts +5 -2
  280. package/models/operations/updateagent.d.ts.map +1 -1
  281. package/models/operations/updateagent.js +2 -4
  282. package/models/operations/updateagent.js.map +1 -1
  283. package/models/operations/updatebudget.js +2 -2
  284. package/models/operations/updatecontact.js +2 -2
  285. package/models/operations/updatedatapoint.js +8 -8
  286. package/models/operations/updatedataset.js +2 -2
  287. package/models/operations/updatedatasource.js +2 -2
  288. package/models/operations/updateeval.d.ts +14 -79
  289. package/models/operations/updateeval.d.ts.map +1 -1
  290. package/models/operations/updateeval.js +51 -134
  291. package/models/operations/updateeval.js.map +1 -1
  292. package/models/operations/updatememorystore.d.ts +9 -20
  293. package/models/operations/updatememorystore.d.ts.map +1 -1
  294. package/models/operations/updatememorystore.js +9 -14
  295. package/models/operations/updatememorystore.js.map +1 -1
  296. package/models/operations/updateprompt.d.ts +18 -22
  297. package/models/operations/updateprompt.d.ts.map +1 -1
  298. package/models/operations/updateprompt.js +18 -22
  299. package/models/operations/updateprompt.js.map +1 -1
  300. package/models/operations/updatetool.js +14 -14
  301. package/package.json +1 -1
  302. package/sdk/agents.d.ts +5 -5
  303. package/sdk/agents.d.ts.map +1 -1
  304. package/sdk/agents.js +4 -4
  305. package/sdk/agents.js.map +1 -1
  306. package/sdk/evals.d.ts +4 -0
  307. package/sdk/evals.d.ts.map +1 -1
  308. package/sdk/evals.js +7 -0
  309. package/sdk/evals.js.map +1 -1
  310. package/sdk/responses.d.ts +1 -1
  311. package/sdk/responses.d.ts.map +1 -1
  312. package/sdk/responses.js +2 -2
  313. package/sdk/responses.js.map +1 -1
  314. package/src/funcs/agentsCreate.ts +4 -8
  315. package/src/funcs/agentsResponsesCreate.ts +4 -4
  316. package/src/funcs/agentsRun.ts +4 -7
  317. package/src/funcs/agentsStream.ts +4 -4
  318. package/src/funcs/agentsStreamRun.ts +4 -9
  319. package/src/funcs/agentsUpdate.ts +4 -4
  320. package/src/funcs/evalsInvoke.ts +177 -0
  321. package/src/lib/config.ts +3 -3
  322. package/src/mcp-server/mcp-server.ts +1 -1
  323. package/src/mcp-server/server.ts +3 -1
  324. package/src/mcp-server/tools/agentsCreate.ts +1 -1
  325. package/src/mcp-server/tools/agentsResponsesCreate.ts +2 -3
  326. package/src/mcp-server/tools/agentsRun.ts +1 -1
  327. package/src/mcp-server/tools/agentsStream.ts +2 -2
  328. package/src/mcp-server/tools/agentsStreamRun.ts +1 -1
  329. package/src/mcp-server/tools/agentsUpdate.ts +2 -3
  330. package/src/mcp-server/tools/evalsInvoke.ts +35 -0
  331. package/src/models/components/actionreviewedstreamingevent.ts +189 -0
  332. package/src/models/components/actionreviewrequestedstreamingevent.ts +326 -0
  333. package/src/models/components/agenterroredstreamingevent.ts +142 -0
  334. package/src/models/components/agentexecutionstartedstreamingevent.ts +145 -0
  335. package/src/models/components/agenthandedoffstreamingevent.ts +142 -0
  336. package/src/models/components/agentinactivestreamingevent.ts +857 -0
  337. package/src/models/components/agentmessagecreatedstreamingevent.ts +396 -0
  338. package/src/models/components/agentstartedstreamingevent.ts +909 -0
  339. package/src/models/components/agentthoughtstreamingevent.ts +1419 -0
  340. package/src/models/components/datapart.ts +71 -0
  341. package/src/models/components/errorstreamingevent.ts +129 -0
  342. package/src/models/components/executionnamedstreamingevent.ts +142 -0
  343. package/src/models/components/executionreviewedstreamingevent.ts +122 -0
  344. package/src/models/components/executionreviewrequiredstreamingevent.ts +130 -0
  345. package/src/models/components/filepart.ts +231 -0
  346. package/src/models/components/index.ts +22 -0
  347. package/src/models/components/invokedeploymentrequest.ts +66 -52
  348. package/src/models/components/textpart.ts +68 -0
  349. package/src/models/components/timeoutstreamingevent.ts +125 -0
  350. package/src/models/components/toolcallpart.ts +92 -0
  351. package/src/models/components/toolexecutionfailedstreamingevent.ts +406 -0
  352. package/src/models/components/toolexecutionfinishedstreamingevent.ts +373 -0
  353. package/src/models/components/toolexecutionstartedstreamingevent.ts +350 -0
  354. package/src/models/components/toolresultpart.ts +86 -0
  355. package/src/models/errors/index.ts +1 -0
  356. package/src/models/errors/invokeeval.ts +128 -0
  357. package/src/models/operations/createagentrequest.ts +3 -0
  358. package/src/models/operations/createagentresponserequest.ts +190 -397
  359. package/src/models/operations/createbudget.ts +2 -2
  360. package/src/models/operations/createcontact.ts +2 -2
  361. package/src/models/operations/createdataset.ts +2 -2
  362. package/src/models/operations/createdatasetitem.ts +8 -8
  363. package/src/models/operations/createdatasource.ts +2 -2
  364. package/src/models/operations/createeval.ts +318 -615
  365. package/src/models/operations/createprompt.ts +9 -11
  366. package/src/models/operations/createtool.ts +12 -12
  367. package/src/models/operations/deploymentgetconfig.ts +877 -685
  368. package/src/models/operations/deploymentinvoke.ts +44 -46
  369. package/src/models/operations/deployments.ts +45 -47
  370. package/src/models/operations/deploymentstream.ts +64 -49
  371. package/src/models/operations/fileget.ts +2 -2
  372. package/src/models/operations/filelist.ts +2 -2
  373. package/src/models/operations/fileupload.ts +2 -2
  374. package/src/models/operations/getallprompts.ts +9 -11
  375. package/src/models/operations/getalltools.ts +12 -12
  376. package/src/models/operations/getbudget.ts +2 -2
  377. package/src/models/operations/getevals.ts +52 -287
  378. package/src/models/operations/getoneprompt.ts +9 -11
  379. package/src/models/operations/getpromptversion.ts +9 -11
  380. package/src/models/operations/index.ts +1 -0
  381. package/src/models/operations/invokeagent.ts +180 -1041
  382. package/src/models/operations/invokeeval.ts +2062 -0
  383. package/src/models/operations/listagents.ts +3 -0
  384. package/src/models/operations/listbudgets.ts +2 -2
  385. package/src/models/operations/listcontacts.ts +2 -2
  386. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  387. package/src/models/operations/listdatasets.ts +2 -2
  388. package/src/models/operations/listdatasources.ts +2 -2
  389. package/src/models/operations/listknowledgebases.ts +82 -102
  390. package/src/models/operations/listpromptversions.ts +9 -11
  391. package/src/models/operations/retrieveagentrequest.ts +3 -0
  392. package/src/models/operations/retrievecontact.ts +2 -2
  393. package/src/models/operations/retrievedatapoint.ts +8 -8
  394. package/src/models/operations/retrievedataset.ts +2 -2
  395. package/src/models/operations/retrievedatasource.ts +2 -2
  396. package/src/models/operations/retrievetool.ts +12 -12
  397. package/src/models/operations/runagent.ts +238 -1140
  398. package/src/models/operations/streamagent.ts +780 -9308
  399. package/src/models/operations/streamrunagent.ts +3839 -12309
  400. package/src/models/operations/updateagent.ts +7 -6
  401. package/src/models/operations/updatebudget.ts +2 -2
  402. package/src/models/operations/updatecontact.ts +2 -2
  403. package/src/models/operations/updatedatapoint.ts +8 -8
  404. package/src/models/operations/updatedataset.ts +2 -2
  405. package/src/models/operations/updatedatasource.ts +2 -2
  406. package/src/models/operations/updateeval.ts +52 -287
  407. package/src/models/operations/updatememorystore.ts +9 -20
  408. package/src/models/operations/updateprompt.ts +18 -22
  409. package/src/models/operations/updatetool.ts +14 -14
  410. package/src/sdk/agents.ts +7 -7
  411. package/src/sdk/evals.ts +15 -0
  412. package/src/sdk/responses.ts +2 -2
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as components from "../components/index.js";
10
11
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
12
 
12
13
  /**
@@ -42,101 +43,13 @@ export type InvokeAgentRole =
42
43
  | InvokeAgentRoleUserMessage
43
44
  | InvokeAgentRoleToolMessage;
44
45
 
45
- export const InvokeAgentPublicMessagePartAgentsRequestKind = {
46
- ToolResult: "tool_result",
47
- } as const;
48
- export type InvokeAgentPublicMessagePartAgentsRequestKind = ClosedEnum<
49
- typeof InvokeAgentPublicMessagePartAgentsRequestKind
50
- >;
51
-
52
- /**
53
- * 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.
54
- */
55
- export type PublicMessagePartToolResultPart = {
56
- kind: InvokeAgentPublicMessagePartAgentsRequestKind;
57
- toolCallId: string;
58
- result?: any | undefined;
59
- metadata?: { [k: string]: any } | undefined;
60
- };
61
-
62
- export const InvokeAgentPublicMessagePartAgentsKind = {
63
- File: "file",
64
- } as const;
65
- export type InvokeAgentPublicMessagePartAgentsKind = ClosedEnum<
66
- typeof InvokeAgentPublicMessagePartAgentsKind
67
- >;
68
-
69
- /**
70
- * File in URI format. Check in the model's documentation for the supported mime types for the URI format
71
- */
72
- export type FileFileInURIFormat = {
73
- /**
74
- * URL for the File content
75
- */
76
- uri: string;
77
- /**
78
- * Optional mimeType for the file
79
- */
80
- mimeType?: string | undefined;
81
- /**
82
- * Optional name for the file
83
- */
84
- name?: string | undefined;
85
- };
86
-
87
- /**
88
- * Binary in base64 format. Check in the model's documentation for the supported mime types for the binary format.
89
- */
90
- export type FileBinaryFormat = {
91
- /**
92
- * base64 encoded content of the file
93
- */
94
- bytes: string;
95
- /**
96
- * Optional mimeType for the file
97
- */
98
- mimeType?: string | undefined;
99
- /**
100
- * Optional name for the file
101
- */
102
- name?: string | undefined;
103
- };
104
-
105
- export type InvokeAgentPublicMessagePartFile =
106
- | FileBinaryFormat
107
- | FileFileInURIFormat;
108
-
109
- /**
110
- * File attachment part. Use this to send files (images, documents, etc.) to the agent for processing.
111
- */
112
- export type PublicMessagePartFilePart = {
113
- kind: InvokeAgentPublicMessagePartAgentsKind;
114
- file: FileBinaryFormat | FileFileInURIFormat;
115
- metadata?: { [k: string]: any } | undefined;
116
- };
117
-
118
- export const InvokeAgentPublicMessagePartKind = {
119
- Text: "text",
120
- } as const;
121
- export type InvokeAgentPublicMessagePartKind = ClosedEnum<
122
- typeof InvokeAgentPublicMessagePartKind
123
- >;
124
-
125
- /**
126
- * Text content part. Use this to send text messages to the agent.
127
- */
128
- export type PublicMessagePartTextPart = {
129
- kind: InvokeAgentPublicMessagePartKind;
130
- text: string;
131
- };
132
-
133
46
  /**
134
47
  * 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.
135
48
  */
136
49
  export type InvokeAgentPublicMessagePart =
137
- | PublicMessagePartTextPart
138
- | PublicMessagePartFilePart
139
- | PublicMessagePartToolResultPart;
50
+ | components.TextPart
51
+ | components.FilePart
52
+ | components.ToolResultPart;
140
53
 
141
54
  /**
142
55
  * The A2A message to send to the agent (user input or tool results)
@@ -154,9 +67,7 @@ export type InvokeAgentA2AMessage = {
154
67
  * A2A message parts (text, file, or tool_result only)
155
68
  */
156
69
  parts: Array<
157
- | PublicMessagePartTextPart
158
- | PublicMessagePartFilePart
159
- | PublicMessagePartToolResultPart
70
+ components.TextPart | components.FilePart | components.ToolResultPart
160
71
  >;
161
72
  };
162
73
 
@@ -256,13 +167,13 @@ export type InvokeAgentRequest = {
256
167
  /**
257
168
  * A2A entity type identifier
258
169
  */
259
- export const InvokeAgentKind = {
170
+ export const Kind = {
260
171
  Task: "task",
261
172
  } as const;
262
173
  /**
263
174
  * A2A entity type identifier
264
175
  */
265
- export type InvokeAgentKind = ClosedEnum<typeof InvokeAgentKind>;
176
+ export type Kind = ClosedEnum<typeof Kind>;
266
177
 
267
178
  /**
268
179
  * Current state of the agent task execution. Values: submitted (queued), working (executing), input-required (awaiting user input), completed (finished successfully), failed (error occurred). Note: auth-required, canceled, and rejected statuses are defined for A2A protocol compatibility but are not currently supported in task execution.
@@ -282,10 +193,10 @@ export const TaskState = {
282
193
  */
283
194
  export type TaskState = ClosedEnum<typeof TaskState>;
284
195
 
285
- export const InvokeAgentAgentsKind = {
196
+ export const InvokeAgentKind = {
286
197
  Message: "message",
287
198
  } as const;
288
- export type InvokeAgentAgentsKind = ClosedEnum<typeof InvokeAgentAgentsKind>;
199
+ export type InvokeAgentKind = ClosedEnum<typeof InvokeAgentKind>;
289
200
 
290
201
  /**
291
202
  * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
@@ -301,147 +212,29 @@ export const ExtendedMessageRole = {
301
212
  */
302
213
  export type ExtendedMessageRole = ClosedEnum<typeof ExtendedMessageRole>;
303
214
 
304
- export const InvokeAgentPartsAgentsResponse200Kind = {
305
- ToolResult: "tool_result",
306
- } as const;
307
- export type InvokeAgentPartsAgentsResponse200Kind = ClosedEnum<
308
- typeof InvokeAgentPartsAgentsResponse200Kind
309
- >;
310
-
311
- /**
312
- * The result of a tool execution. Contains the tool call ID for correlation and the result data from the tool invocation.
313
- */
314
- export type PartsToolResultPart = {
315
- kind: InvokeAgentPartsAgentsResponse200Kind;
316
- toolCallId: string;
317
- result?: any | undefined;
318
- metadata?: { [k: string]: any } | undefined;
319
- };
320
-
321
- export const InvokeAgentPartsAgentsResponseKind = {
322
- ToolCall: "tool_call",
323
- } as const;
324
- export type InvokeAgentPartsAgentsResponseKind = ClosedEnum<
325
- typeof InvokeAgentPartsAgentsResponseKind
326
- >;
327
-
328
- /**
329
- * A tool invocation request from an agent. Contains the tool name, unique call ID, and arguments for the tool execution.
330
- */
331
- export type ToolCallPart = {
332
- kind: InvokeAgentPartsAgentsResponseKind;
333
- toolName: string;
334
- toolCallId: string;
335
- arguments: { [k: string]: any };
336
- metadata?: { [k: string]: any } | undefined;
337
- };
338
-
339
- export const InvokeAgentPartsAgentsKind = {
340
- File: "file",
341
- } as const;
342
- export type InvokeAgentPartsAgentsKind = ClosedEnum<
343
- typeof InvokeAgentPartsAgentsKind
344
- >;
345
-
346
- /**
347
- * File in URI format. Check in the model's documentation for the supported mime types for the URI format
348
- */
349
- export type InvokeAgentFileFileInURIFormat = {
350
- /**
351
- * URL for the File content
352
- */
353
- uri: string;
354
- /**
355
- * Optional mimeType for the file
356
- */
357
- mimeType?: string | undefined;
358
- /**
359
- * Optional name for the file
360
- */
361
- name?: string | undefined;
362
- };
363
-
364
- /**
365
- * Binary in base64 format. Check in the model's documentation for the supported mime types for the binary format.
366
- */
367
- export type InvokeAgentFileBinaryFormat = {
368
- /**
369
- * base64 encoded content of the file
370
- */
371
- bytes: string;
372
- /**
373
- * Optional mimeType for the file
374
- */
375
- mimeType?: string | undefined;
376
- /**
377
- * Optional name for the file
378
- */
379
- name?: string | undefined;
380
- };
381
-
382
- export type PartsFile =
383
- | InvokeAgentFileBinaryFormat
384
- | InvokeAgentFileFileInURIFormat;
385
-
386
- /**
387
- * 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.
388
- */
389
- export type PartsFilePart = {
390
- kind: InvokeAgentPartsAgentsKind;
391
- file: InvokeAgentFileBinaryFormat | InvokeAgentFileFileInURIFormat;
392
- metadata?: { [k: string]: any } | undefined;
393
- };
394
-
395
- export const InvokeAgentPartsKind = {
396
- Data: "data",
397
- } as const;
398
- export type InvokeAgentPartsKind = ClosedEnum<typeof InvokeAgentPartsKind>;
399
-
400
- /**
401
- * A structured data part containing JSON-serializable key-value pairs. Used for passing structured information between agents and tools.
402
- */
403
- export type DataPart = {
404
- kind: InvokeAgentPartsKind;
405
- data: { [k: string]: any };
406
- metadata?: { [k: string]: any } | undefined;
407
- };
408
-
409
- export const PartsKind = {
410
- Text: "text",
411
- } as const;
412
- export type PartsKind = ClosedEnum<typeof PartsKind>;
413
-
414
- /**
415
- * A text content part containing plain text or markdown. Used for agent messages, user input, and text-based responses.
416
- */
417
- export type PartsTextPart = {
418
- kind: PartsKind;
419
- text: string;
420
- };
421
-
422
- export type Parts =
423
- | ToolCallPart
424
- | PartsTextPart
425
- | DataPart
426
- | PartsFilePart
427
- | PartsToolResultPart;
215
+ export type InvokeAgentParts =
216
+ | (components.ToolCallPart & { kind: "tool_call" })
217
+ | (components.TextPart & { kind: "text" })
218
+ | (components.DataPart & { kind: "data" })
219
+ | (components.FilePart & { kind: "file" })
220
+ | (components.ToolResultPart & { kind: "tool_result" });
428
221
 
429
222
  /**
430
223
  * Optional A2A message providing additional context about the current status
431
224
  */
432
225
  export type TaskStatusMessage = {
433
- kind: InvokeAgentAgentsKind;
226
+ kind: InvokeAgentKind;
434
227
  messageId: string;
435
228
  /**
436
229
  * Role of the message sender in the A2A protocol. Values: user (end user), agent (AI agent), tool (tool execution result), system (system instructions/prompts).
437
230
  */
438
231
  role: ExtendedMessageRole;
439
232
  parts: Array<
440
- | ToolCallPart
441
- | PartsTextPart
442
- | DataPart
443
- | PartsFilePart
444
- | PartsToolResultPart
233
+ | (components.ToolCallPart & { kind: "tool_call" })
234
+ | (components.TextPart & { kind: "text" })
235
+ | (components.DataPart & { kind: "data" })
236
+ | (components.FilePart & { kind: "file" })
237
+ | (components.ToolResultPart & { kind: "tool_result" })
445
238
  >;
446
239
  };
447
240
 
@@ -478,7 +271,7 @@ export type InvokeAgentA2ATaskResponse = {
478
271
  /**
479
272
  * A2A entity type identifier
480
273
  */
481
- kind: InvokeAgentKind;
274
+ kind: Kind;
482
275
  /**
483
276
  * Current task status information
484
277
  */
@@ -523,336 +316,24 @@ export type InvokeAgentRole$Outbound = string | string;
523
316
  export const InvokeAgentRole$outboundSchema: z.ZodType<
524
317
  InvokeAgentRole$Outbound,
525
318
  z.ZodTypeDef,
526
- InvokeAgentRole
527
- > = z.union([
528
- InvokeAgentRoleUserMessage$outboundSchema,
529
- InvokeAgentRoleToolMessage$outboundSchema,
530
- ]);
531
-
532
- export function invokeAgentRoleToJSON(
533
- invokeAgentRole: InvokeAgentRole,
534
- ): string {
535
- return JSON.stringify(InvokeAgentRole$outboundSchema.parse(invokeAgentRole));
536
- }
537
- export function invokeAgentRoleFromJSON(
538
- jsonString: string,
539
- ): SafeParseResult<InvokeAgentRole, SDKValidationError> {
540
- return safeParse(
541
- jsonString,
542
- (x) => InvokeAgentRole$inboundSchema.parse(JSON.parse(x)),
543
- `Failed to parse 'InvokeAgentRole' from JSON`,
544
- );
545
- }
546
-
547
- /** @internal */
548
- export const InvokeAgentPublicMessagePartAgentsRequestKind$inboundSchema:
549
- z.ZodNativeEnum<typeof InvokeAgentPublicMessagePartAgentsRequestKind> = z
550
- .nativeEnum(InvokeAgentPublicMessagePartAgentsRequestKind);
551
- /** @internal */
552
- export const InvokeAgentPublicMessagePartAgentsRequestKind$outboundSchema:
553
- z.ZodNativeEnum<typeof InvokeAgentPublicMessagePartAgentsRequestKind> =
554
- InvokeAgentPublicMessagePartAgentsRequestKind$inboundSchema;
555
-
556
- /** @internal */
557
- export const PublicMessagePartToolResultPart$inboundSchema: z.ZodType<
558
- PublicMessagePartToolResultPart,
559
- z.ZodTypeDef,
560
- unknown
561
- > = z.object({
562
- kind: InvokeAgentPublicMessagePartAgentsRequestKind$inboundSchema,
563
- tool_call_id: z.string(),
564
- result: z.any().optional(),
565
- metadata: z.record(z.any()).optional(),
566
- }).transform((v) => {
567
- return remap$(v, {
568
- "tool_call_id": "toolCallId",
569
- });
570
- });
571
- /** @internal */
572
- export type PublicMessagePartToolResultPart$Outbound = {
573
- kind: string;
574
- tool_call_id: string;
575
- result?: any | undefined;
576
- metadata?: { [k: string]: any } | undefined;
577
- };
578
-
579
- /** @internal */
580
- export const PublicMessagePartToolResultPart$outboundSchema: z.ZodType<
581
- PublicMessagePartToolResultPart$Outbound,
582
- z.ZodTypeDef,
583
- PublicMessagePartToolResultPart
584
- > = z.object({
585
- kind: InvokeAgentPublicMessagePartAgentsRequestKind$outboundSchema,
586
- toolCallId: z.string(),
587
- result: z.any().optional(),
588
- metadata: z.record(z.any()).optional(),
589
- }).transform((v) => {
590
- return remap$(v, {
591
- toolCallId: "tool_call_id",
592
- });
593
- });
594
-
595
- export function publicMessagePartToolResultPartToJSON(
596
- publicMessagePartToolResultPart: PublicMessagePartToolResultPart,
597
- ): string {
598
- return JSON.stringify(
599
- PublicMessagePartToolResultPart$outboundSchema.parse(
600
- publicMessagePartToolResultPart,
601
- ),
602
- );
603
- }
604
- export function publicMessagePartToolResultPartFromJSON(
605
- jsonString: string,
606
- ): SafeParseResult<PublicMessagePartToolResultPart, SDKValidationError> {
607
- return safeParse(
608
- jsonString,
609
- (x) => PublicMessagePartToolResultPart$inboundSchema.parse(JSON.parse(x)),
610
- `Failed to parse 'PublicMessagePartToolResultPart' from JSON`,
611
- );
612
- }
613
-
614
- /** @internal */
615
- export const InvokeAgentPublicMessagePartAgentsKind$inboundSchema:
616
- z.ZodNativeEnum<typeof InvokeAgentPublicMessagePartAgentsKind> = z.nativeEnum(
617
- InvokeAgentPublicMessagePartAgentsKind,
618
- );
619
- /** @internal */
620
- export const InvokeAgentPublicMessagePartAgentsKind$outboundSchema:
621
- z.ZodNativeEnum<typeof InvokeAgentPublicMessagePartAgentsKind> =
622
- InvokeAgentPublicMessagePartAgentsKind$inboundSchema;
623
-
624
- /** @internal */
625
- export const FileFileInURIFormat$inboundSchema: z.ZodType<
626
- FileFileInURIFormat,
627
- z.ZodTypeDef,
628
- unknown
629
- > = z.object({
630
- uri: z.string(),
631
- mimeType: z.string().optional(),
632
- name: z.string().optional(),
633
- });
634
- /** @internal */
635
- export type FileFileInURIFormat$Outbound = {
636
- uri: string;
637
- mimeType?: string | undefined;
638
- name?: string | undefined;
639
- };
640
-
641
- /** @internal */
642
- export const FileFileInURIFormat$outboundSchema: z.ZodType<
643
- FileFileInURIFormat$Outbound,
644
- z.ZodTypeDef,
645
- FileFileInURIFormat
646
- > = z.object({
647
- uri: z.string(),
648
- mimeType: z.string().optional(),
649
- name: z.string().optional(),
650
- });
651
-
652
- export function fileFileInURIFormatToJSON(
653
- fileFileInURIFormat: FileFileInURIFormat,
654
- ): string {
655
- return JSON.stringify(
656
- FileFileInURIFormat$outboundSchema.parse(fileFileInURIFormat),
657
- );
658
- }
659
- export function fileFileInURIFormatFromJSON(
660
- jsonString: string,
661
- ): SafeParseResult<FileFileInURIFormat, SDKValidationError> {
662
- return safeParse(
663
- jsonString,
664
- (x) => FileFileInURIFormat$inboundSchema.parse(JSON.parse(x)),
665
- `Failed to parse 'FileFileInURIFormat' from JSON`,
666
- );
667
- }
668
-
669
- /** @internal */
670
- export const FileBinaryFormat$inboundSchema: z.ZodType<
671
- FileBinaryFormat,
672
- z.ZodTypeDef,
673
- unknown
674
- > = z.object({
675
- bytes: z.string(),
676
- mimeType: z.string().optional(),
677
- name: z.string().optional(),
678
- });
679
- /** @internal */
680
- export type FileBinaryFormat$Outbound = {
681
- bytes: string;
682
- mimeType?: string | undefined;
683
- name?: string | undefined;
684
- };
685
-
686
- /** @internal */
687
- export const FileBinaryFormat$outboundSchema: z.ZodType<
688
- FileBinaryFormat$Outbound,
689
- z.ZodTypeDef,
690
- FileBinaryFormat
691
- > = z.object({
692
- bytes: z.string(),
693
- mimeType: z.string().optional(),
694
- name: z.string().optional(),
695
- });
696
-
697
- export function fileBinaryFormatToJSON(
698
- fileBinaryFormat: FileBinaryFormat,
699
- ): string {
700
- return JSON.stringify(
701
- FileBinaryFormat$outboundSchema.parse(fileBinaryFormat),
702
- );
703
- }
704
- export function fileBinaryFormatFromJSON(
705
- jsonString: string,
706
- ): SafeParseResult<FileBinaryFormat, SDKValidationError> {
707
- return safeParse(
708
- jsonString,
709
- (x) => FileBinaryFormat$inboundSchema.parse(JSON.parse(x)),
710
- `Failed to parse 'FileBinaryFormat' from JSON`,
711
- );
712
- }
713
-
714
- /** @internal */
715
- export const InvokeAgentPublicMessagePartFile$inboundSchema: z.ZodType<
716
- InvokeAgentPublicMessagePartFile,
717
- z.ZodTypeDef,
718
- unknown
719
- > = z.union([
720
- z.lazy(() => FileBinaryFormat$inboundSchema),
721
- z.lazy(() => FileFileInURIFormat$inboundSchema),
722
- ]);
723
- /** @internal */
724
- export type InvokeAgentPublicMessagePartFile$Outbound =
725
- | FileBinaryFormat$Outbound
726
- | FileFileInURIFormat$Outbound;
727
-
728
- /** @internal */
729
- export const InvokeAgentPublicMessagePartFile$outboundSchema: z.ZodType<
730
- InvokeAgentPublicMessagePartFile$Outbound,
731
- z.ZodTypeDef,
732
- InvokeAgentPublicMessagePartFile
733
- > = z.union([
734
- z.lazy(() => FileBinaryFormat$outboundSchema),
735
- z.lazy(() => FileFileInURIFormat$outboundSchema),
736
- ]);
737
-
738
- export function invokeAgentPublicMessagePartFileToJSON(
739
- invokeAgentPublicMessagePartFile: InvokeAgentPublicMessagePartFile,
740
- ): string {
741
- return JSON.stringify(
742
- InvokeAgentPublicMessagePartFile$outboundSchema.parse(
743
- invokeAgentPublicMessagePartFile,
744
- ),
745
- );
746
- }
747
- export function invokeAgentPublicMessagePartFileFromJSON(
748
- jsonString: string,
749
- ): SafeParseResult<InvokeAgentPublicMessagePartFile, SDKValidationError> {
750
- return safeParse(
751
- jsonString,
752
- (x) => InvokeAgentPublicMessagePartFile$inboundSchema.parse(JSON.parse(x)),
753
- `Failed to parse 'InvokeAgentPublicMessagePartFile' from JSON`,
754
- );
755
- }
756
-
757
- /** @internal */
758
- export const PublicMessagePartFilePart$inboundSchema: z.ZodType<
759
- PublicMessagePartFilePart,
760
- z.ZodTypeDef,
761
- unknown
762
- > = z.object({
763
- kind: InvokeAgentPublicMessagePartAgentsKind$inboundSchema,
764
- file: z.union([
765
- z.lazy(() => FileBinaryFormat$inboundSchema),
766
- z.lazy(() => FileFileInURIFormat$inboundSchema),
767
- ]),
768
- metadata: z.record(z.any()).optional(),
769
- });
770
- /** @internal */
771
- export type PublicMessagePartFilePart$Outbound = {
772
- kind: string;
773
- file: FileBinaryFormat$Outbound | FileFileInURIFormat$Outbound;
774
- metadata?: { [k: string]: any } | undefined;
775
- };
776
-
777
- /** @internal */
778
- export const PublicMessagePartFilePart$outboundSchema: z.ZodType<
779
- PublicMessagePartFilePart$Outbound,
780
- z.ZodTypeDef,
781
- PublicMessagePartFilePart
782
- > = z.object({
783
- kind: InvokeAgentPublicMessagePartAgentsKind$outboundSchema,
784
- file: z.union([
785
- z.lazy(() => FileBinaryFormat$outboundSchema),
786
- z.lazy(() => FileFileInURIFormat$outboundSchema),
787
- ]),
788
- metadata: z.record(z.any()).optional(),
789
- });
790
-
791
- export function publicMessagePartFilePartToJSON(
792
- publicMessagePartFilePart: PublicMessagePartFilePart,
793
- ): string {
794
- return JSON.stringify(
795
- PublicMessagePartFilePart$outboundSchema.parse(publicMessagePartFilePart),
796
- );
797
- }
798
- export function publicMessagePartFilePartFromJSON(
799
- jsonString: string,
800
- ): SafeParseResult<PublicMessagePartFilePart, SDKValidationError> {
801
- return safeParse(
802
- jsonString,
803
- (x) => PublicMessagePartFilePart$inboundSchema.parse(JSON.parse(x)),
804
- `Failed to parse 'PublicMessagePartFilePart' from JSON`,
805
- );
806
- }
807
-
808
- /** @internal */
809
- export const InvokeAgentPublicMessagePartKind$inboundSchema: z.ZodNativeEnum<
810
- typeof InvokeAgentPublicMessagePartKind
811
- > = z.nativeEnum(InvokeAgentPublicMessagePartKind);
812
- /** @internal */
813
- export const InvokeAgentPublicMessagePartKind$outboundSchema: z.ZodNativeEnum<
814
- typeof InvokeAgentPublicMessagePartKind
815
- > = InvokeAgentPublicMessagePartKind$inboundSchema;
816
-
817
- /** @internal */
818
- export const PublicMessagePartTextPart$inboundSchema: z.ZodType<
819
- PublicMessagePartTextPart,
820
- z.ZodTypeDef,
821
- unknown
822
- > = z.object({
823
- kind: InvokeAgentPublicMessagePartKind$inboundSchema,
824
- text: z.string(),
825
- });
826
- /** @internal */
827
- export type PublicMessagePartTextPart$Outbound = {
828
- kind: string;
829
- text: string;
830
- };
831
-
832
- /** @internal */
833
- export const PublicMessagePartTextPart$outboundSchema: z.ZodType<
834
- PublicMessagePartTextPart$Outbound,
835
- z.ZodTypeDef,
836
- PublicMessagePartTextPart
837
- > = z.object({
838
- kind: InvokeAgentPublicMessagePartKind$outboundSchema,
839
- text: z.string(),
840
- });
319
+ InvokeAgentRole
320
+ > = z.union([
321
+ InvokeAgentRoleUserMessage$outboundSchema,
322
+ InvokeAgentRoleToolMessage$outboundSchema,
323
+ ]);
841
324
 
842
- export function publicMessagePartTextPartToJSON(
843
- publicMessagePartTextPart: PublicMessagePartTextPart,
325
+ export function invokeAgentRoleToJSON(
326
+ invokeAgentRole: InvokeAgentRole,
844
327
  ): string {
845
- return JSON.stringify(
846
- PublicMessagePartTextPart$outboundSchema.parse(publicMessagePartTextPart),
847
- );
328
+ return JSON.stringify(InvokeAgentRole$outboundSchema.parse(invokeAgentRole));
848
329
  }
849
- export function publicMessagePartTextPartFromJSON(
330
+ export function invokeAgentRoleFromJSON(
850
331
  jsonString: string,
851
- ): SafeParseResult<PublicMessagePartTextPart, SDKValidationError> {
332
+ ): SafeParseResult<InvokeAgentRole, SDKValidationError> {
852
333
  return safeParse(
853
334
  jsonString,
854
- (x) => PublicMessagePartTextPart$inboundSchema.parse(JSON.parse(x)),
855
- `Failed to parse 'PublicMessagePartTextPart' from JSON`,
335
+ (x) => InvokeAgentRole$inboundSchema.parse(JSON.parse(x)),
336
+ `Failed to parse 'InvokeAgentRole' from JSON`,
856
337
  );
857
338
  }
858
339
 
@@ -862,15 +343,15 @@ export const InvokeAgentPublicMessagePart$inboundSchema: z.ZodType<
862
343
  z.ZodTypeDef,
863
344
  unknown
864
345
  > = z.union([
865
- z.lazy(() => PublicMessagePartTextPart$inboundSchema),
866
- z.lazy(() => PublicMessagePartFilePart$inboundSchema),
867
- z.lazy(() => PublicMessagePartToolResultPart$inboundSchema),
346
+ components.TextPart$inboundSchema,
347
+ components.FilePart$inboundSchema,
348
+ components.ToolResultPart$inboundSchema,
868
349
  ]);
869
350
  /** @internal */
870
351
  export type InvokeAgentPublicMessagePart$Outbound =
871
- | PublicMessagePartTextPart$Outbound
872
- | PublicMessagePartFilePart$Outbound
873
- | PublicMessagePartToolResultPart$Outbound;
352
+ | components.TextPart$Outbound
353
+ | components.FilePart$Outbound
354
+ | components.ToolResultPart$Outbound;
874
355
 
875
356
  /** @internal */
876
357
  export const InvokeAgentPublicMessagePart$outboundSchema: z.ZodType<
@@ -878,9 +359,9 @@ export const InvokeAgentPublicMessagePart$outboundSchema: z.ZodType<
878
359
  z.ZodTypeDef,
879
360
  InvokeAgentPublicMessagePart
880
361
  > = z.union([
881
- z.lazy(() => PublicMessagePartTextPart$outboundSchema),
882
- z.lazy(() => PublicMessagePartFilePart$outboundSchema),
883
- z.lazy(() => PublicMessagePartToolResultPart$outboundSchema),
362
+ components.TextPart$outboundSchema,
363
+ components.FilePart$outboundSchema,
364
+ components.ToolResultPart$outboundSchema,
884
365
  ]);
885
366
 
886
367
  export function invokeAgentPublicMessagePartToJSON(
@@ -915,9 +396,9 @@ export const InvokeAgentA2AMessage$inboundSchema: z.ZodType<
915
396
  ]),
916
397
  parts: z.array(
917
398
  z.union([
918
- z.lazy(() => PublicMessagePartTextPart$inboundSchema),
919
- z.lazy(() => PublicMessagePartFilePart$inboundSchema),
920
- z.lazy(() => PublicMessagePartToolResultPart$inboundSchema),
399
+ components.TextPart$inboundSchema,
400
+ components.FilePart$inboundSchema,
401
+ components.ToolResultPart$inboundSchema,
921
402
  ]),
922
403
  ),
923
404
  });
@@ -926,9 +407,9 @@ export type InvokeAgentA2AMessage$Outbound = {
926
407
  messageId?: string | undefined;
927
408
  role: string | string;
928
409
  parts: Array<
929
- | PublicMessagePartTextPart$Outbound
930
- | PublicMessagePartFilePart$Outbound
931
- | PublicMessagePartToolResultPart$Outbound
410
+ | components.TextPart$Outbound
411
+ | components.FilePart$Outbound
412
+ | components.ToolResultPart$Outbound
932
413
  >;
933
414
  };
934
415
 
@@ -945,9 +426,9 @@ export const InvokeAgentA2AMessage$outboundSchema: z.ZodType<
945
426
  ]),
946
427
  parts: z.array(
947
428
  z.union([
948
- z.lazy(() => PublicMessagePartTextPart$outboundSchema),
949
- z.lazy(() => PublicMessagePartFilePart$outboundSchema),
950
- z.lazy(() => PublicMessagePartToolResultPart$outboundSchema),
429
+ components.TextPart$outboundSchema,
430
+ components.FilePart$outboundSchema,
431
+ components.ToolResultPart$outboundSchema,
951
432
  ]),
952
433
  ),
953
434
  });
@@ -1238,13 +719,12 @@ export function invokeAgentRequestFromJSON(
1238
719
  }
1239
720
 
1240
721
  /** @internal */
1241
- export const InvokeAgentKind$inboundSchema: z.ZodNativeEnum<
1242
- typeof InvokeAgentKind
1243
- > = z.nativeEnum(InvokeAgentKind);
722
+ export const Kind$inboundSchema: z.ZodNativeEnum<typeof Kind> = z.nativeEnum(
723
+ Kind,
724
+ );
1244
725
  /** @internal */
1245
- export const InvokeAgentKind$outboundSchema: z.ZodNativeEnum<
1246
- typeof InvokeAgentKind
1247
- > = InvokeAgentKind$inboundSchema;
726
+ export const Kind$outboundSchema: z.ZodNativeEnum<typeof Kind> =
727
+ Kind$inboundSchema;
1248
728
 
1249
729
  /** @internal */
1250
730
  export const TaskState$inboundSchema: z.ZodNativeEnum<typeof TaskState> = z
@@ -1254,13 +734,13 @@ export const TaskState$outboundSchema: z.ZodNativeEnum<typeof TaskState> =
1254
734
  TaskState$inboundSchema;
1255
735
 
1256
736
  /** @internal */
1257
- export const InvokeAgentAgentsKind$inboundSchema: z.ZodNativeEnum<
1258
- typeof InvokeAgentAgentsKind
1259
- > = z.nativeEnum(InvokeAgentAgentsKind);
737
+ export const InvokeAgentKind$inboundSchema: z.ZodNativeEnum<
738
+ typeof InvokeAgentKind
739
+ > = z.nativeEnum(InvokeAgentKind);
1260
740
  /** @internal */
1261
- export const InvokeAgentAgentsKind$outboundSchema: z.ZodNativeEnum<
1262
- typeof InvokeAgentAgentsKind
1263
- > = InvokeAgentAgentsKind$inboundSchema;
741
+ export const InvokeAgentKind$outboundSchema: z.ZodNativeEnum<
742
+ typeof InvokeAgentKind
743
+ > = InvokeAgentKind$inboundSchema;
1264
744
 
1265
745
  /** @internal */
1266
746
  export const ExtendedMessageRole$inboundSchema: z.ZodNativeEnum<
@@ -1272,461 +752,80 @@ export const ExtendedMessageRole$outboundSchema: z.ZodNativeEnum<
1272
752
  > = ExtendedMessageRole$inboundSchema;
1273
753
 
1274
754
  /** @internal */
1275
- export const InvokeAgentPartsAgentsResponse200Kind$inboundSchema:
1276
- z.ZodNativeEnum<typeof InvokeAgentPartsAgentsResponse200Kind> = z.nativeEnum(
1277
- InvokeAgentPartsAgentsResponse200Kind,
1278
- );
1279
- /** @internal */
1280
- export const InvokeAgentPartsAgentsResponse200Kind$outboundSchema:
1281
- z.ZodNativeEnum<typeof InvokeAgentPartsAgentsResponse200Kind> =
1282
- InvokeAgentPartsAgentsResponse200Kind$inboundSchema;
1283
-
1284
- /** @internal */
1285
- export const PartsToolResultPart$inboundSchema: z.ZodType<
1286
- PartsToolResultPart,
1287
- z.ZodTypeDef,
1288
- unknown
1289
- > = z.object({
1290
- kind: InvokeAgentPartsAgentsResponse200Kind$inboundSchema,
1291
- tool_call_id: z.string(),
1292
- result: z.any().optional(),
1293
- metadata: z.record(z.any()).optional(),
1294
- }).transform((v) => {
1295
- return remap$(v, {
1296
- "tool_call_id": "toolCallId",
1297
- });
1298
- });
1299
- /** @internal */
1300
- export type PartsToolResultPart$Outbound = {
1301
- kind: string;
1302
- tool_call_id: string;
1303
- result?: any | undefined;
1304
- metadata?: { [k: string]: any } | undefined;
1305
- };
1306
-
1307
- /** @internal */
1308
- export const PartsToolResultPart$outboundSchema: z.ZodType<
1309
- PartsToolResultPart$Outbound,
1310
- z.ZodTypeDef,
1311
- PartsToolResultPart
1312
- > = z.object({
1313
- kind: InvokeAgentPartsAgentsResponse200Kind$outboundSchema,
1314
- toolCallId: z.string(),
1315
- result: z.any().optional(),
1316
- metadata: z.record(z.any()).optional(),
1317
- }).transform((v) => {
1318
- return remap$(v, {
1319
- toolCallId: "tool_call_id",
1320
- });
1321
- });
1322
-
1323
- export function partsToolResultPartToJSON(
1324
- partsToolResultPart: PartsToolResultPart,
1325
- ): string {
1326
- return JSON.stringify(
1327
- PartsToolResultPart$outboundSchema.parse(partsToolResultPart),
1328
- );
1329
- }
1330
- export function partsToolResultPartFromJSON(
1331
- jsonString: string,
1332
- ): SafeParseResult<PartsToolResultPart, SDKValidationError> {
1333
- return safeParse(
1334
- jsonString,
1335
- (x) => PartsToolResultPart$inboundSchema.parse(JSON.parse(x)),
1336
- `Failed to parse 'PartsToolResultPart' from JSON`,
1337
- );
1338
- }
1339
-
1340
- /** @internal */
1341
- export const InvokeAgentPartsAgentsResponseKind$inboundSchema: z.ZodNativeEnum<
1342
- typeof InvokeAgentPartsAgentsResponseKind
1343
- > = z.nativeEnum(InvokeAgentPartsAgentsResponseKind);
1344
- /** @internal */
1345
- export const InvokeAgentPartsAgentsResponseKind$outboundSchema: z.ZodNativeEnum<
1346
- typeof InvokeAgentPartsAgentsResponseKind
1347
- > = InvokeAgentPartsAgentsResponseKind$inboundSchema;
1348
-
1349
- /** @internal */
1350
- export const ToolCallPart$inboundSchema: z.ZodType<
1351
- ToolCallPart,
1352
- z.ZodTypeDef,
1353
- unknown
1354
- > = z.object({
1355
- kind: InvokeAgentPartsAgentsResponseKind$inboundSchema,
1356
- tool_name: z.string(),
1357
- tool_call_id: z.string(),
1358
- arguments: z.record(z.any()),
1359
- metadata: z.record(z.any()).optional(),
1360
- }).transform((v) => {
1361
- return remap$(v, {
1362
- "tool_name": "toolName",
1363
- "tool_call_id": "toolCallId",
1364
- });
1365
- });
1366
- /** @internal */
1367
- export type ToolCallPart$Outbound = {
1368
- kind: string;
1369
- tool_name: string;
1370
- tool_call_id: string;
1371
- arguments: { [k: string]: any };
1372
- metadata?: { [k: string]: any } | undefined;
1373
- };
1374
-
1375
- /** @internal */
1376
- export const ToolCallPart$outboundSchema: z.ZodType<
1377
- ToolCallPart$Outbound,
1378
- z.ZodTypeDef,
1379
- ToolCallPart
1380
- > = z.object({
1381
- kind: InvokeAgentPartsAgentsResponseKind$outboundSchema,
1382
- toolName: z.string(),
1383
- toolCallId: z.string(),
1384
- arguments: z.record(z.any()),
1385
- metadata: z.record(z.any()).optional(),
1386
- }).transform((v) => {
1387
- return remap$(v, {
1388
- toolName: "tool_name",
1389
- toolCallId: "tool_call_id",
1390
- });
1391
- });
1392
-
1393
- export function toolCallPartToJSON(toolCallPart: ToolCallPart): string {
1394
- return JSON.stringify(ToolCallPart$outboundSchema.parse(toolCallPart));
1395
- }
1396
- export function toolCallPartFromJSON(
1397
- jsonString: string,
1398
- ): SafeParseResult<ToolCallPart, SDKValidationError> {
1399
- return safeParse(
1400
- jsonString,
1401
- (x) => ToolCallPart$inboundSchema.parse(JSON.parse(x)),
1402
- `Failed to parse 'ToolCallPart' from JSON`,
1403
- );
1404
- }
1405
-
1406
- /** @internal */
1407
- export const InvokeAgentPartsAgentsKind$inboundSchema: z.ZodNativeEnum<
1408
- typeof InvokeAgentPartsAgentsKind
1409
- > = z.nativeEnum(InvokeAgentPartsAgentsKind);
1410
- /** @internal */
1411
- export const InvokeAgentPartsAgentsKind$outboundSchema: z.ZodNativeEnum<
1412
- typeof InvokeAgentPartsAgentsKind
1413
- > = InvokeAgentPartsAgentsKind$inboundSchema;
1414
-
1415
- /** @internal */
1416
- export const InvokeAgentFileFileInURIFormat$inboundSchema: z.ZodType<
1417
- InvokeAgentFileFileInURIFormat,
1418
- z.ZodTypeDef,
1419
- unknown
1420
- > = z.object({
1421
- uri: z.string(),
1422
- mimeType: z.string().optional(),
1423
- name: z.string().optional(),
1424
- });
1425
- /** @internal */
1426
- export type InvokeAgentFileFileInURIFormat$Outbound = {
1427
- uri: string;
1428
- mimeType?: string | undefined;
1429
- name?: string | undefined;
1430
- };
1431
-
1432
- /** @internal */
1433
- export const InvokeAgentFileFileInURIFormat$outboundSchema: z.ZodType<
1434
- InvokeAgentFileFileInURIFormat$Outbound,
1435
- z.ZodTypeDef,
1436
- InvokeAgentFileFileInURIFormat
1437
- > = z.object({
1438
- uri: z.string(),
1439
- mimeType: z.string().optional(),
1440
- name: z.string().optional(),
1441
- });
1442
-
1443
- export function invokeAgentFileFileInURIFormatToJSON(
1444
- invokeAgentFileFileInURIFormat: InvokeAgentFileFileInURIFormat,
1445
- ): string {
1446
- return JSON.stringify(
1447
- InvokeAgentFileFileInURIFormat$outboundSchema.parse(
1448
- invokeAgentFileFileInURIFormat,
1449
- ),
1450
- );
1451
- }
1452
- export function invokeAgentFileFileInURIFormatFromJSON(
1453
- jsonString: string,
1454
- ): SafeParseResult<InvokeAgentFileFileInURIFormat, SDKValidationError> {
1455
- return safeParse(
1456
- jsonString,
1457
- (x) => InvokeAgentFileFileInURIFormat$inboundSchema.parse(JSON.parse(x)),
1458
- `Failed to parse 'InvokeAgentFileFileInURIFormat' from JSON`,
1459
- );
1460
- }
1461
-
1462
- /** @internal */
1463
- export const InvokeAgentFileBinaryFormat$inboundSchema: z.ZodType<
1464
- InvokeAgentFileBinaryFormat,
1465
- z.ZodTypeDef,
1466
- unknown
1467
- > = z.object({
1468
- bytes: z.string(),
1469
- mimeType: z.string().optional(),
1470
- name: z.string().optional(),
1471
- });
1472
- /** @internal */
1473
- export type InvokeAgentFileBinaryFormat$Outbound = {
1474
- bytes: string;
1475
- mimeType?: string | undefined;
1476
- name?: string | undefined;
1477
- };
1478
-
1479
- /** @internal */
1480
- export const InvokeAgentFileBinaryFormat$outboundSchema: z.ZodType<
1481
- InvokeAgentFileBinaryFormat$Outbound,
1482
- z.ZodTypeDef,
1483
- InvokeAgentFileBinaryFormat
1484
- > = z.object({
1485
- bytes: z.string(),
1486
- mimeType: z.string().optional(),
1487
- name: z.string().optional(),
1488
- });
1489
-
1490
- export function invokeAgentFileBinaryFormatToJSON(
1491
- invokeAgentFileBinaryFormat: InvokeAgentFileBinaryFormat,
1492
- ): string {
1493
- return JSON.stringify(
1494
- InvokeAgentFileBinaryFormat$outboundSchema.parse(
1495
- invokeAgentFileBinaryFormat,
1496
- ),
1497
- );
1498
- }
1499
- export function invokeAgentFileBinaryFormatFromJSON(
1500
- jsonString: string,
1501
- ): SafeParseResult<InvokeAgentFileBinaryFormat, SDKValidationError> {
1502
- return safeParse(
1503
- jsonString,
1504
- (x) => InvokeAgentFileBinaryFormat$inboundSchema.parse(JSON.parse(x)),
1505
- `Failed to parse 'InvokeAgentFileBinaryFormat' from JSON`,
1506
- );
1507
- }
1508
-
1509
- /** @internal */
1510
- export const PartsFile$inboundSchema: z.ZodType<
1511
- PartsFile,
755
+ export const InvokeAgentParts$inboundSchema: z.ZodType<
756
+ InvokeAgentParts,
1512
757
  z.ZodTypeDef,
1513
758
  unknown
1514
759
  > = z.union([
1515
- z.lazy(() => InvokeAgentFileBinaryFormat$inboundSchema),
1516
- z.lazy(() => InvokeAgentFileFileInURIFormat$inboundSchema),
760
+ components.ToolCallPart$inboundSchema.and(
761
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
762
+ kind: v.kind,
763
+ })),
764
+ ),
765
+ components.TextPart$inboundSchema.and(
766
+ z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind })),
767
+ ),
768
+ components.DataPart$inboundSchema.and(
769
+ z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind })),
770
+ ),
771
+ components.FilePart$inboundSchema.and(
772
+ z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind })),
773
+ ),
774
+ components.ToolResultPart$inboundSchema.and(
775
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
776
+ kind: v.kind,
777
+ })),
778
+ ),
1517
779
  ]);
1518
780
  /** @internal */
1519
- export type PartsFile$Outbound =
1520
- | InvokeAgentFileBinaryFormat$Outbound
1521
- | InvokeAgentFileFileInURIFormat$Outbound;
781
+ export type InvokeAgentParts$Outbound =
782
+ | (components.ToolCallPart$Outbound & { kind: "tool_call" })
783
+ | (components.TextPart$Outbound & { kind: "text" })
784
+ | (components.DataPart$Outbound & { kind: "data" })
785
+ | (components.FilePart$Outbound & { kind: "file" })
786
+ | (components.ToolResultPart$Outbound & { kind: "tool_result" });
1522
787
 
1523
788
  /** @internal */
1524
- export const PartsFile$outboundSchema: z.ZodType<
1525
- PartsFile$Outbound,
789
+ export const InvokeAgentParts$outboundSchema: z.ZodType<
790
+ InvokeAgentParts$Outbound,
1526
791
  z.ZodTypeDef,
1527
- PartsFile
792
+ InvokeAgentParts
1528
793
  > = z.union([
1529
- z.lazy(() => InvokeAgentFileBinaryFormat$outboundSchema),
1530
- z.lazy(() => InvokeAgentFileFileInURIFormat$outboundSchema),
794
+ components.ToolCallPart$outboundSchema.and(
795
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
796
+ kind: v.kind,
797
+ })),
798
+ ),
799
+ components.TextPart$outboundSchema.and(
800
+ z.object({ kind: z.literal("text") }).transform((v) => ({ kind: v.kind })),
801
+ ),
802
+ components.DataPart$outboundSchema.and(
803
+ z.object({ kind: z.literal("data") }).transform((v) => ({ kind: v.kind })),
804
+ ),
805
+ components.FilePart$outboundSchema.and(
806
+ z.object({ kind: z.literal("file") }).transform((v) => ({ kind: v.kind })),
807
+ ),
808
+ components.ToolResultPart$outboundSchema.and(
809
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
810
+ kind: v.kind,
811
+ })),
812
+ ),
1531
813
  ]);
1532
814
 
1533
- export function partsFileToJSON(partsFile: PartsFile): string {
1534
- return JSON.stringify(PartsFile$outboundSchema.parse(partsFile));
1535
- }
1536
- export function partsFileFromJSON(
1537
- jsonString: string,
1538
- ): SafeParseResult<PartsFile, SDKValidationError> {
1539
- return safeParse(
1540
- jsonString,
1541
- (x) => PartsFile$inboundSchema.parse(JSON.parse(x)),
1542
- `Failed to parse 'PartsFile' from JSON`,
1543
- );
1544
- }
1545
-
1546
- /** @internal */
1547
- export const PartsFilePart$inboundSchema: z.ZodType<
1548
- PartsFilePart,
1549
- z.ZodTypeDef,
1550
- unknown
1551
- > = z.object({
1552
- kind: InvokeAgentPartsAgentsKind$inboundSchema,
1553
- file: z.union([
1554
- z.lazy(() => InvokeAgentFileBinaryFormat$inboundSchema),
1555
- z.lazy(() => InvokeAgentFileFileInURIFormat$inboundSchema),
1556
- ]),
1557
- metadata: z.record(z.any()).optional(),
1558
- });
1559
- /** @internal */
1560
- export type PartsFilePart$Outbound = {
1561
- kind: string;
1562
- file:
1563
- | InvokeAgentFileBinaryFormat$Outbound
1564
- | InvokeAgentFileFileInURIFormat$Outbound;
1565
- metadata?: { [k: string]: any } | undefined;
1566
- };
1567
-
1568
- /** @internal */
1569
- export const PartsFilePart$outboundSchema: z.ZodType<
1570
- PartsFilePart$Outbound,
1571
- z.ZodTypeDef,
1572
- PartsFilePart
1573
- > = z.object({
1574
- kind: InvokeAgentPartsAgentsKind$outboundSchema,
1575
- file: z.union([
1576
- z.lazy(() => InvokeAgentFileBinaryFormat$outboundSchema),
1577
- z.lazy(() => InvokeAgentFileFileInURIFormat$outboundSchema),
1578
- ]),
1579
- metadata: z.record(z.any()).optional(),
1580
- });
1581
-
1582
- export function partsFilePartToJSON(partsFilePart: PartsFilePart): string {
1583
- return JSON.stringify(PartsFilePart$outboundSchema.parse(partsFilePart));
1584
- }
1585
- export function partsFilePartFromJSON(
1586
- jsonString: string,
1587
- ): SafeParseResult<PartsFilePart, SDKValidationError> {
1588
- return safeParse(
1589
- jsonString,
1590
- (x) => PartsFilePart$inboundSchema.parse(JSON.parse(x)),
1591
- `Failed to parse 'PartsFilePart' from JSON`,
1592
- );
1593
- }
1594
-
1595
- /** @internal */
1596
- export const InvokeAgentPartsKind$inboundSchema: z.ZodNativeEnum<
1597
- typeof InvokeAgentPartsKind
1598
- > = z.nativeEnum(InvokeAgentPartsKind);
1599
- /** @internal */
1600
- export const InvokeAgentPartsKind$outboundSchema: z.ZodNativeEnum<
1601
- typeof InvokeAgentPartsKind
1602
- > = InvokeAgentPartsKind$inboundSchema;
1603
-
1604
- /** @internal */
1605
- export const DataPart$inboundSchema: z.ZodType<
1606
- DataPart,
1607
- z.ZodTypeDef,
1608
- unknown
1609
- > = z.object({
1610
- kind: InvokeAgentPartsKind$inboundSchema,
1611
- data: z.record(z.any()),
1612
- metadata: z.record(z.any()).optional(),
1613
- });
1614
- /** @internal */
1615
- export type DataPart$Outbound = {
1616
- kind: string;
1617
- data: { [k: string]: any };
1618
- metadata?: { [k: string]: any } | undefined;
1619
- };
1620
-
1621
- /** @internal */
1622
- export const DataPart$outboundSchema: z.ZodType<
1623
- DataPart$Outbound,
1624
- z.ZodTypeDef,
1625
- DataPart
1626
- > = z.object({
1627
- kind: InvokeAgentPartsKind$outboundSchema,
1628
- data: z.record(z.any()),
1629
- metadata: z.record(z.any()).optional(),
1630
- });
1631
-
1632
- export function dataPartToJSON(dataPart: DataPart): string {
1633
- return JSON.stringify(DataPart$outboundSchema.parse(dataPart));
1634
- }
1635
- export function dataPartFromJSON(
1636
- jsonString: string,
1637
- ): SafeParseResult<DataPart, SDKValidationError> {
1638
- return safeParse(
1639
- jsonString,
1640
- (x) => DataPart$inboundSchema.parse(JSON.parse(x)),
1641
- `Failed to parse 'DataPart' from JSON`,
1642
- );
1643
- }
1644
-
1645
- /** @internal */
1646
- export const PartsKind$inboundSchema: z.ZodNativeEnum<typeof PartsKind> = z
1647
- .nativeEnum(PartsKind);
1648
- /** @internal */
1649
- export const PartsKind$outboundSchema: z.ZodNativeEnum<typeof PartsKind> =
1650
- PartsKind$inboundSchema;
1651
-
1652
- /** @internal */
1653
- export const PartsTextPart$inboundSchema: z.ZodType<
1654
- PartsTextPart,
1655
- z.ZodTypeDef,
1656
- unknown
1657
- > = z.object({
1658
- kind: PartsKind$inboundSchema,
1659
- text: z.string(),
1660
- });
1661
- /** @internal */
1662
- export type PartsTextPart$Outbound = {
1663
- kind: string;
1664
- text: string;
1665
- };
1666
-
1667
- /** @internal */
1668
- export const PartsTextPart$outboundSchema: z.ZodType<
1669
- PartsTextPart$Outbound,
1670
- z.ZodTypeDef,
1671
- PartsTextPart
1672
- > = z.object({
1673
- kind: PartsKind$outboundSchema,
1674
- text: z.string(),
1675
- });
1676
-
1677
- export function partsTextPartToJSON(partsTextPart: PartsTextPart): string {
1678
- return JSON.stringify(PartsTextPart$outboundSchema.parse(partsTextPart));
1679
- }
1680
- export function partsTextPartFromJSON(
1681
- jsonString: string,
1682
- ): SafeParseResult<PartsTextPart, SDKValidationError> {
1683
- return safeParse(
1684
- jsonString,
1685
- (x) => PartsTextPart$inboundSchema.parse(JSON.parse(x)),
1686
- `Failed to parse 'PartsTextPart' from JSON`,
815
+ export function invokeAgentPartsToJSON(
816
+ invokeAgentParts: InvokeAgentParts,
817
+ ): string {
818
+ return JSON.stringify(
819
+ InvokeAgentParts$outboundSchema.parse(invokeAgentParts),
1687
820
  );
1688
821
  }
1689
-
1690
- /** @internal */
1691
- export const Parts$inboundSchema: z.ZodType<Parts, z.ZodTypeDef, unknown> = z
1692
- .union([
1693
- z.lazy(() => ToolCallPart$inboundSchema),
1694
- z.lazy(() => PartsTextPart$inboundSchema),
1695
- z.lazy(() => DataPart$inboundSchema),
1696
- z.lazy(() => PartsFilePart$inboundSchema),
1697
- z.lazy(() => PartsToolResultPart$inboundSchema),
1698
- ]);
1699
- /** @internal */
1700
- export type Parts$Outbound =
1701
- | ToolCallPart$Outbound
1702
- | PartsTextPart$Outbound
1703
- | DataPart$Outbound
1704
- | PartsFilePart$Outbound
1705
- | PartsToolResultPart$Outbound;
1706
-
1707
- /** @internal */
1708
- export const Parts$outboundSchema: z.ZodType<
1709
- Parts$Outbound,
1710
- z.ZodTypeDef,
1711
- Parts
1712
- > = z.union([
1713
- z.lazy(() => ToolCallPart$outboundSchema),
1714
- z.lazy(() => PartsTextPart$outboundSchema),
1715
- z.lazy(() => DataPart$outboundSchema),
1716
- z.lazy(() => PartsFilePart$outboundSchema),
1717
- z.lazy(() => PartsToolResultPart$outboundSchema),
1718
- ]);
1719
-
1720
- export function partsToJSON(parts: Parts): string {
1721
- return JSON.stringify(Parts$outboundSchema.parse(parts));
1722
- }
1723
- export function partsFromJSON(
822
+ export function invokeAgentPartsFromJSON(
1724
823
  jsonString: string,
1725
- ): SafeParseResult<Parts, SDKValidationError> {
824
+ ): SafeParseResult<InvokeAgentParts, SDKValidationError> {
1726
825
  return safeParse(
1727
826
  jsonString,
1728
- (x) => Parts$inboundSchema.parse(JSON.parse(x)),
1729
- `Failed to parse 'Parts' from JSON`,
827
+ (x) => InvokeAgentParts$inboundSchema.parse(JSON.parse(x)),
828
+ `Failed to parse 'InvokeAgentParts' from JSON`,
1730
829
  );
1731
830
  }
1732
831
 
@@ -1736,16 +835,36 @@ export const TaskStatusMessage$inboundSchema: z.ZodType<
1736
835
  z.ZodTypeDef,
1737
836
  unknown
1738
837
  > = z.object({
1739
- kind: InvokeAgentAgentsKind$inboundSchema,
838
+ kind: InvokeAgentKind$inboundSchema,
1740
839
  messageId: z.string(),
1741
840
  role: ExtendedMessageRole$inboundSchema,
1742
841
  parts: z.array(
1743
842
  z.union([
1744
- z.lazy(() => ToolCallPart$inboundSchema),
1745
- z.lazy(() => PartsTextPart$inboundSchema),
1746
- z.lazy(() => DataPart$inboundSchema),
1747
- z.lazy(() => PartsFilePart$inboundSchema),
1748
- z.lazy(() => PartsToolResultPart$inboundSchema),
843
+ components.ToolCallPart$inboundSchema.and(
844
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
845
+ kind: v.kind,
846
+ })),
847
+ ),
848
+ components.TextPart$inboundSchema.and(
849
+ z.object({ kind: z.literal("text") }).transform((v) => ({
850
+ kind: v.kind,
851
+ })),
852
+ ),
853
+ components.DataPart$inboundSchema.and(
854
+ z.object({ kind: z.literal("data") }).transform((v) => ({
855
+ kind: v.kind,
856
+ })),
857
+ ),
858
+ components.FilePart$inboundSchema.and(
859
+ z.object({ kind: z.literal("file") }).transform((v) => ({
860
+ kind: v.kind,
861
+ })),
862
+ ),
863
+ components.ToolResultPart$inboundSchema.and(
864
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
865
+ kind: v.kind,
866
+ })),
867
+ ),
1749
868
  ]),
1750
869
  ),
1751
870
  });
@@ -1755,11 +874,11 @@ export type TaskStatusMessage$Outbound = {
1755
874
  messageId: string;
1756
875
  role: string;
1757
876
  parts: Array<
1758
- | ToolCallPart$Outbound
1759
- | PartsTextPart$Outbound
1760
- | DataPart$Outbound
1761
- | PartsFilePart$Outbound
1762
- | PartsToolResultPart$Outbound
877
+ | (components.ToolCallPart$Outbound & { kind: "tool_call" })
878
+ | (components.TextPart$Outbound & { kind: "text" })
879
+ | (components.DataPart$Outbound & { kind: "data" })
880
+ | (components.FilePart$Outbound & { kind: "file" })
881
+ | (components.ToolResultPart$Outbound & { kind: "tool_result" })
1763
882
  >;
1764
883
  };
1765
884
 
@@ -1769,16 +888,36 @@ export const TaskStatusMessage$outboundSchema: z.ZodType<
1769
888
  z.ZodTypeDef,
1770
889
  TaskStatusMessage
1771
890
  > = z.object({
1772
- kind: InvokeAgentAgentsKind$outboundSchema,
891
+ kind: InvokeAgentKind$outboundSchema,
1773
892
  messageId: z.string(),
1774
893
  role: ExtendedMessageRole$outboundSchema,
1775
894
  parts: z.array(
1776
895
  z.union([
1777
- z.lazy(() => ToolCallPart$outboundSchema),
1778
- z.lazy(() => PartsTextPart$outboundSchema),
1779
- z.lazy(() => DataPart$outboundSchema),
1780
- z.lazy(() => PartsFilePart$outboundSchema),
1781
- z.lazy(() => PartsToolResultPart$outboundSchema),
896
+ components.ToolCallPart$outboundSchema.and(
897
+ z.object({ kind: z.literal("tool_call") }).transform((v) => ({
898
+ kind: v.kind,
899
+ })),
900
+ ),
901
+ components.TextPart$outboundSchema.and(
902
+ z.object({ kind: z.literal("text") }).transform((v) => ({
903
+ kind: v.kind,
904
+ })),
905
+ ),
906
+ components.DataPart$outboundSchema.and(
907
+ z.object({ kind: z.literal("data") }).transform((v) => ({
908
+ kind: v.kind,
909
+ })),
910
+ ),
911
+ components.FilePart$outboundSchema.and(
912
+ z.object({ kind: z.literal("file") }).transform((v) => ({
913
+ kind: v.kind,
914
+ })),
915
+ ),
916
+ components.ToolResultPart$outboundSchema.and(
917
+ z.object({ kind: z.literal("tool_result") }).transform((v) => ({
918
+ kind: v.kind,
919
+ })),
920
+ ),
1782
921
  ]),
1783
922
  ),
1784
923
  });
@@ -1849,7 +988,7 @@ export const InvokeAgentA2ATaskResponse$inboundSchema: z.ZodType<
1849
988
  > = z.object({
1850
989
  id: z.string(),
1851
990
  contextId: z.string(),
1852
- kind: InvokeAgentKind$inboundSchema,
991
+ kind: Kind$inboundSchema,
1853
992
  status: z.lazy(() => TaskStatus$inboundSchema),
1854
993
  metadata: z.record(z.any()).optional(),
1855
994
  });
@@ -1870,7 +1009,7 @@ export const InvokeAgentA2ATaskResponse$outboundSchema: z.ZodType<
1870
1009
  > = z.object({
1871
1010
  id: z.string(),
1872
1011
  contextId: z.string(),
1873
- kind: InvokeAgentKind$outboundSchema,
1012
+ kind: Kind$outboundSchema,
1874
1013
  status: z.lazy(() => TaskStatus$outboundSchema),
1875
1014
  metadata: z.record(z.any()).optional(),
1876
1015
  });