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