@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
@@ -0,0 +1,131 @@
1
+ /**
2
+ * internal/idempotency/idempotency — dedupe-by-key + last-result cache as pure state + ops.
3
+ *
4
+ * Same shape as `../../work-queue`'s `ops.ts` and `../../resilience/rate-limit`:
5
+ * a state type plus pure transition functions. Host-agnostic by construction —
6
+ * no `Date.now()`, no timers, no I/O. The caller injects the clock (`nowMs`)
7
+ * and wires the result into its own reducer / interpret. This keeps the store
8
+ * inside TEA's invariant 2 (transitions are pure: same inputs → same outputs,
9
+ * no `Date.now`) so a consumer can fold it through `update` and exercise it
10
+ * with `replay` / the pbt fold without a fake clock.
11
+ *
12
+ * Every op returns a NEW store value and never mutates its input (invariant 1 —
13
+ * state is a value, not a place). `seen` / `recall` are read-shaped predicates;
14
+ * `remember` / `evictExpired` return a new store.
15
+ *
16
+ * The use case: a webhook receiver, a retried queue message, or a repeated user
17
+ * action arrives carrying an idempotency key. `seen(store, key, now)` answers
18
+ * "did I already process this?"; `recall(store, key, now)` returns the cached
19
+ * result so the duplicate request gets the SAME response the original produced
20
+ * rather than re-running the side effect. `remember(store, key, value, now)`
21
+ * records the key + its result after the first run.
22
+ *
23
+ * Two eviction policies keep the store bounded, both injected at `initStore`:
24
+ *
25
+ * - **`ttlMs`** — an entry expires `ttlMs` after the `atMs` it was remembered
26
+ * at. `seen` / `recall` treat an expired entry as absent; `evictExpired`
27
+ * (and every `remember`) physically drops it. Without a TTL, entries live
28
+ * until evicted by capacity. The cutoff is half-open: an entry exactly
29
+ * `ttlMs` old is expired (`age >= ttlMs` drops it), matching `rate-limit`'s
30
+ * window edge — a key remembered at `t` no longer counts at `t + ttlMs`.
31
+ * - **`capacity`** — at most `capacity` entries are retained. When a
32
+ * `remember` would push the count past `capacity` (after expiry eviction),
33
+ * the OLDEST entries by insertion `order` are dropped until the count fits.
34
+ * Without a capacity, the store grows unbounded (TTL alone bounds it).
35
+ *
36
+ * `order` is the insertion-order index that capacity eviction reads — the keys
37
+ * oldest-first. It is the store's own LRU-by-insertion ledger, kept in lockstep
38
+ * with `entries` so `entries` never needs to be sorted to find the oldest.
39
+ *
40
+ * **Overwrite semantics** (decided + pinned by tests): re-`remember`ing an
41
+ * existing key is an UPDATE, not a no-op. It (1) overwrites `value`, (2)
42
+ * refreshes `atMs` to the new `nowMs` — so the TTL clock restarts and a
43
+ * frequently-seen key never expires — and (3) moves the key to the NEWEST
44
+ * position in `order` — so capacity eviction treats a re-remembered key as
45
+ * fresh, not as a stale candidate for eviction. This makes `remember` behave
46
+ * like "touch": a key actively being re-seen is kept alive on both the TTL and
47
+ * capacity axes.
48
+ *
49
+ * Internal since #47 — not published on any subpath; reached from inside the
50
+ * package as `internal/idempotency/idempotency`. Same one-shape-per-package rule
51
+ * as `work-queue`, `rate-limit`, and `do`.
52
+ */
53
+ /**
54
+ * A cached entry: the result `value` the original request produced and the
55
+ * clock reading `atMs` it was remembered at. `atMs` is the TTL anchor — expiry
56
+ * is measured from here, and a re-`remember` refreshes it. Both fields are
57
+ * plain data so the whole store is trivially JSON-serializable into a
58
+ * consumer's `Store<S>`.
59
+ */
60
+ interface IdempotencyEntry<V> {
61
+ readonly value: V;
62
+ readonly atMs: number;
63
+ }
64
+ /**
65
+ * The dedupe store: a map of `key → entry`, an insertion-`order` ledger
66
+ * (oldest-first) that capacity eviction reads, and the two optional bounds.
67
+ *
68
+ * `entries` and `order` are kept in lockstep — every key in `order` has an
69
+ * entry and vice versa. `capacity` / `ttlMs` are carried on the store (not
70
+ * passed per-op) so a single value fully describes the policy; a consumer
71
+ * persists the store and rehydrates the same bounds without re-deriving them.
72
+ */
73
+ interface IdempotencyStore<V> {
74
+ readonly entries: Readonly<Record<string, IdempotencyEntry<V>>>;
75
+ readonly order: readonly string[];
76
+ readonly capacity?: number;
77
+ readonly ttlMs?: number;
78
+ }
79
+ /**
80
+ * Create an empty store. `capacity` and `ttlMs` are both optional — omit both
81
+ * for an unbounded cache, supply either or both to bound by count, age, or
82
+ * both. Stored on the returned value so every later op reads the policy off
83
+ * the store rather than from a re-passed argument.
84
+ */
85
+ declare function initStore<V>(opts?: {
86
+ capacity?: number;
87
+ ttlMs?: number;
88
+ }): IdempotencyStore<V>;
89
+ /**
90
+ * True iff `key` is present AND not expired at `nowMs`. This is the dedupe
91
+ * predicate: a webhook / retried message / repeated action whose key returns
92
+ * `true` has already been processed and should be short-circuited (paired with
93
+ * `recall` to return the original result). PURE — reads only, never mutates.
94
+ */
95
+ declare function seen<V>(store: IdempotencyStore<V>, key: string, nowMs: number): boolean;
96
+ /**
97
+ * The cached `value` for `key` if present and unexpired at `nowMs`, else
98
+ * `undefined`. Use after `seen` returns `true` to replay the original result to
99
+ * a duplicate request. An expired entry reads as absent (returns `undefined`)
100
+ * even though it is physically still in `entries` until the next `remember` /
101
+ * `evictExpired` drops it. PURE — reads only, never mutates.
102
+ */
103
+ declare function recall<V>(store: IdempotencyStore<V>, key: string, nowMs: number): V | undefined;
104
+ /**
105
+ * Drop every entry expired at `nowMs` (older than `ttlMs`). Returns a NEW store
106
+ * with the survivors; `order` is rebuilt to drop the same keys, preserving the
107
+ * relative insertion order of the survivors. A no-TTL store returns an
108
+ * equivalent store (nothing ages out). PURE — the input store is never mutated.
109
+ */
110
+ declare function evictExpired<V>(store: IdempotencyStore<V>, nowMs: number): IdempotencyStore<V>;
111
+ /**
112
+ * Record `key → value` at `nowMs`, then enforce both bounds. PURE — returns a
113
+ * new store; the input is untouched.
114
+ *
115
+ * Order of operations (each step matters):
116
+ * 1. **Expiry eviction** — drop everything older than `ttlMs` first, so an
117
+ * expired key never occupies a capacity slot the new entry could take, and
118
+ * a stale entry under the same `key` is cleared before the overwrite.
119
+ * 2. **Insert / overwrite** — write the new entry. If `key` already exists,
120
+ * this is an UPDATE: `value` is overwritten, `atMs` is refreshed to
121
+ * `nowMs` (restarting the TTL clock), and the key is moved to the NEWEST
122
+ * position in `order` (removed from wherever it sat, appended at the end).
123
+ * See the module-level "Overwrite semantics" note.
124
+ * 3. **Capacity eviction** — if the entry count now exceeds `capacity`, drop
125
+ * the OLDEST keys by `order` until the count fits. Because step 2 moves a
126
+ * re-remembered key to the newest position, an actively re-seen key is
127
+ * never the eviction victim.
128
+ */
129
+ declare function remember<V>(store: IdempotencyStore<V>, key: string, value: V, nowMs: number): IdempotencyStore<V>;
130
+
131
+ export { type IdempotencyStore as I, type IdempotencyEntry as a, remember as b, evictExpired as e, initStore as i, recall as r, seen as s };
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @demlik/tea/debounce — a timer-based call transformer that coalesces a burst
2
+ * internal/timing/debounce — a timer-based call transformer that coalesces a burst
3
3
  * of calls into a single fire.
4
4
  *
5
- * Sibling of `@demlik/tea/throttle` — the two share a SYMMETRIC surface
5
+ * Sibling of `../throttle` — the two share a SYMMETRIC surface
6
6
  * (`Debounced<A>` / `Throttled<A>`, both callable + `.cancel()` + `.flush()`,
7
7
  * both `{ leading?, trailing? }`) so they read as a pair. They are kept in
8
8
  * separate files with NO cross-import: each is a self-contained timer, and the
9
9
  * coalesce-vs-drop policies are different enough that sharing code would hide
10
10
  * the distinction. Read one to understand the other; do not couple them.
11
11
  *
12
- * Layering with `@demlik/tea/throttled-input`: `debounce` and `throttle` are
12
+ * Layering with `../throttled-input`: `debounce` and `throttle` are
13
13
  * the two host-boundary PRIMITIVES — two distinct algorithms (collapse-a-burst
14
14
  * vs at-most-once-per-window) behind one signature shape. `throttled-input` is
15
15
  * NOT a third primitive: it is a TEA machine composed OVER them that
@@ -39,9 +39,9 @@
39
39
  * window.addEventListener("resize", onResized);
40
40
  * // cleanup: onResized.cancel(); window.removeEventListener("resize", onResized);
41
41
  *
42
- * NOT exported from the package root — reached via the `@demlik/tea/debounce`
43
- * subpath, same one-shape-per-package rule as `rate-limit`, `deadline`, and
44
- * `work-queue`.
42
+ * Internal since #47 — not published on any subpath; reached from inside the
43
+ * package as `internal/timing/debounce`. Same one-shape-per-package rule as
44
+ * `rate-limit`, `deadline`, and `work-queue`.
45
45
  *
46
46
  * Uses the universal `setTimeout` / `clearTimeout` timer idiom (same discipline
47
47
  * as `subs/from-timeout.ts`): exactly one live handle at a time, every arm
@@ -117,4 +117,4 @@ declare function debounce<A extends readonly unknown[]>(fn: (...args: A) => void
117
117
  trailing?: boolean;
118
118
  }): Debounced<A>;
119
119
 
120
- export { type Debounced, debounce };
120
+ export { type Debounced as D, debounce as d };
@@ -0,0 +1,69 @@
1
+ import { S as Store } from './runtime-types-LWDoi943.js';
2
+
3
+ /**
4
+ * internal/work-queue — substrate-agnostic work-queue lifecycle on `Store<S>`.
5
+ *
6
+ * Two public surfaces, one shape:
7
+ * - `createQueue(store)` (this file) is the in-process adapter — it binds the
8
+ * pure ops to an injected `Store` and runs `load → mutate → save`.
9
+ * - `internal/work-queue/ops` (`./ops`) is the BLESSED, importable surface
10
+ * of those same pure ops. L2 compositions that own their own Model slice
11
+ * (`monitored-run`, `idempotent-intake`, …) import the ops directly and
12
+ * delegate status flips to them instead of re-rolling the transitions.
13
+ * Both routes call the identical ops, so the lifecycle rules live in exactly
14
+ * one place. This mirrors `@demlik/tea/do`'s one-shape-per-package rule.
15
+ *
16
+ * The package is generic in the input payload `I` (audit-specific fields go
17
+ * here in the extension host). `output` is a free-form side-channel correlation
18
+ * token (a backend id, URL, trace id) — typed as `string` because that's its
19
+ * only honest type. Consumers that need structured per-item data persist it in
20
+ * their own store and put the foreign-key string in `output`.
21
+ */
22
+
23
+ type QueueItemStatus = "pending" | "running" | "done" | "failed" | "cancelled";
24
+ /**
25
+ * A single queue entry. Every field is `readonly`: a persisted slice is
26
+ * immutable, so a transition returns a NEW item (the ops always spread —
27
+ * `{ ...item, status: … }`) rather than mutating in place. This type-enforces
28
+ * the durability invariant the consumers already honor by convention, and
29
+ * keeps a slice round-trippable through JSON unchanged across a reload.
30
+ */
31
+ interface QueueItem<I> {
32
+ readonly id: string;
33
+ readonly status: QueueItemStatus;
34
+ readonly input: I;
35
+ readonly enqueuedAt: number;
36
+ readonly startedAt?: number;
37
+ readonly finishedAt?: number;
38
+ readonly output?: string;
39
+ readonly error?: string;
40
+ }
41
+ /**
42
+ * Caller-facing enqueue payload. Just `I` today — kept named so future
43
+ * variants (priority, deferUntil, …) can grow without breaking callers.
44
+ */
45
+ type EnqueueInput<I> = I;
46
+ /**
47
+ * Adapter that binds the pure ops to an injected `Store<QueueItem<I>[]>`.
48
+ *
49
+ * `load → mutate → save` is the only durability discipline this package
50
+ * imposes. The store decides what "save" means (chrome.storage, KV, DO
51
+ * storage, in-memory) — that decision belongs at the caller.
52
+ *
53
+ * Ops that don't change the queue (e.g. `markDone` on an unknown id) skip the
54
+ * save call so the underlying store doesn't observe a write churn.
55
+ */
56
+ declare function createQueue<I>(store: Store<QueueItem<I>[]>): {
57
+ enqueue: (input: EnqueueInput<I>) => Promise<QueueItem<I>>;
58
+ claimNext: () => Promise<QueueItem<I> | null>;
59
+ markDone: (id: string) => Promise<void>;
60
+ markFailed: (id: string, error: string) => Promise<void>;
61
+ markCancelled: (id: string) => Promise<void>;
62
+ resetRunningToPending: () => Promise<void>;
63
+ removeItem: (id: string) => Promise<void>;
64
+ retryItem: (id: string) => Promise<void>;
65
+ bindOutput: (id: string, value: string) => Promise<void>;
66
+ list: () => Promise<QueueItem<I>[]>;
67
+ };
68
+
69
+ export { type EnqueueInput as E, type QueueItem as Q, type QueueItemStatus as a, createQueue as c };
@@ -1,75 +1,4 @@
1
- import { C as Cmd, I as Interpret } from '../core-Co0LWkIA.js';
2
- import 'zod';
3
-
4
- /**
5
- * @demlik/tea/snapshot — periodic state checkpoint to a host store (R2/KV-shaped).
6
- *
7
- * The problem it solves: a long-running machine (a multi-stage run, a paginated
8
- * crawl, a saga) lives in TEA's in-memory `State` and is persisted as ONE blob
9
- * by the substrate's `Store<S>` on every transition. That blob is fine for
10
- * crash recovery of the *runtime* — but it is NOT a coarse, named checkpoint a
11
- * human (or a separate recovery job) can point a restart at. `snapshot` adds
12
- * the "every N units of progress, write a durable checkpoint to R2/KV"
13
- * discipline on top, so a crashed long run restarts from the last checkpoint
14
- * instead of from zero (the field-guide pain row).
15
- *
16
- * Shape: this is the same knob contract every L2 composition follows —
17
- * `createSnapshot(config)` hands back a `{ init, <verbs>, handlers }` bundle you
18
- * splice into your machine. The state it owns is a Model slice (durable +
19
- * replayable, the two non-negotiables); the verbs are PURE decisions; the I/O
20
- * (the actual `put` to the store) lives only in `handlers`.
21
- *
22
- * It is a LEAF module: it imports only the core substrate (`../index`, for
23
- * `Cmd` / `Interpret`) and no sibling subpath. (It does NOT reuse
24
- * `@demlik/tea/retry-backoff` — that is an even-leafier utility that depends on
25
- * nothing at all, not even the core; the kinship here is "leaf with injected
26
- * time", not a shared dependency.)
27
- * Nothing here reads the clock or the RNG on its own behalf — time enters as an
28
- * `at`/`now` parameter at the verb boundary and the store I/O is realized only
29
- * when the runtime performs the emitted `Cmd`. That keeps every verb
30
- * deterministic (invariant 2) and the checkpoint write a `Cmd` the runtime
31
- * interprets (invariant 3).
32
- *
33
- * The Store port is deliberately ABSTRACT — `{ get, put }`, the lowest common
34
- * shape of R2 and KV — so this module never imports `@cloudflare/workers-types`
35
- * and can be checkpointed to anything (R2, KV, a DO sub-key, an in-memory map in
36
- * tests). The host binds the concrete adapter at `handlers({ store })`.
37
- *
38
- * Typical wiring:
39
- *
40
- * const snap = createSnapshot<RunState>({ every: 25, key: "run/checkpoint" });
41
- *
42
- * // machine state:
43
- * type State = { run: RunState; snapshot: SnapshotState };
44
- * init: (loaded) => loaded ? [loaded, []] : [{ run: initRun(), snapshot: snap.init() }, []],
45
- *
46
- * // in `update`, on each progress Msg, fold the snapshot slice:
47
- * progress: (s, msg) => {
48
- * const run = advance(s.run, msg);
49
- * const [snapshot, cmds] = snap.record(s.snapshot, run, msg.at);
50
- * return [{ ...s, run, snapshot }, cmds];
51
- * },
52
- * // the write completed → durable ack folds back through update:
53
- * snapshot_saved: (s, msg) => {
54
- * const [snapshot, cmds] = snap.confirm(s.snapshot, msg);
55
- * return [{ ...s, snapshot }, cmds];
56
- * },
57
- *
58
- * // RECOVERY — the half that makes a checkpoint a restart point, not just a
59
- * // backup. A `boot` Msg the host dispatches once after `run(...)` asks the
60
- * // store for the durable checkpoint; the answer folds the recovered payload
61
- * // back into the run slice:
62
- * boot: (s) => snap.requestLoad(s), // emits snapshot_load Cmd
63
- * snapshot_loaded: (s, msg) => {
64
- * if (msg.payload === null) return [s, []]; // no checkpoint → keep fresh init
65
- * const [snapshot, cmds] = snap.boot(s.snapshot);
66
- * return [{ ...s, run: msg.payload, snapshot }, cmds];
67
- * },
68
- * snapshot_load_failed: (s) => [s, []], // errors are data — decide here
69
- *
70
- * // splice the I/O — both effect cells (write + load):
71
- * interpret: { ...snap.handlers({ store: r2Adapter }) },
72
- */
1
+ import { a as CmdOf, b as CmdDef, C as Cmd, I as Interpret } from './core-CTzMJ82M.js';
73
2
 
74
3
  /**
75
4
  * The snapshot knob.
@@ -163,13 +92,20 @@ interface SnapshotPorts<V> {
163
92
  * state, the cursor, whatever the machine wants restartable). The verb takes it
164
93
  * as an argument so the snapshot slice never has to hold a copy of the
165
94
  * machine's domain state.
95
+ *
96
+ * `Cmd.define`d (ADR 0014), minted per `V` by a factory the way
97
+ * `workflowActivityDef<A>()` is, since the payload type is the knob's own
98
+ * parameter. The handler answers through this module's OWN Msgs
99
+ * (`snapshot_saved` / `snapshot_failed`), never the minted `_ok` / `_err`,
100
+ * hence `ok: z.void()` and an empty `err` list.
166
101
  */
167
- type SnapshotWriteCmd<V> = Cmd<"snapshot_write"> & {
102
+ declare function snapshotWriteDef<V>(): CmdDef<"snapshot_write", {
168
103
  readonly key: string;
169
104
  readonly seq: number;
170
105
  readonly at: number;
171
106
  readonly payload: V;
172
- };
107
+ }, void, never, unknown>;
108
+ type SnapshotWriteCmd<V> = CmdOf<ReturnType<typeof snapshotWriteDef<V>>>;
173
109
  /**
174
110
  * The Msg the write handler dispatches on a SUCCESSFUL `put`. Fold it back
175
111
  * through `confirm(state, msg)` to advance `lastSavedSeq` / `lastSavedAt`. The
@@ -204,9 +140,10 @@ type SnapshotFailedMsg = {
204
140
  * triggering Msg once on resume (a `boot` Msg, never `init`'s rehydrate branch —
205
141
  * invariant 2), folds the recovered payload into its run slice, then continues.
206
142
  */
207
- type SnapshotLoadCmd = Cmd<"snapshot_load"> & {
208
- readonly key: string;
209
- };
143
+ declare const snapshotLoad: CmdDef<"snapshot_load", {
144
+ key: string;
145
+ }, void, never, unknown>;
146
+ type SnapshotLoadCmd = CmdOf<typeof snapshotLoad>;
210
147
  /**
211
148
  * The Msg the load handler dispatches when `store.get` RESOLVES. `payload` is
212
149
  * the recovered checkpoint value, or `null` when the store has no checkpoint
@@ -332,4 +269,4 @@ interface SnapshotKnob<V> {
332
269
  */
333
270
  declare function createSnapshot<V>(config: SnapshotConfig): SnapshotKnob<V>;
334
271
 
335
- export { type SnapshotConfig, type SnapshotFailedMsg, type SnapshotKnob, type SnapshotLoadCmd, type SnapshotLoadFailedMsg, type SnapshotLoadedMsg, type SnapshotPorts, type SnapshotSavedMsg, type SnapshotState, type SnapshotStore, type SnapshotWriteCmd, createSnapshot, snapshotFailed, snapshotLoadFailed, snapshotLoaded, snapshotSaved };
272
+ export { type SnapshotWriteCmd as S, type SnapshotState as a, type SnapshotStore as b, type SnapshotSavedMsg as c, type SnapshotFailedMsg as d, type SnapshotLoadedMsg as e, type SnapshotLoadFailedMsg as f, type SnapshotLoadCmd as g, type SnapshotConfig as h, type SnapshotKnob as i, type SnapshotPorts as j, createSnapshot as k, snapshotLoad as l, snapshotLoadFailed as m, snapshotLoaded as n, snapshotSaved as o, snapshotWriteDef as p, snapshotFailed as s };
@@ -1,15 +1,10 @@
1
- import { DeadlineExceeded, DeadlineSub } from '../deadline/index.js';
2
- export { deadlineSub, subscribeDeadline } from '../deadline/index.js';
3
- import { I as Interpret, C as Cmd } from '../core-Co0LWkIA.js';
4
- import { SnapshotWriteCmd, SnapshotState, SnapshotStore, SnapshotSavedMsg, SnapshotFailedMsg, SnapshotLoadedMsg, SnapshotLoadFailedMsg, SnapshotLoadCmd } from '../snapshot/index.js';
5
- import { QueueItem } from '../work-queue/index.js';
6
- import '../types-XS_miRnB.js';
7
- import 'zod';
8
- import '../runtime-types-CNLmhWif.js';
9
- import 'better-result';
1
+ import { I as Interpret, C as Cmd } from './core-CTzMJ82M.js';
2
+ import { S as SnapshotWriteCmd, a as SnapshotState, b as SnapshotStore, c as SnapshotSavedMsg, d as SnapshotFailedMsg, e as SnapshotLoadedMsg, f as SnapshotLoadFailedMsg, g as SnapshotLoadCmd } from './index-DMCeMPMJ.js';
3
+ import { D as DeadlineExceeded, a as DeadlineSub } from './index-q0hXFeZ0.js';
4
+ import { Q as QueueItem } from './index-DJWIER_3.js';
10
5
 
11
6
  /**
12
- * @demlik/tea/monitored-run — a long-running operation that is BOTH staged and
7
+ * internal/flow/monitored-run — a long-running operation that is BOTH staged and
13
8
  * watched: an ordered stage pipeline whose POSITION survives eviction, wrapped
14
9
  * by a no-progress safety deadline and (optionally) a periodic durable
15
10
  * checkpoint.
@@ -46,7 +41,7 @@ import 'better-result';
46
41
  *
47
42
  * ## Why the run lifecycle is INLINE (run-tracker not extracted)
48
43
  *
49
- * The phase union (`idle` / `running` / `stale` / `done` / `failed`, a
44
+ * The phase union (`idle` / `running` / `stale` / `done` / `failed` / `cancelled`, a
50
45
  * discriminated union carrying only each phase's own data) and its bookkeeping
51
46
  * (`runId`, `startedAt`, `lastProgressAt`, `progressSeq`) live directly on this
52
47
  * slice rather than behind a `run-tracker` sub-knob.
@@ -203,10 +198,19 @@ interface RunCore<Stage> {
203
198
  * - `failed` — terminal failure; the typed `failure` reason rides ONLY this
204
199
  * arm, so it is present iff `phase === "failed"` BY CONSTRUCTION —
205
200
  * there is no nullable side field to keep in sync.
201
+ * - `cancelled` — the consumer stopped the run from outside (`cancel`). Its own
202
+ * phase rather than a `RunFailure` reason, on the same argument
203
+ * that keeps `stale` a phase: a caller who asked for the stop did
204
+ * not suffer a failure, and every "did this fail?" reader would
205
+ * otherwise have to except one reason. Terminal, so it re-enters
206
+ * no verb and arms no watchdog.
206
207
  *
207
208
  * `runId` is the host-minted run identity, stamped at `start` (the machine never
208
209
  * mints — see the audit seed's "run identity is host-minted"). It rides every
209
- * started phase, but not `idle`.
210
+ * started phase, but not `idle`. `cancelled` is the one phase reachable from BOTH
211
+ * sides of that line, so its `runId` is `string | null`: `null` says the run was
212
+ * cancelled before it ever started and there was no identity to mint, which is a
213
+ * different fact from a cancelled live run and stays a different value.
210
214
  */
211
215
  type MonitoredRunState<Stage> = (RunCore<Stage> & {
212
216
  readonly phase: "idle";
@@ -223,7 +227,26 @@ type MonitoredRunState<Stage> = (RunCore<Stage> & {
223
227
  readonly phase: "failed";
224
228
  readonly runId: string;
225
229
  readonly failure: RunFailure<Stage>;
230
+ }) | (RunCore<Stage> & {
231
+ readonly phase: "cancelled";
232
+ readonly runId: string | null;
233
+ readonly at: number;
226
234
  });
235
+ /**
236
+ * The ENDED phases — a run that finished (`done`) or was stopped from outside
237
+ * (`cancelled`). Every arm here was started or explicitly stopped, so `idle` is
238
+ * out and `runId` is present on the whole union: a consumer holding one of these
239
+ * reads the run identity without a `phase` guard the value can never fail.
240
+ *
241
+ * It is the resolved half of a drive: a promise that resolves only on an ended
242
+ * run should say so in its type rather than resolve `MonitoredRunState` and
243
+ * leave every reader to re-prove the `idle` arm impossible (#155). `cancelled`
244
+ * keeps its `string | null` `runId` unchanged — a run cancelled before it ever
245
+ * started genuinely has no identity, and that stays a different value here.
246
+ */
247
+ type EndedRun<Stage> = Extract<MonitoredRunState<Stage>, {
248
+ readonly phase: "done" | "cancelled";
249
+ }>;
227
250
  /**
228
251
  * The outcome a consumer reports to `advance`: the current stage either
229
252
  * succeeded (retire it, claim the next) or failed (terminate the run). Plain
@@ -259,6 +282,7 @@ declare function createMonitoredRun<Stage, V = unknown>(config?: MonitoredRunCon
259
282
  start: (s: MonitoredRunState<Stage>, runId: string, at: number) => readonly [MonitoredRunState<Stage>, readonly MonitoredRunCmd<V>[]];
260
283
  progress: (s: MonitoredRunState<Stage>, payload: V, at: number) => readonly [MonitoredRunState<Stage>, readonly MonitoredRunCmd<V>[]];
261
284
  markStale: (s: MonitoredRunState<Stage>) => readonly [MonitoredRunState<Stage>, readonly MonitoredRunCmd<V>[]];
285
+ cancel: (s: MonitoredRunState<Stage>, at: number) => readonly [MonitoredRunState<Stage>, readonly MonitoredRunCmd<V>[]];
262
286
  advance: (s: MonitoredRunState<Stage>, payload: V, result: StageResult, at: number) => readonly [MonitoredRunState<Stage>, readonly MonitoredRunCmd<V>[]];
263
287
  onDeadline: (s: MonitoredRunState<Stage>, msg: MonitoredRunTimerMsg) => readonly [MonitoredRunState<Stage>, readonly MonitoredRunCmd<V>[]];
264
288
  boot: (s: MonitoredRunState<Stage>, at: number) => readonly [MonitoredRunState<Stage>, readonly MonitoredRunCmd<V>[]];
@@ -276,4 +300,4 @@ declare function liftRun<S extends {
276
300
  run: MonitoredRunState<Stage>;
277
301
  }, Stage, C extends Cmd>(state: S, [slice, cmds]: readonly [MonitoredRunState<Stage>, readonly C[]]): readonly [S, readonly C[]];
278
302
 
279
- export { DeadlineExceeded, DeadlineSub, type MonitoredRunCmd, type MonitoredRunConfig, type MonitoredRunPorts, type MonitoredRunState, type MonitoredRunTimerMsg, type RunFailure, SnapshotSavedMsg, SnapshotWriteCmd, type StageResult, createMonitoredRun, liftRun };
303
+ export { type EndedRun as E, type MonitoredRunCmd as M, type RunFailure as R, type StageResult as S, type MonitoredRunState as a, type MonitoredRunConfig as b, type MonitoredRunPorts as c, type MonitoredRunTimerMsg as d, createMonitoredRun as e, liftRun as l };
@@ -1,7 +1,4 @@
1
- import { B as BootingRuntime } from '../runtime-types-CNLmhWif.js';
2
- import 'better-result';
3
- import '../core-Co0LWkIA.js';
4
- import 'zod';
1
+ import { B as BootingRuntime } from './runtime-types-LWDoi943.js';
5
2
 
6
3
  /**
7
4
  * A recorded run, sufficient to reproduce it via `../trace-replay`.
@@ -221,7 +218,7 @@ interface TraceAttachment {
221
218
  *
222
219
  * ```ts
223
220
  * import * as Sentry from "@sentry/browser"; // or "@sentry/node"
224
- * import { traceAttachment } from "@demlik/tea/recorder";
221
+ * import { traceAttachment } from "./internal/persistence/recorder"; // internal module
225
222
  * Sentry.getCurrentScope().addAttachment(traceAttachment(rec.dump()));
226
223
  * ```
227
224
  *
@@ -279,7 +276,7 @@ interface BreadcrumbsOptions<M> {
279
276
  *
280
277
  * ```ts
281
278
  * import * as Sentry from "@sentry/browser"; // or "@sentry/node"
282
- * import { breadcrumbsFromTrace } from "@demlik/tea/recorder";
279
+ * import { breadcrumbsFromTrace } from "./internal/persistence/recorder"; // internal module
283
280
  * for (const b of breadcrumbsFromTrace(rec.dump())) Sentry.addBreadcrumb(b);
284
281
  * ```
285
282
  *
@@ -290,4 +287,4 @@ declare function breadcrumbsFromTrace<S, M extends {
290
287
  type: string;
291
288
  }>(trace: Trace<S, M>, opts?: BreadcrumbsOptions<M>): TraceBreadcrumb[];
292
289
 
293
- export { type BreadcrumbsOptions, type Recorder, type RecorderOptions, type Trace, type TraceAttachment, type TraceBreadcrumb, breadcrumbsFromTrace, parseJSONL, recorder, traceAttachment };
290
+ export { type BreadcrumbsOptions as B, type RecorderOptions as R, type Trace as T, type Recorder as a, type TraceAttachment as b, type TraceBreadcrumb as c, breadcrumbsFromTrace as d, parseJSONL as p, recorder as r, traceAttachment as t };