@graphrefly/graphrefly 0.45.0 → 0.46.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 (714) hide show
  1. package/README.md +1 -2
  2. package/dist/_internal-B23BagFd.d.cts +33 -0
  3. package/dist/_internal-B23BagFd.d.ts +33 -0
  4. package/dist/adaptive-rate-limiter-Dch_xYIi.d.cts +111 -0
  5. package/dist/adaptive-rate-limiter-Dch_xYIi.d.ts +111 -0
  6. package/dist/agents-C0Ji9ldU.d.cts +629 -0
  7. package/dist/agents-C9zexT7I.d.ts +629 -0
  8. package/dist/audit-BAXb3VOg.d.ts +246 -0
  9. package/dist/audit-C_bPfkqS.d.cts +246 -0
  10. package/dist/backoff-7KIK3WQW.js +24 -0
  11. package/dist/backoff-7KIK3WQW.js.map +1 -0
  12. package/dist/backoff-Bnb9OoPh.d.cts +6 -0
  13. package/dist/backoff-Bnb9OoPh.d.ts +6 -0
  14. package/dist/base/composition/index.cjs +811 -0
  15. package/dist/base/composition/index.cjs.map +1 -0
  16. package/dist/base/composition/index.d.cts +469 -0
  17. package/dist/base/composition/index.d.ts +469 -0
  18. package/dist/base/composition/index.js +40 -0
  19. package/dist/base/composition/index.js.map +1 -0
  20. package/dist/base/index.cjs +6336 -0
  21. package/dist/base/index.cjs.map +1 -0
  22. package/dist/base/index.d.cts +22 -0
  23. package/dist/base/index.d.ts +22 -0
  24. package/dist/base/index.js +259 -0
  25. package/dist/base/index.js.map +1 -0
  26. package/dist/base/io/index.cjs +3270 -0
  27. package/dist/base/io/index.cjs.map +1 -0
  28. package/dist/base/io/index.d.cts +2245 -0
  29. package/dist/base/io/index.d.ts +2245 -0
  30. package/dist/base/io/index.js +117 -0
  31. package/dist/base/io/index.js.map +1 -0
  32. package/dist/base/meta/index.cjs +43 -0
  33. package/dist/base/meta/index.cjs.map +1 -0
  34. package/dist/base/meta/index.d.cts +45 -0
  35. package/dist/base/meta/index.d.ts +45 -0
  36. package/dist/base/meta/index.js +13 -0
  37. package/dist/base/meta/index.js.map +1 -0
  38. package/dist/base/mutation/index.cjs +200 -0
  39. package/dist/base/mutation/index.cjs.map +1 -0
  40. package/dist/base/mutation/index.d.cts +177 -0
  41. package/dist/base/mutation/index.d.ts +177 -0
  42. package/dist/base/mutation/index.js +22 -0
  43. package/dist/base/mutation/index.js.map +1 -0
  44. package/dist/base/render/index.cjs +1120 -0
  45. package/dist/base/render/index.cjs.map +1 -0
  46. package/dist/base/render/index.d.cts +227 -0
  47. package/dist/base/render/index.d.ts +227 -0
  48. package/dist/base/render/index.js +24 -0
  49. package/dist/base/render/index.js.map +1 -0
  50. package/dist/base/sources/browser/index.cjs +172 -0
  51. package/dist/base/sources/browser/index.cjs.map +1 -0
  52. package/dist/base/sources/browser/index.d.cts +84 -0
  53. package/dist/base/sources/browser/index.d.ts +84 -0
  54. package/dist/base/sources/browser/index.js +151 -0
  55. package/dist/base/sources/browser/index.js.map +1 -0
  56. package/dist/base/sources/event/index.cjs +98 -0
  57. package/dist/base/sources/event/index.cjs.map +1 -0
  58. package/dist/base/sources/event/index.d.cts +91 -0
  59. package/dist/base/sources/event/index.d.ts +91 -0
  60. package/dist/base/sources/event/index.js +13 -0
  61. package/dist/base/sources/event/index.js.map +1 -0
  62. package/dist/base/sources/index.cjs +755 -0
  63. package/dist/base/sources/index.cjs.map +1 -0
  64. package/dist/base/sources/index.d.cts +357 -0
  65. package/dist/base/sources/index.d.ts +357 -0
  66. package/dist/base/sources/index.js +42 -0
  67. package/dist/base/sources/index.js.map +1 -0
  68. package/dist/base/sources/node/index.cjs +320 -0
  69. package/dist/base/sources/node/index.cjs.map +1 -0
  70. package/dist/base/sources/node/index.d.cts +185 -0
  71. package/dist/base/sources/node/index.d.ts +185 -0
  72. package/dist/base/sources/node/index.js +306 -0
  73. package/dist/base/sources/node/index.js.map +1 -0
  74. package/dist/base/utils/index.cjs +37 -0
  75. package/dist/base/utils/index.cjs.map +1 -0
  76. package/dist/base/utils/index.d.cts +37 -0
  77. package/dist/base/utils/index.d.ts +37 -0
  78. package/dist/base/utils/index.js +11 -0
  79. package/dist/base/utils/index.js.map +1 -0
  80. package/dist/base/worker/index.cjs +548 -0
  81. package/dist/base/worker/index.cjs.map +1 -0
  82. package/dist/base/worker/index.d.cts +207 -0
  83. package/dist/base/worker/index.d.ts +207 -0
  84. package/dist/base/worker/index.js +20 -0
  85. package/dist/base/worker/index.js.map +1 -0
  86. package/dist/breaker-C9skL3d8.d.ts +175 -0
  87. package/dist/breaker-ugSdq54q.d.cts +175 -0
  88. package/dist/cascading-CSSbKGrJ.d.ts +199 -0
  89. package/dist/cascading-baGkiihI.d.cts +199 -0
  90. package/dist/chunk-255UCBG4.js +58 -0
  91. package/dist/chunk-255UCBG4.js.map +1 -0
  92. package/dist/chunk-2LO3EL4W.js +1 -0
  93. package/dist/chunk-2LO3EL4W.js.map +1 -0
  94. package/dist/chunk-2OB3CEJS.js +1065 -0
  95. package/dist/chunk-2OB3CEJS.js.map +1 -0
  96. package/dist/chunk-36NMM65U.js +144 -0
  97. package/dist/chunk-36NMM65U.js.map +1 -0
  98. package/dist/chunk-3CEXCBN6.js +1 -0
  99. package/dist/chunk-3CEXCBN6.js.map +1 -0
  100. package/dist/chunk-3MUSLI6E.js +105 -0
  101. package/dist/chunk-3MUSLI6E.js.map +1 -0
  102. package/dist/chunk-3PSLNJDU.js +884 -0
  103. package/dist/chunk-3PSLNJDU.js.map +1 -0
  104. package/dist/chunk-3QZY5BI7.js +92 -0
  105. package/dist/chunk-3QZY5BI7.js.map +1 -0
  106. package/dist/chunk-42FQ27MQ.js +594 -0
  107. package/dist/chunk-42FQ27MQ.js.map +1 -0
  108. package/dist/chunk-4GYMCUDZ.js +1085 -0
  109. package/dist/chunk-4GYMCUDZ.js.map +1 -0
  110. package/dist/chunk-4S53H2KR.js +382 -0
  111. package/dist/chunk-4S53H2KR.js.map +1 -0
  112. package/dist/chunk-4XCHZRUJ.js +128 -0
  113. package/dist/chunk-4XCHZRUJ.js.map +1 -0
  114. package/dist/chunk-5THCXDWY.js +725 -0
  115. package/dist/chunk-5THCXDWY.js.map +1 -0
  116. package/dist/chunk-6XZYT4SW.js +256 -0
  117. package/dist/chunk-6XZYT4SW.js.map +1 -0
  118. package/dist/chunk-7EGRP2VX.js +76 -0
  119. package/dist/chunk-7EGRP2VX.js.map +1 -0
  120. package/dist/chunk-A7KV5UK4.js +150 -0
  121. package/dist/chunk-A7KV5UK4.js.map +1 -0
  122. package/dist/chunk-APY2SS5X.js +156 -0
  123. package/dist/chunk-APY2SS5X.js.map +1 -0
  124. package/dist/chunk-AZDQPQ3V.js +66 -0
  125. package/dist/chunk-AZDQPQ3V.js.map +1 -0
  126. package/dist/chunk-BU3SEFA5.js +90 -0
  127. package/dist/chunk-BU3SEFA5.js.map +1 -0
  128. package/dist/chunk-BXGZFGZ4.js +189 -0
  129. package/dist/chunk-BXGZFGZ4.js.map +1 -0
  130. package/dist/chunk-CGHORL6G.js +579 -0
  131. package/dist/chunk-CGHORL6G.js.map +1 -0
  132. package/dist/chunk-CXANAIZU.js +530 -0
  133. package/dist/chunk-CXANAIZU.js.map +1 -0
  134. package/dist/chunk-CZQHCKKG.js +1 -0
  135. package/dist/chunk-CZQHCKKG.js.map +1 -0
  136. package/dist/chunk-DKNHAICT.js +133 -0
  137. package/dist/chunk-DKNHAICT.js.map +1 -0
  138. package/dist/chunk-DM4OMPWK.js +584 -0
  139. package/dist/chunk-DM4OMPWK.js.map +1 -0
  140. package/dist/chunk-DMSNO6ZB.js +452 -0
  141. package/dist/chunk-DMSNO6ZB.js.map +1 -0
  142. package/dist/chunk-E5OZPDIW.js +229 -0
  143. package/dist/chunk-E5OZPDIW.js.map +1 -0
  144. package/dist/chunk-EVYY4X5A.js +509 -0
  145. package/dist/chunk-EVYY4X5A.js.map +1 -0
  146. package/dist/chunk-FDFD67UO.js +1 -0
  147. package/dist/chunk-FDFD67UO.js.map +1 -0
  148. package/dist/chunk-FMPF42Q4.js +13 -0
  149. package/dist/chunk-FMPF42Q4.js.map +1 -0
  150. package/dist/chunk-FR6RGA3B.js +1277 -0
  151. package/dist/chunk-FR6RGA3B.js.map +1 -0
  152. package/dist/chunk-FW23JYNQ.js +454 -0
  153. package/dist/chunk-FW23JYNQ.js.map +1 -0
  154. package/dist/chunk-GBCENOLN.js +1575 -0
  155. package/dist/chunk-GBCENOLN.js.map +1 -0
  156. package/dist/chunk-HL7HUJIX.js +1 -0
  157. package/dist/chunk-HL7HUJIX.js.map +1 -0
  158. package/dist/chunk-HULCUY35.js +2508 -0
  159. package/dist/chunk-HULCUY35.js.map +1 -0
  160. package/dist/chunk-IHTWQEDR.js +169 -0
  161. package/dist/chunk-IHTWQEDR.js.map +1 -0
  162. package/dist/chunk-IJRR6YAI.js +128 -0
  163. package/dist/chunk-IJRR6YAI.js.map +1 -0
  164. package/dist/chunk-JGFRAFDL.js +221 -0
  165. package/dist/chunk-JGFRAFDL.js.map +1 -0
  166. package/dist/chunk-KIIXR252.js +211 -0
  167. package/dist/chunk-KIIXR252.js.map +1 -0
  168. package/dist/chunk-KN3H5CNT.js +11 -0
  169. package/dist/chunk-KN3H5CNT.js.map +1 -0
  170. package/dist/chunk-KPG3DGLA.js +1 -0
  171. package/dist/chunk-KPG3DGLA.js.map +1 -0
  172. package/dist/chunk-KRNQ6RGQ.js +1 -0
  173. package/dist/chunk-KRNQ6RGQ.js.map +1 -0
  174. package/dist/chunk-LBAJK24K.js +1071 -0
  175. package/dist/chunk-LBAJK24K.js.map +1 -0
  176. package/dist/chunk-MLTPJMH6.js +417 -0
  177. package/dist/chunk-MLTPJMH6.js.map +1 -0
  178. package/dist/chunk-N3SZ7BMH.js +95 -0
  179. package/dist/chunk-N3SZ7BMH.js.map +1 -0
  180. package/dist/chunk-NDUD3IMO.js +540 -0
  181. package/dist/chunk-NDUD3IMO.js.map +1 -0
  182. package/dist/chunk-NY2PYHNC.js +873 -0
  183. package/dist/chunk-NY2PYHNC.js.map +1 -0
  184. package/dist/chunk-O3MT7DYI.js +225 -0
  185. package/dist/chunk-O3MT7DYI.js.map +1 -0
  186. package/dist/chunk-OCUDSN63.js +2386 -0
  187. package/dist/chunk-OCUDSN63.js.map +1 -0
  188. package/dist/chunk-OIWU3NYV.js +199 -0
  189. package/dist/chunk-OIWU3NYV.js.map +1 -0
  190. package/dist/chunk-OO5BM6CJ.js +1153 -0
  191. package/dist/chunk-OO5BM6CJ.js.map +1 -0
  192. package/dist/chunk-OQUIJT7A.js +1 -0
  193. package/dist/chunk-OQUIJT7A.js.map +1 -0
  194. package/dist/chunk-P5LBT622.js +105 -0
  195. package/dist/chunk-P5LBT622.js.map +1 -0
  196. package/dist/chunk-PKGQG5QQ.js +519 -0
  197. package/dist/chunk-PKGQG5QQ.js.map +1 -0
  198. package/dist/chunk-PKPO3JTZ.js +561 -0
  199. package/dist/chunk-PKPO3JTZ.js.map +1 -0
  200. package/dist/chunk-PL5UDIQ5.js +118 -0
  201. package/dist/chunk-PL5UDIQ5.js.map +1 -0
  202. package/dist/chunk-PZWISPIQ.js +432 -0
  203. package/dist/chunk-PZWISPIQ.js.map +1 -0
  204. package/dist/chunk-Q3EYOCZB.js +510 -0
  205. package/dist/chunk-Q3EYOCZB.js.map +1 -0
  206. package/dist/chunk-QMBYUVRL.js +15 -0
  207. package/dist/chunk-QMBYUVRL.js.map +1 -0
  208. package/dist/chunk-RAGGHLCV.js +200 -0
  209. package/dist/chunk-RAGGHLCV.js.map +1 -0
  210. package/dist/chunk-RGL53X5G.js +574 -0
  211. package/dist/chunk-RGL53X5G.js.map +1 -0
  212. package/dist/chunk-RJOG4IJU.js +1039 -0
  213. package/dist/chunk-RJOG4IJU.js.map +1 -0
  214. package/dist/chunk-SOOKUYVM.js +403 -0
  215. package/dist/chunk-SOOKUYVM.js.map +1 -0
  216. package/dist/chunk-T5BN5KG7.js +1 -0
  217. package/dist/chunk-T5BN5KG7.js.map +1 -0
  218. package/dist/chunk-TP7244Y6.js +207 -0
  219. package/dist/chunk-TP7244Y6.js.map +1 -0
  220. package/dist/chunk-TSBFTJKM.js +57 -0
  221. package/dist/chunk-TSBFTJKM.js.map +1 -0
  222. package/dist/chunk-URQ2CBBF.js +143 -0
  223. package/dist/chunk-URQ2CBBF.js.map +1 -0
  224. package/dist/chunk-W2BOPXTI.js +1 -0
  225. package/dist/chunk-W2BOPXTI.js.map +1 -0
  226. package/dist/chunk-WKSWLSCX.js +207 -0
  227. package/dist/chunk-WKSWLSCX.js.map +1 -0
  228. package/dist/chunk-Y52CS6YA.js +88 -0
  229. package/dist/chunk-Y52CS6YA.js.map +1 -0
  230. package/dist/chunk-YCBUWK77.js +92 -0
  231. package/dist/chunk-YCBUWK77.js.map +1 -0
  232. package/dist/chunk-YJ4U2D2C.js +314 -0
  233. package/dist/chunk-YJ4U2D2C.js.map +1 -0
  234. package/dist/chunk-Z4YXAUDN.js +239 -0
  235. package/dist/chunk-Z4YXAUDN.js.map +1 -0
  236. package/dist/chunk-Z6EGP5D7.js +92 -0
  237. package/dist/chunk-Z6EGP5D7.js.map +1 -0
  238. package/dist/compat/index.cjs +3083 -2
  239. package/dist/compat/index.cjs.map +1 -1
  240. package/dist/compat/index.d.cts +116 -1
  241. package/dist/compat/index.d.ts +116 -1
  242. package/dist/compat/index.js +175 -2
  243. package/dist/compat/index.js.map +1 -1
  244. package/dist/compat/jotai/index.cjs +130 -2
  245. package/dist/compat/jotai/index.cjs.map +1 -1
  246. package/dist/compat/jotai/index.d.cts +2 -1
  247. package/dist/compat/jotai/index.d.ts +2 -1
  248. package/dist/compat/jotai/index.js +7 -2
  249. package/dist/compat/jotai/index.js.map +1 -1
  250. package/dist/compat/nanostores/index.cjs +186 -2
  251. package/dist/compat/nanostores/index.cjs.map +1 -1
  252. package/dist/compat/nanostores/index.d.cts +2 -1
  253. package/dist/compat/nanostores/index.d.ts +2 -1
  254. package/dist/compat/nanostores/index.js +21 -2
  255. package/dist/compat/nanostores/index.js.map +1 -1
  256. package/dist/compat/nestjs/index.cjs +2224 -2
  257. package/dist/compat/nestjs/index.cjs.map +1 -1
  258. package/dist/compat/nestjs/index.d.cts +10 -1
  259. package/dist/compat/nestjs/index.d.ts +10 -1
  260. package/dist/compat/nestjs/index.js +77 -2
  261. package/dist/compat/nestjs/index.js.map +1 -1
  262. package/dist/compat/react/index.cjs +95 -2
  263. package/dist/compat/react/index.cjs.map +1 -1
  264. package/dist/compat/react/index.d.cts +2 -1
  265. package/dist/compat/react/index.d.ts +2 -1
  266. package/dist/compat/react/index.js +11 -2
  267. package/dist/compat/react/index.js.map +1 -1
  268. package/dist/compat/solid/index.cjs +82 -2
  269. package/dist/compat/solid/index.cjs.map +1 -1
  270. package/dist/compat/solid/index.d.cts +2 -1
  271. package/dist/compat/solid/index.d.ts +2 -1
  272. package/dist/compat/solid/index.js +11 -2
  273. package/dist/compat/solid/index.js.map +1 -1
  274. package/dist/compat/svelte/index.cjs +85 -2
  275. package/dist/compat/svelte/index.cjs.map +1 -1
  276. package/dist/compat/svelte/index.d.cts +2 -1
  277. package/dist/compat/svelte/index.d.ts +2 -1
  278. package/dist/compat/svelte/index.js +11 -2
  279. package/dist/compat/svelte/index.js.map +1 -1
  280. package/dist/compat/vue/index.cjs +100 -2
  281. package/dist/compat/vue/index.cjs.map +1 -1
  282. package/dist/compat/vue/index.d.cts +3 -1
  283. package/dist/compat/vue/index.d.ts +3 -1
  284. package/dist/compat/vue/index.js +11 -2
  285. package/dist/compat/vue/index.js.map +1 -1
  286. package/dist/compat/zustand/index.cjs +50 -2
  287. package/dist/compat/zustand/index.cjs.map +1 -1
  288. package/dist/compat/zustand/index.d.cts +2 -1
  289. package/dist/compat/zustand/index.d.ts +2 -1
  290. package/dist/compat/zustand/index.js +7 -2
  291. package/dist/compat/zustand/index.js.map +1 -1
  292. package/dist/distill-De6Rnn15.d.cts +48 -0
  293. package/dist/distill-De6Rnn15.d.ts +48 -0
  294. package/dist/external-register-CWyroXb_.d.cts +138 -0
  295. package/dist/external-register-CWyroXb_.d.ts +138 -0
  296. package/dist/fallback-Bx46zqky.d.cts +243 -0
  297. package/dist/fallback-pIWW8A2d.d.ts +243 -0
  298. package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
  299. package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
  300. package/dist/index-5SU_O78r.d.cts +754 -0
  301. package/dist/index-B6pxYJzO.d.cts +36 -0
  302. package/dist/index-B6pxYJzO.d.ts +36 -0
  303. package/dist/index-BFsng6v1.d.cts +44 -0
  304. package/dist/index-BFsng6v1.d.ts +44 -0
  305. package/dist/index-Bg-LwEt-.d.cts +45 -0
  306. package/dist/index-Bg-LwEt-.d.ts +45 -0
  307. package/dist/index-Brp888t0.d.cts +127 -0
  308. package/dist/index-Brp888t0.d.ts +127 -0
  309. package/dist/index-CDfk6jHN.d.cts +37 -0
  310. package/dist/index-CDfk6jHN.d.ts +37 -0
  311. package/dist/index-CEXCtYYJ.d.ts +754 -0
  312. package/dist/index-DLAxYaN5.d.cts +169 -0
  313. package/dist/index-DLAxYaN5.d.ts +169 -0
  314. package/dist/index-DeWbQzMe.d.cts +34 -0
  315. package/dist/index-DeWbQzMe.d.ts +34 -0
  316. package/dist/index-dX9IzPqj.d.cts +86 -0
  317. package/dist/index-dX9IzPqj.d.ts +86 -0
  318. package/dist/index.cjs +25950 -0
  319. package/dist/index.cjs.map +1 -1
  320. package/dist/index.d.cts +56 -42
  321. package/dist/index.d.ts +56 -42
  322. package/dist/index.js +849 -0
  323. package/dist/index.js.map +1 -1
  324. package/dist/layout-types-B5aiHYgk.d.cts +72 -0
  325. package/dist/layout-types-B5aiHYgk.d.ts +72 -0
  326. package/dist/memory-composers-BryDrRBX.d.cts +529 -0
  327. package/dist/memory-composers-CVQqPYEV.d.ts +529 -0
  328. package/dist/observable-BXQoW1P-.d.cts +36 -0
  329. package/dist/observable-BXQoW1P-.d.ts +36 -0
  330. package/dist/pipeline-graph-Ce47CB6Y.d.cts +145 -0
  331. package/dist/pipeline-graph-DXCwY9vG.d.ts +145 -0
  332. package/dist/presets/ai/index.cjs +4377 -0
  333. package/dist/presets/ai/index.cjs.map +1 -0
  334. package/dist/presets/ai/index.d.cts +98 -0
  335. package/dist/presets/ai/index.d.ts +98 -0
  336. package/dist/presets/ai/index.js +54 -0
  337. package/dist/presets/ai/index.js.map +1 -0
  338. package/dist/presets/harness/index.cjs +5929 -0
  339. package/dist/presets/harness/index.cjs.map +1 -0
  340. package/dist/presets/harness/index.d.cts +566 -0
  341. package/dist/presets/harness/index.d.ts +566 -0
  342. package/dist/presets/harness/index.js +71 -0
  343. package/dist/presets/harness/index.js.map +1 -0
  344. package/dist/presets/index.cjs +9782 -0
  345. package/dist/presets/index.cjs.map +1 -0
  346. package/dist/presets/index.d.cts +28 -0
  347. package/dist/presets/index.d.ts +28 -0
  348. package/dist/presets/index.js +129 -0
  349. package/dist/presets/index.js.map +1 -0
  350. package/dist/presets/inspect/index.cjs +1087 -0
  351. package/dist/presets/inspect/index.cjs.map +1 -0
  352. package/dist/presets/inspect/index.d.cts +172 -0
  353. package/dist/presets/inspect/index.d.ts +172 -0
  354. package/dist/presets/inspect/index.js +21 -0
  355. package/dist/presets/inspect/index.js.map +1 -0
  356. package/dist/presets/resilience/index.cjs +1593 -0
  357. package/dist/presets/resilience/index.cjs.map +1 -0
  358. package/dist/presets/resilience/index.d.cts +205 -0
  359. package/dist/presets/resilience/index.d.ts +205 -0
  360. package/dist/presets/resilience/index.js +18 -0
  361. package/dist/presets/resilience/index.js.map +1 -0
  362. package/dist/rate-limiter-CEALq4N1.d.ts +559 -0
  363. package/dist/rate-limiter-DpVbSYdH.d.cts +559 -0
  364. package/dist/reactive-layout-fswlBUvX.d.cts +195 -0
  365. package/dist/reactive-layout-fswlBUvX.d.ts +195 -0
  366. package/dist/retry-BDbRZ_gx.d.ts +125 -0
  367. package/dist/retry-DWuhjvsA.d.cts +125 -0
  368. package/dist/solutions/index.cjs +8200 -0
  369. package/dist/solutions/index.cjs.map +1 -0
  370. package/dist/solutions/index.d.cts +23 -0
  371. package/dist/solutions/index.d.ts +23 -0
  372. package/dist/solutions/index.js +55 -0
  373. package/dist/solutions/index.js.map +1 -0
  374. package/dist/spawnable-5mDY501F.d.cts +746 -0
  375. package/dist/spawnable-D3lR0oQu.d.ts +746 -0
  376. package/dist/status-U-rUI79b.d.cts +84 -0
  377. package/dist/status-U-rUI79b.d.ts +84 -0
  378. package/dist/timeout-U5O4ESK3.js +12 -0
  379. package/dist/timeout-U5O4ESK3.js.map +1 -0
  380. package/dist/types-BB5Lw-pB.d.cts +442 -0
  381. package/dist/types-BB5Lw-pB.d.ts +442 -0
  382. package/dist/types-CJWIMJiZ.d.ts +548 -0
  383. package/dist/types-vCq7ShIm.d.cts +548 -0
  384. package/dist/utils/ai/browser.cjs +2169 -0
  385. package/dist/utils/ai/browser.cjs.map +1 -0
  386. package/dist/utils/ai/browser.d.cts +129 -0
  387. package/dist/utils/ai/browser.d.ts +129 -0
  388. package/dist/utils/ai/browser.js +255 -0
  389. package/dist/utils/ai/browser.js.map +1 -0
  390. package/dist/utils/ai/index.cjs +8468 -0
  391. package/dist/utils/ai/index.cjs.map +1 -0
  392. package/dist/utils/ai/index.d.cts +1777 -0
  393. package/dist/utils/ai/index.d.ts +1777 -0
  394. package/dist/utils/ai/index.js +173 -0
  395. package/dist/utils/ai/index.js.map +1 -0
  396. package/dist/utils/ai/node.cjs +648 -0
  397. package/dist/utils/ai/node.cjs.map +1 -0
  398. package/dist/utils/ai/node.d.cts +57 -0
  399. package/dist/utils/ai/node.d.ts +57 -0
  400. package/dist/utils/ai/node.js +84 -0
  401. package/dist/utils/ai/node.js.map +1 -0
  402. package/dist/utils/cqrs/index.cjs +1036 -0
  403. package/dist/utils/cqrs/index.cjs.map +1 -0
  404. package/dist/utils/cqrs/index.d.cts +438 -0
  405. package/dist/utils/cqrs/index.d.ts +438 -0
  406. package/dist/utils/cqrs/index.js +18 -0
  407. package/dist/utils/cqrs/index.js.map +1 -0
  408. package/dist/utils/demo-shell/index.cjs +865 -0
  409. package/dist/utils/demo-shell/index.cjs.map +1 -0
  410. package/dist/utils/demo-shell/index.d.cts +90 -0
  411. package/dist/utils/demo-shell/index.d.ts +90 -0
  412. package/dist/utils/demo-shell/index.js +13 -0
  413. package/dist/utils/demo-shell/index.js.map +1 -0
  414. package/dist/utils/domain-templates/index.cjs +732 -0
  415. package/dist/utils/domain-templates/index.cjs.map +1 -0
  416. package/dist/utils/domain-templates/index.d.cts +214 -0
  417. package/dist/utils/domain-templates/index.d.ts +214 -0
  418. package/dist/utils/domain-templates/index.js +17 -0
  419. package/dist/utils/domain-templates/index.js.map +1 -0
  420. package/dist/utils/graphspec/index.cjs +1174 -0
  421. package/dist/utils/graphspec/index.cjs.map +1 -0
  422. package/dist/utils/graphspec/index.d.cts +449 -0
  423. package/dist/utils/graphspec/index.d.ts +449 -0
  424. package/dist/utils/graphspec/index.js +35 -0
  425. package/dist/utils/graphspec/index.js.map +1 -0
  426. package/dist/utils/harness/index.cjs +656 -0
  427. package/dist/utils/harness/index.cjs.map +1 -0
  428. package/dist/utils/harness/index.d.cts +542 -0
  429. package/dist/utils/harness/index.d.ts +542 -0
  430. package/dist/utils/harness/index.js +56 -0
  431. package/dist/utils/harness/index.js.map +1 -0
  432. package/dist/utils/index.cjs +17609 -0
  433. package/dist/utils/index.cjs.map +1 -0
  434. package/dist/utils/index.d.cts +96 -0
  435. package/dist/utils/index.d.ts +96 -0
  436. package/dist/utils/index.js +514 -0
  437. package/dist/utils/index.js.map +1 -0
  438. package/dist/utils/inspect/index.cjs +807 -0
  439. package/dist/utils/inspect/index.cjs.map +1 -0
  440. package/dist/utils/inspect/index.d.cts +123 -0
  441. package/dist/utils/inspect/index.d.ts +123 -0
  442. package/dist/utils/inspect/index.js +30 -0
  443. package/dist/utils/inspect/index.js.map +1 -0
  444. package/dist/utils/job-queue/index.cjs +717 -0
  445. package/dist/utils/job-queue/index.cjs.map +1 -0
  446. package/dist/utils/job-queue/index.d.cts +200 -0
  447. package/dist/utils/job-queue/index.d.ts +200 -0
  448. package/dist/utils/job-queue/index.js +18 -0
  449. package/dist/utils/job-queue/index.js.map +1 -0
  450. package/dist/utils/memory/index.cjs +1451 -0
  451. package/dist/utils/memory/index.cjs.map +1 -0
  452. package/dist/utils/memory/index.d.cts +582 -0
  453. package/dist/utils/memory/index.d.ts +582 -0
  454. package/dist/utils/memory/index.js +19 -0
  455. package/dist/utils/memory/index.js.map +1 -0
  456. package/dist/utils/messaging/index.cjs +666 -0
  457. package/dist/utils/messaging/index.cjs.map +1 -0
  458. package/dist/utils/messaging/index.d.cts +562 -0
  459. package/dist/utils/messaging/index.d.ts +562 -0
  460. package/dist/utils/messaging/index.js +50 -0
  461. package/dist/utils/messaging/index.js.map +1 -0
  462. package/dist/utils/orchestration/index.cjs +876 -0
  463. package/dist/utils/orchestration/index.cjs.map +1 -0
  464. package/dist/utils/orchestration/index.d.cts +233 -0
  465. package/dist/utils/orchestration/index.d.ts +233 -0
  466. package/dist/utils/orchestration/index.js +19 -0
  467. package/dist/utils/orchestration/index.js.map +1 -0
  468. package/dist/utils/process/index.cjs +743 -0
  469. package/dist/utils/process/index.cjs.map +1 -0
  470. package/dist/utils/process/index.d.cts +411 -0
  471. package/dist/utils/process/index.d.ts +411 -0
  472. package/dist/utils/process/index.js +14 -0
  473. package/dist/utils/process/index.js.map +1 -0
  474. package/dist/utils/reactive-layout/index.cjs +1607 -0
  475. package/dist/utils/reactive-layout/index.cjs.map +1 -0
  476. package/dist/utils/reactive-layout/index.d.cts +492 -0
  477. package/dist/utils/reactive-layout/index.d.ts +492 -0
  478. package/dist/utils/reactive-layout/index.js +52 -0
  479. package/dist/utils/reactive-layout/index.js.map +1 -0
  480. package/dist/utils/reduction/index.cjs +203 -0
  481. package/dist/utils/reduction/index.cjs.map +1 -0
  482. package/dist/utils/reduction/index.d.cts +102 -0
  483. package/dist/utils/reduction/index.d.ts +102 -0
  484. package/dist/utils/reduction/index.js +14 -0
  485. package/dist/utils/reduction/index.js.map +1 -0
  486. package/dist/utils/resilience/index.cjs +1617 -0
  487. package/dist/utils/resilience/index.cjs.map +1 -0
  488. package/dist/utils/resilience/index.d.cts +9 -0
  489. package/dist/utils/resilience/index.d.ts +9 -0
  490. package/dist/utils/resilience/index.js +44 -0
  491. package/dist/utils/resilience/index.js.map +1 -0
  492. package/dist/utils/surface/index.cjs +1070 -0
  493. package/dist/utils/surface/index.cjs.map +1 -0
  494. package/dist/utils/surface/index.d.cts +240 -0
  495. package/dist/utils/surface/index.d.ts +240 -0
  496. package/dist/utils/surface/index.js +30 -0
  497. package/dist/utils/surface/index.js.map +1 -0
  498. package/dist/utils/topology-view/index.cjs +620 -0
  499. package/dist/utils/topology-view/index.cjs.map +1 -0
  500. package/dist/utils/topology-view/index.d.cts +68 -0
  501. package/dist/utils/topology-view/index.d.ts +68 -0
  502. package/dist/utils/topology-view/index.js +11 -0
  503. package/dist/utils/topology-view/index.js.map +1 -0
  504. package/package.json +293 -237
  505. package/dist/core/index.cjs +0 -21
  506. package/dist/core/index.cjs.map +0 -1
  507. package/dist/core/index.d.cts +0 -1
  508. package/dist/core/index.d.ts +0 -1
  509. package/dist/core/index.js +0 -3
  510. package/dist/core/index.js.map +0 -1
  511. package/dist/extra/browser.cjs +0 -21
  512. package/dist/extra/browser.cjs.map +0 -1
  513. package/dist/extra/browser.d.cts +0 -1
  514. package/dist/extra/browser.d.ts +0 -1
  515. package/dist/extra/browser.js +0 -3
  516. package/dist/extra/browser.js.map +0 -1
  517. package/dist/extra/index.cjs +0 -21
  518. package/dist/extra/index.cjs.map +0 -1
  519. package/dist/extra/index.d.cts +0 -1
  520. package/dist/extra/index.d.ts +0 -1
  521. package/dist/extra/index.js +0 -3
  522. package/dist/extra/index.js.map +0 -1
  523. package/dist/extra/node.cjs +0 -21
  524. package/dist/extra/node.cjs.map +0 -1
  525. package/dist/extra/node.d.cts +0 -1
  526. package/dist/extra/node.d.ts +0 -1
  527. package/dist/extra/node.js +0 -3
  528. package/dist/extra/node.js.map +0 -1
  529. package/dist/extra/operators.cjs +0 -21
  530. package/dist/extra/operators.cjs.map +0 -1
  531. package/dist/extra/operators.d.cts +0 -1
  532. package/dist/extra/operators.d.ts +0 -1
  533. package/dist/extra/operators.js +0 -3
  534. package/dist/extra/operators.js.map +0 -1
  535. package/dist/extra/reactive.cjs +0 -21
  536. package/dist/extra/reactive.cjs.map +0 -1
  537. package/dist/extra/reactive.d.cts +0 -1
  538. package/dist/extra/reactive.d.ts +0 -1
  539. package/dist/extra/reactive.js +0 -3
  540. package/dist/extra/reactive.js.map +0 -1
  541. package/dist/extra/render/index.cjs +0 -21
  542. package/dist/extra/render/index.cjs.map +0 -1
  543. package/dist/extra/render/index.d.cts +0 -1
  544. package/dist/extra/render/index.d.ts +0 -1
  545. package/dist/extra/render/index.js +0 -3
  546. package/dist/extra/render/index.js.map +0 -1
  547. package/dist/extra/sources.cjs +0 -21
  548. package/dist/extra/sources.cjs.map +0 -1
  549. package/dist/extra/sources.d.cts +0 -1
  550. package/dist/extra/sources.d.ts +0 -1
  551. package/dist/extra/sources.js +0 -3
  552. package/dist/extra/sources.js.map +0 -1
  553. package/dist/extra/storage-browser.cjs +0 -21
  554. package/dist/extra/storage-browser.cjs.map +0 -1
  555. package/dist/extra/storage-browser.d.cts +0 -1
  556. package/dist/extra/storage-browser.d.ts +0 -1
  557. package/dist/extra/storage-browser.js +0 -3
  558. package/dist/extra/storage-browser.js.map +0 -1
  559. package/dist/extra/storage-core.cjs +0 -21
  560. package/dist/extra/storage-core.cjs.map +0 -1
  561. package/dist/extra/storage-core.d.cts +0 -1
  562. package/dist/extra/storage-core.d.ts +0 -1
  563. package/dist/extra/storage-core.js +0 -3
  564. package/dist/extra/storage-core.js.map +0 -1
  565. package/dist/extra/storage-node.cjs +0 -21
  566. package/dist/extra/storage-node.cjs.map +0 -1
  567. package/dist/extra/storage-node.d.cts +0 -1
  568. package/dist/extra/storage-node.d.ts +0 -1
  569. package/dist/extra/storage-node.js +0 -3
  570. package/dist/extra/storage-node.js.map +0 -1
  571. package/dist/extra/storage-tiers-browser.cjs +0 -21
  572. package/dist/extra/storage-tiers-browser.cjs.map +0 -1
  573. package/dist/extra/storage-tiers-browser.d.cts +0 -1
  574. package/dist/extra/storage-tiers-browser.d.ts +0 -1
  575. package/dist/extra/storage-tiers-browser.js +0 -3
  576. package/dist/extra/storage-tiers-browser.js.map +0 -1
  577. package/dist/extra/storage-tiers-node.cjs +0 -21
  578. package/dist/extra/storage-tiers-node.cjs.map +0 -1
  579. package/dist/extra/storage-tiers-node.d.cts +0 -1
  580. package/dist/extra/storage-tiers-node.d.ts +0 -1
  581. package/dist/extra/storage-tiers-node.js +0 -3
  582. package/dist/extra/storage-tiers-node.js.map +0 -1
  583. package/dist/extra/storage-tiers.cjs +0 -21
  584. package/dist/extra/storage-tiers.cjs.map +0 -1
  585. package/dist/extra/storage-tiers.d.cts +0 -1
  586. package/dist/extra/storage-tiers.d.ts +0 -1
  587. package/dist/extra/storage-tiers.js +0 -3
  588. package/dist/extra/storage-tiers.js.map +0 -1
  589. package/dist/extra/storage-wal.cjs +0 -21
  590. package/dist/extra/storage-wal.cjs.map +0 -1
  591. package/dist/extra/storage-wal.d.cts +0 -1
  592. package/dist/extra/storage-wal.d.ts +0 -1
  593. package/dist/extra/storage-wal.js +0 -3
  594. package/dist/extra/storage-wal.js.map +0 -1
  595. package/dist/graph/index.cjs +0 -21
  596. package/dist/graph/index.cjs.map +0 -1
  597. package/dist/graph/index.d.cts +0 -1
  598. package/dist/graph/index.d.ts +0 -1
  599. package/dist/graph/index.js +0 -3
  600. package/dist/graph/index.js.map +0 -1
  601. package/dist/patterns/ai/browser.cjs +0 -21
  602. package/dist/patterns/ai/browser.cjs.map +0 -1
  603. package/dist/patterns/ai/browser.d.cts +0 -1
  604. package/dist/patterns/ai/browser.d.ts +0 -1
  605. package/dist/patterns/ai/browser.js +0 -3
  606. package/dist/patterns/ai/browser.js.map +0 -1
  607. package/dist/patterns/ai/index.cjs +0 -21
  608. package/dist/patterns/ai/index.cjs.map +0 -1
  609. package/dist/patterns/ai/index.d.cts +0 -1
  610. package/dist/patterns/ai/index.d.ts +0 -1
  611. package/dist/patterns/ai/index.js +0 -3
  612. package/dist/patterns/ai/index.js.map +0 -1
  613. package/dist/patterns/ai/node.cjs +0 -21
  614. package/dist/patterns/ai/node.cjs.map +0 -1
  615. package/dist/patterns/ai/node.d.cts +0 -1
  616. package/dist/patterns/ai/node.d.ts +0 -1
  617. package/dist/patterns/ai/node.js +0 -3
  618. package/dist/patterns/ai/node.js.map +0 -1
  619. package/dist/patterns/cqrs/index.cjs +0 -21
  620. package/dist/patterns/cqrs/index.cjs.map +0 -1
  621. package/dist/patterns/cqrs/index.d.cts +0 -1
  622. package/dist/patterns/cqrs/index.d.ts +0 -1
  623. package/dist/patterns/cqrs/index.js +0 -3
  624. package/dist/patterns/cqrs/index.js.map +0 -1
  625. package/dist/patterns/demo-shell/index.cjs +0 -21
  626. package/dist/patterns/demo-shell/index.cjs.map +0 -1
  627. package/dist/patterns/demo-shell/index.d.cts +0 -1
  628. package/dist/patterns/demo-shell/index.d.ts +0 -1
  629. package/dist/patterns/demo-shell/index.js +0 -3
  630. package/dist/patterns/demo-shell/index.js.map +0 -1
  631. package/dist/patterns/domain-templates/index.cjs +0 -21
  632. package/dist/patterns/domain-templates/index.cjs.map +0 -1
  633. package/dist/patterns/domain-templates/index.d.cts +0 -1
  634. package/dist/patterns/domain-templates/index.d.ts +0 -1
  635. package/dist/patterns/domain-templates/index.js +0 -3
  636. package/dist/patterns/domain-templates/index.js.map +0 -1
  637. package/dist/patterns/graphspec/index.cjs +0 -21
  638. package/dist/patterns/graphspec/index.cjs.map +0 -1
  639. package/dist/patterns/graphspec/index.d.cts +0 -1
  640. package/dist/patterns/graphspec/index.d.ts +0 -1
  641. package/dist/patterns/graphspec/index.js +0 -3
  642. package/dist/patterns/graphspec/index.js.map +0 -1
  643. package/dist/patterns/harness/index.cjs +0 -21
  644. package/dist/patterns/harness/index.cjs.map +0 -1
  645. package/dist/patterns/harness/index.d.cts +0 -1
  646. package/dist/patterns/harness/index.d.ts +0 -1
  647. package/dist/patterns/harness/index.js +0 -3
  648. package/dist/patterns/harness/index.js.map +0 -1
  649. package/dist/patterns/inspect/index.cjs +0 -21
  650. package/dist/patterns/inspect/index.cjs.map +0 -1
  651. package/dist/patterns/inspect/index.d.cts +0 -1
  652. package/dist/patterns/inspect/index.d.ts +0 -1
  653. package/dist/patterns/inspect/index.js +0 -3
  654. package/dist/patterns/inspect/index.js.map +0 -1
  655. package/dist/patterns/job-queue/index.cjs +0 -21
  656. package/dist/patterns/job-queue/index.cjs.map +0 -1
  657. package/dist/patterns/job-queue/index.d.cts +0 -1
  658. package/dist/patterns/job-queue/index.d.ts +0 -1
  659. package/dist/patterns/job-queue/index.js +0 -3
  660. package/dist/patterns/job-queue/index.js.map +0 -1
  661. package/dist/patterns/memory/index.cjs +0 -21
  662. package/dist/patterns/memory/index.cjs.map +0 -1
  663. package/dist/patterns/memory/index.d.cts +0 -1
  664. package/dist/patterns/memory/index.d.ts +0 -1
  665. package/dist/patterns/memory/index.js +0 -3
  666. package/dist/patterns/memory/index.js.map +0 -1
  667. package/dist/patterns/messaging/index.cjs +0 -21
  668. package/dist/patterns/messaging/index.cjs.map +0 -1
  669. package/dist/patterns/messaging/index.d.cts +0 -1
  670. package/dist/patterns/messaging/index.d.ts +0 -1
  671. package/dist/patterns/messaging/index.js +0 -3
  672. package/dist/patterns/messaging/index.js.map +0 -1
  673. package/dist/patterns/orchestration/index.cjs +0 -21
  674. package/dist/patterns/orchestration/index.cjs.map +0 -1
  675. package/dist/patterns/orchestration/index.d.cts +0 -1
  676. package/dist/patterns/orchestration/index.d.ts +0 -1
  677. package/dist/patterns/orchestration/index.js +0 -3
  678. package/dist/patterns/orchestration/index.js.map +0 -1
  679. package/dist/patterns/process/index.cjs +0 -21
  680. package/dist/patterns/process/index.cjs.map +0 -1
  681. package/dist/patterns/process/index.d.cts +0 -1
  682. package/dist/patterns/process/index.d.ts +0 -1
  683. package/dist/patterns/process/index.js +0 -3
  684. package/dist/patterns/process/index.js.map +0 -1
  685. package/dist/patterns/reactive-layout/index.cjs +0 -21
  686. package/dist/patterns/reactive-layout/index.cjs.map +0 -1
  687. package/dist/patterns/reactive-layout/index.d.cts +0 -1
  688. package/dist/patterns/reactive-layout/index.d.ts +0 -1
  689. package/dist/patterns/reactive-layout/index.js +0 -3
  690. package/dist/patterns/reactive-layout/index.js.map +0 -1
  691. package/dist/patterns/reduction/index.cjs +0 -21
  692. package/dist/patterns/reduction/index.cjs.map +0 -1
  693. package/dist/patterns/reduction/index.d.cts +0 -1
  694. package/dist/patterns/reduction/index.d.ts +0 -1
  695. package/dist/patterns/reduction/index.js +0 -3
  696. package/dist/patterns/reduction/index.js.map +0 -1
  697. package/dist/patterns/surface/index.cjs +0 -21
  698. package/dist/patterns/surface/index.cjs.map +0 -1
  699. package/dist/patterns/surface/index.d.cts +0 -1
  700. package/dist/patterns/surface/index.d.ts +0 -1
  701. package/dist/patterns/surface/index.js +0 -3
  702. package/dist/patterns/surface/index.js.map +0 -1
  703. package/dist/patterns/topology-view/index.cjs +0 -21
  704. package/dist/patterns/topology-view/index.cjs.map +0 -1
  705. package/dist/patterns/topology-view/index.d.cts +0 -1
  706. package/dist/patterns/topology-view/index.d.ts +0 -1
  707. package/dist/patterns/topology-view/index.js +0 -3
  708. package/dist/patterns/topology-view/index.js.map +0 -1
  709. package/dist/testing/index.cjs +0 -21
  710. package/dist/testing/index.cjs.map +0 -1
  711. package/dist/testing/index.d.cts +0 -1
  712. package/dist/testing/index.d.ts +0 -1
  713. package/dist/testing/index.js +0 -3
  714. package/dist/testing/index.js.map +0 -1
@@ -0,0 +1,811 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/base/composition/index.ts
21
+ var composition_exports = {};
22
+ __export(composition_exports, {
23
+ NativePubSubBackend: () => NativePubSubBackend,
24
+ createWatermarkController: () => createWatermarkController,
25
+ distill: () => distill,
26
+ externalBundle: () => externalBundle,
27
+ externalProducer: () => externalProducer,
28
+ materialize: () => materialize,
29
+ pubsub: () => pubsub,
30
+ selector: () => selector,
31
+ singleFromAny: () => singleFromAny,
32
+ singleNodeFromAny: () => singleNodeFromAny,
33
+ toObservable: () => toObservable,
34
+ verifiable: () => verifiable
35
+ });
36
+ module.exports = __toCommonJS(composition_exports);
37
+
38
+ // src/base/composition/backpressure.ts
39
+ var import_core = require("@graphrefly/pure-ts/core");
40
+ var nextLockId = 0;
41
+ function createWatermarkController(sendUp, opts) {
42
+ if (opts.highWaterMark < 1) throw new RangeError("highWaterMark must be >= 1");
43
+ if (opts.lowWaterMark < 0) throw new RangeError("lowWaterMark must be >= 0");
44
+ if (opts.lowWaterMark >= opts.highWaterMark)
45
+ throw new RangeError("lowWaterMark must be < highWaterMark");
46
+ const lockId = /* @__PURE__ */ Symbol(`bp-${++nextLockId}`);
47
+ let pending = 0;
48
+ let paused = false;
49
+ return {
50
+ onEnqueue() {
51
+ pending += 1;
52
+ if (!paused && pending >= opts.highWaterMark) {
53
+ paused = true;
54
+ sendUp([[import_core.PAUSE, lockId]]);
55
+ return true;
56
+ }
57
+ return false;
58
+ },
59
+ onDequeue() {
60
+ if (pending > 0) pending -= 1;
61
+ if (paused && pending <= opts.lowWaterMark) {
62
+ paused = false;
63
+ sendUp([[import_core.RESUME, lockId]]);
64
+ return true;
65
+ }
66
+ return false;
67
+ },
68
+ get pending() {
69
+ return pending;
70
+ },
71
+ get paused() {
72
+ return paused;
73
+ },
74
+ dispose() {
75
+ if (paused) {
76
+ paused = false;
77
+ sendUp([[import_core.RESUME, lockId]]);
78
+ }
79
+ }
80
+ };
81
+ }
82
+
83
+ // src/base/composition/distill.ts
84
+ var import_core3 = require("@graphrefly/pure-ts/core");
85
+ var import_extra3 = require("@graphrefly/pure-ts/extra");
86
+
87
+ // src/base/sources/async.ts
88
+ var import_core2 = require("@graphrefly/pure-ts/core");
89
+ var import_extra = require("@graphrefly/pure-ts/extra");
90
+ var import_extra2 = require("@graphrefly/pure-ts/extra");
91
+ function forEach(source, fn, opts) {
92
+ const inner = (0, import_core2.node)(
93
+ [source],
94
+ (data, _actions) => {
95
+ const batch0 = data[0];
96
+ if (batch0 != null && batch0.length > 0) {
97
+ for (const v of batch0) fn(v);
98
+ }
99
+ },
100
+ { describeKind: "effect", ...opts }
101
+ );
102
+ return inner.subscribe(() => {
103
+ });
104
+ }
105
+
106
+ // src/base/composition/distill.ts
107
+ function isNodeLike(value) {
108
+ return typeof value === "object" && value !== null && "cache" in value && typeof value.subscribe === "function";
109
+ }
110
+ function keepalive(node8) {
111
+ node8.subscribe(() => void 0);
112
+ }
113
+ function mapFromSnapshot(snapshot) {
114
+ if (snapshot instanceof Map) return snapshot;
115
+ return /* @__PURE__ */ new Map();
116
+ }
117
+ function applyExtraction(store, extraction) {
118
+ if (!Array.isArray(extraction.upsert)) {
119
+ throw new TypeError("distill extraction requires upsert: Array<{ key, value }>");
120
+ }
121
+ (0, import_core3.batch)(() => {
122
+ for (const { key, value } of extraction.upsert) {
123
+ store.set(key, value);
124
+ }
125
+ for (const key of extraction.remove ?? []) {
126
+ store.delete(key);
127
+ }
128
+ });
129
+ }
130
+ function distill(source, extractFn, opts) {
131
+ const sourceNode = (0, import_extra3.fromAny)(source);
132
+ const store = (0, import_extra3.reactiveMap)(opts.mapOptions ?? {});
133
+ const budget = opts.budget ?? 2e3;
134
+ const hasContext = opts.context !== void 0 && opts.context !== null;
135
+ const contextNode = hasContext ? (0, import_extra3.fromAny)(opts.context) : (0, import_core3.node)([], { initial: null });
136
+ const extractionStream = (0, import_extra3.fromAny)(
137
+ extractFn(sourceNode, store.entries)
138
+ );
139
+ forEach(extractionStream, (extraction) => {
140
+ applyExtraction(store, extraction);
141
+ });
142
+ if (opts.evict) {
143
+ const verdictUnsubs = /* @__PURE__ */ new Map();
144
+ const evictionKeys = (0, import_core3.node)(
145
+ [store.entries],
146
+ (batchData, actions, ctx) => {
147
+ const batch0 = batchData[0];
148
+ const snapshot = batch0 != null && batch0.length > 0 ? batch0.at(-1) : ctx.prevData[0];
149
+ const out = [];
150
+ const entries = mapFromSnapshot(snapshot);
151
+ for (const key of verdictUnsubs.keys()) {
152
+ if (!entries.has(key)) {
153
+ verdictUnsubs.get(key)();
154
+ verdictUnsubs.delete(key);
155
+ }
156
+ }
157
+ for (const [key, mem] of entries) {
158
+ const verdict = opts.evict(key, mem);
159
+ if (isNodeLike(verdict)) {
160
+ if (!verdictUnsubs.has(key)) {
161
+ const unsub = forEach(verdict, (val) => {
162
+ if (val === true && store.has(key)) {
163
+ store.delete(key);
164
+ }
165
+ });
166
+ verdictUnsubs.set(key, unsub);
167
+ }
168
+ continue;
169
+ }
170
+ if (typeof verdict === "boolean") {
171
+ if (verdict) out.push(key);
172
+ continue;
173
+ }
174
+ throw new TypeError("distill evict() must return boolean or Node<boolean>");
175
+ }
176
+ actions.emit(out);
177
+ },
178
+ { describeKind: "derived" }
179
+ );
180
+ forEach(evictionKeys, (keys) => {
181
+ for (const key of keys) store.delete(key);
182
+ });
183
+ }
184
+ const hasConsolidateTrigger = opts.consolidateTrigger !== void 0 && opts.consolidateTrigger !== null;
185
+ if (opts.consolidate && hasConsolidateTrigger) {
186
+ const consolidateTriggerNode = (0, import_extra3.fromAny)(opts.consolidateTrigger);
187
+ const consolidatePaired = (0, import_extra3.withLatestFrom)(
188
+ consolidateTriggerNode,
189
+ store.entries
190
+ );
191
+ const consolidationStream = (0, import_extra3.switchMap)(
192
+ consolidatePaired,
193
+ ([, entries]) => opts.consolidate(mapFromSnapshot(entries))
194
+ );
195
+ forEach(consolidationStream, (extraction) => {
196
+ applyExtraction(store, extraction);
197
+ });
198
+ }
199
+ const compact = (0, import_core3.node)(
200
+ [store.entries, contextNode],
201
+ (batchData, actions, ctx) => {
202
+ const data = batchData.map(
203
+ (batch5, i) => batch5 != null && batch5.length > 0 ? batch5.at(-1) : ctx.prevData[i]
204
+ );
205
+ const snapshot = data[0];
206
+ const context = data[1];
207
+ const map = mapFromSnapshot(snapshot);
208
+ const entries = [...map.entries()].map(([key, value]) => ({
209
+ key,
210
+ value,
211
+ score: opts.score(value, context),
212
+ cost: opts.cost(value)
213
+ }));
214
+ entries.sort((a, b) => b.score - a.score);
215
+ const packed = [];
216
+ let remaining = budget;
217
+ for (const item of entries) {
218
+ if (item.cost <= remaining) {
219
+ packed.push({ key: item.key, value: item.value, score: item.score });
220
+ remaining -= item.cost;
221
+ }
222
+ }
223
+ actions.emit(packed);
224
+ },
225
+ { describeKind: "derived", meta: { ...(0, import_core3.factoryTag)("distill", { budget }) } }
226
+ );
227
+ const size = (0, import_core3.node)(
228
+ [store.entries],
229
+ (batchData, actions, ctx) => {
230
+ const batch0 = batchData[0];
231
+ const snapshot = batch0 != null && batch0.length > 0 ? batch0.at(-1) : ctx.prevData[0];
232
+ actions.emit(mapFromSnapshot(snapshot).size);
233
+ },
234
+ { describeKind: "derived" }
235
+ );
236
+ keepalive(compact);
237
+ keepalive(size);
238
+ return { store, compact, size };
239
+ }
240
+
241
+ // src/base/composition/external-register.ts
242
+ var import_core4 = require("@graphrefly/pure-ts/core");
243
+ function sourceOpts2(opts) {
244
+ return { describeKind: "producer", ...opts };
245
+ }
246
+ function externalProducer(register, opts) {
247
+ return (0, import_core4.node)((_data, a) => {
248
+ let active = true;
249
+ const triad = {
250
+ emit(value) {
251
+ if (!active) return;
252
+ a.emit(value);
253
+ },
254
+ error(err) {
255
+ if (!active) return;
256
+ active = false;
257
+ a.down([[import_core4.ERROR, err]]);
258
+ },
259
+ complete() {
260
+ if (!active) return;
261
+ active = false;
262
+ a.down([[import_core4.COMPLETE]]);
263
+ }
264
+ };
265
+ let cleanup;
266
+ try {
267
+ const ret = register(triad);
268
+ cleanup = typeof ret === "function" ? ret : void 0;
269
+ } catch (err) {
270
+ triad.error(err);
271
+ return () => {
272
+ active = false;
273
+ };
274
+ }
275
+ return () => {
276
+ active = false;
277
+ try {
278
+ cleanup?.();
279
+ } catch {
280
+ }
281
+ };
282
+ }, sourceOpts2(opts));
283
+ }
284
+ function externalBundle(register, channels, opts) {
285
+ let active = true;
286
+ let cleanup;
287
+ let activatedCount = 0;
288
+ let teardownCount = 0;
289
+ const nodes = {};
290
+ const channelNodes = [];
291
+ const finishCleanup = () => {
292
+ const fn = cleanup;
293
+ cleanup = void 0;
294
+ try {
295
+ fn?.();
296
+ } catch {
297
+ }
298
+ };
299
+ for (const ch of channels) {
300
+ const name = opts?.name ? `${opts.name}::${ch}` : ch;
301
+ const chOpts = opts?.channelOpts?.[ch];
302
+ const n = (0, import_core4.node)(
303
+ (_data, _a) => {
304
+ activatedCount++;
305
+ return () => {
306
+ teardownCount++;
307
+ if (activatedCount > 0 && teardownCount >= activatedCount && teardownCount >= channels.length) {
308
+ finishCleanup();
309
+ }
310
+ };
311
+ },
312
+ sourceOpts2({ ...chOpts, name })
313
+ );
314
+ nodes[ch] = n;
315
+ channelNodes.push(n);
316
+ }
317
+ const bundle = {};
318
+ for (const ch of channels) {
319
+ bundle[ch] = (value) => {
320
+ if (!active) return;
321
+ nodes[ch].down([[import_core4.DATA, value]]);
322
+ };
323
+ }
324
+ bundle.error = (err) => {
325
+ if (!active) return;
326
+ active = false;
327
+ (0, import_core4.batch)(() => {
328
+ for (const n of channelNodes) n.down([[import_core4.ERROR, err]]);
329
+ });
330
+ finishCleanup();
331
+ };
332
+ bundle.complete = () => {
333
+ if (!active) return;
334
+ active = false;
335
+ (0, import_core4.batch)(() => {
336
+ for (const n of channelNodes) n.down([[import_core4.COMPLETE]]);
337
+ });
338
+ finishCleanup();
339
+ };
340
+ const ret = register(bundle);
341
+ cleanup = typeof ret === "function" ? ret : void 0;
342
+ const dispose = () => {
343
+ if (!active) return;
344
+ active = false;
345
+ (0, import_core4.batch)(() => {
346
+ for (const n of channelNodes) {
347
+ try {
348
+ n.down([[import_core4.COMPLETE]]);
349
+ } catch {
350
+ }
351
+ }
352
+ });
353
+ finishCleanup();
354
+ };
355
+ return Object.assign(nodes, { dispose });
356
+ }
357
+
358
+ // src/base/composition/materialize.ts
359
+ var import_core5 = require("@graphrefly/pure-ts/core");
360
+ function operatorOpts(opts) {
361
+ return { describeKind: "derived", ...opts };
362
+ }
363
+ function selector(input, fn, opts) {
364
+ const equals = opts?.equals ?? Object.is;
365
+ let cleanup;
366
+ return (0, import_core5.node)(
367
+ [input],
368
+ (data, a, ctx) => {
369
+ if (cleanup === void 0) {
370
+ const store = ctx.store;
371
+ cleanup = {
372
+ onDeactivation: () => {
373
+ delete store.prev;
374
+ delete store.hasPrev;
375
+ }
376
+ };
377
+ }
378
+ const batch0 = data[0];
379
+ if (batch0 == null || batch0.length === 0) {
380
+ a.down([[import_core5.RESOLVED]]);
381
+ return cleanup;
382
+ }
383
+ const toEmit = [];
384
+ let prev = ctx.store.hasPrev ? ctx.store.prev : void 0;
385
+ let hasPrev = ctx.store.hasPrev;
386
+ for (const v of batch0) {
387
+ const key = fn(v);
388
+ if (hasPrev) {
389
+ let same;
390
+ try {
391
+ same = equals(prev, key);
392
+ } catch (err) {
393
+ a.down([[import_core5.ERROR, err]]);
394
+ return;
395
+ }
396
+ if (same) continue;
397
+ }
398
+ prev = key;
399
+ hasPrev = true;
400
+ toEmit.push(key);
401
+ }
402
+ if (toEmit.length === 0) {
403
+ a.down([[import_core5.RESOLVED]]);
404
+ return cleanup;
405
+ }
406
+ ctx.store.prev = prev;
407
+ ctx.store.hasPrev = true;
408
+ for (const k of toEmit) a.emit(k);
409
+ return cleanup;
410
+ },
411
+ {
412
+ ...operatorOpts(opts),
413
+ meta: { ...(0, import_core5.factoryTag)("selector"), ...opts?.meta ?? {} }
414
+ }
415
+ );
416
+ }
417
+ function materialize(key, factories, parent, opts) {
418
+ const slotName = opts?.slotName ?? "materialized";
419
+ return (0, import_core5.node)(
420
+ (_data, a) => {
421
+ let currentKey;
422
+ let hasCurrentKey = false;
423
+ let currentGraph;
424
+ let latestFactories;
425
+ let terminated = false;
426
+ function unmountCurrent() {
427
+ if (currentGraph === void 0) return;
428
+ try {
429
+ parent.remove(slotName);
430
+ } catch {
431
+ }
432
+ currentGraph = void 0;
433
+ }
434
+ const facUnsub = factories.subscribe((msgs) => {
435
+ if (terminated) return;
436
+ for (const m of msgs) {
437
+ if (m[0] === import_core5.DATA) {
438
+ latestFactories = m[1];
439
+ }
440
+ }
441
+ });
442
+ const keyUnsub = key.subscribe((msgs) => {
443
+ if (terminated) return;
444
+ for (const m of msgs) {
445
+ if (m[0] === import_core5.DATA) {
446
+ const newKey = m[1];
447
+ const keyChanged = !hasCurrentKey || newKey !== currentKey;
448
+ if (keyChanged) {
449
+ unmountCurrent();
450
+ if (latestFactories !== void 0) {
451
+ const factory = latestFactories.get(newKey);
452
+ if (factory !== void 0) {
453
+ currentGraph = factory();
454
+ parent.mount(slotName, currentGraph);
455
+ }
456
+ }
457
+ currentKey = newKey;
458
+ hasCurrentKey = true;
459
+ }
460
+ if (currentGraph !== void 0) {
461
+ a.emit(currentGraph);
462
+ } else {
463
+ a.down([[import_core5.RESOLVED]]);
464
+ }
465
+ } else if (m[0] === import_core5.COMPLETE) {
466
+ terminated = true;
467
+ a.down([[import_core5.COMPLETE]]);
468
+ } else if (m[0] === import_core5.ERROR) {
469
+ terminated = true;
470
+ a.down([m]);
471
+ }
472
+ }
473
+ });
474
+ return () => {
475
+ terminated = true;
476
+ keyUnsub();
477
+ facUnsub();
478
+ unmountCurrent();
479
+ };
480
+ },
481
+ {
482
+ ...operatorOpts(opts),
483
+ meta: { ...(0, import_core5.factoryTag)("materialize"), slotName, ...opts?.meta ?? {} }
484
+ }
485
+ );
486
+ }
487
+
488
+ // src/base/composition/observable.ts
489
+ var import_core6 = require("@graphrefly/pure-ts/core");
490
+ var import_rxjs = require("rxjs");
491
+ function toObservable(node8, options) {
492
+ if (options?.raw) {
493
+ return new import_rxjs.Observable((subscriber) => {
494
+ const unsub = node8.subscribe((msgs) => {
495
+ if (subscriber.closed) return;
496
+ subscriber.next(msgs);
497
+ for (const m of msgs) {
498
+ if (m[0] === import_core6.ERROR) {
499
+ subscriber.error(m[1]);
500
+ return;
501
+ }
502
+ if (m[0] === import_core6.COMPLETE) {
503
+ subscriber.complete();
504
+ return;
505
+ }
506
+ }
507
+ });
508
+ return unsub;
509
+ });
510
+ }
511
+ return new import_rxjs.Observable((subscriber) => {
512
+ const unsub = node8.subscribe((msgs) => {
513
+ for (const m of msgs) {
514
+ if (subscriber.closed) return;
515
+ if (m[0] === import_core6.DATA) {
516
+ subscriber.next(m[1]);
517
+ } else if (m[0] === import_core6.ERROR) {
518
+ subscriber.error(m[1]);
519
+ return;
520
+ } else if (m[0] === import_core6.COMPLETE) {
521
+ subscriber.complete();
522
+ return;
523
+ }
524
+ }
525
+ });
526
+ return unsub;
527
+ });
528
+ }
529
+
530
+ // src/base/composition/pubsub.ts
531
+ var import_core7 = require("@graphrefly/pure-ts/core");
532
+ var import_extra4 = require("@graphrefly/pure-ts/extra");
533
+ var NativePubSubBackend = class {
534
+ _version = 0;
535
+ _topics = /* @__PURE__ */ new Set();
536
+ get version() {
537
+ return this._version;
538
+ }
539
+ get topicCount() {
540
+ return this._topics.size;
541
+ }
542
+ hasTopic(name) {
543
+ return this._topics.has(name);
544
+ }
545
+ topicNames() {
546
+ return this._topics.values();
547
+ }
548
+ createTopic(name) {
549
+ if (this._topics.has(name)) return false;
550
+ this._topics.add(name);
551
+ this._version += 1;
552
+ return true;
553
+ }
554
+ removeTopic(name) {
555
+ const had = this._topics.delete(name);
556
+ if (had) this._version += 1;
557
+ return had;
558
+ }
559
+ };
560
+ function pubsub(options = {}) {
561
+ const { backend: userBackend, mutationLog: mutLogOpt } = options;
562
+ const backend = userBackend ?? new NativePubSubBackend();
563
+ const nodes = /* @__PURE__ */ new Map();
564
+ const mutLog = mutLogOpt ? (0, import_extra4.reactiveLog)(void 0, {
565
+ name: mutLogOpt === true ? "pubsub.mutationLog" : mutLogOpt.name ?? "pubsub.mutationLog",
566
+ maxSize: mutLogOpt === true ? void 0 : mutLogOpt.maxSize
567
+ }) : void 0;
568
+ let mutVersion = 0;
569
+ function recordChange(change) {
570
+ if (!mutLog) return;
571
+ mutLog.append({
572
+ structure: "pubsub",
573
+ version: ++mutVersion,
574
+ t_ns: (0, import_core7.wallClockNs)(),
575
+ lifecycle: "data",
576
+ change
577
+ });
578
+ }
579
+ function ensureTopic(name) {
580
+ let n = nodes.get(name);
581
+ if (n === void 0) {
582
+ n = (0, import_core7.node)({ describeKind: "state" });
583
+ nodes.set(name, n);
584
+ backend.createTopic(name);
585
+ }
586
+ return n;
587
+ }
588
+ return {
589
+ topic(name) {
590
+ return ensureTopic(name);
591
+ },
592
+ publish(name, value) {
593
+ if (!mutLog) {
594
+ ensureTopic(name).emit(value);
595
+ return;
596
+ }
597
+ (0, import_core7.batch)(() => {
598
+ ensureTopic(name).emit(value);
599
+ recordChange({ kind: "publish", value });
600
+ });
601
+ },
602
+ publishMany(entries) {
603
+ (0, import_core7.batch)(() => {
604
+ for (const [name, value] of entries) {
605
+ ensureTopic(name).emit(value);
606
+ recordChange({ kind: "publish", value });
607
+ }
608
+ });
609
+ },
610
+ removeTopic(name) {
611
+ const n = nodes.get(name);
612
+ if (n === void 0) return false;
613
+ nodes.delete(name);
614
+ backend.removeTopic(name);
615
+ if (!mutLog) {
616
+ n.down([[import_core7.TEARDOWN]]);
617
+ return true;
618
+ }
619
+ (0, import_core7.batch)(() => {
620
+ recordChange({ kind: "remove", name });
621
+ n.down([[import_core7.TEARDOWN]]);
622
+ });
623
+ return true;
624
+ },
625
+ has(name) {
626
+ return backend.hasTopic(name);
627
+ },
628
+ get size() {
629
+ return backend.topicCount;
630
+ },
631
+ topicNames() {
632
+ return backend.topicNames();
633
+ },
634
+ mutationLog: mutLog
635
+ };
636
+ }
637
+
638
+ // src/base/composition/single-from-any.ts
639
+ var import_core9 = require("@graphrefly/pure-ts/core");
640
+ var import_extra5 = require("@graphrefly/pure-ts/extra");
641
+
642
+ // src/base/sources/settled.ts
643
+ var import_core8 = require("@graphrefly/pure-ts/core");
644
+ function firstValueFrom(source) {
645
+ return new Promise((resolve, reject) => {
646
+ let settled = false;
647
+ let shouldUnsub = false;
648
+ let unsub;
649
+ unsub = source.subscribe((msgs) => {
650
+ for (const m of msgs) {
651
+ if (settled) return;
652
+ if (m[0] === import_core8.DATA) {
653
+ settled = true;
654
+ resolve(m[1]);
655
+ if (unsub) {
656
+ unsub();
657
+ unsub = void 0;
658
+ } else shouldUnsub = true;
659
+ return;
660
+ }
661
+ if (m[0] === import_core8.ERROR) {
662
+ settled = true;
663
+ reject(m[1]);
664
+ if (unsub) {
665
+ unsub();
666
+ unsub = void 0;
667
+ } else shouldUnsub = true;
668
+ return;
669
+ }
670
+ if (m[0] === import_core8.COMPLETE) {
671
+ settled = true;
672
+ reject(new Error("completed without DATA"));
673
+ if (unsub) {
674
+ unsub();
675
+ unsub = void 0;
676
+ } else shouldUnsub = true;
677
+ return;
678
+ }
679
+ }
680
+ });
681
+ if (shouldUnsub) {
682
+ unsub?.();
683
+ unsub = void 0;
684
+ }
685
+ });
686
+ }
687
+
688
+ // src/base/composition/single-from-any.ts
689
+ function singleFromAny(factory, opts = {}) {
690
+ const keyFn = opts.keyFn ?? ((k) => String(k));
691
+ const inFlight = /* @__PURE__ */ new Map();
692
+ return (key) => {
693
+ const k = keyFn(key);
694
+ const existing = inFlight.get(k);
695
+ if (existing) return existing;
696
+ const input = factory(key);
697
+ let rawPromise;
698
+ if (input != null && typeof input.then === "function") {
699
+ rawPromise = Promise.resolve(input);
700
+ } else if (input != null && typeof input === "object" && "subscribe" in input && "cache" in input) {
701
+ rawPromise = firstValueFrom(input);
702
+ } else if (input != null && typeof input === "object" && Symbol.asyncIterator in input) {
703
+ rawPromise = (async () => {
704
+ const iter = input[Symbol.asyncIterator]();
705
+ try {
706
+ const { value, done } = await iter.next();
707
+ if (done) throw new Error("singleFromAny: factory returned empty async iterable");
708
+ return value;
709
+ } finally {
710
+ await iter.return?.();
711
+ }
712
+ })();
713
+ } else if (input != null && typeof input === "object" && Symbol.iterator in input) {
714
+ rawPromise = (async () => {
715
+ const iter = input[Symbol.iterator]();
716
+ try {
717
+ const { value, done } = iter.next();
718
+ if (done) throw new Error("singleFromAny: factory returned empty iterable");
719
+ return value;
720
+ } finally {
721
+ iter.return?.();
722
+ }
723
+ })();
724
+ } else {
725
+ rawPromise = Promise.resolve(input);
726
+ }
727
+ let tracked;
728
+ const cleanup = () => {
729
+ if (inFlight.get(k) === tracked) inFlight.delete(k);
730
+ };
731
+ tracked = rawPromise.then(
732
+ (v) => {
733
+ cleanup();
734
+ return v;
735
+ },
736
+ (e) => {
737
+ cleanup();
738
+ throw e;
739
+ }
740
+ );
741
+ inFlight.set(k, tracked);
742
+ return tracked;
743
+ };
744
+ }
745
+ function singleNodeFromAny(factory, opts = {}) {
746
+ const keyFn = opts.keyFn ?? ((k) => String(k));
747
+ const inFlight = /* @__PURE__ */ new Map();
748
+ return (key) => {
749
+ const k = keyFn(key);
750
+ const existing = inFlight.get(k);
751
+ if (existing) return existing;
752
+ const node8 = (0, import_extra5.fromAny)(factory(key));
753
+ inFlight.set(k, node8);
754
+ const unsub = node8.subscribe((msgs) => {
755
+ for (const m of msgs) {
756
+ if (m[0] === import_core9.ERROR || m[0] === import_core9.COMPLETE) {
757
+ if (inFlight.get(k) === node8) inFlight.delete(k);
758
+ unsub();
759
+ return;
760
+ }
761
+ }
762
+ });
763
+ return node8;
764
+ };
765
+ }
766
+
767
+ // src/base/composition/verifiable.ts
768
+ var import_core10 = require("@graphrefly/pure-ts/core");
769
+ var import_extra6 = require("@graphrefly/pure-ts/extra");
770
+ function verifiable(source, verifyFn, opts) {
771
+ const sourceNode = (0, import_extra6.fromAny)(source);
772
+ const hasSourceVersioning = sourceNode.v != null;
773
+ const verified = (0, import_core10.node)([], {
774
+ initial: opts?.initialVerified ?? null,
775
+ meta: {
776
+ ...(0, import_core10.factoryTag)("verifiable"),
777
+ ...hasSourceVersioning ? { sourceVersion: null } : {}
778
+ }
779
+ });
780
+ const hasTrigger = opts?.trigger !== void 0 && opts.trigger !== null;
781
+ let triggerNode = null;
782
+ if (hasTrigger && opts?.autoVerify) {
783
+ triggerNode = (0, import_extra6.merge)((0, import_extra6.fromAny)(opts.trigger), sourceNode);
784
+ } else if (hasTrigger) {
785
+ triggerNode = (0, import_extra6.fromAny)(opts.trigger);
786
+ } else if (opts?.autoVerify) {
787
+ triggerNode = sourceNode;
788
+ }
789
+ if (triggerNode !== null) {
790
+ let verifyStream;
791
+ if (triggerNode === sourceNode) {
792
+ verifyStream = (0, import_extra6.switchMap)(sourceNode, (src) => verifyFn(src));
793
+ } else {
794
+ const paired = (0, import_extra6.withLatestFrom)(triggerNode, sourceNode);
795
+ verifyStream = (0, import_extra6.switchMap)(paired, ([, source2]) => verifyFn(source2));
796
+ }
797
+ forEach(verifyStream, (value) => {
798
+ (0, import_core10.batch)(() => {
799
+ verified.down([[import_core10.DATA, value]]);
800
+ if (hasSourceVersioning) {
801
+ const sv = sourceNode.v;
802
+ if (sv != null) {
803
+ verified.meta.sourceVersion.down([[import_core10.DATA, { id: sv.id, version: sv.version }]]);
804
+ }
805
+ }
806
+ });
807
+ });
808
+ }
809
+ return { node: sourceNode, verified, trigger: triggerNode };
810
+ }
811
+ //# sourceMappingURL=index.cjs.map