@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,21 +1,605 @@
1
- import { C as Cmd } from '../core-Bjc0bS8j.js';
2
- export { LlmCall, LlmErr, LlmFailMsg, LlmOk, LlmRunCmd, LlmSucceedMsg, MessageLoader, ModelFactory, Schema } from '../llm-call/index.js';
3
- import { A as AgentTurn, a as AgentConfigCore, C as CompactionPolicy, b as AgentKnob } from '../machine-0OmPvsy_.js';
4
- export { c as AgentBootMsg, d as AgentCmd, e as AgentCompactErrMsg, f as AgentCompactOkMsg, g as AgentCompactRunCmd, h as AgentCompactionConfig, i as AgentConfig, j as AgentDetachedHandlers, k as AgentEvent, l as AgentFailure, m as AgentLlmErrMsg, n as AgentLlmOkMsg, o as AgentLlmRunCmd, p as AgentMachineMsg, q as AgentPorts, r as AgentSnapshotConfig, s as AgentState, t as AgentStatus, u as AgentTerminalFailure, v as AgentTimerMsg, w as AgentToMachine, x as Awaiting, y as COMPACTION_PURPOSE, z as CompactInterpret, B as CompactionOutputs, D as CompactionPurpose, E as CompactionSummary, F as Conversation, S as SnapshotInterpret, T as ToolCall, G as ToolOutcome, H as ToolRecord, I as agentBootMsg, J as agentEvents, K as agentTurnSchema, L as compactionSummarySchema, M as isAgentTurn, N as isCompactionSummary, O as liftAgent, P as mergeInterpret, Q as status } from '../machine-0OmPvsy_.js';
5
- export { MonitoredRunCmd, RunFailure } from '../monitored-run/index.js';
6
- export { DeadlineSub, deadlineSub, subscribeDeadline } from '../deadline/index.js';
7
- import '../resilient-call/index.js';
8
- import '../cache/index.js';
9
- import '../types-D7u9DkH7.js';
10
- import '../circuit-breaker/index.js';
11
- import '../protocol-B5YmJr0d.js';
12
- import '../rate-limit/index.js';
13
- import '../retry-backoff/index.js';
14
- import '../fan-out/index.js';
15
- import '../work-queue/index.js';
16
- import '../runtime-types-Bxc637bp.js';
1
+ import { R as RequiredCtx, M as Machine, I as Interpret, C as Cmd } from '../core-CTzMJ82M.js';
2
+ import { T as ToolCall, a as ToolOutcome, C as Conversation, A as AnyToolDef, P as PlainModel, b as AgentTurn, S as StreamingModel, c as AgentState, d as ToolResult, e as ToolFailureOf, f as ToolCmd, g as AgentEvent, h as TurnChunk, i as AgentMachineMsg, W as WiredToolMsg, j as AgentCmd, k as AgentConfigCore, l as CompactionPolicy, m as AgentKnob } from '../machine-CdIcN2Xm.js';
3
+ export { n as AgentBootMsg, o as AgentCancelMsg, p as AgentCompactErrMsg, q as AgentCompactOkMsg, r as AgentCompactRunCmd, s as AgentCompactionConfig, t as AgentConfig, u as AgentDetachedHandlers, v as AgentFailure, w as AgentLlmErrMsg, x as AgentLlmOkMsg, y as AgentLlmRunCmd, z as AgentPorts, B as AgentSnapshotConfig, D as AgentStatus, E as AgentTerminalFailure, F as AgentTimerMsg, G as AgentToMachine, H as Awaiting, I as COMPACTION_PURPOSE, J as CompactInterpret, K as CompactionOutputs, L as CompactionPurpose, M as CompactionSummary, N as LlmCall, O as LlmErr, Q as LlmFailMsg, R as LlmOk, U as LlmRunCmd, V as LlmSucceedMsg, X as MessageLoader, Y as ModelFactory, Z as ModelPort, _ as ModelStream, $ as PLAIN_MODEL_MISROUTE_REASON, a0 as ReservedToolName, a1 as Schema, a2 as SnapshotInterpret, a3 as TOOL_RETRY_EXHAUSTED_TAG, a4 as TOOL_TIMEOUT_TAG, a5 as TaggedFailure, a6 as ToolConstructors, a7 as ToolDef, a8 as ToolError, a9 as ToolFail, aa as ToolFailure, ab as ToolHandler, ac as ToolInput, ad as ToolMsg, ae as ToolOk, af as ToolRecord, ag as ToolRejectedCmd, ah as ToolRejection, ai as ToolResilience, aj as ToolResilienceError, ak as ToolRetryExhausted, al as ToolRouter, am as ToolSettlement, an as ToolThrown, ao as ToolTimedOut, ap as WiredToolCmd, aq as agentBootMsg, ar as agentCancelMsg, as as agentEvents, at as agentTurnSchema, au as compactionSummarySchema, av as fanOutInterpret, aw as isAgentTurn, ax as isCompactionSummary, ay as isReservedToolName, az as isStreamingModel, aA as liftAgent, aB as mergeInterpret, aC as plainModel, aD as status, aE as tool, aF as toolErrorReason, aG as toolRouter } from '../machine-CdIcN2Xm.js';
4
+ import { a as ScopedCtxArg, S as Store } from '../runtime-types-LWDoi943.js';
5
+ import { E as EndedRun } from '../index-NjrT3fL2.js';
6
+ export { M as MonitoredRunCmd, R as RunFailure } from '../index-NjrT3fL2.js';
7
+ import { RetryPolicy } from '../retry-backoff/index.js';
8
+ import { a as DeadlineSub } from '../index-q0hXFeZ0.js';
9
+ export { b as deadlineSub, s as subscribeDeadline } from '../index-q0hXFeZ0.js';
10
+ import 'zod';
11
+ import '../index-B5BZ-_cT.js';
12
+ import '../index-6A7dB8f6.js';
13
+ import '../index-DJWIER_3.js';
17
14
  import 'better-result';
18
- import '../snapshot/index.js';
15
+ import '../index-DMCeMPMJ.js';
16
+ import '../types-DP3f5NIl.js';
17
+
18
+ /**
19
+ * @demlik/tea/agent — `defineAgent`, the convenience layer over `createAgent`.
20
+ *
21
+ * `defineAgent({ model, tools, instructions })` is the three-line door: it
22
+ * defaults the single-stage wiring (`stages`, `turnOf`, `schemas`), derives the
23
+ * tool handlers from `toolRouter`, renders the prompt off the Model, and absorbs
24
+ * the drive loop through `driveToDone`. It hides wiring, never state (ADR
25
+ * 0015): the Model it runs is the same `AgentState` a hand-wired `createAgent`
26
+ * produces, under the same keys, and `machine(input)` is the door down to the
27
+ * raw kernel `run`. Each hidden thing is a named helper below.
28
+ */
29
+
30
+ /**
31
+ * One message a `defineAgent` `model` receives. Plain data the adapter renders into
32
+ * its provider's shape: the head is the `instructions` (when set) and the
33
+ * run's `input`; then, per model turn, the `assistant` turn followed by the
34
+ * `tool` outcomes that turn asked for. A tool outcome rides as data — the
35
+ * adapter decides how a failure reads to its model. An `assistant` message
36
+ * carries the turn's opaque `provider` slot exactly as the adapter returned it
37
+ * (see `AgentTurn`), present only when the stored turn has one.
38
+ */
39
+ type AgentMessage = {
40
+ readonly role: "system";
41
+ readonly content: string;
42
+ } | {
43
+ readonly role: "user";
44
+ readonly content: string;
45
+ } | {
46
+ readonly role: "assistant";
47
+ readonly content: string;
48
+ readonly toolCalls: readonly ToolCall[];
49
+ readonly provider?: unknown;
50
+ } | {
51
+ readonly role: "tool";
52
+ readonly callId: string;
53
+ readonly name: string;
54
+ readonly outcome: ToolOutcome<unknown>;
55
+ };
56
+ /**
57
+ * The brain-call payload `defineAgent` builds from the durable state — everything
58
+ * `messagesOf` renders, so the prompt is a pure function of the Model and the
59
+ * resilient slice carries exactly what was sent.
60
+ */
61
+ interface AgentPrompt<R> {
62
+ readonly instructions: string | null;
63
+ readonly input: string | null;
64
+ readonly conversation: Conversation<R>;
65
+ }
66
+ /** The one purpose a `defineAgent` agent runs. */
67
+ type LidPurpose = "act";
68
+ type LidOutputs = {
69
+ readonly [K in LidPurpose]: AgentTurn;
70
+ };
71
+ /** The Model a defined agent runs — a hand-wired `createAgent`'s, key for key. */
72
+ type DefinedAgentState<T extends AnyToolDef> = AgentState<string, LidPurpose, LidOutputs, ToolResult<T>>;
73
+ /**
74
+ * The Model `run` RESOLVES with — {@link DefinedAgentState} whose `run` slice is
75
+ * narrowed to the ended phases ({@link EndedRun}).
76
+ *
77
+ * `run`'s terminal predicate is `done || cancelled` and its `failed` one rejects,
78
+ * so the never-started `idle` arm is unreachable on the resolved value. Typing
79
+ * the promise as the whole Model published that unreachable arm anyway, and
80
+ * `idle` carries no `runId` — so `(await agent.run(input)).run.runId`, a field
81
+ * every resolved run has, did not typecheck (#155). The narrow is on what `run`
82
+ * can RESOLVE; the `idle` arm is untouched and still carries no `runId`.
83
+ *
84
+ * `DefinedAgentState` itself stays wide, because it is the DURABLE Model: an
85
+ * `init` slice is `idle`, and a `Store<DefinedAgentState<T>>` has to hold one.
86
+ */
87
+ type DefinedAgentResolvedState<T extends AnyToolDef> = Omit<DefinedAgentState<T>, "run"> & {
88
+ readonly run: EndedRun<string>;
89
+ };
90
+ /** The ctx the tools' `needs` demand, intersected — what `run` asks for. */
91
+ type DefinedAgentCtx<T extends AnyToolDef> = RequiredCtx<ToolCmd<T>>;
92
+ /** The Msg union a defined agent's machine folds. */
93
+ type DefinedAgentMsg<T extends AnyToolDef> = AgentMachineMsg<LidPurpose, LidOutputs, ToolResult<T>> | WiredToolMsg<T>;
94
+ /**
95
+ * The Cmd union a defined agent's machine emits — one interpret cell per member.
96
+ *
97
+ * Snapshotting is fixed OFF (the lid checkpoints through the run's `store`, not
98
+ * the monitored-run cadence), so `snapshot_write` is out of the union.
99
+ * Compaction is fixed ON, which is the SUPERSET of the two machines
100
+ * `defineAgent` builds: with the knob set the `compact_run` cell is the one the
101
+ * lid wires, and without it the reducer provably emits no such Cmd, so the
102
+ * machine carries no cell for it and the union simply has a member nothing
103
+ * reaches. Naming the superset is what lets one type describe both arms — and
104
+ * it is why `with` may wrap `compact_run` on a compacting agent and gets
105
+ * `overlaid`'s "this machine has none of that cell" throw on one without.
106
+ */
107
+ type DefinedAgentCmd<T extends AnyToolDef> = AgentCmd<LidPurpose, ToolCmd<T>, false, true>;
108
+ /**
109
+ * The interpret table of the machine `defineAgent` wired: one cell per
110
+ * {@link DefinedAgentCmd}, keyed by its `type` — a tool's own Cmd type, the
111
+ * router's `tool_rejected`, and the agent-owned brain call.
112
+ */
113
+ type DefinedAgentInterpret<T extends AnyToolDef> = Interpret<DefinedAgentMsg<T>, DefinedAgentCmd<T>, DefinedAgentCtx<T>>;
114
+ /** The wired machine `defineAgent` builds per `input` — feed it to the raw `run`. */
115
+ type DefinedAgentMachine<T extends AnyToolDef> = Machine<DefinedAgentState<T>, DefinedAgentMsg<T>, DefinedAgentCmd<T>, DeadlineSub, DefinedAgentCtx<T>>;
116
+ /**
117
+ * The brain a defined agent runs, in either of its two shapes:
118
+ *
119
+ * - `async (messages) => turn` — the plain port, and the common path.
120
+ * - `async (messages, { onChunk }) => turn` — the same call, plus a side
121
+ * channel it may write token deltas to while the turn is in flight.
122
+ *
123
+ * `defineAgent` takes one field for both and tells them apart by arity
124
+ * (`isStreamingModel`), so there is no config flag saying which you passed and
125
+ * no way for that flag to disagree with the function. Whichever shape you
126
+ * write, the run's Model is the same: the turn it RESOLVES is what the reducer
127
+ * folds, and the deltas end at the `onChunk` run option (see
128
+ * {@link DefinedAgentRunOptions}).
129
+ *
130
+ * Both members are unions of one signature so a model written inline still gets
131
+ * its `messages` parameter typed from the config field.
132
+ */
133
+ type DefinedAgentModel = PlainModel<AgentMessage, AgentTurn> | StreamingModel<AgentMessage, AgentTurn>;
134
+ /**
135
+ * What `defineAgent` takes: the model, the tools and the instructions, plus the
136
+ * four optional guards that stop a run — `maxTurns`, `deadlineMs`,
137
+ * `maxElapsedMs` and `stopWhen` — and the one that keeps a run going, `retry`,
138
+ * the brain call's backoff ladder. Omit every guard and the run is unbounded:
139
+ * it ends only when the model stops asking for tools.
140
+ *
141
+ * Two more knobs bound what a run COSTS rather than whether it ends:
142
+ * `compaction`, which stops the transcript growing, and `toolConcurrency`,
143
+ * which says how many of a turn's tool calls go out at once.
144
+ */
145
+ interface DefineAgentConfig<T extends AnyToolDef> {
146
+ /** The brain — either {@link DefinedAgentModel} shape. */
147
+ readonly model: DefinedAgentModel;
148
+ /** The `tool()`s the model may call. */
149
+ readonly tools: readonly T[];
150
+ /**
151
+ * The system prompt — stored on the Model at `init` (ADR 0004) and never
152
+ * re-read, so a resumed run keeps the prompt it started with even across a
153
+ * redeploy that changed this string; to replace a bad prompt already in
154
+ * flight, end that run and start a new one rather than resuming it.
155
+ */
156
+ readonly instructions: string;
157
+ /**
158
+ * Stops a run that keeps going: the maximum number of model round-trips it
159
+ * may take. Once the completed-turn count reaches it the run fails rather
160
+ * than calling the model again. Omit → no limit on turns.
161
+ */
162
+ readonly maxTurns?: number;
163
+ /**
164
+ * Stops a run that stops progressing: milliseconds the run may sit without
165
+ * advancing before it fails. The budget is a no-progress watchdog, not a
166
+ * total wall-clock cap — it restarts each time the run moves. Omit → no
167
+ * watchdog.
168
+ */
169
+ readonly deadlineMs?: number;
170
+ /**
171
+ * Stops a run that keeps going, by the clock: total milliseconds from the
172
+ * run's start it may take before it fails. This is the total wall-clock cap
173
+ * `deadlineMs` is not — the budget never restarts, so a run that keeps
174
+ * progressing is bounded by it where `deadlineMs` would let it run forever,
175
+ * and it counts elapsed time where `maxTurns` counts round-trips. It is read
176
+ * at the turn boundary, so like both of those it stops the run rather than
177
+ * cancelling the work already in flight. Omit → no wall-clock cap.
178
+ *
179
+ * The run's start time is on the durable Model, so a run killed and resumed
180
+ * continues the ORIGINAL budget — the time it spent dead counts against it.
181
+ *
182
+ * The same name on a `DurationRetryPolicy` (`retry`, and a tool's own) is the
183
+ * same idea one altitude down: that one bounds how long ONE call's retry
184
+ * ladder may keep climbing, this one how long the whole run may take.
185
+ */
186
+ readonly maxElapsedMs?: number;
187
+ /**
188
+ * Stops a run on a condition only you can see: a predicate consulted at the
189
+ * turn boundary, after the other three guards have passed, over the run's
190
+ * durable Model. Answer `true` and the run ends there — settled `cancelled`,
191
+ * the same terminal an aborted `signal` reaches, with the transcript intact
192
+ * and no further model call made. Where `maxTurns` and `maxElapsedMs` bound
193
+ * a quantity the agent counts for you and `deadlineMs` watches for a stall,
194
+ * this bounds whatever you name — a token ledger you keep, an external flag,
195
+ * a condition on the turns so far. Omit → no predicate.
196
+ *
197
+ * It must be PURE: the reducer calls it, so a replay hands it the same state
198
+ * and must get the same answer. And it is config rather than Model — a
199
+ * resumed run consults the predicate the config passed to THIS boot, exactly
200
+ * as it uses the `maxTurns` passed to this boot.
201
+ */
202
+ readonly stopWhen?: (state: DefinedAgentState<T>) => boolean;
203
+ /**
204
+ * The backoff ladder a FAILED BRAIN CALL climbs — the same `RetryPolicy`
205
+ * shape `AgentConfigCore.retry` takes, threaded straight to it, so the ladder
206
+ * runs in the resilient slice that already exists and lives on the Model:
207
+ * each failure is recorded there and the next attempt is armed as a timer
208
+ * Sub, which is what makes the wait durable and the attempt count survive a
209
+ * reload.
210
+ *
211
+ * The per-tool knob grows no lid option because a `tool()` is a spec object
212
+ * that declares its own policy (`ToolResilience.retry`). A
213
+ * `defineAgent` `model` is a bare function with no spec object, so the lid is
214
+ * the only declaration site a brain-call policy has.
215
+ *
216
+ * Omit → NO backoff, exactly as before: one throw from `model` ends the run
217
+ * after a single attempt. Nothing is defaulted on your behalf — a silent
218
+ * default would change the failure timing of every existing caller.
219
+ */
220
+ readonly retry?: RetryPolicy;
221
+ /**
222
+ * Observe a tool call that failed, typed against THIS agent's tools: the
223
+ * outcome is `{ kind: "error", _tag, …payload, reason }` over
224
+ * `ToolError`'s union — declared tags, `thrown`, `malformed_result`,
225
+ * `unknown_tool`, `malformed_args` — so a `switch` on `_tag` is exhaustive and an
226
+ * unhandled failure mode is a compile error rather than a silent turn (#115).
227
+ * The model still reads `reason` next turn either way — this is the host's
228
+ * channel beside it, never instead of it.
229
+ *
230
+ * Called ONCE per failed call, at the interpret boundary: after the handler
231
+ * settled, before the failure is folded into the conversation. It is awaited,
232
+ * so an async hook holds the settle until it resolves — keep it short, and put
233
+ * anything slow on your own queue.
234
+ *
235
+ * A resume calls it for the calls THIS process runs and no others: an outcome
236
+ * a previous process already folded is in the Model the Store handed back and
237
+ * is never re-interpreted, so a durable run does not re-fire the hook over its
238
+ * history.
239
+ *
240
+ * The hook is CONTAINED, exactly as `onEvent` is: a throw (or a rejected
241
+ * promise) is warned about and the run goes on, so `run`'s contract does not
242
+ * depend on the hook's.
243
+ *
244
+ * Omit → the router is wired unwrapped and nothing observes failures.
245
+ */
246
+ readonly onToolError?: (outcome: ToolFailureOf<T>, ctx: ToolErrorContext) => void | Promise<void>;
247
+ /**
248
+ * Bounds a run that keeps going without ever failing: the transcript budget,
249
+ * past which the OLDEST turns are folded into one model-written summary
250
+ * before the next brain call, so a long run's prompt stops growing instead of
251
+ * climbing until the provider rejects it.
252
+ *
253
+ * The knob is a THRESHOLD, not a policy function — see
254
+ * {@link DefineAgentCompaction}. `compaction` is what a run tolerates, and the
255
+ * summarize round-trip that enforces it is wiring, so the lid takes the
256
+ * former and supplies the latter from the `model` it already has.
257
+ *
258
+ * Omit → NO compaction, exactly as before: the transcript grows for as long
259
+ * as the model keeps asking for tools. Nothing is defaulted on your behalf —
260
+ * a silent budget would change the prompt every existing caller sends.
261
+ */
262
+ readonly compaction?: DefineAgentCompaction;
263
+ /**
264
+ * How many of ONE turn's tool calls a transition launches at once. At the
265
+ * default `1` a turn's calls go out one at a time, each waiting for the last
266
+ * to settle; raise it and up to that many are launched together, so they are
267
+ * all in flight in the fan-out ledger rather than queued behind each other.
268
+ * A turn asking for more calls than this runs them in waves.
269
+ *
270
+ * Launched together means overlapping on the clock: a turn of two slow tools
271
+ * costs the slower of them, not their sum. The overlap lives inside the tool
272
+ * Cmds' own handlers and NOT in the kernel — `runInterpret` still interprets
273
+ * a transition's Cmds one after another and never interleaves two handlers,
274
+ * which is ADR 0018's ruling and the reason a replay is unaffected. Settle
275
+ * Msgs fold in Cmd-EMISSION order whichever call finishes first, so raising
276
+ * the knob changes the turn's latency and nothing about its Model.
277
+ *
278
+ * Omit (or `1`) → serial dispatch, exactly as before.
279
+ */
280
+ readonly toolConcurrency?: number;
281
+ }
282
+ /**
283
+ * The lid's compaction budget: the two numbers that say when a transcript is
284
+ * too long and how much of it survives the fold. Both are plain counts, so the
285
+ * trigger they build is PURE — a replay re-decides identically, and no clock or
286
+ * token estimate enters the Model (ADR 0004).
287
+ *
288
+ * This is deliberately a threshold rather than the core's `planCompaction`
289
+ * function: a policy function is a second place a lid agent would have to learn
290
+ * the conversation shape, and the lid hides wiring, never state (ADR 0015). A
291
+ * run that needs its own heuristic descends to `createAgent`, whose
292
+ * `CompactionPolicy` this is built from.
293
+ */
294
+ interface DefineAgentCompaction {
295
+ /**
296
+ * Fold once the conversation holds at least this many turns, counted BEFORE
297
+ * the brain call about to fire. Must be at least `1`.
298
+ */
299
+ readonly afterTurns: number;
300
+ /**
301
+ * How many of the NEWEST turns survive the fold intact, beside the summary.
302
+ * Everything older becomes the summary's one synthetic head turn. Omit → `0`:
303
+ * the whole transcript folds into the summary.
304
+ *
305
+ * A fold worth fewer than two turns is skipped by the agent itself — one turn
306
+ * replaced by one summary shrinks nothing — so `keepTurns` within one of
307
+ * `afterTurns` is a policy that never fires.
308
+ */
309
+ readonly keepTurns?: number;
310
+ }
311
+ /**
312
+ * Which call an `onToolError` failure belongs to: the model's `callId` — the
313
+ * fan-out identity the outcome folds back on — and the tool `name` the model
314
+ * asked for, which for an `unknown_tool` is the name it invented rather than
315
+ * any declared tool.
316
+ */
317
+ interface ToolErrorContext {
318
+ readonly callId: string;
319
+ readonly name: string;
320
+ }
321
+ /**
322
+ * One lifecycle event a defined agent's run emits — {@link AgentEvent} with the
323
+ * tool results typed against this agent's own tool set.
324
+ */
325
+ type DefinedAgentEvent<T extends AnyToolDef> = AgentEvent<ToolResult<T>>;
326
+ /**
327
+ * Host wiring for one `run`: the store, the ctx the tools need, a runId, a clock.
328
+ *
329
+ * `ctx` is `ScopedCtxArg`, the same widening `run` itself takes: an agent's tools
330
+ * are exactly the handlers a scoped resource is for, so a `provide({ … })` graph
331
+ * is accepted here in place of the object and gets the same acquire-at-boot /
332
+ * release-at-terminal lifetime.
333
+ */
334
+ type DefinedAgentRunOptions<T extends AnyToolDef> = ScopedCtxArg<DefinedAgentCtx<T>> & {
335
+ readonly store?: Store<DefinedAgentState<T>>;
336
+ /** The run's identity. Omit → a fresh UUID. */
337
+ readonly runId?: string;
338
+ /** The clock that stamps `at`. Omit → `Date.now`. */
339
+ readonly clock?: () => number;
340
+ /**
341
+ * Observe the run's turn-level lifecycle events — `TurnSettled`,
342
+ * `ToolSettled`, `RunDone` — in the order the kernel settles them. This is
343
+ * the progress seam: without it the only way to see anything mid-run is
344
+ * `machine(input)` plus the raw kernel loop.
345
+ *
346
+ * It forwards the runtime's existing semantic stream (`agentEvents()` /
347
+ * `runtime.on`); it mints no vocabulary of its own, so a consumer folds the
348
+ * same {@link AgentEvent}s a hand-wired `run` would.
349
+ *
350
+ * The listener is CONTAINED: a throw is caught and warned, never allowed to
351
+ * take the run down, and never observable in `run`'s resolution. Only
352
+ * transitions applied by THIS process project events, so a store-backed
353
+ * resume replays nothing that settled before the boot.
354
+ *
355
+ * Omit → no projector is wired and the run behaves exactly as before.
356
+ */
357
+ readonly onEvent?: (event: DefinedAgentEvent<T>) => void;
358
+ /**
359
+ * Observe the token deltas of the turn being produced right now — the
360
+ * granularity below `onEvent`'s. Wired only when the configured `model` is
361
+ * the streaming shape (`async (messages, { onChunk }) => turn`); a plain
362
+ * model has no deltas to give, so passing this beside one is silent.
363
+ *
364
+ * Chunks ride a SIDE CHANNEL, never state. They are not projected off
365
+ * transitions like an {@link AgentEvent} is, because nothing about a chunk is
366
+ * a transition: it is never journaled, never written to the `Store`, and
367
+ * never folded into the Model. That is the whole rule this option obeys — a
368
+ * delta that has not settled is not an outcome, so a run that dies mid-turn
369
+ * loses its chunks and resumes from the last SETTLED turn, and a resumed run
370
+ * re-emits nothing it did not itself re-produce.
371
+ *
372
+ * The listener is CONTAINED exactly as `onEvent`'s is: a throw is caught and
373
+ * warned, never allowed to fail the model call it fired from.
374
+ *
375
+ * Omit → the streaming model is still invoked in its streaming shape, with a
376
+ * sink that drops every chunk.
377
+ */
378
+ readonly onChunk?: (chunk: TurnChunk) => void;
379
+ /**
380
+ * Stop the run from outside — the stop button's seam. On abort the run settles
381
+ * on a CANCELLED terminal Model and `run` RESOLVES with it; it does not reject,
382
+ * and no `DriveFailedError` is thrown. Read the outcome with `status(state)`,
383
+ * which answers `{ kind: "cancelled", at }` — distinct from `failed`, because a
384
+ * run someone stopped did not fail.
385
+ *
386
+ * The outcome is durable, so it is also the answer on the next boot: a process
387
+ * killed after an abort resumes reading a run that ENDED, not one to restart.
388
+ * A signal already aborted when `run` is called ends it before the first model
389
+ * call is made.
390
+ *
391
+ * It stops DISPATCH, not the work already in flight — a promise cannot be
392
+ * cancelled, so a tool handler mid-call runs to its own end. Those late results
393
+ * reach no `onEvent`, no `onToolError` and no Model, and they do not hold the
394
+ * runtime's teardown. Propagating the signal INTO handlers is a separate seam
395
+ * this option does not open.
396
+ *
397
+ * Omit → the run has no stop button and every path behaves exactly as before.
398
+ */
399
+ readonly signal?: AbortSignal;
400
+ };
401
+ /**
402
+ * One decorator per interpret cell you name: it receives the cell the agent
403
+ * wired (`next`) and returns the cell that runs in its place. Every key is
404
+ * optional and a cell nobody names is passed through by REFERENCE, so an
405
+ * overlay that wraps one tool leaves the others the exact functions
406
+ * `defineAgent` built.
407
+ *
408
+ * The wrapper's signature is the cell's, so calling `next(cmd, ctx, dispatch)`
409
+ * is how the wrapped work happens — that is the typed Cmd→Msg edge
410
+ * (`Cmd.define`'s `_ok` / `_err` Msgs), and returning its Msg is what keeps the
411
+ * fold, and therefore a replay, identical to the unwrapped run's.
412
+ */
413
+ type InterpretOverlay<T extends AnyToolDef> = CellWrappers<DefinedAgentInterpret<T>>;
414
+ /**
415
+ * The decorator table over an interpret table `I`. Written over a bare type
416
+ * parameter because `I[K]` is only indexable when `I` is one: applying the
417
+ * mapped type to `DefinedAgentInterpret<T>` inline leaves TypeScript indexing
418
+ * an unreduced generic mapped type, which it refuses.
419
+ */
420
+ type CellWrappers<I> = {
421
+ readonly [K in keyof I]?: (next: I[K]) => I[K];
422
+ };
423
+ /**
424
+ * What `defineAgent(cfg).with(...)` takes — the one documented wrap point over
425
+ * the machine the lid built.
426
+ */
427
+ interface DefinedAgentOverlay<T extends AnyToolDef> {
428
+ readonly interpret: InterpretOverlay<T>;
429
+ }
430
+ /** What `defineAgent` returns. */
431
+ interface DefinedAgent<T extends AnyToolDef> {
432
+ /**
433
+ * Run `input` to its terminal Model. Resolves on `run.phase: "done"`; a
434
+ * failed run rejects with `DriveFailedError` carrying the failed Model.
435
+ *
436
+ * With a `store`, the same call is also the resume: a Model the Store hands
437
+ * back mid-run is booted (`agent_boot`) at its one outstanding effect —
438
+ * same `runId`, no tool re-run — and one already `done` resolves as it is.
439
+ * A fresh start needs an empty Store.
440
+ *
441
+ * It resolves with {@link DefinedAgentResolvedState} — the Model whose `run`
442
+ * slice is narrowed to the ENDED phases, so `(await agent.run(i)).run.runId`
443
+ * reads without a guard against an `idle` arm this promise cannot produce.
444
+ */
445
+ readonly run: (input: string, ...opts: [Record<never, never>] extends [DefinedAgentCtx<T>] ? [opts?: DefinedAgentRunOptions<T>] : [opts: DefinedAgentRunOptions<T>]) => Promise<DefinedAgentResolvedState<T>>;
446
+ /** The machine `run` drives for `input` — the door down to the raw kernel. */
447
+ readonly machine: (input: string) => DefinedAgentMachine<T>;
448
+ /**
449
+ * The ramp between the lid and `createAgent`: wrap ONE interpret cell of the
450
+ * machine this agent builds and get back a NEW defined agent that runs the
451
+ * wrapped table. The agent it is called on is untouched, and so is every cell
452
+ * the overlay does not name.
453
+ *
454
+ * const traced = agent.with({
455
+ * interpret: {
456
+ * fetch_rate: (next) => async (cmd, ctx, dispatch) => {
457
+ * console.time(cmd.callId);
458
+ * try { return await next(cmd, ctx, dispatch); }
459
+ * finally { console.timeEnd(cmd.callId); }
460
+ * },
461
+ * },
462
+ * });
463
+ *
464
+ * The wrapped cell settles through the SAME typed Cmd→Msg edge as the cell it
465
+ * wraps — it returns whatever `next` returned — so the reducer folds the same
466
+ * Msgs and a replay of a wrapped run is the unwrapped run's replay. That is
467
+ * the whole contract: the door is one over the effect boundary, never over
468
+ * the fold. A cell that must settle DIFFERENTLY is a different machine, and
469
+ * `createAgent` is still where you build one.
470
+ *
471
+ * `with` composes — `agent.with(a).with(b)` puts `b`'s wrapper OUTSIDE `a`'s,
472
+ * so `b` is entered first and `a`'s cell is what its `next` calls. Naming a
473
+ * cell the machine has none of throws at `machine(input)`, where the table it
474
+ * is checked against exists.
475
+ */
476
+ readonly with: (overlay: DefinedAgentOverlay<T>) => DefinedAgent<T>;
477
+ }
478
+ /**
479
+ * Define an agent from a model, the tools it may call and its instructions, and
480
+ * get back `run(input)` — a promise of the finished state — plus `machine(input)`
481
+ * for driving the same run yourself, which is the entry point a newcomer picks,
482
+ * `createAgent` being the layer underneath that you drop to only to walk a stage
483
+ * pipeline of your own.
484
+ *
485
+ * Add `maxTurns`, `deadlineMs`, `maxElapsedMs` or `stopWhen` to bound the run;
486
+ * all four are described on `DefineAgentConfig`. The run's `input` is its single stage, so it is durable
487
+ * beside `instructions`, and the prompt is rendered from those two and the
488
+ * conversation on every model call.
489
+ *
490
+ * One unusual requirement does not cost you the lid: `.with({ interpret })`
491
+ * wraps one interpret cell of the machine this built and hands back another
492
+ * defined agent, so `createAgent` is for a rebuild rather than for a detour.
493
+ */
494
+ declare function defineAgent<T extends AnyToolDef>(config: DefineAgentConfig<T>): DefinedAgent<T>;
495
+ /** The prompt as messages: the head, then each turn with its tool outcomes. PURE. */
496
+ declare function renderPrompt(prompt: AgentPrompt<unknown>): AgentMessage[];
497
+
498
+ /**
499
+ * @packageDocumentation
500
+ * The transcript collector — the built-in way to KEEP a run's turns, given that
501
+ * a finished run's Model does not.
502
+ *
503
+ * A run that reaches `phase: "done"` clears `conversation` to `null` on
504
+ * purpose: the terminating turn is stamped onto `output` first, so the answer
505
+ * survives, and the history that would otherwise grow without bound in storage
506
+ * kept for its state is dropped (`docs/explanation/durability-model.md`). That
507
+ * policy is not what this module changes. What it changes is that every
508
+ * consumer wanting the history had to hand-write the same fold over `onEvent`.
509
+ *
510
+ * So this is a COLLECTOR over the event stream that already exists, not a knob
511
+ * on the Model. Nothing here is durable, nothing here is written to a `Store`,
512
+ * and a run with a collector attached is byte for byte the run it was without
513
+ * one — the same reason `onChunk` rides a side channel rather than state.
514
+ *
515
+ * const t = transcript<ToolResult<typeof tools>>();
516
+ * const final = await agent.run(input, { store, onEvent: t.onEvent });
517
+ * t.read().turns; // every turn this process settled
518
+ *
519
+ * ## What a resume needs from you
520
+ *
521
+ * Events are projected off the transitions THIS process applies, so a run
522
+ * resumed from a `Store` re-emits nothing the killed process already settled.
523
+ * A collector that only ever listened would therefore hold the tail of a
524
+ * resumed run and call it the whole thing. Hence the seed: hand
525
+ * {@link transcript} the Model the `Store` handed back and it starts from that
526
+ * Model's live conversation, so the resumed collector reads as the whole run
527
+ * rather than its last leg.
528
+ */
529
+
530
+ /**
531
+ * One tool call the run settled OK, as the transcript keeps it — the `callId`
532
+ * and the result, which is exactly what the `ToolSettled` event carries.
533
+ *
534
+ * A tool that FAILED is absent, and that is the event stream's shape rather
535
+ * than a choice made here: `ToolSettled` is projected off the OK settle alone.
536
+ * Branch on failures through `onToolError`, whose argument is typed per tag.
537
+ */
538
+ interface TranscriptToolResult<R> {
539
+ readonly callId: string;
540
+ readonly result: R;
541
+ }
542
+ /**
543
+ * Whether the run has finished, and its terminal turn once it has.
544
+ *
545
+ * The two cases are a union rather than a nullable `output` field because
546
+ * `output` is legitimately `null` on a finished run — a `RunDone` with no
547
+ * terminating turn — and a single field would make "not finished yet" and
548
+ * "finished with nothing" the same reading.
549
+ */
550
+ type TranscriptOutcome = {
551
+ readonly kind: "running";
552
+ } | {
553
+ readonly kind: "done";
554
+ readonly output: AgentTurn | null;
555
+ };
556
+ /** What a collector holds right now — a plain, immutable read. */
557
+ interface TranscriptSnapshot<R> {
558
+ /** Every model turn the transcript holds, in order. */
559
+ readonly turns: readonly AgentTurn[];
560
+ /** Every tool call that settled OK, in settle order. */
561
+ readonly tools: readonly TranscriptToolResult<R>[];
562
+ /** Whether `RunDone` has been seen, and the terminal turn if so. */
563
+ readonly outcome: TranscriptOutcome;
564
+ }
565
+ /**
566
+ * The Model a resumed collector starts from — structural on purpose, so any
567
+ * agent state (`DefinedAgentState<T>`, `AgentState<…>`) satisfies it without
568
+ * this module importing the lid, and a bare `{ conversation }` object works in
569
+ * a test.
570
+ */
571
+ interface TranscriptSeed<R> {
572
+ readonly conversation: Conversation<R> | null;
573
+ }
574
+ /**
575
+ * A live transcript: the listener you wire, and the read you take off it.
576
+ *
577
+ * `onEvent` is a bound function, so `{ onEvent: t.onEvent }` is the whole
578
+ * wiring — there is no `this` to lose.
579
+ */
580
+ interface Transcript<R> {
581
+ /** Wire this to `run`'s `onEvent`. */
582
+ readonly onEvent: (event: AgentEvent<R>) => void;
583
+ /** The transcript as of now. Each call returns a fresh immutable snapshot. */
584
+ readonly read: () => TranscriptSnapshot<R>;
585
+ }
586
+ /**
587
+ * Open a transcript collector over an agent run's event stream.
588
+ *
589
+ * Wire `onEvent` to `run`'s `onEvent` option and `read()` gives you the turns
590
+ * and settled tool results afterwards — the transcript the finished Model no
591
+ * longer carries.
592
+ *
593
+ * Pass `seed` when the run is a RESUME: the Model the `Store` handed back still
594
+ * holds the live conversation the killed process built, and seeding from it is
595
+ * what makes the collector hold the whole run rather than the leg this process
596
+ * ran. One collector per process is the honest unit; a fresh run needs no seed.
597
+ *
598
+ * A seed taken from an already-finished Model contributes nothing, and
599
+ * correctly so: that Model's `conversation` is `null` and its answer is its
600
+ * `output`, which you already hold.
601
+ */
602
+ declare function transcript<R>(seed?: TranscriptSeed<R>): Transcript<R>;
19
603
 
20
604
  /**
21
605
  * @packageDocumentation
@@ -24,16 +608,15 @@ import '../snapshot/index.js';
24
608
  * drives the classic loop `llm → tools → fold → llm` until the model stops
25
609
  * asking for tools.
26
610
  *
27
- * This is the `seed/audit-agent-machine` reducer generalized: the seed's audit /
28
- * glyph / violation domain specifics are stripped, and what remains — the loop,
29
- * the durability, the boot-reconcile crash recovery, the serial-vs-fanned tool
30
- * dispatch — is yours. The consumer supplies the only things that are genuinely
31
- * domain: the tools, the prompts (via the llm-call message loader), the schemas,
32
- * and the model. `createAgent(config)` returns the uniform knob contract every
611
+ * This generalizes a production audit agent: the domain specifics are stripped,
612
+ * and what remains — the loop, the durability, the boot-reconcile crash
613
+ * recovery, the serial-vs-fanned tool dispatch — is yours. The consumer
614
+ * supplies the only things that are genuinely domain: the tools, the prompts
615
+ * (via the llm-call message loader), the schemas, and the model. `createAgent(config)` returns the uniform handle contract every
33
616
  * composition exposes (`init` / verbs returning `readonly [State, Cmd[]]` /
34
617
  * `subs`) AND a ready-to-`run` `defineMachine` (`toMachine`) — THE one wired
35
618
  * path. (`unsafeDetachedHandlers` is the hand-wiring escape hatch; its name
36
- * advertises that it does not drive the retry loop — see #54.)
619
+ * advertises that it does not drive the retry loop.)
37
620
  *
38
621
  * ## The composition (three siblings wired into ONE machine)
39
622
  *
@@ -42,18 +625,21 @@ import '../snapshot/index.js';
42
625
  * position survives eviction, the no-progress deadline auto-fails a wedged
43
626
  * run, and `boot` resumes mid-pipeline. The agent slice OWNS this slice and
44
627
  * delegates `start` / `advance` / `progress` / `onDeadline` / `boot` to it.
45
- * - `../llm-call` — every brain call (the seed's `call_llm{purpose}`). One
628
+ * - `../llm-call` — every brain call. One
46
629
  * `LlmCall` per turn, structured-output parsed, retry composed in. The agent
47
630
  * delegates the resilient slice + verbs and reuses the detached handler.
48
- * - `../fan-out` — the tool calls a turn produced. The seed dispatched tools
49
- * SERIALLY (concurrency 1); fan-out generalizes that to bounded concurrency
50
- * `config.toolConcurrency` (default 1 = the seed's serial behavior). Each
631
+ * - `../fan-out` — the tool calls a turn produced. Tools dispatch SERIALLY by
632
+ * default (concurrency 1); fan-out generalizes that to a bounded number
633
+ * LAUNCHED per transition, `config.toolConcurrency`. Above `1` a router's
634
+ * tool cells overlap on the clock while `runInterpret` stays serial — the
635
+ * fan-out is inside the Cmd handler, and its settles fold in emission
636
+ * order (ADR 0018). Each
51
637
  * tool is an `of(call)` Cmd the consumer's own interpret performs; results
52
638
  * route back through `toolOk` / `toolErr`. When the batch drains, the agent
53
639
  * folds the gathered results back into the conversation and fires the next
54
640
  * brain call (`fold → llm`).
55
641
  *
56
- * ## The flow loop, as TEA (generalized from the seed's `applyAiTurn`)
642
+ * ## The flow loop, as TEA
57
643
  *
58
644
  * 1. `start` enters the pipeline; the consumer wires the per-stage outstanding
59
645
  * effect (often a `call_llm` for the agentic stage) off the current stage.
@@ -67,10 +653,12 @@ import '../snapshot/index.js';
67
653
  * queued tool. When the batch drains, fold the gathered outcomes into the
68
654
  * conversation, bump the turn count (livelock guard), and fire the next
69
655
  * brain call — `awaiting` flips back to `llm`.
70
- * 4. The watchdog + turn-limit guard bound the loop; the deadline fires
71
- * `failed`, the turn limit fires `failed { turn_limit }`.
656
+ * 4. The watchdog bounds a stall and the turn boundary's own stop conditions
657
+ * bound the loop: the deadline fires `failed`, the turn limit fires
658
+ * `failed { turn_limit }`, the wall-clock cap `failed { elapsed_limit }`,
659
+ * and the consumer's `stopWhen` settles the run `cancelled`.
72
660
  *
73
- * ## Boot reconcile (crash recovery — the seed's `outstandingEffect`)
661
+ * ## Boot reconcile (crash recovery)
74
662
  *
75
663
  * Cold wake re-derives the ONE outstanding effect from `phase × awaiting`: a
76
664
  * brain call in flight re-fires `call_llm`; tools in flight re-fire the in-flight
@@ -97,11 +685,13 @@ import '../snapshot/index.js';
97
685
  * type RunTool = { readonly type: "run_tool" } & ToolCall;
98
686
  * const agent = createAgent<Stage, Purpose, Outputs, Result, RunTool, Msg>({
99
687
  * stages: ["plan", "act", "report"],
100
- * model: (id) => createChatModel(env, id),
688
+ * // The brain: a plain `async (messages) => turn` (the common path), or the
689
+ * // `(id) => Llm` factory when the model binds the schema itself.
690
+ * model: async (messages) => client.chat(messages),
101
691
  * schemas: { plan: planSchema, act: turnSchema, report: reportSchema },
102
692
  * turnOf: (stage) => stageToPurpose[stage], // which brain call a stage runs
103
693
  * toolOf: (call): RunTool => ({ type: "run_tool", ...call }),
104
- * toolConcurrency: 1, // serial like the seed (default)
694
+ * toolConcurrency: 1, // launched per transition
105
695
  * deadlineMs: 10 * 60_000,
106
696
  * maxTurns: 60,
107
697
  * retry: defaultRetryPolicy,
@@ -114,21 +704,24 @@ import '../snapshot/index.js';
114
704
  */
115
705
 
116
706
  /**
117
- * Build an agent knob from `config`. The determinism seam — `config.rng`,
118
- * injected for the inherited brain-call retry jitter — lives as a named field
119
- * on the config (pass a fixed `() => 0` to pin backoff in tests; omit → defaults
120
- * to `Math.random`, read only at the resilient-call verb boundary).
707
+ * Assemble an agent from `config` — the model, the stages it walks, and how a
708
+ * tool call is turned into a command — and get back its `init`, verbs and `subs`
709
+ * plus a `toMachine()` that wires all of it into one machine you hand to `run`,
710
+ * which is the layer to reach for only once `defineAgent` cannot express the run
711
+ * you want — a newcomer starts there, not here.
121
712
  *
122
- * Returns the uniform knob contract (`init` / verbs / `subs`) plus `toMachine()`
123
- * — a `defineMachine` wiring all of it into one runnable machine — and the
124
- * `unsafeDetachedHandlers` hand-wiring escape hatch.
713
+ * Pass `snapshotEvery` to have the run persist itself every N steps, and
714
+ * `compaction` to have long conversations summarized as they grow; each one you
715
+ * pass obliges you to supply the matching handler at `toMachine`, and each one
716
+ * you omit forbids it. `rng` is the determinism seam for the retry backoff —
717
+ * pass a fixed `() => 0` to pin it in tests; omit for `Math.random`.
718
+ * `unsafeDetachedHandlers` is the hand-wiring escape hatch.
125
719
  *
126
- * `createAgent` is OVERLOADED on TWO independent discriminants — the snapshotting
127
- * (#55) and the compaction (#85) one — so each `toMachine` obligation is derived
720
+ * The four overloads exist because the two obligations are derived
128
721
  * from the `config` VALUE, never inferred. `{ snapshotEvery: number }` REQUIRES
129
722
  * the `snapshot_write` cell, `{ snapshotEvery?: never }` FORBIDS it; `{ compaction:
130
723
  * policy }` REQUIRES the `compact_run` cell, `{ compaction?: never }` FORBIDS it.
131
- * The four overloads enumerate the snapshot × compaction grid: overload resolution
724
+ * They enumerate the snapshot × compaction grid: overload resolution
132
725
  * reads the two fields off `config`, so the right `Snap`/`Compact` pair is fixed
133
726
  * even when the call site passes explicit type arguments (TS does not infer
134
727
  * trailing type params — a `Cfg`-inference scheme would silently fall back to OFF
@@ -151,4 +744,4 @@ declare function createAgent<Stage, P extends string, O extends Record<P, AgentT
151
744
  readonly compaction?: never;
152
745
  }): AgentKnob<Stage, P, O, R, TC, false, false>;
153
746
 
154
- export { AgentConfigCore, AgentKnob, AgentTurn, CompactionPolicy, createAgent };
747
+ export { AgentCmd, AgentConfigCore, AgentEvent, AgentKnob, AgentMachineMsg, type AgentMessage, type AgentPrompt, AgentState, AgentTurn, AnyToolDef, CompactionPolicy, Conversation, DeadlineSub, type DefineAgentCompaction, type DefineAgentConfig, type DefinedAgent, type DefinedAgentCmd, type DefinedAgentCtx, type DefinedAgentEvent, type DefinedAgentInterpret, type DefinedAgentMachine, type DefinedAgentModel, type DefinedAgentMsg, type DefinedAgentOverlay, type DefinedAgentResolvedState, type DefinedAgentRunOptions, type DefinedAgentState, EndedRun, type InterpretOverlay, type LidPurpose, PlainModel, StreamingModel, ToolCall, ToolCmd, type ToolErrorContext, ToolFailureOf, ToolOutcome, ToolResult, type Transcript, type TranscriptOutcome, type TranscriptSeed, type TranscriptSnapshot, type TranscriptToolResult, TurnChunk, WiredToolMsg, createAgent, defineAgent, renderPrompt, transcript };