@temelj/workflow 0.0.0-alpha.1

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 (393) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/dist/attributes.d.mts +15 -0
  4. package/dist/attributes.mjs +30 -0
  5. package/dist/client/create.d.mts +31 -0
  6. package/dist/client/create.mjs +67 -0
  7. package/dist/client/facades.d.mts +21 -0
  8. package/dist/client/facades.mjs +142 -0
  9. package/dist/client/mod.d.mts +2 -0
  10. package/dist/client/mod.mjs +2 -0
  11. package/dist/client/run-handle.d.mts +66 -0
  12. package/dist/client/run-handle.mjs +156 -0
  13. package/dist/client/worker-options.d.mts +17 -0
  14. package/dist/client/worker-options.mjs +25 -0
  15. package/dist/collection.d.mts +15 -0
  16. package/dist/collection.mjs +33 -0
  17. package/dist/compiled-function.d.mts +27 -0
  18. package/dist/compiled-function.mjs +54 -0
  19. package/dist/definition.d.mts +37 -0
  20. package/dist/definition.mjs +83 -0
  21. package/dist/engine/child-workflow.d.mts +10 -0
  22. package/dist/engine/child-workflow.mjs +333 -0
  23. package/dist/engine/command-identity.d.mts +9 -0
  24. package/dist/engine/command-identity.mjs +14 -0
  25. package/dist/engine/create.d.mts +106 -0
  26. package/dist/engine/create.mjs +402 -0
  27. package/dist/engine/deterministic.d.mts +12 -0
  28. package/dist/engine/deterministic.mjs +102 -0
  29. package/dist/engine/durable-command.d.mts +10 -0
  30. package/dist/engine/durable-command.mjs +17 -0
  31. package/dist/engine/execution-api.d.mts +29 -0
  32. package/dist/engine/execution-api.mjs +33 -0
  33. package/dist/engine/execution-service.d.mts +41 -0
  34. package/dist/engine/execution-service.mjs +288 -0
  35. package/dist/engine/hooks.d.mts +56 -0
  36. package/dist/engine/hooks.mjs +237 -0
  37. package/dist/engine/inspection-api.d.mts +34 -0
  38. package/dist/engine/inspection-api.mjs +77 -0
  39. package/dist/engine/inspection.d.mts +18 -0
  40. package/dist/engine/inspection.mjs +149 -0
  41. package/dist/engine/lifecycle.d.mts +18 -0
  42. package/dist/engine/lifecycle.mjs +38 -0
  43. package/dist/engine/lock-replay.d.mts +30 -0
  44. package/dist/engine/lock-replay.mjs +38 -0
  45. package/dist/engine/lock.d.mts +21 -0
  46. package/dist/engine/lock.mjs +197 -0
  47. package/dist/engine/message.d.mts +47 -0
  48. package/dist/engine/message.mjs +357 -0
  49. package/dist/engine/mod.d.mts +4 -0
  50. package/dist/engine/mod.mjs +2 -0
  51. package/dist/engine/observation.d.mts +35 -0
  52. package/dist/engine/observation.mjs +201 -0
  53. package/dist/engine/recovery.d.mts +26 -0
  54. package/dist/engine/recovery.mjs +92 -0
  55. package/dist/engine/replay.d.mts +41 -0
  56. package/dist/engine/replay.mjs +122 -0
  57. package/dist/engine/retry-policy.d.mts +4 -0
  58. package/dist/engine/retry-policy.mjs +4 -0
  59. package/dist/engine/retry.d.mts +23 -0
  60. package/dist/engine/retry.mjs +75 -0
  61. package/dist/engine/run-data.d.mts +9 -0
  62. package/dist/engine/run-data.mjs +74 -0
  63. package/dist/engine/run-service.d.mts +38 -0
  64. package/dist/engine/run-service.mjs +133 -0
  65. package/dist/engine/run-utils.d.mts +16 -0
  66. package/dist/engine/run-utils.mjs +83 -0
  67. package/dist/engine/schedule.d.mts +25 -0
  68. package/dist/engine/schedule.mjs +207 -0
  69. package/dist/engine/serialization.d.mts +9 -0
  70. package/dist/engine/serialization.mjs +85 -0
  71. package/dist/engine/start-api.d.mts +30 -0
  72. package/dist/engine/start-api.mjs +98 -0
  73. package/dist/engine/state.d.mts +77 -0
  74. package/dist/engine/state.mjs +464 -0
  75. package/dist/engine/step-api.d.mts +9 -0
  76. package/dist/engine/step-api.mjs +25 -0
  77. package/dist/engine/stream.d.mts +55 -0
  78. package/dist/engine/stream.mjs +333 -0
  79. package/dist/engine/summary/active-events.d.mts +34 -0
  80. package/dist/engine/summary/active-events.mjs +69 -0
  81. package/dist/engine/summary/child-workflow-runs.d.mts +24 -0
  82. package/dist/engine/summary/child-workflow-runs.mjs +138 -0
  83. package/dist/engine/summary/child-workflow-waits.d.mts +21 -0
  84. package/dist/engine/summary/child-workflow-waits.mjs +67 -0
  85. package/dist/engine/summary/recovery-child-workflow-waits.d.mts +11 -0
  86. package/dist/engine/summary/recovery-child-workflow-waits.mjs +89 -0
  87. package/dist/engine/summary/recovery-due-runs.d.mts +16 -0
  88. package/dist/engine/summary/recovery-due-runs.mjs +52 -0
  89. package/dist/engine/summary/recovery-failed-runs.d.mts +14 -0
  90. package/dist/engine/summary/recovery-failed-runs.mjs +33 -0
  91. package/dist/engine/summary/recovery-lease-runs.d.mts +16 -0
  92. package/dist/engine/summary/recovery-lease-runs.mjs +69 -0
  93. package/dist/engine/summary/recovery-locks.d.mts +18 -0
  94. package/dist/engine/summary/recovery-locks.mjs +100 -0
  95. package/dist/engine/summary/recovery-message-waits.d.mts +11 -0
  96. package/dist/engine/summary/recovery-message-waits.mjs +74 -0
  97. package/dist/engine/summary/recovery-retry-runs.d.mts +17 -0
  98. package/dist/engine/summary/recovery-retry-runs.mjs +65 -0
  99. package/dist/engine/summary/recovery-run-timestamps.d.mts +13 -0
  100. package/dist/engine/summary/recovery-run-timestamps.mjs +18 -0
  101. package/dist/engine/summary/recovery-runs.d.mts +23 -0
  102. package/dist/engine/summary/recovery-runs.mjs +54 -0
  103. package/dist/engine/summary/recovery-schedules.d.mts +10 -0
  104. package/dist/engine/summary/recovery-schedules.mjs +46 -0
  105. package/dist/engine/summary/recovery-sleep-waits.d.mts +10 -0
  106. package/dist/engine/summary/recovery-sleep-waits.mjs +53 -0
  107. package/dist/engine/summary/recovery-waits.d.mts +21 -0
  108. package/dist/engine/summary/recovery-waits.mjs +29 -0
  109. package/dist/engine/summary/run-availability.d.mts +13 -0
  110. package/dist/engine/summary/run-availability.mjs +37 -0
  111. package/dist/engine/summary/run-cleanup.d.mts +14 -0
  112. package/dist/engine/summary/run-cleanup.mjs +44 -0
  113. package/dist/engine/summary/run-failure.d.mts +14 -0
  114. package/dist/engine/summary/run-failure.mjs +62 -0
  115. package/dist/engine/summary/run-hooks.d.mts +14 -0
  116. package/dist/engine/summary/run-hooks.mjs +63 -0
  117. package/dist/engine/summary/run-lease.d.mts +11 -0
  118. package/dist/engine/summary/run-lease.mjs +64 -0
  119. package/dist/engine/summary/run-message-waits.d.mts +15 -0
  120. package/dist/engine/summary/run-message-waits.mjs +62 -0
  121. package/dist/engine/summary/run-metrics.d.mts +31 -0
  122. package/dist/engine/summary/run-metrics.mjs +93 -0
  123. package/dist/engine/summary/run-retry.d.mts +9 -0
  124. package/dist/engine/summary/run-retry.mjs +69 -0
  125. package/dist/engine/summary/run-sleeps.d.mts +15 -0
  126. package/dist/engine/summary/run-sleeps.mjs +61 -0
  127. package/dist/engine/summary/run-state.d.mts +26 -0
  128. package/dist/engine/summary/run-state.mjs +48 -0
  129. package/dist/engine/summary/run-status.d.mts +16 -0
  130. package/dist/engine/summary/run-status.mjs +35 -0
  131. package/dist/engine/summary/run-streams.d.mts +14 -0
  132. package/dist/engine/summary/run-streams.mjs +46 -0
  133. package/dist/engine/summary/run-transition.d.mts +9 -0
  134. package/dist/engine/summary/run-transition.mjs +39 -0
  135. package/dist/engine/summary/run-workflow.d.mts +9 -0
  136. package/dist/engine/summary/run-workflow.mjs +47 -0
  137. package/dist/engine/summary/step-attempt-active-child-workflows.d.mts +13 -0
  138. package/dist/engine/summary/step-attempt-active-child-workflows.mjs +55 -0
  139. package/dist/engine/summary/step-attempt-active-fields.d.mts +23 -0
  140. package/dist/engine/summary/step-attempt-active-fields.mjs +14 -0
  141. package/dist/engine/summary/step-attempt-active-message-waits.d.mts +12 -0
  142. package/dist/engine/summary/step-attempt-active-message-waits.mjs +47 -0
  143. package/dist/engine/summary/step-attempt-active-sleeps.d.mts +19 -0
  144. package/dist/engine/summary/step-attempt-active-sleeps.mjs +44 -0
  145. package/dist/engine/summary/step-attempt-buckets.d.mts +22 -0
  146. package/dist/engine/summary/step-attempt-buckets.mjs +152 -0
  147. package/dist/engine/summary/step-attempt-failure.d.mts +12 -0
  148. package/dist/engine/summary/step-attempt-failure.mjs +61 -0
  149. package/dist/engine/summary/step-attempt-lifecycle.d.mts +13 -0
  150. package/dist/engine/summary/step-attempt-lifecycle.mjs +19 -0
  151. package/dist/engine/summary/step-attempts.d.mts +11 -0
  152. package/dist/engine/summary/step-attempts.mjs +43 -0
  153. package/dist/engine/summary.d.mts +32 -0
  154. package/dist/engine/summary.mjs +37 -0
  155. package/dist/engine/task.d.mts +6 -0
  156. package/dist/engine/task.mjs +207 -0
  157. package/dist/errors/base.d.mts +99 -0
  158. package/dist/errors/base.mjs +426 -0
  159. package/dist/errors/capability.d.mts +11 -0
  160. package/dist/errors/capability.mjs +23 -0
  161. package/dist/errors/definition.d.mts +21 -0
  162. package/dist/errors/definition.mjs +51 -0
  163. package/dist/errors/details.d.mts +13 -0
  164. package/dist/errors/details.mjs +65 -0
  165. package/dist/errors/failures.d.mts +81 -0
  166. package/dist/errors/failures.mjs +168 -0
  167. package/dist/errors/hook.d.mts +14 -0
  168. package/dist/errors/hook.mjs +30 -0
  169. package/dist/errors/implementation.d.mts +11 -0
  170. package/dist/errors/implementation.mjs +25 -0
  171. package/dist/errors/lock.d.mts +28 -0
  172. package/dist/errors/lock.mjs +70 -0
  173. package/dist/errors/message.d.mts +106 -0
  174. package/dist/errors/message.mjs +122 -0
  175. package/dist/errors/mod.d.mts +17 -0
  176. package/dist/errors/mod.mjs +17 -0
  177. package/dist/errors/record-view.d.mts +11 -0
  178. package/dist/errors/record-view.mjs +24 -0
  179. package/dist/errors/records.d.mts +7 -0
  180. package/dist/errors/records.mjs +280 -0
  181. package/dist/errors/run.d.mts +116 -0
  182. package/dist/errors/run.mjs +232 -0
  183. package/dist/errors/runtime.d.mts +12 -0
  184. package/dist/errors/runtime.mjs +24 -0
  185. package/dist/errors/schedule.d.mts +27 -0
  186. package/dist/errors/schedule.mjs +65 -0
  187. package/dist/errors/step.d.mts +76 -0
  188. package/dist/errors/step.mjs +113 -0
  189. package/dist/errors/stream.d.mts +24 -0
  190. package/dist/errors/stream.mjs +64 -0
  191. package/dist/esbuild.d.mts +7 -0
  192. package/dist/esbuild.mjs +6 -0
  193. package/dist/events/descriptors.d.mts +245 -0
  194. package/dist/events/descriptors.mjs +405 -0
  195. package/dist/events/mod.d.mts +3 -0
  196. package/dist/events/mod.mjs +2 -0
  197. package/dist/history/attempt-key.d.mts +6 -0
  198. package/dist/history/attempt-key.mjs +7 -0
  199. package/dist/history/mod.d.mts +71 -0
  200. package/dist/history/mod.mjs +195 -0
  201. package/dist/history/projection.d.mts +8 -0
  202. package/dist/history/projection.mjs +259 -0
  203. package/dist/history/replay-projection.d.mts +88 -0
  204. package/dist/history/replay-projection.mjs +369 -0
  205. package/dist/history/sequencer.d.mts +16 -0
  206. package/dist/history/sequencer.mjs +78 -0
  207. package/dist/history/step-attempts.d.mts +9 -0
  208. package/dist/history/step-attempts.mjs +50 -0
  209. package/dist/history/timeline.d.mts +16 -0
  210. package/dist/history/timeline.mjs +272 -0
  211. package/dist/history/validator.d.mts +9 -0
  212. package/dist/history/validator.mjs +110 -0
  213. package/dist/inspection/mod.d.mts +5 -0
  214. package/dist/inspection/mod.mjs +3 -0
  215. package/dist/message-options.d.mts +8 -0
  216. package/dist/message-options.mjs +25 -0
  217. package/dist/mod.d.mts +52 -0
  218. package/dist/mod.mjs +26 -0
  219. package/dist/otel/support.d.mts +18 -0
  220. package/dist/otel/support.mjs +102 -0
  221. package/dist/otel.d.mts +30 -0
  222. package/dist/otel.mjs +588 -0
  223. package/dist/pagination.d.mts +25 -0
  224. package/dist/pagination.mjs +73 -0
  225. package/dist/registry.d.mts +20 -0
  226. package/dist/registry.mjs +48 -0
  227. package/dist/rolldown.d.mts +7 -0
  228. package/dist/rolldown.mjs +6 -0
  229. package/dist/rollup.d.mts +7 -0
  230. package/dist/rollup.mjs +6 -0
  231. package/dist/rspack.d.mts +7 -0
  232. package/dist/rspack.mjs +6 -0
  233. package/dist/runtime.d.mts +34 -0
  234. package/dist/runtime.mjs +194 -0
  235. package/dist/step-definition.d.mts +10 -0
  236. package/dist/step-definition.mjs +15 -0
  237. package/dist/store/append-projection.d.mts +15 -0
  238. package/dist/store/append-projection.mjs +26 -0
  239. package/dist/store/capabilities.d.mts +14 -0
  240. package/dist/store/capabilities.mjs +42 -0
  241. package/dist/store/cleanup.d.mts +18 -0
  242. package/dist/store/cleanup.mjs +338 -0
  243. package/dist/store/compaction.d.mts +5 -0
  244. package/dist/store/compaction.mjs +8 -0
  245. package/dist/store/create.d.mts +52 -0
  246. package/dist/store/create.mjs +159 -0
  247. package/dist/store/event-append-project.d.mts +15 -0
  248. package/dist/store/event-append-project.mjs +77 -0
  249. package/dist/store/event-append.d.mts +37 -0
  250. package/dist/store/event-append.mjs +80 -0
  251. package/dist/store/event-history.d.mts +22 -0
  252. package/dist/store/event-history.mjs +75 -0
  253. package/dist/store/event.d.mts +10 -0
  254. package/dist/store/event.mjs +28 -0
  255. package/dist/store/idempotency.d.mts +10 -0
  256. package/dist/store/idempotency.mjs +167 -0
  257. package/dist/store/instrumentation.d.mts +7 -0
  258. package/dist/store/instrumentation.mjs +123 -0
  259. package/dist/store/lock.d.mts +8 -0
  260. package/dist/store/lock.mjs +28 -0
  261. package/dist/store/materialization.d.mts +30 -0
  262. package/dist/store/materialization.mjs +127 -0
  263. package/dist/store/message-index.d.mts +21 -0
  264. package/dist/store/message-index.mjs +121 -0
  265. package/dist/store/mod.d.mts +5 -0
  266. package/dist/store/mod.mjs +4 -0
  267. package/dist/store/query.d.mts +24 -0
  268. package/dist/store/query.mjs +82 -0
  269. package/dist/store/revision.d.mts +4 -0
  270. package/dist/store/revision.mjs +7 -0
  271. package/dist/store/run.d.mts +49 -0
  272. package/dist/store/run.mjs +236 -0
  273. package/dist/store/schedule.d.mts +12 -0
  274. package/dist/store/schedule.mjs +41 -0
  275. package/dist/store/schema.d.mts +14 -0
  276. package/dist/store/schema.mjs +17 -0
  277. package/dist/store/step-attempt.d.mts +14 -0
  278. package/dist/store/step-attempt.mjs +23 -0
  279. package/dist/store/storage-value.d.mts +5 -0
  280. package/dist/store/storage-value.mjs +6 -0
  281. package/dist/store/validation.d.mts +35 -0
  282. package/dist/store/validation.mjs +77 -0
  283. package/dist/store-keys.d.mts +49 -0
  284. package/dist/store-keys.mjs +63 -0
  285. package/dist/telemetry.d.mts +132 -0
  286. package/dist/telemetry.mjs +172 -0
  287. package/dist/temporal.d.mts +23 -0
  288. package/dist/temporal.mjs +59 -0
  289. package/dist/timer.d.mts +12 -0
  290. package/dist/timer.mjs +28 -0
  291. package/dist/types/cleanup.d.mts +112 -0
  292. package/dist/types/cleanup.mjs +22 -0
  293. package/dist/types/client.d.mts +270 -0
  294. package/dist/types/client.mjs +1 -0
  295. package/dist/types/common.d.mts +19 -0
  296. package/dist/types/common.mjs +15 -0
  297. package/dist/types/definition.d.mts +92 -0
  298. package/dist/types/definition.mjs +1 -0
  299. package/dist/types/engine-options.d.mts +76 -0
  300. package/dist/types/engine-options.mjs +1 -0
  301. package/dist/types/engine.d.mts +309 -0
  302. package/dist/types/engine.mjs +1 -0
  303. package/dist/types/error-code.d.mts +256 -0
  304. package/dist/types/error-code.mjs +131 -0
  305. package/dist/types/error.d.mts +236 -0
  306. package/dist/types/error.mjs +48 -0
  307. package/dist/types/events.d.mts +2869 -0
  308. package/dist/types/events.mjs +283 -0
  309. package/dist/types/hook.d.mts +149 -0
  310. package/dist/types/hook.mjs +66 -0
  311. package/dist/types/lock.d.mts +63 -0
  312. package/dist/types/lock.mjs +18 -0
  313. package/dist/types/message-id.d.mts +7 -0
  314. package/dist/types/message-id.mjs +5 -0
  315. package/dist/types/message.d.mts +87 -0
  316. package/dist/types/message.mjs +1 -0
  317. package/dist/types/observation.d.mts +146 -0
  318. package/dist/types/observation.mjs +1 -0
  319. package/dist/types/pagination.d.mts +32 -0
  320. package/dist/types/pagination.mjs +13 -0
  321. package/dist/types/result.d.mts +62 -0
  322. package/dist/types/result.mjs +1 -0
  323. package/dist/types/retry.d.mts +48 -0
  324. package/dist/types/retry.mjs +1 -0
  325. package/dist/types/run-id.d.mts +7 -0
  326. package/dist/types/run-id.mjs +5 -0
  327. package/dist/types/run-list.d.mts +43 -0
  328. package/dist/types/run-list.mjs +1 -0
  329. package/dist/types/run-options.d.mts +86 -0
  330. package/dist/types/run-options.mjs +1 -0
  331. package/dist/types/run.d.mts +355 -0
  332. package/dist/types/run.mjs +207 -0
  333. package/dist/types/runtime.d.mts +143 -0
  334. package/dist/types/runtime.mjs +21 -0
  335. package/dist/types/schedule.d.mts +127 -0
  336. package/dist/types/schedule.mjs +48 -0
  337. package/dist/types/step-attempts.d.mts +326 -0
  338. package/dist/types/step-attempts.mjs +43 -0
  339. package/dist/types/step-id.d.mts +7 -0
  340. package/dist/types/step-id.mjs +5 -0
  341. package/dist/types/step.d.mts +183 -0
  342. package/dist/types/step.mjs +5 -0
  343. package/dist/types/store.d.mts +254 -0
  344. package/dist/types/store.mjs +1 -0
  345. package/dist/types/stream-id.d.mts +7 -0
  346. package/dist/types/stream-id.mjs +5 -0
  347. package/dist/types/stream.d.mts +126 -0
  348. package/dist/types/stream.mjs +1 -0
  349. package/dist/types/summary.d.mts +318 -0
  350. package/dist/types/summary.mjs +1 -0
  351. package/dist/types/telemetry.d.mts +74 -0
  352. package/dist/types/telemetry.mjs +9 -0
  353. package/dist/types/timeline.d.mts +237 -0
  354. package/dist/types/timeline.mjs +1 -0
  355. package/dist/types/vite.d.mts +65 -0
  356. package/dist/types/vite.mjs +1 -0
  357. package/dist/types/worker-id.d.mts +7 -0
  358. package/dist/types/worker-id.mjs +5 -0
  359. package/dist/types/worker.d.mts +94 -0
  360. package/dist/types/worker.mjs +1 -0
  361. package/dist/utility.d.mts +49 -0
  362. package/dist/utility.mjs +122 -0
  363. package/dist/vite/ast.d.mts +23 -0
  364. package/dist/vite/ast.mjs +73 -0
  365. package/dist/vite/error.d.mts +19 -0
  366. package/dist/vite/error.mjs +47 -0
  367. package/dist/vite/generated-name.d.mts +7 -0
  368. package/dist/vite/generated-name.mjs +9 -0
  369. package/dist/vite/manifest.d.mts +7 -0
  370. package/dist/vite/manifest.mjs +106 -0
  371. package/dist/vite/plugin.d.mts +7 -0
  372. package/dist/vite/plugin.mjs +190 -0
  373. package/dist/vite/safety.d.mts +12 -0
  374. package/dist/vite/safety.mjs +96 -0
  375. package/dist/vite/source-edit.d.mts +12 -0
  376. package/dist/vite/source-edit.mjs +44 -0
  377. package/dist/vite/source-map.d.mts +11 -0
  378. package/dist/vite/source-map.mjs +53 -0
  379. package/dist/vite/source.d.mts +7 -0
  380. package/dist/vite/source.mjs +14 -0
  381. package/dist/vite/transform.d.mts +7 -0
  382. package/dist/vite/transform.mjs +405 -0
  383. package/dist/vite.d.mts +6 -0
  384. package/dist/vite.mjs +5 -0
  385. package/dist/webhook.d.mts +16 -0
  386. package/dist/webhook.mjs +17 -0
  387. package/dist/webpack.d.mts +7 -0
  388. package/dist/webpack.mjs +6 -0
  389. package/dist/worker/error.d.mts +11 -0
  390. package/dist/worker/error.mjs +40 -0
  391. package/dist/worker.d.mts +18 -0
  392. package/dist/worker.mjs +427 -0
  393. package/package.json +144 -0
@@ -0,0 +1,2869 @@
1
+ import { MessageId } from "./message-id.mjs";
2
+ import { RunId } from "./run-id.mjs";
3
+ import { StepId } from "./step-id.mjs";
4
+ import { StreamId } from "./stream-id.mjs";
5
+ import { WorkflowChildWorkflowCancellationPolicy } from "./step.mjs";
6
+ import { TelemetryContext } from "./telemetry.mjs";
7
+ import { WorkflowAttributeValue, WorkflowStepType } from "./run.mjs";
8
+ import { WorkflowErrorRecord } from "./error.mjs";
9
+ import { StorageValue } from "@temelj/storage";
10
+ import { z } from "zod";
11
+ //#region src/types/events.d.ts
12
+ declare const workflowMessageWaitSourceSchema: z.ZodEnum<{
13
+ hook: "hook";
14
+ webhook: "webhook";
15
+ }>;
16
+ declare const workflowRunEventKindSchema: z.ZodEnum<{
17
+ workflow_completed: "workflow_completed";
18
+ workflow_failed: "workflow_failed";
19
+ workflow_started: "workflow_started";
20
+ }>;
21
+ declare const workflowStepEventKindSchema: z.ZodEnum<{
22
+ step_completed: "step_completed";
23
+ step_failed: "step_failed";
24
+ step_started: "step_started";
25
+ }>;
26
+ declare const workflowSleepEventKindSchema: z.ZodEnum<{
27
+ sleep_completed: "sleep_completed";
28
+ sleep_started: "sleep_started";
29
+ }>;
30
+ declare const workflowChildWorkflowEventKindSchema: z.ZodEnum<{
31
+ child_workflow_completed: "child_workflow_completed";
32
+ child_workflow_failed: "child_workflow_failed";
33
+ child_workflow_started: "child_workflow_started";
34
+ }>;
35
+ declare const workflowMessageEventKindSchema: z.ZodEnum<{
36
+ message_send_completed: "message_send_completed";
37
+ message_send_failed: "message_send_failed";
38
+ message_send_started: "message_send_started";
39
+ message_sent: "message_sent";
40
+ message_wait_completed: "message_wait_completed";
41
+ message_wait_failed: "message_wait_failed";
42
+ message_wait_started: "message_wait_started";
43
+ }>;
44
+ declare const workflowStreamEventKindSchema: z.ZodEnum<{
45
+ stream_chunk: "stream_chunk";
46
+ stream_closed: "stream_closed";
47
+ stream_failed: "stream_failed";
48
+ stream_started: "stream_started";
49
+ }>;
50
+ declare const workflowDataEventKindSchema: z.ZodEnum<{
51
+ attributes_set: "attributes_set";
52
+ metadata_set: "metadata_set";
53
+ }>;
54
+ declare const workflowDeterministicEventKindSchema: z.ZodLiteral<"deterministic_value_recorded">;
55
+ declare const workflowEventKindSchema: z.ZodUnion<readonly [z.ZodEnum<{
56
+ workflow_completed: "workflow_completed";
57
+ workflow_failed: "workflow_failed";
58
+ workflow_started: "workflow_started";
59
+ }>, z.ZodEnum<{
60
+ step_completed: "step_completed";
61
+ step_failed: "step_failed";
62
+ step_started: "step_started";
63
+ }>, z.ZodEnum<{
64
+ sleep_completed: "sleep_completed";
65
+ sleep_started: "sleep_started";
66
+ }>, z.ZodEnum<{
67
+ child_workflow_completed: "child_workflow_completed";
68
+ child_workflow_failed: "child_workflow_failed";
69
+ child_workflow_started: "child_workflow_started";
70
+ }>, z.ZodEnum<{
71
+ message_send_completed: "message_send_completed";
72
+ message_send_failed: "message_send_failed";
73
+ message_send_started: "message_send_started";
74
+ message_sent: "message_sent";
75
+ message_wait_completed: "message_wait_completed";
76
+ message_wait_failed: "message_wait_failed";
77
+ message_wait_started: "message_wait_started";
78
+ }>, z.ZodEnum<{
79
+ stream_chunk: "stream_chunk";
80
+ stream_closed: "stream_closed";
81
+ stream_failed: "stream_failed";
82
+ stream_started: "stream_started";
83
+ }>, z.ZodEnum<{
84
+ attributes_set: "attributes_set";
85
+ metadata_set: "metadata_set";
86
+ }>, z.ZodLiteral<"deterministic_value_recorded">]>;
87
+ declare const workflowMessageWaiterStepIdsSchema: z.ZodReadonly<z.ZodArray<z.ZodString>>;
88
+ declare const workflowStartedEventSchema: z.ZodObject<{
89
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
90
+ kind: z.ZodLiteral<"workflow_started">;
91
+ }, z.core.$strip>;
92
+ declare const workflowCompletedEventSchema: z.ZodObject<{
93
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
94
+ kind: z.ZodLiteral<"workflow_completed">;
95
+ }, z.core.$strip>;
96
+ declare const workflowFailedEventSchema: z.ZodObject<{
97
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
98
+ kind: z.ZodLiteral<"workflow_failed">;
99
+ }, z.core.$strip>;
100
+ declare const workflowStepStartedEventSchema: z.ZodObject<{
101
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
102
+ stepId: z.ZodString;
103
+ stepName: z.ZodString;
104
+ count: z.ZodNumber;
105
+ attempt: z.ZodNumber;
106
+ kind: z.ZodLiteral<"step_started">;
107
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
108
+ }, z.core.$strip>;
109
+ declare const workflowStepCompletedEventSchema: z.ZodObject<{
110
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
111
+ stepId: z.ZodString;
112
+ stepName: z.ZodString;
113
+ attempt: z.ZodNumber;
114
+ kind: z.ZodLiteral<"step_completed">;
115
+ result: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
116
+ }, z.core.$strip>;
117
+ declare const workflowStepFailedEventSchema: z.ZodObject<{
118
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
119
+ stepId: z.ZodString;
120
+ stepName: z.ZodString;
121
+ attempt: z.ZodNumber;
122
+ kind: z.ZodLiteral<"step_failed">;
123
+ error: z.ZodObject<{
124
+ code: z.ZodOptional<z.ZodEnum<{
125
+ readonly ERROR: "workflow.error";
126
+ readonly DEFINITION_INVALID: "definition.invalid";
127
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
128
+ readonly OPTIONS_INVALID: "options.invalid";
129
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
130
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
131
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
132
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
133
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
134
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
135
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
136
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
137
+ readonly OPTIONS_REQUIRED: "options.required";
138
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
139
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
140
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
141
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
142
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
143
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
144
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
145
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
146
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
147
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
148
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
149
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
150
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
151
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
152
+ readonly STATE_INVALID: "state.invalid";
153
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
154
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
155
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
156
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
157
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
158
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
159
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
160
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
161
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
162
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
163
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
164
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
165
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
166
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
167
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
168
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
169
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
170
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
171
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
172
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
173
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
174
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
175
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
176
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
177
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
178
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
179
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
180
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
181
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
182
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
183
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
184
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
185
+ readonly RUNTIME_INVALID: "runtime.invalid";
186
+ readonly RUN_ERROR: "run.error";
187
+ readonly STEP_ERROR: "step.error";
188
+ readonly MESSAGE_ERROR: "message.error";
189
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
190
+ readonly DURATION_INVALID: "duration.invalid";
191
+ readonly SERIALIZATION_FAILED: "serialization.failed";
192
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
193
+ readonly PERMANENT_FAILURE: "failure.permanent";
194
+ readonly RETRYABLE_FAILURE: "failure.retryable";
195
+ readonly REPLAY_DIVERGED: "replay.diverged";
196
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
197
+ readonly RUN_NOT_FOUND: "run.not_found";
198
+ readonly RUN_INVALID: "run.invalid";
199
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
200
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
201
+ readonly RUN_CANCELED: "run.canceled";
202
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
203
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
204
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
205
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
206
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
207
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
208
+ readonly HOOK_DISPOSED: "hook.disposed";
209
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
210
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
211
+ readonly STEP_TIMEOUT: "step.timeout";
212
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
213
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
214
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
215
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
216
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
217
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
218
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
219
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
220
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
221
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
222
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
223
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
224
+ readonly STREAM_NOT_FOUND: "stream.not_found";
225
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
226
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
227
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
228
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
229
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
230
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
231
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
232
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
233
+ readonly LOCK_NOT_STALE: "lock.not_stale";
234
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
235
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
236
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
237
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
238
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
239
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
240
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
241
+ readonly LOCK_NOT_FOUND: "lock.not_found";
242
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
243
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
244
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
245
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
246
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
247
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
248
+ }>>;
249
+ name: z.ZodString;
250
+ message: z.ZodString;
251
+ stack: z.ZodOptional<z.ZodString>;
252
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
253
+ }, z.core.$loose>;
254
+ }, z.core.$strip>;
255
+ declare const workflowSleepStartedEventSchema: z.ZodObject<{
256
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
257
+ stepId: z.ZodString;
258
+ stepName: z.ZodString;
259
+ count: z.ZodNumber;
260
+ kind: z.ZodLiteral<"sleep_started">;
261
+ until: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
262
+ duration: z.ZodOptional<z.ZodCustom<Temporal.Duration, Temporal.Duration>>;
263
+ }, z.core.$strip>;
264
+ declare const workflowSleepCompletedEventSchema: z.ZodObject<{
265
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
266
+ stepId: z.ZodString;
267
+ stepName: z.ZodString;
268
+ kind: z.ZodLiteral<"sleep_completed">;
269
+ }, z.core.$strip>;
270
+ declare const workflowChildWorkflowStartedEventSchema: z.ZodObject<{
271
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
272
+ stepId: z.ZodString;
273
+ stepName: z.ZodString;
274
+ count: z.ZodNumber;
275
+ attempt: z.ZodNumber;
276
+ kind: z.ZodLiteral<"child_workflow_started">;
277
+ childRunId: z.ZodString;
278
+ workflowName: z.ZodString;
279
+ workflowVersion: z.ZodOptional<z.ZodString>;
280
+ cancellation: z.ZodOptional<z.ZodEnum<{
281
+ cascade: "cascade";
282
+ detach: "detach";
283
+ }>>;
284
+ input: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
285
+ idempotencyKey: z.ZodOptional<z.ZodString>;
286
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
287
+ }, z.core.$strip>;
288
+ declare const workflowChildWorkflowCompletedEventSchema: z.ZodObject<{
289
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
290
+ stepId: z.ZodString;
291
+ stepName: z.ZodString;
292
+ attempt: z.ZodNumber;
293
+ kind: z.ZodLiteral<"child_workflow_completed">;
294
+ childRunId: z.ZodString;
295
+ result: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
296
+ }, z.core.$strip>;
297
+ declare const workflowChildWorkflowFailedEventSchema: z.ZodObject<{
298
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
299
+ stepId: z.ZodString;
300
+ stepName: z.ZodString;
301
+ attempt: z.ZodNumber;
302
+ kind: z.ZodLiteral<"child_workflow_failed">;
303
+ childRunId: z.ZodString;
304
+ error: z.ZodObject<{
305
+ code: z.ZodOptional<z.ZodEnum<{
306
+ readonly ERROR: "workflow.error";
307
+ readonly DEFINITION_INVALID: "definition.invalid";
308
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
309
+ readonly OPTIONS_INVALID: "options.invalid";
310
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
311
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
312
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
313
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
314
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
315
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
316
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
317
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
318
+ readonly OPTIONS_REQUIRED: "options.required";
319
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
320
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
321
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
322
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
323
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
324
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
325
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
326
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
327
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
328
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
329
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
330
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
331
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
332
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
333
+ readonly STATE_INVALID: "state.invalid";
334
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
335
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
336
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
337
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
338
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
339
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
340
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
341
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
342
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
343
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
344
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
345
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
346
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
347
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
348
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
349
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
350
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
351
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
352
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
353
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
354
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
355
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
356
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
357
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
358
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
359
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
360
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
361
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
362
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
363
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
364
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
365
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
366
+ readonly RUNTIME_INVALID: "runtime.invalid";
367
+ readonly RUN_ERROR: "run.error";
368
+ readonly STEP_ERROR: "step.error";
369
+ readonly MESSAGE_ERROR: "message.error";
370
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
371
+ readonly DURATION_INVALID: "duration.invalid";
372
+ readonly SERIALIZATION_FAILED: "serialization.failed";
373
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
374
+ readonly PERMANENT_FAILURE: "failure.permanent";
375
+ readonly RETRYABLE_FAILURE: "failure.retryable";
376
+ readonly REPLAY_DIVERGED: "replay.diverged";
377
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
378
+ readonly RUN_NOT_FOUND: "run.not_found";
379
+ readonly RUN_INVALID: "run.invalid";
380
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
381
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
382
+ readonly RUN_CANCELED: "run.canceled";
383
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
384
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
385
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
386
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
387
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
388
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
389
+ readonly HOOK_DISPOSED: "hook.disposed";
390
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
391
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
392
+ readonly STEP_TIMEOUT: "step.timeout";
393
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
394
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
395
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
396
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
397
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
398
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
399
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
400
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
401
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
402
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
403
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
404
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
405
+ readonly STREAM_NOT_FOUND: "stream.not_found";
406
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
407
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
408
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
409
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
410
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
411
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
412
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
413
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
414
+ readonly LOCK_NOT_STALE: "lock.not_stale";
415
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
416
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
417
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
418
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
419
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
420
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
421
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
422
+ readonly LOCK_NOT_FOUND: "lock.not_found";
423
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
424
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
425
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
426
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
427
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
428
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
429
+ }>>;
430
+ name: z.ZodString;
431
+ message: z.ZodString;
432
+ stack: z.ZodOptional<z.ZodString>;
433
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
434
+ }, z.core.$loose>;
435
+ }, z.core.$strip>;
436
+ declare const workflowMessageSentEventSchema: z.ZodObject<{
437
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
438
+ kind: z.ZodLiteral<"message_sent">;
439
+ messageId: z.ZodString;
440
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
441
+ waiterStepIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
442
+ idempotencyKey: z.ZodOptional<z.ZodString>;
443
+ telemetryContext: z.ZodOptional<z.ZodObject<{
444
+ traceparent: z.ZodOptional<z.ZodString>;
445
+ tracestate: z.ZodOptional<z.ZodString>;
446
+ }, z.core.$strip>>;
447
+ }, z.core.$strip>;
448
+ declare const workflowMessageSendStartedEventSchema: z.ZodObject<{
449
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
450
+ stepId: z.ZodString;
451
+ stepName: z.ZodString;
452
+ count: z.ZodNumber;
453
+ kind: z.ZodLiteral<"message_send_started">;
454
+ targetRunId: z.ZodString;
455
+ messageId: z.ZodString;
456
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
457
+ idempotencyKey: z.ZodOptional<z.ZodString>;
458
+ }, z.core.$strip>;
459
+ declare const workflowMessageSendCompletedEventSchema: z.ZodObject<{
460
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
461
+ stepId: z.ZodString;
462
+ stepName: z.ZodString;
463
+ kind: z.ZodLiteral<"message_send_completed">;
464
+ targetRunId: z.ZodString;
465
+ messageId: z.ZodString;
466
+ }, z.core.$strip>;
467
+ declare const workflowMessageSendFailedEventSchema: z.ZodObject<{
468
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
469
+ stepId: z.ZodString;
470
+ stepName: z.ZodString;
471
+ kind: z.ZodLiteral<"message_send_failed">;
472
+ targetRunId: z.ZodString;
473
+ messageId: z.ZodString;
474
+ error: z.ZodObject<{
475
+ code: z.ZodOptional<z.ZodEnum<{
476
+ readonly ERROR: "workflow.error";
477
+ readonly DEFINITION_INVALID: "definition.invalid";
478
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
479
+ readonly OPTIONS_INVALID: "options.invalid";
480
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
481
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
482
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
483
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
484
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
485
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
486
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
487
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
488
+ readonly OPTIONS_REQUIRED: "options.required";
489
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
490
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
491
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
492
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
493
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
494
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
495
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
496
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
497
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
498
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
499
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
500
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
501
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
502
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
503
+ readonly STATE_INVALID: "state.invalid";
504
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
505
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
506
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
507
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
508
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
509
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
510
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
511
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
512
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
513
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
514
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
515
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
516
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
517
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
518
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
519
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
520
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
521
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
522
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
523
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
524
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
525
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
526
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
527
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
528
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
529
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
530
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
531
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
532
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
533
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
534
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
535
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
536
+ readonly RUNTIME_INVALID: "runtime.invalid";
537
+ readonly RUN_ERROR: "run.error";
538
+ readonly STEP_ERROR: "step.error";
539
+ readonly MESSAGE_ERROR: "message.error";
540
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
541
+ readonly DURATION_INVALID: "duration.invalid";
542
+ readonly SERIALIZATION_FAILED: "serialization.failed";
543
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
544
+ readonly PERMANENT_FAILURE: "failure.permanent";
545
+ readonly RETRYABLE_FAILURE: "failure.retryable";
546
+ readonly REPLAY_DIVERGED: "replay.diverged";
547
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
548
+ readonly RUN_NOT_FOUND: "run.not_found";
549
+ readonly RUN_INVALID: "run.invalid";
550
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
551
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
552
+ readonly RUN_CANCELED: "run.canceled";
553
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
554
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
555
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
556
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
557
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
558
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
559
+ readonly HOOK_DISPOSED: "hook.disposed";
560
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
561
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
562
+ readonly STEP_TIMEOUT: "step.timeout";
563
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
564
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
565
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
566
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
567
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
568
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
569
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
570
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
571
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
572
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
573
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
574
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
575
+ readonly STREAM_NOT_FOUND: "stream.not_found";
576
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
577
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
578
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
579
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
580
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
581
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
582
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
583
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
584
+ readonly LOCK_NOT_STALE: "lock.not_stale";
585
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
586
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
587
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
588
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
589
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
590
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
591
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
592
+ readonly LOCK_NOT_FOUND: "lock.not_found";
593
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
594
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
595
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
596
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
597
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
598
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
599
+ }>>;
600
+ name: z.ZodString;
601
+ message: z.ZodString;
602
+ stack: z.ZodOptional<z.ZodString>;
603
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
604
+ }, z.core.$loose>;
605
+ }, z.core.$strip>;
606
+ declare const workflowMessageWaitStartedEventSchema: z.ZodObject<{
607
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
608
+ stepId: z.ZodString;
609
+ stepName: z.ZodString;
610
+ count: z.ZodNumber;
611
+ kind: z.ZodLiteral<"message_wait_started">;
612
+ messageId: z.ZodString;
613
+ source: z.ZodOptional<z.ZodEnum<{
614
+ hook: "hook";
615
+ webhook: "webhook";
616
+ }>>;
617
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
618
+ }, z.core.$strip>;
619
+ declare const workflowMessageWaitCompletedEventSchema: z.ZodObject<{
620
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
621
+ stepId: z.ZodString;
622
+ stepName: z.ZodString;
623
+ kind: z.ZodLiteral<"message_wait_completed">;
624
+ messageId: z.ZodString;
625
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
626
+ messageTimestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
627
+ telemetryContext: z.ZodOptional<z.ZodObject<{
628
+ traceparent: z.ZodOptional<z.ZodString>;
629
+ tracestate: z.ZodOptional<z.ZodString>;
630
+ }, z.core.$strip>>;
631
+ }, z.core.$strip>;
632
+ declare const workflowMessageWaitFailedEventSchema: z.ZodObject<{
633
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
634
+ stepId: z.ZodString;
635
+ stepName: z.ZodString;
636
+ kind: z.ZodLiteral<"message_wait_failed">;
637
+ messageId: z.ZodString;
638
+ error: z.ZodObject<{
639
+ code: z.ZodOptional<z.ZodEnum<{
640
+ readonly ERROR: "workflow.error";
641
+ readonly DEFINITION_INVALID: "definition.invalid";
642
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
643
+ readonly OPTIONS_INVALID: "options.invalid";
644
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
645
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
646
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
647
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
648
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
649
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
650
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
651
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
652
+ readonly OPTIONS_REQUIRED: "options.required";
653
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
654
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
655
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
656
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
657
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
658
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
659
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
660
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
661
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
662
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
663
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
664
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
665
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
666
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
667
+ readonly STATE_INVALID: "state.invalid";
668
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
669
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
670
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
671
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
672
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
673
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
674
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
675
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
676
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
677
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
678
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
679
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
680
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
681
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
682
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
683
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
684
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
685
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
686
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
687
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
688
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
689
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
690
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
691
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
692
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
693
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
694
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
695
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
696
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
697
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
698
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
699
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
700
+ readonly RUNTIME_INVALID: "runtime.invalid";
701
+ readonly RUN_ERROR: "run.error";
702
+ readonly STEP_ERROR: "step.error";
703
+ readonly MESSAGE_ERROR: "message.error";
704
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
705
+ readonly DURATION_INVALID: "duration.invalid";
706
+ readonly SERIALIZATION_FAILED: "serialization.failed";
707
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
708
+ readonly PERMANENT_FAILURE: "failure.permanent";
709
+ readonly RETRYABLE_FAILURE: "failure.retryable";
710
+ readonly REPLAY_DIVERGED: "replay.diverged";
711
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
712
+ readonly RUN_NOT_FOUND: "run.not_found";
713
+ readonly RUN_INVALID: "run.invalid";
714
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
715
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
716
+ readonly RUN_CANCELED: "run.canceled";
717
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
718
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
719
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
720
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
721
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
722
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
723
+ readonly HOOK_DISPOSED: "hook.disposed";
724
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
725
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
726
+ readonly STEP_TIMEOUT: "step.timeout";
727
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
728
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
729
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
730
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
731
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
732
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
733
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
734
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
735
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
736
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
737
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
738
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
739
+ readonly STREAM_NOT_FOUND: "stream.not_found";
740
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
741
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
742
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
743
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
744
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
745
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
746
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
747
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
748
+ readonly LOCK_NOT_STALE: "lock.not_stale";
749
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
750
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
751
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
752
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
753
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
754
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
755
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
756
+ readonly LOCK_NOT_FOUND: "lock.not_found";
757
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
758
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
759
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
760
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
761
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
762
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
763
+ }>>;
764
+ name: z.ZodString;
765
+ message: z.ZodString;
766
+ stack: z.ZodOptional<z.ZodString>;
767
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
768
+ }, z.core.$loose>;
769
+ }, z.core.$strip>;
770
+ declare const workflowMetadataSetEventSchema: z.ZodObject<{
771
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
772
+ stepId: z.ZodString;
773
+ stepName: z.ZodString;
774
+ count: z.ZodNumber;
775
+ kind: z.ZodLiteral<"metadata_set">;
776
+ metadata: z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>;
777
+ }, z.core.$strip>;
778
+ declare const workflowAttributesSetEventSchema: z.ZodObject<{
779
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
780
+ stepId: z.ZodString;
781
+ stepName: z.ZodString;
782
+ count: z.ZodNumber;
783
+ kind: z.ZodLiteral<"attributes_set">;
784
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
785
+ removeAttributes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
786
+ }, z.core.$strip>;
787
+ declare const workflowStreamStartedEventSchema: z.ZodObject<{
788
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
789
+ stepId: z.ZodString;
790
+ stepName: z.ZodString;
791
+ count: z.ZodNumber;
792
+ kind: z.ZodLiteral<"stream_started">;
793
+ streamId: z.ZodString;
794
+ contentType: z.ZodOptional<z.ZodString>;
795
+ metadata: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
796
+ }, z.core.$strip>;
797
+ declare const workflowStreamChunkEventSchema: z.ZodObject<{
798
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
799
+ stepId: z.ZodString;
800
+ stepName: z.ZodString;
801
+ kind: z.ZodLiteral<"stream_chunk">;
802
+ streamId: z.ZodString;
803
+ index: z.ZodNumber;
804
+ chunk: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
805
+ }, z.core.$strip>;
806
+ declare const workflowStreamClosedEventSchema: z.ZodObject<{
807
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
808
+ stepId: z.ZodString;
809
+ stepName: z.ZodString;
810
+ kind: z.ZodLiteral<"stream_closed">;
811
+ streamId: z.ZodString;
812
+ }, z.core.$strip>;
813
+ declare const workflowStreamFailedEventSchema: z.ZodObject<{
814
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
815
+ stepId: z.ZodString;
816
+ stepName: z.ZodString;
817
+ kind: z.ZodLiteral<"stream_failed">;
818
+ streamId: z.ZodString;
819
+ error: z.ZodObject<{
820
+ code: z.ZodOptional<z.ZodEnum<{
821
+ readonly ERROR: "workflow.error";
822
+ readonly DEFINITION_INVALID: "definition.invalid";
823
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
824
+ readonly OPTIONS_INVALID: "options.invalid";
825
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
826
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
827
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
828
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
829
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
830
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
831
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
832
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
833
+ readonly OPTIONS_REQUIRED: "options.required";
834
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
835
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
836
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
837
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
838
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
839
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
840
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
841
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
842
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
843
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
844
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
845
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
846
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
847
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
848
+ readonly STATE_INVALID: "state.invalid";
849
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
850
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
851
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
852
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
853
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
854
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
855
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
856
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
857
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
858
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
859
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
860
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
861
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
862
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
863
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
864
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
865
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
866
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
867
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
868
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
869
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
870
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
871
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
872
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
873
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
874
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
875
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
876
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
877
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
878
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
879
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
880
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
881
+ readonly RUNTIME_INVALID: "runtime.invalid";
882
+ readonly RUN_ERROR: "run.error";
883
+ readonly STEP_ERROR: "step.error";
884
+ readonly MESSAGE_ERROR: "message.error";
885
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
886
+ readonly DURATION_INVALID: "duration.invalid";
887
+ readonly SERIALIZATION_FAILED: "serialization.failed";
888
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
889
+ readonly PERMANENT_FAILURE: "failure.permanent";
890
+ readonly RETRYABLE_FAILURE: "failure.retryable";
891
+ readonly REPLAY_DIVERGED: "replay.diverged";
892
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
893
+ readonly RUN_NOT_FOUND: "run.not_found";
894
+ readonly RUN_INVALID: "run.invalid";
895
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
896
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
897
+ readonly RUN_CANCELED: "run.canceled";
898
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
899
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
900
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
901
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
902
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
903
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
904
+ readonly HOOK_DISPOSED: "hook.disposed";
905
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
906
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
907
+ readonly STEP_TIMEOUT: "step.timeout";
908
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
909
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
910
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
911
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
912
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
913
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
914
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
915
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
916
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
917
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
918
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
919
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
920
+ readonly STREAM_NOT_FOUND: "stream.not_found";
921
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
922
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
923
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
924
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
925
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
926
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
927
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
928
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
929
+ readonly LOCK_NOT_STALE: "lock.not_stale";
930
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
931
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
932
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
933
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
934
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
935
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
936
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
937
+ readonly LOCK_NOT_FOUND: "lock.not_found";
938
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
939
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
940
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
941
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
942
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
943
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
944
+ }>>;
945
+ name: z.ZodString;
946
+ message: z.ZodString;
947
+ stack: z.ZodOptional<z.ZodString>;
948
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
949
+ }, z.core.$loose>;
950
+ }, z.core.$strip>;
951
+ declare const workflowDeterministicValueRecordedEventSchema: z.ZodObject<{
952
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
953
+ stepId: z.ZodString;
954
+ stepName: z.ZodString;
955
+ count: z.ZodNumber;
956
+ kind: z.ZodLiteral<"deterministic_value_recorded">;
957
+ value: z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>;
958
+ }, z.core.$strip>;
959
+ declare const workflowEventRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
960
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
961
+ kind: z.ZodLiteral<"workflow_started">;
962
+ }, z.core.$strip>, z.ZodObject<{
963
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
964
+ kind: z.ZodLiteral<"workflow_completed">;
965
+ }, z.core.$strip>, z.ZodObject<{
966
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
967
+ kind: z.ZodLiteral<"workflow_failed">;
968
+ }, z.core.$strip>, z.ZodObject<{
969
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
970
+ stepId: z.ZodString;
971
+ stepName: z.ZodString;
972
+ count: z.ZodNumber;
973
+ attempt: z.ZodNumber;
974
+ kind: z.ZodLiteral<"step_started">;
975
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
976
+ }, z.core.$strip>, z.ZodObject<{
977
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
978
+ stepId: z.ZodString;
979
+ stepName: z.ZodString;
980
+ attempt: z.ZodNumber;
981
+ kind: z.ZodLiteral<"step_completed">;
982
+ result: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
983
+ }, z.core.$strip>, z.ZodObject<{
984
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
985
+ stepId: z.ZodString;
986
+ stepName: z.ZodString;
987
+ attempt: z.ZodNumber;
988
+ kind: z.ZodLiteral<"step_failed">;
989
+ error: z.ZodObject<{
990
+ code: z.ZodOptional<z.ZodEnum<{
991
+ readonly ERROR: "workflow.error";
992
+ readonly DEFINITION_INVALID: "definition.invalid";
993
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
994
+ readonly OPTIONS_INVALID: "options.invalid";
995
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
996
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
997
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
998
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
999
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
1000
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
1001
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
1002
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
1003
+ readonly OPTIONS_REQUIRED: "options.required";
1004
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
1005
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
1006
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
1007
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
1008
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
1009
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
1010
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
1011
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
1012
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
1013
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
1014
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
1015
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
1016
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
1017
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
1018
+ readonly STATE_INVALID: "state.invalid";
1019
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
1020
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
1021
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
1022
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
1023
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
1024
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
1025
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
1026
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
1027
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
1028
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
1029
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
1030
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
1031
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
1032
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
1033
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
1034
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
1035
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
1036
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
1037
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
1038
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
1039
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
1040
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
1041
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
1042
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
1043
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
1044
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
1045
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
1046
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
1047
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
1048
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
1049
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
1050
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
1051
+ readonly RUNTIME_INVALID: "runtime.invalid";
1052
+ readonly RUN_ERROR: "run.error";
1053
+ readonly STEP_ERROR: "step.error";
1054
+ readonly MESSAGE_ERROR: "message.error";
1055
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
1056
+ readonly DURATION_INVALID: "duration.invalid";
1057
+ readonly SERIALIZATION_FAILED: "serialization.failed";
1058
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
1059
+ readonly PERMANENT_FAILURE: "failure.permanent";
1060
+ readonly RETRYABLE_FAILURE: "failure.retryable";
1061
+ readonly REPLAY_DIVERGED: "replay.diverged";
1062
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
1063
+ readonly RUN_NOT_FOUND: "run.not_found";
1064
+ readonly RUN_INVALID: "run.invalid";
1065
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
1066
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
1067
+ readonly RUN_CANCELED: "run.canceled";
1068
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
1069
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
1070
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
1071
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
1072
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
1073
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
1074
+ readonly HOOK_DISPOSED: "hook.disposed";
1075
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
1076
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
1077
+ readonly STEP_TIMEOUT: "step.timeout";
1078
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
1079
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
1080
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
1081
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
1082
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
1083
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
1084
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
1085
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
1086
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
1087
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
1088
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
1089
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
1090
+ readonly STREAM_NOT_FOUND: "stream.not_found";
1091
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
1092
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
1093
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
1094
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
1095
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
1096
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
1097
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
1098
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
1099
+ readonly LOCK_NOT_STALE: "lock.not_stale";
1100
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
1101
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
1102
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
1103
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
1104
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
1105
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
1106
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
1107
+ readonly LOCK_NOT_FOUND: "lock.not_found";
1108
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
1109
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
1110
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
1111
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
1112
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
1113
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
1114
+ }>>;
1115
+ name: z.ZodString;
1116
+ message: z.ZodString;
1117
+ stack: z.ZodOptional<z.ZodString>;
1118
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1119
+ }, z.core.$loose>;
1120
+ }, z.core.$strip>, z.ZodObject<{
1121
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1122
+ stepId: z.ZodString;
1123
+ stepName: z.ZodString;
1124
+ count: z.ZodNumber;
1125
+ kind: z.ZodLiteral<"sleep_started">;
1126
+ until: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1127
+ duration: z.ZodOptional<z.ZodCustom<Temporal.Duration, Temporal.Duration>>;
1128
+ }, z.core.$strip>, z.ZodObject<{
1129
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1130
+ stepId: z.ZodString;
1131
+ stepName: z.ZodString;
1132
+ kind: z.ZodLiteral<"sleep_completed">;
1133
+ }, z.core.$strip>, z.ZodObject<{
1134
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1135
+ stepId: z.ZodString;
1136
+ stepName: z.ZodString;
1137
+ count: z.ZodNumber;
1138
+ attempt: z.ZodNumber;
1139
+ kind: z.ZodLiteral<"child_workflow_started">;
1140
+ childRunId: z.ZodString;
1141
+ workflowName: z.ZodString;
1142
+ workflowVersion: z.ZodOptional<z.ZodString>;
1143
+ cancellation: z.ZodOptional<z.ZodEnum<{
1144
+ cascade: "cascade";
1145
+ detach: "detach";
1146
+ }>>;
1147
+ input: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1148
+ idempotencyKey: z.ZodOptional<z.ZodString>;
1149
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
1150
+ }, z.core.$strip>, z.ZodObject<{
1151
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1152
+ stepId: z.ZodString;
1153
+ stepName: z.ZodString;
1154
+ attempt: z.ZodNumber;
1155
+ kind: z.ZodLiteral<"child_workflow_completed">;
1156
+ childRunId: z.ZodString;
1157
+ result: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1158
+ }, z.core.$strip>, z.ZodObject<{
1159
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1160
+ stepId: z.ZodString;
1161
+ stepName: z.ZodString;
1162
+ attempt: z.ZodNumber;
1163
+ kind: z.ZodLiteral<"child_workflow_failed">;
1164
+ childRunId: z.ZodString;
1165
+ error: z.ZodObject<{
1166
+ code: z.ZodOptional<z.ZodEnum<{
1167
+ readonly ERROR: "workflow.error";
1168
+ readonly DEFINITION_INVALID: "definition.invalid";
1169
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
1170
+ readonly OPTIONS_INVALID: "options.invalid";
1171
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
1172
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
1173
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
1174
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
1175
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
1176
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
1177
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
1178
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
1179
+ readonly OPTIONS_REQUIRED: "options.required";
1180
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
1181
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
1182
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
1183
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
1184
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
1185
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
1186
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
1187
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
1188
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
1189
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
1190
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
1191
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
1192
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
1193
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
1194
+ readonly STATE_INVALID: "state.invalid";
1195
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
1196
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
1197
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
1198
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
1199
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
1200
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
1201
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
1202
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
1203
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
1204
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
1205
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
1206
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
1207
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
1208
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
1209
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
1210
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
1211
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
1212
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
1213
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
1214
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
1215
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
1216
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
1217
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
1218
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
1219
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
1220
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
1221
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
1222
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
1223
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
1224
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
1225
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
1226
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
1227
+ readonly RUNTIME_INVALID: "runtime.invalid";
1228
+ readonly RUN_ERROR: "run.error";
1229
+ readonly STEP_ERROR: "step.error";
1230
+ readonly MESSAGE_ERROR: "message.error";
1231
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
1232
+ readonly DURATION_INVALID: "duration.invalid";
1233
+ readonly SERIALIZATION_FAILED: "serialization.failed";
1234
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
1235
+ readonly PERMANENT_FAILURE: "failure.permanent";
1236
+ readonly RETRYABLE_FAILURE: "failure.retryable";
1237
+ readonly REPLAY_DIVERGED: "replay.diverged";
1238
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
1239
+ readonly RUN_NOT_FOUND: "run.not_found";
1240
+ readonly RUN_INVALID: "run.invalid";
1241
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
1242
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
1243
+ readonly RUN_CANCELED: "run.canceled";
1244
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
1245
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
1246
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
1247
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
1248
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
1249
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
1250
+ readonly HOOK_DISPOSED: "hook.disposed";
1251
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
1252
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
1253
+ readonly STEP_TIMEOUT: "step.timeout";
1254
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
1255
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
1256
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
1257
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
1258
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
1259
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
1260
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
1261
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
1262
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
1263
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
1264
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
1265
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
1266
+ readonly STREAM_NOT_FOUND: "stream.not_found";
1267
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
1268
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
1269
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
1270
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
1271
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
1272
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
1273
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
1274
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
1275
+ readonly LOCK_NOT_STALE: "lock.not_stale";
1276
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
1277
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
1278
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
1279
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
1280
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
1281
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
1282
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
1283
+ readonly LOCK_NOT_FOUND: "lock.not_found";
1284
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
1285
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
1286
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
1287
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
1288
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
1289
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
1290
+ }>>;
1291
+ name: z.ZodString;
1292
+ message: z.ZodString;
1293
+ stack: z.ZodOptional<z.ZodString>;
1294
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1295
+ }, z.core.$loose>;
1296
+ }, z.core.$strip>, z.ZodObject<{
1297
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1298
+ kind: z.ZodLiteral<"message_sent">;
1299
+ messageId: z.ZodString;
1300
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1301
+ waiterStepIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1302
+ idempotencyKey: z.ZodOptional<z.ZodString>;
1303
+ telemetryContext: z.ZodOptional<z.ZodObject<{
1304
+ traceparent: z.ZodOptional<z.ZodString>;
1305
+ tracestate: z.ZodOptional<z.ZodString>;
1306
+ }, z.core.$strip>>;
1307
+ }, z.core.$strip>, z.ZodObject<{
1308
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1309
+ stepId: z.ZodString;
1310
+ stepName: z.ZodString;
1311
+ count: z.ZodNumber;
1312
+ kind: z.ZodLiteral<"message_send_started">;
1313
+ targetRunId: z.ZodString;
1314
+ messageId: z.ZodString;
1315
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1316
+ idempotencyKey: z.ZodOptional<z.ZodString>;
1317
+ }, z.core.$strip>, z.ZodObject<{
1318
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1319
+ stepId: z.ZodString;
1320
+ stepName: z.ZodString;
1321
+ kind: z.ZodLiteral<"message_send_completed">;
1322
+ targetRunId: z.ZodString;
1323
+ messageId: z.ZodString;
1324
+ }, z.core.$strip>, z.ZodObject<{
1325
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1326
+ stepId: z.ZodString;
1327
+ stepName: z.ZodString;
1328
+ kind: z.ZodLiteral<"message_send_failed">;
1329
+ targetRunId: z.ZodString;
1330
+ messageId: z.ZodString;
1331
+ error: z.ZodObject<{
1332
+ code: z.ZodOptional<z.ZodEnum<{
1333
+ readonly ERROR: "workflow.error";
1334
+ readonly DEFINITION_INVALID: "definition.invalid";
1335
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
1336
+ readonly OPTIONS_INVALID: "options.invalid";
1337
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
1338
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
1339
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
1340
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
1341
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
1342
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
1343
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
1344
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
1345
+ readonly OPTIONS_REQUIRED: "options.required";
1346
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
1347
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
1348
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
1349
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
1350
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
1351
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
1352
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
1353
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
1354
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
1355
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
1356
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
1357
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
1358
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
1359
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
1360
+ readonly STATE_INVALID: "state.invalid";
1361
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
1362
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
1363
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
1364
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
1365
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
1366
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
1367
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
1368
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
1369
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
1370
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
1371
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
1372
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
1373
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
1374
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
1375
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
1376
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
1377
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
1378
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
1379
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
1380
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
1381
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
1382
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
1383
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
1384
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
1385
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
1386
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
1387
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
1388
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
1389
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
1390
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
1391
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
1392
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
1393
+ readonly RUNTIME_INVALID: "runtime.invalid";
1394
+ readonly RUN_ERROR: "run.error";
1395
+ readonly STEP_ERROR: "step.error";
1396
+ readonly MESSAGE_ERROR: "message.error";
1397
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
1398
+ readonly DURATION_INVALID: "duration.invalid";
1399
+ readonly SERIALIZATION_FAILED: "serialization.failed";
1400
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
1401
+ readonly PERMANENT_FAILURE: "failure.permanent";
1402
+ readonly RETRYABLE_FAILURE: "failure.retryable";
1403
+ readonly REPLAY_DIVERGED: "replay.diverged";
1404
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
1405
+ readonly RUN_NOT_FOUND: "run.not_found";
1406
+ readonly RUN_INVALID: "run.invalid";
1407
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
1408
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
1409
+ readonly RUN_CANCELED: "run.canceled";
1410
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
1411
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
1412
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
1413
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
1414
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
1415
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
1416
+ readonly HOOK_DISPOSED: "hook.disposed";
1417
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
1418
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
1419
+ readonly STEP_TIMEOUT: "step.timeout";
1420
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
1421
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
1422
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
1423
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
1424
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
1425
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
1426
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
1427
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
1428
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
1429
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
1430
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
1431
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
1432
+ readonly STREAM_NOT_FOUND: "stream.not_found";
1433
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
1434
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
1435
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
1436
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
1437
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
1438
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
1439
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
1440
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
1441
+ readonly LOCK_NOT_STALE: "lock.not_stale";
1442
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
1443
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
1444
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
1445
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
1446
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
1447
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
1448
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
1449
+ readonly LOCK_NOT_FOUND: "lock.not_found";
1450
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
1451
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
1452
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
1453
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
1454
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
1455
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
1456
+ }>>;
1457
+ name: z.ZodString;
1458
+ message: z.ZodString;
1459
+ stack: z.ZodOptional<z.ZodString>;
1460
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1461
+ }, z.core.$loose>;
1462
+ }, z.core.$strip>, z.ZodObject<{
1463
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1464
+ stepId: z.ZodString;
1465
+ stepName: z.ZodString;
1466
+ count: z.ZodNumber;
1467
+ kind: z.ZodLiteral<"message_wait_started">;
1468
+ messageId: z.ZodString;
1469
+ source: z.ZodOptional<z.ZodEnum<{
1470
+ hook: "hook";
1471
+ webhook: "webhook";
1472
+ }>>;
1473
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
1474
+ }, z.core.$strip>, z.ZodObject<{
1475
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1476
+ stepId: z.ZodString;
1477
+ stepName: z.ZodString;
1478
+ kind: z.ZodLiteral<"message_wait_completed">;
1479
+ messageId: z.ZodString;
1480
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1481
+ messageTimestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1482
+ telemetryContext: z.ZodOptional<z.ZodObject<{
1483
+ traceparent: z.ZodOptional<z.ZodString>;
1484
+ tracestate: z.ZodOptional<z.ZodString>;
1485
+ }, z.core.$strip>>;
1486
+ }, z.core.$strip>, z.ZodObject<{
1487
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1488
+ stepId: z.ZodString;
1489
+ stepName: z.ZodString;
1490
+ kind: z.ZodLiteral<"message_wait_failed">;
1491
+ messageId: z.ZodString;
1492
+ error: z.ZodObject<{
1493
+ code: z.ZodOptional<z.ZodEnum<{
1494
+ readonly ERROR: "workflow.error";
1495
+ readonly DEFINITION_INVALID: "definition.invalid";
1496
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
1497
+ readonly OPTIONS_INVALID: "options.invalid";
1498
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
1499
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
1500
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
1501
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
1502
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
1503
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
1504
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
1505
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
1506
+ readonly OPTIONS_REQUIRED: "options.required";
1507
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
1508
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
1509
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
1510
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
1511
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
1512
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
1513
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
1514
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
1515
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
1516
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
1517
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
1518
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
1519
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
1520
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
1521
+ readonly STATE_INVALID: "state.invalid";
1522
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
1523
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
1524
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
1525
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
1526
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
1527
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
1528
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
1529
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
1530
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
1531
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
1532
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
1533
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
1534
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
1535
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
1536
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
1537
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
1538
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
1539
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
1540
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
1541
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
1542
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
1543
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
1544
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
1545
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
1546
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
1547
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
1548
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
1549
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
1550
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
1551
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
1552
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
1553
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
1554
+ readonly RUNTIME_INVALID: "runtime.invalid";
1555
+ readonly RUN_ERROR: "run.error";
1556
+ readonly STEP_ERROR: "step.error";
1557
+ readonly MESSAGE_ERROR: "message.error";
1558
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
1559
+ readonly DURATION_INVALID: "duration.invalid";
1560
+ readonly SERIALIZATION_FAILED: "serialization.failed";
1561
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
1562
+ readonly PERMANENT_FAILURE: "failure.permanent";
1563
+ readonly RETRYABLE_FAILURE: "failure.retryable";
1564
+ readonly REPLAY_DIVERGED: "replay.diverged";
1565
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
1566
+ readonly RUN_NOT_FOUND: "run.not_found";
1567
+ readonly RUN_INVALID: "run.invalid";
1568
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
1569
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
1570
+ readonly RUN_CANCELED: "run.canceled";
1571
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
1572
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
1573
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
1574
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
1575
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
1576
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
1577
+ readonly HOOK_DISPOSED: "hook.disposed";
1578
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
1579
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
1580
+ readonly STEP_TIMEOUT: "step.timeout";
1581
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
1582
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
1583
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
1584
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
1585
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
1586
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
1587
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
1588
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
1589
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
1590
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
1591
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
1592
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
1593
+ readonly STREAM_NOT_FOUND: "stream.not_found";
1594
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
1595
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
1596
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
1597
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
1598
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
1599
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
1600
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
1601
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
1602
+ readonly LOCK_NOT_STALE: "lock.not_stale";
1603
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
1604
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
1605
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
1606
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
1607
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
1608
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
1609
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
1610
+ readonly LOCK_NOT_FOUND: "lock.not_found";
1611
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
1612
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
1613
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
1614
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
1615
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
1616
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
1617
+ }>>;
1618
+ name: z.ZodString;
1619
+ message: z.ZodString;
1620
+ stack: z.ZodOptional<z.ZodString>;
1621
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1622
+ }, z.core.$loose>;
1623
+ }, z.core.$strip>, z.ZodObject<{
1624
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1625
+ stepId: z.ZodString;
1626
+ stepName: z.ZodString;
1627
+ count: z.ZodNumber;
1628
+ kind: z.ZodLiteral<"metadata_set">;
1629
+ metadata: z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>;
1630
+ }, z.core.$strip>, z.ZodObject<{
1631
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1632
+ stepId: z.ZodString;
1633
+ stepName: z.ZodString;
1634
+ count: z.ZodNumber;
1635
+ kind: z.ZodLiteral<"attributes_set">;
1636
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1637
+ removeAttributes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1638
+ }, z.core.$strip>, z.ZodObject<{
1639
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1640
+ stepId: z.ZodString;
1641
+ stepName: z.ZodString;
1642
+ count: z.ZodNumber;
1643
+ kind: z.ZodLiteral<"stream_started">;
1644
+ streamId: z.ZodString;
1645
+ contentType: z.ZodOptional<z.ZodString>;
1646
+ metadata: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1647
+ }, z.core.$strip>, z.ZodObject<{
1648
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1649
+ stepId: z.ZodString;
1650
+ stepName: z.ZodString;
1651
+ kind: z.ZodLiteral<"stream_chunk">;
1652
+ streamId: z.ZodString;
1653
+ index: z.ZodNumber;
1654
+ chunk: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1655
+ }, z.core.$strip>, z.ZodObject<{
1656
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1657
+ stepId: z.ZodString;
1658
+ stepName: z.ZodString;
1659
+ kind: z.ZodLiteral<"stream_closed">;
1660
+ streamId: z.ZodString;
1661
+ }, z.core.$strip>, z.ZodObject<{
1662
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1663
+ stepId: z.ZodString;
1664
+ stepName: z.ZodString;
1665
+ kind: z.ZodLiteral<"stream_failed">;
1666
+ streamId: z.ZodString;
1667
+ error: z.ZodObject<{
1668
+ code: z.ZodOptional<z.ZodEnum<{
1669
+ readonly ERROR: "workflow.error";
1670
+ readonly DEFINITION_INVALID: "definition.invalid";
1671
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
1672
+ readonly OPTIONS_INVALID: "options.invalid";
1673
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
1674
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
1675
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
1676
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
1677
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
1678
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
1679
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
1680
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
1681
+ readonly OPTIONS_REQUIRED: "options.required";
1682
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
1683
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
1684
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
1685
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
1686
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
1687
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
1688
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
1689
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
1690
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
1691
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
1692
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
1693
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
1694
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
1695
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
1696
+ readonly STATE_INVALID: "state.invalid";
1697
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
1698
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
1699
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
1700
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
1701
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
1702
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
1703
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
1704
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
1705
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
1706
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
1707
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
1708
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
1709
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
1710
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
1711
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
1712
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
1713
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
1714
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
1715
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
1716
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
1717
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
1718
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
1719
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
1720
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
1721
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
1722
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
1723
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
1724
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
1725
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
1726
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
1727
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
1728
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
1729
+ readonly RUNTIME_INVALID: "runtime.invalid";
1730
+ readonly RUN_ERROR: "run.error";
1731
+ readonly STEP_ERROR: "step.error";
1732
+ readonly MESSAGE_ERROR: "message.error";
1733
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
1734
+ readonly DURATION_INVALID: "duration.invalid";
1735
+ readonly SERIALIZATION_FAILED: "serialization.failed";
1736
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
1737
+ readonly PERMANENT_FAILURE: "failure.permanent";
1738
+ readonly RETRYABLE_FAILURE: "failure.retryable";
1739
+ readonly REPLAY_DIVERGED: "replay.diverged";
1740
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
1741
+ readonly RUN_NOT_FOUND: "run.not_found";
1742
+ readonly RUN_INVALID: "run.invalid";
1743
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
1744
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
1745
+ readonly RUN_CANCELED: "run.canceled";
1746
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
1747
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
1748
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
1749
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
1750
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
1751
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
1752
+ readonly HOOK_DISPOSED: "hook.disposed";
1753
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
1754
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
1755
+ readonly STEP_TIMEOUT: "step.timeout";
1756
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
1757
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
1758
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
1759
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
1760
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
1761
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
1762
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
1763
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
1764
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
1765
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
1766
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
1767
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
1768
+ readonly STREAM_NOT_FOUND: "stream.not_found";
1769
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
1770
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
1771
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
1772
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
1773
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
1774
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
1775
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
1776
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
1777
+ readonly LOCK_NOT_STALE: "lock.not_stale";
1778
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
1779
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
1780
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
1781
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
1782
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
1783
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
1784
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
1785
+ readonly LOCK_NOT_FOUND: "lock.not_found";
1786
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
1787
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
1788
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
1789
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
1790
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
1791
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
1792
+ }>>;
1793
+ name: z.ZodString;
1794
+ message: z.ZodString;
1795
+ stack: z.ZodOptional<z.ZodString>;
1796
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1797
+ }, z.core.$loose>;
1798
+ }, z.core.$strip>, z.ZodObject<{
1799
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1800
+ stepId: z.ZodString;
1801
+ stepName: z.ZodString;
1802
+ count: z.ZodNumber;
1803
+ kind: z.ZodLiteral<"deterministic_value_recorded">;
1804
+ value: z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>;
1805
+ }, z.core.$strip>], "kind">;
1806
+ declare const workflowEventRecordListSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1807
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1808
+ kind: z.ZodLiteral<"workflow_started">;
1809
+ }, z.core.$strip>, z.ZodObject<{
1810
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1811
+ kind: z.ZodLiteral<"workflow_completed">;
1812
+ }, z.core.$strip>, z.ZodObject<{
1813
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1814
+ kind: z.ZodLiteral<"workflow_failed">;
1815
+ }, z.core.$strip>, z.ZodObject<{
1816
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1817
+ stepId: z.ZodString;
1818
+ stepName: z.ZodString;
1819
+ count: z.ZodNumber;
1820
+ attempt: z.ZodNumber;
1821
+ kind: z.ZodLiteral<"step_started">;
1822
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
1823
+ }, z.core.$strip>, z.ZodObject<{
1824
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1825
+ stepId: z.ZodString;
1826
+ stepName: z.ZodString;
1827
+ attempt: z.ZodNumber;
1828
+ kind: z.ZodLiteral<"step_completed">;
1829
+ result: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1830
+ }, z.core.$strip>, z.ZodObject<{
1831
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1832
+ stepId: z.ZodString;
1833
+ stepName: z.ZodString;
1834
+ attempt: z.ZodNumber;
1835
+ kind: z.ZodLiteral<"step_failed">;
1836
+ error: z.ZodObject<{
1837
+ code: z.ZodOptional<z.ZodEnum<{
1838
+ readonly ERROR: "workflow.error";
1839
+ readonly DEFINITION_INVALID: "definition.invalid";
1840
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
1841
+ readonly OPTIONS_INVALID: "options.invalid";
1842
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
1843
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
1844
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
1845
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
1846
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
1847
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
1848
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
1849
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
1850
+ readonly OPTIONS_REQUIRED: "options.required";
1851
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
1852
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
1853
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
1854
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
1855
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
1856
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
1857
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
1858
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
1859
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
1860
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
1861
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
1862
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
1863
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
1864
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
1865
+ readonly STATE_INVALID: "state.invalid";
1866
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
1867
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
1868
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
1869
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
1870
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
1871
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
1872
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
1873
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
1874
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
1875
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
1876
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
1877
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
1878
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
1879
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
1880
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
1881
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
1882
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
1883
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
1884
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
1885
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
1886
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
1887
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
1888
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
1889
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
1890
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
1891
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
1892
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
1893
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
1894
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
1895
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
1896
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
1897
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
1898
+ readonly RUNTIME_INVALID: "runtime.invalid";
1899
+ readonly RUN_ERROR: "run.error";
1900
+ readonly STEP_ERROR: "step.error";
1901
+ readonly MESSAGE_ERROR: "message.error";
1902
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
1903
+ readonly DURATION_INVALID: "duration.invalid";
1904
+ readonly SERIALIZATION_FAILED: "serialization.failed";
1905
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
1906
+ readonly PERMANENT_FAILURE: "failure.permanent";
1907
+ readonly RETRYABLE_FAILURE: "failure.retryable";
1908
+ readonly REPLAY_DIVERGED: "replay.diverged";
1909
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
1910
+ readonly RUN_NOT_FOUND: "run.not_found";
1911
+ readonly RUN_INVALID: "run.invalid";
1912
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
1913
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
1914
+ readonly RUN_CANCELED: "run.canceled";
1915
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
1916
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
1917
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
1918
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
1919
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
1920
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
1921
+ readonly HOOK_DISPOSED: "hook.disposed";
1922
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
1923
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
1924
+ readonly STEP_TIMEOUT: "step.timeout";
1925
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
1926
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
1927
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
1928
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
1929
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
1930
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
1931
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
1932
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
1933
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
1934
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
1935
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
1936
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
1937
+ readonly STREAM_NOT_FOUND: "stream.not_found";
1938
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
1939
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
1940
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
1941
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
1942
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
1943
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
1944
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
1945
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
1946
+ readonly LOCK_NOT_STALE: "lock.not_stale";
1947
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
1948
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
1949
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
1950
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
1951
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
1952
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
1953
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
1954
+ readonly LOCK_NOT_FOUND: "lock.not_found";
1955
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
1956
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
1957
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
1958
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
1959
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
1960
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
1961
+ }>>;
1962
+ name: z.ZodString;
1963
+ message: z.ZodString;
1964
+ stack: z.ZodOptional<z.ZodString>;
1965
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
1966
+ }, z.core.$loose>;
1967
+ }, z.core.$strip>, z.ZodObject<{
1968
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1969
+ stepId: z.ZodString;
1970
+ stepName: z.ZodString;
1971
+ count: z.ZodNumber;
1972
+ kind: z.ZodLiteral<"sleep_started">;
1973
+ until: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1974
+ duration: z.ZodOptional<z.ZodCustom<Temporal.Duration, Temporal.Duration>>;
1975
+ }, z.core.$strip>, z.ZodObject<{
1976
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1977
+ stepId: z.ZodString;
1978
+ stepName: z.ZodString;
1979
+ kind: z.ZodLiteral<"sleep_completed">;
1980
+ }, z.core.$strip>, z.ZodObject<{
1981
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1982
+ stepId: z.ZodString;
1983
+ stepName: z.ZodString;
1984
+ count: z.ZodNumber;
1985
+ attempt: z.ZodNumber;
1986
+ kind: z.ZodLiteral<"child_workflow_started">;
1987
+ childRunId: z.ZodString;
1988
+ workflowName: z.ZodString;
1989
+ workflowVersion: z.ZodOptional<z.ZodString>;
1990
+ cancellation: z.ZodOptional<z.ZodEnum<{
1991
+ cascade: "cascade";
1992
+ detach: "detach";
1993
+ }>>;
1994
+ input: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
1995
+ idempotencyKey: z.ZodOptional<z.ZodString>;
1996
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
1997
+ }, z.core.$strip>, z.ZodObject<{
1998
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
1999
+ stepId: z.ZodString;
2000
+ stepName: z.ZodString;
2001
+ attempt: z.ZodNumber;
2002
+ kind: z.ZodLiteral<"child_workflow_completed">;
2003
+ childRunId: z.ZodString;
2004
+ result: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
2005
+ }, z.core.$strip>, z.ZodObject<{
2006
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2007
+ stepId: z.ZodString;
2008
+ stepName: z.ZodString;
2009
+ attempt: z.ZodNumber;
2010
+ kind: z.ZodLiteral<"child_workflow_failed">;
2011
+ childRunId: z.ZodString;
2012
+ error: z.ZodObject<{
2013
+ code: z.ZodOptional<z.ZodEnum<{
2014
+ readonly ERROR: "workflow.error";
2015
+ readonly DEFINITION_INVALID: "definition.invalid";
2016
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
2017
+ readonly OPTIONS_INVALID: "options.invalid";
2018
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
2019
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
2020
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
2021
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
2022
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
2023
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
2024
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
2025
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
2026
+ readonly OPTIONS_REQUIRED: "options.required";
2027
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
2028
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
2029
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
2030
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
2031
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
2032
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
2033
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
2034
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
2035
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
2036
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
2037
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
2038
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
2039
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
2040
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
2041
+ readonly STATE_INVALID: "state.invalid";
2042
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
2043
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
2044
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
2045
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
2046
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
2047
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
2048
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
2049
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
2050
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
2051
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
2052
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
2053
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
2054
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
2055
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
2056
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
2057
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
2058
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
2059
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
2060
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
2061
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
2062
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
2063
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
2064
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
2065
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
2066
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
2067
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
2068
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
2069
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
2070
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
2071
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
2072
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
2073
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
2074
+ readonly RUNTIME_INVALID: "runtime.invalid";
2075
+ readonly RUN_ERROR: "run.error";
2076
+ readonly STEP_ERROR: "step.error";
2077
+ readonly MESSAGE_ERROR: "message.error";
2078
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
2079
+ readonly DURATION_INVALID: "duration.invalid";
2080
+ readonly SERIALIZATION_FAILED: "serialization.failed";
2081
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
2082
+ readonly PERMANENT_FAILURE: "failure.permanent";
2083
+ readonly RETRYABLE_FAILURE: "failure.retryable";
2084
+ readonly REPLAY_DIVERGED: "replay.diverged";
2085
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
2086
+ readonly RUN_NOT_FOUND: "run.not_found";
2087
+ readonly RUN_INVALID: "run.invalid";
2088
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
2089
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
2090
+ readonly RUN_CANCELED: "run.canceled";
2091
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
2092
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
2093
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
2094
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
2095
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
2096
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
2097
+ readonly HOOK_DISPOSED: "hook.disposed";
2098
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
2099
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
2100
+ readonly STEP_TIMEOUT: "step.timeout";
2101
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
2102
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
2103
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
2104
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
2105
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
2106
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
2107
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
2108
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
2109
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
2110
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
2111
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
2112
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
2113
+ readonly STREAM_NOT_FOUND: "stream.not_found";
2114
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
2115
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
2116
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
2117
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
2118
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
2119
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
2120
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
2121
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
2122
+ readonly LOCK_NOT_STALE: "lock.not_stale";
2123
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
2124
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
2125
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
2126
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
2127
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
2128
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
2129
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
2130
+ readonly LOCK_NOT_FOUND: "lock.not_found";
2131
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
2132
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
2133
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
2134
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
2135
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
2136
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
2137
+ }>>;
2138
+ name: z.ZodString;
2139
+ message: z.ZodString;
2140
+ stack: z.ZodOptional<z.ZodString>;
2141
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
2142
+ }, z.core.$loose>;
2143
+ }, z.core.$strip>, z.ZodObject<{
2144
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2145
+ kind: z.ZodLiteral<"message_sent">;
2146
+ messageId: z.ZodString;
2147
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
2148
+ waiterStepIds: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
2149
+ idempotencyKey: z.ZodOptional<z.ZodString>;
2150
+ telemetryContext: z.ZodOptional<z.ZodObject<{
2151
+ traceparent: z.ZodOptional<z.ZodString>;
2152
+ tracestate: z.ZodOptional<z.ZodString>;
2153
+ }, z.core.$strip>>;
2154
+ }, z.core.$strip>, z.ZodObject<{
2155
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2156
+ stepId: z.ZodString;
2157
+ stepName: z.ZodString;
2158
+ count: z.ZodNumber;
2159
+ kind: z.ZodLiteral<"message_send_started">;
2160
+ targetRunId: z.ZodString;
2161
+ messageId: z.ZodString;
2162
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
2163
+ idempotencyKey: z.ZodOptional<z.ZodString>;
2164
+ }, z.core.$strip>, z.ZodObject<{
2165
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2166
+ stepId: z.ZodString;
2167
+ stepName: z.ZodString;
2168
+ kind: z.ZodLiteral<"message_send_completed">;
2169
+ targetRunId: z.ZodString;
2170
+ messageId: z.ZodString;
2171
+ }, z.core.$strip>, z.ZodObject<{
2172
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2173
+ stepId: z.ZodString;
2174
+ stepName: z.ZodString;
2175
+ kind: z.ZodLiteral<"message_send_failed">;
2176
+ targetRunId: z.ZodString;
2177
+ messageId: z.ZodString;
2178
+ error: z.ZodObject<{
2179
+ code: z.ZodOptional<z.ZodEnum<{
2180
+ readonly ERROR: "workflow.error";
2181
+ readonly DEFINITION_INVALID: "definition.invalid";
2182
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
2183
+ readonly OPTIONS_INVALID: "options.invalid";
2184
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
2185
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
2186
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
2187
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
2188
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
2189
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
2190
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
2191
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
2192
+ readonly OPTIONS_REQUIRED: "options.required";
2193
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
2194
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
2195
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
2196
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
2197
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
2198
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
2199
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
2200
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
2201
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
2202
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
2203
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
2204
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
2205
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
2206
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
2207
+ readonly STATE_INVALID: "state.invalid";
2208
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
2209
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
2210
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
2211
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
2212
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
2213
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
2214
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
2215
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
2216
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
2217
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
2218
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
2219
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
2220
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
2221
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
2222
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
2223
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
2224
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
2225
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
2226
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
2227
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
2228
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
2229
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
2230
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
2231
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
2232
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
2233
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
2234
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
2235
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
2236
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
2237
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
2238
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
2239
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
2240
+ readonly RUNTIME_INVALID: "runtime.invalid";
2241
+ readonly RUN_ERROR: "run.error";
2242
+ readonly STEP_ERROR: "step.error";
2243
+ readonly MESSAGE_ERROR: "message.error";
2244
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
2245
+ readonly DURATION_INVALID: "duration.invalid";
2246
+ readonly SERIALIZATION_FAILED: "serialization.failed";
2247
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
2248
+ readonly PERMANENT_FAILURE: "failure.permanent";
2249
+ readonly RETRYABLE_FAILURE: "failure.retryable";
2250
+ readonly REPLAY_DIVERGED: "replay.diverged";
2251
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
2252
+ readonly RUN_NOT_FOUND: "run.not_found";
2253
+ readonly RUN_INVALID: "run.invalid";
2254
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
2255
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
2256
+ readonly RUN_CANCELED: "run.canceled";
2257
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
2258
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
2259
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
2260
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
2261
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
2262
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
2263
+ readonly HOOK_DISPOSED: "hook.disposed";
2264
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
2265
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
2266
+ readonly STEP_TIMEOUT: "step.timeout";
2267
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
2268
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
2269
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
2270
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
2271
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
2272
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
2273
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
2274
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
2275
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
2276
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
2277
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
2278
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
2279
+ readonly STREAM_NOT_FOUND: "stream.not_found";
2280
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
2281
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
2282
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
2283
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
2284
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
2285
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
2286
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
2287
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
2288
+ readonly LOCK_NOT_STALE: "lock.not_stale";
2289
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
2290
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
2291
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
2292
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
2293
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
2294
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
2295
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
2296
+ readonly LOCK_NOT_FOUND: "lock.not_found";
2297
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
2298
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
2299
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
2300
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
2301
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
2302
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
2303
+ }>>;
2304
+ name: z.ZodString;
2305
+ message: z.ZodString;
2306
+ stack: z.ZodOptional<z.ZodString>;
2307
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
2308
+ }, z.core.$loose>;
2309
+ }, z.core.$strip>, z.ZodObject<{
2310
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2311
+ stepId: z.ZodString;
2312
+ stepName: z.ZodString;
2313
+ count: z.ZodNumber;
2314
+ kind: z.ZodLiteral<"message_wait_started">;
2315
+ messageId: z.ZodString;
2316
+ source: z.ZodOptional<z.ZodEnum<{
2317
+ hook: "hook";
2318
+ webhook: "webhook";
2319
+ }>>;
2320
+ timeoutAt: z.ZodOptional<z.ZodCustom<Temporal.Instant, Temporal.Instant>>;
2321
+ }, z.core.$strip>, z.ZodObject<{
2322
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2323
+ stepId: z.ZodString;
2324
+ stepName: z.ZodString;
2325
+ kind: z.ZodLiteral<"message_wait_completed">;
2326
+ messageId: z.ZodString;
2327
+ payload: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
2328
+ messageTimestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2329
+ telemetryContext: z.ZodOptional<z.ZodObject<{
2330
+ traceparent: z.ZodOptional<z.ZodString>;
2331
+ tracestate: z.ZodOptional<z.ZodString>;
2332
+ }, z.core.$strip>>;
2333
+ }, z.core.$strip>, z.ZodObject<{
2334
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2335
+ stepId: z.ZodString;
2336
+ stepName: z.ZodString;
2337
+ kind: z.ZodLiteral<"message_wait_failed">;
2338
+ messageId: z.ZodString;
2339
+ error: z.ZodObject<{
2340
+ code: z.ZodOptional<z.ZodEnum<{
2341
+ readonly ERROR: "workflow.error";
2342
+ readonly DEFINITION_INVALID: "definition.invalid";
2343
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
2344
+ readonly OPTIONS_INVALID: "options.invalid";
2345
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
2346
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
2347
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
2348
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
2349
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
2350
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
2351
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
2352
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
2353
+ readonly OPTIONS_REQUIRED: "options.required";
2354
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
2355
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
2356
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
2357
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
2358
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
2359
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
2360
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
2361
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
2362
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
2363
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
2364
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
2365
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
2366
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
2367
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
2368
+ readonly STATE_INVALID: "state.invalid";
2369
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
2370
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
2371
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
2372
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
2373
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
2374
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
2375
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
2376
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
2377
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
2378
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
2379
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
2380
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
2381
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
2382
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
2383
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
2384
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
2385
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
2386
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
2387
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
2388
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
2389
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
2390
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
2391
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
2392
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
2393
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
2394
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
2395
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
2396
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
2397
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
2398
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
2399
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
2400
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
2401
+ readonly RUNTIME_INVALID: "runtime.invalid";
2402
+ readonly RUN_ERROR: "run.error";
2403
+ readonly STEP_ERROR: "step.error";
2404
+ readonly MESSAGE_ERROR: "message.error";
2405
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
2406
+ readonly DURATION_INVALID: "duration.invalid";
2407
+ readonly SERIALIZATION_FAILED: "serialization.failed";
2408
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
2409
+ readonly PERMANENT_FAILURE: "failure.permanent";
2410
+ readonly RETRYABLE_FAILURE: "failure.retryable";
2411
+ readonly REPLAY_DIVERGED: "replay.diverged";
2412
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
2413
+ readonly RUN_NOT_FOUND: "run.not_found";
2414
+ readonly RUN_INVALID: "run.invalid";
2415
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
2416
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
2417
+ readonly RUN_CANCELED: "run.canceled";
2418
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
2419
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
2420
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
2421
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
2422
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
2423
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
2424
+ readonly HOOK_DISPOSED: "hook.disposed";
2425
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
2426
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
2427
+ readonly STEP_TIMEOUT: "step.timeout";
2428
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
2429
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
2430
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
2431
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
2432
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
2433
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
2434
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
2435
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
2436
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
2437
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
2438
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
2439
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
2440
+ readonly STREAM_NOT_FOUND: "stream.not_found";
2441
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
2442
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
2443
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
2444
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
2445
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
2446
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
2447
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
2448
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
2449
+ readonly LOCK_NOT_STALE: "lock.not_stale";
2450
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
2451
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
2452
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
2453
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
2454
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
2455
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
2456
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
2457
+ readonly LOCK_NOT_FOUND: "lock.not_found";
2458
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
2459
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
2460
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
2461
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
2462
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
2463
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
2464
+ }>>;
2465
+ name: z.ZodString;
2466
+ message: z.ZodString;
2467
+ stack: z.ZodOptional<z.ZodString>;
2468
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
2469
+ }, z.core.$loose>;
2470
+ }, z.core.$strip>, z.ZodObject<{
2471
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2472
+ stepId: z.ZodString;
2473
+ stepName: z.ZodString;
2474
+ count: z.ZodNumber;
2475
+ kind: z.ZodLiteral<"metadata_set">;
2476
+ metadata: z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>;
2477
+ }, z.core.$strip>, z.ZodObject<{
2478
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2479
+ stepId: z.ZodString;
2480
+ stepName: z.ZodString;
2481
+ count: z.ZodNumber;
2482
+ kind: z.ZodLiteral<"attributes_set">;
2483
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
2484
+ removeAttributes: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
2485
+ }, z.core.$strip>, z.ZodObject<{
2486
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2487
+ stepId: z.ZodString;
2488
+ stepName: z.ZodString;
2489
+ count: z.ZodNumber;
2490
+ kind: z.ZodLiteral<"stream_started">;
2491
+ streamId: z.ZodString;
2492
+ contentType: z.ZodOptional<z.ZodString>;
2493
+ metadata: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
2494
+ }, z.core.$strip>, z.ZodObject<{
2495
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2496
+ stepId: z.ZodString;
2497
+ stepName: z.ZodString;
2498
+ kind: z.ZodLiteral<"stream_chunk">;
2499
+ streamId: z.ZodString;
2500
+ index: z.ZodNumber;
2501
+ chunk: z.ZodOptional<z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>>;
2502
+ }, z.core.$strip>, z.ZodObject<{
2503
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2504
+ stepId: z.ZodString;
2505
+ stepName: z.ZodString;
2506
+ kind: z.ZodLiteral<"stream_closed">;
2507
+ streamId: z.ZodString;
2508
+ }, z.core.$strip>, z.ZodObject<{
2509
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2510
+ stepId: z.ZodString;
2511
+ stepName: z.ZodString;
2512
+ kind: z.ZodLiteral<"stream_failed">;
2513
+ streamId: z.ZodString;
2514
+ error: z.ZodObject<{
2515
+ code: z.ZodOptional<z.ZodEnum<{
2516
+ readonly ERROR: "workflow.error";
2517
+ readonly DEFINITION_INVALID: "definition.invalid";
2518
+ readonly CAPABILITY_UNSUPPORTED: "capability.unsupported";
2519
+ readonly OPTIONS_INVALID: "options.invalid";
2520
+ readonly OPTIONS_EXPECTED_OBJECT: "options.expected_object";
2521
+ readonly OPTIONS_EXPECTED_ARRAY: "options.expected_array";
2522
+ readonly OPTIONS_EXPECTED_FUNCTION: "options.expected_function";
2523
+ readonly OPTIONS_EXPECTED_STRING: "options.expected_string";
2524
+ readonly OPTIONS_EXPECTED_NON_EMPTY: "options.expected_non_empty";
2525
+ readonly OPTIONS_EXPECTED_NON_BLANK: "options.expected_non_blank";
2526
+ readonly OPTIONS_EXPECTED_NUMBER: "options.expected_number";
2527
+ readonly OPTIONS_EXPECTED_BOOLEAN: "options.expected_boolean";
2528
+ readonly OPTIONS_REQUIRED: "options.required";
2529
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER: "options.expected_positive_safe_integer";
2530
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_SAFE_INTEGER: "options.expected_non_negative_safe_integer";
2531
+ readonly OPTIONS_EXPECTED_POSITIVE_DURATION: "options.expected_positive_duration";
2532
+ readonly OPTIONS_EXPECTED_NON_NEGATIVE_DURATION: "options.expected_non_negative_duration";
2533
+ readonly OPTIONS_EXPECTED_TIMER_SAFE_DURATION: "options.expected_timer_safe_duration";
2534
+ readonly OPTIONS_EXPECTED_POSITIVE_SAFE_INTEGER_DURATION: "options.expected_positive_safe_integer_duration";
2535
+ readonly OPTIONS_EXPECTED_TEMPORAL_INSTANT: "options.expected_temporal_instant";
2536
+ readonly OPTIONS_EXPECTED_ABORT_SIGNAL: "options.expected_abort_signal";
2537
+ readonly OPTIONS_CHILD_CANCELLATION_POLICY_INVALID: "options.child_cancellation_policy_invalid";
2538
+ readonly OPTIONS_CURSOR_INVALID: "options.cursor_invalid";
2539
+ readonly OPTIONS_RETRY_MAXIMUM_INTERVAL_TOO_SMALL: "options.retry_maximum_interval_too_small";
2540
+ readonly OPTIONS_RETRYABLE_ERROR_DELAY_CONFLICT: "options.retryable_error_delay_conflict";
2541
+ readonly OPTIONS_ENGINE_STORE_STORAGE_CONFLICT: "options.engine_store_storage_conflict";
2542
+ readonly OPTIONS_MISSING_IMPLEMENTATION_RETRY_ATTEMPT_INVALID: "options.missing_implementation_retry_attempt_invalid";
2543
+ readonly STATE_INVALID: "state.invalid";
2544
+ readonly STATE_RUN_NAMESPACE_MISMATCH: "state.run_namespace_mismatch";
2545
+ readonly STATE_RUN_ID_MISMATCH: "state.run_id_mismatch";
2546
+ readonly STATE_RUN_ALREADY_EXISTS: "state.run_already_exists";
2547
+ readonly STATE_EVENT_HISTORY_ALREADY_EXISTS: "state.event_history_already_exists";
2548
+ readonly STATE_EVENT_NOT_TERMINAL_STEP: "state.event_not_terminal_step";
2549
+ readonly STATE_RECORDED_STEP_EVENT_UNSUPPORTED: "state.recorded_step_event_unsupported";
2550
+ readonly STATE_STEP_ATTEMPT_FIELD_MISMATCH: "state.step_attempt_field_mismatch";
2551
+ readonly STATE_FAILED_RUN_MISSING_ERROR: "state.failed_run_missing_error";
2552
+ readonly STATE_RUN_NOT_CLAIMABLE: "state.run_not_claimable";
2553
+ readonly STATE_WORKER_STOPPED_BEFORE_RUN: "state.worker_stopped_before_run";
2554
+ readonly STATE_STORE_RUN_ID_INVALID: "state.store_run_id_invalid";
2555
+ readonly STATE_IDEMPOTENCY_KEY_CLAIMED_WITHOUT_RUN: "state.idempotency_key_claimed_without_run";
2556
+ readonly STATE_RUN_MISSING_IDEMPOTENCY_KEY: "state.run_missing_idempotency_key";
2557
+ readonly STATE_RUN_METADATA_UPDATE_FAILED: "state.run_metadata_update_failed";
2558
+ readonly STATE_RUN_ATTRIBUTES_UPDATE_FAILED: "state.run_attributes_update_failed";
2559
+ readonly STATE_RUN_CANNOT_BE_RESCHEDULED: "state.run_cannot_be_rescheduled";
2560
+ readonly STATE_RUN_RESCHEDULE_FAILED: "state.run_reschedule_failed";
2561
+ readonly STATE_STALE_LEASE_RELEASE_REQUIRES_RUNNING: "state.stale_lease_release_requires_running";
2562
+ readonly STATE_RUN_LEASE_STILL_ACTIVE: "state.run_lease_still_active";
2563
+ readonly STATE_STALE_RUN_LEASE_RELEASE_FAILED: "state.stale_run_lease_release_failed";
2564
+ readonly STATE_RUN_RETRY_REQUIRES_FAILED: "state.run_retry_requires_failed";
2565
+ readonly STATE_RUN_RETRY_REQUIRES_FORCE_AFTER_PERMANENT_FAILURE: "state.run_retry_requires_force_after_permanent_failure";
2566
+ readonly STATE_FAILED_RUN_RETRY_REQUIRES_FORCE: "state.failed_run_retry_requires_force";
2567
+ readonly STATE_RUN_RETRY_FAILED: "state.run_retry_failed";
2568
+ readonly STATE_PERMANENT_RUN_FAILURE_FAILED: "state.permanent_run_failure_failed";
2569
+ readonly STATE_PERMANENT_FAILURE_STATUS_INVALID: "state.permanent_failure_status_invalid";
2570
+ readonly STATE_MESSAGE_APPEND_FAILED: "state.message_append_failed";
2571
+ readonly STATE_CLEANUP_SELECTED_NON_TERMINAL_RUN: "state.cleanup_selected_non_terminal_run";
2572
+ readonly STATE_CLEANUP_RUN_MISSING_FINISHED_AT: "state.cleanup_run_missing_finished_at";
2573
+ readonly STATE_WORKFLOW_EVENT_APPEND_FAILED: "state.workflow_event_append_failed";
2574
+ readonly STATE_STEP_ATTEMPT_MATERIALIZATION_FAILED: "state.step_attempt_materialization_failed";
2575
+ readonly STATE_APPEND_PROJECTION_PIPELINE_MISSING: "state.append_projection_pipeline_missing";
2576
+ readonly RUNTIME_INVALID: "runtime.invalid";
2577
+ readonly RUN_ERROR: "run.error";
2578
+ readonly STEP_ERROR: "step.error";
2579
+ readonly MESSAGE_ERROR: "message.error";
2580
+ readonly IMPLEMENTATION_NOT_FOUND: "implementation.not_found";
2581
+ readonly DURATION_INVALID: "duration.invalid";
2582
+ readonly SERIALIZATION_FAILED: "serialization.failed";
2583
+ readonly NON_RETRYABLE_FAILURE: "failure.non_retryable";
2584
+ readonly PERMANENT_FAILURE: "failure.permanent";
2585
+ readonly RETRYABLE_FAILURE: "failure.retryable";
2586
+ readonly REPLAY_DIVERGED: "replay.diverged";
2587
+ readonly LOCK_ALREADY_HELD: "lock.already_held";
2588
+ readonly RUN_NOT_FOUND: "run.not_found";
2589
+ readonly RUN_INVALID: "run.invalid";
2590
+ readonly RUN_WORKFLOW_MISMATCH: "run.workflow_mismatch";
2591
+ readonly RUN_RESULT_TIMEOUT: "run.result_timeout";
2592
+ readonly RUN_CANCELED: "run.canceled";
2593
+ readonly RUN_CANCELLATION_REJECTED: "run.cancellation_rejected";
2594
+ readonly RUN_TRANSITION_INVALID: "run.transition_invalid";
2595
+ readonly RUN_PARENT_INVALID: "run.parent_invalid";
2596
+ readonly RUN_DEADLINE_EXCEEDED: "run.deadline_exceeded";
2597
+ readonly CHILD_WORKFLOW_TIMEOUT: "child_workflow.timeout";
2598
+ readonly MESSAGE_WAIT_TIMEOUT: "message.wait_timeout";
2599
+ readonly HOOK_DISPOSED: "hook.disposed";
2600
+ readonly MESSAGE_DELIVERY_REJECTED: "message.delivery_rejected";
2601
+ readonly MESSAGE_IDEMPOTENCY_CONFLICT: "message.idempotency_conflict";
2602
+ readonly STEP_TIMEOUT: "step.timeout";
2603
+ readonly STEP_EXECUTION_FAILED: "step.execution_failed";
2604
+ readonly STEP_RETRY_LIMIT_EXCEEDED: "step.retry_limit_exceeded";
2605
+ readonly STEP_ATTEMPT_LIMIT_EXCEEDED: "step.attempt_limit_exceeded";
2606
+ readonly SCHEDULE_ALREADY_EXISTS: "schedule.already_exists";
2607
+ readonly SCHEDULE_NAMESPACE_MISMATCH: "schedule.namespace_mismatch";
2608
+ readonly SCHEDULE_RECORD_INVALID: "schedule.record_invalid";
2609
+ readonly SCHEDULE_ID_CHANGE_REJECTED: "schedule.id_change_rejected";
2610
+ readonly SCHEDULE_CURRENT_RECORD_INVALID: "schedule.current_record_invalid";
2611
+ readonly SCHEDULE_NEXT_RECORD_INVALID: "schedule.next_record_invalid";
2612
+ readonly SCHEDULE_UPSERT_CONFLICT_EXHAUSTED: "schedule.upsert_conflict_exhausted";
2613
+ readonly SCHEDULE_NOT_FOUND: "schedule.not_found";
2614
+ readonly SCHEDULE_UPDATE_CONFLICT_EXHAUSTED: "schedule.update_conflict_exhausted";
2615
+ readonly STREAM_NOT_FOUND: "stream.not_found";
2616
+ readonly STREAM_CHUNK_LIMIT_EXCEEDED: "stream.chunk_limit_exceeded";
2617
+ readonly STREAM_READ_OFFSET_CONFLICT: "stream.read_offset_conflict";
2618
+ readonly STREAM_CHUNK_INDEX_NON_CONTIGUOUS: "stream.chunk_index_non_contiguous";
2619
+ readonly STREAM_CHUNK_AFTER_TERMINAL: "stream.chunk_after_terminal";
2620
+ readonly STREAM_ALREADY_CLOSED: "stream.already_closed";
2621
+ readonly LOCK_ALREADY_HELD_WITHOUT_WAIT: "lock.already_held_without_wait";
2622
+ readonly LOCK_HOLDER_MISMATCH: "lock.holder_mismatch";
2623
+ readonly LOCK_ALREADY_RELEASED: "lock.already_released";
2624
+ readonly LOCK_NOT_STALE: "lock.not_stale";
2625
+ readonly LOCK_WAIT_DEADLINE_CONFLICT: "lock.wait_deadline_conflict";
2626
+ readonly LOCK_TIMEOUT_REQUIRES_WAIT: "lock.timeout_requires_wait";
2627
+ readonly LOCK_NAMESPACE_MISMATCH: "lock.namespace_mismatch";
2628
+ readonly LOCK_KEY_CHANGE_REJECTED: "lock.key_change_rejected";
2629
+ readonly LOCK_CURRENT_RECORD_INVALID: "lock.current_record_invalid";
2630
+ readonly LOCK_NEXT_RECORD_INVALID: "lock.next_record_invalid";
2631
+ readonly LOCK_ACQUIRE_CONFLICT_EXHAUSTED: "lock.acquire_conflict_exhausted";
2632
+ readonly LOCK_NOT_FOUND: "lock.not_found";
2633
+ readonly LOCK_RELEASE_CONFLICT_EXHAUSTED: "lock.release_conflict_exhausted";
2634
+ readonly LOCK_STALE_RELEASE_CONFLICT_EXHAUSTED: "lock.stale_release_conflict_exhausted";
2635
+ readonly HOOK_TOKEN_INVALID: "hook.token_invalid";
2636
+ readonly WEBHOOK_TOKEN_INVALID: "webhook.token_invalid";
2637
+ readonly HOOK_TOKEN_NOT_UNIQUE: "hook.token_not_unique";
2638
+ readonly HOOK_WAITING_STEP_MISSING: "hook.waiting_step_missing";
2639
+ }>>;
2640
+ name: z.ZodString;
2641
+ message: z.ZodString;
2642
+ stack: z.ZodOptional<z.ZodString>;
2643
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
2644
+ }, z.core.$loose>;
2645
+ }, z.core.$strip>, z.ZodObject<{
2646
+ timestamp: z.ZodCustom<Temporal.Instant, Temporal.Instant>;
2647
+ stepId: z.ZodString;
2648
+ stepName: z.ZodString;
2649
+ count: z.ZodNumber;
2650
+ kind: z.ZodLiteral<"deterministic_value_recorded">;
2651
+ value: z.ZodType<StorageValue, unknown, z.core.$ZodTypeInternals<StorageValue, unknown>>;
2652
+ }, z.core.$strip>], "kind">>;
2653
+ /** Type used for workflow message sent event payloads. */
2654
+ type MessageSentPayload = StorageValue;
2655
+ /** Type used for workflow stream failure event errors. */
2656
+ type StreamFailedError = WorkflowErrorRecord;
2657
+ /** Discriminant values for every durable workflow event record. */
2658
+ type EventKind = WorkflowRunEventKind | WorkflowStepEventKind | SleepEventKind | ChildWorkflowEventKind | MessageEventKind | StreamEventKind | DataEventKind | DeterministicEventKind;
2659
+ /** Metadata describing how an event participates in cleanup and step-attempt materialization. */
2660
+ interface EventDescriptor {
2661
+ readonly kind: EventKind;
2662
+ readonly category: EventDescriptorCategory;
2663
+ readonly cleanup: boolean;
2664
+ readonly stepType?: WorkflowStepType;
2665
+ readonly stepAttempt?: EventDescriptorStepAttempt;
2666
+ readonly terminalStepAttempt?: boolean;
2667
+ readonly startedEventType?: EventKind;
2668
+ readonly startedEventMatchFields?: readonly string[];
2669
+ readonly identityFields?: readonly string[];
2670
+ readonly valueIdentityFields?: readonly string[];
2671
+ readonly stringListIdentityFields?: readonly string[];
2672
+ }
2673
+ /** Event descriptor category values. */
2674
+ type EventDescriptorCategory = "workflow" | "step" | "sleep" | "child_workflow" | "message" | "stream" | "deterministic" | "metadata";
2675
+ /** How an event maps to a materialized step attempt. */
2676
+ type EventDescriptorStepAttempt = "event" | "single";
2677
+ /** Event kinds emitted for workflow lifecycle transitions. */
2678
+ type WorkflowRunEventKind = "workflow_started" | "workflow_completed" | "workflow_failed";
2679
+ /** Event kinds emitted for durable task attempts. */
2680
+ type WorkflowStepEventKind = "step_started" | "step_completed" | "step_failed";
2681
+ /** Event kinds emitted for durable sleeps. */
2682
+ type SleepEventKind = "sleep_started" | "sleep_completed";
2683
+ /** Event kinds emitted while starting and observing child workflows. */
2684
+ type ChildWorkflowEventKind = "child_workflow_started" | "child_workflow_completed" | "child_workflow_failed";
2685
+ /** Event kinds emitted for message sends and waits. */
2686
+ type MessageEventKind = "message_sent" | "message_send_started" | "message_send_completed" | "message_send_failed" | "message_wait_started" | "message_wait_completed" | "message_wait_failed";
2687
+ /** Event kinds emitted for durable workflow streams. */
2688
+ type StreamEventKind = "stream_started" | "stream_chunk" | "stream_closed" | "stream_failed";
2689
+ /** Event kinds emitted when workflow metadata or attributes change. */
2690
+ type DataEventKind = "metadata_set" | "attributes_set";
2691
+ /** Event kind emitted when a deterministic value is recorded for replay. */
2692
+ type DeterministicEventKind = "deterministic_value_recorded";
2693
+ /** Union of all persisted workflow event records. */
2694
+ type EventRecord = WorkflowStartedEvent | WorkflowCompletedEvent | WorkflowFailedEvent | WorkflowStepStartedEvent | WorkflowStepCompletedEvent | WorkflowStepFailedEvent | SleepStartedEvent | SleepCompletedEvent | ChildWorkflowStartedEvent | ChildWorkflowCompletedEvent | ChildWorkflowFailedEvent | MessageSentEvent | MessageSendStartedEvent | MessageSendCompletedEvent | MessageSendFailedEvent | MessageWaitStartedEvent | MessageWaitCompletedEvent | MessageWaitFailedEvent | MetadataSetEvent | AttributesSetEvent | StreamStartedEvent | StreamChunkEvent | StreamClosedEvent | StreamFailedEvent | DeterministicValueRecordedEvent;
2695
+ /** Workflow event record narrowed by a workflow event kind. */
2696
+ type WorkflowEvent = Extract<EventRecord, {
2697
+ readonly kind: EventKind;
2698
+ }>;
2699
+ /** Workflow lifecycle event record. */
2700
+ type WorkflowRunEvent = Extract<EventRecord, {
2701
+ readonly kind: WorkflowRunEventKind;
2702
+ }>;
2703
+ /** Event recorded when a durable task attempt starts. */
2704
+ interface WorkflowStepStartedEvent extends WorkflowCountedAttemptedStepEvent {
2705
+ readonly kind: "step_started";
2706
+ readonly timeoutAt?: Temporal.Instant;
2707
+ }
2708
+ /** Event recorded when a durable task attempt completes. */
2709
+ interface WorkflowStepCompletedEvent extends WorkflowAttemptedStepEvent {
2710
+ readonly kind: "step_completed";
2711
+ readonly result?: StorageValue;
2712
+ }
2713
+ /** Event recorded when a durable task attempt fails. */
2714
+ interface WorkflowStepFailedEvent extends WorkflowAttemptedStepEvent {
2715
+ readonly kind: "step_failed";
2716
+ readonly error: WorkflowErrorRecord;
2717
+ }
2718
+ /** Event recorded when a durable sleep starts. */
2719
+ interface SleepStartedEvent extends WorkflowCountedStepEvent {
2720
+ readonly kind: "sleep_started";
2721
+ readonly until: Temporal.Instant;
2722
+ readonly duration?: Temporal.Duration;
2723
+ }
2724
+ /** Event recorded when a durable sleep completes. */
2725
+ interface SleepCompletedEvent extends WorkflowStepEvent {
2726
+ readonly kind: "sleep_completed";
2727
+ }
2728
+ /** Event recorded when a child workflow is started. */
2729
+ interface ChildWorkflowStartedEvent extends WorkflowCountedAttemptedStepEvent {
2730
+ readonly kind: "child_workflow_started";
2731
+ readonly childRunId: RunId;
2732
+ readonly workflowName: string;
2733
+ readonly workflowVersion?: string;
2734
+ readonly cancellation?: WorkflowChildWorkflowCancellationPolicy;
2735
+ readonly input?: StorageValue;
2736
+ readonly idempotencyKey?: string;
2737
+ readonly timeoutAt?: Temporal.Instant;
2738
+ }
2739
+ /** Event recorded when a child workflow completes. */
2740
+ interface ChildWorkflowCompletedEvent extends WorkflowAttemptedStepEvent {
2741
+ readonly kind: "child_workflow_completed";
2742
+ readonly childRunId: RunId;
2743
+ readonly result?: StorageValue;
2744
+ }
2745
+ /** Event recorded when a child workflow fails. */
2746
+ interface ChildWorkflowFailedEvent extends WorkflowAttemptedStepEvent {
2747
+ readonly kind: "child_workflow_failed";
2748
+ readonly childRunId: RunId;
2749
+ readonly error: WorkflowErrorRecord;
2750
+ }
2751
+ /** Event recorded when an external messageId is accepted for a run. */
2752
+ interface MessageSentEvent extends WorkflowTimestampedEvent {
2753
+ readonly kind: "message_sent";
2754
+ readonly messageId: MessageId;
2755
+ readonly payload?: MessageSentPayload;
2756
+ readonly waiterStepIds?: readonly StepId[];
2757
+ readonly idempotencyKey?: string;
2758
+ readonly telemetryContext?: TelemetryContext;
2759
+ }
2760
+ /** Event recorded when a workflow starts sending a messageId to another run. */
2761
+ interface MessageSendStartedEvent extends WorkflowCountedStepEvent {
2762
+ readonly kind: "message_send_started";
2763
+ readonly targetRunId: RunId;
2764
+ readonly messageId: MessageId;
2765
+ readonly payload?: StorageValue;
2766
+ readonly idempotencyKey?: string;
2767
+ }
2768
+ /** Event recorded when a workflow message send completes. */
2769
+ interface MessageSendCompletedEvent extends WorkflowStepEvent {
2770
+ readonly kind: "message_send_completed";
2771
+ readonly targetRunId: RunId;
2772
+ readonly messageId: MessageId;
2773
+ }
2774
+ /** Event recorded when a workflow message send fails. */
2775
+ interface MessageSendFailedEvent extends WorkflowStepEvent {
2776
+ readonly kind: "message_send_failed";
2777
+ readonly targetRunId: RunId;
2778
+ readonly messageId: MessageId;
2779
+ readonly error: WorkflowErrorRecord;
2780
+ }
2781
+ /** Event recorded when a workflow starts waiting for a messageId. */
2782
+ interface MessageWaitStartedEvent extends WorkflowCountedStepEvent {
2783
+ readonly kind: "message_wait_started";
2784
+ readonly messageId: MessageId;
2785
+ readonly source?: MessageWaitSource;
2786
+ readonly timeoutAt?: Temporal.Instant;
2787
+ }
2788
+ /** Event recorded when a waiting workflow receives a messageId. */
2789
+ interface MessageWaitCompletedEvent extends WorkflowStepEvent {
2790
+ readonly kind: "message_wait_completed";
2791
+ readonly messageId: MessageId;
2792
+ readonly payload?: StorageValue;
2793
+ readonly messageTimestamp: Temporal.Instant;
2794
+ readonly telemetryContext?: TelemetryContext;
2795
+ }
2796
+ /** Event recorded when a message wait fails or times out. */
2797
+ interface MessageWaitFailedEvent extends WorkflowStepEvent {
2798
+ readonly kind: "message_wait_failed";
2799
+ readonly messageId: MessageId;
2800
+ readonly error: WorkflowErrorRecord;
2801
+ }
2802
+ /** Event recorded when workflow run metadata is replaced. */
2803
+ interface MetadataSetEvent extends WorkflowCountedStepEvent {
2804
+ readonly kind: "metadata_set";
2805
+ readonly metadata: StorageValue;
2806
+ }
2807
+ /** Event recorded when workflow run attributes are patched. */
2808
+ interface AttributesSetEvent extends WorkflowCountedStepEvent {
2809
+ readonly kind: "attributes_set";
2810
+ readonly attributes?: Readonly<Record<string, WorkflowAttributeValue>>;
2811
+ readonly removeAttributes?: readonly string[];
2812
+ }
2813
+ /** Event recorded when a durable stream is opened. */
2814
+ interface StreamStartedEvent extends WorkflowCountedStepEvent {
2815
+ readonly kind: "stream_started";
2816
+ readonly streamId: StreamId;
2817
+ readonly contentType?: string;
2818
+ readonly metadata?: StorageValue;
2819
+ }
2820
+ /** Event recorded for a durable stream chunk. */
2821
+ interface StreamChunkEvent extends WorkflowStepEvent {
2822
+ readonly kind: "stream_chunk";
2823
+ readonly streamId: StreamId;
2824
+ readonly index: number;
2825
+ readonly chunk?: StorageValue;
2826
+ }
2827
+ /** Event recorded when a durable stream closes normally. */
2828
+ interface StreamClosedEvent extends WorkflowStepEvent {
2829
+ readonly kind: "stream_closed";
2830
+ readonly streamId: StreamId;
2831
+ }
2832
+ /** Event recorded when a durable stream fails. */
2833
+ interface StreamFailedEvent extends WorkflowStepEvent {
2834
+ readonly kind: "stream_failed";
2835
+ readonly streamId: StreamId;
2836
+ readonly error: StreamFailedError;
2837
+ }
2838
+ /** Event recorded when a replay-safe value is captured for deterministic reuse. */
2839
+ interface DeterministicValueRecordedEvent extends WorkflowCountedStepEvent {
2840
+ readonly kind: "deterministic_value_recorded";
2841
+ readonly value: StorageValue;
2842
+ }
2843
+ /** Source that resumed a workflow message wait. */
2844
+ type MessageWaitSource = "hook" | "webhook";
2845
+ interface WorkflowTimestampedEvent {
2846
+ readonly timestamp: Temporal.Instant;
2847
+ }
2848
+ interface WorkflowStartedEvent extends WorkflowTimestampedEvent {
2849
+ readonly kind: "workflow_started";
2850
+ }
2851
+ interface WorkflowCompletedEvent extends WorkflowTimestampedEvent {
2852
+ readonly kind: "workflow_completed";
2853
+ }
2854
+ interface WorkflowFailedEvent extends WorkflowTimestampedEvent {
2855
+ readonly kind: "workflow_failed";
2856
+ }
2857
+ interface WorkflowStepEvent extends WorkflowTimestampedEvent {
2858
+ readonly stepId: StepId;
2859
+ readonly stepName: string;
2860
+ }
2861
+ interface WorkflowCountedStepEvent extends WorkflowStepEvent {
2862
+ readonly count: number;
2863
+ }
2864
+ interface WorkflowAttemptedStepEvent extends WorkflowStepEvent {
2865
+ readonly attempt: number;
2866
+ }
2867
+ interface WorkflowCountedAttemptedStepEvent extends WorkflowCountedStepEvent, WorkflowAttemptedStepEvent {}
2868
+ //#endregion
2869
+ export { AttributesSetEvent, ChildWorkflowCompletedEvent, ChildWorkflowEventKind, ChildWorkflowFailedEvent, ChildWorkflowStartedEvent, DataEventKind, DeterministicEventKind, DeterministicValueRecordedEvent, EventDescriptor, EventDescriptorCategory, EventDescriptorStepAttempt, EventKind, EventRecord, MessageEventKind, MessageSendCompletedEvent, MessageSendFailedEvent, MessageSendStartedEvent, MessageSentEvent, MessageSentPayload, MessageWaitCompletedEvent, MessageWaitFailedEvent, MessageWaitSource, MessageWaitStartedEvent, MetadataSetEvent, SleepCompletedEvent, SleepEventKind, SleepStartedEvent, StreamChunkEvent, StreamClosedEvent, StreamEventKind, StreamFailedError, StreamFailedEvent, StreamStartedEvent, WorkflowEvent, WorkflowRunEvent, WorkflowRunEventKind, WorkflowStepCompletedEvent, WorkflowStepEventKind, WorkflowStepFailedEvent, WorkflowStepStartedEvent, workflowAttributesSetEventSchema, workflowChildWorkflowCompletedEventSchema, workflowChildWorkflowEventKindSchema, workflowChildWorkflowFailedEventSchema, workflowChildWorkflowStartedEventSchema, workflowCompletedEventSchema, workflowDataEventKindSchema, workflowDeterministicEventKindSchema, workflowDeterministicValueRecordedEventSchema, workflowEventKindSchema, workflowEventRecordListSchema, workflowEventRecordSchema, workflowFailedEventSchema, workflowMessageEventKindSchema, workflowMessageSendCompletedEventSchema, workflowMessageSendFailedEventSchema, workflowMessageSendStartedEventSchema, workflowMessageSentEventSchema, workflowMessageWaitCompletedEventSchema, workflowMessageWaitFailedEventSchema, workflowMessageWaitSourceSchema, workflowMessageWaitStartedEventSchema, workflowMessageWaiterStepIdsSchema, workflowMetadataSetEventSchema, workflowRunEventKindSchema, workflowSleepCompletedEventSchema, workflowSleepEventKindSchema, workflowSleepStartedEventSchema, workflowStartedEventSchema, workflowStepCompletedEventSchema, workflowStepEventKindSchema, workflowStepFailedEventSchema, workflowStepStartedEventSchema, workflowStreamChunkEventSchema, workflowStreamClosedEventSchema, workflowStreamEventKindSchema, workflowStreamFailedEventSchema, workflowStreamStartedEventSchema };