@graphrefly/graphrefly 0.27.0 → 0.29.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 (428) hide show
  1. package/dist/backoff-HPZMEZNF.js +1 -0
  2. package/dist/cascading-Bp99ckMJ.d.ts +180 -0
  3. package/dist/cascading-CcAgRacD.d.cts +180 -0
  4. package/dist/chunk-22F4K3G7.js +1 -0
  5. package/dist/chunk-22SVXUPB.js +64 -0
  6. package/dist/chunk-2GQREQ6C.js +1 -0
  7. package/dist/chunk-3JXNEPCD.js +2 -0
  8. package/dist/chunk-4JJCCD5S.js +2 -0
  9. package/dist/chunk-4OFIQ66T.js +1 -0
  10. package/dist/chunk-4V4C7K56.js +1 -0
  11. package/dist/chunk-4VVTGLXJ.js +1 -0
  12. package/dist/chunk-567NWZ3T.js +1 -0
  13. package/dist/chunk-5JDE5JHE.js +1 -0
  14. package/dist/chunk-5QDBSZBV.js +1 -0
  15. package/dist/chunk-5Z4HDCO6.js +1 -0
  16. package/dist/chunk-63FFOHLA.js +1 -0
  17. package/dist/chunk-6QZNQS5B.js +1 -0
  18. package/dist/chunk-7JDLFI6N.js +1 -0
  19. package/dist/chunk-7TDOES3L.js +1 -0
  20. package/dist/chunk-A7IAQQ63.js +1 -0
  21. package/dist/chunk-AMG5VBHW.js +1 -0
  22. package/dist/chunk-AUY2YKCO.js +1 -0
  23. package/dist/chunk-AV3PIDFQ.js +1 -0
  24. package/dist/chunk-BA5URFYW.js +1 -0
  25. package/dist/chunk-BKPLTBL5.js +1 -0
  26. package/dist/chunk-BZP5T4X6.js +1 -0
  27. package/dist/chunk-CK2E7BTU.js +1 -0
  28. package/dist/chunk-CSJE2EKV.js +1 -0
  29. package/dist/chunk-E3AXATVZ.js +9 -0
  30. package/dist/chunk-ESMPEKEV.js +1 -0
  31. package/dist/chunk-GJR3P6JG.js +1 -0
  32. package/dist/chunk-GNCBXARM.js +1 -0
  33. package/dist/chunk-GPW2V3RE.js +1 -0
  34. package/dist/chunk-HSIEYSDY.js +1 -0
  35. package/dist/chunk-I6VIH3VA.js +1 -0
  36. package/dist/chunk-ISCENNXS.js +1 -0
  37. package/dist/chunk-JYOUF6UQ.js +1 -0
  38. package/dist/chunk-KASHOCF5.js +1 -0
  39. package/dist/chunk-LGSNR4LU.js +5 -0
  40. package/dist/chunk-LVGBLZM2.js +1 -0
  41. package/dist/chunk-MGKAO4EK.js +7 -0
  42. package/dist/chunk-NSG4C6BF.js +23 -0
  43. package/dist/chunk-OL33ZI6R.js +1 -0
  44. package/dist/chunk-PCZ35NXD.js +78 -0
  45. package/dist/chunk-PGMUCUHG.js +43 -0
  46. package/dist/chunk-QYADASLV.js +1 -0
  47. package/dist/chunk-RD52SNH2.js +1 -0
  48. package/dist/chunk-SLMYTGTU.js +1 -0
  49. package/dist/chunk-TWMEGG45.js +1 -0
  50. package/dist/chunk-UVJQ35G2.js +1 -0
  51. package/dist/chunk-VGTCGNRX.js +18 -0
  52. package/dist/chunk-VIMF6LGM.js +1 -0
  53. package/dist/chunk-VJLMUKOI.js +1 -0
  54. package/dist/chunk-VWPRPPKR.js +1 -0
  55. package/dist/chunk-W4TSQ6RJ.js +1 -0
  56. package/dist/chunk-WM7H7WTY.js +3 -0
  57. package/dist/chunk-Y32RJO24.js +1 -0
  58. package/dist/chunk-Y53B6NS4.js +1 -0
  59. package/dist/compat/index.cjs +15 -7656
  60. package/dist/compat/index.d.cts +15 -14
  61. package/dist/compat/index.d.ts +15 -14
  62. package/dist/compat/index.js +1 -50
  63. package/dist/compat/jotai/index.cjs +1 -2048
  64. package/dist/compat/jotai/index.d.cts +2 -2
  65. package/dist/compat/jotai/index.d.ts +2 -2
  66. package/dist/compat/jotai/index.js +1 -9
  67. package/dist/compat/nanostores/index.cjs +1 -2175
  68. package/dist/compat/nanostores/index.d.cts +2 -2
  69. package/dist/compat/nanostores/index.d.ts +2 -2
  70. package/dist/compat/nanostores/index.js +1 -23
  71. package/dist/compat/nestjs/index.cjs +15 -6782
  72. package/dist/compat/nestjs/index.d.cts +7 -6
  73. package/dist/compat/nestjs/index.d.ts +7 -6
  74. package/dist/compat/nestjs/index.js +1 -83
  75. package/dist/compat/react/index.cjs +1 -141
  76. package/dist/compat/react/index.d.cts +2 -2
  77. package/dist/compat/react/index.d.ts +2 -2
  78. package/dist/compat/react/index.js +1 -12
  79. package/dist/compat/solid/index.cjs +1 -128
  80. package/dist/compat/solid/index.d.cts +2 -2
  81. package/dist/compat/solid/index.d.ts +2 -2
  82. package/dist/compat/solid/index.js +1 -12
  83. package/dist/compat/svelte/index.cjs +1 -131
  84. package/dist/compat/svelte/index.d.cts +2 -2
  85. package/dist/compat/svelte/index.d.ts +2 -2
  86. package/dist/compat/svelte/index.js +1 -12
  87. package/dist/compat/vue/index.cjs +1 -146
  88. package/dist/compat/vue/index.d.cts +2 -2
  89. package/dist/compat/vue/index.d.ts +2 -2
  90. package/dist/compat/vue/index.js +1 -12
  91. package/dist/compat/zustand/index.cjs +7 -4931
  92. package/dist/compat/zustand/index.d.cts +5 -5
  93. package/dist/compat/zustand/index.d.ts +5 -5
  94. package/dist/compat/zustand/index.js +1 -12
  95. package/dist/composite-BL-llbnE.d.ts +69 -0
  96. package/dist/composite-Dze--DaA.d.cts +69 -0
  97. package/dist/core/index.cjs +1 -2271
  98. package/dist/core/index.d.cts +4 -4
  99. package/dist/core/index.d.ts +4 -4
  100. package/dist/core/index.js +1 -110
  101. package/dist/extra/browser.cjs +1 -0
  102. package/dist/extra/browser.d.cts +3 -0
  103. package/dist/extra/browser.d.ts +3 -0
  104. package/dist/extra/browser.js +1 -0
  105. package/dist/extra/index.cjs +24 -9971
  106. package/dist/extra/index.d.cts +13 -6
  107. package/dist/extra/index.d.ts +13 -6
  108. package/dist/extra/index.js +1 -381
  109. package/dist/extra/node.cjs +3 -0
  110. package/dist/extra/node.d.cts +81 -0
  111. package/dist/extra/node.d.ts +81 -0
  112. package/dist/extra/node.js +2 -0
  113. package/dist/extra/operators.cjs +1 -0
  114. package/dist/extra/operators.d.cts +910 -0
  115. package/dist/extra/operators.d.ts +910 -0
  116. package/dist/extra/operators.js +1 -0
  117. package/dist/extra/reactive.cjs +1 -0
  118. package/dist/extra/reactive.d.cts +352 -0
  119. package/dist/extra/reactive.d.ts +352 -0
  120. package/dist/extra/reactive.js +1 -0
  121. package/dist/extra/sources.cjs +1 -2486
  122. package/dist/extra/sources.d.cts +6 -2
  123. package/dist/extra/sources.d.ts +6 -2
  124. package/dist/extra/sources.js +1 -57
  125. package/dist/extra/storage-browser.cjs +1 -0
  126. package/dist/extra/storage-browser.d.cts +71 -0
  127. package/dist/extra/storage-browser.d.ts +71 -0
  128. package/dist/extra/storage-browser.js +1 -0
  129. package/dist/extra/storage-core.cjs +1 -0
  130. package/dist/extra/storage-core.d.cts +98 -0
  131. package/dist/extra/storage-core.d.ts +98 -0
  132. package/dist/extra/storage-core.js +1 -0
  133. package/dist/extra/storage-node.cjs +2 -0
  134. package/dist/extra/storage-node.d.cts +60 -0
  135. package/dist/extra/storage-node.d.ts +60 -0
  136. package/dist/extra/storage-node.js +1 -0
  137. package/dist/fallback-BaTS7vVY.d.cts +258 -0
  138. package/dist/fallback-eOm3LNxP.d.ts +258 -0
  139. package/dist/graph/index.cjs +7 -5030
  140. package/dist/graph/index.d.cts +6 -5
  141. package/dist/graph/index.d.ts +6 -5
  142. package/dist/graph/index.js +1 -50
  143. package/dist/{graph-DNCrvZSn.d.cts → graph-DgohqXK-.d.cts} +151 -32
  144. package/dist/{graph-CCwGKLCm.d.ts → graph-Qjg9gWHI.d.ts} +151 -32
  145. package/dist/{index-BwfLUNw4.d.ts → index-2BVuRCI4.d.ts} +173 -2040
  146. package/dist/{index-BPVt8kqc.d.ts → index-2NvguqQA.d.ts} +10 -195
  147. package/dist/index-A65LZhoM.d.ts +186 -0
  148. package/dist/{index-DlLp-2Xn.d.cts → index-B-8FCEua.d.cts} +10 -195
  149. package/dist/index-B-gqvYel.d.ts +135 -0
  150. package/dist/index-B2PRuolf.d.cts +86 -0
  151. package/dist/index-BJqt9EwW.d.ts +231 -0
  152. package/dist/{index-BHlKbUwO.d.cts → index-BKjT5DiZ.d.cts} +173 -2040
  153. package/dist/{index-C0svESO4.d.ts → index-BM8BU4q6.d.ts} +1 -1
  154. package/dist/{index-VdHQMPy1.d.ts → index-BQaEnxBf.d.ts} +1 -1
  155. package/dist/index-BSfwiy5B.d.ts +192 -0
  156. package/dist/index-BTSkeCZs.d.cts +291 -0
  157. package/dist/index-BUVtw1Ay.d.cts +186 -0
  158. package/dist/index-BUi57v_p.d.ts +163 -0
  159. package/dist/{messaging-Gt4LPbyA.d.cts → index-BanNUILp.d.cts} +31 -93
  160. package/dist/{audit-DRlSzBu9.d.ts → index-BayHDRx6.d.cts} +27 -21
  161. package/dist/{index-B6D3QNSA.d.ts → index-BiyjsZ0m.d.ts} +148 -20
  162. package/dist/index-BqZ6vB2A.d.ts +2057 -0
  163. package/dist/{memory-li6FL5RM.d.ts → index-BuVidq3D.d.cts} +26 -26
  164. package/dist/index-Byh-xTyp.d.ts +105 -0
  165. package/dist/index-C08QPDcV.d.cts +321 -0
  166. package/dist/{demo-shell-BDkOptd6.d.ts → index-C66RJiX8.d.ts} +14 -14
  167. package/dist/index-C8RfjffH.d.ts +291 -0
  168. package/dist/index-CA1Cu7Ud.d.ts +873 -0
  169. package/dist/{index-ByQxazQJ.d.cts → index-CABbltIu.d.cts} +1 -1
  170. package/dist/{index-VHqptjhu.d.cts → index-CHEBsnYv.d.cts} +1 -1
  171. package/dist/{index-BuEoe-Qu.d.ts → index-CI0yDnLp.d.ts} +9 -9
  172. package/dist/{index-B9B7_HEY.d.ts → index-CJ45TW-h.d.ts} +1 -1
  173. package/dist/{index-CO8uBlUh.d.cts → index-CJZKZoo4.d.cts} +148 -20
  174. package/dist/{index-wEn0eFe8.d.ts → index-CX2tFJL1.d.ts} +1 -1
  175. package/dist/{index-BaSM3aYt.d.ts → index-CcWOJ6F0.d.ts} +3 -3
  176. package/dist/{audit-ClmqGOCx.d.cts → index-CiaVoZGo.d.ts} +27 -21
  177. package/dist/{index-Dzk2hrlR.d.ts → index-Ct5CWc4E.d.ts} +1 -1
  178. package/dist/index-D38duMCv.d.cts +357 -0
  179. package/dist/{index-C8oil6M6.d.ts → index-D5XJ2tSx.d.ts} +30 -6
  180. package/dist/{index-DO_6JN9Z.d.cts → index-D80do5jX.d.cts} +1 -1
  181. package/dist/index-D9HKAH_-.d.cts +231 -0
  182. package/dist/index-DBe_8XW5.d.cts +143 -0
  183. package/dist/{memory-C6Z2tGpC.d.cts → index-DCeTyFlB.d.ts} +26 -26
  184. package/dist/index-DDy8eeXS.d.ts +321 -0
  185. package/dist/index-DJ5oNBc8.d.ts +143 -0
  186. package/dist/{index-CI3DprxP.d.cts → index-DP0_O3ls.d.cts} +30 -6
  187. package/dist/{demo-shell-Crid1WdR.d.cts → index-DX8xS-yB.d.cts} +14 -14
  188. package/dist/index-DiZejfCI.d.cts +2057 -0
  189. package/dist/index-DknyJ2Fu.d.cts +163 -0
  190. package/dist/index-DoWMs-Kk.d.cts +135 -0
  191. package/dist/{messaging-XDoYablx.d.ts → index-DuB5aO4-.d.ts} +31 -93
  192. package/dist/index-DwjJGKxV.d.ts +357 -0
  193. package/dist/{index-B6EhDnjH.d.cts → index-H_oxVec5.d.cts} +1 -1
  194. package/dist/{index-3lsddbbS.d.ts → index-IMAHq-ia.d.ts} +1 -1
  195. package/dist/{index-B1tloyhO.d.cts → index-U1nir7MX.d.cts} +1 -1
  196. package/dist/index-Vg7tORgk.d.ts +86 -0
  197. package/dist/index-dig-r2tQ.d.cts +873 -0
  198. package/dist/{index-CxFrXH4m.d.ts → index-gsT79Xu9.d.ts} +1 -1
  199. package/dist/{index-D8wS_PeY.d.cts → index-i99Ka8s7.d.cts} +9 -9
  200. package/dist/index-iKkyJosF.d.cts +105 -0
  201. package/dist/{index-Xi3u0HCQ.d.cts → index-jleeotBT.d.cts} +1 -1
  202. package/dist/{index-DVGiGFGT.d.cts → index-kykKWwV-.d.cts} +3 -3
  203. package/dist/index-vgcLF5TH.d.cts +192 -0
  204. package/dist/{index-DYme44FM.d.cts → index-y1RllPn4.d.cts} +1 -1
  205. package/dist/index.cjs +151 -24142
  206. package/dist/index.d.cts +69 -2099
  207. package/dist/index.d.ts +69 -2099
  208. package/dist/index.js +1 -3868
  209. package/dist/{meta-CbznRPYJ.d.ts → meta-CX7YsOzp.d.cts} +5 -5
  210. package/dist/{meta-BxCA7rcr.d.cts → meta-CckhhFRd.d.ts} +5 -5
  211. package/dist/{node-BmerH3kS.d.cts → node-Dd6wHSib.d.cts} +71 -11
  212. package/dist/{node-BmerH3kS.d.ts → node-Dd6wHSib.d.ts} +71 -11
  213. package/dist/{observable-BgGUwcqp.d.ts → observable-BZJgo616.d.ts} +1 -1
  214. package/dist/{observable-DJt_AxzQ.d.cts → observable-kwzpLvbi.d.cts} +1 -1
  215. package/dist/patterns/ai/browser.cjs +25 -0
  216. package/dist/patterns/ai/browser.d.cts +127 -0
  217. package/dist/patterns/ai/browser.d.ts +127 -0
  218. package/dist/patterns/ai/browser.js +3 -0
  219. package/dist/patterns/ai/index.cjs +92 -0
  220. package/dist/patterns/ai/index.d.cts +17 -0
  221. package/dist/patterns/ai/index.d.ts +17 -0
  222. package/dist/patterns/ai/index.js +1 -0
  223. package/dist/patterns/ai/node.cjs +2 -0
  224. package/dist/patterns/ai/node.d.cts +58 -0
  225. package/dist/patterns/ai/node.d.ts +58 -0
  226. package/dist/patterns/ai/node.js +1 -0
  227. package/dist/patterns/audit/index.cjs +7 -0
  228. package/dist/patterns/audit/index.d.cts +6 -0
  229. package/dist/patterns/audit/index.d.ts +6 -0
  230. package/dist/patterns/audit/index.js +1 -0
  231. package/dist/patterns/cqrs/index.cjs +7 -0
  232. package/dist/patterns/cqrs/index.d.cts +5 -0
  233. package/dist/patterns/cqrs/index.d.ts +5 -0
  234. package/dist/patterns/cqrs/index.js +1 -0
  235. package/dist/patterns/demo-shell/index.cjs +8 -0
  236. package/dist/patterns/demo-shell/index.d.cts +6 -0
  237. package/dist/patterns/demo-shell/index.d.ts +6 -0
  238. package/dist/patterns/demo-shell/index.js +1 -0
  239. package/dist/patterns/domain-templates/index.cjs +7 -0
  240. package/dist/patterns/domain-templates/index.d.cts +5 -0
  241. package/dist/patterns/domain-templates/index.d.ts +5 -0
  242. package/dist/patterns/domain-templates/index.js +1 -0
  243. package/dist/patterns/graphspec/index.cjs +84 -0
  244. package/dist/patterns/graphspec/index.d.cts +7 -0
  245. package/dist/patterns/graphspec/index.d.ts +7 -0
  246. package/dist/patterns/graphspec/index.js +1 -0
  247. package/dist/patterns/guarded-execution/index.cjs +7 -0
  248. package/dist/patterns/guarded-execution/index.d.cts +7 -0
  249. package/dist/patterns/guarded-execution/index.d.ts +7 -0
  250. package/dist/patterns/guarded-execution/index.js +1 -0
  251. package/dist/patterns/harness/index.cjs +49 -0
  252. package/dist/patterns/harness/index.d.cts +11 -0
  253. package/dist/patterns/harness/index.d.ts +11 -0
  254. package/dist/patterns/harness/index.js +1 -0
  255. package/dist/patterns/job-queue/index.cjs +7 -0
  256. package/dist/patterns/job-queue/index.d.cts +5 -0
  257. package/dist/patterns/job-queue/index.d.ts +5 -0
  258. package/dist/patterns/job-queue/index.js +1 -0
  259. package/dist/patterns/lens/index.cjs +7 -0
  260. package/dist/patterns/lens/index.d.cts +7 -0
  261. package/dist/patterns/lens/index.d.ts +7 -0
  262. package/dist/patterns/lens/index.js +1 -0
  263. package/dist/patterns/memory/index.cjs +7 -0
  264. package/dist/patterns/memory/index.d.cts +5 -0
  265. package/dist/patterns/memory/index.d.ts +5 -0
  266. package/dist/patterns/memory/index.js +1 -0
  267. package/dist/patterns/messaging/index.cjs +7 -0
  268. package/dist/patterns/messaging/index.d.cts +5 -0
  269. package/dist/patterns/messaging/index.d.ts +5 -0
  270. package/dist/patterns/messaging/index.js +1 -0
  271. package/dist/patterns/orchestration/index.cjs +7 -0
  272. package/dist/patterns/orchestration/index.d.cts +6 -0
  273. package/dist/patterns/orchestration/index.d.ts +6 -0
  274. package/dist/patterns/orchestration/index.js +1 -0
  275. package/dist/patterns/reactive-layout/index.cjs +8 -6444
  276. package/dist/patterns/reactive-layout/index.d.cts +6 -6
  277. package/dist/patterns/reactive-layout/index.d.ts +6 -6
  278. package/dist/patterns/reactive-layout/index.js +1 -56
  279. package/dist/patterns/reduction/index.cjs +7 -0
  280. package/dist/patterns/reduction/index.d.cts +5 -0
  281. package/dist/patterns/reduction/index.d.ts +5 -0
  282. package/dist/patterns/reduction/index.js +1 -0
  283. package/dist/patterns/refine-loop/index.cjs +9 -0
  284. package/dist/patterns/refine-loop/index.d.cts +7 -0
  285. package/dist/patterns/refine-loop/index.d.ts +7 -0
  286. package/dist/patterns/refine-loop/index.js +1 -0
  287. package/dist/patterns/resilient-pipeline/index.cjs +1 -0
  288. package/dist/patterns/resilient-pipeline/index.d.cts +7 -0
  289. package/dist/patterns/resilient-pipeline/index.d.ts +7 -0
  290. package/dist/patterns/resilient-pipeline/index.js +1 -0
  291. package/dist/patterns/surface/index.cjs +15 -0
  292. package/dist/patterns/surface/index.d.cts +8 -0
  293. package/dist/patterns/surface/index.d.ts +8 -0
  294. package/dist/patterns/surface/index.js +1 -0
  295. package/dist/{reactive-layout-u5Ulnqag.d.ts → reactive-layout-BkBwVvwm.d.ts} +2 -2
  296. package/dist/{reactive-layout-MQP--J3F.d.cts → reactive-layout-PiFwVaWS.d.cts} +2 -2
  297. package/dist/reactive-log-1QTyx10a.d.ts +190 -0
  298. package/dist/reactive-log-BiVoSxke.d.cts +190 -0
  299. package/dist/{composite-aUCvjZVR.d.ts → reactive-map-CwO_COHy.d.cts} +2 -67
  300. package/dist/{composite-C7PcQvcs.d.cts → reactive-map-FeuTVAJb.d.ts} +2 -67
  301. package/dist/resilience-CBfYJW5C.d.ts +493 -0
  302. package/dist/resilience-XRUF267O.js +1 -0
  303. package/dist/resilience-uBz4yvYB.d.cts +493 -0
  304. package/dist/{sugar-CCOxXK1e.d.ts → sugar-CY-MCfZ9.d.ts} +17 -15
  305. package/dist/{sugar-D02n5JjF.d.cts → sugar-DHttV0LX.d.cts} +17 -15
  306. package/dist/topology-tree-CVjt2gp7.d.cts +25 -0
  307. package/dist/topology-tree-one6oSKY.d.ts +25 -0
  308. package/dist/types-O3GzJY2U.d.cts +401 -0
  309. package/dist/types-u64Ose53.d.ts +401 -0
  310. package/package.json +252 -22
  311. package/dist/ai-CaR_912Q.d.cts +0 -1033
  312. package/dist/ai-WlRltJV7.d.ts +0 -1033
  313. package/dist/chunk-3ZWCKRHX.js +0 -117
  314. package/dist/chunk-3ZWCKRHX.js.map +0 -1
  315. package/dist/chunk-7TAQJHQV.js +0 -103
  316. package/dist/chunk-7TAQJHQV.js.map +0 -1
  317. package/dist/chunk-APFNLIRG.js +0 -62
  318. package/dist/chunk-APFNLIRG.js.map +0 -1
  319. package/dist/chunk-AT5LKYNL.js +0 -395
  320. package/dist/chunk-AT5LKYNL.js.map +0 -1
  321. package/dist/chunk-BQ6RQQFF.js +0 -5087
  322. package/dist/chunk-BQ6RQQFF.js.map +0 -1
  323. package/dist/chunk-BVZYTZ5H.js +0 -599
  324. package/dist/chunk-BVZYTZ5H.js.map +0 -1
  325. package/dist/chunk-DST5DKZS.js +0 -1371
  326. package/dist/chunk-DST5DKZS.js.map +0 -1
  327. package/dist/chunk-GTE6PWRZ.js +0 -866
  328. package/dist/chunk-GTE6PWRZ.js.map +0 -1
  329. package/dist/chunk-HXZEYDUR.js +0 -94
  330. package/dist/chunk-HXZEYDUR.js.map +0 -1
  331. package/dist/chunk-J22W6HV3.js +0 -107
  332. package/dist/chunk-J22W6HV3.js.map +0 -1
  333. package/dist/chunk-J2VBW3DZ.js +0 -302
  334. package/dist/chunk-J2VBW3DZ.js.map +0 -1
  335. package/dist/chunk-JSCT3CR4.js +0 -38
  336. package/dist/chunk-JSCT3CR4.js.map +0 -1
  337. package/dist/chunk-JWBCY4NC.js +0 -330
  338. package/dist/chunk-JWBCY4NC.js.map +0 -1
  339. package/dist/chunk-K2AUJHVP.js +0 -2251
  340. package/dist/chunk-K2AUJHVP.js.map +0 -1
  341. package/dist/chunk-MJ2NKQQL.js +0 -119
  342. package/dist/chunk-MJ2NKQQL.js.map +0 -1
  343. package/dist/chunk-N6UR7YVY.js +0 -198
  344. package/dist/chunk-N6UR7YVY.js.map +0 -1
  345. package/dist/chunk-NC6S43JJ.js +0 -456
  346. package/dist/chunk-NC6S43JJ.js.map +0 -1
  347. package/dist/chunk-OFVJBJXR.js +0 -98
  348. package/dist/chunk-OFVJBJXR.js.map +0 -1
  349. package/dist/chunk-OHISZPOJ.js +0 -97
  350. package/dist/chunk-OHISZPOJ.js.map +0 -1
  351. package/dist/chunk-OU5CQKNW.js +0 -102
  352. package/dist/chunk-OU5CQKNW.js.map +0 -1
  353. package/dist/chunk-PF7GRZMW.js +0 -2712
  354. package/dist/chunk-PF7GRZMW.js.map +0 -1
  355. package/dist/chunk-PHOUUNK7.js +0 -2291
  356. package/dist/chunk-PHOUUNK7.js.map +0 -1
  357. package/dist/chunk-RNHBMHKA.js +0 -1665
  358. package/dist/chunk-RNHBMHKA.js.map +0 -1
  359. package/dist/chunk-SX52TAR4.js +0 -110
  360. package/dist/chunk-SX52TAR4.js.map +0 -1
  361. package/dist/chunk-VYPWMZ6H.js +0 -98
  362. package/dist/chunk-VYPWMZ6H.js.map +0 -1
  363. package/dist/chunk-WBZOVTYK.js +0 -171
  364. package/dist/chunk-WBZOVTYK.js.map +0 -1
  365. package/dist/chunk-WKNUIZOY.js +0 -354
  366. package/dist/chunk-WKNUIZOY.js.map +0 -1
  367. package/dist/chunk-X3VMZYBT.js +0 -713
  368. package/dist/chunk-X3VMZYBT.js.map +0 -1
  369. package/dist/chunk-X5R3GL6H.js +0 -525
  370. package/dist/chunk-X5R3GL6H.js.map +0 -1
  371. package/dist/chunk-XGPU467M.js +0 -136
  372. package/dist/chunk-XGPU467M.js.map +0 -1
  373. package/dist/compat/index.cjs.map +0 -1
  374. package/dist/compat/index.js.map +0 -1
  375. package/dist/compat/jotai/index.cjs.map +0 -1
  376. package/dist/compat/jotai/index.js.map +0 -1
  377. package/dist/compat/nanostores/index.cjs.map +0 -1
  378. package/dist/compat/nanostores/index.js.map +0 -1
  379. package/dist/compat/nestjs/index.cjs.map +0 -1
  380. package/dist/compat/nestjs/index.js.map +0 -1
  381. package/dist/compat/react/index.cjs.map +0 -1
  382. package/dist/compat/react/index.js.map +0 -1
  383. package/dist/compat/solid/index.cjs.map +0 -1
  384. package/dist/compat/solid/index.js.map +0 -1
  385. package/dist/compat/svelte/index.cjs.map +0 -1
  386. package/dist/compat/svelte/index.js.map +0 -1
  387. package/dist/compat/vue/index.cjs.map +0 -1
  388. package/dist/compat/vue/index.js.map +0 -1
  389. package/dist/compat/zustand/index.cjs.map +0 -1
  390. package/dist/compat/zustand/index.js.map +0 -1
  391. package/dist/core/index.cjs.map +0 -1
  392. package/dist/core/index.js.map +0 -1
  393. package/dist/extra/index.cjs.map +0 -1
  394. package/dist/extra/index.js.map +0 -1
  395. package/dist/extra/sources.cjs.map +0 -1
  396. package/dist/extra/sources.js.map +0 -1
  397. package/dist/graph/index.cjs.map +0 -1
  398. package/dist/graph/index.js.map +0 -1
  399. package/dist/index.cjs.map +0 -1
  400. package/dist/index.js.map +0 -1
  401. package/dist/patterns/ai.cjs +0 -7930
  402. package/dist/patterns/ai.cjs.map +0 -1
  403. package/dist/patterns/ai.d.cts +0 -10
  404. package/dist/patterns/ai.d.ts +0 -10
  405. package/dist/patterns/ai.js +0 -71
  406. package/dist/patterns/ai.js.map +0 -1
  407. package/dist/patterns/audit.cjs +0 -5805
  408. package/dist/patterns/audit.cjs.map +0 -1
  409. package/dist/patterns/audit.d.cts +0 -6
  410. package/dist/patterns/audit.d.ts +0 -6
  411. package/dist/patterns/audit.js +0 -29
  412. package/dist/patterns/audit.js.map +0 -1
  413. package/dist/patterns/demo-shell.cjs +0 -5604
  414. package/dist/patterns/demo-shell.cjs.map +0 -1
  415. package/dist/patterns/demo-shell.d.cts +0 -6
  416. package/dist/patterns/demo-shell.d.ts +0 -6
  417. package/dist/patterns/demo-shell.js +0 -15
  418. package/dist/patterns/demo-shell.js.map +0 -1
  419. package/dist/patterns/memory.cjs +0 -5283
  420. package/dist/patterns/memory.cjs.map +0 -1
  421. package/dist/patterns/memory.d.cts +0 -5
  422. package/dist/patterns/memory.d.ts +0 -5
  423. package/dist/patterns/memory.js +0 -20
  424. package/dist/patterns/memory.js.map +0 -1
  425. package/dist/patterns/reactive-layout/index.cjs.map +0 -1
  426. package/dist/patterns/reactive-layout/index.js.map +0 -1
  427. package/dist/storage-CMjUUuxn.d.ts +0 -190
  428. package/dist/storage-DdWlZo6U.d.cts +0 -190
@@ -1,198 +0,0 @@
1
- import {
2
- batch,
3
- dynamicNode,
4
- state
5
- } from "./chunk-PHOUUNK7.js";
6
- import {
7
- DATA,
8
- ERROR,
9
- __export
10
- } from "./chunk-SX52TAR4.js";
11
-
12
- // src/compat/nanostores/index.ts
13
- var nanostores_exports = {};
14
- __export(nanostores_exports, {
15
- action: () => action,
16
- atom: () => atom,
17
- computed: () => computed,
18
- getValue: () => getValue,
19
- map: () => map,
20
- onMount: () => onMount,
21
- onStart: () => onStart,
22
- onStop: () => onStop
23
- });
24
- var START_LISTENERS = /* @__PURE__ */ new WeakMap();
25
- var STOP_LISTENERS = /* @__PURE__ */ new WeakMap();
26
- function trigger(node, map2) {
27
- const callbacks = map2.get(node);
28
- if (callbacks) {
29
- for (const cb of callbacks) cb();
30
- }
31
- }
32
- function createStore(node, extra = {}) {
33
- let listeners = 0;
34
- const store = {
35
- ...extra,
36
- get: () => getVal(node),
37
- subscribe: (cb) => {
38
- if (listeners === 0) trigger(node, START_LISTENERS);
39
- listeners++;
40
- const sub = node.subscribe((msgs) => {
41
- for (const [t, v] of msgs) {
42
- if (t === DATA) cb(v);
43
- }
44
- });
45
- return () => {
46
- sub();
47
- listeners--;
48
- if (listeners === 0) trigger(node, STOP_LISTENERS);
49
- };
50
- },
51
- listen: (cb) => {
52
- if (listeners === 0) trigger(node, START_LISTENERS);
53
- listeners++;
54
- let initial = true;
55
- const sub = node.subscribe((msgs) => {
56
- for (const [t, v] of msgs) {
57
- if (t === DATA) {
58
- if (initial) {
59
- initial = false;
60
- continue;
61
- }
62
- cb(v);
63
- }
64
- }
65
- });
66
- return () => {
67
- sub();
68
- listeners--;
69
- if (listeners === 0) trigger(node, STOP_LISTENERS);
70
- };
71
- },
72
- _node: node
73
- };
74
- return store;
75
- }
76
- function pull(n) {
77
- let val = n.cache;
78
- let err;
79
- const unsub = n.subscribe((msgs) => {
80
- for (const [t, v] of msgs) {
81
- if (t === DATA) val = v;
82
- if (t === ERROR) err = v;
83
- }
84
- });
85
- unsub();
86
- if (err) throw err;
87
- return val;
88
- }
89
- function getVal(n) {
90
- if (n.status === "sentinel") {
91
- return pull(n);
92
- }
93
- return n.cache;
94
- }
95
- function atom(initial) {
96
- const n = state(initial, {
97
- resubscribable: true,
98
- resetOnTeardown: true
99
- });
100
- return createStore(n, {
101
- // `n.emit` routes through the framed pipeline: `bundle()` auto-
102
- // prefixes `[DIRTY]` (diamond-safe wave coordination) and the
103
- // node's `equals` (default `Object.is`) folds same-value writes
104
- // into `RESOLVED`. Matches nanostores' documented Object.is
105
- // dedup semantics without any custom check.
106
- set: (value) => n.emit(value)
107
- });
108
- }
109
- function computed(stores, fn) {
110
- const storeArray = Array.isArray(stores) ? stores : [stores];
111
- const depNodes = storeArray.map((s) => s._node);
112
- const n = dynamicNode(
113
- depNodes,
114
- (track) => {
115
- const vals = storeArray.map((s) => {
116
- const node = s._node;
117
- if (node.status === "sentinel") {
118
- pull(node);
119
- }
120
- return track(node);
121
- });
122
- return fn(...vals);
123
- },
124
- {
125
- resubscribable: true,
126
- resetOnTeardown: true,
127
- equals: Object.is
128
- }
129
- );
130
- return createStore(n);
131
- }
132
- function map(initial) {
133
- const n = state(initial, {
134
- resubscribable: true,
135
- resetOnTeardown: true,
136
- equals: () => false
137
- });
138
- return createStore(n, {
139
- // `map`'s state node is configured with `equals: () => false`
140
- // above, so every `emit` produces DATA (even for same-key same-
141
- // value sets). The `emit` path is still required for diamond
142
- // coordination (`[DIRTY]` auto-prefix via `bundle()`).
143
- set: (value) => n.emit(value),
144
- setKey: (key, value) => {
145
- const current = getVal(n);
146
- n.emit({ ...current, [key]: value });
147
- }
148
- });
149
- }
150
- function getValue(store) {
151
- return store.get();
152
- }
153
- function onStart(store, cb) {
154
- const node = store._node;
155
- let callbacks = START_LISTENERS.get(node);
156
- if (!callbacks) {
157
- callbacks = /* @__PURE__ */ new Set();
158
- START_LISTENERS.set(node, callbacks);
159
- }
160
- callbacks.add(cb);
161
- }
162
- function onStop(store, cb) {
163
- const node = store._node;
164
- let callbacks = STOP_LISTENERS.get(node);
165
- if (!callbacks) {
166
- callbacks = /* @__PURE__ */ new Set();
167
- STOP_LISTENERS.set(node, callbacks);
168
- }
169
- callbacks.add(cb);
170
- }
171
- function onMount(store, cb) {
172
- onStart(store, () => {
173
- const stop = cb();
174
- if (typeof stop === "function") onStop(store, stop);
175
- });
176
- }
177
- function action(_store, _name, fn) {
178
- return (...args) => {
179
- let result;
180
- batch(() => {
181
- result = fn(...args);
182
- });
183
- return result;
184
- };
185
- }
186
-
187
- export {
188
- atom,
189
- computed,
190
- map,
191
- getValue,
192
- onStart,
193
- onStop,
194
- onMount,
195
- action,
196
- nanostores_exports
197
- };
198
- //# sourceMappingURL=chunk-N6UR7YVY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/compat/nanostores/index.ts"],"sourcesContent":["import { batch } from \"../../core/batch.js\";\nimport { DATA, ERROR, type Messages } from \"../../core/messages.js\";\nimport type { Node } from \"../../core/node.js\";\nimport { dynamicNode, state, type TrackFn } from \"../../core/sugar.js\";\n\n/**\n * A Nanostores-compatible atom.\n *\n * @category compat\n */\nexport interface NanoAtom<T> {\n\t/** Get current value. */\n\tget(): T;\n\t/** Set a new value (writable atoms only). */\n\tset(value: T): void;\n\t/** Subscribe to value changes. Callback receives the new value.\n\t * Returns unsubscribe function. Called immediately with current value. */\n\tsubscribe(cb: (value: T) => void): () => void;\n\t/** Listen to value changes (no immediate call). Returns unsubscribe. */\n\tlisten(cb: (value: T) => void): () => void;\n\t/** The underlying GraphReFly node. */\n\treadonly _node: Node<T>;\n}\n\n/**\n * A Nanostores-compatible computed store.\n *\n * @category compat\n */\nexport interface NanoComputed<T> {\n\t/** Get current value. */\n\tget(): T;\n\t/** Subscribe to value changes. Called immediately with current value.\n\t * Returns unsubscribe function. */\n\tsubscribe(cb: (value: T) => void): () => void;\n\t/** Listen to value changes (no immediate call). Returns unsubscribe. */\n\tlisten(cb: (value: T) => void): () => void;\n\t/** The underlying GraphReFly node. */\n\treadonly _node: Node<T>;\n}\n\n/**\n * A Nanostores-compatible map.\n *\n * @category compat\n */\nexport interface NanoMap<T extends Record<string, unknown>> extends NanoAtom<T> {\n\t/** Set a single key. */\n\tsetKey<K extends keyof T>(key: K, value: T[K]): void;\n}\n\nconst START_LISTENERS = new WeakMap<Node<any>, Set<() => void>>();\nconst STOP_LISTENERS = new WeakMap<Node<any>, Set<() => void>>();\n\nfunction trigger(node: Node<any>, map: WeakMap<Node<any>, Set<() => void>>) {\n\tconst callbacks = map.get(node);\n\tif (callbacks) {\n\t\tfor (const cb of callbacks) cb();\n\t}\n}\n\nfunction createStore<T>(node: Node<T>, extra: any = {}): any {\n\tlet listeners = 0;\n\tconst store = {\n\t\t...extra,\n\t\tget: () => getVal(node),\n\t\tsubscribe: (cb: (value: T) => void) => {\n\t\t\tif (listeners === 0) trigger(node, START_LISTENERS);\n\t\t\tlisteners++;\n\t\t\t// Push-on-subscribe delivers the initial value via DATA — no explicit cb() needed.\n\t\t\tconst sub = node.subscribe((msgs: Messages) => {\n\t\t\t\tfor (const [t, v] of msgs) {\n\t\t\t\t\tif (t === DATA) cb(v as T);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tsub();\n\t\t\t\tlisteners--;\n\t\t\t\tif (listeners === 0) trigger(node, STOP_LISTENERS);\n\t\t\t};\n\t\t},\n\t\tlisten: (cb: (value: T) => void) => {\n\t\t\tif (listeners === 0) trigger(node, START_LISTENERS);\n\t\t\tlisteners++;\n\t\t\t// Skip the initial push-on-subscribe DATA — listen() fires on changes only.\n\t\t\tlet initial = true;\n\t\t\tconst sub = node.subscribe((msgs: Messages) => {\n\t\t\t\tfor (const [t, v] of msgs) {\n\t\t\t\t\tif (t === DATA) {\n\t\t\t\t\t\tif (initial) {\n\t\t\t\t\t\t\tinitial = false;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcb(v as T);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tsub();\n\t\t\t\tlisteners--;\n\t\t\t\tif (listeners === 0) trigger(node, STOP_LISTENERS);\n\t\t\t};\n\t\t},\n\t\t_node: node,\n\t};\n\treturn store;\n}\n\nfunction pull<T>(n: Node<T>): T {\n\tlet val: T | undefined | null = n.cache;\n\tlet err: any;\n\tconst unsub = n.subscribe((msgs: Messages) => {\n\t\tfor (const [t, v] of msgs) {\n\t\t\tif (t === DATA) val = v as T;\n\t\t\tif (t === ERROR) err = v;\n\t\t}\n\t});\n\tunsub();\n\tif (err) throw err;\n\treturn val as T;\n}\n\nfunction getVal<T>(n: Node<T>): T {\n\tif (n.status === \"sentinel\") {\n\t\treturn pull(n);\n\t}\n\treturn n.cache as T;\n}\n\n/**\n * Creates a nanostores-compatible atom.\n *\n * @param initial - Initial value.\n * @returns `NanoAtom<T>`\n *\n * @category compat\n */\nexport function atom<T>(initial: T): NanoAtom<T> {\n\tconst n = state<T>(initial, {\n\t\tresubscribable: true,\n\t\tresetOnTeardown: true,\n\t});\n\n\treturn createStore(n, {\n\t\t// `n.emit` routes through the framed pipeline: `bundle()` auto-\n\t\t// prefixes `[DIRTY]` (diamond-safe wave coordination) and the\n\t\t// node's `equals` (default `Object.is`) folds same-value writes\n\t\t// into `RESOLVED`. Matches nanostores' documented Object.is\n\t\t// dedup semantics without any custom check.\n\t\tset: (value: T) => n.emit(value),\n\t});\n}\n\n/**\n * Creates a nanostores-compatible computed store.\n *\n * @param stores - One or more atoms/computed stores.\n * @param fn - Compute function.\n * @returns `NanoComputed<T>`\n *\n * @category compat\n */\nexport function computed<T, A>(\n\tstoreA: NanoAtom<A> | NanoComputed<A>,\n\tfn: (a: A) => T,\n): NanoComputed<T>;\nexport function computed<T, A, B>(\n\tstores: [NanoAtom<A> | NanoComputed<A>, NanoAtom<B> | NanoComputed<B>],\n\tfn: (a: A, b: B) => T,\n): NanoComputed<T>;\nexport function computed<T, A, B, C>(\n\tstores: [\n\t\tNanoAtom<A> | NanoComputed<A>,\n\t\tNanoAtom<B> | NanoComputed<B>,\n\t\tNanoAtom<C> | NanoComputed<C>,\n\t],\n\tfn: (a: A, b: B, c: C) => T,\n): NanoComputed<T>;\nexport function computed<T>(stores: any, fn: (...args: any[]) => T): NanoComputed<T> {\n\tconst storeArray: Array<NanoAtom<any> | NanoComputed<any>> = Array.isArray(stores)\n\t\t? stores\n\t\t: [stores];\n\n\tconst depNodes = storeArray.map((s) => s._node);\n\tconst n = dynamicNode(\n\t\tdepNodes,\n\t\t(track: TrackFn) => {\n\t\t\tconst vals = storeArray.map((s) => {\n\t\t\t\tconst node = s._node;\n\t\t\t\tif (node.status === \"sentinel\") {\n\t\t\t\t\tpull(node);\n\t\t\t\t}\n\t\t\t\treturn track(node);\n\t\t\t});\n\t\t\treturn fn(...vals);\n\t\t},\n\t\t{\n\t\t\tresubscribable: true,\n\t\t\tresetOnTeardown: true,\n\t\t\tequals: Object.is as any,\n\t\t},\n\t);\n\n\treturn createStore(n);\n}\n\n/**\n * Creates a nanostores-compatible map.\n *\n * @param initial - Initial object value.\n * @returns `NanoMap<T>`\n *\n * @category compat\n */\nexport function map<T extends Record<string, unknown>>(initial: T): NanoMap<T> {\n\tconst n = state<T>(initial, {\n\t\tresubscribable: true,\n\t\tresetOnTeardown: true,\n\t\tequals: () => false,\n\t});\n\n\treturn createStore(n, {\n\t\t// `map`'s state node is configured with `equals: () => false`\n\t\t// above, so every `emit` produces DATA (even for same-key same-\n\t\t// value sets). The `emit` path is still required for diamond\n\t\t// coordination (`[DIRTY]` auto-prefix via `bundle()`).\n\t\tset: (value: T) => n.emit(value),\n\t\tsetKey: <K extends keyof T>(key: K, value: T[K]) => {\n\t\t\tconst current = getVal(n);\n\t\t\tn.emit({ ...current, [key]: value });\n\t\t},\n\t});\n}\n\n/**\n * Returns the current value of the store.\n *\n * @category compat\n */\nexport function getValue<T>(store: NanoAtom<T> | NanoComputed<T>): T {\n\treturn store.get();\n}\n\n/**\n * Adds a listener for the store start (first listener connected).\n *\n * @category compat\n */\nexport function onStart(store: NanoAtom<any> | NanoComputed<any>, cb: () => void): void {\n\tconst node = store._node;\n\tlet callbacks = START_LISTENERS.get(node);\n\tif (!callbacks) {\n\t\tcallbacks = new Set();\n\t\tSTART_LISTENERS.set(node, callbacks);\n\t}\n\tcallbacks.add(cb);\n}\n\n/**\n * Adds a listener for the store stop (last listener disconnected).\n *\n * @category compat\n */\nexport function onStop(store: NanoAtom<any> | NanoComputed<any>, cb: () => void): void {\n\tconst node = store._node;\n\tlet callbacks = STOP_LISTENERS.get(node);\n\tif (!callbacks) {\n\t\tcallbacks = new Set();\n\t\tSTOP_LISTENERS.set(node, callbacks);\n\t}\n\tcallbacks.add(cb);\n}\n\n/**\n * Adds a listener for the store mount (first listener connected).\n *\n * @returns A cleanup function called when the last listener is removed.\n * @category compat\n */\nexport function onMount(\n\tstore: NanoAtom<any> | NanoComputed<any>,\n\tcb: () => (() => void) | undefined,\n): void {\n\tonStart(store, () => {\n\t\tconst stop = cb();\n\t\tif (typeof stop === \"function\") onStop(store, stop);\n\t});\n}\n\n/**\n * Batches multiple store updates.\n *\n * @category compat\n */\nexport function action<Args extends any[], Return>(\n\t_store: NanoAtom<any> | NanoComputed<any>,\n\t_name: string,\n\tfn: (...args: Args) => Return,\n): (...args: Args) => Return {\n\treturn (...args: Args) => {\n\t\tlet result: any;\n\t\tbatch(() => {\n\t\t\tresult = fn(...args);\n\t\t});\n\t\treturn result as Return;\n\t};\n}\n"],"mappings":"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","names":["map"]}
@@ -1,456 +0,0 @@
1
- import {
2
- TopicGraph
3
- } from "./chunk-X5R3GL6H.js";
4
- import {
5
- domainMeta
6
- } from "./chunk-JSCT3CR4.js";
7
- import {
8
- reactiveLog
9
- } from "./chunk-J2VBW3DZ.js";
10
- import {
11
- keepalive
12
- } from "./chunk-BVZYTZ5H.js";
13
- import {
14
- watchTopologyTree
15
- } from "./chunk-OU5CQKNW.js";
16
- import {
17
- Graph
18
- } from "./chunk-PF7GRZMW.js";
19
- import {
20
- NodeImpl,
21
- defaultHash,
22
- derived,
23
- monotonicNs,
24
- policyFromRules,
25
- state,
26
- wallClockNs
27
- } from "./chunk-PHOUUNK7.js";
28
- import {
29
- DATA,
30
- __export
31
- } from "./chunk-SX52TAR4.js";
32
-
33
- // src/patterns/audit.ts
34
- var audit_exports = {};
35
- __export(audit_exports, {
36
- AuditTrailGraph: () => AuditTrailGraph,
37
- PolicyEnforcerGraph: () => PolicyEnforcerGraph,
38
- auditTrail: () => auditTrail,
39
- complianceSnapshot: () => complianceSnapshot,
40
- policyEnforcer: () => policyEnforcer,
41
- reactiveExplainPath: () => reactiveExplainPath
42
- });
43
- function auditMeta(kind, extra) {
44
- return domainMeta("audit", kind, extra);
45
- }
46
- var DEFAULT_INCLUDE_TYPES = /* @__PURE__ */ new Set([
47
- "data",
48
- "error",
49
- "complete",
50
- "teardown"
51
- ]);
52
- var AuditTrailGraph = class extends Graph {
53
- entries;
54
- count;
55
- _log;
56
- _target;
57
- constructor(target, opts) {
58
- super(opts.name ?? `${target.name}_audit`, opts.graph);
59
- this._target = target;
60
- this._log = reactiveLog([], {
61
- name: "entries",
62
- ...opts.maxSize != null ? { maxSize: opts.maxSize } : {}
63
- });
64
- this.entries = this._log.entries;
65
- this.add("entries", this.entries);
66
- this.count = derived(
67
- [this.entries],
68
- ([snapshot]) => snapshot.length,
69
- { name: "count", describeKind: "derived", meta: auditMeta("count") }
70
- );
71
- this.add("count", this.count);
72
- this.addDisposer(keepalive(this.count));
73
- const includeTypes = opts.includeTypes != null ? new Set(opts.includeTypes) : DEFAULT_INCLUDE_TYPES;
74
- const filter = opts.filter;
75
- let seq = 0;
76
- const handle = target.observe({ timeline: true, structured: true });
77
- const offEvent = handle.onEvent((event) => {
78
- if (event.type === "derived") return;
79
- const type = event.type;
80
- if (!includeTypes.has(type)) return;
81
- const path = event.path ?? "";
82
- const entry = {
83
- seq: seq++,
84
- timestamp_ns: event.timestamp_ns ?? monotonicNs(),
85
- wall_clock_ns: wallClockNs(),
86
- path,
87
- type
88
- };
89
- const node = path ? safeNode(target, path) : void 0;
90
- const lastMutation = node?.lastMutation;
91
- if (lastMutation != null) entry.actor = lastMutation.actor;
92
- if (type === "data") entry.value = event.data;
93
- if (type === "error") entry.error = event.data;
94
- const reason = path ? safeAnnotation(target, path) : void 0;
95
- if (reason != null) entry.reason = reason;
96
- if (filter != null && !filter(entry)) return;
97
- this._log.append(entry);
98
- });
99
- this.addDisposer(() => {
100
- offEvent();
101
- handle.dispose();
102
- });
103
- this.addDisposer(() => this._log.disposeAllViews());
104
- }
105
- /** All entries currently in the ring (snapshot). */
106
- all() {
107
- return this.entries.cache ?? [];
108
- }
109
- /** Entries matching `path`. Order preserved. */
110
- byNode(path) {
111
- return this.all().filter((e) => e.path === path);
112
- }
113
- /** Entries whose `actor.id` matches. Use `byActorType` for type filtering. */
114
- byActor(actorId) {
115
- return this.all().filter((e) => e.actor?.id === actorId);
116
- }
117
- /** Entries whose `actor.type` matches (e.g. `"llm"`, `"human"`). */
118
- byActorType(type) {
119
- return this.all().filter((e) => e.actor?.type === type);
120
- }
121
- /**
122
- * Entries with `timestamp_ns` in `[start_ns, end_ns)` (end exclusive).
123
- * Omit `end_ns` to query open-ended.
124
- */
125
- byTimeRange(start_ns, end_ns) {
126
- return this.all().filter((e) => {
127
- if (e.timestamp_ns < start_ns) return false;
128
- if (end_ns != null && e.timestamp_ns >= end_ns) return false;
129
- return true;
130
- });
131
- }
132
- /** Reference to the audited graph (escape hatch for tooling). */
133
- get target() {
134
- return this._target;
135
- }
136
- };
137
- function auditTrail(target, opts = {}) {
138
- return new AuditTrailGraph(target, opts);
139
- }
140
- var PolicyEnforcerGraph = class extends Graph {
141
- policies;
142
- violations;
143
- violationCount;
144
- _target;
145
- _mode;
146
- _currentGuard;
147
- constructor(target, policies, opts) {
148
- super(opts.name ?? `${target.name}_policy`, opts.graph);
149
- this._target = target;
150
- this._mode = opts.mode ?? "audit";
151
- const policiesNode = isNode(policies) ? policies : state(policies, { name: "policies" });
152
- this.policies = policiesNode;
153
- this.add("policies", this.policies);
154
- this.violations = new TopicGraph("violations", {
155
- retainedLimit: opts.violationsLimit ?? 1e3
156
- });
157
- this.mount("violations", this.violations);
158
- this.violationCount = derived(
159
- [this.violations.events],
160
- ([snapshot]) => snapshot.length,
161
- {
162
- name: "violationCount",
163
- describeKind: "derived",
164
- meta: auditMeta("policy_violation_count")
165
- }
166
- );
167
- this.add("violationCount", this.violationCount);
168
- this.addDisposer(keepalive(this.violationCount));
169
- const initialRules = policiesNode.cache ?? [];
170
- let latestRules = initialRules;
171
- this._currentGuard = policyFromRules(latestRules);
172
- const offPolicies = policiesNode.subscribe((msgs) => {
173
- for (const m of msgs) {
174
- if (m[0] === DATA) {
175
- latestRules = m[1] ?? [];
176
- this._currentGuard = policyFromRules(latestRules);
177
- }
178
- }
179
- });
180
- this.addDisposer(offPolicies);
181
- const paths = opts.paths != null ? [...opts.paths] : collectPaths(target);
182
- if (this._mode === "enforce") {
183
- const restorers = /* @__PURE__ */ new Map();
184
- const wrapAndPush = (path) => {
185
- if (restorers.has(path)) return;
186
- const node = safeNode(target, path);
187
- if (!(node instanceof NodeImpl)) return;
188
- const pathGuard = (actor, action) => {
189
- const ok = this._currentGuard(actor, action);
190
- if (!ok) {
191
- this._publishViolation(actor, action, path, "blocked");
192
- }
193
- return ok;
194
- };
195
- restorers.set(path, node._pushGuard(pathGuard));
196
- };
197
- for (const path of paths) wrapAndPush(path);
198
- if (opts.paths == null) {
199
- const offTopology = watchTopologyTree(target, (event, emitter, prefix) => {
200
- if (event.kind === "added") {
201
- if (event.nodeKind === "node") {
202
- wrapAndPush(`${prefix}${event.name}`);
203
- } else {
204
- const child = emitter._mounts.get(event.name);
205
- if (!(child instanceof Graph)) return;
206
- const mountPrefix = `${prefix}${event.name}::`;
207
- const localPaths = collectPaths(child);
208
- for (const localPath of localPaths) {
209
- wrapAndPush(
210
- localPath === "" ? `${prefix}${event.name}` : `${mountPrefix}${localPath}`
211
- );
212
- }
213
- }
214
- } else if (event.kind === "removed") {
215
- if (event.nodeKind === "node") {
216
- const qp = `${prefix}${event.name}`;
217
- const r = restorers.get(qp);
218
- if (r != null) {
219
- r();
220
- restorers.delete(qp);
221
- }
222
- } else {
223
- const mountQp = `${prefix}${event.name}`;
224
- const mountPrefix = `${mountQp}::`;
225
- for (const [p, r] of restorers) {
226
- if (p === mountQp || p.startsWith(mountPrefix)) {
227
- r();
228
- restorers.delete(p);
229
- }
230
- }
231
- }
232
- }
233
- });
234
- this.addDisposer(offTopology);
235
- } else {
236
- const offCleanup = target.topology.subscribe((msgs) => {
237
- for (const m of msgs) {
238
- if (m[0] !== DATA) continue;
239
- const event = m[1];
240
- if (event.kind !== "removed" || event.nodeKind !== "node") continue;
241
- const r = restorers.get(event.name);
242
- if (r != null) {
243
- r();
244
- restorers.delete(event.name);
245
- }
246
- }
247
- });
248
- this.addDisposer(offCleanup);
249
- }
250
- this.addDisposer(() => {
251
- for (const r of restorers.values()) r();
252
- restorers.clear();
253
- });
254
- } else {
255
- const handle = target.observe({ timeline: true, structured: true });
256
- const off = handle.onEvent((event) => {
257
- if (event.type !== "data" && event.type !== "error") return;
258
- const path = event.path ?? "";
259
- if (!path) return;
260
- if (opts.paths != null && !opts.paths.includes(path)) return;
261
- const node = safeNode(target, path);
262
- const lastMutation = node?.lastMutation;
263
- if (lastMutation == null) return;
264
- const action = "write";
265
- if (this._currentGuard(lastMutation.actor, action)) return;
266
- this._publishViolation(lastMutation.actor, action, path, "observed");
267
- });
268
- this.addDisposer(() => {
269
- off();
270
- handle.dispose();
271
- });
272
- }
273
- }
274
- _publishViolation(actor, action, path, result) {
275
- this.violations.publish({
276
- timestamp_ns: monotonicNs(),
277
- wall_clock_ns: wallClockNs(),
278
- path,
279
- actor,
280
- action,
281
- mode: this._mode,
282
- result
283
- });
284
- }
285
- /** Snapshot of recorded violations. */
286
- all() {
287
- return this.violations.retained();
288
- }
289
- get mode() {
290
- return this._mode;
291
- }
292
- get target() {
293
- return this._target;
294
- }
295
- };
296
- function policyEnforcer(target, policies, opts = {}) {
297
- return new PolicyEnforcerGraph(target, policies, opts);
298
- }
299
- function reactiveExplainPath(target, from, to, opts) {
300
- let v = 0;
301
- const version = state(v, { name: "explain_version" });
302
- const handle = target.observe({ timeline: true, structured: true });
303
- const off = handle.onEvent((event) => {
304
- const t = event.type;
305
- if (t !== "data" && t !== "error" && t !== "complete" && t !== "teardown") return;
306
- v += 1;
307
- version.emit(v);
308
- });
309
- const explainOpts = {
310
- ...opts?.maxDepth != null ? { maxDepth: opts.maxDepth } : {},
311
- ...opts?.findCycle === true ? { findCycle: true } : {}
312
- };
313
- const node = derived([version], () => target.explain(from, to, explainOpts), {
314
- name: opts?.name ?? "explain",
315
- describeKind: "derived",
316
- equals: (a, b) => a.found === b.found && a.reason === b.reason && a.steps.length === b.steps.length && causalStepsEqual(a.steps, b.steps),
317
- meta: auditMeta("explain_path", { from, to })
318
- });
319
- const stopKeepalive = keepalive(node);
320
- return {
321
- node,
322
- dispose() {
323
- off();
324
- handle.dispose();
325
- stopKeepalive();
326
- }
327
- };
328
- }
329
- function causalStepsEqual(a, b) {
330
- for (let i = 0; i < a.length; i++) {
331
- const x = a[i];
332
- const y = b[i];
333
- if (x.path !== y.path) return false;
334
- if (x.type !== y.type) return false;
335
- if (x.status !== y.status) return false;
336
- if (x.hop !== y.hop) return false;
337
- if (x.dep_index !== y.dep_index) return false;
338
- if (x.reason !== y.reason) return false;
339
- if (x.value !== y.value) return false;
340
- if (x.lastMutation !== y.lastMutation) return false;
341
- const xv = x.v;
342
- const yv = y.v;
343
- if (xv !== yv) {
344
- if (xv == null || yv == null) return false;
345
- if (xv.id !== yv.id || xv.version !== yv.version) return false;
346
- }
347
- }
348
- return true;
349
- }
350
- function complianceSnapshot(target, opts = {}) {
351
- const result = {
352
- format_version: 1,
353
- timestamp_ns: monotonicNs(),
354
- wall_clock_ns: wallClockNs(),
355
- graph: target.snapshot()
356
- };
357
- if (opts.actor != null) result.actor = opts.actor;
358
- if (opts.audit != null) {
359
- const entries = [...opts.audit.all()];
360
- result.audit = { count: entries.length, entries };
361
- }
362
- if (opts.policies != null) {
363
- const rules = opts.policies.policies.cache ?? [];
364
- result.policies = {
365
- mode: opts.policies.mode,
366
- rules,
367
- violations: [...opts.policies.all()]
368
- };
369
- }
370
- const fingerprint = computeFingerprint(result);
371
- return { ...result, fingerprint };
372
- }
373
- function isNode(x) {
374
- return typeof x === "object" && x !== null && "subscribe" in x;
375
- }
376
- function safeNode(target, path) {
377
- try {
378
- return target.node(path);
379
- } catch {
380
- return void 0;
381
- }
382
- }
383
- function safeAnnotation(target, path) {
384
- try {
385
- return target.annotation(path);
386
- } catch {
387
- return void 0;
388
- }
389
- }
390
- function collectPaths(target) {
391
- const described = target.describe({ detail: "minimal" });
392
- return Object.keys(described.nodes);
393
- }
394
- function computeFingerprint(value) {
395
- return defaultHash(JSON.stringify(canonicalize(value)));
396
- }
397
- function canonicalize(value) {
398
- const stack = /* @__PURE__ */ new Set();
399
- const walk = (v) => {
400
- if (v === void 0) return { __undefined: true };
401
- if (v === null) return null;
402
- const t = typeof v;
403
- if (t === "bigint") return { __bigint: v.toString() };
404
- if (t !== "object") return v;
405
- const obj = v;
406
- if (stack.has(obj)) return { __circular: true };
407
- stack.add(obj);
408
- try {
409
- if (Array.isArray(obj)) {
410
- return obj.map(walk);
411
- }
412
- if (obj instanceof Date) {
413
- return { __date: obj.toISOString() };
414
- }
415
- if (obj instanceof RegExp) {
416
- return { __regexp: { source: obj.source, flags: obj.flags } };
417
- }
418
- if (obj instanceof Map) {
419
- const entries = [...obj.entries()].map(([k, mv]) => [
420
- walk(k),
421
- walk(mv)
422
- ]);
423
- return { __map: entries };
424
- }
425
- if (obj instanceof Set) {
426
- const items = [...obj].map(walk);
427
- return { __set: items };
428
- }
429
- if (ArrayBuffer.isView(obj)) {
430
- const ta = obj;
431
- const arr = new Array(ta.length);
432
- for (let i = 0; i < ta.length; i++) arr[i] = ta[i] ?? 0;
433
- return { __typed_array: { ctor: obj.constructor.name, data: arr } };
434
- }
435
- const out = {};
436
- for (const k of Object.keys(obj).sort()) {
437
- out[k] = walk(obj[k]);
438
- }
439
- return out;
440
- } finally {
441
- stack.delete(obj);
442
- }
443
- };
444
- return walk(value);
445
- }
446
-
447
- export {
448
- AuditTrailGraph,
449
- auditTrail,
450
- PolicyEnforcerGraph,
451
- policyEnforcer,
452
- reactiveExplainPath,
453
- complianceSnapshot,
454
- audit_exports
455
- };
456
- //# sourceMappingURL=chunk-NC6S43JJ.js.map