@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
package/dist/chunk-3I52QZZ5.js
DELETED
|
@@ -1,519 +0,0 @@
|
|
|
1
|
-
import { createMonitoredRun } from './chunk-DMYGQB4O.js';
|
|
2
|
-
import { createLlmCall } from './chunk-COS5MSTO.js';
|
|
3
|
-
import { createResilientCall } from './chunk-4KLG43GY.js';
|
|
4
|
-
import { MsgType } from './chunk-JELSZN25.js';
|
|
5
|
-
import { createFanOut, initFanOut } from './chunk-D736QUGF.js';
|
|
6
|
-
import { subscribeDeadline } from './chunk-DGE4PV4A.js';
|
|
7
|
-
import { defineMachine } from './chunk-ZSUUOEPL.js';
|
|
8
|
-
|
|
9
|
-
// src/agent/schema.ts
|
|
10
|
-
function schemaFromGuard(guard, name) {
|
|
11
|
-
return {
|
|
12
|
-
parse: (value) => {
|
|
13
|
-
if (!guard(value)) {
|
|
14
|
-
throw new Error(`structured-output parse failed: not ${name}`);
|
|
15
|
-
}
|
|
16
|
-
return value;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// src/agent/compaction.ts
|
|
22
|
-
var COMPACTION_PURPOSE = "$compact";
|
|
23
|
-
function isCompactionSummary(value) {
|
|
24
|
-
if (value === null || typeof value !== "object") return false;
|
|
25
|
-
return typeof value.summary === "string";
|
|
26
|
-
}
|
|
27
|
-
var compactionSummarySchema = schemaFromGuard(isCompactionSummary, "a CompactionSummary");
|
|
28
|
-
|
|
29
|
-
// src/agent/internal.ts
|
|
30
|
-
function freshConversation() {
|
|
31
|
-
return {
|
|
32
|
-
turns: [],
|
|
33
|
-
toolRecords: [],
|
|
34
|
-
turnCount: 0,
|
|
35
|
-
awaiting: { kind: "llm" }
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function dedupeByCallId(calls) {
|
|
39
|
-
const seen = /* @__PURE__ */ new Set();
|
|
40
|
-
const out = [];
|
|
41
|
-
for (const call of calls) {
|
|
42
|
-
if (seen.has(call.callId)) continue;
|
|
43
|
-
seen.add(call.callId);
|
|
44
|
-
out.push(call);
|
|
45
|
-
}
|
|
46
|
-
return out;
|
|
47
|
-
}
|
|
48
|
-
function foldSummary(conv, folding, summaryTurn) {
|
|
49
|
-
const shift = folding - 1;
|
|
50
|
-
const survivingTurns = conv.turns.slice(folding);
|
|
51
|
-
const survivingRecords = conv.toolRecords.filter((rec) => rec.turn >= folding).map((rec) => ({ ...rec, turn: rec.turn - shift }));
|
|
52
|
-
return {
|
|
53
|
-
...conv,
|
|
54
|
-
turns: [summaryTurn, ...survivingTurns],
|
|
55
|
-
toolRecords: survivingRecords,
|
|
56
|
-
awaiting: { kind: "llm" }
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function currentStage(s) {
|
|
60
|
-
return s.run.stepStates.find((i) => i.status === "running")?.input;
|
|
61
|
-
}
|
|
62
|
-
function isSettled(s) {
|
|
63
|
-
return s.run.phase === "done" || s.run.phase === "failed" || s.failure !== null;
|
|
64
|
-
}
|
|
65
|
-
function requireAwaiting(s, kind) {
|
|
66
|
-
if (isSettled(s)) return null;
|
|
67
|
-
const conv = s.conversation;
|
|
68
|
-
if (conv === null || conv.awaiting.kind !== kind) return null;
|
|
69
|
-
return conv;
|
|
70
|
-
}
|
|
71
|
-
function toCompactRunCmd(cmd) {
|
|
72
|
-
return {
|
|
73
|
-
type: MsgType.CompactRun,
|
|
74
|
-
key: COMPACTION_PURPOSE,
|
|
75
|
-
input: cmd.input
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// src/agent/machine.ts
|
|
80
|
-
function agentBootMsg(at) {
|
|
81
|
-
return { type: MsgType.AgentBoot, at };
|
|
82
|
-
}
|
|
83
|
-
function agentEvents() {
|
|
84
|
-
return (msg, state) => {
|
|
85
|
-
const events = [];
|
|
86
|
-
switch (msg.type) {
|
|
87
|
-
case MsgType.ResilientOk:
|
|
88
|
-
events.push({ type: "TurnSettled", turn: msg.result.output });
|
|
89
|
-
break;
|
|
90
|
-
case MsgType.AgentToolOk:
|
|
91
|
-
events.push({
|
|
92
|
-
type: "ToolSettled",
|
|
93
|
-
callId: msg.callId,
|
|
94
|
-
result: msg.result
|
|
95
|
-
});
|
|
96
|
-
break;
|
|
97
|
-
// start / boot / timer / the *_err arms / the compaction settles carry no
|
|
98
|
-
// public event — return []. (No `default`: the switch is exhaustive over
|
|
99
|
-
// the Msg discriminant, so a new Msg variant forces a decision here at
|
|
100
|
-
// compile time.) Compaction is an internal optimization, not a semantic
|
|
101
|
-
// lifecycle moment a UI folds — its settles are deliberately silent here.
|
|
102
|
-
case MsgType.AgentStart:
|
|
103
|
-
case MsgType.AgentToolErr:
|
|
104
|
-
case MsgType.ResilientErr:
|
|
105
|
-
case MsgType.CompactOk:
|
|
106
|
-
case MsgType.CompactErr:
|
|
107
|
-
case "deadline_exceeded":
|
|
108
|
-
case MsgType.AgentBoot:
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
if (state.run.phase === "done") {
|
|
112
|
-
events.push({ type: "RunDone", output: state.output });
|
|
113
|
-
}
|
|
114
|
-
return events;
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function mergeInterpret(a, b) {
|
|
118
|
-
return { ...a ?? {}, ...b };
|
|
119
|
-
}
|
|
120
|
-
function liftAgent(state, [slice, cmds]) {
|
|
121
|
-
return [{ ...state, agent: slice }, cmds];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// src/agent/types.ts
|
|
125
|
-
function isToolCall(value) {
|
|
126
|
-
if (value === null || typeof value !== "object") return false;
|
|
127
|
-
const t = value;
|
|
128
|
-
return typeof t.callId === "string" && typeof t.name === "string" && t.args !== null && typeof t.args === "object";
|
|
129
|
-
}
|
|
130
|
-
function isAgentTurn(value) {
|
|
131
|
-
if (value === null || typeof value !== "object") return false;
|
|
132
|
-
const t = value;
|
|
133
|
-
return typeof t.content === "string" && Array.isArray(t.toolCalls) && t.toolCalls.every(isToolCall);
|
|
134
|
-
}
|
|
135
|
-
var agentTurnSchema = schemaFromGuard(
|
|
136
|
-
isAgentTurn,
|
|
137
|
-
"an AgentTurn"
|
|
138
|
-
);
|
|
139
|
-
function status(s) {
|
|
140
|
-
if (s.failure !== null) {
|
|
141
|
-
return { kind: "failed", failure: s.failure };
|
|
142
|
-
}
|
|
143
|
-
if (s.run.phase === "failed") {
|
|
144
|
-
return { kind: "failed", failure: s.run.failure };
|
|
145
|
-
}
|
|
146
|
-
if (s.run.phase === "done") {
|
|
147
|
-
return { kind: "done", output: s.output };
|
|
148
|
-
}
|
|
149
|
-
if (s.conversation !== null && s.conversation.awaiting.kind === "tools") {
|
|
150
|
-
return { kind: "suspended", pending: s.tools.running };
|
|
151
|
-
}
|
|
152
|
-
return { kind: "running" };
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// src/agent/index.ts
|
|
156
|
-
function createAgent(config) {
|
|
157
|
-
const rng = config.rng ?? Math.random;
|
|
158
|
-
const run = createMonitoredRun({
|
|
159
|
-
...config.stages !== void 0 ? { stages: config.stages } : {},
|
|
160
|
-
...config.deadlineMs !== void 0 ? { deadlineMs: config.deadlineMs } : {},
|
|
161
|
-
...config.snapshotEvery !== void 0 ? { snapshotEvery: config.snapshotEvery } : {}
|
|
162
|
-
});
|
|
163
|
-
const llm = createLlmCall(
|
|
164
|
-
{
|
|
165
|
-
model: config.model,
|
|
166
|
-
schemas: config.schemas,
|
|
167
|
-
...config.retry !== void 0 ? { retry: config.retry } : {},
|
|
168
|
-
...config.loadMessages !== void 0 ? { loadMessages: config.loadMessages } : {}
|
|
169
|
-
},
|
|
170
|
-
rng
|
|
171
|
-
);
|
|
172
|
-
const compactRc = createResilientCall({ ...config.retry !== void 0 ? { retry: config.retry } : {} }, rng);
|
|
173
|
-
const fan = createFanOut({
|
|
174
|
-
concurrency: config.toolConcurrency ?? 1,
|
|
175
|
-
idOf: (call) => call.callId,
|
|
176
|
-
of: (call) => config.toolOf(call)
|
|
177
|
-
});
|
|
178
|
-
function init() {
|
|
179
|
-
return {
|
|
180
|
-
run: run.init(),
|
|
181
|
-
resilience: llm.init(),
|
|
182
|
-
tools: initFanOut(),
|
|
183
|
-
conversation: null,
|
|
184
|
-
compaction: compactRc.init(),
|
|
185
|
-
failure: null,
|
|
186
|
-
output: null
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
function brainCall(s) {
|
|
190
|
-
const stage = currentStage(s);
|
|
191
|
-
const conversation = s.conversation ?? freshConversation();
|
|
192
|
-
return {
|
|
193
|
-
purpose: config.turnOf(stage),
|
|
194
|
-
model: config.modelId ?? null,
|
|
195
|
-
payload: config.payloadOf ? config.payloadOf(stage, conversation) : null
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
function fireBrainCall(s, at) {
|
|
199
|
-
const call = brainCall(s);
|
|
200
|
-
const [resilience, cmds] = llm.attempt(s.resilience, call, at);
|
|
201
|
-
return [{ ...s, resilience }, cmds];
|
|
202
|
-
}
|
|
203
|
-
function compactionCall(conv, folding) {
|
|
204
|
-
const payloadOf = config.compaction?.payloadOf;
|
|
205
|
-
return {
|
|
206
|
-
purpose: COMPACTION_PURPOSE,
|
|
207
|
-
model: config.modelId ?? null,
|
|
208
|
-
payload: payloadOf ? payloadOf(conv, folding) : null
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
function reKeyCompactCmds(result) {
|
|
212
|
-
const [slice, cmds] = result;
|
|
213
|
-
return [slice, cmds.map(toCompactRunCmd)];
|
|
214
|
-
}
|
|
215
|
-
const compact = {
|
|
216
|
-
attempt: (slice, key, input, at) => reKeyCompactCmds(compactRc.attempt(slice, key, input, at)),
|
|
217
|
-
succeed: (slice, key, msg) => reKeyCompactCmds(compactRc.succeed(slice, key, msg)),
|
|
218
|
-
fail: (slice, key, msg) => reKeyCompactCmds(compactRc.fail(slice, key, msg)),
|
|
219
|
-
onTimer: (slice, msg) => reKeyCompactCmds(compactRc.onTimer(slice, msg))
|
|
220
|
-
};
|
|
221
|
-
function start(s, runId, at) {
|
|
222
|
-
const [runSlice] = run.start(s.run, runId, at);
|
|
223
|
-
const conversation = freshConversation();
|
|
224
|
-
const withRun = {
|
|
225
|
-
...s,
|
|
226
|
-
run: runSlice,
|
|
227
|
-
conversation,
|
|
228
|
-
failure: null,
|
|
229
|
-
// A restart clears the prior run's terminal output — `result()` reads
|
|
230
|
-
// `undefined` again until THIS run finishes (#46).
|
|
231
|
-
output: null,
|
|
232
|
-
tools: initFanOut(),
|
|
233
|
-
// A restart also clears any prior compaction slice — a fresh run never
|
|
234
|
-
// inherits the previous run's summarize retry bookkeeping (#85).
|
|
235
|
-
compaction: compactRc.init()
|
|
236
|
-
};
|
|
237
|
-
return fireBrainCall(withRun, at);
|
|
238
|
-
}
|
|
239
|
-
function turn(s, result, at) {
|
|
240
|
-
const conv = requireAwaiting(s, "llm");
|
|
241
|
-
if (conv === null) return [s, []];
|
|
242
|
-
const withTurn = {
|
|
243
|
-
...conv,
|
|
244
|
-
turns: [...conv.turns, result]
|
|
245
|
-
};
|
|
246
|
-
if (result.toolCalls.length === 0) {
|
|
247
|
-
return advanceStage({ ...s, conversation: withTurn }, result, at);
|
|
248
|
-
}
|
|
249
|
-
const batch = dedupeByCallId(result.toolCalls);
|
|
250
|
-
const [tools, launchCmds] = fan.scatter(
|
|
251
|
-
initFanOut(),
|
|
252
|
-
batch
|
|
253
|
-
);
|
|
254
|
-
const nextConv = {
|
|
255
|
-
...withTurn,
|
|
256
|
-
awaiting: { kind: "tools", batchTurn: withTurn.turnCount }
|
|
257
|
-
};
|
|
258
|
-
const [runSlice] = run.progress(s.run, void 0, at);
|
|
259
|
-
return [{ ...s, run: runSlice, tools, conversation: nextConv }, launchCmds];
|
|
260
|
-
}
|
|
261
|
-
function advanceStage(s, terminatingTurn, at) {
|
|
262
|
-
const [runSlice, runCmds] = run.advance(
|
|
263
|
-
s.run,
|
|
264
|
-
void 0,
|
|
265
|
-
{ kind: "ok" },
|
|
266
|
-
at
|
|
267
|
-
);
|
|
268
|
-
if (runSlice.phase === "done") {
|
|
269
|
-
return [
|
|
270
|
-
{ ...s, run: runSlice, conversation: null, output: terminatingTurn },
|
|
271
|
-
runCmds
|
|
272
|
-
];
|
|
273
|
-
}
|
|
274
|
-
const conversation = freshConversation();
|
|
275
|
-
const moved = {
|
|
276
|
-
...s,
|
|
277
|
-
run: runSlice,
|
|
278
|
-
conversation,
|
|
279
|
-
tools: initFanOut()
|
|
280
|
-
};
|
|
281
|
-
const [fired, llmCmds] = fireBrainCall(moved, at);
|
|
282
|
-
return [fired, [...runCmds, ...llmCmds]];
|
|
283
|
-
}
|
|
284
|
-
function toolOk(s, callId, result, at) {
|
|
285
|
-
return settleTool(s, callId, { kind: "ok", result }, at);
|
|
286
|
-
}
|
|
287
|
-
function toolErr(s, callId, reason, at) {
|
|
288
|
-
return settleTool(s, callId, { kind: "error", reason }, at);
|
|
289
|
-
}
|
|
290
|
-
function settleTool(s, callId, outcome, at) {
|
|
291
|
-
const conv = requireAwaiting(s, "tools");
|
|
292
|
-
if (conv === null) return [s, []];
|
|
293
|
-
const call = s.tools.running.find((c) => c.callId === callId);
|
|
294
|
-
if (call === void 0) return [s, []];
|
|
295
|
-
const [tools, launchCmds] = outcome.kind === "ok" ? fan.itemOk(s.tools, callId, outcome) : fan.itemErr(s.tools, callId, outcome);
|
|
296
|
-
const foldedConv = {
|
|
297
|
-
...conv,
|
|
298
|
-
// Stamp the producing-turn index on the record (#85, A1). At settle time
|
|
299
|
-
// `conv.turnCount` equals the index in `turns` of the turn that scattered
|
|
300
|
-
// this batch (each prior drained batch bumped `turnCount` exactly once, and
|
|
301
|
-
// each tool-bearing turn appended exactly one entry to `turns`), so a record
|
|
302
|
-
// carrying `turn: conv.turnCount` is dropped iff its producing turn is folded
|
|
303
|
-
// (`turn < N`) — the association the fold-back relies on.
|
|
304
|
-
toolRecords: [
|
|
305
|
-
...conv.toolRecords,
|
|
306
|
-
{ call, outcome, turn: conv.turnCount }
|
|
307
|
-
]
|
|
308
|
-
};
|
|
309
|
-
if (!fan.isComplete(tools)) {
|
|
310
|
-
const [runSlice2] = run.progress(s.run, void 0, at);
|
|
311
|
-
return [
|
|
312
|
-
{ ...s, run: runSlice2, tools, conversation: foldedConv },
|
|
313
|
-
launchCmds
|
|
314
|
-
];
|
|
315
|
-
}
|
|
316
|
-
const turnedConv = {
|
|
317
|
-
...foldedConv,
|
|
318
|
-
turnCount: foldedConv.turnCount + 1,
|
|
319
|
-
awaiting: { kind: "llm" }
|
|
320
|
-
};
|
|
321
|
-
if (config.maxTurns !== void 0 && turnedConv.turnCount >= config.maxTurns) {
|
|
322
|
-
return failTurnLimit({ ...s, tools, conversation: turnedConv }, at);
|
|
323
|
-
}
|
|
324
|
-
const drained = {
|
|
325
|
-
...s,
|
|
326
|
-
tools: initFanOut(),
|
|
327
|
-
conversation: turnedConv
|
|
328
|
-
};
|
|
329
|
-
const compacting = maybeCompact(drained, at);
|
|
330
|
-
if (compacting !== null) return compacting;
|
|
331
|
-
const [runSlice] = run.progress(drained.run, void 0, at);
|
|
332
|
-
const [fired, llmCmds] = fireBrainCall({ ...drained, run: runSlice }, at);
|
|
333
|
-
return [fired, [...launchCmds, ...llmCmds]];
|
|
334
|
-
}
|
|
335
|
-
function maybeCompact(s, at) {
|
|
336
|
-
const policy = config.compaction;
|
|
337
|
-
const conv = s.conversation;
|
|
338
|
-
if (policy === void 0 || conv === null) return null;
|
|
339
|
-
const requested = policy.planCompaction(conv);
|
|
340
|
-
const folding = Math.min(requested, conv.turns.length);
|
|
341
|
-
if (folding < 2) return null;
|
|
342
|
-
const compactConv = {
|
|
343
|
-
...conv,
|
|
344
|
-
awaiting: { kind: "compacting", folding }
|
|
345
|
-
};
|
|
346
|
-
const [runSlice] = run.progress(s.run, void 0, at);
|
|
347
|
-
const input = compactionCall(conv, folding);
|
|
348
|
-
const [compaction, cmds] = compact.attempt(
|
|
349
|
-
s.compaction,
|
|
350
|
-
COMPACTION_PURPOSE,
|
|
351
|
-
input,
|
|
352
|
-
at
|
|
353
|
-
);
|
|
354
|
-
return [
|
|
355
|
-
{ ...s, run: runSlice, conversation: compactConv, compaction },
|
|
356
|
-
cmds
|
|
357
|
-
];
|
|
358
|
-
}
|
|
359
|
-
function failTurnLimit(s, at) {
|
|
360
|
-
return [{ ...s, failure: { reason: "turn_limit", at } }, []];
|
|
361
|
-
}
|
|
362
|
-
function succeed(s, key, msg, at) {
|
|
363
|
-
const [resilience, retryCmds] = llm.succeed(s.resilience, key, msg);
|
|
364
|
-
const settled = { ...s, resilience };
|
|
365
|
-
const [withTurn, turnCmds] = turn(settled, msg.result.output, at);
|
|
366
|
-
return [withTurn, [...retryCmds, ...turnCmds]];
|
|
367
|
-
}
|
|
368
|
-
function fail(s, key, msg, at) {
|
|
369
|
-
const [resilience, cmds] = llm.fail(s.resilience, key, msg);
|
|
370
|
-
const call = resilience.calls[key];
|
|
371
|
-
const failure = call?.phase === "failed" ? { reason: "llm", error: msg.error, at } : s.failure;
|
|
372
|
-
return [{ ...s, resilience, failure }, cmds];
|
|
373
|
-
}
|
|
374
|
-
function compactOk(s, key, msg, at) {
|
|
375
|
-
const [compaction, retryCmds] = compact.succeed(s.compaction, key, {
|
|
376
|
-
type: MsgType.ResilientOk,
|
|
377
|
-
key: msg.key,
|
|
378
|
-
result: msg.result,
|
|
379
|
-
at: msg.at
|
|
380
|
-
});
|
|
381
|
-
const settledRetry = { ...s, compaction };
|
|
382
|
-
const conv = requireAwaiting(settledRetry, "compacting");
|
|
383
|
-
if (conv === null) return [settledRetry, retryCmds];
|
|
384
|
-
const folding = conv.awaiting.folding;
|
|
385
|
-
const summaryTurn = {
|
|
386
|
-
content: msg.result.output.summary,
|
|
387
|
-
toolCalls: []
|
|
388
|
-
};
|
|
389
|
-
const foldedConv = foldSummary(conv, folding, summaryTurn);
|
|
390
|
-
const [fired, llmCmds] = fireBrainCall(
|
|
391
|
-
{ ...settledRetry, conversation: foldedConv },
|
|
392
|
-
at
|
|
393
|
-
);
|
|
394
|
-
return [fired, [...retryCmds, ...llmCmds]];
|
|
395
|
-
}
|
|
396
|
-
function compactErr(s, key, msg, at) {
|
|
397
|
-
const [compaction, cmds] = compact.fail(s.compaction, key, {
|
|
398
|
-
type: MsgType.ResilientErr,
|
|
399
|
-
key: msg.key,
|
|
400
|
-
error: msg.error,
|
|
401
|
-
at: msg.at
|
|
402
|
-
});
|
|
403
|
-
const settledRetry = { ...s, compaction };
|
|
404
|
-
const call = compaction.calls[key];
|
|
405
|
-
if (call?.phase === "waiting_retry") {
|
|
406
|
-
return [settledRetry, cmds];
|
|
407
|
-
}
|
|
408
|
-
const conv = requireAwaiting(settledRetry, "compacting");
|
|
409
|
-
if (conv === null) return [settledRetry, cmds];
|
|
410
|
-
const resumedConv = { ...conv, awaiting: { kind: "llm" } };
|
|
411
|
-
const [fired, llmCmds] = fireBrainCall(
|
|
412
|
-
{ ...settledRetry, conversation: resumedConv },
|
|
413
|
-
at
|
|
414
|
-
);
|
|
415
|
-
return [fired, [...cmds, ...llmCmds]];
|
|
416
|
-
}
|
|
417
|
-
function onTimer(s, msg) {
|
|
418
|
-
if (msg.id.startsWith("monitored:")) {
|
|
419
|
-
const [runSlice] = run.onDeadline(s.run, msg);
|
|
420
|
-
return [{ ...s, run: runSlice }, []];
|
|
421
|
-
}
|
|
422
|
-
if (msg.id.endsWith(`:${COMPACTION_PURPOSE}`)) {
|
|
423
|
-
const [compaction, cmds2] = compact.onTimer(s.compaction, msg);
|
|
424
|
-
return [{ ...s, compaction }, cmds2];
|
|
425
|
-
}
|
|
426
|
-
const [resilience, cmds] = llm.onTimer(s.resilience, msg);
|
|
427
|
-
return [{ ...s, resilience }, cmds];
|
|
428
|
-
}
|
|
429
|
-
function boot(s, at) {
|
|
430
|
-
const [runSlice] = run.boot(s.run, at);
|
|
431
|
-
const rebooted = { ...s, run: runSlice };
|
|
432
|
-
if (isSettled(rebooted)) return [rebooted, []];
|
|
433
|
-
const conv = rebooted.conversation;
|
|
434
|
-
if (conv === null) return [rebooted, []];
|
|
435
|
-
if (conv.awaiting.kind === "llm") {
|
|
436
|
-
return fireBrainCall(rebooted, at);
|
|
437
|
-
}
|
|
438
|
-
if (conv.awaiting.kind === "compacting") {
|
|
439
|
-
const input = compactionCall(conv, conv.awaiting.folding);
|
|
440
|
-
const [compaction, cmds2] = compact.attempt(
|
|
441
|
-
rebooted.compaction,
|
|
442
|
-
COMPACTION_PURPOSE,
|
|
443
|
-
input,
|
|
444
|
-
at
|
|
445
|
-
);
|
|
446
|
-
return [{ ...rebooted, compaction }, cmds2];
|
|
447
|
-
}
|
|
448
|
-
const cmds = rebooted.tools.running.map((call) => config.toolOf(call));
|
|
449
|
-
return [rebooted, cmds];
|
|
450
|
-
}
|
|
451
|
-
function subs(s) {
|
|
452
|
-
return [
|
|
453
|
-
...llm.subs(s.resilience),
|
|
454
|
-
...compactRc.subs(s.compaction),
|
|
455
|
-
...run.subs(s.run)
|
|
456
|
-
];
|
|
457
|
-
}
|
|
458
|
-
function unsafeDetachedHandlers(ports) {
|
|
459
|
-
return llm.handlers(ports);
|
|
460
|
-
}
|
|
461
|
-
function brainHandlers() {
|
|
462
|
-
return llm.handlers();
|
|
463
|
-
}
|
|
464
|
-
function toMachine(opts) {
|
|
465
|
-
const consumerInterpret = opts?.toolInterpret ?? {};
|
|
466
|
-
const interpret = mergeInterpret(consumerInterpret, brainHandlers());
|
|
467
|
-
const update = {
|
|
468
|
-
[MsgType.AgentStart]: (s, m) => start(s, m.runId, m.at),
|
|
469
|
-
[MsgType.AgentToolOk]: (s, m) => toolOk(s, m.callId, m.result, m.at),
|
|
470
|
-
[MsgType.AgentToolErr]: (s, m) => toolErr(s, m.callId, m.reason, m.at),
|
|
471
|
-
// The re-entered brain-call settle Msgs (from `brainHandlers`): success
|
|
472
|
-
// runs `succeed` (reset retry + fold the turn), failure runs `fail`.
|
|
473
|
-
[MsgType.ResilientOk]: (s, m) => succeed(s, m.key, m, m.at),
|
|
474
|
-
[MsgType.ResilientErr]: (s, m) => fail(s, m.key, m, m.at),
|
|
475
|
-
// The re-entered compaction settle Msgs (from the consumer's `compact_run`
|
|
476
|
-
// cell, #85): `compact_ok` folds the summary back (drop oldest turns +
|
|
477
|
-
// their records, fire the next brain call), `compact_err` backs off via the
|
|
478
|
-
// compaction retry or proceeds without compacting.
|
|
479
|
-
[MsgType.CompactOk]: (s, m) => compactOk(s, m.key, m, m.at),
|
|
480
|
-
[MsgType.CompactErr]: (s, m) => compactErr(s, m.key, m, m.at),
|
|
481
|
-
deadline_exceeded: (s, m) => onTimer(s, m),
|
|
482
|
-
[MsgType.AgentBoot]: (s, m) => boot(s, m.at)
|
|
483
|
-
};
|
|
484
|
-
const machine = {
|
|
485
|
-
init: (loaded) => loaded !== null ? [loaded, []] : [init(), []],
|
|
486
|
-
update,
|
|
487
|
-
subscriptions: (s) => subs(s),
|
|
488
|
-
subscribe: { deadline: subscribeDeadline },
|
|
489
|
-
interpret
|
|
490
|
-
};
|
|
491
|
-
return defineMachine(machine);
|
|
492
|
-
}
|
|
493
|
-
return {
|
|
494
|
-
init,
|
|
495
|
-
start,
|
|
496
|
-
turn,
|
|
497
|
-
toolOk,
|
|
498
|
-
toolErr,
|
|
499
|
-
succeed,
|
|
500
|
-
fail,
|
|
501
|
-
compactOk,
|
|
502
|
-
compactErr,
|
|
503
|
-
onTimer,
|
|
504
|
-
boot,
|
|
505
|
-
isSettled,
|
|
506
|
-
currentStage,
|
|
507
|
-
brainCall,
|
|
508
|
-
subs,
|
|
509
|
-
// `toMachine` is THE wired path. `unsafeDetachedHandlers` is the
|
|
510
|
-
// hand-wiring escape hatch — named to advertise the retry-loop gap so it is
|
|
511
|
-
// never mistaken for the loop driver (#54).
|
|
512
|
-
toMachine,
|
|
513
|
-
unsafeDetachedHandlers
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
export { COMPACTION_PURPOSE, agentBootMsg, agentEvents, agentTurnSchema, compactionSummarySchema, createAgent, isAgentTurn, isCompactionSummary, liftAgent, mergeInterpret, status };
|
|
518
|
-
//# sourceMappingURL=chunk-3I52QZZ5.js.map
|
|
519
|
-
//# sourceMappingURL=chunk-3I52QZZ5.js.map
|