@graphrefly/graphrefly 0.30.0 → 0.32.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 (253) hide show
  1. package/dist/{cascading-dNCtjW8j.d.cts → cascading-BfQmSmjU.d.cts} +21 -2
  2. package/dist/{cascading-BszPheHD.d.ts → cascading-D3sapjue.d.ts} +21 -2
  3. package/dist/chunk-2JNT5NDF.js +61 -0
  4. package/dist/{chunk-DDPYNMGG.js → chunk-2RH4QNDQ.js} +1 -1
  5. package/dist/chunk-4JBKKUCJ.js +7 -0
  6. package/dist/{chunk-SLMYTGTU.js → chunk-4UUDNFYG.js} +1 -1
  7. package/dist/chunk-4VXL3UZK.js +1 -0
  8. package/dist/{chunk-SHYH5SXV.js → chunk-4YGJ7KZ6.js} +1 -1
  9. package/dist/{chunk-GJR3P6JG.js → chunk-5PBXUVHI.js} +1 -1
  10. package/dist/{chunk-W4TSQ6RJ.js → chunk-7AJKUA36.js} +1 -1
  11. package/dist/{chunk-XQAXYVXX.js → chunk-7EMUF2RY.js} +1 -1
  12. package/dist/chunk-7JZ3YORY.js +80 -0
  13. package/dist/chunk-7QMVU3IX.js +1 -0
  14. package/dist/{chunk-WANIEEKV.js → chunk-7QS77X6G.js} +1 -1
  15. package/dist/{chunk-BA5URFYW.js → chunk-A4JT4SAD.js} +1 -1
  16. package/dist/{chunk-Y36UZ5VS.js → chunk-BU4SUZSA.js} +1 -1
  17. package/dist/{chunk-P7JXGKDO.js → chunk-CNXUW2CU.js} +1 -1
  18. package/dist/{chunk-Y32RJO24.js → chunk-CZVYLXFK.js} +1 -1
  19. package/dist/{chunk-567NWZ3T.js → chunk-DWIAG62L.js} +1 -1
  20. package/dist/chunk-EIFHFDFD.js +1 -0
  21. package/dist/chunk-FTA5TB2A.js +1 -0
  22. package/dist/{chunk-T5SHIKJD.js → chunk-JAHAJU4G.js} +1 -1
  23. package/dist/{chunk-AV3PIDFQ.js → chunk-JYMNVEH6.js} +1 -1
  24. package/dist/{chunk-5Z4HDCO6.js → chunk-K54OKWNY.js} +1 -1
  25. package/dist/chunk-KD3IYBTD.js +3 -0
  26. package/dist/{chunk-3NEPQO2E.js → chunk-LG73TUF4.js} +2 -2
  27. package/dist/chunk-LJGPOJHS.js +1 -0
  28. package/dist/chunk-LWGLBCMU.js +1 -0
  29. package/dist/{chunk-BKPLTBL5.js → chunk-M2VFLRPJ.js} +1 -1
  30. package/dist/{chunk-GNCBXARM.js → chunk-MFNOZ5E6.js} +1 -1
  31. package/dist/{chunk-TWMEGG45.js → chunk-N2KKISCE.js} +1 -1
  32. package/dist/chunk-PNTBXOQ6.js +5 -0
  33. package/dist/{chunk-73Z3W2RN.js → chunk-PWKLZ2XU.js} +1 -1
  34. package/dist/{chunk-7TDOES3L.js → chunk-Q2SY7M7K.js} +1 -1
  35. package/dist/{chunk-OL33ZI6R.js → chunk-RWGJQQLT.js} +1 -1
  36. package/dist/chunk-SGS4OJGS.js +1 -0
  37. package/dist/{chunk-4OFIQ66T.js → chunk-TOCCHQI6.js} +1 -1
  38. package/dist/chunk-UMH3HSP7.js +1 -0
  39. package/dist/{chunk-XHVB6G6M.js → chunk-UXEB35L4.js} +1 -1
  40. package/dist/{chunk-33FA6V4B.js → chunk-VXJX3ZZP.js} +1 -1
  41. package/dist/{chunk-BZP5T4X6.js → chunk-W6FQIFVE.js} +1 -1
  42. package/dist/{chunk-RD52SNH2.js → chunk-WE32AFFA.js} +1 -1
  43. package/dist/{chunk-KA6MMXIY.js → chunk-WF3V5X2L.js} +1 -1
  44. package/dist/chunk-WQ7I7JVU.js +1 -0
  45. package/dist/{chunk-4JJCCD5S.js → chunk-X4OOM6QU.js} +1 -1
  46. package/dist/{chunk-AUY2YKCO.js → chunk-XRSHMHEG.js} +1 -1
  47. package/dist/chunk-Y26UN6J5.js +18 -0
  48. package/dist/{chunk-VWPRPPKR.js → chunk-ZWETYYQG.js} +1 -1
  49. package/dist/compat/index.cjs +2 -2
  50. package/dist/compat/index.d.cts +5 -5
  51. package/dist/compat/index.d.ts +5 -5
  52. package/dist/compat/index.js +1 -1
  53. package/dist/compat/jotai/index.cjs +1 -1
  54. package/dist/compat/jotai/index.js +1 -1
  55. package/dist/compat/nanostores/index.cjs +1 -1
  56. package/dist/compat/nanostores/index.js +1 -1
  57. package/dist/compat/nestjs/index.cjs +5 -5
  58. package/dist/compat/nestjs/index.d.cts +3 -3
  59. package/dist/compat/nestjs/index.d.ts +3 -3
  60. package/dist/compat/nestjs/index.js +1 -1
  61. package/dist/compat/zustand/index.cjs +2 -2
  62. package/dist/compat/zustand/index.d.cts +2 -2
  63. package/dist/compat/zustand/index.d.ts +2 -2
  64. package/dist/compat/zustand/index.js +1 -1
  65. package/dist/{composite-DGspwCqk.d.ts → composite-BY9hMxN7.d.ts} +1 -1
  66. package/dist/{composite-nrRumJ7l.d.cts → composite-CH0S8DFn.d.cts} +1 -1
  67. package/dist/content-addressed-storage-BUiREIuj.d.ts +124 -0
  68. package/dist/content-addressed-storage-DqIWCmZG.d.cts +124 -0
  69. package/dist/core/index.cjs +1 -1
  70. package/dist/core/index.js +1 -1
  71. package/dist/extra/browser.cjs +1 -1
  72. package/dist/extra/browser.js +1 -1
  73. package/dist/extra/index.cjs +18 -18
  74. package/dist/extra/index.d.cts +7 -6
  75. package/dist/extra/index.d.ts +7 -6
  76. package/dist/extra/index.js +1 -1
  77. package/dist/extra/node.cjs +2 -2
  78. package/dist/extra/node.js +1 -1
  79. package/dist/extra/operators.cjs +1 -1
  80. package/dist/extra/operators.d.cts +41 -1
  81. package/dist/extra/operators.d.ts +41 -1
  82. package/dist/extra/operators.js +1 -1
  83. package/dist/extra/reactive.cjs +1 -1
  84. package/dist/extra/reactive.d.cts +1 -1
  85. package/dist/extra/reactive.d.ts +1 -1
  86. package/dist/extra/reactive.js +1 -1
  87. package/dist/extra/sources.cjs +1 -1
  88. package/dist/extra/sources.d.cts +62 -2
  89. package/dist/extra/sources.d.ts +62 -2
  90. package/dist/extra/sources.js +1 -1
  91. package/dist/extra/storage-browser.cjs +1 -1
  92. package/dist/extra/storage-browser.js +1 -1
  93. package/dist/{fallback-BaTS7vVY.d.cts → fallback-Cb3GH1O7.d.cts} +6 -14
  94. package/dist/{fallback-eOm3LNxP.d.ts → fallback-DRjJ_ZM8.d.ts} +6 -14
  95. package/dist/graph/index.cjs +4 -4
  96. package/dist/graph/index.d.cts +3 -3
  97. package/dist/graph/index.d.ts +3 -3
  98. package/dist/graph/index.js +1 -1
  99. package/dist/{graph-CWeI0aHd.d.ts → graph-BOhEGJ6E.d.ts} +10 -0
  100. package/dist/{graph-C4Uxwv0T.d.cts → graph-CdJeX7O7.d.cts} +10 -0
  101. package/dist/{index-B-z8WaSd.d.cts → index-BDLy6CQ9.d.cts} +1 -1
  102. package/dist/{index-iBp74eGU.d.cts → index-BJDXj9Wf.d.cts} +2 -2
  103. package/dist/{index-BBINVimG.d.ts → index-BUZPTPSQ.d.ts} +2 -2
  104. package/dist/{index-DnrZghBB.d.ts → index-BbcSZCAG.d.ts} +1 -1
  105. package/dist/{index-lKuLYmHO.d.cts → index-BiGeETJs.d.cts} +1 -1
  106. package/dist/{index-BHu_Wba0.d.cts → index-BmZb8fNF.d.cts} +3 -3
  107. package/dist/{index-Docdiu9a.d.ts → index-Bnmttu35.d.ts} +1 -1
  108. package/dist/{index-D6ajK8Mh.d.cts → index-BuN2wGJs.d.cts} +517 -134
  109. package/dist/{index-Cy7eFeIX.d.cts → index-BwdPDWI4.d.cts} +1 -1
  110. package/dist/{index-DylQCKEL.d.cts → index-BzxU4yhV.d.cts} +11 -2
  111. package/dist/{index-D9Y_u6BG.d.cts → index-C-Gsh-0a.d.cts} +2 -2
  112. package/dist/{index-ybtSyjWB.d.cts → index-C22aTC1X.d.cts} +5 -5
  113. package/dist/{index-yIdWFo2b.d.cts → index-C4QTaDli.d.cts} +2 -2
  114. package/dist/{index-BJHQUCZx.d.ts → index-C7RqYbOZ.d.ts} +82 -7
  115. package/dist/{index-C5Ghnp5B.d.ts → index-C9qCLIN4.d.ts} +2 -2
  116. package/dist/{index-DVNLe3pS.d.cts → index-CCdg0JLX.d.cts} +1 -1
  117. package/dist/{index-B5iVOD7w.d.ts → index-CEoU-r-g.d.ts} +2 -2
  118. package/dist/{index-CfFYyLR8.d.ts → index-CHfBm51k.d.ts} +11 -2
  119. package/dist/{index-Dljd76bC.d.ts → index-CNyiYQWF.d.ts} +5 -5
  120. package/dist/{index-C6NBfXj-.d.ts → index-CVevMZ0n.d.ts} +2 -2
  121. package/dist/{index-DGb1awva.d.ts → index-CZUzi6Dy.d.ts} +2 -2
  122. package/dist/{index-FrYrV-Vf.d.ts → index-Ckl03Q0s.d.ts} +1 -1
  123. package/dist/{index-Bvi5uJxX.d.ts → index-CmSjld-4.d.ts} +1 -1
  124. package/dist/{index-9iguV3bF.d.cts → index-CnjUhRbs.d.cts} +2 -2
  125. package/dist/{index-C98oJsEs.d.cts → index-D3HcdZ4d.d.cts} +1 -1
  126. package/dist/{index-IZ3l_vQ9.d.ts → index-DD1czHj3.d.ts} +1 -1
  127. package/dist/{index-BS220yqj.d.cts → index-DNhTQReY.d.cts} +82 -7
  128. package/dist/{index-UZO988ox.d.cts → index-DSawGt8n.d.cts} +2 -2
  129. package/dist/{index-CcpEvuPl.d.cts → index-DUkuH3jP.d.cts} +1 -1
  130. package/dist/{index-CRAkoq-y.d.cts → index-DY2QbdoP.d.cts} +1 -1
  131. package/dist/{index-CvS9IuTG.d.ts → index-Dbmj0iYR.d.ts} +1 -1
  132. package/dist/{index-ClgKmOHe.d.ts → index-DhlAMlm9.d.ts} +517 -134
  133. package/dist/{index-ClB7TCfL.d.cts → index-DlGaEBW5.d.cts} +2 -2
  134. package/dist/{index-CotRMjtJ.d.ts → index-Dp_pS7Bw.d.ts} +1 -1
  135. package/dist/{index-Cc8VQIgL.d.ts → index-Dxk-pUQI.d.ts} +2 -2
  136. package/dist/{index-DBQUKh59.d.cts → index-EGjF6iSY.d.cts} +3 -3
  137. package/dist/{index-D9HrBx2J.d.ts → index-LGzAYqdR.d.ts} +1 -1
  138. package/dist/{index-DR3gf_DG.d.cts → index-LzCJ0kMT.d.cts} +2 -2
  139. package/dist/{index-RQg6lTrN.d.ts → index-MV2yGIAq.d.ts} +2 -2
  140. package/dist/{index-Bs3-LC83.d.cts → index-_BXz9K7b.d.cts} +1 -1
  141. package/dist/{index-SSGqF8mI.d.cts → index-aBqZUx3B.d.cts} +1 -1
  142. package/dist/{index-CFW32Dy1.d.ts → index-eYHRkoK-.d.ts} +1 -1
  143. package/dist/{index-B2HBxvMb.d.ts → index-gXTVbSax.d.ts} +3 -3
  144. package/dist/{index-B8Aj_z8S.d.cts → index-j33Lfb1G.d.cts} +23 -2
  145. package/dist/{index-BEpRsvhg.d.ts → index-lpGUhTBn.d.ts} +3 -3
  146. package/dist/{index-BXbQUn4n.d.ts → index-zMQIQuDu.d.ts} +23 -2
  147. package/dist/index.cjs +106 -125
  148. package/dist/index.d.cts +34 -33
  149. package/dist/index.d.ts +34 -33
  150. package/dist/index.js +1 -1
  151. package/dist/patterns/ai/browser.cjs +5 -22
  152. package/dist/patterns/ai/browser.d.cts +3 -3
  153. package/dist/patterns/ai/browser.d.ts +3 -3
  154. package/dist/patterns/ai/browser.js +1 -1
  155. package/dist/patterns/ai/index.cjs +30 -44
  156. package/dist/patterns/ai/index.d.cts +13 -11
  157. package/dist/patterns/ai/index.d.ts +13 -11
  158. package/dist/patterns/ai/index.js +1 -1
  159. package/dist/patterns/ai/node.cjs +2 -2
  160. package/dist/patterns/ai/node.d.cts +5 -4
  161. package/dist/patterns/ai/node.d.ts +5 -4
  162. package/dist/patterns/ai/node.js +1 -1
  163. package/dist/patterns/audit/index.cjs +3 -3
  164. package/dist/patterns/audit/index.d.cts +3 -3
  165. package/dist/patterns/audit/index.d.ts +3 -3
  166. package/dist/patterns/audit/index.js +1 -1
  167. package/dist/patterns/cqrs/index.cjs +6 -6
  168. package/dist/patterns/cqrs/index.d.cts +2 -2
  169. package/dist/patterns/cqrs/index.d.ts +2 -2
  170. package/dist/patterns/cqrs/index.js +1 -1
  171. package/dist/patterns/demo-shell/index.cjs +2 -2
  172. package/dist/patterns/demo-shell/index.d.cts +3 -3
  173. package/dist/patterns/demo-shell/index.d.ts +3 -3
  174. package/dist/patterns/demo-shell/index.js +1 -1
  175. package/dist/patterns/domain-templates/index.cjs +6 -6
  176. package/dist/patterns/domain-templates/index.d.cts +2 -2
  177. package/dist/patterns/domain-templates/index.d.ts +2 -2
  178. package/dist/patterns/domain-templates/index.js +1 -1
  179. package/dist/patterns/graphspec/index.cjs +27 -25
  180. package/dist/patterns/graphspec/index.d.cts +3 -3
  181. package/dist/patterns/graphspec/index.d.ts +3 -3
  182. package/dist/patterns/graphspec/index.js +1 -1
  183. package/dist/patterns/guarded-execution/index.cjs +7 -7
  184. package/dist/patterns/guarded-execution/index.d.cts +4 -4
  185. package/dist/patterns/guarded-execution/index.d.ts +4 -4
  186. package/dist/patterns/guarded-execution/index.js +1 -1
  187. package/dist/patterns/harness/index.cjs +12 -11
  188. package/dist/patterns/harness/index.d.cts +6 -6
  189. package/dist/patterns/harness/index.d.ts +6 -6
  190. package/dist/patterns/harness/index.js +1 -1
  191. package/dist/patterns/job-queue/index.cjs +5 -5
  192. package/dist/patterns/job-queue/index.d.cts +2 -2
  193. package/dist/patterns/job-queue/index.d.ts +2 -2
  194. package/dist/patterns/job-queue/index.js +1 -1
  195. package/dist/patterns/lens/index.cjs +5 -5
  196. package/dist/patterns/lens/index.d.cts +4 -4
  197. package/dist/patterns/lens/index.d.ts +4 -4
  198. package/dist/patterns/lens/index.js +1 -1
  199. package/dist/patterns/memory/index.cjs +4 -4
  200. package/dist/patterns/memory/index.d.cts +2 -2
  201. package/dist/patterns/memory/index.d.ts +2 -2
  202. package/dist/patterns/memory/index.js +1 -1
  203. package/dist/patterns/messaging/index.cjs +5 -5
  204. package/dist/patterns/messaging/index.d.cts +2 -2
  205. package/dist/patterns/messaging/index.d.ts +2 -2
  206. package/dist/patterns/messaging/index.js +1 -1
  207. package/dist/patterns/orchestration/index.cjs +7 -7
  208. package/dist/patterns/orchestration/index.d.cts +2 -2
  209. package/dist/patterns/orchestration/index.d.ts +2 -2
  210. package/dist/patterns/orchestration/index.js +1 -1
  211. package/dist/patterns/reactive-layout/index.cjs +2 -2
  212. package/dist/patterns/reactive-layout/index.d.cts +3 -3
  213. package/dist/patterns/reactive-layout/index.d.ts +3 -3
  214. package/dist/patterns/reactive-layout/index.js +1 -1
  215. package/dist/patterns/reduction/index.cjs +5 -5
  216. package/dist/patterns/reduction/index.d.cts +2 -2
  217. package/dist/patterns/reduction/index.d.ts +2 -2
  218. package/dist/patterns/reduction/index.js +1 -1
  219. package/dist/patterns/refine-loop/index.cjs +8 -8
  220. package/dist/patterns/refine-loop/index.d.cts +3 -3
  221. package/dist/patterns/refine-loop/index.d.ts +3 -3
  222. package/dist/patterns/refine-loop/index.js +1 -1
  223. package/dist/patterns/resilient-pipeline/index.cjs +1 -1
  224. package/dist/patterns/resilient-pipeline/index.d.cts +3 -3
  225. package/dist/patterns/resilient-pipeline/index.d.ts +3 -3
  226. package/dist/patterns/resilient-pipeline/index.js +1 -1
  227. package/dist/patterns/surface/index.cjs +15 -13
  228. package/dist/patterns/surface/index.d.cts +4 -4
  229. package/dist/patterns/surface/index.d.ts +4 -4
  230. package/dist/patterns/surface/index.js +1 -1
  231. package/dist/{reactive-layout-BAr6-_o5.d.ts → reactive-layout-Bq0rA2Wb.d.ts} +1 -1
  232. package/dist/{reactive-layout-5oEn8lHM.d.cts → reactive-layout-Dhhe54Oj.d.cts} +1 -1
  233. package/dist/{reactive-map-BvDrRuwt.d.ts → reactive-map-CtRaCddO.d.ts} +59 -1
  234. package/dist/{reactive-map-CmlPPKHN.d.cts → reactive-map-IJIfZxoh.d.cts} +59 -1
  235. package/dist/{resilience-XRUF267O.js → resilience-IVNDYORD.js} +1 -1
  236. package/dist/{topology-tree-CVREibAc.d.cts → topology-tree-CpSjvIXp.d.cts} +1 -1
  237. package/dist/{topology-tree-CkjojcB6.d.ts → topology-tree-DAbCV2Yw.d.ts} +1 -1
  238. package/dist/{types-O3GzJY2U.d.cts → types-BgMqbc7N.d.cts} +41 -14
  239. package/dist/{types-u64Ose53.d.ts → types-CdfO2QTt.d.ts} +41 -14
  240. package/package.json +1 -1
  241. package/dist/chunk-2GQREQ6C.js +0 -1
  242. package/dist/chunk-4C2OR2GH.js +0 -18
  243. package/dist/chunk-5JDE5JHE.js +0 -1
  244. package/dist/chunk-7JDLFI6N.js +0 -1
  245. package/dist/chunk-AMBYCIOH.js +0 -3
  246. package/dist/chunk-GLSM33ZM.js +0 -78
  247. package/dist/chunk-ISCENNXS.js +0 -1
  248. package/dist/chunk-IUK4EFCE.js +0 -1
  249. package/dist/chunk-KASHOCF5.js +0 -1
  250. package/dist/chunk-LI3E75VE.js +0 -64
  251. package/dist/chunk-MGKAO4EK.js +0 -7
  252. package/dist/chunk-NSG4C6BF.js +0 -23
  253. package/dist/chunk-VIEUJSTT.js +0 -1
@@ -1,8 +1,8 @@
1
- export { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory } from '../../index-B8Aj_z8S.cjs';
2
- export { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot } from '../../index-ClB7TCfL.cjs';
1
+ export { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory } from '../../index-j33Lfb1G.cjs';
2
+ export { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot } from '../../index-DlGaEBW5.cjs';
3
3
  import '../../node-BVV7G1bq.cjs';
4
- import '../../graph-C4Uxwv0T.cjs';
4
+ import '../../graph-CdJeX7O7.cjs';
5
5
  import '../../meta-COtmHLwT.cjs';
6
6
  import '../../extra/storage-core.cjs';
7
- import '../../types-O3GzJY2U.cjs';
7
+ import '../../types-BgMqbc7N.cjs';
8
8
  import '../../extra/sources.cjs';
@@ -1,8 +1,8 @@
1
- export { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory } from '../../index-BXbQUn4n.js';
2
- export { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot } from '../../index-Cc8VQIgL.js';
1
+ export { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory } from '../../index-zMQIQuDu.js';
2
+ export { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot } from '../../index-Dxk-pUQI.js';
3
3
  import '../../node-BVV7G1bq.js';
4
- import '../../graph-CWeI0aHd.js';
4
+ import '../../graph-BOhEGJ6E.js';
5
5
  import '../../meta-BMwx3ExI.js';
6
6
  import '../../extra/storage-core.js';
7
- import '../../types-u64Ose53.js';
7
+ import '../../types-CdfO2QTt.js';
8
8
  import '../../extra/sources.js';
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"../../chunk-XQAXYVXX.js";import"../../chunk-GLSM33ZM.js";import"../../chunk-KA6MMXIY.js";import"../../chunk-5Z4HDCO6.js";import"../../chunk-MGKAO4EK.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-TWMEGG45.js";import"../../chunk-5JDE5JHE.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-2GQREQ6C.js";import"../../chunk-KASHOCF5.js";import"../../chunk-W4TSQ6RJ.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{e as SNAPSHOT_WIRE_VERSION,a as SurfaceError,b as asSurfaceError,c as createGraph,j as deleteSnapshot,h as diffSnapshots,i as listSnapshots,g as restoreSnapshot,d as runReduction,f as saveSnapshot};
1
+ import{a,b,c,d,e,f,g,h,i,j}from"../../chunk-7EMUF2RY.js";import"../../chunk-7JZ3YORY.js";import"../../chunk-WF3V5X2L.js";import"../../chunk-K54OKWNY.js";import"../../chunk-LWGLBCMU.js";import"../../chunk-4JBKKUCJ.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-N2KKISCE.js";import"../../chunk-WQ7I7JVU.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-UMH3HSP7.js";import"../../chunk-7AJKUA36.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{e as SNAPSHOT_WIRE_VERSION,a as SurfaceError,b as asSurfaceError,c as createGraph,j as deleteSnapshot,h as diffSnapshots,i as listSnapshots,g as restoreSnapshot,d as runReduction,f as saveSnapshot};
@@ -1,5 +1,5 @@
1
1
  import { a as Node } from './node-BVV7G1bq.js';
2
- import { G as Graph } from './graph-CWeI0aHd.js';
2
+ import { G as Graph } from './graph-BOhEGJ6E.js';
3
3
 
4
4
  /** Pluggable measurement backend. */
5
5
  interface MeasurementAdapter {
@@ -1,5 +1,5 @@
1
1
  import { a as Node } from './node-BVV7G1bq.cjs';
2
- import { G as Graph } from './graph-C4Uxwv0T.cjs';
2
+ import { G as Graph } from './graph-CdJeX7O7.cjs';
3
3
 
4
4
  /** Pluggable measurement backend. */
5
5
  interface MeasurementAdapter {
@@ -6,6 +6,10 @@ type ReactiveMapOptions<K, V> = {
6
6
  /**
7
7
  * LRU cap. When set, evicts least-recently-used keys after inserts that exceed this size.
8
8
  * Forwarded to the default `NativeMapBackend`. Ignored if a custom `backend` is provided.
9
+ *
10
+ * **Mutually exclusive with `retention`** — the LRU cap is "youngest-access wins,"
11
+ * score-based retention is "highest-score wins." Configuring both would make
12
+ * eviction nondeterministic; construction throws if both are set.
9
13
  */
10
14
  maxSize?: number;
11
15
  /**
@@ -24,7 +28,61 @@ type ReactiveMapOptions<K, V> = {
24
28
  * monotonic version counter, or `1` for V1 + content-addressed cid.
25
29
  */
26
30
  versioning?: VersioningLevel;
31
+ /**
32
+ * Score-based retention policy. After every mutation, each live entry is
33
+ * scored; entries below `archiveThreshold` and / or over `maxSize` (lowest-
34
+ * scored first) are archived via `onArchive` before being removed.
35
+ *
36
+ * Retention replaces the ad-hoc "tierClassifier effect writing back to its
37
+ * own store dep" pattern — the feedback cycle is gone because archival is
38
+ * part of the atomic mutation, not a second reactive wave.
39
+ *
40
+ * Mutually exclusive with top-level `maxSize` (LRU). Pass one or the other.
41
+ */
42
+ retention?: ReactiveMapRetention<K, V>;
27
43
  } & Omit<NodeOptions, "initial" | "describeKind" | "equals" | "versioning">;
44
+ /**
45
+ * Score-based retention policy for {@link reactiveMap}. Evaluated synchronously
46
+ * on every successful mutation (`set` / `setMany` / `delete` / `clear` /
47
+ * `pruneExpired`). Entries are archived in ascending score order until the
48
+ * map satisfies both constraints:
49
+ *
50
+ * 1. Every remaining entry has `score >= archiveThreshold` (if set).
51
+ * 2. Total entry count `<= maxSize` (if set).
52
+ *
53
+ * At least one of `archiveThreshold` / `maxSize` must be set; otherwise there's
54
+ * no eviction trigger.
55
+ *
56
+ * **Archival order.** When multiple entries are candidates for archival in the
57
+ * same mutation, they are archived in ascending score order (lowest first). On
58
+ * score ties, iteration order (insertion order in the default backend) is the
59
+ * tiebreak.
60
+ *
61
+ * **No recursion.** Archival deletes happen on the backend directly — they do
62
+ * NOT re-enter the retention evaluator. The one-pass scan collects archival
63
+ * candidates against the post-mutation snapshot before removing them.
64
+ *
65
+ * @category extra
66
+ */
67
+ type ReactiveMapRetention<K, V> = {
68
+ /** Score entry — higher is kept. Should be a pure function of `(key, value)`. */
69
+ score: (key: K, value: V) => number;
70
+ /** Below-threshold entries are archived. Omit for pure `maxSize`-based retention. */
71
+ archiveThreshold?: number;
72
+ /**
73
+ * Cap on live entry count. Over this, the lowest-scored entries are
74
+ * archived until the size fits. Omit for pure threshold-based retention.
75
+ */
76
+ maxSize?: number;
77
+ /**
78
+ * Synchronous callback fired **before** archival deletion. Receives the
79
+ * key, value, and computed score. Callers typically persist the entry to
80
+ * a cold tier here (`await permanent.set(key, value)` — async is fine but
81
+ * the archival deletion happens synchronously after this callback
82
+ * returns).
83
+ */
84
+ onArchive?: (key: K, value: V, score: number) => void;
85
+ };
28
86
  type ReactiveMapBundle<K, V> = {
29
87
  /** Emits `ReadonlyMap<K, V>` on each structural change (two-phase). */
30
88
  entries: Node<ReadonlyMap<K, V>>;
@@ -235,4 +293,4 @@ declare class NativeMapBackend<K, V> implements MapBackend<K, V> {
235
293
  */
236
294
  declare function reactiveMap<K, V>(options?: ReactiveMapOptions<K, V>): ReactiveMapBundle<K, V>;
237
295
 
238
- export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type ReactiveMapOptions as a, type NativeMapBackendOptions as b, reactiveMap as r };
296
+ export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type ReactiveMapOptions as a, type NativeMapBackendOptions as b, type ReactiveMapRetention as c, reactiveMap as r };
@@ -6,6 +6,10 @@ type ReactiveMapOptions<K, V> = {
6
6
  /**
7
7
  * LRU cap. When set, evicts least-recently-used keys after inserts that exceed this size.
8
8
  * Forwarded to the default `NativeMapBackend`. Ignored if a custom `backend` is provided.
9
+ *
10
+ * **Mutually exclusive with `retention`** — the LRU cap is "youngest-access wins,"
11
+ * score-based retention is "highest-score wins." Configuring both would make
12
+ * eviction nondeterministic; construction throws if both are set.
9
13
  */
10
14
  maxSize?: number;
11
15
  /**
@@ -24,7 +28,61 @@ type ReactiveMapOptions<K, V> = {
24
28
  * monotonic version counter, or `1` for V1 + content-addressed cid.
25
29
  */
26
30
  versioning?: VersioningLevel;
31
+ /**
32
+ * Score-based retention policy. After every mutation, each live entry is
33
+ * scored; entries below `archiveThreshold` and / or over `maxSize` (lowest-
34
+ * scored first) are archived via `onArchive` before being removed.
35
+ *
36
+ * Retention replaces the ad-hoc "tierClassifier effect writing back to its
37
+ * own store dep" pattern — the feedback cycle is gone because archival is
38
+ * part of the atomic mutation, not a second reactive wave.
39
+ *
40
+ * Mutually exclusive with top-level `maxSize` (LRU). Pass one or the other.
41
+ */
42
+ retention?: ReactiveMapRetention<K, V>;
27
43
  } & Omit<NodeOptions, "initial" | "describeKind" | "equals" | "versioning">;
44
+ /**
45
+ * Score-based retention policy for {@link reactiveMap}. Evaluated synchronously
46
+ * on every successful mutation (`set` / `setMany` / `delete` / `clear` /
47
+ * `pruneExpired`). Entries are archived in ascending score order until the
48
+ * map satisfies both constraints:
49
+ *
50
+ * 1. Every remaining entry has `score >= archiveThreshold` (if set).
51
+ * 2. Total entry count `<= maxSize` (if set).
52
+ *
53
+ * At least one of `archiveThreshold` / `maxSize` must be set; otherwise there's
54
+ * no eviction trigger.
55
+ *
56
+ * **Archival order.** When multiple entries are candidates for archival in the
57
+ * same mutation, they are archived in ascending score order (lowest first). On
58
+ * score ties, iteration order (insertion order in the default backend) is the
59
+ * tiebreak.
60
+ *
61
+ * **No recursion.** Archival deletes happen on the backend directly — they do
62
+ * NOT re-enter the retention evaluator. The one-pass scan collects archival
63
+ * candidates against the post-mutation snapshot before removing them.
64
+ *
65
+ * @category extra
66
+ */
67
+ type ReactiveMapRetention<K, V> = {
68
+ /** Score entry — higher is kept. Should be a pure function of `(key, value)`. */
69
+ score: (key: K, value: V) => number;
70
+ /** Below-threshold entries are archived. Omit for pure `maxSize`-based retention. */
71
+ archiveThreshold?: number;
72
+ /**
73
+ * Cap on live entry count. Over this, the lowest-scored entries are
74
+ * archived until the size fits. Omit for pure threshold-based retention.
75
+ */
76
+ maxSize?: number;
77
+ /**
78
+ * Synchronous callback fired **before** archival deletion. Receives the
79
+ * key, value, and computed score. Callers typically persist the entry to
80
+ * a cold tier here (`await permanent.set(key, value)` — async is fine but
81
+ * the archival deletion happens synchronously after this callback
82
+ * returns).
83
+ */
84
+ onArchive?: (key: K, value: V, score: number) => void;
85
+ };
28
86
  type ReactiveMapBundle<K, V> = {
29
87
  /** Emits `ReadonlyMap<K, V>` on each structural change (two-phase). */
30
88
  entries: Node<ReadonlyMap<K, V>>;
@@ -235,4 +293,4 @@ declare class NativeMapBackend<K, V> implements MapBackend<K, V> {
235
293
  */
236
294
  declare function reactiveMap<K, V>(options?: ReactiveMapOptions<K, V>): ReactiveMapBundle<K, V>;
237
295
 
238
- export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type ReactiveMapOptions as a, type NativeMapBackendOptions as b, reactiveMap as r };
296
+ export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type ReactiveMapOptions as a, type NativeMapBackendOptions as b, type ReactiveMapRetention as c, reactiveMap as r };
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-OL33ZI6R.js";import"./chunk-ESMPEKEV.js";import"./chunk-4VVTGLXJ.js";import"./chunk-KASHOCF5.js";import"./chunk-W4TSQ6RJ.js";import"./chunk-CK2E7BTU.js";import"./chunk-QYADASLV.js";export{c as CircuitOpenError,g as RateLimiterOverflowError,j as TimeoutError,d as circuitBreaker,k as fallback,h as rateLimiter,a as retry,b as retrySource,l as timeout,f as tokenBucket,e as withBreaker,i as withStatus};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-RWGJQQLT.js";import"./chunk-ESMPEKEV.js";import"./chunk-4VVTGLXJ.js";import"./chunk-UMH3HSP7.js";import"./chunk-7AJKUA36.js";import"./chunk-CK2E7BTU.js";import"./chunk-QYADASLV.js";export{c as CircuitOpenError,g as RateLimiterOverflowError,j as TimeoutError,d as circuitBreaker,k as fallback,h as rateLimiter,a as retry,b as retrySource,l as timeout,f as tokenBucket,e as withBreaker,i as withStatus};
@@ -1,4 +1,4 @@
1
- import { G as Graph, T as TopologyEvent } from './graph-C4Uxwv0T.cjs';
1
+ import { G as Graph, T as TopologyEvent } from './graph-CdJeX7O7.cjs';
2
2
 
3
3
  /**
4
4
  * Subscribe to structural changes across `graph` and every transitively
@@ -1,4 +1,4 @@
1
- import { G as Graph, T as TopologyEvent } from './graph-CWeI0aHd.js';
1
+ import { G as Graph, T as TopologyEvent } from './graph-BOhEGJ6E.js';
2
2
 
3
3
  /**
4
4
  * Subscribe to structural changes across `graph` and every transitively
@@ -1,18 +1,6 @@
1
+ import { a as Node } from './node-BVV7G1bq.cjs';
1
2
  import { NodeInput } from './extra/sources.cjs';
2
3
 
3
- /**
4
- * Pluggable pricing for LLM adapters.
5
- *
6
- * The library ships the **shape** (types + computation helpers + registry
7
- * factory) and **zero model data**. Users populate a `PricingRegistry` with
8
- * the prices for the models they use — either by hand, from a curated table,
9
- * or by importing a third-party dataset (litellm JSON, etc.).
10
- *
11
- * Pricing is a pure function of raw `TokenUsage`. The library does not
12
- * know current prices, regional rates, tier thresholds, or promotional
13
- * discounts — those are all user domain.
14
- */
15
-
16
4
  /**
17
5
  * A rate per 1M tokens. Supports threshold-based tiering (Anthropic
18
6
  * long-context >200K, Gemini >200K) via optional `thresholdTokens` +
@@ -132,6 +120,33 @@ declare function createPricingRegistry(initial?: ReadonlyArray<readonly [provide
132
120
  declare function registryPricing(registry: PricingRegistry, defaultCurrency?: string): PricingFn;
133
121
  /** Compose multiple `PricingFn`s — first non-zero wins. Useful for registry layering. */
134
122
  declare function composePricing(...fns: readonly PricingFn[]): PricingFn;
123
+ /**
124
+ * Convenience: compute a {@link PriceBreakdown} directly from a
125
+ * {@link import("./capabilities.js").ModelCapabilities} object + usage.
126
+ *
127
+ * When callers look up capabilities themselves (via
128
+ * `capabilitiesRegistry.lookup(...)` or `adapter.capabilities?.(model)`),
129
+ * this helper skips the pricing-registry round-trip and computes the price
130
+ * from `capabilities.pricing` directly.
131
+ *
132
+ * Returns `zeroPrice()` when `capabilities.pricing` is undefined — never throws.
133
+ *
134
+ * @param capabilities - Model capabilities object (`capabilities.pricing` may be absent).
135
+ * @param usage - Per-call usage to price.
136
+ * @param opts - Pass-through to {@link computePrice}.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * const cap = registry.lookup("anthropic", "claude-sonnet-4-6");
141
+ * const price = pricingFor(cap, resp.usage, { tier: "batch", withBreakdown: true });
142
+ * ```
143
+ *
144
+ * @category ai
145
+ */
146
+ declare function pricingFor(capabilities: ModelCapabilities | undefined, usage: TokenUsage, opts?: {
147
+ tier?: string;
148
+ withBreakdown?: boolean;
149
+ }): PriceBreakdown;
135
150
 
136
151
  /**
137
152
  * Pluggable model capabilities (roadmap §9.3d).
@@ -199,6 +214,18 @@ interface CapabilitiesRegistry {
199
214
  register(cap: ModelCapabilities): void;
200
215
  remove(provider: string, model: string): boolean;
201
216
  entries(): IterableIterator<ModelCapabilities>;
217
+ /**
218
+ * Reactive view of `(provider, model)` → `ModelCapabilities`. Re-emits
219
+ * whenever any `register()` / `remove()` touches the underlying store, so
220
+ * UIs and gated middleware (capability-aware retry, feature flags) can
221
+ * subscribe instead of polling. Prefix fallback mirrors the imperative
222
+ * `lookup()`: exact match first, then longest-prefix within provider.
223
+ */
224
+ lookupNode(provider: string, model: string): Node<ModelCapabilities | undefined>;
225
+ /** Reactive view of every registered entry. */
226
+ readonly entriesNode: Node<readonly ModelCapabilities[]>;
227
+ /** Reactive slice of entries for a single provider. */
228
+ byProvider(provider: string): Node<readonly ModelCapabilities[]>;
202
229
  }
203
230
  /** Create a fresh `CapabilitiesRegistry`. Optionally seed with entries. */
204
231
  declare function createCapabilitiesRegistry(initial?: readonly ModelCapabilities[]): CapabilitiesRegistry;
@@ -398,4 +425,4 @@ interface LLMAdapter {
398
425
  capabilities?(model?: string): ModelCapabilities | undefined;
399
426
  }
400
427
 
401
- export { type ChatMessage as C, type LLMAdapter as L, type ModelCapabilities as M, type PricingFn as P, type Rate as R, type StreamDelta as S, type TokenUsage as T, type LLMInvokeOptions as a, type LLMResponse as b, type ToolCall as c, type ToolDefinition as d, type CapabilitiesRegistry as e, type ModelFeatures as f, type ModelLimits as g, type ModelPricing as h, type PriceBreakdown as i, type PricingRegistry as j, type TieredRate as k, composePricing as l, computePrice as m, createCapabilitiesRegistry as n, createPricingRegistry as o, registryPricing as r, zeroPrice as z };
428
+ export { type ChatMessage as C, type LLMAdapter as L, type ModelCapabilities as M, type PricingFn as P, type Rate as R, type StreamDelta as S, type TokenUsage as T, type LLMInvokeOptions as a, type LLMResponse as b, type ToolCall as c, type ToolDefinition as d, type CapabilitiesRegistry as e, type ModelFeatures as f, type ModelLimits as g, type ModelPricing as h, type PriceBreakdown as i, type PricingRegistry as j, type TieredRate as k, composePricing as l, computePrice as m, createCapabilitiesRegistry as n, createPricingRegistry as o, pricingFor as p, registryPricing as r, zeroPrice as z };
@@ -1,18 +1,6 @@
1
+ import { a as Node } from './node-BVV7G1bq.js';
1
2
  import { NodeInput } from './extra/sources.js';
2
3
 
3
- /**
4
- * Pluggable pricing for LLM adapters.
5
- *
6
- * The library ships the **shape** (types + computation helpers + registry
7
- * factory) and **zero model data**. Users populate a `PricingRegistry` with
8
- * the prices for the models they use — either by hand, from a curated table,
9
- * or by importing a third-party dataset (litellm JSON, etc.).
10
- *
11
- * Pricing is a pure function of raw `TokenUsage`. The library does not
12
- * know current prices, regional rates, tier thresholds, or promotional
13
- * discounts — those are all user domain.
14
- */
15
-
16
4
  /**
17
5
  * A rate per 1M tokens. Supports threshold-based tiering (Anthropic
18
6
  * long-context >200K, Gemini >200K) via optional `thresholdTokens` +
@@ -132,6 +120,33 @@ declare function createPricingRegistry(initial?: ReadonlyArray<readonly [provide
132
120
  declare function registryPricing(registry: PricingRegistry, defaultCurrency?: string): PricingFn;
133
121
  /** Compose multiple `PricingFn`s — first non-zero wins. Useful for registry layering. */
134
122
  declare function composePricing(...fns: readonly PricingFn[]): PricingFn;
123
+ /**
124
+ * Convenience: compute a {@link PriceBreakdown} directly from a
125
+ * {@link import("./capabilities.js").ModelCapabilities} object + usage.
126
+ *
127
+ * When callers look up capabilities themselves (via
128
+ * `capabilitiesRegistry.lookup(...)` or `adapter.capabilities?.(model)`),
129
+ * this helper skips the pricing-registry round-trip and computes the price
130
+ * from `capabilities.pricing` directly.
131
+ *
132
+ * Returns `zeroPrice()` when `capabilities.pricing` is undefined — never throws.
133
+ *
134
+ * @param capabilities - Model capabilities object (`capabilities.pricing` may be absent).
135
+ * @param usage - Per-call usage to price.
136
+ * @param opts - Pass-through to {@link computePrice}.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * const cap = registry.lookup("anthropic", "claude-sonnet-4-6");
141
+ * const price = pricingFor(cap, resp.usage, { tier: "batch", withBreakdown: true });
142
+ * ```
143
+ *
144
+ * @category ai
145
+ */
146
+ declare function pricingFor(capabilities: ModelCapabilities | undefined, usage: TokenUsage, opts?: {
147
+ tier?: string;
148
+ withBreakdown?: boolean;
149
+ }): PriceBreakdown;
135
150
 
136
151
  /**
137
152
  * Pluggable model capabilities (roadmap §9.3d).
@@ -199,6 +214,18 @@ interface CapabilitiesRegistry {
199
214
  register(cap: ModelCapabilities): void;
200
215
  remove(provider: string, model: string): boolean;
201
216
  entries(): IterableIterator<ModelCapabilities>;
217
+ /**
218
+ * Reactive view of `(provider, model)` → `ModelCapabilities`. Re-emits
219
+ * whenever any `register()` / `remove()` touches the underlying store, so
220
+ * UIs and gated middleware (capability-aware retry, feature flags) can
221
+ * subscribe instead of polling. Prefix fallback mirrors the imperative
222
+ * `lookup()`: exact match first, then longest-prefix within provider.
223
+ */
224
+ lookupNode(provider: string, model: string): Node<ModelCapabilities | undefined>;
225
+ /** Reactive view of every registered entry. */
226
+ readonly entriesNode: Node<readonly ModelCapabilities[]>;
227
+ /** Reactive slice of entries for a single provider. */
228
+ byProvider(provider: string): Node<readonly ModelCapabilities[]>;
202
229
  }
203
230
  /** Create a fresh `CapabilitiesRegistry`. Optionally seed with entries. */
204
231
  declare function createCapabilitiesRegistry(initial?: readonly ModelCapabilities[]): CapabilitiesRegistry;
@@ -398,4 +425,4 @@ interface LLMAdapter {
398
425
  capabilities?(model?: string): ModelCapabilities | undefined;
399
426
  }
400
427
 
401
- export { type ChatMessage as C, type LLMAdapter as L, type ModelCapabilities as M, type PricingFn as P, type Rate as R, type StreamDelta as S, type TokenUsage as T, type LLMInvokeOptions as a, type LLMResponse as b, type ToolCall as c, type ToolDefinition as d, type CapabilitiesRegistry as e, type ModelFeatures as f, type ModelLimits as g, type ModelPricing as h, type PriceBreakdown as i, type PricingRegistry as j, type TieredRate as k, composePricing as l, computePrice as m, createCapabilitiesRegistry as n, createPricingRegistry as o, registryPricing as r, zeroPrice as z };
428
+ export { type ChatMessage as C, type LLMAdapter as L, type ModelCapabilities as M, type PricingFn as P, type Rate as R, type StreamDelta as S, type TokenUsage as T, type LLMInvokeOptions as a, type LLMResponse as b, type ToolCall as c, type ToolDefinition as d, type CapabilitiesRegistry as e, type ModelFeatures as f, type ModelLimits as g, type ModelPricing as h, type PriceBreakdown as i, type PricingRegistry as j, type TieredRate as k, composePricing as l, computePrice as m, createCapabilitiesRegistry as n, createPricingRegistry as o, pricingFor as p, registryPricing as r, zeroPrice as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphrefly/graphrefly",
3
- "version": "0.30.0",
3
+ "version": "0.32.0",
4
4
  "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319",
5
5
  "description": "Reactive harness layer for agent workflows. Describe automations in plain language, trace every decision, enforce policies, persist checkpoints. Zero dependencies.",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{E as c,m,o as u}from"./chunk-W4TSQ6RJ.js";import{b as f,c as h}from"./chunk-CK2E7BTU.js";var p=class{_version=0;_store=new Map;_maxSize;_defaultTtl;constructor(t={}){let{maxSize:e,defaultTtl:i}=t;if(e!==void 0&&e<1)throw new RangeError("maxSize must be >= 1");if(i!==void 0&&i<=0)throw new RangeError("defaultTtl must be positive");this._maxSize=e,this._defaultTtl=i}get version(){return this._version}get size(){return this._store.size}has(t){let e=this._store.get(t);return e===void 0?!1:this._isExpired(e)?(this._store.delete(t),this._version+=1,!1):(this._touchLru(t,e),!0)}get(t){let e=this._store.get(t);if(e!==void 0){if(this._isExpired(e)){this._store.delete(t),this._version+=1;return}return this._touchLru(t,e),e.value}}set(t,e,i){let s=this._resolveExpiresAt(i);this._store.has(t)&&this._store.delete(t),this._store.set(t,{value:e,expiresAt:s}),this._evictLruWhileOver(),this._version+=1}setMany(t,e){let i=this._resolveExpiresAt(e),s=0;try{for(let[d,n]of t)this._store.has(d)&&this._store.delete(d),this._store.set(d,{value:n,expiresAt:i}),s+=1}finally{s>0&&(this._evictLruWhileOver(),this._version+=1)}}delete(t){let e=this._store.delete(t);return e&&(this._version+=1),e}deleteMany(t){let e=0;try{for(let i of t)this._store.delete(i)&&(e+=1)}finally{e>0&&(this._version+=1)}return e}clear(){let t=this._store.size;return t===0?0:(this._store.clear(),this._version+=1,t)}pruneExpired(){let t=u(),e=0;for(let[i,s]of this._store)this._isExpired(s,t)&&(this._store.delete(i),e+=1);return e>0&&(this._version+=1),e}toMap(){let t=u(),e=new Map;for(let[i,s]of this._store)this._isExpired(s,t)||e.set(i,s.value);return e}_resolveExpiresAt(t){let e=t??this._defaultTtl;if(e!==void 0){if(!Number.isFinite(e)||e<=0)throw new RangeError(`MapBackend: ttl must be a positive finite number (got ${e})`);return u()+e*1e9}}_isExpired(t,e){return t.expiresAt===void 0?!1:(e??u())>=t.expiresAt}_touchLru(t,e){this._store.delete(t),this._store.set(t,e)}_evictLruWhileOver(){if(this._maxSize!==void 0)for(;this._store.size>this._maxSize;){let t=this._store.keys().next().value;if(t===void 0)break;this._store.delete(t)}}};function x(v={}){let{name:t,maxSize:e,defaultTtl:i,versioning:s,backend:d}=v,n=d??new p({maxSize:e,defaultTtl:i}),l=c(n.toMap(),{name:t,describeKind:"state",equals:(r,a)=>r===a,...s!=null?{versioning:s}:{}});function _(){let r=n.toMap();m(()=>{l.down([[h]]),l.down([[f,r]])})}function o(r){let a=n.version;try{return r()}finally{n.version!==a&&_()}}return{entries:l,has(r){return o(()=>n.has(r))},get(r){return o(()=>n.get(r))},set(r,a,b){o(()=>n.set(r,a,b?.ttl))},setMany(r,a){o(()=>n.setMany(r,a?.ttl))},delete(r){o(()=>n.delete(r))},deleteMany(r){o(()=>n.deleteMany(r))},clear(){o(()=>n.clear())},pruneExpired(){o(()=>n.pruneExpired())},get size(){return n.size},dispose(){}}}export{p as a,x as b};
@@ -1,18 +0,0 @@
1
- import{a as an}from"./chunk-GJR3P6JG.js";import{a as Qt,b as Jt}from"./chunk-IUK4EFCE.js";import{a as $e,b as we,c as _e,d as Qe,e as Je,f as Ye,g as Ge,h as Xe,i as Se,j as Ze,k as er,l as rr}from"./chunk-OL33ZI6R.js";import{a as en,b as rn}from"./chunk-ISCENNXS.js";import{a as wr,b as tt}from"./chunk-5QDBSZBV.js";import{a as tr}from"./chunk-MGKAO4EK.js";import{a as Ve}from"./chunk-ESMPEKEV.js";import{a as tn,b as nn,c as on,d as sn}from"./chunk-I6VIH3VA.js";import{A as Nt,B as Ot,C as Rt,D as Mt,E as Pt,G as Ct,H as Lt,I as At,J as Bt,K as It,L as Ft,M as Wt,N as zt,O as Ht,P as Ut,Q as Kt,R as jt,S as Dt,T as qt,U as Vt,a as xe,b as Ie,c as st,d as it,e as at,f as ct,g as ut,h as dt,i as Fe,j as lt,k as pt,l as ft,m as mt,n as gt,o as Tt,p as yt,q as kt,r as We,s as bt,t as ht,u as vt,v as ge,w as wt,x as St,y as xt,z as Et}from"./chunk-5JDE5JHE.js";import{a as ne,b as ve,c as Er,d as Nr,e as Or,f as Rr,g as Mr,h as Pr,i as Be}from"./chunk-4VVTGLXJ.js";import{a as Yt,b as Gt}from"./chunk-567NWZ3T.js";import{a as Xt,b as Zt}from"./chunk-SLMYTGTU.js";import{a as $t,b as _t}from"./chunk-2GQREQ6C.js";import{a as nt,b as ot}from"./chunk-AUY2YKCO.js";import{A as et,B as rt,a as Sr,b as xr,c as Cr,d as Lr,e as Ar,f as oe,g as Br,h as Ir,i as Fr,j as Wr,k as zr,l as Hr,m as Ur,n as Kr,o as jr,p as Dr,q as qr,r as Vr,s as $r,t as _r,u as Qr,v as Jr,w as Yr,x as Gr,y as Xr,z as Zr}from"./chunk-KASHOCF5.js";import{A as G,D as re,E as B,F as W,H as he,m as j,p as V}from"./chunk-W4TSQ6RJ.js";import{b as x,c as Me,d as Pe,e as Ce,f as Le,g as Ae,h as q,i as C,j as E}from"./chunk-CK2E7BTU.js";import{b as vr}from"./chunk-QYADASLV.js";var lo={};vr(lo,{CircuitOpenError:()=>_e,NS_PER_MS:()=>ne,NS_PER_SEC:()=>ve,NativeIndexBackend:()=>Yt,NativeListBackend:()=>Xt,NativeLogBackend:()=>nt,NativeMapBackend:()=>$t,NativePubSubBackend:()=>Ee,RateLimiterOverflowError:()=>Ge,ResettableTimer:()=>Ve,TimeoutError:()=>Ze,audit:()=>Pt,awaitSettled:()=>Xr,buffer:()=>Ct,bufferCount:()=>Lt,bufferTime:()=>Bt,cached:()=>Jr,cascadingCache:()=>oo,catchError:()=>Vt,checkpointToRedis:()=>Gn,checkpointToS3:()=>Yn,circuitBreaker:()=>Qe,combine:()=>yt,combineLatest:()=>jt,concat:()=>ht,concatMap:()=>St,constant:()=>Er,createTransport:()=>ie,createWatermarkController:()=>tt,csvRows:()=>An,debounce:()=>Ot,debounceTime:()=>Dt,decorrelatedJitter:()=>Mr,delay:()=>Nt,deserializeError:()=>pe,dictStorage:()=>sn,distill:()=>Jt,distinctUntilChanged:()=>gt,elementAt:()=>ft,empty:()=>jr,escapeRegexChar:()=>Cr,exhaustMap:()=>wt,exponential:()=>Or,externalBundle:()=>ze,externalProducer:()=>ae,fallback:()=>er,fibonacci:()=>Rr,filter:()=>Ie,find:()=>pt,first:()=>Fe,firstValueFrom:()=>Yr,firstWhere:()=>Gr,flatMap:()=>Et,forEach:()=>Vr,fromAny:()=>Ur,fromAsyncIter:()=>Hr,fromCSV:()=>Ln,fromClickHouseWatch:()=>Fn,fromCron:()=>Ir,fromDrizzle:()=>to,fromEvent:()=>Fr,fromHTTP:()=>sr,fromHTTPPoll:()=>Tn,fromHTTPStream:()=>gn,fromIter:()=>Wr,fromKafka:()=>Rn,fromKysely:()=>no,fromMCP:()=>bn,fromNATS:()=>Hn,fromNDJSON:()=>In,fromOTel:()=>hn,fromPrisma:()=>ro,fromPrometheus:()=>Nn,fromPromise:()=>zr,fromPulsar:()=>Wn,fromRabbitMQ:()=>Kn,fromRaf:()=>Br,fromRedisStream:()=>Pn,fromSSE:()=>mn,fromSqlite:()=>Xn,fromSqliteCursor:()=>Zn,fromStatsD:()=>Sn,fromSyslog:()=>vn,fromTimer:()=>oe,fromWebSocket:()=>or,fromWebSocketReconnect:()=>kn,fromWebhook:()=>un,globToRegExp:()=>Lr,interval:()=>Wt,keepalive:()=>et,last:()=>lt,linear:()=>Nr,lru:()=>lr,map:()=>xe,matchesAnyPattern:()=>Ar,matchesCron:()=>xr,memoryStorage:()=>on,merge:()=>We,mergeMap:()=>xt,nameToSignal:()=>de,ndjsonRows:()=>Bn,never:()=>Dr,of:()=>Kr,pairwise:()=>Tt,parseCron:()=>Sr,parsePrometheusText:()=>cr,parseStatsD:()=>En,parseSyslog:()=>wn,pausable:()=>Ht,pubsub:()=>so,race:()=>vt,rateLimiter:()=>Xe,reactiveCounter:()=>rt,reactiveIndex:()=>Gt,reactiveList:()=>Zt,reactiveLog:()=>ot,reactiveMap:()=>_t,reactiveSink:()=>U,reduce:()=>it,repeat:()=>zt,replay:()=>Qr,rescue:()=>Ut,resolveBackoffPreset:()=>Be,retry:()=>$e,retrySource:()=>we,sample:()=>Mt,scan:()=>st,serializeError:()=>le,share:()=>_r,shareReplay:()=>Zr,signalToName:()=>se,singleFromAny:()=>en,singleNodeFromAny:()=>rn,skip:()=>ct,sortJsonValue:()=>tn,stableJsonString:()=>nn,stratify:()=>an,switchMap:()=>ge,take:()=>at,takeUntil:()=>dt,takeWhile:()=>ut,tap:()=>mt,throttle:()=>Rt,throttleTime:()=>qt,throwError:()=>qr,timeout:()=>rr,toArray:()=>$r,toCSV:()=>Dn,toClickHouse:()=>qn,toFile:()=>dr,toHTTP:()=>dn,toKafka:()=>Mn,toLoki:()=>Qn,toMongo:()=>_n,toNATS:()=>Un,toObservable:()=>wr,toPostgres:()=>$n,toPulsar:()=>zn,toRabbitMQ:()=>jn,toReadableStream:()=>fn,toRedisStream:()=>Cn,toS3:()=>Vn,toSSE:()=>ln,toSSEBytes:()=>pn,toSqlite:()=>eo,toTempo:()=>Jn,toWebSocket:()=>yn,tokenBucket:()=>Ye,valve:()=>Kt,verifiable:()=>Qt,window:()=>Ft,windowCount:()=>At,windowTime:()=>It,withBreaker:()=>Je,withLatestFrom:()=>kt,withMaxAttempts:()=>Pr,withStatus:()=>Se,workerBridge:()=>fr,workerSelf:()=>mr,zip:()=>bt});function nr(e){return{describeKind:"producer",...e}}function ae(e,t){return W(n=>{let a=!0,c={emit(o){a&&n.emit(o)},error(o){a&&(a=!1,n.down([[E,o]]))},complete(){a&&(a=!1,n.down([[C]]))}},r;try{let o=e(c);r=typeof o=="function"?o:void 0}catch(o){return c.error(o),()=>{a=!1}}return()=>{a=!1;try{r?.()}catch{}}},nr(t))}function ze(e,t,n){let a=!0,c,r=0,o=0,s={},d=[],i=()=>{let l=c;c=void 0;try{l?.()}catch{}};for(let l of t){let m=n?.name?`${n.name}::${l}`:l,h=n?.channelOpts?.[l],b=W(g=>(r++,()=>{o++,r>0&&o>=r&&o>=t.length&&i()}),nr({...h,name:m}));s[l]=b,d.push(b)}let f={};for(let l of t)f[l]=m=>{a&&s[l].down([[x,m]])};f.error=l=>{a&&(a=!1,j(()=>{for(let m of d)m.down([[E,l]])}),i())},f.complete=()=>{a&&(a=!1,j(()=>{for(let l of d)l.down([[C]])}),i())};let p=e(f);return c=typeof p=="function"?p:void 0,Object.assign(s,{dispose:()=>{a&&(a=!1,j(()=>{for(let l of d)try{l.down([[C]])}catch{}}),i())}})}var He=class{ring;arr;constructor(t){t===Number.POSITIVE_INFINITY||t<=0?(this.arr=[],this.ring=null):(this.ring=new tr(t),this.arr=null)}get length(){return this.ring!=null?this.ring.size:this.arr.length}push(t){this.ring!=null?this.ring.push(t):this.arr.push(t)}shift(){return this.ring!=null?this.ring.shift():this.arr.shift()}drain(){if(this.ring!=null){let n=this.ring.toArray();return this.ring.clear(),n}let t=this.arr;return this.arr=[],t}};function Te(e){return e instanceof Error?e:new Error(String(e))}function cn(e){return e===void 0?null:typeof e=="string"?Be(e):e}function U(e,t){let{name:n,onTransportError:a,retry:c,backpressure:r,batchSize:o=Number.POSITIVE_INFINITY,flushIntervalMs:s=0,serialize:d,stopOn:i,onUpstreamMessage:f,onDispose:p,send:u,sendBatch:l,ctx:m}=t;if(!u&&!l)throw new Error("reactiveSink: `send` or `sendBatch` must be provided");let h=m,b=Math.max(1,c?.maxAttempts??1),g=cn(c?.backoff??(b>1?"exponential":void 0)),T=c?.shouldRetry??(()=>!0),y=l!==void 0||o<Number.POSITIVE_INFINITY||s>0,k=S=>n?`${n}::${S}`:void 0,v=B(void 0,{equals:()=>!1,name:k("sent")}),w=B(null,{name:k("failed")}),N=B(0,{name:k("inFlight")}),O=B(null,{name:k("errors")}),H=y?B(0,{name:k("buffered")}):void 0,z=r?B(!1,{name:k("paused")}):void 0,J=0,Y=S=>{J+=S,N.down([[x,J]])},R=S=>{try{a?.(S)}catch{}try{O.down([[x,S]])}catch{}},D=new Set,X=S=>{D.add(S);let M=()=>D.delete(S);S.then(M,M)},F=(S,M,L)=>{let I=g?g(M-1,L,null):0,K=I==null?0:typeof I=="number"&&I>0?I:0,_=Math.max(1,Math.ceil(K/1e6));return new Promise(A=>{setTimeout(()=>A(S()),_)})},$=S=>S!=null&&typeof S=="object"&&typeof S.then=="function",Z=S=>{let M;try{M=d?d(S):S}catch(A){let P=Te(A);return R({stage:"serialize",error:P,value:S}),w.down([[x,{value:S,error:P,attempts:0}]]),Promise.resolve()}let L=0,I=A=>{Y(-1);let P=Te(A);if(R({stage:"send",error:P,value:S,attempt:L}),!(L<b&&T(P,L))){w.down([[x,{value:S,error:P,attempts:L}]]);return}return F(_,L,P)},K=()=>{Y(-1),v.down([[x,S]])};function _(){L+=1,Y(1);let A;try{A=u(M,h)}catch(P){return I(P)??Promise.resolve()}return $(A)?A.then(K,P=>I(P)):(K(),Promise.resolve())}return _()},fe=r?.maxBuffer??Number.POSITIVE_INFINITY,te=new He(fe),ee,ye=!1,Ne=()=>{H?.down([[x,te.length]])},ke=S=>{z&&z.down([[x,S]])},Ke=r?.strategy??"drop-oldest",gr=(S,M)=>{let L={value:S,payload:M};if(te.length<fe)return te.push(L),Ne(),!0;if(Ke==="drop-oldest"){let K=te.shift();return te.push(L),Ne(),ke(!0),w.down([[x,{value:K.value,error:new Error("backpressure: buffer overflow \u2014 dropped oldest"),attempts:0}]]),!0}if(Ke==="drop-newest")return ke(!0),w.down([[x,{value:S,error:new Error("backpressure: buffer overflow \u2014 dropped newest"),attempts:0}]]),!1;let I=new Error("backpressure: buffer overflow");return R({stage:"send",error:I,value:S}),w.down([[x,{value:S,error:I,attempts:0}]]),ke(!0),!1},Tr=S=>{let M=0,L=S.map(A=>A.payload),I=A=>{Y(-1);let P=Te(A);if(R({stage:"send",error:P,value:S.map(Re=>Re.value),attempt:M}),!(M<b&&T(P,M))){for(let{value:Re}of S)w.down([[x,{value:Re,error:P,attempts:M}]]);return}return F(_,M,P)},K=()=>{Y(-1);for(let{value:A}of S)v.down([[x,A]])};function _(){M+=1,Y(1);let A;try{A=l(L,h)}catch(P){return I(P)??Promise.resolve()}return $(A)?A.then(K,P=>I(P)):(K(),Promise.resolve())}return _()},yr=async S=>{for(let M of S)await kr(M.value,M.payload)},kr=(S,M)=>{let L=0,I=A=>{Y(-1);let P=Te(A);if(R({stage:"send",error:P,value:S,attempt:L}),!(L<b&&T(P,L))){w.down([[x,{value:S,error:P,attempts:L}]]);return}return F(_,L,P)},K=()=>{Y(-1),v.down([[x,S]])};function _(){L+=1,Y(1);let A;try{A=u(M,h)}catch(P){return I(P)??Promise.resolve()}return $(A)?A.then(K,P=>I(P)):(K(),Promise.resolve())}return _()},me=()=>{if(ye||te.length===0)return Promise.resolve();let S=te.drain();if(Ne(),ke(!1),l!==void 0){let L=Tr(S);return X(L),L}let M=yr(S);return X(M),M},br=()=>{ee!==void 0||ye||s<=0||(ee=setTimeout(()=>{ee=void 0,me()},s))},hr=e.subscribe(S=>{for(let M of S){let L=M[0];if(L!==x)try{f?.(M)}catch{}if(L===x){let I=M[1];if(y){let K;if(d)try{K=d(I)}catch(A){let P=Te(A);R({stage:"serialize",error:P,value:I}),w.down([[x,{value:I,error:P,attempts:0}]]);continue}else K=I;if(!gr(I,K))continue;te.length>=o?me():br()}else{let K=Z(I);X(K)}}else G.messageTier(L)>=3&&y&&(ee!==void 0&&(clearTimeout(ee),ee=void 0),me())}}),je;if(i){let S=!1;je=i.subscribe(M=>{if(!S){S=!0;return}M.length>0&&!Oe&&De()})}let Oe=!1,De=()=>{if(Oe)return;Oe=!0,ee!==void 0&&(clearTimeout(ee),ee=void 0),y&&me(),ye=!0,je?.(),hr();let S=M=>{try{M.down([[q]])}catch{}};S(O),S(w),S(v),S(N),H&&S(H),z&&S(z);try{p?.()}catch{}},be={dispose:De,sent:v,failed:w,inFlight:N,errors:O};return y&&(be.buffered=H,be.flush=async()=>{ye||(await me(),await Promise.all(D))}),z&&(be.paused=z),be}function Q(e){return{describeKind:"producer",...e}}function or(e,t){let{parse:n,closeOnTeardown:a=!1,...c}=t??{};return W(r=>{let o=!0,s,d=()=>{let g=s;s=void 0,g?.()},i=g=>{o&&(o=!1,r.down([g]),d())},f=(g,T=g)=>{if(o)try{let y=g!==null&&typeof g=="object"&&"data"in g?g.data:g,k=n?n(y,T):y;r.emit(k)}catch(y){i([E,y])}},p=g=>{i([E,g])},u=()=>{i([C])};if(typeof e=="function"){try{if(s=e(f,p,u),typeof s!="function")throw new Error("fromWebSocket register contract violation: register must return cleanup callable")}catch(g){i([E,g])}return()=>{o=!1,d()}}let l=e,m=g=>f(g,g),h=g=>p(g),b=()=>u();return l.addEventListener("message",m),l.addEventListener("error",h),l.addEventListener("close",b),s=()=>{l.removeEventListener("message",m),l.removeEventListener("error",h),l.removeEventListener("close",b),a&&l.close()},()=>{o=!1,d()}},Q(c))}function un(e,t){return ae(e,t)}function sr(e,t){let{method:n="GET",headers:a,body:c,transform:r=y=>y.json(),timeoutNs:o=30*1e9,signal:s,completeAfterFetch:d=!1,refetchOnSubscribe:i=!1,...f}=t??{},p=B(0,{name:`${f.name??"http"}/fetchCount`}),u=B(0,{name:`${f.name??"http"}/lastUpdated`}),l=B(!1,{name:`${f.name??"http"}/fetched`}),m=0,h=c!==void 0?typeof c=="string"?c:JSON.stringify(c):void 0,b=y=>{let k=new AbortController,v=!0;if(s?.aborted)return v=!1,y.down([[E,s.reason??new Error("Aborted")]]),()=>{};s?.addEventListener("abort",()=>k.abort(s.reason),{once:!0});let w=setTimeout(()=>k.abort(new Error("Request timeout")),Math.ceil(o/1e6));return fetch(e,{method:n,headers:a,body:h,signal:k.signal}).then(async N=>{if(clearTimeout(w),!v)return;if(!N.ok)throw new Error(`HTTP ${N.status}: ${N.statusText}`);let O=await r(N);v&&(j(()=>{m+=1,p.down([[x,m]]),u.down([[x,V()]]),l.down([[x,!0]]),y.emit(O)}),d&&y.down([[C]]))}).catch(N=>{clearTimeout(w),v&&(N&&N.name==="AbortError"||y.down([[E,N]]))}),()=>{v=!1,k.abort()}},g=W(y=>b({emit:k=>y.emit(k),down:k=>y.down(k)}),{...Q(f),resubscribable:i});return{...Se(g),fetchCount:p,lastUpdated:u,fetched:l}}function dn(e,t,n){let{method:a="POST",headers:c={"Content-Type":"application/json"},serialize:r=m=>JSON.stringify(m),timeoutNs:o,batchFormat:s="json-array",batchSize:d,flushIntervalMs:i,retry:f,onTransportError:p}=n??{},u=async m=>{let h=o!==void 0?new AbortController:void 0,b;h&&o!==void 0&&(b=setTimeout(()=>h.abort(new Error("Request timeout")),Math.ceil(o/1e6)));try{let g=await fetch(t,{method:a,headers:c,body:m,signal:h?.signal}),T=async()=>{try{await g.arrayBuffer?.()}catch{}};if(!g.ok)throw await T(),new Error(`HTTP ${g.status}: ${g.statusText}`);await T()}finally{b!==void 0&&clearTimeout(b)}};return d!==void 0||i!==void 0?U(e,{onTransportError:p,retry:f,batchSize:d,flushIntervalMs:i,sendBatch:async m=>{let h;s==="ndjson"?h=m.map(b=>{let g=r(b);return typeof g=="string"?g:new TextDecoder().decode(g)}).join(`
2
- `):h=JSON.stringify(m),await u(h)}}):U(e,{onTransportError:p,retry:f,serialize:r,send:async m=>{await u(m)}})}function ir(e){return Symbol.keyFor(e)??e.description??"message"}function ce(e,t){return typeof e=="string"?e:t(e)}function ar(e,t){let n=`event: ${e}
3
- `;if(t!==void 0){let a=t.split(/\r?\n/);for(let c of a)n+=`data: ${c}
4
- `}return`${n}
5
- `}function ln(e,t){let{serialize:n=l=>{if(l instanceof Error)return l.message;try{return JSON.stringify(l)}catch{return String(l)}},dataEvent:a="data",errorEvent:c="error",completeEvent:r="complete",includeResolved:o=!1,includeDirty:s=!1,keepAliveMs:d,signal:i,eventNameResolver:f=ir}=t??{},p=new TextEncoder,u;return new ReadableStream({start(l){let m=!1,h,b=()=>{},g=()=>{m||(m=!0,h!==void 0&&clearInterval(h),i?.removeEventListener("abort",y),b(),l.close())};u=g;let T=(k,v)=>{m||l.enqueue(p.encode(ar(k,v)))},y=()=>{m||g()};b=e.subscribe(k=>{for(let v of k){let w=v[0];if(!(G.isLocalOnly(w)&&!(w===Me&&s))){if(w===x){T(a,ce(v[1],n));continue}if(w===E){T(c,ce(v[1],n)),g();return}if(w===C){T(r),g();return}!o&&w===Pe||T(f(w),v.length>1?ce(v[1],n):void 0)}}}),d!==void 0&&d>0&&(h=setInterval(()=>{m||l.enqueue(p.encode(`: keepalive
6
-
7
- `))},d)),i?.aborted?y():i?.addEventListener("abort",y,{once:!0})},cancel(){u?.()}})}function pn(e,t){let{serialize:n=u=>{if(u instanceof Error)return u.message;try{return JSON.stringify(u)}catch{return String(u)}},dataEvent:a="data",errorEvent:c="error",completeEvent:r="complete",includeResolved:o=!1,includeDirty:s=!1,keepAliveMs:d,signal:i,eventNameResolver:f=ir}=t??{},p=new TextEncoder;return W(u=>{let l=!0,m,h=(T,y)=>{l&&u.emit(p.encode(ar(T,y)))},b=()=>{l&&(l=!1,u.down([[C]]))},g=e.subscribe(T=>{if(l)for(let y of T){let k=y[0];if(!(G.isLocalOnly(k)&&!(k===Me&&s))){if(k===x){h(a,ce(y[1],n));continue}if(k===E){h(c,ce(y[1],n)),l=!1,u.down([[C]]);return}if(k===C){h(r),l=!1,u.down([[C]]);return}!o&&k===Pe||h(f(k),y.length>1?ce(y[1],n):void 0)}}});return d!==void 0&&d>0&&(m=setInterval(()=>{l&&u.emit(p.encode(`: keepalive
8
-
9
- `))},d)),i?.aborted?b():i?.addEventListener("abort",b,{once:!0}),()=>{l=!1,m!==void 0&&clearInterval(m),i?.removeEventListener("abort",b),g()}})}function fn(e){let t,n=!1;return new ReadableStream({start(a){t=e.subscribe(c=>{for(let r of c){let o=r[0];if(n)return;if(o===x)try{a.enqueue(r[1])}catch{n=!0,t?.()}else if(o===E){n=!0;try{a.error(r[1])}catch{}return}else if(o===C){n=!0;try{a.close()}catch{}return}}})},cancel(){n=!0,t?.()}})}function mn(e,t){let{parse:n=c=>c,...a}=t??{};return W(c=>{let r=!0,o=new TextDecoder,s="",d="message",i=[],f,p,u=()=>{if(i.length===0&&d==="message"&&f===void 0){i=[];return}let T=i.join(`
10
- `);c.emit({event:d,data:n(T),id:f,retry:p}),d="message",i=[],f=void 0,p=void 0},l=T=>{if(T===""){u();return}if(T.startsWith(":"))return;let y=T.indexOf(":"),k=y<0?T:T.slice(0,y),v=y<0?"":T.slice(y+1);switch(v.startsWith(" ")&&(v=v.slice(1)),k){case"event":d=v;break;case"data":i.push(v);break;case"id":v.includes("\0")||(f=v);break;case"retry":{let w=Number(v);Number.isFinite(w)&&(p=w);break}}},m=(T,y)=>{if(!r)return;s+=o.decode(T,{stream:!y});let k=s.split(/\r?\n/);s=k.pop()??"";for(let v of k)l(v)},h,b;return(async()=>{try{let T=e,y=e instanceof ReadableStream?e:T&&typeof T=="object"&&T.body instanceof ReadableStream?T.body:null;if(y){for(h=y.getReader();r;){let{value:k,done:v}=await h.read();if(v)break;m(k,!1)}m(new Uint8Array,!0)}else{for(b=e[Symbol.asyncIterator]();r;){let v=await b.next();if(v.done)break;m(v.value,!1)}m(new Uint8Array,!0)}if(s.trim()){for(let k of s.split(/\r?\n/))l(k);u()}r&&c.down([[C]])}catch(T){r&&c.down([[E,T]])}})(),()=>{r=!1,h&&h.cancel().catch(()=>{}),b&&typeof b.return=="function"&&Promise.resolve(b.return()).catch(()=>{})}},Q(a))}function gn(e,t){let{method:n="GET",headers:a,body:c,signal:r,...o}=t??{};return W(s=>{let d=!0,i=new AbortController;if(r?.aborted)return s.down([[E,r.reason??new Error("Aborted")]]),()=>{};r?.addEventListener("abort",()=>i.abort(r.reason),{once:!0});let f=c!==void 0?typeof c=="string"?c:JSON.stringify(c):void 0;return(async()=>{try{let u=await fetch(e,{method:n,headers:a,body:f,signal:i.signal});if(!d)return;if(!u.ok)throw new Error(`HTTP ${u.status}: ${u.statusText}`);if(!u.body)throw new Error("HTTP response has no body");let l=u.body.getReader();for(;d;){let{value:m,done:h}=await l.read();if(h)break;m&&s.emit(m)}d&&s.down([[C]])}catch(u){if(!d||u&&u.name==="AbortError")return;s.down([[E,u]])}})(),()=>{d=!1,i.abort()}},Q(o))}function Tn(e,t){let{intervalMs:n=5e3,...a}=t??{};return ge(oe(n,{period:n}),()=>sr(e,{...a,completeAfterFetch:!0}).node)}function yn(e,t,n){let{serialize:a=g=>{if(typeof g=="string"||g instanceof Blob||g instanceof ArrayBuffer||ArrayBuffer.isView(g))return g;try{return JSON.stringify(g)}catch{return String(g)}},closeOnComplete:c=!0,closeOnError:r=!0,closeCode:o,closeReason:s,onTransportError:d,retry:i,backpressure:f,stopOn:p}=n??{},u=!1,l=g=>{if(!u){u=!0;try{t.close(o,s)}catch(T){let y=T instanceof Error?T:new Error(String(T));try{d?.({stage:"close",error:y,value:void 0,message:g})}catch{}}}},m=null,b=U(e,{onTransportError:d,serialize:g=>{let T=a(g);if(T===void 0)throw new Error("serialize returned undefined");return T},retry:i,backpressure:f,stopOn:p,onDispose:()=>{if(m){try{t.removeEventListener("close",m)}catch{}m=null}},send:g=>{t.send(g)},onUpstreamMessage:g=>{(g[0]===C&&c||g[0]===E&&r)&&l(g)}});return m=()=>{u=!0,b.dispose()},t.addEventListener("close",m),b}function kn(e,t){let{parse:n,maxRetries:a,backoff:c="exponential",closeOnTeardown:r=!0,...o}=t??{};return we(()=>or(e(),{parse:n,closeOnTeardown:r,...o}),{count:a,backoff:c})}function bn(e,t){let{method:n="notifications/message",onDisconnect:a,...c}=t??{};return ae(({emit:r,error:o})=>(e.setNotificationHandler(n,s=>r(s)),a?.(s=>o(s??new Error("MCP client disconnected"))),()=>e.setNotificationHandler(n,()=>{})),c)}function hn(e,t){return ze(({traces:a,metrics:c,logs:r,error:o})=>e({onTraces:s=>{j(()=>{for(let d of s)a(d)})},onMetrics:s=>{j(()=>{for(let d of s)c(d)})},onLogs:s=>{j(()=>{for(let d of s)r(d)})},onError:o})??void 0,["traces","metrics","logs"],t?.name?{name:t.name}:void 0)}function vn(e,t){return ae(e,t)}function wn(e){let t=e.match(/^<(\d{1,3})>\d?\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)/s);if(!t){let a=V();return{facility:1,severity:6,timestamp:new Date(Math.floor(a/1e6)).toISOString(),hostname:"-",appName:"-",procId:"-",msgId:"-",message:e.trim(),timestampNs:a}}let n=Number(t[1]);return{facility:n>>3,severity:n&7,timestamp:t[2],hostname:t[3],appName:t[4],procId:t[5],msgId:t[6],message:(t[7]??"").trim(),timestampNs:V()}}function Sn(e,t){return ae(e,t)}var xn={c:"counter",g:"gauge",ms:"timer",h:"histogram",s:"set",d:"distribution"};function En(e){let t=e.split("|"),[n,a]=(t[0]??"").split(":");if(!n||a===void 0)throw new Error(`Invalid StatsD line: ${e}`);let c=t[1]?.trim()??"c",r=xn[c]??"counter",o=r==="set"?0:Number(a),s,d={};for(let i=2;i<t.length;i++){let f=t[i].trim();if(f.startsWith("@"))s=Number(f.slice(1));else if(f.startsWith("#"))for(let p of f.slice(1).split(",")){let[u,l]=p.split(":");u&&(d[u]=l??"")}}return{name:n.trim(),value:o,type:r,sampleRate:s,tags:d,timestampNs:V()}}function Nn(e,t){let{intervalNs:n=15*1e9,headers:a,timeoutNs:c=10*1e9,signal:r,maxConsecutiveErrors:o=1}=t??{},s=Math.ceil(n/1e6),d=0;return ge(oe(0,{period:s,signal:r}),()=>W(i=>{let f=!0,p=new AbortController,u=setTimeout(()=>p.abort(new Error("Scrape timeout")),Math.ceil(c/1e6));return(async()=>{try{let m=await fetch(e,{headers:{Accept:"text/plain",...a},signal:p.signal});if(clearTimeout(u),!f)return;if(!m.ok)throw new Error(`Prometheus scrape ${m.status}: ${m.statusText}`);let h=await m.text();if(!f)return;let b=cr(h);for(let g of b)i.emit(g);d=0,i.down([[C]])}catch(m){if(clearTimeout(u),!f||m instanceof Error&&m.name==="AbortError")return;d+=1,d>=o&&i.down([[E,m]])}})(),()=>{f=!1,clearTimeout(u),p.abort()}}))}function cr(e){let t=[],n=new Map,a=new Map;for(let c of e.split(`
11
- `)){let r=c.trim();if(!r)continue;if(r.startsWith("# TYPE ")){let u=r.slice(7),l=u.indexOf(" ");l>0&&n.set(u.slice(0,l),u.slice(l+1).trim());continue}if(r.startsWith("# HELP ")){let u=r.slice(7),l=u.indexOf(" ");l>0&&a.set(u.slice(0,l),u.slice(l+1).trim());continue}if(r.startsWith("#"))continue;let o,s={},d,i,f=r.indexOf("{");if(f>=0){o=r.slice(0,f);let u=r.indexOf("}",f);if(u<0)continue;let l=r.slice(f+1,u);s=On(l);let m=r.slice(u+1).trim().split(/\s+/);d=m[0]??"",i=m[1]}else{let u=r.split(/\s+/);o=u[0]??"",d=u[1]??"",i=u[2]}if(!o||!d)continue;let p=o.replace(/(_total|_count|_sum|_bucket|_created|_info)$/,"");t.push({name:o,labels:s,value:Number(d),timestampMs:i?Number(i):void 0,type:n.get(p)??n.get(o),help:a.get(p)??a.get(o),timestampNs:V()})}return t}function On(e){let t={},n=/(\w+)="((?:[^"\\]|\\.)*)"/g,a=n.exec(e);for(;a!==null;)t[a[1]]=a[2].replace(/\\(.)/g,"$1"),a=n.exec(e);return t}function Rn(e,t,n){let{fromBeginning:a=!1,deserialize:c=o=>{if(o===null)return null;try{return JSON.parse(o.toString())}catch{return o.toString()}},...r}=n??{};return W(o=>{let s=!0;return(async()=>{try{await e.subscribe({topic:t,fromBeginning:a}),await e.run({eachMessage:async({topic:i,partition:f,message:p})=>{if(!s)return;let u={};if(p.headers)for(let[l,m]of Object.entries(p.headers))m!==void 0&&(u[l]=typeof m=="string"?m:m.toString());o.emit({topic:i,partition:f,key:p.key?.toString()??null,value:c(p.value),headers:u,offset:p.offset,timestamp:p.timestamp,timestampNs:V()})}})}catch(i){s&&o.down([[E,i]])}})(),()=>{s=!1}},Q(r))}function Mn(e,t,n,a){let{serialize:c=s=>JSON.stringify(s),keyExtractor:r,onTransportError:o}=a??{};return U(e,{onTransportError:o,send:async s=>{let d=r?.(s)??null,i=c(s);await t.send({topic:n,messages:[{key:d,value:Buffer.from(i)}]})}})}function Pn(e,t,n){let{blockMs:a=5e3,startId:c="$",parse:r=s=>{for(let i=0;i<s.length;i+=2)if(s[i]==="data")try{return JSON.parse(s[i+1])}catch{return s[i+1]}let d={};for(let i=0;i<s.length;i+=2)d[s[i]]=s[i+1];return d},...o}=n??{};return W(s=>{let d=!0,i=c;return(async()=>{for(;d;)try{let p=await e.xread("BLOCK",a,"STREAMS",t,i);if(!d)return;if(p)for(let[u,l]of p)for(let[m,h]of l)i=m,s.emit({id:m,key:t,data:r(h),timestampNs:V()})}catch(p){if(!d)return;s.down([[E,p]]);return}})(),()=>{d=!1}},Q(o))}function Cn(e,t,n,a){let{serialize:c=s=>["data",JSON.stringify(s)],maxLen:r,onTransportError:o}=a??{};return U(e,{onTransportError:o,send:async s=>{let d=c(s);await(r!==void 0?t.xadd(n,"MAXLEN","~",String(r),"*",...d):t.xadd(n,"*",...d))}})}function Ln(e,t){let{delimiter:n=",",hasHeader:a=!0,columns:c,parseLine:r,...o}=t??{},s=r??(d=>ur(d,n));return W(d=>{let i=!1;return(async()=>{try{let p=c,u="";for await(let l of e){if(i)return;u+=l;let m=u.split(/\r?\n/);u=m.pop()??"";for(let h of m){if(i)return;if(!h.trim())continue;let b=s(h);if(!p&&a){p=b;continue}p||(p=b.map((T,y)=>`col${y}`));let g={};for(let T=0;T<p.length;T++)g[p[T]]=b[T]??"";d.emit(g)}}if(!i&&u.trim()){let l=s(u);if(p){let m={};for(let h=0;h<p.length;h++)m[p[h]]=l[h]??"";d.emit(m)}}i||d.down([[C]])}catch(p){i||d.down([[E,p]])}})(),()=>{i=!0}},Q(o))}function An(e,t){let{delimiter:n=",",hasHeader:a=!0,columns:c,parseLine:r,...o}=t??{},s=r??(d=>ur(d,n));return re([e],(d,i,f)=>{let p=d[0];if(p==null||p.length===0)return;let u=f.store;typeof u.buffer!="string"&&(u.buffer=""),u.headers===void 0&&c&&(u.headers=c.slice());for(let l of p){u.buffer=u.buffer+l;let m=u.buffer.split(/\r?\n/);u.buffer=m.pop()??"";for(let h of m){if(!h.trim())continue;let b=s(h);if(!u.headers&&a){u.headers=b;continue}u.headers||(u.headers=b.map((T,y)=>`col${y}`));let g={};for(let T=0;T<u.headers.length;T++)g[u.headers[T]]=b[T]??"";i.emit(g)}}},{describeKind:"derived",...o})}function Bn(e,t){return re([e],(n,a,c)=>{let r=n[0];if(r==null||r.length===0)return;let o=c.store;typeof o.buffer!="string"&&(o.buffer="");for(let s of r){o.buffer=o.buffer+s;let d=o.buffer.split(/\r?\n/);o.buffer=d.pop()??"";for(let i of d)if(i.trim())try{a.emit(JSON.parse(i))}catch(f){a.down([[E,f]]);return}}},{describeKind:"derived",...t??{}})}function ur(e,t){let n=[],a="",c=!1;for(let r=0;r<e.length;r++){let o=e[r];c?o==='"'?e[r+1]==='"'?(a+='"',r++):c=!1:a+=o:o==='"'?c=!0:o===t?(n.push(a),a=""):a+=o}return n.push(a),n}function In(e,t){return W(n=>{let a=!1;return(async()=>{try{let r="";for await(let o of e){if(a)return;r+=o;let s=r.split(/\r?\n/);r=s.pop()??"";for(let d of s){if(a)return;let i=d.trim();i&&n.emit(JSON.parse(i))}}!a&&r.trim()&&n.emit(JSON.parse(r.trim())),a||n.down([[C]])}catch(r){a||n.down([[E,r]])}})(),()=>{a=!0}},Q(t))}function Fn(e,t,n){let{intervalNs:a=5*1e9,format:c="JSONEachRow",signal:r,maxConsecutiveErrors:o=1}=n??{},s=Math.ceil(a/1e6),d=0;return ge(oe(0,{period:s,signal:r}),()=>W(i=>{let f=!0;return(async()=>{try{let u=await e.query({query:t,format:c});if(!f)return;let l=await u.json();if(!f)return;for(let m of l)i.emit(m);d=0,i.down([[C]])}catch(u){if(!f)return;d+=1,d>=o&&i.down([[E,u]])}})(),()=>{f=!1}}))}function Wn(e,t){let{autoAck:n=!0,deserialize:a=s=>{try{return JSON.parse(s.toString())}catch{return s.toString()}},onAckError:c,...r}=t??{},o=s=>{if(c)try{c(s instanceof Error?s:new Error(String(s)))}catch{}};return W(s=>{let d=!0;return(async()=>{for(;d;)try{let f=await e.receive();if(!d)return;let p={topic:f.getTopicName(),messageId:f.getMessageId().toString(),key:f.getPartitionKey(),value:a(f.getData()),properties:f.getProperties(),publishTime:f.getPublishTimestamp(),eventTime:f.getEventTimestamp(),timestampNs:V()};if(n)s.emit(p),e.acknowledge(f).catch(o);else{let u=!1,l={value:p,ack(){u||(u=!0,e.acknowledge(f).catch(o))},nack(m){if(u)return;u=!0;let h=e;try{let b=h.negativeAcknowledge?.(f);b&&typeof b.then=="function"&&b.catch(o)}catch(b){o(b)}}};s.emit(l)}}catch(f){d&&s.down([[E,f]]);return}})(),()=>{d=!1}},Q(r))}function zn(e,t,n){let{serialize:a=s=>Buffer.from(JSON.stringify(s)),keyExtractor:c,propertiesExtractor:r,onTransportError:o}=n??{};return U(e,{onTransportError:o,send:async s=>{await t.send({data:a(s),partitionKey:c?.(s),properties:r?.(s)})}})}function Hn(e,t,n){let a=new TextDecoder,{queue:c,deserialize:r=s=>{let d=a.decode(s);try{return JSON.parse(d)}catch{return d}},...o}=n??{};return W(s=>{let d=!0,i=e.subscribe(t,c?{queue:c}:void 0);return(async()=>{try{for await(let p of i){if(!d)return;let u={};if(p.headers)for(let l of p.headers.keys())u[l]=p.headers.get(l);s.emit({subject:p.subject,data:r(p.data),headers:u,reply:p.reply,sid:p.sid,timestampNs:V()})}d&&s.down([[C]])}catch(p){d&&s.down([[E,p]])}})(),()=>{d=!1}},Q(o))}function Un(e,t,n,a){let c=new TextEncoder,{serialize:r=s=>c.encode(JSON.stringify(s)),onTransportError:o}=a??{};return U(e,{onTransportError:o,send:s=>{t.publish(n,r(s))}})}function Kn(e,t,n){let{autoAck:a=!0,deserialize:c=d=>{try{return JSON.parse(d.toString())}catch{return d.toString()}},onAckError:r,...o}=n??{},s=d=>{if(r)try{r(d instanceof Error?d:new Error(String(d)))}catch{}};return W(d=>{let i=!0,f;return(async()=>{try{f=(await e.consume(t,l=>{if(!i)return;if(l===null){i&&d.down([[E,new Error("Consumer cancelled by broker")]]);return}let m={queue:t,routingKey:l.fields.routingKey,exchange:l.fields.exchange,content:c(l.content),properties:l.properties,deliveryTag:l.fields.deliveryTag,redelivered:l.fields.redelivered,timestampNs:V()};if(a){d.emit(m);try{e.ack(l)}catch(h){s(h)}}else{let h=!1,b=e,g={value:m,ack(){if(!h){h=!0;try{e.ack(l)}catch(T){s(T)}}},nack(T){if(h)return;h=!0;let y=T?.requeue;if(!b.nack){s(new Error("RabbitMQ channel does not expose `nack`; cannot negative-ack"));return}try{b.nack(l,!1,y)}catch(k){s(k)}}};d.emit(g)}},{noAck:!1})).consumerTag}catch(u){i&&d.down([[E,u]])}})(),()=>{i=!1,f!==void 0&&e.cancel(f)}},Q(o))}function jn(e,t,n,a){let{serialize:c=s=>Buffer.from(JSON.stringify(s)),routingKeyExtractor:r=()=>"",onTransportError:o}=a??{};return U(e,{onTransportError:o,send:s=>{let d=r(s),i=c(s);t.publish(n,d,i)}})}function dr(e,t,n){let{serialize:a=p=>`${JSON.stringify(p)}
12
- `,flushIntervalMs:c=0,batchSize:r=Number.POSITIVE_INFINITY,onTransportError:o,mode:s}=n??{},i=c>0||r<Number.POSITIVE_INFINITY?U(e,{onTransportError:o,batchSize:r,flushIntervalMs:c,serialize:a,sendBatch:p=>{t.write(p.join(""))}}):U(e,{onTransportError:o,serialize:a,send:p=>{t.write(p)}}),f=i.dispose;return i.dispose=()=>{f();try{t.end()}catch{}},i}function Ue(e,t){return e.includes(t)||e.includes('"')||e.includes(`
13
- `)?`"${e.replace(/"/g,'""')}"`:e}function Dn(e,t,n){let{columns:a,delimiter:c=",",writeHeader:r=!0,cellExtractor:o=(l,m)=>String(l[m]??""),flushIntervalMs:s=0,batchSize:d=Number.POSITIVE_INFINITY,onTransportError:i,...f}=n,p=!1;return dr(e,t,{serialize:l=>{if(!p&&r){p=!0;let m=a.map(b=>Ue(b,c)).join(c),h=a.map(b=>Ue(o(l,b),c)).join(c);return`${m}
14
- ${h}
15
- `}return`${a.map(m=>Ue(o(l,m),c)).join(c)}
16
- `},flushIntervalMs:s,batchSize:d,onTransportError:i,...f})}function qn(e,t,n,a){let{batchSize:c=1e3,flushIntervalMs:r=5e3,format:o="JSONEachRow",transform:s=i=>i,onTransportError:d}=a??{};return U(e,{onTransportError:d,batchSize:c,flushIntervalMs:r,serialize:s,sendBatch:async i=>{await t.insert({table:n,values:i,format:o})}})}function Vn(e,t,n,a){let{format:c="ndjson",keyGenerator:r=(u,l)=>{let m=Math.floor(l/1e6);return`data/${new Date(m).toISOString().replace(/[:.]/g,"-")}-${u}.${c==="ndjson"?"ndjson":"json"}`},batchSize:o=1e3,flushIntervalMs:s=1e4,transform:d=u=>u,onTransportError:i}=a??{},f=c==="ndjson"?"application/x-ndjson":"application/json",p=0;return U(e,{onTransportError:i,batchSize:o,flushIntervalMs:s,serialize:d,sendBatch:async u=>{p+=1;let l=c==="ndjson"?`${u.map(h=>JSON.stringify(h)).join(`
17
- `)}
18
- `:JSON.stringify(u),m=r(p,V());await t.putObject({Bucket:n,Key:m,Body:l,ContentType:f})}})}function $n(e,t,n,a){let{toSQL:c=(o,s)=>({sql:`INSERT INTO "${s.replace(/"/g,'""')}" (data) VALUES ($1)`,params:[JSON.stringify(o)]}),onTransportError:r}=a??{};return U(e,{onTransportError:r,serialize:o=>c(o,n),send:async o=>{let s=o;await t.query(s.sql,s.params)}})}function _n(e,t,n){let{toDocument:a=r=>r,onTransportError:c}=n??{};return U(e,{onTransportError:c,serialize:a,send:async r=>{await t.insertOne(r)}})}function Qn(e,t,n){let{labels:a={},toLine:c=s=>JSON.stringify(s),toLabels:r,onTransportError:o}=n??{};return U(e,{onTransportError:o,serialize:s=>({line:c(s),labels:r?{...a,...r(s)}:a}),send:async s=>{let{line:d,labels:i}=s,f=`${V()}`;await t.push({streams:[{stream:i,values:[[f,d]]}]})}})}function Jn(e,t,n){let{toResourceSpans:a=r=>[r],onTransportError:c}=n??{};return U(e,{onTransportError:c,serialize:a,send:async r=>{await t.push({resourceSpans:r})}})}function Yn(e,t,n,a){let{prefix:c="checkpoints/",debounceMs:r=500,compactEvery:o=10,onError:s}=a??{},d={debounceMs:r,compactEvery:o,save(i,f){let p=Math.floor(V()/1e6),u=`${c}${e.name}/checkpoint-${p}.json`,l;try{l=JSON.stringify(f)}catch(m){s?.(m);return}t.putObject({Bucket:n,Key:u,Body:l,ContentType:"application/json"}).catch(m=>s?.(m))},load(){return null}};return e.attachStorage([d],{onError:i=>s?.(i)})}function Gn(e,t,n){let{prefix:a="graphrefly:checkpoint:",debounceMs:c=500,compactEvery:r=10,onError:o}=n??{},s=`${a}${e.name}`,d={debounceMs:c,compactEvery:r,save(i,f){let p;try{p=JSON.stringify(f)}catch(u){o?.(u);return}t.set(s,p).catch(u=>o?.(u))},async load(){let i=await t.get(s);if(i==null)return null;try{return JSON.parse(i)}catch{return null}}};return e.attachStorage([d],{onError:i=>o?.(i)})}function Xn(e,t,n){let{mapRow:a=o=>o,params:c,...r}=n??{};return W(o=>{try{let d=e.query(t,c).map(a);o.emit(d),o.down([[C]])}catch(s){o.down([[E,s instanceof Error?s:new Error(String(s))]])}},{describeKind:"producer",completeWhenDepsComplete:!1,...r})}function Zn(e,t,n){let{mapRow:a=o=>o,params:c,...r}=n??{};return W(o=>{try{let s=e.iterate(t,c);j(()=>{for(let d of s)o.emit(a(d));o.down([[C]])})}catch(s){o.down([[E,s instanceof Error?s:new Error(String(s))]])}},{describeKind:"producer",completeWhenDepsComplete:!1,...r})}function eo(e,t,n,a){if(n.includes("\0")||n.length===0)throw new Error(`toSqlite: invalid table name: ${JSON.stringify(n)}`);let{toSQL:c=(R,D)=>({sql:`INSERT INTO "${D.replace(/"/g,'""')}" (data) VALUES (?)`,params:[JSON.stringify(R)]}),onTransportError:r,batchInsert:o=!1,maxBatchSize:s=1e3,flushIntervalMs:d=0}=a??{},i=R=>c(R,n);if(!o)return U(e,{onTransportError:r,serialize:i,send:R=>{let D=R;t.query(D.sql,D.params)}});let f=B(null),p=B(void 0,{equals:()=>!1}),u=B(null),l=B(0),m=B(0),h=R=>{try{r?.(R)}catch{}try{f.down([[x,R]])}catch{}},b=[],g=!1,T,y=!1,k=()=>m.down([[x,b.length]]),v=R=>{y||p.down([[x,R]])},w=R=>{y||u.down([[x,R]])},N=R=>{y||l.down([[x,R]])},O=R=>{y||h(R)},H=()=>{if(b.length===0||g)return;g=!0,N(1);try{t.query("BEGIN",[])}catch(F){g=!1,N(0),O({stage:"send",error:F instanceof Error?F:new Error(String(F)),value:void 0});return}let R=b;b=[],k();let D,X=0;for(let F of R)try{t.query(F.query.sql,F.query.params),X+=1}catch($){D=$ instanceof Error?$:new Error(String($));break}if(D){try{t.query("ROLLBACK",[])}catch{}O({stage:"send",error:D,value:void 0});for(let F of R)w({value:F.value,error:D,attempts:1})}else try{t.query("COMMIT",[]);for(let F of R)v(F.value)}catch(F){let $=F instanceof Error?F:new Error(String(F));O({stage:"send",error:$,value:void 0});for(let Z=0;Z<X;Z++)w({value:R[Z].value,error:$,attempts:1})}g=!1,N(0)},z=()=>{d>0&&T===void 0&&!y&&(T=setTimeout(()=>{T=void 0,H()},d))},J=e.subscribe(R=>{for(let D of R){let X=D[0];if(X===x){let F=D[1],$;try{$=i(F)}catch(Z){let fe=Z instanceof Error?Z:new Error(String(Z));h({stage:"serialize",error:fe,value:F}),u.down([[x,{value:F,error:fe,attempts:0}]]);continue}b.push({value:F,query:$}),k(),b.length>=s?H():z()}else G.messageTier(X)>=3&&H()}});return{dispose:()=>{if(!y){T!==void 0&&(clearTimeout(T),T=void 0),H(),y=!0,J();for(let R of[f,p,u,l,m])try{R.down([[q]])}catch{}}},sent:p,failed:u,inFlight:l,errors:f,buffered:m,flush:async()=>{y||H()}}}function ro(e,t){let{args:n,mapRow:a=r=>r,...c}=t??{};return W(r=>{let o=!0;return e.findMany(n).then(s=>{o&&(r.emit(s.map(a)),r.down([[C]]))}).catch(s=>{if(o)try{r.down([[E,s instanceof Error?s:new Error(String(s))]])}catch{}}),()=>{o=!1}},{...c,describeKind:"producer",completeWhenDepsComplete:!1})}function to(e,t){let{mapRow:n=c=>c,...a}=t??{};return W(c=>{let r=!0;return e.execute().then(o=>{r&&(c.emit(o.map(n)),c.down([[C]]))}).catch(o=>{if(r)try{c.down([[E,o instanceof Error?o:new Error(String(o))]])}catch{}}),()=>{r=!1}},{...a,describeKind:"producer",completeWhenDepsComplete:!1})}function no(e,t){let{mapRow:n=c=>c,...a}=t??{};return W(c=>{let r=!0;return e.execute().then(o=>{r&&(c.emit(o.map(n)),c.down([[C]]))}).catch(o=>{if(r)try{c.down([[E,o instanceof Error?o:new Error(String(o))]])}catch{}}),()=>{r=!1}},{...a,describeKind:"producer",completeWhenDepsComplete:!1})}function lr(){let e=new Map,t=null,n=null;function a(r){r.prev?r.prev.next=r.next:t=r.next,r.next?r.next.prev=r.prev:n=r.prev,r.prev=null,r.next=null}function c(r){r.next=t,r.prev=null,t&&(t.prev=r),t=r,n===null&&(n=r)}return{insert(r){if(e.has(r)){this.touch(r);return}let o={key:r,prev:null,next:null};e.set(r,o),c(o)},touch(r){let o=e.get(r);o&&(a(o),c(o))},delete(r){let o=e.get(r);o&&(a(o),e.delete(r))},evict(r){let o=[];for(let s=0;s<r&&n!==null;s++){let d=n;o.push(d.key),a(d),e.delete(d.key)}return o},size(){return e.size}}}function pr(e){return e!=null&&typeof e.then=="function"}function ue(e){pr(e)&&e.catch(()=>{})}function oo(e,t){let n=new Map,a=t?.maxSize??0,c=a>0?t?.eviction??lr():null,r=t?.writeThrough??!1;function o(i,f,p){for(let u=0;u<p;u++)try{ue(e[u].save(i,f))}catch{}}function s(i,f,p=0){for(let u=p;u<e.length;u++){let l;try{l=e[u].load(i)}catch{continue}if(pr(l)){let m=u;l.then(h=>{h!=null?(f.down([[x,h]]),o(i,h,m)):s(i,f,m+1)},()=>{s(i,f,m+1)});return}if(l!=null){f.down([[x,l]]),o(i,l,u);return}}}function d(){if(!(!c||a<=0))for(;c.size()>=a;){let i=c.evict(1);if(i.length===0)break;for(let f of i){let p=n.get(f);if(p){let u=p.cache;if(p.status!=="sentinel"&&e.length>0){let l=e.length-1;try{ue(e[l].save(f,u))}catch{}for(let m=0;m<l;m++)try{let h=e[m].clear;h&&ue(h.call(e[m],f))}catch{}}p.down([[q]])}n.delete(f)}}}return{load(i){let f=n.get(i);if(f)return c?.touch(i),f;c&&a>0&&c.size()>=a&&d();let p=B(void 0);return n.set(i,p),c?.insert(i),s(i,p),p},save(i,f){if(r)for(let u of e)try{ue(u.save(i,f))}catch{}else if(e[0])try{ue(e[0].save(i,f))}catch{}let p=n.get(i);if(p)p.down([[x,f]]),c?.touch(i);else{c&&a>0&&c.size()>=a&&d();let u=B(f);n.set(i,u),c?.insert(i)}},invalidate(i){let f=n.get(i);f&&s(i,f)},delete(i){c?.delete(i);let f=n.get(i);f&&f.down([[q]]),n.delete(i);for(let p of e)try{let u=p.clear;u&&ue(u.call(p,i))}catch{}},has(i){return n.has(i)},get size(){return n.size}}}var Ee=class{_version=0;_topics=new Set;get version(){return this._version}get topicCount(){return this._topics.size}hasTopic(t){return this._topics.has(t)}topicNames(){return this._topics.values()}createTopic(t){return this._topics.has(t)?!1:(this._topics.add(t),this._version+=1,!0)}removeTopic(t){let n=this._topics.delete(t);return n&&(this._version+=1),n}};function so(e={}){let{backend:t}=e,n=t??new Ee,a=new Map;function c(r){let o=a.get(r);return o===void 0&&(o=re({describeKind:"state"}),a.set(r,o),n.createTopic(r)),o}return{topic(r){return c(r)},publish(r,o){c(r).emit(o)},publishMany(r){j(()=>{for(let[o,s]of r)c(o).emit(s)})},removeTopic(r){let o=a.get(r);return o===void 0?!1:(a.delete(r),n.removeTopic(r),o.down([[q]]),!0)},has(r){return n.hasTopic(r)},get size(){return n.topicCount},topicNames(){return n.topicNames()}}}var io=new Map([[Ce,"INVALIDATE"],[Le,"PAUSE"],[Ae,"RESUME"],[q,"TEARDOWN"],[C,"COMPLETE"],[E,"ERROR"]]),ao=new Map([["INVALIDATE",Ce],["PAUSE",Le],["RESUME",Ae],["TEARDOWN",q],["COMPLETE",C],["ERROR",E]]);function se(e){let t=io.get(e);return t||(Symbol.keyFor(e)??"UNKNOWN")}function de(e){let t=ao.get(e);if(t)return t;if(e&&e!=="UNKNOWN")return Symbol.for(e)}function le(e){return e instanceof Error?{message:e.message,name:e.name,stack:e.stack}:{message:String(e),name:"Error"}}function pe(e){let t=new Error(e.message);return t.name=e.name,e.stack&&(t.stack=e.stack),t}function ie(e){if(typeof MessagePort<"u"&&e instanceof MessagePort)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=a=>t(a.data);return e.addEventListener("message",n),e.start(),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof SharedWorker<"u"&&e instanceof SharedWorker)return ie(e.port);if(typeof Worker<"u"&&e instanceof Worker)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=a=>t(a.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.terminate()}};if(typeof BroadcastChannel<"u"&&e instanceof BroadcastChannel)return{post(t,n){n&&n.length>0&&console.warn("[graphrefly] WorkerTransport: BroadcastChannel does not support Transferable objects. The transfer argument is ignored and objects will be cloned instead."),e.postMessage(t)},listen(t){let n=a=>t(a.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof ServiceWorker<"u"&&e instanceof ServiceWorker)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=a=>{a.source===e&&t(a.data)};return navigator.serviceWorker.addEventListener("message",n),()=>navigator.serviceWorker.removeEventListener("message",n)}};throw new Error("createTransport: unsupported target type. Expected Worker, SharedWorker, ServiceWorker, BroadcastChannel, or MessagePort.")}function co(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function fr(e,t){let n=co(e)?e:ie(e),a=t.name??"workerBridge",c=Object.entries(t.expose??{}),r=t.import??[],o=t.transfer??{},s=B("connecting",{name:`${a}::meta::status`}),d=B(null,{name:`${a}::meta::error`}),i=new Map,f=new Map;for(let T of r){let y=B(void 0,{name:`${a}::${T}`});i.set(T,y)}let p;if(c.length>0){let T=c.map(([,v])=>v),y=re(T,(v,w)=>{let N={};for(let O=0;O<c.length;O++){let[H]=c[O],z=v[O];z!=null&&z.length>0&&(N[H]=z.at(-1))}Object.keys(N).length!==0&&w.emit(N)},{name:`${a}::aggregated`,partial:!0});p=he([y],v=>{let w=v[0];if(w==null||Object.keys(w).length===0)return;let N=[];for(let z of Object.keys(w)){let J=o[z];J&&N.push(...J(w[z]))}let O;for(let[z,J]of c)z in w&&J.v!=null&&(O==null&&(O={}),O[z]=J.v.version);let H={t:"b",u:w,...O?{v:O}:{}};try{n.post(H,N.length>0?N:void 0)}catch(z){d.down([[x,z instanceof Error?z:new Error(String(z))]])}}).subscribe(()=>{})}let u=!1,l=n.listen(T=>{if(u)return;let y=T;switch(y.t){case"r":{j(()=>{for(let[v,w]of Object.entries(y.stores)){let N=i.get(v);N&&N.down([[x,w]])}}),s.down([[x,"connected"]]);let k={};for(let[v,w]of c)k[v]=w.cache;n.post({t:"i",stores:k});break}case"v":{let k=i.get(y.s);k&&k.down([[x,y.d]]);break}case"b":{j(()=>{for(let[k,v]of Object.entries(y.u)){let w=y.v?.[k];if(w!=null){let O=f.get(k);if(O!=null&&w<=O)continue;f.set(k,w)}let N=i.get(k);N&&N.down([[x,v]])}});break}case"e":{let k=i.get(y.s);k&&k.down([[E,pe(y.err)]]);break}case"s":{let k=de(y.sig);if(!k)break;let v=y.s==="*"?[...i.values()]:i.has(y.s)?[i.get(y.s)]:[];for(let w of v)w.down(y.d===void 0?[[k]]:[[k,y.d]]);break}}}),m=[];for(let[T,y]of c){let k=y.subscribe((v=>{if(!u)for(let w of v){let N=w[0];N!==x&&(G.isLocalOnly(N)||(N===E?n.post({t:"e",s:T,err:le(w[1])}):n.post({t:"s",s:T,sig:se(N),d:w.length>1?w[1]:void 0})))}}));m.push(k)}let h;if(t.timeoutMs!=null&&t.timeoutMs>0){let T=oe(t.timeoutMs),y=Ie(s,v=>v==="connected");h=Fe(We(xe(T,()=>"timeout"),xe(y,()=>"ready"))).subscribe(v=>{for(let w of v)w[0]===x&&w[1]==="timeout"&&(d.down([[x,new Error("Worker bridge handshake timeout")]]),b())})}function b(){if(!u){u=!0,h?.(),n.post({t:"s",s:"*",sig:se(q)}),p&&p();for(let T of m)T();m.length=0,l(),s.down([[x,"closed"]]),f.clear(),i.clear()}}let g={meta:{status:s,error:d},destroy:b};for(let[T,y]of i)g[T]=y;return g}function uo(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function mr(e,t){let n=uo(e)?e:ie(e),a=t.import??[],c=t.transfer??{},r=new Map,o=new Map,s={};for(let b of a){let g=B(void 0,{name:`worker::${b}`});r.set(b,g),s[b]=g}let d=t.expose(s),i=Object.entries(d),f,p=!1;if(i.length>0){let b=i.map(([,y])=>y),g=re(b,(y,k)=>{let v={};for(let w=0;w<i.length;w++){let[N]=i[w],O=y[w];O!=null&&O.length>0&&(v[N]=O.at(-1))}Object.keys(v).length!==0&&k.emit(v)},{name:"workerSelf::aggregated",partial:!0});f=he([g],y=>{if(p)return;let k=y[0];if(k==null||Object.keys(k).length===0)return;let v=[];for(let O of Object.keys(k)){let H=c[O];H&&v.push(...H(k[O]))}let w;for(let[O,H]of i)O in k&&H.v!=null&&(w==null&&(w={}),w[O]=H.v.version);let N={t:"b",u:k,...w?{v:w}:{}};try{n.post(N,v.length>0?v:void 0)}catch{}}).subscribe(()=>{})}let u=[];for(let[b,g]of i){let T=g.subscribe((y=>{if(!p)for(let k of y){let v=k[0];v!==x&&(G.isLocalOnly(v)||(v===E?n.post({t:"e",s:b,err:le(k[1])}):n.post({t:"s",s:b,sig:se(v),d:k.length>1?k[1]:void 0})))}}));u.push(T)}let l=n.listen(b=>{if(p)return;let g=b;switch(g.t){case"i":{j(()=>{for(let[T,y]of Object.entries(g.stores)){let k=r.get(T);k&&k.down([[x,y]])}});break}case"v":{let T=r.get(g.s);T&&T.down([[x,g.d]]);break}case"b":{j(()=>{for(let[T,y]of Object.entries(g.u)){let k=g.v?.[T];if(k!=null){let w=o.get(T);if(w!=null&&k<=w)continue;o.set(T,k)}let v=r.get(T);v&&v.down([[x,y]])}});break}case"e":{let T=r.get(g.s);T&&T.down([[E,pe(g.err)]]);break}case"s":{let T=de(g.sig);if(!T)break;if(T===q&&g.s==="*"){h();return}let y=g.s==="*"?[...r.values()]:r.has(g.s)?[r.get(g.s)]:[];for(let k of y)k.down(g.d===void 0?[[T]]:[[T,g.d]]);break}}}),m={};for(let[b,g]of i)m[b]=g.cache;n.post({t:"r",stores:m});function h(){if(!p){p=!0,f&&f();for(let b of u)b();u.length=0,l(),n.terminate?.(),o.clear(),r.clear()}}return{destroy:h}}export{ae as a,ze as b,U as c,or as d,un as e,sr as f,dn as g,ln as h,pn as i,fn as j,mn as k,gn as l,Tn as m,yn as n,kn as o,bn as p,hn as q,vn as r,wn as s,Sn as t,En as u,Nn as v,cr as w,Rn as x,Mn as y,Pn as z,Cn as A,Ln as B,An as C,Bn as D,In as E,Fn as F,Wn as G,zn as H,Hn as I,Un as J,Kn as K,jn as L,dr as M,Dn as N,qn as O,Vn as P,$n as Q,_n as R,Qn as S,Jn as T,Yn as U,Gn as V,Xn as W,Zn as X,eo as Y,ro as Z,to as _,no as $,lr as aa,oo as ba,Ee as ca,so as da,se as ea,de as fa,le as ga,pe as ha,ie as ia,fr as ja,mr as ka,lo as la};
@@ -1 +0,0 @@
1
- import{a as P}from"./chunk-4VVTGLXJ.js";import{m as y}from"./chunk-KASHOCF5.js";import{D as N,F as w,G as W,o as k}from"./chunk-W4TSQ6RJ.js";import{a as C,b as p,c as A,d as m,i as a,j as b}from"./chunk-CK2E7BTU.js";function c(d){return{describeKind:"derived",...d}}function B(d){return{describeKind:"derived",partial:!0,...d}}function J(d,i,u){return N([d],(t,e)=>{let n=t[0];if(n==null||n.length===0){e.down([[m]]);return}for(let o of n)e.emit(i(o))},c(u))}function S(d,i,u){return N([d],(t,e)=>{let n=t[0];if(n==null||n.length===0){e.down([[m]]);return}let o=!1;for(let r of n)i(r)&&(e.emit(r),o=!0);o||e.down([[m]])},c(u))}function Q(d,i,u,t){return N([d],(e,n,o)=>{"acc"in o.store||(o.store.acc=u);let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)o.store.acc=i(o.store.acc,s),n.emit(o.store.acc)},{...c(t),initial:u,resetOnTeardown:!0})}function X(d,i,u,t){return N([d],(e,n,o)=>{if("acc"in o.store||(o.store.acc=u),o.terminalDeps[0]===!0){n.emit(o.store.acc),n.down([[a]]);return}let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)o.store.acc=i(o.store.acc,s)},{...c(t),completeWhenDepsComplete:!1})}function M(d,i,u){return i<=0?N([d],(t,e,n)=>{n.store.completed||(n.store.completed=!0,e.down([[a]]))},{...c(u),completeWhenDepsComplete:!1}):N([d],(t,e,n)=>{if("taken"in n.store||(n.store.taken=0),n.store.done){e.down([[m]]);return}if(n.terminalDeps[0]===!0){n.store.done=!0,e.down([[a]]);return}let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}for(let r of o)if(n.store.taken++,e.emit(r),n.store.taken>=i){n.store.done=!0,e.down([[a]]);return}},{...c(u),completeWhenDepsComplete:!1})}function V(d,i,u){return N([d],(t,e,n)=>{"skipped"in n.store||(n.store.skipped=0);let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}let r=!1;for(let s of o)n.store.skipped++,n.store.skipped<=i||(e.emit(s),r=!0);r||e.down([[m]])},c(u))}function Z(d,i,u){return N([d],(t,e,n)=>{if(n.store.done){e.down([[m]]);return}let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}for(let r of o){if(!i(r)){n.store.done=!0,e.down([[a]]);return}e.emit(r)}},{...c(u),completeWhenDepsComplete:!1})}function $(d,i,u){let t=u?.predicate??(o=>o[0]===p),{predicate:e,...n}=u??{};return w(o=>{let r=!1,s=d.subscribe(l=>{if(!r)for(let T of l){if(r)return;T[0]===p?o.emit(T[1]):(T[0]===a||T[0]===b)&&(r=!0,o.down([T]))}}),f=i.subscribe(l=>{if(!r)for(let T of l){if(r)return;if(t(T)){r=!0,o.down([[a]]);return}}});return()=>{s(),f()}},c(n))}function ee(d,i){return M(d,1,i)}function ne(d,i){let{defaultValue:u,...t}=i??{},e=i!=null&&Object.hasOwn(i,"defaultValue");return N([d],(n,o,r)=>{if(r.terminalDeps[0]===!0){r.store.has?o.emit(r.store.latest):e&&o.emit(u),o.down([[a]]);return}let s=n[0];if(s==null||s.length===0){o.down([[m]]);return}r.store.latest=s.at(-1),r.store.has=!0},{...c(t),completeWhenDepsComplete:!1})}function te(d,i,u){return M(S(d,i,u),1,u)}function oe(d,i,u){return M(V(d,i,u),1,u)}function re(d,i,u){if(typeof i=="function")return N([d],(e,n)=>{let o=e[0];if(o==null||o.length===0){n.down([[m]]);return}for(let r of o)i(r),n.emit(r)},c(u));let t=i;return N([d],(e,n,o)=>{if(o.terminalDeps[0]!==void 0){o.terminalDeps[0]===!0?(t.complete?.(),n.down([[a]])):(t.error?.(o.terminalDeps[0]),n.down([[b,o.terminalDeps[0]]]));return}let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)t.data?.(s),n.emit(s)},{...c(u),completeWhenDepsComplete:!1})}function se(d,i=Object.is,u){return N([d],(t,e,n)=>{let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}let r=!1;for(let s of o)n.store.hasPrev&&i(n.store.prev,s)||(n.store.prev=s,n.store.hasPrev=!0,e.emit(s),r=!0);r||e.down([[m]])},c(u))}function ie(d,i){return N([d],(u,t,e)=>{let n=u[0];if(n==null||n.length===0){t.down([[m]]);return}let o=!1;for(let r of n)if(!e.store.hasPrev)e.store.prev=r,e.store.hasPrev=!0;else{let s=[e.store.prev,r];e.store.prev=r,t.emit(s),o=!0}o||t.down([[m]])},c(i))}function K(...d){let i=[...d];return W(i,u=>u,{...c(),equals:(u,t)=>{if(u.length!==t.length)return!1;for(let e=0;e<u.length;e++)if(!Object.is(u[e],t[e]))return!1;return!0}})}function ue(d,i,u){return N([d,i],(t,e,n)=>{let o=t[0],r=t[1],s=r!=null&&r.length>0?r.at(-1):n.prevData[1];if(o!=null&&o.length>0){if(!(r!=null&&r.length>0)&&n.prevData[1]===void 0){e.down([[m]]);return}for(let f of o)e.emit([f,s])}else e.down([[m]])},B(u))}function fe(...d){return d.length===0?w(i=>{i.down([[a]])},c()):w(i=>{let u=d.length,t=0,e=[];for(let n of d){let o=n.subscribe(r=>{for(let s of r)s[0]===p?i.emit(s[1]):s[0]===a?(t+=1,t>=u&&i.down([[a]])):s[0]===b&&i.down([s])});e.push(o)}return()=>{for(let n of e)n()}},c())}function de(...d){let i=d.length;return i===0?w(u=>{u.emit([]),u.down([[a]])},c()):w(u=>{let t=Array.from({length:i},()=>[]),e=i;function n(){for(;t.every(r=>r.length>0);){let r=t.map(s=>s.shift());u.emit(r)}}let o=[];for(let r=0;r<i;r++){let s=r,f=d[r].subscribe(l=>{for(let T of l)T[0]===p?(t[s].push(T[1]),n()):T[0]===a?(e-=1,(e===0||t[s].length===0)&&u.down([[a]])):T[0]===b&&u.down([T])});o.push(f)}return()=>{for(let r of o)r()}},c())}function le(d,i,u){return w(t=>{let e=0,n=[],o,r;return r=i.subscribe(s=>{for(let f of s)e===0?f[0]===p?n.push(f[1]):f[0]===b&&t.down([f]):f[0]===p?t.emit(f[1]):(f[0]===a||f[0]===b)&&t.down([f])}),o=d.subscribe(s=>{for(let f of s)if(e===0)if(f[0]===p)t.emit(f[1]);else if(f[0]===a){e=1;for(let l of n)t.emit(l);n.length=0}else f[0]===b&&t.down([f])}),()=>{o?.(),r?.()}},c(u))}function ae(...d){return d.length===0?w(i=>{i.down([[a]])},c()):d.length===1?N([d[0]],(i,u)=>{let t=i[0];if(t==null||t.length===0){u.down([[m]]);return}for(let e of t)u.emit(e)},c()):w(i=>{let u=null,t=[];for(let e=0;e<d.length;e++){let n=e,o=d[e].subscribe(r=>{for(let s of r){if(u!==null&&n!==u)return;s[0]===p?(u===null&&(u=n),i.emit(s[1])):(s[0]===a||s[0]===b)&&(u===null||n===u)&&i.down([s])}});t.push(o)}return()=>{for(let e of t)e()}},c())}function I(d,i,u){let t,e=!1,n=()=>{e||(e=!0,u())};return t=d.subscribe(o=>{let r=!1,s=!1;for(let f of o)f[0]!==C&&(f[0]===p?i.emit(f[1]):f[0]===a?r=!0:f[0]===b?(s=!0,i.down([f])):(f[0]===A||f[0]===m)&&i.down([f]));s?(t?.(),t=void 0,n()):r&&n()}),()=>{t?.(),t=void 0}}function ce(d,i,u){let t,e=!1;function n(){t?.(),t=void 0}return N([d],(o,r,s)=>{if(s.terminalDeps[0]!=null&&s.terminalDeps[0]!==!0){n();return}if(s.terminalDeps[0]===!0){e=!0,t||r.down([[a]]);return}let f=o[0];if(!(f==null||f.length===0))return n(),t=I(y(i(f[f.length-1])),r,()=>{n(),e&&r.down([[a]])}),{deactivate:()=>{n(),e=!1}}},{...c(u),completeWhenDepsComplete:!1})}function Te(d,i,u){let t,e=!1;function n(){t?.(),t=void 0}return N([d],(o,r,s)=>{if(s.terminalDeps[0]!=null&&s.terminalDeps[0]!==!0){n();return}if(s.terminalDeps[0]===!0){e=!0,t||r.down([[a]]);return}let f=o[0];if(!(f==null||f.length===0))return t===void 0?t=I(y(i(f[0])),r,()=>{n(),e&&r.down([[a]])}):r.down([[m]]),{deactivate:()=>{n(),e=!1}}},{...c(u),completeWhenDepsComplete:!1})}function pe(d,i,u){let{maxBuffer:t,...e}=u??{},n=[],o,r=!1,s;function f(){o?.(),o=void 0}function l(){if(!s||o!==void 0)return;if(n.length===0){r&&s.down([[a]]);return}let h=n.shift();o=I(y(i(h)),s,()=>{f(),l()})}function T(h){t&&t>0&&n.length>=t&&n.shift(),n.push(h),l()}return N([d],(h,O,E)=>{if(s=O,E.terminalDeps[0]!=null&&E.terminalDeps[0]!==!0){f(),n.length=0;return}if(E.terminalDeps[0]===!0){r=!0,l();return}let x=h[0];if(!(x==null||x.length===0)){for(let v of x)T(v);return{deactivate:()=>{f(),n.length=0,r=!1}}}},{...c(e),completeWhenDepsComplete:!1})}function q(d,i,u){let{concurrent:t,...e}=u??{},n=t!=null&&t>0?t:Number.POSITIVE_INFINITY,o=0,r=!1,s=new Set,f=[],l;function T(){r&&o===0&&f.length===0&&l&&l.down([[a]])}function h(v){if(!l)return;o++;let g;g=I(y(i(v)),l,()=>{g&&s.delete(g),o--,O(),T()}),s.add(g)}function O(){for(;f.length>0&&o<n;)h(f.shift())}function E(v){o<n?h(v):f.push(v)}function x(){for(let v of s)v();s.clear(),o=0,f.length=0}return N([d],(v,g,D)=>{if(l=g,D.terminalDeps[0]!=null&&D.terminalDeps[0]!==!0){x();return}if(D.terminalDeps[0]===!0){r=!0,T();return}let R=v[0];if(!(R==null||R.length===0)){for(let U of R)E(U);return{deactivate:()=>{x(),r=!1}}}},{...c(e),completeWhenDepsComplete:!1})}var me=q;function be(d,i,u){return w(t=>{let e=new Set;function n(){for(let r of e)clearTimeout(r);e.clear()}let o=d.subscribe(r=>{for(let s of r)if(s[0]===p){let f=setTimeout(()=>{e.delete(f),t.emit(s[1])},i);e.add(f)}else if(s[0]===a){let f=setTimeout(()=>{e.delete(f),t.down([[a]])},i);e.add(f)}else s[0]===b&&(n(),t.down([s]))});return()=>{o(),n()}},c(u))}function _(d,i,u){return w(t=>{let e,n;function o(){e!==void 0&&(clearTimeout(e),e=void 0)}let r=d.subscribe(s=>{for(let f of s)f[0]===p?(o(),n=f[1],e=setTimeout(()=>{e=void 0,t.emit(n)},i)):f[0]===a?(e!==void 0&&(o(),t.emit(n)),t.down([[a]])):f[0]===b&&(o(),t.down([f]))});return()=>{r(),o()}},c(u))}function j(d,i,u){let{leading:t,trailing:e,...n}=u??{},o=t!==!1,r=e===!0,s=i*1e6;return w(f=>{let l,T=-1/0,h,O=!1;function E(){l!==void 0&&(clearTimeout(l),l=void 0)}let x=d.subscribe(v=>{for(let g of v)if(g[0]===p){let D=g[1],R=k();if(o&&R-T>=s)T=R,f.emit(D),E(),r&&(l=setTimeout(()=>{l=void 0,O&&(T=k(),f.emit(h),O=!1)},i));else if(r&&(h=D,O=!0,l===void 0)){let U=(R-T)/1e6;l=setTimeout(()=>{l=void 0,O&&(T=k(),f.emit(h),O=!1)},Math.max(0,i-U))}}else(g[0]===a||g[0]===b)&&(E(),f.down([g]))});return()=>{x(),E()}},c(n))}function we(d,i,u){return w(t=>{let e,n=!1,o=!1,r=d.subscribe(f=>{if(!n)for(let l of f){if(n)return;l[0]===p?e={v:l[1]}:l[0]===b?(n=!0,t.down([l])):l[0]===a&&(o=!0,e=void 0)}}),s=i.subscribe(f=>{if(!n)for(let l of f){if(n)return;l[0]===p?e!==void 0&&!o&&t.emit(e.v):l[0]===b?(n=!0,t.down([l])):l[0]===a&&(n=!0,t.down([[a]]))}});return()=>{r(),s()}},c(u))}function Ne(d,i,u){return w(t=>{let e,n,o=!1;function r(){e!==void 0&&(clearTimeout(e),e=void 0)}let s=d.subscribe(f=>{for(let l of f)l[0]===p?(n=l[1],o=!0,r(),e=setTimeout(()=>{e=void 0,o&&(o=!1,t.emit(n))},i)):(l[0]===a||l[0]===b)&&(r(),t.down([l]))});return()=>{s(),r()}},c(u))}function he(d,i,u){let{with:t,...e}=u??{},n=t??new Error("timeout");return w(o=>{let r;function s(){clearTimeout(r),r=setTimeout(()=>{r=void 0,o.down([[b,n]])},i)}s();let f=d.subscribe(l=>{for(let T of l)T[0]===p?(s(),o.emit(T[1])):(T[0]===a||T[0]===b)&&(clearTimeout(r),o.down([T]))});return()=>{f(),clearTimeout(r)}},c(e))}function ve(d,i,u){return w(t=>{let e=[],n=d.subscribe(r=>{for(let s of r)s[0]===p?e.push(s[1]):s[0]===a?(e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):s[0]===b&&t.down([s])}),o=i.subscribe(r=>{for(let s of r)s[0]===p?e.length>0&&(t.emit([...e]),e.length=0):s[0]===a?t.down([[a]]):s[0]===b&&t.down([s])});return()=>{n(),o(),e.length=0}},c(u))}function ge(d,i,u){if(i<=0)throw new RangeError("bufferCount expects count > 0");return w(t=>{let e=[],n=d.subscribe(o=>{for(let r of o)r[0]===p?(e.push(r[1]),e.length>=i&&t.emit(e.splice(0,e.length))):r[0]===a?(e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):r[0]===b&&t.down([r])});return()=>{n(),e.length=0}},c(u))}function Oe(d,i,u){if(i<=0)throw new RangeError("windowCount expects count > 0");return w(t=>{let e,n=0;function o(){let s=w(f=>(e=f.down.bind(f),()=>{e=void 0}),c());n=0,t.emit(s)}let r=d.subscribe(s=>{for(let f of s)f[0]===p?(e||o(),e?.([[p,f[1]]]),n+=1,n>=i&&(e?.([[a]]),e=void 0)):f[0]===a?(e?.([[a]]),e=void 0,t.down([[a]])):f[0]===b&&(e?.([f]),e=void 0,t.down([f]))});return()=>{r(),e?.([[a]]),e=void 0}},c(u))}function Ee(d,i,u){return w(t=>{let e=[],n=setInterval(()=>{e.length>0&&(t.emit([...e]),e.length=0)},i),o=d.subscribe(r=>{for(let s of r)s[0]===p?e.push(s[1]):s[0]===a?(clearInterval(n),e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):s[0]===b&&(clearInterval(n),t.down([s]))});return()=>{o(),clearInterval(n),e.length=0}},c(u))}function xe(d,i,u){return w(t=>{let e;function n(){e?.([[a]]),e=void 0}function o(){let f=w(l=>(e=l.down.bind(l),()=>{e=void 0}),c());t.emit(f)}o();let r=setInterval(()=>{n(),o()},i),s=d.subscribe(f=>{for(let l of f)l[0]===p?e?.([[p,l[1]]]):l[0]===a?(clearInterval(r),n(),t.down([[a]])):l[0]===b&&(clearInterval(r),e?.([l]),n(),t.down([l]))});return()=>{s(),clearInterval(r),n()}},c(u))}function Re(d,i,u){return w(t=>{let e;function n(){e?.([[a]]),e=void 0}function o(){let f=w(l=>(e=l.down.bind(l),()=>{e=void 0}),c());t.emit(f)}let r=d.subscribe(f=>{for(let l of f)l[0]===p?(e||o(),e?.([[p,l[1]]])):l[0]===a?(n(),t.down([[a]])):l[0]===b&&(e?.([l]),e=void 0,t.down([l]))}),s=i.subscribe(f=>{for(let l of f)l[0]===p&&(n(),o())});return()=>{r(),s(),n()}},c(u))}function De(d,i){return w((u,t)=>{"n"in t.store||(t.store.n=0);let e=setInterval(()=>{u.emit(t.store.n),t.store.n=t.store.n+1},d);return()=>clearInterval(e)},c(i))}function ye(d,i,u){if(i<=0)throw new RangeError("repeat expects count > 0");return w(t=>{let e=i,n,o=()=>{n?.(),n=d.subscribe(r=>{let s=!1,f=[];for(let l of r)l[0]===a?s=!0:f.push(l);f.length>0&&t.down(f),s&&(n?.(),n=void 0,e-=1,e>0?o():t.down([[a]]))})};return o(),()=>{n?.()}},c(u))}function ke(d,i){return N([d],(u,t)=>{let e=u[0];if(e==null||e.length===0){t.down([[m]]);return}for(let n of e)t.emit(n)},c(i))}function L(d,i,u){return w(t=>{let e=d.subscribe(n=>{for(let o of n)if(o[0]===p)t.emit(o[1]);else if(o[0]===b)try{t.emit(i(o[1]))}catch(r){t.down([[b,r]])}else o[0]===a&&t.down([[a]])});return()=>{e()}},c(u))}function Ie(d,i,u){return N([d,i],(t,e,n)=>{let o=t[1];if(!(o!=null&&o.length>0?o.at(-1):n.prevData[1])){e.down([[m]]);return}let s=t[0];if(s!=null&&s.length>0){for(let f of s)e.emit(f);return}if(o!=null&&o.length>0&&n.prevData[0]!==void 0){e.emit(n.prevData[0]);return}e.down([[m]])},B(u))}var Ue=K,Me=_,Ce=j,Ae=L;export{J as a,S as b,Q as c,X as d,M as e,V as f,Z as g,$ as h,ee as i,ne as j,te as k,oe as l,re as m,se as n,ie as o,K as p,ue as q,fe as r,de as s,le as t,ae as u,ce as v,Te as w,pe as x,q as y,me as z,be as A,_ as B,j as C,we as D,Ne as E,he as F,ve as G,ge as H,Oe as I,Ee as J,xe as K,Re as L,De as M,ye as N,ke as O,L as P,Ie as Q,Ue as R,Me as S,Ce as T,Ae as U};
@@ -1 +0,0 @@
1
- import{a as K}from"./chunk-ISCENNXS.js";import{a as A}from"./chunk-ESMPEKEV.js";import{c as T}from"./chunk-I6VIH3VA.js";import{o as j,p as S}from"./chunk-W4TSQ6RJ.js";function P(){let e=new Error("aborted");return e.name="AbortError",e}function $(e,r){return e<=0?Promise.resolve():r?.aborted?Promise.reject(P()):new Promise((t,n)=>{let i=new A,o,d=()=>{i.cancel(),r&&o&&r.removeEventListener("abort",o)};i.start(e,()=>{d(),t()}),r&&(o=()=>{d(),n(P())},r.addEventListener("abort",o,{once:!0}))})}function D(e={}){let r=e.provider??"dry-run",t=e.model??"dry-run-v1",n=e.latencyMs??0,i=Math.max(1,e.streamChunkSize??16),o=e.respond??(u=>{let p=[...u].reverse().find(l=>l.role==="user");return p?`echo: ${p.content}`:"dry-run: no user message"}),d=e.usage??((u,p)=>{let l=u.reduce((y,g)=>y+g.content.length,0);return{input:{regular:Math.ceil(l/4)},output:{regular:Math.ceil(p.length/4)}}});return{provider:r,model:t,async invoke(u,p){if(await $(n,p?.signal),p?.signal?.aborted)throw P();let l=o(u,p),y=d(u,l);return{content:l,usage:y,finishReason:"stop",model:p?.model??t,provider:r,tier:p?.tier,metadata:{dryRun:!0}}},async*stream(u,p){let l=o(u,p),y=d(u,l),g=Math.ceil(l.length/i)||1,k=n>0?n/g:0;for(let h=0;h<l.length;h+=i){if(p?.signal?.aborted)throw P();await $(k,p?.signal),yield{type:"token",delta:l.slice(h,h+i)}}yield{type:"usage",usage:y},yield{type:"finish",reason:"stop"}}}}async function F(e){let r=typeof e=="string"?new TextEncoder().encode(e):e,t=await globalThis.crypto.subtle.digest("SHA-256",r),n=new Uint8Array(t),i="";for(let o=0;o<n.length;o++)i+=N[n[o]];return i}var N=new Array(256);for(let e=0;e<256;e++)N[e]=e.toString(16).padStart(2,"0");var R=class extends Error{constructor(t,n){super(`withReplayCache: no cached response for ${n} (key=${t}, mode=read-strict)`);this.key=t;this.method=n}name="ReplayCacheMissError"};function U(e,r){let t=r.mode??"read-write",n=r.cacheStreaming??!1,i=r.captureStreamCadence??!1,o=r.replaySpeed??1,d=r.keyPrefix??"llm-replay",u=r.storage,p=t==="read"||t==="read-strict",l=async(a,s)=>{if(r.keyFn){let w=r.keyFn;if(w.length<=1){let C={messages:a,opts:s,context:s?.keyContext},c=await w(C);return`${d}:${c}`}let v=await w(a,s);return`${d}:${v}`}let{signal:m,keyContext:f,...L}=s??{},b=I({messages:a,opts:L}),x=await F(b);return`${d}:${x}`},y=async a=>{if(t==="write-only")return;let s=await u.load(a);if(s!=null)try{return typeof s=="string"?JSON.parse(s):s}catch{return}},g=async a=>(await y(a))?.response,k=async(a,s,m)=>{if(p)return;let f={response:s,storedAtNs:S(),...m?{streamChunks:m.chunks,streamCadenceMs:m.delaysMs}:{}};await u.save(a,f)},h=a=>a<=0?Promise.resolve():new Promise(s=>{new A().start(a,()=>s())}),z=K(async({messages:a,invokeOpts:s})=>{let m=e.invoke(a,s);return await G(m)},{keyFn:({_precomputedKey:a})=>a});return{provider:e.provider,model:e.model,capabilities:e.capabilities?.bind(e),async invoke(a,s){let m=await l(a,s),f=await g(m);if(f)return{...f,metadata:{...f.metadata??{},replayCache:"hit"}};if(t==="read-strict")throw new R(m,"invoke");let L=await z({messages:a,invokeOpts:s,_precomputedKey:m});return await k(m,L),L},async*stream(a,s){if(!n){for await(let c of e.stream(a,s))yield c;return}let m=await l(a,s),f=await y(m);if(f){let c=f.response;if(f.streamChunks&&f.streamCadenceMs)for(let M=0;M<f.streamChunks.length;M++){let E=f.streamCadenceMs[M]??0,O=o>0?E/o:0;O>0&&await h(O),yield{type:"token",delta:f.streamChunks[M]?.delta??""}}else c.content&&(yield{type:"token",delta:c.content});c.usage&&(yield{type:"usage",usage:c.usage}),yield{type:"finish",reason:c.finishReason??"stop"};return}if(t==="read-strict")throw new R(m,"stream");let L="",b,x,w=[],v=[],C;for await(let c of e.stream(a,s)){if(c.type==="token"&&(L+=c.delta,i)){let M=j(),E=C===void 0?0:(M-C)/1e6;v.push(E),C=M,w.push({delta:c.delta})}c.type==="usage"&&(b=c.usage),c.type==="finish"&&(x=c.reason),yield c}if(L||b){let c={content:L,usage:b??{input:{regular:0},output:{regular:0}},finishReason:x,model:e.model??s?.model??"",provider:e.provider};await k(m,c,i?{chunks:w,delaysMs:v}:void 0)}}}}function I(e){let r=new Set,t=n=>{if(n===null||typeof n!="object")return n;let i=n;if(r.has(i))return{__cycle:!0};r.add(i);try{if(Array.isArray(n))return n.map(t);let o={};for(let d of Object.keys(n).sort())o[d]=t(n[d]);return o}finally{r.delete(i)}};return JSON.stringify(t(e))}async function G(e){if(e!=null&&typeof e.then=="function")return await e;if(e&&typeof e=="object"&&"content"in e)return e;throw new Error("withReplayCache: adapter.invoke must return Promise or LLMResponse (Node input not supported in cache path)")}var ie=R;function _(e,r){return{content:"[fallback: no cached response available for this request]",usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:r,provider:e,metadata:{degraded:!0,reason:"no-fixture"}}}function H(e,r,t){return typeof e=="string"?{content:e,usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:t,provider:r,metadata:{degraded:!0,reason:"respond"}}:e}async function J(e,r){if("key"in e)return e.key;let t=I({messages:e.messages,opts:e.invokeOpts??{}}),n=await F(t);return`${r}:${n}`}function W(e){let r={response:e.response,storedAtNs:S()};if("key"in e&&e.stream){let t=e.stream.chunks.filter(n=>n.type==="token");return{...r,streamChunks:t.map(n=>({delta:n.delta})),streamCadenceMs:e.stream.delaysMs??t.map(()=>0)}}return r}function q(e,r){let t=[];if(e.fixtures!=null&&t.push("fixtures"),e.fixturesStorage!=null&&t.push("fixturesStorage"),t.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\` and \`fixturesStorage\` are mutually exclusive; got both ${t.join(" and ")}. Pick one source. For filesystem directories use the node subpath's \`fallbackAdapter\`.`);if(e.fixtures){let n=T(),i=e.fixtures,o=(async()=>{for(let d of i){let u=await J(d,r);await n.save(u,W(d))}})();return o.catch(()=>{}),{tier:n,seedReady:o}}return e.fixturesStorage?{tier:e.fixturesStorage,seedReady:Promise.resolve()}:{tier:void 0,seedReady:Promise.resolve()}}function ce(e={}){let r=e.provider??"fallback",t=e.model??"fallback",n=e.onMiss??"respond",i=e.keyPrefix??"fallback",o=e.record?e.record.adapter:n==="throw"?D({provider:r,model:t,respond:()=>"[unreachable: read-strict mode throws on miss]"}):{provider:r,model:t,async invoke(y,g){let k=e.respond?e.respond(y,g):_(r,t);return H(k,r,t)},async*stream(y,g){let k=e.respond?e.respond(y,g):_(r,t),h=H(k,r,t);yield{type:"token",delta:h.content},h.usage&&(yield{type:"usage",usage:h.usage}),yield{type:"finish",reason:h.finishReason??"stop"}}},d,u=Promise.resolve();if(e.record){if(!e.record.storage)throw new TypeError("fallbackAdapter: `record.storage` is required in record mode. For filesystem `record.dir` convenience, use the node subpath's `fallbackAdapter`.");d=e.record.storage}else{let y=q(e,i);d=y.tier??T(),u=y.seedReady}let p=e.record?"read-write":n==="throw"?"read-strict":"read",l=U(o,{storage:d,mode:p,keyPrefix:i,cacheStreaming:!0,captureStreamCadence:!0,replaySpeed:e.replaySpeed,...e.keyFn?{keyFn:e.keyFn}:{}});return{provider:r,model:t,capabilities:l.capabilities?.bind(l),async invoke(y,g){return await u,l.invoke(y,g)},async*stream(y,g){await u;for await(let k of l.stream(y,g))yield k}}}export{D as a,R as b,U as c,I as d,ie as e,ce as f};