@demlik/tea 0.13.0 → 0.15.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.
- package/README.md +11 -9
- package/dist/agent/index.d.ts +638 -45
- package/dist/agent/index.js +9 -19
- package/dist/{chunk-RH5EFRVJ.js → chunk-22POWGFA.js} +31 -5
- package/dist/chunk-22POWGFA.js.map +1 -0
- package/dist/{chunk-DMYGQB4O.js → chunk-3B5X7SBB.js} +23 -6
- package/dist/chunk-3B5X7SBB.js.map +1 -0
- package/dist/chunk-66PY5WYF.js +1816 -0
- package/dist/chunk-66PY5WYF.js.map +1 -0
- package/dist/{chunk-25LBDCBC.js → chunk-6IQPODUF.js} +2 -2
- package/dist/{chunk-25LBDCBC.js.map → chunk-6IQPODUF.js.map} +1 -1
- package/dist/chunk-AYS5N6WY.js +505 -0
- package/dist/chunk-AYS5N6WY.js.map +1 -0
- package/dist/{chunk-EWJP3YYP.js → chunk-HWVW4AXC.js} +3 -3
- package/dist/chunk-HWVW4AXC.js.map +1 -0
- package/dist/{chunk-O4MVQTEJ.js → chunk-L3TND7LA.js} +20 -16
- package/dist/chunk-L3TND7LA.js.map +1 -0
- package/dist/{chunk-J6527VRQ.js → chunk-LFZUK6J2.js} +3 -3
- package/dist/chunk-LFZUK6J2.js.map +1 -0
- package/dist/{chunk-D736QUGF.js → chunk-MYXFNWAJ.js} +4 -5
- package/dist/chunk-MYXFNWAJ.js.map +1 -0
- package/dist/{chunk-K575PT4S.js → chunk-PR6TB3BL.js} +15 -4
- package/dist/chunk-PR6TB3BL.js.map +1 -0
- package/dist/{chunk-YUXP55T2.js → chunk-Q5CQTBFA.js} +57 -7
- package/dist/chunk-Q5CQTBFA.js.map +1 -0
- package/dist/{batch-window/index.js → chunk-QPEVCJ5Q.js} +4 -8
- package/dist/chunk-QPEVCJ5Q.js.map +1 -0
- package/dist/chunk-TCLBCERH.js +1480 -0
- package/dist/chunk-TCLBCERH.js.map +1 -0
- package/dist/{chunk-FV3Z5MBE.js → chunk-TXN2KFHF.js} +14 -4
- package/dist/chunk-TXN2KFHF.js.map +1 -0
- package/dist/{chunk-MUUROGIH.js → chunk-V46HSVCK.js} +62 -12
- package/dist/chunk-V46HSVCK.js.map +1 -0
- package/dist/{chunk-Q2UM7BXU.js → chunk-VBDU4JL6.js} +2 -2
- package/dist/chunk-VBDU4JL6.js.map +1 -0
- package/dist/{chunk-ZVJZ72HY.js → chunk-VTQI2NHP.js} +25 -11
- package/dist/chunk-VTQI2NHP.js.map +1 -0
- package/dist/{core-Co0LWkIA.d.ts → core-DnzqWy6u.d.ts} +72 -23
- package/dist/devtools/index.d.ts +2 -2
- package/dist/devtools/index.js +207 -2
- package/dist/devtools/index.js.map +1 -1
- package/dist/do/index.d.ts +43 -29
- package/dist/do/index.js +36 -25
- package/dist/do/index.js.map +1 -1
- package/dist/{durable-effects-C6uwzjb5.d.ts → durable-effects-CWzA-o2B.d.ts} +2 -2
- package/dist/extension/index.d.ts +300 -3
- package/dist/extension/index.js +596 -5
- package/dist/extension/index.js.map +1 -1
- package/dist/flow/index.d.ts +1284 -0
- package/dist/flow/index.js +732 -0
- package/dist/flow/index.js.map +1 -0
- package/dist/idempotency/index.d.ts +90 -116
- package/dist/idempotency/index.js +4 -1
- package/dist/index-Bc40JWVl.d.ts +131 -0
- package/dist/{batch-window/index.d.ts → index-C2DwkjlP.d.ts} +7 -12
- package/dist/index-CA_7I5g9.d.ts +806 -0
- package/dist/index-CSyMYDAB.d.ts +69 -0
- package/dist/{fan-out/index.d.ts → index-CuNO9m8i.d.ts} +7 -9
- package/dist/{debounce/index.d.ts → index-DHSUmQTR.d.ts} +7 -7
- package/dist/{recorder/index.d.ts → index-DrIRb_Ch.d.ts} +4 -7
- package/dist/index-HSYgG2Yt.d.ts +380 -0
- package/dist/{monitored-run/index.d.ts → index-KXqTRJyb.d.ts} +37 -13
- package/dist/{snapshot/index.d.ts → index-ZCMhnVKN.d.ts} +15 -78
- package/dist/index.d.ts +771 -6
- package/dist/index.js +1 -2
- package/dist/jev/index.d.ts +646 -0
- package/dist/jev/index.js +485 -0
- package/dist/jev/index.js.map +1 -0
- package/dist/machine-DGlPWCWI.d.ts +1781 -0
- package/dist/machine-viz/index.d.ts +1 -1
- package/dist/machine-viz/index.js +12 -5
- package/dist/machine-viz/index.js.map +1 -1
- package/dist/mem/index.d.ts +18 -3
- package/dist/mem/index.js +22 -2
- package/dist/mem/index.js.map +1 -1
- package/dist/node/index.d.ts +104 -6
- package/dist/node/index.js +132 -9
- package/dist/node/index.js.map +1 -1
- package/dist/{paginator → paginate}/index.d.ts +140 -6
- package/dist/paginate/index.js +7 -0
- package/dist/parity/index.d.ts +4 -10
- package/dist/parity/index.js +4 -7
- package/dist/parity/index.js.map +1 -1
- package/dist/pbt/index.d.ts +247 -5
- package/dist/pbt/index.js +124 -5
- package/dist/pbt/index.js.map +1 -1
- package/dist/{trace-replay → persistence}/index.d.ts +7 -5
- package/dist/persistence/index.js +6 -0
- package/dist/{protocol-B5YmJr0d.d.ts → protocol-D8VbH-VH.d.ts} +10 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +1 -2
- package/dist/react/index.js.map +1 -1
- package/dist/resilience/index.d.ts +744 -0
- package/dist/resilience/index.js +657 -0
- package/dist/resilience/index.js.map +1 -0
- package/dist/retry-backoff/index.d.ts +3 -2
- package/dist/retry-backoff/index.js +1 -1
- package/dist/runtime-types-CMF13BBh.d.ts +998 -0
- package/dist/testing/index.d.ts +147 -3
- package/dist/testing/index.js +95 -3
- package/dist/testing/index.js.map +1 -1
- package/dist/{throttled-input → timing}/index.d.ts +143 -12
- package/dist/{throttled-input → timing}/index.js +57 -12
- package/dist/timing/index.js.map +1 -0
- package/dist/{types-XS_miRnB.d.ts → types-BseNPIhr.d.ts} +1 -1
- package/dist/work-queue/index.d.ts +130 -54
- package/dist/work-queue/index.js +3 -2
- package/dist/work-queue/index.js.map +1 -1
- package/package.json +45 -218
- package/dist/authed-call/index.d.ts +0 -120
- package/dist/authed-call/index.js +0 -134
- package/dist/authed-call/index.js.map +0 -1
- package/dist/await-terminal/index.d.ts +0 -101
- package/dist/await-terminal/index.js +0 -76
- package/dist/await-terminal/index.js.map +0 -1
- package/dist/batch-window/index.js.map +0 -1
- package/dist/cache/index.d.ts +0 -152
- package/dist/cache/index.js +0 -8
- package/dist/chart/index.d.ts +0 -218
- package/dist/chart/index.js +0 -16
- package/dist/chart/index.js.map +0 -1
- package/dist/chart/inspect/index.d.ts +0 -86
- package/dist/chart/inspect/index.js +0 -5
- package/dist/chart/inspect/react.d.ts +0 -113
- package/dist/chart/inspect/react.js +0 -11
- package/dist/chart/inspect/react.js.map +0 -1
- package/dist/chart/inspect/styles.css +0 -286
- package/dist/chart/lane/index.d.ts +0 -362
- package/dist/chart/lane/index.js +0 -9
- package/dist/chart/lane/index.js.map +0 -1
- package/dist/chart/lane/react.d.ts +0 -84
- package/dist/chart/lane/react.js +0 -559
- package/dist/chart/lane/react.js.map +0 -1
- package/dist/chart/lane/server.d.ts +0 -148
- package/dist/chart/lane/server.js +0 -209
- package/dist/chart/lane/server.js.map +0 -1
- package/dist/chart/lane/styles.css +0 -498
- package/dist/chart/lane/viewer/assets/abnfDiagram-N423BO3Z-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/architectureDiagram-T3A2C74G-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/blockDiagram-VBNYF7ZC-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/c4Diagram-5PPSVZJV-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/chunk-2GRJ4B5K-HdDf8SI3.js +0 -1
- package/dist/chart/lane/viewer/assets/chunk-5RXB4S5H-CcNtpUd7.js +0 -231
- package/dist/chart/lane/viewer/assets/chunk-5VM5RSS4-BP4fRS_5.js +0 -15
- package/dist/chart/lane/viewer/assets/chunk-KBJHAD2P-DZOw7xU6.js +0 -1
- package/dist/chart/lane/viewer/assets/chunk-NSK5VX7P-CBCyTZMs.js +0 -128
- package/dist/chart/lane/viewer/assets/classDiagram-JCYQIIEL-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/classDiagram-v2-OCEON4UE-D4uAiFr8.js +0 -206
- package/dist/chart/lane/viewer/assets/cose-bilkent-JH36ORCC-DOwCrGXH.js +0 -1
- package/dist/chart/lane/viewer/assets/cynefinDiagram-MW4NZA55-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/dagre-K_PewWfS.js +0 -1
- package/dist/chart/lane/viewer/assets/dagre-VZM6K2ZE-831qZcA8.js +0 -4
- package/dist/chart/lane/viewer/assets/diagram-7IWD3JNH-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/diagram-B4RE2ZJO-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/diagram-LBJQPF4R-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/diagram-Q27KOJAE-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/diagram-UB23O5K3-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/ebnfDiagram-BXEA7PRR-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/erDiagram-JOGREHBK-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/flowDiagram-UKHOOZJN-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/ganttDiagram-PKOTCBZU-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/gitGraphDiagram-DS77QQ5N-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/index-9SkH5NA3.css +0 -1
- package/dist/chart/lane/viewer/assets/index-Bgt4sXpW.js +0 -195
- package/dist/chart/lane/viewer/assets/infoDiagram-6WML65LV-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/ishikawaDiagram-WSZJBQD7-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/journeyDiagram-NVQOT4AX-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/kanban-definition-27J2QSJJ-G7PaPzy-.js +0 -89
- package/dist/chart/lane/viewer/assets/katex-DOwCrGXH.js +0 -1
- package/dist/chart/lane/viewer/assets/mindmap-definition-FAOFIHXS-CGj9nrVk.js +0 -96
- package/dist/chart/lane/viewer/assets/path-fybaL0A-.js +0 -1
- package/dist/chart/lane/viewer/assets/pegDiagram-VL7TDLO6-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/pieDiagram-7S7Q4E2Y-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/quadrantDiagram-CIZ2JOQS-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/railroadDiagram-AXF67PYL-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/requirementDiagram-LRYGKXZP-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/sankeyDiagram-W5VNT64P-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/sequenceDiagram-SI44F4Z6-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/stateDiagram-OKZ733FA-B_88AzBS.js +0 -1
- package/dist/chart/lane/viewer/assets/stateDiagram-v2-UEYNNEHI-CR5gcgq6.js +0 -1
- package/dist/chart/lane/viewer/assets/swimlanes-SLNWSIFB-B4xK-rwg.js +0 -1
- package/dist/chart/lane/viewer/assets/swimlanesDiagram-ULZ7WXOC-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/timeline-definition-Z64GVDOM-CCv52MfY.js +0 -120
- package/dist/chart/lane/viewer/assets/vennDiagram-T6HMQDX7-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/wardleyDiagram-T6FBY63Y-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/assets/xychartDiagram-ELKLHX3M-C729LI31.js +0 -1
- package/dist/chart/lane/viewer/index.html +0 -15
- package/dist/chart/report/index.d.ts +0 -117
- package/dist/chart/report/index.js +0 -32
- package/dist/chart/report/index.js.map +0 -1
- package/dist/chunk-2YFLOCWX.js +0 -15
- package/dist/chunk-2YFLOCWX.js.map +0 -1
- package/dist/chunk-3I52QZZ5.js +0 -519
- package/dist/chunk-3I52QZZ5.js.map +0 -1
- package/dist/chunk-3ZAFFRRB.js +0 -457
- package/dist/chunk-3ZAFFRRB.js.map +0 -1
- package/dist/chunk-4EQZ76JC.js +0 -33
- package/dist/chunk-4EQZ76JC.js.map +0 -1
- package/dist/chunk-4KLG43GY.js +0 -223
- package/dist/chunk-4KLG43GY.js.map +0 -1
- package/dist/chunk-7FRZ2CT2.js +0 -424
- package/dist/chunk-7FRZ2CT2.js.map +0 -1
- package/dist/chunk-AZZLE7XR.js +0 -62
- package/dist/chunk-AZZLE7XR.js.map +0 -1
- package/dist/chunk-BYQUGDD3.js +0 -16
- package/dist/chunk-BYQUGDD3.js.map +0 -1
- package/dist/chunk-CIQG5L42.js +0 -685
- package/dist/chunk-CIQG5L42.js.map +0 -1
- package/dist/chunk-CLM6ERNO.js +0 -61
- package/dist/chunk-CLM6ERNO.js.map +0 -1
- package/dist/chunk-COS5MSTO.js +0 -88
- package/dist/chunk-COS5MSTO.js.map +0 -1
- package/dist/chunk-CRPZJVD2.js +0 -71
- package/dist/chunk-CRPZJVD2.js.map +0 -1
- package/dist/chunk-D62FDQKE.js +0 -53
- package/dist/chunk-D62FDQKE.js.map +0 -1
- package/dist/chunk-D736QUGF.js.map +0 -1
- package/dist/chunk-DGE4PV4A.js +0 -26
- package/dist/chunk-DGE4PV4A.js.map +0 -1
- package/dist/chunk-DMYGQB4O.js.map +0 -1
- package/dist/chunk-EWJP3YYP.js.map +0 -1
- package/dist/chunk-FV3Z5MBE.js.map +0 -1
- package/dist/chunk-HCEVHFJ7.js +0 -54
- package/dist/chunk-HCEVHFJ7.js.map +0 -1
- package/dist/chunk-J6527VRQ.js.map +0 -1
- package/dist/chunk-JELSZN25.js +0 -47
- package/dist/chunk-JELSZN25.js.map +0 -1
- package/dist/chunk-K575PT4S.js.map +0 -1
- package/dist/chunk-L57ZOT5K.js +0 -184
- package/dist/chunk-L57ZOT5K.js.map +0 -1
- package/dist/chunk-MU6MCIAC.js +0 -15
- package/dist/chunk-MU6MCIAC.js.map +0 -1
- package/dist/chunk-MUUROGIH.js.map +0 -1
- package/dist/chunk-NR7BU22N.js +0 -758
- package/dist/chunk-NR7BU22N.js.map +0 -1
- package/dist/chunk-O4MVQTEJ.js.map +0 -1
- package/dist/chunk-OOYD44JI.js +0 -317
- package/dist/chunk-OOYD44JI.js.map +0 -1
- package/dist/chunk-Q2UM7BXU.js.map +0 -1
- package/dist/chunk-RH5EFRVJ.js.map +0 -1
- package/dist/chunk-S2EGRPCM.js +0 -47
- package/dist/chunk-S2EGRPCM.js.map +0 -1
- package/dist/chunk-SINXE47Y.js +0 -55
- package/dist/chunk-SINXE47Y.js.map +0 -1
- package/dist/chunk-UF4MZSLT.js +0 -53
- package/dist/chunk-UF4MZSLT.js.map +0 -1
- package/dist/chunk-UOC2PL46.js +0 -13
- package/dist/chunk-UOC2PL46.js.map +0 -1
- package/dist/chunk-VYFAZN3F.js +0 -372
- package/dist/chunk-VYFAZN3F.js.map +0 -1
- package/dist/chunk-WRAA7GVZ.js +0 -209
- package/dist/chunk-WRAA7GVZ.js.map +0 -1
- package/dist/chunk-XGELA764.js +0 -163
- package/dist/chunk-XGELA764.js.map +0 -1
- package/dist/chunk-YUXP55T2.js.map +0 -1
- package/dist/chunk-YWIKDKHY.js +0 -307
- package/dist/chunk-YWIKDKHY.js.map +0 -1
- package/dist/chunk-ZJ5AOYBH.js +0 -8
- package/dist/chunk-ZJ5AOYBH.js.map +0 -1
- package/dist/chunk-ZSUUOEPL.js +0 -731
- package/dist/chunk-ZSUUOEPL.js.map +0 -1
- package/dist/chunk-ZVJZ72HY.js.map +0 -1
- package/dist/circuit-breaker/index.d.ts +0 -197
- package/dist/circuit-breaker/index.js +0 -3
- package/dist/circuit-breaker/index.js.map +0 -1
- package/dist/deadline/index.d.ts +0 -199
- package/dist/deadline/index.js +0 -6
- package/dist/deadline/index.js.map +0 -1
- package/dist/debounce/index.js +0 -3
- package/dist/debounce/index.js.map +0 -1
- package/dist/extension/react.d.ts +0 -121
- package/dist/extension/react.js +0 -75
- package/dist/extension/react.js.map +0 -1
- package/dist/extension/subs/index.d.ts +0 -45
- package/dist/extension/subs/index.js +0 -80
- package/dist/extension/subs/index.js.map +0 -1
- package/dist/extension/test-utils.d.ts +0 -128
- package/dist/extension/test-utils.js +0 -277
- package/dist/extension/test-utils.js.map +0 -1
- package/dist/fan-out/index.js +0 -5
- package/dist/fan-out/index.js.map +0 -1
- package/dist/fold-BJPdjc9w.d.ts +0 -435
- package/dist/graph-B3L5e0N1.d.ts +0 -923
- package/dist/idempotency/adapter.d.ts +0 -62
- package/dist/idempotency/adapter.js +0 -4
- package/dist/idempotency/adapter.js.map +0 -1
- package/dist/idempotent-intake/index.d.ts +0 -188
- package/dist/idempotent-intake/index.js +0 -7
- package/dist/idempotent-intake/index.js.map +0 -1
- package/dist/journal/index.d.ts +0 -373
- package/dist/journal/index.js +0 -3
- package/dist/journal/index.js.map +0 -1
- package/dist/llm-call/index.d.ts +0 -311
- package/dist/llm-call/index.js +0 -16
- package/dist/llm-call/index.js.map +0 -1
- package/dist/machine-BtFWQmmq.d.ts +0 -804
- package/dist/monitored-run/index.js +0 -10
- package/dist/monitored-run/index.js.map +0 -1
- package/dist/paginated-walk/index.d.ts +0 -235
- package/dist/paginated-walk/index.js +0 -16
- package/dist/paginated-walk/index.js.map +0 -1
- package/dist/paginator/index.js +0 -3
- package/dist/paginator/index.js.map +0 -1
- package/dist/pbt/arbitraries/index.d.ts +0 -136
- package/dist/pbt/arbitraries/index.js +0 -3
- package/dist/pbt/arbitraries/index.js.map +0 -1
- package/dist/pbt/runners/index.d.ts +0 -118
- package/dist/pbt/runners/index.js +0 -5
- package/dist/pbt/runners/index.js.map +0 -1
- package/dist/poller/index.d.ts +0 -352
- package/dist/poller/index.js +0 -115
- package/dist/poller/index.js.map +0 -1
- package/dist/prediction/index.d.ts +0 -131
- package/dist/prediction/index.js +0 -4
- package/dist/prediction/index.js.map +0 -1
- package/dist/pure/index.d.ts +0 -3
- package/dist/pure/index.js +0 -4
- package/dist/pure/index.js.map +0 -1
- package/dist/rate-limit/index.d.ts +0 -115
- package/dist/rate-limit/index.js +0 -3
- package/dist/rate-limit/index.js.map +0 -1
- package/dist/reconciler/index.d.ts +0 -193
- package/dist/reconciler/index.js +0 -164
- package/dist/reconciler/index.js.map +0 -1
- package/dist/recorder/index.js +0 -3
- package/dist/recorder/index.js.map +0 -1
- package/dist/reducer-4GNR6b8B.d.ts +0 -447
- package/dist/resilient-call/index.d.ts +0 -320
- package/dist/resilient-call/index.js +0 -14
- package/dist/resilient-call/index.js.map +0 -1
- package/dist/retry-to-success/index.d.ts +0 -109
- package/dist/retry-to-success/index.js +0 -37
- package/dist/retry-to-success/index.js.map +0 -1
- package/dist/run-pAcmBpah.d.ts +0 -713
- package/dist/runtime-types-CNLmhWif.d.ts +0 -517
- package/dist/saga/index.d.ts +0 -241
- package/dist/saga/index.js +0 -150
- package/dist/saga/index.js.map +0 -1
- package/dist/samples-B3My5oh2.d.ts +0 -59
- package/dist/snapshot/index.js +0 -5
- package/dist/snapshot/index.js.map +0 -1
- package/dist/subs/index.d.ts +0 -472
- package/dist/subs/index.js +0 -7
- package/dist/subs/index.js.map +0 -1
- package/dist/throttle/index.d.ts +0 -134
- package/dist/throttle/index.js +0 -3
- package/dist/throttle/index.js.map +0 -1
- package/dist/throttled-input/index.js.map +0 -1
- package/dist/token-refresh/index.d.ts +0 -216
- package/dist/token-refresh/index.js +0 -6
- package/dist/token-refresh/index.js.map +0 -1
- package/dist/trace-replay/index.js +0 -6
- package/dist/trace-replay/index.js.map +0 -1
- package/dist/with-deadline/index.d.ts +0 -197
- package/dist/with-deadline/index.js +0 -111
- package/dist/with-deadline/index.js.map +0 -1
- package/dist/with-resilience/index.d.ts +0 -225
- package/dist/with-resilience/index.js +0 -240
- package/dist/with-resilience/index.js.map +0 -1
- package/dist/with-telemetry/index.d.ts +0 -150
- package/dist/with-telemetry/index.js +0 -70
- package/dist/with-telemetry/index.js.map +0 -1
- package/dist/work-queue/adapter.d.ts +0 -84
- package/dist/work-queue/adapter.js +0 -4
- package/dist/work-queue/adapter.js.map +0 -1
- package/dist/work-queue/ops.d.ts +0 -71
- package/dist/work-queue/ops.js +0 -3
- package/dist/work-queue/ops.js.map +0 -1
- package/dist/workflow/index.d.ts +0 -485
- package/dist/workflow/index.js +0 -244
- package/dist/workflow/index.js.map +0 -1
- /package/dist/{cache → paginate}/index.js.map +0 -0
- /package/dist/{chart/inspect → persistence}/index.js.map +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { createMonitoredRun, liftRun } from '../chunk-DMYGQB4O.js';
|
|
2
|
-
import '../chunk-O4MVQTEJ.js';
|
|
3
|
-
export { deadlineSub, subscribeDeadline } from '../chunk-DGE4PV4A.js';
|
|
4
|
-
import '../chunk-MU6MCIAC.js';
|
|
5
|
-
import '../chunk-FV3Z5MBE.js';
|
|
6
|
-
import '../chunk-2YFLOCWX.js';
|
|
7
|
-
import '../chunk-ZSUUOEPL.js';
|
|
8
|
-
import '../chunk-OOYD44JI.js';
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { C as Cmd } from '../core-Co0LWkIA.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 'zod';
|
|
8
|
-
import '../cache/index.js';
|
|
9
|
-
import '../types-XS_miRnB.js';
|
|
10
|
-
import '../circuit-breaker/index.js';
|
|
11
|
-
import '../protocol-B5YmJr0d.js';
|
|
12
|
-
import '../rate-limit/index.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @demlik/tea/paginated-walk — traverse a paginated API / sitemap end to end
|
|
16
|
-
* WITHOUT a fake clock, without 429s, and resumable across a Durable-Object
|
|
17
|
-
* eviction. The L2 composition that bolts `../resilient-call`'s resilience onto
|
|
18
|
-
* `../paginator`'s cursor walk: each page is fetched as ONE keyed resilient
|
|
19
|
-
* call (retry + backoff + rate-limit gate), and the cursor advances only once a
|
|
20
|
-
* page settles `ok`.
|
|
21
|
-
*
|
|
22
|
-
* ## The recipe (the two siblings it composes)
|
|
23
|
-
*
|
|
24
|
-
* - **`../paginator`** owns the walk loop: the opaque `Cursor`, the `seen` /
|
|
25
|
-
* `pages` counters, and the `idle → fetching → … → done` phase machine.
|
|
26
|
-
* `paginated-walk` never re-implements cursor advancement — it folds each
|
|
27
|
-
* settled page through `recordPage`, letting the paginator decide
|
|
28
|
-
* `done` / `fetching(next)` / `paused`. Backpressure is a TWO-way valve:
|
|
29
|
-
* `recordPage` parks the walk in `paused` once `seen >= highWaterMark`, and
|
|
30
|
-
* the `drain` / `resume` verbs (delegating to the paginator's own
|
|
31
|
-
* `drain` / `resume`) lower the gauge and re-open the parked fetch — without
|
|
32
|
-
* them `highWaterMark` would be a one-way valve that strands a paused walk.
|
|
33
|
-
* - **`../resilient-call`** owns the page fetch: the single `resilient_run`
|
|
34
|
-
* effect per page is gated through that knob's cache → circuit → rate-limit
|
|
35
|
-
* → retry pipeline. A transient page failure backs off and re-issues the
|
|
36
|
-
* SAME cursor (idempotent retry); the walk does not advance until the page
|
|
37
|
-
* genuinely settles.
|
|
38
|
-
*
|
|
39
|
-
* Those are the only two siblings this module calls into. The resilience knobs
|
|
40
|
-
* (`retry` / `circuit` / `rateLimit` / `deadline`) are NOT separate bricks
|
|
41
|
-
* `paginated-walk` composes — they belong to `resilient-call`, which owns the
|
|
42
|
-
* rate-limit gate internally. This module merely passes them through to
|
|
43
|
-
* `createResilientCall` and re-uses two config TYPES at the boundary:
|
|
44
|
-
* `RateLimitConfig` (re-exported by `resilient-call`) and `RetryPolicy` (from
|
|
45
|
-
* `../retry-backoff`). Pass a `rateLimit` and `resilient-call`'s token bucket
|
|
46
|
-
* throttles page fetches ("don't 429 the upstream"); omit it and the walk runs
|
|
47
|
-
* as fast as the upstream answers.
|
|
48
|
-
*
|
|
49
|
-
* Because the page-fetch resilience IS a `resilient-call` slice, this knob
|
|
50
|
-
* **inherits that knob's contract verbatim**: the slice is a flat record, every
|
|
51
|
-
* verb returns `readonly [State, Cmd[]]`, time is always an `at` parameter, and
|
|
52
|
-
* the jitter RNG is injected once at `createPaginatedWalk(config, rng)` — never
|
|
53
|
-
* read inside a verb (per the spec, `paginated-walk` *extends* `resilient-call`).
|
|
54
|
-
*
|
|
55
|
-
* ## The two non-negotiables (canon)
|
|
56
|
-
*
|
|
57
|
-
* - **Durable** — the slice is plain data: the paginator phase + counters, and
|
|
58
|
-
* the resilient-call brick states (all JSON-serializable). The cursor lives
|
|
59
|
-
* in the Model, not a closure, so a walk survives eviction mid-traversal and
|
|
60
|
-
* resumes from the exact page it was fetching.
|
|
61
|
-
* - **Replayable** — every transition is a verb returning new state + Cmds.
|
|
62
|
-
* `nextCursor` / `onPage` are pure config functions applied at the verb
|
|
63
|
-
* boundary; the Cmds they yield are plain data. `replay` reconstructs the
|
|
64
|
-
* whole walk exactly.
|
|
65
|
-
*
|
|
66
|
-
* ## Where the clock / RNG live
|
|
67
|
-
*
|
|
68
|
-
* Inside the verbs: nowhere. `at` arrives on `start` / `pageOk` / `pageErr` /
|
|
69
|
-
* `onTimer` and is threaded straight into the underlying resilient-call gate (so
|
|
70
|
-
* a rate-limited or retried page measures backoff from that `at`). The jitter
|
|
71
|
-
* RNG is injected at construction. The only clock read is `Date.now()` inside
|
|
72
|
-
* the resilient-call `handlers` port (the effect boundary), inherited unchanged.
|
|
73
|
-
*
|
|
74
|
-
* ## The fixed fetch key
|
|
75
|
-
*
|
|
76
|
-
* A walk fetches one page at a time, so the resilient-call layer tracks exactly
|
|
77
|
-
* one logical call under the constant key `PAGE_KEY`. The cursor being fetched
|
|
78
|
-
* is the resilient call's `input`, so a post-eviction resume re-issues the same
|
|
79
|
-
* page request. (`resilient-call` is keyed to support N concurrent calls; a walk
|
|
80
|
-
* deliberately uses a single key — the paginator is the sequencer.)
|
|
81
|
-
*
|
|
82
|
-
* ## Typical wiring
|
|
83
|
-
*
|
|
84
|
-
* const walk = createPaginatedWalk<PageToken, ApiPage>({
|
|
85
|
-
* firstPage: null, // the API's "page one" sentinel
|
|
86
|
-
* nextCursor: (page) => page.nextToken ?? null,
|
|
87
|
-
* onPage: (page) => [{ type: "index_rows", rows: page.items }],
|
|
88
|
-
* rateLimit: { capacity: 10, refillPerSec: 5 },
|
|
89
|
-
* retry: defaultRetryPolicy,
|
|
90
|
-
* });
|
|
91
|
-
*
|
|
92
|
-
* // in the machine:
|
|
93
|
-
* init: () => [{ walk: walk.init() }, []],
|
|
94
|
-
* update: {
|
|
95
|
-
* start: (s, m) => lift(s, walk.start(s.walk, m.at)),
|
|
96
|
-
* page_ok: (s, m) => lift(s, walk.pageOk(s.walk, m.result, m.at)),
|
|
97
|
-
* page_err: (s, m) => lift(s, walk.pageErr(s.walk, m.error, m.at)),
|
|
98
|
-
* retry_due:(s, m) => lift(s, walk.onTimer(s.walk, m)),
|
|
99
|
-
* drained: (s, m) => lift(s, walk.drain(s.walk, m.n)),
|
|
100
|
-
* resume: (s, m) => lift(s, walk.resume(s.walk, m.at)),
|
|
101
|
-
* },
|
|
102
|
-
* subscriptions: (s) => walk.subs(s.walk),
|
|
103
|
-
* subscribe: { deadline: subscribeDeadline },
|
|
104
|
-
* interpret: walk.handlers({ run: (cursor) => api.fetchPage(cursor) }),
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The paginated-walk knob. Generic in `Cursor` (the opaque page handle the
|
|
109
|
-
* upstream API hands back — offset, page token, "next" URL, …) and `Page` (the
|
|
110
|
-
* shape your fetch port resolves with).
|
|
111
|
-
*
|
|
112
|
-
* `nextCursor` and `onPage` are PURE config functions applied at the verb
|
|
113
|
-
* boundary, never stored in the slice or in a Cmd (invariant 3 — Cmds are
|
|
114
|
-
* plain data, not closures). `nextCursor(page)` extracts the API's next-page
|
|
115
|
-
* handle (or `null` at the end); `onPage(page)` yields the Cmds the consumer
|
|
116
|
-
* wants emitted for each successfully fetched page (index rows, write to R2,
|
|
117
|
-
* dispatch a downstream Msg — whatever; an empty array is fine).
|
|
118
|
-
*
|
|
119
|
-
* The resilience bricks (`retry` / `circuit` / `rateLimit` / `deadline`) are
|
|
120
|
-
* the SAME optional knobs `resilient-call` exposes — paginated-walk extends it.
|
|
121
|
-
* `rateLimit` is the brick that keeps the walk from 429-ing the upstream.
|
|
122
|
-
*/
|
|
123
|
-
interface PaginatedWalkConfig<Cursor, Page, EmittedCmd extends Cmd> {
|
|
124
|
-
/**
|
|
125
|
-
* The cursor the walk fetches first. For an offset API this is typically `0`;
|
|
126
|
-
* for a token API, whatever sentinel the API treats as "page one" (often
|
|
127
|
-
* `null` or `""`). Threaded into `paginator`'s `firstCursor`.
|
|
128
|
-
*/
|
|
129
|
-
readonly firstPage: Cursor;
|
|
130
|
-
/**
|
|
131
|
-
* Extract the next cursor from a just-fetched page. Return a `Cursor` to keep
|
|
132
|
-
* walking, or `null` when the API signalled the end (the walk finishes). PURE
|
|
133
|
-
* + consumer-specific (only the consumer knows the API's pagination shape).
|
|
134
|
-
*/
|
|
135
|
-
readonly nextCursor: (page: Page) => Cursor | null;
|
|
136
|
-
/**
|
|
137
|
-
* The Cmds to emit for each successfully fetched page — the consumer's work
|
|
138
|
-
* per page (index, persist, fan out, …). Returns plain-data Cmds; `[]` is a
|
|
139
|
-
* valid "I process the page synchronously elsewhere" answer. PURE.
|
|
140
|
-
*/
|
|
141
|
-
readonly onPage: (page: Page) => readonly EmittedCmd[];
|
|
142
|
-
/**
|
|
143
|
-
* How many items a page contributes to the paginator's backpressure gauge
|
|
144
|
-
* (`seen`). Defaults to `1` per page (count pages, not items) when omitted; a
|
|
145
|
-
* consumer that wants per-item backpressure returns `page.items.length`. PURE.
|
|
146
|
-
*/
|
|
147
|
-
readonly pageSize?: (page: Page) => number;
|
|
148
|
-
/**
|
|
149
|
-
* Backpressure threshold handed to the paginator. `seen >= highWaterMark`
|
|
150
|
-
* parks the walk in `paused` instead of fetching the next page. Non-positive
|
|
151
|
-
* (the default `0`) disables backpressure — the walk runs flat out until the
|
|
152
|
-
* API exhausts. See `../paginator`'s `highWaterMark` docs.
|
|
153
|
-
*/
|
|
154
|
-
readonly highWaterMark?: number;
|
|
155
|
-
/** Exponential-backoff retry policy for a transient page-fetch failure. */
|
|
156
|
-
readonly retry?: RetryPolicy;
|
|
157
|
-
/** Circuit breaker around the page fetch (one upstream → one breaker). */
|
|
158
|
-
readonly circuit?: CircuitConfig;
|
|
159
|
-
/** Token-bucket rate limit — the "don't 429 the upstream" knob. */
|
|
160
|
-
readonly rateLimit?: RateLimitConfig;
|
|
161
|
-
/** Overall wall-clock deadline per individual page fetch. */
|
|
162
|
-
readonly deadline?: DeadlineConfig;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* The slice. `walk` is the cursor/phase/counters from `../paginator`;
|
|
166
|
-
* `resilience` is the `../resilient-call` slice that gates the page fetch.
|
|
167
|
-
* Every field is JSON-serializable, so the whole walk survives a reload.
|
|
168
|
-
*
|
|
169
|
-
* The two move in lockstep: `walk` decides WHICH cursor to fetch next, while
|
|
170
|
-
* `resilience` decides HOW that fetch is attempted (gated, retried, backed
|
|
171
|
-
* off). `pageOk` advances `walk`; `pageErr` defers to `resilience` and leaves
|
|
172
|
-
* `walk` parked on the same cursor until the page truly settles.
|
|
173
|
-
*/
|
|
174
|
-
interface PaginatedWalkState<Cursor, Page> {
|
|
175
|
-
readonly walk: PaginatorState<Cursor>;
|
|
176
|
-
readonly resilience: ResilientState<Cursor, Page>;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* The page-fetch effect this knob emits: the inherited `resilient_run` Cmd from
|
|
180
|
-
* resilient-call, whose `input` is the `Cursor` to fetch and whose `key` is the
|
|
181
|
-
* fixed `PAGE_KEY`. The consumer's `handlers(ports)` interprets it.
|
|
182
|
-
*/
|
|
183
|
-
type FetchPageCmd<Cursor> = RunCmd<Cursor>;
|
|
184
|
-
/** Page-settled Msgs the `handlers` port dispatches back (inherited verbatim). */
|
|
185
|
-
type PageOkMsg<Page> = SucceedMsg<Page>;
|
|
186
|
-
type PageErrMsg = FailMsg;
|
|
187
|
-
/** The retry / deadline timer Msg — inherited from resilient-call. */
|
|
188
|
-
type PaginatedWalkTimerMsg = ResilientTimerMsg;
|
|
189
|
-
/**
|
|
190
|
-
* Ports the consumer supplies to `handlers`. `run(cursor)` fetches ONE page for
|
|
191
|
-
* the given cursor; throwing routes to `pageErr` (and thus the resilience
|
|
192
|
-
* backoff). Same shape as resilient-call's port, specialized to the page fetch.
|
|
193
|
-
*/
|
|
194
|
-
interface PaginatedWalkPorts<Cursor, Page> extends ResilientPorts<Cursor, Page> {
|
|
195
|
-
}
|
|
196
|
-
/** The single resilient-call key every page fetch runs under. */
|
|
197
|
-
declare const PAGE_KEY = "page";
|
|
198
|
-
/**
|
|
199
|
-
* Build a paginated-walk knob from `config`. `rng` is injected for the
|
|
200
|
-
* underlying retry jitter — pass a fixed `() => 0` in tests to pin backoff;
|
|
201
|
-
* defaults to `Math.random` (read at the verb boundary inside resilient-call,
|
|
202
|
-
* never in a `paginated-walk` verb). Inherited straight from resilient-call.
|
|
203
|
-
*
|
|
204
|
-
* Returns the uniform L2 knob contract: `init()`, the verbs `start` / `pageOk`
|
|
205
|
-
* / `pageErr` / `onTimer`, `subs(state)`, and `handlers(ports)`. `Cursor` is
|
|
206
|
-
* the page handle, `Page` the fetch result, `EmittedCmd` the consumer's
|
|
207
|
-
* per-page Cmds plus the inherited `FetchPageCmd`.
|
|
208
|
-
*/
|
|
209
|
-
declare function createPaginatedWalk<Cursor, Page, EmittedCmd extends Cmd = Cmd>(config: PaginatedWalkConfig<Cursor, Page, EmittedCmd>, rng?: () => number): {
|
|
210
|
-
init: () => PaginatedWalkState<Cursor, Page>;
|
|
211
|
-
start: (s: PaginatedWalkState<Cursor, Page>, at: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
|
|
212
|
-
pageOk: (s: PaginatedWalkState<Cursor, Page>, page: Page, at: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
|
|
213
|
-
pageErr: (s: PaginatedWalkState<Cursor, Page>, error: unknown, at: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
|
|
214
|
-
onTimer: (s: PaginatedWalkState<Cursor, Page>, msg: PaginatedWalkTimerMsg) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
|
|
215
|
-
drain: (s: PaginatedWalkState<Cursor, Page>, n: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
|
|
216
|
-
resume: (s: PaginatedWalkState<Cursor, Page>, at: number) => readonly [PaginatedWalkState<Cursor, Page>, readonly (EmittedCmd | FetchPageCmd<Cursor>)[]];
|
|
217
|
-
isComplete: (s: PaginatedWalkState<Cursor, Page>) => boolean;
|
|
218
|
-
failure: (s: PaginatedWalkState<Cursor, Page>) => unknown;
|
|
219
|
-
isStuck: (s: PaginatedWalkState<Cursor, Page>) => boolean;
|
|
220
|
-
subs: (s: PaginatedWalkState<Cursor, Page>) => readonly DeadlineSub[];
|
|
221
|
-
handlers: (ports: PaginatedWalkPorts<Cursor, Page>) => {
|
|
222
|
-
resilient_run: (cmd: RunCmd<Cursor>, ctx: Readonly<Record<never, never>>) => Promise<FailMsg | SucceedMsg<Page>>;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
226
|
-
* Lift a knob result `[slice, cmds]` into a host `[State, cmds]` where the slice
|
|
227
|
-
* lives at `state.walk`. A convenience for the common single-slice host;
|
|
228
|
-
* consumers with a differently-named field spread by hand. Pure — a thin record
|
|
229
|
-
* rebuild, no clock / RNG.
|
|
230
|
-
*/
|
|
231
|
-
declare function liftWalk<S extends {
|
|
232
|
-
walk: PaginatedWalkState<Cursor, Page>;
|
|
233
|
-
}, Cursor, Page, C extends Cmd>(state: S, [slice, cmds]: readonly [PaginatedWalkState<Cursor, Page>, readonly C[]]): readonly [S, readonly C[]];
|
|
234
|
-
|
|
235
|
-
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-YUXP55T2.js';
|
|
2
|
-
import '../chunk-SINXE47Y.js';
|
|
3
|
-
import '../chunk-4KLG43GY.js';
|
|
4
|
-
import '../chunk-JELSZN25.js';
|
|
5
|
-
import '../chunk-RH5EFRVJ.js';
|
|
6
|
-
export { deadlineSub, subscribeDeadline } from '../chunk-DGE4PV4A.js';
|
|
7
|
-
import '../chunk-Q2UM7BXU.js';
|
|
8
|
-
import '../chunk-S2EGRPCM.js';
|
|
9
|
-
import '../chunk-UF4MZSLT.js';
|
|
10
|
-
import '../chunk-VYFAZN3F.js';
|
|
11
|
-
import '../chunk-2YFLOCWX.js';
|
|
12
|
-
import '../chunk-ZJ5AOYBH.js';
|
|
13
|
-
import '../chunk-ZSUUOEPL.js';
|
|
14
|
-
import '../chunk-OOYD44JI.js';
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/paginator/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import * as fc from 'fast-check';
|
|
2
|
-
import { C as Cmd, S as Sub, M as Machine } from '../../core-Co0LWkIA.js';
|
|
3
|
-
import 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Build a Ctx value whose every property access throws. Use as the `ctx`
|
|
7
|
-
* argument to PBT runners when the reducer under test is pure (does not
|
|
8
|
-
* read from ctx). Accidental ctx access during property generation
|
|
9
|
-
* surfaces as a labelled error instead of a silent `undefined` or
|
|
10
|
-
* downstream type-error.
|
|
11
|
-
*
|
|
12
|
-
* Returns a typed `Ctx` (via `as unknown as Ctx`) — the proxy satisfies the
|
|
13
|
-
* type-shape requirement at the call site; the runtime contract is
|
|
14
|
-
* "throw on first read." The `as unknown` cast is the one boundary cast
|
|
15
|
-
* this helper requires; the proxy is structurally a `Ctx` for every
|
|
16
|
-
* property accessor.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* import { stubCtxThrowingProxy } from "../index";
|
|
20
|
-
* const ctx = stubCtxThrowingProxy<MyCtx>();
|
|
21
|
-
* propertyTerminates(machine, ctx, ...);
|
|
22
|
-
* // If anything reads ctx.someField during the run, an Error throws:
|
|
23
|
-
* // "@demlik/tea/pbt: ctx access denied (PBT operates on the pure
|
|
24
|
-
* // reducer; ctx field 'someField' was read)"
|
|
25
|
-
*/
|
|
26
|
-
declare function stubCtxThrowingProxy<Ctx>(): Ctx;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Strict per-variant Msg arbitrary table. Mapped type: every key in
|
|
30
|
-
* `M["type"]` MUST have an arbitrary entry whose `T` is the narrowed
|
|
31
|
-
* variant. Adding a new Msg variant without an entry is a compile error
|
|
32
|
-
* (same load-bearing discipline as `Reducer<S, M, C>` in the substrate).
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* type Msg = { type: "start" } | { type: "tick"; now: number };
|
|
36
|
-
* const table: MsgArbitraryTable<Msg> = {
|
|
37
|
-
* start: arbConstantMsg("start"),
|
|
38
|
-
* tick: arbRecordMsg("tick", { now: fc.integer({ min: 0 }) }),
|
|
39
|
-
* };
|
|
40
|
-
*/
|
|
41
|
-
type MsgArbitraryTable<M extends {
|
|
42
|
-
type: string;
|
|
43
|
-
}> = {
|
|
44
|
-
[K in M["type"]]: fc.Arbitrary<Extract<M, {
|
|
45
|
-
type: K;
|
|
46
|
-
}>>;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Build a single `fc.Arbitrary<M>` from a `MsgArbitraryTable<M>`. Picks one
|
|
50
|
-
* variant per generation via `fc.oneof`; optional per-variant `weights`
|
|
51
|
-
* bias the distribution (default uniform).
|
|
52
|
-
*
|
|
53
|
-
* @param table Per-variant arbitrary table (strict — every variant required).
|
|
54
|
-
* @param opts Optional bias: `weights` is a `Partial<Record<M["type"], number>>`.
|
|
55
|
-
* Variants without an explicit weight default to 1.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* const msgArb = arbMsg<Msg>({
|
|
59
|
-
* start: arbConstantMsg("start"),
|
|
60
|
-
* tick: arbRecordMsg("tick", { now: fc.integer() }),
|
|
61
|
-
* stop: arbConstantMsg("stop"),
|
|
62
|
-
* }, { weights: { tick: 5, start: 1, stop: 1 } });
|
|
63
|
-
*/
|
|
64
|
-
declare function arbMsg<M extends {
|
|
65
|
-
type: string;
|
|
66
|
-
}>(table: MsgArbitraryTable<M>, opts?: {
|
|
67
|
-
weights?: Partial<Record<M["type"], number>>;
|
|
68
|
-
}): fc.Arbitrary<M>;
|
|
69
|
-
/**
|
|
70
|
-
* Build a payload-free Msg variant arbitrary. Sugar for
|
|
71
|
-
* `fc.constant({ type })` that narrows the result to `{ type: T }` literal.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* arbConstantMsg("stop") // fc.Arbitrary<{ type: "stop" }>
|
|
75
|
-
*/
|
|
76
|
-
declare function arbConstantMsg<T extends string>(type: T): fc.Arbitrary<{
|
|
77
|
-
type: T;
|
|
78
|
-
}>;
|
|
79
|
-
/**
|
|
80
|
-
* Build a record-shaped Msg variant arbitrary. Sugar for
|
|
81
|
-
* `fc.record({ type: fc.constant(type), ...fields })` that stamps the
|
|
82
|
-
* discriminator literal and combines with the per-field arbitraries.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* arbRecordMsg("tick", { now: fc.integer({ min: 0 }) })
|
|
86
|
-
* // fc.Arbitrary<{ type: "tick"; now: number }>
|
|
87
|
-
*/
|
|
88
|
-
declare function arbRecordMsg<T extends string, R>(type: T, fields: {
|
|
89
|
-
[K in keyof R]: fc.Arbitrary<R[K]>;
|
|
90
|
-
}): fc.Arbitrary<{
|
|
91
|
-
type: T;
|
|
92
|
-
} & R>;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Build an arbitrary of Msg sequences over a per-Msg arbitrary. Optionally
|
|
96
|
-
* bounded in length and / or prefixed with a fixed sequence.
|
|
97
|
-
*
|
|
98
|
-
* - `minLength` (default 0) and `maxLength` (default 30) bound the random
|
|
99
|
-
* array length. `prefix` is prepended AFTER the random tail is built; the
|
|
100
|
-
* final length is `prefix.length + tail.length`.
|
|
101
|
-
* - `prefix` is the load-bearing escape hatch for "the first msg is the
|
|
102
|
-
* one that exercises the cell I care about" (e.g. Test A's
|
|
103
|
-
* `[{ type: "ws:client:hello" }]` prefix to land in the
|
|
104
|
-
* `auditing.ws:client:hello` cell on the first transition).
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* arbMsgSequence(msgArb, { minLength: 1, maxLength: 30 });
|
|
108
|
-
* arbMsgSequence(msgArb, { prefix: [{ type: "ws:client:hello" }], maxLength: 20 });
|
|
109
|
-
*/
|
|
110
|
-
declare function arbMsgSequence<M extends {
|
|
111
|
-
type: string;
|
|
112
|
-
}>(msgArb: fc.Arbitrary<M>, opts?: {
|
|
113
|
-
readonly minLength?: number;
|
|
114
|
-
readonly maxLength?: number;
|
|
115
|
-
readonly prefix?: readonly NoInfer<M>[];
|
|
116
|
-
}): fc.Arbitrary<readonly M[]>;
|
|
117
|
-
/**
|
|
118
|
-
* State-aware Msg sequence arbitrary — generates only msgs whose
|
|
119
|
-
* precondition holds in the current state. Backed by `fc.commands`
|
|
120
|
-
* internally. Planned for a later phase.
|
|
121
|
-
*
|
|
122
|
-
* **NOT IMPLEMENTED IN v1.** The export exists today so the surface is
|
|
123
|
-
* forward-compatible; this ships in a later phase alongside
|
|
124
|
-
* shrinkers. Calling it throws.
|
|
125
|
-
*/
|
|
126
|
-
declare function arbGuidedSequence<S, M extends {
|
|
127
|
-
type: string;
|
|
128
|
-
}, C extends Cmd, U extends Sub, Ctx>(_machine: Machine<S, M, C, U, Ctx>, _ctx: Ctx, _cells: {
|
|
129
|
-
[K in M["type"]]?: (state: S) => fc.Arbitrary<Extract<M, {
|
|
130
|
-
type: K;
|
|
131
|
-
}>> | null;
|
|
132
|
-
}, _opts?: {
|
|
133
|
-
maxLength?: number;
|
|
134
|
-
}): fc.Arbitrary<readonly M[]>;
|
|
135
|
-
|
|
136
|
-
export { type MsgArbitraryTable, arbConstantMsg, arbGuidedSequence, arbMsg, arbMsgSequence, arbRecordMsg, stubCtxThrowingProxy };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import * as fc from 'fast-check';
|
|
2
|
-
import { C as Cmd, S as Sub, M as Machine } from '../../core-Co0LWkIA.js';
|
|
3
|
-
import 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* One unit in a fold trace — the four pieces of data a property
|
|
7
|
-
* invariant typically asserts on. `prev` is the state before the msg
|
|
8
|
-
* applied; `next` is the state after; `cmds` is the cmds emitted by this
|
|
9
|
-
* single step (NOT the running total).
|
|
10
|
-
*/
|
|
11
|
-
interface Step<S, M, C> {
|
|
12
|
-
readonly prev: S;
|
|
13
|
-
readonly msg: M;
|
|
14
|
-
readonly next: S;
|
|
15
|
-
readonly cmds: readonly C[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Fold a Msg sequence through a machine's pure reducer, returning the
|
|
19
|
-
* per-step trace, every state in order, and the final state. Initial
|
|
20
|
-
* state comes from `replay(machine, { msgs: [], ctx, loaded })` — i.e.
|
|
21
|
-
* `machine.init(loaded ?? null, ctx)` faithfully. Init's emitted cmds
|
|
22
|
-
* are NOT included in any `Step` (they're the boot moment, not a Msg).
|
|
23
|
-
*
|
|
24
|
-
* @param machine The machine under test.
|
|
25
|
-
* @param ctx The Ctx — typically `stubCtxThrowingProxy<Ctx>()` when
|
|
26
|
-
* init is pure. Pass a real ctx if init reads from it.
|
|
27
|
-
* @param loaded Optional pre-init snapshot (the `loaded` arg to
|
|
28
|
-
* `machine.init`). Defaults to `null` (fresh boot).
|
|
29
|
-
* @param msgs The Msg sequence to fold.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* const { states, steps, finalState } = foldEvents(machine, ctx, null, [
|
|
33
|
-
* { type: "start" }, { type: "tick" }, { type: "stop" },
|
|
34
|
-
* ]);
|
|
35
|
-
* // steps[1] = { prev: { type: "counting", n: 0 }, msg: { type: "tick" }, ... }
|
|
36
|
-
*/
|
|
37
|
-
declare function foldEvents<S, M extends {
|
|
38
|
-
type: string;
|
|
39
|
-
}, 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>[]): {
|
|
40
|
-
readonly states: readonly S[];
|
|
41
|
-
readonly steps: readonly Step<S, M, C>[];
|
|
42
|
-
readonly finalState: S;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/** Common options shared by every property runner. */
|
|
46
|
-
interface PropertyOpts<S> {
|
|
47
|
-
/** Pre-init snapshot — passed to `machine.init(loaded, ctx)`. Default `null`. */
|
|
48
|
-
readonly loaded?: S | null;
|
|
49
|
-
/** Number of generated sequences to test. Forwarded to `fc.assert`. */
|
|
50
|
-
readonly numRuns?: number;
|
|
51
|
-
/** Optional fast-check seed for reproducibility. */
|
|
52
|
-
readonly seed?: number;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Assert every generated Msg sequence ends in a terminal state. `terminal`
|
|
56
|
-
* is the predicate that names the acceptable final states (often
|
|
57
|
-
* `(s) => s.type === "done" || s.type === "idle"`).
|
|
58
|
-
*
|
|
59
|
-
* The "every sequence" property catches stuck states (machine gets to a
|
|
60
|
-
* non-terminal state and no further msg can escape) AND silent loops
|
|
61
|
-
* (every msg variant is a noop from a given state).
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* propertyTerminates(
|
|
65
|
-
* auditBackgroundMachine,
|
|
66
|
-
* stubCtxThrowingProxy<BackgroundCtx>(),
|
|
67
|
-
* arbMsgSequence(msgArb, { minLength: 1, maxLength: 30 }),
|
|
68
|
-
* (s) => s.type === "done" || s.type === "idle",
|
|
69
|
-
* { loaded: auditingState, numRuns: 500 },
|
|
70
|
-
* );
|
|
71
|
-
*/
|
|
72
|
-
declare function propertyTerminates<S, M extends {
|
|
73
|
-
type: string;
|
|
74
|
-
}, 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;
|
|
75
|
-
/**
|
|
76
|
-
* Assert a predicate holds on EVERY transition step in a generated
|
|
77
|
-
* sequence. The predicate sees `{ prev, msg, next, cmds }` per step;
|
|
78
|
-
* return true to accept, false (or throw) to fail.
|
|
79
|
-
*
|
|
80
|
-
* Use to pin a "when X happens in state Y, cmd Z must be emitted" rule.
|
|
81
|
-
* The shrinker minimizes the offending sequence to the smallest Msg list
|
|
82
|
-
* that still violates the predicate.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* // Pin the resume-handshake fix: `ws:client:hello` in auditing must
|
|
86
|
-
* // emit `send_ws { client:ready }`.
|
|
87
|
-
* propertyInvariant(
|
|
88
|
-
* auditBackgroundMachine, ctx,
|
|
89
|
-
* arbMsgSequence(msgArb, { prefix: [{ type: "ws:client:hello" }] }),
|
|
90
|
-
* ({ prev, msg, cmds }) =>
|
|
91
|
-
* !(prev.type === "auditing" && msg.type === "ws:client:hello") ||
|
|
92
|
-
* cmds.some((c) => c.type === "send_ws" && c.msg.type === "client:ready"),
|
|
93
|
-
* { loaded: auditingState, numRuns: 200 },
|
|
94
|
-
* );
|
|
95
|
-
*/
|
|
96
|
-
declare function propertyInvariant<S, M extends {
|
|
97
|
-
type: string;
|
|
98
|
-
}, 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;
|
|
99
|
-
/**
|
|
100
|
-
* Assert a predicate over the full trace plus the final state. Use when
|
|
101
|
-
* the property is "some Msg appeared in the trace before reaching the
|
|
102
|
-
* final state" or "no two consecutive steps had the same state.type" —
|
|
103
|
-
* predicates that need the full sequence, not a single step.
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* propertyTrace(
|
|
107
|
-
* machine, ctx, seqArb,
|
|
108
|
-
* (steps, final) =>
|
|
109
|
-
* final.type !== "done" ||
|
|
110
|
-
* steps.some((step) => step.msg.type === "ws:audit:done"),
|
|
111
|
-
* { loaded: auditingState, numRuns: 500 },
|
|
112
|
-
* );
|
|
113
|
-
*/
|
|
114
|
-
declare function propertyTrace<S, M extends {
|
|
115
|
-
type: string;
|
|
116
|
-
}, 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;
|
|
117
|
-
|
|
118
|
-
export { type Step, foldEvents, propertyInvariant, propertyTerminates, propertyTrace };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|