@graphrefly/graphrefly 0.40.0 → 0.42.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 (296) hide show
  1. package/dist/{cascading-Cxs1eztH.d.cts → cascading-CH-_VwG9.d.cts} +2 -2
  2. package/dist/{cascading-BNfxffgc.d.ts → cascading-OgKQZjsa.d.ts} +2 -2
  3. package/dist/{chunk-CKFQS2CJ.js → chunk-2K5RXLAH.js} +1 -1
  4. package/dist/chunk-3ERTUW2J.js +45 -0
  5. package/dist/chunk-3K7HA4Y6.js +1 -0
  6. package/dist/chunk-3ZZX7M25.js +1 -0
  7. package/dist/chunk-4QH6VJF4.js +1 -0
  8. package/dist/{chunk-I2DEVPMU.js → chunk-5QRRKBUT.js} +1 -1
  9. package/dist/chunk-5ST42ESJ.js +1 -0
  10. package/dist/{chunk-FHRBBHJN.js → chunk-6YFZMUMR.js} +1 -1
  11. package/dist/{chunk-MNZIKXK4.js → chunk-7ARY3Y3T.js} +1 -1
  12. package/dist/chunk-7B7ELAT2.js +1 -0
  13. package/dist/{chunk-Z4F3DOWS.js → chunk-7VKFXLZQ.js} +1 -1
  14. package/dist/chunk-ACMJ2ZPS.js +3 -0
  15. package/dist/{chunk-32N3JALT.js → chunk-AGNM6RS6.js} +1 -1
  16. package/dist/chunk-AS3TV2TV.js +1 -0
  17. package/dist/{chunk-B7LCDQEV.js → chunk-CISGGAIF.js} +1 -1
  18. package/dist/{chunk-N43XM7BM.js → chunk-DEJTNNQC.js} +1 -1
  19. package/dist/{chunk-2QXRYP7Q.js → chunk-FDZAZNRO.js} +1 -1
  20. package/dist/{chunk-QSK3RRII.js → chunk-FUZ6S2DY.js} +1 -1
  21. package/dist/{chunk-LYM4PBMV.js → chunk-G5VBJ5K6.js} +1 -1
  22. package/dist/{chunk-6I726LZU.js → chunk-HZKW2AAB.js} +1 -1
  23. package/dist/{chunk-LCGAVGGV.js → chunk-IZM3UEH3.js} +3 -3
  24. package/dist/{chunk-2DMKW2AD.js → chunk-KCACBSJH.js} +1 -1
  25. package/dist/{chunk-SSCGRYJ2.js → chunk-KT5DTRBP.js} +1 -1
  26. package/dist/{chunk-WL6LFPJB.js → chunk-KY2LMAXU.js} +1 -1
  27. package/dist/{chunk-YXDRGKXP.js → chunk-LDQ3IUIP.js} +1 -1
  28. package/dist/chunk-LPRWATHB.js +61 -0
  29. package/dist/{chunk-6VWBPSSY.js → chunk-NWXQIOIB.js} +3 -3
  30. package/dist/{chunk-XW4YDF6G.js → chunk-Q7QQQA3I.js} +1 -1
  31. package/dist/chunk-VE5SIZEM.js +1 -0
  32. package/dist/chunk-VRALOYRD.js +1 -0
  33. package/dist/{chunk-XJLYLLIJ.js → chunk-WHMUB5QB.js} +1 -1
  34. package/dist/chunk-XLQPNNIC.js +1 -0
  35. package/dist/{chunk-JKBOIJ22.js → chunk-YGL7FPVQ.js} +1 -1
  36. package/dist/compat/index.cjs +5 -5
  37. package/dist/compat/index.d.cts +16 -16
  38. package/dist/compat/index.d.ts +16 -16
  39. package/dist/compat/index.js +1 -1
  40. package/dist/compat/jotai/index.d.cts +2 -2
  41. package/dist/compat/jotai/index.d.ts +2 -2
  42. package/dist/compat/nanostores/index.d.cts +2 -2
  43. package/dist/compat/nanostores/index.d.ts +2 -2
  44. package/dist/compat/nestjs/index.cjs +5 -5
  45. package/dist/compat/nestjs/index.d.cts +8 -8
  46. package/dist/compat/nestjs/index.d.ts +8 -8
  47. package/dist/compat/nestjs/index.js +1 -1
  48. package/dist/compat/react/index.d.cts +2 -2
  49. package/dist/compat/react/index.d.ts +2 -2
  50. package/dist/compat/solid/index.d.cts +2 -2
  51. package/dist/compat/solid/index.d.ts +2 -2
  52. package/dist/compat/svelte/index.d.cts +2 -2
  53. package/dist/compat/svelte/index.d.ts +2 -2
  54. package/dist/compat/vue/index.d.cts +2 -2
  55. package/dist/compat/vue/index.d.ts +2 -2
  56. package/dist/compat/zustand/index.cjs +3 -3
  57. package/dist/compat/zustand/index.d.cts +4 -4
  58. package/dist/compat/zustand/index.d.ts +4 -4
  59. package/dist/compat/zustand/index.js +1 -1
  60. package/dist/core/index.d.cts +4 -4
  61. package/dist/core/index.d.ts +4 -4
  62. package/dist/{decay-C25AyNAj.d.cts → decay-2ZukgQ4o.d.cts} +2 -2
  63. package/dist/{decay-BnrlbxSv.d.ts → decay-CdEBmDIs.d.ts} +2 -2
  64. package/dist/extra/browser.d.cts +1 -1
  65. package/dist/extra/browser.d.ts +1 -1
  66. package/dist/extra/index.cjs +14 -14
  67. package/dist/extra/index.d.cts +10 -11
  68. package/dist/extra/index.d.ts +10 -11
  69. package/dist/extra/index.js +1 -1
  70. package/dist/extra/node.cjs +2 -2
  71. package/dist/extra/node.d.cts +1 -1
  72. package/dist/extra/node.d.ts +1 -1
  73. package/dist/extra/node.js +1 -1
  74. package/dist/extra/operators.cjs +1 -1
  75. package/dist/extra/operators.d.cts +1 -1
  76. package/dist/extra/operators.d.ts +1 -1
  77. package/dist/extra/operators.js +1 -1
  78. package/dist/extra/reactive.d.cts +3 -3
  79. package/dist/extra/reactive.d.ts +3 -3
  80. package/dist/extra/reactive.js +1 -1
  81. package/dist/extra/render/index.d.cts +3 -3
  82. package/dist/extra/render/index.d.ts +3 -3
  83. package/dist/extra/sources.cjs +3 -1
  84. package/dist/extra/sources.d.cts +1 -1
  85. package/dist/extra/sources.d.ts +1 -1
  86. package/dist/extra/sources.js +1 -1
  87. package/dist/extra/storage-browser.d.cts +1 -1
  88. package/dist/extra/storage-browser.d.ts +1 -1
  89. package/dist/{fallback-CMZl39L5.d.ts → fallback-CqYVLL6X.d.ts} +1 -1
  90. package/dist/{fallback-8JYU8tlT.d.cts → fallback-Ctlj2tMY.d.cts} +1 -1
  91. package/dist/graph/index.cjs +7 -7
  92. package/dist/graph/index.d.cts +5 -5
  93. package/dist/graph/index.d.ts +5 -5
  94. package/dist/graph/index.js +1 -1
  95. package/dist/{graph-BkIkog4h.d.ts → graph-7VguS7a4.d.ts} +3 -3
  96. package/dist/{graph-E6likq7w.d.cts → graph-C4SHb3Ly.d.cts} +3 -3
  97. package/dist/{index-DktLSZOc.d.cts → index-2B7u2pVn.d.cts} +4 -4
  98. package/dist/{index-BTHOTC0Q.d.cts → index-3NmAfcH0.d.cts} +25 -7
  99. package/dist/{index-D1IEZUsj.d.ts → index-4Uz-e_fL.d.ts} +573 -213
  100. package/dist/{index-BAQrjuZF.d.ts → index-B-i4_g3k.d.ts} +2 -2
  101. package/dist/{index-DpiGqtrs.d.cts → index-B11anra4.d.cts} +441 -381
  102. package/dist/{index-WSlcjhQF.d.ts → index-B3OTH1dV.d.ts} +124 -13
  103. package/dist/{index-2n8Eai6M.d.ts → index-BG0BN3PB.d.ts} +1 -1
  104. package/dist/{index-z8WFPVI8.d.cts → index-BJX94aud.d.cts} +1 -1
  105. package/dist/{index-DhLyOHYZ.d.ts → index-BP8a88zx.d.ts} +11 -4
  106. package/dist/{index-Cnr1WrlX.d.cts → index-BTQtTb_H.d.cts} +14 -3
  107. package/dist/{index-BaA-xpSw.d.ts → index-BUYXac2c.d.ts} +3 -3
  108. package/dist/{index-DOBLxOti.d.cts → index-BVpm6noz.d.cts} +1 -1
  109. package/dist/{index-DhnsQfa3.d.ts → index-Bbkgpt5t.d.ts} +441 -381
  110. package/dist/{index-Cczxgd2D.d.ts → index-Bc41FuHp.d.cts} +3 -3
  111. package/dist/{index-BiHUBEKq.d.cts → index-BdGtBX-X.d.cts} +3 -3
  112. package/dist/index-BeT2r7sk.d.ts +760 -0
  113. package/dist/{index-da2V5vPy.d.ts → index-Bf7eqeSF.d.ts} +2 -2
  114. package/dist/{index-bXXLSvor.d.ts → index-Bn4zHYLj.d.ts} +4 -4
  115. package/dist/{index-DGTo1yka.d.cts → index-BoLv_OfD.d.cts} +2 -2
  116. package/dist/{index-B72TQQHd.d.cts → index-BsT7F2et.d.ts} +3 -3
  117. package/dist/{index-Bd91Nmf4.d.cts → index-BtAsBp8K.d.cts} +4 -4
  118. package/dist/{index-DgJc8Zgc.d.cts → index-C0-Jv1kP.d.cts} +81 -5
  119. package/dist/{index-C6ZUaos7.d.ts → index-C7O6r5fV.d.ts} +1 -1
  120. package/dist/{index-CL7oilfm.d.cts → index-C9kSENB4.d.cts} +1 -1
  121. package/dist/{index-yLt-aPMp.d.ts → index-CCq87F7t.d.ts} +1 -1
  122. package/dist/{index-DQQCOIt8.d.cts → index-CEMx8n40.d.cts} +10 -5
  123. package/dist/{index-BilOa6AE.d.cts → index-CJIuLu2f.d.cts} +124 -13
  124. package/dist/{index-B2RUoIUz.d.ts → index-CJK1JkYy.d.ts} +1 -1
  125. package/dist/{index-IUCY0OFN.d.ts → index-CJQm0g38.d.ts} +25 -7
  126. package/dist/index-CPNSy-U0.d.cts +760 -0
  127. package/dist/{index-A3U3CSve.d.cts → index-CZjOhcBy.d.cts} +2 -2
  128. package/dist/{index-CAP3UGsq.d.ts → index-CZmcDtFn.d.ts} +1 -1
  129. package/dist/{index-DYTBbF8T.d.cts → index-ChOyVLKm.d.cts} +1 -1
  130. package/dist/{index-eaQuGJnv.d.ts → index-CpyNFqkB.d.ts} +3 -3
  131. package/dist/{index-BJSZxSFX.d.ts → index-CvrqGfNS.d.ts} +1 -1
  132. package/dist/{index-DJ_MPOJ5.d.cts → index-D-Xs74HZ.d.cts} +573 -213
  133. package/dist/{index-C5cQ7Gfx.d.ts → index-D6egPFAL.d.ts} +4 -4
  134. package/dist/{index-CD2dBMet.d.ts → index-D8l8hNXn.d.ts} +10 -5
  135. package/dist/{index-40ZT4MHj.d.ts → index-DBHK8O6H.d.ts} +14 -3
  136. package/dist/{index-DVDapw2k.d.cts → index-DBIqYS43.d.cts} +35 -21
  137. package/dist/{index-3k4Gg6-n.d.ts → index-DBevwHj_.d.ts} +3 -3
  138. package/dist/{index-Ctb7_2sG.d.ts → index-DIOoAZUX.d.ts} +1 -1
  139. package/dist/{index-BQ1fR4li.d.ts → index-DO9XxMzS.d.ts} +35 -21
  140. package/dist/{index-CQtWm7jS.d.ts → index-DQo8xBgd.d.ts} +9 -9
  141. package/dist/{index-DH4fm2Ck.d.ts → index-Dgs8zcj7.d.ts} +2 -2
  142. package/dist/{index-CtFNGe-m.d.cts → index-Dhc7a7Xo.d.cts} +2 -2
  143. package/dist/{index-MxYuWOrf.d.cts → index-DmAgG5CI.d.cts} +3 -3
  144. package/dist/{index-CoM4rzyB.d.ts → index-Dmqp7KjD.d.ts} +1 -1
  145. package/dist/{index-B6iTqKtJ.d.ts → index-Dn-wI9g4.d.ts} +2 -2
  146. package/dist/{index-C-dkXOpB.d.cts → index-Du7u1lSf.d.cts} +11 -4
  147. package/dist/{index-DVAlsmEU.d.cts → index-HoU88d5U.d.cts} +3 -3
  148. package/dist/{index-CRm0YIzC.d.cts → index-LIpQQE9f.d.cts} +9 -9
  149. package/dist/{index-CgnCFhr2.d.cts → index-f5IivDUX.d.cts} +1 -1
  150. package/dist/{index-PgwvGWa1.d.cts → index-hHcaFlJX.d.cts} +1 -1
  151. package/dist/{index-I1cCY3ZI.d.ts → index-pT8sCpOJ.d.ts} +81 -5
  152. package/dist/{index-D4uimgee.d.cts → index-sl4NyzQx.d.cts} +1 -1
  153. package/dist/{index-tV3AA9hI.d.cts → index-tJoTcnHh.d.cts} +2 -2
  154. package/dist/{index-D3ayz3hy.d.cts → index-z96luz5O.d.cts} +1 -1
  155. package/dist/index.cjs +48 -48
  156. package/dist/index.d.cts +45 -50
  157. package/dist/index.d.ts +45 -50
  158. package/dist/index.js +1 -1
  159. package/dist/{meta-D8OyedKp.d.ts → meta-BgVAsg9j.d.ts} +1 -1
  160. package/dist/{meta-Ct9nqQS5.d.cts → meta-vE8bxW1E.d.cts} +1 -1
  161. package/dist/{node-BYInONRr.d.cts → node-ClS5yC-B.d.cts} +1 -1
  162. package/dist/{node-BYInONRr.d.ts → node-ClS5yC-B.d.ts} +1 -1
  163. package/dist/{observable-DO8DDEzv.d.ts → observable-BsBzUrcI.d.ts} +1 -1
  164. package/dist/{observable-DMIlYJV1.d.cts → observable-DLGPPtb8.d.cts} +1 -1
  165. package/dist/patterns/ai/browser.d.cts +4 -4
  166. package/dist/patterns/ai/browser.d.ts +4 -4
  167. package/dist/patterns/ai/browser.js +1 -1
  168. package/dist/patterns/ai/index.cjs +17 -17
  169. package/dist/patterns/ai/index.d.cts +17 -17
  170. package/dist/patterns/ai/index.d.ts +17 -17
  171. package/dist/patterns/ai/index.js +1 -1
  172. package/dist/patterns/ai/node.d.cts +4 -4
  173. package/dist/patterns/ai/node.d.ts +4 -4
  174. package/dist/patterns/ai/node.js +1 -1
  175. package/dist/patterns/cqrs/index.cjs +3 -3
  176. package/dist/patterns/cqrs/index.d.cts +6 -6
  177. package/dist/patterns/cqrs/index.d.ts +6 -6
  178. package/dist/patterns/cqrs/index.js +1 -1
  179. package/dist/patterns/demo-shell/index.cjs +5 -5
  180. package/dist/patterns/demo-shell/index.d.cts +5 -5
  181. package/dist/patterns/demo-shell/index.d.ts +5 -5
  182. package/dist/patterns/demo-shell/index.js +1 -1
  183. package/dist/patterns/domain-templates/index.cjs +3 -3
  184. package/dist/patterns/domain-templates/index.d.cts +4 -4
  185. package/dist/patterns/domain-templates/index.d.ts +4 -4
  186. package/dist/patterns/domain-templates/index.js +1 -1
  187. package/dist/patterns/graphspec/index.cjs +12 -12
  188. package/dist/patterns/graphspec/index.d.cts +5 -5
  189. package/dist/patterns/graphspec/index.d.ts +5 -5
  190. package/dist/patterns/graphspec/index.js +1 -1
  191. package/dist/patterns/harness/index.cjs +10 -8
  192. package/dist/patterns/harness/index.d.cts +11 -12
  193. package/dist/patterns/harness/index.d.ts +11 -12
  194. package/dist/patterns/harness/index.js +1 -1
  195. package/dist/patterns/inspect/index.cjs +3 -0
  196. package/dist/patterns/inspect/index.d.cts +9 -0
  197. package/dist/patterns/inspect/index.d.ts +9 -0
  198. package/dist/patterns/inspect/index.js +1 -0
  199. package/dist/patterns/job-queue/index.cjs +3 -3
  200. package/dist/patterns/job-queue/index.d.cts +6 -6
  201. package/dist/patterns/job-queue/index.d.ts +6 -6
  202. package/dist/patterns/job-queue/index.js +1 -1
  203. package/dist/patterns/memory/index.cjs +3 -3
  204. package/dist/patterns/memory/index.d.cts +6 -6
  205. package/dist/patterns/memory/index.d.ts +6 -6
  206. package/dist/patterns/memory/index.js +1 -1
  207. package/dist/patterns/messaging/index.cjs +3 -3
  208. package/dist/patterns/messaging/index.d.cts +5 -5
  209. package/dist/patterns/messaging/index.d.ts +5 -5
  210. package/dist/patterns/messaging/index.js +1 -1
  211. package/dist/patterns/orchestration/index.cjs +3 -3
  212. package/dist/patterns/orchestration/index.d.cts +7 -7
  213. package/dist/patterns/orchestration/index.d.ts +7 -7
  214. package/dist/patterns/orchestration/index.js +1 -1
  215. package/dist/patterns/process/index.cjs +1 -1
  216. package/dist/patterns/process/index.d.cts +7 -7
  217. package/dist/patterns/process/index.d.ts +7 -7
  218. package/dist/patterns/process/index.js +1 -1
  219. package/dist/patterns/reactive-layout/index.cjs +4 -4
  220. package/dist/patterns/reactive-layout/index.d.cts +5 -5
  221. package/dist/patterns/reactive-layout/index.d.ts +5 -5
  222. package/dist/patterns/reactive-layout/index.js +1 -1
  223. package/dist/patterns/reduction/index.cjs +3 -3
  224. package/dist/patterns/reduction/index.d.cts +4 -4
  225. package/dist/patterns/reduction/index.d.ts +4 -4
  226. package/dist/patterns/reduction/index.js +1 -1
  227. package/dist/patterns/surface/index.cjs +8 -8
  228. package/dist/patterns/surface/index.d.cts +6 -6
  229. package/dist/patterns/surface/index.d.ts +6 -6
  230. package/dist/patterns/surface/index.js +1 -1
  231. package/dist/{pipeline-graph-MWrQZXCq.d.cts → pipeline-graph-WBlobVhU.d.cts} +5 -5
  232. package/dist/{pipeline-graph-CB4La-UW.d.ts → pipeline-graph-v8fMvqNk.d.ts} +5 -5
  233. package/dist/{reactive-layout-BtZfUKuL.d.cts → reactive-layout-Dsvob4zD.d.cts} +2 -2
  234. package/dist/{reactive-layout-KJj4E2dT.d.ts → reactive-layout-v7KPvxoc.d.ts} +2 -2
  235. package/dist/{reactive-log-_zeEnB9H.d.cts → reactive-log-B00laMSQ.d.cts} +1 -1
  236. package/dist/{reactive-log-BlAsPLl2.d.ts → reactive-log-BezYsbA_.d.ts} +1 -1
  237. package/dist/{reactive-map-6P_k3AQM.d.cts → reactive-map-48mnZ-nu.d.cts} +1 -1
  238. package/dist/{reactive-map-CjXByDV-.d.ts → reactive-map-BVVPdvmi.d.ts} +1 -1
  239. package/dist/resilience-445VFFXQ.js +1 -0
  240. package/dist/{sugar-BhfjgetH.d.ts → sugar-CH-2ZY90.d.ts} +1 -1
  241. package/dist/{sugar-DzePN5-g.d.cts → sugar-DStZfUEK.d.cts} +1 -1
  242. package/dist/{topology-tree-mF7Emqzm.d.ts → topology-tree-BNGvuG82.d.ts} +1 -1
  243. package/dist/{topology-tree-3LBKFsUo.d.cts → topology-tree-BSdfSwMi.d.cts} +1 -1
  244. package/dist/{types-1Dhoi7HM.d.cts → types-B1jDWVsM.d.cts} +1 -1
  245. package/dist/{types-39jk0kaV.d.ts → types-DkzUUs0H.d.ts} +1 -1
  246. package/package.json +11 -51
  247. package/dist/budget-gate-CmmVtasH.d.ts +0 -115
  248. package/dist/budget-gate-DiP_nK0n.d.cts +0 -115
  249. package/dist/chunk-2BX4NB34.js +0 -3
  250. package/dist/chunk-6XVD5TZV.js +0 -1
  251. package/dist/chunk-756D5TFD.js +0 -1
  252. package/dist/chunk-7Q4ZD3YW.js +0 -1
  253. package/dist/chunk-ECQRP2UT.js +0 -1
  254. package/dist/chunk-INQFTVZA.js +0 -61
  255. package/dist/chunk-J63M5U46.js +0 -1
  256. package/dist/chunk-K2Z7UENB.js +0 -1
  257. package/dist/chunk-OSZ22J7O.js +0 -1
  258. package/dist/chunk-PPUYQ66A.js +0 -1
  259. package/dist/chunk-RZJDIV2G.js +0 -1
  260. package/dist/chunk-SGS4OJGS.js +0 -1
  261. package/dist/chunk-SVFKHUCW.js +0 -1
  262. package/dist/chunk-UWA6D7UF.js +0 -3
  263. package/dist/chunk-VMF23LGB.js +0 -1
  264. package/dist/chunk-WUT362QV.js +0 -1
  265. package/dist/chunk-YKD7WUYJ.js +0 -43
  266. package/dist/index-8s-Qm-gz.d.ts +0 -218
  267. package/dist/index-BgjS2b8N.d.ts +0 -366
  268. package/dist/index-BmSQLAZo.d.cts +0 -244
  269. package/dist/index-CGhMJNHb.d.cts +0 -128
  270. package/dist/index-CUIkE1l9.d.cts +0 -230
  271. package/dist/index-Ck35nA-T.d.ts +0 -244
  272. package/dist/index-CuPUehFa.d.cts +0 -218
  273. package/dist/index-D1Gc7wV5.d.ts +0 -230
  274. package/dist/index-N2MAxt7_.d.ts +0 -128
  275. package/dist/index-t6L2qpHh.d.cts +0 -366
  276. package/dist/patterns/audit/index.cjs +0 -3
  277. package/dist/patterns/audit/index.d.cts +0 -8
  278. package/dist/patterns/audit/index.d.ts +0 -8
  279. package/dist/patterns/audit/index.js +0 -1
  280. package/dist/patterns/guarded-execution/index.cjs +0 -3
  281. package/dist/patterns/guarded-execution/index.d.cts +0 -9
  282. package/dist/patterns/guarded-execution/index.d.ts +0 -9
  283. package/dist/patterns/guarded-execution/index.js +0 -1
  284. package/dist/patterns/lens/index.cjs +0 -3
  285. package/dist/patterns/lens/index.d.cts +0 -7
  286. package/dist/patterns/lens/index.d.ts +0 -7
  287. package/dist/patterns/lens/index.js +0 -1
  288. package/dist/patterns/refine-loop/index.cjs +0 -5
  289. package/dist/patterns/refine-loop/index.d.cts +0 -9
  290. package/dist/patterns/refine-loop/index.d.ts +0 -9
  291. package/dist/patterns/refine-loop/index.js +0 -1
  292. package/dist/patterns/resilient-pipeline/index.cjs +0 -3
  293. package/dist/patterns/resilient-pipeline/index.d.cts +0 -8
  294. package/dist/patterns/resilient-pipeline/index.d.ts +0 -8
  295. package/dist/patterns/resilient-pipeline/index.js +0 -1
  296. package/dist/resilience-S33JV6XC.js +0 -1
@@ -0,0 +1,760 @@
1
+ import { A as Actor, N as Node, W as PolicyRuleData, o as GuardAction } from './node-ClS5yC-B.cjs';
2
+ import { G as Graph, a as GraphOptions, r as GraphPersistSnapshot, b as GraphDescribeOutput, j as GraphDescribeOptions, C as CausalChain, e as DescribeFilter } from './graph-C4SHb3Ly.cjs';
3
+ import { T as TopicGraph } from './index-BTQtTb_H.cjs';
4
+ import { w as watchTopologyTree } from './topology-tree-BSdfSwMi.cjs';
5
+
6
+ /**
7
+ * Audit, policy enforcement, and compliance export (roadmap §9.2).
8
+ *
9
+ * Three composed factories that wrap any {@link Graph} with the harness
10
+ * accountability layer:
11
+ *
12
+ * - {@link auditTrail} — reactive mutation log with by-node/by-actor/by-time
13
+ * queries.
14
+ * - {@link policyGate} — reactive ABAC gate (Tier 2.3 rename of
15
+ * `policyEnforcer`); in `"audit"` mode records would-be denials, in
16
+ * `"enforce"` mode pushes guards onto target nodes so subsequent writes
17
+ * throw {@link GuardDenied}.
18
+ * - {@link complianceSnapshot} — point-in-time export of graph state +
19
+ * audit trail + policies for regulatory archival.
20
+ *
21
+ * @module
22
+ */
23
+
24
+ /** A single recorded mutation/event in an {@link AuditTrailGraph}. */
25
+ interface AuditEntry {
26
+ seq: number;
27
+ timestamp_ns: number;
28
+ wall_clock_ns: number;
29
+ path: string;
30
+ type: "data" | "dirty" | "resolved" | "invalidate" | "pause" | "resume" | "complete" | "error" | "teardown";
31
+ actor?: Actor;
32
+ value?: unknown;
33
+ error?: unknown;
34
+ annotation?: string;
35
+ }
36
+ /** Options for {@link auditTrail}. */
37
+ interface AuditTrailOptions {
38
+ name?: string;
39
+ graph?: GraphOptions;
40
+ /** Ring-buffer cap for the underlying `reactiveLog`. Default: unbounded. */
41
+ maxSize?: number;
42
+ /**
43
+ * Which event types to record. Default: `["data", "error", "complete",
44
+ * "teardown"]` — the user-meaningful set. Opt in to mid-wave protocol
45
+ * events (`"dirty"`, `"resolved"`, `"invalidate"`, `"pause"`, `"resume"`)
46
+ * by listing them explicitly. Note: those tier-1/tier-2 events do not
47
+ * carry an `actor` (no `lastMutation` populated) — record them only for
48
+ * protocol-level diagnostics.
49
+ */
50
+ includeTypes?: readonly AuditEntry["type"][];
51
+ /** Per-event filter; return false to skip. */
52
+ filter?: (entry: AuditEntry) => boolean;
53
+ }
54
+ /**
55
+ * Mounted audit log — `entries` exposes the reactive `AuditEntry[]`; query
56
+ * helpers are sync convenience wrappers over the cached snapshot.
57
+ */
58
+ declare class AuditTrailGraph extends Graph {
59
+ readonly entries: Node<readonly AuditEntry[]>;
60
+ readonly count: Node<number>;
61
+ private readonly _log;
62
+ private readonly _target;
63
+ constructor(target: Graph, opts: AuditTrailOptions);
64
+ /** All entries currently in the ring (snapshot). */
65
+ all(): readonly AuditEntry[];
66
+ /** Entries matching `path`. Order preserved. */
67
+ byNode(path: string): readonly AuditEntry[];
68
+ /** Entries whose `actor.id` matches. Use `byActorType` for type filtering. */
69
+ byActor(actorId: string): readonly AuditEntry[];
70
+ /** Entries whose `actor.type` matches (e.g. `"llm"`, `"human"`). */
71
+ byActorType(type: string): readonly AuditEntry[];
72
+ /**
73
+ * Entries with `timestamp_ns` in `[start_ns, end_ns)` (end exclusive).
74
+ * Omit `end_ns` to query open-ended.
75
+ */
76
+ byTimeRange(start_ns: number, end_ns?: number): readonly AuditEntry[];
77
+ /** Reference to the audited graph (escape hatch for tooling). */
78
+ get target(): Graph;
79
+ }
80
+ /**
81
+ * Wraps any {@link Graph} with a reactive audit trail recording every event
82
+ * matching `includeTypes` (default: data + error + complete + teardown).
83
+ *
84
+ * Each entry carries `seq`, `timestamp_ns` (monotonic), `wall_clock_ns`,
85
+ * `path`, `type`, and — when available — `actor`, `value`, `error`, and the
86
+ * `graph.trace()` reasoning annotation for the path.
87
+ *
88
+ * The returned graph mounts an `entries` node + `count` derived. Query
89
+ * helpers (`byNode`, `byActor`, `byTimeRange`) operate on the cached
90
+ * snapshot synchronously.
91
+ */
92
+ declare function auditTrail(target: Graph, opts?: AuditTrailOptions): AuditTrailGraph;
93
+ /** A single policy denial recorded by {@link PolicyGateGraph}. */
94
+ interface PolicyViolation {
95
+ timestamp_ns: number;
96
+ wall_clock_ns: number;
97
+ path: string;
98
+ actor: Actor;
99
+ action: GuardAction;
100
+ mode: "audit" | "enforce";
101
+ /** `"observed"` (audit mode after-the-fact) or `"blocked"` (enforce mode pre-write). */
102
+ result: "observed" | "blocked";
103
+ }
104
+ /** Options for {@link policyGate}. */
105
+ interface PolicyGateOptions {
106
+ name?: string;
107
+ graph?: GraphOptions;
108
+ /**
109
+ * `"audit"` (default) — observe events and record would-be denials;
110
+ * does not block writes. Audit mode requires `lastMutation` attribution
111
+ * on the audited node — anonymous/internal writes (no `actor` passed,
112
+ * unguarded node) are skipped silently because the policy cannot be
113
+ * evaluated without an actor.
114
+ *
115
+ * `"enforce"` — push guards onto target nodes so disallowed writes
116
+ * throw {@link GuardDenied}. Reverted on dispose.
117
+ */
118
+ mode?: "audit" | "enforce";
119
+ /**
120
+ * Restrict enforcement to specific node paths (qualified). When omitted,
121
+ * applies to every node visible in `target.describe()` at construction
122
+ * time (subgraphs are walked transitively) AND subscribes to the full
123
+ * topology tree via {@link watchTopologyTree}, so nodes added to
124
+ * `target` OR any transitively-mounted subgraph after construction are
125
+ * guarded automatically (enforce mode only).
126
+ *
127
+ * Accepts a static `readonly string[]` or a reactive
128
+ * `Node<readonly string[]>` (Tier 3.4 — F.9 reactive primitive carve-out).
129
+ * When a `Node` is passed, the enforcer rebinds the guarded path set on
130
+ * every emission: paths added to the new set get wrapped, paths removed
131
+ * from the new set get released, and the audit-mode allow-list filter
132
+ * uses the latest cached value. Static-array callers retain the current
133
+ * "caller owns the path set" semantics.
134
+ *
135
+ * **Cost:** unrestricted mode runs `describe({detail:"minimal"})` once
136
+ * at construction (O(N) over the graph tree) plus one topology
137
+ * subscription per graph instance in the mount tree. Restricted mode
138
+ * (static or reactive) skips both and disables `watchTopologyTree`
139
+ * dynamic coverage — for reactive callers, the path-set Node is the
140
+ * single source of truth for which paths are guarded.
141
+ */
142
+ paths?: readonly string[] | Node<readonly string[]>;
143
+ /**
144
+ * Ring-buffer cap for the violations topic. Default: 1000. Static
145
+ * number only — reactive form is deferred pending TopicGraph reactive
146
+ * `retainedLimit` support (see Tier 10.8 design follow-up in
147
+ * `docs/optimizations.md`).
148
+ */
149
+ violationsLimit?: number;
150
+ }
151
+ /**
152
+ * Reactive ABAC enforcement layer. Policies are reactive — pass a
153
+ * `Node<readonly PolicyRuleData[]>` to allow LLMs (or any reactive source)
154
+ * to update them at runtime; the enforcer rebinds its internal
155
+ * {@link NodeGuard} on every push.
156
+ */
157
+ declare class PolicyGateGraph extends Graph {
158
+ readonly policies: Node<readonly PolicyRuleData[]>;
159
+ readonly violations: TopicGraph<PolicyViolation>;
160
+ readonly violationCount: Node<number>;
161
+ private readonly _target;
162
+ private readonly _mode;
163
+ private _currentGuard;
164
+ constructor(target: Graph, policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>, opts: PolicyGateOptions);
165
+ private _publishViolation;
166
+ /** Snapshot of recorded violations. */
167
+ all(): readonly PolicyViolation[];
168
+ get mode(): "audit" | "enforce";
169
+ get target(): Graph;
170
+ }
171
+ /**
172
+ * Wraps a {@link Graph} with reactive policy enforcement. Pass either a
173
+ * static rule list or a {@link Node} of rules (LLM-updatable). Records
174
+ * `PolicyViolation` entries to `violations` topic; in `"enforce"` mode also
175
+ * pushes guards onto target nodes so disallowed writes throw.
176
+ *
177
+ * Self-tags via `g.tagFactory("policyGate", placeholderArgs(opts))` so
178
+ * `graph.describe()` surfaces `factory: "policyGate"` provenance (Phase 2.5
179
+ * DT5 ride-along, locked with the Tier 2.3 rename).
180
+ */
181
+ declare function policyGate(target: Graph, policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>, opts?: PolicyGateOptions): PolicyGateGraph;
182
+ /** Options for {@link complianceSnapshot}. */
183
+ interface ComplianceSnapshotOptions {
184
+ audit?: AuditTrailGraph;
185
+ policies?: PolicyGateGraph;
186
+ /** Actor recorded as the snapshot taker. */
187
+ actor?: Actor;
188
+ }
189
+ /** Output of {@link complianceSnapshot}. JSON-serializable. */
190
+ interface ComplianceSnapshotResult {
191
+ format_version: 1;
192
+ timestamp_ns: number;
193
+ wall_clock_ns: number;
194
+ actor?: Actor;
195
+ graph: GraphPersistSnapshot;
196
+ audit?: {
197
+ count: number;
198
+ entries: AuditEntry[];
199
+ };
200
+ policies?: {
201
+ mode: "audit" | "enforce";
202
+ rules: readonly PolicyRuleData[];
203
+ violations: readonly PolicyViolation[];
204
+ };
205
+ /**
206
+ * Truncated SHA-256 hex (16 chars / ~64 bits) over a canonical encoding
207
+ * of every field above (excluding `fingerprint` itself). Deterministic
208
+ * across runs given identical inputs. Suitable for casual tamper-evidence
209
+ * and content-addressed dedup; for full cryptographic strength, hash the
210
+ * canonical JSON externally with Web Crypto / Node `crypto`.
211
+ */
212
+ fingerprint: string;
213
+ }
214
+ /**
215
+ * One-shot point-in-time export of a {@link Graph}'s state plus optional
216
+ * audit + policy bundles. Returns a JSON-serializable object with a
217
+ * deterministic truncated-SHA-256 {@link ComplianceSnapshotResult.fingerprint}
218
+ * over the canonical payload for tamper-evidence in regulatory archival.
219
+ *
220
+ * **Cryptographic strength:** the fingerprint is truncated to 64 bits for
221
+ * compact archival. Collision-resistant for casual integrity checks but NOT
222
+ * sufficient for adversarial tamper-evidence — pair with a full SHA-256
223
+ * (or stronger) over the canonical JSON when regulatory requirements demand
224
+ * collision resistance.
225
+ */
226
+ declare function complianceSnapshot(target: Graph, opts?: ComplianceSnapshotOptions): ComplianceSnapshotResult;
227
+
228
+ /**
229
+ * Composable safety layer (roadmap §9.0b — Tier 5.1 Wave-B rebuild).
230
+ *
231
+ * {@link guardedExecution} wraps any {@link Graph} with:
232
+ *
233
+ * - {@link policyGate} — reactive ABAC (Tier 2.3 rename of `policyEnforcer`),
234
+ * policies stored as a `Node` so LLMs / humans can update them at runtime.
235
+ * Full transitive dynamic coverage via `watchTopologyTree`.
236
+ * - Reactive {@link GuardedExecutionGraph.scopedDescribeNode} — a thin
237
+ * delegate over `target.describe({ reactive: true, actor })` that re-derives
238
+ * on every settle (topology change, error transition, actor swap).
239
+ * - The enforcer's `violations` topic is republished as `violations` on
240
+ * the wrapper, composable with {@link graphLens}'s `health`.
241
+ * - The wrapper-level `lints` topic surfaces non-policy diagnostic warnings
242
+ * (`empty-policies` / `audit-no-effect` / `no-actor`) so misconfigurations
243
+ * are caught reactively rather than via thrown errors at scattered call sites.
244
+ * - The `scope` derived publishes the current configuration tuple
245
+ * (`{actor, mode, policiesCount}`) for dashboards.
246
+ *
247
+ * V1 scope: policies + actor + reactive scoped describe + lints + scope.
248
+ * Budget-as-option is NOT in V1 — it requires a cost-tracking design that
249
+ * hasn't landed yet. Callers who need a budget limit today append a
250
+ * budget-aware {@link PolicyRuleData} to the policies list (check current
251
+ * cost and `deny` when exhausted).
252
+ *
253
+ * @module
254
+ */
255
+
256
+ /** Diagnostic warning published on {@link GuardedExecutionGraph.lints}. */
257
+ interface GuardedExecutionLint {
258
+ /**
259
+ * - `"empty-policies"` — `policies` Node emitted an empty array in
260
+ * `mode: "enforce"`. Static empty arrays throw at construction; this
261
+ * covers the reactive case.
262
+ * - `"audit-no-effect"` — `mode: "audit"` plus the target has no per-node
263
+ * guards, so `scopedDescribeNode` filters by per-node guards only and
264
+ * policies will never gate visibility (they still populate `violations`
265
+ * on writes).
266
+ * - `"no-actor"` — neither a wrapper-configured nor per-call actor was
267
+ * supplied. `scopedDescribeNode` falls back to "describe everything"
268
+ * for the corresponding subscription.
269
+ */
270
+ kind: "empty-policies" | "audit-no-effect" | "no-actor";
271
+ message: string;
272
+ timestamp_ns: number;
273
+ }
274
+ /** Configuration tuple published on {@link GuardedExecutionGraph.scope}. */
275
+ interface GuardedScope {
276
+ /** The wrapper-configured default actor, or `null` when none configured. */
277
+ actor: Actor | null;
278
+ mode: "audit" | "enforce";
279
+ /** Current policy count (reactive — re-emits on `policies` Node updates). */
280
+ policiesCount: number;
281
+ }
282
+ /** Options for {@link guardedExecution}. */
283
+ interface GuardedExecutionOptions {
284
+ /**
285
+ * Policies enforced against every guarded write. Static list or a live
286
+ * `Node<readonly PolicyRuleData[]>` (LLM-updatable).
287
+ *
288
+ * **Empty-policies handling:**
289
+ * - Static empty array + `mode: "enforce"` throws `RangeError` at
290
+ * construction (deny-by-default is almost certainly a misconfiguration).
291
+ * - Node-supplied empty array + `mode: "enforce"` emits a one-time
292
+ * `"empty-policies"` lint on first such emission (the wrapper can't
293
+ * throw mid-run — surface the warning reactively).
294
+ * - `mode: "audit"` tolerates empty policies (no guards stacked; policies
295
+ * only feed the `violations` channel on writes).
296
+ */
297
+ policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>;
298
+ /**
299
+ * Default actor used when the caller invokes
300
+ * {@link GuardedExecutionGraph.scopedDescribeNode} without an override.
301
+ * Accepts a static {@link Actor} or a `Node<Actor>` — when a Node is
302
+ * supplied, the reactive describe re-derives on every actor emission so
303
+ * harnesses binding a per-turn actor get a single live describe Node
304
+ * instead of re-creating one per turn.
305
+ *
306
+ * Omit to scope per-call only. A `"no-actor"` lint fires once per instance
307
+ * if neither a configured nor per-call actor is ever supplied (the
308
+ * resulting describe is unscoped — full visibility).
309
+ */
310
+ actor?: Actor | Node<Actor>;
311
+ /**
312
+ * `"enforce"` (default) — push guards onto target nodes so disallowed
313
+ * writes throw {@link GuardDenied}.
314
+ * `"audit"` — record would-be denials to the `violations` topic without
315
+ * blocking writes.
316
+ */
317
+ mode?: "audit" | "enforce";
318
+ /** Ring-buffer cap for the `violations` topic. Default 1000 (inherited from policyGate). */
319
+ violationsLimit?: number;
320
+ /** Ring-buffer cap for the `lints` topic. Default 64 — each lint kind fires at most once per instance. */
321
+ lintsLimit?: number;
322
+ /** Wrapper graph name. Default `${target.name}_guarded`. */
323
+ name?: string;
324
+ /** Wrapper graph options. */
325
+ graph?: GraphOptions;
326
+ }
327
+ /**
328
+ * Wrapper over a target {@link Graph} providing reactive ABAC + reactive
329
+ * scoped describe + diagnostic lints. Mounts a {@link PolicyGateGraph} under
330
+ * `enforcer`, a {@link TopicGraph} of {@link GuardedExecutionLint} under
331
+ * `lints`, and a `scope` derived publishing `{actor, mode, policiesCount}`.
332
+ *
333
+ * @category patterns
334
+ */
335
+ declare class GuardedExecutionGraph extends Graph {
336
+ readonly enforcer: PolicyGateGraph;
337
+ readonly violations: TopicGraph<PolicyViolation>;
338
+ readonly lints: TopicGraph<GuardedExecutionLint>;
339
+ readonly scope: Node<GuardedScope>;
340
+ /**
341
+ * Canonical reactive describe scoped to the wrapper's configured `actor`.
342
+ * Subscribes ONCE at construction; lifecycle owned by the wrapper (disposed
343
+ * on `wrapper.destroy()`). Use this property for the common case
344
+ * (long-lived consumer wanting "describe scoped to my actor"); use
345
+ * {@link scopedDescribeNode} only when a per-call actor override or
346
+ * different `detail`/`fields` is required.
347
+ *
348
+ * Re-derives on every settle of the target graph: structural changes,
349
+ * status transitions (errors flip nodes into `"errored"`), and actor
350
+ * emissions (when a `Node<Actor>` is bound, including the SENTINEL bridge
351
+ * applied internally — see qa G1B).
352
+ */
353
+ readonly scopedDescribe: Node<GraphDescribeOutput>;
354
+ private readonly _target;
355
+ private readonly _actorNode;
356
+ private readonly _mode;
357
+ private readonly _firedLintKinds;
358
+ constructor(target: Graph, opts: GuardedExecutionOptions);
359
+ private _fireLint;
360
+ /**
361
+ * **Per-call escape hatch.** Prefer {@link scopedDescribe} (the mounted
362
+ * property) for the common case of "describe scoped to my actor." Use
363
+ * this method ONLY when you need a per-call actor override or different
364
+ * `detail`/`fields`/`filter`.
365
+ *
366
+ * Returns a live `Node<GraphDescribeOutput>` scoped to the supplied (or
367
+ * configured) actor, plus an explicit `dispose` for caller-controlled
368
+ * lifecycle. Re-derives on every settle of the target graph: structural
369
+ * changes, status transitions, and actor emissions (when a `Node<Actor>`
370
+ * is bound).
371
+ *
372
+ * **Lifecycle (qa G1A — EC1 fix).** Each call instantiates a fresh
373
+ * `target.describe({reactive: true})` handle (with its own version state,
374
+ * observe handle, transitive topology subscriptions, derived + keepalive).
375
+ * The caller MUST invoke the returned `dispose()` when finished to release
376
+ * these resources. Disposers ARE also tracked on the wrapper graph so
377
+ * `wrapper.destroy()` cleans up any handles the caller forgot — but a
378
+ * long-lived wrapper with heavy per-call usage will leak until destroy
379
+ * unless `dispose()` is called explicitly.
380
+ *
381
+ * @param actorOverride - Optional per-call override. Static {@link Actor}
382
+ * or `Node<Actor>`. Omit to use the wrapper-configured default.
383
+ * @param opts - Standard {@link GraphDescribeOptions} fields (`detail`,
384
+ * `fields`, `filter`). `actor` / `reactive` / `reactiveName` are
385
+ * controlled by the wrapper.
386
+ * @returns `{node, dispose}` — `node` is the live describe Node; `dispose`
387
+ * tears down the underlying reactive describe subscription idempotently.
388
+ */
389
+ scopedDescribeNode(actorOverride?: Actor | Node<Actor>, opts?: Omit<GraphDescribeOptions, "actor" | "reactive" | "reactiveName">): {
390
+ node: Node<GraphDescribeOutput>;
391
+ dispose: () => void;
392
+ };
393
+ /** The wrapped graph (escape hatch for tooling). */
394
+ get target(): Graph;
395
+ }
396
+ /**
397
+ * Wrap a {@link Graph} with {@link policyGate} plus a reactive scoped describe
398
+ * lens. Returns a {@link GuardedExecutionGraph} that can be mounted, diffed,
399
+ * or composed with {@link graphLens}.
400
+ *
401
+ * @param target - The graph to guard.
402
+ * @param opts - See {@link GuardedExecutionOptions}.
403
+ *
404
+ * @example
405
+ * ```ts
406
+ * const guarded = guardedExecution(app, {
407
+ * actor: state<Actor>({ type: "human", id: "alice" }), // reactive — re-derive on swap
408
+ * policies: [
409
+ * { effect: "allow", action: "read", actorType: "human" },
410
+ * { effect: "deny", action: "write", pathPattern: "system::*" },
411
+ * ],
412
+ * mode: "enforce",
413
+ * });
414
+ *
415
+ * // Canonical: subscribe to the mounted reactive describe (no per-call leak).
416
+ * guarded.scopedDescribe.subscribe((msgs) => { /* live describe per actor / topology change *\/ });
417
+ * // Per-call escape hatch (different actor / detail) — caller manages dispose.
418
+ * const detailed = guarded.scopedDescribeNode(undefined, { detail: "standard" });
419
+ * try { detailed.node.subscribe(/* … *\/); } finally { detailed.dispose(); }
420
+ * guarded.violations.events.subscribe(msgs => console.log("violations:", msgs));
421
+ * guarded.lints.events.subscribe(msgs => console.warn("lints:", msgs));
422
+ * guarded.scope.subscribe(msgs => console.log("scope:", msgs));
423
+ * ```
424
+ *
425
+ * @category patterns
426
+ */
427
+ declare function guardedExecution(target: Graph, opts: GuardedExecutionOptions): GuardedExecutionGraph;
428
+
429
+ /**
430
+ * Reactive graph observability preset (Tier 5.3 reshape — Session A.4 lock).
431
+ *
432
+ * `graphLens(target)` is a thin compositor (~30 LOC of glue) over two
433
+ * already-shipped reactive primitives:
434
+ *
435
+ * - `target.describe({ reactive: true })` — live topology snapshot.
436
+ * - `target.observe({ reactive: true, tiers: ["data"] })` — coalesced data
437
+ * changesets per outermost batch flush.
438
+ *
439
+ * It returns three Nodes plus a dispose function:
440
+ *
441
+ * - `topology: Node<GraphDescribeOutput>` — the live describe snapshot,
442
+ * re-emitting on every settle of the target tree (structural change,
443
+ * error/complete/teardown transition).
444
+ * - `health: Node<HealthReport>` — `{ok, problems[]}` aggregated from the
445
+ * live describe; `ok=false` when any node enters `"errored"` status,
446
+ * with `upstreamCause` walked backward through deps.
447
+ * - `flow: Node<ReadonlyMap<string, FlowEntry>>` — per-path DATA counters
448
+ * accumulating as `target.observe({reactive: true, tiers: ["data"]})`
449
+ * delivers changesets. The map is reconciled against `topology` on each
450
+ * topology change so removed nodes drop their entries.
451
+ *
452
+ * Pre-Tier-5.3 shipped a `LensGraph` class with `stats` / `health` / `flow`
453
+ * (as a `ReactiveMapBundle`) / `why(from, to)` / `flowEntryNode(...)`. The
454
+ * surface collapsed because every concern was already a one-liner over
455
+ * `describe({reactive:true})` + `observe({reactive:true, tiers})` once those
456
+ * landed in Tier 1.5.1 / 1.5.2 — the class added no protocol-level concept,
457
+ * just glue. Callers who need topology stats compose a derived over
458
+ * `topology` directly; callers who need a causal chain call
459
+ * `target.explain(from, to, { reactive: true })`.
460
+ *
461
+ * The transitive topology-subscription helper {@link watchTopologyTree} is
462
+ * re-exported here for downstream factories that need full-tree dynamic
463
+ * coverage without taking a dep on `graph/`.
464
+ *
465
+ * @module
466
+ */
467
+
468
+ /** A single health problem entry. */
469
+ interface HealthProblem {
470
+ path: string;
471
+ /** V1 only reports `"errored"`. Future versions may add `"completed"`, `"disconnected"`. */
472
+ status: "errored";
473
+ /** First errored upstream ancestor along the dep chain, when one exists and is distinct from `path`. */
474
+ upstreamCause?: string;
475
+ }
476
+ /** Aggregate health snapshot. `ok=true` iff `problems.length === 0`. */
477
+ interface HealthReport {
478
+ ok: boolean;
479
+ problems: readonly HealthProblem[];
480
+ }
481
+ /** Per-path flow entry stored in the {@link GraphLensView.flow} map. */
482
+ interface FlowEntry {
483
+ path: string;
484
+ /** Cumulative DATA emissions observed since the lens activated. */
485
+ count: number;
486
+ /** Monotonic ns at the most recent DATA emission for this path, or `null` if none yet. */
487
+ lastUpdate_ns: number | null;
488
+ }
489
+ /** Output of {@link graphLens}. */
490
+ interface GraphLensView {
491
+ /** Live describe snapshot. Re-emits on structural change AND status transitions. */
492
+ topology: Node<GraphDescribeOutput>;
493
+ /** Live `{ok, problems[]}`. Aggregated from `topology`; equality-deduped. */
494
+ health: Node<HealthReport>;
495
+ /** Per-path DATA counter map. Re-emits per outermost batch flush. */
496
+ flow: Node<ReadonlyMap<string, FlowEntry>>;
497
+ /**
498
+ * Tear down the underlying `describe({reactive:true})` subscription.
499
+ * The `flow` node activates lazily; subscribing-then-unsubscribing reclaims
500
+ * its observe stream automatically. Call `dispose()` once when finished.
501
+ */
502
+ dispose(): void;
503
+ }
504
+ /** Build a `HealthReport` from a fresh `GraphDescribeOutput`. */
505
+ declare function computeHealthReport(described: GraphDescribeOutput): HealthReport;
506
+ /** Structural equality for {@link HealthReport} — used as the `health` derived's `equals`. */
507
+ declare function healthReportEqual(a: HealthReport, b: HealthReport): boolean;
508
+ /**
509
+ * Reactive observability preset over a target {@link Graph}.
510
+ *
511
+ * @param target - The graph to observe.
512
+ *
513
+ * @example
514
+ * ```ts
515
+ * const g = new Graph("app");
516
+ * g.add(state(0, { name: "counter" }), { name: "counter" });
517
+ *
518
+ * const lens = graphLens(g);
519
+ * lens.topology.subscribe((msgs) => console.log("topology:", msgs));
520
+ * lens.health.subscribe((msgs) => console.log("health:", msgs));
521
+ * lens.flow.subscribe((msgs) => {
522
+ * for (const [type, payload] of msgs) {
523
+ * if (type === DATA) console.log("flow map size:", (payload as ReadonlyMap<string, FlowEntry>).size);
524
+ * }
525
+ * });
526
+ *
527
+ * // Causal chains: use the underlying primitive directly — `graphLens` no
528
+ * // longer wraps it, since `graph.explain({ reactive: true })` already
529
+ * // provides everything the old `lens.why()` did.
530
+ * const why = g.explain("counter", "consumer", { reactive: true });
531
+ *
532
+ * // Tear down when done.
533
+ * lens.dispose();
534
+ * ```
535
+ *
536
+ * @category observability
537
+ */
538
+ declare function graphLens(target: Graph): GraphLensView;
539
+
540
+ /**
541
+ * `inspect()` preset — Tier 9.1 γ-form γ-II + Q5-6 medium scope.
542
+ *
543
+ * Composes graph observability into a single mounted facade:
544
+ * - `lens` (mounted as a `LensSubgraph` child) — exposes `topology` /
545
+ * `health` / `flow` Nodes via `inspect.lens.*`.
546
+ * - `audit` (mounted `AuditTrailGraph`) — every mutation on the wrapped
547
+ * target captured as an audit entry.
548
+ * - `explainTarget(from, to, opts?)` — facade over `target.explain(...)`;
549
+ * supports both static and reactive forms.
550
+ * - `complianceSnapshot()` — one-shot tamper-evident snapshot pairing the
551
+ * target's persisted state with the audit log.
552
+ *
553
+ * **Path-namespace boundary.** `inspect.describe()` shows InspectGraph's
554
+ * OWN topology (the lens + audit subgraphs and any caller-added siblings) —
555
+ * NOT the wrapped target's topology. Use `inspect.target.describe()` to
556
+ * walk the target. `inspect.node("counter")` resolves under the inspect
557
+ * graph, NOT the target.
558
+ *
559
+ * **Why a Graph subclass.** Per Tier 9.1 γ-II lock: closure-bundled returns
560
+ * (`{lens, audit, explain, ...}` of independently-constructed primitives)
561
+ * hide topology — `describe()` from the wrapper can't walk into the
562
+ * audit/lens pieces. Mounting them under a real `InspectGraph` keeps every
563
+ * contained primitive visible in describe / explain across the boundary,
564
+ * which is the point of the inspect preset.
565
+ *
566
+ * **Why the lens lives in a child `LensSubgraph` mount.** `Graph.destroy()`
567
+ * signals TEARDOWN through `this._nodes` after disposers drain. If the
568
+ * lens nodes were `add()`ed directly to InspectGraph's path table, they
569
+ * would receive TEARDOWN at parent destroy — invalidating any externally
570
+ * held `view.lens.topology.subscribe(...)` reference. Mounting via a child
571
+ * subgraph contains the cascade: inspect's TEARDOWN visits the lens
572
+ * subgraph's nodes through `mount → child._destroyClearOnly`, which clears
573
+ * structure but does NOT broadcast TEARDOWN. The `lens.dispose()` disposer
574
+ * still tears down the underlying observe handle as designed (D1 fix per
575
+ * /qa lock).
576
+ *
577
+ * **Why `inspect()` mounts `graphLens` rather than rebuilding `health` / `flow`.**
578
+ * Per Q3 yellow lock: rebuilding would duplicate the `topology → health`
579
+ * and `dataFlow → flow` deriveds, doubling subscription cost and risking
580
+ * semantic drift. Mounting graphLens once lets `inspect.lens` and the
581
+ * standalone `graphLens(target)` factory share a single source of truth.
582
+ *
583
+ * @module
584
+ */
585
+
586
+ /** Options for {@link inspect}. */
587
+ interface InspectOptions {
588
+ /** Default actor recorded on `complianceSnapshot()` calls. */
589
+ actor?: Actor;
590
+ /**
591
+ * Forwarded to the mounted {@link auditTrail} so callers can configure
592
+ * retention / inclusion policy. Pre-allocated to keep `inspect()`
593
+ * callable with no opts.
594
+ */
595
+ audit?: AuditTrailOptions;
596
+ /** Optional name override for the `InspectGraph` itself. */
597
+ name?: string;
598
+ }
599
+ /**
600
+ * Graph subclass returned by {@link inspect}. Mounts a `graphLens` view (as
601
+ * a child `LensSubgraph`), an `auditTrail` (as a child subgraph), and
602
+ * exposes `explainTarget()` + `complianceSnapshot()` facades over the
603
+ * wrapped target.
604
+ *
605
+ * Mounted children (visible in `describe()`):
606
+ * - `lens::topology` / `lens::health` / `lens::flow` — `graphLens(target)` Nodes.
607
+ * - `audit::*` — the mounted {@link AuditTrailGraph}.
608
+ *
609
+ * @category observability
610
+ */
611
+ declare class InspectGraph extends Graph {
612
+ readonly target: Graph;
613
+ /**
614
+ * Underlying lens view — reach individual Nodes via
615
+ * `inspect.lens.topology` / `inspect.lens.health` / `inspect.lens.flow`.
616
+ *
617
+ * Direct `inspect.topology` / `inspect.health` / `inspect.flow`
618
+ * accessors are NOT shipped because `Graph.topology` is already an
619
+ * accessor on the base class with a different shape (`Node<TopologyEvent>`
620
+ * — the mount/unmount stream of THIS graph, not the wrapped target's
621
+ * describe snapshot). Going through `.lens.*` keeps the two concepts
622
+ * cleanly separated.
623
+ */
624
+ readonly lens: GraphLensView;
625
+ /** Mounted audit trail subgraph. */
626
+ readonly audit: AuditTrailGraph;
627
+ private readonly _defaultActor?;
628
+ private readonly _lensSubgraph;
629
+ constructor(target: Graph, opts?: InspectOptions);
630
+ /**
631
+ * Causal-chain facade over `target.explain(...)`. Supports both static
632
+ * (one-shot {@link CausalChain}) and reactive (`{ reactive: true }`)
633
+ * forms — overload signatures mirror {@link Graph.explain}.
634
+ *
635
+ * Named `explainTarget` (not `explain`) to avoid shadowing the
636
+ * inherited {@link Graph.explain} method, which walks `InspectGraph`'s
637
+ * OWN topology (lens + audit subgraphs) rather than the wrapped
638
+ * target's. Use `inspect.explainTarget(...)` for chains across the
639
+ * wrapped graph; `inspect.explain(...)` for chains across the lens /
640
+ * audit composition.
641
+ */
642
+ explainTarget(from: string | Node<string>, to: string | Node<string>, opts?: {
643
+ maxDepth?: number | Node<number>;
644
+ findCycle?: boolean | Node<boolean>;
645
+ }): CausalChain;
646
+ explainTarget(from: string | Node<string>, to: string | Node<string>, opts: {
647
+ reactive: true;
648
+ maxDepth?: number | Node<number>;
649
+ findCycle?: boolean | Node<boolean>;
650
+ name?: string;
651
+ }): {
652
+ node: Node<CausalChain>;
653
+ dispose: () => void;
654
+ };
655
+ /**
656
+ * One-shot tamper-evident snapshot pairing the target's persisted state
657
+ * with the audit log + (optional) policy-gate violations.
658
+ *
659
+ * Uses the inspect's mounted `audit` by default; pair with a separate
660
+ * `policyGate` (mounted elsewhere) by passing `policies` explicitly.
661
+ *
662
+ * **Cryptographic strength caveat (echoed from {@link complianceSnapshot}):**
663
+ * the returned `fingerprint` is a truncated SHA-256 (16 hex chars / ~64
664
+ * bits) optimized for compact archival. Sufficient for casual integrity
665
+ * checks and content-addressed dedup; for adversarial tamper-evidence,
666
+ * pair with a full SHA-256 over the canonical JSON externally.
667
+ */
668
+ complianceSnapshot(opts?: {
669
+ actor?: Actor;
670
+ policies?: PolicyGateGraph;
671
+ }): ComplianceSnapshotResult;
672
+ }
673
+ /**
674
+ * Build an {@link InspectGraph} that mounts `graphLens` + `auditTrail` over
675
+ * the wrapped target and exposes `explainTarget()` + `complianceSnapshot()`
676
+ * facades.
677
+ *
678
+ * @example
679
+ * ```ts
680
+ * import { inspect } from "@graphrefly/graphrefly/patterns/inspect";
681
+ *
682
+ * const target = buildMyApp();
683
+ * const view = inspect(target, { actor: { id: "ops-bot", role: "monitor" } });
684
+ *
685
+ * // Live observability
686
+ * view.lens.health.subscribe((msgs) => console.log("health:", msgs));
687
+ * view.lens.flow.subscribe((msgs) => console.log("flow:", msgs));
688
+ *
689
+ * // Causal explainability across the wrapped target
690
+ * const chain = view.explainTarget("input", "output");
691
+ *
692
+ * // Tamper-evident snapshot for archival
693
+ * const snapshot = view.complianceSnapshot();
694
+ * ```
695
+ *
696
+ * @category observability
697
+ */
698
+ declare function inspect(target: Graph, opts?: InspectOptions): InspectGraph;
699
+
700
+ /**
701
+ * Inspect — graph observability primitives + presets (Tier 9.1 γ-form γ-ii merge).
702
+ *
703
+ * Merges the former `patterns/audit/`, `patterns/lens/`, and
704
+ * `patterns/guarded-execution/` folders into a single domain. Sub-files
705
+ * preserve the legacy folder boundaries for clarity, then export through this
706
+ * barrel.
707
+ *
708
+ * Building blocks (this barrel + sub-files):
709
+ * - `auditTrail` / `policyGate` / `complianceSnapshot` / `explainPath` —
710
+ * audit + policy + causal explainability primitives.
711
+ * - `graphLens` / `computeHealthReport` / `healthReportEqual` /
712
+ * `watchTopologyTree` — topology-driven health and flow views.
713
+ * - `guardedExecution` / `GuardedExecutionGraph` — actor-scoped wrapper
714
+ * that enforces / audits guards on a target graph.
715
+ *
716
+ * Presets (`./presets/inspect.ts`):
717
+ * - `inspect()` — `lens + auditTrail + explain (facade) + complianceSnapshot()`
718
+ * composition (Tier 9.1 γ-form Q5-6 medium scope). Mounts `graphLens`
719
+ * internally rather than rebuilding `health` / `flow`.
720
+ *
721
+ * @module
722
+ */
723
+
724
+ type index_AuditEntry = AuditEntry;
725
+ type index_AuditTrailGraph = AuditTrailGraph;
726
+ declare const index_AuditTrailGraph: typeof AuditTrailGraph;
727
+ type index_AuditTrailOptions = AuditTrailOptions;
728
+ type index_ComplianceSnapshotOptions = ComplianceSnapshotOptions;
729
+ type index_ComplianceSnapshotResult = ComplianceSnapshotResult;
730
+ declare const index_DescribeFilter: typeof DescribeFilter;
731
+ type index_FlowEntry = FlowEntry;
732
+ type index_GraphLensView = GraphLensView;
733
+ type index_GuardedExecutionGraph = GuardedExecutionGraph;
734
+ declare const index_GuardedExecutionGraph: typeof GuardedExecutionGraph;
735
+ type index_GuardedExecutionLint = GuardedExecutionLint;
736
+ type index_GuardedExecutionOptions = GuardedExecutionOptions;
737
+ type index_GuardedScope = GuardedScope;
738
+ type index_HealthProblem = HealthProblem;
739
+ type index_HealthReport = HealthReport;
740
+ type index_InspectGraph = InspectGraph;
741
+ declare const index_InspectGraph: typeof InspectGraph;
742
+ type index_InspectOptions = InspectOptions;
743
+ type index_PolicyGateGraph = PolicyGateGraph;
744
+ declare const index_PolicyGateGraph: typeof PolicyGateGraph;
745
+ type index_PolicyGateOptions = PolicyGateOptions;
746
+ type index_PolicyViolation = PolicyViolation;
747
+ declare const index_auditTrail: typeof auditTrail;
748
+ declare const index_complianceSnapshot: typeof complianceSnapshot;
749
+ declare const index_computeHealthReport: typeof computeHealthReport;
750
+ declare const index_graphLens: typeof graphLens;
751
+ declare const index_guardedExecution: typeof guardedExecution;
752
+ declare const index_healthReportEqual: typeof healthReportEqual;
753
+ declare const index_inspect: typeof inspect;
754
+ declare const index_policyGate: typeof policyGate;
755
+ declare const index_watchTopologyTree: typeof watchTopologyTree;
756
+ declare namespace index {
757
+ export { type index_AuditEntry as AuditEntry, index_AuditTrailGraph as AuditTrailGraph, type index_AuditTrailOptions as AuditTrailOptions, type index_ComplianceSnapshotOptions as ComplianceSnapshotOptions, type index_ComplianceSnapshotResult as ComplianceSnapshotResult, index_DescribeFilter as DescribeFilter, type index_FlowEntry as FlowEntry, type index_GraphLensView as GraphLensView, index_GuardedExecutionGraph as GuardedExecutionGraph, type index_GuardedExecutionLint as GuardedExecutionLint, type index_GuardedExecutionOptions as GuardedExecutionOptions, type index_GuardedScope as GuardedScope, type index_HealthProblem as HealthProblem, type index_HealthReport as HealthReport, index_InspectGraph as InspectGraph, type index_InspectOptions as InspectOptions, index_PolicyGateGraph as PolicyGateGraph, type index_PolicyGateOptions as PolicyGateOptions, type index_PolicyViolation as PolicyViolation, index_auditTrail as auditTrail, index_complianceSnapshot as complianceSnapshot, index_computeHealthReport as computeHealthReport, index_graphLens as graphLens, index_guardedExecution as guardedExecution, index_healthReportEqual as healthReportEqual, index_inspect as inspect, index_policyGate as policyGate, index_watchTopologyTree as watchTopologyTree };
758
+ }
759
+
760
+ export { type AuditEntry as A, type ComplianceSnapshotOptions as C, type FlowEntry as F, type GraphLensView as G, type HealthProblem as H, InspectGraph as I, PolicyGateGraph as P, AuditTrailGraph as a, type AuditTrailOptions as b, type ComplianceSnapshotResult as c, GuardedExecutionGraph as d, type GuardedExecutionLint as e, type GuardedExecutionOptions as f, type GuardedScope as g, type HealthReport as h, index as i, type InspectOptions as j, type PolicyGateOptions as k, type PolicyViolation as l, auditTrail as m, complianceSnapshot as n, computeHealthReport as o, graphLens as p, guardedExecution as q, healthReportEqual as r, inspect as s, policyGate as t };