@smthrs/flow 0.0.0-stage → 1.0.0-rc.3

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 (654) hide show
  1. package/CHANGELOG.md +160 -0
  2. package/LICENSE +21 -0
  3. package/README.md +210 -2
  4. package/THIRD_PARTY_NOTICES.md +52 -0
  5. package/dist/cjs/Action/Action.d.ts +250 -0
  6. package/dist/cjs/Action/Action.d.ts.map +1 -0
  7. package/dist/cjs/Action/Action.js +42 -0
  8. package/dist/cjs/Action/Action.js.map +7 -0
  9. package/dist/cjs/Action/AttemptTimedOut.d.ts +33 -0
  10. package/dist/cjs/Action/AttemptTimedOut.d.ts.map +1 -0
  11. package/dist/cjs/Action/AttemptTimedOut.js +51 -0
  12. package/dist/cjs/Action/AttemptTimedOut.js.map +7 -0
  13. package/dist/cjs/Action/BoundaryMode.d.ts +29 -0
  14. package/dist/cjs/Action/BoundaryMode.d.ts.map +1 -0
  15. package/dist/cjs/Action/BoundaryMode.js +36 -0
  16. package/dist/cjs/Action/BoundaryMode.js.map +7 -0
  17. package/dist/cjs/Action/CacheEnvironment.d.ts +158 -0
  18. package/dist/cjs/Action/CacheEnvironment.d.ts.map +1 -0
  19. package/dist/cjs/Action/CacheEnvironment.js +57 -0
  20. package/dist/cjs/Action/CacheEnvironment.js.map +7 -0
  21. package/dist/cjs/Action/ConcurrentKeylessDispatch.d.ts +34 -0
  22. package/dist/cjs/Action/ConcurrentKeylessDispatch.d.ts.map +1 -0
  23. package/dist/cjs/Action/ConcurrentKeylessDispatch.js +46 -0
  24. package/dist/cjs/Action/ConcurrentKeylessDispatch.js.map +7 -0
  25. package/dist/cjs/Action/Context.d.ts +131 -0
  26. package/dist/cjs/Action/Context.d.ts.map +1 -0
  27. package/dist/cjs/Action/Context.js +68 -0
  28. package/dist/cjs/Action/Context.js.map +7 -0
  29. package/dist/cjs/Action/DuplicateImplementation.d.ts +20 -0
  30. package/dist/cjs/Action/DuplicateImplementation.d.ts.map +1 -0
  31. package/dist/cjs/Action/DuplicateImplementation.js +46 -0
  32. package/dist/cjs/Action/DuplicateImplementation.js.map +7 -0
  33. package/dist/cjs/Action/FileBoundary.d.ts +59 -0
  34. package/dist/cjs/Action/FileBoundary.d.ts.map +1 -0
  35. package/dist/cjs/Action/FileBoundary.js +81 -0
  36. package/dist/cjs/Action/FileBoundary.js.map +7 -0
  37. package/dist/cjs/Action/FileInput.d.ts +28 -0
  38. package/dist/cjs/Action/FileInput.d.ts.map +1 -0
  39. package/dist/cjs/Action/FileInput.js +42 -0
  40. package/dist/cjs/Action/FileInput.js.map +7 -0
  41. package/dist/cjs/Action/Filegroup.d.ts +16 -0
  42. package/dist/cjs/Action/Filegroup.d.ts.map +1 -0
  43. package/dist/cjs/Action/Filegroup.js +27 -0
  44. package/dist/cjs/Action/Filegroup.js.map +7 -0
  45. package/dist/cjs/Action/Glob.d.ts +8 -0
  46. package/dist/cjs/Action/Glob.d.ts.map +1 -0
  47. package/dist/cjs/Action/Glob.js +28 -0
  48. package/dist/cjs/Action/Glob.js.map +7 -0
  49. package/dist/cjs/Action/ImplementationVersionMismatch.d.ts +26 -0
  50. package/dist/cjs/Action/ImplementationVersionMismatch.d.ts.map +1 -0
  51. package/dist/cjs/Action/ImplementationVersionMismatch.js +45 -0
  52. package/dist/cjs/Action/ImplementationVersionMismatch.js.map +7 -0
  53. package/dist/cjs/Action/Implementations.d.ts +114 -0
  54. package/dist/cjs/Action/Implementations.d.ts.map +1 -0
  55. package/dist/cjs/Action/Implementations.js +65 -0
  56. package/dist/cjs/Action/Implementations.js.map +7 -0
  57. package/dist/cjs/Action/InfraInterrupt.d.ts +26 -0
  58. package/dist/cjs/Action/InfraInterrupt.d.ts.map +1 -0
  59. package/dist/cjs/Action/InfraInterrupt.js +46 -0
  60. package/dist/cjs/Action/InfraInterrupt.js.map +7 -0
  61. package/dist/cjs/Action/InfraInterruptRetriesExhausted.d.ts +33 -0
  62. package/dist/cjs/Action/InfraInterruptRetriesExhausted.d.ts.map +1 -0
  63. package/dist/cjs/Action/InfraInterruptRetriesExhausted.js +54 -0
  64. package/dist/cjs/Action/InfraInterruptRetriesExhausted.js.map +7 -0
  65. package/dist/cjs/Action/IrreversibleRetryRequiresIdempotencyKey.d.ts +26 -0
  66. package/dist/cjs/Action/IrreversibleRetryRequiresIdempotencyKey.d.ts.map +1 -0
  67. package/dist/cjs/Action/IrreversibleRetryRequiresIdempotencyKey.js +47 -0
  68. package/dist/cjs/Action/IrreversibleRetryRequiresIdempotencyKey.js.map +7 -0
  69. package/dist/cjs/Action/StepIdentity.d.ts +153 -0
  70. package/dist/cjs/Action/StepIdentity.d.ts.map +1 -0
  71. package/dist/cjs/Action/StepIdentity.js +75 -0
  72. package/dist/cjs/Action/StepIdentity.js.map +7 -0
  73. package/dist/cjs/Action/TreeArtifact.d.ts +8 -0
  74. package/dist/cjs/Action/TreeArtifact.d.ts.map +1 -0
  75. package/dist/cjs/Action/TreeArtifact.js +25 -0
  76. package/dist/cjs/Action/TreeArtifact.js.map +7 -0
  77. package/dist/cjs/Action/TypeId.d.ts +8 -0
  78. package/dist/cjs/Action/TypeId.d.ts.map +1 -0
  79. package/dist/cjs/Action/TypeId.js +25 -0
  80. package/dist/cjs/Action/TypeId.js.map +7 -0
  81. package/dist/cjs/Action/UncanonicalIdempotencyKey.d.ts +32 -0
  82. package/dist/cjs/Action/UncanonicalIdempotencyKey.d.ts.map +1 -0
  83. package/dist/cjs/Action/UncanonicalIdempotencyKey.js +51 -0
  84. package/dist/cjs/Action/UncanonicalIdempotencyKey.js.map +7 -0
  85. package/dist/cjs/Action/idempotencyKey.d.ts +21 -0
  86. package/dist/cjs/Action/idempotencyKey.d.ts.map +1 -0
  87. package/dist/cjs/Action/idempotencyKey.js +59 -0
  88. package/dist/cjs/Action/idempotencyKey.js.map +7 -0
  89. package/dist/cjs/Action/index.d.ts +29 -0
  90. package/dist/cjs/Action/index.d.ts.map +1 -0
  91. package/dist/cjs/Action/index.js +60 -0
  92. package/dist/cjs/Action/index.js.map +7 -0
  93. package/dist/cjs/Action/make.d.ts +128 -0
  94. package/dist/cjs/Action/make.d.ts.map +1 -0
  95. package/dist/cjs/Action/make.js +373 -0
  96. package/dist/cjs/Action/make.js.map +7 -0
  97. package/dist/cjs/Action/raceAll.d.ts +21 -0
  98. package/dist/cjs/Action/raceAll.d.ts.map +1 -0
  99. package/dist/cjs/Action/raceAll.js +46 -0
  100. package/dist/cjs/Action/raceAll.js.map +7 -0
  101. package/dist/cjs/Action/retry.d.ts +19 -0
  102. package/dist/cjs/Action/retry.d.ts.map +1 -0
  103. package/dist/cjs/Action/retry.js +75 -0
  104. package/dist/cjs/Action/retry.js.map +7 -0
  105. package/dist/cjs/Deadline.d.ts +105 -0
  106. package/dist/cjs/Deadline.d.ts.map +1 -0
  107. package/dist/cjs/Deadline.js +104 -0
  108. package/dist/cjs/Deadline.js.map +7 -0
  109. package/dist/cjs/DurableClock.d.ts +61 -0
  110. package/dist/cjs/DurableClock.d.ts.map +1 -0
  111. package/dist/cjs/DurableClock.js +90 -0
  112. package/dist/cjs/DurableClock.js.map +7 -0
  113. package/dist/cjs/DurableDeferred.d.ts +311 -0
  114. package/dist/cjs/DurableDeferred.d.ts.map +1 -0
  115. package/dist/cjs/DurableDeferred.js +322 -0
  116. package/dist/cjs/DurableDeferred.js.map +7 -0
  117. package/dist/cjs/DurableQueue.d.ts +160 -0
  118. package/dist/cjs/DurableQueue.d.ts.map +1 -0
  119. package/dist/cjs/DurableQueue.js +229 -0
  120. package/dist/cjs/DurableQueue.js.map +7 -0
  121. package/dist/cjs/ExternalJob.d.ts +179 -0
  122. package/dist/cjs/ExternalJob.d.ts.map +1 -0
  123. package/dist/cjs/ExternalJob.js +338 -0
  124. package/dist/cjs/ExternalJob.js.map +7 -0
  125. package/dist/cjs/Fault.d.ts +131 -0
  126. package/dist/cjs/Fault.d.ts.map +1 -0
  127. package/dist/cjs/Fault.js +157 -0
  128. package/dist/cjs/Fault.js.map +7 -0
  129. package/dist/cjs/Flow/Annotations.d.ts +245 -0
  130. package/dist/cjs/Flow/Annotations.d.ts.map +1 -0
  131. package/dist/cjs/Flow/Annotations.js +72 -0
  132. package/dist/cjs/Flow/Annotations.js.map +7 -0
  133. package/dist/cjs/Flow/CapabilityCeiling.d.ts +21 -0
  134. package/dist/cjs/Flow/CapabilityCeiling.d.ts.map +1 -0
  135. package/dist/cjs/Flow/CapabilityCeiling.js +49 -0
  136. package/dist/cjs/Flow/CapabilityCeiling.js.map +7 -0
  137. package/dist/cjs/Flow/DeadlineExceeded.d.ts +33 -0
  138. package/dist/cjs/Flow/DeadlineExceeded.d.ts.map +1 -0
  139. package/dist/cjs/Flow/DeadlineExceeded.js +52 -0
  140. package/dist/cjs/Flow/DeadlineExceeded.js.map +7 -0
  141. package/dist/cjs/Flow/ExecutionIdRequired.d.ts +25 -0
  142. package/dist/cjs/Flow/ExecutionIdRequired.d.ts.map +1 -0
  143. package/dist/cjs/Flow/ExecutionIdRequired.js +46 -0
  144. package/dist/cjs/Flow/ExecutionIdRequired.js.map +7 -0
  145. package/dist/cjs/Flow/ExecutionIds.d.ts +80 -0
  146. package/dist/cjs/Flow/ExecutionIds.d.ts.map +1 -0
  147. package/dist/cjs/Flow/ExecutionIds.js +66 -0
  148. package/dist/cjs/Flow/ExecutionIds.js.map +7 -0
  149. package/dist/cjs/Flow/Flow.d.ts +422 -0
  150. package/dist/cjs/Flow/Flow.d.ts.map +1 -0
  151. package/dist/cjs/Flow/Flow.js +17 -0
  152. package/dist/cjs/Flow/Flow.js.map +7 -0
  153. package/dist/cjs/Flow/MaxRoundsExceeded.d.ts +35 -0
  154. package/dist/cjs/Flow/MaxRoundsExceeded.d.ts.map +1 -0
  155. package/dist/cjs/Flow/MaxRoundsExceeded.js +50 -0
  156. package/dist/cjs/Flow/MaxRoundsExceeded.js.map +7 -0
  157. package/dist/cjs/Flow/Outcome.d.ts +162 -0
  158. package/dist/cjs/Flow/Outcome.d.ts.map +1 -0
  159. package/dist/cjs/Flow/Outcome.js +80 -0
  160. package/dist/cjs/Flow/Outcome.js.map +7 -0
  161. package/dist/cjs/Flow/Result.d.ts +186 -0
  162. package/dist/cjs/Flow/Result.d.ts.map +1 -0
  163. package/dist/cjs/Flow/Result.js +159 -0
  164. package/dist/cjs/Flow/Result.js.map +7 -0
  165. package/dist/cjs/Flow/Runtime.d.ts +98 -0
  166. package/dist/cjs/Flow/Runtime.d.ts.map +1 -0
  167. package/dist/cjs/Flow/Runtime.js +160 -0
  168. package/dist/cjs/Flow/Runtime.js.map +7 -0
  169. package/dist/cjs/Flow/TypeId.d.ts +8 -0
  170. package/dist/cjs/Flow/TypeId.d.ts.map +1 -0
  171. package/dist/cjs/Flow/TypeId.js +25 -0
  172. package/dist/cjs/Flow/TypeId.js.map +7 -0
  173. package/dist/cjs/Flow/index.d.ts +17 -0
  174. package/dist/cjs/Flow/index.d.ts.map +1 -0
  175. package/dist/cjs/Flow/index.js +29 -0
  176. package/dist/cjs/Flow/index.js.map +7 -0
  177. package/dist/cjs/Flow/internal.d.ts +34 -0
  178. package/dist/cjs/Flow/internal.d.ts.map +1 -0
  179. package/dist/cjs/Flow/internal.js +187 -0
  180. package/dist/cjs/Flow/internal.js.map +7 -0
  181. package/dist/cjs/Flow/make.d.ts +134 -0
  182. package/dist/cjs/Flow/make.d.ts.map +1 -0
  183. package/dist/cjs/Flow/make.js +104 -0
  184. package/dist/cjs/Flow/make.js.map +7 -0
  185. package/dist/cjs/FlowRuntime/CancelRequestFailed.d.ts +55 -0
  186. package/dist/cjs/FlowRuntime/CancelRequestFailed.d.ts.map +1 -0
  187. package/dist/cjs/FlowRuntime/CancelRequestFailed.js +51 -0
  188. package/dist/cjs/FlowRuntime/CancelRequestFailed.js.map +7 -0
  189. package/dist/cjs/FlowRuntime/ExecutionIdentityConflict.d.ts +23 -0
  190. package/dist/cjs/FlowRuntime/ExecutionIdentityConflict.d.ts.map +1 -0
  191. package/dist/cjs/FlowRuntime/ExecutionIdentityConflict.js +55 -0
  192. package/dist/cjs/FlowRuntime/ExecutionIdentityConflict.js.map +7 -0
  193. package/dist/cjs/FlowRuntime/FlowCycleDetected.d.ts +28 -0
  194. package/dist/cjs/FlowRuntime/FlowCycleDetected.d.ts.map +1 -0
  195. package/dist/cjs/FlowRuntime/FlowCycleDetected.js +49 -0
  196. package/dist/cjs/FlowRuntime/FlowCycleDetected.js.map +7 -0
  197. package/dist/cjs/FlowRuntime/FlowExecutionNotFound.d.ts +38 -0
  198. package/dist/cjs/FlowRuntime/FlowExecutionNotFound.d.ts.map +1 -0
  199. package/dist/cjs/FlowRuntime/FlowExecutionNotFound.js +53 -0
  200. package/dist/cjs/FlowRuntime/FlowExecutionNotFound.js.map +7 -0
  201. package/dist/cjs/FlowRuntime/FlowInstance.d.ts +115 -0
  202. package/dist/cjs/FlowRuntime/FlowInstance.d.ts.map +1 -0
  203. package/dist/cjs/FlowRuntime/FlowInstance.js +37 -0
  204. package/dist/cjs/FlowRuntime/FlowInstance.js.map +7 -0
  205. package/dist/cjs/FlowRuntime/FlowRuntime.d.ts +198 -0
  206. package/dist/cjs/FlowRuntime/FlowRuntime.d.ts.map +1 -0
  207. package/dist/cjs/FlowRuntime/FlowRuntime.js +37 -0
  208. package/dist/cjs/FlowRuntime/FlowRuntime.js.map +7 -0
  209. package/dist/cjs/FlowRuntime/NodeRecord.d.ts +175 -0
  210. package/dist/cjs/FlowRuntime/NodeRecord.d.ts.map +1 -0
  211. package/dist/cjs/FlowRuntime/NodeRecord.js +17 -0
  212. package/dist/cjs/FlowRuntime/NodeRecord.js.map +7 -0
  213. package/dist/cjs/FlowRuntime/WaitingAnnotation.d.ts +69 -0
  214. package/dist/cjs/FlowRuntime/WaitingAnnotation.d.ts.map +1 -0
  215. package/dist/cjs/FlowRuntime/WaitingAnnotation.js +53 -0
  216. package/dist/cjs/FlowRuntime/WaitingAnnotation.js.map +7 -0
  217. package/dist/cjs/FlowRuntime/index.d.ts +14 -0
  218. package/dist/cjs/FlowRuntime/index.d.ts.map +1 -0
  219. package/dist/cjs/FlowRuntime/index.js +26 -0
  220. package/dist/cjs/FlowRuntime/index.js.map +7 -0
  221. package/dist/cjs/Graph.d.ts +325 -0
  222. package/dist/cjs/Graph.d.ts.map +1 -0
  223. package/dist/cjs/Graph.js +1022 -0
  224. package/dist/cjs/Graph.js.map +7 -0
  225. package/dist/cjs/HumanTask.d.ts +440 -0
  226. package/dist/cjs/HumanTask.d.ts.map +1 -0
  227. package/dist/cjs/HumanTask.js +413 -0
  228. package/dist/cjs/HumanTask.js.map +7 -0
  229. package/dist/cjs/Interpreter.d.ts +222 -0
  230. package/dist/cjs/Interpreter.d.ts.map +1 -0
  231. package/dist/cjs/Interpreter.js +888 -0
  232. package/dist/cjs/Interpreter.js.map +7 -0
  233. package/dist/cjs/Poll.d.ts +238 -0
  234. package/dist/cjs/Poll.d.ts.map +1 -0
  235. package/dist/cjs/Poll.js +150 -0
  236. package/dist/cjs/Poll.js.map +7 -0
  237. package/dist/cjs/RetryPolicy.d.ts +273 -0
  238. package/dist/cjs/RetryPolicy.d.ts.map +1 -0
  239. package/dist/cjs/RetryPolicy.js +251 -0
  240. package/dist/cjs/RetryPolicy.js.map +7 -0
  241. package/dist/cjs/Sleep.d.ts +98 -0
  242. package/dist/cjs/Sleep.d.ts.map +1 -0
  243. package/dist/cjs/Sleep.js +133 -0
  244. package/dist/cjs/Sleep.js.map +7 -0
  245. package/dist/cjs/Stall.d.ts +173 -0
  246. package/dist/cjs/Stall.d.ts.map +1 -0
  247. package/dist/cjs/Stall.js +92 -0
  248. package/dist/cjs/Stall.js.map +7 -0
  249. package/dist/cjs/WaitFor.d.ts +109 -0
  250. package/dist/cjs/WaitFor.d.ts.map +1 -0
  251. package/dist/cjs/WaitFor.js +117 -0
  252. package/dist/cjs/WaitFor.js.map +7 -0
  253. package/dist/cjs/index.d.ts +107 -0
  254. package/dist/cjs/index.d.ts.map +1 -0
  255. package/dist/cjs/index.js +69 -0
  256. package/dist/cjs/index.js.map +7 -0
  257. package/dist/cjs/internal/BoundedJson.d.ts +48 -0
  258. package/dist/cjs/internal/BoundedJson.d.ts.map +1 -0
  259. package/dist/cjs/internal/BoundedJson.js +96 -0
  260. package/dist/cjs/internal/BoundedJson.js.map +7 -0
  261. package/dist/cjs/internal/DeclarationSite.d.ts +135 -0
  262. package/dist/cjs/internal/DeclarationSite.d.ts.map +1 -0
  263. package/dist/cjs/internal/DeclarationSite.js +89 -0
  264. package/dist/cjs/internal/DeclarationSite.js.map +7 -0
  265. package/dist/cjs/internal/Declarations.d.ts +35 -0
  266. package/dist/cjs/internal/Declarations.d.ts.map +1 -0
  267. package/dist/cjs/internal/Declarations.js +50 -0
  268. package/dist/cjs/internal/Declarations.js.map +7 -0
  269. package/dist/cjs/internal/ExecutionMiddleware.d.ts +21 -0
  270. package/dist/cjs/internal/ExecutionMiddleware.d.ts.map +1 -0
  271. package/dist/cjs/internal/ExecutionMiddleware.js +39 -0
  272. package/dist/cjs/internal/ExecutionMiddleware.js.map +7 -0
  273. package/dist/cjs/internal/JsonSchemaSubset.d.ts +133 -0
  274. package/dist/cjs/internal/JsonSchemaSubset.d.ts.map +1 -0
  275. package/dist/cjs/internal/JsonSchemaSubset.js +229 -0
  276. package/dist/cjs/internal/JsonSchemaSubset.js.map +7 -0
  277. package/dist/cjs/internal/OutcomeMarker.d.ts +18 -0
  278. package/dist/cjs/internal/OutcomeMarker.d.ts.map +1 -0
  279. package/dist/cjs/internal/OutcomeMarker.js +27 -0
  280. package/dist/cjs/internal/OutcomeMarker.js.map +7 -0
  281. package/dist/cjs/package.json +1 -0
  282. package/dist/esm/Action/Action.d.ts +250 -0
  283. package/dist/esm/Action/Action.d.ts.map +1 -0
  284. package/dist/esm/Action/Action.js +30 -0
  285. package/dist/esm/Action/Action.js.map +1 -0
  286. package/dist/esm/Action/AttemptTimedOut.d.ts +33 -0
  287. package/dist/esm/Action/AttemptTimedOut.d.ts.map +1 -0
  288. package/dist/esm/Action/AttemptTimedOut.js +32 -0
  289. package/dist/esm/Action/AttemptTimedOut.js.map +1 -0
  290. package/dist/esm/Action/BoundaryMode.d.ts +29 -0
  291. package/dist/esm/Action/BoundaryMode.d.ts.map +1 -0
  292. package/dist/esm/Action/BoundaryMode.js +23 -0
  293. package/dist/esm/Action/BoundaryMode.js.map +1 -0
  294. package/dist/esm/Action/CacheEnvironment.d.ts +158 -0
  295. package/dist/esm/Action/CacheEnvironment.d.ts.map +1 -0
  296. package/dist/esm/Action/CacheEnvironment.js +130 -0
  297. package/dist/esm/Action/CacheEnvironment.js.map +1 -0
  298. package/dist/esm/Action/ConcurrentKeylessDispatch.d.ts +34 -0
  299. package/dist/esm/Action/ConcurrentKeylessDispatch.d.ts.map +1 -0
  300. package/dist/esm/Action/ConcurrentKeylessDispatch.js +33 -0
  301. package/dist/esm/Action/ConcurrentKeylessDispatch.js.map +1 -0
  302. package/dist/esm/Action/Context.d.ts +131 -0
  303. package/dist/esm/Action/Context.d.ts.map +1 -0
  304. package/dist/esm/Action/Context.js +99 -0
  305. package/dist/esm/Action/Context.js.map +1 -0
  306. package/dist/esm/Action/DuplicateImplementation.d.ts +20 -0
  307. package/dist/esm/Action/DuplicateImplementation.d.ts.map +1 -0
  308. package/dist/esm/Action/DuplicateImplementation.js +20 -0
  309. package/dist/esm/Action/DuplicateImplementation.js.map +1 -0
  310. package/dist/esm/Action/FileBoundary.d.ts +59 -0
  311. package/dist/esm/Action/FileBoundary.d.ts.map +1 -0
  312. package/dist/esm/Action/FileBoundary.js +60 -0
  313. package/dist/esm/Action/FileBoundary.js.map +1 -0
  314. package/dist/esm/Action/FileInput.d.ts +28 -0
  315. package/dist/esm/Action/FileInput.d.ts.map +1 -0
  316. package/dist/esm/Action/FileInput.js +32 -0
  317. package/dist/esm/Action/FileInput.js.map +1 -0
  318. package/dist/esm/Action/Filegroup.d.ts +16 -0
  319. package/dist/esm/Action/Filegroup.d.ts.map +1 -0
  320. package/dist/esm/Action/Filegroup.js +15 -0
  321. package/dist/esm/Action/Filegroup.js.map +1 -0
  322. package/dist/esm/Action/Glob.d.ts +8 -0
  323. package/dist/esm/Action/Glob.d.ts.map +1 -0
  324. package/dist/esm/Action/Glob.js +7 -0
  325. package/dist/esm/Action/Glob.js.map +1 -0
  326. package/dist/esm/Action/ImplementationVersionMismatch.d.ts +26 -0
  327. package/dist/esm/Action/ImplementationVersionMismatch.d.ts.map +1 -0
  328. package/dist/esm/Action/ImplementationVersionMismatch.js +24 -0
  329. package/dist/esm/Action/ImplementationVersionMismatch.js.map +1 -0
  330. package/dist/esm/Action/Implementations.d.ts +114 -0
  331. package/dist/esm/Action/Implementations.d.ts.map +1 -0
  332. package/dist/esm/Action/Implementations.js +94 -0
  333. package/dist/esm/Action/Implementations.js.map +1 -0
  334. package/dist/esm/Action/InfraInterrupt.d.ts +26 -0
  335. package/dist/esm/Action/InfraInterrupt.d.ts.map +1 -0
  336. package/dist/esm/Action/InfraInterrupt.js +25 -0
  337. package/dist/esm/Action/InfraInterrupt.js.map +1 -0
  338. package/dist/esm/Action/InfraInterruptRetriesExhausted.d.ts +33 -0
  339. package/dist/esm/Action/InfraInterruptRetriesExhausted.d.ts.map +1 -0
  340. package/dist/esm/Action/InfraInterruptRetriesExhausted.js +32 -0
  341. package/dist/esm/Action/InfraInterruptRetriesExhausted.js.map +1 -0
  342. package/dist/esm/Action/IrreversibleRetryRequiresIdempotencyKey.d.ts +26 -0
  343. package/dist/esm/Action/IrreversibleRetryRequiresIdempotencyKey.d.ts.map +1 -0
  344. package/dist/esm/Action/IrreversibleRetryRequiresIdempotencyKey.js +25 -0
  345. package/dist/esm/Action/IrreversibleRetryRequiresIdempotencyKey.js.map +1 -0
  346. package/dist/esm/Action/StepIdentity.d.ts +153 -0
  347. package/dist/esm/Action/StepIdentity.d.ts.map +1 -0
  348. package/dist/esm/Action/StepIdentity.js +139 -0
  349. package/dist/esm/Action/StepIdentity.js.map +1 -0
  350. package/dist/esm/Action/TreeArtifact.d.ts +8 -0
  351. package/dist/esm/Action/TreeArtifact.d.ts.map +1 -0
  352. package/dist/esm/Action/TreeArtifact.js +7 -0
  353. package/dist/esm/Action/TreeArtifact.js.map +1 -0
  354. package/dist/esm/Action/TypeId.d.ts +8 -0
  355. package/dist/esm/Action/TypeId.d.ts.map +1 -0
  356. package/dist/esm/Action/TypeId.js +9 -0
  357. package/dist/esm/Action/TypeId.js.map +1 -0
  358. package/dist/esm/Action/UncanonicalIdempotencyKey.d.ts +32 -0
  359. package/dist/esm/Action/UncanonicalIdempotencyKey.d.ts.map +1 -0
  360. package/dist/esm/Action/UncanonicalIdempotencyKey.js +31 -0
  361. package/dist/esm/Action/UncanonicalIdempotencyKey.js.map +1 -0
  362. package/dist/esm/Action/idempotencyKey.d.ts +21 -0
  363. package/dist/esm/Action/idempotencyKey.d.ts.map +1 -0
  364. package/dist/esm/Action/idempotencyKey.js +50 -0
  365. package/dist/esm/Action/idempotencyKey.js.map +1 -0
  366. package/dist/esm/Action/index.d.ts +29 -0
  367. package/dist/esm/Action/index.d.ts.map +1 -0
  368. package/dist/esm/Action/index.js +30 -0
  369. package/dist/esm/Action/index.js.map +1 -0
  370. package/dist/esm/Action/make.d.ts +128 -0
  371. package/dist/esm/Action/make.d.ts.map +1 -0
  372. package/dist/esm/Action/make.js +405 -0
  373. package/dist/esm/Action/make.js.map +1 -0
  374. package/dist/esm/Action/raceAll.d.ts +21 -0
  375. package/dist/esm/Action/raceAll.d.ts.map +1 -0
  376. package/dist/esm/Action/raceAll.js +20 -0
  377. package/dist/esm/Action/raceAll.js.map +1 -0
  378. package/dist/esm/Action/retry.d.ts +19 -0
  379. package/dist/esm/Action/retry.d.ts.map +1 -0
  380. package/dist/esm/Action/retry.js +72 -0
  381. package/dist/esm/Action/retry.js.map +1 -0
  382. package/dist/esm/Deadline.d.ts +105 -0
  383. package/dist/esm/Deadline.d.ts.map +1 -0
  384. package/dist/esm/Deadline.js +152 -0
  385. package/dist/esm/Deadline.js.map +1 -0
  386. package/dist/esm/DurableClock.d.ts +61 -0
  387. package/dist/esm/DurableClock.d.ts.map +1 -0
  388. package/dist/esm/DurableClock.js +75 -0
  389. package/dist/esm/DurableClock.js.map +1 -0
  390. package/dist/esm/DurableDeferred.d.ts +311 -0
  391. package/dist/esm/DurableDeferred.d.ts.map +1 -0
  392. package/dist/esm/DurableDeferred.js +357 -0
  393. package/dist/esm/DurableDeferred.js.map +1 -0
  394. package/dist/esm/DurableQueue.d.ts +160 -0
  395. package/dist/esm/DurableQueue.d.ts.map +1 -0
  396. package/dist/esm/DurableQueue.js +303 -0
  397. package/dist/esm/DurableQueue.js.map +1 -0
  398. package/dist/esm/ExternalJob.d.ts +179 -0
  399. package/dist/esm/ExternalJob.d.ts.map +1 -0
  400. package/dist/esm/ExternalJob.js +296 -0
  401. package/dist/esm/ExternalJob.js.map +1 -0
  402. package/dist/esm/Fault.d.ts +131 -0
  403. package/dist/esm/Fault.d.ts.map +1 -0
  404. package/dist/esm/Fault.js +198 -0
  405. package/dist/esm/Fault.js.map +1 -0
  406. package/dist/esm/Flow/Annotations.d.ts +245 -0
  407. package/dist/esm/Flow/Annotations.d.ts.map +1 -0
  408. package/dist/esm/Flow/Annotations.js +110 -0
  409. package/dist/esm/Flow/Annotations.js.map +1 -0
  410. package/dist/esm/Flow/CapabilityCeiling.d.ts +21 -0
  411. package/dist/esm/Flow/CapabilityCeiling.d.ts.map +1 -0
  412. package/dist/esm/Flow/CapabilityCeiling.js +27 -0
  413. package/dist/esm/Flow/CapabilityCeiling.js.map +1 -0
  414. package/dist/esm/Flow/DeadlineExceeded.d.ts +33 -0
  415. package/dist/esm/Flow/DeadlineExceeded.d.ts.map +1 -0
  416. package/dist/esm/Flow/DeadlineExceeded.js +34 -0
  417. package/dist/esm/Flow/DeadlineExceeded.js.map +1 -0
  418. package/dist/esm/Flow/ExecutionIdRequired.d.ts +25 -0
  419. package/dist/esm/Flow/ExecutionIdRequired.d.ts.map +1 -0
  420. package/dist/esm/Flow/ExecutionIdRequired.js +30 -0
  421. package/dist/esm/Flow/ExecutionIdRequired.js.map +1 -0
  422. package/dist/esm/Flow/ExecutionIds.d.ts +80 -0
  423. package/dist/esm/Flow/ExecutionIds.d.ts.map +1 -0
  424. package/dist/esm/Flow/ExecutionIds.js +91 -0
  425. package/dist/esm/Flow/ExecutionIds.js.map +1 -0
  426. package/dist/esm/Flow/Flow.d.ts +422 -0
  427. package/dist/esm/Flow/Flow.d.ts.map +1 -0
  428. package/dist/esm/Flow/Flow.js +3 -0
  429. package/dist/esm/Flow/Flow.js.map +1 -0
  430. package/dist/esm/Flow/MaxRoundsExceeded.d.ts +35 -0
  431. package/dist/esm/Flow/MaxRoundsExceeded.d.ts.map +1 -0
  432. package/dist/esm/Flow/MaxRoundsExceeded.js +34 -0
  433. package/dist/esm/Flow/MaxRoundsExceeded.js.map +1 -0
  434. package/dist/esm/Flow/Outcome.d.ts +162 -0
  435. package/dist/esm/Flow/Outcome.d.ts.map +1 -0
  436. package/dist/esm/Flow/Outcome.js +115 -0
  437. package/dist/esm/Flow/Outcome.js.map +1 -0
  438. package/dist/esm/Flow/Result.d.ts +186 -0
  439. package/dist/esm/Flow/Result.d.ts.map +1 -0
  440. package/dist/esm/Flow/Result.js +171 -0
  441. package/dist/esm/Flow/Result.js.map +1 -0
  442. package/dist/esm/Flow/Runtime.d.ts +98 -0
  443. package/dist/esm/Flow/Runtime.d.ts.map +1 -0
  444. package/dist/esm/Flow/Runtime.js +231 -0
  445. package/dist/esm/Flow/Runtime.js.map +1 -0
  446. package/dist/esm/Flow/TypeId.d.ts +8 -0
  447. package/dist/esm/Flow/TypeId.d.ts.map +1 -0
  448. package/dist/esm/Flow/TypeId.js +9 -0
  449. package/dist/esm/Flow/TypeId.js.map +1 -0
  450. package/dist/esm/Flow/index.d.ts +17 -0
  451. package/dist/esm/Flow/index.d.ts.map +1 -0
  452. package/dist/esm/Flow/index.js +18 -0
  453. package/dist/esm/Flow/index.js.map +1 -0
  454. package/dist/esm/Flow/internal.d.ts +34 -0
  455. package/dist/esm/Flow/internal.d.ts.map +1 -0
  456. package/dist/esm/Flow/internal.js +149 -0
  457. package/dist/esm/Flow/internal.js.map +1 -0
  458. package/dist/esm/Flow/make.d.ts +134 -0
  459. package/dist/esm/Flow/make.d.ts.map +1 -0
  460. package/dist/esm/Flow/make.js +106 -0
  461. package/dist/esm/Flow/make.js.map +1 -0
  462. package/dist/esm/FlowRuntime/CancelRequestFailed.d.ts +55 -0
  463. package/dist/esm/FlowRuntime/CancelRequestFailed.d.ts.map +1 -0
  464. package/dist/esm/FlowRuntime/CancelRequestFailed.js +53 -0
  465. package/dist/esm/FlowRuntime/CancelRequestFailed.js.map +1 -0
  466. package/dist/esm/FlowRuntime/ExecutionIdentityConflict.d.ts +23 -0
  467. package/dist/esm/FlowRuntime/ExecutionIdentityConflict.d.ts.map +1 -0
  468. package/dist/esm/FlowRuntime/ExecutionIdentityConflict.js +24 -0
  469. package/dist/esm/FlowRuntime/ExecutionIdentityConflict.js.map +1 -0
  470. package/dist/esm/FlowRuntime/FlowCycleDetected.d.ts +28 -0
  471. package/dist/esm/FlowRuntime/FlowCycleDetected.d.ts.map +1 -0
  472. package/dist/esm/FlowRuntime/FlowCycleDetected.js +35 -0
  473. package/dist/esm/FlowRuntime/FlowCycleDetected.js.map +1 -0
  474. package/dist/esm/FlowRuntime/FlowExecutionNotFound.d.ts +38 -0
  475. package/dist/esm/FlowRuntime/FlowExecutionNotFound.d.ts.map +1 -0
  476. package/dist/esm/FlowRuntime/FlowExecutionNotFound.js +40 -0
  477. package/dist/esm/FlowRuntime/FlowExecutionNotFound.js.map +1 -0
  478. package/dist/esm/FlowRuntime/FlowInstance.d.ts +115 -0
  479. package/dist/esm/FlowRuntime/FlowInstance.d.ts.map +1 -0
  480. package/dist/esm/FlowRuntime/FlowInstance.js +24 -0
  481. package/dist/esm/FlowRuntime/FlowInstance.js.map +1 -0
  482. package/dist/esm/FlowRuntime/FlowRuntime.d.ts +198 -0
  483. package/dist/esm/FlowRuntime/FlowRuntime.d.ts.map +1 -0
  484. package/dist/esm/FlowRuntime/FlowRuntime.js +34 -0
  485. package/dist/esm/FlowRuntime/FlowRuntime.js.map +1 -0
  486. package/dist/esm/FlowRuntime/NodeRecord.d.ts +175 -0
  487. package/dist/esm/FlowRuntime/NodeRecord.d.ts.map +1 -0
  488. package/dist/esm/FlowRuntime/NodeRecord.js +21 -0
  489. package/dist/esm/FlowRuntime/NodeRecord.js.map +1 -0
  490. package/dist/esm/FlowRuntime/WaitingAnnotation.d.ts +69 -0
  491. package/dist/esm/FlowRuntime/WaitingAnnotation.d.ts.map +1 -0
  492. package/dist/esm/FlowRuntime/WaitingAnnotation.js +53 -0
  493. package/dist/esm/FlowRuntime/WaitingAnnotation.js.map +1 -0
  494. package/dist/esm/FlowRuntime/index.d.ts +14 -0
  495. package/dist/esm/FlowRuntime/index.d.ts.map +1 -0
  496. package/dist/esm/FlowRuntime/index.js +15 -0
  497. package/dist/esm/FlowRuntime/index.js.map +1 -0
  498. package/dist/esm/Graph.d.ts +325 -0
  499. package/dist/esm/Graph.d.ts.map +1 -0
  500. package/dist/esm/Graph.js +1482 -0
  501. package/dist/esm/Graph.js.map +1 -0
  502. package/dist/esm/HumanTask.d.ts +440 -0
  503. package/dist/esm/HumanTask.d.ts.map +1 -0
  504. package/dist/esm/HumanTask.js +794 -0
  505. package/dist/esm/HumanTask.js.map +1 -0
  506. package/dist/esm/Interpreter.d.ts +222 -0
  507. package/dist/esm/Interpreter.d.ts.map +1 -0
  508. package/dist/esm/Interpreter.js +1269 -0
  509. package/dist/esm/Interpreter.js.map +1 -0
  510. package/dist/esm/Poll.d.ts +238 -0
  511. package/dist/esm/Poll.d.ts.map +1 -0
  512. package/dist/esm/Poll.js +282 -0
  513. package/dist/esm/Poll.js.map +1 -0
  514. package/dist/esm/RetryPolicy.d.ts +273 -0
  515. package/dist/esm/RetryPolicy.d.ts.map +1 -0
  516. package/dist/esm/RetryPolicy.js +429 -0
  517. package/dist/esm/RetryPolicy.js.map +1 -0
  518. package/dist/esm/Sleep.d.ts +98 -0
  519. package/dist/esm/Sleep.d.ts.map +1 -0
  520. package/dist/esm/Sleep.js +230 -0
  521. package/dist/esm/Sleep.js.map +1 -0
  522. package/dist/esm/Stall.d.ts +173 -0
  523. package/dist/esm/Stall.d.ts.map +1 -0
  524. package/dist/esm/Stall.js +138 -0
  525. package/dist/esm/Stall.js.map +1 -0
  526. package/dist/esm/WaitFor.d.ts +109 -0
  527. package/dist/esm/WaitFor.d.ts.map +1 -0
  528. package/dist/esm/WaitFor.js +184 -0
  529. package/dist/esm/WaitFor.js.map +1 -0
  530. package/dist/esm/index.d.ts +107 -0
  531. package/dist/esm/index.d.ts.map +1 -0
  532. package/dist/esm/index.js +108 -0
  533. package/dist/esm/index.js.map +1 -0
  534. package/dist/esm/internal/BoundedJson.d.ts +48 -0
  535. package/dist/esm/internal/BoundedJson.d.ts.map +1 -0
  536. package/dist/esm/internal/BoundedJson.js +107 -0
  537. package/dist/esm/internal/BoundedJson.js.map +1 -0
  538. package/dist/esm/internal/DeclarationSite.d.ts +135 -0
  539. package/dist/esm/internal/DeclarationSite.d.ts.map +1 -0
  540. package/dist/esm/internal/DeclarationSite.js +196 -0
  541. package/dist/esm/internal/DeclarationSite.js.map +1 -0
  542. package/dist/esm/internal/Declarations.d.ts +35 -0
  543. package/dist/esm/internal/Declarations.d.ts.map +1 -0
  544. package/dist/esm/internal/Declarations.js +43 -0
  545. package/dist/esm/internal/Declarations.js.map +1 -0
  546. package/dist/esm/internal/ExecutionMiddleware.d.ts +21 -0
  547. package/dist/esm/internal/ExecutionMiddleware.d.ts.map +1 -0
  548. package/dist/esm/internal/ExecutionMiddleware.js +13 -0
  549. package/dist/esm/internal/ExecutionMiddleware.js.map +1 -0
  550. package/dist/esm/internal/JsonSchemaSubset.d.ts +133 -0
  551. package/dist/esm/internal/JsonSchemaSubset.d.ts.map +1 -0
  552. package/dist/esm/internal/JsonSchemaSubset.js +363 -0
  553. package/dist/esm/internal/JsonSchemaSubset.js.map +1 -0
  554. package/dist/esm/internal/OutcomeMarker.d.ts +18 -0
  555. package/dist/esm/internal/OutcomeMarker.d.ts.map +1 -0
  556. package/dist/esm/internal/OutcomeMarker.js +18 -0
  557. package/dist/esm/internal/OutcomeMarker.js.map +1 -0
  558. package/docs/README.md +150 -0
  559. package/docs/api.md +436 -0
  560. package/docs/concepts/bodies-and-plans.md +157 -0
  561. package/docs/concepts/execution-identity.md +142 -0
  562. package/docs/concepts/flows-and-actions.md +129 -0
  563. package/docs/concepts/suspension-and-replay.md +130 -0
  564. package/docs/concepts/the-runtime-port.md +110 -0
  565. package/docs/concepts/trampoline-rounds.md +151 -0
  566. package/docs/guides/ask-a-person.md +184 -0
  567. package/docs/guides/build-a-body.md +161 -0
  568. package/docs/guides/cancel-and-roll-back.md +112 -0
  569. package/docs/guides/implement-an-action.md +147 -0
  570. package/docs/guides/inspect-the-plan.md +154 -0
  571. package/docs/guides/poll-until-ready.md +167 -0
  572. package/docs/guides/queue-work-to-a-worker.md +122 -0
  573. package/docs/guides/retry-a-failing-action.md +243 -0
  574. package/docs/guides/reuse-a-recorded-result.md +122 -0
  575. package/docs/guides/run-a-child-flow.md +108 -0
  576. package/docs/guides/run-an-external-job.md +86 -0
  577. package/docs/guides/use-a-prompt.md +38 -0
  578. package/docs/guides/wait-for-a-deadline.md +141 -0
  579. package/docs/guides/wait-for-an-external-signal.md +151 -0
  580. package/docs/installation.md +82 -0
  581. package/docs/quickstart.md +155 -0
  582. package/docs/reference/flow.md +1831 -0
  583. package/docs/testing.md +157 -0
  584. package/docs/troubleshooting.md +286 -0
  585. package/package.json +327 -3
  586. package/src/Action/Action.ts +333 -0
  587. package/src/Action/AttemptTimedOut.ts +37 -0
  588. package/src/Action/BoundaryMode.ts +33 -0
  589. package/src/Action/CacheEnvironment.ts +170 -0
  590. package/src/Action/ConcurrentKeylessDispatch.ts +38 -0
  591. package/src/Action/Context.ts +156 -0
  592. package/src/Action/DuplicateImplementation.ts +24 -0
  593. package/src/Action/FileBoundary.ts +77 -0
  594. package/src/Action/FileInput.ts +42 -0
  595. package/src/Action/Filegroup.ts +16 -0
  596. package/src/Action/Glob.ts +8 -0
  597. package/src/Action/ImplementationVersionMismatch.ts +27 -0
  598. package/src/Action/Implementations.ts +149 -0
  599. package/src/Action/InfraInterrupt.ts +30 -0
  600. package/src/Action/InfraInterruptRetriesExhausted.ts +37 -0
  601. package/src/Action/IrreversibleRetryRequiresIdempotencyKey.ts +32 -0
  602. package/src/Action/StepIdentity.ts +219 -0
  603. package/src/Action/TreeArtifact.ts +8 -0
  604. package/src/Action/TypeId.ts +9 -0
  605. package/src/Action/UncanonicalIdempotencyKey.ts +36 -0
  606. package/src/Action/idempotencyKey.ts +67 -0
  607. package/src/Action/index.ts +31 -0
  608. package/src/Action/make.ts +657 -0
  609. package/src/Action/raceAll.ts +48 -0
  610. package/src/Action/retry.ts +92 -0
  611. package/src/Deadline.ts +185 -0
  612. package/src/DurableClock.ts +133 -0
  613. package/src/DurableDeferred.ts +753 -0
  614. package/src/DurableQueue.ts +519 -0
  615. package/src/ExternalJob.ts +432 -0
  616. package/src/Fault.ts +279 -0
  617. package/src/Flow/Annotations.ts +151 -0
  618. package/src/Flow/CapabilityCeiling.ts +37 -0
  619. package/src/Flow/DeadlineExceeded.ts +40 -0
  620. package/src/Flow/ExecutionIdRequired.ts +36 -0
  621. package/src/Flow/ExecutionIds.ts +133 -0
  622. package/src/Flow/Flow.ts +576 -0
  623. package/src/Flow/MaxRoundsExceeded.ts +39 -0
  624. package/src/Flow/Outcome.ts +179 -0
  625. package/src/Flow/Result.ts +284 -0
  626. package/src/Flow/Runtime.ts +309 -0
  627. package/src/Flow/TypeId.ts +9 -0
  628. package/src/Flow/index.ts +19 -0
  629. package/src/Flow/internal.ts +237 -0
  630. package/src/Flow/make.ts +279 -0
  631. package/src/FlowRuntime/CancelRequestFailed.ts +56 -0
  632. package/src/FlowRuntime/ExecutionIdentityConflict.ts +32 -0
  633. package/src/FlowRuntime/FlowCycleDetected.ts +41 -0
  634. package/src/FlowRuntime/FlowExecutionNotFound.ts +46 -0
  635. package/src/FlowRuntime/FlowInstance.ts +128 -0
  636. package/src/FlowRuntime/FlowRuntime.ts +333 -0
  637. package/src/FlowRuntime/NodeRecord.ts +183 -0
  638. package/src/FlowRuntime/WaitingAnnotation.ts +85 -0
  639. package/src/FlowRuntime/index.ts +17 -0
  640. package/src/Graph.ts +1860 -0
  641. package/src/HumanTask.ts +1003 -0
  642. package/src/Interpreter.ts +1593 -0
  643. package/src/Poll.ts +414 -0
  644. package/src/RetryPolicy.ts +550 -0
  645. package/src/Sleep.ts +267 -0
  646. package/src/Stall.ts +217 -0
  647. package/src/WaitFor.ts +228 -0
  648. package/src/index.ts +125 -0
  649. package/src/internal/BoundedJson.ts +109 -0
  650. package/src/internal/DeclarationSite.ts +214 -0
  651. package/src/internal/Declarations.ts +49 -0
  652. package/src/internal/ExecutionMiddleware.ts +29 -0
  653. package/src/internal/JsonSchemaSubset.ts +392 -0
  654. package/src/internal/OutcomeMarker.ts +19 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Result.js","sourceRoot":"","sources":["../../../src/Flow/Result.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAA;AAG7D,MAAM,YAAY,GAAG,0BAA0B,CAAA;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAU,EACS,EAAE;IACrB,IAAI,CAAC,KAAK,MAAM,C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AAC,CAAC,CAAA;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAA0C,MAAM,CAAC,SAAS,CAClF,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC;IACL,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;CACjB,CAAC,CACH,CACK,CAAA","sourcesContent":["// Deep reviewed and polished by a human on 2026-08-10.\n\n/**\n * Serializable completion and suspension states returned by flow executions.\n *\n * @since 0.1.0\n */\n\nimport { CapabilityPattern } from \"@smthrs/capability/Capability\"\nimport * as Data from \"effect/Data\"\nimport * as Effect from \"effect/Effect\"\nimport type * as Exit from \"effect/Exit\"\nimport * as Schema from \"effect/Schema\"\nimport * as SchemaIssue from \"effect/SchemaIssue\"\nimport * as SchemaParser from \"effect/SchemaParser\"\nimport * as Transformation from \"effect/SchemaTransformation\"\nimport type { ExitEncoded } from \"effect/unstable/rpc/RpcMessage\"\n\nconst ResultTypeId = \"@smthrs/flow/Flow/Result\"\n\n/**\n * Returns `true` when a value is a flow `Result`.\n *\n * @category results\n * @since 0.1.0\n */\nexport const isResult = <A = unknown, E = unknown>(\n u: unknown\n): u is Result<A, E> => {\n if (u !== Object(u)) return false\n const marker = Object.getOwnPropertyDescriptor(u, ResultTypeId)\n if (marker === undefined || !(\"value\" in marker) || marker.value !== ResultTypeId) return false\n const tag = Object.getOwnPropertyDescriptor(u, \"_tag\")\n return tag !== undefined && \"value\" in tag &&\n (tag.value === \"Complete\" || tag.value === \"Suspended\" || tag.value === \"Handoff\")\n}\n\n/**\n * Result of a flow execution: a completed exit, a suspended flow state, or a\n * handoff to the next round of a trampoline lineage.\n *\n * @category results\n * @since 0.1.0\n */\nexport type Result<A, E> = Complete<A, E> | Suspended | Handoff\n\n/**\n * Encoded representation of a flow `Result`.\n *\n * @category results\n * @since 0.1.0\n */\nexport type ResultEncoded<A, E> =\n | CompleteEncoded<A, E>\n | typeof Suspended.Encoded\n | typeof Handoff.Encoded\n\n/**\n * Encoded representation of a completed flow result containing an encoded\n * `Exit`.\n *\n * @category results\n * @since 0.1.0\n */\nexport interface CompleteEncoded<A, E> {\n readonly _tag: \"Complete\"\n readonly exit: ExitEncoded<A, E>\n}\n\n/**\n * Schema constructor for `Complete` flow results using the supplied\n * success and error schemas.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport interface CompleteSchema<\n Success extends Schema.Constraint,\n Error extends Schema.Constraint\n> extends\n Schema.declareConstructor<\n Complete<Success[\"Type\"], Error[\"Type\"]>,\n Complete<Success[\"Encoded\"], Error[\"Encoded\"]>,\n readonly [Schema.Exit<Success, Error, Schema.Defect>]\n >\n{\n readonly success: Success\n readonly error: Error\n}\n\n/**\n * Represents a completed flow execution with its success or failure `Exit`.\n *\n * @category results\n * @since 0.1.0\n */\nexport class Complete<A, E> extends Data.TaggedClass(\"Complete\")<{\n readonly exit: Exit.Exit<A, E>\n}> {\n /**\n * Marks this value as a flow result for runtime guards.\n *\n * @since 0.1.0\n */\n readonly [ResultTypeId] = ResultTypeId\n\n /**\n * Builds the schema for completed flow results from success and error schemas.\n *\n * @since 0.1.0\n */\n static Schema<Success extends Schema.Constraint, Error extends Schema.Constraint>(options: {\n readonly success: Success\n readonly error: Error\n }): CompleteSchema<Success, Error> {\n // The declaration stays inline because it closes over this constructor's schemas.\n const schema = Schema.declareConstructor<\n Complete<Success[\"Type\"], Error[\"Type\"]>,\n Complete<Success[\"Encoded\"], Error[\"Encoded\"]>\n >()(\n [Schema.Exit(options.success, options.error, Schema.Defect())],\n ([exit]) => (input, ast, options) => {\n if (!(isResult(input) && input._tag === \"Complete\")) {\n return Effect.fail(new SchemaIssue.InvalidType(ast, input, options))\n }\n return Effect.mapBothEager(\n SchemaParser.decodeEffect(exit)(input.exit, options),\n {\n onSuccess: (exit) => new Complete({ exit }),\n onFailure: (issue) =>\n new SchemaIssue.Composite(\n ast,\n [\n new SchemaIssue.Pointer([\"exit\"], issue)\n ],\n input,\n options\n )\n }\n )\n },\n {\n expected: \"Flow.Complete\",\n toCodecJson: ([exit]) =>\n Schema.link<Complete<Success[\"Encoded\"], Error[\"Encoded\"]>>()(\n Schema.Struct({\n _tag: Schema.tag(\"Complete\"),\n exit\n }),\n Transformation.transform({\n decode: (encoded) => new Complete({ exit: encoded.exit }),\n encode: (result) => (({\n _tag: \"Complete\",\n exit: result.exit\n }) as const)\n })\n )\n }\n )\n return Schema.make(schema.ast, {\n success: options.success,\n error: options.error\n })\n }\n}\n\n/**\n * Represents a suspended flow execution, optionally carrying the cause that\n * triggered suspension.\n *\n * @category results\n * @since 0.1.0\n */\nexport class Suspended extends Schema.Class<Suspended>(\n \"@smthrs/flow/Flow/Suspended\"\n)({\n _tag: Schema.tag(\"Suspended\"),\n cause: Schema.optional(Schema.Cause(Schema.Never, Schema.Defect()))\n}) {\n /**\n * Marks this value as a flow result for runtime guards.\n *\n * @since 0.1.0\n */\n readonly [ResultTypeId] = ResultTypeId\n}\n\n/**\n * The deadline a trampoline lineage's rounds share: the journaled first start\n * of its originating round and the bound in milliseconds, so every round\n * expires at `startedAtMs + deadlineMs`.\n *\n * @category results\n * @since 1.0.0\n */\nexport const LineageDeadline = Schema.Struct({\n startedAtMs: Schema.Number,\n deadlineMs: Schema.Number\n})\n\n/**\n * The deadline a trampoline lineage's rounds share.\n *\n * @category results\n * @since 1.0.0\n */\nexport type LineageDeadline = typeof LineageDeadline.Type\n\n/**\n * Represents a flow round that ended by handing off to the next round of its\n * trampoline lineage.\n *\n * A round settles this way when its body's root value is a `to` invocation\n * (`docs/concepts/trampoline-rounds.md`): the round produced no answer of\n * its own, it produced the NEXT flow to run. `flow` is the target's tag, so the\n * value survives the journal and the run row unchanged.\n *\n * DECIDED: `payload` is the target's payload in\n * ENCODED form. The target's `to` method accepts its ordinary constructor\n * shape so authoring stays aligned with `call` and `execute`; the body\n * interpreter resolves planned references and encodes the invocation through\n * the target declaration before constructing `Handoff`. The receiving round\n * decodes those bytes through the same schema.\n *\n * It is a third settlement rather than a `Complete` carrying a magic value\n * because the engine has to tell \"this run answered\" from \"this run continues\n * elsewhere\" without decoding against a success schema the handoff never\n * satisfies.\n *\n * @category results\n * @since 0.1.0\n */\nexport class Handoff extends Schema.Class<Handoff>(\n \"@smthrs/flow/Flow/Handoff\"\n)({\n _tag: Schema.tag(\"Handoff\"),\n flow: Schema.NonEmptyString,\n capabilityCeilings: Schema.optionalKey(Schema.Array(Schema.Array(CapabilityPattern))),\n payload: Schema.Unknown,\n /**\n * The lineage deadline the next round runs under, stamped by the round\n * that handed off when its lineage is bounded (`Deadline.bound`).\n */\n deadline: Schema.optionalKey(LineageDeadline)\n}) {\n /**\n * Marks this value as a flow result for runtime guards.\n *\n * @since 0.1.0\n */\n readonly [ResultTypeId] = ResultTypeId\n}\n\n/**\n * Creates a schema for flow results using the supplied success and error\n * schemas.\n *\n * @category results\n * @since 0.1.0\n */\nexport const Result = <\n Success extends Schema.Constraint,\n Error extends Schema.Constraint\n>(options: {\n readonly success: Success\n readonly error: Error\n}) => Schema.Union([Complete.Schema(options), Suspended, Handoff])\n\nconst AnyOrVoid = Schema.Union([Schema.Any, Schema.Void])\n\n/**\n * Schema for encoded flow results with generic success and error payloads.\n *\n * @category results\n * @since 0.1.0\n */\nexport const ResultEncoded: Schema.Codec<ResultEncoded<any, any>> = Schema.toEncoded(\n Schema.toCodecJson(\n Result({\n success: AnyOrVoid,\n error: AnyOrVoid\n })\n )\n) as any\n"]}
@@ -0,0 +1,98 @@
1
+ import * as Cause from "effect/Cause";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Exit from "effect/Exit";
4
+ import * as Scope from "effect/Scope";
5
+ import { FlowInstance } from "../FlowRuntime/FlowInstance.ts";
6
+ import { type Result } from "./Result.ts";
7
+ /**
8
+ * Runs an effect as a flow execution and converts its outcome into a
9
+ * `Result`, handling suspension, defect capture, interruption, and flow
10
+ * scope finalization.
11
+ *
12
+ * @category results
13
+ * @since 0.1.0
14
+ */
15
+ export declare const intoResult: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<Result<A, E>, never, Exclude<R, Scope.Scope> | FlowInstance>;
16
+ /**
17
+ * Wraps an action-like effect so flow suspension waits for currently
18
+ * running actions to finish or suspend.
19
+ *
20
+ * The wait is for *siblings*. An action that suspends holds work its siblings
21
+ * have not journaled yet, so the flow must not park out from under them; an
22
+ * enclosing region holds no such work, because everything it is doing is this
23
+ * region. Waiting for one is a deadlock, and it was a real one: a harness cell
24
+ * call is an action, the `wait` flow it dispatches awaits a `DurableClock`
25
+ * under the run's own instance, and the round that should have parked instead
26
+ * blocked forever inside an uninterruptible finalizer — not cancellable, not
27
+ * resumable, and invisible in the journal past the `clock-scheduled` record.
28
+ *
29
+ * @category results
30
+ * @since 0.1.0
31
+ */
32
+ export declare const wrapActionResult: <A, E, R>(effect: Effect.Effect<A, E, R>, isSuspend: (value: A) => boolean) => Effect.Effect<A, E, R | FlowInstance>;
33
+ /**
34
+ * Accesses the current round's flow scope. Suspension keeps it open;
35
+ * completion or handoff closes it.
36
+ *
37
+ * @category resource management
38
+ * @since 0.1.0
39
+ */
40
+ export declare const scope: Effect.Effect<Scope.Scope, never, FlowInstance>;
41
+ /**
42
+ * Provides the current round's flow scope to the given effect. Suspension keeps
43
+ * the scope open; completion or handoff closes it.
44
+ *
45
+ * @category resource management
46
+ * @since 0.1.0
47
+ */
48
+ export declare const provideScope: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Scope.Scope> | FlowInstance>;
49
+ /**
50
+ * Adds an exit finalizer to the current flow scope, preserving the
51
+ * services available when the finalizer is registered.
52
+ *
53
+ * @category resource management
54
+ * @since 0.1.0
55
+ */
56
+ export declare const addFinalizer: <R>(f: (exit: Exit.Exit<unknown, unknown>) => Effect.Effect<void, never, R>) => Effect.Effect<void, never, FlowInstance | R>;
57
+ /**
58
+ * Runs an effect and registers how to undo its successful result if the
59
+ * current round later exits unsuccessfully.
60
+ *
61
+ * **When to use**
62
+ *
63
+ * Use when a top-level flow operation changes something that must be undone if
64
+ * a later operation causes the same round to fail or be interrupted.
65
+ *
66
+ * **Details**
67
+ *
68
+ * The effect runs first. If it fails, no rollback is registered. If it
69
+ * succeeds, its value is captured in a round-scope finalizer. The finalizer does
70
+ * nothing when the round succeeds; when the round exits unsuccessfully
71
+ * it calls `rollback(value, cause)`. Suspension keeps that scope open.
72
+ *
73
+ * A handoff completes the round successfully and discards its `withRollback` registrations.
74
+ * A later round's failure cannot invoke those rollbacks. The engine does not
75
+ * provide lineage-scoped compensation.
76
+ *
77
+ * **Gotchas**
78
+ *
79
+ * This applies only to effects run directly inside the flow execution. It does
80
+ * not attach rollback behavior to nested actions. The rollback's typed error
81
+ * channel is `never`; handle expected rollback failures inside the callback.
82
+ *
83
+ * @category resource management
84
+ * @since 0.1.0
85
+ */
86
+ export declare const withRollback: {
87
+ <A, R2>(rollback: (value: A, cause: Cause.Cause<unknown>) => Effect.Effect<void, never, R2>): <E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R | R2 | FlowInstance | Scope.Scope>;
88
+ <A, E, R, R2>(effect: Effect.Effect<A, E, R>, rollback: (value: A, cause: Cause.Cause<unknown>) => Effect.Effect<void, never, R2>): Effect.Effect<A, E, R | R2 | FlowInstance | Scope.Scope>;
89
+ };
90
+ /**
91
+ * Marks a flow instance as suspended and interrupts the current fiber to
92
+ * stop execution until it is resumed.
93
+ *
94
+ * @category results
95
+ * @since 0.1.0
96
+ */
97
+ export declare const suspend: (instance: FlowInstance["Service"]) => Effect.Effect<never>;
98
+ //# sourceMappingURL=Runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Runtime.d.ts","sourceRoot":"","sources":["../../../src/Flow/Runtime.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AAInC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,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"}
@@ -0,0 +1,231 @@
1
+ // Deep reviewed and polished by a human on 2026-08-10.
2
+ /**
3
+ * Runtime helpers for flow completion, suspension, scopes, and rollback.
4
+ *
5
+ * @since 0.1.0
6
+ */
7
+ import * as Arr from "effect/Array";
8
+ import * as Cause from "effect/Cause";
9
+ import * as Context from "effect/Context";
10
+ import * as Effect from "effect/Effect";
11
+ import * as Exit from "effect/Exit";
12
+ import * as Fiber from "effect/Fiber";
13
+ import * as Filter from "effect/Filter";
14
+ import { dual, identity } from "effect/Function";
15
+ import * as Scope from "effect/Scope";
16
+ import { FlowInstance } from "../FlowRuntime/FlowInstance.js";
17
+ import { CaptureDefects, SuspendOnFailure } from "./Annotations.js";
18
+ import { Complete, isResult, Suspended } from "./Result.js";
19
+ /**
20
+ * Runs an effect as a flow execution and converts its outcome into a
21
+ * `Result`, handling suspension, defect capture, interruption, and flow
22
+ * scope finalization.
23
+ *
24
+ * @category results
25
+ * @since 0.1.0
26
+ */
27
+ export const intoResult = (effect) => Effect.contextWith((context) => {
28
+ const instance = Context.get(context, FlowInstance);
29
+ const captureDefects = Context.get(instance.flow.annotations, CaptureDefects);
30
+ const suspendOnFailure = Context.get(instance.flow.annotations, SuspendOnFailure);
31
+ return effect.pipe(
32
+ // so we can use external interruption to suspend the flow
33
+ Effect.forkChild({ startImmediately: true }), Effect.flatMap((fiber) => Effect.onInterrupt(Fiber.join(fiber), () => Fiber.interrupt(fiber))), Effect.interruptible, suspendOnFailure
34
+ ? Effect.catchCause((cause) => {
35
+ instance.suspended = true;
36
+ if (!Cause.hasInterruptsOnly(cause)) {
37
+ instance.cause = Cause.die(Cause.squash(cause));
38
+ }
39
+ return Effect.interrupt;
40
+ })
41
+ : identity, Effect.scoped, Effect.matchCauseEffect({
42
+ // A body that handed off produced no answer of its own, so the slot
43
+ // the handoff was recorded in wins over the value the handler returned
44
+ // (`docs/concepts/trampoline-rounds.md`).
45
+ onSuccess: (value) => Effect.succeed(instance.handoff ?? new Complete({ exit: Exit.succeed(value) })),
46
+ onFailure: (cause) => {
47
+ const [reasons, interrupts] = Arr.partition(cause.reasons, Filter.fromPredicate(Cause.isInterruptReason));
48
+ const hasInterruptsOnly = interrupts.length === cause.reasons.length;
49
+ const filtered = reasons.length === 0 ? cause : Cause.fromReasons(reasons);
50
+ return instance.suspended && hasInterruptsOnly
51
+ ? Effect.succeed(new Suspended({ cause: instance.cause }))
52
+ : (!instance.interrupted && hasInterruptsOnly) ||
53
+ (!captureDefects && Cause.hasDies(cause))
54
+ ? Effect.failCause(filtered)
55
+ : Effect.succeed(new Complete({ exit: Exit.failCause(filtered) }));
56
+ }
57
+ }), (eff) => Effect.onExitPrimitive(eff, (exit) => {
58
+ if (Exit.isFailure(exit)) {
59
+ return Scope.close(instance.scope, exit);
60
+ }
61
+ else if (exit.value._tag === "Complete") {
62
+ return Scope.close(instance.scope, exit.value.exit);
63
+ }
64
+ else if (exit.value._tag === "Handoff") {
65
+ // A handoff ends this round for good — the next round is a separate
66
+ // execution with its own instance and its own scope — so the round's
67
+ // scope closes here exactly as a completion closes it. A suspension
68
+ // is the only settlement that keeps the scope open.
69
+ return Scope.close(instance.scope, Exit.void);
70
+ }
71
+ return Effect.void;
72
+ }, true), Effect.uninterruptible);
73
+ });
74
+ /**
75
+ * The action regions open on the current fiber's dynamic call stack.
76
+ *
77
+ * `actionState.count` says how many regions are open on an instance; it does
78
+ * not say which of them the current region is nested inside. That difference is
79
+ * the whole of {@link wrapActionResult}'s liveness: a region that suspends
80
+ * waits for the *other* open regions to settle, and an enclosing region can
81
+ * never settle before the region inside it returns. Carrying the enclosing
82
+ * instances in the context is what lets a suspension tell a sibling — which
83
+ * will settle — from an ancestor, which is waiting on the very fiber that is
84
+ * waiting on it.
85
+ *
86
+ * It is a context reference rather than a fiber-local counter because the chain
87
+ * crosses fibers: {@link intoResult} forks the body, and an engine gives every
88
+ * action dispatch a fiber of its own. Context propagates to forked children;
89
+ * a per-fiber counter would restart at each fork and read every ancestor as a
90
+ * sibling again.
91
+ */
92
+ const EnclosingActions = Context.Reference("@smthrs/flow/Flow/EnclosingActions", { defaultValue: () => [] });
93
+ /**
94
+ * Wraps an action-like effect so flow suspension waits for currently
95
+ * running actions to finish or suspend.
96
+ *
97
+ * The wait is for *siblings*. An action that suspends holds work its siblings
98
+ * have not journaled yet, so the flow must not park out from under them; an
99
+ * enclosing region holds no such work, because everything it is doing is this
100
+ * region. Waiting for one is a deadlock, and it was a real one: a harness cell
101
+ * call is an action, the `wait` flow it dispatches awaits a `DurableClock`
102
+ * under the run's own instance, and the round that should have parked instead
103
+ * blocked forever inside an uninterruptible finalizer — not cancellable, not
104
+ * resumable, and invisible in the journal past the `clock-scheduled` record.
105
+ *
106
+ * @category results
107
+ * @since 0.1.0
108
+ */
109
+ export const wrapActionResult = (effect, isSuspend) => Effect.contextWith((context) => {
110
+ const instance = Context.get(context, FlowInstance);
111
+ const enclosing = Context.getUnsafe(context, EnclosingActions);
112
+ // How many of the regions counted on this instance are this one's own
113
+ // ancestors, and so how many of them will still be open once every sibling
114
+ // has settled.
115
+ let ancestors = 0;
116
+ for (const open of enclosing)
117
+ if (open === instance)
118
+ ancestors++;
119
+ const state = instance.actionState;
120
+ if (state.count === 0)
121
+ state.latch.closeUnsafe();
122
+ state.count++;
123
+ return Effect.onExit(Effect.provideService(effect, EnclosingActions, [...enclosing, instance]), (exit) => {
124
+ state.count--;
125
+ const isSuspended = Exit.isSuccess(exit) && isSuspend(exit.value);
126
+ if (Exit.isSuccess(exit) &&
127
+ isResult(exit.value) &&
128
+ exit.value._tag === "Suspended" &&
129
+ exit.value.cause) {
130
+ instance.cause = instance.cause
131
+ ? Cause.combine(instance.cause, exit.value.cause)
132
+ : exit.value.cause;
133
+ }
134
+ if (state.count === 0)
135
+ return state.latch.open;
136
+ // Every decrement can satisfy a waiter whose threshold is not zero, so
137
+ // the waiters are released to re-test their own. `release` wakes them
138
+ // without opening the latch, so the ones still short of their threshold
139
+ // park again on the next turn of the loop.
140
+ return isSuspended
141
+ ? Effect.andThen(state.latch.release, waitForSiblings(instance, ancestors))
142
+ : Effect.asVoid(state.latch.release);
143
+ });
144
+ });
145
+ // Untraced because this latch loop is a flow scheduler hot path.
146
+ const waitForSiblings = Effect.fnUntraced(function* (instance, ancestors) {
147
+ const state = instance.actionState;
148
+ while (true) {
149
+ if (state.count > ancestors) {
150
+ yield* state.latch.await;
151
+ yield* Effect.yieldNow;
152
+ continue;
153
+ }
154
+ yield* Effect.yieldNow;
155
+ if (state.count <= ancestors)
156
+ return;
157
+ }
158
+ });
159
+ /**
160
+ * Accesses the current round's flow scope. Suspension keeps it open;
161
+ * completion or handoff closes it.
162
+ *
163
+ * @category resource management
164
+ * @since 0.1.0
165
+ */
166
+ export const scope = Effect.map(FlowInstance, (instance) => instance.scope);
167
+ /**
168
+ * Provides the current round's flow scope to the given effect. Suspension keeps
169
+ * the scope open; completion or handoff closes it.
170
+ *
171
+ * @category resource management
172
+ * @since 0.1.0
173
+ */
174
+ export const provideScope = (effect) => Effect.flatMap(scope, (scope) => Scope.provide(effect, scope));
175
+ /**
176
+ * Adds an exit finalizer to the current flow scope, preserving the
177
+ * services available when the finalizer is registered.
178
+ *
179
+ * @category resource management
180
+ * @since 0.1.0
181
+ */
182
+ export const addFinalizer =
183
+ // Untraced because suspension recursively re-enters flow execution.
184
+ Effect.fnUntraced(function* (f) {
185
+ const instance = yield* FlowInstance;
186
+ const services = yield* Effect.context();
187
+ yield* Scope.addFinalizerExit(instance.scope, (exit) => Effect.provideContext(f(exit), services));
188
+ });
189
+ /**
190
+ * Runs an effect and registers how to undo its successful result if the
191
+ * current round later exits unsuccessfully.
192
+ *
193
+ * **When to use**
194
+ *
195
+ * Use when a top-level flow operation changes something that must be undone if
196
+ * a later operation causes the same round to fail or be interrupted.
197
+ *
198
+ * **Details**
199
+ *
200
+ * The effect runs first. If it fails, no rollback is registered. If it
201
+ * succeeds, its value is captured in a round-scope finalizer. The finalizer does
202
+ * nothing when the round succeeds; when the round exits unsuccessfully
203
+ * it calls `rollback(value, cause)`. Suspension keeps that scope open.
204
+ *
205
+ * A handoff completes the round successfully and discards its `withRollback` registrations.
206
+ * A later round's failure cannot invoke those rollbacks. The engine does not
207
+ * provide lineage-scoped compensation.
208
+ *
209
+ * **Gotchas**
210
+ *
211
+ * This applies only to effects run directly inside the flow execution. It does
212
+ * not attach rollback behavior to nested actions. The rollback's typed error
213
+ * channel is `never`; handle expected rollback failures inside the callback.
214
+ *
215
+ * @category resource management
216
+ * @since 0.1.0
217
+ */
218
+ export const withRollback = dual(2, (effect, rollback) => Effect.uninterruptibleMask((restore) => Effect.tap(restore(effect), (value) => addFinalizer((exit) => Exit.isSuccess(exit) ? Effect.void : rollback(value, exit.cause)))));
219
+ /**
220
+ * Marks a flow instance as suspended and interrupts the current fiber to
221
+ * stop execution until it is resumed.
222
+ *
223
+ * @category results
224
+ * @since 0.1.0
225
+ */
226
+ export const suspend = (instance) => Effect.interruptible(Effect.callback(() => {
227
+ instance.suspended = true;
228
+ const fiber = Fiber.getCurrent();
229
+ fiber.interruptUnsafe(fiber.id);
230
+ }));
231
+ //# sourceMappingURL=Runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Runtime.js","sourceRoot":"","sources":["../../../src/Flow/Runtime.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD;;;;GAIG;AAEH,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,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,EAAG,CAAA;IACjC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;AACjC,CAAC,CAAC,CAAC,CAAA","sourcesContent":["// Deep reviewed and polished by a human on 2026-08-10.\n\n/**\n * Runtime helpers for flow completion, suspension, scopes, and rollback.\n *\n * @since 0.1.0\n */\n\nimport * as Arr from \"effect/Array\"\nimport * as Cause from \"effect/Cause\"\nimport * as Context from \"effect/Context\"\nimport * as Effect from \"effect/Effect\"\nimport * as Exit from \"effect/Exit\"\nimport * as Fiber from \"effect/Fiber\"\nimport * as Filter from \"effect/Filter\"\nimport { dual, identity } from \"effect/Function\"\nimport * as Scope from \"effect/Scope\"\nimport { FlowInstance } from \"../FlowRuntime/FlowInstance.ts\"\nimport { CaptureDefects, SuspendOnFailure } from \"./Annotations.ts\"\nimport { Complete, isResult, type Result, Suspended } from \"./Result.ts\"\n\n/**\n * Runs an effect as a flow execution and converts its outcome into a\n * `Result`, handling suspension, defect capture, interruption, and flow\n * scope finalization.\n *\n * @category results\n * @since 0.1.0\n */\nexport const intoResult = <A, E, R>(\n effect: Effect.Effect<A, E, R>\n): Effect.Effect<\n Result<A, E>,\n never,\n Exclude<R, Scope.Scope> | FlowInstance\n> =>\n Effect.contextWith((context: Context.Context<FlowInstance>) => {\n const instance = Context.get(context, FlowInstance)\n const captureDefects = Context.get(instance.flow.annotations, CaptureDefects)\n const suspendOnFailure = Context.get(instance.flow.annotations, SuspendOnFailure)\n return effect.pipe(\n // so we can use external interruption to suspend the flow\n Effect.forkChild({ startImmediately: true }),\n Effect.flatMap((fiber) => Effect.onInterrupt(Fiber.join(fiber), () => Fiber.interrupt(fiber))),\n Effect.interruptible,\n suspendOnFailure\n ? Effect.catchCause((cause) => {\n instance.suspended = true\n if (!Cause.hasInterruptsOnly(cause)) {\n instance.cause = Cause.die(Cause.squash(cause))\n }\n return Effect.interrupt\n })\n : identity,\n Effect.scoped,\n Effect.matchCauseEffect({\n // A body that handed off produced no answer of its own, so the slot\n // the handoff was recorded in wins over the value the handler returned\n // (`docs/concepts/trampoline-rounds.md`).\n onSuccess: (value) =>\n Effect.succeed(\n instance.handoff ?? new Complete({ exit: Exit.succeed(value) })\n ),\n onFailure: (cause): Effect.Effect<Result<A, E>> => {\n const [reasons, interrupts] = Arr.partition(\n cause.reasons,\n Filter.fromPredicate(Cause.isInterruptReason)\n )\n const hasInterruptsOnly = interrupts.length === cause.reasons.length\n const filtered = reasons.length === 0 ? cause : Cause.fromReasons(reasons)\n return instance.suspended && hasInterruptsOnly\n ? Effect.succeed(new Suspended({ cause: instance.cause }))\n : (!instance.interrupted && hasInterruptsOnly) ||\n (!captureDefects && Cause.hasDies(cause))\n ? Effect.failCause(filtered as Cause.Cause<never>)\n : Effect.succeed(new Complete({ exit: Exit.failCause(filtered) }))\n }\n }),\n (eff) =>\n Effect.onExitPrimitive(eff, (exit) => {\n if (Exit.isFailure(exit)) {\n return Scope.close(instance.scope, exit)\n } else if (exit.value._tag === \"Complete\") {\n return Scope.close(instance.scope, exit.value.exit)\n } else if (exit.value._tag === \"Handoff\") {\n // A handoff ends this round for good — the next round is a separate\n // execution with its own instance and its own scope — so the round's\n // scope closes here exactly as a completion closes it. A suspension\n // is the only settlement that keeps the scope open.\n return Scope.close(instance.scope, Exit.void)\n }\n return Effect.void\n }, true),\n Effect.uninterruptible\n )\n })\n\n/**\n * The action regions open on the current fiber's dynamic call stack.\n *\n * `actionState.count` says how many regions are open on an instance; it does\n * not say which of them the current region is nested inside. That difference is\n * the whole of {@link wrapActionResult}'s liveness: a region that suspends\n * waits for the *other* open regions to settle, and an enclosing region can\n * never settle before the region inside it returns. Carrying the enclosing\n * instances in the context is what lets a suspension tell a sibling — which\n * will settle — from an ancestor, which is waiting on the very fiber that is\n * waiting on it.\n *\n * It is a context reference rather than a fiber-local counter because the chain\n * crosses fibers: {@link intoResult} forks the body, and an engine gives every\n * action dispatch a fiber of its own. Context propagates to forked children;\n * a per-fiber counter would restart at each fork and read every ancestor as a\n * sibling again.\n */\nconst EnclosingActions = Context.Reference<ReadonlyArray<FlowInstance[\"Service\"]>>(\n \"@smthrs/flow/Flow/EnclosingActions\",\n { defaultValue: () => [] }\n)\n\n/**\n * Wraps an action-like effect so flow suspension waits for currently\n * running actions to finish or suspend.\n *\n * The wait is for *siblings*. An action that suspends holds work its siblings\n * have not journaled yet, so the flow must not park out from under them; an\n * enclosing region holds no such work, because everything it is doing is this\n * region. Waiting for one is a deadlock, and it was a real one: a harness cell\n * call is an action, the `wait` flow it dispatches awaits a `DurableClock`\n * under the run's own instance, and the round that should have parked instead\n * blocked forever inside an uninterruptible finalizer — not cancellable, not\n * resumable, and invisible in the journal past the `clock-scheduled` record.\n *\n * @category results\n * @since 0.1.0\n */\nexport const wrapActionResult = <A, E, R>(\n effect: Effect.Effect<A, E, R>,\n isSuspend: (value: A) => boolean\n): Effect.Effect<A, E, R | FlowInstance> =>\n Effect.contextWith((context: Context.Context<FlowInstance>) => {\n const instance = Context.get(context, FlowInstance)\n const enclosing = Context.getUnsafe(context, EnclosingActions)\n // How many of the regions counted on this instance are this one's own\n // ancestors, and so how many of them will still be open once every sibling\n // has settled.\n let ancestors = 0\n for (const open of enclosing) if (open === instance) ancestors++\n const state = instance.actionState\n if (state.count === 0) state.latch.closeUnsafe()\n state.count++\n return Effect.onExit(\n Effect.provideService(effect, EnclosingActions, [...enclosing, instance]),\n (exit) => {\n state.count--\n const isSuspended = Exit.isSuccess(exit) && isSuspend(exit.value)\n if (\n Exit.isSuccess(exit) &&\n isResult(exit.value) &&\n exit.value._tag === \"Suspended\" &&\n exit.value.cause\n ) {\n instance.cause = instance.cause\n ? Cause.combine(instance.cause, exit.value.cause)\n : exit.value.cause\n }\n if (state.count === 0) return state.latch.open\n // Every decrement can satisfy a waiter whose threshold is not zero, so\n // the waiters are released to re-test their own. `release` wakes them\n // without opening the latch, so the ones still short of their threshold\n // park again on the next turn of the loop.\n return isSuspended\n ? Effect.andThen(state.latch.release, waitForSiblings(instance, ancestors))\n : Effect.asVoid(state.latch.release)\n }\n )\n })\n\n// Untraced because this latch loop is a flow scheduler hot path.\nconst waitForSiblings = Effect.fnUntraced(function*(\n instance: FlowInstance[\"Service\"],\n ancestors: number\n) {\n const state = instance.actionState\n while (true) {\n if (state.count > ancestors) {\n yield* state.latch.await\n yield* Effect.yieldNow\n continue\n }\n yield* Effect.yieldNow\n if (state.count <= ancestors) return\n }\n})\n\n/**\n * Accesses the current round's flow scope. Suspension keeps it open;\n * completion or handoff closes it.\n *\n * @category resource management\n * @since 0.1.0\n */\nexport const scope: Effect.Effect<\n Scope.Scope,\n never,\n FlowInstance\n> = Effect.map(\n FlowInstance,\n (instance) => instance.scope as Scope.Scope\n)\n\n/**\n * Provides the current round's flow scope to the given effect. Suspension keeps\n * the scope open; completion or handoff closes it.\n *\n * @category resource management\n * @since 0.1.0\n */\nexport const provideScope = <A, E, R>(\n effect: Effect.Effect<A, E, R>\n): Effect.Effect<A, E, Exclude<R, Scope.Scope> | FlowInstance> =>\n Effect.flatMap(scope, (scope) => Scope.provide(effect, scope))\n\n/**\n * Adds an exit finalizer to the current flow scope, preserving the\n * services available when the finalizer is registered.\n *\n * @category resource management\n * @since 0.1.0\n */\nexport const addFinalizer: <R>(\n f: (exit: Exit.Exit<unknown, unknown>) => Effect.Effect<void, never, R>\n) => Effect.Effect<\n void,\n never,\n FlowInstance | R\n> =\n // Untraced because suspension recursively re-enters flow execution.\n Effect.fnUntraced(function*<R>(\n f: (exit: Exit.Exit<unknown, unknown>) => Effect.Effect<void, never, R>\n ) {\n const instance = yield* FlowInstance\n const services = yield* Effect.context<R>()\n yield* Scope.addFinalizerExit(instance.scope, (exit) => Effect.provideContext(f(exit), services))\n })\n\n/**\n * Runs an effect and registers how to undo its successful result if the\n * current round later exits unsuccessfully.\n *\n * **When to use**\n *\n * Use when a top-level flow operation changes something that must be undone if\n * a later operation causes the same round to fail or be interrupted.\n *\n * **Details**\n *\n * The effect runs first. If it fails, no rollback is registered. If it\n * succeeds, its value is captured in a round-scope finalizer. The finalizer does\n * nothing when the round succeeds; when the round exits unsuccessfully\n * it calls `rollback(value, cause)`. Suspension keeps that scope open.\n *\n * A handoff completes the round successfully and discards its `withRollback` registrations.\n * A later round's failure cannot invoke those rollbacks. The engine does not\n * provide lineage-scoped compensation.\n *\n * **Gotchas**\n *\n * This applies only to effects run directly inside the flow execution. It does\n * not attach rollback behavior to nested actions. The rollback's typed error\n * channel is `never`; handle expected rollback failures inside the callback.\n *\n * @category resource management\n * @since 0.1.0\n */\nexport const withRollback: {\n <A, R2>(\n rollback: (value: A, cause: Cause.Cause<unknown>) => Effect.Effect<void, never, R2>\n ): <E, R>(\n effect: Effect.Effect<A, E, R>\n ) => Effect.Effect<A, E, R | R2 | FlowInstance | Scope.Scope>\n <A, E, R, R2>(\n effect: Effect.Effect<A, E, R>,\n rollback: (value: A, cause: Cause.Cause<unknown>) => Effect.Effect<void, never, R2>\n ): Effect.Effect<A, E, R | R2 | FlowInstance | Scope.Scope>\n} = dual(2, <A, E, R, R2>(\n effect: Effect.Effect<A, E, R>,\n rollback: (value: A, cause: Cause.Cause<unknown>) => Effect.Effect<void, never, R2>\n): Effect.Effect<A, E, R | R2 | FlowInstance | Scope.Scope> =>\n Effect.uninterruptibleMask((restore) =>\n Effect.tap(\n restore(effect),\n (value) => addFinalizer((exit) => Exit.isSuccess(exit) ? Effect.void : rollback(value, exit.cause))\n )\n ))\n\n/**\n * Marks a flow instance as suspended and interrupts the current fiber to\n * stop execution until it is resumed.\n *\n * @category results\n * @since 0.1.0\n */\nexport const suspend = (instance: FlowInstance[\"Service\"]): Effect.Effect<never> =>\n Effect.interruptible(Effect.callback<never>(() => {\n instance.suspended = true\n const fiber = Fiber.getCurrent()!\n fiber.interruptUnsafe(fiber.id)\n }))\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Runtime identity shared by flow interfaces and constructors.
3
+ *
4
+ * @private
5
+ * @since 0.1.0
6
+ */
7
+ export declare const TypeId = "@smthrs/flow/Flow";
8
+ //# sourceMappingURL=TypeId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeId.d.ts","sourceRoot":"","sources":["../../../src/Flow/TypeId.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,9 @@
1
+ // Deep reviewed and polished by a human on 2026-08-10.
2
+ /**
3
+ * Runtime identity shared by flow interfaces and constructors.
4
+ *
5
+ * @private
6
+ * @since 0.1.0
7
+ */
8
+ export const TypeId = "@smthrs/flow/Flow";
9
+ //# sourceMappingURL=TypeId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeId.js","sourceRoot":"","sources":["../../../src/Flow/TypeId.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,mBAAmB,CAAA","sourcesContent":["// Deep reviewed and polished by a human on 2026-08-10.\n\n/**\n * Runtime identity shared by flow interfaces and constructors.\n *\n * @private\n * @since 0.1.0\n */\nexport const TypeId = \"@smthrs/flow/Flow\"\n"]}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Typed durable flow definitions, results, and runtime helpers.
3
+ *
4
+ * @since 0.1.0
5
+ */
6
+ export * from "./Annotations.ts";
7
+ export * from "./CapabilityCeiling.ts";
8
+ export * from "./DeadlineExceeded.ts";
9
+ export * from "./ExecutionIdRequired.ts";
10
+ export * from "./ExecutionIds.ts";
11
+ export * from "./Flow.ts";
12
+ export * from "./make.ts";
13
+ export * from "./MaxRoundsExceeded.ts";
14
+ export * from "./Outcome.ts";
15
+ export * from "./Result.ts";
16
+ export * from "./Runtime.ts";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Flow/index.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -0,0 +1,18 @@
1
+ // Deep reviewed and polished by a human on 2026-08-10.
2
+ /**
3
+ * Typed durable flow definitions, results, and runtime helpers.
4
+ *
5
+ * @since 0.1.0
6
+ */
7
+ export * from "./Annotations.js";
8
+ export * from "./CapabilityCeiling.js";
9
+ export * from "./DeadlineExceeded.js";
10
+ export * from "./ExecutionIdRequired.js";
11
+ export * from "./ExecutionIds.js";
12
+ export * from "./Flow.js";
13
+ export * from "./make.js";
14
+ export * from "./MaxRoundsExceeded.js";
15
+ export * from "./Outcome.js";
16
+ export * from "./Result.js";
17
+ export * from "./Runtime.js";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Flow/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD;;;;GAIG;AAEH,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA","sourcesContent":["// Deep reviewed and polished by a human on 2026-08-10.\n\n/**\n * Typed durable flow definitions, results, and runtime helpers.\n *\n * @since 0.1.0\n */\n\nexport * from \"./Annotations.ts\"\nexport * from \"./CapabilityCeiling.ts\"\nexport * from \"./DeadlineExceeded.ts\"\nexport * from \"./ExecutionIdRequired.ts\"\nexport * from \"./ExecutionIds.ts\"\nexport * from \"./Flow.ts\"\nexport * from \"./make.ts\"\nexport * from \"./MaxRoundsExceeded.ts\"\nexport * from \"./Outcome.ts\"\nexport * from \"./Result.ts\"\nexport * from \"./Runtime.ts\"\n"]}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Private flow construction shared by declarations and action registration.
3
+ *
4
+ * @since 1.0.0
5
+ * @private
6
+ */
7
+ import * as Node from "@smthrs/plan/Node";
8
+ import * as Context from "effect/Context";
9
+ import type * as Duration from "effect/Duration";
10
+ import * as Schema from "effect/Schema";
11
+ import type * as RetryPolicy from "../RetryPolicy.ts";
12
+ import type { Any, AnyStructSchema, BodySuccess, DeclarationMetadata, Flow } from "./Flow.ts";
13
+ /**
14
+ * Builds the private prototype from normalized declaration data.
15
+ *
16
+ * @since 1.0.0
17
+ * @private
18
+ */
19
+ export declare const makeProto: <const Tag extends string, Payload extends AnyStructSchema, Success extends Schema.Top, Error extends Schema.Top, Requires>(options: DeclarationMetadata & {
20
+ readonly _tag: Tag;
21
+ readonly description?: string | undefined;
22
+ readonly payloadSchema: Payload;
23
+ readonly successSchema: Success;
24
+ readonly errorSchema: Error;
25
+ readonly annotations: Context.Context<never>;
26
+ readonly body: (payload: Payload["Type"]) => Node.Node<BodySuccess<Success["Type"]>, Error["Type"], Requires>;
27
+ readonly prompt?: ((payload: Payload["Type"]) => string) | undefined;
28
+ readonly action?: Any["action"] | undefined;
29
+ readonly idempotencyKey?: ((payload: Payload["Type"]) => string) | undefined;
30
+ readonly suspendedRetryPolicy?: RetryPolicy.RetryPolicy | undefined;
31
+ readonly maxRounds?: number | undefined;
32
+ readonly deadline?: Duration.Duration | undefined;
33
+ }) => Flow<Tag, Payload, Success, Error, Requires>;
34
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/Flow/internal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO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