@trigger.dev/core 0.0.0-prerelease-streamfix-20260909094302 → 0.0.0-prerelease-20260911094758

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 (305) hide show
  1. package/dist/commonjs/schemas/eventFilter.d.ts +27 -105
  2. package/dist/commonjs/schemas/eventFilter.js +38 -38
  3. package/dist/commonjs/schemas/eventFilter.js.map +1 -1
  4. package/dist/commonjs/schemas/json.d.ts +3 -3
  5. package/dist/commonjs/schemas/json.js +20 -12
  6. package/dist/commonjs/schemas/json.js.map +1 -1
  7. package/dist/commonjs/v3/apiClient/core.d.ts +14 -14
  8. package/dist/commonjs/v3/apiClient/core.js +39 -18
  9. package/dist/commonjs/v3/apiClient/core.js.map +1 -1
  10. package/dist/commonjs/v3/apiClient/encodeTaskIdForPath.d.ts +6 -0
  11. package/dist/commonjs/v3/apiClient/encodeTaskIdForPath.js +20 -0
  12. package/dist/commonjs/v3/apiClient/encodeTaskIdForPath.js.map +1 -0
  13. package/dist/commonjs/v3/apiClient/index.d.ts +82 -184
  14. package/dist/commonjs/v3/apiClient/index.js +27 -8
  15. package/dist/commonjs/v3/apiClient/index.js.map +1 -1
  16. package/dist/commonjs/v3/apiClient/stream.d.ts +4 -4
  17. package/dist/commonjs/v3/apiClient/stream.js.map +1 -1
  18. package/dist/commonjs/v3/errors.d.ts +5 -4
  19. package/dist/commonjs/v3/errors.js.map +1 -1
  20. package/dist/commonjs/v3/index.d.ts +1 -1
  21. package/dist/commonjs/v3/index.js.map +1 -1
  22. package/dist/commonjs/v3/realtimeStreams/sessionStreamInstance.js +3 -0
  23. package/dist/commonjs/v3/realtimeStreams/sessionStreamInstance.js.map +1 -1
  24. package/dist/commonjs/v3/realtimeStreams/streamsWriterV1.js +3 -0
  25. package/dist/commonjs/v3/realtimeStreams/streamsWriterV1.js.map +1 -1
  26. package/dist/commonjs/v3/realtimeStreams/streamsWriterV2.js +4 -0
  27. package/dist/commonjs/v3/realtimeStreams/streamsWriterV2.js.map +1 -1
  28. package/dist/commonjs/v3/runEngineWorker/supervisor/http.d.ts +24 -114
  29. package/dist/commonjs/v3/runEngineWorker/supervisor/http.js +2 -11
  30. package/dist/commonjs/v3/runEngineWorker/supervisor/http.js.map +1 -1
  31. package/dist/commonjs/v3/runEngineWorker/supervisor/schemas.d.ts +594 -4187
  32. package/dist/commonjs/v3/runEngineWorker/supervisor/schemas.js +84 -67
  33. package/dist/commonjs/v3/runEngineWorker/supervisor/schemas.js.map +1 -1
  34. package/dist/commonjs/v3/runEngineWorker/workload/http.d.ts +15 -110
  35. package/dist/commonjs/v3/runEngineWorker/workload/http.js +8 -16
  36. package/dist/commonjs/v3/runEngineWorker/workload/http.js.map +1 -1
  37. package/dist/commonjs/v3/runEngineWorker/workload/schemas.d.ts +465 -3624
  38. package/dist/commonjs/v3/runEngineWorker/workload/schemas.js +10 -9
  39. package/dist/commonjs/v3/runEngineWorker/workload/schemas.js.map +1 -1
  40. package/dist/commonjs/v3/schemas/api.d.ts +1865 -12681
  41. package/dist/commonjs/v3/schemas/api.js +1017 -943
  42. package/dist/commonjs/v3/schemas/api.js.map +1 -1
  43. package/dist/commonjs/v3/schemas/build.d.ts +645 -9115
  44. package/dist/commonjs/v3/schemas/build.js +71 -71
  45. package/dist/commonjs/v3/schemas/build.js.map +1 -1
  46. package/dist/commonjs/v3/schemas/checkpoints.d.ts +121 -461
  47. package/dist/commonjs/v3/schemas/checkpoints.js +11 -11
  48. package/dist/commonjs/v3/schemas/checkpoints.js.map +1 -1
  49. package/dist/commonjs/v3/schemas/common.d.ts +1018 -6499
  50. package/dist/commonjs/v3/schemas/common.js +225 -218
  51. package/dist/commonjs/v3/schemas/common.js.map +1 -1
  52. package/dist/commonjs/v3/schemas/config.d.ts +3 -9
  53. package/dist/commonjs/v3/schemas/config.js +4 -4
  54. package/dist/commonjs/v3/schemas/config.js.map +1 -1
  55. package/dist/commonjs/v3/schemas/errors.d.ts +42 -173
  56. package/dist/commonjs/v3/schemas/errors.js +44 -44
  57. package/dist/commonjs/v3/schemas/errors.js.map +1 -1
  58. package/dist/commonjs/v3/schemas/eventFilter.d.ts +23 -91
  59. package/dist/commonjs/v3/schemas/eventFilter.js +35 -35
  60. package/dist/commonjs/v3/schemas/eventFilter.js.map +1 -1
  61. package/dist/commonjs/v3/schemas/fetch.d.ts +119 -415
  62. package/dist/commonjs/v3/schemas/fetch.js +17 -14
  63. package/dist/commonjs/v3/schemas/fetch.js.map +1 -1
  64. package/dist/commonjs/v3/schemas/messages.d.ts +603 -7438
  65. package/dist/commonjs/v3/schemas/messages.js +50 -50
  66. package/dist/commonjs/v3/schemas/messages.js.map +1 -1
  67. package/dist/commonjs/v3/schemas/openTelemetry.d.ts +50 -401
  68. package/dist/commonjs/v3/schemas/openTelemetry.js +32 -32
  69. package/dist/commonjs/v3/schemas/openTelemetry.js.map +1 -1
  70. package/dist/commonjs/v3/schemas/query.d.ts +51 -273
  71. package/dist/commonjs/v3/schemas/query.js +41 -40
  72. package/dist/commonjs/v3/schemas/query.js.map +1 -1
  73. package/dist/commonjs/v3/schemas/queues.d.ts +29 -100
  74. package/dist/commonjs/v3/schemas/queues.js +22 -22
  75. package/dist/commonjs/v3/schemas/queues.js.map +1 -1
  76. package/dist/commonjs/v3/schemas/reports.d.ts +150 -692
  77. package/dist/commonjs/v3/schemas/reports.js +55 -55
  78. package/dist/commonjs/v3/schemas/reports.js.map +1 -1
  79. package/dist/commonjs/v3/schemas/resources.d.ts +533 -5985
  80. package/dist/commonjs/v3/schemas/resources.js +49 -49
  81. package/dist/commonjs/v3/schemas/resources.js.map +1 -1
  82. package/dist/commonjs/v3/schemas/runEngine.d.ts +467 -1822
  83. package/dist/commonjs/v3/schemas/runEngine.js +113 -109
  84. package/dist/commonjs/v3/schemas/runEngine.js.map +1 -1
  85. package/dist/commonjs/v3/schemas/scheduleWindow.d.ts +2 -2
  86. package/dist/commonjs/v3/schemas/scheduleWindow.js +3 -3
  87. package/dist/commonjs/v3/schemas/scheduleWindow.js.map +1 -1
  88. package/dist/commonjs/v3/schemas/schemas.d.ts +788 -7456
  89. package/dist/commonjs/v3/schemas/schemas.js +133 -132
  90. package/dist/commonjs/v3/schemas/schemas.js.map +1 -1
  91. package/dist/commonjs/v3/schemas/snapshotRoute.d.ts +33 -0
  92. package/dist/commonjs/v3/schemas/snapshotRoute.js +33 -0
  93. package/dist/commonjs/v3/schemas/snapshotRoute.js.map +1 -0
  94. package/dist/commonjs/v3/schemas/style.d.ts +24 -86
  95. package/dist/commonjs/v3/schemas/style.js +12 -12
  96. package/dist/commonjs/v3/schemas/style.js.map +1 -1
  97. package/dist/commonjs/v3/schemas/tokens.d.ts +5 -31
  98. package/dist/commonjs/v3/schemas/tokens.js +10 -10
  99. package/dist/commonjs/v3/schemas/tokens.js.map +1 -1
  100. package/dist/commonjs/v3/schemas/warmStart.d.ts +2 -8
  101. package/dist/commonjs/v3/schemas/warmStart.js +4 -4
  102. package/dist/commonjs/v3/schemas/warmStart.js.map +1 -1
  103. package/dist/commonjs/v3/schemas/webhookApi.d.ts +75 -249
  104. package/dist/commonjs/v3/schemas/webhookApi.js +41 -41
  105. package/dist/commonjs/v3/schemas/webhookApi.js.map +1 -1
  106. package/dist/commonjs/v3/schemas/webhookConfig.d.ts +473 -3309
  107. package/dist/commonjs/v3/schemas/webhookConfig.js +79 -78
  108. package/dist/commonjs/v3/schemas/webhookConfig.js.map +1 -1
  109. package/dist/commonjs/v3/schemas/webhookFilter.d.ts +16 -4
  110. package/dist/commonjs/v3/schemas/webhookFilter.js +16 -16
  111. package/dist/commonjs/v3/schemas/webhookFilter.js.map +1 -1
  112. package/dist/commonjs/v3/schemas/webhooks.d.ts +247 -2055
  113. package/dist/commonjs/v3/schemas/webhooks.js +116 -115
  114. package/dist/commonjs/v3/schemas/webhooks.js.map +1 -1
  115. package/dist/commonjs/v3/serverOnly/httpServer.d.ts +19 -8
  116. package/dist/commonjs/v3/serverOnly/httpServer.js +6 -3
  117. package/dist/commonjs/v3/serverOnly/httpServer.js.map +1 -1
  118. package/dist/commonjs/v3/sessionStreams/chatSnapshot.d.ts +163 -16
  119. package/dist/commonjs/v3/sessionStreams/chatSnapshot.js +332 -8
  120. package/dist/commonjs/v3/sessionStreams/chatSnapshot.js.map +1 -1
  121. package/dist/commonjs/v3/sessionStreams/router.d.ts +39 -1
  122. package/dist/commonjs/v3/sessionStreams/router.js +62 -0
  123. package/dist/commonjs/v3/sessionStreams/router.js.map +1 -1
  124. package/dist/commonjs/v3/sessionStreams/wireProtocol.d.ts +15 -0
  125. package/dist/commonjs/v3/sessionStreams/wireProtocol.js +16 -1
  126. package/dist/commonjs/v3/sessionStreams/wireProtocol.js.map +1 -1
  127. package/dist/commonjs/v3/test/test-session-stream-manager.js +5 -1
  128. package/dist/commonjs/v3/test/test-session-stream-manager.js.map +1 -1
  129. package/dist/commonjs/v3/types/schemas.d.ts +21 -1
  130. package/dist/commonjs/v3/types/schemas.js +2 -1
  131. package/dist/commonjs/v3/types/schemas.js.map +1 -1
  132. package/dist/commonjs/v3/types/tools.d.ts +16 -5
  133. package/dist/commonjs/v3/types/tools.js +2 -2
  134. package/dist/commonjs/v3/types/tools.js.map +1 -1
  135. package/dist/commonjs/v3/utils/ioSerialization.js +3 -3
  136. package/dist/commonjs/v3/utils/ioSerialization.js.map +1 -1
  137. package/dist/commonjs/v3/utils/zod.d.ts +8 -0
  138. package/dist/commonjs/v3/utils/zod.js +8 -0
  139. package/dist/commonjs/v3/utils/zod.js.map +1 -0
  140. package/dist/commonjs/v3/workloadDeploymentToken.d.ts +2 -21
  141. package/dist/commonjs/v3/workloadDeploymentToken.js +10 -10
  142. package/dist/commonjs/v3/workloadDeploymentToken.js.map +1 -1
  143. package/dist/commonjs/v3/zodIpc.d.ts +6 -6
  144. package/dist/commonjs/v3/zodIpc.js +20 -18
  145. package/dist/commonjs/v3/zodIpc.js.map +1 -1
  146. package/dist/commonjs/v3/zodMessageHandler.d.ts +14 -21
  147. package/dist/commonjs/v3/zodMessageHandler.js +20 -7
  148. package/dist/commonjs/v3/zodMessageHandler.js.map +1 -1
  149. package/dist/commonjs/v3/zodSocket.d.ts +11 -11
  150. package/dist/commonjs/v3/zodSocket.js +9 -8
  151. package/dist/commonjs/v3/zodSocket.js.map +1 -1
  152. package/dist/commonjs/version.js +1 -1
  153. package/dist/esm/schemas/eventFilter.d.ts +27 -105
  154. package/dist/esm/schemas/eventFilter.js +2 -2
  155. package/dist/esm/schemas/eventFilter.js.map +1 -1
  156. package/dist/esm/schemas/json.d.ts +3 -3
  157. package/dist/esm/schemas/json.js +11 -3
  158. package/dist/esm/schemas/json.js.map +1 -1
  159. package/dist/esm/v3/apiClient/core.d.ts +14 -14
  160. package/dist/esm/v3/apiClient/core.js +38 -17
  161. package/dist/esm/v3/apiClient/core.js.map +1 -1
  162. package/dist/esm/v3/apiClient/encodeTaskIdForPath.d.ts +6 -0
  163. package/dist/esm/v3/apiClient/encodeTaskIdForPath.js +17 -0
  164. package/dist/esm/v3/apiClient/encodeTaskIdForPath.js.map +1 -0
  165. package/dist/esm/v3/apiClient/index.d.ts +82 -184
  166. package/dist/esm/v3/apiClient/index.js +22 -4
  167. package/dist/esm/v3/apiClient/index.js.map +1 -1
  168. package/dist/esm/v3/apiClient/stream.d.ts +4 -4
  169. package/dist/esm/v3/apiClient/stream.js.map +1 -1
  170. package/dist/esm/v3/errors.d.ts +5 -4
  171. package/dist/esm/v3/errors.js.map +1 -1
  172. package/dist/esm/v3/index.d.ts +1 -1
  173. package/dist/esm/v3/index.js.map +1 -1
  174. package/dist/esm/v3/realtimeStreams/sessionStreamInstance.js +3 -0
  175. package/dist/esm/v3/realtimeStreams/sessionStreamInstance.js.map +1 -1
  176. package/dist/esm/v3/realtimeStreams/streamsWriterV1.js +3 -0
  177. package/dist/esm/v3/realtimeStreams/streamsWriterV1.js.map +1 -1
  178. package/dist/esm/v3/realtimeStreams/streamsWriterV2.js +4 -0
  179. package/dist/esm/v3/realtimeStreams/streamsWriterV2.js.map +1 -1
  180. package/dist/esm/v3/runEngineWorker/supervisor/http.d.ts +24 -114
  181. package/dist/esm/v3/runEngineWorker/supervisor/http.js +1 -10
  182. package/dist/esm/v3/runEngineWorker/supervisor/http.js.map +1 -1
  183. package/dist/esm/v3/runEngineWorker/supervisor/schemas.d.ts +594 -4187
  184. package/dist/esm/v3/runEngineWorker/supervisor/schemas.js +22 -5
  185. package/dist/esm/v3/runEngineWorker/supervisor/schemas.js.map +1 -1
  186. package/dist/esm/v3/runEngineWorker/workload/http.d.ts +15 -110
  187. package/dist/esm/v3/runEngineWorker/workload/http.js +8 -16
  188. package/dist/esm/v3/runEngineWorker/workload/http.js.map +1 -1
  189. package/dist/esm/v3/runEngineWorker/workload/schemas.d.ts +465 -3624
  190. package/dist/esm/v3/runEngineWorker/workload/schemas.js +5 -4
  191. package/dist/esm/v3/runEngineWorker/workload/schemas.js.map +1 -1
  192. package/dist/esm/v3/schemas/api.d.ts +1865 -12681
  193. package/dist/esm/v3/schemas/api.js +109 -35
  194. package/dist/esm/v3/schemas/api.js.map +1 -1
  195. package/dist/esm/v3/schemas/build.d.ts +645 -9115
  196. package/dist/esm/v3/schemas/build.js +10 -10
  197. package/dist/esm/v3/schemas/build.js.map +1 -1
  198. package/dist/esm/v3/schemas/checkpoints.d.ts +121 -461
  199. package/dist/esm/v3/schemas/checkpoints.js +1 -1
  200. package/dist/esm/v3/schemas/checkpoints.js.map +1 -1
  201. package/dist/esm/v3/schemas/common.d.ts +1018 -6499
  202. package/dist/esm/v3/schemas/common.js +17 -10
  203. package/dist/esm/v3/schemas/common.js.map +1 -1
  204. package/dist/esm/v3/schemas/config.d.ts +3 -9
  205. package/dist/esm/v3/schemas/config.js +1 -1
  206. package/dist/esm/v3/schemas/config.js.map +1 -1
  207. package/dist/esm/v3/schemas/errors.d.ts +42 -173
  208. package/dist/esm/v3/schemas/errors.js +1 -1
  209. package/dist/esm/v3/schemas/errors.js.map +1 -1
  210. package/dist/esm/v3/schemas/eventFilter.d.ts +23 -91
  211. package/dist/esm/v3/schemas/eventFilter.js +2 -2
  212. package/dist/esm/v3/schemas/eventFilter.js.map +1 -1
  213. package/dist/esm/v3/schemas/fetch.d.ts +119 -415
  214. package/dist/esm/v3/schemas/fetch.js +6 -3
  215. package/dist/esm/v3/schemas/fetch.js.map +1 -1
  216. package/dist/esm/v3/schemas/messages.d.ts +603 -7438
  217. package/dist/esm/v3/schemas/messages.js +3 -3
  218. package/dist/esm/v3/schemas/messages.js.map +1 -1
  219. package/dist/esm/v3/schemas/openTelemetry.d.ts +50 -401
  220. package/dist/esm/v3/schemas/openTelemetry.js +2 -2
  221. package/dist/esm/v3/schemas/openTelemetry.js.map +1 -1
  222. package/dist/esm/v3/schemas/query.d.ts +51 -273
  223. package/dist/esm/v3/schemas/query.js +4 -3
  224. package/dist/esm/v3/schemas/query.js.map +1 -1
  225. package/dist/esm/v3/schemas/queues.d.ts +29 -100
  226. package/dist/esm/v3/schemas/queues.js +1 -1
  227. package/dist/esm/v3/schemas/queues.js.map +1 -1
  228. package/dist/esm/v3/schemas/reports.d.ts +150 -692
  229. package/dist/esm/v3/schemas/reports.js +5 -5
  230. package/dist/esm/v3/schemas/reports.js.map +1 -1
  231. package/dist/esm/v3/schemas/resources.d.ts +533 -5985
  232. package/dist/esm/v3/schemas/resources.js +3 -3
  233. package/dist/esm/v3/schemas/resources.js.map +1 -1
  234. package/dist/esm/v3/schemas/runEngine.d.ts +467 -1822
  235. package/dist/esm/v3/schemas/runEngine.js +11 -3
  236. package/dist/esm/v3/schemas/runEngine.js.map +1 -1
  237. package/dist/esm/v3/schemas/scheduleWindow.d.ts +2 -2
  238. package/dist/esm/v3/schemas/scheduleWindow.js +1 -1
  239. package/dist/esm/v3/schemas/scheduleWindow.js.map +1 -1
  240. package/dist/esm/v3/schemas/schemas.d.ts +788 -7456
  241. package/dist/esm/v3/schemas/schemas.js +11 -10
  242. package/dist/esm/v3/schemas/schemas.js.map +1 -1
  243. package/dist/esm/v3/schemas/snapshotRoute.d.ts +33 -0
  244. package/dist/esm/v3/schemas/snapshotRoute.js +30 -0
  245. package/dist/esm/v3/schemas/snapshotRoute.js.map +1 -0
  246. package/dist/esm/v3/schemas/style.d.ts +24 -86
  247. package/dist/esm/v3/schemas/style.js +1 -1
  248. package/dist/esm/v3/schemas/style.js.map +1 -1
  249. package/dist/esm/v3/schemas/tokens.d.ts +5 -31
  250. package/dist/esm/v3/schemas/tokens.js +1 -1
  251. package/dist/esm/v3/schemas/tokens.js.map +1 -1
  252. package/dist/esm/v3/schemas/warmStart.d.ts +2 -8
  253. package/dist/esm/v3/schemas/warmStart.js +1 -1
  254. package/dist/esm/v3/schemas/warmStart.js.map +1 -1
  255. package/dist/esm/v3/schemas/webhookApi.d.ts +75 -249
  256. package/dist/esm/v3/schemas/webhookApi.js +2 -2
  257. package/dist/esm/v3/schemas/webhookApi.js.map +1 -1
  258. package/dist/esm/v3/schemas/webhookConfig.d.ts +473 -3309
  259. package/dist/esm/v3/schemas/webhookConfig.js +10 -9
  260. package/dist/esm/v3/schemas/webhookConfig.js.map +1 -1
  261. package/dist/esm/v3/schemas/webhookFilter.d.ts +16 -4
  262. package/dist/esm/v3/schemas/webhookFilter.js +1 -1
  263. package/dist/esm/v3/schemas/webhookFilter.js.map +1 -1
  264. package/dist/esm/v3/schemas/webhooks.d.ts +247 -2055
  265. package/dist/esm/v3/schemas/webhooks.js +3 -2
  266. package/dist/esm/v3/schemas/webhooks.js.map +1 -1
  267. package/dist/esm/v3/serverOnly/httpServer.d.ts +19 -8
  268. package/dist/esm/v3/serverOnly/httpServer.js +5 -2
  269. package/dist/esm/v3/serverOnly/httpServer.js.map +1 -1
  270. package/dist/esm/v3/sessionStreams/chatSnapshot.d.ts +163 -16
  271. package/dist/esm/v3/sessionStreams/chatSnapshot.js +318 -2
  272. package/dist/esm/v3/sessionStreams/chatSnapshot.js.map +1 -1
  273. package/dist/esm/v3/sessionStreams/router.d.ts +39 -1
  274. package/dist/esm/v3/sessionStreams/router.js +62 -0
  275. package/dist/esm/v3/sessionStreams/router.js.map +1 -1
  276. package/dist/esm/v3/sessionStreams/wireProtocol.d.ts +15 -0
  277. package/dist/esm/v3/sessionStreams/wireProtocol.js +15 -0
  278. package/dist/esm/v3/sessionStreams/wireProtocol.js.map +1 -1
  279. package/dist/esm/v3/test/test-session-stream-manager.js +5 -1
  280. package/dist/esm/v3/test/test-session-stream-manager.js.map +1 -1
  281. package/dist/esm/v3/types/schemas.d.ts +21 -1
  282. package/dist/esm/v3/types/schemas.js +2 -1
  283. package/dist/esm/v3/types/schemas.js.map +1 -1
  284. package/dist/esm/v3/types/tools.d.ts +16 -5
  285. package/dist/esm/v3/types/tools.js +2 -2
  286. package/dist/esm/v3/types/tools.js.map +1 -1
  287. package/dist/esm/v3/utils/ioSerialization.js +1 -1
  288. package/dist/esm/v3/utils/ioSerialization.js.map +1 -1
  289. package/dist/esm/v3/utils/zod.d.ts +8 -0
  290. package/dist/esm/v3/utils/zod.js +5 -0
  291. package/dist/esm/v3/utils/zod.js.map +1 -0
  292. package/dist/esm/v3/workloadDeploymentToken.d.ts +2 -21
  293. package/dist/esm/v3/workloadDeploymentToken.js +1 -1
  294. package/dist/esm/v3/workloadDeploymentToken.js.map +1 -1
  295. package/dist/esm/v3/zodIpc.d.ts +6 -6
  296. package/dist/esm/v3/zodIpc.js +5 -3
  297. package/dist/esm/v3/zodIpc.js.map +1 -1
  298. package/dist/esm/v3/zodMessageHandler.d.ts +14 -21
  299. package/dist/esm/v3/zodMessageHandler.js +16 -3
  300. package/dist/esm/v3/zodMessageHandler.js.map +1 -1
  301. package/dist/esm/v3/zodSocket.d.ts +11 -11
  302. package/dist/esm/v3/zodSocket.js +3 -2
  303. package/dist/esm/v3/zodSocket.js.map +1 -1
  304. package/dist/esm/version.js +1 -1
  305. package/package.json +7 -3
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateArtifactResponseBody = exports.CreateArtifactRequestBody = exports.UpsertBranchResponseBody = exports.UpsertBranchRequestBody = exports.DeploymentTriggeredVia = exports.ExternalBuildData = exports.CancelDeploymentRequestBody = exports.ProgressDeploymentRequestBody = exports.BuildServerMetadata = exports.FinalizeDeploymentRequestBody = exports.StartDeploymentIndexingResponseBody = exports.StartDeploymentIndexingRequestBody = exports.GetEnvironmentVariablesResponseBody = exports.RescheduleRunRequestBody = exports.AddTagsRequestBody = exports.GetBatchResponseBody = exports.BatchTriggerTaskResponse = exports.StreamBatchItemsResponse = exports.BatchItemNDJSON = exports.CreateBatchResponse = exports.CreateBatchRequestBody = exports.BatchTriggerTaskV3Response = exports.BatchTriggerTaskV3RequestBody = exports.BatchTriggerTaskV2Response = exports.BatchTriggerTaskV2RequestBody = exports.BatchTriggerTaskItem = exports.BatchTriggerTaskRequestBody = exports.TriggerTaskResponse = exports.TriggerTaskRequestBody = exports.IdempotencyKeyOptionsSchema = exports.RunTags = exports.CreateBackgroundWorkerResponse = exports.CreateBackgroundWorkerRequestBody = exports.GetJWTResponse = exports.GetJWTRequestBody = exports.GetWorkerByTagResponse = exports.GetWorkerTaskResponse = exports.GetProjectEnvironmentsResponseBody = exports.ProjectEnvironment = exports.GetProjectEnvResponse = exports.CreateProjectRequestBody = exports.CreateOrgResponseBody = exports.CreateOrgRequestBody = exports.GetOrgsResponseBody = exports.GetProjectRuntimesResponseBody = exports.NODE_RUNTIME_UPDATE_MAJOR = exports.GetProjectsResponseBody = exports.GetProjectResponseBody = exports.WhoAmIResponseSchema = exports.RunEngineVersion = void 0;
4
- exports.BulkActionStatus = exports.CreateBulkActionRequestBody = exports.ListRunResponse = exports.ListRunResponseItem = exports.RetrieveRunResponse = exports.RelatedRunDetails = exports.TriggerFunction = exports.RunScheduleDetails = exports.RunEnvironmentDetails = exports.AttemptStatus = exports.RunStatus = exports.TimezonesResult = exports.ListScheduleOptions = exports.ListSchedulesResult = exports.DeletedScheduleObject = exports.ScheduleObject = exports.ScheduleGenerator = exports.UpdateScheduleOptions = exports.CreateScheduleOptions = exports.ScheduledTaskPayload = exports.ScheduleType = exports.ResetIdempotencyKeyResponse = exports.CanceledRunResponse = exports.ReplayRunResponse = exports.DevDisconnectResponseBody = exports.DevDisconnectRequestBody = exports.DevDequeueResponseBody = exports.DevDequeueRequestBody = exports.DevConfigResponseBody = exports.WorkersCreateResponseBody = exports.WorkersCreateRequestBody = exports.WorkersListResponseBody = exports.CreateUploadPayloadUrlResponseBody = exports.DeploymentEventFromString = exports.DeploymentEvent = exports.DeploymentFinalizedEvent = exports.DeploymentLogEvent = exports.GetLatestDeploymentResponseBody = exports.GetDeploymentBuildEnvVarsResponseBody = exports.GetDeploymentResponseBody = exports.PromoteDeploymentResponseBody = exports.FailDeploymentResponseBody = exports.FailDeploymentRequestBody = exports.DeploymentErrorData = exports.GenerateRegistryCredentialsResponseBody = exports.RemoteBuildProviderStatusResponseBody = exports.GetDeploySettingsResponseBody = exports.DeployBuildPath = exports.InitializeDeploymentRequestBody = exports.InitializeDeploymentResponseBody = void 0;
5
- exports.WaitForDurationRequestBody = exports.WaitForWaitpointTokenResponseBody = exports.CompleteWaitpointTokenResponseBody = exports.ListSessionsResponseBody = exports.ListedSessionItem = exports.ListSessionsOptions = exports.ListSessionsQueryParams = exports.SessionStatus = exports.CloseSessionRequestBody = exports.UpdateSessionRequestBody = exports.EndAndContinueSessionResponseBody = exports.EndAndContinueSessionRequestBody = exports.RetrieveSessionResponseBody = exports.CreatedSessionResponseBody = exports.SessionItem = exports.CreateSessionRequestBody = exports.SessionTriggerConfig = exports.CompleteWaitpointTokenRequestBody = exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem = exports.WaitpointTokenItem = exports.WaitpointTokenStatus = exports.waitpointTokenStatuses = exports.CreateSessionStreamWaitpointResponseBody = exports.CreateSessionStreamWaitpointRequestBody = exports.CreateInputStreamWaitpointResponseBody = exports.CreateInputStreamWaitpointRequestBody = exports.CreateWaitpointTokenResponseBody = exports.CreateWaitpointTokenRequestBody = exports.TimePeriod = exports.SubscribeRealtimeStreamChunkRawShape = exports.RetrieveBatchV2Response = exports.RetrieveBatchResponse = exports.BatchStatus = exports.SubscribeRunRawShape = exports.UpdateMetadataResponseBody = exports.UpdateMetadataRequestBody = exports.EnvironmentVariableWithSecret = exports.EnvironmentVariables = exports.EnvironmentVariable = exports.EnvironmentVariableValue = exports.EnvironmentVariableResponseBody = exports.ImportEnvironmentVariablesRequestBody = exports.UpdateEnvironmentVariableRequestBody = exports.CreateEnvironmentVariableRequestBody = exports.ListBulkActionsResponseBody = exports.AbortBulkActionResponseBody = exports.CreateBulkActionResponseBody = exports.BulkActionObject = exports.BulkActionType = void 0;
6
- exports.PromptOverrideCreatedResponseBody = exports.PromptOkResponseBody = exports.ReactivatePromptOverrideRequestBody = exports.UpdatePromptOverrideRequestBody = exports.CreatePromptOverrideRequestBody = exports.PromotePromptVersionRequestBody = exports.ListPromptVersionsResponseBody = exports.ListPromptsResponseBody = exports.ResolvePromptResponseBody = exports.ResolvePromptRequestBody = exports.ReadSessionStreamRecordsResponseBody = exports.SendInputStreamResponseBody = exports.AppendToStreamResponseBody = exports.CreateStreamResponseBody = exports.RetrieveSpanDetailResponseBody = exports.RetrieveRunTraceResponseBody = exports.RetrieveRunTraceSpan = exports.RetrieveRunTraceSpanSchema = exports.ApiBranchListResponseBody = exports.RetrieveCurrentDeploymentResponseBody = exports.ApiDeploymentListResponseItem = exports.ApiDeploymentListSearchParams = exports.ApiDeploymentListOptions = exports.ApiDeploymentListParams = exports.WaitForDurationResponseBody = void 0;
3
+ exports.CreateArtifactRequestBody = exports.UpsertBranchResponseBody = exports.UpsertBranchRequestBody = exports.DeploymentTriggeredVia = exports.ExternalBuildData = exports.CancelDeploymentRequestBody = exports.ProgressDeploymentRequestBody = exports.GetDeploymentArtifactUrlResponseBody = exports.BuildServerMetadata = exports.FinalizeDeploymentRequestBody = exports.StartDeploymentIndexingResponseBody = exports.StartDeploymentIndexingRequestBody = exports.GetEnvironmentVariablesResponseBody = exports.RescheduleRunRequestBody = exports.AddTagsRequestBody = exports.GetBatchResponseBody = exports.BatchTriggerTaskResponse = exports.StreamBatchItemsResponse = exports.BatchItemNDJSON = exports.CreateBatchResponse = exports.CreateBatchRequestBody = exports.BatchTriggerTaskV3Response = exports.BatchTriggerTaskV3RequestBody = exports.BatchTriggerTaskV2Response = exports.BatchTriggerTaskV2RequestBody = exports.BatchTriggerTaskItem = exports.BatchTriggerTaskRequestBody = exports.TriggerTaskResponse = exports.TriggerTaskRequestBody = exports.IdempotencyKeyOptionsSchema = exports.RunTags = exports.CreateBackgroundWorkerResponse = exports.CreateBackgroundWorkerRequestBody = exports.GetJWTResponse = exports.GetJWTRequestBody = exports.GetWorkerByTagResponse = exports.GetWorkerTaskResponse = exports.GetProjectEnvironmentsResponseBody = exports.ProjectEnvironment = exports.GetProjectEnvResponse = exports.CreateProjectRequestBody = exports.CreateOrgResponseBody = exports.CreateOrgRequestBody = exports.GetOrgsResponseBody = exports.GetProjectRuntimesResponseBody = exports.NODE_RUNTIME_UPDATE_MAJOR = exports.GetProjectsResponseBody = exports.GetProjectResponseBody = exports.WhoAmIResponseSchema = exports.RunEngineVersion = void 0;
4
+ exports.ListRunResponse = exports.ListRunResponseItem = exports.RetrieveRunResponse = exports.RelatedRunDetails = exports.TriggerFunction = exports.RunScheduleDetails = exports.RunEnvironmentDetails = exports.AttemptStatus = exports.RunStatus = exports.TimezonesResult = exports.ListScheduleOptions = exports.ListSchedulesResult = exports.DeletedScheduleObject = exports.ScheduleObject = exports.ScheduleGenerator = exports.UpdateScheduleOptions = exports.CreateScheduleOptions = exports.ScheduledTaskPayload = exports.ScheduleType = exports.ResetIdempotencyKeyResponse = exports.CanceledRunResponse = exports.ReplayRunResponse = exports.DevDisconnectResponseBody = exports.DevDisconnectRequestBody = exports.DevDequeueResponseBody = exports.DevDequeueRequestBody = exports.DevConfigResponseBody = exports.WorkersCreateResponseBody = exports.WorkersCreateRequestBody = exports.WorkersListResponseBody = exports.SessionTranscriptResponseBody = exports.CreateUploadPayloadUrlResponseBody = exports.DeploymentEventFromString = exports.DeploymentEvent = exports.DeploymentFinalizedEvent = exports.DeploymentLogEvent = exports.GetLatestDeploymentResponseBody = exports.GetDeploymentBuildEnvVarsResponseBody = exports.GetDeploymentResponseBody = exports.PromoteDeploymentResponseBody = exports.FailDeploymentResponseBody = exports.FailDeploymentRequestBody = exports.DeploymentErrorData = exports.GenerateRegistryCredentialsResponseBody = exports.RemoteBuildProviderStatusResponseBody = exports.GetDeploySettingsResponseBody = exports.DeployBuildPath = exports.InitializeDeploymentRequestBody = exports.InitializeDeploymentResponseBody = exports.CreateArtifactResponseBody = void 0;
5
+ exports.CompleteWaitpointTokenResponseBody = exports.ListSessionsResponseBody = exports.ListedSessionItem = exports.ListSessionsOptions = exports.ListSessionsQueryParams = exports.SessionStatus = exports.CloseSessionRequestBody = exports.UpdateSessionRequestBody = exports.EndAndContinueSessionResponseBody = exports.EndAndContinueSessionRequestBody = exports.RetrieveSessionResponseBody = exports.CreatedSessionResponseBody = exports.SessionItem = exports.CreateSessionRequestBody = exports.SessionTriggerConfig = exports.CompleteWaitpointTokenRequestBody = exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem = exports.WaitpointTokenItem = exports.WaitpointTokenStatus = exports.waitpointTokenStatuses = exports.CreateSessionStreamWaitpointResponseBody = exports.CreateSessionStreamWaitpointRequestBody = exports.CreateInputStreamWaitpointResponseBody = exports.CreateInputStreamWaitpointRequestBody = exports.CreateWaitpointTokenResponseBody = exports.CreateWaitpointTokenRequestBody = exports.TimePeriod = exports.SubscribeRealtimeStreamChunkRawShape = exports.RetrieveBatchV2Response = exports.RetrieveBatchResponse = exports.BatchStatus = exports.SubscribeRunRawShape = exports.UpdateMetadataResponseBody = exports.UpdateMetadataRequestBody = exports.EnvironmentVariableWithSecret = exports.EnvironmentVariables = exports.EnvironmentVariable = exports.EnvironmentVariableValue = exports.EnvironmentVariableResponseBody = exports.ImportEnvironmentVariablesRequestBody = exports.UpdateEnvironmentVariableRequestBody = exports.CreateEnvironmentVariableRequestBody = exports.ListBulkActionsResponseBody = exports.AbortBulkActionResponseBody = exports.CreateBulkActionResponseBody = exports.BulkActionObject = exports.BulkActionType = exports.BulkActionStatus = exports.CreateBulkActionRequestBody = void 0;
6
+ exports.PromptOverrideCreatedResponseBody = exports.PromptOkResponseBody = exports.ReactivatePromptOverrideRequestBody = exports.UpdatePromptOverrideRequestBody = exports.CreatePromptOverrideRequestBody = exports.PromotePromptVersionRequestBody = exports.ListPromptVersionsResponseBody = exports.ListPromptsResponseBody = exports.ResolvePromptResponseBody = exports.ResolvePromptRequestBody = exports.ReadSessionStreamRecordsResponseBody = exports.SendInputStreamResponseBody = exports.AppendToStreamResponseBody = exports.CreateStreamResponseBody = exports.RetrieveSpanDetailResponseBody = exports.RetrieveRunTraceResponseBody = exports.RetrieveRunTraceSpan = exports.RetrieveRunTraceSpanSchema = exports.ApiBranchListResponseBody = exports.RetrieveCurrentDeploymentResponseBody = exports.ApiDeploymentListResponseItem = exports.ApiDeploymentListSearchParams = exports.ApiDeploymentListOptions = exports.ApiDeploymentListParams = exports.WaitForDurationResponseBody = exports.WaitForDurationRequestBody = exports.WaitForWaitpointTokenResponseBody = void 0;
7
7
  exports.nodeMajor = nodeMajor;
8
8
  exports.needsNodeRuntimeUpdate = needsNodeRuntimeUpdate;
9
9
  exports.isWaitpointOutputTimeout = isWaitpointOutputTimeout;
10
10
  exports.timeoutError = timeoutError;
11
- const zod_1 = require("zod");
11
+ const v4_1 = require("zod/v4");
12
+ const zod_js_1 = require("../utils/zod.js");
12
13
  const json_js_1 = require("../../schemas/json.js");
13
14
  const externalDeploymentId_js_1 = require("../externalDeploymentId.js");
14
15
  const common_js_1 = require("./common.js");
@@ -17,40 +18,40 @@ const runEngine_js_1 = require("./runEngine.js");
17
18
  const queues_js_1 = require("./queues.js");
18
19
  const schemas_js_1 = require("./schemas.js");
19
20
  const build_js_1 = require("./build.js");
20
- exports.RunEngineVersion = zod_1.z.union([zod_1.z.literal("V1"), zod_1.z.literal("V2")]);
21
- exports.WhoAmIResponseSchema = zod_1.z.object({
22
- userId: zod_1.z.string(),
23
- email: zod_1.z.string().email(),
24
- dashboardUrl: zod_1.z.string(),
25
- project: zod_1.z
21
+ exports.RunEngineVersion = v4_1.z.union([v4_1.z.literal("V1"), v4_1.z.literal("V2")]);
22
+ exports.WhoAmIResponseSchema = v4_1.z.object({
23
+ userId: v4_1.z.string(),
24
+ email: v4_1.z.string().email(),
25
+ dashboardUrl: v4_1.z.string(),
26
+ project: v4_1.z
26
27
  .object({
27
- name: zod_1.z.string(),
28
- url: zod_1.z.string(),
29
- orgTitle: zod_1.z.string(),
28
+ name: v4_1.z.string(),
29
+ url: v4_1.z.string(),
30
+ orgTitle: v4_1.z.string(),
30
31
  })
31
32
  .optional(),
32
33
  });
33
- exports.GetProjectResponseBody = zod_1.z.object({
34
- id: zod_1.z.string(),
35
- externalRef: zod_1.z
34
+ exports.GetProjectResponseBody = v4_1.z.object({
35
+ id: v4_1.z.string(),
36
+ externalRef: v4_1.z
36
37
  .string()
37
38
  .describe("The external reference for the project, also known as the project ref, a unique identifier starting with proj_"),
38
- name: zod_1.z.string(),
39
- slug: zod_1.z.string(),
40
- createdAt: zod_1.z.coerce.date(),
39
+ name: v4_1.z.string(),
40
+ slug: v4_1.z.string(),
41
+ createdAt: v4_1.z.coerce.date(),
41
42
  // Worker-group name of the project's default region, or null when unset
42
43
  // (the project falls back to the global platform default). Optional so a
43
44
  // newer client still parses responses from an older server that omits it.
44
- defaultRegion: zod_1.z.string().nullable().optional(),
45
+ defaultRegion: v4_1.z.string().nullable().optional(),
45
46
  defaultRuntime: build_js_1.BuildRuntime.nullable().optional(),
46
- organization: zod_1.z.object({
47
- id: zod_1.z.string(),
48
- title: zod_1.z.string(),
49
- slug: zod_1.z.string(),
50
- createdAt: zod_1.z.coerce.date(),
47
+ organization: v4_1.z.object({
48
+ id: v4_1.z.string(),
49
+ title: v4_1.z.string(),
50
+ slug: v4_1.z.string(),
51
+ createdAt: v4_1.z.coerce.date(),
51
52
  }),
52
53
  });
53
- exports.GetProjectsResponseBody = zod_1.z.array(exports.GetProjectResponseBody);
54
+ exports.GetProjectsResponseBody = v4_1.z.array(exports.GetProjectResponseBody);
54
55
  /** The Node.js major version currently targeted by the runtime update report. */
55
56
  exports.NODE_RUNTIME_UPDATE_MAJOR = 21;
56
57
  /**
@@ -80,169 +81,175 @@ function needsNodeRuntimeUpdate(runtime, runtimeVersion) {
80
81
  ? Number(configuredMajorMatch[1]) === exports.NODE_RUNTIME_UPDATE_MAJOR
81
82
  : false;
82
83
  }
83
- exports.GetProjectRuntimesResponseBody = zod_1.z.array(zod_1.z.object({
84
- organization: zod_1.z.object({
85
- title: zod_1.z.string(),
86
- slug: zod_1.z.string(),
84
+ exports.GetProjectRuntimesResponseBody = v4_1.z.array(v4_1.z.object({
85
+ organization: v4_1.z.object({
86
+ title: v4_1.z.string(),
87
+ slug: v4_1.z.string(),
87
88
  }),
88
- project: zod_1.z.object({
89
- name: zod_1.z.string(),
90
- slug: zod_1.z.string(),
91
- externalRef: zod_1.z.string(),
89
+ project: v4_1.z.object({
90
+ name: v4_1.z.string(),
91
+ slug: v4_1.z.string(),
92
+ externalRef: v4_1.z.string(),
92
93
  }),
93
- environment: zod_1.z.object({
94
- slug: zod_1.z.string(),
94
+ environment: v4_1.z.object({
95
+ slug: v4_1.z.string(),
95
96
  }),
96
- deployment: zod_1.z
97
+ deployment: v4_1.z
97
98
  .object({
98
- runtime: zod_1.z.string().nullable(),
99
- runtimeVersion: zod_1.z.string().nullable(),
100
- nodeMajor: zod_1.z.number().int().positive().nullable(),
101
- deployedAt: zod_1.z.coerce.date().nullable(),
102
- shortCode: zod_1.z.string(),
99
+ runtime: v4_1.z.string().nullable(),
100
+ runtimeVersion: v4_1.z.string().nullable(),
101
+ nodeMajor: v4_1.z.number().int().positive().nullable(),
102
+ deployedAt: v4_1.z.coerce.date().nullable(),
103
+ shortCode: v4_1.z.string(),
103
104
  })
104
105
  .nullable(),
105
106
  }));
106
- exports.GetOrgsResponseBody = zod_1.z.array(zod_1.z.object({
107
- id: zod_1.z.string(),
108
- title: zod_1.z.string(),
109
- slug: zod_1.z.string(),
110
- createdAt: zod_1.z.coerce.date(),
107
+ exports.GetOrgsResponseBody = v4_1.z.array(v4_1.z.object({
108
+ id: v4_1.z.string(),
109
+ title: v4_1.z.string(),
110
+ slug: v4_1.z.string(),
111
+ createdAt: v4_1.z.coerce.date(),
111
112
  }));
112
- exports.CreateOrgRequestBody = zod_1.z.object({
113
- title: zod_1.z.string().trim().min(3).max(50),
114
- companySize: zod_1.z.string().optional(),
115
- companyUrl: zod_1.z.string().optional(),
116
- });
117
- exports.CreateOrgResponseBody = zod_1.z.object({
118
- id: zod_1.z.string(),
119
- title: zod_1.z.string(),
120
- slug: zod_1.z.string(),
121
- createdAt: zod_1.z.coerce.date(),
122
- });
123
- exports.CreateProjectRequestBody = zod_1.z.object({
124
- name: zod_1.z
113
+ exports.CreateOrgRequestBody = v4_1.z.object({
114
+ title: v4_1.z.string().trim().min(3).max(50),
115
+ companySize: v4_1.z.string().optional(),
116
+ companyUrl: v4_1.z.string().optional(),
117
+ });
118
+ exports.CreateOrgResponseBody = v4_1.z.object({
119
+ id: v4_1.z.string(),
120
+ title: v4_1.z.string(),
121
+ slug: v4_1.z.string(),
122
+ createdAt: v4_1.z.coerce.date(),
123
+ });
124
+ exports.CreateProjectRequestBody = v4_1.z.object({
125
+ name: v4_1.z
125
126
  .string()
126
127
  .trim()
127
128
  .min(1, "Name is required")
128
129
  .max(255, "Name must be less than 255 characters"),
129
130
  });
130
- exports.GetProjectEnvResponse = zod_1.z.object({
131
- apiKey: zod_1.z.string(),
132
- name: zod_1.z.string(),
133
- apiUrl: zod_1.z.string(),
134
- projectId: zod_1.z.string(),
131
+ exports.GetProjectEnvResponse = v4_1.z.object({
132
+ apiKey: v4_1.z.string(),
133
+ name: v4_1.z.string(),
134
+ apiUrl: v4_1.z.string(),
135
+ projectId: v4_1.z.string(),
135
136
  defaultRuntime: build_js_1.BuildRuntime.nullable().optional(),
136
137
  });
137
- exports.ProjectEnvironment = zod_1.z.object({
138
- id: zod_1.z.string(),
138
+ exports.ProjectEnvironment = v4_1.z.object({
139
+ id: v4_1.z.string(),
139
140
  /// The slug used as the environment identifier in env var endpoints (e.g. "dev", "stg", "prod", "preview")
140
- slug: zod_1.z.string(),
141
- type: zod_1.z.enum(["DEVELOPMENT", "STAGING", "PREVIEW", "PRODUCTION"]),
141
+ slug: v4_1.z.string(),
142
+ type: v4_1.z.enum(["DEVELOPMENT", "STAGING", "PREVIEW", "PRODUCTION"]),
142
143
  /// Whether this is the branchable parent (preview); individual branches are not returned
143
- isBranchableEnvironment: zod_1.z.boolean(),
144
- branchName: zod_1.z.string().nullable(),
145
- paused: zod_1.z.boolean(),
144
+ isBranchableEnvironment: v4_1.z.boolean(),
145
+ branchName: v4_1.z.string().nullable(),
146
+ paused: v4_1.z.boolean(),
146
147
  });
147
- exports.GetProjectEnvironmentsResponseBody = zod_1.z.array(exports.ProjectEnvironment);
148
+ exports.GetProjectEnvironmentsResponseBody = v4_1.z.array(exports.ProjectEnvironment);
148
149
  // Zod schema for the response body type
149
- exports.GetWorkerTaskResponse = zod_1.z.object({
150
- id: zod_1.z.string(),
151
- slug: zod_1.z.string(),
152
- filePath: zod_1.z.string(),
153
- triggerSource: zod_1.z.string(),
154
- createdAt: zod_1.z.coerce.date(),
155
- payloadSchema: zod_1.z.any().nullish(),
156
- queueConfig: zod_1.z.any().nullish(),
157
- });
158
- exports.GetWorkerByTagResponse = zod_1.z.object({
159
- worker: zod_1.z.object({
160
- id: zod_1.z.string(),
161
- version: zod_1.z.string(),
162
- engine: zod_1.z.string().nullish(),
163
- sdkVersion: zod_1.z.string().nullish(),
164
- cliVersion: zod_1.z.string().nullish(),
165
- tasks: zod_1.z.array(exports.GetWorkerTaskResponse),
150
+ exports.GetWorkerTaskResponse = v4_1.z.object({
151
+ id: v4_1.z.string(),
152
+ slug: v4_1.z.string(),
153
+ filePath: v4_1.z.string(),
154
+ triggerSource: v4_1.z.string(),
155
+ createdAt: v4_1.z.coerce.date(),
156
+ payloadSchema: v4_1.z.any().nullish(),
157
+ queueConfig: v4_1.z.any().nullish(),
158
+ });
159
+ exports.GetWorkerByTagResponse = v4_1.z.object({
160
+ worker: v4_1.z.object({
161
+ id: v4_1.z.string(),
162
+ version: v4_1.z.string(),
163
+ engine: v4_1.z.string().nullish(),
164
+ sdkVersion: v4_1.z.string().nullish(),
165
+ cliVersion: v4_1.z.string().nullish(),
166
+ tasks: v4_1.z.array(exports.GetWorkerTaskResponse),
166
167
  }),
167
- urls: zod_1.z.object({
168
- runs: zod_1.z.string(),
168
+ urls: v4_1.z.object({
169
+ runs: v4_1.z.string(),
169
170
  }),
170
171
  });
171
- exports.GetJWTRequestBody = zod_1.z.object({
172
- claims: zod_1.z
172
+ exports.GetJWTRequestBody = v4_1.z.object({
173
+ claims: v4_1.z
173
174
  .object({
174
- scopes: zod_1.z.array(zod_1.z.string()).default([]),
175
+ scopes: v4_1.z.array(v4_1.z.string()).default([]),
175
176
  })
176
177
  .optional(),
177
- expirationTime: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
178
+ expirationTime: v4_1.z.union([v4_1.z.number(), v4_1.z.string()]).optional(),
178
179
  });
179
- exports.GetJWTResponse = zod_1.z.object({
180
- token: zod_1.z.string(),
180
+ exports.GetJWTResponse = v4_1.z.object({
181
+ token: v4_1.z.string(),
182
+ // The environment the exchange resolved, so a caller that named a slug learns the id.
183
+ environmentId: v4_1.z.string().optional(),
181
184
  });
182
- exports.CreateBackgroundWorkerRequestBody = zod_1.z.object({
183
- localOnly: zod_1.z.boolean(),
185
+ exports.CreateBackgroundWorkerRequestBody = v4_1.z.object({
186
+ localOnly: v4_1.z.boolean(),
184
187
  metadata: resources_js_1.BackgroundWorkerMetadata,
185
188
  engine: exports.RunEngineVersion.optional(),
186
- supportsLazyAttempts: zod_1.z.boolean().optional(),
187
- buildPlatform: zod_1.z.string().optional(),
188
- targetPlatform: zod_1.z.string().optional(),
189
+ supportsLazyAttempts: v4_1.z.boolean().optional(),
190
+ buildPlatform: v4_1.z.string().optional(),
191
+ targetPlatform: v4_1.z.string().optional(),
189
192
  });
190
- exports.CreateBackgroundWorkerResponse = zod_1.z.object({
191
- id: zod_1.z.string(),
192
- version: zod_1.z.string(),
193
- contentHash: zod_1.z.string(),
193
+ exports.CreateBackgroundWorkerResponse = v4_1.z.object({
194
+ id: v4_1.z.string(),
195
+ version: v4_1.z.string(),
196
+ contentHash: v4_1.z.string(),
194
197
  });
195
198
  //an array of 1, 2, or 3 strings
196
- const RunTag = zod_1.z.string().max(128, "Tags must be less than 128 characters");
197
- exports.RunTags = zod_1.z.union([RunTag, RunTag.array()]);
199
+ const RunTag = v4_1.z.string().max(128, "Tags must be less than 128 characters");
200
+ exports.RunTags = v4_1.z.union([RunTag, RunTag.array()]);
198
201
  /** Stores the original user-provided idempotency key and scope */
199
- exports.IdempotencyKeyOptionsSchema = zod_1.z.object({
200
- key: zod_1.z.string(),
201
- scope: zod_1.z.enum(["run", "attempt", "global"]),
202
+ exports.IdempotencyKeyOptionsSchema = v4_1.z.object({
203
+ key: v4_1.z.string(),
204
+ scope: v4_1.z.enum(["run", "attempt", "global"]),
202
205
  });
203
206
  // Coerces user-supplied concurrencyKey values to string. The downstream Prisma
204
207
  // column is String?, so passing a number (a common foot-gun when callers do
205
208
  // `concurrencyKey: payload.userId`) used to fail at `prisma.taskRun.create`
206
209
  // with PrismaClientValidationError. Accept the intent and stringify here.
207
- const ConcurrencyKeySchema = zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).transform((value) => String(value));
208
- const ExternalDeploymentId = zod_1.z.preprocess((value) => {
210
+ const ConcurrencyKeySchema = v4_1.z.union([v4_1.z.string(), v4_1.z.number()]).transform((value) => String(value));
211
+ const ExternalDeploymentId = v4_1.z.preprocess((value) => {
212
+ // `null` is the opt-out sentinel callers write; treat it as absent, not a validation error.
213
+ if (value === null) {
214
+ return undefined;
215
+ }
209
216
  if (typeof value !== "string") {
210
217
  return value;
211
218
  }
212
219
  const trimmed = value.trim();
213
220
  return trimmed === "" ? undefined : trimmed;
214
- }, zod_1.z.string().max(externalDeploymentId_js_1.EXTERNAL_DEPLOYMENT_ID_MAX_LENGTH, `externalId must be at most ${externalDeploymentId_js_1.EXTERNAL_DEPLOYMENT_ID_MAX_LENGTH} characters`).optional());
215
- exports.TriggerTaskRequestBody = zod_1.z
221
+ }, v4_1.z.string().max(externalDeploymentId_js_1.EXTERNAL_DEPLOYMENT_ID_MAX_LENGTH, `externalId must be at most ${externalDeploymentId_js_1.EXTERNAL_DEPLOYMENT_ID_MAX_LENGTH} characters`).optional());
222
+ exports.TriggerTaskRequestBody = v4_1.z
216
223
  .object({
217
- payload: zod_1.z.any(),
218
- context: zod_1.z.any(),
219
- options: zod_1.z
224
+ payload: v4_1.z.any().optional(),
225
+ context: v4_1.z.any().optional(),
226
+ options: v4_1.z
220
227
  .object({
221
228
  /** @deprecated engine v1 only */
222
- dependentAttempt: zod_1.z.string().optional(),
229
+ dependentAttempt: v4_1.z.string().optional(),
223
230
  /** @deprecated engine v1 only */
224
- parentAttempt: zod_1.z.string().optional(),
231
+ parentAttempt: v4_1.z.string().optional(),
225
232
  /** @deprecated engine v1 only */
226
- dependentBatch: zod_1.z.string().optional(),
233
+ dependentBatch: v4_1.z.string().optional(),
227
234
  /**
228
235
  * If triggered in a batch, this is the BatchTaskRun id
229
236
  */
230
- parentBatch: zod_1.z.string().optional(),
237
+ parentBatch: v4_1.z.string().optional(),
231
238
  /**
232
239
  * RunEngine v2
233
240
  * If triggered inside another run, the parentRunId is the friendly ID of the parent run.
234
241
  */
235
- parentRunId: zod_1.z.string().optional(),
242
+ parentRunId: v4_1.z.string().optional(),
236
243
  /**
237
244
  * RunEngine v2
238
245
  * Should be `true` if `triggerAndWait` or `batchTriggerAndWait`
239
246
  */
240
- resumeParentOnCompletion: zod_1.z.boolean().optional(),
247
+ resumeParentOnCompletion: v4_1.z.boolean().optional(),
241
248
  /**
242
249
  * Locks the version to the passed value.
243
250
  * Automatically set when using `triggerAndWait` or `batchTriggerAndWait`
244
251
  */
245
- lockToVersion: zod_1.z.string().optional(),
252
+ lockToVersion: v4_1.z.string().optional(),
246
253
  /**
247
254
  * The external deployment id the calling application belongs to — a commit SHA, a
248
255
  * CI run id, a release tag. Independent of `lockToVersion`: the SDK reports every
@@ -251,49 +258,49 @@ exports.TriggerTaskRequestBody = zod_1.z
251
258
  * deployment that has not landed yet parks the run rather than failing it.
252
259
  */
253
260
  externalDeploymentId: ExternalDeploymentId,
254
- queue: zod_1.z
261
+ queue: v4_1.z
255
262
  .object({
256
- name: zod_1.z.string(),
263
+ name: v4_1.z.string(),
257
264
  // @deprecated, this is now specified on the queue
258
- concurrencyLimit: zod_1.z.number().int().optional(),
265
+ concurrencyLimit: v4_1.z.number().int().optional(),
259
266
  })
260
267
  .optional(),
261
268
  concurrencyKey: ConcurrencyKeySchema.optional(),
262
- delay: zod_1.z.string().or(zod_1.z.coerce.date()).optional(),
263
- idempotencyKey: zod_1.z
269
+ delay: v4_1.z.string().or(v4_1.z.coerce.date()).optional(),
270
+ idempotencyKey: v4_1.z
264
271
  .string()
265
272
  // Caps user-supplied keys before they reach the unique idempotency index
266
273
  // on the underlying table — values past this fail at the database layer
267
274
  // rather than returning a clean 400.
268
275
  .max(2048, "idempotencyKey must be 2048 characters or less")
269
276
  .optional(),
270
- idempotencyKeyTTL: zod_1.z.string().optional(),
277
+ idempotencyKeyTTL: v4_1.z.string().optional(),
271
278
  /** The original user-provided idempotency key and scope */
272
279
  idempotencyKeyOptions: exports.IdempotencyKeyOptionsSchema.optional(),
273
280
  machine: common_js_1.MachinePresetName.optional(),
274
- maxAttempts: zod_1.z.number().int().optional(),
275
- maxDuration: zod_1.z.number().optional(),
276
- metadata: zod_1.z.any(),
277
- metadataType: zod_1.z.string().optional(),
278
- payloadType: zod_1.z.string().optional(),
281
+ maxAttempts: v4_1.z.number().int().optional(),
282
+ maxDuration: v4_1.z.number().optional(),
283
+ metadata: v4_1.z.any().optional(),
284
+ metadataType: v4_1.z.string().optional(),
285
+ payloadType: v4_1.z.string().optional(),
279
286
  /**
280
287
  * Byte size of the (pre-offload) serialized payload, measured by the caller
281
288
  * before any object-store offload. Lets the pipeline know how large a payload
282
289
  * is without downloading an "application/store" reference.
283
290
  */
284
- payloadSize: zod_1.z.number().int().nonnegative().optional(),
291
+ payloadSize: v4_1.z.number().int().nonnegative().optional(),
285
292
  tags: exports.RunTags.optional(),
286
- test: zod_1.z.boolean().optional(),
287
- ttl: zod_1.z.string().or(zod_1.z.number().nonnegative().int()).optional(),
288
- priority: zod_1.z.number().optional(),
289
- bulkActionId: zod_1.z.string().optional(),
290
- region: zod_1.z.string().optional(),
291
- debounce: zod_1.z
293
+ test: v4_1.z.boolean().optional(),
294
+ ttl: v4_1.z.string().or(v4_1.z.number().nonnegative().int()).optional(),
295
+ priority: v4_1.z.number().optional(),
296
+ bulkActionId: v4_1.z.string().optional(),
297
+ region: v4_1.z.string().optional(),
298
+ debounce: v4_1.z
292
299
  .object({
293
- key: zod_1.z.string().max(512),
294
- delay: zod_1.z.string(),
295
- mode: zod_1.z.enum(["leading", "trailing"]).optional(),
296
- maxDelay: zod_1.z.string().optional(),
300
+ key: v4_1.z.string().max(512),
301
+ delay: v4_1.z.string(),
302
+ mode: v4_1.z.enum(["leading", "trailing"]).optional(),
303
+ maxDelay: v4_1.z.string().optional(),
297
304
  })
298
305
  .optional(),
299
306
  })
@@ -305,113 +312,113 @@ exports.TriggerTaskRequestBody = zod_1.z
305
312
  }
306
313
  if (typeof value.payload !== "string" || value.payload.length === 0) {
307
314
  ctx.addIssue({
308
- code: zod_1.z.ZodIssueCode.custom,
315
+ code: v4_1.z.ZodIssueCode.custom,
309
316
  message: "payload must be a non-empty string when options.payloadType is application/store",
310
317
  path: ["payload"],
311
318
  });
312
319
  }
313
320
  });
314
- exports.TriggerTaskResponse = zod_1.z.object({
315
- id: zod_1.z.string(),
316
- isCached: zod_1.z.boolean().optional(),
321
+ exports.TriggerTaskResponse = v4_1.z.object({
322
+ id: v4_1.z.string(),
323
+ isCached: v4_1.z.boolean().optional(),
317
324
  });
318
- exports.BatchTriggerTaskRequestBody = zod_1.z.object({
325
+ exports.BatchTriggerTaskRequestBody = v4_1.z.object({
319
326
  items: exports.TriggerTaskRequestBody.array(),
320
- dependentAttempt: zod_1.z.string().optional(),
327
+ dependentAttempt: v4_1.z.string().optional(),
321
328
  });
322
- exports.BatchTriggerTaskItem = zod_1.z.object({
323
- task: zod_1.z.string(),
324
- payload: zod_1.z.any(),
325
- context: zod_1.z.any(),
326
- options: zod_1.z
329
+ exports.BatchTriggerTaskItem = v4_1.z.object({
330
+ task: v4_1.z.string(),
331
+ payload: v4_1.z.any().optional(),
332
+ context: v4_1.z.any().optional(),
333
+ options: v4_1.z
327
334
  .object({
328
335
  concurrencyKey: ConcurrencyKeySchema.optional(),
329
- delay: zod_1.z.string().or(zod_1.z.coerce.date()).optional(),
330
- idempotencyKey: zod_1.z
336
+ delay: v4_1.z.string().or(v4_1.z.coerce.date()).optional(),
337
+ idempotencyKey: v4_1.z
331
338
  .string()
332
339
  // Caps user-supplied keys before they reach the unique idempotency index
333
340
  // on the underlying table — values past this fail at the database layer
334
341
  // rather than returning a clean 400.
335
342
  .max(2048, "idempotencyKey must be 2048 characters or less")
336
343
  .optional(),
337
- idempotencyKeyTTL: zod_1.z.string().optional(),
344
+ idempotencyKeyTTL: v4_1.z.string().optional(),
338
345
  /** The original user-provided idempotency key and scope */
339
346
  idempotencyKeyOptions: exports.IdempotencyKeyOptionsSchema.optional(),
340
- lockToVersion: zod_1.z.string().optional(),
347
+ lockToVersion: v4_1.z.string().optional(),
341
348
  /** See `TriggerTaskRequestBody.options.externalDeploymentId`. */
342
349
  externalDeploymentId: ExternalDeploymentId,
343
350
  machine: common_js_1.MachinePresetName.optional(),
344
- maxAttempts: zod_1.z.number().int().optional(),
345
- maxDuration: zod_1.z.number().optional(),
346
- metadata: zod_1.z.any(),
347
- metadataType: zod_1.z.string().optional(),
348
- parentAttempt: zod_1.z.string().optional(),
349
- payloadType: zod_1.z.string().optional(),
351
+ maxAttempts: v4_1.z.number().int().optional(),
352
+ maxDuration: v4_1.z.number().optional(),
353
+ metadata: v4_1.z.any().optional(),
354
+ metadataType: v4_1.z.string().optional(),
355
+ parentAttempt: v4_1.z.string().optional(),
356
+ payloadType: v4_1.z.string().optional(),
350
357
  /** Byte size of the (pre-offload) serialized payload for this item. */
351
- payloadSize: zod_1.z.number().int().nonnegative().optional(),
352
- queue: zod_1.z
358
+ payloadSize: v4_1.z.number().int().nonnegative().optional(),
359
+ queue: v4_1.z
353
360
  .object({
354
- name: zod_1.z.string(),
361
+ name: v4_1.z.string(),
355
362
  })
356
363
  .optional(),
357
364
  tags: exports.RunTags.optional(),
358
- test: zod_1.z.boolean().optional(),
359
- ttl: zod_1.z.string().or(zod_1.z.number().nonnegative().int()).optional(),
360
- priority: zod_1.z.number().optional(),
361
- region: zod_1.z.string().optional(),
362
- debounce: zod_1.z
365
+ test: v4_1.z.boolean().optional(),
366
+ ttl: v4_1.z.string().or(v4_1.z.number().nonnegative().int()).optional(),
367
+ priority: v4_1.z.number().optional(),
368
+ region: v4_1.z.string().optional(),
369
+ debounce: v4_1.z
363
370
  .object({
364
- key: zod_1.z.string().max(512),
365
- delay: zod_1.z.string(),
366
- mode: zod_1.z.enum(["leading", "trailing"]).optional(),
367
- maxDelay: zod_1.z.string().optional(),
371
+ key: v4_1.z.string().max(512),
372
+ delay: v4_1.z.string(),
373
+ mode: v4_1.z.enum(["leading", "trailing"]).optional(),
374
+ maxDelay: v4_1.z.string().optional(),
368
375
  })
369
376
  .optional(),
370
377
  })
371
378
  .optional(),
372
379
  });
373
- exports.BatchTriggerTaskV2RequestBody = zod_1.z.object({
380
+ exports.BatchTriggerTaskV2RequestBody = v4_1.z.object({
374
381
  items: exports.BatchTriggerTaskItem.array(),
375
382
  /** @deprecated engine v1 only */
376
- dependentAttempt: zod_1.z.string().optional(),
383
+ dependentAttempt: v4_1.z.string().optional(),
377
384
  /**
378
385
  * RunEngine v2
379
386
  * If triggered inside another run, the parentRunId is the friendly ID of the parent run.
380
387
  */
381
- parentRunId: zod_1.z.string().optional(),
388
+ parentRunId: v4_1.z.string().optional(),
382
389
  /**
383
390
  * RunEngine v2
384
391
  * Should be `true` if `triggerAndWait` or `batchTriggerAndWait`
385
392
  */
386
- resumeParentOnCompletion: zod_1.z.boolean().optional(),
387
- });
388
- exports.BatchTriggerTaskV2Response = zod_1.z.object({
389
- id: zod_1.z.string(),
390
- isCached: zod_1.z.boolean(),
391
- idempotencyKey: zod_1.z.string().optional(),
392
- runs: zod_1.z.array(zod_1.z.object({
393
- id: zod_1.z.string(),
394
- taskIdentifier: zod_1.z.string(),
395
- isCached: zod_1.z.boolean(),
396
- idempotencyKey: zod_1.z.string().optional(),
393
+ resumeParentOnCompletion: v4_1.z.boolean().optional(),
394
+ });
395
+ exports.BatchTriggerTaskV2Response = v4_1.z.object({
396
+ id: v4_1.z.string(),
397
+ isCached: v4_1.z.boolean(),
398
+ idempotencyKey: v4_1.z.string().optional(),
399
+ runs: v4_1.z.array(v4_1.z.object({
400
+ id: v4_1.z.string(),
401
+ taskIdentifier: v4_1.z.string(),
402
+ isCached: v4_1.z.boolean(),
403
+ idempotencyKey: v4_1.z.string().optional(),
397
404
  })),
398
405
  });
399
- exports.BatchTriggerTaskV3RequestBody = zod_1.z.object({
406
+ exports.BatchTriggerTaskV3RequestBody = v4_1.z.object({
400
407
  items: exports.BatchTriggerTaskItem.array(),
401
408
  /**
402
409
  * RunEngine v2
403
410
  * If triggered inside another run, the parentRunId is the friendly ID of the parent run.
404
411
  */
405
- parentRunId: zod_1.z.string().optional(),
412
+ parentRunId: v4_1.z.string().optional(),
406
413
  /**
407
414
  * RunEngine v2
408
415
  * Should be `true` if `triggerAndWait` or `batchTriggerAndWait`
409
416
  */
410
- resumeParentOnCompletion: zod_1.z.boolean().optional(),
417
+ resumeParentOnCompletion: v4_1.z.boolean().optional(),
411
418
  });
412
- exports.BatchTriggerTaskV3Response = zod_1.z.object({
413
- id: zod_1.z.string(),
414
- runCount: zod_1.z.number(),
419
+ exports.BatchTriggerTaskV3Response = v4_1.z.object({
420
+ id: v4_1.z.string(),
421
+ runCount: v4_1.z.number(),
415
422
  });
416
423
  // ============================================================================
417
424
  // 2-Phase Batch API (v3) - Streaming NDJSON Support
@@ -420,17 +427,17 @@ exports.BatchTriggerTaskV3Response = zod_1.z.object({
420
427
  * Phase 1: Create batch request body
421
428
  * Creates the batch record and optionally blocks parent run for batchTriggerAndWait
422
429
  */
423
- exports.CreateBatchRequestBody = zod_1.z.object({
430
+ exports.CreateBatchRequestBody = v4_1.z.object({
424
431
  /** Expected number of items in the batch */
425
- runCount: zod_1.z.number().int().positive(),
432
+ runCount: v4_1.z.number().int().positive(),
426
433
  /** Distinct task identifiers expected in the item stream */
427
- taskIdentifiers: zod_1.z.array(zod_1.z.string().min(1)).min(1).optional(),
434
+ taskIdentifiers: v4_1.z.array(v4_1.z.string().min(1)).min(1).optional(),
428
435
  /** Parent run ID for batchTriggerAndWait (friendly ID) */
429
- parentRunId: zod_1.z.string().optional(),
436
+ parentRunId: v4_1.z.string().optional(),
430
437
  /** Whether to resume parent on completion (true for batchTriggerAndWait) */
431
- resumeParentOnCompletion: zod_1.z.boolean().optional(),
438
+ resumeParentOnCompletion: v4_1.z.boolean().optional(),
432
439
  /** Idempotency key for the batch */
433
- idempotencyKey: zod_1.z
440
+ idempotencyKey: v4_1.z
434
441
  .string()
435
442
  // Caps user-supplied keys before they reach the unique idempotency index
436
443
  // on the underlying table — values past this fail at the database layer
@@ -443,15 +450,15 @@ exports.CreateBatchRequestBody = zod_1.z.object({
443
450
  /**
444
451
  * Phase 1: Create batch response
445
452
  */
446
- exports.CreateBatchResponse = zod_1.z.object({
453
+ exports.CreateBatchResponse = v4_1.z.object({
447
454
  /** The batch ID (friendly ID) */
448
- id: zod_1.z.string(),
455
+ id: v4_1.z.string(),
449
456
  /** The expected run count */
450
- runCount: zod_1.z.number(),
457
+ runCount: v4_1.z.number(),
451
458
  /** Whether this response came from a cached/idempotent batch */
452
- isCached: zod_1.z.boolean(),
459
+ isCached: v4_1.z.boolean(),
453
460
  /** The idempotency key if provided */
454
- idempotencyKey: zod_1.z.string().optional(),
461
+ idempotencyKey: v4_1.z.string().optional(),
455
462
  });
456
463
  /**
457
464
  * Phase 2: Individual item in the NDJSON stream
@@ -459,16 +466,16 @@ exports.CreateBatchResponse = zod_1.z.object({
459
466
  *
460
467
  * `options` reuses the strict shape from BatchTriggerTaskItem so that the
461
468
  * Phase-2 streaming path validates option fields identically to the V2/V3
462
- * batch trigger endpoints — historically this used z.record(z.unknown()) and
469
+ * batch trigger endpoints — historically this used z.record(z.string(), z.unknown()) and
463
470
  * let invalid values (e.g. numeric concurrencyKey) reach Prisma.
464
471
  */
465
- exports.BatchItemNDJSON = zod_1.z.object({
472
+ exports.BatchItemNDJSON = v4_1.z.object({
466
473
  /** Zero-based index of this item (used for idempotency and ordering) */
467
- index: zod_1.z.number().int().nonnegative(),
474
+ index: v4_1.z.number().int().nonnegative(),
468
475
  /** The task identifier to trigger */
469
- task: zod_1.z.string(),
476
+ task: v4_1.z.string(),
470
477
  /** The payload for this task run */
471
- payload: zod_1.z.unknown().optional(),
478
+ payload: v4_1.z.unknown().optional(),
472
479
  /** Options for this specific item */
473
480
  options: exports.BatchTriggerTaskItem.shape.options,
474
481
  });
@@ -476,81 +483,85 @@ exports.BatchItemNDJSON = zod_1.z.object({
476
483
  * Phase 2: Stream items response
477
484
  * Returned after the NDJSON stream completes
478
485
  */
479
- exports.StreamBatchItemsResponse = zod_1.z.object({
486
+ exports.StreamBatchItemsResponse = v4_1.z.object({
480
487
  /** The batch ID */
481
- id: zod_1.z.string(),
488
+ id: v4_1.z.string(),
482
489
  /** Number of items successfully accepted */
483
- itemsAccepted: zod_1.z.number(),
490
+ itemsAccepted: v4_1.z.number(),
484
491
  /** Number of items that were deduplicated (already enqueued) */
485
- itemsDeduplicated: zod_1.z.number(),
492
+ itemsDeduplicated: v4_1.z.number(),
486
493
  /** Whether the batch was sealed and is ready for processing.
487
494
  * If false, the batch needs more items before processing can start.
488
495
  * Clients should check this field and retry with missing items if needed. */
489
- sealed: zod_1.z.boolean(),
496
+ sealed: v4_1.z.boolean(),
490
497
  /** Total items currently enqueued (only present when sealed=false to help with retries) */
491
- enqueuedCount: zod_1.z.number().optional(),
498
+ enqueuedCount: v4_1.z.number().optional(),
492
499
  /** Expected total item count (only present when sealed=false to help with retries) */
493
- expectedCount: zod_1.z.number().optional(),
494
- });
495
- exports.BatchTriggerTaskResponse = zod_1.z.object({
496
- batchId: zod_1.z.string(),
497
- runs: zod_1.z.string().array(),
498
- });
499
- exports.GetBatchResponseBody = zod_1.z.object({
500
- id: zod_1.z.string(),
501
- items: zod_1.z.array(zod_1.z.object({
502
- id: zod_1.z.string(),
503
- taskRunId: zod_1.z.string(),
504
- status: zod_1.z.enum(["PENDING", "CANCELED", "COMPLETED", "FAILED"]),
500
+ expectedCount: v4_1.z.number().optional(),
501
+ });
502
+ exports.BatchTriggerTaskResponse = v4_1.z.object({
503
+ batchId: v4_1.z.string(),
504
+ runs: v4_1.z.string().array(),
505
+ });
506
+ exports.GetBatchResponseBody = v4_1.z.object({
507
+ id: v4_1.z.string(),
508
+ items: v4_1.z.array(v4_1.z.object({
509
+ id: v4_1.z.string(),
510
+ taskRunId: v4_1.z.string(),
511
+ status: v4_1.z.enum(["PENDING", "CANCELED", "COMPLETED", "FAILED"]),
505
512
  })),
506
513
  });
507
- exports.AddTagsRequestBody = zod_1.z.object({
514
+ exports.AddTagsRequestBody = v4_1.z.object({
508
515
  tags: exports.RunTags,
509
516
  });
510
- exports.RescheduleRunRequestBody = zod_1.z.object({
511
- delay: zod_1.z.string().or(zod_1.z.coerce.date()),
517
+ exports.RescheduleRunRequestBody = v4_1.z.object({
518
+ delay: v4_1.z.string().or(v4_1.z.coerce.date()),
512
519
  });
513
- exports.GetEnvironmentVariablesResponseBody = zod_1.z.object({
514
- variables: zod_1.z.record(zod_1.z.string()),
520
+ exports.GetEnvironmentVariablesResponseBody = v4_1.z.object({
521
+ variables: v4_1.z.record(v4_1.z.string(), v4_1.z.string()),
515
522
  });
516
- exports.StartDeploymentIndexingRequestBody = zod_1.z.object({
517
- imageReference: zod_1.z.string(),
518
- selfHosted: zod_1.z.boolean().optional(),
523
+ exports.StartDeploymentIndexingRequestBody = v4_1.z.object({
524
+ imageReference: v4_1.z.string(),
525
+ selfHosted: v4_1.z.boolean().optional(),
519
526
  });
520
- exports.StartDeploymentIndexingResponseBody = zod_1.z.object({
521
- id: zod_1.z.string(),
522
- contentHash: zod_1.z.string(),
527
+ exports.StartDeploymentIndexingResponseBody = v4_1.z.object({
528
+ id: v4_1.z.string(),
529
+ contentHash: v4_1.z.string(),
523
530
  });
524
- exports.FinalizeDeploymentRequestBody = zod_1.z.object({
525
- skipPromotion: zod_1.z.boolean().optional(),
526
- imageDigest: zod_1.z.string().optional(),
527
- skipPushToRegistry: zod_1.z.boolean().optional(),
531
+ exports.FinalizeDeploymentRequestBody = v4_1.z.object({
532
+ skipPromotion: v4_1.z.boolean().optional(),
533
+ imageDigest: v4_1.z.string().optional(),
534
+ skipPushToRegistry: v4_1.z.boolean().optional(),
528
535
  });
529
- exports.BuildServerMetadata = zod_1.z.object({
530
- buildId: zod_1.z.string().optional(),
531
- isNativeBuild: zod_1.z.boolean().optional(),
532
- artifactKey: zod_1.z.string().optional(),
533
- skipPromotion: zod_1.z.boolean().optional(),
534
- configFilePath: zod_1.z.string().optional(),
535
- skipEnqueue: zod_1.z.boolean().optional(),
536
- fromBundle: zod_1.z.boolean().optional(),
536
+ exports.BuildServerMetadata = v4_1.z.object({
537
+ buildId: v4_1.z.string().optional(),
538
+ isNativeBuild: v4_1.z.boolean().optional(),
539
+ artifactKey: v4_1.z.string().optional(),
540
+ skipPromotion: v4_1.z.boolean().optional(),
541
+ configFilePath: v4_1.z.string().optional(),
542
+ skipEnqueue: v4_1.z.boolean().optional(),
543
+ fromBundle: v4_1.z.boolean().optional(),
537
544
  });
538
- exports.ProgressDeploymentRequestBody = zod_1.z.object({
539
- contentHash: zod_1.z.string().optional(),
545
+ exports.GetDeploymentArtifactUrlResponseBody = v4_1.z.object({
546
+ url: v4_1.z.string().url(),
547
+ expiresAt: v4_1.z.string().datetime(),
548
+ });
549
+ exports.ProgressDeploymentRequestBody = v4_1.z.object({
550
+ contentHash: v4_1.z.string().optional(),
540
551
  gitMeta: common_js_1.GitMeta.optional(),
541
- runtime: zod_1.z.string().optional(),
552
+ runtime: v4_1.z.string().optional(),
542
553
  buildServerMetadata: exports.BuildServerMetadata.optional(),
543
554
  });
544
- exports.CancelDeploymentRequestBody = zod_1.z.object({
545
- reason: zod_1.z.string().max(200, "Reason must be less than 200 characters").optional(),
555
+ exports.CancelDeploymentRequestBody = v4_1.z.object({
556
+ reason: v4_1.z.string().max(200, "Reason must be less than 200 characters").optional(),
546
557
  });
547
- exports.ExternalBuildData = zod_1.z.object({
548
- buildId: zod_1.z.string(),
549
- buildToken: zod_1.z.string(),
550
- projectId: zod_1.z.string(),
558
+ exports.ExternalBuildData = v4_1.z.object({
559
+ buildId: v4_1.z.string(),
560
+ buildToken: v4_1.z.string(),
561
+ projectId: v4_1.z.string(),
551
562
  });
552
- const anyString = zod_1.z.custom((v) => typeof v === "string");
553
- exports.DeploymentTriggeredVia = zod_1.z
563
+ const anyString = v4_1.z.custom((v) => typeof v === "string");
564
+ exports.DeploymentTriggeredVia = v4_1.z
554
565
  .enum([
555
566
  "cli:manual",
556
567
  "cli:ci_other",
@@ -568,76 +579,76 @@ exports.DeploymentTriggeredVia = zod_1.z
568
579
  .or(anyString);
569
580
  // TriggerSource, TriggerAction, and RunAnnotations are defined in runEngine.ts
570
581
  // They are re-exported through the schemas barrel (index.ts)
571
- exports.UpsertBranchRequestBody = zod_1.z.object({
582
+ exports.UpsertBranchRequestBody = v4_1.z.object({
572
583
  git: common_js_1.GitMeta.optional(),
573
- env: zod_1.z.enum(["preview", "development"]),
574
- branch: zod_1.z.string(),
575
- });
576
- exports.UpsertBranchResponseBody = zod_1.z.object({
577
- id: zod_1.z.string(),
578
- });
579
- exports.CreateArtifactRequestBody = zod_1.z.object({
580
- type: zod_1.z.enum(["deployment_context", "deployment_bundle"]).default("deployment_context"),
581
- contentType: zod_1.z.string().default("application/gzip"),
582
- contentLength: zod_1.z.number().optional(),
583
- });
584
- exports.CreateArtifactResponseBody = zod_1.z.object({
585
- artifactKey: zod_1.z.string(),
586
- uploadUrl: zod_1.z.string(),
587
- uploadFields: zod_1.z.record(zod_1.z.string()),
588
- expiresAt: zod_1.z.string().datetime(),
589
- });
590
- exports.InitializeDeploymentResponseBody = zod_1.z.object({
591
- id: zod_1.z.string(),
592
- contentHash: zod_1.z.string(),
593
- shortCode: zod_1.z.string(),
594
- version: zod_1.z.string(),
595
- imageTag: zod_1.z.string(),
596
- imagePlatform: zod_1.z.string(),
597
- externalId: zod_1.z.string().optional(),
598
- outcome: zod_1.z.enum(["created", "existing"]).optional(),
599
- isPromoted: zod_1.z.boolean().optional(),
584
+ env: v4_1.z.enum(["preview", "development"]),
585
+ branch: v4_1.z.string(),
586
+ });
587
+ exports.UpsertBranchResponseBody = v4_1.z.object({
588
+ id: v4_1.z.string(),
589
+ });
590
+ exports.CreateArtifactRequestBody = v4_1.z.object({
591
+ type: v4_1.z.enum(["deployment_context", "deployment_bundle"]).default("deployment_context"),
592
+ contentType: v4_1.z.string().default("application/gzip"),
593
+ contentLength: v4_1.z.number().optional(),
594
+ });
595
+ exports.CreateArtifactResponseBody = v4_1.z.object({
596
+ artifactKey: v4_1.z.string(),
597
+ uploadUrl: v4_1.z.string(),
598
+ uploadFields: v4_1.z.record(v4_1.z.string(), v4_1.z.string()),
599
+ expiresAt: v4_1.z.string().datetime(),
600
+ });
601
+ exports.InitializeDeploymentResponseBody = v4_1.z.object({
602
+ id: v4_1.z.string(),
603
+ contentHash: v4_1.z.string(),
604
+ shortCode: v4_1.z.string(),
605
+ version: v4_1.z.string(),
606
+ imageTag: v4_1.z.string(),
607
+ imagePlatform: v4_1.z.string(),
608
+ externalId: v4_1.z.string().optional(),
609
+ outcome: v4_1.z.enum(["created", "existing"]).optional(),
610
+ isPromoted: v4_1.z.boolean().optional(),
600
611
  externalBuildData: exports.ExternalBuildData.optional().nullable(),
601
- canceledDeployments: zod_1.z.array(zod_1.z.object({ version: zod_1.z.string(), shortCode: zod_1.z.string() })).optional(),
602
- eventStream: zod_1.z
612
+ canceledDeployments: v4_1.z.array(v4_1.z.object({ version: v4_1.z.string(), shortCode: v4_1.z.string() })).optional(),
613
+ eventStream: v4_1.z
603
614
  .object({
604
- s2: zod_1.z.object({
605
- basin: zod_1.z.string(),
606
- stream: zod_1.z.string(),
607
- accessToken: zod_1.z.string(),
615
+ s2: v4_1.z.object({
616
+ basin: v4_1.z.string(),
617
+ stream: v4_1.z.string(),
618
+ accessToken: v4_1.z.string(),
608
619
  }),
609
620
  })
610
621
  .optional(),
611
622
  });
612
- const InitializeDeploymentRequestBodyBase = zod_1.z.object({
613
- contentHash: zod_1.z.string(),
614
- userId: zod_1.z.string().optional(),
623
+ const InitializeDeploymentRequestBodyBase = v4_1.z.object({
624
+ contentHash: v4_1.z.string(),
625
+ userId: v4_1.z.string().optional(),
615
626
  /** @deprecated This is now determined by the webapp. This is only used to warn users with old CLI versions. */
616
- selfHosted: zod_1.z.boolean().optional(),
627
+ selfHosted: v4_1.z.boolean().optional(),
617
628
  gitMeta: common_js_1.GitMeta.optional(),
618
- type: zod_1.z.enum(["MANAGED", "UNMANAGED", "V1"]).optional(),
619
- runtime: zod_1.z.string().optional(),
620
- initialStatus: zod_1.z.enum(["PENDING", "BUILDING"]).optional(),
621
- isLocalBuild: zod_1.z.boolean().optional(),
629
+ type: v4_1.z.enum(["MANAGED", "UNMANAGED", "V1"]).optional(),
630
+ runtime: v4_1.z.string().optional(),
631
+ initialStatus: v4_1.z.enum(["PENDING", "BUILDING"]).optional(),
632
+ isLocalBuild: v4_1.z.boolean().optional(),
622
633
  triggeredVia: exports.DeploymentTriggeredVia.optional(),
623
- buildId: zod_1.z.string().optional(),
634
+ buildId: v4_1.z.string().optional(),
624
635
  externalId: ExternalDeploymentId,
625
- force: zod_1.z.boolean().optional(),
636
+ force: v4_1.z.boolean().optional(),
626
637
  });
627
638
  const InitializeDeploymentRequestBodyFull = InitializeDeploymentRequestBodyBase.extend({
628
- isNativeBuild: zod_1.z.boolean().default(false),
629
- skipPromotion: zod_1.z.boolean().optional(),
630
- artifactKey: zod_1.z.string().optional(),
631
- configFilePath: zod_1.z.string().optional(),
632
- skipEnqueue: zod_1.z.boolean().optional().default(false),
639
+ isNativeBuild: v4_1.z.boolean().default(false),
640
+ skipPromotion: v4_1.z.boolean().optional(),
641
+ artifactKey: v4_1.z.string().optional(),
642
+ configFilePath: v4_1.z.string().optional(),
643
+ skipEnqueue: v4_1.z.boolean().optional().default(false),
633
644
  // The artifact is a pre-built bundle; the build server only runs the container build
634
- fromBundle: zod_1.z.boolean().optional(),
645
+ fromBundle: v4_1.z.boolean().optional(),
635
646
  // Build-time env var values for fromBundle deploys, stored encrypted on the deployment
636
- buildEnvVars: zod_1.z.record(zod_1.z.string()).optional(),
647
+ buildEnvVars: v4_1.z.record(v4_1.z.string(), v4_1.z.string()).optional(),
637
648
  }).superRefine((data, ctx) => {
638
649
  if (data.force && !data.externalId) {
639
650
  ctx.addIssue({
640
- code: zod_1.z.ZodIssueCode.custom,
651
+ code: v4_1.z.ZodIssueCode.custom,
641
652
  path: ["force"],
642
653
  message: "force requires externalId",
643
654
  });
@@ -650,40 +661,40 @@ exports.InitializeDeploymentRequestBody = InitializeDeploymentRequestBodyFull.tr
650
661
  const { skipPromotion, artifactKey, configFilePath, skipEnqueue, fromBundle, buildEnvVars, ...rest } = data;
651
662
  return { ...rest, isNativeBuild: false };
652
663
  });
653
- exports.DeployBuildPath = zod_1.z.enum(["depot", "native", "native_local_bundle"]);
654
- exports.GetDeploySettingsResponseBody = zod_1.z.object({
664
+ exports.DeployBuildPath = v4_1.z.enum(["depot", "native", "native_local_bundle"]);
665
+ exports.GetDeploySettingsResponseBody = v4_1.z.object({
655
666
  build_path: exports.DeployBuildPath,
656
667
  });
657
- exports.RemoteBuildProviderStatusResponseBody = zod_1.z.object({
658
- status: zod_1.z.enum(["operational", "degraded", "unknown"]),
659
- message: zod_1.z.string(),
668
+ exports.RemoteBuildProviderStatusResponseBody = v4_1.z.object({
669
+ status: v4_1.z.enum(["operational", "degraded", "unknown"]),
670
+ message: v4_1.z.string(),
660
671
  });
661
- exports.GenerateRegistryCredentialsResponseBody = zod_1.z.object({
662
- username: zod_1.z.string(),
663
- password: zod_1.z.string(),
664
- expiresAt: zod_1.z.string(),
665
- repositoryUri: zod_1.z.string(),
672
+ exports.GenerateRegistryCredentialsResponseBody = v4_1.z.object({
673
+ username: v4_1.z.string(),
674
+ password: v4_1.z.string(),
675
+ expiresAt: v4_1.z.string(),
676
+ repositoryUri: v4_1.z.string(),
666
677
  });
667
- exports.DeploymentErrorData = zod_1.z.object({
668
- name: zod_1.z.string(),
669
- message: zod_1.z.string(),
670
- stack: zod_1.z.string().optional(),
671
- stderr: zod_1.z.string().optional(),
678
+ exports.DeploymentErrorData = v4_1.z.object({
679
+ name: v4_1.z.string(),
680
+ message: v4_1.z.string(),
681
+ stack: v4_1.z.string().optional(),
682
+ stderr: v4_1.z.string().optional(),
672
683
  });
673
- exports.FailDeploymentRequestBody = zod_1.z.object({
684
+ exports.FailDeploymentRequestBody = v4_1.z.object({
674
685
  error: exports.DeploymentErrorData,
675
686
  });
676
- exports.FailDeploymentResponseBody = zod_1.z.object({
677
- id: zod_1.z.string(),
687
+ exports.FailDeploymentResponseBody = v4_1.z.object({
688
+ id: v4_1.z.string(),
678
689
  });
679
- exports.PromoteDeploymentResponseBody = zod_1.z.object({
680
- id: zod_1.z.string(),
681
- version: zod_1.z.string(),
682
- shortCode: zod_1.z.string(),
690
+ exports.PromoteDeploymentResponseBody = v4_1.z.object({
691
+ id: v4_1.z.string(),
692
+ version: v4_1.z.string(),
693
+ shortCode: v4_1.z.string(),
683
694
  });
684
- exports.GetDeploymentResponseBody = zod_1.z.object({
685
- id: zod_1.z.string(),
686
- status: zod_1.z.enum([
695
+ exports.GetDeploymentResponseBody = v4_1.z.object({
696
+ id: v4_1.z.string(),
697
+ status: v4_1.z.enum([
687
698
  "PENDING",
688
699
  "INSTALLING",
689
700
  "BUILDING",
@@ -693,139 +704,159 @@ exports.GetDeploymentResponseBody = zod_1.z.object({
693
704
  "CANCELED",
694
705
  "TIMED_OUT",
695
706
  ]),
696
- contentHash: zod_1.z.string(),
697
- shortCode: zod_1.z.string(),
698
- version: zod_1.z.string(),
699
- imageReference: zod_1.z.string().nullish(),
700
- imagePlatform: zod_1.z.string(),
701
- commitSHA: zod_1.z.string().nullish(),
707
+ contentHash: v4_1.z.string(),
708
+ shortCode: v4_1.z.string(),
709
+ version: v4_1.z.string(),
710
+ imageReference: v4_1.z.string().nullish(),
711
+ imagePlatform: v4_1.z.string(),
712
+ commitSHA: v4_1.z.string().nullish(),
713
+ /**
714
+ * The `--external-id` this deployment was deployed under, used by version skew
715
+ * protection to pin runs. Distinct from `commitSHA`, which is git metadata.
716
+ *
717
+ * `optional`, not `nullish`, to stay assignable to the CLI's narrower
718
+ * `InitializeDeploymentResponseBody` shape, which this is spread into on the
719
+ * attach-to-existing-deployment path (`cli-v3/src/commands/deploy.ts:1156`).
720
+ */
721
+ externalId: v4_1.z.string().optional(),
702
722
  externalBuildData: exports.ExternalBuildData.optional().nullable(),
703
723
  errorData: exports.DeploymentErrorData.nullish(),
704
- canceledReason: zod_1.z.string().nullish(),
705
- worker: zod_1.z
724
+ canceledReason: v4_1.z.string().nullish(),
725
+ worker: v4_1.z
706
726
  .object({
707
- id: zod_1.z.string(),
708
- version: zod_1.z.string(),
709
- tasks: zod_1.z.array(zod_1.z.object({
710
- id: zod_1.z.string(),
711
- slug: zod_1.z.string(),
712
- filePath: zod_1.z.string(),
713
- exportName: zod_1.z.string().optional(),
727
+ id: v4_1.z.string(),
728
+ version: v4_1.z.string(),
729
+ tasks: v4_1.z.array(v4_1.z.object({
730
+ id: v4_1.z.string(),
731
+ slug: v4_1.z.string(),
732
+ filePath: v4_1.z.string(),
733
+ exportName: v4_1.z.string().optional(),
714
734
  })),
715
735
  })
716
736
  .optional(),
717
- integrationDeployments: zod_1.z
718
- .array(zod_1.z.object({
719
- id: zod_1.z.string(),
720
- integrationName: zod_1.z.string(),
721
- integrationDeploymentId: zod_1.z.string(),
722
- commitSHA: zod_1.z.string(),
723
- createdAt: zod_1.z.coerce.date(),
737
+ integrationDeployments: v4_1.z
738
+ .array(v4_1.z.object({
739
+ id: v4_1.z.string(),
740
+ integrationName: v4_1.z.string(),
741
+ integrationDeploymentId: v4_1.z.string(),
742
+ commitSHA: v4_1.z.string(),
743
+ createdAt: v4_1.z.coerce.date(),
724
744
  }))
725
745
  .nullish(),
726
746
  });
727
747
  // Secret material, deliberately kept off GetDeploymentResponseBody
728
- exports.GetDeploymentBuildEnvVarsResponseBody = zod_1.z.object({
729
- variables: zod_1.z.record(zod_1.z.string()),
748
+ exports.GetDeploymentBuildEnvVarsResponseBody = v4_1.z.object({
749
+ variables: v4_1.z.record(v4_1.z.string(), v4_1.z.string()),
730
750
  });
731
751
  exports.GetLatestDeploymentResponseBody = exports.GetDeploymentResponseBody.omit({
732
752
  worker: true,
733
753
  });
734
- exports.DeploymentLogEvent = zod_1.z.object({
735
- type: zod_1.z.literal("log"),
736
- data: zod_1.z.object({
737
- level: zod_1.z.enum(["debug", "info", "warn", "error"]).optional().default("info"),
738
- message: zod_1.z.string(),
754
+ exports.DeploymentLogEvent = v4_1.z.object({
755
+ type: v4_1.z.literal("log"),
756
+ data: v4_1.z.object({
757
+ level: v4_1.z.enum(["debug", "info", "warn", "error"]).optional().default("info"),
758
+ message: v4_1.z.string(),
739
759
  }),
740
760
  });
741
- exports.DeploymentFinalizedEvent = zod_1.z.object({
742
- type: zod_1.z.literal("finalized"),
743
- data: zod_1.z.object({
744
- result: zod_1.z.enum(["succeeded", "failed", "timed_out", "canceled"]).or(anyString),
745
- message: zod_1.z.string().optional(),
761
+ exports.DeploymentFinalizedEvent = v4_1.z.object({
762
+ type: v4_1.z.literal("finalized"),
763
+ data: v4_1.z.object({
764
+ result: v4_1.z.enum(["succeeded", "failed", "timed_out", "canceled"]).or(anyString),
765
+ message: v4_1.z.string().optional(),
746
766
  }),
747
767
  });
748
- exports.DeploymentEvent = zod_1.z.discriminatedUnion("type", [
768
+ exports.DeploymentEvent = (0, zod_js_1.discriminatedUnion)("type", [
749
769
  exports.DeploymentLogEvent,
750
770
  exports.DeploymentFinalizedEvent,
751
771
  ]);
752
- exports.DeploymentEventFromString = zod_1.z
772
+ exports.DeploymentEventFromString = v4_1.z
753
773
  .string()
754
774
  .transform((s, ctx) => {
755
775
  try {
756
776
  return JSON.parse(s);
757
777
  }
758
778
  catch {
759
- ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, message: "Invalid JSON" });
760
- return zod_1.z.NEVER;
779
+ ctx.addIssue({ code: v4_1.z.ZodIssueCode.custom, message: "Invalid JSON" });
780
+ return v4_1.z.NEVER;
761
781
  }
762
782
  })
763
783
  .pipe(exports.DeploymentEvent);
764
- exports.CreateUploadPayloadUrlResponseBody = zod_1.z.object({
765
- presignedUrl: zod_1.z.string(),
784
+ exports.CreateUploadPayloadUrlResponseBody = v4_1.z.object({
785
+ presignedUrl: v4_1.z.string(),
766
786
  /** Present on `/api/v2/packets` PUT (upload handshake); omitted on v1 GET download presign. */
767
- storagePath: zod_1.z.string().optional(),
787
+ storagePath: v4_1.z.string().optional(),
768
788
  });
769
- exports.WorkersListResponseBody = zod_1.z
789
+ /** One page of a `chat.agent` session transcript, from `GET /api/v1/sessions/{id}/transcript`. */
790
+ exports.SessionTranscriptResponseBody = v4_1.z.object({
791
+ messages: v4_1.z.array(v4_1.z.unknown()),
792
+ cursors: v4_1.z
793
+ .object({
794
+ lastOutEventId: v4_1.z.string().optional(),
795
+ lastInEventId: v4_1.z.string().optional(),
796
+ })
797
+ .optional(),
798
+ nextCursor: v4_1.z.string().optional(),
799
+ });
800
+ exports.WorkersListResponseBody = v4_1.z
770
801
  .object({
771
- type: zod_1.z.string(),
772
- name: zod_1.z.string(),
773
- description: zod_1.z.string().nullish(),
774
- latestVersion: zod_1.z.string().nullish(),
775
- lastHeartbeatAt: zod_1.z.string().nullish(),
776
- isDefault: zod_1.z.boolean(),
777
- updatedAt: zod_1.z.coerce.date(),
802
+ type: v4_1.z.string(),
803
+ name: v4_1.z.string(),
804
+ description: v4_1.z.string().nullish(),
805
+ latestVersion: v4_1.z.string().nullish(),
806
+ lastHeartbeatAt: v4_1.z.string().nullish(),
807
+ isDefault: v4_1.z.boolean(),
808
+ updatedAt: v4_1.z.coerce.date(),
778
809
  })
779
810
  .array();
780
- exports.WorkersCreateRequestBody = zod_1.z.object({
781
- name: zod_1.z.string().optional(),
782
- description: zod_1.z.string().optional(),
783
- });
784
- exports.WorkersCreateResponseBody = zod_1.z.object({
785
- workerGroup: zod_1.z.object({
786
- name: zod_1.z.string(),
787
- description: zod_1.z.string().nullish(),
811
+ exports.WorkersCreateRequestBody = v4_1.z.object({
812
+ name: v4_1.z.string().optional(),
813
+ description: v4_1.z.string().optional(),
814
+ });
815
+ exports.WorkersCreateResponseBody = v4_1.z.object({
816
+ workerGroup: v4_1.z.object({
817
+ name: v4_1.z.string(),
818
+ description: v4_1.z.string().nullish(),
788
819
  }),
789
- token: zod_1.z.object({
790
- plaintext: zod_1.z.string(),
820
+ token: v4_1.z.object({
821
+ plaintext: v4_1.z.string(),
791
822
  }),
792
823
  });
793
- exports.DevConfigResponseBody = zod_1.z.object({
794
- environmentId: zod_1.z.string(),
795
- dequeueIntervalWithRun: zod_1.z.number(),
796
- dequeueIntervalWithoutRun: zod_1.z.number(),
797
- maxConcurrentRuns: zod_1.z.number(),
798
- engineUrl: zod_1.z.string(),
824
+ exports.DevConfigResponseBody = v4_1.z.object({
825
+ environmentId: v4_1.z.string(),
826
+ dequeueIntervalWithRun: v4_1.z.number(),
827
+ dequeueIntervalWithoutRun: v4_1.z.number(),
828
+ maxConcurrentRuns: v4_1.z.number(),
829
+ engineUrl: v4_1.z.string(),
799
830
  });
800
- exports.DevDequeueRequestBody = zod_1.z.object({
801
- currentWorker: zod_1.z.string(),
802
- oldWorkers: zod_1.z.string().array(),
831
+ exports.DevDequeueRequestBody = v4_1.z.object({
832
+ currentWorker: v4_1.z.string(),
833
+ oldWorkers: v4_1.z.string().array(),
803
834
  maxResources: runEngine_js_1.MachineResources.optional(),
804
835
  });
805
- exports.DevDequeueResponseBody = zod_1.z.object({
836
+ exports.DevDequeueResponseBody = v4_1.z.object({
806
837
  dequeuedMessages: runEngine_js_1.DequeuedMessage.array(),
807
838
  });
808
- exports.DevDisconnectRequestBody = zod_1.z.object({
809
- runFriendlyIds: zod_1.z.string().array(),
839
+ exports.DevDisconnectRequestBody = v4_1.z.object({
840
+ runFriendlyIds: v4_1.z.string().array(),
810
841
  });
811
- exports.DevDisconnectResponseBody = zod_1.z.object({
812
- cancelled: zod_1.z.number(),
813
- bulkActionId: zod_1.z.string().optional(),
842
+ exports.DevDisconnectResponseBody = v4_1.z.object({
843
+ cancelled: v4_1.z.number(),
844
+ bulkActionId: v4_1.z.string().optional(),
814
845
  });
815
- exports.ReplayRunResponse = zod_1.z.object({
816
- id: zod_1.z.string(),
846
+ exports.ReplayRunResponse = v4_1.z.object({
847
+ id: v4_1.z.string(),
817
848
  });
818
- exports.CanceledRunResponse = zod_1.z.object({
819
- id: zod_1.z.string(),
849
+ exports.CanceledRunResponse = v4_1.z.object({
850
+ id: v4_1.z.string(),
820
851
  });
821
- exports.ResetIdempotencyKeyResponse = zod_1.z.object({
822
- id: zod_1.z.string(),
852
+ exports.ResetIdempotencyKeyResponse = v4_1.z.object({
853
+ id: v4_1.z.string(),
823
854
  });
824
- exports.ScheduleType = zod_1.z.union([zod_1.z.literal("DECLARATIVE"), zod_1.z.literal("IMPERATIVE")]);
825
- exports.ScheduledTaskPayload = zod_1.z.object({
855
+ exports.ScheduleType = v4_1.z.union([v4_1.z.literal("DECLARATIVE"), v4_1.z.literal("IMPERATIVE")]);
856
+ exports.ScheduledTaskPayload = v4_1.z.object({
826
857
  /** The schedule id associated with this run (you can have many schedules for the same task).
827
858
  You can use this to remove the schedule, update it, etc */
828
- scheduleId: zod_1.z.string(),
859
+ scheduleId: v4_1.z.string(),
829
860
  /** The type of schedule – `"DECLARATIVE"` or `"IMPERATIVE"`.
830
861
  *
831
862
  * **DECLARATIVE** – defined inline on your `schedules.task` using the `cron` property. They can only be created, updated or deleted by modifying the `cron` property on your task.
@@ -842,24 +873,24 @@ exports.ScheduledTaskPayload = zod_1.z.object({
842
873
  timeZone: payload.timezone,
843
874
  });
844
875
  ``` */
845
- timestamp: zod_1.z.date(),
876
+ timestamp: v4_1.z.date(),
846
877
  /** When the task was last run (it has been).
847
878
  This can be undefined if it's never been run. This date is UTC. */
848
- lastTimestamp: zod_1.z.date().optional(),
879
+ lastTimestamp: v4_1.z.date().optional(),
849
880
  /** You can optionally provide an external id when creating the schedule.
850
881
  Usually you would use a userId or some other unique identifier.
851
882
  This defaults to undefined if you didn't provide one. */
852
- externalId: zod_1.z.string().optional(),
883
+ externalId: v4_1.z.string().optional(),
853
884
  /** The IANA timezone the schedule is set to. The default is UTC.
854
885
  * You can see the full list of supported timezones here: https://cloud.trigger.dev/timezones
855
886
  */
856
- timezone: zod_1.z.string(),
887
+ timezone: v4_1.z.string(),
857
888
  /** The next 5 dates this task is scheduled to run */
858
- upcoming: zod_1.z.array(zod_1.z.date()),
889
+ upcoming: v4_1.z.array(v4_1.z.date()),
859
890
  });
860
- exports.CreateScheduleOptions = zod_1.z.object({
891
+ exports.CreateScheduleOptions = v4_1.z.object({
861
892
  /** The id of the task you want to attach to. */
862
- task: zod_1.z.string(),
893
+ task: v4_1.z.string(),
863
894
  /** The schedule in CRON format.
864
895
  *
865
896
  * ```txt
@@ -876,16 +907,16 @@ exports.CreateScheduleOptions = zod_1.z.object({
876
907
  "L" means the last. In the "day of week" field, 1L means the last Monday of the month. In the day of month field, L means the last day of the month.
877
908
 
878
909
  */
879
- cron: zod_1.z.string(),
910
+ cron: v4_1.z.string(),
880
911
  /** You can only create one schedule with this key. If you use it twice, the second call will update the schedule.
881
912
  *
882
913
  * This is required to prevent you from creating duplicate schedules. */
883
- deduplicationKey: zod_1.z.string(),
914
+ deduplicationKey: v4_1.z.string(),
884
915
  /** Optionally, you can specify your own IDs (like a user ID) and then use it inside the run function of your task.
885
916
  *
886
917
  * This allows you to have per-user CRON tasks.
887
918
  */
888
- externalId: zod_1.z.string().optional(),
919
+ externalId: v4_1.z.string().optional(),
889
920
  /** Optionally, you can specify a timezone in the IANA format. If unset it will use UTC.
890
921
  * If specified then the CRON will be evaluated in that timezone and will respect daylight savings.
891
922
  *
@@ -896,7 +927,7 @@ exports.CreateScheduleOptions = zod_1.z.object({
896
927
  * @example "America/New_York", "Europe/London", "Asia/Tokyo", "Africa/Cairo"
897
928
  *
898
929
  */
899
- timezone: zod_1.z.string().optional(),
930
+ timezone: v4_1.z.string().optional(),
900
931
  /** Optionally delay each occurrence by a stable amount within this window.
901
932
  * Absolute windows use whole minutes or hours up to 24 hours and are capped at the next
902
933
  * nominal interval. Percentages are relative to each nominal interval.
@@ -906,50 +937,61 @@ exports.CreateScheduleOptions = zod_1.z.object({
906
937
  window: schemas_js_1.ScheduleWindow.optional(),
907
938
  });
908
939
  exports.UpdateScheduleOptions = exports.CreateScheduleOptions.omit({ deduplicationKey: true });
909
- exports.ScheduleGenerator = zod_1.z.object({
910
- type: zod_1.z.literal("CRON"),
911
- expression: zod_1.z.string(),
912
- description: zod_1.z.string(),
940
+ exports.ScheduleGenerator = v4_1.z.object({
941
+ type: v4_1.z.literal("CRON"),
942
+ expression: v4_1.z.string(),
943
+ description: v4_1.z.string(),
913
944
  });
914
- exports.ScheduleObject = zod_1.z.object({
915
- id: zod_1.z.string(),
945
+ exports.ScheduleObject = v4_1.z.object({
946
+ id: v4_1.z.string(),
916
947
  type: exports.ScheduleType,
917
- task: zod_1.z.string(),
918
- active: zod_1.z.boolean(),
919
- deduplicationKey: zod_1.z.string().nullish(),
920
- externalId: zod_1.z.string().nullish(),
948
+ task: v4_1.z.string(),
949
+ active: v4_1.z.boolean(),
950
+ deduplicationKey: v4_1.z.string().nullish(),
951
+ externalId: v4_1.z.string().nullish(),
921
952
  generator: exports.ScheduleGenerator,
922
- timezone: zod_1.z.string(),
953
+ timezone: v4_1.z.string(),
923
954
  window: schemas_js_1.ScheduleWindow.optional(),
924
955
  /** The next nominal CRON time. */
925
- nextRun: zod_1.z.coerce.date().nullish(),
956
+ nextRun: v4_1.z.coerce.date().nullish(),
926
957
  /** The stable assigned time for the next nominal CRON time. */
927
- nextRunEffectiveAt: zod_1.z.coerce.date().nullish(),
928
- environments: zod_1.z.array(zod_1.z.object({
929
- id: zod_1.z.string(),
930
- type: zod_1.z.string(),
931
- userName: zod_1.z.string().nullish(),
958
+ nextRunEffectiveAt: v4_1.z.coerce.date().nullish(),
959
+ /**
960
+ * Present when a non-overridable plan policy applies a minimum window to this schedule (e.g.
961
+ * a free-plan schedule's 60-minute minimum). The configured `window` is returned separately
962
+ * and unchanged; this describes the floor applied on top of it.
963
+ */
964
+ appliedSchedulePolicy: v4_1.z
965
+ .object({
966
+ minimumWindowSeconds: v4_1.z.number(),
967
+ reason: v4_1.z.literal("free_schedule"),
968
+ })
969
+ .optional(),
970
+ environments: v4_1.z.array(v4_1.z.object({
971
+ id: v4_1.z.string(),
972
+ type: v4_1.z.string(),
973
+ userName: v4_1.z.string().nullish(),
932
974
  })),
933
975
  });
934
- exports.DeletedScheduleObject = zod_1.z.object({
935
- id: zod_1.z.string(),
976
+ exports.DeletedScheduleObject = v4_1.z.object({
977
+ id: v4_1.z.string(),
936
978
  });
937
- exports.ListSchedulesResult = zod_1.z.object({
938
- data: zod_1.z.array(exports.ScheduleObject),
939
- pagination: zod_1.z.object({
940
- currentPage: zod_1.z.number(),
941
- totalPages: zod_1.z.number(),
942
- count: zod_1.z.number(),
979
+ exports.ListSchedulesResult = v4_1.z.object({
980
+ data: v4_1.z.array(exports.ScheduleObject),
981
+ pagination: v4_1.z.object({
982
+ currentPage: v4_1.z.number(),
983
+ totalPages: v4_1.z.number(),
984
+ count: v4_1.z.number(),
943
985
  }),
944
986
  });
945
- exports.ListScheduleOptions = zod_1.z.object({
946
- page: zod_1.z.number().optional(),
947
- perPage: zod_1.z.number().optional(),
987
+ exports.ListScheduleOptions = v4_1.z.object({
988
+ page: v4_1.z.number().optional(),
989
+ perPage: v4_1.z.number().optional(),
948
990
  });
949
- exports.TimezonesResult = zod_1.z.object({
950
- timezones: zod_1.z.array(zod_1.z.string()),
991
+ exports.TimezonesResult = v4_1.z.object({
992
+ timezones: v4_1.z.array(v4_1.z.string()),
951
993
  });
952
- exports.RunStatus = zod_1.z.enum([
994
+ exports.RunStatus = v4_1.z.enum([
953
995
  /// Task is waiting for a version update because it cannot execute without additional information (task, queue, etc.)
954
996
  "PENDING_VERSION",
955
997
  /// Task is waiting to be executed by a worker
@@ -977,7 +1019,7 @@ exports.RunStatus = zod_1.z.enum([
977
1019
  /// Task has reached it's maxDuration and has been stopped
978
1020
  "TIMED_OUT",
979
1021
  ]);
980
- exports.AttemptStatus = zod_1.z.enum([
1022
+ exports.AttemptStatus = v4_1.z.enum([
981
1023
  "PENDING",
982
1024
  "EXECUTING",
983
1025
  "PAUSED",
@@ -985,102 +1027,102 @@ exports.AttemptStatus = zod_1.z.enum([
985
1027
  "FAILED",
986
1028
  "CANCELED",
987
1029
  ]);
988
- exports.RunEnvironmentDetails = zod_1.z.object({
989
- id: zod_1.z.string(),
990
- name: zod_1.z.string(),
991
- user: zod_1.z.string().optional(),
992
- });
993
- exports.RunScheduleDetails = zod_1.z.object({
994
- id: zod_1.z.string(),
995
- externalId: zod_1.z.string().optional(),
996
- deduplicationKey: zod_1.z.string().optional(),
1030
+ exports.RunEnvironmentDetails = v4_1.z.object({
1031
+ id: v4_1.z.string(),
1032
+ name: v4_1.z.string(),
1033
+ user: v4_1.z.string().optional(),
1034
+ });
1035
+ exports.RunScheduleDetails = v4_1.z.object({
1036
+ id: v4_1.z.string(),
1037
+ externalId: v4_1.z.string().optional(),
1038
+ deduplicationKey: v4_1.z.string().optional(),
997
1039
  generator: exports.ScheduleGenerator,
998
1040
  });
999
- exports.TriggerFunction = zod_1.z.enum([
1041
+ exports.TriggerFunction = v4_1.z.enum([
1000
1042
  "triggerAndWait",
1001
1043
  "trigger",
1002
1044
  "batchTriggerAndWait",
1003
1045
  "batchTrigger",
1004
1046
  ]);
1005
1047
  const CommonRunFields = {
1006
- id: zod_1.z.string(),
1048
+ id: v4_1.z.string(),
1007
1049
  status: exports.RunStatus,
1008
- taskIdentifier: zod_1.z.string(),
1009
- idempotencyKey: zod_1.z.string().optional(),
1010
- version: zod_1.z.string().optional(),
1011
- isQueued: zod_1.z.boolean(),
1012
- isExecuting: zod_1.z.boolean(),
1013
- isWaiting: zod_1.z.boolean(),
1014
- isCompleted: zod_1.z.boolean(),
1015
- isSuccess: zod_1.z.boolean(),
1016
- isFailed: zod_1.z.boolean(),
1017
- isCancelled: zod_1.z.boolean(),
1018
- isTest: zod_1.z.boolean(),
1019
- createdAt: zod_1.z.coerce.date(),
1020
- updatedAt: zod_1.z.coerce.date(),
1021
- startedAt: zod_1.z.coerce.date().optional(),
1022
- finishedAt: zod_1.z.coerce.date().optional(),
1023
- delayedUntil: zod_1.z.coerce.date().optional(),
1024
- ttl: zod_1.z.string().optional(),
1025
- expiredAt: zod_1.z.coerce.date().optional(),
1026
- tags: zod_1.z.string().array(),
1027
- costInCents: zod_1.z.number(),
1028
- baseCostInCents: zod_1.z.number(),
1029
- durationMs: zod_1.z.number(),
1030
- metadata: zod_1.z.record(zod_1.z.any()).optional(),
1031
- taskKind: zod_1.z.string().optional(),
1032
- region: zod_1.z.string().optional(),
1050
+ taskIdentifier: v4_1.z.string(),
1051
+ idempotencyKey: v4_1.z.string().optional(),
1052
+ version: v4_1.z.string().optional(),
1053
+ isQueued: v4_1.z.boolean(),
1054
+ isExecuting: v4_1.z.boolean(),
1055
+ isWaiting: v4_1.z.boolean(),
1056
+ isCompleted: v4_1.z.boolean(),
1057
+ isSuccess: v4_1.z.boolean(),
1058
+ isFailed: v4_1.z.boolean(),
1059
+ isCancelled: v4_1.z.boolean(),
1060
+ isTest: v4_1.z.boolean(),
1061
+ createdAt: v4_1.z.coerce.date(),
1062
+ updatedAt: v4_1.z.coerce.date(),
1063
+ startedAt: v4_1.z.coerce.date().optional(),
1064
+ finishedAt: v4_1.z.coerce.date().optional(),
1065
+ delayedUntil: v4_1.z.coerce.date().optional(),
1066
+ ttl: v4_1.z.string().optional(),
1067
+ expiredAt: v4_1.z.coerce.date().optional(),
1068
+ tags: v4_1.z.string().array(),
1069
+ costInCents: v4_1.z.number(),
1070
+ baseCostInCents: v4_1.z.number(),
1071
+ durationMs: v4_1.z.number(),
1072
+ metadata: v4_1.z.record(v4_1.z.string(), v4_1.z.any()).optional(),
1073
+ taskKind: v4_1.z.string().optional(),
1074
+ region: v4_1.z.string().optional(),
1033
1075
  };
1034
1076
  const RetrieveRunCommandFields = {
1035
1077
  ...CommonRunFields,
1036
- depth: zod_1.z.number(),
1037
- triggerFunction: zod_1.z.enum(["triggerAndWait", "trigger", "batchTriggerAndWait", "batchTrigger"]),
1038
- batchId: zod_1.z.string().optional(),
1078
+ depth: v4_1.z.number(),
1079
+ triggerFunction: v4_1.z.enum(["triggerAndWait", "trigger", "batchTriggerAndWait", "batchTrigger"]),
1080
+ batchId: v4_1.z.string().optional(),
1039
1081
  };
1040
- exports.RelatedRunDetails = zod_1.z.object(RetrieveRunCommandFields);
1041
- exports.RetrieveRunResponse = zod_1.z.object({
1082
+ exports.RelatedRunDetails = v4_1.z.object(RetrieveRunCommandFields);
1083
+ exports.RetrieveRunResponse = v4_1.z.object({
1042
1084
  ...RetrieveRunCommandFields,
1043
- payload: zod_1.z.any().optional(),
1044
- payloadPresignedUrl: zod_1.z.string().optional(),
1045
- output: zod_1.z.any().optional(),
1046
- outputPresignedUrl: zod_1.z.string().optional(),
1085
+ payload: v4_1.z.any().optional(),
1086
+ payloadPresignedUrl: v4_1.z.string().optional(),
1087
+ output: v4_1.z.any().optional(),
1088
+ outputPresignedUrl: v4_1.z.string().optional(),
1047
1089
  error: common_js_1.SerializedError.optional(),
1048
1090
  schedule: exports.RunScheduleDetails.optional(),
1049
- relatedRuns: zod_1.z.object({
1091
+ relatedRuns: v4_1.z.object({
1050
1092
  root: exports.RelatedRunDetails.optional(),
1051
1093
  parent: exports.RelatedRunDetails.optional(),
1052
- children: zod_1.z.array(exports.RelatedRunDetails).optional(),
1094
+ children: v4_1.z.array(exports.RelatedRunDetails).optional(),
1053
1095
  }),
1054
- attemptCount: zod_1.z.number().default(0),
1096
+ attemptCount: v4_1.z.number().default(0),
1055
1097
  });
1056
- exports.ListRunResponseItem = zod_1.z.object({
1098
+ exports.ListRunResponseItem = v4_1.z.object({
1057
1099
  ...CommonRunFields,
1058
1100
  env: exports.RunEnvironmentDetails,
1059
1101
  });
1060
- exports.ListRunResponse = zod_1.z.object({
1061
- data: zod_1.z.array(exports.ListRunResponseItem),
1062
- pagination: zod_1.z.object({
1063
- next: zod_1.z.string().optional(),
1064
- previous: zod_1.z.string().optional(),
1102
+ exports.ListRunResponse = v4_1.z.object({
1103
+ data: v4_1.z.array(exports.ListRunResponseItem),
1104
+ pagination: v4_1.z.object({
1105
+ next: v4_1.z.string().optional(),
1106
+ previous: v4_1.z.string().optional(),
1065
1107
  }),
1066
1108
  });
1067
- const StringOrStringArray = zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]);
1068
- const MachineOrMachineArray = zod_1.z.union([common_js_1.MachinePresetName, zod_1.z.array(common_js_1.MachinePresetName)]);
1069
- const QueueOrQueueArray = zod_1.z.union([queues_js_1.QueueTypeName, zod_1.z.array(queues_js_1.QueueTypeName)]);
1070
- const DateOrNumber = zod_1.z.union([zod_1.z.coerce.date(), zod_1.z.number()]);
1071
- const BulkActionFilterRequestBody = zod_1.z
1109
+ const StringOrStringArray = v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]);
1110
+ const MachineOrMachineArray = v4_1.z.union([common_js_1.MachinePresetName, v4_1.z.array(common_js_1.MachinePresetName)]);
1111
+ const QueueOrQueueArray = v4_1.z.union([queues_js_1.QueueTypeName, v4_1.z.array(queues_js_1.QueueTypeName)]);
1112
+ const DateOrNumber = v4_1.z.union([v4_1.z.coerce.date(), v4_1.z.number()]);
1113
+ const BulkActionFilterRequestBody = v4_1.z
1072
1114
  .object({
1073
- status: zod_1.z.union([exports.RunStatus, zod_1.z.array(exports.RunStatus)]).optional(),
1115
+ status: v4_1.z.union([exports.RunStatus, v4_1.z.array(exports.RunStatus)]).optional(),
1074
1116
  taskIdentifier: StringOrStringArray.optional(),
1075
1117
  version: StringOrStringArray.optional(),
1076
1118
  from: DateOrNumber.optional(),
1077
1119
  to: DateOrNumber.optional(),
1078
- period: zod_1.z.string().optional(),
1079
- bulkAction: zod_1.z.string().optional(),
1120
+ period: v4_1.z.string().optional(),
1121
+ bulkAction: v4_1.z.string().optional(),
1080
1122
  tag: StringOrStringArray.optional(),
1081
- schedule: zod_1.z.string().optional(),
1082
- isTest: zod_1.z.boolean().optional(),
1083
- batch: zod_1.z.string().optional(),
1123
+ schedule: v4_1.z.string().optional(),
1124
+ isTest: v4_1.z.boolean().optional(),
1125
+ batch: v4_1.z.string().optional(),
1084
1126
  queue: QueueOrQueueArray.optional(),
1085
1127
  machine: MachineOrMachineArray.optional(),
1086
1128
  region: StringOrStringArray.optional(),
@@ -1103,91 +1145,87 @@ function isNonEmptyBulkActionFilterValue(value) {
1103
1145
  }
1104
1146
  const BulkActionSelectionRequestBody = {
1105
1147
  filter: BulkActionFilterRequestBody.optional(),
1106
- runIds: zod_1.z.array(zod_1.z.string()).min(1).optional(),
1107
- name: zod_1.z.string().max(255, "Name must be less than 255 characters").optional(),
1148
+ runIds: v4_1.z.array(v4_1.z.string()).min(1).optional(),
1149
+ name: v4_1.z.string().max(255, "Name must be less than 255 characters").optional(),
1108
1150
  };
1109
- exports.CreateBulkActionRequestBody = zod_1.z
1110
- .discriminatedUnion("action", [
1111
- zod_1.z.object({
1112
- action: zod_1.z.literal("cancel"),
1113
- targetRegion: zod_1.z.never().optional(),
1151
+ exports.CreateBulkActionRequestBody = (0, zod_js_1.discriminatedUnion)("action", [
1152
+ v4_1.z.object({
1153
+ action: v4_1.z.literal("cancel"),
1154
+ targetRegion: v4_1.z.never().optional(),
1114
1155
  ...BulkActionSelectionRequestBody,
1115
1156
  }),
1116
- zod_1.z.object({
1117
- action: zod_1.z.literal("replay"),
1118
- targetRegion: zod_1.z.string().optional(),
1157
+ v4_1.z.object({
1158
+ action: v4_1.z.literal("replay"),
1159
+ targetRegion: v4_1.z.string().optional(),
1119
1160
  ...BulkActionSelectionRequestBody,
1120
1161
  }),
1121
- ])
1122
- .refine((body) => (body.filter ? 1 : 0) + (body.runIds ? 1 : 0) === 1, {
1162
+ ]).refine((body) => (body.filter ? 1 : 0) + (body.runIds ? 1 : 0) === 1, {
1123
1163
  message: "Exactly one of filter or runIds must be provided",
1124
1164
  });
1125
- exports.BulkActionStatus = zod_1.z.enum(["PENDING", "COMPLETED", "ABORTED"]);
1126
- exports.BulkActionType = zod_1.z.enum(["CANCEL", "REPLAY"]);
1127
- exports.BulkActionObject = zod_1.z.object({
1128
- id: zod_1.z.string(),
1129
- name: zod_1.z.string().optional(),
1165
+ exports.BulkActionStatus = v4_1.z.enum(["PENDING", "COMPLETED", "ABORTED"]);
1166
+ exports.BulkActionType = v4_1.z.enum(["CANCEL", "REPLAY"]);
1167
+ exports.BulkActionObject = v4_1.z.object({
1168
+ id: v4_1.z.string(),
1169
+ name: v4_1.z.string().optional(),
1130
1170
  type: exports.BulkActionType,
1131
1171
  status: exports.BulkActionStatus,
1132
- counts: zod_1.z.object({
1133
- total: zod_1.z.number(),
1134
- success: zod_1.z.number(),
1135
- failure: zod_1.z.number(),
1172
+ counts: v4_1.z.object({
1173
+ total: v4_1.z.number(),
1174
+ success: v4_1.z.number(),
1175
+ failure: v4_1.z.number(),
1136
1176
  }),
1137
- createdAt: zod_1.z.coerce.date(),
1138
- completedAt: zod_1.z.coerce.date().optional(),
1177
+ createdAt: v4_1.z.coerce.date(),
1178
+ completedAt: v4_1.z.coerce.date().optional(),
1139
1179
  });
1140
- exports.CreateBulkActionResponseBody = zod_1.z.object({
1141
- id: zod_1.z.string(),
1180
+ exports.CreateBulkActionResponseBody = v4_1.z.object({
1181
+ id: v4_1.z.string(),
1142
1182
  });
1143
- exports.AbortBulkActionResponseBody = zod_1.z.object({
1144
- id: zod_1.z.string(),
1183
+ exports.AbortBulkActionResponseBody = v4_1.z.object({
1184
+ id: v4_1.z.string(),
1145
1185
  });
1146
- exports.ListBulkActionsResponseBody = zod_1.z.object({
1147
- data: zod_1.z.array(exports.BulkActionObject),
1148
- pagination: zod_1.z.object({
1149
- next: zod_1.z.string().optional(),
1150
- previous: zod_1.z.string().optional(),
1186
+ exports.ListBulkActionsResponseBody = v4_1.z.object({
1187
+ data: v4_1.z.array(exports.BulkActionObject),
1188
+ pagination: v4_1.z.object({
1189
+ next: v4_1.z.string().optional(),
1190
+ previous: v4_1.z.string().optional(),
1151
1191
  }),
1152
1192
  });
1153
- exports.CreateEnvironmentVariableRequestBody = zod_1.z.object({
1154
- name: zod_1.z.string(),
1155
- value: zod_1.z.string(),
1193
+ exports.CreateEnvironmentVariableRequestBody = v4_1.z.object({
1194
+ name: v4_1.z.string(),
1195
+ value: v4_1.z.string(),
1156
1196
  // When omitted, the variable defaults to non-secret (the DB default is false).
1157
- isSecret: zod_1.z.boolean().optional(),
1197
+ isSecret: v4_1.z.boolean().optional(),
1158
1198
  });
1159
- exports.UpdateEnvironmentVariableRequestBody = zod_1.z.object({
1160
- value: zod_1.z.string(),
1199
+ exports.UpdateEnvironmentVariableRequestBody = v4_1.z.object({
1200
+ value: v4_1.z.string(),
1161
1201
  });
1162
- exports.ImportEnvironmentVariablesRequestBody = zod_1.z.object({
1163
- variables: zod_1.z.record(zod_1.z.string()),
1164
- parentVariables: zod_1.z.record(zod_1.z.string()).optional(),
1165
- override: zod_1.z.boolean().optional(),
1202
+ exports.ImportEnvironmentVariablesRequestBody = v4_1.z.object({
1203
+ variables: v4_1.z.record(v4_1.z.string(), v4_1.z.string()),
1204
+ parentVariables: v4_1.z.record(v4_1.z.string(), v4_1.z.string()).optional(),
1205
+ override: v4_1.z.boolean().optional(),
1166
1206
  // When omitted, variables default to non-secret (the DB default is false).
1167
- isSecret: zod_1.z.boolean().optional(),
1168
- source: zod_1.z
1169
- .discriminatedUnion("type", [
1170
- zod_1.z.object({ type: zod_1.z.literal("user"), userId: zod_1.z.string() }),
1171
- zod_1.z.object({ type: zod_1.z.literal("integration"), integration: zod_1.z.string() }),
1172
- ])
1173
- .optional(),
1207
+ isSecret: v4_1.z.boolean().optional(),
1208
+ source: (0, zod_js_1.discriminatedUnion)("type", [
1209
+ v4_1.z.object({ type: v4_1.z.literal("user"), userId: v4_1.z.string() }),
1210
+ v4_1.z.object({ type: v4_1.z.literal("integration"), integration: v4_1.z.string() }),
1211
+ ]).optional(),
1174
1212
  });
1175
- exports.EnvironmentVariableResponseBody = zod_1.z.object({
1176
- success: zod_1.z.boolean(),
1213
+ exports.EnvironmentVariableResponseBody = v4_1.z.object({
1214
+ success: v4_1.z.boolean(),
1177
1215
  });
1178
- exports.EnvironmentVariableValue = zod_1.z.object({
1179
- value: zod_1.z.string(),
1216
+ exports.EnvironmentVariableValue = v4_1.z.object({
1217
+ value: v4_1.z.string(),
1180
1218
  });
1181
- exports.EnvironmentVariable = zod_1.z.object({
1182
- name: zod_1.z.string(),
1183
- value: zod_1.z.string(),
1219
+ exports.EnvironmentVariable = v4_1.z.object({
1220
+ name: v4_1.z.string(),
1221
+ value: v4_1.z.string(),
1184
1222
  });
1185
- exports.EnvironmentVariables = zod_1.z.array(exports.EnvironmentVariable);
1186
- exports.EnvironmentVariableWithSecret = zod_1.z.object({
1223
+ exports.EnvironmentVariables = v4_1.z.array(exports.EnvironmentVariable);
1224
+ exports.EnvironmentVariableWithSecret = v4_1.z.object({
1187
1225
  /** The name of the env var, e.g. `DATABASE_URL` */
1188
- name: zod_1.z.string(),
1226
+ name: v4_1.z.string(),
1189
1227
  /** The value of the env var. If it's a secret, this will be a redacted value, not the real value. */
1190
- value: zod_1.z.string(),
1228
+ value: v4_1.z.string(),
1191
1229
  /**
1192
1230
  * Whether the env var is a secret or not.
1193
1231
  * When you create env vars you can mark them as secrets.
@@ -1195,25 +1233,25 @@ exports.EnvironmentVariableWithSecret = zod_1.z.object({
1195
1233
  * You can't view the value of a secret env var after setting it initially.
1196
1234
  * For a secret env var, the value will be redacted.
1197
1235
  */
1198
- isSecret: zod_1.z.boolean(),
1236
+ isSecret: v4_1.z.boolean(),
1199
1237
  });
1200
1238
  exports.UpdateMetadataRequestBody = common_js_1.FlushedRunMetadata;
1201
- exports.UpdateMetadataResponseBody = zod_1.z.object({
1202
- metadata: zod_1.z.record(json_js_1.DeserializedJsonSchema),
1239
+ exports.UpdateMetadataResponseBody = v4_1.z.object({
1240
+ metadata: v4_1.z.record(v4_1.z.string(), json_js_1.DeserializedJsonSchema),
1203
1241
  });
1204
- const RawShapeDate = zod_1.z
1242
+ const RawShapeDate = v4_1.z
1205
1243
  .string()
1206
1244
  .transform((val) => `${val}Z`)
1207
- .pipe(zod_1.z.coerce.date());
1208
- const RawOptionalShapeDate = zod_1.z
1245
+ .pipe(v4_1.z.coerce.date());
1246
+ const RawOptionalShapeDate = v4_1.z
1209
1247
  .string()
1210
1248
  .nullish()
1211
1249
  .transform((val) => (val ? new Date(`${val}Z`) : val));
1212
- exports.SubscribeRunRawShape = zod_1.z.object({
1213
- id: zod_1.z.string(),
1214
- taskIdentifier: zod_1.z.string(),
1215
- friendlyId: zod_1.z.string(),
1216
- status: zod_1.z.string(),
1250
+ exports.SubscribeRunRawShape = v4_1.z.object({
1251
+ id: v4_1.z.string(),
1252
+ taskIdentifier: v4_1.z.string(),
1253
+ friendlyId: v4_1.z.string(),
1254
+ status: v4_1.z.string(),
1217
1255
  createdAt: RawShapeDate,
1218
1256
  updatedAt: RawShapeDate,
1219
1257
  startedAt: RawOptionalShapeDate,
@@ -1221,74 +1259,74 @@ exports.SubscribeRunRawShape = zod_1.z.object({
1221
1259
  queuedAt: RawOptionalShapeDate,
1222
1260
  expiredAt: RawOptionalShapeDate,
1223
1261
  completedAt: RawOptionalShapeDate,
1224
- idempotencyKey: zod_1.z.string().nullish(),
1225
- number: zod_1.z.number().default(0),
1226
- isTest: zod_1.z.boolean().default(false),
1227
- usageDurationMs: zod_1.z.number().default(0),
1228
- costInCents: zod_1.z.number().default(0),
1229
- baseCostInCents: zod_1.z.number().default(0),
1230
- ttl: zod_1.z.string().nullish(),
1231
- payload: zod_1.z.string().nullish(),
1232
- payloadType: zod_1.z.string().nullish(),
1233
- metadata: zod_1.z.string().nullish(),
1234
- metadataType: zod_1.z.string().nullish(),
1235
- output: zod_1.z.string().nullish(),
1236
- outputType: zod_1.z.string().nullish(),
1237
- runTags: zod_1.z.array(zod_1.z.string()).nullish().default([]),
1262
+ idempotencyKey: v4_1.z.string().nullish(),
1263
+ number: v4_1.z.number().default(0),
1264
+ isTest: v4_1.z.boolean().default(false),
1265
+ usageDurationMs: v4_1.z.number().default(0),
1266
+ costInCents: v4_1.z.number().default(0),
1267
+ baseCostInCents: v4_1.z.number().default(0),
1268
+ ttl: v4_1.z.string().nullish(),
1269
+ payload: v4_1.z.string().nullish(),
1270
+ payloadType: v4_1.z.string().nullish(),
1271
+ metadata: v4_1.z.string().nullish(),
1272
+ metadataType: v4_1.z.string().nullish(),
1273
+ output: v4_1.z.string().nullish(),
1274
+ outputType: v4_1.z.string().nullish(),
1275
+ runTags: v4_1.z.array(v4_1.z.string()).nullish().default([]),
1238
1276
  error: common_js_1.TaskRunError.nullish(),
1239
- realtimeStreams: zod_1.z.array(zod_1.z.string()).nullish().default([]),
1277
+ realtimeStreams: v4_1.z.array(v4_1.z.string()).nullish().default([]),
1240
1278
  });
1241
- exports.BatchStatus = zod_1.z.enum([
1279
+ exports.BatchStatus = v4_1.z.enum([
1242
1280
  "PENDING",
1243
1281
  "PROCESSING",
1244
1282
  "COMPLETED",
1245
1283
  "PARTIAL_FAILED",
1246
1284
  "ABORTED",
1247
1285
  ]);
1248
- exports.RetrieveBatchResponse = zod_1.z.object({
1249
- id: zod_1.z.string(),
1286
+ exports.RetrieveBatchResponse = v4_1.z.object({
1287
+ id: v4_1.z.string(),
1250
1288
  status: exports.BatchStatus,
1251
- idempotencyKey: zod_1.z.string().optional(),
1252
- createdAt: zod_1.z.coerce.date(),
1253
- updatedAt: zod_1.z.coerce.date(),
1254
- runCount: zod_1.z.number(),
1255
- runs: zod_1.z.array(zod_1.z.string()),
1256
- });
1257
- exports.RetrieveBatchV2Response = zod_1.z.object({
1258
- id: zod_1.z.string(),
1289
+ idempotencyKey: v4_1.z.string().optional(),
1290
+ createdAt: v4_1.z.coerce.date(),
1291
+ updatedAt: v4_1.z.coerce.date(),
1292
+ runCount: v4_1.z.number(),
1293
+ runs: v4_1.z.array(v4_1.z.string()),
1294
+ });
1295
+ exports.RetrieveBatchV2Response = v4_1.z.object({
1296
+ id: v4_1.z.string(),
1259
1297
  status: exports.BatchStatus,
1260
- idempotencyKey: zod_1.z.string().optional(),
1261
- createdAt: zod_1.z.coerce.date(),
1262
- updatedAt: zod_1.z.coerce.date(),
1263
- runCount: zod_1.z.number(),
1264
- runs: zod_1.z.array(zod_1.z.string()),
1265
- processing: zod_1.z.object({
1266
- completedAt: zod_1.z.coerce.date().optional(),
1267
- errors: zod_1.z.array(zod_1.z.object({
1268
- index: zod_1.z.number(),
1269
- taskIdentifier: zod_1.z.string(),
1270
- error: zod_1.z.string(),
1271
- errorCode: zod_1.z.string().optional(),
1298
+ idempotencyKey: v4_1.z.string().optional(),
1299
+ createdAt: v4_1.z.coerce.date(),
1300
+ updatedAt: v4_1.z.coerce.date(),
1301
+ runCount: v4_1.z.number(),
1302
+ runs: v4_1.z.array(v4_1.z.string()),
1303
+ processing: v4_1.z.object({
1304
+ completedAt: v4_1.z.coerce.date().optional(),
1305
+ errors: v4_1.z.array(v4_1.z.object({
1306
+ index: v4_1.z.number(),
1307
+ taskIdentifier: v4_1.z.string(),
1308
+ error: v4_1.z.string(),
1309
+ errorCode: v4_1.z.string().optional(),
1272
1310
  })),
1273
1311
  }),
1274
1312
  });
1275
- exports.SubscribeRealtimeStreamChunkRawShape = zod_1.z.object({
1276
- id: zod_1.z.string(),
1277
- runId: zod_1.z.string(),
1278
- sequence: zod_1.z.number(),
1279
- key: zod_1.z.string(),
1280
- value: zod_1.z.string(),
1281
- createdAt: zod_1.z.coerce.date(),
1313
+ exports.SubscribeRealtimeStreamChunkRawShape = v4_1.z.object({
1314
+ id: v4_1.z.string(),
1315
+ runId: v4_1.z.string(),
1316
+ sequence: v4_1.z.number(),
1317
+ key: v4_1.z.string(),
1318
+ value: v4_1.z.string(),
1319
+ createdAt: v4_1.z.coerce.date(),
1282
1320
  });
1283
- exports.TimePeriod = zod_1.z.string().or(zod_1.z.coerce.date());
1284
- exports.CreateWaitpointTokenRequestBody = zod_1.z.object({
1321
+ exports.TimePeriod = v4_1.z.string().or(v4_1.z.coerce.date());
1322
+ exports.CreateWaitpointTokenRequestBody = v4_1.z.object({
1285
1323
  /**
1286
1324
  * An optional idempotency key for the waitpoint.
1287
1325
  * If you use the same key twice (and the key hasn't expired), you will get the original waitpoint back.
1288
1326
  *
1289
1327
  * Note: This waitpoint may already be complete, in which case when you wait for it, it will immediately continue.
1290
1328
  */
1291
- idempotencyKey: zod_1.z
1329
+ idempotencyKey: v4_1.z
1292
1330
  .string()
1293
1331
  // Caps user-supplied keys before they reach the unique idempotency index
1294
1332
  // on the underlying table — values past this fail at the database layer
@@ -1299,7 +1337,7 @@ exports.CreateWaitpointTokenRequestBody = zod_1.z.object({
1299
1337
  * When set, this means the passed in idempotency key will expire after this time.
1300
1338
  * This means after that time if you pass the same idempotency key again, you will get a new waitpoint.
1301
1339
  */
1302
- idempotencyKeyTTL: zod_1.z.string().optional(),
1340
+ idempotencyKeyTTL: v4_1.z.string().optional(),
1303
1341
  /** The resume token will timeout after this time.
1304
1342
  * If you are waiting for the token in a run, the token will return a result where `ok` is false.
1305
1343
  *
@@ -1321,33 +1359,33 @@ exports.CreateWaitpointTokenRequestBody = zod_1.z.object({
1321
1359
  */
1322
1360
  tags: exports.RunTags.optional(),
1323
1361
  });
1324
- exports.CreateWaitpointTokenResponseBody = zod_1.z.object({
1325
- id: zod_1.z.string(),
1326
- isCached: zod_1.z.boolean(),
1327
- url: zod_1.z.string(),
1362
+ exports.CreateWaitpointTokenResponseBody = v4_1.z.object({
1363
+ id: v4_1.z.string(),
1364
+ isCached: v4_1.z.boolean(),
1365
+ url: v4_1.z.string(),
1328
1366
  });
1329
- exports.CreateInputStreamWaitpointRequestBody = zod_1.z.object({
1330
- streamId: zod_1.z.string(),
1331
- timeout: zod_1.z.string().optional(),
1332
- idempotencyKey: zod_1.z
1367
+ exports.CreateInputStreamWaitpointRequestBody = v4_1.z.object({
1368
+ streamId: v4_1.z.string(),
1369
+ timeout: v4_1.z.string().optional(),
1370
+ idempotencyKey: v4_1.z
1333
1371
  .string()
1334
1372
  // Caps user-supplied keys before they reach the unique idempotency index
1335
1373
  // on the underlying table — values past this fail at the database layer
1336
1374
  // rather than returning a clean 400.
1337
1375
  .max(2048, "idempotencyKey must be 2048 characters or less")
1338
1376
  .optional(),
1339
- idempotencyKeyTTL: zod_1.z.string().optional(),
1340
- tags: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
1377
+ idempotencyKeyTTL: v4_1.z.string().optional(),
1378
+ tags: v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]).optional(),
1341
1379
  /**
1342
1380
  * The last S2 sequence number the client has seen on this input stream.
1343
1381
  * Used to check for data that arrived before .wait() was called.
1344
1382
  * If undefined, the server checks from the beginning of the stream.
1345
1383
  */
1346
- lastSeqNum: zod_1.z.number().optional(),
1384
+ lastSeqNum: v4_1.z.number().optional(),
1347
1385
  });
1348
- exports.CreateInputStreamWaitpointResponseBody = zod_1.z.object({
1349
- waitpointId: zod_1.z.string(),
1350
- isCached: zod_1.z.boolean(),
1386
+ exports.CreateInputStreamWaitpointResponseBody = v4_1.z.object({
1387
+ waitpointId: v4_1.z.string(),
1388
+ isCached: v4_1.z.boolean(),
1351
1389
  });
1352
1390
  /**
1353
1391
  * Create a run-scoped waitpoint that completes when the next record lands on
@@ -1355,55 +1393,55 @@ exports.CreateInputStreamWaitpointResponseBody = zod_1.z.object({
1355
1393
  * but keyed by `{sessionId, io}` instead of `{runId, streamId}`. The run is
1356
1394
  * still the thing being suspended — Session only supplies the trigger source.
1357
1395
  */
1358
- exports.CreateSessionStreamWaitpointRequestBody = zod_1.z.object({
1396
+ exports.CreateSessionStreamWaitpointRequestBody = v4_1.z.object({
1359
1397
  /** Session friendlyId (`session_*`) or user-supplied externalId. */
1360
- session: zod_1.z.string(),
1361
- io: zod_1.z.enum(["out", "in"]),
1362
- timeout: zod_1.z.string().optional(),
1363
- idempotencyKey: zod_1.z
1398
+ session: v4_1.z.string(),
1399
+ io: v4_1.z.enum(["out", "in"]),
1400
+ timeout: v4_1.z.string().optional(),
1401
+ idempotencyKey: v4_1.z
1364
1402
  .string()
1365
1403
  // Caps user-supplied keys before they reach the unique idempotency index
1366
1404
  // on the underlying table — values past this fail at the database layer
1367
1405
  // rather than returning a clean 400.
1368
1406
  .max(2048, "idempotencyKey must be 2048 characters or less")
1369
1407
  .optional(),
1370
- idempotencyKeyTTL: zod_1.z.string().optional(),
1371
- tags: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
1408
+ idempotencyKeyTTL: v4_1.z.string().optional(),
1409
+ tags: v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]).optional(),
1372
1410
  /**
1373
1411
  * Last S2 sequence number the client has seen on this session channel.
1374
1412
  * Used to catch data that arrived before `.wait()` was called.
1375
1413
  */
1376
- lastSeqNum: zod_1.z.number().optional(),
1414
+ lastSeqNum: v4_1.z.number().optional(),
1377
1415
  });
1378
- exports.CreateSessionStreamWaitpointResponseBody = zod_1.z.object({
1379
- waitpointId: zod_1.z.string(),
1380
- isCached: zod_1.z.boolean(),
1416
+ exports.CreateSessionStreamWaitpointResponseBody = v4_1.z.object({
1417
+ waitpointId: v4_1.z.string(),
1418
+ isCached: v4_1.z.boolean(),
1381
1419
  });
1382
1420
  exports.waitpointTokenStatuses = ["WAITING", "COMPLETED", "TIMED_OUT"];
1383
- exports.WaitpointTokenStatus = zod_1.z.enum(exports.waitpointTokenStatuses);
1384
- exports.WaitpointTokenItem = zod_1.z.object({
1385
- id: zod_1.z.string(),
1421
+ exports.WaitpointTokenStatus = v4_1.z.enum(exports.waitpointTokenStatuses);
1422
+ exports.WaitpointTokenItem = v4_1.z.object({
1423
+ id: v4_1.z.string(),
1386
1424
  /** If you make a POST request to this URL, it will complete the waitpoint. */
1387
- url: zod_1.z.string(),
1425
+ url: v4_1.z.string(),
1388
1426
  status: exports.WaitpointTokenStatus,
1389
- completedAt: zod_1.z.coerce.date().optional(),
1390
- completedAfter: zod_1.z.coerce.date().optional(),
1391
- timeoutAt: zod_1.z.coerce.date().optional(),
1392
- idempotencyKey: zod_1.z.string().optional(),
1393
- idempotencyKeyExpiresAt: zod_1.z.coerce.date().optional(),
1394
- tags: zod_1.z.array(zod_1.z.string()),
1395
- createdAt: zod_1.z.coerce.date(),
1427
+ completedAt: v4_1.z.coerce.date().optional(),
1428
+ completedAfter: v4_1.z.coerce.date().optional(),
1429
+ timeoutAt: v4_1.z.coerce.date().optional(),
1430
+ idempotencyKey: v4_1.z.string().optional(),
1431
+ idempotencyKeyExpiresAt: v4_1.z.coerce.date().optional(),
1432
+ tags: v4_1.z.array(v4_1.z.string()),
1433
+ createdAt: v4_1.z.coerce.date(),
1396
1434
  });
1397
1435
  exports.WaitpointListTokenItem = exports.WaitpointTokenItem.omit({
1398
1436
  completedAfter: true,
1399
1437
  });
1400
- exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem.and(zod_1.z.object({
1401
- output: zod_1.z.string().optional(),
1402
- outputType: zod_1.z.string().optional(),
1403
- outputIsError: zod_1.z.boolean().optional(),
1438
+ exports.WaitpointRetrieveTokenResponse = exports.WaitpointListTokenItem.and(v4_1.z.object({
1439
+ output: v4_1.z.string().optional(),
1440
+ outputType: v4_1.z.string().optional(),
1441
+ outputIsError: v4_1.z.boolean().optional(),
1404
1442
  }));
1405
- exports.CompleteWaitpointTokenRequestBody = zod_1.z.object({
1406
- data: zod_1.z.any().nullish(),
1443
+ exports.CompleteWaitpointTokenRequestBody = v4_1.z.object({
1444
+ data: v4_1.z.any().nullish(),
1407
1445
  });
1408
1446
  /**
1409
1447
  * Trigger config persisted on a Session. Drives every run the session
@@ -1412,20 +1450,27 @@ exports.CompleteWaitpointTokenRequestBody = zod_1.z.object({
1412
1450
  * `trigger: "preload" | "trigger"` are merged on top per-call by the
1413
1451
  * server's trigger machinery.
1414
1452
  */
1415
- exports.SessionTriggerConfig = zod_1.z.object({
1416
- basePayload: zod_1.z.record(zod_1.z.unknown()),
1453
+ exports.SessionTriggerConfig = v4_1.z.object({
1454
+ basePayload: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()),
1417
1455
  machine: common_js_1.MachinePresetName.optional(),
1418
- queue: zod_1.z.string().max(128).optional(),
1419
- tags: zod_1.z.array(zod_1.z.string().max(128)).max(10).optional(),
1420
- maxAttempts: zod_1.z.number().int().positive().max(10).optional(),
1456
+ queue: v4_1.z.string().max(128).optional(),
1457
+ tags: v4_1.z.array(v4_1.z.string().max(128)).max(10).optional(),
1458
+ maxAttempts: v4_1.z.number().int().positive().max(10).optional(),
1421
1459
  /** Per-run wall-clock cap (seconds). Forwarded to `TaskRunOptions.maxDuration`. */
1422
- maxDuration: zod_1.z.number().int().positive().optional(),
1460
+ maxDuration: v4_1.z.number().int().positive().optional(),
1423
1461
  /** Pin every run to a specific worker version. Forwarded to `TaskRunOptions.lockToVersion`. */
1424
- lockToVersion: zod_1.z.string().optional(),
1462
+ lockToVersion: v4_1.z.string().optional(),
1463
+ /**
1464
+ * Pin every run the session schedules to the deployment carrying this id, refreshed by each
1465
+ * `sessions.start`. Independent of `lockToVersion`, which wins.
1466
+ */
1467
+ externalDeploymentId: ExternalDeploymentId,
1425
1468
  /** Region to schedule runs in. Forwarded to `TaskRunOptions.region`. */
1426
- region: zod_1.z.string().optional(),
1469
+ region: v4_1.z.string().optional(),
1427
1470
  /** Convenience field surfaced to chat.agent via the wire payload. */
1428
- idleTimeoutInSeconds: zod_1.z.number().int().positive().max(3600).optional(),
1471
+ idleTimeoutInSeconds: v4_1.z.number().int().positive().max(3600).optional(),
1472
+ /** How long a run may sit undequeued before it expires. Forwarded to `TaskRunOptions.ttl`. */
1473
+ ttl: v4_1.z.string().or(v4_1.z.number().nonnegative().int()).optional(),
1429
1474
  });
1430
1475
  /**
1431
1476
  * Request body for `POST /api/v1/sessions`. Creates a Session and
@@ -1434,11 +1479,11 @@ exports.SessionTriggerConfig = zod_1.z.object({
1434
1479
  * (after run termination, after `end-and-continue`) reuse the same
1435
1480
  * config.
1436
1481
  */
1437
- exports.CreateSessionRequestBody = zod_1.z.object({
1482
+ exports.CreateSessionRequestBody = v4_1.z.object({
1438
1483
  /** Plain string discriminator — e.g. `"chat.agent"`. Not validated against an enum on the server. */
1439
- type: zod_1.z.string().min(1).max(64),
1484
+ type: v4_1.z.string().min(1).max(64),
1440
1485
  /** User-supplied idempotency key. Unique per environment. Empty strings are rejected. */
1441
- externalId: zod_1.z
1486
+ externalId: v4_1.z
1442
1487
  .string()
1443
1488
  .trim()
1444
1489
  .min(1)
@@ -1448,21 +1493,21 @@ exports.CreateSessionRequestBody = zod_1.z.object({
1448
1493
  })
1449
1494
  .optional(),
1450
1495
  /** Task this session triggers runs against. Required. */
1451
- taskIdentifier: zod_1.z.string().min(1).max(128),
1496
+ taskIdentifier: v4_1.z.string().min(1).max(128),
1452
1497
  /** Trigger config used for every run scheduled by this session. */
1453
1498
  triggerConfig: exports.SessionTriggerConfig,
1454
1499
  /** Up to 10 tags for dashboard filtering. */
1455
- tags: zod_1.z.array(zod_1.z.string().max(128)).max(10).optional(),
1500
+ tags: v4_1.z.array(v4_1.z.string().max(128)).max(10).optional(),
1456
1501
  /** Arbitrary JSON metadata. */
1457
- metadata: zod_1.z.record(zod_1.z.unknown()).optional(),
1502
+ metadata: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).optional(),
1458
1503
  /** Absolute expiry timestamp for retention. */
1459
- expiresAt: zod_1.z.coerce.date().optional(),
1504
+ expiresAt: v4_1.z.coerce.date().optional(),
1460
1505
  });
1461
- exports.SessionItem = zod_1.z.object({
1462
- id: zod_1.z.string(),
1463
- externalId: zod_1.z.string().nullable(),
1464
- type: zod_1.z.string(),
1465
- taskIdentifier: zod_1.z.string(),
1506
+ exports.SessionItem = v4_1.z.object({
1507
+ id: v4_1.z.string(),
1508
+ externalId: v4_1.z.string().nullable(),
1509
+ type: v4_1.z.string(),
1510
+ taskIdentifier: v4_1.z.string(),
1466
1511
  /**
1467
1512
  * Optional on the wire because some surfaces (the list endpoint backed
1468
1513
  * by ClickHouse, list-page rendering) don't carry triggerConfig.
@@ -1475,22 +1520,27 @@ exports.SessionItem = zod_1.z.object({
1475
1520
  * `SessionItem` are responsible for resolving the friendly form
1476
1521
  * from the underlying cuid before returning.
1477
1522
  */
1478
- currentRunId: zod_1.z.string().nullable().optional(),
1479
- tags: zod_1.z.array(zod_1.z.string()),
1480
- metadata: zod_1.z.record(zod_1.z.unknown()).nullable(),
1481
- closedAt: zod_1.z.coerce.date().nullable(),
1482
- closedReason: zod_1.z.string().nullable(),
1483
- expiresAt: zod_1.z.coerce.date().nullable(),
1484
- createdAt: zod_1.z.coerce.date(),
1485
- updatedAt: zod_1.z.coerce.date(),
1523
+ currentRunId: v4_1.z.string().nullable().optional(),
1524
+ tags: v4_1.z.array(v4_1.z.string()),
1525
+ metadata: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).nullable(),
1526
+ closedAt: v4_1.z.coerce.date().nullable(),
1527
+ closedReason: v4_1.z.string().nullable(),
1528
+ expiresAt: v4_1.z.coerce.date().nullable(),
1529
+ createdAt: v4_1.z.coerce.date(),
1530
+ updatedAt: v4_1.z.coerce.date(),
1486
1531
  });
1487
1532
  exports.CreatedSessionResponseBody = exports.SessionItem.extend({
1488
1533
  /** Friendly id of the first run triggered alongside session create. */
1489
- runId: zod_1.z.string(),
1534
+ runId: v4_1.z.string(),
1490
1535
  /** Session-scoped public access token: `read:sessions:{ext} + write:sessions:{ext}`. */
1491
- publicAccessToken: zod_1.z.string(),
1536
+ publicAccessToken: v4_1.z.string(),
1492
1537
  /** True if the session existed already (idempotent upsert), false if newly created. */
1493
- isCached: zod_1.z.boolean(),
1538
+ isCached: v4_1.z.boolean(),
1539
+ /**
1540
+ * The session's live run is parked waiting for a deployment carrying its external deployment
1541
+ * id. Messages sent meanwhile are durable. Optional, so older servers read as `false`.
1542
+ */
1543
+ pendingVersion: v4_1.z.boolean().optional(),
1494
1544
  });
1495
1545
  exports.RetrieveSessionResponseBody = exports.SessionItem;
1496
1546
  /**
@@ -1500,31 +1550,42 @@ exports.RetrieveSessionResponseBody = exports.SessionItem;
1500
1550
  * server triggers a new run, atomically swaps `currentRunId`, and the
1501
1551
  * caller exits.
1502
1552
  */
1503
- exports.EndAndContinueSessionRequestBody = zod_1.z.object({
1553
+ exports.EndAndContinueSessionRequestBody = v4_1.z.object({
1504
1554
  /** The friendlyId of the run requesting the handoff. */
1505
- callingRunId: zod_1.z.string(),
1555
+ callingRunId: v4_1.z.string(),
1506
1556
  /** Free-form label for the SessionRun audit row. e.g. `"upgrade"`. */
1507
- reason: zod_1.z.string().max(64),
1557
+ reason: v4_1.z.string().max(64),
1558
+ /**
1559
+ * Re-pin the session to this id instead of clearing the pin. Only read when `reason` is
1560
+ * `"upgrade"`. `lockToVersion` is never cleared.
1561
+ */
1562
+ externalDeploymentId: ExternalDeploymentId,
1508
1563
  });
1509
- exports.EndAndContinueSessionResponseBody = zod_1.z.object({
1564
+ exports.EndAndContinueSessionResponseBody = v4_1.z.object({
1510
1565
  /** friendlyId of the run that has taken over the session. */
1511
- runId: zod_1.z.string(),
1566
+ runId: v4_1.z.string(),
1512
1567
  /**
1513
1568
  * False when the swap was preempted (a different run was already
1514
1569
  * running by the time we tried to claim). The caller should treat
1515
1570
  * this as "someone else moved on" — exit cleanly without expecting
1516
1571
  * to drive the next run.
1517
1572
  */
1518
- swapped: zod_1.z.boolean(),
1573
+ swapped: v4_1.z.boolean(),
1574
+ /**
1575
+ * The run that took over is parked waiting for its deployment. Surface this so a
1576
+ * handoff onto a version that has not landed reads as a deploy in progress rather
1577
+ * than a chat that went quiet.
1578
+ */
1579
+ pendingVersion: v4_1.z.boolean().optional(),
1519
1580
  });
1520
- exports.UpdateSessionRequestBody = zod_1.z.object({
1521
- tags: zod_1.z.array(zod_1.z.string().max(128)).max(10).optional(),
1522
- metadata: zod_1.z.record(zod_1.z.unknown()).nullable().optional(),
1581
+ exports.UpdateSessionRequestBody = v4_1.z.object({
1582
+ tags: v4_1.z.array(v4_1.z.string().max(128)).max(10).optional(),
1583
+ metadata: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).nullable().optional(),
1523
1584
  // Null explicitly clears the externalId; non-null values must be non-empty.
1524
- externalId: zod_1.z
1585
+ externalId: v4_1.z
1525
1586
  .union([
1526
- zod_1.z.literal(null),
1527
- zod_1.z
1587
+ v4_1.z.literal(null),
1588
+ v4_1.z
1528
1589
  .string()
1529
1590
  .trim()
1530
1591
  .min(1)
@@ -1535,10 +1596,17 @@ exports.UpdateSessionRequestBody = zod_1.z.object({
1535
1596
  ])
1536
1597
  .optional(),
1537
1598
  });
1538
- exports.CloseSessionRequestBody = zod_1.z.object({
1539
- reason: zod_1.z.string().max(256).optional(),
1599
+ exports.CloseSessionRequestBody = v4_1.z.object({
1600
+ reason: v4_1.z.string().max(256).optional(),
1601
+ /**
1602
+ * The friendlyId of the run requesting the close, when the close comes
1603
+ * from inside the session's own run (`chat.close()`). That run is already
1604
+ * exiting, so the server skips appending the wake-up close record to `.in`
1605
+ * for it. Omitted for an external close (dashboard, `sessions.close()`, MCP).
1606
+ */
1607
+ callingRunId: v4_1.z.string().optional(),
1540
1608
  });
1541
- exports.SessionStatus = zod_1.z.enum(["ACTIVE", "CLOSED", "EXPIRED"]);
1609
+ exports.SessionStatus = v4_1.z.enum(["ACTIVE", "CLOSED", "EXPIRED"]);
1542
1610
  /**
1543
1611
  * Server-side validation schema for `GET /api/v1/sessions`. Follows the same
1544
1612
  * cursor-pagination convention as runs/waitpoints (`page[size]`,
@@ -1546,19 +1614,19 @@ exports.SessionStatus = zod_1.z.enum(["ACTIVE", "CLOSED", "EXPIRED"]);
1546
1614
  * narrowing fields — both produced automatically by `zodfetchCursorPage`
1547
1615
  * and the matching client-side search-query helper.
1548
1616
  */
1549
- exports.ListSessionsQueryParams = zod_1.z
1617
+ exports.ListSessionsQueryParams = v4_1.z
1550
1618
  .object({
1551
- "page[size]": zod_1.z.coerce.number().int().min(1).max(100).default(20),
1552
- "page[after]": zod_1.z.string().optional(),
1553
- "page[before]": zod_1.z.string().optional(),
1554
- "filter[type]": zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
1555
- "filter[tags]": zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
1556
- "filter[taskIdentifier]": zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
1557
- "filter[externalId]": zod_1.z.string().optional(),
1558
- "filter[status]": zod_1.z.union([exports.SessionStatus, zod_1.z.array(exports.SessionStatus)]).optional(),
1559
- "filter[createdAt][period]": zod_1.z.string().optional(),
1560
- "filter[createdAt][from]": zod_1.z.coerce.number().int().optional(),
1561
- "filter[createdAt][to]": zod_1.z.coerce.number().int().optional(),
1619
+ "page[size]": v4_1.z.coerce.number().int().min(1).max(100).default(20),
1620
+ "page[after]": v4_1.z.string().optional(),
1621
+ "page[before]": v4_1.z.string().optional(),
1622
+ "filter[type]": v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]).optional(),
1623
+ "filter[tags]": v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]).optional(),
1624
+ "filter[taskIdentifier]": v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]).optional(),
1625
+ "filter[externalId]": v4_1.z.string().optional(),
1626
+ "filter[status]": v4_1.z.union([exports.SessionStatus, v4_1.z.array(exports.SessionStatus)]).optional(),
1627
+ "filter[createdAt][period]": v4_1.z.string().optional(),
1628
+ "filter[createdAt][from]": v4_1.z.coerce.number().int().optional(),
1629
+ "filter[createdAt][to]": v4_1.z.coerce.number().int().optional(),
1562
1630
  })
1563
1631
  .refine((value) => !(value["page[after]"] && value["page[before]"]), {
1564
1632
  message: "Cannot pass both page[after] and page[before] on the same request",
@@ -1569,41 +1637,41 @@ exports.ListSessionsQueryParams = zod_1.z
1569
1637
  * {@link ApiClient.listSessions} converts into the `filter[*]` / `page[*]`
1570
1638
  * query string before sending.
1571
1639
  */
1572
- exports.ListSessionsOptions = zod_1.z.object({
1573
- limit: zod_1.z.number().int().min(1).max(100).optional(),
1574
- after: zod_1.z.string().optional(),
1575
- before: zod_1.z.string().optional(),
1576
- type: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
1577
- tag: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
1578
- taskIdentifier: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
1579
- externalId: zod_1.z.string().optional(),
1580
- status: zod_1.z.union([exports.SessionStatus, zod_1.z.array(exports.SessionStatus)]).optional(),
1581
- period: zod_1.z.string().optional(),
1582
- from: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
1583
- to: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
1640
+ exports.ListSessionsOptions = v4_1.z.object({
1641
+ limit: v4_1.z.number().int().min(1).max(100).optional(),
1642
+ after: v4_1.z.string().optional(),
1643
+ before: v4_1.z.string().optional(),
1644
+ type: v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]).optional(),
1645
+ tag: v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]).optional(),
1646
+ taskIdentifier: v4_1.z.union([v4_1.z.string(), v4_1.z.array(v4_1.z.string())]).optional(),
1647
+ externalId: v4_1.z.string().optional(),
1648
+ status: v4_1.z.union([exports.SessionStatus, v4_1.z.array(exports.SessionStatus)]).optional(),
1649
+ period: v4_1.z.string().optional(),
1650
+ from: v4_1.z.union([v4_1.z.number(), v4_1.z.date()]).optional(),
1651
+ to: v4_1.z.union([v4_1.z.number(), v4_1.z.date()]).optional(),
1584
1652
  });
1585
1653
  exports.ListedSessionItem = exports.SessionItem;
1586
- exports.ListSessionsResponseBody = zod_1.z.object({
1587
- data: zod_1.z.array(exports.ListedSessionItem),
1588
- pagination: zod_1.z.object({
1589
- next: zod_1.z.string().optional(),
1590
- previous: zod_1.z.string().optional(),
1654
+ exports.ListSessionsResponseBody = v4_1.z.object({
1655
+ data: v4_1.z.array(exports.ListedSessionItem),
1656
+ pagination: v4_1.z.object({
1657
+ next: v4_1.z.string().optional(),
1658
+ previous: v4_1.z.string().optional(),
1591
1659
  }),
1592
1660
  });
1593
- exports.CompleteWaitpointTokenResponseBody = zod_1.z.object({
1594
- success: zod_1.z.literal(true),
1661
+ exports.CompleteWaitpointTokenResponseBody = v4_1.z.object({
1662
+ success: v4_1.z.literal(true),
1595
1663
  });
1596
- exports.WaitForWaitpointTokenResponseBody = zod_1.z.object({
1597
- success: zod_1.z.boolean(),
1664
+ exports.WaitForWaitpointTokenResponseBody = v4_1.z.object({
1665
+ success: v4_1.z.boolean(),
1598
1666
  });
1599
- exports.WaitForDurationRequestBody = zod_1.z.object({
1667
+ exports.WaitForDurationRequestBody = v4_1.z.object({
1600
1668
  /**
1601
1669
  * An optional idempotency key for the waitpoint.
1602
1670
  * If you use the same key twice (and the key hasn't expired), you will get the original waitpoint back.
1603
1671
  *
1604
1672
  * Note: This waitpoint may already be complete, in which case when you wait for it, it will immediately continue.
1605
1673
  */
1606
- idempotencyKey: zod_1.z
1674
+ idempotencyKey: v4_1.z
1607
1675
  .string()
1608
1676
  // Caps user-supplied keys before they reach the unique idempotency index
1609
1677
  // on the underlying table — values past this fail at the database layer
@@ -1614,20 +1682,20 @@ exports.WaitForDurationRequestBody = zod_1.z.object({
1614
1682
  * When set, this means the passed in idempotency key will expire after this time.
1615
1683
  * This means after that time if you pass the same idempotency key again, you will get a new waitpoint.
1616
1684
  */
1617
- idempotencyKeyTTL: zod_1.z.string().optional(),
1685
+ idempotencyKeyTTL: v4_1.z.string().optional(),
1618
1686
  /**
1619
1687
  * The date that the waitpoint will complete.
1620
1688
  */
1621
- date: zod_1.z.coerce.date(),
1689
+ date: v4_1.z.coerce.date(),
1622
1690
  });
1623
- exports.WaitForDurationResponseBody = zod_1.z.object({
1691
+ exports.WaitForDurationResponseBody = v4_1.z.object({
1624
1692
  /**
1625
1693
  If you pass an idempotencyKey, you may actually not need to wait.
1626
1694
  Use this date to determine when to continue.
1627
1695
  */
1628
- waitUntil: zod_1.z.coerce.date(),
1629
- waitpoint: zod_1.z.object({
1630
- id: zod_1.z.string(),
1696
+ waitUntil: v4_1.z.coerce.date(),
1697
+ waitpoint: v4_1.z.object({
1698
+ id: v4_1.z.string(),
1631
1699
  }),
1632
1700
  });
1633
1701
  const WAITPOINT_TIMEOUT_ERROR_CODE = "TRIGGER_WAITPOINT_TIMEOUT";
@@ -1647,19 +1715,19 @@ function timeoutError(timeout) {
1647
1715
  };
1648
1716
  }
1649
1717
  const ApiDeploymentCommonShape = {
1650
- from: zod_1.z.string().describe("The date to start the search from, in ISO 8601 format").optional(),
1651
- to: zod_1.z.string().describe("The date to end the search, in ISO 8601 format").optional(),
1652
- period: zod_1.z.string().describe("The period to search within (e.g. 1d, 7d, 3h, etc.)").optional(),
1653
- status: zod_1.z
1718
+ from: v4_1.z.string().describe("The date to start the search from, in ISO 8601 format").optional(),
1719
+ to: v4_1.z.string().describe("The date to end the search, in ISO 8601 format").optional(),
1720
+ period: v4_1.z.string().describe("The period to search within (e.g. 1d, 7d, 3h, etc.)").optional(),
1721
+ status: v4_1.z
1654
1722
  .enum(["PENDING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"])
1655
1723
  .describe("Filter deployments that are in this status")
1656
1724
  .optional(),
1657
1725
  };
1658
- const ApiDeploymentListPaginationCursor = zod_1.z
1726
+ const ApiDeploymentListPaginationCursor = v4_1.z
1659
1727
  .string()
1660
1728
  .describe("The deployment ID to start the search from, to get the next page")
1661
1729
  .optional();
1662
- const ApiDeploymentListPaginationLimit = zod_1.z.coerce
1730
+ const ApiDeploymentListPaginationLimit = v4_1.z.coerce
1663
1731
  .number()
1664
1732
  .describe("The number of deployments to return, defaults to 20 (max 100)")
1665
1733
  .min(1, "Limit must be at least 1")
@@ -1670,20 +1738,20 @@ exports.ApiDeploymentListParams = {
1670
1738
  cursor: ApiDeploymentListPaginationCursor,
1671
1739
  limit: ApiDeploymentListPaginationLimit,
1672
1740
  };
1673
- exports.ApiDeploymentListOptions = zod_1.z.object(exports.ApiDeploymentListParams);
1674
- exports.ApiDeploymentListSearchParams = zod_1.z.object({
1741
+ exports.ApiDeploymentListOptions = v4_1.z.object(exports.ApiDeploymentListParams);
1742
+ exports.ApiDeploymentListSearchParams = v4_1.z.object({
1675
1743
  ...ApiDeploymentCommonShape,
1676
1744
  "page[after]": ApiDeploymentListPaginationCursor,
1677
1745
  "page[size]": ApiDeploymentListPaginationLimit,
1678
1746
  });
1679
- exports.ApiDeploymentListResponseItem = zod_1.z.object({
1680
- id: zod_1.z.string(),
1681
- createdAt: zod_1.z.coerce.date(),
1682
- shortCode: zod_1.z.string(),
1683
- version: zod_1.z.string(),
1684
- runtime: zod_1.z.string().nullable(),
1685
- runtimeVersion: zod_1.z.string().nullable(),
1686
- status: zod_1.z.enum([
1747
+ exports.ApiDeploymentListResponseItem = v4_1.z.object({
1748
+ id: v4_1.z.string(),
1749
+ createdAt: v4_1.z.coerce.date(),
1750
+ shortCode: v4_1.z.string(),
1751
+ version: v4_1.z.string(),
1752
+ runtime: v4_1.z.string().nullable(),
1753
+ runtimeVersion: v4_1.z.string().nullable(),
1754
+ status: v4_1.z.enum([
1687
1755
  "PENDING",
1688
1756
  "BUILDING",
1689
1757
  "DEPLOYING",
@@ -1692,106 +1760,112 @@ exports.ApiDeploymentListResponseItem = zod_1.z.object({
1692
1760
  "CANCELED",
1693
1761
  "TIMED_OUT",
1694
1762
  ]),
1695
- deployedAt: zod_1.z.coerce.date().optional(),
1696
- git: zod_1.z.record(zod_1.z.any()).optional(),
1763
+ deployedAt: v4_1.z.coerce.date().optional(),
1764
+ git: v4_1.z.record(v4_1.z.string(), v4_1.z.any()).optional(),
1697
1765
  error: exports.DeploymentErrorData.optional(),
1766
+ /**
1767
+ * The `--external-id` this deployment was deployed under, used by version skew
1768
+ * protection to pin runs. Nullish on deployments created without one, and on
1769
+ * servers older than this field.
1770
+ */
1771
+ externalId: v4_1.z.string().nullish(),
1698
1772
  });
1699
1773
  exports.RetrieveCurrentDeploymentResponseBody = exports.ApiDeploymentListResponseItem;
1700
- exports.ApiBranchListResponseBody = zod_1.z.object({
1701
- branches: zod_1.z.array(zod_1.z.object({
1702
- id: zod_1.z.string(),
1703
- name: zod_1.z.string(),
1704
- createdAt: zod_1.z.coerce.date(),
1705
- updatedAt: zod_1.z.coerce.date(),
1706
- git: zod_1.z.record(zod_1.z.any()).optional(),
1707
- isPaused: zod_1.z.boolean(),
1774
+ exports.ApiBranchListResponseBody = v4_1.z.object({
1775
+ branches: v4_1.z.array(v4_1.z.object({
1776
+ id: v4_1.z.string(),
1777
+ name: v4_1.z.string(),
1778
+ createdAt: v4_1.z.coerce.date(),
1779
+ updatedAt: v4_1.z.coerce.date(),
1780
+ git: v4_1.z.record(v4_1.z.string(), v4_1.z.any()).optional(),
1781
+ isPaused: v4_1.z.boolean(),
1708
1782
  })),
1709
1783
  });
1710
- exports.RetrieveRunTraceSpanSchema = zod_1.z.object({
1711
- id: zod_1.z.string(),
1712
- parentId: zod_1.z.string().optional(),
1713
- runId: zod_1.z.string(),
1714
- data: zod_1.z.object({
1715
- message: zod_1.z.string(),
1716
- taskSlug: zod_1.z.string().optional(),
1717
- taskPath: zod_1.z.string().optional(),
1718
- events: zod_1.z.array(zod_1.z.any()).optional(),
1719
- startTime: zod_1.z.coerce.date(),
1720
- duration: zod_1.z.number(),
1721
- isError: zod_1.z.boolean(),
1722
- isPartial: zod_1.z.boolean(),
1723
- isCancelled: zod_1.z.boolean(),
1724
- level: zod_1.z.string(),
1725
- workerVersion: zod_1.z.string().optional(),
1726
- queueName: zod_1.z.string().optional(),
1727
- machinePreset: zod_1.z.string().optional(),
1728
- properties: zod_1.z.record(zod_1.z.any()).optional(),
1729
- output: zod_1.z.unknown().optional(),
1784
+ exports.RetrieveRunTraceSpanSchema = v4_1.z.object({
1785
+ id: v4_1.z.string(),
1786
+ parentId: v4_1.z.string().optional(),
1787
+ runId: v4_1.z.string(),
1788
+ data: v4_1.z.object({
1789
+ message: v4_1.z.string(),
1790
+ taskSlug: v4_1.z.string().optional(),
1791
+ taskPath: v4_1.z.string().optional(),
1792
+ events: v4_1.z.array(v4_1.z.any()).optional(),
1793
+ startTime: v4_1.z.coerce.date(),
1794
+ duration: v4_1.z.number(),
1795
+ isError: v4_1.z.boolean(),
1796
+ isPartial: v4_1.z.boolean(),
1797
+ isCancelled: v4_1.z.boolean(),
1798
+ level: v4_1.z.string(),
1799
+ workerVersion: v4_1.z.string().optional(),
1800
+ queueName: v4_1.z.string().optional(),
1801
+ machinePreset: v4_1.z.string().optional(),
1802
+ properties: v4_1.z.record(v4_1.z.string(), v4_1.z.any()).optional(),
1803
+ output: v4_1.z.unknown().optional(),
1730
1804
  }),
1731
1805
  });
1732
1806
  exports.RetrieveRunTraceSpan = exports.RetrieveRunTraceSpanSchema.extend({
1733
- children: zod_1.z.lazy(() => exports.RetrieveRunTraceSpan.array()),
1807
+ children: v4_1.z.lazy(() => exports.RetrieveRunTraceSpan.array()),
1734
1808
  });
1735
- exports.RetrieveRunTraceResponseBody = zod_1.z.object({
1736
- trace: zod_1.z.object({
1737
- traceId: zod_1.z.string(),
1809
+ exports.RetrieveRunTraceResponseBody = v4_1.z.object({
1810
+ trace: v4_1.z.object({
1811
+ traceId: v4_1.z.string(),
1738
1812
  rootSpan: exports.RetrieveRunTraceSpan,
1739
1813
  }),
1740
1814
  });
1741
- exports.RetrieveSpanDetailResponseBody = zod_1.z.object({
1742
- spanId: zod_1.z.string(),
1743
- parentId: zod_1.z.string().nullable(),
1744
- runId: zod_1.z.string(),
1745
- message: zod_1.z.string(),
1746
- isError: zod_1.z.boolean(),
1747
- isPartial: zod_1.z.boolean(),
1748
- isCancelled: zod_1.z.boolean(),
1749
- level: zod_1.z.string(),
1750
- startTime: zod_1.z.coerce.date(),
1751
- durationMs: zod_1.z.number(),
1752
- properties: zod_1.z.record(zod_1.z.any()).optional(),
1753
- events: zod_1.z.array(zod_1.z.any()).optional(),
1754
- entityType: zod_1.z.string().optional(),
1755
- ai: zod_1.z
1815
+ exports.RetrieveSpanDetailResponseBody = v4_1.z.object({
1816
+ spanId: v4_1.z.string(),
1817
+ parentId: v4_1.z.string().nullable(),
1818
+ runId: v4_1.z.string(),
1819
+ message: v4_1.z.string(),
1820
+ isError: v4_1.z.boolean(),
1821
+ isPartial: v4_1.z.boolean(),
1822
+ isCancelled: v4_1.z.boolean(),
1823
+ level: v4_1.z.string(),
1824
+ startTime: v4_1.z.coerce.date(),
1825
+ durationMs: v4_1.z.number(),
1826
+ properties: v4_1.z.record(v4_1.z.string(), v4_1.z.any()).optional(),
1827
+ events: v4_1.z.array(v4_1.z.any()).optional(),
1828
+ entityType: v4_1.z.string().optional(),
1829
+ ai: v4_1.z
1756
1830
  .object({
1757
- model: zod_1.z.string(),
1758
- provider: zod_1.z.string(),
1759
- operationName: zod_1.z.string(),
1760
- inputTokens: zod_1.z.number(),
1761
- outputTokens: zod_1.z.number(),
1762
- totalTokens: zod_1.z.number(),
1763
- cachedTokens: zod_1.z.number().optional(),
1764
- reasoningTokens: zod_1.z.number().optional(),
1765
- inputCost: zod_1.z.number().optional(),
1766
- outputCost: zod_1.z.number().optional(),
1767
- totalCost: zod_1.z.number().optional(),
1768
- cachedCost: zod_1.z.number().optional(),
1769
- cacheCreationCost: zod_1.z.number().optional(),
1770
- tokensPerSecond: zod_1.z.number().optional(),
1771
- msToFirstChunk: zod_1.z.number().optional(),
1772
- durationMs: zod_1.z.number(),
1773
- finishReason: zod_1.z.string().optional(),
1774
- responseText: zod_1.z.string().optional(),
1831
+ model: v4_1.z.string(),
1832
+ provider: v4_1.z.string(),
1833
+ operationName: v4_1.z.string(),
1834
+ inputTokens: v4_1.z.number(),
1835
+ outputTokens: v4_1.z.number(),
1836
+ totalTokens: v4_1.z.number(),
1837
+ cachedTokens: v4_1.z.number().optional(),
1838
+ reasoningTokens: v4_1.z.number().optional(),
1839
+ inputCost: v4_1.z.number().optional(),
1840
+ outputCost: v4_1.z.number().optional(),
1841
+ totalCost: v4_1.z.number().optional(),
1842
+ cachedCost: v4_1.z.number().optional(),
1843
+ cacheCreationCost: v4_1.z.number().optional(),
1844
+ tokensPerSecond: v4_1.z.number().optional(),
1845
+ msToFirstChunk: v4_1.z.number().optional(),
1846
+ durationMs: v4_1.z.number(),
1847
+ finishReason: v4_1.z.string().optional(),
1848
+ responseText: v4_1.z.string().optional(),
1775
1849
  })
1776
1850
  .optional(),
1777
- triggeredRuns: zod_1.z
1778
- .array(zod_1.z.object({
1779
- runId: zod_1.z.string(),
1780
- taskIdentifier: zod_1.z.string(),
1781
- status: zod_1.z.string(),
1782
- createdAt: zod_1.z.coerce.date(),
1851
+ triggeredRuns: v4_1.z
1852
+ .array(v4_1.z.object({
1853
+ runId: v4_1.z.string(),
1854
+ taskIdentifier: v4_1.z.string(),
1855
+ status: v4_1.z.string(),
1856
+ createdAt: v4_1.z.coerce.date(),
1783
1857
  }))
1784
1858
  .optional(),
1785
1859
  });
1786
- exports.CreateStreamResponseBody = zod_1.z.object({
1787
- version: zod_1.z.string(),
1860
+ exports.CreateStreamResponseBody = v4_1.z.object({
1861
+ version: v4_1.z.string(),
1788
1862
  });
1789
- exports.AppendToStreamResponseBody = zod_1.z.object({
1790
- ok: zod_1.z.boolean(),
1791
- message: zod_1.z.string().optional(),
1863
+ exports.AppendToStreamResponseBody = v4_1.z.object({
1864
+ ok: v4_1.z.boolean(),
1865
+ message: v4_1.z.string().optional(),
1792
1866
  });
1793
- exports.SendInputStreamResponseBody = zod_1.z.object({
1794
- ok: zod_1.z.boolean(),
1867
+ exports.SendInputStreamResponseBody = v4_1.z.object({
1868
+ ok: v4_1.z.boolean(),
1795
1869
  });
1796
1870
  /**
1797
1871
  * Response body for `GET /realtime/v1/sessions/:id/:io/records`. A non-SSE,
@@ -1808,80 +1882,80 @@ exports.SendInputStreamResponseBody = zod_1.z.object({
1808
1882
  * already runtime-check on the discriminator and tolerate malformed
1809
1883
  * records by skipping them.
1810
1884
  */
1811
- exports.ReadSessionStreamRecordsResponseBody = zod_1.z.object({
1812
- records: zod_1.z.array(zod_1.z.object({
1813
- data: zod_1.z.unknown(),
1814
- id: zod_1.z.string(),
1815
- seqNum: zod_1.z.number(),
1885
+ exports.ReadSessionStreamRecordsResponseBody = v4_1.z.object({
1886
+ records: v4_1.z.array(v4_1.z.object({
1887
+ data: v4_1.z.unknown(),
1888
+ id: v4_1.z.string(),
1889
+ seqNum: v4_1.z.number(),
1816
1890
  // S2 record headers — present on Trigger control records (e.g.
1817
1891
  // `trigger-control: turn-complete` plus sibling headers). The
1818
1892
  // server has always serialized them; older schemas stripped them
1819
1893
  // client-side, so treat as optional.
1820
- headers: zod_1.z.array(zod_1.z.tuple([zod_1.z.string(), zod_1.z.string()])).optional(),
1894
+ headers: v4_1.z.array(v4_1.z.tuple([v4_1.z.string(), v4_1.z.string()])).optional(),
1821
1895
  })),
1822
1896
  });
1823
- exports.ResolvePromptRequestBody = zod_1.z.object({
1824
- variables: zod_1.z.record(zod_1.z.unknown()).default({}),
1825
- label: zod_1.z.string().optional(),
1826
- version: zod_1.z.number().optional(),
1827
- });
1828
- exports.ResolvePromptResponseBody = zod_1.z.object({
1829
- data: zod_1.z.object({
1830
- promptId: zod_1.z.string(),
1831
- slug: zod_1.z.string(),
1832
- version: zod_1.z.number(),
1833
- labels: zod_1.z.array(zod_1.z.string()),
1834
- template: zod_1.z.string().optional(),
1835
- text: zod_1.z.string().optional(),
1836
- model: zod_1.z.string().optional().nullable(),
1837
- config: zod_1.z.record(zod_1.z.unknown()).optional().nullable(),
1897
+ exports.ResolvePromptRequestBody = v4_1.z.object({
1898
+ variables: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).default({}),
1899
+ label: v4_1.z.string().optional(),
1900
+ version: v4_1.z.number().optional(),
1901
+ });
1902
+ exports.ResolvePromptResponseBody = v4_1.z.object({
1903
+ data: v4_1.z.object({
1904
+ promptId: v4_1.z.string(),
1905
+ slug: v4_1.z.string(),
1906
+ version: v4_1.z.number(),
1907
+ labels: v4_1.z.array(v4_1.z.string()),
1908
+ template: v4_1.z.string().optional(),
1909
+ text: v4_1.z.string().optional(),
1910
+ model: v4_1.z.string().optional().nullable(),
1911
+ config: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).optional().nullable(),
1838
1912
  }),
1839
1913
  });
1840
- exports.ListPromptsResponseBody = zod_1.z.object({
1841
- data: zod_1.z.array(zod_1.z.object({
1842
- slug: zod_1.z.string(),
1843
- friendlyId: zod_1.z.string(),
1844
- description: zod_1.z.string().nullable(),
1845
- tags: zod_1.z.array(zod_1.z.string()),
1846
- defaultModel: zod_1.z.string().nullable(),
1847
- currentVersion: zod_1.z.number().nullable(),
1848
- hasOverride: zod_1.z.boolean(),
1849
- updatedAt: zod_1.z.string(),
1914
+ exports.ListPromptsResponseBody = v4_1.z.object({
1915
+ data: v4_1.z.array(v4_1.z.object({
1916
+ slug: v4_1.z.string(),
1917
+ friendlyId: v4_1.z.string(),
1918
+ description: v4_1.z.string().nullable(),
1919
+ tags: v4_1.z.array(v4_1.z.string()),
1920
+ defaultModel: v4_1.z.string().nullable(),
1921
+ currentVersion: v4_1.z.number().nullable(),
1922
+ hasOverride: v4_1.z.boolean(),
1923
+ updatedAt: v4_1.z.string(),
1850
1924
  })),
1851
1925
  });
1852
- exports.ListPromptVersionsResponseBody = zod_1.z.object({
1853
- data: zod_1.z.array(zod_1.z.object({
1854
- id: zod_1.z.string(),
1855
- version: zod_1.z.number(),
1856
- labels: zod_1.z.array(zod_1.z.string()),
1857
- source: zod_1.z.string(),
1858
- model: zod_1.z.string().nullable(),
1859
- textContent: zod_1.z.string().nullable(),
1860
- commitMessage: zod_1.z.string().nullable(),
1861
- contentHash: zod_1.z.string(),
1862
- createdAt: zod_1.z.string(),
1926
+ exports.ListPromptVersionsResponseBody = v4_1.z.object({
1927
+ data: v4_1.z.array(v4_1.z.object({
1928
+ id: v4_1.z.string(),
1929
+ version: v4_1.z.number(),
1930
+ labels: v4_1.z.array(v4_1.z.string()),
1931
+ source: v4_1.z.string(),
1932
+ model: v4_1.z.string().nullable(),
1933
+ textContent: v4_1.z.string().nullable(),
1934
+ commitMessage: v4_1.z.string().nullable(),
1935
+ contentHash: v4_1.z.string(),
1936
+ createdAt: v4_1.z.string(),
1863
1937
  })),
1864
1938
  });
1865
- exports.PromotePromptVersionRequestBody = zod_1.z.object({
1866
- version: zod_1.z.number().int().positive(),
1939
+ exports.PromotePromptVersionRequestBody = v4_1.z.object({
1940
+ version: v4_1.z.number().int().positive(),
1867
1941
  });
1868
- exports.CreatePromptOverrideRequestBody = zod_1.z.object({
1869
- textContent: zod_1.z.string(),
1870
- model: zod_1.z.string().optional(),
1871
- commitMessage: zod_1.z.string().optional(),
1872
- source: zod_1.z.string().optional(),
1942
+ exports.CreatePromptOverrideRequestBody = v4_1.z.object({
1943
+ textContent: v4_1.z.string(),
1944
+ model: v4_1.z.string().optional(),
1945
+ commitMessage: v4_1.z.string().optional(),
1946
+ source: v4_1.z.string().optional(),
1873
1947
  });
1874
- exports.UpdatePromptOverrideRequestBody = zod_1.z.object({
1875
- textContent: zod_1.z.string().optional(),
1876
- model: zod_1.z.string().optional(),
1877
- commitMessage: zod_1.z.string().optional(),
1948
+ exports.UpdatePromptOverrideRequestBody = v4_1.z.object({
1949
+ textContent: v4_1.z.string().optional(),
1950
+ model: v4_1.z.string().optional(),
1951
+ commitMessage: v4_1.z.string().optional(),
1878
1952
  });
1879
- exports.ReactivatePromptOverrideRequestBody = zod_1.z.object({
1880
- version: zod_1.z.number().int().positive(),
1953
+ exports.ReactivatePromptOverrideRequestBody = v4_1.z.object({
1954
+ version: v4_1.z.number().int().positive(),
1881
1955
  });
1882
- exports.PromptOkResponseBody = zod_1.z.object({ ok: zod_1.z.boolean() });
1883
- exports.PromptOverrideCreatedResponseBody = zod_1.z.object({
1884
- ok: zod_1.z.boolean(),
1885
- version: zod_1.z.number(),
1956
+ exports.PromptOkResponseBody = v4_1.z.object({ ok: v4_1.z.boolean() });
1957
+ exports.PromptOverrideCreatedResponseBody = v4_1.z.object({
1958
+ ok: v4_1.z.boolean(),
1959
+ version: v4_1.z.number(),
1886
1960
  });
1887
1961
  //# sourceMappingURL=api.js.map