@demlik/tea 0.12.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 (368) hide show
  1. package/README.md +11 -9
  2. package/dist/agent/index.d.ts +638 -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-7SVIRMC6.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-7V4EVLZA.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-WLGO64WC.js → chunk-HYDWG35Q.js} +23 -6
  19. package/dist/chunk-HYDWG35Q.js.map +1 -0
  20. package/dist/{chunk-I5OV65MS.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-CTzMJ82M.d.ts +562 -0
  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 +48 -31
  43. package/dist/do/index.js +36 -25
  44. package/dist/do/index.js.map +1 -1
  45. package/dist/{durable-effects-D8SqU_if.d.ts → durable-effects-B0-qGQDy.d.ts} +2 -2
  46. package/dist/extension/index.d.ts +301 -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 -11
  55. package/dist/{fan-out/index.d.ts → index-6A7dB8f6.d.ts} +7 -8
  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 -77
  61. package/dist/{monitored-run/index.d.ts → index-NjrT3fL2.d.ts} +37 -12
  62. package/dist/{recorder/index.d.ts → index-TvRb1KVf.d.ts} +4 -6
  63. package/dist/{deadline/index.d.ts → index-q0hXFeZ0.d.ts} +155 -8
  64. package/dist/index.d.ts +719 -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 +2 -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 +19 -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 +130 -4
  77. package/dist/node/index.js +222 -10
  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 +5 -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 +248 -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 -4
  88. package/dist/persistence/index.js +6 -0
  89. package/dist/react/index.d.ts +4 -3
  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 +3 -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 +144 -12
  102. package/dist/{throttled-input → timing}/index.js +57 -12
  103. package/dist/timing/index.js.map +1 -0
  104. package/dist/{types-D7u9DkH7.d.ts → types-DP3f5NIl.d.ts} +1 -1
  105. package/dist/work-queue/index.d.ts +131 -54
  106. package/dist/work-queue/index.js +3 -2
  107. package/dist/work-queue/index.js.map +1 -1
  108. package/package.json +50 -216
  109. package/dist/authed-call/index.d.ts +0 -119
  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 -100
  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 -151
  117. package/dist/cache/index.js +0 -8
  118. package/dist/chart/index.d.ts +0 -217
  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 -85
  122. package/dist/chart/inspect/index.js +0 -5
  123. package/dist/chart/inspect/react.d.ts +0 -112
  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 -361
  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 -83
  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 -116
  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-3JU6657S.js +0 -372
  193. package/dist/chunk-3JU6657S.js.map +0 -1
  194. package/dist/chunk-4KTWLPL5.js +0 -33
  195. package/dist/chunk-4KTWLPL5.js.map +0 -1
  196. package/dist/chunk-5EHLEUTL.js +0 -686
  197. package/dist/chunk-5EHLEUTL.js.map +0 -1
  198. package/dist/chunk-5KJKJOFC.js +0 -758
  199. package/dist/chunk-5KJKJOFC.js.map +0 -1
  200. package/dist/chunk-7SVIRMC6.js.map +0 -1
  201. package/dist/chunk-7V4EVLZA.js.map +0 -1
  202. package/dist/chunk-A56OR5RF.js +0 -184
  203. package/dist/chunk-A56OR5RF.js.map +0 -1
  204. package/dist/chunk-AZZLE7XR.js +0 -62
  205. package/dist/chunk-AZZLE7XR.js.map +0 -1
  206. package/dist/chunk-B5VXOFMZ.js +0 -266
  207. package/dist/chunk-B5VXOFMZ.js.map +0 -1
  208. package/dist/chunk-BYQUGDD3.js +0 -16
  209. package/dist/chunk-BYQUGDD3.js.map +0 -1
  210. package/dist/chunk-D736QUGF.js.map +0 -1
  211. package/dist/chunk-E6GEDSF4.js +0 -307
  212. package/dist/chunk-E6GEDSF4.js.map +0 -1
  213. package/dist/chunk-EUF7XOEE.js +0 -223
  214. package/dist/chunk-EUF7XOEE.js.map +0 -1
  215. package/dist/chunk-EWJP3YYP.js.map +0 -1
  216. package/dist/chunk-FV3Z5MBE.js.map +0 -1
  217. package/dist/chunk-HCEVHFJ7.js +0 -54
  218. package/dist/chunk-HCEVHFJ7.js.map +0 -1
  219. package/dist/chunk-I5OV65MS.js.map +0 -1
  220. package/dist/chunk-J6527VRQ.js.map +0 -1
  221. package/dist/chunk-JELSZN25.js +0 -47
  222. package/dist/chunk-JELSZN25.js.map +0 -1
  223. package/dist/chunk-JER5O7PQ.js +0 -416
  224. package/dist/chunk-JER5O7PQ.js.map +0 -1
  225. package/dist/chunk-JGVL3WPL.js +0 -26
  226. package/dist/chunk-JGVL3WPL.js.map +0 -1
  227. package/dist/chunk-JP5D6GSL.js +0 -71
  228. package/dist/chunk-JP5D6GSL.js.map +0 -1
  229. package/dist/chunk-K575PT4S.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-ND3DH6KM.js +0 -88
  234. package/dist/chunk-ND3DH6KM.js.map +0 -1
  235. package/dist/chunk-Q2UM7BXU.js.map +0 -1
  236. package/dist/chunk-S2EGRPCM.js +0 -47
  237. package/dist/chunk-S2EGRPCM.js.map +0 -1
  238. package/dist/chunk-SINXE47Y.js +0 -55
  239. package/dist/chunk-SINXE47Y.js.map +0 -1
  240. package/dist/chunk-SUST46KO.js +0 -53
  241. package/dist/chunk-SUST46KO.js.map +0 -1
  242. package/dist/chunk-TP5UPGLY.js +0 -61
  243. package/dist/chunk-TP5UPGLY.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-WLGO64WC.js.map +0 -1
  249. package/dist/chunk-WRAA7GVZ.js +0 -209
  250. package/dist/chunk-WRAA7GVZ.js.map +0 -1
  251. package/dist/chunk-ZCL7SCBK.js +0 -685
  252. package/dist/chunk-ZCL7SCBK.js.map +0 -1
  253. package/dist/chunk-ZD6PNZBK.js +0 -457
  254. package/dist/chunk-ZD6PNZBK.js.map +0 -1
  255. package/dist/chunk-ZF6WDK2D.js +0 -519
  256. package/dist/chunk-ZF6WDK2D.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-ZVJZ72HY.js.map +0 -1
  260. package/dist/circuit-breaker/index.d.ts +0 -197
  261. package/dist/circuit-breaker/index.js +0 -3
  262. package/dist/circuit-breaker/index.js.map +0 -1
  263. package/dist/core-Bjc0bS8j.d.ts +0 -326
  264. package/dist/deadline/index.js +0 -6
  265. package/dist/deadline/index.js.map +0 -1
  266. package/dist/debounce/index.js +0 -3
  267. package/dist/debounce/index.js.map +0 -1
  268. package/dist/extension/react.d.ts +0 -121
  269. package/dist/extension/react.js +0 -75
  270. package/dist/extension/react.js.map +0 -1
  271. package/dist/extension/subs/index.d.ts +0 -44
  272. package/dist/extension/subs/index.js +0 -80
  273. package/dist/extension/subs/index.js.map +0 -1
  274. package/dist/extension/test-utils.d.ts +0 -128
  275. package/dist/extension/test-utils.js +0 -277
  276. package/dist/extension/test-utils.js.map +0 -1
  277. package/dist/fan-out/index.js +0 -5
  278. package/dist/fan-out/index.js.map +0 -1
  279. package/dist/fold-Blbhru48.d.ts +0 -435
  280. package/dist/graph-CcjWZVrd.d.ts +0 -923
  281. package/dist/idempotency/adapter.d.ts +0 -62
  282. package/dist/idempotency/adapter.js +0 -4
  283. package/dist/idempotency/adapter.js.map +0 -1
  284. package/dist/idempotent-intake/index.d.ts +0 -187
  285. package/dist/idempotent-intake/index.js +0 -7
  286. package/dist/idempotent-intake/index.js.map +0 -1
  287. package/dist/llm-call/index.d.ts +0 -310
  288. package/dist/llm-call/index.js +0 -16
  289. package/dist/llm-call/index.js.map +0 -1
  290. package/dist/machine-0OmPvsy_.d.ts +0 -804
  291. package/dist/monitored-run/index.js +0 -10
  292. package/dist/monitored-run/index.js.map +0 -1
  293. package/dist/paginated-walk/index.d.ts +0 -234
  294. package/dist/paginated-walk/index.js +0 -16
  295. package/dist/paginated-walk/index.js.map +0 -1
  296. package/dist/paginator/index.js +0 -3
  297. package/dist/paginator/index.js.map +0 -1
  298. package/dist/pbt/arbitraries/index.d.ts +0 -135
  299. package/dist/pbt/arbitraries/index.js +0 -3
  300. package/dist/pbt/arbitraries/index.js.map +0 -1
  301. package/dist/pbt/runners/index.d.ts +0 -117
  302. package/dist/pbt/runners/index.js +0 -5
  303. package/dist/pbt/runners/index.js.map +0 -1
  304. package/dist/poller/index.d.ts +0 -351
  305. package/dist/poller/index.js +0 -115
  306. package/dist/poller/index.js.map +0 -1
  307. package/dist/prediction/index.d.ts +0 -130
  308. package/dist/prediction/index.js +0 -4
  309. package/dist/prediction/index.js.map +0 -1
  310. package/dist/protocol-B5YmJr0d.d.ts +0 -45
  311. package/dist/pure/index.d.ts +0 -2
  312. package/dist/pure/index.js +0 -4
  313. package/dist/pure/index.js.map +0 -1
  314. package/dist/rate-limit/index.d.ts +0 -115
  315. package/dist/rate-limit/index.js +0 -3
  316. package/dist/rate-limit/index.js.map +0 -1
  317. package/dist/reconciler/index.d.ts +0 -192
  318. package/dist/reconciler/index.js +0 -164
  319. package/dist/reconciler/index.js.map +0 -1
  320. package/dist/recorder/index.js +0 -3
  321. package/dist/recorder/index.js.map +0 -1
  322. package/dist/reducer-BqyoVyBG.d.ts +0 -447
  323. package/dist/resilient-call/index.d.ts +0 -319
  324. package/dist/resilient-call/index.js +0 -14
  325. package/dist/resilient-call/index.js.map +0 -1
  326. package/dist/retry-to-success/index.d.ts +0 -109
  327. package/dist/retry-to-success/index.js +0 -37
  328. package/dist/retry-to-success/index.js.map +0 -1
  329. package/dist/run-BVeqJDBF.d.ts +0 -713
  330. package/dist/runtime-types-Bxc637bp.d.ts +0 -502
  331. package/dist/saga/index.d.ts +0 -240
  332. package/dist/saga/index.js +0 -150
  333. package/dist/saga/index.js.map +0 -1
  334. package/dist/samples-DCt6nF8H.d.ts +0 -59
  335. package/dist/snapshot/index.js +0 -5
  336. package/dist/snapshot/index.js.map +0 -1
  337. package/dist/subs/index.d.ts +0 -471
  338. package/dist/subs/index.js +0 -7
  339. package/dist/subs/index.js.map +0 -1
  340. package/dist/throttle/index.d.ts +0 -134
  341. package/dist/throttle/index.js +0 -3
  342. package/dist/throttle/index.js.map +0 -1
  343. package/dist/throttled-input/index.js.map +0 -1
  344. package/dist/token-refresh/index.d.ts +0 -215
  345. package/dist/token-refresh/index.js +0 -6
  346. package/dist/token-refresh/index.js.map +0 -1
  347. package/dist/trace-replay/index.js +0 -6
  348. package/dist/trace-replay/index.js.map +0 -1
  349. package/dist/with-deadline/index.d.ts +0 -196
  350. package/dist/with-deadline/index.js +0 -111
  351. package/dist/with-deadline/index.js.map +0 -1
  352. package/dist/with-resilience/index.d.ts +0 -224
  353. package/dist/with-resilience/index.js +0 -240
  354. package/dist/with-resilience/index.js.map +0 -1
  355. package/dist/with-telemetry/index.d.ts +0 -149
  356. package/dist/with-telemetry/index.js +0 -70
  357. package/dist/with-telemetry/index.js.map +0 -1
  358. package/dist/work-queue/adapter.d.ts +0 -83
  359. package/dist/work-queue/adapter.js +0 -4
  360. package/dist/work-queue/adapter.js.map +0 -1
  361. package/dist/work-queue/ops.d.ts +0 -70
  362. package/dist/work-queue/ops.js +0 -3
  363. package/dist/work-queue/ops.js.map +0 -1
  364. package/dist/workflow/index.d.ts +0 -484
  365. package/dist/workflow/index.js +0 -244
  366. package/dist/workflow/index.js.map +0 -1
  367. /package/dist/{cache → paginate}/index.js.map +0 -0
  368. /package/dist/{chart/inspect → persistence}/index.js.map +0 -0
@@ -1,10 +0,0 @@
1
- export { createMonitoredRun, liftRun } from '../chunk-WLGO64WC.js';
2
- import '../chunk-7V4EVLZA.js';
3
- export { deadlineSub, subscribeDeadline } from '../chunk-JGVL3WPL.js';
4
- import '../chunk-MU6MCIAC.js';
5
- import '../chunk-FV3Z5MBE.js';
6
- import '../chunk-2YFLOCWX.js';
7
- import '../chunk-5EHLEUTL.js';
8
- import '../chunk-B5VXOFMZ.js';
9
- //# sourceMappingURL=index.js.map
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,234 +0,0 @@
1
- import { C as Cmd } from '../core-Bjc0bS8j.js';
2
- import { PaginatorState } from '../paginator/index.js';
3
- import { RunCmd, FailMsg, SucceedMsg, CircuitConfig, RateLimitConfig, DeadlineConfig, ResilientPorts, ResilientState, ResilientTimerMsg } from '../resilient-call/index.js';
4
- import { RetryPolicy } from '../retry-backoff/index.js';
5
- import { DeadlineSub } from '../deadline/index.js';
6
- export { deadlineSub, subscribeDeadline } from '../deadline/index.js';
7
- import '../cache/index.js';
8
- import '../types-D7u9DkH7.js';
9
- import '../circuit-breaker/index.js';
10
- import '../protocol-B5YmJr0d.js';
11
- import '../rate-limit/index.js';
12
-
13
- /**
14
- * @demlik/tea/paginated-walk — traverse a paginated API / sitemap end to end
15
- * WITHOUT a fake clock, without 429s, and resumable across a Durable-Object
16
- * eviction. The L2 composition that bolts `../resilient-call`'s resilience onto
17
- * `../paginator`'s cursor walk: each page is fetched as ONE keyed resilient
18
- * call (retry + backoff + rate-limit gate), and the cursor advances only once a
19
- * page settles `ok`.
20
- *
21
- * ## The recipe (the two siblings it composes)
22
- *
23
- * - **`../paginator`** owns the walk loop: the opaque `Cursor`, the `seen` /
24
- * `pages` counters, and the `idle → fetching → … → done` phase machine.
25
- * `paginated-walk` never re-implements cursor advancement — it folds each
26
- * settled page through `recordPage`, letting the paginator decide
27
- * `done` / `fetching(next)` / `paused`. Backpressure is a TWO-way valve:
28
- * `recordPage` parks the walk in `paused` once `seen >= highWaterMark`, and
29
- * the `drain` / `resume` verbs (delegating to the paginator's own
30
- * `drain` / `resume`) lower the gauge and re-open the parked fetch — without
31
- * them `highWaterMark` would be a one-way valve that strands a paused walk.
32
- * - **`../resilient-call`** owns the page fetch: the single `resilient_run`
33
- * effect per page is gated through that knob's cache → circuit → rate-limit
34
- * → retry pipeline. A transient page failure backs off and re-issues the
35
- * SAME cursor (idempotent retry); the walk does not advance until the page
36
- * genuinely settles.
37
- *
38
- * Those are the only two siblings this module calls into. The resilience knobs
39
- * (`retry` / `circuit` / `rateLimit` / `deadline`) are NOT separate bricks
40
- * `paginated-walk` composes — they belong to `resilient-call`, which owns the
41
- * rate-limit gate internally. This module merely passes them through to
42
- * `createResilientCall` and re-uses two config TYPES at the boundary:
43
- * `RateLimitConfig` (re-exported by `resilient-call`) and `RetryPolicy` (from
44
- * `../retry-backoff`). Pass a `rateLimit` and `resilient-call`'s token bucket
45
- * throttles page fetches ("don't 429 the upstream"); omit it and the walk runs
46
- * as fast as the upstream answers.
47
- *
48
- * Because the page-fetch resilience IS a `resilient-call` slice, this knob
49
- * **inherits that knob's contract verbatim**: the slice is a flat record, every
50
- * verb returns `readonly [State, Cmd[]]`, time is always an `at` parameter, and
51
- * the jitter RNG is injected once at `createPaginatedWalk(config, rng)` — never
52
- * read inside a verb (per the spec, `paginated-walk` *extends* `resilient-call`).
53
- *
54
- * ## The two non-negotiables (canon)
55
- *
56
- * - **Durable** — the slice is plain data: the paginator phase + counters, and
57
- * the resilient-call brick states (all JSON-serializable). The cursor lives
58
- * in the Model, not a closure, so a walk survives eviction mid-traversal and
59
- * resumes from the exact page it was fetching.
60
- * - **Replayable** — every transition is a verb returning new state + Cmds.
61
- * `nextCursor` / `onPage` are pure config functions applied at the verb
62
- * boundary; the Cmds they yield are plain data. `replay` reconstructs the
63
- * whole walk exactly.
64
- *
65
- * ## Where the clock / RNG live
66
- *
67
- * Inside the verbs: nowhere. `at` arrives on `start` / `pageOk` / `pageErr` /
68
- * `onTimer` and is threaded straight into the underlying resilient-call gate (so
69
- * a rate-limited or retried page measures backoff from that `at`). The jitter
70
- * RNG is injected at construction. The only clock read is `Date.now()` inside
71
- * the resilient-call `handlers` port (the effect boundary), inherited unchanged.
72
- *
73
- * ## The fixed fetch key
74
- *
75
- * A walk fetches one page at a time, so the resilient-call layer tracks exactly
76
- * one logical call under the constant key `PAGE_KEY`. The cursor being fetched
77
- * is the resilient call's `input`, so a post-eviction resume re-issues the same
78
- * page request. (`resilient-call` is keyed to support N concurrent calls; a walk
79
- * deliberately uses a single key — the paginator is the sequencer.)
80
- *
81
- * ## Typical wiring
82
- *
83
- * const walk = createPaginatedWalk<PageToken, ApiPage>({
84
- * firstPage: null, // the API's "page one" sentinel
85
- * nextCursor: (page) => page.nextToken ?? null,
86
- * onPage: (page) => [{ type: "index_rows", rows: page.items }],
87
- * rateLimit: { capacity: 10, refillPerSec: 5 },
88
- * retry: defaultRetryPolicy,
89
- * });
90
- *
91
- * // in the machine:
92
- * init: () => [{ walk: walk.init() }, []],
93
- * update: {
94
- * start: (s, m) => lift(s, walk.start(s.walk, m.at)),
95
- * page_ok: (s, m) => lift(s, walk.pageOk(s.walk, m.result, m.at)),
96
- * page_err: (s, m) => lift(s, walk.pageErr(s.walk, m.error, m.at)),
97
- * retry_due:(s, m) => lift(s, walk.onTimer(s.walk, m)),
98
- * drained: (s, m) => lift(s, walk.drain(s.walk, m.n)),
99
- * resume: (s, m) => lift(s, walk.resume(s.walk, m.at)),
100
- * },
101
- * subscriptions: (s) => walk.subs(s.walk),
102
- * subscribe: { deadline: subscribeDeadline },
103
- * interpret: walk.handlers({ run: (cursor) => api.fetchPage(cursor) }),
104
- */
105
-
106
- /**
107
- * The paginated-walk knob. Generic in `Cursor` (the opaque page handle the
108
- * upstream API hands back — offset, page token, "next" URL, …) and `Page` (the
109
- * shape your fetch port resolves with).
110
- *
111
- * `nextCursor` and `onPage` are PURE config functions applied at the verb
112
- * boundary, never stored in the slice or in a Cmd (invariant 3 — Cmds are
113
- * plain data, not closures). `nextCursor(page)` extracts the API's next-page
114
- * handle (or `null` at the end); `onPage(page)` yields the Cmds the consumer
115
- * wants emitted for each successfully fetched page (index rows, write to R2,
116
- * dispatch a downstream Msg — whatever; an empty array is fine).
117
- *
118
- * The resilience bricks (`retry` / `circuit` / `rateLimit` / `deadline`) are
119
- * the SAME optional knobs `resilient-call` exposes — paginated-walk extends it.
120
- * `rateLimit` is the brick that keeps the walk from 429-ing the upstream.
121
- */
122
- interface PaginatedWalkConfig<Cursor, Page, EmittedCmd extends Cmd> {
123
- /**
124
- * The cursor the walk fetches first. For an offset API this is typically `0`;
125
- * for a token API, whatever sentinel the API treats as "page one" (often
126
- * `null` or `""`). Threaded into `paginator`'s `firstCursor`.
127
- */
128
- readonly firstPage: Cursor;
129
- /**
130
- * Extract the next cursor from a just-fetched page. Return a `Cursor` to keep
131
- * walking, or `null` when the API signalled the end (the walk finishes). PURE
132
- * + consumer-specific (only the consumer knows the API's pagination shape).
133
- */
134
- readonly nextCursor: (page: Page) => Cursor | null;
135
- /**
136
- * The Cmds to emit for each successfully fetched page — the consumer's work
137
- * per page (index, persist, fan out, …). Returns plain-data Cmds; `[]` is a
138
- * valid "I process the page synchronously elsewhere" answer. PURE.
139
- */
140
- readonly onPage: (page: Page) => readonly EmittedCmd[];
141
- /**
142
- * How many items a page contributes to the paginator's backpressure gauge
143
- * (`seen`). Defaults to `1` per page (count pages, not items) when omitted; a
144
- * consumer that wants per-item backpressure returns `page.items.length`. PURE.
145
- */
146
- readonly pageSize?: (page: Page) => number;
147
- /**
148
- * Backpressure threshold handed to the paginator. `seen >= highWaterMark`
149
- * parks the walk in `paused` instead of fetching the next page. Non-positive
150
- * (the default `0`) disables backpressure — the walk runs flat out until the
151
- * API exhausts. See `../paginator`'s `highWaterMark` docs.
152
- */
153
- readonly highWaterMark?: number;
154
- /** Exponential-backoff retry policy for a transient page-fetch failure. */
155
- readonly retry?: RetryPolicy;
156
- /** Circuit breaker around the page fetch (one upstream → one breaker). */
157
- readonly circuit?: CircuitConfig;
158
- /** Token-bucket rate limit — the "don't 429 the upstream" knob. */
159
- readonly rateLimit?: RateLimitConfig;
160
- /** Overall wall-clock deadline per individual page fetch. */
161
- readonly deadline?: DeadlineConfig;
162
- }
163
- /**
164
- * The slice. `walk` is the cursor/phase/counters from `../paginator`;
165
- * `resilience` is the `../resilient-call` slice that gates the page fetch.
166
- * Every field is JSON-serializable, so the whole walk survives a reload.
167
- *
168
- * The two move in lockstep: `walk` decides WHICH cursor to fetch next, while
169
- * `resilience` decides HOW that fetch is attempted (gated, retried, backed
170
- * off). `pageOk` advances `walk`; `pageErr` defers to `resilience` and leaves
171
- * `walk` parked on the same cursor until the page truly settles.
172
- */
173
- interface PaginatedWalkState<Cursor, Page> {
174
- readonly walk: PaginatorState<Cursor>;
175
- readonly resilience: ResilientState<Cursor, Page>;
176
- }
177
- /**
178
- * The page-fetch effect this knob emits: the inherited `resilient_run` Cmd from
179
- * resilient-call, whose `input` is the `Cursor` to fetch and whose `key` is the
180
- * fixed `PAGE_KEY`. The consumer's `handlers(ports)` interprets it.
181
- */
182
- type FetchPageCmd<Cursor> = RunCmd<Cursor>;
183
- /** Page-settled Msgs the `handlers` port dispatches back (inherited verbatim). */
184
- type PageOkMsg<Page> = SucceedMsg<Page>;
185
- type PageErrMsg = FailMsg;
186
- /** The retry / deadline timer Msg — inherited from resilient-call. */
187
- type PaginatedWalkTimerMsg = ResilientTimerMsg;
188
- /**
189
- * Ports the consumer supplies to `handlers`. `run(cursor)` fetches ONE page for
190
- * the given cursor; throwing routes to `pageErr` (and thus the resilience
191
- * backoff). Same shape as resilient-call's port, specialized to the page fetch.
192
- */
193
- interface PaginatedWalkPorts<Cursor, Page> extends ResilientPorts<Cursor, Page> {
194
- }
195
- /** The single resilient-call key every page fetch runs under. */
196
- declare const PAGE_KEY = "page";
197
- /**
198
- * Build a paginated-walk knob from `config`. `rng` is injected for the
199
- * underlying retry jitter — pass a fixed `() => 0` in tests to pin backoff;
200
- * defaults to `Math.random` (read at the verb boundary inside resilient-call,
201
- * never in a `paginated-walk` verb). Inherited straight from resilient-call.
202
- *
203
- * Returns the uniform L2 knob contract: `init()`, the verbs `start` / `pageOk`
204
- * / `pageErr` / `onTimer`, `subs(state)`, and `handlers(ports)`. `Cursor` is
205
- * the page handle, `Page` the fetch result, `EmittedCmd` the consumer's
206
- * per-page Cmds plus the inherited `FetchPageCmd`.
207
- */
208
- declare function createPaginatedWalk<Cursor, Page, EmittedCmd extends Cmd = Cmd>(config: PaginatedWalkConfig<Cursor, Page, EmittedCmd>, rng?: () => number): {
209
- init: () => PaginatedWalkState<Cursor, Page>;
210
- start: (s: PaginatedWalkState<Cursor, Page>, at: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
211
- pageOk: (s: PaginatedWalkState<Cursor, Page>, page: Page, at: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
212
- pageErr: (s: PaginatedWalkState<Cursor, Page>, error: unknown, at: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
213
- onTimer: (s: PaginatedWalkState<Cursor, Page>, msg: PaginatedWalkTimerMsg) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
214
- drain: (s: PaginatedWalkState<Cursor, Page>, n: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
215
- resume: (s: PaginatedWalkState<Cursor, Page>, at: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
216
- isComplete: (s: PaginatedWalkState<Cursor, Page>) => boolean;
217
- failure: (s: PaginatedWalkState<Cursor, Page>) => unknown;
218
- isStuck: (s: PaginatedWalkState<Cursor, Page>) => boolean;
219
- subs: (s: PaginatedWalkState<Cursor, Page>) => readonly DeadlineSub[];
220
- handlers: (ports: PaginatedWalkPorts<Cursor, Page>) => {
221
- resilient_run: (cmd: RunCmd<Cursor>, ctx: Readonly<Record<never, never>>) => Promise<FailMsg | SucceedMsg<Page>>;
222
- };
223
- };
224
- /**
225
- * Lift a knob result `[slice, cmds]` into a host `[State, cmds]` where the slice
226
- * lives at `state.walk`. A convenience for the common single-slice host;
227
- * consumers with a differently-named field spread by hand. Pure — a thin record
228
- * rebuild, no clock / RNG.
229
- */
230
- declare function liftWalk<S extends {
231
- walk: PaginatedWalkState<Cursor, Page>;
232
- }, Cursor, Page, C extends Cmd>(state: S, [slice, cmds]: readonly [PaginatedWalkState<Cursor, Page>, readonly C[]]): readonly [S, readonly C[]];
233
-
234
- export { DeadlineSub, type FetchPageCmd, PAGE_KEY, type PageErrMsg, type PageOkMsg, type PaginatedWalkConfig, type PaginatedWalkPorts, type PaginatedWalkState, type PaginatedWalkTimerMsg, createPaginatedWalk, liftWalk };
@@ -1,16 +0,0 @@
1
- export { PAGE_KEY, createPaginatedWalk, liftWalk } from '../chunk-I5OV65MS.js';
2
- import '../chunk-SINXE47Y.js';
3
- import '../chunk-EUF7XOEE.js';
4
- import '../chunk-JELSZN25.js';
5
- export { deadlineSub, subscribeDeadline } from '../chunk-JGVL3WPL.js';
6
- import '../chunk-Q2UM7BXU.js';
7
- import '../chunk-S2EGRPCM.js';
8
- import '../chunk-UF4MZSLT.js';
9
- import '../chunk-7SVIRMC6.js';
10
- import '../chunk-3JU6657S.js';
11
- import '../chunk-2YFLOCWX.js';
12
- import '../chunk-ZJ5AOYBH.js';
13
- import '../chunk-5EHLEUTL.js';
14
- import '../chunk-B5VXOFMZ.js';
15
- //# sourceMappingURL=index.js.map
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,3 +0,0 @@
1
- export { defaultPaginatorPolicy, drain, initPaginator, isDone, recordPage, resume, start } from '../chunk-SINXE47Y.js';
2
- //# sourceMappingURL=index.js.map
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,135 +0,0 @@
1
- import * as fc from 'fast-check';
2
- import { C as Cmd, S as Sub, M as Machine } from '../../core-Bjc0bS8j.js';
3
-
4
- /**
5
- * Build a Ctx value whose every property access throws. Use as the `ctx`
6
- * argument to PBT runners when the reducer under test is pure (does not
7
- * read from ctx). Accidental ctx access during property generation
8
- * surfaces as a labelled error instead of a silent `undefined` or
9
- * downstream type-error.
10
- *
11
- * Returns a typed `Ctx` (via `as unknown as Ctx`) — the proxy satisfies the
12
- * type-shape requirement at the call site; the runtime contract is
13
- * "throw on first read." The `as unknown` cast is the one boundary cast
14
- * this helper requires; the proxy is structurally a `Ctx` for every
15
- * property accessor.
16
- *
17
- * @example
18
- * import { stubCtxThrowingProxy } from "../index";
19
- * const ctx = stubCtxThrowingProxy<MyCtx>();
20
- * propertyTerminates(machine, ctx, ...);
21
- * // If anything reads ctx.someField during the run, an Error throws:
22
- * // "@demlik/tea/pbt: ctx access denied (PBT operates on the pure
23
- * // reducer; ctx field 'someField' was read)"
24
- */
25
- declare function stubCtxThrowingProxy<Ctx>(): Ctx;
26
-
27
- /**
28
- * Strict per-variant Msg arbitrary table. Mapped type: every key in
29
- * `M["type"]` MUST have an arbitrary entry whose `T` is the narrowed
30
- * variant. Adding a new Msg variant without an entry is a compile error
31
- * (same load-bearing discipline as `Reducer<S, M, C>` in the substrate).
32
- *
33
- * @example
34
- * type Msg = { type: "start" } | { type: "tick"; now: number };
35
- * const table: MsgArbitraryTable<Msg> = {
36
- * start: arbConstantMsg("start"),
37
- * tick: arbRecordMsg("tick", { now: fc.integer({ min: 0 }) }),
38
- * };
39
- */
40
- type MsgArbitraryTable<M extends {
41
- type: string;
42
- }> = {
43
- [K in M["type"]]: fc.Arbitrary<Extract<M, {
44
- type: K;
45
- }>>;
46
- };
47
- /**
48
- * Build a single `fc.Arbitrary<M>` from a `MsgArbitraryTable<M>`. Picks one
49
- * variant per generation via `fc.oneof`; optional per-variant `weights`
50
- * bias the distribution (default uniform).
51
- *
52
- * @param table Per-variant arbitrary table (strict — every variant required).
53
- * @param opts Optional bias: `weights` is a `Partial<Record<M["type"], number>>`.
54
- * Variants without an explicit weight default to 1.
55
- *
56
- * @example
57
- * const msgArb = arbMsg<Msg>({
58
- * start: arbConstantMsg("start"),
59
- * tick: arbRecordMsg("tick", { now: fc.integer() }),
60
- * stop: arbConstantMsg("stop"),
61
- * }, { weights: { tick: 5, start: 1, stop: 1 } });
62
- */
63
- declare function arbMsg<M extends {
64
- type: string;
65
- }>(table: MsgArbitraryTable<M>, opts?: {
66
- weights?: Partial<Record<M["type"], number>>;
67
- }): fc.Arbitrary<M>;
68
- /**
69
- * Build a payload-free Msg variant arbitrary. Sugar for
70
- * `fc.constant({ type })` that narrows the result to `{ type: T }` literal.
71
- *
72
- * @example
73
- * arbConstantMsg("stop") // fc.Arbitrary<{ type: "stop" }>
74
- */
75
- declare function arbConstantMsg<T extends string>(type: T): fc.Arbitrary<{
76
- type: T;
77
- }>;
78
- /**
79
- * Build a record-shaped Msg variant arbitrary. Sugar for
80
- * `fc.record({ type: fc.constant(type), ...fields })` that stamps the
81
- * discriminator literal and combines with the per-field arbitraries.
82
- *
83
- * @example
84
- * arbRecordMsg("tick", { now: fc.integer({ min: 0 }) })
85
- * // fc.Arbitrary<{ type: "tick"; now: number }>
86
- */
87
- declare function arbRecordMsg<T extends string, R>(type: T, fields: {
88
- [K in keyof R]: fc.Arbitrary<R[K]>;
89
- }): fc.Arbitrary<{
90
- type: T;
91
- } & R>;
92
-
93
- /**
94
- * Build an arbitrary of Msg sequences over a per-Msg arbitrary. Optionally
95
- * bounded in length and / or prefixed with a fixed sequence.
96
- *
97
- * - `minLength` (default 0) and `maxLength` (default 30) bound the random
98
- * array length. `prefix` is prepended AFTER the random tail is built; the
99
- * final length is `prefix.length + tail.length`.
100
- * - `prefix` is the load-bearing escape hatch for "the first msg is the
101
- * one that exercises the cell I care about" (e.g. Test A's
102
- * `[{ type: "ws:client:hello" }]` prefix to land in the
103
- * `auditing.ws:client:hello` cell on the first transition).
104
- *
105
- * @example
106
- * arbMsgSequence(msgArb, { minLength: 1, maxLength: 30 });
107
- * arbMsgSequence(msgArb, { prefix: [{ type: "ws:client:hello" }], maxLength: 20 });
108
- */
109
- declare function arbMsgSequence<M extends {
110
- type: string;
111
- }>(msgArb: fc.Arbitrary<M>, opts?: {
112
- readonly minLength?: number;
113
- readonly maxLength?: number;
114
- readonly prefix?: readonly NoInfer<M>[];
115
- }): fc.Arbitrary<readonly M[]>;
116
- /**
117
- * State-aware Msg sequence arbitrary — generates only msgs whose
118
- * precondition holds in the current state. Backed by `fc.commands`
119
- * internally. Planned for a later phase.
120
- *
121
- * **NOT IMPLEMENTED IN v1.** The export exists today so the surface is
122
- * forward-compatible; this ships in a later phase alongside
123
- * shrinkers. Calling it throws.
124
- */
125
- declare function arbGuidedSequence<S, M extends {
126
- type: string;
127
- }, C extends Cmd, U extends Sub, Ctx>(_machine: Machine<S, M, C, U, Ctx>, _ctx: Ctx, _cells: {
128
- [K in M["type"]]?: (state: S) => fc.Arbitrary<Extract<M, {
129
- type: K;
130
- }>> | null;
131
- }, _opts?: {
132
- maxLength?: number;
133
- }): fc.Arbitrary<readonly M[]>;
134
-
135
- export { type MsgArbitraryTable, arbConstantMsg, arbGuidedSequence, arbMsg, arbMsgSequence, arbRecordMsg, stubCtxThrowingProxy };
@@ -1,3 +0,0 @@
1
- export { arbConstantMsg, arbGuidedSequence, arbMsg, arbMsgSequence, arbRecordMsg, stubCtxThrowingProxy } from '../../chunk-AZZLE7XR.js';
2
- //# sourceMappingURL=index.js.map
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,117 +0,0 @@
1
- import * as fc from 'fast-check';
2
- import { C as Cmd, S as Sub, M as Machine } from '../../core-Bjc0bS8j.js';
3
-
4
- /**
5
- * One unit in a fold trace — the four pieces of data a property
6
- * invariant typically asserts on. `prev` is the state before the msg
7
- * applied; `next` is the state after; `cmds` is the cmds emitted by this
8
- * single step (NOT the running total).
9
- */
10
- interface Step<S, M, C> {
11
- readonly prev: S;
12
- readonly msg: M;
13
- readonly next: S;
14
- readonly cmds: readonly C[];
15
- }
16
- /**
17
- * Fold a Msg sequence through a machine's pure reducer, returning the
18
- * per-step trace, every state in order, and the final state. Initial
19
- * state comes from `replay(machine, { msgs: [], ctx, loaded })` — i.e.
20
- * `machine.init(loaded ?? null, ctx)` faithfully. Init's emitted cmds
21
- * are NOT included in any `Step` (they're the boot moment, not a Msg).
22
- *
23
- * @param machine The machine under test.
24
- * @param ctx The Ctx — typically `stubCtxThrowingProxy<Ctx>()` when
25
- * init is pure. Pass a real ctx if init reads from it.
26
- * @param loaded Optional pre-init snapshot (the `loaded` arg to
27
- * `machine.init`). Defaults to `null` (fresh boot).
28
- * @param msgs The Msg sequence to fold.
29
- *
30
- * @example
31
- * const { states, steps, finalState } = foldEvents(machine, ctx, null, [
32
- * { type: "start" }, { type: "tick" }, { type: "stop" },
33
- * ]);
34
- * // steps[1] = { prev: { type: "counting", n: 0 }, msg: { type: "tick" }, ... }
35
- */
36
- declare function foldEvents<S, M extends {
37
- type: string;
38
- }, C extends Cmd, U extends Sub, Ctx>(machine: Machine<S, M, C, U, Ctx>, ctx: NoInfer<Ctx>, loaded: NoInfer<S> | null, msgs: readonly NoInfer<M>[]): {
39
- readonly states: readonly S[];
40
- readonly steps: readonly Step<S, M, C>[];
41
- readonly finalState: S;
42
- };
43
-
44
- /** Common options shared by every property runner. */
45
- interface PropertyOpts<S> {
46
- /** Pre-init snapshot — passed to `machine.init(loaded, ctx)`. Default `null`. */
47
- readonly loaded?: S | null;
48
- /** Number of generated sequences to test. Forwarded to `fc.assert`. */
49
- readonly numRuns?: number;
50
- /** Optional fast-check seed for reproducibility. */
51
- readonly seed?: number;
52
- }
53
- /**
54
- * Assert every generated Msg sequence ends in a terminal state. `terminal`
55
- * is the predicate that names the acceptable final states (often
56
- * `(s) => s.type === "done" || s.type === "idle"`).
57
- *
58
- * The "every sequence" property catches stuck states (machine gets to a
59
- * non-terminal state and no further msg can escape) AND silent loops
60
- * (every msg variant is a noop from a given state).
61
- *
62
- * @example
63
- * propertyTerminates(
64
- * auditBackgroundMachine,
65
- * stubCtxThrowingProxy<BackgroundCtx>(),
66
- * arbMsgSequence(msgArb, { minLength: 1, maxLength: 30 }),
67
- * (s) => s.type === "done" || s.type === "idle",
68
- * { loaded: auditingState, numRuns: 500 },
69
- * );
70
- */
71
- declare function propertyTerminates<S, M extends {
72
- type: string;
73
- }, C extends Cmd, U extends Sub, Ctx>(machine: Machine<S, M, C, U, Ctx>, ctx: NoInfer<Ctx>, seqArb: fc.Arbitrary<readonly NoInfer<M>[]>, terminal: (state: NoInfer<S>) => boolean, opts?: NoInfer<PropertyOpts<S>>): void;
74
- /**
75
- * Assert a predicate holds on EVERY transition step in a generated
76
- * sequence. The predicate sees `{ prev, msg, next, cmds }` per step;
77
- * return true to accept, false (or throw) to fail.
78
- *
79
- * Use to pin a "when X happens in state Y, cmd Z must be emitted" rule.
80
- * The shrinker minimizes the offending sequence to the smallest Msg list
81
- * that still violates the predicate.
82
- *
83
- * @example
84
- * // Pin the resume-handshake fix: `ws:client:hello` in auditing must
85
- * // emit `send_ws { client:ready }`.
86
- * propertyInvariant(
87
- * auditBackgroundMachine, ctx,
88
- * arbMsgSequence(msgArb, { prefix: [{ type: "ws:client:hello" }] }),
89
- * ({ prev, msg, cmds }) =>
90
- * !(prev.type === "auditing" && msg.type === "ws:client:hello") ||
91
- * cmds.some((c) => c.type === "send_ws" && c.msg.type === "client:ready"),
92
- * { loaded: auditingState, numRuns: 200 },
93
- * );
94
- */
95
- declare function propertyInvariant<S, M extends {
96
- type: string;
97
- }, C extends Cmd, U extends Sub, Ctx>(machine: Machine<S, M, C, U, Ctx>, ctx: NoInfer<Ctx>, seqArb: fc.Arbitrary<readonly NoInfer<M>[]>, invariant: (step: Step<NoInfer<S>, NoInfer<M>, NoInfer<C>>) => boolean, opts?: NoInfer<PropertyOpts<S>>): void;
98
- /**
99
- * Assert a predicate over the full trace plus the final state. Use when
100
- * the property is "some Msg appeared in the trace before reaching the
101
- * final state" or "no two consecutive steps had the same state.type" —
102
- * predicates that need the full sequence, not a single step.
103
- *
104
- * @example
105
- * propertyTrace(
106
- * machine, ctx, seqArb,
107
- * (steps, final) =>
108
- * final.type !== "done" ||
109
- * steps.some((step) => step.msg.type === "ws:audit:done"),
110
- * { loaded: auditingState, numRuns: 500 },
111
- * );
112
- */
113
- declare function propertyTrace<S, M extends {
114
- type: string;
115
- }, C extends Cmd, U extends Sub, Ctx>(machine: Machine<S, M, C, U, Ctx>, ctx: NoInfer<Ctx>, seqArb: fc.Arbitrary<readonly NoInfer<M>[]>, predicate: (steps: readonly Step<NoInfer<S>, NoInfer<M>, NoInfer<C>>[], finalState: NoInfer<S>) => boolean, opts?: NoInfer<PropertyOpts<S>>): void;
116
-
117
- export { type Step, foldEvents, propertyInvariant, propertyTerminates, propertyTrace };
@@ -1,5 +0,0 @@
1
- export { foldEvents, propertyInvariant, propertyTerminates, propertyTrace } from '../../chunk-JP5D6GSL.js';
2
- import '../../chunk-5EHLEUTL.js';
3
- import '../../chunk-B5VXOFMZ.js';
4
- //# sourceMappingURL=index.js.map
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}