@vertesia/client 1.2.0 → 1.4.0-dev.20260614.160504Z

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 (579) hide show
  1. package/lib/{types/AccountApi.d.ts → AccountApi.d.ts} +5 -10
  2. package/lib/AccountApi.d.ts.map +1 -0
  3. package/lib/{esm/AccountApi.js → AccountApi.js} +5 -13
  4. package/lib/AccountApi.js.map +1 -0
  5. package/lib/{types/AccountsApi.d.ts → AccountsApi.d.ts} +3 -2
  6. package/lib/AccountsApi.d.ts.map +1 -0
  7. package/lib/{esm/AccountsApi.js → AccountsApi.js} +2 -2
  8. package/lib/AccountsApi.js.map +1 -0
  9. package/lib/{types/AnalyticsApi.d.ts → AnalyticsApi.d.ts} +3 -2
  10. package/lib/AnalyticsApi.d.ts.map +1 -0
  11. package/lib/{esm/AnalyticsApi.js → AnalyticsApi.js} +5 -5
  12. package/lib/AnalyticsApi.js.map +1 -0
  13. package/lib/{types/ApiKeysApi.d.ts → ApiKeysApi.d.ts} +3 -2
  14. package/lib/ApiKeysApi.d.ts.map +1 -0
  15. package/lib/ApiKeysApi.js.map +1 -0
  16. package/lib/{types/AppsApi.d.ts → AppsApi.d.ts} +40 -2
  17. package/lib/AppsApi.d.ts.map +1 -0
  18. package/lib/{esm/AppsApi.js → AppsApi.js} +87 -14
  19. package/lib/AppsApi.js.map +1 -0
  20. package/lib/{types/AuditTrailApi.d.ts → AuditTrailApi.d.ts} +2 -1
  21. package/lib/AuditTrailApi.d.ts.map +1 -0
  22. package/lib/{esm/AuditTrailApi.js → AuditTrailApi.js} +1 -1
  23. package/lib/AuditTrailApi.js.map +1 -0
  24. package/lib/{types/CommandsApi.d.ts → CommandsApi.d.ts} +3 -2
  25. package/lib/CommandsApi.d.ts.map +1 -0
  26. package/lib/{esm/CommandsApi.js → CommandsApi.js} +3 -3
  27. package/lib/CommandsApi.js.map +1 -0
  28. package/lib/{types/EnvironmentsApi.d.ts → EnvironmentsApi.d.ts} +5 -4
  29. package/lib/EnvironmentsApi.d.ts.map +1 -0
  30. package/lib/{esm/EnvironmentsApi.js → EnvironmentsApi.js} +13 -13
  31. package/lib/EnvironmentsApi.js.map +1 -0
  32. package/lib/{types/GroupsApi.d.ts → GroupsApi.d.ts} +3 -2
  33. package/lib/GroupsApi.d.ts.map +1 -0
  34. package/lib/{esm/GroupsApi.js → GroupsApi.js} +8 -8
  35. package/lib/GroupsApi.js.map +1 -0
  36. package/lib/IamApi.d.ts +51 -0
  37. package/lib/IamApi.d.ts.map +1 -0
  38. package/lib/IamApi.js +67 -0
  39. package/lib/IamApi.js.map +1 -0
  40. package/lib/{types/InteractionBase.d.ts → InteractionBase.d.ts} +6 -5
  41. package/lib/InteractionBase.d.ts.map +1 -0
  42. package/lib/{esm/InteractionBase.js → InteractionBase.js} +4 -4
  43. package/lib/InteractionBase.js.map +1 -0
  44. package/lib/{types/InteractionCatalogApi.d.ts → InteractionCatalogApi.d.ts} +3 -2
  45. package/lib/InteractionCatalogApi.d.ts.map +1 -0
  46. package/lib/{esm/InteractionCatalogApi.js → InteractionCatalogApi.js} +12 -12
  47. package/lib/InteractionCatalogApi.js.map +1 -0
  48. package/lib/{types/InteractionOutput.d.ts → InteractionOutput.d.ts} +13 -12
  49. package/lib/InteractionOutput.d.ts.map +1 -0
  50. package/lib/{esm/InteractionOutput.js → InteractionOutput.js} +22 -25
  51. package/lib/InteractionOutput.js.map +1 -0
  52. package/lib/{types/InteractionResult.example.d.ts → InteractionResult.example.d.ts} +1 -0
  53. package/lib/InteractionResult.example.d.ts.map +1 -0
  54. package/lib/{esm/InteractionResult.example.js → InteractionResult.example.js} +4 -4
  55. package/lib/InteractionResult.example.js.map +1 -0
  56. package/lib/{types/InteractionsApi.d.ts → InteractionsApi.d.ts} +17 -6
  57. package/lib/InteractionsApi.d.ts.map +1 -0
  58. package/lib/{esm/InteractionsApi.js → InteractionsApi.js} +45 -28
  59. package/lib/InteractionsApi.js.map +1 -0
  60. package/lib/{types/OAuthClientsApi.d.ts → OAuthClientsApi.d.ts} +4 -2
  61. package/lib/OAuthClientsApi.d.ts.map +1 -0
  62. package/lib/{esm/OAuthClientsApi.js → OAuthClientsApi.js} +3 -0
  63. package/lib/OAuthClientsApi.js.map +1 -0
  64. package/lib/{types/OAuthGrantsApi.d.ts → OAuthGrantsApi.d.ts} +2 -1
  65. package/lib/OAuthGrantsApi.d.ts.map +1 -0
  66. package/lib/OAuthGrantsApi.js.map +1 -0
  67. package/lib/{types/OAuthProvidersApi.d.ts → OAuthProvidersApi.d.ts} +3 -2
  68. package/lib/OAuthProvidersApi.d.ts.map +1 -0
  69. package/lib/OAuthProvidersApi.js.map +1 -0
  70. package/lib/OAuthServerApi.d.ts +19 -0
  71. package/lib/OAuthServerApi.d.ts.map +1 -0
  72. package/lib/OAuthServerApi.js +48 -0
  73. package/lib/OAuthServerApi.js.map +1 -0
  74. package/lib/{types/ProjectsApi.d.ts → ProjectsApi.d.ts} +8 -5
  75. package/lib/ProjectsApi.d.ts.map +1 -0
  76. package/lib/{esm/ProjectsApi.js → ProjectsApi.js} +21 -12
  77. package/lib/ProjectsApi.js.map +1 -0
  78. package/lib/{types/PromptsApi.d.ts → PromptsApi.d.ts} +17 -9
  79. package/lib/PromptsApi.d.ts.map +1 -0
  80. package/lib/{esm/PromptsApi.js → PromptsApi.js} +16 -18
  81. package/lib/PromptsApi.js.map +1 -0
  82. package/lib/RefsApi.d.ts +7 -0
  83. package/lib/RefsApi.d.ts.map +1 -0
  84. package/lib/{esm/RefsApi.js → RefsApi.js} +2 -2
  85. package/lib/RefsApi.js.map +1 -0
  86. package/lib/{types/RemoteMcpConnectionsApi.d.ts → RemoteMcpConnectionsApi.d.ts} +3 -2
  87. package/lib/RemoteMcpConnectionsApi.d.ts.map +1 -0
  88. package/lib/{esm/RemoteMcpConnectionsApi.js → RemoteMcpConnectionsApi.js} +3 -3
  89. package/lib/RemoteMcpConnectionsApi.js.map +1 -0
  90. package/lib/{types/RunsApi.d.ts → RunsApi.d.ts} +8 -7
  91. package/lib/RunsApi.d.ts.map +1 -0
  92. package/lib/{esm/RunsApi.js → RunsApi.js} +11 -11
  93. package/lib/RunsApi.js.map +1 -0
  94. package/lib/SecretsApi.d.ts +18 -0
  95. package/lib/SecretsApi.d.ts.map +1 -0
  96. package/lib/SecretsApi.js +30 -0
  97. package/lib/SecretsApi.js.map +1 -0
  98. package/lib/{types/SkillsApi.d.ts → SkillsApi.d.ts} +3 -2
  99. package/lib/SkillsApi.d.ts.map +1 -0
  100. package/lib/{esm/SkillsApi.js → SkillsApi.js} +3 -3
  101. package/lib/SkillsApi.js.map +1 -0
  102. package/lib/{types/StreamSource.d.ts → StreamSource.d.ts} +1 -0
  103. package/lib/StreamSource.d.ts.map +1 -0
  104. package/lib/StreamSource.js.map +1 -0
  105. package/lib/ToolsApi.d.ts +36 -0
  106. package/lib/ToolsApi.d.ts.map +1 -0
  107. package/lib/ToolsApi.js +46 -0
  108. package/lib/ToolsApi.js.map +1 -0
  109. package/lib/{types/TrainingApi.d.ts → TrainingApi.d.ts} +7 -6
  110. package/lib/TrainingApi.d.ts.map +1 -0
  111. package/lib/TrainingApi.js +51 -0
  112. package/lib/TrainingApi.js.map +1 -0
  113. package/lib/{types/UsersApi.d.ts → UsersApi.d.ts} +3 -2
  114. package/lib/UsersApi.d.ts.map +1 -0
  115. package/lib/{esm/UsersApi.js → UsersApi.js} +3 -3
  116. package/lib/UsersApi.js.map +1 -0
  117. package/lib/{types/client.d.ts → client.d.ts} +42 -27
  118. package/lib/client.d.ts.map +1 -0
  119. package/lib/{esm/client.js → client.js} +90 -61
  120. package/lib/client.js.map +1 -0
  121. package/lib/{types/execute.d.ts → execute.d.ts} +5 -4
  122. package/lib/execute.d.ts.map +1 -0
  123. package/lib/{esm/execute.js → execute.js} +13 -11
  124. package/lib/execute.js.map +1 -0
  125. package/lib/{types/index.d.ts → index.d.ts} +9 -8
  126. package/lib/index.d.ts.map +1 -0
  127. package/lib/{esm/index.js → index.js} +4 -2
  128. package/lib/index.js.map +1 -0
  129. package/lib/{types/nodejs → nodejs}/NodeStreamSource.d.ts +3 -2
  130. package/lib/nodejs/NodeStreamSource.d.ts.map +1 -0
  131. package/lib/{esm/nodejs → nodejs}/NodeStreamSource.js +3 -3
  132. package/lib/nodejs/NodeStreamSource.js.map +1 -0
  133. package/lib/nodejs/index.d.ts +2 -0
  134. package/lib/nodejs/index.d.ts.map +1 -0
  135. package/lib/nodejs/index.js +2 -0
  136. package/lib/nodejs/index.js.map +1 -0
  137. package/lib/{types/store → store}/AgentsApi.d.ts +55 -8
  138. package/lib/store/AgentsApi.d.ts.map +1 -0
  139. package/lib/{esm/store → store}/AgentsApi.js +155 -47
  140. package/lib/store/AgentsApi.js.map +1 -0
  141. package/lib/{types/store → store}/AnalyzeDocApi.d.ts +3 -2
  142. package/lib/store/AnalyzeDocApi.d.ts.map +1 -0
  143. package/lib/{esm/store → store}/AnalyzeDocApi.js +10 -10
  144. package/lib/store/AnalyzeDocApi.js.map +1 -0
  145. package/lib/{types/store → store}/CollectionsApi.d.ts +6 -5
  146. package/lib/store/CollectionsApi.d.ts.map +1 -0
  147. package/lib/{esm/store → store}/CollectionsApi.js +22 -22
  148. package/lib/store/CollectionsApi.js.map +1 -0
  149. package/lib/{types/store → store}/CostApi.d.ts +3 -2
  150. package/lib/store/CostApi.d.ts.map +1 -0
  151. package/lib/store/CostApi.js.map +1 -0
  152. package/lib/{types/store → store}/DashboardApi.d.ts +3 -2
  153. package/lib/store/DashboardApi.d.ts.map +1 -0
  154. package/lib/{esm/store → store}/DashboardApi.js +7 -4
  155. package/lib/store/DashboardApi.js.map +1 -0
  156. package/lib/{types/store → store}/DataApi.d.ts +4 -3
  157. package/lib/store/DataApi.d.ts.map +1 -0
  158. package/lib/{esm/store → store}/DataApi.js +6 -6
  159. package/lib/store/DataApi.js.map +1 -0
  160. package/lib/{types/store → store}/EmailApi.d.ts +3 -2
  161. package/lib/store/EmailApi.d.ts.map +1 -0
  162. package/lib/{esm/store → store}/EmailApi.js +5 -5
  163. package/lib/store/EmailApi.js.map +1 -0
  164. package/lib/store/EmbeddingsApi.d.ts +13 -0
  165. package/lib/store/EmbeddingsApi.d.ts.map +1 -0
  166. package/lib/store/EmbeddingsApi.js +25 -0
  167. package/lib/store/EmbeddingsApi.js.map +1 -0
  168. package/lib/{types/store → store}/FilesApi.d.ts +22 -7
  169. package/lib/store/FilesApi.d.ts.map +1 -0
  170. package/lib/{esm/store → store}/FilesApi.js +56 -51
  171. package/lib/store/FilesApi.js.map +1 -0
  172. package/lib/{types/store → store}/HiveMemoryApi.d.ts +3 -2
  173. package/lib/store/HiveMemoryApi.d.ts.map +1 -0
  174. package/lib/{esm/store → store}/HiveMemoryApi.js +11 -11
  175. package/lib/{esm/store → store}/HiveMemoryApi.js.map +1 -1
  176. package/lib/{types/store → store}/IndexingApi.d.ts +16 -10
  177. package/lib/store/IndexingApi.d.ts.map +1 -0
  178. package/lib/{esm/store → store}/IndexingApi.js +57 -45
  179. package/lib/store/IndexingApi.js.map +1 -0
  180. package/lib/{types/store → store}/ObjectsApi.d.ts +16 -11
  181. package/lib/store/ObjectsApi.d.ts.map +1 -0
  182. package/lib/{esm/store → store}/ObjectsApi.js +46 -63
  183. package/lib/store/ObjectsApi.js.map +1 -0
  184. package/lib/{types/store → store}/PendingAsksApi.d.ts +5 -2
  185. package/lib/store/PendingAsksApi.d.ts.map +1 -0
  186. package/lib/{esm/store → store}/PendingAsksApi.js +4 -4
  187. package/lib/store/PendingAsksApi.js.map +1 -0
  188. package/lib/store/ProcessApi.d.ts +25 -0
  189. package/lib/store/ProcessApi.d.ts.map +1 -0
  190. package/lib/store/ProcessApi.js +42 -0
  191. package/lib/store/ProcessApi.js.map +1 -0
  192. package/lib/{types/store → store}/QueryApi.d.ts +2 -1
  193. package/lib/store/QueryApi.d.ts.map +1 -0
  194. package/lib/{esm/store → store}/QueryApi.js +3 -3
  195. package/lib/store/QueryApi.js.map +1 -0
  196. package/lib/{types/store → store}/RenderingApi.d.ts +3 -2
  197. package/lib/store/RenderingApi.d.ts.map +1 -0
  198. package/lib/{esm/store → store}/RenderingApi.js +8 -8
  199. package/lib/store/RenderingApi.js.map +1 -0
  200. package/lib/{types/store → store}/SchedulesApi.d.ts +3 -2
  201. package/lib/store/SchedulesApi.d.ts.map +1 -0
  202. package/lib/{esm/store → store}/SchedulesApi.js +4 -4
  203. package/lib/store/SchedulesApi.js.map +1 -0
  204. package/lib/store/TaskApi.d.ts +16 -0
  205. package/lib/store/TaskApi.d.ts.map +1 -0
  206. package/lib/store/TaskApi.js +42 -0
  207. package/lib/store/TaskApi.js.map +1 -0
  208. package/lib/{types/store → store}/ToolsApi.d.ts +3 -2
  209. package/lib/store/ToolsApi.d.ts.map +1 -0
  210. package/lib/{esm/store → store}/ToolsApi.js +2 -2
  211. package/lib/store/ToolsApi.js.map +1 -0
  212. package/lib/{types/store → store}/TypeCatalogApi.d.ts +4 -3
  213. package/lib/store/TypeCatalogApi.d.ts.map +1 -0
  214. package/lib/{esm/store → store}/TypeCatalogApi.js +5 -5
  215. package/lib/store/TypeCatalogApi.js.map +1 -0
  216. package/lib/{types/store → store}/TypesApi.d.ts +5 -4
  217. package/lib/store/TypesApi.d.ts.map +1 -0
  218. package/lib/{esm/store → store}/TypesApi.js +12 -12
  219. package/lib/store/TypesApi.js.map +1 -0
  220. package/lib/{types/store → store}/WorkflowsApi.d.ts +11 -9
  221. package/lib/store/WorkflowsApi.d.ts.map +1 -0
  222. package/lib/{esm/store → store}/WorkflowsApi.js +44 -46
  223. package/lib/store/WorkflowsApi.js.map +1 -0
  224. package/lib/store/client.d.ts +59 -0
  225. package/lib/store/client.d.ts.map +1 -0
  226. package/lib/{esm/store → store}/client.js +32 -29
  227. package/lib/store/client.js.map +1 -0
  228. package/lib/{types/store → store}/errors.d.ts +2 -1
  229. package/lib/store/errors.d.ts.map +1 -0
  230. package/lib/store/errors.js +7 -0
  231. package/lib/store/errors.js.map +1 -0
  232. package/lib/store/index.d.ts +20 -0
  233. package/lib/store/index.d.ts.map +1 -0
  234. package/lib/store/index.js +20 -0
  235. package/lib/store/index.js.map +1 -0
  236. package/lib/store/signed-url.d.ts +39 -0
  237. package/lib/store/signed-url.d.ts.map +1 -0
  238. package/lib/store/signed-url.js +153 -0
  239. package/lib/store/signed-url.js.map +1 -0
  240. package/lib/store/stream-termination.d.ts +4 -0
  241. package/lib/store/stream-termination.d.ts.map +1 -0
  242. package/lib/store/stream-termination.js +31 -0
  243. package/lib/store/stream-termination.js.map +1 -0
  244. package/lib/{types/store → store}/version.d.ts +1 -0
  245. package/lib/store/version.d.ts.map +1 -0
  246. package/lib/store/version.js.map +1 -0
  247. package/lib/vertesia-client.js +1 -1
  248. package/lib/vertesia-client.js.map +1 -1
  249. package/package.json +25 -38
  250. package/src/AccountApi.ts +10 -22
  251. package/src/AccountsApi.ts +3 -9
  252. package/src/AnalyticsApi.ts +6 -8
  253. package/src/ApiKeysApi.ts +10 -2
  254. package/src/AppsApi.ts +131 -27
  255. package/src/AuditTrailApi.ts +4 -4
  256. package/src/CommandsApi.ts +7 -8
  257. package/src/EnvironmentsApi.ts +27 -23
  258. package/src/GroupsApi.ts +15 -10
  259. package/src/IamApi.ts +46 -23
  260. package/src/InteractionBase.ts +18 -9
  261. package/src/InteractionCatalogApi.ts +15 -20
  262. package/src/InteractionOutput.test.ts +40 -57
  263. package/src/InteractionOutput.ts +55 -47
  264. package/src/InteractionResult.example.ts +30 -18
  265. package/src/InteractionsApi.ts +113 -59
  266. package/src/OAuthClientsApi.ts +6 -1
  267. package/src/OAuthGrantsApi.ts +1 -1
  268. package/src/OAuthProvidersApi.ts +3 -4
  269. package/src/OAuthServerApi.ts +53 -6
  270. package/src/ProjectsApi.ts +70 -31
  271. package/src/PromptsApi.ts +44 -29
  272. package/src/RefsApi.ts +4 -10
  273. package/src/RemoteMcpConnectionsApi.ts +6 -7
  274. package/src/RunsApi.ts +22 -20
  275. package/src/SecretsApi.ts +56 -0
  276. package/src/SkillsApi.ts +5 -12
  277. package/src/StreamSource.ts +6 -1
  278. package/src/ToolsApi.ts +52 -0
  279. package/src/TrainingApi.ts +27 -25
  280. package/src/UsersApi.ts +6 -8
  281. package/src/client.test.ts +68 -2
  282. package/src/client.ts +130 -103
  283. package/src/execute.ts +41 -20
  284. package/src/index.ts +8 -8
  285. package/src/nodejs/NodeStreamSource.ts +4 -5
  286. package/src/nodejs/index.ts +1 -1
  287. package/src/store/AgentsApi.ts +285 -143
  288. package/src/store/AnalyzeDocApi.ts +39 -21
  289. package/src/store/CollectionsApi.ts +40 -38
  290. package/src/store/CostApi.ts +14 -19
  291. package/src/store/DashboardApi.ts +24 -27
  292. package/src/store/DataApi.ts +29 -32
  293. package/src/store/EmailApi.ts +6 -6
  294. package/src/store/EmbeddingsApi.ts +15 -15
  295. package/src/store/FilesApi.ts +80 -85
  296. package/src/store/HiveMemoryApi.ts +17 -28
  297. package/src/store/IndexingApi.ts +113 -76
  298. package/src/store/ObjectsApi.ts +100 -131
  299. package/src/store/PendingAsksApi.ts +7 -5
  300. package/src/store/ProcessApi.ts +61 -0
  301. package/src/store/QueryApi.ts +3 -4
  302. package/src/store/RenderingApi.ts +14 -17
  303. package/src/store/SchedulesApi.ts +6 -6
  304. package/src/store/TaskApi.ts +45 -0
  305. package/src/store/ToolsApi.ts +3 -3
  306. package/src/store/TypeCatalogApi.ts +56 -53
  307. package/src/store/TypesApi.ts +26 -18
  308. package/src/store/WorkflowsApi.ts +140 -146
  309. package/src/store/client.ts +44 -39
  310. package/src/store/errors.ts +3 -3
  311. package/src/store/index.ts +19 -18
  312. package/src/store/signed-url.test.ts +182 -0
  313. package/src/store/signed-url.ts +184 -0
  314. package/src/store/stream-termination.test.ts +58 -0
  315. package/src/store/stream-termination.ts +40 -0
  316. package/src/store/version.ts +1 -1
  317. package/lib/cjs/AccountApi.js +0 -85
  318. package/lib/cjs/AccountApi.js.map +0 -1
  319. package/lib/cjs/AccountsApi.js +0 -16
  320. package/lib/cjs/AccountsApi.js.map +0 -1
  321. package/lib/cjs/AnalyticsApi.js +0 -43
  322. package/lib/cjs/AnalyticsApi.js.map +0 -1
  323. package/lib/cjs/ApiKeysApi.js +0 -61
  324. package/lib/cjs/ApiKeysApi.js.map +0 -1
  325. package/lib/cjs/AppsApi.js +0 -137
  326. package/lib/cjs/AppsApi.js.map +0 -1
  327. package/lib/cjs/AuditTrailApi.js +0 -39
  328. package/lib/cjs/AuditTrailApi.js.map +0 -1
  329. package/lib/cjs/CommandsApi.js +0 -19
  330. package/lib/cjs/CommandsApi.js.map +0 -1
  331. package/lib/cjs/EnvironmentsApi.js +0 -72
  332. package/lib/cjs/EnvironmentsApi.js.map +0 -1
  333. package/lib/cjs/GroupsApi.js +0 -86
  334. package/lib/cjs/GroupsApi.js.map +0 -1
  335. package/lib/cjs/IamApi.js +0 -53
  336. package/lib/cjs/IamApi.js.map +0 -1
  337. package/lib/cjs/InteractionBase.js +0 -44
  338. package/lib/cjs/InteractionBase.js.map +0 -1
  339. package/lib/cjs/InteractionCatalogApi.js +0 -64
  340. package/lib/cjs/InteractionCatalogApi.js.map +0 -1
  341. package/lib/cjs/InteractionOutput.js +0 -300
  342. package/lib/cjs/InteractionOutput.js.map +0 -1
  343. package/lib/cjs/InteractionResult.example.js +0 -57
  344. package/lib/cjs/InteractionResult.example.js.map +0 -1
  345. package/lib/cjs/InteractionsApi.js +0 -260
  346. package/lib/cjs/InteractionsApi.js.map +0 -1
  347. package/lib/cjs/OAuthClientsApi.js +0 -25
  348. package/lib/cjs/OAuthClientsApi.js.map +0 -1
  349. package/lib/cjs/OAuthGrantsApi.js +0 -30
  350. package/lib/cjs/OAuthGrantsApi.js.map +0 -1
  351. package/lib/cjs/OAuthProvidersApi.js +0 -43
  352. package/lib/cjs/OAuthProvidersApi.js.map +0 -1
  353. package/lib/cjs/OAuthServerApi.js +0 -22
  354. package/lib/cjs/OAuthServerApi.js.map +0 -1
  355. package/lib/cjs/ProjectsApi.js +0 -105
  356. package/lib/cjs/ProjectsApi.js.map +0 -1
  357. package/lib/cjs/PromptsApi.js +0 -135
  358. package/lib/cjs/PromptsApi.js.map +0 -1
  359. package/lib/cjs/RefsApi.js +0 -14
  360. package/lib/cjs/RefsApi.js.map +0 -1
  361. package/lib/cjs/RemoteMcpConnectionsApi.js +0 -38
  362. package/lib/cjs/RemoteMcpConnectionsApi.js.map +0 -1
  363. package/lib/cjs/RunsApi.js +0 -115
  364. package/lib/cjs/RunsApi.js.map +0 -1
  365. package/lib/cjs/SkillsApi.js +0 -39
  366. package/lib/cjs/SkillsApi.js.map +0 -1
  367. package/lib/cjs/StreamSource.js +0 -17
  368. package/lib/cjs/StreamSource.js.map +0 -1
  369. package/lib/cjs/TrainingApi.js +0 -54
  370. package/lib/cjs/TrainingApi.js.map +0 -1
  371. package/lib/cjs/UsersApi.js +0 -19
  372. package/lib/cjs/UsersApi.js.map +0 -1
  373. package/lib/cjs/client.js +0 -375
  374. package/lib/cjs/client.js.map +0 -1
  375. package/lib/cjs/execute.js +0 -160
  376. package/lib/cjs/execute.js.map +0 -1
  377. package/lib/cjs/index.js +0 -36
  378. package/lib/cjs/index.js.map +0 -1
  379. package/lib/cjs/nodejs/NodeStreamSource.js +0 -45
  380. package/lib/cjs/nodejs/NodeStreamSource.js.map +0 -1
  381. package/lib/cjs/nodejs/index.js +0 -18
  382. package/lib/cjs/nodejs/index.js.map +0 -1
  383. package/lib/cjs/package.json +0 -3
  384. package/lib/cjs/store/AgentsApi.js +0 -663
  385. package/lib/cjs/store/AgentsApi.js.map +0 -1
  386. package/lib/cjs/store/AnalyzeDocApi.js +0 -56
  387. package/lib/cjs/store/AnalyzeDocApi.js.map +0 -1
  388. package/lib/cjs/store/CollectionsApi.js +0 -131
  389. package/lib/cjs/store/CollectionsApi.js.map +0 -1
  390. package/lib/cjs/store/CommandsApi.js +0 -17
  391. package/lib/cjs/store/CommandsApi.js.map +0 -1
  392. package/lib/cjs/store/CostApi.js +0 -62
  393. package/lib/cjs/store/CostApi.js.map +0 -1
  394. package/lib/cjs/store/DashboardApi.js +0 -182
  395. package/lib/cjs/store/DashboardApi.js.map +0 -1
  396. package/lib/cjs/store/DataApi.js +0 -436
  397. package/lib/cjs/store/DataApi.js.map +0 -1
  398. package/lib/cjs/store/EmailApi.js +0 -103
  399. package/lib/cjs/store/EmailApi.js.map +0 -1
  400. package/lib/cjs/store/EmbeddingsApi.js +0 -29
  401. package/lib/cjs/store/EmbeddingsApi.js.map +0 -1
  402. package/lib/cjs/store/FilesApi.js +0 -286
  403. package/lib/cjs/store/FilesApi.js.map +0 -1
  404. package/lib/cjs/store/HiveMemoryApi.js +0 -174
  405. package/lib/cjs/store/HiveMemoryApi.js.map +0 -1
  406. package/lib/cjs/store/IndexingApi.js +0 -308
  407. package/lib/cjs/store/IndexingApi.js.map +0 -1
  408. package/lib/cjs/store/ObjectsApi.js +0 -340
  409. package/lib/cjs/store/ObjectsApi.js.map +0 -1
  410. package/lib/cjs/store/PendingAsksApi.js +0 -43
  411. package/lib/cjs/store/PendingAsksApi.js.map +0 -1
  412. package/lib/cjs/store/QueryApi.js +0 -67
  413. package/lib/cjs/store/QueryApi.js.map +0 -1
  414. package/lib/cjs/store/RenderingApi.js +0 -84
  415. package/lib/cjs/store/RenderingApi.js.map +0 -1
  416. package/lib/cjs/store/SchedulesApi.js +0 -103
  417. package/lib/cjs/store/SchedulesApi.js.map +0 -1
  418. package/lib/cjs/store/ToolsApi.js +0 -21
  419. package/lib/cjs/store/ToolsApi.js.map +0 -1
  420. package/lib/cjs/store/TypeCatalogApi.js +0 -50
  421. package/lib/cjs/store/TypeCatalogApi.js.map +0 -1
  422. package/lib/cjs/store/TypesApi.js +0 -60
  423. package/lib/cjs/store/TypesApi.js.map +0 -1
  424. package/lib/cjs/store/WorkersApi.js +0 -16
  425. package/lib/cjs/store/WorkersApi.js.map +0 -1
  426. package/lib/cjs/store/WorkflowsApi.js +0 -621
  427. package/lib/cjs/store/WorkflowsApi.js.map +0 -1
  428. package/lib/cjs/store/client.js +0 -93
  429. package/lib/cjs/store/client.js.map +0 -1
  430. package/lib/cjs/store/errors.js +0 -11
  431. package/lib/cjs/store/errors.js.map +0 -1
  432. package/lib/cjs/store/index.js +0 -34
  433. package/lib/cjs/store/index.js.map +0 -1
  434. package/lib/cjs/store/version.js +0 -6
  435. package/lib/cjs/store/version.js.map +0 -1
  436. package/lib/esm/AccountApi.js.map +0 -1
  437. package/lib/esm/AccountsApi.js.map +0 -1
  438. package/lib/esm/AnalyticsApi.js.map +0 -1
  439. package/lib/esm/ApiKeysApi.js.map +0 -1
  440. package/lib/esm/AppsApi.js.map +0 -1
  441. package/lib/esm/AuditTrailApi.js.map +0 -1
  442. package/lib/esm/CommandsApi.js.map +0 -1
  443. package/lib/esm/EnvironmentsApi.js.map +0 -1
  444. package/lib/esm/GroupsApi.js.map +0 -1
  445. package/lib/esm/IamApi.js +0 -47
  446. package/lib/esm/IamApi.js.map +0 -1
  447. package/lib/esm/InteractionBase.js.map +0 -1
  448. package/lib/esm/InteractionCatalogApi.js.map +0 -1
  449. package/lib/esm/InteractionOutput.js.map +0 -1
  450. package/lib/esm/InteractionResult.example.js.map +0 -1
  451. package/lib/esm/InteractionsApi.js.map +0 -1
  452. package/lib/esm/OAuthClientsApi.js.map +0 -1
  453. package/lib/esm/OAuthGrantsApi.js.map +0 -1
  454. package/lib/esm/OAuthProvidersApi.js.map +0 -1
  455. package/lib/esm/OAuthServerApi.js +0 -19
  456. package/lib/esm/OAuthServerApi.js.map +0 -1
  457. package/lib/esm/ProjectsApi.js.map +0 -1
  458. package/lib/esm/PromptsApi.js.map +0 -1
  459. package/lib/esm/RefsApi.js.map +0 -1
  460. package/lib/esm/RemoteMcpConnectionsApi.js.map +0 -1
  461. package/lib/esm/RunsApi.js.map +0 -1
  462. package/lib/esm/SkillsApi.js.map +0 -1
  463. package/lib/esm/StreamSource.js.map +0 -1
  464. package/lib/esm/TrainingApi.js +0 -51
  465. package/lib/esm/TrainingApi.js.map +0 -1
  466. package/lib/esm/UsersApi.js.map +0 -1
  467. package/lib/esm/client.js.map +0 -1
  468. package/lib/esm/execute.js.map +0 -1
  469. package/lib/esm/index.js.map +0 -1
  470. package/lib/esm/nodejs/NodeStreamSource.js.map +0 -1
  471. package/lib/esm/nodejs/index.js +0 -2
  472. package/lib/esm/nodejs/index.js.map +0 -1
  473. package/lib/esm/store/AgentsApi.js.map +0 -1
  474. package/lib/esm/store/AnalyzeDocApi.js.map +0 -1
  475. package/lib/esm/store/CollectionsApi.js.map +0 -1
  476. package/lib/esm/store/CommandsApi.js +0 -13
  477. package/lib/esm/store/CommandsApi.js.map +0 -1
  478. package/lib/esm/store/CostApi.js.map +0 -1
  479. package/lib/esm/store/DashboardApi.js.map +0 -1
  480. package/lib/esm/store/DataApi.js.map +0 -1
  481. package/lib/esm/store/EmailApi.js.map +0 -1
  482. package/lib/esm/store/EmbeddingsApi.js +0 -25
  483. package/lib/esm/store/EmbeddingsApi.js.map +0 -1
  484. package/lib/esm/store/FilesApi.js.map +0 -1
  485. package/lib/esm/store/IndexingApi.js.map +0 -1
  486. package/lib/esm/store/ObjectsApi.js.map +0 -1
  487. package/lib/esm/store/PendingAsksApi.js.map +0 -1
  488. package/lib/esm/store/QueryApi.js.map +0 -1
  489. package/lib/esm/store/RenderingApi.js.map +0 -1
  490. package/lib/esm/store/SchedulesApi.js.map +0 -1
  491. package/lib/esm/store/ToolsApi.js.map +0 -1
  492. package/lib/esm/store/TypeCatalogApi.js.map +0 -1
  493. package/lib/esm/store/TypesApi.js.map +0 -1
  494. package/lib/esm/store/WorkersApi.js +0 -12
  495. package/lib/esm/store/WorkersApi.js.map +0 -1
  496. package/lib/esm/store/WorkflowsApi.js.map +0 -1
  497. package/lib/esm/store/client.js.map +0 -1
  498. package/lib/esm/store/errors.js +0 -7
  499. package/lib/esm/store/errors.js.map +0 -1
  500. package/lib/esm/store/index.js +0 -18
  501. package/lib/esm/store/index.js.map +0 -1
  502. package/lib/esm/store/version.js.map +0 -1
  503. package/lib/tsconfig.tsbuildinfo +0 -1
  504. package/lib/types/AccountApi.d.ts.map +0 -1
  505. package/lib/types/AccountsApi.d.ts.map +0 -1
  506. package/lib/types/AnalyticsApi.d.ts.map +0 -1
  507. package/lib/types/ApiKeysApi.d.ts.map +0 -1
  508. package/lib/types/AppsApi.d.ts.map +0 -1
  509. package/lib/types/AuditTrailApi.d.ts.map +0 -1
  510. package/lib/types/CommandsApi.d.ts.map +0 -1
  511. package/lib/types/EnvironmentsApi.d.ts.map +0 -1
  512. package/lib/types/GroupsApi.d.ts.map +0 -1
  513. package/lib/types/IamApi.d.ts +0 -36
  514. package/lib/types/IamApi.d.ts.map +0 -1
  515. package/lib/types/InteractionBase.d.ts.map +0 -1
  516. package/lib/types/InteractionCatalogApi.d.ts.map +0 -1
  517. package/lib/types/InteractionOutput.d.ts.map +0 -1
  518. package/lib/types/InteractionResult.example.d.ts.map +0 -1
  519. package/lib/types/InteractionsApi.d.ts.map +0 -1
  520. package/lib/types/OAuthClientsApi.d.ts.map +0 -1
  521. package/lib/types/OAuthGrantsApi.d.ts.map +0 -1
  522. package/lib/types/OAuthProvidersApi.d.ts.map +0 -1
  523. package/lib/types/OAuthServerApi.d.ts +0 -10
  524. package/lib/types/OAuthServerApi.d.ts.map +0 -1
  525. package/lib/types/ProjectsApi.d.ts.map +0 -1
  526. package/lib/types/PromptsApi.d.ts.map +0 -1
  527. package/lib/types/RefsApi.d.ts +0 -6
  528. package/lib/types/RefsApi.d.ts.map +0 -1
  529. package/lib/types/RemoteMcpConnectionsApi.d.ts.map +0 -1
  530. package/lib/types/RunsApi.d.ts.map +0 -1
  531. package/lib/types/SkillsApi.d.ts.map +0 -1
  532. package/lib/types/StreamSource.d.ts.map +0 -1
  533. package/lib/types/TrainingApi.d.ts.map +0 -1
  534. package/lib/types/UsersApi.d.ts.map +0 -1
  535. package/lib/types/client.d.ts.map +0 -1
  536. package/lib/types/execute.d.ts.map +0 -1
  537. package/lib/types/index.d.ts.map +0 -1
  538. package/lib/types/nodejs/NodeStreamSource.d.ts.map +0 -1
  539. package/lib/types/nodejs/index.d.ts +0 -1
  540. package/lib/types/nodejs/index.d.ts.map +0 -1
  541. package/lib/types/store/AgentsApi.d.ts.map +0 -1
  542. package/lib/types/store/AnalyzeDocApi.d.ts.map +0 -1
  543. package/lib/types/store/CollectionsApi.d.ts.map +0 -1
  544. package/lib/types/store/CommandsApi.d.ts +0 -10
  545. package/lib/types/store/CommandsApi.d.ts.map +0 -1
  546. package/lib/types/store/CostApi.d.ts.map +0 -1
  547. package/lib/types/store/DashboardApi.d.ts.map +0 -1
  548. package/lib/types/store/DataApi.d.ts.map +0 -1
  549. package/lib/types/store/EmailApi.d.ts.map +0 -1
  550. package/lib/types/store/EmbeddingsApi.d.ts +0 -12
  551. package/lib/types/store/EmbeddingsApi.d.ts.map +0 -1
  552. package/lib/types/store/FilesApi.d.ts.map +0 -1
  553. package/lib/types/store/HiveMemoryApi.d.ts.map +0 -1
  554. package/lib/types/store/IndexingApi.d.ts.map +0 -1
  555. package/lib/types/store/ObjectsApi.d.ts.map +0 -1
  556. package/lib/types/store/PendingAsksApi.d.ts.map +0 -1
  557. package/lib/types/store/QueryApi.d.ts.map +0 -1
  558. package/lib/types/store/RenderingApi.d.ts.map +0 -1
  559. package/lib/types/store/SchedulesApi.d.ts.map +0 -1
  560. package/lib/types/store/ToolsApi.d.ts.map +0 -1
  561. package/lib/types/store/TypeCatalogApi.d.ts.map +0 -1
  562. package/lib/types/store/TypesApi.d.ts.map +0 -1
  563. package/lib/types/store/WorkersApi.d.ts +0 -6
  564. package/lib/types/store/WorkersApi.d.ts.map +0 -1
  565. package/lib/types/store/WorkflowsApi.d.ts.map +0 -1
  566. package/lib/types/store/client.d.ts +0 -57
  567. package/lib/types/store/client.d.ts.map +0 -1
  568. package/lib/types/store/errors.d.ts.map +0 -1
  569. package/lib/types/store/index.d.ts +0 -17
  570. package/lib/types/store/index.d.ts.map +0 -1
  571. package/lib/types/store/version.d.ts.map +0 -1
  572. package/src/store/CommandsApi.ts +0 -15
  573. package/src/store/WorkersApi.ts +0 -17
  574. /package/lib/{esm/ApiKeysApi.js → ApiKeysApi.js} +0 -0
  575. /package/lib/{esm/OAuthGrantsApi.js → OAuthGrantsApi.js} +0 -0
  576. /package/lib/{esm/OAuthProvidersApi.js → OAuthProvidersApi.js} +0 -0
  577. /package/lib/{esm/StreamSource.js → StreamSource.js} +0 -0
  578. /package/lib/{esm/store → store}/CostApi.js +0 -0
  579. /package/lib/{esm/store → store}/version.js +0 -0
@@ -1,51 +1,59 @@
1
- import { ApiTopic, ClientBase } from '@vertesia/api-fetch-client';
1
+ import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
2
2
  import {
3
- ActiveWorkstreamsQueryResult,
4
- AgentEvent,
5
- AgentArtifactUrlResponse,
6
- AgentMessage,
7
- AgentMessageType,
8
- AgentRun,
9
- AgentRunDetailsStreamEvent,
10
- AgentRunInternals,
11
- AgentRunUpdatesResponse,
12
- CompactMessage,
13
- CreateAgentRunPayload,
14
- ErrorAnalyticsResponse,
15
- FirstResponseBehaviorAnalyticsResponse,
16
- LatencyAnalyticsResponse,
17
- ListAgentRunsQuery,
18
- ListAgentRunsResponse,
19
- ListWorkflowRunsResponse,
3
+ type ActiveWorkstreamsQueryResult,
4
+ type AgentArtifactUrlResponse,
5
+ type AgentEvent,
6
+ type AgentMessage,
7
+ type AgentRun,
8
+ type AgentRunDetailsStreamEvent,
9
+ type AgentRunInternals,
10
+ type AgentRunResponse,
11
+ type AgentRunUpdatesResponse,
12
+ type BindRunWorkflowPayload,
13
+ type CompactMessage,
14
+ type CreateAgentRunPayload,
15
+ type CreateProcessRunPayload,
16
+ type ErrorAnalyticsResponse,
17
+ type FirstResponseBehaviorAnalyticsResponse,
18
+ type IngestAgentEventsPayload,
19
+ type IngestAgentEventsResponse,
20
+ type LatencyAnalyticsResponse,
21
+ type ListAgentRunsQuery,
22
+ type ListAgentRunsResponse,
23
+ type ListWorkflowRunsResponse,
24
+ type PostAgentRunUpdatePayload,
25
+ type PostAgentRunUpdateResponse,
26
+ type ProcessRun,
27
+ type ProcessState,
28
+ type PromptSizeAnalyticsResponse,
20
29
  parseMessage,
21
- PromptSizeAnalyticsResponse,
22
- PostAgentRunUpdatePayload,
23
- PostAgentRunUpdateResponse,
24
- RecordAgentRunPayload,
25
- RunsByAgentAnalyticsResponse,
26
- SearchAgentRunsQuery,
27
- SearchAgentRunsResponse,
28
- SignalAgentPayload,
29
- SignalAgentResponse,
30
- TimeToFirstResponseAnalyticsResponse,
31
- TerminateAgentRunResponse,
30
+ type RecordAgentRunPayload,
31
+ type RecordProcessRunPayload,
32
+ type RecordRunPayload,
33
+ type RunsByAgentAnalyticsResponse,
34
+ type SearchAgentRunsQuery,
35
+ type SearchAgentRunsResponse,
36
+ type SignalAgentPayload,
37
+ type SignalAgentResponse,
38
+ type TerminateAgentRunResponse,
39
+ type TimeToFirstResponseAnalyticsResponse,
40
+ type TokenUsageAnalyticsResponse,
41
+ type ToolAnalyticsResponse,
42
+ type ToolParameterAnalyticsResponse,
43
+ type TopPrincipalsAnalyticsResponse,
32
44
  toAgentMessage,
33
- TokenUsageAnalyticsResponse,
34
- ToolAnalyticsResponse,
35
- ToolParameterAnalyticsResponse,
36
- TopPrincipalsAnalyticsResponse,
37
- UpdateAgentRunStatusPayload,
38
- WorkflowAnalyticsFilterOptionsResponse,
39
- WorkflowAnalyticsSummaryQuery,
40
- WorkflowAnalyticsSummaryResponse,
41
- WorkflowAnalyticsTimeSeriesQuery,
42
- WorkflowRunWithDetails,
43
- WorkflowToolParametersQuery,
44
- IngestAgentEventsPayload,
45
- IngestAgentEventsResponse,
45
+ type UpdateAgentRunStatusPayload,
46
+ type WorkflowAnalyticsFilterOptionsResponse,
47
+ type WorkflowAnalyticsSummaryQuery,
48
+ type WorkflowAnalyticsSummaryResponse,
49
+ type WorkflowAnalyticsTimeSeriesQuery,
50
+ type WorkflowRunWithDetails,
51
+ type WorkflowToolParametersQuery,
46
52
  } from '@vertesia/common';
47
- import { VertesiaClient } from '../client.js';
53
+ import type { VertesiaClient } from '../client.js';
48
54
  import { EventSourceProvider } from '../execute.js';
55
+ import { fetchSignedUrl } from './signed-url.js';
56
+ import { shouldCloseAgentRunStream, shouldCloseCompactRunStream } from './stream-termination.js';
49
57
 
50
58
  export class AgentsApi extends ApiTopic {
51
59
  constructor(parent: ClientBase) {
@@ -60,20 +68,32 @@ export class AgentsApi extends ApiTopic {
60
68
  * Create and start a new agent run.
61
69
  * Returns the created AgentRun with its stable id.
62
70
  */
71
+ start<TData = Record<string, unknown>>(payload: CreateAgentRunPayload<TData>): Promise<AgentRun<TData>>;
72
+ start<TData = Record<string, unknown>>(payload: CreateProcessRunPayload<TData>): Promise<ProcessRun>;
63
73
  start<TData = Record<string, unknown>>(
64
- payload: CreateAgentRunPayload<TData>,
65
- ): Promise<AgentRun<TData>> {
74
+ payload: CreateAgentRunPayload<TData> | CreateProcessRunPayload<TData>,
75
+ ): Promise<AgentRun<TData> | ProcessRun> {
66
76
  return this.post('/', { payload });
67
77
  }
68
78
 
69
79
  /**
70
- * Record an AgentRun for an already-running workflow (e.g. schedule-triggered).
71
- * Only creates the MongoDB document the workflow passes its own Temporal IDs.
80
+ * Record a run for an already-running workflow. This only creates the
81
+ * MongoDB document; the caller owns the Temporal workflow ids.
82
+ *
83
+ * @internal
72
84
  */
73
- createRecord(payload: RecordAgentRunPayload): Promise<AgentRun> {
85
+ recordRun<TData = Record<string, unknown>>(payload: RecordAgentRunPayload<TData>): Promise<AgentRun<TData>>;
86
+ recordRun<TData = Record<string, unknown>>(payload: RecordProcessRunPayload<TData>): Promise<ProcessRun>;
87
+ recordRun<TData = Record<string, unknown>>(
88
+ payload: RecordRunPayload<TData>,
89
+ ): Promise<AgentRun<TData> | ProcessRun> {
74
90
  return this.post('/record', { payload });
75
91
  }
76
92
 
93
+ createRecord(payload: RecordAgentRunPayload): Promise<AgentRun> {
94
+ return this.recordRun(payload);
95
+ }
96
+
77
97
  /**
78
98
  * Get agent run by id.
79
99
  */
@@ -81,10 +101,34 @@ export class AgentsApi extends ApiTopic {
81
101
  return this.get(`/${id}`);
82
102
  }
83
103
 
104
+ /**
105
+ * Get any agent run by id, preserving the agent/process discriminator.
106
+ */
107
+ retrieveRun<TData = Record<string, unknown>, TProperties = Record<string, unknown>>(
108
+ id: string,
109
+ ): Promise<AgentRunResponse<TData, TProperties>> {
110
+ return this.get(`/${id}`);
111
+ }
112
+
113
+ retrieveProcess(id: string): Promise<ProcessRun> {
114
+ return this.get(`/${id}`);
115
+ }
116
+
84
117
  /**
85
118
  * List agent runs with optional filters.
86
119
  */
87
120
  list(query?: ListAgentRunsQuery): Promise<ListAgentRunsResponse> {
121
+ return this.get('/', { query: this.buildListQueryParams(query) });
122
+ }
123
+
124
+ async listProcessRuns(query?: Omit<ListAgentRunsQuery, 'run_kind'>): Promise<ProcessRun[]> {
125
+ const response: ListAgentRunsResponse = await this.get('/', {
126
+ query: this.buildListQueryParams({ ...query, run_kind: 'process' }),
127
+ });
128
+ return response.items.filter(isProcessRunResponse);
129
+ }
130
+
131
+ private buildListQueryParams(query?: ListAgentRunsQuery): Record<string, string> {
88
132
  const params: Record<string, string> = {};
89
133
  if (query?.id) params.id = query.id;
90
134
  if (query?.status) {
@@ -96,12 +140,15 @@ export class AgentsApi extends ApiTopic {
96
140
  if (query?.until) params.until = query.until.toISOString();
97
141
  if (query?.schedule_id) params.schedule_id = query.schedule_id;
98
142
  if (query?.type) params.type = query.type;
143
+ if (query?.run_type)
144
+ params.run_type = Array.isArray(query.run_type) ? query.run_type.join(',') : query.run_type;
145
+ if (query?.run_kind) params.run_kind = query.run_kind;
99
146
  if (query?.limit) params.limit = String(query.limit);
100
147
  if (query?.offset) params.offset = String(query.offset);
101
148
  if (query?.cursor) params.cursor = query.cursor;
102
149
  if (query?.sort) params.sort = query.sort;
103
150
  if (query?.order) params.order = query.order;
104
- return this.get('/', { query: params });
151
+ return params;
105
152
  }
106
153
 
107
154
  /**
@@ -122,6 +169,7 @@ export class AgentsApi extends ApiTopic {
122
169
  if (query?.until) params.until = query.until.toISOString();
123
170
  if (query?.limit) params.limit = String(query.limit);
124
171
  if (query?.offset) params.offset = String(query.offset);
172
+ if (query?.sort?.length) params.sort = query.sort.join(',');
125
173
  return this.get('/search', { query: params });
126
174
  }
127
175
 
@@ -150,24 +198,55 @@ export class AgentsApi extends ApiTopic {
150
198
  return this.post(`/${id}/fork`, {});
151
199
  }
152
200
 
201
+ getContext(id: string): Promise<{ run_id: string; current_node: string; context: Record<string, unknown> }> {
202
+ return this.get(`/${id}/context`);
203
+ }
204
+
205
+ getHistory(id: string): Promise<{
206
+ run_id: string;
207
+ current_node: string;
208
+ node_history: ProcessState['node_history'];
209
+ node_history_ref?: ProcessState['node_history_ref'];
210
+ }> {
211
+ return this.get(`/${id}/history`);
212
+ }
213
+
214
+ advance(id: string, payload?: { target?: string; reason?: string }): Promise<{ message: string }> {
215
+ return this.post(`/${id}/advance`, { payload: payload ?? {} });
216
+ }
217
+
218
+ retryNode(id: string, payload?: { node?: string; reason?: string }): Promise<{ message: string }> {
219
+ return this.post(`/${id}/retry-node`, { payload: payload ?? {} });
220
+ }
221
+
222
+ answerTask(id: string, taskId: string, result: Record<string, unknown>): Promise<{ message: string }> {
223
+ return this.post(`/${id}/answer-task`, { payload: { task_id: taskId, result } });
224
+ }
225
+
153
226
  /**
154
227
  * Update agent run status/metadata.
155
228
  * Called by workflow activities to sync lifecycle state.
156
229
  */
157
- updateStatus(
158
- id: string,
159
- update: UpdateAgentRunStatusPayload,
160
- ): Promise<AgentRun> {
230
+ updateStatus(id: string, update: UpdateAgentRunStatusPayload): Promise<AgentRun | ProcessRun> {
161
231
  return this.post(`/${id}/status`, { payload: update });
162
232
  }
163
233
 
234
+ /**
235
+ * Attach Temporal workflow run ids to a pre-created run record.
236
+ *
237
+ * @internal
238
+ */
239
+ bindWorkflowRun(id: string, payload: BindRunWorkflowPayload): Promise<AgentRun | ProcessRun> {
240
+ return this.post(`/${id}/workflow`, { payload });
241
+ }
242
+
164
243
  // ========================================================================
165
244
  // Communication
166
245
  // ========================================================================
167
246
 
168
247
  /**
169
248
  * Send a signal to a running agent.
170
- * Signals: "UserInput", "Stop", "FileUploaded"
249
+ * Signals: "UserInput", "Stop", "FileUploaded", "FileRemoved"
171
250
  */
172
251
  sendSignal(id: string, signalName: string, payload?: SignalAgentPayload): Promise<SignalAgentResponse> {
173
252
  return this.post(`/${id}/signal/${signalName}`, { payload });
@@ -198,7 +277,7 @@ export class AgentsApi extends ApiTopic {
198
277
  */
199
278
  async retrieveMessages(id: string, since?: number): Promise<AgentMessage[]> {
200
279
  const query = since ? { since } : undefined;
201
- const response = await this.get(`/${id}/updates`, { query }) as AgentRunUpdatesResponse;
280
+ const response = (await this.get(`/${id}/updates`, { query })) as AgentRunUpdatesResponse;
202
281
  return response.messages.map((m: CompactMessage) => toAgentMessage(m, id));
203
282
  }
204
283
 
@@ -245,16 +324,28 @@ export class AgentsApi extends ApiTopic {
245
324
  const maxDelay = 30000;
246
325
 
247
326
  const calculateBackoffDelay = (attempts: number): number => {
248
- const exponentialDelay = Math.min(baseDelay * Math.pow(2, attempts), maxDelay);
327
+ const exponentialDelay = Math.min(baseDelay * 2 ** attempts, maxDelay);
249
328
  const jitter = Math.random() * 0.1 * exponentialDelay;
250
329
  return exponentialDelay + jitter;
251
330
  };
252
331
 
253
332
  const cleanup = () => {
254
- if (reconnectTimer) { clearTimeout(reconnectTimer); reconnectTimer = null; }
255
- if (interval) { clearInterval(interval); interval = null; }
256
- if (currentSse) { currentSse.close(); currentSse = null; }
257
- if (signal && abortHandler) { signal.removeEventListener('abort', abortHandler); abortHandler = null; }
333
+ if (reconnectTimer) {
334
+ clearTimeout(reconnectTimer);
335
+ reconnectTimer = null;
336
+ }
337
+ if (interval) {
338
+ clearInterval(interval);
339
+ interval = null;
340
+ }
341
+ if (currentSse) {
342
+ currentSse.close();
343
+ currentSse = null;
344
+ }
345
+ if (signal && abortHandler) {
346
+ signal.removeEventListener('abort', abortHandler);
347
+ abortHandler = null;
348
+ }
258
349
  };
259
350
 
260
351
  const exit = (payload: unknown) => {
@@ -265,9 +356,71 @@ export class AgentsApi extends ApiTopic {
265
356
  }
266
357
  };
267
358
 
359
+ // SSE reconnection exhausted. The run is durable and still executing
360
+ // server-side — only the live view dropped. Failing fatally here aborts
361
+ // headless consumers (CLI `agents stream`, agent test harnesses) before
362
+ // they can read the result. Instead degrade gracefully: poll GET /updates
363
+ // for any messages we missed and exit cleanly once the run is terminal,
364
+ // even if the terminal message never streamed.
365
+ const POLL_INTERVAL_MS = 5000;
366
+ const isTerminalStatus = (status: unknown): boolean =>
367
+ typeof status === 'string' && ['completed', 'failed', 'cancelled'].includes(status);
368
+ const degradeToPolling = (reason: unknown) => {
369
+ if (isClosed) return;
370
+ cleanup();
371
+ console.warn(
372
+ `Agent stream ${id}: SSE unavailable after ${maxReconnectAttempts} attempts; falling back to /updates polling.`,
373
+ reason instanceof Error ? reason.message : reason,
374
+ );
375
+ const tick = async () => {
376
+ if (isClosed) return;
377
+ try {
378
+ const recent = await this.retrieveMessages(id, lastMessageTimestamp || undefined);
379
+ for (const msg of recent) {
380
+ if (isClosed) return;
381
+ if ((msg.timestamp || 0) <= lastMessageTimestamp) continue;
382
+ lastMessageTimestamp = msg.timestamp || lastMessageTimestamp;
383
+ if (onMessage) onMessage(msg, exit);
384
+ if (isClosed) return;
385
+ if (shouldCloseAgentRunStream(msg, id)) {
386
+ exit(null);
387
+ return;
388
+ }
389
+ }
390
+ } catch {
391
+ // transient poll error — retry next tick
392
+ }
393
+ if (isClosed) return;
394
+ // Exit even when no terminal message ever streams, by reading the run record.
395
+ try {
396
+ const run = (await this.get(`/${id}`)) as { status?: unknown };
397
+ if (isTerminalStatus(run?.status)) {
398
+ exit(null);
399
+ return;
400
+ }
401
+ } catch {
402
+ // ignore — retry next tick
403
+ }
404
+ if (!isClosed) {
405
+ reconnectTimer = setTimeout(() => {
406
+ reconnectTimer = null;
407
+ void tick();
408
+ }, POLL_INTERVAL_MS);
409
+ }
410
+ };
411
+ void tick();
412
+ };
413
+
268
414
  if (signal) {
269
- if (signal.aborted) { isClosed = true; cleanup(); resolveFn(null); return promise; }
270
- abortHandler = () => { exit(null); };
415
+ if (signal.aborted) {
416
+ isClosed = true;
417
+ cleanup();
418
+ resolveFn(null);
419
+ return promise;
420
+ }
421
+ abortHandler = () => {
422
+ exit(null);
423
+ };
271
424
  signal.addEventListener('abort', abortHandler, { once: true });
272
425
  }
273
426
 
@@ -281,11 +434,7 @@ export class AgentsApi extends ApiTopic {
281
434
  if (onMessage) onMessage(msg, exit);
282
435
  if (isClosed) break;
283
436
 
284
- const workstreamId = msg.workstream_id || 'main';
285
- const streamIsOver =
286
- msg.type === AgentMessageType.TERMINATED ||
287
- (msg.type === AgentMessageType.COMPLETE && workstreamId === 'main');
288
- if (streamIsOver) {
437
+ if (shouldCloseAgentRunStream(msg, id)) {
289
438
  exit(null);
290
439
  return promise;
291
440
  }
@@ -304,7 +453,7 @@ export class AgentsApi extends ApiTopic {
304
453
  const EventSourceImpl = await EventSourceProvider();
305
454
  if (isClosed) return;
306
455
  const client = this.client as VertesiaClient;
307
- const streamUrl = new URL(client.agents.baseUrl + `/${id}/stream`);
456
+ const streamUrl = new URL(`${client.agents.baseUrl}/${id}/stream`);
308
457
 
309
458
  if (lastMessageTimestamp > 0) {
310
459
  streamUrl.searchParams.set('since', lastMessageTimestamp.toString());
@@ -324,13 +473,15 @@ export class AgentsApi extends ApiTopic {
324
473
  streamUrl.searchParams.set('access_token', token);
325
474
 
326
475
  if (isReconnect) {
327
- console.log(`Reconnecting to agent stream ${id} (attempt ${reconnectAttempts + 1}/${maxReconnectAttempts})`);
476
+ console.log(
477
+ `Reconnecting to agent stream ${id} (attempt ${reconnectAttempts + 1}/${maxReconnectAttempts})`,
478
+ );
328
479
  }
329
480
 
330
481
  if (isClosed) return;
331
482
  const sse = new EventSourceImpl(streamUrl.href);
332
483
  currentSse = sse;
333
- interval = setInterval(() => { }, 1000);
484
+ interval = setInterval(() => {}, 1000);
334
485
 
335
486
  let connectionOpenedAt = 0;
336
487
 
@@ -356,11 +507,7 @@ export class AgentsApi extends ApiTopic {
356
507
  onMessage(agentMessage, exit);
357
508
  }
358
509
 
359
- const workstreamId = compactMessage.w || 'main';
360
- const streamIsOver =
361
- compactMessage.t === AgentMessageType.TERMINATED ||
362
- (compactMessage.t === AgentMessageType.COMPLETE && workstreamId === 'main');
363
- if (streamIsOver) {
510
+ if (shouldCloseCompactRunStream(compactMessage, id)) {
364
511
  exit(null);
365
512
  }
366
513
  } catch (err) {
@@ -386,12 +533,12 @@ export class AgentsApi extends ApiTopic {
386
533
  reconnectAttempts++;
387
534
  reconnectTimer = setTimeout(() => {
388
535
  reconnectTimer = null;
389
- if (!isClosed) setupStream(true);
536
+ if (!isClosed) void setupStream(true);
390
537
  }, delay);
391
538
  } else {
392
- isClosed = true;
393
- cleanup();
394
- rejectFn(new Error(`SSE connection failed after ${maxReconnectAttempts} reconnection attempts`));
539
+ degradeToPolling(
540
+ new Error(`SSE connection failed after ${maxReconnectAttempts} reconnection attempts`),
541
+ );
395
542
  }
396
543
  };
397
544
  } catch (err) {
@@ -401,17 +548,15 @@ export class AgentsApi extends ApiTopic {
401
548
  reconnectAttempts++;
402
549
  reconnectTimer = setTimeout(() => {
403
550
  reconnectTimer = null;
404
- if (!isClosed) setupStream(true);
551
+ if (!isClosed) void setupStream(true);
405
552
  }, delay);
406
553
  } else {
407
- isClosed = true;
408
- cleanup();
409
- rejectFn(err);
554
+ degradeToPolling(err);
410
555
  }
411
556
  }
412
557
  };
413
558
 
414
- setupStream(false);
559
+ void setupStream(false);
415
560
  return promise;
416
561
  }
417
562
 
@@ -435,10 +580,12 @@ export class AgentsApi extends ApiTopic {
435
580
  id: string,
436
581
  options?: {
437
582
  includeHistory?: boolean;
583
+ hydratePayloads?: boolean;
438
584
  },
439
585
  ): Promise<WorkflowRunWithDetails> {
440
586
  const query: Record<string, string> = {};
441
587
  if (options?.includeHistory) query.include_history = 'true';
588
+ if (options?.hydratePayloads) query.hydrate_payloads = 'true';
442
589
  return this.get(`/${id}/details`, { query });
443
590
  }
444
591
 
@@ -453,7 +600,7 @@ export class AgentsApi extends ApiTopic {
453
600
  ): Promise<void> {
454
601
  const EventSourceImpl = await EventSourceProvider();
455
602
  const client = this.client as VertesiaClient;
456
- const streamUrl = new URL(client.agents.baseUrl + `/${id}/details/stream`);
603
+ const streamUrl = new URL(`${client.agents.baseUrl}/${id}/details/stream`);
457
604
 
458
605
  const bearerToken = client._auth ? await client._auth() : undefined;
459
606
  if (!bearerToken) {
@@ -475,34 +622,53 @@ export class AgentsApi extends ApiTopic {
475
622
  };
476
623
 
477
624
  if (signal) {
478
- if (signal.aborted) { cleanup(); resolve(); return; }
479
- abortHandler = () => { cleanup(); resolve(); };
625
+ if (signal.aborted) {
626
+ cleanup();
627
+ resolve();
628
+ return;
629
+ }
630
+ abortHandler = () => {
631
+ cleanup();
632
+ resolve();
633
+ };
480
634
  signal.addEventListener('abort', abortHandler, { once: true });
481
635
  }
482
636
 
483
637
  sse.addEventListener('history', (ev: MessageEvent) => {
484
638
  try {
485
- const data = JSON.parse(ev.data) as Extract<AgentRunDetailsStreamEvent, { type: 'history' }>['data'];
639
+ const data = JSON.parse(ev.data) as Extract<
640
+ AgentRunDetailsStreamEvent,
641
+ { type: 'history' }
642
+ >['data'];
486
643
  if (onEvent) onEvent({ type: 'history', data });
487
- } catch (_err) { /* ignore parse errors */ }
644
+ } catch (_err) {
645
+ /* ignore parse errors */
646
+ }
488
647
  });
489
648
 
490
649
  sse.addEventListener('control', (ev: MessageEvent) => {
491
650
  try {
492
- const data = JSON.parse(ev.data) as Extract<AgentRunDetailsStreamEvent, { type: 'control' }>['data'];
651
+ const data = JSON.parse(ev.data) as Extract<
652
+ AgentRunDetailsStreamEvent,
653
+ { type: 'control' }
654
+ >['data'];
493
655
  if (onEvent) onEvent({ type: 'control', data });
494
656
  if ('type' in data && data.type === 'done') {
495
657
  cleanup();
496
658
  resolve();
497
659
  }
498
- } catch (_err) { /* ignore parse errors */ }
660
+ } catch (_err) {
661
+ /* ignore parse errors */
662
+ }
499
663
  });
500
664
 
501
665
  sse.addEventListener('error', (ev: MessageEvent) => {
502
666
  try {
503
667
  const data = JSON.parse(ev.data) as Extract<AgentRunDetailsStreamEvent, { type: 'error' }>['data'];
504
668
  if (onEvent) onEvent({ type: 'error', data });
505
- } catch (_err) { /* ignore parse errors */ }
669
+ } catch (_err) {
670
+ /* ignore parse errors */
671
+ }
506
672
  });
507
673
 
508
674
  sse.onerror = (_err: unknown) => {
@@ -513,7 +679,7 @@ export class AgentsApi extends ApiTopic {
513
679
  }
514
680
 
515
681
  /**
516
- * List child workflows (sub-agents) for an agent run.
682
+ * List child workflows for an agent or process run.
517
683
  */
518
684
  listChildren(id: string): Promise<ListWorkflowRunsResponse> {
519
685
  return this.get(`/${id}/children`);
@@ -521,15 +687,16 @@ export class AgentsApi extends ApiTopic {
521
687
 
522
688
  /**
523
689
  * Get details for a specific child workflow.
524
- * Serves from GCS archive when available, falls back to Temporal.
690
+ * Serves from the child run record when available, falls back to archive or Temporal.
525
691
  */
526
692
  getChildDetails(
527
693
  id: string,
528
694
  childWorkflowId: string,
529
- options?: { includeHistory?: boolean },
695
+ options?: { includeHistory?: boolean; hydratePayloads?: boolean },
530
696
  ): Promise<WorkflowRunWithDetails> {
531
697
  const query: Record<string, string> = {};
532
698
  if (options?.includeHistory) query.include_history = 'true';
699
+ if (options?.hydratePayloads) query.hydrate_payloads = 'true';
533
700
  return this.get(`/${id}/children/${childWorkflowId}/details`, { query });
534
701
  }
535
702
 
@@ -582,12 +749,12 @@ export class AgentsApi extends ApiTopic {
582
749
  const mimeType = contentType || 'application/octet-stream';
583
750
 
584
751
  // 1. Get signed upload URL from the agents API
585
- const result = await this.put(`/${id}/artifacts/${path}`, {
752
+ const result = (await this.put(`/${id}/artifacts/${path}`, {
586
753
  headers: { 'Content-Type': mimeType },
587
- }) as AgentArtifactUrlResponse;
754
+ })) as AgentArtifactUrlResponse;
588
755
 
589
756
  // 2. Upload directly to cloud storage
590
- const res = await fetch(result.url, {
757
+ const res = await fetchSignedUrl(result.url, {
591
758
  method: 'PUT',
592
759
  body: content,
593
760
  headers: { 'Content-Type': mimeType },
@@ -603,12 +770,9 @@ export class AgentsApi extends ApiTopic {
603
770
  /**
604
771
  * Download an artifact from an agent run.
605
772
  */
606
- async downloadArtifact(
607
- id: string,
608
- path: string,
609
- ): Promise<ReadableStream<Uint8Array>> {
773
+ async downloadArtifact(id: string, path: string): Promise<ReadableStream<Uint8Array>> {
610
774
  const { url } = await this.getArtifactUrl(id, path, 'attachment');
611
- const res = await fetch(url);
775
+ const res = await fetchSignedUrl(url);
612
776
  if (!res.ok) {
613
777
  throw new Error(`Failed to download artifact: ${res.statusText}`);
614
778
  }
@@ -626,10 +790,7 @@ export class AgentsApi extends ApiTopic {
626
790
  * Ingest telemetry events for an agent run.
627
791
  * Workers use this to send telemetry to zeno-server for BigQuery storage.
628
792
  */
629
- ingestEvents(
630
- agentRunId: string,
631
- events: AgentEvent[],
632
- ): Promise<IngestAgentEventsResponse> {
793
+ ingestEvents(agentRunId: string, events: AgentEvent[]): Promise<IngestAgentEventsResponse> {
633
794
  const payload: IngestAgentEventsPayload = { events };
634
795
  return this.post(`/${agentRunId}/events`, { payload });
635
796
  }
@@ -642,9 +803,7 @@ export class AgentsApi extends ApiTopic {
642
803
  * Get analytics summary.
643
804
  * Returns overall metrics including token usage, success rates, and run counts.
644
805
  */
645
- getAnalyticsSummary(
646
- query: WorkflowAnalyticsSummaryQuery = {}
647
- ): Promise<WorkflowAnalyticsSummaryResponse> {
806
+ getAnalyticsSummary(query: WorkflowAnalyticsSummaryQuery = {}): Promise<WorkflowAnalyticsSummaryResponse> {
648
807
  return this.post('/analytics/summary', { payload: query });
649
808
  }
650
809
 
@@ -652,9 +811,7 @@ export class AgentsApi extends ApiTopic {
652
811
  * Get token usage analytics.
653
812
  * Returns token consumption metrics by model, agent, tool, or over time.
654
813
  */
655
- getTokenUsageAnalytics(
656
- query: WorkflowAnalyticsTimeSeriesQuery = {}
657
- ): Promise<TokenUsageAnalyticsResponse> {
814
+ getTokenUsageAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<TokenUsageAnalyticsResponse> {
658
815
  return this.post('/analytics/tokens', { payload: query });
659
816
  }
660
817
 
@@ -662,9 +819,7 @@ export class AgentsApi extends ApiTopic {
662
819
  * Get LLM latency analytics.
663
820
  * Returns duration/latency metrics for LLM calls.
664
821
  */
665
- getLlmLatencyAnalytics(
666
- query: WorkflowAnalyticsTimeSeriesQuery = {}
667
- ): Promise<LatencyAnalyticsResponse> {
822
+ getLlmLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
668
823
  return this.post('/analytics/latency/llm', { payload: query });
669
824
  }
670
825
 
@@ -672,9 +827,7 @@ export class AgentsApi extends ApiTopic {
672
827
  * Get tool latency analytics.
673
828
  * Returns duration/latency metrics for tool calls.
674
829
  */
675
- getToolLatencyAnalytics(
676
- query: WorkflowAnalyticsTimeSeriesQuery = {}
677
- ): Promise<LatencyAnalyticsResponse> {
830
+ getToolLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
678
831
  return this.post('/analytics/latency/tools', { payload: query });
679
832
  }
680
833
 
@@ -682,9 +835,7 @@ export class AgentsApi extends ApiTopic {
682
835
  * Get agent latency analytics.
683
836
  * Returns duration metrics for complete agent runs.
684
837
  */
685
- getAgentLatencyAnalytics(
686
- query: WorkflowAnalyticsTimeSeriesQuery = {}
687
- ): Promise<LatencyAnalyticsResponse> {
838
+ getAgentLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
688
839
  return this.post('/analytics/latency/agents', { payload: query });
689
840
  }
690
841
 
@@ -692,9 +843,7 @@ export class AgentsApi extends ApiTopic {
692
843
  * Get error analytics.
693
844
  * Returns error rates, types, and trends.
694
845
  */
695
- getErrorAnalytics(
696
- query: WorkflowAnalyticsTimeSeriesQuery = {}
697
- ): Promise<ErrorAnalyticsResponse> {
846
+ getErrorAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<ErrorAnalyticsResponse> {
698
847
  return this.post('/analytics/errors', { payload: query });
699
848
  }
700
849
 
@@ -702,9 +851,7 @@ export class AgentsApi extends ApiTopic {
702
851
  * Get tool usage analytics.
703
852
  * Returns tool invocation counts, success rates, and performance metrics.
704
853
  */
705
- getToolAnalytics(
706
- query: WorkflowAnalyticsSummaryQuery = {}
707
- ): Promise<ToolAnalyticsResponse> {
854
+ getToolAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<ToolAnalyticsResponse> {
708
855
  return this.post('/analytics/tools', { payload: query });
709
856
  }
710
857
 
@@ -712,9 +859,7 @@ export class AgentsApi extends ApiTopic {
712
859
  * Get tool parameter analytics.
713
860
  * Returns parameter value distributions for a specific tool.
714
861
  */
715
- getToolParameterAnalytics(
716
- query: WorkflowToolParametersQuery
717
- ): Promise<ToolParameterAnalyticsResponse> {
862
+ getToolParameterAnalytics(query: WorkflowToolParametersQuery): Promise<ToolParameterAnalyticsResponse> {
718
863
  return this.post('/analytics/tools/parameters', { payload: query });
719
864
  }
720
865
 
@@ -723,7 +868,7 @@ export class AgentsApi extends ApiTopic {
723
868
  * Returns unique agents, environments, and models from telemetry data.
724
869
  */
725
870
  getAnalyticsFilterOptions(
726
- query: WorkflowAnalyticsSummaryQuery = {}
871
+ query: WorkflowAnalyticsSummaryQuery = {},
727
872
  ): Promise<WorkflowAnalyticsFilterOptionsResponse> {
728
873
  return this.post('/analytics/filter-options', { payload: query });
729
874
  }
@@ -732,9 +877,7 @@ export class AgentsApi extends ApiTopic {
732
877
  * Get average prompt size (input tokens) by agent for startConversation calls.
733
878
  * This represents the initial prompt + tools size.
734
879
  */
735
- getPromptSizeAnalytics(
736
- query: WorkflowAnalyticsSummaryQuery = {}
737
- ): Promise<PromptSizeAnalyticsResponse> {
880
+ getPromptSizeAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<PromptSizeAnalyticsResponse> {
738
881
  return this.post('/analytics/prompt-size', { payload: query });
739
882
  }
740
883
 
@@ -742,9 +885,7 @@ export class AgentsApi extends ApiTopic {
742
885
  * Get top principals (users/API keys) who started the most agent runs.
743
886
  * Returns the top N principals sorted by run count descending.
744
887
  */
745
- getTopPrincipalsAnalytics(
746
- query: WorkflowAnalyticsSummaryQuery = {}
747
- ): Promise<TopPrincipalsAnalyticsResponse> {
888
+ getTopPrincipalsAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<TopPrincipalsAnalyticsResponse> {
748
889
  return this.post('/analytics/top-principals', { payload: query });
749
890
  }
750
891
 
@@ -752,9 +893,7 @@ export class AgentsApi extends ApiTopic {
752
893
  * Get agent run distribution - how many runs per agent/interaction type.
753
894
  * Returns the top N agents sorted by run count descending.
754
895
  */
755
- getRunsByAgentAnalytics(
756
- query: WorkflowAnalyticsSummaryQuery = {}
757
- ): Promise<RunsByAgentAnalyticsResponse> {
896
+ getRunsByAgentAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<RunsByAgentAnalyticsResponse> {
758
897
  return this.post('/analytics/runs-by-agent', { payload: query });
759
898
  }
760
899
 
@@ -764,7 +903,7 @@ export class AgentsApi extends ApiTopic {
764
903
  * Returns average, min, max, median, p95, and p99 metrics.
765
904
  */
766
905
  getTimeToFirstResponseAnalytics(
767
- query: WorkflowAnalyticsTimeSeriesQuery = {}
906
+ query: WorkflowAnalyticsTimeSeriesQuery = {},
768
907
  ): Promise<TimeToFirstResponseAnalyticsResponse> {
769
908
  return this.post('/analytics/time-to-first-response', { payload: query });
770
909
  }
@@ -776,9 +915,12 @@ export class AgentsApi extends ApiTopic {
776
915
  * - Percentage of agents that return no tool calls at start
777
916
  */
778
917
  getFirstResponseBehaviorAnalytics(
779
- query: WorkflowAnalyticsTimeSeriesQuery = {}
918
+ query: WorkflowAnalyticsTimeSeriesQuery = {},
780
919
  ): Promise<FirstResponseBehaviorAnalyticsResponse> {
781
920
  return this.post('/analytics/first-response-behavior', { payload: query });
782
921
  }
922
+ }
783
923
 
924
+ function isProcessRunResponse(run: AgentRunResponse): run is ProcessRun {
925
+ return run.run_kind === 'process';
784
926
  }