@graphrefly/graphrefly 0.37.0 → 0.39.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 (329) hide show
  1. package/dist/budget-gate-CmmVtasH.d.ts +115 -0
  2. package/dist/budget-gate-DiP_nK0n.d.cts +115 -0
  3. package/dist/{cascading-BsJ4GbnS.d.ts → cascading-BzuxW0_w.d.cts} +2 -2
  4. package/dist/{cascading-B25wxpRa.d.cts → cascading-g2_rhhaM.d.ts} +2 -2
  5. package/dist/chunk-35JTVPOX.js +1 -0
  6. package/dist/chunk-3G5U5QNE.js +5 -0
  7. package/dist/chunk-4I45FVQS.js +1 -0
  8. package/dist/chunk-5LK7XMEV.js +1 -0
  9. package/dist/chunk-5XRI6RM3.js +1 -0
  10. package/dist/chunk-73PBQNST.js +1 -0
  11. package/dist/chunk-7JRF5YEK.js +3 -0
  12. package/dist/{chunk-YVYSO5CW.js → chunk-7NZMZJMW.js} +1 -1
  13. package/dist/chunk-7QFRK3N3.js +84 -0
  14. package/dist/{chunk-K6ZFJ473.js → chunk-7SD73DS6.js} +1 -1
  15. package/dist/{chunk-LOQRPP4Y.js → chunk-A6ZSKGUG.js} +1 -1
  16. package/dist/{chunk-KUVDFOJH.js → chunk-AU7YTQX7.js} +1 -1
  17. package/dist/chunk-C72GO4IZ.js +1 -0
  18. package/dist/{chunk-Q7EUZ6NN.js → chunk-CGDMTXSY.js} +1 -1
  19. package/dist/chunk-D27JNOLZ.js +1 -0
  20. package/dist/chunk-D47YVDR5.js +1 -0
  21. package/dist/chunk-EWF7KCDJ.js +61 -0
  22. package/dist/{chunk-PCD2MU7X.js → chunk-GEAO3TL3.js} +1 -1
  23. package/dist/chunk-GX5LSSRE.js +1 -0
  24. package/dist/{chunk-2C4NESZE.js → chunk-HAWKGIXM.js} +1 -1
  25. package/dist/chunk-HX3EGQ5Z.js +1 -0
  26. package/dist/{chunk-MQZWA3DF.js → chunk-IA7DUNGB.js} +1 -1
  27. package/dist/{chunk-MYFR67PY.js → chunk-INH6FS2G.js} +2 -2
  28. package/dist/chunk-INHC33EH.js +1 -0
  29. package/dist/chunk-IUB4NYI2.js +1 -0
  30. package/dist/{chunk-TFK4P4CX.js → chunk-JNMC2WJ6.js} +1 -1
  31. package/dist/{chunk-TLS7M7H4.js → chunk-KD4NHLMU.js} +1 -1
  32. package/dist/chunk-L6NSJVJZ.js +1 -0
  33. package/dist/chunk-L7WY6TZS.js +1 -0
  34. package/dist/chunk-LQNOXGET.js +1 -0
  35. package/dist/chunk-MC4UYY2X.js +1 -0
  36. package/dist/{chunk-U3COB5WU.js → chunk-N7UIBZCW.js} +1 -1
  37. package/dist/chunk-NQI2C36M.js +1 -0
  38. package/dist/chunk-R75BMDLA.js +1 -0
  39. package/dist/chunk-RF3QZP6D.js +1 -0
  40. package/dist/{chunk-MC5LZG3U.js → chunk-S2U57TFC.js} +1 -1
  41. package/dist/{chunk-QP5TH523.js → chunk-SC7BQDNP.js} +1 -1
  42. package/dist/{chunk-5CPPC75H.js → chunk-TFPZLQ5H.js} +1 -1
  43. package/dist/chunk-VJJLIEAL.js +1 -0
  44. package/dist/chunk-WHIZM6JV.js +1 -0
  45. package/dist/chunk-XEUANKBO.js +43 -0
  46. package/dist/chunk-XQ55HO5N.js +1 -0
  47. package/dist/chunk-ZJ7SM3G2.js +1 -0
  48. package/dist/{chunk-T4U24DXX.js → chunk-ZOX3LBRV.js} +1 -1
  49. package/dist/compat/index.cjs +9 -13
  50. package/dist/compat/index.d.cts +16 -16
  51. package/dist/compat/index.d.ts +16 -16
  52. package/dist/compat/index.js +1 -1
  53. package/dist/compat/jotai/index.d.cts +2 -2
  54. package/dist/compat/jotai/index.d.ts +2 -2
  55. package/dist/compat/nanostores/index.d.cts +2 -2
  56. package/dist/compat/nanostores/index.d.ts +2 -2
  57. package/dist/compat/nestjs/index.cjs +8 -12
  58. package/dist/compat/nestjs/index.d.cts +8 -8
  59. package/dist/compat/nestjs/index.d.ts +8 -8
  60. package/dist/compat/nestjs/index.js +1 -1
  61. package/dist/compat/react/index.d.cts +2 -2
  62. package/dist/compat/react/index.d.ts +2 -2
  63. package/dist/compat/solid/index.d.cts +2 -2
  64. package/dist/compat/solid/index.d.ts +2 -2
  65. package/dist/compat/svelte/index.d.cts +2 -2
  66. package/dist/compat/svelte/index.d.ts +2 -2
  67. package/dist/compat/vue/index.d.cts +2 -2
  68. package/dist/compat/vue/index.d.ts +2 -2
  69. package/dist/compat/zustand/index.cjs +3 -7
  70. package/dist/compat/zustand/index.d.cts +4 -4
  71. package/dist/compat/zustand/index.d.ts +4 -4
  72. package/dist/compat/zustand/index.js +1 -1
  73. package/dist/{composite-_XckYx2e.d.cts → composite-CKd0e2vz.d.cts} +10 -3
  74. package/dist/{composite-CT_mApQD.d.ts → composite-DGatA-JK.d.ts} +10 -3
  75. package/dist/core/index.cjs +1 -1
  76. package/dist/core/index.d.cts +4 -4
  77. package/dist/core/index.d.ts +4 -4
  78. package/dist/core/index.js +1 -1
  79. package/dist/extra/browser.d.cts +1 -1
  80. package/dist/extra/browser.d.ts +1 -1
  81. package/dist/extra/index.cjs +17 -21
  82. package/dist/extra/index.d.cts +11 -9
  83. package/dist/extra/index.d.ts +11 -9
  84. package/dist/extra/index.js +1 -1
  85. package/dist/extra/node.cjs +2 -2
  86. package/dist/extra/node.d.cts +108 -2
  87. package/dist/extra/node.d.ts +108 -2
  88. package/dist/extra/node.js +2 -2
  89. package/dist/extra/operators.cjs +1 -1
  90. package/dist/extra/operators.d.cts +1 -1
  91. package/dist/extra/operators.d.ts +1 -1
  92. package/dist/extra/operators.js +1 -1
  93. package/dist/extra/reactive.cjs +1 -1
  94. package/dist/extra/reactive.d.cts +3 -3
  95. package/dist/extra/reactive.d.ts +3 -3
  96. package/dist/extra/reactive.js +1 -1
  97. package/dist/extra/render/index.cjs +5 -0
  98. package/dist/extra/render/index.d.cts +183 -0
  99. package/dist/extra/render/index.d.ts +183 -0
  100. package/dist/extra/render/index.js +1 -0
  101. package/dist/extra/sources.cjs +1 -1
  102. package/dist/extra/sources.d.cts +1 -1
  103. package/dist/extra/sources.d.ts +1 -1
  104. package/dist/extra/sources.js +1 -1
  105. package/dist/extra/storage-browser.d.cts +1 -1
  106. package/dist/extra/storage-browser.d.ts +1 -1
  107. package/dist/extra/storage-tiers-browser.d.cts +76 -5
  108. package/dist/extra/storage-tiers-browser.d.ts +76 -5
  109. package/dist/extra/storage-tiers-node.d.cts +137 -13
  110. package/dist/extra/storage-tiers-node.d.ts +137 -13
  111. package/dist/extra/storage-tiers.d.cts +151 -23
  112. package/dist/extra/storage-tiers.d.ts +151 -23
  113. package/dist/{fallback-axI2cXwt.d.cts → fallback-8JYU8tlT.d.cts} +1 -1
  114. package/dist/{fallback-DuEXfA4F.d.ts → fallback-CMZl39L5.d.ts} +1 -1
  115. package/dist/graph/index.cjs +7 -7
  116. package/dist/graph/index.d.cts +5 -5
  117. package/dist/graph/index.d.ts +5 -5
  118. package/dist/graph/index.js +1 -1
  119. package/dist/{graph-YQXDndFy.d.ts → graph-30XSgtVX.d.ts} +287 -104
  120. package/dist/{graph-CaNXUc3c.d.cts → graph-BUwMAxJI.d.cts} +287 -104
  121. package/dist/{index-CIcu6fIR.d.ts → index-2n8Eai6M.d.ts} +1 -1
  122. package/dist/{index-BmLkcDlj.d.ts → index-89FczVZ_.d.ts} +47 -71
  123. package/dist/{index-Ci358GSC.d.cts → index-8R1vzNOx.d.cts} +9 -9
  124. package/dist/{index-CDvC1m5p.d.ts → index-B2RUoIUz.d.ts} +1 -1
  125. package/dist/{index-DuhOdNyg.d.ts → index-B41Asm7D.d.ts} +10 -8
  126. package/dist/{index-CKcnuQ2c.d.ts → index-B9fmw5n2.d.ts} +4 -6
  127. package/dist/{index-0qOD-421.d.ts → index-BAlaVimV.d.ts} +9 -9
  128. package/dist/{index-Ae6L8liv.d.ts → index-BC9VybQs.d.ts} +41 -48
  129. package/dist/{index-CUTHDZ7Q.d.ts → index-BEHmxORq.d.ts} +11 -11
  130. package/dist/{index-C_qi0WlF.d.cts → index-BJ26eEjs.d.cts} +26 -19
  131. package/dist/{index-BiomL7AW.d.ts → index-BJSZxSFX.d.ts} +1 -1
  132. package/dist/{index-DCAuN9u5.d.cts → index-BKMdnYnk.d.ts} +75 -39
  133. package/dist/{index-DfAo9WKr.d.ts → index-BM9szD8n.d.cts} +14 -6
  134. package/dist/{index-CajEOoAN.d.ts → index-BUPVld1w.d.ts} +2 -2
  135. package/dist/{index-C-pFD_FV.d.ts → index-BXd6OMEy.d.ts} +3 -3
  136. package/dist/index-BhUaMYm_.d.ts +113 -0
  137. package/dist/{index-DAKm44My.d.cts → index-BndG0cpK.d.cts} +3 -3
  138. package/dist/{index-Bpzw8hx3.d.ts → index-Br3WnqEn.d.ts} +84 -9
  139. package/dist/{index-D6tRNEKz.d.cts → index-BskfDoZ_.d.ts} +14 -6
  140. package/dist/{index-9mbs_PIG.d.ts → index-C19qqa38.d.ts} +4 -4
  141. package/dist/{index-fHKHdAso.d.ts → index-C7VV_qOs.d.ts} +4 -4
  142. package/dist/{index-CLPQyYY5.d.cts → index-CIRG8Hxp.d.cts} +11 -11
  143. package/dist/{index-B3D_z0Z6.d.cts → index-CL7oilfm.d.cts} +1 -1
  144. package/dist/{index-BOfHwQc1.d.ts → index-CPhBvRJU.d.ts} +1 -1
  145. package/dist/{index-B9qJmmv3.d.cts → index-CWHtYmSh.d.cts} +1 -1
  146. package/dist/{index-D_d1erkR.d.ts → index-Cey6VTnX.d.ts} +8 -5
  147. package/dist/{resilience-BWP2c7Af.d.cts → index-CmqiJZKM.d.ts} +141 -23
  148. package/dist/{index-JYtN9uqM.d.ts → index-CoM4rzyB.d.ts} +1 -1
  149. package/dist/{index-DTYIRT_v.d.cts → index-CpLpJb6A.d.cts} +8 -5
  150. package/dist/{index-BjWZARLy.d.ts → index-Ctb7_2sG.d.ts} +1 -1
  151. package/dist/index-CusEP3Sv.d.ts +210 -0
  152. package/dist/{resilience-Bys63Cpd.d.ts → index-CwP_KAMS.d.cts} +141 -23
  153. package/dist/{index-BFuVcqL8.d.cts → index-D3ayz3hy.d.cts} +1 -1
  154. package/dist/{index-CrpjECS6.d.cts → index-DCbE8fFM.d.cts} +3 -3
  155. package/dist/{index-D_DThl_J.d.cts → index-DIHcMLr6.d.cts} +1 -1
  156. package/dist/index-DINuaZlJ.d.cts +210 -0
  157. package/dist/{index-9xhIaM-w.d.cts → index-DOBLxOti.d.cts} +1 -1
  158. package/dist/index-DQUVq1_d.d.ts +374 -0
  159. package/dist/{index-B1IcU--K.d.cts → index-DTtBpuQy.d.cts} +4 -6
  160. package/dist/{index-D_QQ_dTD.d.cts → index-DYTBbF8T.d.cts} +1 -1
  161. package/dist/{index-DqtXA3yX.d.cts → index-DlgHqQxW.d.cts} +84 -9
  162. package/dist/{index-D1E1tqHT.d.ts → index-DlrWu9Hs.d.cts} +75 -39
  163. package/dist/{index-DcWbx58m.d.cts → index-DoYc8BWK.d.cts} +41 -48
  164. package/dist/{index-D0ZxFXYl.d.ts → index-DszPlZzK.d.ts} +3 -3
  165. package/dist/{index-BECJ8M0T.d.cts → index-DyM4tFAe.d.cts} +10 -8
  166. package/dist/{index-D11pGlaI.d.cts → index-FVoPvhAu.d.cts} +4 -4
  167. package/dist/{index-BwtIbzSV.d.cts → index-H_I66pav.d.cts} +2 -2
  168. package/dist/{index-e1m3ZHgc.d.cts → index-IwFqHxCs.d.cts} +2 -2
  169. package/dist/index-K-vl_c6A.d.cts +113 -0
  170. package/dist/{index-C4N-dg5U.d.cts → index-KlZ_ZUip.d.cts} +2 -2
  171. package/dist/index-L8XI8Zql.d.cts +374 -0
  172. package/dist/{index-D8IyqHvT.d.cts → index-MxYuWOrf.d.cts} +6 -4
  173. package/dist/{index-CpZKtdMw.d.cts → index-PgwvGWa1.d.cts} +1 -1
  174. package/dist/{index-B46GWgk3.d.ts → index-PlJ3MraE.d.ts} +1 -1
  175. package/dist/{index-DPqR3wdW.d.ts → index-PqbnoScQ.d.ts} +3 -3
  176. package/dist/{index-CU3z8Cel.d.cts → index-PsVHpPwP.d.cts} +3 -3
  177. package/dist/{index-C0tga1_x.d.ts → index-WyFKER-c.d.ts} +2 -2
  178. package/dist/{index-B5UR87KG.d.ts → index-eaQuGJnv.d.ts} +6 -4
  179. package/dist/{index-CzIWlnPp.d.ts → index-iTX5IqSP.d.ts} +140 -9
  180. package/dist/{index-CRycrNfn.d.ts → index-jKLph6cu.d.ts} +2 -2
  181. package/dist/{index-BhLA9feT.d.ts → index-jr6PuSBt.d.ts} +26 -19
  182. package/dist/{index-4IwO4mH2.d.cts → index-mNwgxC21.d.cts} +140 -9
  183. package/dist/{index-CkN8CZlT.d.cts → index-pVDQcbar.d.cts} +47 -71
  184. package/dist/{index-D6pwWiOc.d.cts → index-xZYcDqFH.d.cts} +4 -4
  185. package/dist/{index-8OxXae3g.d.ts → index-yLt-aPMp.d.ts} +1 -1
  186. package/dist/{index-CqSJ25A9.d.cts → index-z8WFPVI8.d.cts} +1 -1
  187. package/dist/index.cjs +64 -60
  188. package/dist/index.d.cts +48 -47
  189. package/dist/index.d.ts +48 -47
  190. package/dist/index.js +1 -1
  191. package/dist/meta-Ct9nqQS5.d.cts +102 -0
  192. package/dist/meta-D8OyedKp.d.ts +102 -0
  193. package/dist/{node-fSc-hCv8.d.cts → node-BYInONRr.d.cts} +3 -3
  194. package/dist/{node-fSc-hCv8.d.ts → node-BYInONRr.d.ts} +3 -3
  195. package/dist/{observable-Cqty11jG.d.cts → observable-DMIlYJV1.d.cts} +1 -1
  196. package/dist/{observable-EAV_rNfM.d.ts → observable-DO8DDEzv.d.ts} +1 -1
  197. package/dist/patterns/ai/browser.cjs +5 -5
  198. package/dist/patterns/ai/browser.d.cts +4 -4
  199. package/dist/patterns/ai/browser.d.ts +4 -4
  200. package/dist/patterns/ai/browser.js +1 -1
  201. package/dist/patterns/ai/index.cjs +17 -21
  202. package/dist/patterns/ai/index.d.cts +17 -17
  203. package/dist/patterns/ai/index.d.ts +17 -17
  204. package/dist/patterns/ai/index.js +1 -1
  205. package/dist/patterns/ai/node.cjs +1 -1
  206. package/dist/patterns/ai/node.d.cts +4 -4
  207. package/dist/patterns/ai/node.d.ts +4 -4
  208. package/dist/patterns/ai/node.js +1 -1
  209. package/dist/patterns/audit/index.cjs +3 -7
  210. package/dist/patterns/audit/index.d.cts +6 -6
  211. package/dist/patterns/audit/index.d.ts +6 -6
  212. package/dist/patterns/audit/index.js +1 -1
  213. package/dist/patterns/cqrs/index.cjs +3 -7
  214. package/dist/patterns/cqrs/index.d.cts +6 -6
  215. package/dist/patterns/cqrs/index.d.ts +6 -6
  216. package/dist/patterns/cqrs/index.js +1 -1
  217. package/dist/patterns/demo-shell/index.cjs +5 -8
  218. package/dist/patterns/demo-shell/index.d.cts +5 -5
  219. package/dist/patterns/demo-shell/index.d.ts +5 -5
  220. package/dist/patterns/demo-shell/index.js +1 -1
  221. package/dist/patterns/domain-templates/index.cjs +3 -7
  222. package/dist/patterns/domain-templates/index.d.cts +4 -4
  223. package/dist/patterns/domain-templates/index.d.ts +4 -4
  224. package/dist/patterns/domain-templates/index.js +1 -1
  225. package/dist/patterns/graphspec/index.cjs +38 -38
  226. package/dist/patterns/graphspec/index.d.cts +5 -5
  227. package/dist/patterns/graphspec/index.d.ts +5 -5
  228. package/dist/patterns/graphspec/index.js +1 -1
  229. package/dist/patterns/guarded-execution/index.cjs +3 -7
  230. package/dist/patterns/guarded-execution/index.d.cts +7 -7
  231. package/dist/patterns/guarded-execution/index.d.ts +7 -7
  232. package/dist/patterns/guarded-execution/index.js +1 -1
  233. package/dist/patterns/harness/index.cjs +8 -12
  234. package/dist/patterns/harness/index.d.cts +12 -12
  235. package/dist/patterns/harness/index.d.ts +12 -12
  236. package/dist/patterns/harness/index.js +1 -1
  237. package/dist/patterns/job-queue/index.cjs +3 -7
  238. package/dist/patterns/job-queue/index.d.cts +6 -6
  239. package/dist/patterns/job-queue/index.d.ts +6 -6
  240. package/dist/patterns/job-queue/index.js +1 -1
  241. package/dist/patterns/lens/index.cjs +3 -7
  242. package/dist/patterns/lens/index.d.cts +6 -6
  243. package/dist/patterns/lens/index.d.ts +6 -6
  244. package/dist/patterns/lens/index.js +1 -1
  245. package/dist/patterns/memory/index.cjs +3 -7
  246. package/dist/patterns/memory/index.d.cts +7 -5
  247. package/dist/patterns/memory/index.d.ts +7 -5
  248. package/dist/patterns/memory/index.js +1 -1
  249. package/dist/patterns/messaging/index.cjs +3 -7
  250. package/dist/patterns/messaging/index.d.cts +5 -5
  251. package/dist/patterns/messaging/index.d.ts +5 -5
  252. package/dist/patterns/messaging/index.js +1 -1
  253. package/dist/patterns/orchestration/index.cjs +3 -7
  254. package/dist/patterns/orchestration/index.d.cts +8 -8
  255. package/dist/patterns/orchestration/index.d.ts +8 -8
  256. package/dist/patterns/orchestration/index.js +1 -1
  257. package/dist/patterns/process/index.cjs +1 -1
  258. package/dist/patterns/process/index.d.cts +7 -7
  259. package/dist/patterns/process/index.d.ts +7 -7
  260. package/dist/patterns/process/index.js +1 -1
  261. package/dist/patterns/reactive-layout/index.cjs +4 -8
  262. package/dist/patterns/reactive-layout/index.d.cts +5 -5
  263. package/dist/patterns/reactive-layout/index.d.ts +5 -5
  264. package/dist/patterns/reactive-layout/index.js +1 -1
  265. package/dist/patterns/reduction/index.cjs +3 -7
  266. package/dist/patterns/reduction/index.d.cts +4 -4
  267. package/dist/patterns/reduction/index.d.ts +4 -4
  268. package/dist/patterns/reduction/index.js +1 -1
  269. package/dist/patterns/refine-loop/index.cjs +5 -9
  270. package/dist/patterns/refine-loop/index.d.cts +6 -6
  271. package/dist/patterns/refine-loop/index.d.ts +6 -6
  272. package/dist/patterns/refine-loop/index.js +1 -1
  273. package/dist/patterns/resilient-pipeline/index.cjs +1 -1
  274. package/dist/patterns/resilient-pipeline/index.d.cts +4 -8
  275. package/dist/patterns/resilient-pipeline/index.d.ts +4 -8
  276. package/dist/patterns/resilient-pipeline/index.js +1 -1
  277. package/dist/patterns/surface/index.cjs +13 -17
  278. package/dist/patterns/surface/index.d.cts +6 -6
  279. package/dist/patterns/surface/index.d.ts +6 -6
  280. package/dist/patterns/surface/index.js +1 -1
  281. package/dist/{pipeline-graph-BrrYGjuZ.d.cts → pipeline-graph-BQPr2Lqs.d.cts} +34 -17
  282. package/dist/{pipeline-graph-DX2Twdj-.d.ts → pipeline-graph-D8vKcO_p.d.ts} +34 -17
  283. package/dist/{reactive-layout-DrGjuwyC.d.cts → reactive-layout-8CSc0tiA.d.cts} +2 -2
  284. package/dist/{reactive-layout-BDdngW56.d.ts → reactive-layout-DkTXxtSy.d.ts} +2 -2
  285. package/dist/{reactive-log-jirQsxMY.d.ts → reactive-log-BlAsPLl2.d.ts} +30 -3
  286. package/dist/{reactive-log-ScpWyqny.d.cts → reactive-log-_zeEnB9H.d.cts} +30 -3
  287. package/dist/{reactive-map-DmgeADH8.d.cts → reactive-map-B2qfD3hb.d.cts} +1 -1
  288. package/dist/{reactive-map-CHyeCf4D.d.ts → reactive-map-jFIsE6Kt.d.ts} +1 -1
  289. package/dist/resilience-HTF2LBRS.js +1 -0
  290. package/dist/{sugar-D13E2M_z.d.ts → sugar-BhfjgetH.d.ts} +1 -1
  291. package/dist/{sugar-DgaGJcI6.d.cts → sugar-DzePN5-g.d.cts} +1 -1
  292. package/dist/{topology-tree-BkhmMg2a.d.cts → topology-tree-B5Ngw3j0.d.cts} +1 -1
  293. package/dist/{topology-tree-BI665P0L.d.ts → topology-tree-BtvbgMXJ.d.ts} +1 -1
  294. package/dist/{types-BMSGPlpO.d.cts → types-1Dhoi7HM.d.cts} +1 -1
  295. package/dist/{types-CidcBDuk.d.ts → types-39jk0kaV.d.ts} +1 -1
  296. package/package.json +11 -1
  297. package/dist/chunk-4EATTNAE.js +0 -1
  298. package/dist/chunk-533RQFF6.js +0 -1
  299. package/dist/chunk-6SVKZ7VI.js +0 -1
  300. package/dist/chunk-A5HZZYRK.js +0 -1
  301. package/dist/chunk-B4L5X2QO.js +0 -7
  302. package/dist/chunk-C5CBVOCB.js +0 -1
  303. package/dist/chunk-CZIQ6JCE.js +0 -1
  304. package/dist/chunk-FJ6IEMOS.js +0 -1
  305. package/dist/chunk-FMI4CWFL.js +0 -1
  306. package/dist/chunk-G6Q3DUMJ.js +0 -1
  307. package/dist/chunk-GDDPCDLG.js +0 -1
  308. package/dist/chunk-GFOT6UBB.js +0 -1
  309. package/dist/chunk-JJTF75VS.js +0 -1
  310. package/dist/chunk-K2WYIVHM.js +0 -1
  311. package/dist/chunk-KTWBUJO5.js +0 -61
  312. package/dist/chunk-M27MVZCP.js +0 -1
  313. package/dist/chunk-NKKUUKPD.js +0 -43
  314. package/dist/chunk-O32GJOUJ.js +0 -1
  315. package/dist/chunk-QKBCTKH7.js +0 -1
  316. package/dist/chunk-QWVQIL3T.js +0 -1
  317. package/dist/chunk-UODQF4EY.js +0 -1
  318. package/dist/chunk-WGST56ZH.js +0 -80
  319. package/dist/chunk-WSLN4JFO.js +0 -1
  320. package/dist/chunk-XIJKEXWR.js +0 -1
  321. package/dist/imperative-audit-ahAE65a9.d.cts +0 -28
  322. package/dist/imperative-audit-ahAE65a9.d.ts +0 -28
  323. package/dist/index-BCq12BqB.d.ts +0 -139
  324. package/dist/index-BokynmA4.d.cts +0 -186
  325. package/dist/index-DXz9uwcs.d.ts +0 -186
  326. package/dist/index-DbWwMWiB.d.cts +0 -139
  327. package/dist/meta-BGO6C7K9.d.cts +0 -41
  328. package/dist/meta-CC6EPdpK.d.ts +0 -41
  329. package/dist/resilience-OBU472D2.js +0 -1
@@ -1,21 +1,21 @@
1
- export { e as CapabilitiesRegistry, C as ChatMessage, L as LLMAdapter, a as LLMInvokeOptions, b as LLMResponse, M as ModelCapabilities, f as ModelFeatures, g as ModelLimits, h as ModelPricing, i as PriceBreakdown, P as PricingFn, j as PricingRegistry, R as Rate, S as StreamDelta, k as TieredRate, T as TokenUsage, c as ToolCall, d as ToolDefinition, l as composePricing, m as computePrice, n as createCapabilitiesRegistry, o as createPricingRegistry, p as pricingFor, r as registryPricing, z as zeroPrice } from '../../types-BMSGPlpO.cjs';
2
- export { A as AdapterProvider, b as AdapterTier, d as AllTiersExhaustedError, a as CascadeExhaustionReport, C as CascadingLlmAdapterOptions, e as CreateAdapterOptions, O as OpenAICompatAdapterOptions, f as OpenAICompatPreset, g as OpenAISdkLike, h as cascadingLlmAdapter, c as createAdapter, o as openAICompatAdapter, t as tier } from '../../cascading-B25wxpRa.cjs';
3
- export { A as AdapterStats, a as AdmissionScore3DOptions, b as AdmissionScoredOptions, c as AdmissionScores, d as AdmissionThresholds, e as AgentLoopGraph, f as AgentLoopOptions, g as AgentLoopStatus, h as AgentMemoryGraph, j as AgentMemoryOptions, k as AnthropicAdapterOptions, l as AnthropicSdkLike, B as BudgetCaps, m as BudgetExhaustedError, n as BudgetGateBundle, o as BudgetTotals, C as CallStatsEvent, p as ChatStreamGraph, q as ChatStreamOptions, r as ContentDecision, s as ContentGateOptions, t as CostMeterOptions, u as CostMeterReading, D as DEFAULT_DECAY_RATE, v as DryRunAdapterOptions, E as ExtractedToolCall, F as FromLLMOptions, w as FrozenContextOptions, G as GatedStreamHandle, x as GatedStreamOptions, y as GaugesAsContextOptions, z as GoogleAdapterOptions, H as GoogleSdkLike, I as GoogleSdkRequestConfig, J as GoogleSdkRequestParams, K as GraphDefValidation, L as GraphFromSpecOptions, M as HandoffOptions, N as HttpErrorLike, O as KeywordFlag, P as KeywordFlagExtractorOptions, Q as KnobsAsToolsResult, R as LLMConsolidatorOptions, S as LLMExtractorOptions, T as LLMTimeoutError, U as McpToolSchema, V as MemoryRetrievalBundle, W as MemoryRetrievalOptions, X as MemoryTier, Y as MemoryTiersBundle, Z as MemoryTiersOptions, _ as MemoryWithKGOptions, $ as MemoryWithTiersOptions, a0 as MemoryWithVectorsOptions, a1 as OpenAIToolSchema, a2 as PromptNodeOptions, a3 as RedactorOptions, a4 as ResilientAdapterBundle, a5 as ResilientAdapterOptions, a6 as RetrievalEntry, a7 as RetrievalPipelineOptions, a8 as RetrievalQuery, a9 as RetrievalTrace, aa as StampedDelta, ab as StrategyOperation, ac as StrategyPlan, ad as StreamingPromptNodeHandle, ae as StreamingPromptNodeOptions, af as SuggestStrategyOptions, ag as SystemPromptHandle, ah as ToolExecutionOptions, ai as ToolRegistryGraph, aj as ToolRegistryOptions, ak as ToolResult, al as ToolSelectorOptions, am as WithBreakerOptions, an as WithBudgetGateOptions, ao as WithDryRunBundle, ap as WithDryRunOptions, aq as WithRateLimiterOptions, ar as WithRetryOptions, as as admissionFilter3D, at as admissionScored, au as agentLoop, av as agentMemory, aw as anthropicAdapter, ax as chatStream, ay as contentGate, az as costMeterExtractor, aA as dryRunAdapter, aB as fromLLM, aC as frozenContext, aD as gatedStream, aE as gaugesAsContext, aF as googleAdapter, aG as graphFromSpec, aH as graphFromSpecReactive, aI as handoff, aJ as keywordFlagExtractor, aK as knobsAsTools, aL as llmConsolidator, aM as llmExtractor, aN as memoryRetrieval, aO as memoryWithKG, aP as memoryWithTiers, aQ as memoryWithVectors, aR as observableAdapter, aS as parseRateLimitFromError, aT as promptNode, aU as redactor, aV as resilientAdapter, aW as streamExtractor, aX as streamingPromptNode, aY as suggestStrategy, aZ as suggestStrategyReactive, a_ as systemPromptBuilder, a$ as toolCallExtractor, b0 as toolExecution, b1 as toolRegistry, b2 as toolSelector, b3 as validateGraphDef, b4 as withBreaker, b5 as withBudgetGate, b6 as withDryRun, b7 as withRateLimiter, b8 as withRetry, b9 as withTimeout } from '../../index-CkN8CZlT.cjs';
4
- export { F as FallbackAdapterOptions, a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy, R as ReplayCacheKeyContext, d as ReplayCacheMissError, e as ReplayCacheMode, W as WithReplayCacheOptions, f as canonicalJson, g as fallbackAdapter, w as withReplayCache } from '../../fallback-axI2cXwt.cjs';
5
- export { f as CircuitOpenError } from '../../resilience-BWP2c7Af.cjs';
6
- import '../../node-fSc-hCv8.cjs';
1
+ export { e as CapabilitiesRegistry, C as ChatMessage, L as LLMAdapter, a as LLMInvokeOptions, b as LLMResponse, M as ModelCapabilities, f as ModelFeatures, g as ModelLimits, h as ModelPricing, i as PriceBreakdown, P as PricingFn, j as PricingRegistry, R as Rate, S as StreamDelta, k as TieredRate, T as TokenUsage, c as ToolCall, d as ToolDefinition, l as composePricing, m as computePrice, n as createCapabilitiesRegistry, o as createPricingRegistry, p as pricingFor, r as registryPricing, z as zeroPrice } from '../../types-1Dhoi7HM.cjs';
2
+ export { A as AdapterProvider, b as AdapterTier, d as AllTiersExhaustedError, a as CascadeExhaustionReport, C as CascadingLlmAdapterOptions, e as CreateAdapterOptions, O as OpenAICompatAdapterOptions, f as OpenAICompatPreset, g as OpenAISdkLike, h as cascadingLlmAdapter, c as createAdapter, o as openAICompatAdapter, t as tier } from '../../cascading-BzuxW0_w.cjs';
3
+ export { A as AdapterStats, a as AdmissionScore3DOptions, b as AdmissionScoredOptions, c as AdmissionScores, d as AdmissionThresholds, e as AgentLoopGraph, f as AgentLoopOptions, g as AgentLoopStatus, h as AgentMemoryGraph, j as AgentMemoryOptions, k as AnthropicAdapterOptions, l as AnthropicSdkLike, B as BudgetCaps, m as BudgetExhaustedError, n as BudgetGateBundle, o as BudgetTotals, C as CallStatsEvent, p as ChatStreamGraph, q as ChatStreamOptions, r as ContentDecision, s as ContentGateOptions, t as CostMeterOptions, u as CostMeterReading, D as DEFAULT_DECAY_RATE, v as DryRunAdapterOptions, E as ExtractedToolCall, F as FrozenContextOptions, G as GatedStreamHandle, w as GatedStreamOptions, x as GaugesAsContextOptions, y as GoogleAdapterOptions, z as GoogleSdkLike, H as GoogleSdkRequestConfig, I as GoogleSdkRequestParams, J as GraphDefValidation, K as GraphFromSpecOptions, L as HandoffOptions, M as HttpErrorLike, N as KeywordFlag, O as KeywordFlagExtractorOptions, P as KnobsAsToolsResult, Q as LLMConsolidatorOptions, R as LLMExtractorOptions, S as LLMTimeoutError, T as McpToolSchema, U as MemoryRetrievalBundle, V as MemoryRetrievalOptions, W as MemoryTier, X as MemoryTiersBundle, Y as MemoryTiersOptions, Z as MemoryWithKGOptions, _ as MemoryWithTiersOptions, $ as MemoryWithVectorsOptions, a0 as OpenAIToolSchema, a1 as PromptNodeOptions, a2 as RedactorOptions, a3 as ResilientAdapterBundle, a4 as ResilientAdapterOptions, a5 as RetrievalEntry, a6 as RetrievalPipelineOptions, a7 as RetrievalQuery, a8 as RetrievalTrace, a9 as StampedDelta, aa as StrategyOperation, ab as StrategyPlan, ac as StreamingPromptNodeHandle, ad as StreamingPromptNodeOptions, ae as SuggestStrategyOptions, af as SystemPromptHandle, ag as ToolExecutionOptions, ah as ToolRegistryGraph, ai as ToolRegistryOptions, aj as ToolResult, ak as ToolSelectorOptions, al as WithBreakerOptions, am as WithBudgetGateOptions, an as WithDryRunBundle, ao as WithDryRunOptions, ap as WithRateLimiterOptions, aq as WithRetryOptions, ar as admissionFilter3D, as as admissionScored, at as agentLoop, au as agentMemory, av as anthropicAdapter, aw as chatStream, ax as contentGate, ay as costMeterExtractor, az as dryRunAdapter, aA as frozenContext, aB as gatedStream, aC as gaugesAsContext, aD as googleAdapter, aE as graphFromSpec, aF as graphFromSpecReactive, aG as handoff, aH as keywordFlagExtractor, aI as knobsAsTools, aJ as llmConsolidator, aK as llmExtractor, aL as memoryRetrieval, aM as memoryWithKG, aN as memoryWithTiers, aO as memoryWithVectors, aP as observableAdapter, aQ as parseRateLimitFromError, aR as promptNode, aS as redactor, aT as resilientAdapter, aU as streamExtractor, aV as streamingPromptNode, aW as suggestStrategy, aX as suggestStrategyReactive, aY as systemPromptBuilder, aZ as toolCallExtractor, a_ as toolExecution, a$ as toolRegistry, b0 as toolSelector, b1 as validateGraphDef, b2 as withBreaker, b3 as withBudgetGate, b4 as withDryRun, b5 as withRateLimiter, b6 as withRetry, b7 as withTimeout } from '../../index-pVDQcbar.cjs';
4
+ export { F as FallbackAdapterOptions, a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy, R as ReplayCacheKeyContext, d as ReplayCacheMissError, e as ReplayCacheMode, W as WithReplayCacheOptions, f as canonicalJson, g as fallbackAdapter, w as withReplayCache } from '../../fallback-8JYU8tlT.cjs';
5
+ export { f as CircuitOpenError } from '../../index-CwP_KAMS.cjs';
6
+ import '../../node-BYInONRr.cjs';
7
7
  import '../../extra/sources.cjs';
8
- import '../../reactive-log-ScpWyqny.cjs';
8
+ import '../../reactive-log-_zeEnB9H.cjs';
9
9
  import '../../extra/storage-tiers.cjs';
10
- import '../../graph-CaNXUc3c.cjs';
11
- import '../../meta-BGO6C7K9.cjs';
10
+ import '../../graph-BUwMAxJI.cjs';
11
+ import '../../meta-Ct9nqQS5.cjs';
12
12
  import '../../extra/storage-core.cjs';
13
- import '../../index-DAKm44My.cjs';
14
- import '../../pipeline-graph-BrrYGjuZ.cjs';
15
- import '../../sugar-DgaGJcI6.cjs';
16
- import '../../imperative-audit-ahAE65a9.cjs';
17
- import '../../composite-_XckYx2e.cjs';
18
- import '../../reactive-map-DmgeADH8.cjs';
19
- import '../../index-DbWwMWiB.cjs';
20
- import '../../index-DCAuN9u5.cjs';
13
+ import '../../index-BndG0cpK.cjs';
14
+ import '../../pipeline-graph-BQPr2Lqs.cjs';
15
+ import '../../sugar-DzePN5-g.cjs';
16
+ import '../../index-DINuaZlJ.cjs';
17
+ import '../../composite-CKd0e2vz.cjs';
18
+ import '../../reactive-map-B2qfD3hb.cjs';
19
+ import '../../index-L8XI8Zql.cjs';
20
+ import '../../index-DlrWu9Hs.cjs';
21
21
  import '../../content-addressed-storage-4-ST1tYk.cjs';
@@ -1,21 +1,21 @@
1
- export { e as CapabilitiesRegistry, C as ChatMessage, L as LLMAdapter, a as LLMInvokeOptions, b as LLMResponse, M as ModelCapabilities, f as ModelFeatures, g as ModelLimits, h as ModelPricing, i as PriceBreakdown, P as PricingFn, j as PricingRegistry, R as Rate, S as StreamDelta, k as TieredRate, T as TokenUsage, c as ToolCall, d as ToolDefinition, l as composePricing, m as computePrice, n as createCapabilitiesRegistry, o as createPricingRegistry, p as pricingFor, r as registryPricing, z as zeroPrice } from '../../types-CidcBDuk.js';
2
- export { A as AdapterProvider, b as AdapterTier, d as AllTiersExhaustedError, a as CascadeExhaustionReport, C as CascadingLlmAdapterOptions, e as CreateAdapterOptions, O as OpenAICompatAdapterOptions, f as OpenAICompatPreset, g as OpenAISdkLike, h as cascadingLlmAdapter, c as createAdapter, o as openAICompatAdapter, t as tier } from '../../cascading-BsJ4GbnS.js';
3
- export { A as AdapterStats, a as AdmissionScore3DOptions, b as AdmissionScoredOptions, c as AdmissionScores, d as AdmissionThresholds, e as AgentLoopGraph, f as AgentLoopOptions, g as AgentLoopStatus, h as AgentMemoryGraph, j as AgentMemoryOptions, k as AnthropicAdapterOptions, l as AnthropicSdkLike, B as BudgetCaps, m as BudgetExhaustedError, n as BudgetGateBundle, o as BudgetTotals, C as CallStatsEvent, p as ChatStreamGraph, q as ChatStreamOptions, r as ContentDecision, s as ContentGateOptions, t as CostMeterOptions, u as CostMeterReading, D as DEFAULT_DECAY_RATE, v as DryRunAdapterOptions, E as ExtractedToolCall, F as FromLLMOptions, w as FrozenContextOptions, G as GatedStreamHandle, x as GatedStreamOptions, y as GaugesAsContextOptions, z as GoogleAdapterOptions, H as GoogleSdkLike, I as GoogleSdkRequestConfig, J as GoogleSdkRequestParams, K as GraphDefValidation, L as GraphFromSpecOptions, M as HandoffOptions, N as HttpErrorLike, O as KeywordFlag, P as KeywordFlagExtractorOptions, Q as KnobsAsToolsResult, R as LLMConsolidatorOptions, S as LLMExtractorOptions, T as LLMTimeoutError, U as McpToolSchema, V as MemoryRetrievalBundle, W as MemoryRetrievalOptions, X as MemoryTier, Y as MemoryTiersBundle, Z as MemoryTiersOptions, _ as MemoryWithKGOptions, $ as MemoryWithTiersOptions, a0 as MemoryWithVectorsOptions, a1 as OpenAIToolSchema, a2 as PromptNodeOptions, a3 as RedactorOptions, a4 as ResilientAdapterBundle, a5 as ResilientAdapterOptions, a6 as RetrievalEntry, a7 as RetrievalPipelineOptions, a8 as RetrievalQuery, a9 as RetrievalTrace, aa as StampedDelta, ab as StrategyOperation, ac as StrategyPlan, ad as StreamingPromptNodeHandle, ae as StreamingPromptNodeOptions, af as SuggestStrategyOptions, ag as SystemPromptHandle, ah as ToolExecutionOptions, ai as ToolRegistryGraph, aj as ToolRegistryOptions, ak as ToolResult, al as ToolSelectorOptions, am as WithBreakerOptions, an as WithBudgetGateOptions, ao as WithDryRunBundle, ap as WithDryRunOptions, aq as WithRateLimiterOptions, ar as WithRetryOptions, as as admissionFilter3D, at as admissionScored, au as agentLoop, av as agentMemory, aw as anthropicAdapter, ax as chatStream, ay as contentGate, az as costMeterExtractor, aA as dryRunAdapter, aB as fromLLM, aC as frozenContext, aD as gatedStream, aE as gaugesAsContext, aF as googleAdapter, aG as graphFromSpec, aH as graphFromSpecReactive, aI as handoff, aJ as keywordFlagExtractor, aK as knobsAsTools, aL as llmConsolidator, aM as llmExtractor, aN as memoryRetrieval, aO as memoryWithKG, aP as memoryWithTiers, aQ as memoryWithVectors, aR as observableAdapter, aS as parseRateLimitFromError, aT as promptNode, aU as redactor, aV as resilientAdapter, aW as streamExtractor, aX as streamingPromptNode, aY as suggestStrategy, aZ as suggestStrategyReactive, a_ as systemPromptBuilder, a$ as toolCallExtractor, b0 as toolExecution, b1 as toolRegistry, b2 as toolSelector, b3 as validateGraphDef, b4 as withBreaker, b5 as withBudgetGate, b6 as withDryRun, b7 as withRateLimiter, b8 as withRetry, b9 as withTimeout } from '../../index-BmLkcDlj.js';
4
- export { F as FallbackAdapterOptions, a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy, R as ReplayCacheKeyContext, d as ReplayCacheMissError, e as ReplayCacheMode, W as WithReplayCacheOptions, f as canonicalJson, g as fallbackAdapter, w as withReplayCache } from '../../fallback-DuEXfA4F.js';
5
- export { f as CircuitOpenError } from '../../resilience-Bys63Cpd.js';
6
- import '../../node-fSc-hCv8.js';
1
+ export { e as CapabilitiesRegistry, C as ChatMessage, L as LLMAdapter, a as LLMInvokeOptions, b as LLMResponse, M as ModelCapabilities, f as ModelFeatures, g as ModelLimits, h as ModelPricing, i as PriceBreakdown, P as PricingFn, j as PricingRegistry, R as Rate, S as StreamDelta, k as TieredRate, T as TokenUsage, c as ToolCall, d as ToolDefinition, l as composePricing, m as computePrice, n as createCapabilitiesRegistry, o as createPricingRegistry, p as pricingFor, r as registryPricing, z as zeroPrice } from '../../types-39jk0kaV.js';
2
+ export { A as AdapterProvider, b as AdapterTier, d as AllTiersExhaustedError, a as CascadeExhaustionReport, C as CascadingLlmAdapterOptions, e as CreateAdapterOptions, O as OpenAICompatAdapterOptions, f as OpenAICompatPreset, g as OpenAISdkLike, h as cascadingLlmAdapter, c as createAdapter, o as openAICompatAdapter, t as tier } from '../../cascading-g2_rhhaM.js';
3
+ export { A as AdapterStats, a as AdmissionScore3DOptions, b as AdmissionScoredOptions, c as AdmissionScores, d as AdmissionThresholds, e as AgentLoopGraph, f as AgentLoopOptions, g as AgentLoopStatus, h as AgentMemoryGraph, j as AgentMemoryOptions, k as AnthropicAdapterOptions, l as AnthropicSdkLike, B as BudgetCaps, m as BudgetExhaustedError, n as BudgetGateBundle, o as BudgetTotals, C as CallStatsEvent, p as ChatStreamGraph, q as ChatStreamOptions, r as ContentDecision, s as ContentGateOptions, t as CostMeterOptions, u as CostMeterReading, D as DEFAULT_DECAY_RATE, v as DryRunAdapterOptions, E as ExtractedToolCall, F as FrozenContextOptions, G as GatedStreamHandle, w as GatedStreamOptions, x as GaugesAsContextOptions, y as GoogleAdapterOptions, z as GoogleSdkLike, H as GoogleSdkRequestConfig, I as GoogleSdkRequestParams, J as GraphDefValidation, K as GraphFromSpecOptions, L as HandoffOptions, M as HttpErrorLike, N as KeywordFlag, O as KeywordFlagExtractorOptions, P as KnobsAsToolsResult, Q as LLMConsolidatorOptions, R as LLMExtractorOptions, S as LLMTimeoutError, T as McpToolSchema, U as MemoryRetrievalBundle, V as MemoryRetrievalOptions, W as MemoryTier, X as MemoryTiersBundle, Y as MemoryTiersOptions, Z as MemoryWithKGOptions, _ as MemoryWithTiersOptions, $ as MemoryWithVectorsOptions, a0 as OpenAIToolSchema, a1 as PromptNodeOptions, a2 as RedactorOptions, a3 as ResilientAdapterBundle, a4 as ResilientAdapterOptions, a5 as RetrievalEntry, a6 as RetrievalPipelineOptions, a7 as RetrievalQuery, a8 as RetrievalTrace, a9 as StampedDelta, aa as StrategyOperation, ab as StrategyPlan, ac as StreamingPromptNodeHandle, ad as StreamingPromptNodeOptions, ae as SuggestStrategyOptions, af as SystemPromptHandle, ag as ToolExecutionOptions, ah as ToolRegistryGraph, ai as ToolRegistryOptions, aj as ToolResult, ak as ToolSelectorOptions, al as WithBreakerOptions, am as WithBudgetGateOptions, an as WithDryRunBundle, ao as WithDryRunOptions, ap as WithRateLimiterOptions, aq as WithRetryOptions, ar as admissionFilter3D, as as admissionScored, at as agentLoop, au as agentMemory, av as anthropicAdapter, aw as chatStream, ax as contentGate, ay as costMeterExtractor, az as dryRunAdapter, aA as frozenContext, aB as gatedStream, aC as gaugesAsContext, aD as googleAdapter, aE as graphFromSpec, aF as graphFromSpecReactive, aG as handoff, aH as keywordFlagExtractor, aI as knobsAsTools, aJ as llmConsolidator, aK as llmExtractor, aL as memoryRetrieval, aM as memoryWithKG, aN as memoryWithTiers, aO as memoryWithVectors, aP as observableAdapter, aQ as parseRateLimitFromError, aR as promptNode, aS as redactor, aT as resilientAdapter, aU as streamExtractor, aV as streamingPromptNode, aW as suggestStrategy, aX as suggestStrategyReactive, aY as systemPromptBuilder, aZ as toolCallExtractor, a_ as toolExecution, a$ as toolRegistry, b0 as toolSelector, b1 as validateGraphDef, b2 as withBreaker, b3 as withBudgetGate, b4 as withDryRun, b5 as withRateLimiter, b6 as withRetry, b7 as withTimeout } from '../../index-89FczVZ_.js';
4
+ export { F as FallbackAdapterOptions, a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy, R as ReplayCacheKeyContext, d as ReplayCacheMissError, e as ReplayCacheMode, W as WithReplayCacheOptions, f as canonicalJson, g as fallbackAdapter, w as withReplayCache } from '../../fallback-CMZl39L5.js';
5
+ export { f as CircuitOpenError } from '../../index-CmqiJZKM.js';
6
+ import '../../node-BYInONRr.js';
7
7
  import '../../extra/sources.js';
8
- import '../../reactive-log-jirQsxMY.js';
8
+ import '../../reactive-log-BlAsPLl2.js';
9
9
  import '../../extra/storage-tiers.js';
10
- import '../../graph-YQXDndFy.js';
11
- import '../../meta-CC6EPdpK.js';
10
+ import '../../graph-30XSgtVX.js';
11
+ import '../../meta-D8OyedKp.js';
12
12
  import '../../extra/storage-core.js';
13
- import '../../index-D0ZxFXYl.js';
14
- import '../../pipeline-graph-DX2Twdj-.js';
15
- import '../../sugar-D13E2M_z.js';
16
- import '../../imperative-audit-ahAE65a9.js';
17
- import '../../composite-CT_mApQD.js';
18
- import '../../reactive-map-CHyeCf4D.js';
19
- import '../../index-BCq12BqB.js';
20
- import '../../index-D1E1tqHT.js';
13
+ import '../../index-DszPlZzK.js';
14
+ import '../../pipeline-graph-D8vKcO_p.js';
15
+ import '../../sugar-BhfjgetH.js';
16
+ import '../../index-CusEP3Sv.js';
17
+ import '../../composite-DGatA-JK.js';
18
+ import '../../reactive-map-jFIsE6Kt.js';
19
+ import '../../index-DQUVq1_d.js';
20
+ import '../../index-BKMdnYnk.js';
21
21
  import '../../content-addressed-storage-DuYMjV7o.js';
@@ -1 +1 @@
1
- import{$ as na,A as O,B as P,C as Q,D as R,E as S,F as T,G as U,H as V,I as W,J as X,K as Y,L as Z,M as _,N as $,O as aa,P as ba,Q as ca,R as da,S as ea,T as fa,U as ga,V as ha,W as ia,X as ja,Y as ka,Z as la,_ as ma,a as b,aa as oa,b as m,ba as pa,c as n,d as o,e as p,f as q,g as r,h as s,i as t,j as u,k as v,l as w,m as x,n as y,o as C,p as D,q as E,r as F,s as G,t as H,u as I,v as J,w as K,x as L,y as M,z as N}from"../../chunk-KTWBUJO5.js";import"../../chunk-QKBCTKH7.js";import"../../chunk-GFOT6UBB.js";import{a as c,b as j,c as k,d as l,e as z,f as A,g as B}from"../../chunk-PCD2MU7X.js";import{a as d,g as e,h as f,i as g,j as h,k as i}from"../../chunk-5CPPC75H.js";import"../../chunk-U3COB5WU.js";import"../../chunk-WGST56ZH.js";import"../../chunk-XIJKEXWR.js";import"../../chunk-FJ6IEMOS.js";import"../../chunk-O32GJOUJ.js";import"../../chunk-QWVQIL3T.js";import"../../chunk-M27MVZCP.js";import"../../chunk-6SVKZ7VI.js";import"../../chunk-MYFR67PY.js";import{b as a}from"../../chunk-A5HZZYRK.js";import"../../chunk-Q7EUZ6NN.js";import"../../chunk-B4L5X2QO.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-533RQFF6.js";import"../../chunk-D5RFJOZ2.js";import"../../chunk-CE72X3WO.js";import"../../chunk-JJTF75VS.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-TZQPPQEQ.js";import"../../chunk-KUVDFOJH.js";import"../../chunk-MQZWA3DF.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{X as AgentLoopGraph,z as AllTiersExhaustedError,u as BudgetExhaustedError,S as ChatStreamGraph,a as CircuitOpenError,da as DEFAULT_DECAY_RATE,h as FallbackMissError,D as LLMTimeoutError,e as ReplayCacheMissError,V as ToolRegistryGraph,aa as admissionFilter3D,$ as admissionScored,Y as agentLoop,ia as agentMemory,c as anthropicAdapter,g as canonicalJson,A as cascadingLlmAdapter,T as chatStream,r as composePricing,o as computePrice,Q as contentGate,M as costMeterExtractor,l as createAdapter,b as createCapabilitiesRegistry,p as createPricingRegistry,d as dryRunAdapter,i as fallbackAdapter,G as fromLLM,H as frozenContext,K as gatedStream,ja as gaugesAsContext,j as googleAdapter,ka as graphFromSpec,la as graphFromSpecReactive,Z as handoff,N as keywordFlagExtractor,ma as knobsAsTools,ca as llmConsolidator,ba as llmExtractor,ha as memoryRetrieval,fa as memoryWithKG,ga as memoryWithTiers,ea as memoryWithVectors,m as observableAdapter,k as openAICompatAdapter,x as parseRateLimitFromError,s as pricingFor,I as promptNode,R as redactor,q as registryPricing,F as resilientAdapter,O as streamExtractor,J as streamingPromptNode,na as suggestStrategy,oa as suggestStrategyReactive,L as systemPromptBuilder,B as tier,P as toolCallExtractor,U as toolExecution,W as toolRegistry,_ as toolSelector,pa as validateGraphDef,t as withBreaker,v as withBudgetGate,w as withDryRun,y as withRateLimiter,f as withReplayCache,C as withRetry,E as withTimeout,n as zeroPrice};
1
+ import{$ as na,A as O,B as P,C as Q,D as R,E as S,F as T,G as U,H as V,I as W,J as X,K as Y,L as Z,M as _,N as $,O as aa,P as ba,Q as ca,R as da,S as ea,T as fa,U as ga,V as ha,W as ia,X as ja,Y as ka,Z as la,_ as ma,a as b,aa as oa,b as m,c as n,d as o,e as p,f as q,g as r,h as s,i as t,j as u,k as v,l as w,m as x,n as y,o as C,p as D,q as E,r as F,s as G,t as H,u as I,v as J,w as K,x as L,y as M,z as N}from"../../chunk-EWF7KCDJ.js";import"../../chunk-7QFRK3N3.js";import"../../chunk-HX3EGQ5Z.js";import"../../chunk-NQI2C36M.js";import{a as c,b as j,c as k,d as l,e as z,f as A,g as B}from"../../chunk-GEAO3TL3.js";import{a as d,g as e,h as f,i as g,j as h,k as i}from"../../chunk-TFPZLQ5H.js";import"../../chunk-N7UIBZCW.js";import"../../chunk-LQNOXGET.js";import"../../chunk-R75BMDLA.js";import"../../chunk-3G5U5QNE.js";import"../../chunk-C72GO4IZ.js";import"../../chunk-4I45FVQS.js";import"../../chunk-WHIZM6JV.js";import"../../chunk-ZJ7SM3G2.js";import"../../chunk-INH6FS2G.js";import{c as a}from"../../chunk-IUB4NYI2.js";import"../../chunk-CGDMTXSY.js";import"../../chunk-VJJLIEAL.js";import"../../chunk-L6NSJVJZ.js";import"../../chunk-7JRF5YEK.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-D5RFJOZ2.js";import"../../chunk-CE72X3WO.js";import"../../chunk-L7WY6TZS.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-35JTVPOX.js";import"../../chunk-TZQPPQEQ.js";import"../../chunk-AU7YTQX7.js";import"../../chunk-IA7DUNGB.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{W as AgentLoopGraph,z as AllTiersExhaustedError,u as BudgetExhaustedError,R as ChatStreamGraph,a as CircuitOpenError,ca as DEFAULT_DECAY_RATE,h as FallbackMissError,D as LLMTimeoutError,e as ReplayCacheMissError,U as ToolRegistryGraph,$ as admissionFilter3D,_ as admissionScored,X as agentLoop,ha as agentMemory,c as anthropicAdapter,g as canonicalJson,A as cascadingLlmAdapter,S as chatStream,r as composePricing,o as computePrice,P as contentGate,L as costMeterExtractor,l as createAdapter,b as createCapabilitiesRegistry,p as createPricingRegistry,d as dryRunAdapter,i as fallbackAdapter,G as frozenContext,J as gatedStream,ia as gaugesAsContext,j as googleAdapter,ja as graphFromSpec,ka as graphFromSpecReactive,Y as handoff,M as keywordFlagExtractor,la as knobsAsTools,ba as llmConsolidator,aa as llmExtractor,ga as memoryRetrieval,ea as memoryWithKG,fa as memoryWithTiers,da as memoryWithVectors,m as observableAdapter,k as openAICompatAdapter,x as parseRateLimitFromError,s as pricingFor,H as promptNode,Q as redactor,q as registryPricing,F as resilientAdapter,N as streamExtractor,I as streamingPromptNode,ma as suggestStrategy,na as suggestStrategyReactive,K as systemPromptBuilder,B as tier,O as toolCallExtractor,T as toolExecution,V as toolRegistry,Z as toolSelector,oa as validateGraphDef,t as withBreaker,v as withBudgetGate,w as withDryRun,y as withRateLimiter,f as withReplayCache,C as withRetry,E as withTimeout,n as zeroPrice};
@@ -1 +1 @@
1
- "use strict";var ce=Object.defineProperty;var kt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var At=Object.prototype.hasOwnProperty;var x=(t,e)=>()=>(t&&(e=t(t=0)),e);var St=(t,e)=>{for(var n in e)ce(t,n,{get:e[n],enumerable:!0})},Mt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of xt(e))!At.call(t,o)&&o!==n&&ce(t,o,{get:()=>e[o],enumerable:!(r=kt(e,o))||r.enumerable});return t};var Nt=t=>Mt(ce({},"__esModule",{value:!0}),t);function Re(){return Math.trunc(performance.now()*1e6)}function D(){return Date.now()*1e6}var Y=x(()=>{"use strict"});var G,A,L,O,I,V,$,R,S,y,H,ye,Pt,me,Dt,It,be,De,Ie,Ve,ve,X=x(()=>{"use strict";G=Symbol.for("graphrefly/START"),A=Symbol.for("graphrefly/DATA"),L=Symbol.for("graphrefly/DIRTY"),O=Symbol.for("graphrefly/RESOLVED"),I=Symbol.for("graphrefly/INVALIDATE"),V=Symbol.for("graphrefly/PAUSE"),$=Symbol.for("graphrefly/RESUME"),R=Symbol.for("graphrefly/TEARDOWN"),S=Symbol.for("graphrefly/COMPLETE"),y=Symbol.for("graphrefly/ERROR"),H=Object.freeze([L]),ye=Object.freeze([O]),Pt=Object.freeze([I]),me=Object.freeze([G]),Dt=Object.freeze([S]),It=Object.freeze([R]),be=Object.freeze([H]),De=Object.freeze([ye]),Ie=Object.freeze([Pt]),Ve=Object.freeze([Dt]),ve=Object.freeze([It])});function Ge(t){t.registerCodec(Vt)}var Vt,He=x(()=>{"use strict";Vt={name:"json",version:1,contentType:"application/json",encode(t){let e=JSON.stringify(t);return new TextEncoder().encode(e)},decode(t,e){let n=new TextDecoder().decode(t);return JSON.parse(n)}}});function Z(t){if(t==null)return Gt;let{type:e,id:n,...r}=t;return{type:e??"system",id:n??"",...r}}var Gt,Ue=x(()=>{"use strict";Gt={type:"system",id:""}});function We(){return _e>0||Ht}function $e(){return _e>0}function ze(t){_e>0?Ut.push(t):t()}function Q(t,e,n){if(e.length===0)return;if(e.length===1){let c=n(e[0][0]);if(c<3||!We()){t(e);return}(c>=5?Be:c===4?Ke:je).push(()=>t(e));return}let r=e.length,o=r,i=r,d=r,s=0;for(;s<r&&n(e[s][0])<3;)s++;for(o=s;s<r&&n(e[s][0])===3;)s++;for(i=s;s<r&&n(e[s][0])===4;)s++;d=s;let a=We();if(o>0){let c=e.slice(0,o);t(c)}if(i>o){let c=e.slice(o,i);a?je.push(()=>t(c)):t(c)}if(d>i){let c=e.slice(i,d);a?Ke.push(()=>t(c)):t(c)}if(r>d){let c=e.slice(d,r);a?Be.push(()=>t(c)):t(c)}}var _e,Ht,je,Ke,Be,Ut,qe=x(()=>{"use strict";_e=0,Ht=!1,je=[],Ke=[],Be=[],Ut=[]});function Ye(t){t.registerMessageType(G,{tier:0,wireCrossing:!1}),t.registerMessageType(L,{tier:1,wireCrossing:!1}),t.registerMessageType(I,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(V,{tier:2,wireCrossing:!1}),t.registerMessageType($,{tier:2,wireCrossing:!1}),t.registerMessageType(A,{tier:3,wireCrossing:!0}),t.registerMessageType(O,{tier:3,wireCrossing:!0}),t.registerMessageType(S,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(y,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(R,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var ee,Je=x(()=>{"use strict";X();ee=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let r=this._messageTypes.get(n);return r!=null?r.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var U,Xe=x(()=>{"use strict";U=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function Te(t){if(t===void 0)return null;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Cannot hash non-finite number: ${t}`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${t}. Cross-language cid parity is not guaranteed for unsafe integers.`);return t}if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(Array.isArray(t))return t.map(Te);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Te(t[n]);return e}return null}function Bt(t){let e=Kt.encode(t),n=e.length,r=n*8,o=n+9+63&-64,i=new Uint8Array(o);i.set(e),i[n]=128;let d=new DataView(i.buffer);d.setUint32(o-4,r>>>0,!1),d.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let s=1779033703,a=3144134277,c=1013904242,l=2773480762,u=1359893119,p=2600822924,f=528734635,h=1541459225,m=new Uint32Array(64),v=(M,w)=>M>>>w|M<<32-w;for(let M=0;M<o;M+=64){for(let _=0;_<16;_++)m[_]=d.getUint32(M+_*4,!1);for(let _=16;_<64;_++){let B=m[_-15],W=m[_-2],q=v(B,7)^v(B,18)^B>>>3,de=v(W,17)^v(W,19)^W>>>10;m[_]=m[_-16]+q+m[_-7]+de>>>0}let w=s,E=a,N=c,g=l,b=u,C=p,F=f,ae=h;for(let _=0;_<64;_++){let B=v(b,6)^v(b,11)^v(b,25),W=b&C^~b&F,q=ae+B+W+jt[_]+m[_]>>>0,de=v(w,2)^v(w,13)^v(w,22),Tt=w&E^w&N^E&N,wt=de+Tt>>>0;ae=F,F=C,C=b,b=g+q>>>0,g=N,N=E,E=w,w=q+wt>>>0}s=s+w>>>0,a=a+E>>>0,c=c+N>>>0,l=l+g>>>0,u=u+b>>>0,p=p+C>>>0,f=f+F>>>0,h=h+ae>>>0}let T=M=>M.toString(16).padStart(8,"0");return T(s)+T(a)+T(c)+T(l)+T(u)+T(p)+T(f)+T(h)}function we(t){let e=Te(t??null),n=JSON.stringify(e);return Bt(n).slice(0,16)}function Wt(){let t=globalThis.crypto;if(t?.randomUUID)return t.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function ke(t,e,n){let r=n?.id??Wt();if(t===0)return{id:r,version:0};let i=(n?.hash??we)(e);return{id:r,version:0,cid:i,prev:null}}function Ze(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var jt,Kt,Qe=x(()=>{"use strict";jt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Kt=new TextEncoder});function nt(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function xe(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function te(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function ot(t,e,n){let r=rt(t)?t:[],o=typeof t=="function"?t:typeof e=="function"?e:void 0,i={};return rt(t)?i=(Ae(e)?e:n)??{}:Ae(t)?i=t:i=(Ae(e)?e:n)??{},new ne(r,o,i)}var et,tt,$t,zt,Se,ne,rt,Ae,st=x(()=>{"use strict";He();Ue();qe();Y();Je();Xe();X();Qe();et=()=>{},tt=100;$t=(t,e,n,r)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},zt=(t,e,n,r)=>{let o=t;if(o._status==="completed"||o._status==="errored")return;let i=o._cached,d=i===void 0?[me]:[me,[A,i]];o._status==="dirty"&&d.push(H),Q(e,d,o._config.tierOf)},Se=new ee({onMessage:$t,onSubscribe:zt});Ye(Se);Ge(Se);ne=class t{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,n,r){this._config=r.config??Se,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=n,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??we;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?ke(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(nt);let i={};for(let[s,a]of Object.entries(r.meta??{})){let c={initial:a,name:`${r.name??"node"}:meta:${s}`,describeKind:"state",config:this._config};r.guard!=null&&(c.guard=r.guard),i[s]=new t([],void 0,c)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let d=this;this._actions={emit(s){d._emit([[A,s]])},down(s){d._emit(te(s))},up(s){d._emitUp(te(s))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,n){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let r=this._versioningLevel;if(r!=null&&e<=r)return;let o=n?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let i=this._cached===void 0?void 0:this._cached,d=this._versioning,s=d?.id??n?.id,a=d?.version??0,c=ke(e,i,{id:s,hash:o});c.version=a,this._versioning=c,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let n=Z(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!n&&!r)return;let o=Z(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,i))throw new U({actor:o,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let d of this._extraGuards)if(!d(o,i))throw new U({actor:o,action:i,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:D()}}down(e,n){let r=te(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[A,e]])}up(e,n){if(this._deps.length===0)return;let r=te(e);if(r.length===0)return;this._checkGuard(n);let o=n??{internal:!0};this._validateUpTiers(r);for(let i of this._deps)i.node.up?.(r,o)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let r of e){let o=n(r[0]);if(o===3||o===4)throw new Error(`Node "${this.name}": tier-${o} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,n){if(n!=null&&this._guard!=null){let a=Z(n);if(!this._guard(a,"observe"))throw new U({actor:a,action:"observe",nodeName:this.name})}let o=this._isTerminal&&this._resubscribable;if(o){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let a of this._deps)xe(a);if(this._partial===!1){for(let a of this._deps)if(a.prevData!==void 0||a.dataBatch.length!==0||a.terminal!==void 0||a.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let i;try{i=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:o},this._actions)}catch(a){throw this._sinkCount-=1,a}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let d=this._isTerminal;if(this._sinkCount===1&&!d)try{this._activate()}catch(a){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw a}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let s=!1;return()=>{s||(s=!0,this._sinkCount-=1,this._removeSink(e),typeof i=="function"&&i(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[n]=this._sinks;this._sinks=n}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,n=0;try{for(let r=0;r<e;r++){let o=r,i=this._deps[r];i.unsub=et,i.unsub=i.node.subscribe(d=>{if(i.unsub===null)return;let s=this._config.tierOf,a=!1;for(let c of d)s(c[0])>=3&&(a=!0),this._config.onMessage(this,c,{direction:"down-in",depIndex:o},this._actions);a&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let o=0;o<n;o++){let i=this._deps[o];if(i.unsub!=null){let d=i.unsub;i.unsub=null;try{d()}catch{}xe(i)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let n=this._deps.length,r=nt(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(be),r.unsub=et;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let i=this._config.tierOf,d=!1;for(let s of o)i(s[0])>=3&&(d=!0),this._config.onMessage(this,s,{direction:"down-in",depIndex:n},this._actions);d&&this._maybeRunFnOnSettlement()})}catch(o){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(r){this._emit([[y,this._wrapFnError("cleanup threw",r)]])}else if(n!=null&&typeof n=="object"){let r=n.deactivate;if(typeof r=="function")try{r()}catch(o){this._emit([[y,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let r of this._deps){if(r.unsub!=null){let o=r.unsub;r.unsub=null;try{o()}catch{}}xe(r)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,n){let r=this._deps[e],o=n[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:n};for(let d of this._inspectorHooks)d(i)}if(o!==G){if(o===L){this._depDirtied(r);return}if(o===I){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(Ie);return}if(o===V||o===$){this._emit([n]);return}if(o===R){this._emit(ve);return}if(o===A)this._depSettledAsData(r,n[1]);else if(o===O)this._depSettledAsResolved(r);else if(o===S)this._depSettledAsTerminal(r,!0);else if(o===y)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(o===A||o===O)&&this._emit([n]),(o===S||o===y)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(be))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(De),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[y,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(Ve)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(d){this._emit([[y,this._wrapFnError("cleanup threw",d)]]);return}}else if(e!=null&&typeof e=="object"){let d=e.beforeRun;if(typeof d=="function"){e.beforeRun=void 0;try{d()}catch(s){this._emit([[y,this._wrapFnError("cleanup.beforeRun threw",s)]]);return}}}let n=this._deps.map(d=>d.involvedThisWave?d.dataBatch.length>0?[...d.dataBatch]:[]:void 0),r=this._deps.map(d=>d.prevData);for(let d=0;d<this._deps.length;d++){let s=n[d];s!=null&&s.length>0&&(this._deps[d].prevData=s[s.length-1])}let o=this._deps.map(d=>d.terminal),i={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let d={kind:"run",batchData:n,prevData:r};for(let s of this._inspectorHooks)s(d)}this._isExecutingFn=!0;try{let d=this._fn(n,this._actions,i);if(typeof d=="function")this._cleanup=d;else if(d!=null&&typeof d=="object"){let s=d;(typeof s.beforeRun=="function"||typeof s.deactivate=="function"||typeof s.invalidate=="function")&&(this._cleanup=d)}}catch(d){this._emit([[y,this._wrapFnError("fn threw",d)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>tt?(this._rerunDepth=0,this._emit([[y,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${tt} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,n){let r=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[H,e[0]]:e;let r=!0,o=!1,i=!1,d=-1;for(let a of e){let c=n(a[0]);c<d&&(r=!1),c===3&&(o=!0),a[0]===L&&(i=!0),d=c}let s=e;if(!r){let a=e.map((c,l)=>({m:c,i:l,tier:n(c[0])}));a.sort((c,l)=>c.tier-l.tier||c.i-l.i),s=a.map(c=>c.m)}if(o&&!i&&this._status!=="dirty"){let a=0;for(;a<s.length&&n(s[a][0])===0;)a++;return a===0?[H,...s]:[...s.slice(0,a),H,...s.slice(a)]}return s}_emit(e){if(e.length===0)return;for(let s=0;s<e.length;s++){let a=e[s];if(a[0]===y&&a[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let n=e;if(this._isTerminal&&!this._resubscribable){let s=e.filter(a=>a[0]===R||a[0]===I);if(s.length===0)return;n=s}n=this._frameBatch(n);let o=null;for(let s=0;s<n.length;s++){let a=n[s],c=a[0];if(c!==V&&c!==$){o?.push(a);continue}if(a.length<2)throw new Error(`Node "${this.name}": [[${c===V?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let l=!0;if(this._pausable!==!1){let u=a[1];if(c===V)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(u),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(u))l=!1;else if(this._pauseLocks.delete(u),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let p=this._pauseBuffer;this._pauseBuffer=[],this._emit(p)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}l?o?.push(a):o==null&&(o=n.slice(0,s))}if(o!=null){if(o.length===0)return;n=o}if(this._hasMeta&&n.some(s=>s[0]===R))for(let s of Object.keys(this.meta))try{this.meta[s]._emit(ve)}catch{}let{finalMessages:i,equalsError:d}=this._updateState(n);if(i.length>0&&this._config.inspectorEnabled){let s=this._config.globalInspector;if(s!=null)try{s({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let s=this._config.tierOf,a=[];for(let c of i)s(c[0])===3?this._pauseBuffer.push(c):a.push(c);a.length>0&&this._dispatchOrAccumulate(a)}else this._dispatchOrAccumulate(i);d!=null&&this._emit([[y,d]])}_updateState(e){let n=this._config.tierOf,r,o,i=-1,d=0;for(let l of e)n(l[0])===3&&d++;let s=d<=1,a=-1;if(this._versioning!=null&&d>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===A){a=l;break}}for(let l=0;l<e.length;l++){let u=e[l],p=u[0];if(p===A){if(u.length>=2){let f=!1;if(s&&this._cached!==void 0)try{f=this._equals(this._cached,u[1])}catch(h){o=this._wrapFnError("equals threw",h),i=l;break}if(f){r==null&&(r=e.slice(0,l)),r.push(ye),this._status="resolved";continue}this._cached=u[1],this._versioning!=null&&(a<0||l===a)&&Ze(this._versioning,u[1],this._hashFn)}this._status="settled",r?.push(u)}else if(r?.push(u),p===L)this._status="dirty";else if(p===O)this._status="resolved";else if(p===S){this._status="completed";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===y){this._status="errored";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===I){if(this._cached!==void 0){let h=this._config.rigorRecorder;if(h!=null)try{h.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let f=this._cleanup;if(typeof f=="function"){this._cleanup=void 0;try{f()}catch{}}else if(f!=null&&typeof f=="object"){let h=f.invalidate;if(typeof h=="function")try{h()}catch{}}}else p===R&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let c=i>=0?r??e.slice(0,i):r??e;return o!=null?{finalMessages:c,equalsError:o}:{finalMessages:c}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let r of n)r(e)};_dispatchOrAccumulate(e){if($e()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ze(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}Q(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);Q(this._deliverToSinks,n,this._config.tierOf)}},rt=t=>Array.isArray(t),Ae=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function re(t,e){return ot((r,o,i)=>t(o,i)??void 0,{describeKind:"producer",...e})}var it=x(()=>{"use strict";st()});function Me(t){return{describeKind:"producer",...t}}function at(t,e){return re(n=>{let r=!1;try{for(let o of t){if(r)return;n.emit(o)}r||n.down([[S]])}catch(o){r||n.down([[y,o]])}return()=>{r=!0}},Me(e))}function qt(t){return t!=null&&typeof t.then=="function"}function Yt(t,e){let{signal:n,...r}=e??{};return re(o=>{let i=!1,d=()=>{i||(i=!0,o.down([[y,n.reason]]))};if(n?.aborted){d();return}return n?.addEventListener("abort",d,{once:!0}),Promise.resolve(t).then(s=>{i||(i=!0,n?.removeEventListener("abort",d),o.emit(s),o.down([[S]]))},s=>{i||(i=!0,n?.removeEventListener("abort",d),o.down([[y,s]]))}),()=>{i=!0,n?.removeEventListener("abort",d)}},Me(r))}function Jt(t,e){let{signal:n,...r}=e??{};return re(o=>{let i=new AbortController,d=()=>i.abort(n?.reason);n?.aborted?i.abort(n.reason):n?.addEventListener("abort",d,{once:!0});let s=n??i.signal,a=!1,c=t[Symbol.asyncIterator](),l=()=>{a||s.aborted||Promise.resolve(c.next()).then(u=>{if(!(a||s.aborted)){if(u.done){o.down([[S]]);return}o.emit(u.value),l()}},u=>{!a&&!s.aborted&&o.down([[y,u]])})};return l(),()=>{a=!0,n?.removeEventListener("abort",d),i.abort(),Promise.resolve(c.return?.()).catch(()=>{})}},Me(r))}function Xt(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function Ne(t,e){if(Xt(t))return t;if(qt(t))return Yt(t,e);if(t!=null){let n=t;if(typeof n[Symbol.asyncIterator]=="function")return Jt(t,e);if(typeof n[Symbol.iterator]=="function")return at(t,e)}return Zt(t)}function Zt(...t){return at(t,void 0)}function oe(t){return new Promise((e,n)=>{let r=!1,o=!1,i;i=t.subscribe(d=>{for(let s of d){if(r)return;if(s[0]===A){r=!0,e(s[1]),i?(i(),i=void 0):o=!0;return}if(s[0]===y){r=!0,n(s[1]),i?(i(),i=void 0):o=!0;return}if(s[0]===S){r=!0,n(new Error("completed without DATA")),i?(i(),i=void 0):o=!0;return}}}),o&&(i?.(),i=void 0)})}var Ee=x(()=>{"use strict";X();it()});var j,Ce=x(()=>{"use strict";j=class{_timer;_gen=0;start(e,n){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&n()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var on={};St(on,{fallbackAdapter:()=>_t});module.exports=Nt(on);var K=require("node:fs"),ie=require("node:path");var Oe=require("node:crypto"),k=require("node:fs"),P=require("node:path"),Rt=require("node:sqlite");function le(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(le);let e=t,n=Object.keys(e).sort(),r={};for(let o of n)r[o]=le(e[o]);return r}function Le(t){return JSON.stringify(le(t),void 0,0)}var Et=new TextEncoder,Ct=new TextDecoder("utf-8",{fatal:!0}),Lt={name:"json",version:1,encode(t){return Et.encode(Le(t))},decode(t){return JSON.parse(Ct.decode(t))}};function Ot(){let t=new Map;return{name:"memory",read(e){let n=t.get(e);return n===void 0?void 0:new Uint8Array(n)},write(e,n){t.set(e,new Uint8Array(n))},delete(e){t.delete(e)},list(e){let n=[...t.keys()];return e?n.filter(r=>r.startsWith(e)).sort():n.sort()}}}function ue(t,e={}){let n=e.codec??Lt,r=e.name??t.name??"kv",o=e.compactEvery,i=new Map,d=0,s={name:r,debounceMs:e.debounceMs,compactEvery:o,filter:e.filter,save(c,l){if(!(e.filter&&!e.filter(c,l))&&(i.set(c,l),d+=1,o!==void 0&&d%o===0||!e.debounceMs))return a()},load(c){let l=t.read(c);if(l!==void 0)return l instanceof Uint8Array?l.length===0?void 0:n.decode(l):Promise.resolve(l).then(u=>u===void 0||u.length===0?void 0:n.decode(u))},delete(c){if(i.delete(c),!!t.delete)return t.delete(c)},list(c){return t.list?t.list(c):[]},async flush(){await a()},async rollback(){i=new Map}};function a(){if(i.size===0)return;let c=i;i=new Map;let l=[];for(let[u,p]of c){let f=n.encode(p),h=t.write(u,f);h instanceof Promise&&l.push(h)}if(l.length>0)return Promise.all(l).then(()=>{})}return s}function fe(t){return ue(Ot(),t)}function Ft(t){let e=new TextEncoder,n=new TextDecoder("utf-8",{fatal:!0}),r=i=>{let d="";for(let s of i){if(s.length===1&&/[a-zA-Z0-9_-]/.test(s)){d+=s;continue}for(let a of e.encode(s))d+=`%${a.toString(16).padStart(2,"0")}`}return(0,P.join)(t,`${d}.bin`)},o=i=>{if(!i.endsWith(".bin"))return null;let d=i.slice(0,-4),s=[],a=l=>{for(let u=0;u<l.length;u++)s.push(l.charCodeAt(u))},c=0;for(;c<d.length;){let l=d[c];if(l==="%"&&c+2<d.length){let u=d.slice(c+1,c+3);if(/^[0-9a-f]{2}$/i.test(u)){s.push(Number.parseInt(u,16)),c+=3;continue}}a(l),c+=1}try{return n.decode(new Uint8Array(s))}catch{return null}};return{name:`file:${t}`,read(i){try{let d=(0,k.readFileSync)(r(i));return new Uint8Array(d.buffer,d.byteOffset,d.byteLength)}catch{return}},write(i,d){(0,k.mkdirSync)(t,{recursive:!0});let s=r(i),a=(0,P.basename)(s),c=(0,P.dirname)(s),l=(0,P.join)(c,`.${a}.${(0,Oe.randomBytes)(8).toString("hex")}.tmp`);try{(0,k.writeFileSync)(l,d),(0,k.renameSync)(l,s)}catch(u){try{(0,k.unlinkSync)(l)}catch{}throw u}},delete(i){try{(0,k.unlinkSync)(r(i))}catch(d){if(d.code!=="ENOENT")throw d}},list(i){try{let d=(0,k.readdirSync)(t),s=[];for(let a of d){if(a.startsWith("."))continue;let c=o(a);c!==null&&(i!==void 0&&!c.startsWith(i)||s.push(c))}return s.sort()}catch(d){if(d.code==="ENOENT")return[];throw d}}}}function pe(t,e){return ue(Ft(t),e)}Y();async function J(t){let e=typeof t=="string"?new TextEncoder().encode(t):t,n=await globalThis.crypto.subtle.digest("SHA-256",e),r=new Uint8Array(n),o="";for(let i=0;i<r.length;i++)o+=Fe[r[i]];return o}var Fe=new Array(256);for(let t=0;t<256;t++)Fe[t]=t.toString(16).padStart(2,"0");Y();var he=class extends Error{constructor(n,r){super(`content-addressed lookup miss in read-strict mode: ${n}`);this.key=n;this.context=r;this.name="ContentAddressedMissError"}};function ge(t){let e=new Set,n=r=>{if(r===null||typeof r!="object")return r;let o=r;if(e.has(o))return{__cycle:!0};e.add(o);try{if(Array.isArray(r))return r.map(n);let i={};for(let d of Object.keys(r).sort())i[d]=n(r[d]);return i}finally{e.delete(o)}};return JSON.stringify(n(t))}function Pe(t){let{storage:e,keyContext:n,keyPrefix:r,mode:o="read-write"}=t,i=n??(s=>s);async function d(s){let a=ge(i(s)),c=await J(a);return r?`${r}:${c}`:c}return{keyFor:d,async lookup(s){if(o==="write")return;let a=await d(s),c=await e.load(a);if(c===void 0){if(o==="read-strict")throw new he(a,s);return}return c},async store(s,a){if(o==="read")return;let c=await d(s);await e.save(c,a)},async forget(s){if(o==="read"||o==="write"||!e.delete)return;let a=await d(s);await e.delete(a)}}}Ee();function dt(t,e={}){let n=e.keyFn??(o=>String(o)),r=new Map;return o=>{let i=n(o),d=r.get(i);if(d)return d;let s=t(o),a;s!=null&&typeof s.then=="function"?a=Promise.resolve(s):s!=null&&typeof s=="object"&&"subscribe"in s&&"cache"in s?a=oe(s):s!=null&&typeof s=="object"&&Symbol.asyncIterator in s?a=(async()=>{let u=s[Symbol.asyncIterator]();try{let{value:p,done:f}=await u.next();if(f)throw new Error("singleFromAny: factory returned empty async iterable");return p}finally{await u.return?.()}})():s!=null&&typeof s=="object"&&Symbol.iterator in s?a=(async()=>{let u=s[Symbol.iterator]();try{let{value:p,done:f}=u.next();if(f)throw new Error("singleFromAny: factory returned empty iterable");return p}finally{u.return?.()}})():a=Promise.resolve(s);let c,l=()=>{r.get(i)===c&&r.delete(i)};return c=a.then(u=>(l(),u),u=>{throw l(),u}),r.set(i,c),c}}Ee();Ce();function ct(t){let{storage:e,mode:n="read-write",keyFn:r,keyPrefix:o="llm-replay"}=t,d=Pe({storage:e,keyPrefix:o,mode:n==="read-strict"?"read":n,keyContext:({messages:a,opts:c})=>{let{signal:l,keyContext:u,...p}=c??{};return{messages:a,opts:p}}});async function s(a,c){if(r){if(r.length<=1){let u={messages:a,opts:c,context:c?.keyContext},p=await r(u);return`${o}:${p}`}let l=await r(a,c);return`${o}:${l}`}return d.keyFor({messages:a,opts:c})}return{keyFor:s,async lookup(a,c){if(n!=="write"){if(r){let l=await s(a,c),u=await e.load(l);return u===void 0?void 0:u}return d.lookup({messages:a,opts:c})}},async store(a,c,l){if(n!=="read"){if(r){let u=await s(a,c);await e.save(u,l);return}await d.store({messages:a,opts:c},l)}},async forget(a,c){if(!(n==="read"||n==="write")&&e.delete){if(r){let l=await s(a,c);await e.delete(l);return}await d.forget({messages:a,opts:c})}}}}function lt(t,e,n){return{provider:n?.provider??t.provider,model:n?.model??t.model,capabilities:n?.capabilities??t.capabilities?.bind(t),invoke:e.invoke,stream:e.stream}}var ut=Symbol.for("graphrefly.adapter.middlewareLayers");function ft(t,e,n){let o=[...n?Qt(n):[],e];return Object.defineProperty(t,ut,{value:Object.freeze(o),enumerable:!1,writable:!1,configurable:!1}),t}function Qt(t){let e=t[ut];return Array.isArray(e)?e:[]}var z=class extends Error{constructor(n,r){super(`withReplayCache: no cached response for ${r} (key=${n}, mode=read-strict)`);this.key=n;this.method=r}name="ReplayCacheMissError"};function pt(t,e){let n=e.mode??"read-write",r=e.cacheStreaming??!1,o=e.captureStreamCadence??!1,i=e.replaySpeed??1,d=e.keyPrefix??"llm-replay",s=n==="read"||n==="read-strict",a=ct({storage:e.storage,mode:n==="write-only"?"write":n,keyFn:e.keyFn,keyPrefix:d}),c=p=>p<=0?Promise.resolve():new Promise(f=>{new j().start(p,()=>f())}),l=dt(async({messages:p,invokeOpts:f})=>await oe(Ne(t.invoke(p,f))),{keyFn:({_precomputedKey:p})=>p}),u=lt(t,{async invoke(p,f){let h=await a.keyFor(p,f),m=await a.lookup(p,f);if(m?.response){let T=m.response;return{...T,metadata:{...T.metadata??{},replayCache:"hit"}}}if(n==="read-strict")throw new z(h,"invoke");let v=await l({messages:p,invokeOpts:f,_precomputedKey:h});return s||await a.store(p,f,{response:v,storedAtNs:D()}),v},async*stream(p,f){if(!r){for await(let g of t.stream(p,f))yield g;return}let h=await a.keyFor(p,f),m=await a.lookup(p,f);if(m){let g=m.response;if(m.streamChunks&&m.streamCadenceMs)for(let b=0;b<m.streamChunks.length;b++){let C=m.streamCadenceMs[b]??0,F=i>0?C/i:0;F>0&&await c(F),yield{type:"token",delta:m.streamChunks[b]?.delta??""}}else g.content&&(yield{type:"token",delta:g.content});g.usage&&(yield{type:"usage",usage:g.usage}),yield{type:"finish",reason:g.finishReason??"stop"};return}if(n==="read-strict")throw new z(h,"stream");let v="",T,M,w=[],E=[],N;for await(let g of t.stream(p,f)){if(g.type==="token"&&(v+=g.delta,o)){let b=Re(),C=N===void 0?0:(b-N)/1e6;E.push(C),N=b,w.push({delta:g.delta})}g.type==="usage"&&(T=g.usage),g.type==="finish"&&(M=g.reason),yield g}if((v||T)&&!s){let b={response:{content:v,usage:T??{input:{regular:0},output:{regular:0}},finishReason:M,model:t.model??f?.model??"",provider:t.provider},storedAtNs:D(),...o?{streamChunks:w,streamCadenceMs:E}:{}};await a.store(p,f,b)}}});return ft(u,"withReplayCache",t),u}var ht=ge;Ce();function se(){let t=new Error("aborted");return t.name="AbortError",t}function gt(t,e){return t<=0?Promise.resolve():e?.aborted?Promise.reject(se()):new Promise((n,r)=>{let o=new j,i,d=()=>{o.cancel(),e&&i&&e.removeEventListener("abort",i)};o.start(t,()=>{d(),n()}),e&&(i=()=>{d(),r(se())},e.addEventListener("abort",i,{once:!0}))})}function yt(t={}){let e=t.provider??"dry-run",n=t.model??"dry-run-v1",r=t.latencyMs??0,o=Math.max(1,t.streamChunkSize??16),i=t.respond??(s=>{let a=[...s].reverse().find(c=>c.role==="user");return a?`echo: ${a.content}`:"dry-run: no user message"}),d=t.usage??((s,a)=>{let c=s.reduce((l,u)=>l+u.content.length,0);return{input:{regular:Math.ceil(c/4)},output:{regular:Math.ceil(a.length/4)}}});return{provider:e,model:n,async invoke(s,a){if(await gt(r,a?.signal),a?.signal?.aborted)throw se();let c=i(s,a),l=d(s,c);return{content:c,usage:l,finishReason:"stop",model:a?.model??n,provider:e,tier:a?.tier,metadata:{dryRun:!0}}},async*stream(s,a){let c=i(s,a),l=d(s,c),u=Math.ceil(c.length/o)||1,p=r>0?r/u:0;for(let f=0;f<c.length;f+=o){if(a?.signal?.aborted)throw se();await gt(p,a?.signal),yield{type:"token",delta:c.slice(f,f+o)}}yield{type:"usage",usage:l},yield{type:"finish",reason:"stop"}}}}function mt(t,e){return{content:"[fallback: no cached response available for this request]",usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:e,provider:t,metadata:{degraded:!0,reason:"no-fixture"}}}function bt(t,e,n){return typeof t=="string"?{content:t,usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:n,provider:e,metadata:{degraded:!0,reason:"respond"}}:t}async function en(t,e){if("key"in t)return t.key;let n=ht({messages:t.messages,opts:t.invokeOpts??{}}),r=await J(n);return`${e}:${r}`}function tn(t){let e={response:t.response,storedAtNs:D()};if("key"in t&&t.stream){let n=t.stream.chunks.filter(r=>r.type==="token");return{...e,streamChunks:n.map(r=>({delta:r.delta})),streamCadenceMs:t.stream.delaysMs??n.map(()=>0)}}return e}function nn(t,e){let n=[];if(t.fixtures!=null&&n.push("fixtures"),t.fixturesStorage!=null&&n.push("fixturesStorage"),n.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\` and \`fixturesStorage\` are mutually exclusive; got both ${n.join(" and ")}. Pick one source. For filesystem directories use the node subpath's \`fallbackAdapter\`.`);if(t.fixtures){let r=fe(),o=t.fixtures,i=(async()=>{for(let d of o){let s=await en(d,e);await r.save(s,tn(d))}})();return i.catch(()=>{}),{tier:r,seedReady:i}}return t.fixturesStorage?{tier:t.fixturesStorage,seedReady:Promise.resolve()}:{tier:void 0,seedReady:Promise.resolve()}}function vt(t={}){let e=t.provider??"fallback",n=t.model??"fallback",r=t.onMiss??"respond",o=t.keyPrefix??"fallback",i=t.record?t.record.adapter:r==="throw"?yt({provider:e,model:n,respond:()=>"[unreachable: read-strict mode throws on miss]"}):{provider:e,model:n,async invoke(l,u){let p=t.respond?t.respond(l,u):mt(e,n);return bt(p,e,n)},async*stream(l,u){let p=t.respond?t.respond(l,u):mt(e,n),f=bt(p,e,n);yield{type:"token",delta:f.content},f.usage&&(yield{type:"usage",usage:f.usage}),yield{type:"finish",reason:f.finishReason??"stop"}}},d,s=Promise.resolve();if(t.record){if(!t.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=t.record.storage}else{let l=nn(t,o);d=l.tier??fe(),s=l.seedReady}let a=t.record?"read-write":r==="throw"?"read-strict":"read",c=pt(i,{storage:d,mode:a,keyPrefix:o,cacheStreaming:!0,captureStreamCadence:!0,replaySpeed:t.replaySpeed,...t.keyFn?{keyFn:t.keyFn}:{}});return{provider:e,model:n,capabilities:c.capabilities?.bind(c),async invoke(l,u){return await s,c.invoke(l,u)},async*stream(l,u){await s;for await(let p of c.stream(l,u))yield p}}}function rn(t){if(!(0,K.existsSync)(t))return;let e=(0,K.readdirSync)(t).filter(a=>a.endsWith(".json"));if(e.length===0)return;let n=e[0],r=(0,ie.join)(t,n),o;try{o=JSON.parse((0,K.readFileSync)(r,"utf8"))}catch(a){throw new TypeError(`fallbackAdapter: ${r} is not valid JSON (${a.message}).`)}let i=o,d=i!=null&&"messages"in i,s=i==null||typeof i.response?.content!="string"||typeof i.storedAtNs!="number";if(d||s){let a=d?"`messages` at the top level means this looks hand-authored. ":"";throw new TypeError(`fallbackAdapter: ${r} is not in cache-file format. ${a}Expected \`{ response: { content, usage, ... }, storedAtNs, ... }\` (the shape \`withReplayCache\` and this adapter's \`record\` mode write). For hand-authored fixtures, use the inline \`fixtures: FallbackFixture[]\` option \u2014 the adapter hashes messages for you.`)}}function _t(t={}){let e=t.keyPrefix??"fallback",n=[];if(t.fixtures!=null&&n.push("fixtures"),t.fixturesDir!=null&&n.push("fixturesDir"),t.fixturesStorage!=null&&n.push("fixturesStorage"),n.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\`, \`fixturesDir\`, and \`fixturesStorage\` are mutually exclusive; got both ${n.join(" and ")}. Pick one source.`);let r=t.fixturesStorage;if(t.fixturesDir!=null){let c=(0,ie.join)(t.fixturesDir,e);rn(c),r=pe(c)}let o;if(t.record){if(t.record.storage&&t.record.dir)throw new TypeError("fallbackAdapter: `record.storage` and `record.dir` are mutually exclusive; pick one.");if(t.record.storage)o={adapter:t.record.adapter,storage:t.record.storage};else{let c=t.record.dir??t.fixturesDir;if(c==null)throw new TypeError("fallbackAdapter: record mode requires either `record.dir`, `record.storage`, or an inherited `fixturesDir`.");o={adapter:t.record.adapter,storage:pe((0,ie.join)(c,e))}}}let{fixturesDir:i,record:d,...s}=t,a={...s,...r?{fixturesStorage:r}:{},...o?{record:o}:{}};return vt(a)}0&&(module.exports={fallbackAdapter});
1
+ "use strict";var ce=Object.defineProperty;var xt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var St=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(t&&(e=t(t=0)),e);var Mt=(t,e)=>{for(var n in e)ce(t,n,{get:e[n],enumerable:!0})},Nt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of At(e))!St.call(t,o)&&o!==n&&ce(t,o,{get:()=>e[o],enumerable:!(r=xt(e,o))||r.enumerable});return t};var Et=t=>Nt(ce({},"__esModule",{value:!0}),t);function Re(){return Math.trunc(performance.now()*1e6)}function D(){return Date.now()*1e6}var Y=k(()=>{"use strict"});var G,A,L,O,I,V,$,R,S,y,H,ye,Dt,me,It,Vt,be,De,Ie,Ve,ve,X=k(()=>{"use strict";G=Symbol.for("graphrefly/START"),A=Symbol.for("graphrefly/DATA"),L=Symbol.for("graphrefly/DIRTY"),O=Symbol.for("graphrefly/RESOLVED"),I=Symbol.for("graphrefly/INVALIDATE"),V=Symbol.for("graphrefly/PAUSE"),$=Symbol.for("graphrefly/RESUME"),R=Symbol.for("graphrefly/TEARDOWN"),S=Symbol.for("graphrefly/COMPLETE"),y=Symbol.for("graphrefly/ERROR"),H=Object.freeze([L]),ye=Object.freeze([O]),Dt=Object.freeze([I]),me=Object.freeze([G]),It=Object.freeze([S]),Vt=Object.freeze([R]),be=Object.freeze([H]),De=Object.freeze([ye]),Ie=Object.freeze([Dt]),Ve=Object.freeze([It]),ve=Object.freeze([Vt])});function Ge(t){t.registerCodec(Gt)}var Gt,He=k(()=>{"use strict";Gt={name:"json",version:1,contentType:"application/json",encode(t){let e=JSON.stringify(t);return new TextEncoder().encode(e)},decode(t,e){let n=new TextDecoder().decode(t);return JSON.parse(n)}}});function Z(t){if(t==null)return Ht;let{type:e,id:n,...r}=t;return{type:e??"system",id:n??"",...r}}var Ht,Ue=k(()=>{"use strict";Ht={type:"system",id:""}});function We(){return _e>0||Ut}function $e(){return _e>0}function ze(t){_e>0?jt.push(t):t()}function Q(t,e,n){if(e.length===0)return;if(e.length===1){let c=n(e[0][0]);if(c<3||!We()){t(e);return}(c>=5?Be:c===4?Ke:je).push(()=>t(e));return}let r=e.length,o=r,i=r,d=r,s=0;for(;s<r&&n(e[s][0])<3;)s++;for(o=s;s<r&&n(e[s][0])===3;)s++;for(i=s;s<r&&n(e[s][0])===4;)s++;d=s;let a=We();if(o>0){let c=e.slice(0,o);t(c)}if(i>o){let c=e.slice(o,i);a?je.push(()=>t(c)):t(c)}if(d>i){let c=e.slice(i,d);a?Ke.push(()=>t(c)):t(c)}if(r>d){let c=e.slice(d,r);a?Be.push(()=>t(c)):t(c)}}var _e,Ut,je,Ke,Be,jt,qe=k(()=>{"use strict";_e=0,Ut=!1,je=[],Ke=[],Be=[],jt=[]});function Ye(t){t.registerMessageType(G,{tier:0,wireCrossing:!1}),t.registerMessageType(L,{tier:1,wireCrossing:!1}),t.registerMessageType(I,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(V,{tier:2,wireCrossing:!1}),t.registerMessageType($,{tier:2,wireCrossing:!1}),t.registerMessageType(A,{tier:3,wireCrossing:!0}),t.registerMessageType(O,{tier:3,wireCrossing:!0}),t.registerMessageType(S,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(y,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(R,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var ee,Je=k(()=>{"use strict";X();ee=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let r=this._messageTypes.get(n);return r!=null?r.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var U,Xe=k(()=>{"use strict";U=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function Te(t){if(t===void 0)return null;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Cannot hash non-finite number: ${t}`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${t}. Cross-language cid parity is not guaranteed for unsafe integers.`);return t}if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(Array.isArray(t))return t.map(Te);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Te(t[n]);return e}return null}function Wt(t){let e=Bt.encode(t),n=e.length,r=n*8,o=n+9+63&-64,i=new Uint8Array(o);i.set(e),i[n]=128;let d=new DataView(i.buffer);d.setUint32(o-4,r>>>0,!1),d.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let s=1779033703,a=3144134277,c=1013904242,l=2773480762,u=1359893119,p=2600822924,f=528734635,h=1541459225,m=new Uint32Array(64),v=(M,w)=>M>>>w|M<<32-w;for(let M=0;M<o;M+=64){for(let _=0;_<16;_++)m[_]=d.getUint32(M+_*4,!1);for(let _=16;_<64;_++){let B=m[_-15],W=m[_-2],q=v(B,7)^v(B,18)^B>>>3,de=v(W,17)^v(W,19)^W>>>10;m[_]=m[_-16]+q+m[_-7]+de>>>0}let w=s,E=a,N=c,g=l,b=u,C=p,F=f,ae=h;for(let _=0;_<64;_++){let B=v(b,6)^v(b,11)^v(b,25),W=b&C^~b&F,q=ae+B+W+Kt[_]+m[_]>>>0,de=v(w,2)^v(w,13)^v(w,22),wt=w&E^w&N^E&N,kt=de+wt>>>0;ae=F,F=C,C=b,b=g+q>>>0,g=N,N=E,E=w,w=q+kt>>>0}s=s+w>>>0,a=a+E>>>0,c=c+N>>>0,l=l+g>>>0,u=u+b>>>0,p=p+C>>>0,f=f+F>>>0,h=h+ae>>>0}let T=M=>M.toString(16).padStart(8,"0");return T(s)+T(a)+T(c)+T(l)+T(u)+T(p)+T(f)+T(h)}function we(t){let e=Te(t??null),n=JSON.stringify(e);return Wt(n).slice(0,16)}function $t(){let t=globalThis.crypto;if(t?.randomUUID)return t.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function ke(t,e,n){let r=n?.id??$t();if(t===0)return{id:r,version:0};let i=(n?.hash??we)(e);return{id:r,version:0,cid:i,prev:null}}function Ze(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var Kt,Bt,Qe=k(()=>{"use strict";Kt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Bt=new TextEncoder});function nt(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function xe(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function te(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function ot(t,e,n){let r=rt(t)?t:[],o=typeof t=="function"?t:typeof e=="function"?e:void 0,i={};return rt(t)?i=(Ae(e)?e:n)??{}:Ae(t)?i=t:i=(Ae(e)?e:n)??{},new ne(r,o,i)}var et,tt,zt,qt,Se,ne,rt,Ae,st=k(()=>{"use strict";He();Ue();qe();Y();Je();Xe();X();Qe();et=()=>{},tt=100;zt=(t,e,n,r)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},qt=(t,e,n,r)=>{let o=t;if(o._status==="completed"||o._status==="errored")return;let i=o._cached,d=i===void 0?[me]:[me,[A,i]];o._status==="dirty"&&d.push(H),Q(e,d,o._config.tierOf)},Se=new ee({onMessage:zt,onSubscribe:qt});Ye(Se);Ge(Se);ne=class t{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,n,r){this._config=r.config??Se,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=n,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??we;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?ke(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(nt);let i={};for(let[s,a]of Object.entries(r.meta??{})){let c={initial:a,name:`${r.name??"node"}:meta:${s}`,describeKind:"state",config:this._config};r.guard!=null&&(c.guard=r.guard),i[s]=new t([],void 0,c)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let d=this;this._actions={emit(s){d._emit([[A,s]])},down(s){d._emit(te(s))},up(s){d._emitUp(te(s))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,n){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let r=this._versioningLevel;if(r!=null&&e<=r)return;let o=n?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let i=this._cached===void 0?void 0:this._cached,d=this._versioning,s=d?.id??n?.id,a=d?.version??0,c=ke(e,i,{id:s,hash:o});c.version=a,this._versioning=c,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let n=Z(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!n&&!r)return;let o=Z(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,i))throw new U({actor:o,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let d of this._extraGuards)if(!d(o,i))throw new U({actor:o,action:i,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:D()}}down(e,n){let r=te(e);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(e,n){this._checkGuard(n),this._emit([[A,e]])}up(e,n){if(this._deps.length===0)return;let r=te(e);if(r.length===0)return;this._checkGuard(n);let o=n??{internal:!0};this._validateUpTiers(r);for(let i of this._deps)i.node.up?.(r,o)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let r of e){let o=n(r[0]);if(o===3||o===4)throw new Error(`Node "${this.name}": tier-${o} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,n){if(n!=null&&this._guard!=null){let a=Z(n);if(!this._guard(a,"observe"))throw new U({actor:a,action:"observe",nodeName:this.name})}let o=this._isTerminal&&this._resubscribable;if(o){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let a of this._deps)xe(a);if(this._partial===!1){for(let a of this._deps)if(a.prevData!==void 0||a.dataBatch.length!==0||a.terminal!==void 0||a.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let i;try{i=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:o},this._actions)}catch(a){throw this._sinkCount-=1,a}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let d=this._isTerminal;if(this._sinkCount===1&&!d)try{this._activate()}catch(a){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw a}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let s=!1;return()=>{s||(s=!0,this._sinkCount-=1,this._removeSink(e),typeof i=="function"&&i(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[n]=this._sinks;this._sinks=n}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,n=0;try{for(let r=0;r<e;r++){let o=r,i=this._deps[r];i.unsub=et,i.unsub=i.node.subscribe(d=>{if(i.unsub===null)return;let s=this._config.tierOf,a=!1;for(let c of d)s(c[0])>=3&&(a=!0),this._config.onMessage(this,c,{direction:"down-in",depIndex:o},this._actions);a&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let o=0;o<n;o++){let i=this._deps[o];if(i.unsub!=null){let d=i.unsub;i.unsub=null;try{d()}catch{}xe(i)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let n=this._deps.length,r=nt(e);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(be),r.unsub=et;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let i=this._config.tierOf,d=!1;for(let s of o)i(s[0])>=3&&(d=!0),this._config.onMessage(this,s,{direction:"down-in",depIndex:n},this._actions);d&&this._maybeRunFnOnSettlement()})}catch(o){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(r){this._emit([[y,this._wrapFnError("cleanup threw",r)]])}else if(n!=null&&typeof n=="object"){let r=n.deactivate;if(typeof r=="function")try{r()}catch(o){this._emit([[y,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let r of this._deps){if(r.unsub!=null){let o=r.unsub;r.unsub=null;try{o()}catch{}}xe(r)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,n){let r=this._deps[e],o=n[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:n};for(let d of this._inspectorHooks)d(i)}if(o!==G){if(o===L){this._depDirtied(r);return}if(o===I){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(Ie);return}if(o===V||o===$){this._emit([n]);return}if(o===R){this._emit(ve);return}if(o===A)this._depSettledAsData(r,n[1]);else if(o===O)this._depSettledAsResolved(r);else if(o===S)this._depSettledAsTerminal(r,!0);else if(o===y)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(o===A||o===O)&&this._emit([n]),(o===S||o===y)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(be))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(De),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[y,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(Ve)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(d){this._emit([[y,this._wrapFnError("cleanup threw",d)]]);return}}else if(e!=null&&typeof e=="object"){let d=e.beforeRun;if(typeof d=="function"){e.beforeRun=void 0;try{d()}catch(s){this._emit([[y,this._wrapFnError("cleanup.beforeRun threw",s)]]);return}}}let n=this._deps.map(d=>d.involvedThisWave?d.dataBatch.length>0?[...d.dataBatch]:[]:void 0),r=this._deps.map(d=>d.prevData);for(let d=0;d<this._deps.length;d++){let s=n[d];s!=null&&s.length>0&&(this._deps[d].prevData=s[s.length-1])}let o=this._deps.map(d=>d.terminal),i={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let d={kind:"run",batchData:n,prevData:r};for(let s of this._inspectorHooks)s(d)}this._isExecutingFn=!0;try{let d=this._fn(n,this._actions,i);if(typeof d=="function")this._cleanup=d;else if(d!=null&&typeof d=="object"){let s=d;(typeof s.beforeRun=="function"||typeof s.deactivate=="function"||typeof s.invalidate=="function")&&(this._cleanup=d)}}catch(d){this._emit([[y,this._wrapFnError("fn threw",d)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>tt?(this._rerunDepth=0,this._emit([[y,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${tt} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,n){let r=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[H,e[0]]:e;let r=!0,o=!1,i=!1,d=-1;for(let a of e){let c=n(a[0]);c<d&&(r=!1),c===3&&(o=!0),a[0]===L&&(i=!0),d=c}let s=e;if(!r){let a=e.map((c,l)=>({m:c,i:l,tier:n(c[0])}));a.sort((c,l)=>c.tier-l.tier||c.i-l.i),s=a.map(c=>c.m)}if(o&&!i&&this._status!=="dirty"){let a=0;for(;a<s.length&&n(s[a][0])===0;)a++;return a===0?[H,...s]:[...s.slice(0,a),H,...s.slice(a)]}return s}_emit(e){if(e.length===0)return;for(let s=0;s<e.length;s++){let a=e[s];if(a[0]===y&&a[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let n=e;if(this._isTerminal&&!this._resubscribable){let s=e.filter(a=>a[0]===R||a[0]===I);if(s.length===0)return;n=s}n=this._frameBatch(n);let o=null;for(let s=0;s<n.length;s++){let a=n[s],c=a[0];if(c!==V&&c!==$){o?.push(a);continue}if(a.length<2)throw new Error(`Node "${this.name}": [[${c===V?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let l=!0;if(this._pausable!==!1){let u=a[1];if(c===V)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(u),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(u))l=!1;else if(this._pauseLocks.delete(u),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let p=this._pauseBuffer;this._pauseBuffer=[],this._emit(p)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}l?o?.push(a):o==null&&(o=n.slice(0,s))}if(o!=null){if(o.length===0)return;n=o}if(this._hasMeta&&n.some(s=>s[0]===R))for(let s of Object.keys(this.meta))try{this.meta[s]._emit(ve)}catch{}let{finalMessages:i,equalsError:d}=this._updateState(n);if(i.length>0&&this._config.inspectorEnabled){let s=this._config.globalInspector;if(s!=null)try{s({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let s=this._config.tierOf,a=[];for(let c of i)s(c[0])===3?this._pauseBuffer.push(c):a.push(c);a.length>0&&this._dispatchOrAccumulate(a)}else this._dispatchOrAccumulate(i);d!=null&&this._emit([[y,d]])}_updateState(e){let n=this._config.tierOf,r,o,i=-1,d=0;for(let l of e)n(l[0])===3&&d++;let s=d<=1,a=-1;if(this._versioning!=null&&d>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===A){a=l;break}}for(let l=0;l<e.length;l++){let u=e[l],p=u[0];if(p===A){if(u.length>=2){let f=!1;if(s&&this._cached!==void 0)try{f=this._equals(this._cached,u[1])}catch(h){o=this._wrapFnError("equals threw",h),i=l;break}if(f){r==null&&(r=e.slice(0,l)),r.push(ye),this._status="resolved";continue}this._cached=u[1],this._versioning!=null&&(a<0||l===a)&&Ze(this._versioning,u[1],this._hashFn)}this._status="settled",r?.push(u)}else if(r?.push(u),p===L)this._status="dirty";else if(p===O)this._status="resolved";else if(p===S){this._status="completed";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===y){this._status="errored";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===I){if(this._cached!==void 0){let h=this._config.rigorRecorder;if(h!=null)try{h.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let f=this._cleanup;if(typeof f=="function"){this._cleanup=void 0;try{f()}catch{}}else if(f!=null&&typeof f=="object"){let h=f.invalidate;if(typeof h=="function")try{h()}catch{}}}else p===R&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let c=i>=0?r??e.slice(0,i):r??e;return o!=null?{finalMessages:c,equalsError:o}:{finalMessages:c}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let r of n)r(e)};_dispatchOrAccumulate(e){if($e()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ze(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}Q(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);Q(this._deliverToSinks,n,this._config.tierOf)}},rt=t=>Array.isArray(t),Ae=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function re(t,e){return ot((r,o,i)=>t(o,i)??void 0,{describeKind:"producer",...e})}var it=k(()=>{"use strict";st()});function Me(t){return{describeKind:"producer",...t}}function at(t,e){return re(n=>{let r=!1;try{for(let o of t){if(r)return;n.emit(o)}r||n.down([[S]])}catch(o){r||n.down([[y,o]])}return()=>{r=!0}},Me(e))}function Yt(t){return t!=null&&typeof t.then=="function"}function Jt(t,e){let{signal:n,...r}=e??{};return re(o=>{let i=!1,d=()=>{i||(i=!0,o.down([[y,n.reason]]))};if(n?.aborted){d();return}return n?.addEventListener("abort",d,{once:!0}),Promise.resolve(t).then(s=>{i||(i=!0,n?.removeEventListener("abort",d),o.emit(s),o.down([[S]]))},s=>{i||(i=!0,n?.removeEventListener("abort",d),o.down([[y,s]]))}),()=>{i=!0,n?.removeEventListener("abort",d)}},Me(r))}function Xt(t,e){let{signal:n,...r}=e??{};return re(o=>{let i=new AbortController,d=()=>i.abort(n?.reason);n?.aborted?i.abort(n.reason):n?.addEventListener("abort",d,{once:!0});let s=n??i.signal,a=!1,c=t[Symbol.asyncIterator](),l=()=>{a||s.aborted||Promise.resolve(c.next()).then(u=>{if(!(a||s.aborted)){if(u.done){o.down([[S]]);return}o.emit(u.value),l()}},u=>{!a&&!s.aborted&&o.down([[y,u]])})};return l(),()=>{a=!0,n?.removeEventListener("abort",d),i.abort(),Promise.resolve(c.return?.()).catch(()=>{})}},Me(r))}function Zt(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function Ne(t,e){if(Zt(t))return t;if(Yt(t))return Jt(t,e);if(t!=null){let n=t;if(typeof n[Symbol.asyncIterator]=="function")return Xt(t,e);if(typeof n[Symbol.iterator]=="function")return at(t,e)}return Qt(t)}function Qt(...t){return at(t,void 0)}function oe(t){return new Promise((e,n)=>{let r=!1,o=!1,i;i=t.subscribe(d=>{for(let s of d){if(r)return;if(s[0]===A){r=!0,e(s[1]),i?(i(),i=void 0):o=!0;return}if(s[0]===y){r=!0,n(s[1]),i?(i(),i=void 0):o=!0;return}if(s[0]===S){r=!0,n(new Error("completed without DATA")),i?(i(),i=void 0):o=!0;return}}}),o&&(i?.(),i=void 0)})}var dt=k(()=>{"use strict";X();it()});var Ee=k(()=>{"use strict";dt()});var j,Ce=k(()=>{"use strict";j=class{_timer;_gen=0;start(e,n){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&n()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var sn={};Mt(sn,{fallbackAdapter:()=>Tt});module.exports=Et(sn);var K=require("node:fs"),ie=require("node:path");var Oe=require("node:crypto"),x=require("node:fs"),P=require("node:path"),Ft=require("node:sqlite");function le(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(le);let e=t,n=Object.keys(e).sort(),r={};for(let o of n)r[o]=le(e[o]);return r}function Le(t){return JSON.stringify(le(t),void 0,0)}var Ct=new TextEncoder,Lt=new TextDecoder("utf-8",{fatal:!0}),Ot={name:"json",version:1,encode(t){return Ct.encode(Le(t))},decode(t){return JSON.parse(Lt.decode(t))}};function Rt(){let t=new Map;return{name:"memory",read(e){let n=t.get(e);return n===void 0?void 0:new Uint8Array(n)},write(e,n){t.set(e,new Uint8Array(n))},delete(e){t.delete(e)},list(e){let n=[...t.keys()];return e?n.filter(r=>r.startsWith(e)).sort():n.sort()}}}function ue(t,e={}){let n=e.codec??Ot,r=e.name??t.name??"kv",o=e.compactEvery,i=new Map,d=0,s={name:r,debounceMs:e.debounceMs,compactEvery:o,filter:e.filter,save(c,l){if(!(e.filter&&!e.filter(c,l))&&(i.set(c,l),d+=1,o!==void 0&&d%o===0||!e.debounceMs))return a()},load(c){let l=t.read(c);if(l!==void 0)return l instanceof Uint8Array?l.length===0?void 0:n.decode(l):Promise.resolve(l).then(u=>u===void 0||u.length===0?void 0:n.decode(u))},delete(c){if(i.delete(c),!!t.delete)return t.delete(c)},list(c){return t.list?t.list(c):[]},async flush(){await a()},async rollback(){i=new Map}};function a(){if(i.size===0)return;let c=i;i=new Map;let l=[];for(let[u,p]of c){let f=n.encode(p),h=t.write(u,f);h instanceof Promise&&l.push(h)}if(l.length>0)return Promise.all(l).then(()=>{})}return s}function fe(t){return ue(Rt(),t)}function Pt(t){let e=new TextEncoder,n=new TextDecoder("utf-8",{fatal:!0}),r=i=>{let d="";for(let s of i){if(s.length===1&&/[a-zA-Z0-9_-]/.test(s)){d+=s;continue}for(let a of e.encode(s))d+=`%${a.toString(16).padStart(2,"0")}`}return(0,P.join)(t,`${d}.bin`)},o=i=>{if(!i.endsWith(".bin"))return null;let d=i.slice(0,-4),s=[],a=l=>{for(let u=0;u<l.length;u++)s.push(l.charCodeAt(u))},c=0;for(;c<d.length;){let l=d[c];if(l==="%"&&c+2<d.length){let u=d.slice(c+1,c+3);if(/^[0-9a-f]{2}$/i.test(u)){s.push(Number.parseInt(u,16)),c+=3;continue}}a(l),c+=1}try{return n.decode(new Uint8Array(s))}catch{return null}};return{name:`file:${t}`,read(i){try{let d=(0,x.readFileSync)(r(i));return new Uint8Array(d.buffer,d.byteOffset,d.byteLength)}catch{return}},write(i,d){(0,x.mkdirSync)(t,{recursive:!0});let s=r(i),a=(0,P.basename)(s),c=(0,P.dirname)(s),l=(0,P.join)(c,`.${a}.${(0,Oe.randomBytes)(8).toString("hex")}.tmp`);try{(0,x.writeFileSync)(l,d),(0,x.renameSync)(l,s)}catch(u){try{(0,x.unlinkSync)(l)}catch{}throw u}},delete(i){try{(0,x.unlinkSync)(r(i))}catch(d){if(d.code!=="ENOENT")throw d}},list(i){try{let d=(0,x.readdirSync)(t),s=[];for(let a of d){if(a.startsWith("."))continue;let c=o(a);c!==null&&(i!==void 0&&!c.startsWith(i)||s.push(c))}return s.sort()}catch(d){if(d.code==="ENOENT")return[];throw d}}}}function pe(t,e){return ue(Pt(t),e)}Y();async function J(t){let e=typeof t=="string"?new TextEncoder().encode(t):t,n=await globalThis.crypto.subtle.digest("SHA-256",e),r=new Uint8Array(n),o="";for(let i=0;i<r.length;i++)o+=Fe[r[i]];return o}var Fe=new Array(256);for(let t=0;t<256;t++)Fe[t]=t.toString(16).padStart(2,"0");Y();var he=class extends Error{constructor(n,r){super(`content-addressed lookup miss in read-strict mode: ${n}`);this.key=n;this.context=r;this.name="ContentAddressedMissError"}};function ge(t){let e=new Set,n=r=>{if(r===null||typeof r!="object")return r;let o=r;if(e.has(o))return{__cycle:!0};e.add(o);try{if(Array.isArray(r))return r.map(n);let i={};for(let d of Object.keys(r).sort())i[d]=n(r[d]);return i}finally{e.delete(o)}};return JSON.stringify(n(t))}function Pe(t){let{storage:e,keyContext:n,keyPrefix:r,mode:o="read-write"}=t,i=n??(s=>s);async function d(s){let a=ge(i(s)),c=await J(a);return r?`${r}:${c}`:c}return{keyFor:d,async lookup(s){if(o==="write")return;let a=await d(s),c=await e.load(a);if(c===void 0){if(o==="read-strict")throw new he(a,s);return}return c},async store(s,a){if(o==="read")return;let c=await d(s);await e.save(c,a)},async forget(s){if(o==="read"||o==="write"||!e.delete)return;let a=await d(s);await e.delete(a)}}}Ee();function ct(t,e={}){let n=e.keyFn??(o=>String(o)),r=new Map;return o=>{let i=n(o),d=r.get(i);if(d)return d;let s=t(o),a;s!=null&&typeof s.then=="function"?a=Promise.resolve(s):s!=null&&typeof s=="object"&&"subscribe"in s&&"cache"in s?a=oe(s):s!=null&&typeof s=="object"&&Symbol.asyncIterator in s?a=(async()=>{let u=s[Symbol.asyncIterator]();try{let{value:p,done:f}=await u.next();if(f)throw new Error("singleFromAny: factory returned empty async iterable");return p}finally{await u.return?.()}})():s!=null&&typeof s=="object"&&Symbol.iterator in s?a=(async()=>{let u=s[Symbol.iterator]();try{let{value:p,done:f}=u.next();if(f)throw new Error("singleFromAny: factory returned empty iterable");return p}finally{u.return?.()}})():a=Promise.resolve(s);let c,l=()=>{r.get(i)===c&&r.delete(i)};return c=a.then(u=>(l(),u),u=>{throw l(),u}),r.set(i,c),c}}Ee();Ce();function lt(t){let{storage:e,mode:n="read-write",keyFn:r,keyPrefix:o="llm-replay"}=t,d=Pe({storage:e,keyPrefix:o,mode:n==="read-strict"?"read":n,keyContext:({messages:a,opts:c})=>{let{signal:l,keyContext:u,...p}=c??{};return{messages:a,opts:p}}});async function s(a,c){if(r){if(r.length<=1){let u={messages:a,opts:c,context:c?.keyContext},p=await r(u);return`${o}:${p}`}let l=await r(a,c);return`${o}:${l}`}return d.keyFor({messages:a,opts:c})}return{keyFor:s,async lookup(a,c){if(n!=="write"){if(r){let l=await s(a,c),u=await e.load(l);return u===void 0?void 0:u}return d.lookup({messages:a,opts:c})}},async store(a,c,l){if(n!=="read"){if(r){let u=await s(a,c);await e.save(u,l);return}await d.store({messages:a,opts:c},l)}},async forget(a,c){if(!(n==="read"||n==="write")&&e.delete){if(r){let l=await s(a,c);await e.delete(l);return}await d.forget({messages:a,opts:c})}}}}function ut(t,e,n){return{provider:n?.provider??t.provider,model:n?.model??t.model,capabilities:n?.capabilities??t.capabilities?.bind(t),invoke:e.invoke,stream:e.stream}}var ft=Symbol.for("graphrefly.adapter.middlewareLayers");function pt(t,e,n){let o=[...n?en(n):[],e];return Object.defineProperty(t,ft,{value:Object.freeze(o),enumerable:!1,writable:!1,configurable:!1}),t}function en(t){let e=t[ft];return Array.isArray(e)?e:[]}var z=class extends Error{constructor(n,r){super(`withReplayCache: no cached response for ${r} (key=${n}, mode=read-strict)`);this.key=n;this.method=r}name="ReplayCacheMissError"};function ht(t,e){let n=e.mode??"read-write",r=e.cacheStreaming??!1,o=e.captureStreamCadence??!1,i=e.replaySpeed??1,d=e.keyPrefix??"llm-replay",s=n==="read"||n==="read-strict",a=lt({storage:e.storage,mode:n==="write-only"?"write":n,keyFn:e.keyFn,keyPrefix:d}),c=p=>p<=0?Promise.resolve():new Promise(f=>{new j().start(p,()=>f())}),l=ct(async({messages:p,invokeOpts:f})=>await oe(Ne(t.invoke(p,f))),{keyFn:({_precomputedKey:p})=>p}),u=ut(t,{async invoke(p,f){let h=await a.keyFor(p,f),m=await a.lookup(p,f);if(m?.response){let T=m.response;return{...T,metadata:{...T.metadata??{},replayCache:"hit"}}}if(n==="read-strict")throw new z(h,"invoke");let v=await l({messages:p,invokeOpts:f,_precomputedKey:h});return s||await a.store(p,f,{response:v,storedAtNs:D()}),v},async*stream(p,f){if(!r){for await(let g of t.stream(p,f))yield g;return}let h=await a.keyFor(p,f),m=await a.lookup(p,f);if(m){let g=m.response;if(m.streamChunks&&m.streamCadenceMs)for(let b=0;b<m.streamChunks.length;b++){let C=m.streamCadenceMs[b]??0,F=i>0?C/i:0;F>0&&await c(F),yield{type:"token",delta:m.streamChunks[b]?.delta??""}}else g.content&&(yield{type:"token",delta:g.content});g.usage&&(yield{type:"usage",usage:g.usage}),yield{type:"finish",reason:g.finishReason??"stop"};return}if(n==="read-strict")throw new z(h,"stream");let v="",T,M,w=[],E=[],N;for await(let g of t.stream(p,f)){if(g.type==="token"&&(v+=g.delta,o)){let b=Re(),C=N===void 0?0:(b-N)/1e6;E.push(C),N=b,w.push({delta:g.delta})}g.type==="usage"&&(T=g.usage),g.type==="finish"&&(M=g.reason),yield g}if((v||T)&&!s){let b={response:{content:v,usage:T??{input:{regular:0},output:{regular:0}},finishReason:M,model:t.model??f?.model??"",provider:t.provider},storedAtNs:D(),...o?{streamChunks:w,streamCadenceMs:E}:{}};await a.store(p,f,b)}}});return pt(u,"withReplayCache",t),u}var gt=ge;Ce();function se(){let t=new Error("aborted");return t.name="AbortError",t}function yt(t,e){return t<=0?Promise.resolve():e?.aborted?Promise.reject(se()):new Promise((n,r)=>{let o=new j,i,d=()=>{o.cancel(),e&&i&&e.removeEventListener("abort",i)};o.start(t,()=>{d(),n()}),e&&(i=()=>{d(),r(se())},e.addEventListener("abort",i,{once:!0}))})}function mt(t={}){let e=t.provider??"dry-run",n=t.model??"dry-run-v1",r=t.latencyMs??0,o=Math.max(1,t.streamChunkSize??16),i=t.respond??(s=>{let a=[...s].reverse().find(c=>c.role==="user");return a?`echo: ${a.content}`:"dry-run: no user message"}),d=t.usage??((s,a)=>{let c=s.reduce((l,u)=>l+u.content.length,0);return{input:{regular:Math.ceil(c/4)},output:{regular:Math.ceil(a.length/4)}}});return{provider:e,model:n,async invoke(s,a){if(await yt(r,a?.signal),a?.signal?.aborted)throw se();let c=i(s,a),l=d(s,c);return{content:c,usage:l,finishReason:"stop",model:a?.model??n,provider:e,tier:a?.tier,metadata:{dryRun:!0}}},async*stream(s,a){let c=i(s,a),l=d(s,c),u=Math.ceil(c.length/o)||1,p=r>0?r/u:0;for(let f=0;f<c.length;f+=o){if(a?.signal?.aborted)throw se();await yt(p,a?.signal),yield{type:"token",delta:c.slice(f,f+o)}}yield{type:"usage",usage:l},yield{type:"finish",reason:"stop"}}}}function bt(t,e){return{content:"[fallback: no cached response available for this request]",usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:e,provider:t,metadata:{degraded:!0,reason:"no-fixture"}}}function vt(t,e,n){return typeof t=="string"?{content:t,usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:n,provider:e,metadata:{degraded:!0,reason:"respond"}}:t}async function tn(t,e){if("key"in t)return t.key;let n=gt({messages:t.messages,opts:t.invokeOpts??{}}),r=await J(n);return`${e}:${r}`}function nn(t){let e={response:t.response,storedAtNs:D()};if("key"in t&&t.stream){let n=t.stream.chunks.filter(r=>r.type==="token");return{...e,streamChunks:n.map(r=>({delta:r.delta})),streamCadenceMs:t.stream.delaysMs??n.map(()=>0)}}return e}function rn(t,e){let n=[];if(t.fixtures!=null&&n.push("fixtures"),t.fixturesStorage!=null&&n.push("fixturesStorage"),n.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\` and \`fixturesStorage\` are mutually exclusive; got both ${n.join(" and ")}. Pick one source. For filesystem directories use the node subpath's \`fallbackAdapter\`.`);if(t.fixtures){let r=fe(),o=t.fixtures,i=(async()=>{for(let d of o){let s=await tn(d,e);await r.save(s,nn(d))}})();return i.catch(()=>{}),{tier:r,seedReady:i}}return t.fixturesStorage?{tier:t.fixturesStorage,seedReady:Promise.resolve()}:{tier:void 0,seedReady:Promise.resolve()}}function _t(t={}){let e=t.provider??"fallback",n=t.model??"fallback",r=t.onMiss??"respond",o=t.keyPrefix??"fallback",i=t.record?t.record.adapter:r==="throw"?mt({provider:e,model:n,respond:()=>"[unreachable: read-strict mode throws on miss]"}):{provider:e,model:n,async invoke(l,u){let p=t.respond?t.respond(l,u):bt(e,n);return vt(p,e,n)},async*stream(l,u){let p=t.respond?t.respond(l,u):bt(e,n),f=vt(p,e,n);yield{type:"token",delta:f.content},f.usage&&(yield{type:"usage",usage:f.usage}),yield{type:"finish",reason:f.finishReason??"stop"}}},d,s=Promise.resolve();if(t.record){if(!t.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=t.record.storage}else{let l=rn(t,o);d=l.tier??fe(),s=l.seedReady}let a=t.record?"read-write":r==="throw"?"read-strict":"read",c=ht(i,{storage:d,mode:a,keyPrefix:o,cacheStreaming:!0,captureStreamCadence:!0,replaySpeed:t.replaySpeed,...t.keyFn?{keyFn:t.keyFn}:{}});return{provider:e,model:n,capabilities:c.capabilities?.bind(c),async invoke(l,u){return await s,c.invoke(l,u)},async*stream(l,u){await s;for await(let p of c.stream(l,u))yield p}}}function on(t){if(!(0,K.existsSync)(t))return;let e=(0,K.readdirSync)(t).filter(a=>a.endsWith(".json"));if(e.length===0)return;let n=e[0],r=(0,ie.join)(t,n),o;try{o=JSON.parse((0,K.readFileSync)(r,"utf8"))}catch(a){throw new TypeError(`fallbackAdapter: ${r} is not valid JSON (${a.message}).`)}let i=o,d=i!=null&&"messages"in i,s=i==null||typeof i.response?.content!="string"||typeof i.storedAtNs!="number";if(d||s){let a=d?"`messages` at the top level means this looks hand-authored. ":"";throw new TypeError(`fallbackAdapter: ${r} is not in cache-file format. ${a}Expected \`{ response: { content, usage, ... }, storedAtNs, ... }\` (the shape \`withReplayCache\` and this adapter's \`record\` mode write). For hand-authored fixtures, use the inline \`fixtures: FallbackFixture[]\` option \u2014 the adapter hashes messages for you.`)}}function Tt(t={}){let e=t.keyPrefix??"fallback",n=[];if(t.fixtures!=null&&n.push("fixtures"),t.fixturesDir!=null&&n.push("fixturesDir"),t.fixturesStorage!=null&&n.push("fixturesStorage"),n.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\`, \`fixturesDir\`, and \`fixturesStorage\` are mutually exclusive; got both ${n.join(" and ")}. Pick one source.`);let r=t.fixturesStorage;if(t.fixturesDir!=null){let c=(0,ie.join)(t.fixturesDir,e);on(c),r=pe(c)}let o;if(t.record){if(t.record.storage&&t.record.dir)throw new TypeError("fallbackAdapter: `record.storage` and `record.dir` are mutually exclusive; pick one.");if(t.record.storage)o={adapter:t.record.adapter,storage:t.record.storage};else{let c=t.record.dir??t.fixturesDir;if(c==null)throw new TypeError("fallbackAdapter: record mode requires either `record.dir`, `record.storage`, or an inherited `fixturesDir`.");o={adapter:t.record.adapter,storage:pe((0,ie.join)(c,e))}}}let{fixturesDir:i,record:d,...s}=t,a={...s,...r?{fixturesStorage:r}:{},...o?{record:o}:{}};return _t(a)}0&&(module.exports={fallbackAdapter});
@@ -1,8 +1,8 @@
1
1
  import { KvStorageTier } from '../../extra/storage-tiers.cjs';
2
- import { L as LLMAdapter } from '../../types-BMSGPlpO.cjs';
3
- import { F as FallbackAdapterOptions } from '../../fallback-axI2cXwt.cjs';
4
- export { a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy } from '../../fallback-axI2cXwt.cjs';
5
- import '../../node-fSc-hCv8.cjs';
2
+ import { L as LLMAdapter } from '../../types-1Dhoi7HM.cjs';
3
+ import { F as FallbackAdapterOptions } from '../../fallback-8JYU8tlT.cjs';
4
+ export { a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy } from '../../fallback-8JYU8tlT.cjs';
5
+ import '../../node-BYInONRr.cjs';
6
6
  import '../../extra/sources.cjs';
7
7
  import '../../content-addressed-storage-4-ST1tYk.cjs';
8
8
 
@@ -1,8 +1,8 @@
1
1
  import { KvStorageTier } from '../../extra/storage-tiers.js';
2
- import { L as LLMAdapter } from '../../types-CidcBDuk.js';
3
- import { F as FallbackAdapterOptions } from '../../fallback-DuEXfA4F.js';
4
- export { a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy } from '../../fallback-DuEXfA4F.js';
5
- import '../../node-fSc-hCv8.js';
2
+ import { L as LLMAdapter } from '../../types-39jk0kaV.js';
3
+ import { F as FallbackAdapterOptions } from '../../fallback-CMZl39L5.js';
4
+ export { a as FallbackFixture, b as FallbackMissError, c as FallbackMissPolicy } from '../../fallback-CMZl39L5.js';
5
+ import '../../node-BYInONRr.js';
6
6
  import '../../extra/sources.js';
7
7
  import '../../content-addressed-storage-DuYMjV7o.js';
8
8
 
@@ -1 +1 @@
1
- import{k as f}from"../../chunk-5CPPC75H.js";import"../../chunk-Q7EUZ6NN.js";import"../../chunk-ESMPEKEV.js";import{g as c}from"../../chunk-VN6RDSK2.js";import"../../chunk-D5RFJOZ2.js";import"../../chunk-CE72X3WO.js";import"../../chunk-JJTF75VS.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-MQZWA3DF.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";import{existsSync as u,readdirSync as k,readFileSync as h}from"fs";import{join as p}from"path";function b(e){if(!u(e))return;let i=k(e).filter(o=>o.endsWith(".json"));if(i.length===0)return;let r=i[0],a=p(e,r),t;try{t=JSON.parse(h(a,"utf8"))}catch(o){throw new TypeError(`fallbackAdapter: ${a} is not valid JSON (${o.message}).`)}let s=t,l=s!=null&&"messages"in s,d=s==null||typeof s.response?.content!="string"||typeof s.storedAtNs!="number";if(l||d){let o=l?"`messages` at the top level means this looks hand-authored. ":"";throw new TypeError(`fallbackAdapter: ${a} is not in cache-file format. ${o}Expected \`{ response: { content, usage, ... }, storedAtNs, ... }\` (the shape \`withReplayCache\` and this adapter's \`record\` mode write). For hand-authored fixtures, use the inline \`fixtures: FallbackFixture[]\` option \u2014 the adapter hashes messages for you.`)}}function x(e={}){let i=e.keyPrefix??"fallback",r=[];if(e.fixtures!=null&&r.push("fixtures"),e.fixturesDir!=null&&r.push("fixturesDir"),e.fixturesStorage!=null&&r.push("fixturesStorage"),r.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\`, \`fixturesDir\`, and \`fixturesStorage\` are mutually exclusive; got both ${r.join(" and ")}. Pick one source.`);let a=e.fixturesStorage;if(e.fixturesDir!=null){let n=p(e.fixturesDir,i);b(n),a=c(n)}let t;if(e.record){if(e.record.storage&&e.record.dir)throw new TypeError("fallbackAdapter: `record.storage` and `record.dir` are mutually exclusive; pick one.");if(e.record.storage)t={adapter:e.record.adapter,storage:e.record.storage};else{let n=e.record.dir??e.fixturesDir;if(n==null)throw new TypeError("fallbackAdapter: record mode requires either `record.dir`, `record.storage`, or an inherited `fixturesDir`.");t={adapter:e.record.adapter,storage:c(p(n,i))}}}let{fixturesDir:s,record:l,...d}=e,o={...d,...a?{fixturesStorage:a}:{},...t?{record:t}:{}};return f(o)}export{x as fallbackAdapter};
1
+ import{k as f}from"../../chunk-TFPZLQ5H.js";import"../../chunk-CGDMTXSY.js";import"../../chunk-ESMPEKEV.js";import{g as c}from"../../chunk-VN6RDSK2.js";import"../../chunk-D5RFJOZ2.js";import"../../chunk-CE72X3WO.js";import"../../chunk-L7WY6TZS.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-35JTVPOX.js";import"../../chunk-IA7DUNGB.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";import{existsSync as u,readdirSync as k,readFileSync as h}from"fs";import{join as p}from"path";function b(e){if(!u(e))return;let i=k(e).filter(o=>o.endsWith(".json"));if(i.length===0)return;let r=i[0],a=p(e,r),t;try{t=JSON.parse(h(a,"utf8"))}catch(o){throw new TypeError(`fallbackAdapter: ${a} is not valid JSON (${o.message}).`)}let s=t,l=s!=null&&"messages"in s,d=s==null||typeof s.response?.content!="string"||typeof s.storedAtNs!="number";if(l||d){let o=l?"`messages` at the top level means this looks hand-authored. ":"";throw new TypeError(`fallbackAdapter: ${a} is not in cache-file format. ${o}Expected \`{ response: { content, usage, ... }, storedAtNs, ... }\` (the shape \`withReplayCache\` and this adapter's \`record\` mode write). For hand-authored fixtures, use the inline \`fixtures: FallbackFixture[]\` option \u2014 the adapter hashes messages for you.`)}}function x(e={}){let i=e.keyPrefix??"fallback",r=[];if(e.fixtures!=null&&r.push("fixtures"),e.fixturesDir!=null&&r.push("fixturesDir"),e.fixturesStorage!=null&&r.push("fixturesStorage"),r.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\`, \`fixturesDir\`, and \`fixturesStorage\` are mutually exclusive; got both ${r.join(" and ")}. Pick one source.`);let a=e.fixturesStorage;if(e.fixturesDir!=null){let n=p(e.fixturesDir,i);b(n),a=c(n)}let t;if(e.record){if(e.record.storage&&e.record.dir)throw new TypeError("fallbackAdapter: `record.storage` and `record.dir` are mutually exclusive; pick one.");if(e.record.storage)t={adapter:e.record.adapter,storage:e.record.storage};else{let n=e.record.dir??e.fixturesDir;if(n==null)throw new TypeError("fallbackAdapter: record mode requires either `record.dir`, `record.storage`, or an inherited `fixturesDir`.");t={adapter:e.record.adapter,storage:c(p(n,i))}}}let{fixturesDir:s,record:l,...d}=e,o={...d,...a?{fixturesStorage:a}:{},...t?{record:t}:{}};return f(o)}export{x as fallbackAdapter};