@demlik/tea 0.13.0 → 0.14.0

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 (372) hide show
  1. package/README.md +11 -9
  2. package/dist/agent/index.d.ts +637 -45
  3. package/dist/agent/index.js +9 -19
  4. package/dist/{chunk-25LBDCBC.js → chunk-6IQPODUF.js} +2 -2
  5. package/dist/{chunk-25LBDCBC.js.map → chunk-6IQPODUF.js.map} +1 -1
  6. package/dist/chunk-AQ6ZIMEA.js +421 -0
  7. package/dist/chunk-AQ6ZIMEA.js.map +1 -0
  8. package/dist/{chunk-MUUROGIH.js → chunk-BLJ2JQSH.js} +62 -12
  9. package/dist/chunk-BLJ2JQSH.js.map +1 -0
  10. package/dist/{chunk-RH5EFRVJ.js → chunk-F2US5BW6.js} +25 -5
  11. package/dist/chunk-F2US5BW6.js.map +1 -0
  12. package/dist/{batch-window/index.js → chunk-F7FMAWLA.js} +4 -8
  13. package/dist/chunk-F7FMAWLA.js.map +1 -0
  14. package/dist/{chunk-O4MVQTEJ.js → chunk-HUKZQX6U.js} +20 -16
  15. package/dist/chunk-HUKZQX6U.js.map +1 -0
  16. package/dist/{chunk-EWJP3YYP.js → chunk-HWVW4AXC.js} +3 -3
  17. package/dist/chunk-HWVW4AXC.js.map +1 -0
  18. package/dist/{chunk-DMYGQB4O.js → chunk-HYDWG35Q.js} +23 -6
  19. package/dist/chunk-HYDWG35Q.js.map +1 -0
  20. package/dist/{chunk-YUXP55T2.js → chunk-I5MQMJDW.js} +57 -7
  21. package/dist/chunk-I5MQMJDW.js.map +1 -0
  22. package/dist/{chunk-J6527VRQ.js → chunk-LFZUK6J2.js} +3 -3
  23. package/dist/chunk-LFZUK6J2.js.map +1 -0
  24. package/dist/{chunk-ZVJZ72HY.js → chunk-LYLTKJWM.js} +25 -11
  25. package/dist/chunk-LYLTKJWM.js.map +1 -0
  26. package/dist/{chunk-D736QUGF.js → chunk-MYXFNWAJ.js} +4 -5
  27. package/dist/chunk-MYXFNWAJ.js.map +1 -0
  28. package/dist/{chunk-K575PT4S.js → chunk-PR6TB3BL.js} +15 -4
  29. package/dist/chunk-PR6TB3BL.js.map +1 -0
  30. package/dist/chunk-RQULHGYH.js +1804 -0
  31. package/dist/chunk-RQULHGYH.js.map +1 -0
  32. package/dist/{chunk-FV3Z5MBE.js → chunk-TXN2KFHF.js} +14 -4
  33. package/dist/chunk-TXN2KFHF.js.map +1 -0
  34. package/dist/{chunk-Q2UM7BXU.js → chunk-VBDU4JL6.js} +2 -2
  35. package/dist/chunk-VBDU4JL6.js.map +1 -0
  36. package/dist/chunk-Z2L3LSNV.js +1470 -0
  37. package/dist/chunk-Z2L3LSNV.js.map +1 -0
  38. package/dist/{core-Co0LWkIA.d.ts → core-CTzMJ82M.d.ts} +72 -23
  39. package/dist/devtools/index.d.ts +2 -2
  40. package/dist/devtools/index.js +207 -2
  41. package/dist/devtools/index.js.map +1 -1
  42. package/dist/do/index.d.ts +42 -29
  43. package/dist/do/index.js +36 -25
  44. package/dist/do/index.js.map +1 -1
  45. package/dist/{durable-effects-C6uwzjb5.d.ts → durable-effects-B0-qGQDy.d.ts} +2 -2
  46. package/dist/extension/index.d.ts +300 -3
  47. package/dist/extension/index.js +596 -5
  48. package/dist/extension/index.js.map +1 -1
  49. package/dist/flow/index.d.ts +1295 -0
  50. package/dist/flow/index.js +732 -0
  51. package/dist/flow/index.js.map +1 -0
  52. package/dist/idempotency/index.d.ts +90 -116
  53. package/dist/idempotency/index.js +4 -1
  54. package/dist/{batch-window/index.d.ts → index-4vZzljCD.d.ts} +7 -12
  55. package/dist/{fan-out/index.d.ts → index-6A7dB8f6.d.ts} +7 -9
  56. package/dist/index-B5BZ-_cT.d.ts +616 -0
  57. package/dist/index-Bc40JWVl.d.ts +131 -0
  58. package/dist/{debounce/index.d.ts → index-DHSUmQTR.d.ts} +7 -7
  59. package/dist/index-DJWIER_3.d.ts +69 -0
  60. package/dist/{snapshot/index.d.ts → index-DMCeMPMJ.d.ts} +15 -78
  61. package/dist/{monitored-run/index.d.ts → index-NjrT3fL2.d.ts} +37 -13
  62. package/dist/{recorder/index.d.ts → index-TvRb1KVf.d.ts} +4 -7
  63. package/dist/{deadline/index.d.ts → index-q0hXFeZ0.d.ts} +155 -9
  64. package/dist/index.d.ts +711 -6
  65. package/dist/index.js +1 -2
  66. package/dist/jev/index.d.ts +634 -0
  67. package/dist/jev/index.js +433 -0
  68. package/dist/jev/index.js.map +1 -0
  69. package/dist/machine-CdIcN2Xm.d.ts +1773 -0
  70. package/dist/machine-viz/index.d.ts +1 -1
  71. package/dist/machine-viz/index.js +12 -5
  72. package/dist/machine-viz/index.js.map +1 -1
  73. package/dist/mem/index.d.ts +18 -3
  74. package/dist/mem/index.js +22 -2
  75. package/dist/mem/index.js.map +1 -1
  76. package/dist/node/index.d.ts +104 -6
  77. package/dist/node/index.js +132 -9
  78. package/dist/node/index.js.map +1 -1
  79. package/dist/{paginator → paginate}/index.d.ts +151 -6
  80. package/dist/paginate/index.js +7 -0
  81. package/dist/parity/index.d.ts +4 -10
  82. package/dist/parity/index.js +4 -7
  83. package/dist/parity/index.js.map +1 -1
  84. package/dist/pbt/index.d.ts +247 -5
  85. package/dist/pbt/index.js +124 -5
  86. package/dist/pbt/index.js.map +1 -1
  87. package/dist/{trace-replay → persistence}/index.d.ts +7 -5
  88. package/dist/persistence/index.js +6 -0
  89. package/dist/react/index.d.ts +2 -2
  90. package/dist/react/index.js +1 -2
  91. package/dist/react/index.js.map +1 -1
  92. package/dist/resilience/index.d.ts +743 -0
  93. package/dist/resilience/index.js +657 -0
  94. package/dist/resilience/index.js.map +1 -0
  95. package/dist/retry-backoff/index.d.ts +3 -2
  96. package/dist/retry-backoff/index.js +1 -1
  97. package/dist/runtime-types-LWDoi943.d.ts +998 -0
  98. package/dist/testing/index.d.ts +2 -2
  99. package/dist/testing/index.js +1 -2
  100. package/dist/testing/index.js.map +1 -1
  101. package/dist/{throttled-input → timing}/index.d.ts +143 -12
  102. package/dist/{throttled-input → timing}/index.js +57 -12
  103. package/dist/timing/index.js.map +1 -0
  104. package/dist/{types-XS_miRnB.d.ts → types-DP3f5NIl.d.ts} +1 -1
  105. package/dist/work-queue/index.d.ts +130 -54
  106. package/dist/work-queue/index.js +3 -2
  107. package/dist/work-queue/index.js.map +1 -1
  108. package/package.json +45 -218
  109. package/dist/authed-call/index.d.ts +0 -120
  110. package/dist/authed-call/index.js +0 -134
  111. package/dist/authed-call/index.js.map +0 -1
  112. package/dist/await-terminal/index.d.ts +0 -101
  113. package/dist/await-terminal/index.js +0 -76
  114. package/dist/await-terminal/index.js.map +0 -1
  115. package/dist/batch-window/index.js.map +0 -1
  116. package/dist/cache/index.d.ts +0 -152
  117. package/dist/cache/index.js +0 -8
  118. package/dist/chart/index.d.ts +0 -218
  119. package/dist/chart/index.js +0 -16
  120. package/dist/chart/index.js.map +0 -1
  121. package/dist/chart/inspect/index.d.ts +0 -86
  122. package/dist/chart/inspect/index.js +0 -5
  123. package/dist/chart/inspect/react.d.ts +0 -113
  124. package/dist/chart/inspect/react.js +0 -11
  125. package/dist/chart/inspect/react.js.map +0 -1
  126. package/dist/chart/inspect/styles.css +0 -286
  127. package/dist/chart/lane/index.d.ts +0 -362
  128. package/dist/chart/lane/index.js +0 -9
  129. package/dist/chart/lane/index.js.map +0 -1
  130. package/dist/chart/lane/react.d.ts +0 -84
  131. package/dist/chart/lane/react.js +0 -559
  132. package/dist/chart/lane/react.js.map +0 -1
  133. package/dist/chart/lane/server.d.ts +0 -148
  134. package/dist/chart/lane/server.js +0 -209
  135. package/dist/chart/lane/server.js.map +0 -1
  136. package/dist/chart/lane/styles.css +0 -498
  137. package/dist/chart/lane/viewer/assets/abnfDiagram-N423BO3Z-C729LI31.js +0 -1
  138. package/dist/chart/lane/viewer/assets/architectureDiagram-T3A2C74G-C729LI31.js +0 -1
  139. package/dist/chart/lane/viewer/assets/blockDiagram-VBNYF7ZC-C729LI31.js +0 -1
  140. package/dist/chart/lane/viewer/assets/c4Diagram-5PPSVZJV-C729LI31.js +0 -1
  141. package/dist/chart/lane/viewer/assets/chunk-2GRJ4B5K-HdDf8SI3.js +0 -1
  142. package/dist/chart/lane/viewer/assets/chunk-5RXB4S5H-CcNtpUd7.js +0 -231
  143. package/dist/chart/lane/viewer/assets/chunk-5VM5RSS4-BP4fRS_5.js +0 -15
  144. package/dist/chart/lane/viewer/assets/chunk-KBJHAD2P-DZOw7xU6.js +0 -1
  145. package/dist/chart/lane/viewer/assets/chunk-NSK5VX7P-CBCyTZMs.js +0 -128
  146. package/dist/chart/lane/viewer/assets/classDiagram-JCYQIIEL-C729LI31.js +0 -1
  147. package/dist/chart/lane/viewer/assets/classDiagram-v2-OCEON4UE-D4uAiFr8.js +0 -206
  148. package/dist/chart/lane/viewer/assets/cose-bilkent-JH36ORCC-DOwCrGXH.js +0 -1
  149. package/dist/chart/lane/viewer/assets/cynefinDiagram-MW4NZA55-C729LI31.js +0 -1
  150. package/dist/chart/lane/viewer/assets/dagre-K_PewWfS.js +0 -1
  151. package/dist/chart/lane/viewer/assets/dagre-VZM6K2ZE-831qZcA8.js +0 -4
  152. package/dist/chart/lane/viewer/assets/diagram-7IWD3JNH-C729LI31.js +0 -1
  153. package/dist/chart/lane/viewer/assets/diagram-B4RE2ZJO-C729LI31.js +0 -1
  154. package/dist/chart/lane/viewer/assets/diagram-LBJQPF4R-C729LI31.js +0 -1
  155. package/dist/chart/lane/viewer/assets/diagram-Q27KOJAE-C729LI31.js +0 -1
  156. package/dist/chart/lane/viewer/assets/diagram-UB23O5K3-C729LI31.js +0 -1
  157. package/dist/chart/lane/viewer/assets/ebnfDiagram-BXEA7PRR-C729LI31.js +0 -1
  158. package/dist/chart/lane/viewer/assets/erDiagram-JOGREHBK-C729LI31.js +0 -1
  159. package/dist/chart/lane/viewer/assets/flowDiagram-UKHOOZJN-C729LI31.js +0 -1
  160. package/dist/chart/lane/viewer/assets/ganttDiagram-PKOTCBZU-C729LI31.js +0 -1
  161. package/dist/chart/lane/viewer/assets/gitGraphDiagram-DS77QQ5N-C729LI31.js +0 -1
  162. package/dist/chart/lane/viewer/assets/index-9SkH5NA3.css +0 -1
  163. package/dist/chart/lane/viewer/assets/index-Bgt4sXpW.js +0 -195
  164. package/dist/chart/lane/viewer/assets/infoDiagram-6WML65LV-C729LI31.js +0 -1
  165. package/dist/chart/lane/viewer/assets/ishikawaDiagram-WSZJBQD7-C729LI31.js +0 -1
  166. package/dist/chart/lane/viewer/assets/journeyDiagram-NVQOT4AX-C729LI31.js +0 -1
  167. package/dist/chart/lane/viewer/assets/kanban-definition-27J2QSJJ-G7PaPzy-.js +0 -89
  168. package/dist/chart/lane/viewer/assets/katex-DOwCrGXH.js +0 -1
  169. package/dist/chart/lane/viewer/assets/mindmap-definition-FAOFIHXS-CGj9nrVk.js +0 -96
  170. package/dist/chart/lane/viewer/assets/path-fybaL0A-.js +0 -1
  171. package/dist/chart/lane/viewer/assets/pegDiagram-VL7TDLO6-C729LI31.js +0 -1
  172. package/dist/chart/lane/viewer/assets/pieDiagram-7S7Q4E2Y-C729LI31.js +0 -1
  173. package/dist/chart/lane/viewer/assets/quadrantDiagram-CIZ2JOQS-C729LI31.js +0 -1
  174. package/dist/chart/lane/viewer/assets/railroadDiagram-AXF67PYL-C729LI31.js +0 -1
  175. package/dist/chart/lane/viewer/assets/requirementDiagram-LRYGKXZP-C729LI31.js +0 -1
  176. package/dist/chart/lane/viewer/assets/sankeyDiagram-W5VNT64P-C729LI31.js +0 -1
  177. package/dist/chart/lane/viewer/assets/sequenceDiagram-SI44F4Z6-C729LI31.js +0 -1
  178. package/dist/chart/lane/viewer/assets/stateDiagram-OKZ733FA-B_88AzBS.js +0 -1
  179. package/dist/chart/lane/viewer/assets/stateDiagram-v2-UEYNNEHI-CR5gcgq6.js +0 -1
  180. package/dist/chart/lane/viewer/assets/swimlanes-SLNWSIFB-B4xK-rwg.js +0 -1
  181. package/dist/chart/lane/viewer/assets/swimlanesDiagram-ULZ7WXOC-C729LI31.js +0 -1
  182. package/dist/chart/lane/viewer/assets/timeline-definition-Z64GVDOM-CCv52MfY.js +0 -120
  183. package/dist/chart/lane/viewer/assets/vennDiagram-T6HMQDX7-C729LI31.js +0 -1
  184. package/dist/chart/lane/viewer/assets/wardleyDiagram-T6FBY63Y-C729LI31.js +0 -1
  185. package/dist/chart/lane/viewer/assets/xychartDiagram-ELKLHX3M-C729LI31.js +0 -1
  186. package/dist/chart/lane/viewer/index.html +0 -15
  187. package/dist/chart/report/index.d.ts +0 -117
  188. package/dist/chart/report/index.js +0 -32
  189. package/dist/chart/report/index.js.map +0 -1
  190. package/dist/chunk-2YFLOCWX.js +0 -15
  191. package/dist/chunk-2YFLOCWX.js.map +0 -1
  192. package/dist/chunk-3I52QZZ5.js +0 -519
  193. package/dist/chunk-3I52QZZ5.js.map +0 -1
  194. package/dist/chunk-3ZAFFRRB.js +0 -457
  195. package/dist/chunk-3ZAFFRRB.js.map +0 -1
  196. package/dist/chunk-4EQZ76JC.js +0 -33
  197. package/dist/chunk-4EQZ76JC.js.map +0 -1
  198. package/dist/chunk-4KLG43GY.js +0 -223
  199. package/dist/chunk-4KLG43GY.js.map +0 -1
  200. package/dist/chunk-7FRZ2CT2.js +0 -424
  201. package/dist/chunk-7FRZ2CT2.js.map +0 -1
  202. package/dist/chunk-AZZLE7XR.js +0 -62
  203. package/dist/chunk-AZZLE7XR.js.map +0 -1
  204. package/dist/chunk-BYQUGDD3.js +0 -16
  205. package/dist/chunk-BYQUGDD3.js.map +0 -1
  206. package/dist/chunk-CIQG5L42.js +0 -685
  207. package/dist/chunk-CIQG5L42.js.map +0 -1
  208. package/dist/chunk-CLM6ERNO.js +0 -61
  209. package/dist/chunk-CLM6ERNO.js.map +0 -1
  210. package/dist/chunk-COS5MSTO.js +0 -88
  211. package/dist/chunk-COS5MSTO.js.map +0 -1
  212. package/dist/chunk-CRPZJVD2.js +0 -71
  213. package/dist/chunk-CRPZJVD2.js.map +0 -1
  214. package/dist/chunk-D62FDQKE.js +0 -53
  215. package/dist/chunk-D62FDQKE.js.map +0 -1
  216. package/dist/chunk-D736QUGF.js.map +0 -1
  217. package/dist/chunk-DGE4PV4A.js +0 -26
  218. package/dist/chunk-DGE4PV4A.js.map +0 -1
  219. package/dist/chunk-DMYGQB4O.js.map +0 -1
  220. package/dist/chunk-EWJP3YYP.js.map +0 -1
  221. package/dist/chunk-FV3Z5MBE.js.map +0 -1
  222. package/dist/chunk-HCEVHFJ7.js +0 -54
  223. package/dist/chunk-HCEVHFJ7.js.map +0 -1
  224. package/dist/chunk-J6527VRQ.js.map +0 -1
  225. package/dist/chunk-JELSZN25.js +0 -47
  226. package/dist/chunk-JELSZN25.js.map +0 -1
  227. package/dist/chunk-K575PT4S.js.map +0 -1
  228. package/dist/chunk-L57ZOT5K.js +0 -184
  229. package/dist/chunk-L57ZOT5K.js.map +0 -1
  230. package/dist/chunk-MU6MCIAC.js +0 -15
  231. package/dist/chunk-MU6MCIAC.js.map +0 -1
  232. package/dist/chunk-MUUROGIH.js.map +0 -1
  233. package/dist/chunk-NR7BU22N.js +0 -758
  234. package/dist/chunk-NR7BU22N.js.map +0 -1
  235. package/dist/chunk-O4MVQTEJ.js.map +0 -1
  236. package/dist/chunk-OOYD44JI.js +0 -317
  237. package/dist/chunk-OOYD44JI.js.map +0 -1
  238. package/dist/chunk-Q2UM7BXU.js.map +0 -1
  239. package/dist/chunk-RH5EFRVJ.js.map +0 -1
  240. package/dist/chunk-S2EGRPCM.js +0 -47
  241. package/dist/chunk-S2EGRPCM.js.map +0 -1
  242. package/dist/chunk-SINXE47Y.js +0 -55
  243. package/dist/chunk-SINXE47Y.js.map +0 -1
  244. package/dist/chunk-UF4MZSLT.js +0 -53
  245. package/dist/chunk-UF4MZSLT.js.map +0 -1
  246. package/dist/chunk-UOC2PL46.js +0 -13
  247. package/dist/chunk-UOC2PL46.js.map +0 -1
  248. package/dist/chunk-VYFAZN3F.js +0 -372
  249. package/dist/chunk-VYFAZN3F.js.map +0 -1
  250. package/dist/chunk-WRAA7GVZ.js +0 -209
  251. package/dist/chunk-WRAA7GVZ.js.map +0 -1
  252. package/dist/chunk-XGELA764.js +0 -163
  253. package/dist/chunk-XGELA764.js.map +0 -1
  254. package/dist/chunk-YUXP55T2.js.map +0 -1
  255. package/dist/chunk-YWIKDKHY.js +0 -307
  256. package/dist/chunk-YWIKDKHY.js.map +0 -1
  257. package/dist/chunk-ZJ5AOYBH.js +0 -8
  258. package/dist/chunk-ZJ5AOYBH.js.map +0 -1
  259. package/dist/chunk-ZSUUOEPL.js +0 -731
  260. package/dist/chunk-ZSUUOEPL.js.map +0 -1
  261. package/dist/chunk-ZVJZ72HY.js.map +0 -1
  262. package/dist/circuit-breaker/index.d.ts +0 -197
  263. package/dist/circuit-breaker/index.js +0 -3
  264. package/dist/circuit-breaker/index.js.map +0 -1
  265. package/dist/deadline/index.js +0 -6
  266. package/dist/deadline/index.js.map +0 -1
  267. package/dist/debounce/index.js +0 -3
  268. package/dist/debounce/index.js.map +0 -1
  269. package/dist/extension/react.d.ts +0 -121
  270. package/dist/extension/react.js +0 -75
  271. package/dist/extension/react.js.map +0 -1
  272. package/dist/extension/subs/index.d.ts +0 -45
  273. package/dist/extension/subs/index.js +0 -80
  274. package/dist/extension/subs/index.js.map +0 -1
  275. package/dist/extension/test-utils.d.ts +0 -128
  276. package/dist/extension/test-utils.js +0 -277
  277. package/dist/extension/test-utils.js.map +0 -1
  278. package/dist/fan-out/index.js +0 -5
  279. package/dist/fan-out/index.js.map +0 -1
  280. package/dist/fold-BJPdjc9w.d.ts +0 -435
  281. package/dist/graph-B3L5e0N1.d.ts +0 -923
  282. package/dist/idempotency/adapter.d.ts +0 -62
  283. package/dist/idempotency/adapter.js +0 -4
  284. package/dist/idempotency/adapter.js.map +0 -1
  285. package/dist/idempotent-intake/index.d.ts +0 -188
  286. package/dist/idempotent-intake/index.js +0 -7
  287. package/dist/idempotent-intake/index.js.map +0 -1
  288. package/dist/journal/index.d.ts +0 -373
  289. package/dist/journal/index.js +0 -3
  290. package/dist/journal/index.js.map +0 -1
  291. package/dist/llm-call/index.d.ts +0 -311
  292. package/dist/llm-call/index.js +0 -16
  293. package/dist/llm-call/index.js.map +0 -1
  294. package/dist/machine-BtFWQmmq.d.ts +0 -804
  295. package/dist/monitored-run/index.js +0 -10
  296. package/dist/monitored-run/index.js.map +0 -1
  297. package/dist/paginated-walk/index.d.ts +0 -235
  298. package/dist/paginated-walk/index.js +0 -16
  299. package/dist/paginated-walk/index.js.map +0 -1
  300. package/dist/paginator/index.js +0 -3
  301. package/dist/paginator/index.js.map +0 -1
  302. package/dist/pbt/arbitraries/index.d.ts +0 -136
  303. package/dist/pbt/arbitraries/index.js +0 -3
  304. package/dist/pbt/arbitraries/index.js.map +0 -1
  305. package/dist/pbt/runners/index.d.ts +0 -118
  306. package/dist/pbt/runners/index.js +0 -5
  307. package/dist/pbt/runners/index.js.map +0 -1
  308. package/dist/poller/index.d.ts +0 -352
  309. package/dist/poller/index.js +0 -115
  310. package/dist/poller/index.js.map +0 -1
  311. package/dist/prediction/index.d.ts +0 -131
  312. package/dist/prediction/index.js +0 -4
  313. package/dist/prediction/index.js.map +0 -1
  314. package/dist/protocol-B5YmJr0d.d.ts +0 -45
  315. package/dist/pure/index.d.ts +0 -3
  316. package/dist/pure/index.js +0 -4
  317. package/dist/pure/index.js.map +0 -1
  318. package/dist/rate-limit/index.d.ts +0 -115
  319. package/dist/rate-limit/index.js +0 -3
  320. package/dist/rate-limit/index.js.map +0 -1
  321. package/dist/reconciler/index.d.ts +0 -193
  322. package/dist/reconciler/index.js +0 -164
  323. package/dist/reconciler/index.js.map +0 -1
  324. package/dist/recorder/index.js +0 -3
  325. package/dist/recorder/index.js.map +0 -1
  326. package/dist/reducer-4GNR6b8B.d.ts +0 -447
  327. package/dist/resilient-call/index.d.ts +0 -320
  328. package/dist/resilient-call/index.js +0 -14
  329. package/dist/resilient-call/index.js.map +0 -1
  330. package/dist/retry-to-success/index.d.ts +0 -109
  331. package/dist/retry-to-success/index.js +0 -37
  332. package/dist/retry-to-success/index.js.map +0 -1
  333. package/dist/run-pAcmBpah.d.ts +0 -713
  334. package/dist/runtime-types-CNLmhWif.d.ts +0 -517
  335. package/dist/saga/index.d.ts +0 -241
  336. package/dist/saga/index.js +0 -150
  337. package/dist/saga/index.js.map +0 -1
  338. package/dist/samples-B3My5oh2.d.ts +0 -59
  339. package/dist/snapshot/index.js +0 -5
  340. package/dist/snapshot/index.js.map +0 -1
  341. package/dist/subs/index.d.ts +0 -472
  342. package/dist/subs/index.js +0 -7
  343. package/dist/subs/index.js.map +0 -1
  344. package/dist/throttle/index.d.ts +0 -134
  345. package/dist/throttle/index.js +0 -3
  346. package/dist/throttle/index.js.map +0 -1
  347. package/dist/throttled-input/index.js.map +0 -1
  348. package/dist/token-refresh/index.d.ts +0 -216
  349. package/dist/token-refresh/index.js +0 -6
  350. package/dist/token-refresh/index.js.map +0 -1
  351. package/dist/trace-replay/index.js +0 -6
  352. package/dist/trace-replay/index.js.map +0 -1
  353. package/dist/with-deadline/index.d.ts +0 -197
  354. package/dist/with-deadline/index.js +0 -111
  355. package/dist/with-deadline/index.js.map +0 -1
  356. package/dist/with-resilience/index.d.ts +0 -225
  357. package/dist/with-resilience/index.js +0 -240
  358. package/dist/with-resilience/index.js.map +0 -1
  359. package/dist/with-telemetry/index.d.ts +0 -150
  360. package/dist/with-telemetry/index.js +0 -70
  361. package/dist/with-telemetry/index.js.map +0 -1
  362. package/dist/work-queue/adapter.d.ts +0 -84
  363. package/dist/work-queue/adapter.js +0 -4
  364. package/dist/work-queue/adapter.js.map +0 -1
  365. package/dist/work-queue/ops.d.ts +0 -71
  366. package/dist/work-queue/ops.js +0 -3
  367. package/dist/work-queue/ops.js.map +0 -1
  368. package/dist/workflow/index.d.ts +0 -485
  369. package/dist/workflow/index.js +0 -244
  370. package/dist/workflow/index.js.map +0 -1
  371. /package/dist/{cache → paginate}/index.js.map +0 -0
  372. /package/dist/{chart/inspect → persistence}/index.js.map +0 -0
@@ -1,713 +0,0 @@
1
- import { C as Cmd, c as Reducer } from './core-Co0LWkIA.js';
2
- import { Parts } from './chart/index.js';
3
- import { E as EventName, c as StateName, C as Chart, d as Strict, T as Total, e as CellEdgeKey, f as InitialState, g as Ty, h as SuccessFinal, i as ErrorFinal, S as StateOf, a as CmdOf, M as MsgOf, j as MsgIn } from './graph-B3L5e0N1.js';
4
- import { I as ImportedLane, a as ImportedChart, P as PhaseStanding } from './fold-BJPdjc9w.js';
5
-
6
- /** The shape a lane task's chart has at EITHER door. */
7
- interface LaneRegion {
8
- readonly events: Readonly<Record<string, unknown>>;
9
- readonly states: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
10
- }
11
- /**
12
- * A lane, as an author writes it.
13
- *
14
- * The nesting IS the structure: `phases` is an ordered record of phase name →
15
- * the tasks running concurrently in that phase → the chart each of those tasks
16
- * is an instance of. Nothing states the phase order (it is the key order),
17
- * nothing states a phase's task set (it is the keys), and nothing states which
18
- * finals are which (the charts say).
19
- */
20
- interface LaneSpec {
21
- /** The lane's own id — what a report titles itself with. */
22
- readonly id?: string;
23
- /** What fires this lane, when something does. */
24
- readonly trigger?: string;
25
- /** Phase name → task id → the chart that task runs. IN ORDER. */
26
- readonly phases: Readonly<Record<string, Readonly<Record<string, LaneRegion>>>>;
27
- /** The lane's two endings. `tripped` is where an error final lands it. */
28
- readonly terminals: {
29
- readonly complete: string;
30
- readonly tripped: string;
31
- };
32
- /**
33
- * The retry budget, per task, where it is not {@link RETRY_BUDGET}.
34
- *
35
- * SUPPLIED, not derived, and the one thing on this interface that is. The
36
- * guarded edge's predicate is `retries < maxRetries` and no chart declares
37
- * the right-hand side — it is a property of the RUN, which is why fabrika
38
- * keeps it in the document's `context` rather than in the machine.
39
- */
40
- readonly retries?: Readonly<Record<string, number>>;
41
- /** Anything else the lane carries per task, passed through untouched. */
42
- readonly extras?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
43
- }
44
- type Key<K> = K extends string | number ? `${K}` : never;
45
- type Keyed<R> = {
46
- [K in keyof R as Key<K>]: R[K];
47
- };
48
- type TaskIdsIn<P> = {
49
- [K in keyof P]: Key<keyof P[K]>;
50
- }[keyof P];
51
- /**
52
- * Task ids declared under more than one phase.
53
- *
54
- * DEGENERACY-GUARDED, and not for tidiness: `Omit<P, K>` over a `P` with an
55
- * index signature is `P` again, so at a computed-key phase record this reads
56
- * every task as declared twice and accuses the author of a duplicate they did
57
- * not write. {@link LaneLiteralAlphabets} is what actually went wrong there,
58
- * and it is ordered ahead of this so it is what the author is told.
59
- */
60
- type DuplicateTasks<P> = [IsDegenerate$1<TaskIdsIn<P>>] extends [true] ? never : {
61
- [K in keyof P]: Extract<Key<keyof P[K]>, TaskIdsIn<Omit<P, K>>>;
62
- }[keyof P];
63
- /** Phases whose task record is empty — a phase that completes on arrival. */
64
- type EmptyPhases<P> = {
65
- [K in keyof P]: [keyof P[K]] extends [never] ? Key<K> : never;
66
- }[keyof P];
67
- /** The three alphabets a lane derives, each refused where it degenerated. */
68
- type LaneLiteralAlphabets<S> = ([IsDegenerate$1<Key<keyof PhasesOf<S>>>] extends [
69
- true
70
- ] ? {
71
- readonly __lanePhaseNamesMustBeLiteralsAddAsConst: true;
72
- } : unknown) & ([IsDegenerate$1<TaskIdsIn<PhasesOf<S>>>] extends [true] ? {
73
- readonly __laneTaskIdsMustBeLiteralsAddAsConst: true;
74
- } : unknown) & ([IsDegenerate$1<TerminalsOf<S>>] extends [true] ? {
75
- readonly __laneTerminalsMustBeLiteralsAddAsConst: true;
76
- } : unknown);
77
- /**
78
- * Task ids, or event names, carrying a dot.
79
- *
80
- * `${task}.${event}` IS the lane's wire key — `runLane` compiles each region
81
- * under `ns = taskId` and `foldLane` splits an incoming name at the FIRST dot —
82
- * so a dot on either side re-partitions the key space. Task `a` + event `b.GO`
83
- * and task `a.b` + event `GO` both register `"a.b.GO"`: last writer wins, one
84
- * task's event is unreachable forever, and a message addressed to `a` moves
85
- * `a.b`. And task `epic.issue_1` emits a log line the splitter can never route
86
- * back. Banning the dot makes the collision unrepresentable for every pairing
87
- * at once, which is the same move `graph.ts` makes for a foreign event name and
88
- * for a state name.
89
- */
90
- type DottedTaskIds<P> = Extract<TaskIdsIn<P>, `${string}.${string}`>;
91
- type DottedEventTasks<P> = {
92
- [K in keyof P]: {
93
- [T in keyof P[K]]: [IsDegenerate$1<EventName<P[K][T]>>] extends [true] ? never : [Extract<EventName<P[K][T]>, `${string}.${string}`>] extends [never] ? never : Key<T>;
94
- }[keyof P[K]];
95
- }[keyof P];
96
- /**
97
- * Task ids whose chart hands a transition to a hand-written cell.
98
- *
99
- * Degeneracy-guarded like its two siblings below: `CellEdgeKey` over an
100
- * imported chart is `never` for the same reason it is `never` over a chart with
101
- * no cell edge, and reading the first as the second is how a check that cannot
102
- * be asked pretends to have been answered. It happens to be the SAFE direction
103
- * here — the answer is "no cell", which is what the imported door always
104
- * says — but a check that is right by luck is a check that stops being right.
105
- */
106
- type CellDelegatingTasks<P> = {
107
- [K in keyof P]: {
108
- [T in keyof P[K]]: [IsDegenerate$1<StateName<P[K][T]>>] extends [true] ? never : [CellEdgeKey<P[K][T]>] extends [never] ? never : Key<T>;
109
- }[keyof P[K]];
110
- }[keyof P];
111
- /** Task ids whose chart marks no `initial: true` — the fold has no zero. */
112
- type NoInitialTasks<P> = {
113
- [K in keyof P]: {
114
- [T in keyof P[K]]: [IsDegenerate$1<StateName<P[K][T]>>] extends [true] ? never : [InitialState<P[K][T]>] extends [never] ? Key<T> : never;
115
- }[keyof P[K]];
116
- }[keyof P];
117
- /**
118
- * Task ids whose chart marks MORE THAN ONE `initial: true`.
119
- *
120
- * Zero and two are both wrong and only zero was caught. Two is the worse of
121
- * the pair, because it does not fail — it splits: `laneShape` walked the states
122
- * and kept the LAST one it saw, `initialOf` (and therefore the fold, and
123
- * therefore every report) takes the FIRST, so the report printed a start state
124
- * the fold never booted into. `graph.ts` refuses the same thing on a single
125
- * chart with `__chartDeclaresManyInitialStates`; the lane door had dropped it,
126
- * because a lane region's entry is per-INSTANCE (`boot()`) and the check that
127
- * used to sit on the chart's own `InitialData` went with it.
128
- */
129
- type ManyInitialTasks<P> = {
130
- [K in keyof P]: {
131
- [T in keyof P[K]]: [IsDegenerate$1<StateName<P[K][T]>>] extends [true] ? never : [IsUnion<InitialState<P[K][T]>>] extends [true] ? Key<T> : never;
132
- }[keyof P[K]];
133
- }[keyof P];
134
- /** Task ids whose chart declares no final — its phase could never complete. */
135
- type NoFinalTasks<P> = {
136
- [K in keyof P]: {
137
- [T in keyof P[K]]: [IsDegenerate$1<StateName<P[K][T]>>] extends [true] ? never : [SuccessFinal<P[K][T]> | ErrorFinal<P[K][T]>] extends [never] ? Key<T> : never;
138
- }[keyof P[K]];
139
- }[keyof P];
140
- /** `graph.ts`'s own union test — a `T` that is not a single member. */
141
- type IsUnion<T, U = T> = T extends unknown ? [U] extends [T] ? false : true : never;
142
- /** A chart's `ctx`, as declared — the `Ty<…>` payload, unwrapped. */
143
- type LaneCtxOf<C> = C extends {
144
- readonly ctx: Ty<infer T>;
145
- } ? T : unknown;
146
- /** Does any of `C`'s edges carry a `when`? */
147
- type HasGuardedEdge<C> = C extends {
148
- readonly states: infer G;
149
- } ? {
150
- [P in keyof G]: {
151
- [S in keyof G[P]]: G[P][S] extends {
152
- readonly on: infer O;
153
- } ? {
154
- [E in keyof O]: O[E] extends {
155
- readonly when: string;
156
- } ? true : never;
157
- }[keyof O] : never;
158
- }[keyof G[P]];
159
- }[keyof G] : never;
160
- /** The budget the fold's guarded arm reads, and the only shape it can read. */
161
- type RetryBudgetCtx = {
162
- readonly retries: number;
163
- readonly maxRetries: number;
164
- };
165
- /** Task ids that guard an edge on something the fold cannot evaluate. */
166
- type GuardsOffTheBudgetTasks<P> = {
167
- [K in keyof P]: {
168
- [T in keyof P[K]]: [IsDegenerate$1<StateName<P[K][T]>>] extends [true] ? never : [HasGuardedEdge<P[K][T]>] extends [never] ? never : LaneCtxOf<P[K][T]> extends RetryBudgetCtx ? never : Key<T>;
169
- }[keyof P[K]];
170
- }[keyof P];
171
- /**
172
- * Task ids whose region never went through `defineChart`.
173
- *
174
- * `LaneRegion` is the structural minimum BOTH doors satisfy, which is what lets
175
- * one type parameter carry either — and it is also a hole: a hand-written
176
- * object of that shape passes it, so `Strict` and `Total` never run, a typo'd
177
- * target is never checked, and the fold lands the task in a state that does not
178
- * exist and leaves it there forever with no diagnostic. A brand stamped by
179
- * `defineChart` would be the tighter fix; it is not available from here, since
180
- * that would change `defineChart`'s own return type. So the region is put
181
- * through the checking door FROM here instead: a chart that satisfies its own
182
- * F-bounded constraint plus `Strict` and `Total` is a chart `defineChart` would
183
- * have accepted, whatever produced it, and one that does not is refused by the
184
- * name of the door it skipped.
185
- *
186
- * Stands down at the imported door, where `Chart<C>` is not a question an
187
- * `ImportedChart` can be asked.
188
- */
189
- type UncheckedRegionTasks<P> = {
190
- [K in keyof P]: {
191
- [T in keyof P[K]]: [IsDegenerate$1<StateName<P[K][T]>>] extends [true] ? never : [P[K][T]] extends [Chart<P[K][T]> & Strict<P[K][T]> & Total<P[K][T]>] ? never : Key<T>;
192
- }[keyof P[K]];
193
- }[keyof P];
194
- type PhasesOf<S> = S extends {
195
- readonly phases: infer P;
196
- } ? P : never;
197
- type TerminalsOf<S> = S extends {
198
- readonly terminals: {
199
- readonly complete: infer C;
200
- readonly tripped: infer T;
201
- };
202
- } ? C | T : never;
203
- type RetryKeysOf<S> = S extends {
204
- readonly retries: infer R;
205
- } ? Key<keyof R> : never;
206
- /**
207
- * The authoring mistakes assignability can catch — the lane's own shape, and
208
- * the charts it was handed.
209
- *
210
- * THE ORDER IS LOAD-BEARING. {@link LaneLiteralAlphabets} comes first because
211
- * every check under it is a question about a union of literals, and at a
212
- * degenerate alphabet those questions do not merely go unanswered — they answer
213
- * WRONGLY. With two phases and a computed task key the old order accused the
214
- * author of `__taskDeclaredInTwoPhases` for a task declared exactly once, which
215
- * is a diagnostic that sends them looking in the one place the mistake is not.
216
- * A check that cannot be asked stands down; a check that would lie is ordered
217
- * behind the one that names the real cause.
218
- *
219
- * The chart-shaped ones stand down at the imported door, where the answer would
220
- * be a guess rather than a fact, and {@link defineLane}'s runtime checks catch
221
- * what they can there instead. Where a guarantee cannot be had, it is thrown
222
- * for rather than pretended.
223
- */
224
- type LaneChecks<S> = LaneLiteralAlphabets<S> & ([DuplicateTasks<PhasesOf<S>>] extends [never] ? unknown : {
225
- readonly __taskDeclaredInTwoPhases: DuplicateTasks<PhasesOf<S>>;
226
- }) & ([EmptyPhases<PhasesOf<S>>] extends [never] ? unknown : {
227
- readonly __phaseDeclaresNoTasks: EmptyPhases<PhasesOf<S>>;
228
- }) & ([Extract<TerminalsOf<S>, Key<keyof PhasesOf<S>>>] extends [never] ? unknown : {
229
- readonly __terminalCollidesWithAPhase: Extract<TerminalsOf<S>, Key<keyof PhasesOf<S>>>;
230
- }) & ([Exclude<RetryKeysOf<S>, TaskIdsIn<PhasesOf<S>>>] extends [never] ? unknown : {
231
- readonly __retryBudgetNamesAnUnknownTask: Exclude<RetryKeysOf<S>, TaskIdsIn<PhasesOf<S>>>;
232
- }) & ([DottedTaskIds<PhasesOf<S>>] extends [never] ? unknown : {
233
- readonly __laneTaskIdCannotContainADot: DottedTaskIds<PhasesOf<S>>;
234
- }) & ([DottedEventTasks<PhasesOf<S>>] extends [never] ? unknown : {
235
- readonly __laneRegionEventNameCannotContainADot: DottedEventTasks<PhasesOf<S>>;
236
- }) & ([UncheckedRegionTasks<PhasesOf<S>>] extends [never] ? unknown : {
237
- readonly __laneRegionDidNotComeThroughDefineChart: UncheckedRegionTasks<PhasesOf<S>>;
238
- }) & ([CellDelegatingTasks<PhasesOf<S>>] extends [never] ? unknown : {
239
- readonly __laneTaskChartDelegatesToACell: CellDelegatingTasks<PhasesOf<S>>;
240
- }) & ([NoInitialTasks<PhasesOf<S>>] extends [never] ? unknown : {
241
- readonly __laneTaskChartMarksNoInitialState: NoInitialTasks<PhasesOf<S>>;
242
- }) & ([ManyInitialTasks<PhasesOf<S>>] extends [never] ? unknown : {
243
- readonly __laneTaskChartMarksManyInitialStates: ManyInitialTasks<PhasesOf<S>>;
244
- }) & ([GuardsOffTheBudgetTasks<PhasesOf<S>>] extends [never] ? unknown : {
245
- readonly __laneRegionGuardsOnSomethingOtherThanTheRetryBudget: GuardsOffTheBudgetTasks<PhasesOf<S>>;
246
- }) & ([NoFinalTasks<PhasesOf<S>>] extends [never] ? unknown : {
247
- readonly __laneTaskChartDeclaresNoFinal: NoFinalTasks<PhasesOf<S>>;
248
- });
249
- /** The self-referential constraint `defineLane` binds its argument with. */
250
- type LaneOf<S> = LaneSpec & LaneChecks<S>;
251
- /** The lane does not hold together — with every defect named, never a half-lane. */
252
- declare class LaneShapeError extends Error {
253
- readonly defects: readonly string[];
254
- readonly name = "LaneShapeError";
255
- readonly _tag: "LaneShapeError";
256
- constructor(defects: readonly string[]);
257
- }
258
- /**
259
- * An authored lane: the {@link ImportedLane} every reader takes, plus the spec
260
- * it was authored from.
261
- *
262
- * `spec` is the whole typed door. It is DATA, not a phantom — the lane keeps
263
- * the charts it was handed, so `LaneState<L>` and `LaneMsg<L>` read the literal
264
- * types straight off it and nothing has to be re-declared beside the lane. An
265
- * imported lane simply has no `spec`, which is exactly what makes it read back
266
- * as `Chart<unknown>` through the same derivations: one formula, two doors.
267
- */
268
- interface Lane<S> extends ImportedLane {
269
- /** The spec this lane was authored from — where the literal types live. */
270
- readonly spec: S;
271
- }
272
- /**
273
- * A lane, from phases of charts.
274
- *
275
- * The result is an {@link ImportedLane} and nothing more — the SAME value
276
- * `chartFromWorkflow` returns for a `workflow.json`, so `foldLane`,
277
- * `deriveLaneStatus`, `laneReport` and `inspectLane` all take it without a
278
- * second code path. There is exactly one lane representation in this module and
279
- * two ways to obtain it.
280
- *
281
- * ```ts
282
- * const lane = defineLane({
283
- * id: "epic-5728",
284
- * phases: {
285
- * phase1: { issue_5729: coderChart, issue_5730: coderChart },
286
- * phase2: { issue_5731: coderChart },
287
- * },
288
- * terminals: { complete: "complete", tripped: "tripped" },
289
- * });
290
- * ```
291
- *
292
- * @throws {LaneShapeError} for the defects the type layer cannot see — a chart
293
- * with no `initial: true`, a chart with no final at all (its phase could
294
- * never complete, so the lane could never advance), and two terminals spelled
295
- * the same way.
296
- */
297
- declare function defineLane<const S extends LaneOf<S>>(spec: S): Lane<S>;
298
- /** What an `ImportedLane` reads back as: every alphabet the bare `string`. */
299
- interface ImportedSpec {
300
- readonly phases: Readonly<Record<string, Readonly<Record<string, ImportedChart>>>>;
301
- readonly terminals: {
302
- readonly complete: string;
303
- readonly tripped: string;
304
- };
305
- }
306
- /** The spec a lane was authored from — an imported lane carries none. */
307
- type SpecOf<L> = L extends {
308
- readonly spec: infer S;
309
- } ? S : ImportedSpec;
310
- /**
311
- * The lane's phases, keyed the way every other layer keys them: by strings.
312
- *
313
- * A phase or a task written as a number (`{ 5729: coder }` — and fabrika's task
314
- * ids ARE GitHub issue numbers) is a key like any other; it is only `keyof`
315
- * that hands it back as a number. Normalising here, ONCE, is what lets every
316
- * derivation below stay the plain formula it was.
317
- */
318
- type Phases<L> = Keyed<PhasesOf<SpecOf<L>>>;
319
- /** The tasks of phase `P`, keyed by string for the same reason. */
320
- type TasksOf<L, P extends LanePhaseName<L>> = Keyed<Phases<L>[P]>;
321
- /**
322
- * `[string] extends [N]` — the alphabet stopped being a union of literals.
323
- *
324
- * The same guard `graph.ts` uses to catch a computed string key, here for the
325
- * opposite reason: an imported chart is DELIBERATELY degenerate, and a subset
326
- * derived off it (`InitialState`, `SuccessFinal`, `CellEdgeKey`) collapses to
327
- * `never` rather than to `string`. `never` would be a lie — the imported door
328
- * knows nothing about those states, it does not know there are none — so every
329
- * derived subset below is read through {@link StateSubset}, which hands back
330
- * `string` where the chart cannot be asked.
331
- */
332
- type IsDegenerate$1<N> = [string] extends [N] ? true : false;
333
- /** A derived subset of a chart's states — `string` where the chart is imported. */
334
- type StateSubset<C, T> = [IsDegenerate$1<StateName<C>>] extends [true] ? string : T;
335
- /** Every phase name, as a union. The ORDER is the value's, not the type's. */
336
- type LanePhaseName<L> = Extract<keyof Phases<L>, string>;
337
- /** The task ids declared in phase `P`. */
338
- type LaneTasksIn<L, P extends LanePhaseName<L>> = Extract<keyof TasksOf<L, P>, string>;
339
- /** Every task id in the lane, whatever phase it runs in. */
340
- type LaneTaskId<L> = {
341
- [P in LanePhaseName<L>]: LaneTasksIn<L, P>;
342
- }[LanePhaseName<L>];
343
- /** The chart task `T` runs — ITS chart, not a union over the lane's charts. */
344
- type LaneTaskChart<L, T extends LaneTaskId<L>> = {
345
- [P in LanePhaseName<L>]: T extends keyof TasksOf<L, P> ? TasksOf<L, P>[T] : never;
346
- }[LanePhaseName<L>];
347
- /** The phase task `T` runs in. `defineLane` refuses a task with two. */
348
- type LanePhaseOf<L, T extends LaneTaskId<L>> = {
349
- [P in LanePhaseName<L>]: T extends keyof TasksOf<L, P> ? P : never;
350
- }[LanePhaseName<L>];
351
- /** The tasks running BESIDE `T` — its phase's set, minus itself. */
352
- type LaneSiblings<L, T extends LaneTaskId<L>> = Exclude<LaneTasksIn<L, LanePhaseOf<L, T> & LanePhaseName<L>>, T>;
353
- /** Where task `T`'s fold starts — `initial: true`, off its own chart. */
354
- type LaneInitial<L, T extends LaneTaskId<L>> = StateSubset<LaneTaskChart<L, T>, InitialState<LaneTaskChart<L, T>>>;
355
- /** `end: true` on task `T`'s chart — the endings that let its phase complete. */
356
- type LaneSuccessFinals<L, T extends LaneTaskId<L>> = StateSubset<LaneTaskChart<L, T>, SuccessFinal<LaneTaskChart<L, T>>>;
357
- /** `end: "error"` on task `T`'s chart — the endings that trip the lane. */
358
- type LaneErrorFinals<L, T extends LaneTaskId<L>> = StateSubset<LaneTaskChart<L, T>, ErrorFinal<LaneTaskChart<L, T>>>;
359
- /** The lane's two endings, as a union of the two literals. */
360
- type LaneTerminal<L> = TerminalsOf<SpecOf<L>>;
361
- /**
362
- * A phase that is not carrying task states.
363
- *
364
- * ONE TYPE, TWO NAMES, and it used to be two types with ONE name: this and
365
- * `report/fold.ts`'s {@link PhaseStanding} were both exported as
366
- * `PhaseStanding` from two entry points with different members, so which one a
367
- * reader got depended on which module they happened to import. It is a
368
- * SUBSET, so it is spelled as one — the phase standings minus the one reading
369
- * in which the phase IS its tasks' states, which is exactly why `LaneState`'s
370
- * phase leaf cannot hold `"active"`: while a phase is active there is a task
371
- * map there instead.
372
- */
373
- type PhaseAtRest = Exclude<PhaseStanding, "active">;
374
- /**
375
- * The compound state of a whole lane.
376
- *
377
- * A lane is not one machine and its state is not one state:
378
- *
379
- * ```ts
380
- * const s: LaneState<typeof lane> = {
381
- * phases: {
382
- * phase1: { issue_5729: { type: "build", retries: 0, maxRetries: 2 } },
383
- * phase2: "waiting",
384
- * },
385
- * lane: "running",
386
- * };
387
- * ```
388
- *
389
- * Every leaf is that task's OWN `StateOf<chart>`, narrowed — `issue_5729` may
390
- * only stand in a state its own chart declares, carrying its own `ctx`. At an
391
- * imported lane the same formula reads back with `string` throughout.
392
- */
393
- type LaneState<L> = {
394
- readonly phases: {
395
- readonly [P in LanePhaseName<L>]: PhaseAtRest | {
396
- readonly [T in LaneTasksIn<L, P>]: StateOf<TasksOf<L, P>[T]>;
397
- };
398
- };
399
- /** `running`, or the terminal it ended on. */
400
- readonly lane: "running" | LaneTerminal<L>;
401
- };
402
- /**
403
- * One message, addressed to one task of the lane.
404
- *
405
- * The union is built PER TASK, not as one alphabet across the lane: the event
406
- * is narrowed to the events that task's own chart declares, so a message
407
- * carrying a real event to the wrong task is as much a compile error as one
408
- * carrying an event nothing declares. A lane of two different chart templates
409
- * is where that stops being a technicality.
410
- */
411
- type LaneMsg<L> = {
412
- [P in LanePhaseName<L>]: {
413
- [T in LaneTasksIn<L, P>]: {
414
- readonly task: T;
415
- readonly event: EventName<TasksOf<L, P>[T]>;
416
- };
417
- }[LaneTasksIn<L, P>];
418
- }[LanePhaseName<L>];
419
- /** One task of a lane, with everything about it that is derivable. */
420
- interface LaneTaskShape {
421
- readonly id: string;
422
- /** The phase it runs in. */
423
- readonly phase: string;
424
- /** That phase's position in the sequence. */
425
- readonly phaseIndex: number;
426
- /** Where its fold starts — `initial: true`, read off the chart. */
427
- readonly initial: string;
428
- /** The right-hand side of the guarded edge's `retries < maxRetries`. */
429
- readonly maxRetries: number;
430
- /** `end: true` — the endings that let the phase complete. */
431
- readonly successFinals: readonly string[];
432
- /** `end: "error"` — the endings that trip the lane. */
433
- readonly errorFinals: readonly string[];
434
- /** The tasks running BESIDE this one, in the same phase. */
435
- readonly siblings: readonly string[];
436
- }
437
- /** One phase, and the tasks that run concurrently inside it. */
438
- interface LanePhaseShape {
439
- readonly name: string;
440
- readonly index: number;
441
- readonly tasks: readonly string[];
442
- /** The phase this one's `onDone` advances to, or the lane's ending. */
443
- readonly next: string;
444
- }
445
- /**
446
- * A whole lane, read as data. Nothing here is supplied — every field is a
447
- * derivation over the phases and the charts they hold.
448
- */
449
- interface LaneShape {
450
- readonly id?: string;
451
- readonly trigger?: string;
452
- readonly phases: readonly LanePhaseShape[];
453
- /** Every task, in phase order then declaration order. */
454
- readonly tasks: readonly LaneTaskShape[];
455
- readonly terminals: {
456
- readonly complete: string;
457
- readonly tripped: string;
458
- };
459
- /**
460
- * Tasks whose chart declares NO error final.
461
- *
462
- * Not a defect — a lane may legitimately hold a task that cannot fail. It is
463
- * reported because it is invisible otherwise and it changes what the lane can
464
- * do: no run of that task can ever reach the `tripped` terminal.
465
- */
466
- readonly cannotTrip: readonly string[];
467
- }
468
- /**
469
- * Read a lane — imported or authored — into its {@link LaneShape}.
470
- *
471
- * Pure and total. It executes nothing, it validates nothing, and it refuses
472
- * nothing: it is the reader half, and a lane that is odd (a task with no error
473
- * final, say) comes back described rather than rejected. {@link defineLane} is
474
- * where an authoring mistake is refused; this is where any lane is read.
475
- */
476
- declare function laneShape(lane: ImportedLane): LaneShape;
477
-
478
- /**
479
- * Every region's leaf state, keyed by task.
480
- *
481
- * This is `LaneState`'s information with the phase dimension left out, and the
482
- * omission is the point: `LaneState` is the READING shape (what is running
483
- * beside what, which phases are waiting), and every one of those facts is
484
- * derived from the leaves plus the lane's phase order. A run that stored the
485
- * phase standing beside the leaves would be storing a derived fact, which is
486
- * exactly the mistake `laneShape` exists not to make. `deriveLaneStatus(lane,
487
- * state.regions)` produces the compound reading whenever it is wanted.
488
- */
489
- type LaneRegions<L> = {
490
- readonly [T in LaneTaskId<L>]: StateOf<LaneTaskChart<L, T>>;
491
- };
492
- /**
493
- * The state of a lane in flight: every region's leaf, plus which of the three
494
- * things the lane itself is doing.
495
- *
496
- * `lane` is DERIVED after every step — it is `laneTerminalReached` over the
497
- * leaves — and it is stored because it is what a host reads to know the run is
498
- * over. It can never disagree with the leaves: nothing else writes it.
499
- */
500
- type LaneRunState<L> = {
501
- readonly regions: LaneRegions<L>;
502
- readonly lane: "running" | LaneTerminal<L>;
503
- };
504
- /**
505
- * The message union a running lane consumes: `{ task, event }`, on the wire.
506
- *
507
- * `MsgIn<C, NS>` is the chart module's own answer to "how does the compiled
508
- * table key event E under namespace NS", so instantiating it per task at
509
- * `NS = T` gives `${task}.${event}` with the payload that event declares — the
510
- * addressing pair of `LaneMsg<L>` and the key `keyOf` builds from it, which are
511
- * the same fact spelled for a reader and for a dispatcher.
512
- */
513
- type LaneRunMsg<L> = {
514
- [T in LaneTaskId<L>]: MsgIn<LaneTaskChart<L, T>, T> & {
515
- readonly type: string;
516
- };
517
- }[LaneTaskId<L>];
518
- /** One region cmd, wearing the task that emitted it. */
519
- type Tagged<T extends string, K> = K extends {
520
- readonly type: infer N extends string;
521
- } ? // the same witness `LaneRunMsg` carries, for the same reason: `Cmd` is
522
- Omit<K, "type" | "lane"> & {
523
- readonly type: `${T}.${N}`;
524
- readonly lane: {
525
- readonly task: T;
526
- };
527
- } & Cmd : never;
528
- /**
529
- * The cmd union a running lane emits — each region's own `CmdOf<chart>`, under
530
- * the SAME `${task}.${name}` namespace the messages arrive in.
531
- *
532
- * The task id is carried as well as spelled into the type, because the two
533
- * readers differ: an interpreter's handler map is keyed by `cmd.type` (so the
534
- * namespace has to be in the name), while the code that routes the reply back
535
- * wants the task id without parsing it out of a string.
536
- *
537
- * IT IS NESTED, and `lane` is the one key a region's cmd may not use — which
538
- * {@link LaneRunChecks} refuses at the typed door. The tag used to be a flat
539
- * `task`, spread OVER the payload, and `task` is an entirely ordinary field for
540
- * a cmd in a work lane to carry: the author's value was replaced by the lane's
541
- * task id, and `Tagged` narrowed the author's field to that literal, so there
542
- * was no type error either. One nested key is a smaller surface than every key
543
- * a chart might plausibly name.
544
- */
545
- type LaneCmd<L> = {
546
- [T in LaneTaskId<L>]: Tagged<T, CmdOf<LaneTaskChart<L, T>>>;
547
- }[LaneTaskId<L>];
548
- /**
549
- * One task's half of the run.
550
- *
551
- * Both halves are typed to THAT task's chart — `parts` against its edges, its
552
- * guards and its cmds; `boot` against its states. Neither is a union across the
553
- * lane's charts, which is what makes a lane of two different templates safe to
554
- * hand code to.
555
- */
556
- interface LaneHand<C> {
557
- /** The code the chart cannot hold — assigns, guards, cmd builders, cells. */
558
- readonly parts: Parts<C, StateOf<C>, MsgOf<C>>;
559
- /**
560
- * Where THIS instance starts. An emitted epic boots each child where its
561
- * sub-issue actually is, so two instances of one chart start in two different
562
- * states and the chart's `initial: true` is the default rather than the law.
563
- *
564
- * Typed to THAT task's own chart, both ways: the return type is what makes
565
- * `() => ({ type: "queued", … })` infer the literal instead of widening to
566
- * `string`, and {@link LaneRunChecks} asks the same question a second time so
567
- * the diagnostic names the task rather than pointing at a state union.
568
- */
569
- readonly boot: () => StateOf<C>;
570
- }
571
- /** Every task's hand — one per region, none missing, none invented. */
572
- type LaneHands<L> = {
573
- readonly [T in LaneTaskId<L>]: LaneHand<LaneTaskChart<L, T>>;
574
- };
575
- /** `[string] extends [N]` — an imported chart's alphabet, which cannot be asked. */
576
- type IsDegenerate<N> = [string] extends [N] ? true : false;
577
- /** What `boot()` says it returns, for the task keyed `T` however it was spelled. */
578
- type BootOf<H, T> = Keyed<H>[T & keyof Keyed<H>] extends {
579
- readonly boot: () => infer B;
580
- } ? B : never;
581
- /**
582
- * Tasks whose `boot()` returns a state whose `type` is no longer a LITERAL.
583
- *
584
- * Hoisting the hands to a variable is what every author does the moment a lane
585
- * is assembled by a helper, and without a `satisfies` it widens `boot()`'s
586
- * `type` from `"queued"` to `string`. The check below then cannot answer its
587
- * question, and used to answer a DIFFERENT one — it named a task whose boot
588
- * state was entirely correct and sent the author to look at the one thing that
589
- * was right.
590
- *
591
- * So this is asked FIRST and says what actually happened. It is the hands' half
592
- * of `__laneTerminalsMustBeLiteralsAddAsConst` on the spec side: the same
593
- * mistake, the same shape of answer.
594
- */
595
- type BootLostItsLiterals<L, H> = {
596
- [T in LaneTaskId<L>]: [IsDegenerate<StateName<LaneTaskChart<L, T>>>] extends [
597
- true
598
- ] ? never : [BootOf<H, T>] extends [never] ? never : [
599
- IsDegenerate<BootOf<H, T> extends {
600
- readonly type: infer S;
601
- } ? S : never>
602
- ] extends [true] ? T : never;
603
- }[LaneTaskId<L>];
604
- /** Tasks whose `boot()` returns something that is not a state of THEIR chart. */
605
- type BootsOutsideItsChart<L, H> = {
606
- [T in LaneTaskId<L>]: [IsDegenerate<StateName<LaneTaskChart<L, T>>>] extends [
607
- true
608
- ] ? never : [BootOf<H, T>] extends [never] ? never : [
609
- IsDegenerate<BootOf<H, T> extends {
610
- readonly type: infer S;
611
- } ? S : never>
612
- ] extends [true] ? never : [BootOf<H, T>] extends [StateOf<LaneTaskChart<L, T>>] ? never : T;
613
- }[LaneTaskId<L>];
614
- /**
615
- * Tasks whose chart declares a FOREIGN event.
616
- *
617
- * `keyOf` leaves a foreign event's name bare under a namespace — on purpose:
618
- * `deadline_exceeded` is the same event for every instance of a chart, and the
619
- * name was never the author's to rename. A lane cannot hold that: a lane
620
- * message is addressed to ONE region, and a bare event names none of them.
621
- * Refused rather than broadcast, because "this event went to every region at
622
- * once" is a different machine than the one the phases describe.
623
- */
624
- type DeclaresAForeignEvent<L> = {
625
- [T in LaneTaskId<L>]: [IsDegenerate<EventName<LaneTaskChart<L, T>>>] extends [
626
- true
627
- ] ? never : [ForeignOf<LaneTaskChart<L, T>>] extends [never] ? never : T;
628
- }[LaneTaskId<L>];
629
- type ForeignOf<C> = C extends {
630
- readonly events: infer E;
631
- } ? {
632
- [K in keyof E]: E[K] extends {
633
- readonly foreign: true;
634
- } ? K : never;
635
- }[keyof E] : never;
636
- /**
637
- * Tasks whose chart declares a cmd carrying `lane` — the one reserved key.
638
- *
639
- * {@link LaneCmd} nests the task id under `lane` and a nested tag can still be
640
- * shadowed by a payload that spells the same key. It is refused rather than
641
- * silently overwritten, because "the field you declared is not the field your
642
- * interpreter receives" is the exact defect nesting was introduced to end.
643
- */
644
- type CmdCarriesTheLaneTag<L> = {
645
- [T in LaneTaskId<L>]: [
646
- Extract<CmdOf<LaneTaskChart<L, T>>, {
647
- readonly lane: unknown;
648
- }>
649
- ] extends [never] ? never : T;
650
- }[LaneTaskId<L>];
651
- /** The five authoring mistakes a RUN can make that a drawing cannot. */
652
- type LaneRunChecks<L, H> = ([
653
- Exclude<Key<keyof H>, LaneTaskId<L>>
654
- ] extends [never] ? unknown : {
655
- readonly __laneHandNamesAnUnknownTask: Exclude<Key<keyof H>, LaneTaskId<L>>;
656
- }) & ([BootLostItsLiterals<L, H>] extends [never] ? unknown : {
657
- readonly __laneHandsLostTheirLiteralTypesAddSatisfiesLaneHands: BootLostItsLiterals<L, H>;
658
- }) & ([BootsOutsideItsChart<L, H>] extends [never] ? unknown : {
659
- readonly __laneTaskBootsIntoAStateItsChartDoesNotDeclare: BootsOutsideItsChart<L, H>;
660
- }) & ([DeclaresAForeignEvent<L>] extends [never] ? unknown : {
661
- readonly __laneRegionChartDeclaresAForeignEvent: DeclaresAForeignEvent<L>;
662
- }) & ([CmdCarriesTheLaneTag<L>] extends [never] ? unknown : {
663
- readonly __laneRegionCmdDeclaresTheReservedLaneField: CmdCarriesTheLaneTag<L>;
664
- });
665
- /**
666
- * The self-referential constraint `runLane` binds its hands with.
667
- *
668
- * The CHECKS come first in the intersection, and the order is load-bearing for
669
- * the diagnostic rather than for the semantics: tsc reports the first
670
- * constituent that fails, so a hands object that boots a task into the wrong
671
- * state is told which RULE it broke and which TASK broke it, instead of being
672
- * handed that task's whole state union to compare by eye.
673
- */
674
- type LaneHandsOf<L, H> = LaneRunChecks<L, H> & LaneHands<L>;
675
- /**
676
- * A lane's `init` and `update` — the two halves of a `Machine` a lane can
677
- * derive, and exactly the two.
678
- */
679
- interface LaneRuntime<L> {
680
- readonly init: (loaded: LaneRunState<L> | null) => readonly [LaneRunState<L>, readonly LaneCmd<L>[]];
681
- readonly update: Reducer<LaneRunState<L>, LaneRunMsg<L>, LaneCmd<L>>;
682
- }
683
- /** What `runLane` reads off the spec: the charts, still carrying their types. */
684
- type RunnableSpec = {
685
- readonly phases: Readonly<Record<string, Readonly<Record<string, LaneRegion>>>>;
686
- };
687
- /**
688
- * Run a lane: one compiled region per task, one dispatch surface, one derived
689
- * lane standing.
690
- *
691
- * ```ts
692
- * const epic = defineLane({
693
- * phases: { phase1: { issue_5729: coder, issue_5730: coder } },
694
- * terminals: { complete: "complete", tripped: "tripped" },
695
- * });
696
- *
697
- * const machine = defineMachine({
698
- * ...runLane(epic, {
699
- * issue_5729: { parts, boot: () => ({ type: "queued", retries: 0, maxRetries: 2 }) },
700
- * // this one is already merged on GitHub — it boots where it IS.
701
- * issue_5730: { parts, boot: () => ({ type: "shipped", retries: 0, maxRetries: 2 }) },
702
- * }),
703
- * interpret,
704
- * });
705
- * ```
706
- *
707
- * @throws {LaneShapeError} for the run-time half of what the markers say: a
708
- * task with no chart on the spec, a region declaring a foreign event, and a
709
- * `boot()` landing on a state its chart does not declare.
710
- */
711
- declare function runLane<L extends Lane<RunnableSpec>, const H extends LaneHandsOf<L, H>>(lane: L, hands: H): LaneRuntime<L>;
712
-
713
- export { type LaneTaskShape as A, type LaneTasksIn as B, type LaneTerminal as C, defineLane as D, laneShape as E, runLane as F, type LaneTaskId as L, type PhaseAtRest as P, type LaneTaskChart as a, type LaneHandsOf as b, type Lane as c, type LaneChecks as d, type LaneCmd as e, type LaneErrorFinals as f, type LaneHand as g, type LaneHands as h, type LaneInitial as i, type LaneMsg as j, type LaneOf as k, type LanePhaseName as l, type LanePhaseOf as m, type LanePhaseShape as n, type LaneRegion as o, type LaneRegions as p, type LaneRunChecks as q, type LaneRunMsg as r, type LaneRunState as s, type LaneRuntime as t, type LaneShape as u, LaneShapeError as v, type LaneSiblings as w, type LaneSpec as x, type LaneState as y, type LaneSuccessFinals as z };