@graphrefly/graphrefly 0.31.0 → 0.33.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 (290) hide show
  1. package/dist/{cascading-D3sapjue.d.ts → cascading-Bg0a4VSf.d.ts} +2 -2
  2. package/dist/{cascading-BfQmSmjU.d.cts → cascading-DKIb6Pk8.d.cts} +2 -2
  3. package/dist/chunk-2JO6LXFT.js +7 -0
  4. package/dist/{chunk-FTA5TB2A.js → chunk-2LZ6DL45.js} +1 -1
  5. package/dist/{chunk-WQ7I7JVU.js → chunk-4F564IPP.js} +1 -1
  6. package/dist/{chunk-YQJPYEAL.js → chunk-4NYSEUKV.js} +1 -1
  7. package/dist/{chunk-N2KKISCE.js → chunk-533RQFF6.js} +1 -1
  8. package/dist/{chunk-ZM7C2FUM.js → chunk-55T3K37W.js} +1 -1
  9. package/dist/chunk-6HQ6HVTF.js +1 -0
  10. package/dist/{chunk-4VXL3UZK.js → chunk-7Q2WPFQ7.js} +1 -1
  11. package/dist/{chunk-3Q2WXM6X.js → chunk-BY4WKPKM.js} +1 -1
  12. package/dist/{chunk-4ZPO2EL5.js → chunk-C5DINHNP.js} +1 -1
  13. package/dist/{chunk-I4U3TPK2.js → chunk-CJMFZXIZ.js} +1 -1
  14. package/dist/{chunk-W6FQIFVE.js → chunk-CLD3F4R5.js} +1 -1
  15. package/dist/chunk-DUK7LTJO.js +43 -0
  16. package/dist/{chunk-RWGJQQLT.js → chunk-FKRPIRE6.js} +1 -1
  17. package/dist/{chunk-PZP4MEXK.js → chunk-GAOX6OPT.js} +1 -1
  18. package/dist/{chunk-OKQUPJRY.js → chunk-GCUYSIM4.js} +1 -1
  19. package/dist/chunk-HIJ2RKVP.js +1 -0
  20. package/dist/{chunk-XRSHMHEG.js → chunk-HTBOCKVD.js} +1 -1
  21. package/dist/{chunk-JXRZXP3N.js → chunk-IB64M7VP.js} +1 -1
  22. package/dist/{chunk-Q2SY7M7K.js → chunk-IJFSR4NU.js} +1 -1
  23. package/dist/{chunk-YZKGGMPT.js → chunk-INXDSJRC.js} +1 -1
  24. package/dist/{chunk-WLPVGXQ6.js → chunk-IPNJDNE7.js} +1 -1
  25. package/dist/{chunk-4UUDNFYG.js → chunk-KGKJCHEK.js} +1 -1
  26. package/dist/{chunk-A4JT4SAD.js → chunk-KRH66M4O.js} +1 -1
  27. package/dist/{chunk-K54OKWNY.js → chunk-L3KUKDZC.js} +1 -1
  28. package/dist/{chunk-Y26UN6J5.js → chunk-LOF5HSD3.js} +1 -1
  29. package/dist/chunk-LYCLF26R.js +1 -0
  30. package/dist/{chunk-CZVYLXFK.js → chunk-M27MVZCP.js} +1 -1
  31. package/dist/{chunk-DWIAG62L.js → chunk-NNKJUORL.js} +1 -1
  32. package/dist/{chunk-PNTBXOQ6.js → chunk-O2WY22L7.js} +1 -1
  33. package/dist/{chunk-JMGGCSIC.js → chunk-PBN426RU.js} +1 -1
  34. package/dist/{chunk-7EQPXQ7H.js → chunk-Q46YJCQH.js} +1 -1
  35. package/dist/{chunk-4KAUNEKV.js → chunk-SFIM774L.js} +1 -1
  36. package/dist/{chunk-EBQ6FXKW.js → chunk-T2TB37TW.js} +1 -1
  37. package/dist/{chunk-UMH3HSP7.js → chunk-T7EQPKOP.js} +1 -1
  38. package/dist/{chunk-3JRKP4BH.js → chunk-TONEKQM3.js} +1 -1
  39. package/dist/{chunk-GF5T7PGC.js → chunk-TZLEMGAK.js} +1 -1
  40. package/dist/{chunk-LWGLBCMU.js → chunk-TZQPPQEQ.js} +1 -1
  41. package/dist/chunk-U2T2XWDA.js +80 -0
  42. package/dist/{chunk-7EJTWGKW.js → chunk-UF746BQ4.js} +1 -1
  43. package/dist/{chunk-7QMVU3IX.js → chunk-WBWBY6LI.js} +1 -1
  44. package/dist/{chunk-WYJTXYWX.js → chunk-Y63GWRHO.js} +1 -1
  45. package/dist/{chunk-YZ6VYLFD.js → chunk-YDWTVO4E.js} +1 -1
  46. package/dist/{chunk-Z3UWIJ3A.js → chunk-YUBV7EEE.js} +1 -1
  47. package/dist/chunk-Z4GXBOWO.js +61 -0
  48. package/dist/compat/index.cjs +5 -5
  49. package/dist/compat/index.d.cts +14 -14
  50. package/dist/compat/index.d.ts +14 -14
  51. package/dist/compat/index.js +1 -1
  52. package/dist/compat/jotai/index.cjs +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/jotai/index.js +1 -1
  56. package/dist/compat/nanostores/index.cjs +1 -1
  57. package/dist/compat/nanostores/index.d.cts +2 -2
  58. package/dist/compat/nanostores/index.d.ts +2 -2
  59. package/dist/compat/nanostores/index.js +1 -1
  60. package/dist/compat/nestjs/index.cjs +5 -5
  61. package/dist/compat/nestjs/index.d.cts +6 -6
  62. package/dist/compat/nestjs/index.d.ts +6 -6
  63. package/dist/compat/nestjs/index.js +1 -1
  64. package/dist/compat/react/index.d.cts +2 -2
  65. package/dist/compat/react/index.d.ts +2 -2
  66. package/dist/compat/solid/index.d.cts +2 -2
  67. package/dist/compat/solid/index.d.ts +2 -2
  68. package/dist/compat/svelte/index.d.cts +2 -2
  69. package/dist/compat/svelte/index.d.ts +2 -2
  70. package/dist/compat/vue/index.d.cts +2 -2
  71. package/dist/compat/vue/index.d.ts +2 -2
  72. package/dist/compat/zustand/index.cjs +3 -3
  73. package/dist/compat/zustand/index.d.cts +4 -4
  74. package/dist/compat/zustand/index.d.ts +4 -4
  75. package/dist/compat/zustand/index.js +1 -1
  76. package/dist/{composite-BY9hMxN7.d.ts → composite-BPDU_XV1.d.ts} +2 -2
  77. package/dist/{composite-CH0S8DFn.d.cts → composite-CmvdhTJe.d.cts} +2 -2
  78. package/dist/core/index.cjs +1 -1
  79. package/dist/core/index.d.cts +4 -4
  80. package/dist/core/index.d.ts +4 -4
  81. package/dist/core/index.js +1 -1
  82. package/dist/extra/browser.cjs +1 -1
  83. package/dist/extra/browser.d.cts +1 -1
  84. package/dist/extra/browser.d.ts +1 -1
  85. package/dist/extra/browser.js +1 -1
  86. package/dist/extra/index.cjs +16 -16
  87. package/dist/extra/index.d.cts +9 -9
  88. package/dist/extra/index.d.ts +9 -9
  89. package/dist/extra/index.js +1 -1
  90. package/dist/extra/node.cjs +1 -1
  91. package/dist/extra/node.d.cts +1 -1
  92. package/dist/extra/node.d.ts +1 -1
  93. package/dist/extra/node.js +1 -1
  94. package/dist/extra/operators.cjs +1 -1
  95. package/dist/extra/operators.d.cts +1 -1
  96. package/dist/extra/operators.d.ts +1 -1
  97. package/dist/extra/operators.js +1 -1
  98. package/dist/extra/reactive.cjs +1 -1
  99. package/dist/extra/reactive.d.cts +3 -3
  100. package/dist/extra/reactive.d.ts +3 -3
  101. package/dist/extra/reactive.js +1 -1
  102. package/dist/extra/sources.cjs +1 -1
  103. package/dist/extra/sources.d.cts +1 -1
  104. package/dist/extra/sources.d.ts +1 -1
  105. package/dist/extra/sources.js +1 -1
  106. package/dist/extra/storage-browser.cjs +1 -1
  107. package/dist/extra/storage-browser.d.cts +1 -1
  108. package/dist/extra/storage-browser.d.ts +1 -1
  109. package/dist/extra/storage-browser.js +1 -1
  110. package/dist/{fallback-Cb3GH1O7.d.cts → fallback-9YznPvPP.d.cts} +1 -1
  111. package/dist/{fallback-DRjJ_ZM8.d.ts → fallback-mYSd8vQo.d.ts} +1 -1
  112. package/dist/graph/index.cjs +4 -4
  113. package/dist/graph/index.d.cts +5 -5
  114. package/dist/graph/index.d.ts +5 -5
  115. package/dist/graph/index.js +1 -1
  116. package/dist/{graph-CWeI0aHd.d.ts → graph-BROUZPG9.d.ts} +12 -2
  117. package/dist/{graph-C4Uxwv0T.d.cts → graph-DaoydJ_u.d.cts} +12 -2
  118. package/dist/{index-BXzl1NDD.d.ts → index--BTb6HUO.d.ts} +332 -108
  119. package/dist/{index-Dm3_D5Ta.d.cts → index-B-KCkW4M.d.cts} +4 -4
  120. package/dist/{index-CDK5RsV5.d.cts → index-B1hFhK1K.d.cts} +1 -1
  121. package/dist/{index-CJymKyzT.d.ts → index-B5eS17Bz.d.ts} +7 -7
  122. package/dist/{index-UZO988ox.d.cts → index-BDEhWLF4.d.cts} +3 -3
  123. package/dist/{index-DGb1awva.d.ts → index-BFHpNSsV.d.ts} +4 -4
  124. package/dist/{index-DDo-eqQ4.d.cts → index-BO6t0HjV.d.cts} +1 -1
  125. package/dist/{index-CrC7urhX.d.ts → index-BRisOxlx.d.ts} +1 -1
  126. package/dist/{index-CfFYyLR8.d.ts → index-BUtCR0k6.d.ts} +13 -4
  127. package/dist/{index-BydMDMf7.d.cts → index-BVTjuKeP.d.cts} +1 -1
  128. package/dist/{index-BX22kvjh.d.ts → index-BWiX5foT.d.ts} +1 -1
  129. package/dist/{index-DxMS0cHM.d.ts → index-Bd2AjMQY.d.ts} +2 -2
  130. package/dist/{index-CvS9IuTG.d.ts → index-Bi4ZP6Hc.d.ts} +2 -2
  131. package/dist/{index-D-kHVedZ.d.cts → index-BkfL5MXh.d.cts} +24 -3
  132. package/dist/{index-9iguV3bF.d.cts → index-BpjQanLs.d.cts} +2 -2
  133. package/dist/{index-D9HrBx2J.d.ts → index-BsxqmV6u.d.ts} +2 -2
  134. package/dist/{index-DVNLe3pS.d.cts → index-C2Dey3L-.d.cts} +12 -3
  135. package/dist/{index-CwhcFzTA.d.ts → index-C5uMGVJw.d.ts} +4 -4
  136. package/dist/{index-D9Y_u6BG.d.cts → index-C8_bnDBZ.d.cts} +3 -3
  137. package/dist/{index-C5Ghnp5B.d.ts → index-CD7qmvSf.d.ts} +3 -3
  138. package/dist/{index-wIx1Jisk.d.ts → index-CI5fULSz.d.ts} +1 -1
  139. package/dist/{index-BBINVimG.d.ts → index-CNxdDb2e.d.ts} +3 -3
  140. package/dist/{index-FBqTfL_S.d.cts → index-CQ1gt4rn.d.cts} +1 -1
  141. package/dist/{index-DD7RhHNJ.d.cts → index-C_cXlbu0.d.cts} +332 -108
  142. package/dist/{index-B-z8WaSd.d.cts → index-Ccv_61jG.d.cts} +2 -2
  143. package/dist/{index-RQg6lTrN.d.ts → index-Ced0dphF.d.ts} +9 -9
  144. package/dist/{index-DylQCKEL.d.cts → index-ChZvMC4M.d.cts} +13 -4
  145. package/dist/{index-CcS0t-l2.d.ts → index-Chi9IiHJ.d.ts} +24 -3
  146. package/dist/{index-CcpEvuPl.d.cts → index-ClJUZAOr.d.cts} +18 -3
  147. package/dist/{index-D7XxY1Ff.d.cts → index-ClKm7CFB.d.cts} +1 -1
  148. package/dist/{index-C98oJsEs.d.cts → index-Cn3taOmp.d.cts} +2 -2
  149. package/dist/{index-yIdWFo2b.d.cts → index-CoR-tOZA.d.cts} +4 -4
  150. package/dist/{index-BpFWP7Bq.d.cts → index-Cp91Sxbo.d.cts} +5 -4
  151. package/dist/{index-IZ3l_vQ9.d.ts → index-Cq7Uqgu4.d.ts} +2 -2
  152. package/dist/{index-DBQUKh59.d.cts → index-D23g00HE.d.cts} +4 -4
  153. package/dist/{index-Docdiu9a.d.ts → index-D80nGRb9.d.ts} +3 -3
  154. package/dist/{index-Bd6oFZqO.d.ts → index-DDf8PoPO.d.ts} +439 -67
  155. package/dist/{index-CRAkoq-y.d.cts → index-DR3XqZlV.d.cts} +1 -1
  156. package/dist/{index-BANwzwBV.d.ts → index-Db21wuaD.d.ts} +5 -4
  157. package/dist/{index-CZChc85Q.d.cts → index-Dgcd59CJ.d.cts} +439 -67
  158. package/dist/{index-CIXaiYDE.d.cts → index-DhWrMTI6.d.cts} +1 -1
  159. package/dist/{index-CotRMjtJ.d.ts → index-DheNs40A.d.ts} +2 -2
  160. package/dist/{index-C6NBfXj-.d.ts → index-Dia4yc2y.d.ts} +3 -3
  161. package/dist/{index-Bs3-LC83.d.cts → index-Ds3Rz9m9.d.cts} +3 -3
  162. package/dist/{index-FrYrV-Vf.d.ts → index-Dtpr2FIB.d.ts} +18 -3
  163. package/dist/{index-ByPnK85n.d.ts → index-DupIl9wI.d.ts} +1 -1
  164. package/dist/{index-B5iVOD7w.d.ts → index-DuvQAU02.d.ts} +2 -2
  165. package/dist/{index-D0C_USMR.d.ts → index-DxEcY7Om.d.ts} +1 -1
  166. package/dist/{index-CFW32Dy1.d.ts → index-HvJ90_tX.d.ts} +12 -3
  167. package/dist/{index-DR3gf_DG.d.cts → index-Jgl7ev9I.d.cts} +9 -9
  168. package/dist/{index-BMe3pCom.d.cts → index-RJX4snyi.d.cts} +2 -2
  169. package/dist/{index-gJQqJTKx.d.cts → index-ZIQaKIdY.d.cts} +7 -7
  170. package/dist/{index-BEpRsvhg.d.ts → index-b4a6Sg0R.d.ts} +4 -4
  171. package/dist/{index-lKuLYmHO.d.cts → index-iKsmdnq6.d.cts} +2 -2
  172. package/dist/{index-Bvi5uJxX.d.ts → index-nP13Qe6T.d.ts} +1 -1
  173. package/dist/{index-iBp74eGU.d.cts → index-p0bkNfby.d.cts} +3 -3
  174. package/dist/{index-SSGqF8mI.d.cts → index-wcfc7W-f.d.cts} +2 -2
  175. package/dist/{index-Cy7eFeIX.d.cts → index-yJY9thRY.d.cts} +2 -2
  176. package/dist/{index-DnrZghBB.d.ts → index-ygRFoyrN.d.ts} +2 -2
  177. package/dist/{index-Ip3q9T9x.d.ts → index-zA1uVtk0.d.ts} +1 -1
  178. package/dist/index.cjs +53 -50
  179. package/dist/index.d.cts +44 -44
  180. package/dist/index.d.ts +44 -44
  181. package/dist/index.js +1 -1
  182. package/dist/{meta-COtmHLwT.d.cts → meta-BdjSt8ky.d.cts} +1 -1
  183. package/dist/{meta-BMwx3ExI.d.ts → meta-CtDjj7cU.d.ts} +1 -1
  184. package/dist/{node-BVV7G1bq.d.cts → node-8qx0kgYt.d.cts} +49 -1
  185. package/dist/{node-BVV7G1bq.d.ts → node-8qx0kgYt.d.ts} +49 -1
  186. package/dist/{observable-BrUAPeH_.d.cts → observable-B6Ba-TTI.d.cts} +1 -1
  187. package/dist/{observable-ITikPXz3.d.ts → observable-DOniYM2B.d.ts} +1 -1
  188. package/dist/patterns/ai/browser.cjs +4 -4
  189. package/dist/patterns/ai/browser.d.cts +4 -4
  190. package/dist/patterns/ai/browser.d.ts +4 -4
  191. package/dist/patterns/ai/browser.js +1 -1
  192. package/dist/patterns/ai/index.cjs +21 -18
  193. package/dist/patterns/ai/index.d.cts +16 -16
  194. package/dist/patterns/ai/index.d.ts +16 -16
  195. package/dist/patterns/ai/index.js +1 -1
  196. package/dist/patterns/ai/node.cjs +2 -2
  197. package/dist/patterns/ai/node.d.cts +4 -4
  198. package/dist/patterns/ai/node.d.ts +4 -4
  199. package/dist/patterns/ai/node.js +1 -1
  200. package/dist/patterns/audit/index.cjs +7 -7
  201. package/dist/patterns/audit/index.d.cts +5 -5
  202. package/dist/patterns/audit/index.d.ts +5 -5
  203. package/dist/patterns/audit/index.js +1 -1
  204. package/dist/patterns/cqrs/index.cjs +3 -3
  205. package/dist/patterns/cqrs/index.d.cts +4 -4
  206. package/dist/patterns/cqrs/index.d.ts +4 -4
  207. package/dist/patterns/cqrs/index.js +1 -1
  208. package/dist/patterns/demo-shell/index.cjs +6 -6
  209. package/dist/patterns/demo-shell/index.d.cts +5 -5
  210. package/dist/patterns/demo-shell/index.d.ts +5 -5
  211. package/dist/patterns/demo-shell/index.js +1 -1
  212. package/dist/patterns/domain-templates/index.cjs +5 -5
  213. package/dist/patterns/domain-templates/index.d.cts +4 -4
  214. package/dist/patterns/domain-templates/index.d.ts +4 -4
  215. package/dist/patterns/domain-templates/index.js +1 -1
  216. package/dist/patterns/graphspec/index.cjs +27 -25
  217. package/dist/patterns/graphspec/index.d.cts +5 -5
  218. package/dist/patterns/graphspec/index.d.ts +5 -5
  219. package/dist/patterns/graphspec/index.js +1 -1
  220. package/dist/patterns/guarded-execution/index.cjs +7 -7
  221. package/dist/patterns/guarded-execution/index.d.cts +6 -6
  222. package/dist/patterns/guarded-execution/index.d.ts +6 -6
  223. package/dist/patterns/guarded-execution/index.js +1 -1
  224. package/dist/patterns/harness/index.cjs +12 -11
  225. package/dist/patterns/harness/index.d.cts +10 -9
  226. package/dist/patterns/harness/index.d.ts +10 -9
  227. package/dist/patterns/harness/index.js +1 -1
  228. package/dist/patterns/job-queue/index.cjs +7 -7
  229. package/dist/patterns/job-queue/index.d.cts +4 -4
  230. package/dist/patterns/job-queue/index.d.ts +4 -4
  231. package/dist/patterns/job-queue/index.js +1 -1
  232. package/dist/patterns/lens/index.cjs +5 -5
  233. package/dist/patterns/lens/index.d.cts +6 -6
  234. package/dist/patterns/lens/index.d.ts +6 -6
  235. package/dist/patterns/lens/index.js +1 -1
  236. package/dist/patterns/memory/index.cjs +4 -4
  237. package/dist/patterns/memory/index.d.cts +4 -4
  238. package/dist/patterns/memory/index.d.ts +4 -4
  239. package/dist/patterns/memory/index.js +1 -1
  240. package/dist/patterns/messaging/index.cjs +4 -4
  241. package/dist/patterns/messaging/index.d.cts +4 -4
  242. package/dist/patterns/messaging/index.d.ts +4 -4
  243. package/dist/patterns/messaging/index.js +1 -1
  244. package/dist/patterns/orchestration/index.cjs +7 -7
  245. package/dist/patterns/orchestration/index.d.cts +5 -5
  246. package/dist/patterns/orchestration/index.d.ts +5 -5
  247. package/dist/patterns/orchestration/index.js +1 -1
  248. package/dist/patterns/reactive-layout/index.cjs +2 -2
  249. package/dist/patterns/reactive-layout/index.d.cts +5 -5
  250. package/dist/patterns/reactive-layout/index.d.ts +5 -5
  251. package/dist/patterns/reactive-layout/index.js +1 -1
  252. package/dist/patterns/reduction/index.cjs +2 -2
  253. package/dist/patterns/reduction/index.d.cts +4 -4
  254. package/dist/patterns/reduction/index.d.ts +4 -4
  255. package/dist/patterns/reduction/index.js +1 -1
  256. package/dist/patterns/refine-loop/index.cjs +7 -7
  257. package/dist/patterns/refine-loop/index.d.cts +5 -5
  258. package/dist/patterns/refine-loop/index.d.ts +5 -5
  259. package/dist/patterns/refine-loop/index.js +1 -1
  260. package/dist/patterns/resilient-pipeline/index.cjs +1 -1
  261. package/dist/patterns/resilient-pipeline/index.d.cts +6 -6
  262. package/dist/patterns/resilient-pipeline/index.d.ts +6 -6
  263. package/dist/patterns/resilient-pipeline/index.js +1 -1
  264. package/dist/patterns/surface/index.cjs +15 -13
  265. package/dist/patterns/surface/index.d.cts +6 -6
  266. package/dist/patterns/surface/index.d.ts +6 -6
  267. package/dist/patterns/surface/index.js +1 -1
  268. package/dist/{reactive-layout-BAr6-_o5.d.ts → reactive-layout-DBJ3Vz-m.d.ts} +2 -2
  269. package/dist/{reactive-layout-5oEn8lHM.d.cts → reactive-layout-Dk9AOQb_.d.cts} +2 -2
  270. package/dist/{reactive-log-5jFeNRmd.d.cts → reactive-log-CWC7jO4J.d.cts} +1 -1
  271. package/dist/{reactive-log-BOJDCI5x.d.ts → reactive-log-CqaBg8nf.d.ts} +1 -1
  272. package/dist/{reactive-map-IJIfZxoh.d.cts → reactive-map-Cm89Hk0c.d.cts} +1 -1
  273. package/dist/{reactive-map-CtRaCddO.d.ts → reactive-map-LjwjcFaW.d.ts} +1 -1
  274. package/dist/{resilience-IVNDYORD.js → resilience-7UZHSSGC.js} +1 -1
  275. package/dist/{resilience-Q6Bt_7y0.d.cts → resilience-N_VtLf7W.d.cts} +1 -1
  276. package/dist/{resilience-CludlzcP.d.ts → resilience-RjDIHZNZ.d.ts} +1 -1
  277. package/dist/{sugar-BHbAACDG.d.ts → sugar-CQkn_rxB.d.ts} +1 -1
  278. package/dist/{sugar-CqR6DJ7v.d.cts → sugar-DVEYhR7a.d.cts} +1 -1
  279. package/dist/{topology-tree-CVREibAc.d.cts → topology-tree-BB6oJxMz.d.cts} +1 -1
  280. package/dist/{topology-tree-CkjojcB6.d.ts → topology-tree-CAFOG5S5.d.ts} +1 -1
  281. package/dist/{types-CdfO2QTt.d.ts → types-B2LfBvNc.d.ts} +16 -2
  282. package/dist/{types-BgMqbc7N.d.cts → types-Cp_4coR_.d.cts} +16 -2
  283. package/package.json +1 -1
  284. package/dist/chunk-5LJAQTSS.js +0 -1
  285. package/dist/chunk-7AJKUA36.js +0 -1
  286. package/dist/chunk-ASDKRNOJ.js +0 -60
  287. package/dist/chunk-KN4Q5MQO.js +0 -1
  288. package/dist/chunk-PSQNYY72.js +0 -7
  289. package/dist/chunk-X2VHDT26.js +0 -43
  290. package/dist/chunk-XEFAMCEA.js +0 -78
@@ -1 +1 @@
1
- import{b as G,d as F}from"./chunk-JMGGCSIC.js";import{c as E}from"./chunk-K54OKWNY.js";import{a as A}from"./chunk-3Q2WXM6X.js";import{b as q}from"./chunk-XRSHMHEG.js";import{j as I}from"./chunk-PSQNYY72.js";import{B as M}from"./chunk-UMH3HSP7.js";import{E as d,G as o,H as O,m as S}from"./chunk-7AJKUA36.js";import{b as V}from"./chunk-QYADASLV.js";var $={};V($,{contentModerationGraph:()=>Q,dataQualityGraph:()=>T,issueTrackerGraph:()=>B,observabilityGraph:()=>D});function s(u,a){return E("domain_template",u,a)}function D(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=[{name:"errors",classify:e=>C(e,"error")},{name:"traces",classify:e=>C(e,"trace")},{name:"metrics",classify:e=>C(e,"metric")}],m=a.branches??h,y=m.map(e=>({name:e.name,classify:e.classify})),c=A("stratify",a.source,y);n.mount("stratify",c);let k=m.map(e=>{try{let i=n.resolve(`stratify::branch/${e.name}`);return o([i],([x])=>x,{initial:null})}catch{return d(null)}}),l=a.correlate??(e=>e),_=o(k,e=>l(e),{meta:s("observability",{stage:"correlate"})});n.add(_,{name:"correlate"});let N=a.sloCheck??(()=>({pass:!0})),w=o([_],e=>e[0],{meta:s("observability",{stage:"slo_value"})}),f=o([w],e=>N(e[0]),{meta:s("observability",{stage:"slo_verified"})});n.add(w,{name:"slo_value"}),n.add(f,{name:"slo_verified"});let v=a.weights??m.map(()=>1),b=k.map(e=>o([e],i=>i[0]!=null?1:0)),p=v.map(e=>d(e));for(let e=0;e<b.length;e++)n.add(b[e],{name:`__signal_${e}`}),n.add(p[e],{name:`__weight_${e}`});let t=F(b,p);n.add(t,{name:"alerts"});let g=o([t,f],e=>({scored:e[0],slo:e[1]}),{meta:s("observability",{stage:"output"})});n.add(g,{name:"output"});let R=d(null,{meta:s("observability",{stage:"feedback_reentry"})});n.add(R,{name:"feedback_reentry"});let r=o([f],e=>{let i=e[0];return i&&i.pass===!1?i:null},{meta:s("observability",{stage:"feedback_condition"})});return n.add(r,{name:"feedback_condition"}),G(n,"feedback_condition","feedback_reentry",{maxIterations:a.maxFeedbackIterations??5}),n}function B(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=0,m=e=>({id:`issue-${++h}`,title:String(e),severity:1,source:"unknown",raw:e}),y=a.extract??m,c=o([a.source],e=>y(e[0]),{meta:s("issue_tracker",{stage:"extract"})});n.add(c,{name:"extract"});let k=a.verify??(()=>({valid:!0})),l=o([c],e=>{let i=e[0];return{issue:i,verification:k(i)}},{meta:s("issue_tracker",{stage:"verify"})});n.add(l,{name:"verify"});let _=d([],{meta:s("issue_tracker",{stage:"known_patterns"})});n.add(_,{name:"known_patterns"});let N=a.detectRegression??(()=>({regression:!1})),w=o([c,_],e=>{let i=e[0],x=e[1];return{issue:i,regression:N(i,x)}},{meta:s("issue_tracker",{stage:"regression"})});n.add(w,{name:"regression"});let f=o([c],e=>e[0]?.severity??0),v=o([w],e=>e[0]?.regression?2:0);n.add(f,{name:"__severity_signal"}),n.add(v,{name:"__regression_signal"});let b=d(1),p=d(1.5);n.add(b,{name:"__severity_weight"}),n.add(p,{name:"__regression_weight"});let t=F([f,v],[b,p]);n.add(t,{name:"priority"});let g=o([l,w,t],e=>({verified:e[0],regression:e[1],priority:e[2]}),{meta:s("issue_tracker",{stage:"output"})});n.add(g,{name:"output"});let R=d(null,{meta:s("issue_tracker",{stage:"feedback_reentry"})});n.add(R,{name:"feedback_reentry"});let r=o([l],e=>{let i=e[0];if(i){let x=i.verification;if(x&&x.valid===!1)return i}return null},{meta:s("issue_tracker",{stage:"feedback_condition"})});return n.add(r,{name:"feedback_condition"}),G(n,"feedback_condition","feedback_reentry",{maxIterations:a.maxFeedbackIterations??3}),n}function Q(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=r=>({label:"review",confidence:.5,original:r}),m=a.classify??h,y=o([a.source],r=>m(r[0]),{meta:s("content_moderation",{stage:"classify"})});n.add(y,{name:"classify"});let c=A("stratify",y,[{name:"safe",classify:r=>r.label==="safe"},{name:"review",classify:r=>r.label==="review"},{name:"block",classify:r=>r.label==="block"}]);n.mount("stratify",c);let k=q([],{name:"review_queue",maxSize:a.maxQueueSize});n.add(k.entries,{name:"review_queue"});let l;try{l=n.resolve("stratify::branch/review")}catch{l=d(null),n.add(l,{name:"__review_fallback"})}let _=O([l],r=>{let e=r[0];e&&k.append(e)});n.add(_,{name:"__review_accumulator"}),n.addDisposer(M(_));let N=d({},{meta:s("content_moderation",{stage:"policy",access:"both",description:"Moderation policy rules \u2014 updated via feedback"})});n.add(N,{name:"policy"});let w=a.weights??[.1,1,2],f=o([y],r=>r[0]?.confidence??0),v=o([y],r=>{let e=r[0];return e?e.label==="block"?w[2]:e.label==="review"?w[1]:w[0]:0});n.add(f,{name:"__confidence_signal"}),n.add(v,{name:"__severity_signal"});let b=d(1),p=d(1);n.add(b,{name:"__w_confidence"}),n.add(p,{name:"__w_severity"});let t=F([f,v],[b,p]);n.add(t,{name:"priority"});let g=o([y,t],r=>({classification:r[0],priority:r[1]}),{meta:s("content_moderation",{stage:"output"})});n.add(g,{name:"output"});let R=o([k.entries,N],r=>{let e=r[0];if(e&&e.length>0){let i=e[e.length-1];if(i&&i.falsePositive)return i}return null},{meta:s("content_moderation",{stage:"feedback_condition"})});return n.add(R,{name:"feedback_condition"}),G(n,"feedback_condition","policy",{maxIterations:a.maxFeedbackIterations??5}),n}function T(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=a.validate??(t=>({valid:!0,errors:[],record:t})),m=o([a.source],t=>t[0]!=null?h(t[0]):void 0,{meta:s("data_quality",{stage:"validate"})});n.add(m,{name:"validate"});let y=a.detectAnomaly??(t=>({anomaly:!1,score:0,record:t})),c=o([a.source],t=>t[0]!=null?y(t[0]):void 0,{meta:s("data_quality",{stage:"anomaly"})});n.add(c,{name:"anomaly"});let k=d(null,{meta:s("data_quality",{stage:"baseline",description:"Rolling baseline for drift detection"})});n.add(k,{name:"baseline"});let l=O([m],t=>{let g=t[0];g?.valid&&S(()=>{k.emit(g.record)})});n.add(l,{name:"__baseline_updater"}),M(l);let _=a.detectDrift??(()=>({drift:!1})),N=o([a.source,k],t=>_(t[0],t[1]),{meta:s("data_quality",{stage:"drift"})});n.add(N,{name:"drift"});let w=a.suggest??(()=>null),f=o([m,c],t=>w({validation:t[0],anomaly:t[1]}),{meta:s("data_quality",{stage:"remediate"})});n.add(f,{name:"remediate"});let v=o([m,c,N,f],t=>({validation:t[0],anomaly:t[1],drift:t[2],remediation:t[3]}),{meta:s("data_quality",{stage:"output"})});n.add(v,{name:"output"});let b=d([],{meta:s("data_quality",{stage:"validation_rules"})});n.add(b,{name:"validation_rules"});let p=o([c],t=>{let g=t[0];return g?.anomaly?g:null},{meta:s("data_quality",{stage:"feedback_condition"})});return n.add(p,{name:"feedback_condition"}),G(n,"feedback_condition","validation_rules",{maxIterations:a.maxFeedbackIterations??3}),n}function C(u,a){if(u==null||typeof u!="object")return!1;let n=u;return n.type===a||n.kind===a}export{D as a,B as b,Q as c,T as d,$ as e};
1
+ import{b as G,d as F}from"./chunk-PBN426RU.js";import{c as E}from"./chunk-L3KUKDZC.js";import{a as A}from"./chunk-BY4WKPKM.js";import{b as q}from"./chunk-HTBOCKVD.js";import{j as I}from"./chunk-2JO6LXFT.js";import{B as M}from"./chunk-T7EQPKOP.js";import{E as d,G as o,H as O,m as S}from"./chunk-LYCLF26R.js";import{b as V}from"./chunk-QYADASLV.js";var $={};V($,{contentModerationGraph:()=>Q,dataQualityGraph:()=>T,issueTrackerGraph:()=>B,observabilityGraph:()=>D});function s(u,a){return E("domain_template",u,a)}function D(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=[{name:"errors",classify:e=>C(e,"error")},{name:"traces",classify:e=>C(e,"trace")},{name:"metrics",classify:e=>C(e,"metric")}],m=a.branches??h,y=m.map(e=>({name:e.name,classify:e.classify})),c=A("stratify",a.source,y);n.mount("stratify",c);let k=m.map(e=>{try{let i=n.resolve(`stratify::branch/${e.name}`);return o([i],([x])=>x,{initial:null})}catch{return d(null)}}),l=a.correlate??(e=>e),_=o(k,e=>l(e),{meta:s("observability",{stage:"correlate"})});n.add(_,{name:"correlate"});let N=a.sloCheck??(()=>({pass:!0})),w=o([_],e=>e[0],{meta:s("observability",{stage:"slo_value"})}),f=o([w],e=>N(e[0]),{meta:s("observability",{stage:"slo_verified"})});n.add(w,{name:"slo_value"}),n.add(f,{name:"slo_verified"});let v=a.weights??m.map(()=>1),b=k.map(e=>o([e],i=>i[0]!=null?1:0)),p=v.map(e=>d(e));for(let e=0;e<b.length;e++)n.add(b[e],{name:`__signal_${e}`}),n.add(p[e],{name:`__weight_${e}`});let t=F(b,p);n.add(t,{name:"alerts"});let g=o([t,f],e=>({scored:e[0],slo:e[1]}),{meta:s("observability",{stage:"output"})});n.add(g,{name:"output"});let R=d(null,{meta:s("observability",{stage:"feedback_reentry"})});n.add(R,{name:"feedback_reentry"});let r=o([f],e=>{let i=e[0];return i&&i.pass===!1?i:null},{meta:s("observability",{stage:"feedback_condition"})});return n.add(r,{name:"feedback_condition"}),G(n,"feedback_condition","feedback_reentry",{maxIterations:a.maxFeedbackIterations??5}),n}function B(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=0,m=e=>({id:`issue-${++h}`,title:String(e),severity:1,source:"unknown",raw:e}),y=a.extract??m,c=o([a.source],e=>y(e[0]),{meta:s("issue_tracker",{stage:"extract"})});n.add(c,{name:"extract"});let k=a.verify??(()=>({valid:!0})),l=o([c],e=>{let i=e[0];return{issue:i,verification:k(i)}},{meta:s("issue_tracker",{stage:"verify"})});n.add(l,{name:"verify"});let _=d([],{meta:s("issue_tracker",{stage:"known_patterns"})});n.add(_,{name:"known_patterns"});let N=a.detectRegression??(()=>({regression:!1})),w=o([c,_],e=>{let i=e[0],x=e[1];return{issue:i,regression:N(i,x)}},{meta:s("issue_tracker",{stage:"regression"})});n.add(w,{name:"regression"});let f=o([c],e=>e[0]?.severity??0),v=o([w],e=>e[0]?.regression?2:0);n.add(f,{name:"__severity_signal"}),n.add(v,{name:"__regression_signal"});let b=d(1),p=d(1.5);n.add(b,{name:"__severity_weight"}),n.add(p,{name:"__regression_weight"});let t=F([f,v],[b,p]);n.add(t,{name:"priority"});let g=o([l,w,t],e=>({verified:e[0],regression:e[1],priority:e[2]}),{meta:s("issue_tracker",{stage:"output"})});n.add(g,{name:"output"});let R=d(null,{meta:s("issue_tracker",{stage:"feedback_reentry"})});n.add(R,{name:"feedback_reentry"});let r=o([l],e=>{let i=e[0];if(i){let x=i.verification;if(x&&x.valid===!1)return i}return null},{meta:s("issue_tracker",{stage:"feedback_condition"})});return n.add(r,{name:"feedback_condition"}),G(n,"feedback_condition","feedback_reentry",{maxIterations:a.maxFeedbackIterations??3}),n}function Q(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=r=>({label:"review",confidence:.5,original:r}),m=a.classify??h,y=o([a.source],r=>m(r[0]),{meta:s("content_moderation",{stage:"classify"})});n.add(y,{name:"classify"});let c=A("stratify",y,[{name:"safe",classify:r=>r.label==="safe"},{name:"review",classify:r=>r.label==="review"},{name:"block",classify:r=>r.label==="block"}]);n.mount("stratify",c);let k=q([],{name:"review_queue",maxSize:a.maxQueueSize});n.add(k.entries,{name:"review_queue"});let l;try{l=n.resolve("stratify::branch/review")}catch{l=d(null),n.add(l,{name:"__review_fallback"})}let _=O([l],r=>{let e=r[0];e&&k.append(e)});n.add(_,{name:"__review_accumulator"}),n.addDisposer(M(_));let N=d({},{meta:s("content_moderation",{stage:"policy",access:"both",description:"Moderation policy rules \u2014 updated via feedback"})});n.add(N,{name:"policy"});let w=a.weights??[.1,1,2],f=o([y],r=>r[0]?.confidence??0),v=o([y],r=>{let e=r[0];return e?e.label==="block"?w[2]:e.label==="review"?w[1]:w[0]:0});n.add(f,{name:"__confidence_signal"}),n.add(v,{name:"__severity_signal"});let b=d(1),p=d(1);n.add(b,{name:"__w_confidence"}),n.add(p,{name:"__w_severity"});let t=F([f,v],[b,p]);n.add(t,{name:"priority"});let g=o([y,t],r=>({classification:r[0],priority:r[1]}),{meta:s("content_moderation",{stage:"output"})});n.add(g,{name:"output"});let R=o([k.entries,N],r=>{let e=r[0];if(e&&e.length>0){let i=e[e.length-1];if(i&&i.falsePositive)return i}return null},{meta:s("content_moderation",{stage:"feedback_condition"})});return n.add(R,{name:"feedback_condition"}),G(n,"feedback_condition","policy",{maxIterations:a.maxFeedbackIterations??5}),n}function T(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=a.validate??(t=>({valid:!0,errors:[],record:t})),m=o([a.source],t=>t[0]!=null?h(t[0]):void 0,{meta:s("data_quality",{stage:"validate"})});n.add(m,{name:"validate"});let y=a.detectAnomaly??(t=>({anomaly:!1,score:0,record:t})),c=o([a.source],t=>t[0]!=null?y(t[0]):void 0,{meta:s("data_quality",{stage:"anomaly"})});n.add(c,{name:"anomaly"});let k=d(null,{meta:s("data_quality",{stage:"baseline",description:"Rolling baseline for drift detection"})});n.add(k,{name:"baseline"});let l=O([m],t=>{let g=t[0];g?.valid&&S(()=>{k.emit(g.record)})});n.add(l,{name:"__baseline_updater"}),M(l);let _=a.detectDrift??(()=>({drift:!1})),N=o([a.source,k],t=>_(t[0],t[1]),{meta:s("data_quality",{stage:"drift"})});n.add(N,{name:"drift"});let w=a.suggest??(()=>null),f=o([m,c],t=>w({validation:t[0],anomaly:t[1]}),{meta:s("data_quality",{stage:"remediate"})});n.add(f,{name:"remediate"});let v=o([m,c,N,f],t=>({validation:t[0],anomaly:t[1],drift:t[2],remediation:t[3]}),{meta:s("data_quality",{stage:"output"})});n.add(v,{name:"output"});let b=d([],{meta:s("data_quality",{stage:"validation_rules"})});n.add(b,{name:"validation_rules"});let p=o([c],t=>{let g=t[0];return g?.anomaly?g:null},{meta:s("data_quality",{stage:"feedback_condition"})});return n.add(p,{name:"feedback_condition"}),G(n,"feedback_condition","validation_rules",{maxIterations:a.maxFeedbackIterations??3}),n}function C(u,a){if(u==null||typeof u!="object")return!1;let n=u;return n.type===a||n.kind===a}export{D as a,B as b,Q as c,T as d,$ as e};
@@ -1 +1 @@
1
- import{j as C}from"./chunk-PSQNYY72.js";import{E as w,G as E,o as x}from"./chunk-7AJKUA36.js";import{b as z}from"./chunk-QYADASLV.js";var F={};z(F,{collection:()=>G,decay:()=>K,knowledgeGraph:()=>O,lightCollection:()=>S,vectorIndex:()=>L});function K(s,a,l,r=0){if(!Number.isFinite(s))return r;if(!Number.isFinite(a)||a<=0||!Number.isFinite(l)||l<=0)return Math.max(r,s);let y=s*Math.exp(-l*a);return Math.max(r,y)}function V(s){if(s!==void 0&&s<1)throw new RangeError("maxSize must be >= 1")}function M(s){return new Map(s)}function T(s){return s.cache??new Map}function N(s){return s.cache??[]}function I(s,a){let l=Math.max(s.length,a.length),r=0,y=0,p=0;for(let o=0;o<l;o+=1){let n=s[o]??0,e=a[o]??0;r+=n*e,y+=n*n,p+=e*e}return y===0||p===0?0:r/Math.sqrt(y*p)}function S(s={}){let a=s.maxSize,l=s.policy??"fifo";V(a);let r=w(new Map,{name:s.name,describeKind:"state"});function y(o){if(a!==void 0)for(;o.size>a;){let n;for(let e of o.values()){if(!n){n=e;continue}let i=l==="lru"?e.lastAccessNs:e.createdAtNs,t=l==="lru"?n.lastAccessNs:n.createdAtNs;i<t&&(n=e)}if(!n)break;o.delete(n.id)}}function p(o){r.emit(o)}return{entries:r,upsert(o,n){let e=x(),i=T(r),t=i.get(o),m=M(i);m.set(o,{id:o,value:n,createdAtNs:t?.createdAtNs??e,lastAccessNs:e}),y(m),p(m)},remove(o){let n=M(T(r));n.delete(o)&&p(n)},clear(){T(r).size!==0&&p(new Map)},get(o){let n=T(r),e=n.get(o);if(e){if(l==="lru"){let i=x(),t=M(n);t.set(o,{...e,lastAccessNs:i}),p(t)}return e.value}},has(o){return T(r).has(o)}}}function G(s,a={}){let l=a.maxSize,r=a.policy??"lru",y=a.decayRate??0,p=a.minScore??0,o=a.score??(()=>1);V(l);let n=new C(s),e=w(new Map,{name:"items",describeKind:"state"}),i=E([e],([c])=>{let d=c??new Map,u=x(),h=[...d.values()].map(f=>{let b=(u-f.lastAccessNs)/1e9;return{...f,score:K(f.baseScore,b,y,p)}});return h.sort((f,b)=>b.score-f.score||b.lastAccessNs-f.lastAccessNs),h},{name:"ranked",describeKind:"derived"}),t=E([e],([c])=>(c??new Map).size,{name:"size",describeKind:"derived",initial:0});i.subscribe(()=>{}),t.subscribe(()=>{}),n.add(e,{name:"items"}),n.add(i,{name:"ranked"}),n.add(t,{name:"size"});function m(c,d){let u=(d-c.lastAccessNs)/1e9;return K(c.baseScore,u,y,p)}function v(c){if(l!==void 0)for(;c.size>l;){let d=x(),u,h=Number.POSITIVE_INFINITY;for(let f of c.values()){let b=m(f,d);if(b<h){u=f,h=b;continue}if(b===h&&u){let A=r==="lru"?f.lastAccessNs:f.createdAtNs,R=r==="lru"?u.lastAccessNs:u.createdAtNs;A<R&&(u=f)}}if(!u)break;c.delete(u.id)}}function g(c){e.emit(c)}return Object.assign(n,{upsert(c,d,u){let h=x(),f=T(e),b=f.get(c),A=u?.score??o(d),R=M(f);R.set(c,{id:c,value:d,baseScore:A,createdAtNs:b?.createdAtNs??h,lastAccessNs:h}),v(R),g(R)},remove(c){let d=M(T(e));d.delete(c)&&g(d)},clear(){T(e).size!==0&&g(new Map)},getItem(c){let d=T(e),u=d.get(c);if(u){if(r==="lru"){let h=M(d);h.set(c,{...u,lastAccessNs:x()}),g(h)}return u}}})}function L(s={}){let a=s.backend??"flat",l=s.dimension,r;if(a==="hnsw"&&(r=s.hnswFactory?.(),!r))throw new Error('vectorIndex backend "hnsw" requires an optional dependency adapter; install your HNSW package and provide `hnswFactory`.');let y=w(new Map,{describeKind:"state",name:"vector-index"});function p(n){if(l!==void 0&&n.length!==l)throw new RangeError(`vector dimension mismatch: expected ${l}, got ${n.length}`)}function o(n){y.emit(n)}return{backend:a,entries:y,upsert(n,e,i){p(e);let t=M(T(y));t.set(n,{id:n,vector:[...e],meta:i}),a==="hnsw"&&r.upsert(n,e,i),o(t)},remove(n){let e=M(T(y));e.delete(n)&&(a==="hnsw"&&r.remove(n),o(e))},clear(){T(y).size!==0&&(a==="hnsw"&&r.clear(),o(new Map))},search(n,e=5){return p(n),e<=0?[]:a==="hnsw"?r.search(n,e):[...T(y).values()].map(t=>({id:t.id,score:I(n,t.vector),meta:t.meta})).sort((t,m)=>m.score-t.score).slice(0,e)}}}function O(s){let a=new C(s),l=w(new Map,{name:"entities",describeKind:"state"}),r=w([],{name:"edges",describeKind:"state"}),y=E([r],([e])=>{let i=e??[],t=new Map;for(let m of i){let v=t.get(m.from)??[];t.set(m.from,Object.freeze([...v,m]))}return t},{name:"adjacency",describeKind:"derived",initial:new Map});y.subscribe(()=>{}),a.add(l,{name:"entities"}),a.add(r,{name:"edges"}),a.add(y,{name:"adjacency"});function p(e){l.emit(e)}function o(e){r.emit(e)}return Object.assign(a,{upsertEntity(e,i){let t=M(T(l));t.set(e,i),p(t)},removeEntity(e){let i=M(T(l)),t=i.delete(e),m=N(r),v=m.filter(g=>g.from!==e&&g.to!==e);!t&&v.length===m.length||(p(i),o(v))},link(e,i,t,m=1){let v=`${e}\0${i}\0${t}`,g=N(r),k=new Set(g.map(d=>`${d.from}\0${d.to}\0${d.relation}`)),c=[...g];if(k.has(v))for(let d=0;d<c.length;d+=1){let u=c[d];if(u.from===e&&u.to===i&&u.relation===t){c[d]={...u,weight:m};break}}else c.push({from:e,to:i,relation:t,weight:m});o(c)},unlink(e,i,t){let m=N(r),v=m.filter(g=>t===void 0?!(g.from===e&&g.to===i):!(g.from===e&&g.to===i&&g.relation===t));v.length!==m.length&&o(v)},related(e,i){return N(r).filter(t=>(t.from===e||t.to===e)&&(i===void 0||t.relation===i))}})}export{K as a,S as b,G as c,L as d,O as e,F as f};
1
+ import{j as C}from"./chunk-2JO6LXFT.js";import{E as w,G as E,o as x}from"./chunk-LYCLF26R.js";import{b as z}from"./chunk-QYADASLV.js";var F={};z(F,{collection:()=>G,decay:()=>K,knowledgeGraph:()=>O,lightCollection:()=>S,vectorIndex:()=>L});function K(s,a,l,r=0){if(!Number.isFinite(s))return r;if(!Number.isFinite(a)||a<=0||!Number.isFinite(l)||l<=0)return Math.max(r,s);let y=s*Math.exp(-l*a);return Math.max(r,y)}function V(s){if(s!==void 0&&s<1)throw new RangeError("maxSize must be >= 1")}function M(s){return new Map(s)}function T(s){return s.cache??new Map}function N(s){return s.cache??[]}function I(s,a){let l=Math.max(s.length,a.length),r=0,y=0,p=0;for(let o=0;o<l;o+=1){let n=s[o]??0,e=a[o]??0;r+=n*e,y+=n*n,p+=e*e}return y===0||p===0?0:r/Math.sqrt(y*p)}function S(s={}){let a=s.maxSize,l=s.policy??"fifo";V(a);let r=w(new Map,{name:s.name,describeKind:"state"});function y(o){if(a!==void 0)for(;o.size>a;){let n;for(let e of o.values()){if(!n){n=e;continue}let i=l==="lru"?e.lastAccessNs:e.createdAtNs,t=l==="lru"?n.lastAccessNs:n.createdAtNs;i<t&&(n=e)}if(!n)break;o.delete(n.id)}}function p(o){r.emit(o)}return{entries:r,upsert(o,n){let e=x(),i=T(r),t=i.get(o),m=M(i);m.set(o,{id:o,value:n,createdAtNs:t?.createdAtNs??e,lastAccessNs:e}),y(m),p(m)},remove(o){let n=M(T(r));n.delete(o)&&p(n)},clear(){T(r).size!==0&&p(new Map)},get(o){let n=T(r),e=n.get(o);if(e){if(l==="lru"){let i=x(),t=M(n);t.set(o,{...e,lastAccessNs:i}),p(t)}return e.value}},has(o){return T(r).has(o)}}}function G(s,a={}){let l=a.maxSize,r=a.policy??"lru",y=a.decayRate??0,p=a.minScore??0,o=a.score??(()=>1);V(l);let n=new C(s),e=w(new Map,{name:"items",describeKind:"state"}),i=E([e],([c])=>{let d=c??new Map,u=x(),h=[...d.values()].map(f=>{let b=(u-f.lastAccessNs)/1e9;return{...f,score:K(f.baseScore,b,y,p)}});return h.sort((f,b)=>b.score-f.score||b.lastAccessNs-f.lastAccessNs),h},{name:"ranked",describeKind:"derived"}),t=E([e],([c])=>(c??new Map).size,{name:"size",describeKind:"derived",initial:0});i.subscribe(()=>{}),t.subscribe(()=>{}),n.add(e,{name:"items"}),n.add(i,{name:"ranked"}),n.add(t,{name:"size"});function m(c,d){let u=(d-c.lastAccessNs)/1e9;return K(c.baseScore,u,y,p)}function v(c){if(l!==void 0)for(;c.size>l;){let d=x(),u,h=Number.POSITIVE_INFINITY;for(let f of c.values()){let b=m(f,d);if(b<h){u=f,h=b;continue}if(b===h&&u){let A=r==="lru"?f.lastAccessNs:f.createdAtNs,R=r==="lru"?u.lastAccessNs:u.createdAtNs;A<R&&(u=f)}}if(!u)break;c.delete(u.id)}}function g(c){e.emit(c)}return Object.assign(n,{upsert(c,d,u){let h=x(),f=T(e),b=f.get(c),A=u?.score??o(d),R=M(f);R.set(c,{id:c,value:d,baseScore:A,createdAtNs:b?.createdAtNs??h,lastAccessNs:h}),v(R),g(R)},remove(c){let d=M(T(e));d.delete(c)&&g(d)},clear(){T(e).size!==0&&g(new Map)},getItem(c){let d=T(e),u=d.get(c);if(u){if(r==="lru"){let h=M(d);h.set(c,{...u,lastAccessNs:x()}),g(h)}return u}}})}function L(s={}){let a=s.backend??"flat",l=s.dimension,r;if(a==="hnsw"&&(r=s.hnswFactory?.(),!r))throw new Error('vectorIndex backend "hnsw" requires an optional dependency adapter; install your HNSW package and provide `hnswFactory`.');let y=w(new Map,{describeKind:"state",name:"vector-index"});function p(n){if(l!==void 0&&n.length!==l)throw new RangeError(`vector dimension mismatch: expected ${l}, got ${n.length}`)}function o(n){y.emit(n)}return{backend:a,entries:y,upsert(n,e,i){p(e);let t=M(T(y));t.set(n,{id:n,vector:[...e],meta:i}),a==="hnsw"&&r.upsert(n,e,i),o(t)},remove(n){let e=M(T(y));e.delete(n)&&(a==="hnsw"&&r.remove(n),o(e))},clear(){T(y).size!==0&&(a==="hnsw"&&r.clear(),o(new Map))},search(n,e=5){return p(n),e<=0?[]:a==="hnsw"?r.search(n,e):[...T(y).values()].map(t=>({id:t.id,score:I(n,t.vector),meta:t.meta})).sort((t,m)=>m.score-t.score).slice(0,e)}}}function O(s){let a=new C(s),l=w(new Map,{name:"entities",describeKind:"state"}),r=w([],{name:"edges",describeKind:"state"}),y=E([r],([e])=>{let i=e??[],t=new Map;for(let m of i){let v=t.get(m.from)??[];t.set(m.from,Object.freeze([...v,m]))}return t},{name:"adjacency",describeKind:"derived",initial:new Map});y.subscribe(()=>{}),a.add(l,{name:"entities"}),a.add(r,{name:"edges"}),a.add(y,{name:"adjacency"});function p(e){l.emit(e)}function o(e){r.emit(e)}return Object.assign(a,{upsertEntity(e,i){let t=M(T(l));t.set(e,i),p(t)},removeEntity(e){let i=M(T(l)),t=i.delete(e),m=N(r),v=m.filter(g=>g.from!==e&&g.to!==e);!t&&v.length===m.length||(p(i),o(v))},link(e,i,t,m=1){let v=`${e}\0${i}\0${t}`,g=N(r),k=new Set(g.map(d=>`${d.from}\0${d.to}\0${d.relation}`)),c=[...g];if(k.has(v))for(let d=0;d<c.length;d+=1){let u=c[d];if(u.from===e&&u.to===i&&u.relation===t){c[d]={...u,weight:m};break}}else c.push({from:e,to:i,relation:t,weight:m});o(c)},unlink(e,i,t){let m=N(r),v=m.filter(g=>t===void 0?!(g.from===e&&g.to===i):!(g.from===e&&g.to===i&&g.relation===t));v.length!==m.length&&o(v)},related(e,i){return N(r).filter(t=>(t.from===e||t.to===e)&&(i===void 0||t.relation===i))}})}export{K as a,S as b,G as c,L as d,O as e,F as f};
@@ -0,0 +1 @@
1
+ import{c as I}from"./chunk-L3KUKDZC.js";import{g as q,j as P}from"./chunk-2JO6LXFT.js";import{D as G,E as j,G as E,m as C}from"./chunk-LYCLF26R.js";import{b as _,d as D,i as A,j as M}from"./chunk-CK2E7BTU.js";import{b as $}from"./chunk-QYADASLV.js";var ne={};$(ne,{approval:()=>z,branch:()=>V,gate:()=>J,join:()=>Q,loop:()=>X,onFailure:()=>ee,pipeline:()=>L,sensor:()=>Z,subPipeline:()=>Y,task:()=>U});function v(e,n){if(typeof n=="string")return{node:e.resolve(n),path:n};let o=W(e,n);if(!o)throw new Error("orchestration dep node must already be registered in the graph so explicit edges can be recorded; pass a string path or register the node first");return{node:n,path:o}}function W(e,n){let o=e.describe(),r=`::${q}::`;for(let t of Object.keys(o.nodes).sort())if(!t.includes(r))try{if(e.resolve(t)===n)return t}catch{}}function k(e,n,o,r){e.add(o,{name:n})}function y(e,n){return I("orchestration",e,n)}function H(e){let n=r=>{let t=r.trim();return t.length===0?0:Number(t)},o;return typeof e=="string"?o=n(e):e===null?o=0:o=Number(e),Number.isFinite(o)?Math.max(0,Math.trunc(o)):1}function L(e,n){return new P(e,n)}function U(e,n,o,r){let i=(r?.deps??[]).map(a=>v(e,a)),{deps:s,...u}=r??{},h=(a,c,f)=>{let m=a.map((T,b)=>T!=null&&T.length>0?T.at(-1):f.prevData[b]);c.emit(o(m,f))},d=G(i.map(a=>a.node),h,{...u,name:n,describeKind:"derived",meta:y("task",r?.meta)});return k(e,n,d,i.flatMap(a=>a.path?[a.path]:[])),d}function V(e,n,o,r,t){let i=v(e,o),s=E([i.node],([u])=>({branch:r(u)?"then":"else",value:u}),{...t,name:n,meta:y("branch",t?.meta)});return k(e,n,s,i.path?[i.path]:[]),s}function z(e,n,o,r,t){let i=v(e,o),s=v(e,r),u=t?.isApproved??(d=>!!d),h=G([i.node,s.node],(d,a,c)=>{let f=d[0],m=d[1],T=m!=null&&m.length>0?m.at(-1):c.prevData[1];if(T===void 0||!u(T)){a.down([[D]]);return}if(f==null||f.length===0){m!=null&&m.length>0&&c.prevData[0]!==void 0?a.emit(c.prevData[0]):a.down([[D]]);return}for(let b of f)a.emit(b)},{...t,name:n,describeKind:"derived",meta:y("approval",t?.meta)});return k(e,n,h,[i.path,s.path].filter(d=>typeof d=="string")),h}function J(e,n,o,r){let t=r?.maxPending??1/0;if(t<1&&t!==1/0)throw new RangeError("gate: maxPending must be >= 1");let i=r?.startOpen??!1,s=v(e,o),u=j([],{name:"pending",equals:()=>!1}),h=j(i,{name:"isOpen"}),d=E([u],([p])=>p.length,{name:"count"}),a=j(null,{name:"lastRejected",equals:()=>!1}),c=[],f=!1,m=i,T=h.subscribe(p=>{for(let l of p)l[0]===_&&(m=l[1])});function b(){u.emit([...c])}function K(p){c.push(p),c.length>t&&c.shift(),b()}function R(p){let l=c.splice(0,p);return b(),l}function O(p){if(f)throw new Error(`gate: ${p}() called after gate was torn down`)}let S=G([s.node],(p,l,w)=>{let g=w.terminalDeps[0];if(g!==void 0){f=!0,c=[],b(),l.down(g===!0?[[A]]:[[M,g]]);return}let N=p[0];if(N==null||N.length===0){l.down([[D]]);return}for(let F of N)m?l.emit(F):(K(F),l.down([[D]]))},{name:n,describeKind:"derived",meta:y("gate",r?.meta)}),B={node:S,pending:u,count:d,isOpen:h,lastRejected:a,approve(p=1){O("approve");let l=R(p);for(let w of l){if(f)break;S.emit(w)}},reject(p=1){O("reject");let l=[...c],w=Math.min(p,l.length);if(w===0){R(p);return}C(()=>{for(let g=0;g<w;g++)a.emit(l[g]);R(p)})},modify(p,l=1){O("modify");let w=[...c],g=R(l);for(let N=0;N<g.length&&!f;N++)S.emit(p(g[N],N,w))},open(){O("open"),C(()=>{h.emit(!0);let p=R(c.length);for(let l of p){if(f)break;S.emit(l)}})},close(){O("close"),h.emit(!1)}};e.addDisposer(d.subscribe(()=>{})),e.addDisposer(T),k(e,n,S,s.path?[s.path]:[]);let x=new P(`${n}_state`);return x.add(u,{name:"pending"}),x.add(h,{name:"isOpen"}),x.add(d,{name:"count"}),x.add(a,{name:"lastRejected"}),e.mount(`${n}_state`,x),e.addDisposer(a.subscribe(()=>{})),B}function Q(e,n,o,r){let t=o.map(s=>v(e,s)),i=E(t.map(s=>s.node),s=>s,{...r,name:n,meta:y("join",r?.meta)});return k(e,n,i,t.flatMap(s=>s.path?[s.path]:[])),i}function X(e,n,o,r,t){let i=v(e,o),s=t?.iterations,u=typeof s=="number"||s===void 0?void 0:v(e,s),h=typeof s=="number"?s:void 0,d=G(u?[i.node,u.node]:[i.node],(a,c,f)=>{let m=a[0],T=m!=null&&m.length>0?m.at(-1):f.prevData[0],b=u?a[1]:void 0,K=h??(u?b!=null&&b.length>0?b.at(-1):f.prevData[1]:1),R=H(K);for(let O=0;O<R;O+=1)T=r(T,O,c);c.emit(T)},{...t,name:n,describeKind:"derived",meta:y("loop",t?.meta)});return k(e,n,d,[i.path,u?.path].filter(a=>typeof a=="string")),d}function Y(e,n,o,r){let t=o instanceof P?o:L(n,r);return typeof o=="function"&&o(t),e.mount(n,t),t}function Z(e,n,o,r){let t=G([],()=>{},{...r,name:n,initial:o,describeKind:"producer",meta:y("sensor",r?.meta)});return k(e,n,t,[]),{node:t,push(i){t.emit(i)},error(i){t.down([[M,i]])},complete(){t.down([[A]])}}}function ee(e,n,o,r,t){let i=v(e,o),s=!1,u=G([],(h,d)=>{let a=i.node.subscribe(c=>{for(let f of c){if(s)return;if(f[0]===M)try{d.emit(r(f[1],d))}catch(m){s=!0,d.down([[M,m]])}else d.down([f]),f[0]===A&&(s=!0)}});return()=>a()},{...t,name:n,describeKind:"derived",completeWhenDepsComplete:!1,errorWhenDepsError:!1,meta:y("onFailure",t?.meta)});return k(e,n,u,i.path?[i.path]:[]),u}export{L as a,U as b,V as c,z as d,J as e,Q as f,X as g,Y as h,Z as i,ee as j,ne as k};
@@ -1 +1 @@
1
- import{E as S,G as g,m as x}from"./chunk-7AJKUA36.js";import{b as z,c as w}from"./chunk-CK2E7BTU.js";var p=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(n,i){if(i!==void 0&&i<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=i,i!==void 0){if(this._buf=new Array(i),n&&n.length>0){let r=Math.min(n.length,i),h=n.length-r;for(let l=0;l<r;l++)this._buf[l]=n[h+l];this._size=r}}else this._buf=n?[...n]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(n){if(!Number.isInteger(n))return;let i=n>=0?n:this._size+n;if(!(i<0||i>=this._size))return this._maxSize!==void 0?this._buf[(this._head+i)%this._maxSize]:this._buf[i]}append(n){this._rawAppend(n),this._version+=1}appendMany(n){if(n.length===0)return;let i=this._maxSize!==void 0&&n.length>this._maxSize?n.length-this._maxSize:0;for(let r=i;r<n.length;r++)this._rawAppend(n[r]);this._version+=1}clear(){if(this._size===0)return 0;let n=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let i=0;i<n;i++)this._buf[(this._head+i)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,n}trimHead(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return 0;let i=Math.min(n,this._size);if(this._maxSize===void 0)this._buf.splice(0,i);else{for(let r=0;r<i;r++)this._buf[(this._head+r)%this._maxSize]=void 0;this._head=(this._head+i)%this._maxSize}return this._size-=i,this._version+=1,i}slice(n,i){if(!Number.isInteger(n)||n<0)throw new RangeError(`slice: start must be a non-negative integer (got ${n})`);if(i!==void 0&&(!Number.isInteger(i)||i<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${i})`);let r=i===void 0?this._size:Math.min(Math.max(i,0),this._size),h=Math.min(n,this._size);if(h>=r)return[];let l=r-h;if(this._maxSize===void 0)return this._buf.slice(h,r);let s=new Array(l);for(let u=0;u<l;u++)s[u]=this._buf[(this._head+h+u)%this._maxSize];return s}tail(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`tail: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return[];let i=Math.min(n,this._size);return this.slice(this._size-i,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let n=new Array(this._size);for(let i=0;i<this._size;i++)n[i]=this._buf[(this._head+i)%this._maxSize];return n}_rawAppend(n){if(this._maxSize===void 0){this._buf.push(n),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=n,this._size+=1):(this._buf[this._head]=n,this._head=(this._head+1)%this._maxSize)}};function A(_){return _.subscribe(()=>{})}var E=64;function L(_,n={}){let{name:i,maxSize:r,versioning:h,backend:l}=n,s=l??new p(_,r),u=S(s.toArray(),{name:i,describeKind:"state",equals:(e,t)=>e===t,...h!=null?{versioning:h}:{}});function M(){let e=s.toArray();x(()=>{u.down([[w]]),u.down([[z,e]])})}let d=new Map,a=new Map;function v(e,t){return`${e}:${t===void 0?"END":t}`}function y(e){if(e.size<E)return;let t=e.keys().next();if(t.done)return;let o=e.get(t.value);o!==void 0&&o.dispose(),e.delete(t.value)}function b(e){let t=s.version;try{return e()}finally{s.version!==t&&M()}}return{entries:u,get size(){return s.size},at(e){return s.at(e)},append(e){b(()=>s.append(e))},appendMany(e){e.length!==0&&b(()=>s.appendMany(e))},clear(){b(()=>s.clear())},trimHead(e){b(()=>s.trimHead(e))},tail(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);let t=d.get(e);if(t!==void 0)return d.delete(e),d.set(e,t),t.node;y(d);let o=g([u],([m])=>{let c=m;return e===0||c.length===0?[]:c.slice(Math.max(0,c.length-e))},{initial:s.tail(e),describeKind:"derived"}),f=A(o);return d.set(e,{node:o,dispose:f}),o},slice(e,t){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(t!==void 0&&(!Number.isInteger(t)||t<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${t})`);let o=v(e,t),f=a.get(o);if(f!==void 0)return a.delete(o),a.set(o,f),f.node;y(a);let m=g([u],([k])=>{let T=k;return t===void 0?T.slice(e):T.slice(e,t)},{initial:s.slice(e,t),describeKind:"derived"}),c=A(m);return a.set(o,{node:m,dispose:c}),m},disposeTail(e){let t=d.get(e);return t===void 0?!1:(t.dispose(),d.delete(e),!0)},disposeSlice(e,t){let o=v(e,t),f=a.get(o);return f===void 0?!1:(f.dispose(),a.delete(o),!0)},disposeAllViews(){for(let e of d.values())e.dispose();d.clear();for(let e of a.values())e.dispose();a.clear()},dispose(){for(let e of d.values())e.dispose();d.clear();for(let e of a.values())e.dispose();a.clear()}}}export{p as a,L as b};
1
+ import{E as S,G as g,m as x}from"./chunk-LYCLF26R.js";import{b as z,c as w}from"./chunk-CK2E7BTU.js";var p=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(n,i){if(i!==void 0&&i<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=i,i!==void 0){if(this._buf=new Array(i),n&&n.length>0){let r=Math.min(n.length,i),h=n.length-r;for(let l=0;l<r;l++)this._buf[l]=n[h+l];this._size=r}}else this._buf=n?[...n]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(n){if(!Number.isInteger(n))return;let i=n>=0?n:this._size+n;if(!(i<0||i>=this._size))return this._maxSize!==void 0?this._buf[(this._head+i)%this._maxSize]:this._buf[i]}append(n){this._rawAppend(n),this._version+=1}appendMany(n){if(n.length===0)return;let i=this._maxSize!==void 0&&n.length>this._maxSize?n.length-this._maxSize:0;for(let r=i;r<n.length;r++)this._rawAppend(n[r]);this._version+=1}clear(){if(this._size===0)return 0;let n=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let i=0;i<n;i++)this._buf[(this._head+i)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,n}trimHead(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return 0;let i=Math.min(n,this._size);if(this._maxSize===void 0)this._buf.splice(0,i);else{for(let r=0;r<i;r++)this._buf[(this._head+r)%this._maxSize]=void 0;this._head=(this._head+i)%this._maxSize}return this._size-=i,this._version+=1,i}slice(n,i){if(!Number.isInteger(n)||n<0)throw new RangeError(`slice: start must be a non-negative integer (got ${n})`);if(i!==void 0&&(!Number.isInteger(i)||i<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${i})`);let r=i===void 0?this._size:Math.min(Math.max(i,0),this._size),h=Math.min(n,this._size);if(h>=r)return[];let l=r-h;if(this._maxSize===void 0)return this._buf.slice(h,r);let s=new Array(l);for(let u=0;u<l;u++)s[u]=this._buf[(this._head+h+u)%this._maxSize];return s}tail(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`tail: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return[];let i=Math.min(n,this._size);return this.slice(this._size-i,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let n=new Array(this._size);for(let i=0;i<this._size;i++)n[i]=this._buf[(this._head+i)%this._maxSize];return n}_rawAppend(n){if(this._maxSize===void 0){this._buf.push(n),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=n,this._size+=1):(this._buf[this._head]=n,this._head=(this._head+1)%this._maxSize)}};function A(_){return _.subscribe(()=>{})}var E=64;function L(_,n={}){let{name:i,maxSize:r,versioning:h,backend:l}=n,s=l??new p(_,r),u=S(s.toArray(),{name:i,describeKind:"state",equals:(e,t)=>e===t,...h!=null?{versioning:h}:{}});function M(){let e=s.toArray();x(()=>{u.down([[w]]),u.down([[z,e]])})}let d=new Map,a=new Map;function v(e,t){return`${e}:${t===void 0?"END":t}`}function y(e){if(e.size<E)return;let t=e.keys().next();if(t.done)return;let o=e.get(t.value);o!==void 0&&o.dispose(),e.delete(t.value)}function b(e){let t=s.version;try{return e()}finally{s.version!==t&&M()}}return{entries:u,get size(){return s.size},at(e){return s.at(e)},append(e){b(()=>s.append(e))},appendMany(e){e.length!==0&&b(()=>s.appendMany(e))},clear(){b(()=>s.clear())},trimHead(e){b(()=>s.trimHead(e))},tail(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);let t=d.get(e);if(t!==void 0)return d.delete(e),d.set(e,t),t.node;y(d);let o=g([u],([m])=>{let c=m;return e===0||c.length===0?[]:c.slice(Math.max(0,c.length-e))},{initial:s.tail(e),describeKind:"derived"}),f=A(o);return d.set(e,{node:o,dispose:f}),o},slice(e,t){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(t!==void 0&&(!Number.isInteger(t)||t<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${t})`);let o=v(e,t),f=a.get(o);if(f!==void 0)return a.delete(o),a.set(o,f),f.node;y(a);let m=g([u],([k])=>{let T=k;return t===void 0?T.slice(e):T.slice(e,t)},{initial:s.slice(e,t),describeKind:"derived"}),c=A(m);return a.set(o,{node:m,dispose:c}),m},disposeTail(e){let t=d.get(e);return t===void 0?!1:(t.dispose(),d.delete(e),!0)},disposeSlice(e,t){let o=v(e,t),f=a.get(o);return f===void 0?!1:(f.dispose(),a.delete(o),!0)},disposeAllViews(){for(let e of d.values())e.dispose();d.clear();for(let e of a.values())e.dispose();a.clear()},dispose(){for(let e of d.values())e.dispose();d.clear();for(let e of a.values())e.dispose();a.clear()}}}export{p as a,L as b};
@@ -1 +1 @@
1
- import{a as ut}from"./chunk-3Q2WXM6X.js";import{a as Jr,b as Qr}from"./chunk-7QMVU3IX.js";import{$ as Fr,A as kr,B as hr,C as vr,D as xr,E as Tr,F as wr,G as Er,H as Nr,I as Mr,J as Sr,K as Rr,L as Or,M as Wr,N as Br,O as Ir,P as Lr,Q as jr,R as Cr,S as Vr,T as Pr,U as Ar,V as zr,W as Kr,X as Dr,Y as Ur,Z as _r,_ as $r,a as nn,aa as Hr,b as rn,ba as et,c as Gn,d as Jn,e as Qn,f as Xn,g as Yn,h as Zn,i as er,j as nr,k as rr,l as tr,m as or,n as sr,o as ir,p as ar,q as cr,r as dr,s as fr,t as ur,u as pr,v as lr,w as mr,x as gr,y as br,z as yr}from"./chunk-Y26UN6J5.js";import{a as Z,b as ee,c as ne,d as re,e as te,f as oe,g as se,h as ie,i as ae,j as ce,k as de,l as fe}from"./chunk-RWGJQQLT.js";import{b as Xr,c as Yr,d as Zr,e as st,f as it}from"./chunk-4VXL3UZK.js";import{a as nt,b as rt}from"./chunk-DWIAG62L.js";import{a as tt,b as ot}from"./chunk-4UUDNFYG.js";import{a as qr,b as Gr}from"./chunk-LWGLBCMU.js";import{a as be,b as Ye}from"./chunk-5QDBSZBV.js";import{a as Ze,b as en}from"./chunk-XRSHMHEG.js";import{a as Y}from"./chunk-ESMPEKEV.js";import{a as at,b as ct,c as dt,d as ft}from"./chunk-I6VIH3VA.js";import{A as Mn,B as Sn,C as Rn,D as On,E as Wn,F as Bn,G as In,I as Ln,J as jn,K as Cn,L as Vn,M as Pn,N as An,O as zn,P as Kn,Q as Dn,R as Un,S as _n,T as $n,U as Fn,V as Hn,W as qn,a as U,b as J,c as tn,d as on,e as sn,f as an,g as cn,h as dn,i as Q,j as fn,k as un,l as pn,m as ln,n as mn,o as gn,p as bn,q as yn,r as kn,s as hn,t as X,u as vn,v as xn,w as Tn,x as wn,y as En,z as Nn}from"./chunk-WQ7I7JVU.js";import{c as he,d as ve,e as xe,f as Te,g as we,h as Ee,i as Ne}from"./chunk-4VVTGLXJ.js";import{A as Je,B as Qe,C as Xe,a as ye,b as ke,c as Me,d as Se,e as Re,f as G,g as Oe,h as We,i as Be,j as Ie,k as Le,l as je,m as Ce,n as Ve,o as Pe,p as Ae,q as ze,r as Ke,s as De,t as Ue,u as _e,v as $e,w as Fe,x as He,y as qe,z as Ge}from"./chunk-UMH3HSP7.js";import{A as K,D as j,E as W,H as D,m as B}from"./chunk-7AJKUA36.js";import{b as h,e as $,f as F,g as H,h as S,i as q,j as O}from"./chunk-CK2E7BTU.js";import{b as ge}from"./chunk-QYADASLV.js";var kt={};ge(kt,{CircuitOpenError:()=>ne,ContentAddressedMissError:()=>Xr,NS_PER_MS:()=>NS_PER_MS,NS_PER_SEC:()=>NS_PER_SEC,NativeIndexBackend:()=>nt,NativeListBackend:()=>tt,NativeLogBackend:()=>Ze,NativeMapBackend:()=>qr,NativePubSubBackend:()=>_,RateLimiterOverflowError:()=>se,ResettableTimer:()=>Y,TimeoutError:()=>ce,audit:()=>In,awaitSettled:()=>qe,buffer:()=>Ln,bufferCount:()=>jn,bufferTime:()=>Vn,cached:()=>$e,canonicalJson:()=>Yr,cascadingCache:()=>pt,catchError:()=>qn,checkpointToRedis:()=>Kr,checkpointToS3:()=>zr,circuitBreaker:()=>re,combine:()=>kn,combineLatest:()=>$n,concat:()=>xn,concatMap:()=>Nn,constant:()=>he,contentAddressedStorage:()=>Zr,createTransport:()=>L,createWatermarkController:()=>Ye,csvRows:()=>xr,debounce:()=>On,debounceTime:()=>Fn,decorrelatedJitter:()=>we,delay:()=>Rn,deserializeError:()=>A,dictStorage:()=>ft,distill:()=>Qr,distinctUntilChanged:()=>bn,elementAt:()=>pn,empty:()=>Pe,escapeRegexChar:()=>Me,exhaustMap:()=>En,exponential:()=>xe,externalBundle:()=>rn,externalProducer:()=>nn,fallback:()=>de,fibonacci:()=>Te,filter:()=>J,find:()=>un,first:()=>Q,firstValueFrom:()=>Fe,firstWhere:()=>He,flatMap:()=>Sn,forEach:()=>Ke,fromAny:()=>Ce,fromAsyncIter:()=>je,fromCSV:()=>vr,fromClickHouseWatch:()=>Er,fromCron:()=>We,fromDrizzle:()=>Fr,fromEvent:()=>Be,fromHTTP:()=>Xn,fromHTTPPoll:()=>sr,fromHTTPStream:()=>or,fromIter:()=>Ie,fromKafka:()=>br,fromKysely:()=>Hr,fromMCP:()=>cr,fromNATS:()=>Sr,fromNDJSON:()=>wr,fromOTel:()=>dr,fromPrisma:()=>$r,fromPrometheus:()=>mr,fromPromise:()=>Le,fromPulsar:()=>Nr,fromRabbitMQ:()=>Or,fromRaf:()=>Oe,fromRedisStream:()=>kr,fromSSE:()=>tr,fromSqlite:()=>Dr,fromSqliteCursor:()=>Ur,fromStatsD:()=>pr,fromSyslog:()=>fr,fromTimer:()=>G,fromWebSocket:()=>Jn,fromWebSocketReconnect:()=>ar,fromWebhook:()=>Qn,globToRegExp:()=>Se,interval:()=>zn,keepalive:()=>Qe,last:()=>fn,linear:()=>ve,lru:()=>ue,makeHttpError:()=>et,map:()=>U,matchesAnyPattern:()=>Re,matchesCron:()=>ke,memoryStorage:()=>dt,merge:()=>X,mergeMap:()=>Mn,nameToSignal:()=>V,ndjsonRows:()=>Tr,never:()=>Ae,nodeSignal:()=>Ge,of:()=>Ve,onFirstData:()=>mn,pairwise:()=>yn,parseCron:()=>ye,parsePrometheusText:()=>gr,parseSSEStream:()=>rr,parseStatsD:()=>lr,parseSyslog:()=>ur,pausable:()=>Dn,pubsub:()=>lt,race:()=>Tn,rateLimiter:()=>ie,reactiveCounter:()=>Xe,reactiveIndex:()=>rt,reactiveList:()=>ot,reactiveLog:()=>en,reactiveMap:()=>Gr,reactiveSink:()=>Gn,reduce:()=>on,repeat:()=>Kn,replay:()=>_e,rescue:()=>Un,resolveBackoffPreset:()=>Ne,retry:()=>Z,retrySource:()=>ee,sample:()=>Bn,scan:()=>tn,serializeError:()=>P,share:()=>Ue,shareReplay:()=>Je,signalToName:()=>I,singleFromAny:()=>st,singleNodeFromAny:()=>it,skip:()=>an,sortJsonValue:()=>at,stableJsonString:()=>ct,stratify:()=>ut,switchMap:()=>wn,take:()=>sn,takeUntil:()=>dn,takeWhile:()=>cn,tap:()=>ln,tapFirst:()=>gn,throttle:()=>Wn,throttleTime:()=>Hn,throwError:()=>ze,timeout:()=>fe,toArray:()=>De,toCSV:()=>Ir,toClickHouse:()=>Lr,toFile:()=>Br,toHTTP:()=>Yn,toKafka:()=>yr,toLoki:()=>Pr,toMongo:()=>Vr,toNATS:()=>Rr,toObservable:()=>be,toPostgres:()=>Cr,toPulsar:()=>Mr,toRabbitMQ:()=>Wr,toReadableStream:()=>nr,toRedisStream:()=>hr,toS3:()=>jr,toSSE:()=>Zn,toSSEBytes:()=>er,toSqlite:()=>_r,toTempo:()=>Ar,toWebSocket:()=>ir,tokenBucket:()=>oe,valve:()=>_n,verifiable:()=>Jr,window:()=>An,windowCount:()=>Cn,windowTime:()=>Pn,withBreaker:()=>te,withLatestFrom:()=>hn,withMaxAttempts:()=>Ee,withStatus:()=>ae,workerBridge:()=>le,workerSelf:()=>me,zip:()=>vn});function ue(){let e=new Map,t=null,n=null;function p(r){r.prev?r.prev.next=r.next:t=r.next,r.next?r.next.prev=r.prev:n=r.prev,r.prev=null,r.next=null}function l(r){r.next=t,r.prev=null,t&&(t.prev=r),t=r,n===null&&(n=r)}return{insert(r){if(e.has(r)){this.touch(r);return}let f={key:r,prev:null,next:null};e.set(r,f),l(f)},touch(r){let f=e.get(r);f&&(p(f),l(f))},delete(r){let f=e.get(r);f&&(p(f),e.delete(r))},evict(r){let f=[];for(let v=0;v<r&&n!==null;v++){let M=n;f.push(M.key),p(M),e.delete(M.key)}return f},size(){return e.size}}}function pe(e){return e!=null&&typeof e.then=="function"}function C(e){pe(e)&&e.catch(()=>{})}function pt(e,t){let n=new Map,p=t?.maxSize??0,l=p>0?t?.eviction??ue():null,r=t?.writeThrough??!1;function f(o,u,m){for(let g=0;g<m;g++)try{C(e[g].save(o,u))}catch{}}function v(o,u,m=0){for(let g=m;g<e.length;g++){let w;try{w=e[g].load(o)}catch{continue}if(pe(w)){let T=g;w.then(E=>{E!=null?(u.down([[h,E]]),f(o,E,T)):v(o,u,T+1)},()=>{v(o,u,T+1)});return}if(w!=null){u.down([[h,w]]),f(o,w,g);return}}}function M(){if(!(!l||p<=0))for(;l.size()>=p;){let o=l.evict(1);if(o.length===0)break;for(let u of o){let m=n.get(u);if(m){let g=m.cache;if(m.status!=="sentinel"&&e.length>0){let w=e.length-1;try{C(e[w].save(u,g))}catch{}for(let T=0;T<w;T++)try{let E=e[T].clear;E&&C(E.call(e[T],u))}catch{}}m.down([[S]])}n.delete(u)}}}return{load(o){let u=n.get(o);if(u)return l?.touch(o),u;l&&p>0&&l.size()>=p&&M();let m=W(void 0);return n.set(o,m),l?.insert(o),v(o,m),m},save(o,u){if(r)for(let g of e)try{C(g.save(o,u))}catch{}else if(e[0])try{C(e[0].save(o,u))}catch{}let m=n.get(o);if(m)m.down([[h,u]]),l?.touch(o);else{l&&p>0&&l.size()>=p&&M();let g=W(u);n.set(o,g),l?.insert(o)}},invalidate(o){let u=n.get(o);u&&v(o,u)},delete(o){l?.delete(o);let u=n.get(o);u&&u.down([[S]]),n.delete(o);for(let m of e)try{let g=m.clear;g&&C(g.call(m,o))}catch{}},has(o){return n.has(o)},get size(){return n.size}}}var _=class{_version=0;_topics=new Set;get version(){return this._version}get topicCount(){return this._topics.size}hasTopic(t){return this._topics.has(t)}topicNames(){return this._topics.values()}createTopic(t){return this._topics.has(t)?!1:(this._topics.add(t),this._version+=1,!0)}removeTopic(t){let n=this._topics.delete(t);return n&&(this._version+=1),n}};function lt(e={}){let{backend:t}=e,n=t??new _,p=new Map;function l(r){let f=p.get(r);return f===void 0&&(f=j({describeKind:"state"}),p.set(r,f),n.createTopic(r)),f}return{topic(r){return l(r)},publish(r,f){l(r).emit(f)},publishMany(r){B(()=>{for(let[f,v]of r)l(f).emit(v)})},removeTopic(r){let f=p.get(r);return f===void 0?!1:(p.delete(r),n.removeTopic(r),f.down([[S]]),!0)},has(r){return n.hasTopic(r)},get size(){return n.topicCount},topicNames(){return n.topicNames()}}}var mt=new Map([[$,"INVALIDATE"],[F,"PAUSE"],[H,"RESUME"],[S,"TEARDOWN"],[q,"COMPLETE"],[O,"ERROR"]]),gt=new Map([["INVALIDATE",$],["PAUSE",F],["RESUME",H],["TEARDOWN",S],["COMPLETE",q],["ERROR",O]]);function I(e){let t=mt.get(e);return t||(Symbol.keyFor(e)??"UNKNOWN")}function V(e){let t=gt.get(e);if(t)return t;if(e&&e!=="UNKNOWN")return Symbol.for(e)}function P(e){return e instanceof Error?{message:e.message,name:e.name,stack:e.stack}:{message:String(e),name:"Error"}}function A(e){let t=new Error(e.message);return t.name=e.name,e.stack&&(t.stack=e.stack),t}function L(e){if(typeof MessagePort<"u"&&e instanceof MessagePort)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),e.start(),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof SharedWorker<"u"&&e instanceof SharedWorker)return L(e.port);if(typeof Worker<"u"&&e instanceof Worker)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.terminate()}};if(typeof BroadcastChannel<"u"&&e instanceof BroadcastChannel)return{post(t,n){n&&n.length>0&&console.warn("[graphrefly] WorkerTransport: BroadcastChannel does not support Transferable objects. The transfer argument is ignored and objects will be cloned instead."),e.postMessage(t)},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof ServiceWorker<"u"&&e instanceof ServiceWorker)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>{p.source===e&&t(p.data)};return navigator.serviceWorker.addEventListener("message",n),()=>navigator.serviceWorker.removeEventListener("message",n)}};throw new Error("createTransport: unsupported target type. Expected Worker, SharedWorker, ServiceWorker, BroadcastChannel, or MessagePort.")}function bt(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function le(e,t){let n=bt(e)?e:L(e),p=t.name??"workerBridge",l=Object.entries(t.expose??{}),r=t.import??[],f=t.transfer??{},v=W("connecting",{name:`${p}::meta::status`}),M=W(null,{name:`${p}::meta::error`}),o=new Map,u=new Map;for(let c of r){let a=W(void 0,{name:`${p}::${c}`});o.set(c,a)}let m;if(l.length>0){let c=l.map(([,d])=>d),a=j(c,(d,i)=>{let k={};for(let y=0;y<l.length;y++){let[R]=l[y],N=d[y];N!=null&&N.length>0&&(k[R]=N.at(-1))}Object.keys(k).length!==0&&i.emit(k)},{name:`${p}::aggregated`,partial:!0});m=D([a],d=>{let i=d[0];if(i==null||Object.keys(i).length===0)return;let k=[];for(let N of Object.keys(i)){let z=f[N];z&&k.push(...z(i[N]))}let y;for(let[N,z]of l)N in i&&z.v!=null&&(y==null&&(y={}),y[N]=z.v.version);let R={t:"b",u:i,...y?{v:y}:{}};try{n.post(R,k.length>0?k:void 0)}catch(N){M.down([[h,N instanceof Error?N:new Error(String(N))]])}}).subscribe(()=>{})}let g=!1,w=n.listen(c=>{if(g)return;let a=c;switch(a.t){case"r":{B(()=>{for(let[d,i]of Object.entries(a.stores)){let k=o.get(d);k&&k.down([[h,i]])}}),v.down([[h,"connected"]]);let s={};for(let[d,i]of l)s[d]=i.cache;n.post({t:"i",stores:s});break}case"v":{let s=o.get(a.s);s&&s.down([[h,a.d]]);break}case"b":{B(()=>{for(let[s,d]of Object.entries(a.u)){let i=a.v?.[s];if(i!=null){let y=u.get(s);if(y!=null&&i<=y)continue;u.set(s,i)}let k=o.get(s);k&&k.down([[h,d]])}});break}case"e":{let s=o.get(a.s);s&&s.down([[O,A(a.err)]]);break}case"s":{let s=V(a.sig);if(!s)break;let d=a.s==="*"?[...o.values()]:o.has(a.s)?[o.get(a.s)]:[];for(let i of d)i.down(a.d===void 0?[[s]]:[[s,a.d]]);break}}}),T=[];for(let[c,a]of l){let s=a.subscribe((d=>{if(!g)for(let i of d){let k=i[0];k!==h&&(K.isLocalOnly(k)||(k===O?n.post({t:"e",s:c,err:P(i[1])}):n.post({t:"s",s:c,sig:I(k),d:i.length>1?i[1]:void 0})))}}));T.push(s)}let E;if(t.timeoutMs!=null&&t.timeoutMs>0){let c=G(t.timeoutMs),a=J(v,d=>d==="connected");E=Q(X(U(c,()=>"timeout"),U(a,()=>"ready"))).subscribe(d=>{for(let i of d)i[0]===h&&i[1]==="timeout"&&(M.down([[h,new Error("Worker bridge handshake timeout")]]),x())})}function x(){if(!g){g=!0,E?.(),n.post({t:"s",s:"*",sig:I(S)}),m&&m();for(let c of T)c();T.length=0,w(),v.down([[h,"closed"]]),u.clear(),o.clear()}}let b={meta:{status:v,error:M},destroy:x};for(let[c,a]of o)b[c]=a;return b}function yt(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function me(e,t){let n=yt(e)?e:L(e),p=t.import??[],l=t.transfer??{},r=new Map,f=new Map,v={};for(let x of p){let b=W(void 0,{name:`worker::${x}`});r.set(x,b),v[x]=b}let M=t.expose(v),o=Object.entries(M),u,m=!1;if(o.length>0){let x=o.map(([,a])=>a),b=j(x,(a,s)=>{let d={};for(let i=0;i<o.length;i++){let[k]=o[i],y=a[i];y!=null&&y.length>0&&(d[k]=y.at(-1))}Object.keys(d).length!==0&&s.emit(d)},{name:"workerSelf::aggregated",partial:!0});u=D([b],a=>{if(m)return;let s=a[0];if(s==null||Object.keys(s).length===0)return;let d=[];for(let y of Object.keys(s)){let R=l[y];R&&d.push(...R(s[y]))}let i;for(let[y,R]of o)y in s&&R.v!=null&&(i==null&&(i={}),i[y]=R.v.version);let k={t:"b",u:s,...i?{v:i}:{}};try{n.post(k,d.length>0?d:void 0)}catch{}}).subscribe(()=>{})}let g=[];for(let[x,b]of o){let c=b.subscribe((a=>{if(!m)for(let s of a){let d=s[0];d!==h&&(K.isLocalOnly(d)||(d===O?n.post({t:"e",s:x,err:P(s[1])}):n.post({t:"s",s:x,sig:I(d),d:s.length>1?s[1]:void 0})))}}));g.push(c)}let w=n.listen(x=>{if(m)return;let b=x;switch(b.t){case"i":{B(()=>{for(let[c,a]of Object.entries(b.stores)){let s=r.get(c);s&&s.down([[h,a]])}});break}case"v":{let c=r.get(b.s);c&&c.down([[h,b.d]]);break}case"b":{B(()=>{for(let[c,a]of Object.entries(b.u)){let s=b.v?.[c];if(s!=null){let i=f.get(c);if(i!=null&&s<=i)continue;f.set(c,s)}let d=r.get(c);d&&d.down([[h,a]])}});break}case"e":{let c=r.get(b.s);c&&c.down([[O,A(b.err)]]);break}case"s":{let c=V(b.sig);if(!c)break;if(c===S&&b.s==="*"){E();return}let a=b.s==="*"?[...r.values()]:r.has(b.s)?[r.get(b.s)]:[];for(let s of a)s.down(b.d===void 0?[[c]]:[[c,b.d]]);break}}}),T={};for(let[x,b]of o)T[x]=b.cache;n.post({t:"r",stores:T});function E(){if(!m){m=!0,u&&u();for(let x of g)x();g.length=0,w(),n.terminate?.(),f.clear(),r.clear()}}return{destroy:E}}export{ue as a,pt as b,_ as c,lt as d,I as e,V as f,P as g,A as h,L as i,le as j,me as k,kt as l};
1
+ import{a as ut}from"./chunk-BY4WKPKM.js";import{a as Jr,b as Qr}from"./chunk-WBWBY6LI.js";import{$ as Fr,A as kr,B as hr,C as vr,D as xr,E as Tr,F as wr,G as Er,H as Nr,I as Mr,J as Sr,K as Rr,L as Or,M as Wr,N as Br,O as Ir,P as Lr,Q as jr,R as Cr,S as Vr,T as Pr,U as Ar,V as zr,W as Kr,X as Dr,Y as Ur,Z as _r,_ as $r,a as nn,aa as Hr,b as rn,ba as et,c as Gn,d as Jn,e as Qn,f as Xn,g as Yn,h as Zn,i as er,j as nr,k as rr,l as tr,m as or,n as sr,o as ir,p as ar,q as cr,r as dr,s as fr,t as ur,u as pr,v as lr,w as mr,x as gr,y as br,z as yr}from"./chunk-LOF5HSD3.js";import{a as Z,b as ee,c as ne,d as re,e as te,f as oe,g as se,h as ie,i as ae,j as ce,k as de,l as fe}from"./chunk-FKRPIRE6.js";import{b as Xr,c as Yr,d as Zr,e as st,f as it}from"./chunk-7Q2WPFQ7.js";import{a as nt,b as rt}from"./chunk-NNKJUORL.js";import{a as tt,b as ot}from"./chunk-KGKJCHEK.js";import{a as qr,b as Gr}from"./chunk-TZQPPQEQ.js";import{a as be,b as Ye}from"./chunk-5QDBSZBV.js";import{a as Ze,b as en}from"./chunk-HTBOCKVD.js";import{a as Y}from"./chunk-ESMPEKEV.js";import{a as at,b as ct,c as dt,d as ft}from"./chunk-I6VIH3VA.js";import{A as Mn,B as Sn,C as Rn,D as On,E as Wn,F as Bn,G as In,I as Ln,J as jn,K as Cn,L as Vn,M as Pn,N as An,O as zn,P as Kn,Q as Dn,R as Un,S as _n,T as $n,U as Fn,V as Hn,W as qn,a as U,b as J,c as tn,d as on,e as sn,f as an,g as cn,h as dn,i as Q,j as fn,k as un,l as pn,m as ln,n as mn,o as gn,p as bn,q as yn,r as kn,s as hn,t as X,u as vn,v as xn,w as Tn,x as wn,y as En,z as Nn}from"./chunk-4F564IPP.js";import{c as he,d as ve,e as xe,f as Te,g as we,h as Ee,i as Ne}from"./chunk-4VVTGLXJ.js";import{A as Je,B as Qe,C as Xe,a as ye,b as ke,c as Me,d as Se,e as Re,f as G,g as Oe,h as We,i as Be,j as Ie,k as Le,l as je,m as Ce,n as Ve,o as Pe,p as Ae,q as ze,r as Ke,s as De,t as Ue,u as _e,v as $e,w as Fe,x as He,y as qe,z as Ge}from"./chunk-T7EQPKOP.js";import{A as K,D as j,E as W,H as D,m as B}from"./chunk-LYCLF26R.js";import{b as h,e as $,f as F,g as H,h as S,i as q,j as O}from"./chunk-CK2E7BTU.js";import{b as ge}from"./chunk-QYADASLV.js";var kt={};ge(kt,{CircuitOpenError:()=>ne,ContentAddressedMissError:()=>Xr,NS_PER_MS:()=>NS_PER_MS,NS_PER_SEC:()=>NS_PER_SEC,NativeIndexBackend:()=>nt,NativeListBackend:()=>tt,NativeLogBackend:()=>Ze,NativeMapBackend:()=>qr,NativePubSubBackend:()=>_,RateLimiterOverflowError:()=>se,ResettableTimer:()=>Y,TimeoutError:()=>ce,audit:()=>In,awaitSettled:()=>qe,buffer:()=>Ln,bufferCount:()=>jn,bufferTime:()=>Vn,cached:()=>$e,canonicalJson:()=>Yr,cascadingCache:()=>pt,catchError:()=>qn,checkpointToRedis:()=>Kr,checkpointToS3:()=>zr,circuitBreaker:()=>re,combine:()=>kn,combineLatest:()=>$n,concat:()=>xn,concatMap:()=>Nn,constant:()=>he,contentAddressedStorage:()=>Zr,createTransport:()=>L,createWatermarkController:()=>Ye,csvRows:()=>xr,debounce:()=>On,debounceTime:()=>Fn,decorrelatedJitter:()=>we,delay:()=>Rn,deserializeError:()=>A,dictStorage:()=>ft,distill:()=>Qr,distinctUntilChanged:()=>bn,elementAt:()=>pn,empty:()=>Pe,escapeRegexChar:()=>Me,exhaustMap:()=>En,exponential:()=>xe,externalBundle:()=>rn,externalProducer:()=>nn,fallback:()=>de,fibonacci:()=>Te,filter:()=>J,find:()=>un,first:()=>Q,firstValueFrom:()=>Fe,firstWhere:()=>He,flatMap:()=>Sn,forEach:()=>Ke,fromAny:()=>Ce,fromAsyncIter:()=>je,fromCSV:()=>vr,fromClickHouseWatch:()=>Er,fromCron:()=>We,fromDrizzle:()=>Fr,fromEvent:()=>Be,fromHTTP:()=>Xn,fromHTTPPoll:()=>sr,fromHTTPStream:()=>or,fromIter:()=>Ie,fromKafka:()=>br,fromKysely:()=>Hr,fromMCP:()=>cr,fromNATS:()=>Sr,fromNDJSON:()=>wr,fromOTel:()=>dr,fromPrisma:()=>$r,fromPrometheus:()=>mr,fromPromise:()=>Le,fromPulsar:()=>Nr,fromRabbitMQ:()=>Or,fromRaf:()=>Oe,fromRedisStream:()=>kr,fromSSE:()=>tr,fromSqlite:()=>Dr,fromSqliteCursor:()=>Ur,fromStatsD:()=>pr,fromSyslog:()=>fr,fromTimer:()=>G,fromWebSocket:()=>Jn,fromWebSocketReconnect:()=>ar,fromWebhook:()=>Qn,globToRegExp:()=>Se,interval:()=>zn,keepalive:()=>Qe,last:()=>fn,linear:()=>ve,lru:()=>ue,makeHttpError:()=>et,map:()=>U,matchesAnyPattern:()=>Re,matchesCron:()=>ke,memoryStorage:()=>dt,merge:()=>X,mergeMap:()=>Mn,nameToSignal:()=>V,ndjsonRows:()=>Tr,never:()=>Ae,nodeSignal:()=>Ge,of:()=>Ve,onFirstData:()=>mn,pairwise:()=>yn,parseCron:()=>ye,parsePrometheusText:()=>gr,parseSSEStream:()=>rr,parseStatsD:()=>lr,parseSyslog:()=>ur,pausable:()=>Dn,pubsub:()=>lt,race:()=>Tn,rateLimiter:()=>ie,reactiveCounter:()=>Xe,reactiveIndex:()=>rt,reactiveList:()=>ot,reactiveLog:()=>en,reactiveMap:()=>Gr,reactiveSink:()=>Gn,reduce:()=>on,repeat:()=>Kn,replay:()=>_e,rescue:()=>Un,resolveBackoffPreset:()=>Ne,retry:()=>Z,retrySource:()=>ee,sample:()=>Bn,scan:()=>tn,serializeError:()=>P,share:()=>Ue,shareReplay:()=>Je,signalToName:()=>I,singleFromAny:()=>st,singleNodeFromAny:()=>it,skip:()=>an,sortJsonValue:()=>at,stableJsonString:()=>ct,stratify:()=>ut,switchMap:()=>wn,take:()=>sn,takeUntil:()=>dn,takeWhile:()=>cn,tap:()=>ln,tapFirst:()=>gn,throttle:()=>Wn,throttleTime:()=>Hn,throwError:()=>ze,timeout:()=>fe,toArray:()=>De,toCSV:()=>Ir,toClickHouse:()=>Lr,toFile:()=>Br,toHTTP:()=>Yn,toKafka:()=>yr,toLoki:()=>Pr,toMongo:()=>Vr,toNATS:()=>Rr,toObservable:()=>be,toPostgres:()=>Cr,toPulsar:()=>Mr,toRabbitMQ:()=>Wr,toReadableStream:()=>nr,toRedisStream:()=>hr,toS3:()=>jr,toSSE:()=>Zn,toSSEBytes:()=>er,toSqlite:()=>_r,toTempo:()=>Ar,toWebSocket:()=>ir,tokenBucket:()=>oe,valve:()=>_n,verifiable:()=>Jr,window:()=>An,windowCount:()=>Cn,windowTime:()=>Pn,withBreaker:()=>te,withLatestFrom:()=>hn,withMaxAttempts:()=>Ee,withStatus:()=>ae,workerBridge:()=>le,workerSelf:()=>me,zip:()=>vn});function ue(){let e=new Map,t=null,n=null;function p(r){r.prev?r.prev.next=r.next:t=r.next,r.next?r.next.prev=r.prev:n=r.prev,r.prev=null,r.next=null}function l(r){r.next=t,r.prev=null,t&&(t.prev=r),t=r,n===null&&(n=r)}return{insert(r){if(e.has(r)){this.touch(r);return}let f={key:r,prev:null,next:null};e.set(r,f),l(f)},touch(r){let f=e.get(r);f&&(p(f),l(f))},delete(r){let f=e.get(r);f&&(p(f),e.delete(r))},evict(r){let f=[];for(let v=0;v<r&&n!==null;v++){let M=n;f.push(M.key),p(M),e.delete(M.key)}return f},size(){return e.size}}}function pe(e){return e!=null&&typeof e.then=="function"}function C(e){pe(e)&&e.catch(()=>{})}function pt(e,t){let n=new Map,p=t?.maxSize??0,l=p>0?t?.eviction??ue():null,r=t?.writeThrough??!1;function f(o,u,m){for(let g=0;g<m;g++)try{C(e[g].save(o,u))}catch{}}function v(o,u,m=0){for(let g=m;g<e.length;g++){let w;try{w=e[g].load(o)}catch{continue}if(pe(w)){let T=g;w.then(E=>{E!=null?(u.down([[h,E]]),f(o,E,T)):v(o,u,T+1)},()=>{v(o,u,T+1)});return}if(w!=null){u.down([[h,w]]),f(o,w,g);return}}}function M(){if(!(!l||p<=0))for(;l.size()>=p;){let o=l.evict(1);if(o.length===0)break;for(let u of o){let m=n.get(u);if(m){let g=m.cache;if(m.status!=="sentinel"&&e.length>0){let w=e.length-1;try{C(e[w].save(u,g))}catch{}for(let T=0;T<w;T++)try{let E=e[T].clear;E&&C(E.call(e[T],u))}catch{}}m.down([[S]])}n.delete(u)}}}return{load(o){let u=n.get(o);if(u)return l?.touch(o),u;l&&p>0&&l.size()>=p&&M();let m=W(void 0);return n.set(o,m),l?.insert(o),v(o,m),m},save(o,u){if(r)for(let g of e)try{C(g.save(o,u))}catch{}else if(e[0])try{C(e[0].save(o,u))}catch{}let m=n.get(o);if(m)m.down([[h,u]]),l?.touch(o);else{l&&p>0&&l.size()>=p&&M();let g=W(u);n.set(o,g),l?.insert(o)}},invalidate(o){let u=n.get(o);u&&v(o,u)},delete(o){l?.delete(o);let u=n.get(o);u&&u.down([[S]]),n.delete(o);for(let m of e)try{let g=m.clear;g&&C(g.call(m,o))}catch{}},has(o){return n.has(o)},get size(){return n.size}}}var _=class{_version=0;_topics=new Set;get version(){return this._version}get topicCount(){return this._topics.size}hasTopic(t){return this._topics.has(t)}topicNames(){return this._topics.values()}createTopic(t){return this._topics.has(t)?!1:(this._topics.add(t),this._version+=1,!0)}removeTopic(t){let n=this._topics.delete(t);return n&&(this._version+=1),n}};function lt(e={}){let{backend:t}=e,n=t??new _,p=new Map;function l(r){let f=p.get(r);return f===void 0&&(f=j({describeKind:"state"}),p.set(r,f),n.createTopic(r)),f}return{topic(r){return l(r)},publish(r,f){l(r).emit(f)},publishMany(r){B(()=>{for(let[f,v]of r)l(f).emit(v)})},removeTopic(r){let f=p.get(r);return f===void 0?!1:(p.delete(r),n.removeTopic(r),f.down([[S]]),!0)},has(r){return n.hasTopic(r)},get size(){return n.topicCount},topicNames(){return n.topicNames()}}}var mt=new Map([[$,"INVALIDATE"],[F,"PAUSE"],[H,"RESUME"],[S,"TEARDOWN"],[q,"COMPLETE"],[O,"ERROR"]]),gt=new Map([["INVALIDATE",$],["PAUSE",F],["RESUME",H],["TEARDOWN",S],["COMPLETE",q],["ERROR",O]]);function I(e){let t=mt.get(e);return t||(Symbol.keyFor(e)??"UNKNOWN")}function V(e){let t=gt.get(e);if(t)return t;if(e&&e!=="UNKNOWN")return Symbol.for(e)}function P(e){return e instanceof Error?{message:e.message,name:e.name,stack:e.stack}:{message:String(e),name:"Error"}}function A(e){let t=new Error(e.message);return t.name=e.name,e.stack&&(t.stack=e.stack),t}function L(e){if(typeof MessagePort<"u"&&e instanceof MessagePort)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),e.start(),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof SharedWorker<"u"&&e instanceof SharedWorker)return L(e.port);if(typeof Worker<"u"&&e instanceof Worker)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.terminate()}};if(typeof BroadcastChannel<"u"&&e instanceof BroadcastChannel)return{post(t,n){n&&n.length>0&&console.warn("[graphrefly] WorkerTransport: BroadcastChannel does not support Transferable objects. The transfer argument is ignored and objects will be cloned instead."),e.postMessage(t)},listen(t){let n=p=>t(p.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof ServiceWorker<"u"&&e instanceof ServiceWorker)return{post(t,n){e.postMessage(t,n??[])},listen(t){let n=p=>{p.source===e&&t(p.data)};return navigator.serviceWorker.addEventListener("message",n),()=>navigator.serviceWorker.removeEventListener("message",n)}};throw new Error("createTransport: unsupported target type. Expected Worker, SharedWorker, ServiceWorker, BroadcastChannel, or MessagePort.")}function bt(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function le(e,t){let n=bt(e)?e:L(e),p=t.name??"workerBridge",l=Object.entries(t.expose??{}),r=t.import??[],f=t.transfer??{},v=W("connecting",{name:`${p}::meta::status`}),M=W(null,{name:`${p}::meta::error`}),o=new Map,u=new Map;for(let c of r){let a=W(void 0,{name:`${p}::${c}`});o.set(c,a)}let m;if(l.length>0){let c=l.map(([,d])=>d),a=j(c,(d,i)=>{let k={};for(let y=0;y<l.length;y++){let[R]=l[y],N=d[y];N!=null&&N.length>0&&(k[R]=N.at(-1))}Object.keys(k).length!==0&&i.emit(k)},{name:`${p}::aggregated`,partial:!0});m=D([a],d=>{let i=d[0];if(i==null||Object.keys(i).length===0)return;let k=[];for(let N of Object.keys(i)){let z=f[N];z&&k.push(...z(i[N]))}let y;for(let[N,z]of l)N in i&&z.v!=null&&(y==null&&(y={}),y[N]=z.v.version);let R={t:"b",u:i,...y?{v:y}:{}};try{n.post(R,k.length>0?k:void 0)}catch(N){M.down([[h,N instanceof Error?N:new Error(String(N))]])}}).subscribe(()=>{})}let g=!1,w=n.listen(c=>{if(g)return;let a=c;switch(a.t){case"r":{B(()=>{for(let[d,i]of Object.entries(a.stores)){let k=o.get(d);k&&k.down([[h,i]])}}),v.down([[h,"connected"]]);let s={};for(let[d,i]of l)s[d]=i.cache;n.post({t:"i",stores:s});break}case"v":{let s=o.get(a.s);s&&s.down([[h,a.d]]);break}case"b":{B(()=>{for(let[s,d]of Object.entries(a.u)){let i=a.v?.[s];if(i!=null){let y=u.get(s);if(y!=null&&i<=y)continue;u.set(s,i)}let k=o.get(s);k&&k.down([[h,d]])}});break}case"e":{let s=o.get(a.s);s&&s.down([[O,A(a.err)]]);break}case"s":{let s=V(a.sig);if(!s)break;let d=a.s==="*"?[...o.values()]:o.has(a.s)?[o.get(a.s)]:[];for(let i of d)i.down(a.d===void 0?[[s]]:[[s,a.d]]);break}}}),T=[];for(let[c,a]of l){let s=a.subscribe((d=>{if(!g)for(let i of d){let k=i[0];k!==h&&(K.isLocalOnly(k)||(k===O?n.post({t:"e",s:c,err:P(i[1])}):n.post({t:"s",s:c,sig:I(k),d:i.length>1?i[1]:void 0})))}}));T.push(s)}let E;if(t.timeoutMs!=null&&t.timeoutMs>0){let c=G(t.timeoutMs),a=J(v,d=>d==="connected");E=Q(X(U(c,()=>"timeout"),U(a,()=>"ready"))).subscribe(d=>{for(let i of d)i[0]===h&&i[1]==="timeout"&&(M.down([[h,new Error("Worker bridge handshake timeout")]]),x())})}function x(){if(!g){g=!0,E?.(),n.post({t:"s",s:"*",sig:I(S)}),m&&m();for(let c of T)c();T.length=0,w(),v.down([[h,"closed"]]),u.clear(),o.clear()}}let b={meta:{status:v,error:M},destroy:x};for(let[c,a]of o)b[c]=a;return b}function yt(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function me(e,t){let n=yt(e)?e:L(e),p=t.import??[],l=t.transfer??{},r=new Map,f=new Map,v={};for(let x of p){let b=W(void 0,{name:`worker::${x}`});r.set(x,b),v[x]=b}let M=t.expose(v),o=Object.entries(M),u,m=!1;if(o.length>0){let x=o.map(([,a])=>a),b=j(x,(a,s)=>{let d={};for(let i=0;i<o.length;i++){let[k]=o[i],y=a[i];y!=null&&y.length>0&&(d[k]=y.at(-1))}Object.keys(d).length!==0&&s.emit(d)},{name:"workerSelf::aggregated",partial:!0});u=D([b],a=>{if(m)return;let s=a[0];if(s==null||Object.keys(s).length===0)return;let d=[];for(let y of Object.keys(s)){let R=l[y];R&&d.push(...R(s[y]))}let i;for(let[y,R]of o)y in s&&R.v!=null&&(i==null&&(i={}),i[y]=R.v.version);let k={t:"b",u:s,...i?{v:i}:{}};try{n.post(k,d.length>0?d:void 0)}catch{}}).subscribe(()=>{})}let g=[];for(let[x,b]of o){let c=b.subscribe((a=>{if(!m)for(let s of a){let d=s[0];d!==h&&(K.isLocalOnly(d)||(d===O?n.post({t:"e",s:x,err:P(s[1])}):n.post({t:"s",s:x,sig:I(d),d:s.length>1?s[1]:void 0})))}}));g.push(c)}let w=n.listen(x=>{if(m)return;let b=x;switch(b.t){case"i":{B(()=>{for(let[c,a]of Object.entries(b.stores)){let s=r.get(c);s&&s.down([[h,a]])}});break}case"v":{let c=r.get(b.s);c&&c.down([[h,b.d]]);break}case"b":{B(()=>{for(let[c,a]of Object.entries(b.u)){let s=b.v?.[c];if(s!=null){let i=f.get(c);if(i!=null&&s<=i)continue;f.set(c,s)}let d=r.get(c);d&&d.down([[h,a]])}});break}case"e":{let c=r.get(b.s);c&&c.down([[O,A(b.err)]]);break}case"s":{let c=V(b.sig);if(!c)break;if(c===S&&b.s==="*"){E();return}let a=b.s==="*"?[...r.values()]:r.has(b.s)?[r.get(b.s)]:[];for(let s of a)s.down(b.d===void 0?[[c]]:[[c,b.d]]);break}}}),T={};for(let[x,b]of o)T[x]=b.cache;n.post({t:"r",stores:T});function E(){if(!m){m=!0,u&&u();for(let x of g)x();g.length=0,w(),n.terminate?.(),f.clear(),r.clear()}}return{destroy:E}}export{ue as a,pt as b,_ as c,lt as d,I as e,V as f,P as g,A as h,L as i,le as j,me as k,kt as l};
@@ -1 +1 @@
1
- import{F as D}from"./chunk-7AJKUA36.js";import{b as f,i as p,j as c}from"./chunk-CK2E7BTU.js";function x(e){return D(n=>{let r=!1,o=()=>{e.onsuccess=null,e.onerror=null};return e.onsuccess=()=>{r||(r=!0,o(),n.down([[f,e.result],[p]]))},e.onerror=()=>{r||(r=!0,o(),n.down([[c,e.error??new Error("IndexedDB request failed")]]))},()=>{r=!0,o()}})}function E(e){return D(n=>{let r=!1,o=()=>{e.oncomplete=null,e.onerror=null,e.onabort=null};return e.oncomplete=()=>{r||(r=!0,o(),n.down([[f,void 0],[p]]))},e.onerror=()=>{r||(r=!0,o(),n.down([[c,e.error??new Error("IndexedDB transaction failed")]]))},e.onabort=()=>{r||(r=!0,o(),n.down([[c,e.error??new Error("IndexedDB transaction aborted")]]))},()=>{r=!0,o()}})}function b(e,n,r){return new Promise((o,i)=>{if(typeof indexedDB>"u"){i(new TypeError("indexedDB is not available in this environment"));return}let t=indexedDB.open(e,r);t.onupgradeneeded=()=>{let s=t.result;s.objectStoreNames.contains(n)||s.createObjectStore(n)},t.onsuccess=()=>o(t.result),t.onerror=()=>i(t.error??new Error("IndexedDB open failed"))})}function m(e,n,r,o,i){return b(e,n,r).then(t=>new Promise((s,a)=>{let d=t.transaction(n,o),I=d.objectStore(n),u=i(I),w,l=!1,y=!1,B=()=>{!l||!y||(t.close(),s(w))};u.onsuccess=()=>{w=u.result,l=!0,B()},u.onerror=()=>{t.close(),a(u.error??new Error("IndexedDB request failed"))},d.oncomplete=()=>{if(y=!0,!l){t.close(),a(new Error("IndexedDB transaction completed without request result"));return}B()},d.onerror=()=>{t.close(),a(d.error??new Error("IndexedDB transaction failed"))},d.onabort=()=>{t.close(),a(d.error??new Error("IndexedDB transaction aborted"))}}))}function S(e){let{dbName:n,storeName:r}=e,o=e.version??1,i=e.key??"graphrefly_checkpoint";return{async save(t,s){await m(n,r,o,"readwrite",a=>a.put(s,i))},async load(t){let s=await m(n,r,o,"readonly",a=>a.get(i));return s==null||typeof s!="object"||Array.isArray(s)?null:s},async clear(t){await m(n,r,o,"readwrite",s=>s.delete(i))}}}export{x as a,E as b,S as c};
1
+ import{F as D}from"./chunk-LYCLF26R.js";import{b as f,i as p,j as c}from"./chunk-CK2E7BTU.js";function x(e){return D(n=>{let r=!1,o=()=>{e.onsuccess=null,e.onerror=null};return e.onsuccess=()=>{r||(r=!0,o(),n.down([[f,e.result],[p]]))},e.onerror=()=>{r||(r=!0,o(),n.down([[c,e.error??new Error("IndexedDB request failed")]]))},()=>{r=!0,o()}})}function E(e){return D(n=>{let r=!1,o=()=>{e.oncomplete=null,e.onerror=null,e.onabort=null};return e.oncomplete=()=>{r||(r=!0,o(),n.down([[f,void 0],[p]]))},e.onerror=()=>{r||(r=!0,o(),n.down([[c,e.error??new Error("IndexedDB transaction failed")]]))},e.onabort=()=>{r||(r=!0,o(),n.down([[c,e.error??new Error("IndexedDB transaction aborted")]]))},()=>{r=!0,o()}})}function b(e,n,r){return new Promise((o,i)=>{if(typeof indexedDB>"u"){i(new TypeError("indexedDB is not available in this environment"));return}let t=indexedDB.open(e,r);t.onupgradeneeded=()=>{let s=t.result;s.objectStoreNames.contains(n)||s.createObjectStore(n)},t.onsuccess=()=>o(t.result),t.onerror=()=>i(t.error??new Error("IndexedDB open failed"))})}function m(e,n,r,o,i){return b(e,n,r).then(t=>new Promise((s,a)=>{let d=t.transaction(n,o),I=d.objectStore(n),u=i(I),w,l=!1,y=!1,B=()=>{!l||!y||(t.close(),s(w))};u.onsuccess=()=>{w=u.result,l=!0,B()},u.onerror=()=>{t.close(),a(u.error??new Error("IndexedDB request failed"))},d.oncomplete=()=>{if(y=!0,!l){t.close(),a(new Error("IndexedDB transaction completed without request result"));return}B()},d.onerror=()=>{t.close(),a(d.error??new Error("IndexedDB transaction failed"))},d.onabort=()=>{t.close(),a(d.error??new Error("IndexedDB transaction aborted"))}}))}function S(e){let{dbName:n,storeName:r}=e,o=e.version??1,i=e.key??"graphrefly_checkpoint";return{async save(t,s){await m(n,r,o,"readwrite",a=>a.put(s,i))},async load(t){let s=await m(n,r,o,"readonly",a=>a.get(i));return s==null||typeof s!="object"||Array.isArray(s)?null:s},async clear(t){await m(n,r,o,"readwrite",s=>s.delete(i))}}}export{x as a,E as b,S as c};
@@ -1,2 +1,2 @@
1
- import{a as G}from"./chunk-K54OKWNY.js";import{j as z}from"./chunk-PSQNYY72.js";import{D as H,E as M,G as N,o as R}from"./chunk-7AJKUA36.js";function q(t){for(let c of t){let m=c.codePointAt(0);if(m>=19968&&m<=40959||m>=13312&&m<=19903||m>=12288&&m<=12351||m>=12352&&m<=12447||m>=12448&&m<=12543||m>=44032&&m<=55215||m>=65280&&m<=65519)return!0}return!1}var E=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011"]),F=new Set([".",",","!","?",":",";",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]);function D(t){return t.replace(/[\t\n\r\f ]+/g," ").replace(/^ | $/g,"")}function O(t){let c=new Intl.Segmenter(void 0,{granularity:"word"}),m=[];for(let f of c.segment(t)){let h=f.segment,w=f.isWordLike??!1,u=[],s=[],r=[],p="",n=null;for(let i of h){let S;i===" "?S="space":i==="\u200B"?S="zero-width-break":i==="\xAD"?S="soft-hyphen":i===`
1
+ import{a as G}from"./chunk-L3KUKDZC.js";import{j as z}from"./chunk-2JO6LXFT.js";import{D as H,E as M,G as N,o as R}from"./chunk-LYCLF26R.js";function q(t){for(let c of t){let m=c.codePointAt(0);if(m>=19968&&m<=40959||m>=13312&&m<=19903||m>=12288&&m<=12351||m>=12352&&m<=12447||m>=12448&&m<=12543||m>=44032&&m<=55215||m>=65280&&m<=65519)return!0}return!1}var E=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011"]),F=new Set([".",",","!","?",":",";",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]);function D(t){return t.replace(/[\t\n\r\f ]+/g," ").replace(/^ | $/g,"")}function O(t){let c=new Intl.Segmenter(void 0,{granularity:"word"}),m=[];for(let f of c.segment(t)){let h=f.segment,w=f.isWordLike??!1,u=[],s=[],r=[],p="",n=null;for(let i of h){let S;i===" "?S="space":i==="\u200B"?S="zero-width-break":i==="\xAD"?S="soft-hyphen":i===`
2
2
  `?S="hard-break":S="text",n!==null&&S===n?p+=i:(n!==null&&(u.push(p),s.push(n==="text"&&w),r.push(n)),p=i,n=S)}n!==null&&(u.push(p),s.push(n==="text"&&w),r.push(n)),m.push({texts:u,isWordLike:s,kinds:r})}return m}function V(t,c,m,f,h){let w=D(t);if(w.length===0)return[];let u=O(w),s=new Intl.Segmenter(void 0,{granularity:"grapheme"}),r=[],p=[],n=[];for(let g of u)for(let o=0;o<g.texts.length;o++)r.push(g.texts[o]),p.push(g.kinds[o]),n.push(g.isWordLike[o]);let i=[],S=[],B=[];for(let g=0;g<r.length;g++){let o=r[g],y=p[g],I=n[g];if(y==="text"&&!I&&i.length>0&&S[S.length-1]==="text"&&o.length===1&&(F.has(o)||E.has(o))){i[i.length-1]+=o;continue}if(o==="-"&&i.length>0&&S[S.length-1]==="text"&&B[B.length-1]){i[i.length-1]+=o;continue}i.push(o),S.push(y),B.push(I)}let l=f.get(c);l||(l=new Map,f.set(c,l));function b(g){let o=l.get(g);if(o===void 0){h&&(h.misses+=1);let y=m.measureSegment(g,c).width;o=Number.isFinite(y)&&y>=0?y:0,l.set(g,o)}else h&&(h.hits+=1);return o}let d=[];for(let g=0;g<i.length;g++){let o=i[g],y=S[g];if(y!=="text"){d.push({text:o,width:y==="space"?b(" ")*o.length:0,kind:y,graphemeWidths:null});continue}if(q(o)){let a="";for(let x of s.segment(o)){let k=x.segment;if(a.length>0&&E.has(k)){a+=k;continue}if(a.length>0){let L=b(a);d.push({text:a,width:L,kind:"text",graphemeWidths:null})}a=k}if(a.length>0){let x=b(a);d.push({text:a,width:x,kind:"text",graphemeWidths:null})}continue}let I=b(o),e=null;if(B[g]&&o.length>1){let a=[];for(let x of s.segment(o))a.push(b(x.segment));a.length>1&&(e=a)}d.push({text:o,width:I,kind:"text",graphemeWidths:e})}return d}function J(t,c,m,f,h){if(t.length===0)return{lines:[],lineCount:0};let w=[],u=0,s=!1,r=0,p=0,n=0,i=0,S=-1,B=0,l=h.get(f);l||(l=new Map,h.set(f,l));let b=l.get("-");b===void 0&&(b=m.measureSegment("-",f).width,l.set("-",b));function d(e=n,a=i,x=u){let k="";for(let L=r;L<e;L++){let W=t[L];if(!(W.kind==="soft-hyphen"||W.kind==="hard-break"))if(L===r&&p>0&&W.graphemeWidths){let P=[...new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(W.text)].map(K=>K.segment);k+=P.slice(p).join("")}else k+=W.text}if(a>0&&e<t.length){let L=t[e],v=[...new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(L.text)].map(K=>K.segment),P=r===e?p:0;k+=v.slice(P,a).join("")}e>0&&t[e-1]?.kind==="soft-hyphen"&&!(r===e&&p>0)&&(k+="-"),w.push({text:k,width:x,startSegment:r,startGrapheme:p,endSegment:e,endGrapheme:a}),u=0,s=!1,S=-1,B=0}function g(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function o(e,a,x){s=!0,r=e,p=a,n=e+1,i=0,u=x}function y(e,a,x){s=!0,r=e,p=a,n=e,i=a+1,u=x}for(let e=0;e<t.length;e++){let a=t[e];if(a.kind==="hard-break"){s?d():w.push({text:"",width:0,startSegment:e,startGrapheme:0,endSegment:e,endGrapheme:0}),r=e+1,p=0;continue}let x=a.width;if(!s){x>c&&a.graphemeWidths?I(e,0,a.graphemeWidths):o(e,0,x),g(a.kind)&&(S=e+1,B=a.kind==="space"?u-x:u);continue}let k=u+x;if(k>c+.005){if(g(a.kind)){u+=x,n=e+1,i=0,d(e+1,0,a.kind==="space"?u-x:u);continue}if(S>=0){d(S,0,B),e--;continue}if(x>c&&a.graphemeWidths){d(),I(e,0,a.graphemeWidths);continue}d(),e--;continue}u=k,n=e+1,i=0,g(a.kind)&&(S=e+1,B=a.kind==="space"?u-x:u)}return s&&d(),{lines:w,lineCount:w.length};function I(e,a,x){for(let k=a;k<x.length;k++){let L=x[k];if(!s){y(e,k,L);continue}u+L>c+.005?(d(),y(e,k,L)):(u+=L,n=e,i=k+1)}s&&n===e&&i===x.length&&(n=e+1,i=0)}}function A(t){return t==="space"||t==="zero-width-break"||t==="soft-hyphen"}var T=null;function _(){return T===null&&(T=new Intl.Segmenter(void 0,{granularity:"grapheme"})),T}function j(t,c,m){if(c===0&&m<0)return t.text;let f=[..._().segment(t.text)].map(w=>w.segment),h=m<0?f.length:m;return f.slice(c,h).join("")}function C(t,c,m,f,h,w){let u="";for(let s=c;s<f;s++){let r=t[s];r.kind==="soft-hyphen"||r.kind==="hard-break"||(s===c&&m>0?u+=j(r,m,-1):u+=r.text)}if(h>0&&f<t.length){let s=t[f];u+=j(s,c===f?m:0,h)}return w&&(u+="-"),u}function $(t){if(!t?.adapter||!t.font)return 0;let c=t.cache;if(c){let m=c.get(t.font);m||(m=new Map,c.set(t.font,m));let f=m.get("-");return f===void 0&&(f=t.adapter.measureSegment("-",t.font).width,m.set("-",f)),f}return t.adapter.measureSegment("-",t.font).width}function te(t,c,m,f){let h=c.segmentIndex,w=c.graphemeIndex;if(h>=t.length)return null;if(w===0){for(;h<t.length;){let e=t[h];if(e.kind==="hard-break")return{text:"",width:0,start:{segmentIndex:c.segmentIndex,graphemeIndex:0},end:{segmentIndex:h+1,graphemeIndex:0}};if(e.kind==="space"||e.kind==="zero-width-break"||e.kind==="soft-hyphen"){h+=1;continue}break}if(h>=t.length)return null}let u=$(f),s=h,r=h===c.segmentIndex?w:0,p=0,n=s,i=0,S=!1,B=-1,l=0,b=0,d=!1,g=(e,a,x,k)=>{B=e,l=a,b=x,d=k==="soft-hyphen"},o=(e,a,x)=>{for(let k=a;k<x.length;k++){let L=x[k];if(!S){p=L,n=e,i=k+1,S=!0;continue}if(p+L>m+.005)return!0;p+=L,n=e,i=k+1}return n===e&&i===x.length&&(n=e+1,i=0),!1};if(r>0&&s<t.length){let e=t[s];if(e.graphemeWidths){if(o(s,r,e.graphemeWidths))return{text:C(t,s,r,n,i,!1),width:p,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}};h=n}}for(;h<t.length;){let e=t[h];if(e.kind==="hard-break"){if(S){let k=n>0&&t[n-1]?.kind==="soft-hyphen";return{text:C(t,s,r,n,i,k),width:p+(k?u:0),start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}}return{text:"",width:0,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:h+1,graphemeIndex:0}}}let a=e.width;if(!S){if(a>m&&e.graphemeWidths){if(o(h,0,e.graphemeWidths))return{text:C(t,s,r,n,i,!1),width:p,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}};h=n;continue}p=a,n=h+1,i=0,S=!0,A(e.kind)&&g(h+1,0,e.kind==="space"?p-a:p,e.kind),h+=1;continue}let x=p+a;if(x>m+.005){if(A(e.kind)){n=h+1,i=0;let L=e.kind==="soft-hyphen",W=e.kind==="space"?p:p+(L?u:0);return{text:C(t,s,r,n,i,L),width:W,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}}return B>=0?{text:C(t,s,r,B,l,d),width:b+(d?u:0),start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:B,graphemeIndex:l}}:a>m&&e.graphemeWidths?{text:C(t,s,r,n,i,!1),width:p,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}:{text:C(t,s,r,n,i,!1),width:p,start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}}p=x,n=h+1,i=0,A(e.kind)&&g(h+1,0,e.kind==="space"?p-a:p,e.kind),h+=1}if(!S)return null;let y=n>0&&t[n-1]?.kind==="soft-hyphen";return{text:C(t,s,r,n,i,y),width:p+(y?u:0),start:{segmentIndex:s,graphemeIndex:r},end:{segmentIndex:n,graphemeIndex:i}}}function ne(t,c,m=0){let f=[t];for(let h=0;h<c.length;h++){let w=c[h],u=[];for(let s=0;s<f.length;s++){let r=f[s];if(w.right<=r.left||w.left>=r.right){u.push(r);continue}w.left>r.left&&u.push({left:r.left,right:w.left}),w.right<r.right&&u.push({left:w.right,right:r.right})}f=u}return m>0?f.filter(h=>h.right-h.left>=m):f}function Q(t,c,m){let f=[],h=new Intl.Segmenter(void 0,{granularity:"grapheme"});for(let w=0;w<t.lines.length;w++){let u=t.lines[w],s=w*m,r=0;for(let p=u.startSegment;p<c.length;p++){let n=c[p];if(n.kind==="soft-hyphen"||n.kind==="hard-break"){if(p>=u.endSegment&&u.endGrapheme===0)break;continue}let i=[...h.segment(n.text)].map(l=>l.segment);if(i.length===0)continue;let S=p===u.startSegment?u.startGrapheme:0,B;if(p<u.endSegment)B=i.length;else if(p===u.endSegment&&u.endGrapheme>0)B=u.endGrapheme;else break;for(let l=S;l<B;l++){let b=n.graphemeWidths?n.graphemeWidths[l]:n.width/i.length;f.push({x:r,y:s,width:b,height:m,line:w}),r+=b}}}return f}function re(t){let{adapter:c,name:m="reactive-layout"}=t,f=new z(m),h=new Map,w=M(t.text??"",{name:"text"}),u=M(t.font??"16px sans-serif",{name:"font"}),s=M(t.lineHeight??20,{name:"line-height"}),r=M(Math.max(0,t.maxWidth??800),{name:"max-width"});function p(l,b){if(l===null||b===null)return l===b;if(l.length!==b.length)return!1;for(let d=0;d<l.length;d++)if(l[d]!==b[d])return!1;return!0}let n=H([w,u],(l,b,d)=>{let g=l[0],o=g!=null&&g.length>0?g.at(-1):d.prevData[0],y=l[1],I=y!=null&&y.length>0?y.at(-1):d.prevData[1],e=R(),a={hits:0,misses:0},x=V(o,I,c,h,a),k=R()-e,L=a.hits+a.misses,W=L===0?1:a.hits/L,v=n.meta;v&&(G(v["cache-hit-rate"],W),G(v["segment-count"],x.length),G(v["layout-time-ns"],k)),b.emit(x);let P=()=>{h.clear(),c.clearCache?.()};return{deactivate:P,invalidate:P}},{name:"segments",describeKind:"derived",meta:{"cache-hit-rate":0,"segment-count":0,"layout-time-ns":0},equals:(l,b)=>{let d=l,g=b;if(d==null||g==null)return d===g;if(d.length!==g.length)return!1;for(let o=0;o<d.length;o++){let y=d[o],I=g[o];if(y.text!==I.text||y.width!==I.width||y.kind!==I.kind||!p(y.graphemeWidths??null,I.graphemeWidths??null))return!1}return!0}}),i=N([n,r,u],([l,b,d])=>J(l,b,c,d,h),{name:"line-breaks",equals:(l,b)=>{let d=l,g=b;if(d==null||g==null)return d===g;if(d.lineCount!==g.lineCount)return!1;for(let o=0;o<d.lines.length;o++){let y=d.lines[o],I=g.lines[o];if(y.text!==I.text||y.width!==I.width||y.startSegment!==I.startSegment||y.startGrapheme!==I.startGrapheme||y.endSegment!==I.endSegment||y.endGrapheme!==I.endGrapheme)return!1}return!0}}),S=N([i,s],([l,b])=>l.lineCount*b,{name:"height"}),B=N([i,n,s],([l,b,d])=>Q(l,b,d),{name:"char-positions",equals:(l,b)=>{let d=l,g=b;if(d==null||g==null)return d===g;if(d.length!==g.length)return!1;for(let o=0;o<d.length;o++)if(d[o].x!==g[o].x||d[o].y!==g[o].y||d[o].width!==g[o].width)return!1;return!0}});return f.add(w,{name:"text"}),f.add(u,{name:"font"}),f.add(s,{name:"line-height"}),f.add(r,{name:"max-width"}),f.add(n,{name:"segments"}),f.add(i,{name:"line-breaks"}),f.add(S,{name:"height"}),f.add(B,{name:"char-positions"}),{graph:f,setText:l=>f.set("text",l),setFont:l=>f.set("font",l),setLineHeight:l=>f.set("line-height",l),setMaxWidth:l=>f.set("max-width",Math.max(0,l)),segments:n,lineBreaks:i,height:S,charPositions:B}}export{V as a,J as b,te as c,ne as d,Q as e,re as f};
@@ -1 +1 @@
1
- import{e as P}from"./chunk-YZ6VYLFD.js";import{c as S}from"./chunk-K54OKWNY.js";import{a as w}from"./chunk-7EQPXQ7H.js";import{b as _}from"./chunk-LWGLBCMU.js";import{j as O,l as R}from"./chunk-PSQNYY72.js";import{B as T}from"./chunk-UMH3HSP7.js";import{E as k,G as x,o as H}from"./chunk-7AJKUA36.js";import{b as M}from"./chunk-QYADASLV.js";var B={};M(B,{LensGraph:()=>C,graphLens:()=>N,watchTopologyTree:()=>w});function v(e){return S("lens",e)}function E(e){let t=Object.keys(e.nodes),o=new Map,n=new Map;for(let s of t){let a=e.nodes[s]?.deps??[];o.set(s,a);for(let h of a)n.has(h)||n.set(h,new Set),n.get(h).add(s)}let r=[],c=[];for(let s of t)(o.get(s)??[]).length===0&&r.push(s),n.has(s)||c.push(s);r.sort(),c.sort();let p=e.edges.length,f=0,m=1,g=2,d=new Map;for(let s of t)d.set(s,f);let y=!1,l=new Map,u=s=>{let a=d.get(s)??f;if(a===m)return y=!0,0;if(a===g)return l.get(s)??0;d.set(s,m);let h=0,b=n.get(s);if(b!=null)for(let F of b){let G=u(F);G+1>h&&(h=G+1)}return d.set(s,g),l.set(s,h),h},i=0;for(let s of r){let a=u(s);a>i&&(i=a)}for(let s of t)d.get(s)===f&&u(s);return{nodeCount:t.length,edgeCount:p,subgraphCount:e.subgraphs.length,sources:r,sinks:c,depth:i,hasCycles:y}}function $(e){let t=[];for(let[o,n]of Object.entries(e.nodes)){if(n.status!=="errored")continue;let r={path:o,status:"errored"},c=R(e,o,"upstream",{});for(let p of c)if(p!==o&&e.nodes[p]?.status==="errored"){r.upstreamCause=p;break}t.push(r)}return t.sort((o,n)=>o.path<n.path?-1:o.path>n.path?1:0),{ok:t.length===0,problems:t}}function q(e,t){return e.nodeCount===t.nodeCount&&e.edgeCount===t.edgeCount&&e.subgraphCount===t.subgraphCount&&e.depth===t.depth&&e.hasCycles===t.hasCycles&&D(e.sources,t.sources)&&D(e.sinks,t.sinks)}function L(e,t){if(e.ok!==t.ok||e.problems.length!==t.problems.length)return!1;for(let o=0;o<e.problems.length;o++){let n=e.problems[o],r=t.problems[o];if(n.path!==r.path||n.status!==r.status||n.upstreamCause!==r.upstreamCause)return!1}return!0}function D(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var C=class extends O{stats;health;flow;_target;constructor(t,o={}){super(o.name??`${t.name}_lens`,o.graph),this._target=t;let n=0,r=0,c=k(0,{name:"stats_tick"}),p=k(0,{name:"health_tick"});this.add(c,{name:"stats_tick"}),this.add(p,{name:"health_tick"});let f={name:"flow"};o.maxFlowPaths!=null&&(f.maxSize=o.maxFlowPaths),this.flow=_(f),this.add(this.flow.entries,{name:"flow"});let m=o.pathFilter,g=w(t,(l,u,i)=>{if(n+=1,c.emit(n),r+=1,p.emit(r),l.kind==="removed")if(l.nodeKind==="node"){let s=`${i}${l.name}`;this.flow.delete(s)}else{let s=`${i}${l.name}::`,a=[];for(let h of l.audit.nodes){let b=h===""?`${i}${l.name}`:`${s}${h}`;a.push(b)}a.length>0&&this.flow.deleteMany(a)}});this.addDisposer(g);let d=t.observe({timeline:!0,structured:!0}),y=d.onEvent(l=>{let u=l.type;if((u==="error"||u==="complete"||u==="data"||u==="teardown")&&(r+=1,p.emit(r)),u==="data"){let i=l.path??"";if(!i||m!=null&&!m(i))return;let s=this.flow.get(i),a=s!=null?s.count+1:1;this.flow.set(i,{path:i,count:a,lastUpdate_ns:H()})}});this.addDisposer(()=>{y(),d.dispose()}),this.stats=x([c],()=>E(t.describe({detail:"minimal"})),{name:"stats",describeKind:"derived",equals:q,meta:v("stats")}),this.add(this.stats,{name:"stats"}),this.addDisposer(T(this.stats)),this.health=x([p],()=>$(t.describe({detail:"standard"})),{name:"health",describeKind:"derived",equals:L,meta:v("health")}),this.add(this.health,{name:"health"}),this.addDisposer(T(this.health))}why(t,o,n){let r=P(this._target,t,o,n);return this.addDisposer(r.dispose),r}get target(){return this._target}};function N(e,t){return new C(e,t)}export{C as a,N as b,B as c};
1
+ import{e as P}from"./chunk-YDWTVO4E.js";import{c as S}from"./chunk-L3KUKDZC.js";import{a as w}from"./chunk-Q46YJCQH.js";import{b as _}from"./chunk-TZQPPQEQ.js";import{j as O,l as R}from"./chunk-2JO6LXFT.js";import{B as T}from"./chunk-T7EQPKOP.js";import{E as k,G as x,o as H}from"./chunk-LYCLF26R.js";import{b as M}from"./chunk-QYADASLV.js";var B={};M(B,{LensGraph:()=>C,graphLens:()=>N,watchTopologyTree:()=>w});function v(e){return S("lens",e)}function E(e){let t=Object.keys(e.nodes),o=new Map,n=new Map;for(let s of t){let a=e.nodes[s]?.deps??[];o.set(s,a);for(let h of a)n.has(h)||n.set(h,new Set),n.get(h).add(s)}let r=[],c=[];for(let s of t)(o.get(s)??[]).length===0&&r.push(s),n.has(s)||c.push(s);r.sort(),c.sort();let p=e.edges.length,f=0,m=1,g=2,d=new Map;for(let s of t)d.set(s,f);let y=!1,l=new Map,u=s=>{let a=d.get(s)??f;if(a===m)return y=!0,0;if(a===g)return l.get(s)??0;d.set(s,m);let h=0,b=n.get(s);if(b!=null)for(let F of b){let G=u(F);G+1>h&&(h=G+1)}return d.set(s,g),l.set(s,h),h},i=0;for(let s of r){let a=u(s);a>i&&(i=a)}for(let s of t)d.get(s)===f&&u(s);return{nodeCount:t.length,edgeCount:p,subgraphCount:e.subgraphs.length,sources:r,sinks:c,depth:i,hasCycles:y}}function $(e){let t=[];for(let[o,n]of Object.entries(e.nodes)){if(n.status!=="errored")continue;let r={path:o,status:"errored"},c=R(e,o,"upstream",{});for(let p of c)if(p!==o&&e.nodes[p]?.status==="errored"){r.upstreamCause=p;break}t.push(r)}return t.sort((o,n)=>o.path<n.path?-1:o.path>n.path?1:0),{ok:t.length===0,problems:t}}function q(e,t){return e.nodeCount===t.nodeCount&&e.edgeCount===t.edgeCount&&e.subgraphCount===t.subgraphCount&&e.depth===t.depth&&e.hasCycles===t.hasCycles&&D(e.sources,t.sources)&&D(e.sinks,t.sinks)}function L(e,t){if(e.ok!==t.ok||e.problems.length!==t.problems.length)return!1;for(let o=0;o<e.problems.length;o++){let n=e.problems[o],r=t.problems[o];if(n.path!==r.path||n.status!==r.status||n.upstreamCause!==r.upstreamCause)return!1}return!0}function D(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var C=class extends O{stats;health;flow;_target;constructor(t,o={}){super(o.name??`${t.name}_lens`,o.graph),this._target=t;let n=0,r=0,c=k(0,{name:"stats_tick"}),p=k(0,{name:"health_tick"});this.add(c,{name:"stats_tick"}),this.add(p,{name:"health_tick"});let f={name:"flow"};o.maxFlowPaths!=null&&(f.maxSize=o.maxFlowPaths),this.flow=_(f),this.add(this.flow.entries,{name:"flow"});let m=o.pathFilter,g=w(t,(l,u,i)=>{if(n+=1,c.emit(n),r+=1,p.emit(r),l.kind==="removed")if(l.nodeKind==="node"){let s=`${i}${l.name}`;this.flow.delete(s)}else{let s=`${i}${l.name}::`,a=[];for(let h of l.audit.nodes){let b=h===""?`${i}${l.name}`:`${s}${h}`;a.push(b)}a.length>0&&this.flow.deleteMany(a)}});this.addDisposer(g);let d=t.observe({timeline:!0,structured:!0}),y=d.onEvent(l=>{let u=l.type;if((u==="error"||u==="complete"||u==="data"||u==="teardown")&&(r+=1,p.emit(r)),u==="data"){let i=l.path??"";if(!i||m!=null&&!m(i))return;let s=this.flow.get(i),a=s!=null?s.count+1:1;this.flow.set(i,{path:i,count:a,lastUpdate_ns:H()})}});this.addDisposer(()=>{y(),d.dispose()}),this.stats=x([c],()=>E(t.describe({detail:"minimal"})),{name:"stats",describeKind:"derived",equals:q,meta:v("stats")}),this.add(this.stats,{name:"stats"}),this.addDisposer(T(this.stats)),this.health=x([p],()=>$(t.describe({detail:"standard"})),{name:"health",describeKind:"derived",equals:L,meta:v("health")}),this.add(this.health,{name:"health"}),this.addDisposer(T(this.health))}why(t,o,n){let r=P(this._target,t,o,n);return this.addDisposer(r.dispose),r}get target(){return this._target}};function N(e,t){return new C(e,t)}export{C as a,N as b,B as c};
@@ -1 +1 @@
1
- import{E as b,m as h}from"./chunk-7AJKUA36.js";import{b as p,c as l}from"./chunk-CK2E7BTU.js";var u=class{_version=0;_buf;constructor(e){this._buf=e?[...e]:[]}get version(){return this._version}get size(){return this._buf.length}at(e){if(!Number.isInteger(e))return;let n=e>=0?e:this._buf.length+e;if(!(n<0||n>=this._buf.length))return this._buf[n]}append(e){this._buf.push(e),this._version+=1}appendMany(e){if(e.length===0)return;let n=this._buf.length;this._buf.length=n+e.length;for(let i=0;i<e.length;i++)this._buf[n+i]=e[i];this._version+=1}insert(e,n){if(!Number.isInteger(e)||e<0||e>this._buf.length)throw new RangeError(`insert: index ${e} out of range [0, ${this._buf.length}]`);this._buf.splice(e,0,n),this._version+=1}insertMany(e,n){if(!Number.isInteger(e)||e<0||e>this._buf.length)throw new RangeError(`insertMany: index ${e} out of range [0, ${this._buf.length}]`);n.length!==0&&(this._buf.splice(e,0,...n),this._version+=1)}pop(e){if(this._buf.length===0)throw new RangeError("pop from empty list");if(!Number.isInteger(e))throw new RangeError(`pop: index ${e} must be an integer`);let n=e>=0?e:this._buf.length+e;if(n<0||n>=this._buf.length)throw new RangeError(`pop: index ${e} out of range`);let[i]=this._buf.splice(n,1);return this._version+=1,i}clear(){let e=this._buf.length;return e===0?0:(this._buf.length=0,this._version+=1,e)}toArray(){return[...this._buf]}};function y(d,e={}){let{name:n,versioning:i,backend:f}=e,t=f??new u(d),a=b(t.toArray(),{name:n,describeKind:"state",equals:(r,o)=>r===o,...i!=null?{versioning:i}:{}});function v(){let r=t.toArray();h(()=>{a.down([[l]]),a.down([[p,r]])})}function s(r){let o=t.version;try{return r()}finally{t.version!==o&&v()}}return{items:a,get size(){return t.size},at(r){return t.at(r)},append(r){s(()=>t.append(r))},appendMany(r){s(()=>t.appendMany(r))},insert(r,o){s(()=>t.insert(r,o))},insertMany(r,o){s(()=>t.insertMany(r,o))},pop(r=-1){return s(()=>t.pop(r))},clear(){s(()=>t.clear())},dispose(){}}}export{u as a,y as b};
1
+ import{E as b,m as h}from"./chunk-LYCLF26R.js";import{b as p,c as l}from"./chunk-CK2E7BTU.js";var u=class{_version=0;_buf;constructor(e){this._buf=e?[...e]:[]}get version(){return this._version}get size(){return this._buf.length}at(e){if(!Number.isInteger(e))return;let n=e>=0?e:this._buf.length+e;if(!(n<0||n>=this._buf.length))return this._buf[n]}append(e){this._buf.push(e),this._version+=1}appendMany(e){if(e.length===0)return;let n=this._buf.length;this._buf.length=n+e.length;for(let i=0;i<e.length;i++)this._buf[n+i]=e[i];this._version+=1}insert(e,n){if(!Number.isInteger(e)||e<0||e>this._buf.length)throw new RangeError(`insert: index ${e} out of range [0, ${this._buf.length}]`);this._buf.splice(e,0,n),this._version+=1}insertMany(e,n){if(!Number.isInteger(e)||e<0||e>this._buf.length)throw new RangeError(`insertMany: index ${e} out of range [0, ${this._buf.length}]`);n.length!==0&&(this._buf.splice(e,0,...n),this._version+=1)}pop(e){if(this._buf.length===0)throw new RangeError("pop from empty list");if(!Number.isInteger(e))throw new RangeError(`pop: index ${e} must be an integer`);let n=e>=0?e:this._buf.length+e;if(n<0||n>=this._buf.length)throw new RangeError(`pop: index ${e} out of range`);let[i]=this._buf.splice(n,1);return this._version+=1,i}clear(){let e=this._buf.length;return e===0?0:(this._buf.length=0,this._version+=1,e)}toArray(){return[...this._buf]}};function y(d,e={}){let{name:n,versioning:i,backend:f}=e,t=f??new u(d),a=b(t.toArray(),{name:n,describeKind:"state",equals:(r,o)=>r===o,...i!=null?{versioning:i}:{}});function v(){let r=t.toArray();h(()=>{a.down([[l]]),a.down([[p,r]])})}function s(r){let o=t.version;try{return r()}finally{t.version!==o&&v()}}return{items:a,get size(){return t.size},at(r){return t.at(r)},append(r){s(()=>t.append(r))},appendMany(r){s(()=>t.appendMany(r))},insert(r,o){s(()=>t.insert(r,o))},insertMany(r,o){s(()=>t.insertMany(r,o))},pop(r=-1){return s(()=>t.pop(r))},clear(){s(()=>t.clear())},dispose(){}}}export{u as a,y as b};
@@ -1 +1 @@
1
- import{E as l,J as f}from"./chunk-7AJKUA36.js";import{b as m,j as d}from"./chunk-CK2E7BTU.js";import{b as p}from"./chunk-QYADASLV.js";var F={};p(F,{atom:()=>A});function A(s,n,e){if(typeof s=="function"){let t=s;return typeof n=="function"?b(t,n,e):b(t,void 0,n)}return v(s,n)}function c(s){let n=s.cache,e;if(s.subscribe(i=>{for(let[r,o]of i)r===m&&(n=o),r===d&&(e=o)})(),e)throw e;return n}function v(s,n){let e=l(s,{...n,resubscribable:!0,resetOnTeardown:!0});return{get:()=>e.status==="sentinel"?c(e):e.cache,set:t=>e.emit(t),update:t=>{let i=e.status==="sentinel"?c(e):e.cache;e.emit(t(i))},subscribe:t=>{let i=!0;return e.subscribe(r=>{for(let[o,a]of r)if(o===m){if(i){i=!1;continue}t(a)}})},meta:e.meta,_node:e}}function b(s,n,e){let t=f(r=>s(o=>{let a=o._node;return a.status==="sentinel"&&c(a),r(a)}),{...e,resubscribable:!0,resetOnTeardown:!0}),i={get:()=>t.status==="sentinel"?c(t):t.cache,subscribe:r=>{let o=!0;return t.subscribe(a=>{for(let[u,T]of a)if(u===m){if(o){o=!1;continue}r(T)}})},meta:t.meta,_node:t};if(n){let r=u=>u.get(),o=(u,T)=>u.set(T),a=i;return a.set=u=>n(r,o,u),a.update=u=>{let T=t.status==="sentinel"?c(t):t.cache;return n(r,o,u(T))},a}return i}export{A as a,F as b};
1
+ import{E as l,J as f}from"./chunk-LYCLF26R.js";import{b as m,j as d}from"./chunk-CK2E7BTU.js";import{b as p}from"./chunk-QYADASLV.js";var F={};p(F,{atom:()=>A});function A(s,n,e){if(typeof s=="function"){let t=s;return typeof n=="function"?b(t,n,e):b(t,void 0,n)}return v(s,n)}function c(s){let n=s.cache,e;if(s.subscribe(i=>{for(let[r,o]of i)r===m&&(n=o),r===d&&(e=o)})(),e)throw e;return n}function v(s,n){let e=l(s,{...n,resubscribable:!0,resetOnTeardown:!0});return{get:()=>e.status==="sentinel"?c(e):e.cache,set:t=>e.emit(t),update:t=>{let i=e.status==="sentinel"?c(e):e.cache;e.emit(t(i))},subscribe:t=>{let i=!0;return e.subscribe(r=>{for(let[o,a]of r)if(o===m){if(i){i=!1;continue}t(a)}})},meta:e.meta,_node:e}}function b(s,n,e){let t=f(r=>s(o=>{let a=o._node;return a.status==="sentinel"&&c(a),r(a)}),{...e,resubscribable:!0,resetOnTeardown:!0}),i={get:()=>t.status==="sentinel"?c(t):t.cache,subscribe:r=>{let o=!0;return t.subscribe(a=>{for(let[u,T]of a)if(u===m){if(o){o=!1;continue}r(T)}})},meta:t.meta,_node:t};if(n){let r=u=>u.get(),o=(u,T)=>u.set(T),a=i;return a.set=u=>n(r,o,u),a.update=u=>{let T=t.status==="sentinel"?c(t):t.cache;return n(r,o,u(T))},a}return i}export{A as a,F as b};
@@ -1 +1 @@
1
- import{A as u,n as i}from"./chunk-7AJKUA36.js";import{b as t,c as o}from"./chunk-CK2E7BTU.js";function s(r,n){r!=null&&i(e=>r.down(e),[[t,n]],u.tierOf)}function p(r,n){let e=r.cache??0;return e>=n?!1:(r.down([[o],[t,e+1]]),!0)}function g(r,n,e){return{[r]:!0,[`${r}_type`]:n,...e??{}}}function l(r){return r.relatedTo?.[0]??r.summary}export{s as a,p as b,g as c,l as d};
1
+ import{A as u,n as i}from"./chunk-LYCLF26R.js";import{b as t,c as o}from"./chunk-CK2E7BTU.js";function s(r,n){r!=null&&i(e=>r.down(e),[[t,n]],u.tierOf)}function p(r,n){let e=r.cache??0;return e>=n?!1:(r.down([[o],[t,e+1]]),!0)}function g(r,n,e){return{[r]:!0,[`${r}_type`]:n,...e??{}}}function l(r){return r.relatedTo?.[0]??r.summary}export{s as a,p as b,g as c,l as d};
@@ -1,4 +1,4 @@
1
- import{b as Ne,i as Re}from"./chunk-RWGJQQLT.js";import{a as Pe}from"./chunk-SGS4OJGS.js";import{x as fe}from"./chunk-WQ7I7JVU.js";import{a as Z,b as de,i as Oe}from"./chunk-4VVTGLXJ.js";import{f as pe}from"./chunk-UMH3HSP7.js";import{A as ee,D as be,E as U,F as B,m as _,p as D}from"./chunk-7AJKUA36.js";import{b as E,c as ye,d as ke,h as le,i as P,j as x}from"./chunk-CK2E7BTU.js";function Ce(r){return{describeKind:"producer",...r}}function oe(r,n){return B(i=>{let s=!0,u={emit(t){s&&i.emit(t)},error(t){s&&(s=!1,i.down([[x,t]]))},complete(){s&&(s=!1,i.down([[P]]))}},o;try{let t=r(u);o=typeof t=="function"?t:void 0}catch(t){return u.error(t),()=>{s=!1}}return()=>{s=!1;try{o?.()}catch{}}},Ce(n))}function Me(r,n,i){let s=!0,u,o=0,t=0,e={},a=[],l=()=>{let d=u;u=void 0;try{d?.()}catch{}};for(let d of n){let p=i?.name?`${i.name}::${d}`:d,g=i?.channelOpts?.[d],y=B(T=>(o++,()=>{t++,o>0&&t>=o&&t>=n.length&&l()}),Ce({...g,name:p}));e[d]=y,a.push(y)}let m={};for(let d of n)m[d]=p=>{s&&e[d].down([[E,p]])};m.error=d=>{s&&(s=!1,_(()=>{for(let p of a)p.down([[x,d]])}),l())},m.complete=()=>{s&&(s=!1,_(()=>{for(let d of a)d.down([[P]])}),l())};let f=r(m);return u=typeof f=="function"?f:void 0,Object.assign(e,{dispose:()=>{s&&(s=!1,_(()=>{for(let d of a)try{d.down([[P]])}catch{}}),l())}})}var he=class{ring;arr;constructor(n){n===Number.POSITIVE_INFINITY||n<=0?(this.arr=[],this.ring=null):(this.ring=new Pe(n),this.arr=null)}get length(){return this.ring!=null?this.ring.size:this.arr.length}push(n){this.ring!=null?this.ring.push(n):this.arr.push(n)}shift(){return this.ring!=null?this.ring.shift():this.arr.shift()}drain(){if(this.ring!=null){let i=this.ring.toArray();return this.ring.clear(),i}let n=this.arr;return this.arr=[],n}};function se(r){return r instanceof Error?r:new Error(String(r))}function De(r){return r===void 0?null:typeof r=="string"?Oe(r):r}function z(r,n){let{name:i,onTransportError:s,retry:u,backpressure:o,batchSize:t=Number.POSITIVE_INFINITY,flushIntervalMs:e=0,serialize:a,stopOn:l,onUpstreamMessage:m,onDispose:f,send:c,sendBatch:d,ctx:p}=n;if(!c&&!d)throw new Error("reactiveSink: `send` or `sendBatch` must be provided");let g=p,y=Math.max(1,u?.maxAttempts??1),T=De(u?.backoff??(y>1?"exponential":void 0)),h=u?.shouldRetry??(()=>!0),b=d!==void 0||t<Number.POSITIVE_INFINITY||e>0,w=k=>i?`${i}::${k}`:void 0,v=U(void 0,{equals:()=>!1,name:w("sent")}),S=U(null,{name:w("failed")}),L=U(0,{name:w("inFlight")}),F=U(null,{name:w("errors")}),K=b?U(0,{name:w("buffered")}):void 0,G=o?U(!1,{name:w("paused")}):void 0,ie=0,Q=k=>{ie+=k,L.down([[E,ie]])},O=k=>{try{s?.(k)}catch{}try{F.down([[E,k]])}catch{}},q=new Set,J=k=>{q.add(k);let N=()=>q.delete(k);k.then(N,N)},I=(k,N,C)=>{let A=T?T(N-1,C,null):0,H=A==null?0:typeof A=="number"&&A>0?A:0,$=Math.max(1,Math.ceil(H/1e6));return new Promise(M=>{setTimeout(()=>M(k()),$)})},W=k=>k!=null&&typeof k=="object"&&typeof k.then=="function",V=k=>{let N;try{N=a?a(k):k}catch(M){let R=se(M);return O({stage:"serialize",error:R,value:k}),S.down([[E,{value:k,error:R,attempts:0}]]),Promise.resolve()}let C=0,A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k,attempt:C}),!(C<y&&h(R,C))){S.down([[E,{value:k,error:R,attempts:C}]]);return}return I($,C,R)},H=()=>{Q(-1),v.down([[E,k]])};function $(){C+=1,Q(1);let M;try{M=c(N,g)}catch(R){return A(R)??Promise.resolve()}return W(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return $()},te=o?.maxBuffer??Number.POSITIVE_INFINITY,X=new he(te),Y,ae=!1,me=()=>{K?.down([[E,X.length]])},ue=k=>{G&&G.down([[E,k]])},we=o?.strategy??"drop-oldest",Be=(k,N)=>{let C={value:k,payload:N};if(X.length<te)return X.push(C),me(),!0;if(we==="drop-oldest"){let H=X.shift();return X.push(C),me(),ue(!0),S.down([[E,{value:H.value,error:new Error("backpressure: buffer overflow \u2014 dropped oldest"),attempts:0}]]),!0}if(we==="drop-newest")return ue(!0),S.down([[E,{value:k,error:new Error("backpressure: buffer overflow \u2014 dropped newest"),attempts:0}]]),!1;let A=new Error("backpressure: buffer overflow");return O({stage:"send",error:A,value:k}),S.down([[E,{value:k,error:A,attempts:0}]]),ue(!0),!1},Fe=k=>{let N=0,C=k.map(M=>M.payload),A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k.map(ge=>ge.value),attempt:N}),!(N<y&&h(R,N))){for(let{value:ge}of k)S.down([[E,{value:ge,error:R,attempts:N}]]);return}return I($,N,R)},H=()=>{Q(-1);for(let{value:M}of k)v.down([[E,M]])};function $(){N+=1,Q(1);let M;try{M=d(C,g)}catch(R){return A(R)??Promise.resolve()}return W(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return $()},He=async k=>{for(let N of k)await ze(N.value,N.payload)},ze=(k,N)=>{let C=0,A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k,attempt:C}),!(C<y&&h(R,C))){S.down([[E,{value:k,error:R,attempts:C}]]);return}return I($,C,R)},H=()=>{Q(-1),v.down([[E,k]])};function $(){C+=1,Q(1);let M;try{M=c(N,g)}catch(R){return A(R)??Promise.resolve()}return W(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return $()},ne=()=>{if(ae||X.length===0)return Promise.resolve();let k=X.drain();if(me(),ue(!1),d!==void 0){let C=Fe(k);return J(C),C}let N=He(k);return J(N),N},qe=()=>{Y!==void 0||ae||e<=0||(Y=setTimeout(()=>{Y=void 0,ne()},e))},Ue=r.subscribe(k=>{for(let N of k){let C=N[0];if(C!==E)try{m?.(N)}catch{}if(C===E){let A=N[1];if(b){let H;if(a)try{H=a(A)}catch(M){let R=se(M);O({stage:"serialize",error:R,value:A}),S.down([[E,{value:A,error:R,attempts:0}]]);continue}else H=A;if(!Be(A,H))continue;X.length>=t?ne():qe()}else{let H=V(A);J(H)}}else ee.messageTier(C)>=3&&b&&(Y!==void 0&&(clearTimeout(Y),Y=void 0),ne())}}),Se;if(l){let k=!1;Se=l.subscribe(N=>{if(!k){k=!0;return}N.length>0&&!Te&&Ee()})}let Te=!1,Ee=()=>{if(Te)return;Te=!0,Y!==void 0&&(clearTimeout(Y),Y=void 0),b&&ne(),ae=!0,Se?.(),Ue();let k=N=>{try{N.down([[le]])}catch{}};k(F),k(S),k(v),k(L),K&&k(K),G&&k(G);try{f?.()}catch{}},ce={dispose:Ee,sent:v,failed:S,inFlight:L,errors:F};return b&&(ce.buffered=K,ce.flush=async()=>{ae||(await ne(),await Promise.all(q))}),G&&(ce.paused=G),ce}function j(r){return{describeKind:"producer",...r}}function Ke(r,n){let{parse:i,closeOnTeardown:s=!1,...u}=n??{};return B(o=>{let t=!0,e,a=()=>{let T=e;e=void 0,T?.()},l=T=>{t&&(t=!1,o.down([T]),a())},m=(T,h=T)=>{if(t)try{let b=T!==null&&typeof T=="object"&&"data"in T?T.data:T,w=i?i(b,h):b;o.emit(w)}catch(b){l([x,b])}},f=T=>{l([x,T])},c=()=>{l([P])};if(typeof r=="function"){try{if(e=r(m,f,c),typeof e!="function")throw new Error("fromWebSocket register contract violation: register must return cleanup callable")}catch(T){l([x,T])}return()=>{t=!1,a()}}let d=r,p=T=>m(T,T),g=T=>f(T),y=()=>c();return d.addEventListener("message",p),d.addEventListener("error",g),d.addEventListener("close",y),e=()=>{d.removeEventListener("message",p),d.removeEventListener("error",g),d.removeEventListener("close",y),s&&d.close()},()=>{t=!1,a()}},j(u))}function Tr(r,n){return oe(r,n)}function We(r,n){let{method:i="GET",headers:s,body:u,transform:o=b=>b.json(),timeoutNs:t=30*1e9,signal:e,completeAfterFetch:a=!1,refetchOnSubscribe:l=!1,...m}=n??{},f=U(0,{name:`${m.name??"http"}/fetchCount`}),c=U(0,{name:`${m.name??"http"}/lastUpdated`}),d=U(!1,{name:`${m.name??"http"}/fetched`}),p=0,g=u!==void 0?typeof u=="string"?u:JSON.stringify(u):void 0,y=b=>{let w=new AbortController,v=!0;if(e?.aborted)return v=!1,b.down([[x,e.reason??new Error("Aborted")]]),()=>{};e?.addEventListener("abort",()=>w.abort(e.reason),{once:!0});let S=setTimeout(()=>w.abort(new Error("Request timeout")),Math.ceil(t/1e6));return fetch(r,{method:i,headers:s,body:g,signal:w.signal}).then(async L=>{if(clearTimeout(S),!v)return;if(!L.ok)throw new Error(`HTTP ${L.status}: ${L.statusText}`);let F=await o(L);v&&(_(()=>{p+=1,f.down([[E,p]]),c.down([[E,D()]]),d.down([[E,!0]]),b.emit(F)}),a&&b.down([[P]]))}).catch(L=>{clearTimeout(S),v&&(L&&L.name==="AbortError"||b.down([[x,L]]))}),()=>{v=!1,w.abort()}},T=B(b=>y({emit:w=>b.emit(w),down:w=>b.down(w)}),{...j(m),resubscribable:l});return{...Re(T),fetchCount:f,lastUpdated:c,fetched:d}}function gr(r,n,i){let{method:s="POST",headers:u={"Content-Type":"application/json"},serialize:o=p=>JSON.stringify(p),timeoutNs:t,batchFormat:e="json-array",batchSize:a,flushIntervalMs:l,retry:m,onTransportError:f}=i??{},c=async p=>{let g=t!==void 0?new AbortController:void 0,y;g&&t!==void 0&&(y=setTimeout(()=>g.abort(new Error("Request timeout")),Math.ceil(t/1e6)));try{let T=await fetch(n,{method:s,headers:u,body:p,signal:g?.signal}),h=async()=>{try{await T.arrayBuffer?.()}catch{}};if(!T.ok)throw await h(),new Error(`HTTP ${T.status}: ${T.statusText}`);await h()}finally{y!==void 0&&clearTimeout(y)}};return a!==void 0||l!==void 0?z(r,{onTransportError:f,retry:m,batchSize:a,flushIntervalMs:l,sendBatch:async p=>{let g;e==="ndjson"?g=p.map(y=>{let T=o(y);return typeof T=="string"?T:new TextDecoder().decode(T)}).join(`
1
+ import{b as Ne,i as Re}from"./chunk-FKRPIRE6.js";import{a as Pe}from"./chunk-SGS4OJGS.js";import{x as fe}from"./chunk-4F564IPP.js";import{a as Z,b as de,i as Oe}from"./chunk-4VVTGLXJ.js";import{f as pe}from"./chunk-T7EQPKOP.js";import{A as ee,D as be,E as U,F as B,m as _,p as D}from"./chunk-LYCLF26R.js";import{b as E,c as ye,d as ke,h as le,i as P,j as x}from"./chunk-CK2E7BTU.js";function Ce(r){return{describeKind:"producer",...r}}function oe(r,n){return B(i=>{let s=!0,u={emit(t){s&&i.emit(t)},error(t){s&&(s=!1,i.down([[x,t]]))},complete(){s&&(s=!1,i.down([[P]]))}},o;try{let t=r(u);o=typeof t=="function"?t:void 0}catch(t){return u.error(t),()=>{s=!1}}return()=>{s=!1;try{o?.()}catch{}}},Ce(n))}function Me(r,n,i){let s=!0,u,o=0,t=0,e={},a=[],l=()=>{let d=u;u=void 0;try{d?.()}catch{}};for(let d of n){let p=i?.name?`${i.name}::${d}`:d,g=i?.channelOpts?.[d],y=B(T=>(o++,()=>{t++,o>0&&t>=o&&t>=n.length&&l()}),Ce({...g,name:p}));e[d]=y,a.push(y)}let m={};for(let d of n)m[d]=p=>{s&&e[d].down([[E,p]])};m.error=d=>{s&&(s=!1,_(()=>{for(let p of a)p.down([[x,d]])}),l())},m.complete=()=>{s&&(s=!1,_(()=>{for(let d of a)d.down([[P]])}),l())};let f=r(m);return u=typeof f=="function"?f:void 0,Object.assign(e,{dispose:()=>{s&&(s=!1,_(()=>{for(let d of a)try{d.down([[P]])}catch{}}),l())}})}var he=class{ring;arr;constructor(n){n===Number.POSITIVE_INFINITY||n<=0?(this.arr=[],this.ring=null):(this.ring=new Pe(n),this.arr=null)}get length(){return this.ring!=null?this.ring.size:this.arr.length}push(n){this.ring!=null?this.ring.push(n):this.arr.push(n)}shift(){return this.ring!=null?this.ring.shift():this.arr.shift()}drain(){if(this.ring!=null){let i=this.ring.toArray();return this.ring.clear(),i}let n=this.arr;return this.arr=[],n}};function se(r){return r instanceof Error?r:new Error(String(r))}function De(r){return r===void 0?null:typeof r=="string"?Oe(r):r}function z(r,n){let{name:i,onTransportError:s,retry:u,backpressure:o,batchSize:t=Number.POSITIVE_INFINITY,flushIntervalMs:e=0,serialize:a,stopOn:l,onUpstreamMessage:m,onDispose:f,send:c,sendBatch:d,ctx:p}=n;if(!c&&!d)throw new Error("reactiveSink: `send` or `sendBatch` must be provided");let g=p,y=Math.max(1,u?.maxAttempts??1),T=De(u?.backoff??(y>1?"exponential":void 0)),h=u?.shouldRetry??(()=>!0),b=d!==void 0||t<Number.POSITIVE_INFINITY||e>0,w=k=>i?`${i}::${k}`:void 0,v=U(void 0,{equals:()=>!1,name:w("sent")}),S=U(null,{name:w("failed")}),L=U(0,{name:w("inFlight")}),F=U(null,{name:w("errors")}),K=b?U(0,{name:w("buffered")}):void 0,G=o?U(!1,{name:w("paused")}):void 0,ie=0,Q=k=>{ie+=k,L.down([[E,ie]])},O=k=>{try{s?.(k)}catch{}try{F.down([[E,k]])}catch{}},q=new Set,J=k=>{q.add(k);let N=()=>q.delete(k);k.then(N,N)},I=(k,N,C)=>{let A=T?T(N-1,C,null):0,H=A==null?0:typeof A=="number"&&A>0?A:0,$=Math.max(1,Math.ceil(H/1e6));return new Promise(M=>{setTimeout(()=>M(k()),$)})},W=k=>k!=null&&typeof k=="object"&&typeof k.then=="function",V=k=>{let N;try{N=a?a(k):k}catch(M){let R=se(M);return O({stage:"serialize",error:R,value:k}),S.down([[E,{value:k,error:R,attempts:0}]]),Promise.resolve()}let C=0,A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k,attempt:C}),!(C<y&&h(R,C))){S.down([[E,{value:k,error:R,attempts:C}]]);return}return I($,C,R)},H=()=>{Q(-1),v.down([[E,k]])};function $(){C+=1,Q(1);let M;try{M=c(N,g)}catch(R){return A(R)??Promise.resolve()}return W(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return $()},te=o?.maxBuffer??Number.POSITIVE_INFINITY,X=new he(te),Y,ae=!1,me=()=>{K?.down([[E,X.length]])},ue=k=>{G&&G.down([[E,k]])},we=o?.strategy??"drop-oldest",Be=(k,N)=>{let C={value:k,payload:N};if(X.length<te)return X.push(C),me(),!0;if(we==="drop-oldest"){let H=X.shift();return X.push(C),me(),ue(!0),S.down([[E,{value:H.value,error:new Error("backpressure: buffer overflow \u2014 dropped oldest"),attempts:0}]]),!0}if(we==="drop-newest")return ue(!0),S.down([[E,{value:k,error:new Error("backpressure: buffer overflow \u2014 dropped newest"),attempts:0}]]),!1;let A=new Error("backpressure: buffer overflow");return O({stage:"send",error:A,value:k}),S.down([[E,{value:k,error:A,attempts:0}]]),ue(!0),!1},Fe=k=>{let N=0,C=k.map(M=>M.payload),A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k.map(ge=>ge.value),attempt:N}),!(N<y&&h(R,N))){for(let{value:ge}of k)S.down([[E,{value:ge,error:R,attempts:N}]]);return}return I($,N,R)},H=()=>{Q(-1);for(let{value:M}of k)v.down([[E,M]])};function $(){N+=1,Q(1);let M;try{M=d(C,g)}catch(R){return A(R)??Promise.resolve()}return W(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return $()},He=async k=>{for(let N of k)await ze(N.value,N.payload)},ze=(k,N)=>{let C=0,A=M=>{Q(-1);let R=se(M);if(O({stage:"send",error:R,value:k,attempt:C}),!(C<y&&h(R,C))){S.down([[E,{value:k,error:R,attempts:C}]]);return}return I($,C,R)},H=()=>{Q(-1),v.down([[E,k]])};function $(){C+=1,Q(1);let M;try{M=c(N,g)}catch(R){return A(R)??Promise.resolve()}return W(M)?M.then(H,R=>A(R)):(H(),Promise.resolve())}return $()},ne=()=>{if(ae||X.length===0)return Promise.resolve();let k=X.drain();if(me(),ue(!1),d!==void 0){let C=Fe(k);return J(C),C}let N=He(k);return J(N),N},qe=()=>{Y!==void 0||ae||e<=0||(Y=setTimeout(()=>{Y=void 0,ne()},e))},Ue=r.subscribe(k=>{for(let N of k){let C=N[0];if(C!==E)try{m?.(N)}catch{}if(C===E){let A=N[1];if(b){let H;if(a)try{H=a(A)}catch(M){let R=se(M);O({stage:"serialize",error:R,value:A}),S.down([[E,{value:A,error:R,attempts:0}]]);continue}else H=A;if(!Be(A,H))continue;X.length>=t?ne():qe()}else{let H=V(A);J(H)}}else ee.messageTier(C)>=3&&b&&(Y!==void 0&&(clearTimeout(Y),Y=void 0),ne())}}),Se;if(l){let k=!1;Se=l.subscribe(N=>{if(!k){k=!0;return}N.length>0&&!Te&&Ee()})}let Te=!1,Ee=()=>{if(Te)return;Te=!0,Y!==void 0&&(clearTimeout(Y),Y=void 0),b&&ne(),ae=!0,Se?.(),Ue();let k=N=>{try{N.down([[le]])}catch{}};k(F),k(S),k(v),k(L),K&&k(K),G&&k(G);try{f?.()}catch{}},ce={dispose:Ee,sent:v,failed:S,inFlight:L,errors:F};return b&&(ce.buffered=K,ce.flush=async()=>{ae||(await ne(),await Promise.all(q))}),G&&(ce.paused=G),ce}function j(r){return{describeKind:"producer",...r}}function Ke(r,n){let{parse:i,closeOnTeardown:s=!1,...u}=n??{};return B(o=>{let t=!0,e,a=()=>{let T=e;e=void 0,T?.()},l=T=>{t&&(t=!1,o.down([T]),a())},m=(T,h=T)=>{if(t)try{let b=T!==null&&typeof T=="object"&&"data"in T?T.data:T,w=i?i(b,h):b;o.emit(w)}catch(b){l([x,b])}},f=T=>{l([x,T])},c=()=>{l([P])};if(typeof r=="function"){try{if(e=r(m,f,c),typeof e!="function")throw new Error("fromWebSocket register contract violation: register must return cleanup callable")}catch(T){l([x,T])}return()=>{t=!1,a()}}let d=r,p=T=>m(T,T),g=T=>f(T),y=()=>c();return d.addEventListener("message",p),d.addEventListener("error",g),d.addEventListener("close",y),e=()=>{d.removeEventListener("message",p),d.removeEventListener("error",g),d.removeEventListener("close",y),s&&d.close()},()=>{t=!1,a()}},j(u))}function Tr(r,n){return oe(r,n)}function We(r,n){let{method:i="GET",headers:s,body:u,transform:o=b=>b.json(),timeoutNs:t=30*1e9,signal:e,completeAfterFetch:a=!1,refetchOnSubscribe:l=!1,...m}=n??{},f=U(0,{name:`${m.name??"http"}/fetchCount`}),c=U(0,{name:`${m.name??"http"}/lastUpdated`}),d=U(!1,{name:`${m.name??"http"}/fetched`}),p=0,g=u!==void 0?typeof u=="string"?u:JSON.stringify(u):void 0,y=b=>{let w=new AbortController,v=!0;if(e?.aborted)return v=!1,b.down([[x,e.reason??new Error("Aborted")]]),()=>{};e?.addEventListener("abort",()=>w.abort(e.reason),{once:!0});let S=setTimeout(()=>w.abort(new Error("Request timeout")),Math.ceil(t/1e6));return fetch(r,{method:i,headers:s,body:g,signal:w.signal}).then(async L=>{if(clearTimeout(S),!v)return;if(!L.ok)throw new Error(`HTTP ${L.status}: ${L.statusText}`);let F=await o(L);v&&(_(()=>{p+=1,f.down([[E,p]]),c.down([[E,D()]]),d.down([[E,!0]]),b.emit(F)}),a&&b.down([[P]]))}).catch(L=>{clearTimeout(S),v&&(L&&L.name==="AbortError"||b.down([[x,L]]))}),()=>{v=!1,w.abort()}},T=B(b=>y({emit:w=>b.emit(w),down:w=>b.down(w)}),{...j(m),resubscribable:l});return{...Re(T),fetchCount:f,lastUpdated:c,fetched:d}}function gr(r,n,i){let{method:s="POST",headers:u={"Content-Type":"application/json"},serialize:o=p=>JSON.stringify(p),timeoutNs:t,batchFormat:e="json-array",batchSize:a,flushIntervalMs:l,retry:m,onTransportError:f}=i??{},c=async p=>{let g=t!==void 0?new AbortController:void 0,y;g&&t!==void 0&&(y=setTimeout(()=>g.abort(new Error("Request timeout")),Math.ceil(t/1e6)));try{let T=await fetch(n,{method:s,headers:u,body:p,signal:g?.signal}),h=async()=>{try{await T.arrayBuffer?.()}catch{}};if(!T.ok)throw await h(),new Error(`HTTP ${T.status}: ${T.statusText}`);await h()}finally{y!==void 0&&clearTimeout(y)}};return a!==void 0||l!==void 0?z(r,{onTransportError:f,retry:m,batchSize:a,flushIntervalMs:l,sendBatch:async p=>{let g;e==="ndjson"?g=p.map(y=>{let T=o(y);return typeof T=="string"?T:new TextDecoder().decode(T)}).join(`
2
2
  `):g=JSON.stringify(p),await c(g)}}):z(r,{onTransportError:f,retry:m,serialize:o,send:async p=>{await c(p)}})}function Ae(r){return Symbol.keyFor(r)??r.description??"message"}function re(r,n){return typeof r=="string"?r:n(r)}function Le(r,n){let i=`event: ${r}
3
3
  `;if(n!==void 0){let s=n.split(/\r?\n/);for(let u of s)i+=`data: ${u}
4
4
  `}return`${i}
@@ -0,0 +1 @@
1
+ import{a as Y,b,c as M,d as S,e as R,f as N,g as L,h as k,i as C,j as _,k as P,l as he,n as se,q as ie,r as fe,s as pe,t as _e,u as re}from"./chunk-CK2E7BTU.js";var Ce={name:"json",version:1,contentType:"application/json",encode(n){let e=JSON.stringify(n);return new TextEncoder().encode(e)},decode(n,e){let t=new TextDecoder().decode(n);return JSON.parse(t)}};function $e(n){return{name:"dag-cbor",version:1,contentType:"application/dag-cbor",encode:e=>n.encode(e),decode:(e,t)=>n.decode(e)}}function je(n,e){return{name:"dag-cbor-zstd",version:1,contentType:"application/dag-cbor+zstd",encode:t=>e.compressSync(n.encode(t)),decode:(t,s)=>n.decode(e.decompressSync(t))}}var oe=1,ge=4;function ze(n,e){let t=new TextEncoder().encode(n.name);if(t.length===0||t.length>255)throw new Error(`encodeEnvelope: codec name "${n.name}" encodes to ${t.length} bytes (must be 1\u2013255)`);let s=n.version;if(!Number.isInteger(s)||s<0||s>65535)throw new Error(`encodeEnvelope: codec.version ${s} out of u16 range (expected integer 0\u201365535)`);let i=2+t.length+2+e.length;if(i>4294967295)throw new Error(`encodeEnvelope: total envelope size ${i} exceeds 2^32-1 bytes (payload ${e.length} bytes)`);let r=new Uint8Array(i),a=0;return r[a++]=oe,r[a++]=t.length,r.set(t,a),a+=t.length,r[a++]=s>>>8&255,r[a++]=s&255,r.set(e,a),r}function qe(n,e){if(n.length<ge)throw new Error(`decodeEnvelope: bytes too short (${n.length} < ${ge})`);let t=0,s=n[t++];if(s!==oe)throw new Error(`decodeEnvelope: unsupported envelope version ${s} (expected ${oe})`);let i=n[t++];if(i===0)throw new Error("decodeEnvelope: name_len must be >= 1");if(t+i+2>n.length)throw new Error(`decodeEnvelope: envelope truncated (need ${t+i+2} bytes, have ${n.length})`);let r=new TextDecoder().decode(n.subarray(t,t+i));t+=i;let a=(n[t]<<8|n[t+1])>>>0;t+=2;let o=n.subarray(t),d=e.lookupCodec(r);if(d==null)throw new Error(`decodeEnvelope: codec "${r}" not registered (envelope codec_v=${a})`);return{codec:d,codecVersion:a,payload:o}}function ye(n){n.registerCodec(Ce)}function Ke(n){if(n.length===0)throw new Error("WAL is empty \u2014 need at least one full snapshot");let e=n[0];if(e.mode!=="full")throw new Error("WAL must start with a full record carrying a baseline snapshot");let t=JSON.parse(JSON.stringify(e.snapshot)),s=e.seq;for(let i=1;i<n.length;i++){let r=n[i];if(r.seq<=s)throw new Error(`WAL chain broken at index ${i}: seq=${r.seq} must exceed prev seq=${s}`);if(r.mode==="full"){t=JSON.parse(JSON.stringify(r.snapshot)),s=r.seq;continue}let a=r.diff;for(let d of a.nodesRemoved)delete t.nodes[d];let o=a.nodesAddedFull;if(o!=null)for(let[d,l]of Object.entries(o))t.nodes[d]=JSON.parse(JSON.stringify(l));for(let d of a.nodesChanged){let l=t.nodes[d.path];l!=null&&(l[d.field]=d.to)}s=r.seq}return t}var De={type:"system",id:""};function J(n){if(n==null)return De;let{type:e,id:t,...s}=n;return{type:e??"system",id:t??"",...s}}var D=0,U=!1,A=[],E=[],O=[],W=[];function me(){return D>0||U}function be(){return D>0}function ve(n){D>0?W.push(n):n()}function Xe(n){D+=1;let e=!1;try{n()}catch(t){throw e=!0,t}finally{if(D-=1,D===0)if(e){if(!U){let t=W.splice(0);for(let s of t)try{s()}catch{}A.length=0,E.length=0,O.length=0}}else Oe()}}function Oe(){let n=!U;n&&(U=!0);let e=[],t=0;try{for(;A.length>0||E.length>0||O.length>0||n&&W.length>0;){if(n&&W.length>0){let r=W.splice(0);for(let a of r)try{a()}catch(o){e.push(o)}continue}if(t+=1,t>1e3)throw A.length=0,E.length=0,O.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let i=(A.length>0?A:E.length>0?E:O).splice(0);for(let r of i)try{r()}catch(a){e.push(a)}}}finally{n&&(U=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function X(n,e,t){if(e.length===0)return;if(e.length===1){let l=t(e[0][0]);if(l<3||!me()){n(e);return}(l>=5?O:l===4?E:A).push(()=>n(e));return}let s=e.length,i=s,r=s,a=s,o=0;for(;o<s&&t(e[o][0])<3;)o++;for(i=o;o<s&&t(e[o][0])===3;)o++;for(r=o;o<s&&t(e[o][0])===4;)o++;a=o;let d=me();if(i>0){let l=e.slice(0,i);n(l)}if(r>i){let l=e.slice(i,r);d?A.push(()=>n(l)):n(l)}if(a>r){let l=e.slice(r,a);d?E.push(()=>n(l)):n(l)}if(s>a){let l=e.slice(a,s);d?O.push(()=>n(l)):n(l)}}function Qe(){return Math.trunc(performance.now()*1e6)}function we(){return Date.now()*1e6}var Z=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=t=>{let s=this._messageTypes.get(t);return s!=null?s.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,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.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.")}};function xe(n){n.registerMessageType(Y,{tier:0,wireCrossing:!1}),n.registerMessageType(M,{tier:1,wireCrossing:!1}),n.registerMessageType(R,{tier:1,wireCrossing:!1,metaPassthrough:!1}),n.registerMessageType(N,{tier:2,wireCrossing:!1}),n.registerMessageType(L,{tier:2,wireCrossing:!1}),n.registerMessageType(b,{tier:3,wireCrossing:!0}),n.registerMessageType(S,{tier:3,wireCrossing:!0}),n.registerMessageType(C,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(_,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(k,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var F=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`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(n){return Array.isArray(n)?[...n]:[n]}function Fe(n,e){return n.has(e)||n.has("*")}function Ge(n){let e=[];return n((i,r)=>{e.push({kind:"allow",actions:new Set(Te(i)),where:r?.where??(()=>!0)})},(i,r)=>{e.push({kind:"deny",actions:new Set(Te(i)),where:r?.where??(()=>!0)})}),(i,r)=>{let a=!1,o=!1;for(let d of e)Fe(d.actions,r)&&d.where(i)&&(d.kind==="deny"?a=!0:o=!0);return a?!1:o}}function st(n){return Ge((e,t)=>{for(let s of n){let i=s.actorType==null?null:new Set(Array.isArray(s.actorType)?s.actorType:[s.actorType]),r=s.actorId==null?null:new Set(Array.isArray(s.actorId)?s.actorId:[s.actorId]),a=Object.entries(s.claims??{}),o=d=>{if(i!==null&&!i.has(String(d.type))||r!==null&&!r.has(String(d.id??"")))return!1;for(let[l,c]of a)if(d[l]!==c)return!1;return!0};s.effect==="deny"?t(s.action,{where:o}):e(s.action,{where:o})}})}var Ie=["human","llm","wallet","system"];function it(n){let e=Ie.filter(t=>n({type:t,id:""},"write"));return e.length===0?"restricted":e.includes("human")&&e.includes("llm")&&e.every(t=>t==="human"||t==="llm"||t==="system")?"both":e.length===1?e[0]:e.join("+")}function ae(n){if(n===void 0)return null;if(typeof n=="number"){if(!Number.isFinite(n))throw new TypeError(`Cannot hash non-finite number: ${n}`);if(Number.isInteger(n)&&!Number.isSafeInteger(n))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${n}. Cross-language cid parity is not guaranteed for unsafe integers.`);return n}if(typeof n=="string"||typeof n=="boolean"||n===null)return n;if(Array.isArray(n))return n.map(ae);if(typeof n=="object"&&n!==null){let e={};for(let t of Object.keys(n).sort())e[t]=ae(n[t]);return e}return null}var He=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]),Ve=new TextEncoder;function Le(n){let e=Ve.encode(n),t=e.length,s=t*8,i=t+9+63&-64,r=new Uint8Array(i);r.set(e),r[t]=128;let a=new DataView(r.buffer);a.setUint32(i-4,s>>>0,!1),a.setUint32(i-8,Math.floor(s/4294967296)>>>0,!1);let o=1779033703,d=3144134277,l=1013904242,c=2773480762,h=1359893119,p=2600822924,u=528734635,g=1541459225,T=new Uint32Array(64),m=(w,y)=>w>>>y|w<<32-y;for(let w=0;w<i;w+=64){for(let f=0;f<16;f++)T[f]=a.getUint32(w+f*4,!1);for(let f=16;f<64;f++){let H=T[f-15],V=T[f-2],K=m(H,7)^m(H,18)^H>>>3,ne=m(V,17)^m(V,19)^V>>>10;T[f]=T[f-16]+K+T[f-7]+ne>>>0}let y=o,G=d,I=l,ee=c,x=h,z=p,q=u,te=g;for(let f=0;f<64;f++){let H=m(x,6)^m(x,11)^m(x,25),V=x&z^~x&q,K=te+H+V+He[f]+T[f]>>>0,ne=m(y,2)^m(y,13)^m(y,22),Se=y&G^y&I^G&I,Re=ne+Se>>>0;te=q,q=z,z=x,x=ee+K>>>0,ee=I,I=G,G=y,y=K+Re>>>0}o=o+y>>>0,d=d+G>>>0,l=l+I>>>0,c=c+ee>>>0,h=h+x>>>0,p=p+z>>>0,u=u+q>>>0,g=g+te>>>0}let v=w=>w.toString(16).padStart(8,"0");return v(o)+v(d)+v(l)+v(c)+v(h)+v(p)+v(u)+v(g)}function de(n){let e=ae(n??null),t=JSON.stringify(e);return Le(t).slice(0,16)}function Pe(){let n=globalThis.crypto;if(n?.randomUUID)return n.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function le(n,e,t){let s=t?.id??Pe();if(n===0)return{id:s,version:0};let r=(t?.hash??de)(e);return{id:s,version:0,cid:r,prev:null}}function Ne(n,e,t){n.version+=1,"cid"in n&&(n.prev=n.cid,n.cid=t(e))}function ot(n){return"cid"in n}var ke=()=>{},Ae=100;function Ee(n){return{node:n,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function ce(n){n.prevData=void 0,n.dirty=!1,n.involvedThisWave=!1,n.dataBatch.length=0,n.terminal=void 0}function Q(n){return n.length===0?n:typeof n[0]=="symbol"?[n]:n}var Ue=(n,e,t,s)=>{t.direction==="down-in"&&n._onDepMessage(t.depIndex,e)},We=(n,e,t,s)=>{let i=n;if(i._status==="completed"||i._status==="errored")return;let r=i._cached,a=r===void 0?[se]:[se,[b,r]];i._status==="dirty"&&a.push(P),X(e,a,i._config.tierOf)},B=new Z({onMessage:Ue,onSubscribe:We});xe(B);ye(B);function gt(n){if(B._isFrozen())throw new Error("configure() called after a node was created \u2014 the default GraphReFlyConfig is frozen. Call configure(...) at application startup, before any node factories run.");n(B)}var $=class n{_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,t,s){this._config=s.config??B,this._config.onMessage,this._optsName=s.name,this._describeKind=s.describeKind,this._equals=s.equals??Object.is,this._resubscribable=s.resubscribable??!1,this._resetOnTeardown=s.resetOnTeardown??!1,this._autoComplete=s.completeWhenDepsComplete??!0,this._autoError=s.errorWhenDepsError??!0,this._pausable=s.pausable??!0,this._guard=s.guard,this._fn=t,this._partial=s.partial??!1,this._cached=s.initial!==void 0?s.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=s.versioningHash??this._config.defaultHashFn??de;let i=s.versioning??this._config.defaultVersioning;this._versioningLevel=i,this._versioning=i!=null?le(i,this._cached===void 0?void 0:this._cached,{id:s.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(Ee);let r={};for(let[o,d]of Object.entries(s.meta??{})){let l={initial:d,name:`${s.name??"node"}:meta:${o}`,describeKind:"state",config:this._config};s.guard!=null&&(l.guard=s.guard),r[o]=new n([],void 0,l)}Object.freeze(r),this.meta=r,this._hasMeta=Object.keys(r).length>0;let a=this;this._actions={emit(o){a._emit([[b,o]])},down(o){a._emit(Q(o))},up(o){a._emitUp(Q(o))}},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,t){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 s=this._versioningLevel;if(s!=null&&e<=s)return;let i=t?.hash??this._hashFn;i!==this._hashFn&&(this._hashFn=i);let r=this._cached===void 0?void 0:this._cached,a=this._versioning,o=a?.id??t?.id,d=a?.version??0,l=le(e,r,{id:o,hash:i});l.version=d,this._versioning=l,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 t=J(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,s=e?.actor!=null;if(!t&&!s)return;let i=J(e?.actor),r=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(i,r))throw new F({actor:i,action:r,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(i,r))throw new F({actor:i,action:r,nodeName:this.name})}this._lastMutation={actor:i,timestamp_ns:we()}}down(e,t){let s=Q(e);s.length!==0&&(this._checkGuard(t),this._emit(s))}emit(e,t){this._checkGuard(t),this._emit([[b,e]])}up(e,t){if(this._deps.length===0)return;let s=Q(e);if(s.length===0)return;this._checkGuard(t);let i=t??{internal:!0};this._validateUpTiers(s);for(let r of this._deps)r.node.up?.(s,i)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let s of e){let i=t(s[0]);if(i===3||i===4)throw new Error(`Node "${this.name}": tier-${i} 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,t){if(t!=null&&this._guard!=null){let d=J(t);if(!this._guard(d,"observe"))throw new F({actor:d,action:"observe",nodeName:this.name})}let i=this._isTerminal&&this._resubscribable;if(i){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 d of this._deps)ce(d);if(this._partial===!1){for(let d of this._deps)if(d.prevData!==void 0||d.dataBatch.length!==0||d.terminal!==void 0||d.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let r;try{r=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:i},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof r=="function")try{r()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let o=!1;return()=>{o||(o=!0,this._sinkCount-=1,this._removeSink(e),typeof r=="function"&&r(),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[t]=this._sinks;this._sinks=t}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,t=0;try{for(let s=0;s<e;s++){let i=s,r=this._deps[s];r.unsub=ke,r.unsub=r.node.subscribe(a=>{if(r.unsub===null)return;let o=this._config.tierOf,d=!1;for(let l of a)o(l[0])>=3&&(d=!0),this._config.onMessage(this,l,{direction:"down-in",depIndex:i},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(s){this._deps[t].unsub=null;for(let i=0;i<t;i++){let r=this._deps[i];if(r.unsub!=null){let a=r.unsub;r.unsub=null;try{a()}catch{}ce(r)}}throw this._dirtyDepCount=0,s}}_addDep(e){for(let i=0;i<this._deps.length;i++)if(this._deps[i].node===e)return i;let t=this._deps.length,s=Ee(e);if(this._deps.push(s),this._sinks==null)return t;s.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(ie),s.unsub=ke;try{s.unsub=e.subscribe(i=>{if(s.unsub===null)return;let r=this._config.tierOf,a=!1;for(let o of i)r(o[0])>=3&&(a=!0),this._config.onMessage(this,o,{direction:"down-in",depIndex:t},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(i){throw s.unsub=null,this._deps.pop(),this._dirtyDepCount--,i}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(s){this._emit([[_,this._wrapFnError("cleanup threw",s)]])}else if(t!=null&&typeof t=="object"){let s=t.deactivate;if(typeof s=="function")try{s()}catch(i){this._emit([[_,this._wrapFnError("cleanup.deactivate threw",i)]])}}for(let s of this._deps){if(s.unsub!=null){let i=s.unsub;s.unsub=null;try{i()}catch{}}ce(s)}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,t){let s=this._deps[e],i=t[0];if(this._inspectorHooks!=null){let r={kind:"dep_message",depIndex:e,message:t};for(let a of this._inspectorHooks)a(r)}if(i!==Y){if(i===M){this._depDirtied(s);return}if(i===R){if(this._depInvalidated(s),this._cached===void 0)return;this._emit(pe);return}if(i===N||i===L){this._emit([t]);return}if(i===k){this._emit(re);return}if(i===b)this._depSettledAsData(s,t[1]);else if(i===S)this._depSettledAsResolved(s);else if(i===C)this._depSettledAsTerminal(s,!0);else if(i===_)this._depSettledAsTerminal(s,t[1]);else{this._emit([t]);return}if(!this._fn){(i===b||i===S)&&this._emit([t]),(i===C||i===_)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(ie))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,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 t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(fe),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[_,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(_e)}_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(a){this._emit([[_,this._wrapFnError("cleanup threw",a)]]);return}}else if(e!=null&&typeof e=="object"){let a=e.beforeRun;if(typeof a=="function"){e.beforeRun=void 0;try{a()}catch(o){this._emit([[_,this._wrapFnError("cleanup.beforeRun threw",o)]]);return}}}let t=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),s=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let o=t[a];o!=null&&o.length>0&&(this._deps[a].prevData=o[o.length-1])}let i=this._deps.map(a=>a.terminal),r={prevData:s,terminalDeps:i,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:t,prevData:s};for(let o of this._inspectorHooks)o(a)}this._isExecutingFn=!0;try{let a=this._fn(t,this._actions,r);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let o=a;(typeof o.beforeRun=="function"||typeof o.deactivate=="function"||typeof o.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[_,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Ae?(this._rerunDepth=0,this._emit([[_,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Ae} \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,t){let s=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${s}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[P,e[0]]:e;let s=!0,i=!1,r=!1,a=-1;for(let d of e){let l=t(d[0]);l<a&&(s=!1),l===3&&(i=!0),d[0]===M&&(r=!0),a=l}let o=e;if(!s){let d=e.map((l,c)=>({m:l,i:c,tier:t(l[0])}));d.sort((l,c)=>l.tier-c.tier||l.i-c.i),o=d.map(l=>l.m)}if(i&&!r&&this._status!=="dirty"){let d=0;for(;d<o.length&&t(o[d][0])===0;)d++;return d===0?[P,...o]:[...o.slice(0,d),P,...o.slice(d)]}return o}_emit(e){if(e.length===0)return;for(let o=0;o<e.length;o++){let d=e[o];if(d[0]===_&&d[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 t=e;if(this._isTerminal&&!this._resubscribable){let o=e.filter(d=>d[0]===k||d[0]===R);if(o.length===0)return;t=o}t=this._frameBatch(t);let i=null;for(let o=0;o<t.length;o++){let d=t[o],l=d[0];if(l!==N&&l!==L){i?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${l===N?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let h=d[1];if(l===N)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(h),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(h))c=!1;else if(this._pauseLocks.delete(h),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())}}c?i?.push(d):i==null&&(i=t.slice(0,o))}if(i!=null){if(i.length===0)return;t=i}if(this._hasMeta&&t.some(o=>o[0]===k))for(let o of Object.keys(this.meta))try{this.meta[o]._emit(re)}catch{}let{finalMessages:r,equalsError:a}=this._updateState(t);if(r.length>0&&this._config.inspectorEnabled){let o=this._config.globalInspector;if(o!=null)try{o({kind:"emit",node:this,messages:r})}catch{}}if(r.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let o=this._config.tierOf,d=[];for(let l of r)o(l[0])===3?this._pauseBuffer.push(l):d.push(l);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(r);a!=null&&this._emit([[_,a]])}_updateState(e){let t=this._config.tierOf,s,i,r=-1,a=0;for(let c of e)t(c[0])===3&&a++;let o=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===b){d=c;break}}for(let c=0;c<e.length;c++){let h=e[c],p=h[0];if(p===b){if(h.length>=2){let u=!1;if(o&&this._cached!==void 0)try{u=this._equals(this._cached,h[1])}catch(g){i=this._wrapFnError("equals threw",g),r=c;break}if(u){s==null&&(s=e.slice(0,c)),s.push(he),this._status="resolved";continue}this._cached=h[1],this._versioning!=null&&(d<0||c===d)&&Ne(this._versioning,h[1],this._hashFn)}this._status="settled",s?.push(h)}else if(s?.push(h),p===M)this._status="dirty";else if(p===S)this._status="resolved";else if(p===C){this._status="completed";{let u=this._config.rigorRecorder;if(u!=null)try{u.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===_){this._status="errored";{let u=this._config.rigorRecorder;if(u!=null)try{u.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===R){if(this._cached!==void 0){let g=this._config.rigorRecorder;if(g!=null)try{g.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let u=this._cleanup;if(typeof u=="function"){this._cleanup=void 0;try{u()}catch{}}else if(u!=null&&typeof u=="object"){let g=u.invalidate;if(typeof g=="function")try{g()}catch{}}}else p===k&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let l=r>=0?s??e.slice(0,r):s??e;return i!=null?{finalMessages:l,equalsError:i}:{finalMessages:l}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let s of t)s(e)};_dispatchOrAccumulate(e){if(be()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ve(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}X(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);X(this._deliverToSinks,t,this._config.tierOf)}},Me=n=>Array.isArray(n),ue=n=>typeof n=="object"&&n!=null&&!Array.isArray(n);function j(n,e,t){let s=Me(n)?n:[],i=typeof n=="function"?n:typeof e=="function"?e:void 0,r={};return Me(n)?r=(ue(e)?e:t)??{}:ue(n)?r=n:r=(ue(e)?e:t)??{},new $(s,i,r)}function bt(n,e){return j([],{...e,initial:n})}function vt(n,e){return j((s,i,r)=>n(i,r)??void 0,{describeKind:"producer",...e})}function Be(n,e,t){return j(n,(i,r,a)=>{let o=i.map((d,l)=>d!=null&&d.length>0?d.at(-1):a.prevData[l]);r.emit(e(o,a))},{describeKind:"derived",...t})}function wt(n,e,t){return j(n,(i,r,a)=>{let o=i.map((d,l)=>d!=null&&d.length>0?d.at(-1):a.prevData[l]);return e(o,r,a)??void 0},{describeKind:"effect",...t})}function xt(n,e,t){let s=new Map;return n.forEach((i,r)=>{s.set(i,r)}),Be(n,(i,r)=>e(o=>{let d=s.get(o);if(d==null)throw new Error(`dynamicNode: untracked dep "${o.name??"<unnamed>"}"`);return i[d]},r),t)}function Tt(n,e){let t,s=new Map,i=(r,a,o)=>{let d=!1,l=c=>{let h=s.get(c);if(h!==void 0){if(h<r.length){let u=r[h];return u!=null&&u.length>0?u.at(-1):o.prevData[h]}return c.cache}d=!0;let p=t._addDep(c);return s.set(c,p),c.cache};try{let c=n(l,o);d||(a.emit(c),o.store.__autoTrackLastDiscoveryError!=null&&delete o.store.__autoTrackLastDiscoveryError)}catch(c){if(!d)throw c;o.store.__autoTrackLastDiscoveryError=c}};return t=new $([],i,{describeKind:"derived",...e}),t}function Nt(n,...e){let t=n;for(let s of e)t=s(t);return t}export{Ce as a,$e as b,je as c,oe as d,ze as e,qe as f,ye as g,Ke as h,De as i,J as j,me as k,ve as l,Xe as m,X as n,Qe as o,we as p,Z as q,xe as r,F as s,Ge as t,st as u,it as v,de as w,le as x,Ne as y,ot as z,B as A,gt as B,$ as C,j as D,bt as E,vt as F,Be as G,wt as H,xt as I,Tt as J,Nt as K};
@@ -1 +1 @@
1
- import{a as w}from"./chunk-N2KKISCE.js";import{A as b,B as F,C as H,D as G,E as k,F as B,G as Y,H as h,I as v,J as P,K as W,i as K,j,k as S,m as g,n as C,o as I,p as M,q as _,r as u,s as q,t as z,u as J,v as Q,w as L,x as m,y as x,z as V}from"./chunk-7AJKUA36.js";import{a as e,b as t,c as o,d as p,e as r,f as n,g as s,h as i,i as y,j as a,k as d,l as c,m as N,n as T,o as E,p as O,q as D,r as A,s as f,t as l,u as R}from"./chunk-CK2E7BTU.js";import{b as U}from"./chunk-QYADASLV.js";var X={};U(X,{COMPLETE:()=>y,COMPLETE_MSG:()=>E,COMPLETE_ONLY_BATCH:()=>l,DATA:()=>t,DEFAULT_ACTOR:()=>K,DIRTY:()=>o,DIRTY_MSG:()=>d,DIRTY_ONLY_BATCH:()=>D,ERROR:()=>a,GraphReFlyConfig:()=>_,GuardDenied:()=>q,INVALIDATE:()=>r,INVALIDATE_MSG:()=>N,INVALIDATE_ONLY_BATCH:()=>f,NodeImpl:()=>H,PAUSE:()=>n,RESOLVED:()=>p,RESOLVED_MSG:()=>c,RESOLVED_ONLY_BATCH:()=>A,RESUME:()=>s,START:()=>e,START_MSG:()=>T,TEARDOWN:()=>i,TEARDOWN_MSG:()=>O,TEARDOWN_ONLY_BATCH:()=>R,accessHintForGuard:()=>Q,advanceVersion:()=>x,autoTrackNode:()=>P,batch:()=>g,configure:()=>F,createVersioning:()=>m,defaultConfig:()=>b,defaultHash:()=>L,derived:()=>Y,downWithBatch:()=>C,dynamicNode:()=>v,effect:()=>h,isBatching:()=>S,isV1:()=>V,monotonicNs:()=>I,node:()=>G,normalizeActor:()=>j,pipe:()=>W,policy:()=>z,policyFromRules:()=>J,producer:()=>B,registerBuiltins:()=>u,resolveDescribeFields:()=>w,state:()=>k,wallClockNs:()=>M});export{X as a};
1
+ import{a as w}from"./chunk-533RQFF6.js";import{A as b,B as F,C as H,D as G,E as k,F as B,G as Y,H as h,I as v,J as P,K as W,i as K,j,k as g,m as S,n as C,o as I,p as M,q as _,r as u,s as q,t as z,u as J,v as Q,w as L,x as m,y as x,z as V}from"./chunk-LYCLF26R.js";import{a as e,b as t,c as o,d as p,e as r,f as n,g as s,h as i,i as y,j as a,k as d,l as c,m as N,n as T,o as E,p as O,q as D,r as A,s as R,t as f,u as l}from"./chunk-CK2E7BTU.js";import{b as U}from"./chunk-QYADASLV.js";var X={};U(X,{COMPLETE:()=>y,COMPLETE_MSG:()=>E,COMPLETE_ONLY_BATCH:()=>f,DATA:()=>t,DEFAULT_ACTOR:()=>K,DIRTY:()=>o,DIRTY_MSG:()=>d,DIRTY_ONLY_BATCH:()=>D,ERROR:()=>a,GraphReFlyConfig:()=>_,GuardDenied:()=>q,INVALIDATE:()=>r,INVALIDATE_MSG:()=>N,INVALIDATE_ONLY_BATCH:()=>R,NodeImpl:()=>H,PAUSE:()=>n,RESOLVED:()=>p,RESOLVED_MSG:()=>c,RESOLVED_ONLY_BATCH:()=>A,RESUME:()=>s,START:()=>e,START_MSG:()=>T,TEARDOWN:()=>i,TEARDOWN_MSG:()=>O,TEARDOWN_ONLY_BATCH:()=>l,accessHintForGuard:()=>Q,advanceVersion:()=>x,autoTrackNode:()=>P,batch:()=>S,configure:()=>F,createVersioning:()=>m,defaultConfig:()=>b,defaultHash:()=>L,derived:()=>Y,downWithBatch:()=>C,dynamicNode:()=>v,effect:()=>h,isBatching:()=>g,isV1:()=>V,monotonicNs:()=>I,node:()=>G,normalizeActor:()=>j,pipe:()=>W,policy:()=>z,policyFromRules:()=>J,producer:()=>B,registerBuiltins:()=>u,resolveDescribeFields:()=>w,state:()=>k,wallClockNs:()=>M});export{X as a};
@@ -1 +1 @@
1
- import{E as v,G as w,m as h}from"./chunk-7AJKUA36.js";import{b as m,c as V}from"./chunk-CK2E7BTU.js";function x(s,e){if(s===e)return 0;let r=typeof s;if(r===typeof e&&(r==="number"||r==="string"||r==="boolean"||r==="bigint")){let i=s,n=e;return i<n?-1:i>n?1:0}return String(s).localeCompare(String(e))}function k(s,e){let r=x(s[0],e[0]);return r!==0?r:x(s[1],e[1])}function g(s){return[s.secondary,s.primary]}function y(s,e){let r=g(e),o=0,i=s.length;for(;o<i;){let n=o+i>>1;k(r,g(s[n]))>0?o=n+1:i=n}return o}var b=class{_version=0;_buf=[];_byPrimary=new Map;get version(){return this._version}get size(){return this._buf.length}has(e){return this._byPrimary.has(e)}get(e){return this._byPrimary.get(e)?.value}upsert(e,r,o,i){let n=this._byPrimary.get(e),a={primary:e,secondary:r,value:o};if(n!==void 0&&i?.equals?.(n,a))return!1;if(n!==void 0){let p=y(this._buf,n);this._buf.splice(p,1)}let d=y(this._buf,a);return this._buf.splice(d,0,a),this._byPrimary.set(e,a),this._version+=1,n===void 0}upsertMany(e,r){let o=0;try{for(let i of e){let n=this._byPrimary.get(i.primary),a={primary:i.primary,secondary:i.secondary,value:i.value};if(n!==void 0&&r?.equals?.(n,a))continue;if(n!==void 0){let p=y(this._buf,n);this._buf.splice(p,1)}let d=y(this._buf,a);this._buf.splice(d,0,a),this._byPrimary.set(i.primary,a),o+=1}}finally{o>0&&(this._version+=1)}return o}delete(e){let r=this._byPrimary.get(e);if(r===void 0)return!1;let o=y(this._buf,r);return this._buf.splice(o,1),this._byPrimary.delete(e),this._version+=1,!0}deleteMany(e){let r=0;try{for(let o of e){let i=this._byPrimary.get(o);if(i===void 0)continue;let n=y(this._buf,i);this._buf.splice(n,1),this._byPrimary.delete(o),r+=1}}finally{r>0&&(this._version+=1)}return r}clear(){let e=this._buf.length;return e===0?0:(this._buf.length=0,this._byPrimary.clear(),this._version+=1,e)}toArray(){return[...this._buf]}toPrimaryMap(){let e=new Map;for(let r of this._buf)e.set(r.primary,r.value);return e}};function R(s){return s.subscribe(()=>{})}function U(s={}){let{name:e,versioning:r,equals:o,backend:i}=s,n=i??new b;function a(t){return t?.equals!==void 0||o===void 0?t:{...t,equals:o}}let d=v([],{name:e,describeKind:"state",equals:(t,u)=>t===u,...r!=null?{versioning:r}:{}}),p=w([d],([t])=>{let u=t,l=new Map;for(let f of u)l.set(f.primary,f.value);return l},{initial:n.toPrimaryMap(),describeKind:"derived"}),_=R(p),K=!1;function I(){let t=n.toArray();h(()=>{d.down([[V]]),d.down([[m,t]])})}function c(t){let u=n.version;try{return t()}finally{n.version!==u&&I()}}return{ordered:d,byPrimary:p,has(t){return n.has(t)},get(t){return n.get(t)},get size(){return n.size},upsert(t,u,l,f){return c(()=>n.upsert(t,u,l,a(f)))},upsertMany(t,u){let l=[...t];l.length!==0&&c(()=>n.upsertMany(l,a(u)))},delete(t){c(()=>n.delete(t))},deleteMany(t){let u=[...t];u.length!==0&&c(()=>n.deleteMany(u))},clear(){c(()=>n.clear())},dispose(){K||(K=!0,_())}}}export{b as a,U as b};
1
+ import{E as v,G as w,m as h}from"./chunk-LYCLF26R.js";import{b as m,c as V}from"./chunk-CK2E7BTU.js";function x(s,e){if(s===e)return 0;let r=typeof s;if(r===typeof e&&(r==="number"||r==="string"||r==="boolean"||r==="bigint")){let i=s,n=e;return i<n?-1:i>n?1:0}return String(s).localeCompare(String(e))}function k(s,e){let r=x(s[0],e[0]);return r!==0?r:x(s[1],e[1])}function g(s){return[s.secondary,s.primary]}function y(s,e){let r=g(e),o=0,i=s.length;for(;o<i;){let n=o+i>>1;k(r,g(s[n]))>0?o=n+1:i=n}return o}var b=class{_version=0;_buf=[];_byPrimary=new Map;get version(){return this._version}get size(){return this._buf.length}has(e){return this._byPrimary.has(e)}get(e){return this._byPrimary.get(e)?.value}upsert(e,r,o,i){let n=this._byPrimary.get(e),a={primary:e,secondary:r,value:o};if(n!==void 0&&i?.equals?.(n,a))return!1;if(n!==void 0){let p=y(this._buf,n);this._buf.splice(p,1)}let d=y(this._buf,a);return this._buf.splice(d,0,a),this._byPrimary.set(e,a),this._version+=1,n===void 0}upsertMany(e,r){let o=0;try{for(let i of e){let n=this._byPrimary.get(i.primary),a={primary:i.primary,secondary:i.secondary,value:i.value};if(n!==void 0&&r?.equals?.(n,a))continue;if(n!==void 0){let p=y(this._buf,n);this._buf.splice(p,1)}let d=y(this._buf,a);this._buf.splice(d,0,a),this._byPrimary.set(i.primary,a),o+=1}}finally{o>0&&(this._version+=1)}return o}delete(e){let r=this._byPrimary.get(e);if(r===void 0)return!1;let o=y(this._buf,r);return this._buf.splice(o,1),this._byPrimary.delete(e),this._version+=1,!0}deleteMany(e){let r=0;try{for(let o of e){let i=this._byPrimary.get(o);if(i===void 0)continue;let n=y(this._buf,i);this._buf.splice(n,1),this._byPrimary.delete(o),r+=1}}finally{r>0&&(this._version+=1)}return r}clear(){let e=this._buf.length;return e===0?0:(this._buf.length=0,this._byPrimary.clear(),this._version+=1,e)}toArray(){return[...this._buf]}toPrimaryMap(){let e=new Map;for(let r of this._buf)e.set(r.primary,r.value);return e}};function R(s){return s.subscribe(()=>{})}function U(s={}){let{name:e,versioning:r,equals:o,backend:i}=s,n=i??new b;function a(t){return t?.equals!==void 0||o===void 0?t:{...t,equals:o}}let d=v([],{name:e,describeKind:"state",equals:(t,u)=>t===u,...r!=null?{versioning:r}:{}}),p=w([d],([t])=>{let u=t,l=new Map;for(let f of u)l.set(f.primary,f.value);return l},{initial:n.toPrimaryMap(),describeKind:"derived"}),_=R(p),K=!1;function I(){let t=n.toArray();h(()=>{d.down([[V]]),d.down([[m,t]])})}function c(t){let u=n.version;try{return t()}finally{n.version!==u&&I()}}return{ordered:d,byPrimary:p,has(t){return n.has(t)},get(t){return n.get(t)},get size(){return n.size},upsert(t,u,l,f){return c(()=>n.upsert(t,u,l,a(f)))},upsertMany(t,u){let l=[...t];l.length!==0&&c(()=>n.upsertMany(l,a(u)))},delete(t){c(()=>n.delete(t))},deleteMany(t){let u=[...t];u.length!==0&&c(()=>n.deleteMany(u))},clear(){c(()=>n.clear())},dispose(){K||(K=!0,_())}}}export{b as a,U as b};
@@ -1,4 +1,4 @@
1
- import{a as O,f as v,k as P}from"./chunk-FTA5TB2A.js";import{ba as _,k as A}from"./chunk-Y26UN6J5.js";import{d as U}from"./chunk-RWGJQQLT.js";import{m as S,w as T}from"./chunk-UMH3HSP7.js";import{o as y}from"./chunk-7AJKUA36.js";function G(e={}){return e.sdk?H(e):Y(e)}function b(e,t,o,a){let i=t?.model??o;if(!i)throw new Error("anthropicAdapter: model must be set via options.model or invokeOpts.model");let{system:n,chat:s}=q(e,t?.systemPrompt),r={model:i,messages:s.map(J),max_tokens:t?.maxTokens??4096};return n&&(r.system=n),t?.temperature!=null&&(r.temperature=t.temperature),t?.tools&&t.tools.length>0&&(r.tools=t.tools.map(F)),t?.maxReasoningTokens!=null&&(r.thinking={type:"enabled",budget_tokens:t.maxReasoningTokens}),t?.cacheHint,a&&(r.stream=!0),t?.providerExtras&&Object.assign(r,t.providerExtras),r}function q(e,t){let o=[];t&&o.push(t);let a=[];for(let i of e)i.role==="system"?o.push(i.content):a.push(i);return{system:o.length>0?o.join(`
1
+ import{a as O,f as v,k as P}from"./chunk-2LZ6DL45.js";import{ba as _,k as A}from"./chunk-LOF5HSD3.js";import{d as U}from"./chunk-FKRPIRE6.js";import{m as S,w as T}from"./chunk-T7EQPKOP.js";import{o as y}from"./chunk-LYCLF26R.js";function G(e={}){return e.sdk?H(e):Y(e)}function b(e,t,o,a){let i=t?.model??o;if(!i)throw new Error("anthropicAdapter: model must be set via options.model or invokeOpts.model");let{system:n,chat:s}=q(e,t?.systemPrompt),r={model:i,messages:s.map(J),max_tokens:t?.maxTokens??4096};return n&&(r.system=n),t?.temperature!=null&&(r.temperature=t.temperature),t?.tools&&t.tools.length>0&&(r.tools=t.tools.map(F)),t?.maxReasoningTokens!=null&&(r.thinking={type:"enabled",budget_tokens:t.maxReasoningTokens}),t?.cacheHint,a&&(r.stream=!0),t?.providerExtras&&Object.assign(r,t.providerExtras),r}function q(e,t){let o=[];t&&o.push(t);let a=[];for(let i of e)i.role==="system"?o.push(i.content):a.push(i);return{system:o.length>0?o.join(`
2
2
 
3
3
  `):void 0,chat:a}}function J(e){if(e.role==="tool")return{role:"user",content:[{type:"tool_result",tool_use_id:e.toolCallId,content:e.content}]};if(e.role==="assistant"&&e.toolCalls&&e.toolCalls.length>0){let t=[];e.content&&t.push({type:"text",text:e.content});for(let o of e.toolCalls)t.push({type:"tool_use",id:o.id,name:o.name,input:o.arguments});return{role:"assistant",content:t}}return{role:e.role,content:e.content}}function F(e){return{name:e.name,description:e.description,input_schema:e.parameters}}function R(e,t){if(!e)return{...t};let o={...e};return t.input_tokens!=null&&(o.input_tokens=t.input_tokens),t.output_tokens!=null&&(o.output_tokens=t.output_tokens),t.cache_read_input_tokens!=null&&(o.cache_read_input_tokens=t.cache_read_input_tokens),t.cache_creation_input_tokens!=null&&(o.cache_creation_input_tokens=t.cache_creation_input_tokens),t.cache_creation&&(o.cache_creation={...e.cache_creation??{},...t.cache_creation}),t.server_tool_use&&(o.server_tool_use={...e.server_tool_use??{},...t.server_tool_use}),o}function x(e){let t={input:{regular:e?.input_tokens??0},output:{regular:e?.output_tokens??0},raw:e};return e?.cache_read_input_tokens&&(t.input.cacheRead=e.cache_read_input_tokens),e?.cache_creation?(e.cache_creation.ephemeral_5m_input_tokens&&(t.input.cacheWrite5m=e.cache_creation.ephemeral_5m_input_tokens),e.cache_creation.ephemeral_1h_input_tokens&&(t.input.cacheWrite1h=e.cache_creation.ephemeral_1h_input_tokens)):e?.cache_creation_input_tokens&&(t.input.cacheWrite5m=e.cache_creation_input_tokens),e?.server_tool_use?.web_search_requests&&(t.auxiliary={webSearchRequests:e.server_tool_use.web_search_requests}),t}function K(e,t){let o=[],a=[];for(let i of e.content)if(i.type==="text"&&typeof i.text=="string")o.push(i.text);else if(i.type==="tool_use"){let n=i;a.push({id:n.id,name:n.name,arguments:n.input??{}})}return{content:o.join(""),toolCalls:a.length>0?a:void 0,usage:x(e.usage),finishReason:e.stop_reason,latencyMs:t,model:e.model,provider:"anthropic"}}function Y(e){let t=e.apiKey??globalThis.process?.env?.ANTHROPIC_API_KEY,o=e.baseURL??"https://api.anthropic.com",a=e.anthropicVersion??"2023-06-01",i=e.fetchImpl??fetch,n=()=>{if(!t)throw new Error("anthropicAdapter: apiKey required for invoke/stream (or provide opts.sdk)");return{"x-api-key":t,"anthropic-version":a,"content-type":"application/json",...e.headers??{}}};return{provider:"anthropic",model:e.model,async invoke(s,r){let c=b(s,r,e.model,!1),g=y(),l=await i(`${o}/v1/messages`,{method:"POST",headers:n(),body:JSON.stringify(c),signal:r?.signal});if(!l.ok)throw await _(l,"Anthropic");let d=await l.json(),p=Math.max(0,(y()-g)/1e6);return K(d,p)},async*stream(s,r){let c=b(s,r,e.model,!0),g=await i(`${o}/v1/messages`,{method:"POST",headers:{...n(),accept:"text/event-stream"},body:JSON.stringify(c),signal:r?.signal});if(!g.ok)throw await _(g,"Anthropic");if(!g.body)throw new Error("anthropicAdapter: streaming response has no body");let l,d,p=new Map;for await(let m of A(g.body,{signal:r?.signal})){let h=m.data;if(!h)continue;let k;try{k=JSON.parse(h)}catch{continue}switch(k.type){case"message_start":{l=R(l,k.message.usage);break}case"content_block_start":{let u=k,f=u.content_block;f.type==="tool_use"&&(p.set(u.index,{id:String(f.id??""),name:String(f.name??""),argBuf:""}),yield{type:"tool-call-delta",delta:{id:String(f.id??""),name:String(f.name??"")}});break}case"content_block_delta":{let u=k,f=u.delta;if(f.type==="text_delta"&&typeof f.text=="string")yield{type:"token",delta:f.text};else if(f.type==="input_json_delta"&&typeof f.partial_json=="string"){let E=p.get(u.index);E&&(E.argBuf+=f.partial_json),yield{type:"tool-call-delta",delta:{argumentsDelta:f.partial_json}}}else f.type==="thinking_delta"&&typeof f.thinking=="string"&&(yield{type:"thinking",delta:f.thinking});break}case"message_delta":{let u=k;u.delta.stop_reason&&(d=u.delta.stop_reason),u.delta.usage&&(l=R(l,u.delta.usage));break}case"message_stop":break}}l&&(yield{type:"usage",usage:x(l)}),yield{type:"finish",reason:d??"stop"}}}}function H(e){let t=e.sdk;if(!t)throw new Error("sdkBackedAnthropic: sdk instance required");return{provider:"anthropic",model:e.model,async invoke(o,a){let i=b(o,a,e.model,!1),n=y(),s=await t.messages.create(i,{signal:a?.signal}),r=Math.max(0,(y()-n)/1e6);return K(s,r)},async*stream(o,a){if(!t.messages.stream)throw new Error("sdkBackedAnthropic: SDK instance does not expose .messages.stream");let i=b(o,a,e.model,!0),n,s;for await(let r of t.messages.stream(i,{signal:a?.signal}))switch(r.type){case"message_start":n=R(n,r.message.usage);break;case"content_block_delta":{let c=r.delta;c?.type==="text_delta"&&typeof c.text=="string"?yield{type:"token",delta:c.text}:c?.type==="input_json_delta"&&typeof c.partial_json=="string"?yield{type:"tool-call-delta",delta:{argumentsDelta:c.partial_json}}:c?.type==="thinking_delta"&&typeof c.thinking=="string"&&(yield{type:"thinking",delta:c.thinking});break}case"message_delta":{let c=r;c.delta.stop_reason&&(s=c.delta.stop_reason),c.delta.usage&&(n=R(n,c.delta.usage));break}}n&&(yield{type:"usage",usage:x(n)}),yield{type:"finish",reason:s??"stop"}}}}function j(e={}){return e.sdk?Q(e):z(e)}function w(e,t){let o=[],a=[];t?.systemPrompt&&o.push(t.systemPrompt);for(let s of e){if(s.role==="system"){o.push(s.content);continue}if(s.role==="tool"){a.push({role:"user",parts:[{functionResponse:{name:s.name??s.toolCallId??"tool",response:{result:s.content}}}]});continue}if(s.role==="assistant"&&s.toolCalls&&s.toolCalls.length>0){let r=[];s.content&&r.push({text:s.content});for(let c of s.toolCalls)r.push({functionCall:{name:c.name,args:c.arguments}});a.push({role:"model",parts:r});continue}a.push({role:s.role==="assistant"?"model":"user",parts:[{text:s.content}]})}let i={contents:a};o.length>0&&(i.systemInstruction={role:"system",parts:[{text:o.join(`
4
4
 
@@ -1 +1 @@
1
- import{b as F,c as G}from"./chunk-K54OKWNY.js";import{b as $}from"./chunk-LWGLBCMU.js";import{j as _}from"./chunk-PSQNYY72.js";import{t as B}from"./chunk-WQ7I7JVU.js";import{B as N}from"./chunk-UMH3HSP7.js";import{D as x,E as I,G as S,H as M,m as A}from"./chunk-7AJKUA36.js";import{b as k,c as v,d as y,f as T,g as O,i as E,j as w}from"./chunk-CK2E7BTU.js";import{b as K}from"./chunk-QYADASLV.js";var U={};K(U,{budgetGate:()=>C,effectivenessTracker:()=>L,feedback:()=>V,funnel:()=>P,scorer:()=>z});function R(u,t){return G("reduction",u,t)}function P(u,t,i,b){if(t.length===0)throw new RangeError("funnel requires at least one source");if(i.length===0)throw new RangeError("funnel requires at least one stage");let d=new _(u,b),s=t.length===1?t[0]:B(...t);d.add(s,{name:"merged"});let e="merged";for(let f=0;f<i.length;f++){let o=i[f],c=new _(o.name);o.build(c);try{c.resolve("input")}catch{throw new Error(`funnel stage "${o.name}" must define an "input" node`)}try{c.resolve("output")}catch{throw new Error(`funnel stage "${o.name}" must define an "output" node`)}d.mount(o.name,c);let l=d.resolve(e),m=`${o.name}::input`,g=d.resolve(m),a=`__bridge_${e}\u2192${o.name}_input`,p=M([l],([r])=>{g.emit(r)},{name:a});d.add(p,{name:a}),d.addDisposer(N(p)),e=`${o.name}::output`}return d}function V(u,t,i,b){let d=b?.maxIterations??10,s=`__feedback_${t}`,e=I(0,{meta:R("feedback_counter",{maxIterations:d,feedbackFrom:t,feedbackTo:i})});u.add(e,{name:s});let f=u.resolve(t),o=u.resolve(i),c=`__feedback_effect_${t}`,l=x([],(m,g)=>{let a=f.subscribe(p=>{for(let r of p){let n=r[0];if(n===k){let h=r[1];if(h==null)return;A(()=>{F(e,d)&&o.emit(h)})}else if(n===E||n===w){let h=n===w&&r.length>1?[w,r[1]]:[n];e.down([h])}}});return()=>a()},{name:c,describeKind:"effect",meta:{...R("feedback_effect",{feedbackFrom:t,feedbackTo:i}),_internal:!0}});return u.add(l,{name:c}),u.addDisposer(N(l)),u}function C(u,t,i){if(t.length===0)throw new RangeError("budgetGate requires at least one constraint");let b=t.map(a=>a.node),d=[u,...b],s=[],e=!1,f=!1,o=Symbol("budget-gate"),c=new Array(t.length);function l(){return t.every((a,p)=>a.check(c[p]))}function m(a){for(;s.length>0&&l();){let p=s[0];s=s.slice(1),a.emit(p)}s.length===0&&f&&(f=!1,a.down([[y]]))}return x([],(a,p)=>{for(let n=0;n<t.length;n++)c[n]=t[n].node.cache;let r=[];for(let n=0;n<d.length;n++){let h=d[n];r.push(h.subscribe(q=>{for(let D of q)g(D,n,p)}))}return()=>{for(let n of r)n()}},{...i,describeKind:"derived",meta:R("budget_gate",i?.meta)});function g(a,p,r){let n=a[0];if(p===0){if(n===k)return l()&&s.length===0?r.emit(a[1]):(s.push(a[1]),e||(e=!0,r.up([[T,o]]))),!0;if(n===v)return r.down([[v]]),!0;if(n===y)return s.length===0?r.down([[y]]):f=!0,!0;if(n===E||n===w){for(let h of s)r.emit(h);return s=[],f=!1,e&&(e=!1,r.up([[O,o]])),r.down([a]),!0}return!1}return n===k&&(c[p-1]=a[1]),n===k||n===y?(l()&&s.length>0?(m(r),s.length===0&&e&&(e=!1,r.up([[O,o]]))):!l()&&!e&&s.length>0&&(e=!0,r.up([[T,o]])),!0):n===v?!0:n===w?(r.down([a]),!0):n===E}}function z(u,t,i){if(u.length===0)throw new RangeError("scorer requires at least one source");if(u.length!==t.length)throw new RangeError("scorer requires the same number of sources and weights");let b=[...u,...t],d=u.length,s=i?.scoreFns;return S(b,e=>{let f=e.slice(0,d),o=e.slice(d),c=[],l=0;for(let m=0;m<d;m++){let g=f[m]??0,a=o[m]??0,r=(s?.[m]?s[m](g):g)*a;c.push(r),l+=r}return{value:f,score:l,breakdown:c}},{...i?{equals:i.equals,resubscribable:i.resubscribable,resetOnTeardown:i.resetOnTeardown}:{},describeKind:"derived",meta:R("scorer",i?.meta)})}function L(u){let t=$({name:u?.name??"effectiveness-entries"}),i=S([t.entries],([e])=>new Map(e),{name:`${u?.name??"effectiveness"}-snapshot`,equals:(e,f)=>{let o=e,c=f;if(o.size!==c.size)return!1;for(let[l,m]of o){let g=c.get(l);if(!g||m.attempts!==g.attempts||m.successes!==g.successes)return!1}return!0}});function b(e,f){let o=t.get(e),c=(o?.attempts??0)+1,l=(o?.successes??0)+(f?1:0);t.set(e,{key:e,attempts:c,successes:l,successRate:l/c})}function d(e){return t.get(e)}let s=N(i);return{node:i,record:b,lookup:d,dispose:()=>s()}}export{P as a,V as b,C as c,z as d,L as e,U as f};
1
+ import{b as F,c as G}from"./chunk-L3KUKDZC.js";import{b as $}from"./chunk-TZQPPQEQ.js";import{j as _}from"./chunk-2JO6LXFT.js";import{t as B}from"./chunk-4F564IPP.js";import{B as N}from"./chunk-T7EQPKOP.js";import{D as x,E as I,G as S,H as M,m as A}from"./chunk-LYCLF26R.js";import{b as k,c as v,d as y,f as T,g as O,i as E,j as w}from"./chunk-CK2E7BTU.js";import{b as K}from"./chunk-QYADASLV.js";var U={};K(U,{budgetGate:()=>C,effectivenessTracker:()=>L,feedback:()=>V,funnel:()=>P,scorer:()=>z});function R(u,t){return G("reduction",u,t)}function P(u,t,i,b){if(t.length===0)throw new RangeError("funnel requires at least one source");if(i.length===0)throw new RangeError("funnel requires at least one stage");let d=new _(u,b),s=t.length===1?t[0]:B(...t);d.add(s,{name:"merged"});let e="merged";for(let f=0;f<i.length;f++){let o=i[f],c=new _(o.name);o.build(c);try{c.resolve("input")}catch{throw new Error(`funnel stage "${o.name}" must define an "input" node`)}try{c.resolve("output")}catch{throw new Error(`funnel stage "${o.name}" must define an "output" node`)}d.mount(o.name,c);let l=d.resolve(e),m=`${o.name}::input`,g=d.resolve(m),a=`__bridge_${e}\u2192${o.name}_input`,p=M([l],([r])=>{g.emit(r)},{name:a});d.add(p,{name:a}),d.addDisposer(N(p)),e=`${o.name}::output`}return d}function V(u,t,i,b){let d=b?.maxIterations??10,s=`__feedback_${t}`,e=I(0,{meta:R("feedback_counter",{maxIterations:d,feedbackFrom:t,feedbackTo:i})});u.add(e,{name:s});let f=u.resolve(t),o=u.resolve(i),c=`__feedback_effect_${t}`,l=x([],(m,g)=>{let a=f.subscribe(p=>{for(let r of p){let n=r[0];if(n===k){let h=r[1];if(h==null)return;A(()=>{F(e,d)&&o.emit(h)})}else if(n===E||n===w){let h=n===w&&r.length>1?[w,r[1]]:[n];e.down([h])}}});return()=>a()},{name:c,describeKind:"effect",meta:{...R("feedback_effect",{feedbackFrom:t,feedbackTo:i}),_internal:!0}});return u.add(l,{name:c}),u.addDisposer(N(l)),u}function C(u,t,i){if(t.length===0)throw new RangeError("budgetGate requires at least one constraint");let b=t.map(a=>a.node),d=[u,...b],s=[],e=!1,f=!1,o=Symbol("budget-gate"),c=new Array(t.length);function l(){return t.every((a,p)=>a.check(c[p]))}function m(a){for(;s.length>0&&l();){let p=s[0];s=s.slice(1),a.emit(p)}s.length===0&&f&&(f=!1,a.down([[y]]))}return x([],(a,p)=>{for(let n=0;n<t.length;n++)c[n]=t[n].node.cache;let r=[];for(let n=0;n<d.length;n++){let h=d[n];r.push(h.subscribe(q=>{for(let D of q)g(D,n,p)}))}return()=>{for(let n of r)n()}},{...i,describeKind:"derived",meta:R("budget_gate",i?.meta)});function g(a,p,r){let n=a[0];if(p===0){if(n===k)return l()&&s.length===0?r.emit(a[1]):(s.push(a[1]),e||(e=!0,r.up([[T,o]]))),!0;if(n===v)return r.down([[v]]),!0;if(n===y)return s.length===0?r.down([[y]]):f=!0,!0;if(n===E||n===w){for(let h of s)r.emit(h);return s=[],f=!1,e&&(e=!1,r.up([[O,o]])),r.down([a]),!0}return!1}return n===k&&(c[p-1]=a[1]),n===k||n===y?(l()&&s.length>0?(m(r),s.length===0&&e&&(e=!1,r.up([[O,o]]))):!l()&&!e&&s.length>0&&(e=!0,r.up([[T,o]])),!0):n===v?!0:n===w?(r.down([a]),!0):n===E}}function z(u,t,i){if(u.length===0)throw new RangeError("scorer requires at least one source");if(u.length!==t.length)throw new RangeError("scorer requires the same number of sources and weights");let b=[...u,...t],d=u.length,s=i?.scoreFns;return S(b,e=>{let f=e.slice(0,d),o=e.slice(d),c=[],l=0;for(let m=0;m<d;m++){let g=f[m]??0,a=o[m]??0,r=(s?.[m]?s[m](g):g)*a;c.push(r),l+=r}return{value:f,score:l,breakdown:c}},{...i?{equals:i.equals,resubscribable:i.resubscribable,resetOnTeardown:i.resetOnTeardown}:{},describeKind:"derived",meta:R("scorer",i?.meta)})}function L(u){let t=$({name:u?.name??"effectiveness-entries"}),i=S([t.entries],([e])=>new Map(e),{name:`${u?.name??"effectiveness"}-snapshot`,equals:(e,f)=>{let o=e,c=f;if(o.size!==c.size)return!1;for(let[l,m]of o){let g=c.get(l);if(!g||m.attempts!==g.attempts||m.successes!==g.successes)return!1}return!0}});function b(e,f){let o=t.get(e),c=(o?.attempts??0)+1,l=(o?.successes??0)+(f?1:0);t.set(e,{key:e,attempts:c,successes:l,successRate:l/c})}function d(e){return t.get(e)}let s=N(i);return{node:i,record:b,lookup:d,dispose:()=>s()}}export{P as a,V as b,C as c,z as d,L as e,U as f};
@@ -1 +1 @@
1
- import{b as x,c as D,d as $,e as S,f as A,g as R,h as T,i as F,j as y,k as P,l as V}from"./chunk-PSQNYY72.js";import{a as m,b as g,c as k,d as v,e as O,f as G,g as E,h as C}from"./chunk-7AJKUA36.js";import{b as u}from"./chunk-CK2E7BTU.js";import{b as _}from"./chunk-QYADASLV.js";var j={};_(j,{ENVELOPE_VERSION:()=>v,GRAPH_META_SEGMENT:()=>R,Graph:()=>y,JsonCodec:()=>m,SIZEOF_OVERHEAD:()=>D,SIZEOF_SYMBOL:()=>$,SNAPSHOT_VERSION:()=>T,createDagCborCodec:()=>g,createDagCborZstdCodec:()=>k,decodeEnvelope:()=>G,diffForWAL:()=>P,encodeEnvelope:()=>O,explainPath:()=>x,graphProfile:()=>A,mermaidLiveUrl:()=>F,reachable:()=>V,registerBuiltinCodecs:()=>E,replayWAL:()=>C,sizeof:()=>S,validateGraphObservability:()=>L,watchTopologyTree:()=>N});function N(p,n){let o=new Map,d=(s,a)=>{if(o.has(s))return;let c={off:()=>{},prefix:a};o.set(s,c);let f=s.topology.subscribe(l=>{for(let r of l){if(r[0]!==u)continue;let e=r[1];if(n(e,s,a),e.kind==="added"&&e.nodeKind==="mount"){let t=s._mounts.get(e.name);if(t instanceof y){let i=`${a}${e.name}::`;d(t,i)}}else if(e.kind==="removed"&&e.nodeKind==="mount"){let t=`${a}${e.name}::`;for(let[i,h]of Array.from(o.entries()))i!==p&&h.prefix.startsWith(t)&&(h.off(),o.delete(i))}}});c.off=f;for(let[l,r]of s._mounts)if(r instanceof y){let e=`${a}${l}::`;d(r,e)}};return d(p,""),()=>{for(let s of o.values())s.off();o.clear()}}function L(p,n={}){let o=[],d=n.requireFound??!0;if(n.skipDescribe!==!0)try{let r=p.describe(),e=new Set(Object.keys(r.nodes)),t=[];for(let[i,h]of Object.entries(r.nodes))for(let b of h.deps)b!==""&&!e.has(b)&&t.push(`${i} \u2192 ${b}`);for(let i of r.edges)e.has(i.from)||t.push(`edge.from: ${i.from}`),e.has(i.to)||t.push(`edge.to: ${i.to}`);t.length>0?o.push({kind:"describe",ok:!1,reason:`describe() has ${t.length} dangling pointer(s); nodes \u2289 deps`,danglingDeps:t}):o.push({kind:"describe",ok:!0,nodeCount:e.size,edgeCount:r.edges.length})}catch(r){o.push({kind:"describe",ok:!1,reason:`describe() threw: ${r instanceof Error?r.message:String(r)}`})}for(let r of n.formats??[])try{let e=p.describe({format:r});typeof e!="string"||e.length===0?o.push({kind:"describe-format",ok:!1,format:r,reason:`describe({ format: "${r}" }) returned empty or non-string output`}):o.push({kind:"describe-format",ok:!0,format:r,length:e.length})}catch(e){o.push({kind:"describe-format",ok:!1,format:r,reason:e instanceof Error?e.message:String(e)})}for(let r of n.paths??[])try{p.resolve(r),o.push({kind:"observe",ok:!0,path:r})}catch(e){o.push({kind:"observe",ok:!1,path:r,reason:e instanceof Error?e.message:String(e)})}for(let[r,e]of n.pairs??[])try{let t=p.explain(r,e);d&&t.found===!1?o.push({kind:"explain",ok:!1,from:r,to:e,reason:`explain(${r} \u2192 ${e}) found no path${t.reason?`: ${t.reason}`:""}`}):o.push({kind:"explain",ok:!0,from:r,to:e,found:t.found,steps:t.steps.length})}catch(t){o.push({kind:"explain",ok:!1,from:r,to:e,reason:t instanceof Error?t.message:String(t)})}let s=o.filter(r=>!r.ok),a=s.length===0,c=n.paths?.length??0,f=n.pairs?.length??0,l=n.formats?.length??0;return{ok:a,checks:o,failures:s,summary(){let r=[n.skipDescribe===!0?null:"describe",l>0?`${l} format${l===1?"":"s"}`:null,c>0?`${c} observe path${c===1?"":"s"}`:null,f>0?`${f} explain pair${f===1?"":"s"}`:null].filter(t=>t!=null),e=r.length>0?r.join(", "):"describe-only";return a?`validateGraphObservability: OK (${e})`:`validateGraphObservability: ${s.length} failure(s) across ${e}`}}}export{N as a,L as b,j as c};
1
+ import{b as x,c as D,d as $,e as S,f as A,g as R,h as T,i as F,j as y,k as P,l as V}from"./chunk-2JO6LXFT.js";import{a as m,b as g,c as k,d as v,e as O,f as G,g as E,h as C}from"./chunk-LYCLF26R.js";import{b as u}from"./chunk-CK2E7BTU.js";import{b as _}from"./chunk-QYADASLV.js";var j={};_(j,{ENVELOPE_VERSION:()=>v,GRAPH_META_SEGMENT:()=>R,Graph:()=>y,JsonCodec:()=>m,SIZEOF_OVERHEAD:()=>D,SIZEOF_SYMBOL:()=>$,SNAPSHOT_VERSION:()=>T,createDagCborCodec:()=>g,createDagCborZstdCodec:()=>k,decodeEnvelope:()=>G,diffForWAL:()=>P,encodeEnvelope:()=>O,explainPath:()=>x,graphProfile:()=>A,mermaidLiveUrl:()=>F,reachable:()=>V,registerBuiltinCodecs:()=>E,replayWAL:()=>C,sizeof:()=>S,validateGraphObservability:()=>L,watchTopologyTree:()=>N});function N(p,n){let o=new Map,d=(s,a)=>{if(o.has(s))return;let c={off:()=>{},prefix:a};o.set(s,c);let f=s.topology.subscribe(l=>{for(let r of l){if(r[0]!==u)continue;let e=r[1];if(n(e,s,a),e.kind==="added"&&e.nodeKind==="mount"){let t=s._mounts.get(e.name);if(t instanceof y){let i=`${a}${e.name}::`;d(t,i)}}else if(e.kind==="removed"&&e.nodeKind==="mount"){let t=`${a}${e.name}::`;for(let[i,h]of Array.from(o.entries()))i!==p&&h.prefix.startsWith(t)&&(h.off(),o.delete(i))}}});c.off=f;for(let[l,r]of s._mounts)if(r instanceof y){let e=`${a}${l}::`;d(r,e)}};return d(p,""),()=>{for(let s of o.values())s.off();o.clear()}}function L(p,n={}){let o=[],d=n.requireFound??!0;if(n.skipDescribe!==!0)try{let r=p.describe(),e=new Set(Object.keys(r.nodes)),t=[];for(let[i,h]of Object.entries(r.nodes))for(let b of h.deps)b!==""&&!e.has(b)&&t.push(`${i} \u2192 ${b}`);for(let i of r.edges)e.has(i.from)||t.push(`edge.from: ${i.from}`),e.has(i.to)||t.push(`edge.to: ${i.to}`);t.length>0?o.push({kind:"describe",ok:!1,reason:`describe() has ${t.length} dangling pointer(s); nodes \u2289 deps`,danglingDeps:t}):o.push({kind:"describe",ok:!0,nodeCount:e.size,edgeCount:r.edges.length})}catch(r){o.push({kind:"describe",ok:!1,reason:`describe() threw: ${r instanceof Error?r.message:String(r)}`})}for(let r of n.formats??[])try{let e=p.describe({format:r});typeof e!="string"||e.length===0?o.push({kind:"describe-format",ok:!1,format:r,reason:`describe({ format: "${r}" }) returned empty or non-string output`}):o.push({kind:"describe-format",ok:!0,format:r,length:e.length})}catch(e){o.push({kind:"describe-format",ok:!1,format:r,reason:e instanceof Error?e.message:String(e)})}for(let r of n.paths??[])try{p.resolve(r),o.push({kind:"observe",ok:!0,path:r})}catch(e){o.push({kind:"observe",ok:!1,path:r,reason:e instanceof Error?e.message:String(e)})}for(let[r,e]of n.pairs??[])try{let t=p.explain(r,e);d&&t.found===!1?o.push({kind:"explain",ok:!1,from:r,to:e,reason:`explain(${r} \u2192 ${e}) found no path${t.reason?`: ${t.reason}`:""}`}):o.push({kind:"explain",ok:!0,from:r,to:e,found:t.found,steps:t.steps.length})}catch(t){o.push({kind:"explain",ok:!1,from:r,to:e,reason:t instanceof Error?t.message:String(t)})}let s=o.filter(r=>!r.ok),a=s.length===0,c=n.paths?.length??0,f=n.pairs?.length??0,l=n.formats?.length??0;return{ok:a,checks:o,failures:s,summary(){let r=[n.skipDescribe===!0?null:"describe",l>0?`${l} format${l===1?"":"s"}`:null,c>0?`${c} observe path${c===1?"":"s"}`:null,f>0?`${f} explain pair${f===1?"":"s"}`:null].filter(t=>t!=null),e=r.length>0?r.join(", "):"describe-only";return a?`validateGraphObservability: OK (${e})`:`validateGraphObservability: ${s.length} failure(s) across ${e}`}}}export{N as a,L as b,j as c};