@graphrefly/graphrefly 0.44.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (720) hide show
  1. package/README.md +22 -19
  2. package/dist/_internal-B23BagFd.d.cts +33 -0
  3. package/dist/_internal-B23BagFd.d.ts +33 -0
  4. package/dist/adaptive-rate-limiter-Dch_xYIi.d.cts +111 -0
  5. package/dist/adaptive-rate-limiter-Dch_xYIi.d.ts +111 -0
  6. package/dist/agents-C0Ji9ldU.d.cts +629 -0
  7. package/dist/agents-C9zexT7I.d.ts +629 -0
  8. package/dist/audit-BAXb3VOg.d.ts +246 -0
  9. package/dist/audit-C_bPfkqS.d.cts +246 -0
  10. package/dist/backoff-7KIK3WQW.js +24 -0
  11. package/dist/backoff-7KIK3WQW.js.map +1 -0
  12. package/dist/backoff-Bnb9OoPh.d.cts +6 -0
  13. package/dist/backoff-Bnb9OoPh.d.ts +6 -0
  14. package/dist/base/composition/index.cjs +811 -0
  15. package/dist/base/composition/index.cjs.map +1 -0
  16. package/dist/base/composition/index.d.cts +469 -0
  17. package/dist/base/composition/index.d.ts +469 -0
  18. package/dist/base/composition/index.js +40 -0
  19. package/dist/base/composition/index.js.map +1 -0
  20. package/dist/base/index.cjs +6336 -0
  21. package/dist/base/index.cjs.map +1 -0
  22. package/dist/base/index.d.cts +22 -0
  23. package/dist/base/index.d.ts +22 -0
  24. package/dist/base/index.js +259 -0
  25. package/dist/base/index.js.map +1 -0
  26. package/dist/base/io/index.cjs +3270 -0
  27. package/dist/base/io/index.cjs.map +1 -0
  28. package/dist/base/io/index.d.cts +2245 -0
  29. package/dist/base/io/index.d.ts +2245 -0
  30. package/dist/base/io/index.js +117 -0
  31. package/dist/base/io/index.js.map +1 -0
  32. package/dist/base/meta/index.cjs +43 -0
  33. package/dist/base/meta/index.cjs.map +1 -0
  34. package/dist/base/meta/index.d.cts +45 -0
  35. package/dist/base/meta/index.d.ts +45 -0
  36. package/dist/base/meta/index.js +13 -0
  37. package/dist/base/meta/index.js.map +1 -0
  38. package/dist/base/mutation/index.cjs +200 -0
  39. package/dist/base/mutation/index.cjs.map +1 -0
  40. package/dist/base/mutation/index.d.cts +177 -0
  41. package/dist/base/mutation/index.d.ts +177 -0
  42. package/dist/base/mutation/index.js +22 -0
  43. package/dist/base/mutation/index.js.map +1 -0
  44. package/dist/base/render/index.cjs +1120 -0
  45. package/dist/base/render/index.cjs.map +1 -0
  46. package/dist/{extra/render/index.d.ts → base/render/index.d.cts} +75 -31
  47. package/dist/{extra/render/index.d.cts → base/render/index.d.ts} +75 -31
  48. package/dist/base/render/index.js +24 -0
  49. package/dist/base/render/index.js.map +1 -0
  50. package/dist/base/sources/browser/index.cjs +172 -0
  51. package/dist/base/sources/browser/index.cjs.map +1 -0
  52. package/dist/base/sources/browser/index.d.cts +84 -0
  53. package/dist/base/sources/browser/index.d.ts +84 -0
  54. package/dist/base/sources/browser/index.js +151 -0
  55. package/dist/base/sources/browser/index.js.map +1 -0
  56. package/dist/base/sources/event/index.cjs +98 -0
  57. package/dist/base/sources/event/index.cjs.map +1 -0
  58. package/dist/base/sources/event/index.d.cts +91 -0
  59. package/dist/base/sources/event/index.d.ts +91 -0
  60. package/dist/base/sources/event/index.js +13 -0
  61. package/dist/base/sources/event/index.js.map +1 -0
  62. package/dist/base/sources/index.cjs +755 -0
  63. package/dist/base/sources/index.cjs.map +1 -0
  64. package/dist/{extra/sources.d.ts → base/sources/index.d.cts} +74 -301
  65. package/dist/{extra/sources.d.cts → base/sources/index.d.ts} +74 -301
  66. package/dist/base/sources/index.js +42 -0
  67. package/dist/base/sources/index.js.map +1 -0
  68. package/dist/base/sources/node/index.cjs +320 -0
  69. package/dist/base/sources/node/index.cjs.map +1 -0
  70. package/dist/{extra/node.d.ts → base/sources/node/index.d.cts} +35 -37
  71. package/dist/{extra/node.d.cts → base/sources/node/index.d.ts} +35 -37
  72. package/dist/base/sources/node/index.js +306 -0
  73. package/dist/base/sources/node/index.js.map +1 -0
  74. package/dist/base/utils/index.cjs +37 -0
  75. package/dist/base/utils/index.cjs.map +1 -0
  76. package/dist/base/utils/index.d.cts +37 -0
  77. package/dist/base/utils/index.d.ts +37 -0
  78. package/dist/base/utils/index.js +11 -0
  79. package/dist/base/utils/index.js.map +1 -0
  80. package/dist/base/worker/index.cjs +548 -0
  81. package/dist/base/worker/index.cjs.map +1 -0
  82. package/dist/base/worker/index.d.cts +207 -0
  83. package/dist/base/worker/index.d.ts +207 -0
  84. package/dist/base/worker/index.js +20 -0
  85. package/dist/base/worker/index.js.map +1 -0
  86. package/dist/breaker-C9skL3d8.d.ts +175 -0
  87. package/dist/breaker-ugSdq54q.d.cts +175 -0
  88. package/dist/{cascading-BglDkMdX.d.cts → cascading-CSSbKGrJ.d.ts} +3 -3
  89. package/dist/{cascading-MFgxu7Yo.d.ts → cascading-baGkiihI.d.cts} +3 -3
  90. package/dist/chunk-255UCBG4.js +58 -0
  91. package/dist/chunk-255UCBG4.js.map +1 -0
  92. package/dist/chunk-2LO3EL4W.js +1 -0
  93. package/dist/chunk-2LO3EL4W.js.map +1 -0
  94. package/dist/chunk-2OB3CEJS.js +1065 -0
  95. package/dist/chunk-2OB3CEJS.js.map +1 -0
  96. package/dist/chunk-36NMM65U.js +144 -0
  97. package/dist/chunk-36NMM65U.js.map +1 -0
  98. package/dist/chunk-3CEXCBN6.js +1 -0
  99. package/dist/chunk-3CEXCBN6.js.map +1 -0
  100. package/dist/chunk-3MUSLI6E.js +105 -0
  101. package/dist/chunk-3MUSLI6E.js.map +1 -0
  102. package/dist/chunk-3PSLNJDU.js +884 -0
  103. package/dist/chunk-3PSLNJDU.js.map +1 -0
  104. package/dist/chunk-3QZY5BI7.js +92 -0
  105. package/dist/chunk-3QZY5BI7.js.map +1 -0
  106. package/dist/chunk-42FQ27MQ.js +594 -0
  107. package/dist/chunk-42FQ27MQ.js.map +1 -0
  108. package/dist/chunk-4GYMCUDZ.js +1085 -0
  109. package/dist/chunk-4GYMCUDZ.js.map +1 -0
  110. package/dist/chunk-4S53H2KR.js +382 -0
  111. package/dist/chunk-4S53H2KR.js.map +1 -0
  112. package/dist/chunk-4XCHZRUJ.js +128 -0
  113. package/dist/chunk-4XCHZRUJ.js.map +1 -0
  114. package/dist/chunk-5THCXDWY.js +725 -0
  115. package/dist/chunk-5THCXDWY.js.map +1 -0
  116. package/dist/chunk-6XZYT4SW.js +256 -0
  117. package/dist/chunk-6XZYT4SW.js.map +1 -0
  118. package/dist/chunk-7EGRP2VX.js +76 -0
  119. package/dist/chunk-7EGRP2VX.js.map +1 -0
  120. package/dist/chunk-A7KV5UK4.js +150 -0
  121. package/dist/chunk-A7KV5UK4.js.map +1 -0
  122. package/dist/chunk-APY2SS5X.js +156 -0
  123. package/dist/chunk-APY2SS5X.js.map +1 -0
  124. package/dist/chunk-AZDQPQ3V.js +66 -0
  125. package/dist/chunk-AZDQPQ3V.js.map +1 -0
  126. package/dist/chunk-BU3SEFA5.js +90 -0
  127. package/dist/chunk-BU3SEFA5.js.map +1 -0
  128. package/dist/chunk-BXGZFGZ4.js +189 -0
  129. package/dist/chunk-BXGZFGZ4.js.map +1 -0
  130. package/dist/chunk-CGHORL6G.js +579 -0
  131. package/dist/chunk-CGHORL6G.js.map +1 -0
  132. package/dist/chunk-CXANAIZU.js +530 -0
  133. package/dist/chunk-CXANAIZU.js.map +1 -0
  134. package/dist/chunk-CZQHCKKG.js +1 -0
  135. package/dist/chunk-CZQHCKKG.js.map +1 -0
  136. package/dist/chunk-DKNHAICT.js +133 -0
  137. package/dist/chunk-DKNHAICT.js.map +1 -0
  138. package/dist/chunk-DM4OMPWK.js +584 -0
  139. package/dist/chunk-DM4OMPWK.js.map +1 -0
  140. package/dist/chunk-DMSNO6ZB.js +452 -0
  141. package/dist/chunk-DMSNO6ZB.js.map +1 -0
  142. package/dist/chunk-E5OZPDIW.js +229 -0
  143. package/dist/chunk-E5OZPDIW.js.map +1 -0
  144. package/dist/chunk-EVYY4X5A.js +509 -0
  145. package/dist/chunk-EVYY4X5A.js.map +1 -0
  146. package/dist/chunk-FDFD67UO.js +1 -0
  147. package/dist/chunk-FDFD67UO.js.map +1 -0
  148. package/dist/chunk-FMPF42Q4.js +13 -0
  149. package/dist/chunk-FMPF42Q4.js.map +1 -0
  150. package/dist/chunk-FR6RGA3B.js +1277 -0
  151. package/dist/chunk-FR6RGA3B.js.map +1 -0
  152. package/dist/chunk-FW23JYNQ.js +454 -0
  153. package/dist/chunk-FW23JYNQ.js.map +1 -0
  154. package/dist/chunk-GBCENOLN.js +1575 -0
  155. package/dist/chunk-GBCENOLN.js.map +1 -0
  156. package/dist/chunk-HL7HUJIX.js +1 -0
  157. package/dist/chunk-HL7HUJIX.js.map +1 -0
  158. package/dist/chunk-HULCUY35.js +2508 -0
  159. package/dist/chunk-HULCUY35.js.map +1 -0
  160. package/dist/chunk-IHTWQEDR.js +169 -0
  161. package/dist/chunk-IHTWQEDR.js.map +1 -0
  162. package/dist/chunk-IJRR6YAI.js +128 -0
  163. package/dist/chunk-IJRR6YAI.js.map +1 -0
  164. package/dist/chunk-JGFRAFDL.js +221 -0
  165. package/dist/chunk-JGFRAFDL.js.map +1 -0
  166. package/dist/chunk-KIIXR252.js +211 -0
  167. package/dist/chunk-KIIXR252.js.map +1 -0
  168. package/dist/chunk-KN3H5CNT.js +11 -0
  169. package/dist/chunk-KN3H5CNT.js.map +1 -0
  170. package/dist/chunk-KPG3DGLA.js +1 -0
  171. package/dist/chunk-KPG3DGLA.js.map +1 -0
  172. package/dist/chunk-KRNQ6RGQ.js +1 -0
  173. package/dist/chunk-KRNQ6RGQ.js.map +1 -0
  174. package/dist/chunk-LBAJK24K.js +1071 -0
  175. package/dist/chunk-LBAJK24K.js.map +1 -0
  176. package/dist/chunk-MLTPJMH6.js +417 -0
  177. package/dist/chunk-MLTPJMH6.js.map +1 -0
  178. package/dist/chunk-N3SZ7BMH.js +95 -0
  179. package/dist/chunk-N3SZ7BMH.js.map +1 -0
  180. package/dist/chunk-NDUD3IMO.js +540 -0
  181. package/dist/chunk-NDUD3IMO.js.map +1 -0
  182. package/dist/chunk-NY2PYHNC.js +873 -0
  183. package/dist/chunk-NY2PYHNC.js.map +1 -0
  184. package/dist/chunk-O3MT7DYI.js +225 -0
  185. package/dist/chunk-O3MT7DYI.js.map +1 -0
  186. package/dist/chunk-OCUDSN63.js +2386 -0
  187. package/dist/chunk-OCUDSN63.js.map +1 -0
  188. package/dist/chunk-OIWU3NYV.js +199 -0
  189. package/dist/chunk-OIWU3NYV.js.map +1 -0
  190. package/dist/chunk-OO5BM6CJ.js +1153 -0
  191. package/dist/chunk-OO5BM6CJ.js.map +1 -0
  192. package/dist/chunk-OQUIJT7A.js +1 -0
  193. package/dist/chunk-OQUIJT7A.js.map +1 -0
  194. package/dist/chunk-P5LBT622.js +105 -0
  195. package/dist/chunk-P5LBT622.js.map +1 -0
  196. package/dist/chunk-PKGQG5QQ.js +519 -0
  197. package/dist/chunk-PKGQG5QQ.js.map +1 -0
  198. package/dist/chunk-PKPO3JTZ.js +561 -0
  199. package/dist/chunk-PKPO3JTZ.js.map +1 -0
  200. package/dist/chunk-PL5UDIQ5.js +118 -0
  201. package/dist/chunk-PL5UDIQ5.js.map +1 -0
  202. package/dist/chunk-PZWISPIQ.js +432 -0
  203. package/dist/chunk-PZWISPIQ.js.map +1 -0
  204. package/dist/chunk-Q3EYOCZB.js +510 -0
  205. package/dist/chunk-Q3EYOCZB.js.map +1 -0
  206. package/dist/chunk-QMBYUVRL.js +15 -0
  207. package/dist/chunk-QMBYUVRL.js.map +1 -0
  208. package/dist/chunk-RAGGHLCV.js +200 -0
  209. package/dist/chunk-RAGGHLCV.js.map +1 -0
  210. package/dist/chunk-RGL53X5G.js +574 -0
  211. package/dist/chunk-RGL53X5G.js.map +1 -0
  212. package/dist/chunk-RJOG4IJU.js +1039 -0
  213. package/dist/chunk-RJOG4IJU.js.map +1 -0
  214. package/dist/chunk-SOOKUYVM.js +403 -0
  215. package/dist/chunk-SOOKUYVM.js.map +1 -0
  216. package/dist/chunk-T5BN5KG7.js +1 -0
  217. package/dist/chunk-T5BN5KG7.js.map +1 -0
  218. package/dist/chunk-TP7244Y6.js +207 -0
  219. package/dist/chunk-TP7244Y6.js.map +1 -0
  220. package/dist/chunk-TSBFTJKM.js +57 -0
  221. package/dist/chunk-TSBFTJKM.js.map +1 -0
  222. package/dist/chunk-URQ2CBBF.js +143 -0
  223. package/dist/chunk-URQ2CBBF.js.map +1 -0
  224. package/dist/chunk-W2BOPXTI.js +1 -0
  225. package/dist/chunk-W2BOPXTI.js.map +1 -0
  226. package/dist/chunk-WKSWLSCX.js +207 -0
  227. package/dist/chunk-WKSWLSCX.js.map +1 -0
  228. package/dist/chunk-Y52CS6YA.js +88 -0
  229. package/dist/chunk-Y52CS6YA.js.map +1 -0
  230. package/dist/chunk-YCBUWK77.js +92 -0
  231. package/dist/chunk-YCBUWK77.js.map +1 -0
  232. package/dist/chunk-YJ4U2D2C.js +314 -0
  233. package/dist/chunk-YJ4U2D2C.js.map +1 -0
  234. package/dist/chunk-Z4YXAUDN.js +239 -0
  235. package/dist/chunk-Z4YXAUDN.js.map +1 -0
  236. package/dist/chunk-Z6EGP5D7.js +92 -0
  237. package/dist/chunk-Z6EGP5D7.js.map +1 -0
  238. package/dist/compat/index.cjs +3100 -9
  239. package/dist/compat/index.cjs.map +1 -0
  240. package/dist/compat/index.d.cts +112 -18
  241. package/dist/compat/index.d.ts +112 -18
  242. package/dist/compat/index.js +176 -1
  243. package/dist/compat/index.js.map +1 -0
  244. package/dist/compat/jotai/index.cjs +149 -1
  245. package/dist/compat/jotai/index.cjs.map +1 -0
  246. package/dist/compat/jotai/index.d.cts +2 -2
  247. package/dist/compat/jotai/index.d.ts +2 -2
  248. package/dist/compat/jotai/index.js +8 -1
  249. package/dist/compat/jotai/index.js.map +1 -0
  250. package/dist/compat/nanostores/index.cjs +205 -1
  251. package/dist/compat/nanostores/index.cjs.map +1 -0
  252. package/dist/compat/nanostores/index.d.cts +2 -2
  253. package/dist/compat/nanostores/index.d.ts +2 -2
  254. package/dist/compat/nanostores/index.js +22 -1
  255. package/dist/compat/nanostores/index.js.map +1 -0
  256. package/dist/compat/nestjs/index.cjs +2241 -9
  257. package/dist/compat/nestjs/index.cjs.map +1 -0
  258. package/dist/compat/nestjs/index.d.cts +7 -10
  259. package/dist/compat/nestjs/index.d.ts +7 -10
  260. package/dist/compat/nestjs/index.js +78 -1
  261. package/dist/compat/nestjs/index.js.map +1 -0
  262. package/dist/compat/react/index.cjs +114 -1
  263. package/dist/compat/react/index.cjs.map +1 -0
  264. package/dist/compat/react/index.d.cts +2 -2
  265. package/dist/compat/react/index.d.ts +2 -2
  266. package/dist/compat/react/index.js +12 -1
  267. package/dist/compat/react/index.js.map +1 -0
  268. package/dist/compat/solid/index.cjs +101 -1
  269. package/dist/compat/solid/index.cjs.map +1 -0
  270. package/dist/compat/solid/index.d.cts +2 -2
  271. package/dist/compat/solid/index.d.ts +2 -2
  272. package/dist/compat/solid/index.js +12 -1
  273. package/dist/compat/solid/index.js.map +1 -0
  274. package/dist/compat/svelte/index.cjs +104 -1
  275. package/dist/compat/svelte/index.cjs.map +1 -0
  276. package/dist/compat/svelte/index.d.cts +2 -2
  277. package/dist/compat/svelte/index.d.ts +2 -2
  278. package/dist/compat/svelte/index.js +12 -1
  279. package/dist/compat/svelte/index.js.map +1 -0
  280. package/dist/compat/vue/index.cjs +119 -1
  281. package/dist/compat/vue/index.cjs.map +1 -0
  282. package/dist/compat/vue/index.d.cts +2 -2
  283. package/dist/compat/vue/index.d.ts +2 -2
  284. package/dist/compat/vue/index.js +12 -1
  285. package/dist/compat/vue/index.js.map +1 -0
  286. package/dist/compat/zustand/index.cjs +69 -3
  287. package/dist/compat/zustand/index.cjs.map +1 -0
  288. package/dist/compat/zustand/index.d.cts +2 -6
  289. package/dist/compat/zustand/index.d.ts +2 -6
  290. package/dist/compat/zustand/index.js +8 -1
  291. package/dist/compat/zustand/index.js.map +1 -0
  292. package/dist/distill-De6Rnn15.d.cts +48 -0
  293. package/dist/distill-De6Rnn15.d.ts +48 -0
  294. package/dist/external-register-CWyroXb_.d.cts +138 -0
  295. package/dist/external-register-CWyroXb_.d.ts +138 -0
  296. package/dist/{fallback-74oxi34l.d.cts → fallback-Bx46zqky.d.cts} +3 -10
  297. package/dist/{fallback-DUyyBTBK.d.ts → fallback-pIWW8A2d.d.ts} +3 -10
  298. package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
  299. package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
  300. package/dist/{index-CBGUK09R.d.ts → index-5SU_O78r.d.cts} +5 -5
  301. package/dist/{index-BmZXHqkE.d.ts → index-B6pxYJzO.d.cts} +1 -1
  302. package/dist/{index-hcDJ8PSI.d.cts → index-B6pxYJzO.d.ts} +1 -1
  303. package/dist/{index-C5stwKcw.d.cts → index-BFsng6v1.d.cts} +1 -1
  304. package/dist/{index-CdAlHFEt.d.ts → index-BFsng6v1.d.ts} +1 -1
  305. package/dist/{index-_6ODbuOu.d.cts → index-Bg-LwEt-.d.cts} +1 -1
  306. package/dist/{index-CviRnE4K.d.ts → index-Bg-LwEt-.d.ts} +1 -1
  307. package/dist/{index-CBBLl_rc.d.ts → index-Brp888t0.d.cts} +1 -1
  308. package/dist/{index-BQSKmbuG.d.cts → index-Brp888t0.d.ts} +1 -1
  309. package/dist/{index-sqkqlb1p.d.ts → index-CDfk6jHN.d.cts} +1 -1
  310. package/dist/{index-ZVQhLa2i.d.cts → index-CDfk6jHN.d.ts} +1 -1
  311. package/dist/{index-Climxqsu.d.cts → index-CEXCtYYJ.d.ts} +5 -5
  312. package/dist/index-DLAxYaN5.d.cts +169 -0
  313. package/dist/index-DLAxYaN5.d.ts +169 -0
  314. package/dist/{index-CK29LV56.d.cts → index-DeWbQzMe.d.cts} +1 -1
  315. package/dist/{index-CPQlGA29.d.ts → index-DeWbQzMe.d.ts} +1 -1
  316. package/dist/{index-BrPrLl4e.d.cts → index-dX9IzPqj.d.cts} +1 -1
  317. package/dist/{index-Dgl1HpPn.d.ts → index-dX9IzPqj.d.ts} +1 -1
  318. package/dist/index.cjs +25934 -191
  319. package/dist/index.cjs.map +1 -0
  320. package/dist/index.d.cts +58 -94
  321. package/dist/index.d.ts +58 -94
  322. package/dist/index.js +852 -1
  323. package/dist/index.js.map +1 -0
  324. package/dist/layout-types-B5aiHYgk.d.cts +72 -0
  325. package/dist/layout-types-B5aiHYgk.d.ts +72 -0
  326. package/dist/memory-composers-BryDrRBX.d.cts +529 -0
  327. package/dist/memory-composers-CVQqPYEV.d.ts +529 -0
  328. package/dist/{observable-DWjNfLvC.d.ts → observable-BXQoW1P-.d.cts} +1 -1
  329. package/dist/{observable-e3eiPPFy.d.cts → observable-BXQoW1P-.d.ts} +1 -1
  330. package/dist/{pipeline-graph-Sgj0gCwn.d.ts → pipeline-graph-Ce47CB6Y.d.cts} +13 -10
  331. package/dist/{pipeline-graph-CIKhynsF.d.cts → pipeline-graph-DXCwY9vG.d.ts} +13 -10
  332. package/dist/presets/ai/index.cjs +4377 -0
  333. package/dist/presets/ai/index.cjs.map +1 -0
  334. package/dist/presets/ai/index.d.cts +98 -0
  335. package/dist/presets/ai/index.d.ts +98 -0
  336. package/dist/presets/ai/index.js +54 -0
  337. package/dist/presets/ai/index.js.map +1 -0
  338. package/dist/presets/harness/index.cjs +5929 -0
  339. package/dist/presets/harness/index.cjs.map +1 -0
  340. package/dist/presets/harness/index.d.cts +566 -0
  341. package/dist/presets/harness/index.d.ts +566 -0
  342. package/dist/presets/harness/index.js +71 -0
  343. package/dist/presets/harness/index.js.map +1 -0
  344. package/dist/presets/index.cjs +9782 -0
  345. package/dist/presets/index.cjs.map +1 -0
  346. package/dist/presets/index.d.cts +28 -0
  347. package/dist/presets/index.d.ts +28 -0
  348. package/dist/presets/index.js +129 -0
  349. package/dist/presets/index.js.map +1 -0
  350. package/dist/presets/inspect/index.cjs +1087 -0
  351. package/dist/presets/inspect/index.cjs.map +1 -0
  352. package/dist/presets/inspect/index.d.cts +172 -0
  353. package/dist/presets/inspect/index.d.ts +172 -0
  354. package/dist/presets/inspect/index.js +21 -0
  355. package/dist/presets/inspect/index.js.map +1 -0
  356. package/dist/presets/resilience/index.cjs +1593 -0
  357. package/dist/presets/resilience/index.cjs.map +1 -0
  358. package/dist/presets/resilience/index.d.cts +205 -0
  359. package/dist/presets/resilience/index.d.ts +205 -0
  360. package/dist/presets/resilience/index.js +18 -0
  361. package/dist/presets/resilience/index.js.map +1 -0
  362. package/dist/rate-limiter-CEALq4N1.d.ts +559 -0
  363. package/dist/rate-limiter-DpVbSYdH.d.cts +559 -0
  364. package/dist/{reactive-layout-DOTs9P3X.d.ts → reactive-layout-fswlBUvX.d.cts} +19 -7
  365. package/dist/{reactive-layout-DgctbqZo.d.cts → reactive-layout-fswlBUvX.d.ts} +19 -7
  366. package/dist/retry-BDbRZ_gx.d.ts +125 -0
  367. package/dist/retry-DWuhjvsA.d.cts +125 -0
  368. package/dist/solutions/index.cjs +8200 -0
  369. package/dist/solutions/index.cjs.map +1 -0
  370. package/dist/solutions/index.d.cts +23 -0
  371. package/dist/solutions/index.d.ts +23 -0
  372. package/dist/solutions/index.js +55 -0
  373. package/dist/solutions/index.js.map +1 -0
  374. package/dist/spawnable-5mDY501F.d.cts +746 -0
  375. package/dist/spawnable-D3lR0oQu.d.ts +746 -0
  376. package/dist/status-U-rUI79b.d.cts +84 -0
  377. package/dist/status-U-rUI79b.d.ts +84 -0
  378. package/dist/timeout-U5O4ESK3.js +12 -0
  379. package/dist/timeout-U5O4ESK3.js.map +1 -0
  380. package/dist/{types-CWFysE9E.d.ts → types-BB5Lw-pB.d.cts} +3 -3
  381. package/dist/{types-C0_yquda.d.cts → types-BB5Lw-pB.d.ts} +3 -3
  382. package/dist/types-CJWIMJiZ.d.ts +548 -0
  383. package/dist/types-vCq7ShIm.d.cts +548 -0
  384. package/dist/utils/ai/browser.cjs +2169 -0
  385. package/dist/utils/ai/browser.cjs.map +1 -0
  386. package/dist/{patterns → utils}/ai/browser.d.cts +7 -5
  387. package/dist/{patterns → utils}/ai/browser.d.ts +7 -5
  388. package/dist/utils/ai/browser.js +255 -0
  389. package/dist/utils/ai/browser.js.map +1 -0
  390. package/dist/utils/ai/index.cjs +8468 -0
  391. package/dist/utils/ai/index.cjs.map +1 -0
  392. package/dist/{index-CR8QpwX8.d.ts → utils/ai/index.d.cts} +73 -976
  393. package/dist/{index-UPSiS-X7.d.cts → utils/ai/index.d.ts} +73 -976
  394. package/dist/utils/ai/index.js +173 -0
  395. package/dist/utils/ai/index.js.map +1 -0
  396. package/dist/utils/ai/node.cjs +648 -0
  397. package/dist/utils/ai/node.cjs.map +1 -0
  398. package/dist/{patterns → utils}/ai/node.d.cts +5 -7
  399. package/dist/{patterns → utils}/ai/node.d.ts +5 -7
  400. package/dist/utils/ai/node.js +84 -0
  401. package/dist/utils/ai/node.js.map +1 -0
  402. package/dist/utils/cqrs/index.cjs +1036 -0
  403. package/dist/utils/cqrs/index.cjs.map +1 -0
  404. package/dist/{index-CeFiHtAg.d.ts → utils/cqrs/index.d.cts} +7 -37
  405. package/dist/{index-B-_tFaqV.d.cts → utils/cqrs/index.d.ts} +7 -37
  406. package/dist/utils/cqrs/index.js +18 -0
  407. package/dist/utils/cqrs/index.js.map +1 -0
  408. package/dist/utils/demo-shell/index.cjs +865 -0
  409. package/dist/utils/demo-shell/index.cjs.map +1 -0
  410. package/dist/{index-B8YnZpIR.d.ts → utils/demo-shell/index.d.cts} +4 -16
  411. package/dist/{index-Cwv0KWcU.d.cts → utils/demo-shell/index.d.ts} +4 -16
  412. package/dist/utils/demo-shell/index.js +13 -0
  413. package/dist/utils/demo-shell/index.js.map +1 -0
  414. package/dist/utils/domain-templates/index.cjs +732 -0
  415. package/dist/utils/domain-templates/index.cjs.map +1 -0
  416. package/dist/{index-CzLVrjxn.d.ts → utils/domain-templates/index.d.cts} +3 -20
  417. package/dist/{index-BaQaY_IQ.d.cts → utils/domain-templates/index.d.ts} +3 -20
  418. package/dist/utils/domain-templates/index.js +17 -0
  419. package/dist/utils/domain-templates/index.js.map +1 -0
  420. package/dist/utils/graphspec/index.cjs +1174 -0
  421. package/dist/utils/graphspec/index.cjs.map +1 -0
  422. package/dist/{index-CMh5Rz1y.d.ts → utils/graphspec/index.d.cts} +106 -42
  423. package/dist/{index-CS0LTlB8.d.cts → utils/graphspec/index.d.ts} +106 -42
  424. package/dist/utils/graphspec/index.js +35 -0
  425. package/dist/utils/graphspec/index.js.map +1 -0
  426. package/dist/utils/harness/index.cjs +656 -0
  427. package/dist/utils/harness/index.cjs.map +1 -0
  428. package/dist/utils/harness/index.d.cts +542 -0
  429. package/dist/utils/harness/index.d.ts +542 -0
  430. package/dist/utils/harness/index.js +56 -0
  431. package/dist/utils/harness/index.js.map +1 -0
  432. package/dist/utils/index.cjs +17609 -0
  433. package/dist/utils/index.cjs.map +1 -0
  434. package/dist/utils/index.d.cts +96 -0
  435. package/dist/utils/index.d.ts +96 -0
  436. package/dist/utils/index.js +514 -0
  437. package/dist/utils/index.js.map +1 -0
  438. package/dist/utils/inspect/index.cjs +807 -0
  439. package/dist/utils/inspect/index.cjs.map +1 -0
  440. package/dist/utils/inspect/index.d.cts +123 -0
  441. package/dist/utils/inspect/index.d.ts +123 -0
  442. package/dist/utils/inspect/index.js +30 -0
  443. package/dist/utils/inspect/index.js.map +1 -0
  444. package/dist/utils/job-queue/index.cjs +717 -0
  445. package/dist/utils/job-queue/index.cjs.map +1 -0
  446. package/dist/{index-DisjX8a-.d.ts → utils/job-queue/index.d.cts} +5 -26
  447. package/dist/{index-DV_1YuVk.d.cts → utils/job-queue/index.d.ts} +5 -26
  448. package/dist/utils/job-queue/index.js +18 -0
  449. package/dist/utils/job-queue/index.js.map +1 -0
  450. package/dist/utils/memory/index.cjs +1451 -0
  451. package/dist/utils/memory/index.cjs.map +1 -0
  452. package/dist/{index-CZ3r5Rxp.d.ts → utils/memory/index.d.cts} +242 -34
  453. package/dist/{index-B17QddL1.d.cts → utils/memory/index.d.ts} +242 -34
  454. package/dist/utils/memory/index.js +19 -0
  455. package/dist/utils/memory/index.js.map +1 -0
  456. package/dist/utils/messaging/index.cjs +666 -0
  457. package/dist/utils/messaging/index.cjs.map +1 -0
  458. package/dist/utils/messaging/index.d.cts +562 -0
  459. package/dist/utils/messaging/index.d.ts +562 -0
  460. package/dist/utils/messaging/index.js +50 -0
  461. package/dist/utils/messaging/index.js.map +1 -0
  462. package/dist/utils/orchestration/index.cjs +876 -0
  463. package/dist/utils/orchestration/index.cjs.map +1 -0
  464. package/dist/utils/orchestration/index.d.cts +233 -0
  465. package/dist/utils/orchestration/index.d.ts +233 -0
  466. package/dist/utils/orchestration/index.js +19 -0
  467. package/dist/utils/orchestration/index.js.map +1 -0
  468. package/dist/utils/process/index.cjs +743 -0
  469. package/dist/utils/process/index.cjs.map +1 -0
  470. package/dist/{index-p09KSrTN.d.ts → utils/process/index.d.cts} +97 -44
  471. package/dist/{index-CasX6Pfq.d.cts → utils/process/index.d.ts} +97 -44
  472. package/dist/utils/process/index.js +14 -0
  473. package/dist/utils/process/index.js.map +1 -0
  474. package/dist/utils/reactive-layout/index.cjs +1607 -0
  475. package/dist/utils/reactive-layout/index.cjs.map +1 -0
  476. package/dist/{index-B5S8ULbU.d.ts → utils/reactive-layout/index.d.cts} +58 -81
  477. package/dist/{index-Dc4AYqrJ.d.cts → utils/reactive-layout/index.d.ts} +58 -81
  478. package/dist/utils/reactive-layout/index.js +52 -0
  479. package/dist/utils/reactive-layout/index.js.map +1 -0
  480. package/dist/utils/reduction/index.cjs +203 -0
  481. package/dist/utils/reduction/index.cjs.map +1 -0
  482. package/dist/{index-Byu-OpX_.d.ts → utils/reduction/index.d.cts} +6 -17
  483. package/dist/{index-tRCxuAXF.d.cts → utils/reduction/index.d.ts} +6 -17
  484. package/dist/utils/reduction/index.js +14 -0
  485. package/dist/utils/reduction/index.js.map +1 -0
  486. package/dist/utils/resilience/index.cjs +1617 -0
  487. package/dist/utils/resilience/index.cjs.map +1 -0
  488. package/dist/utils/resilience/index.d.cts +9 -0
  489. package/dist/utils/resilience/index.d.ts +9 -0
  490. package/dist/utils/resilience/index.js +44 -0
  491. package/dist/utils/resilience/index.js.map +1 -0
  492. package/dist/utils/surface/index.cjs +1070 -0
  493. package/dist/utils/surface/index.cjs.map +1 -0
  494. package/dist/{index-CYq8vAyV.d.ts → utils/surface/index.d.cts} +7 -58
  495. package/dist/{index-CSOmP7xT.d.cts → utils/surface/index.d.ts} +7 -58
  496. package/dist/utils/surface/index.js +30 -0
  497. package/dist/utils/surface/index.js.map +1 -0
  498. package/dist/utils/topology-view/index.cjs +620 -0
  499. package/dist/utils/topology-view/index.cjs.map +1 -0
  500. package/dist/utils/topology-view/index.d.cts +68 -0
  501. package/dist/utils/topology-view/index.d.ts +68 -0
  502. package/dist/utils/topology-view/index.js +11 -0
  503. package/dist/utils/topology-view/index.js.map +1 -0
  504. package/package.json +664 -584
  505. package/dist/backoff-HPZMEZNF.js +0 -1
  506. package/dist/chunk-2T7U5EU6.js +0 -1
  507. package/dist/chunk-3G5U5QNE.js +0 -5
  508. package/dist/chunk-4VVTGLXJ.js +0 -1
  509. package/dist/chunk-5M4CCMMD.js +0 -45
  510. package/dist/chunk-5QDBSZBV.js +0 -1
  511. package/dist/chunk-5XJ6B66J.js +0 -1
  512. package/dist/chunk-6QZNQS5B.js +0 -1
  513. package/dist/chunk-6X7AFUJV.js +0 -9
  514. package/dist/chunk-7K6PWTDQ.js +0 -1
  515. package/dist/chunk-7LIAPXJB.js +0 -1
  516. package/dist/chunk-7WPU3UHQ.js +0 -1
  517. package/dist/chunk-A5WCQ5NO.js +0 -1
  518. package/dist/chunk-APPIWSGD.js +0 -84
  519. package/dist/chunk-BEZWM2SY.js +0 -1
  520. package/dist/chunk-C72GO4IZ.js +0 -1
  521. package/dist/chunk-CB676TKJ.js +0 -1
  522. package/dist/chunk-CE6TI2TL.js +0 -1
  523. package/dist/chunk-CE72X3WO.js +0 -1
  524. package/dist/chunk-CK2E7BTU.js +0 -1
  525. package/dist/chunk-CLVB32RD.js +0 -1
  526. package/dist/chunk-CRVT7D2P.js +0 -1
  527. package/dist/chunk-D5RFJOZ2.js +0 -1
  528. package/dist/chunk-D7GPHKFH.js +0 -1
  529. package/dist/chunk-DHRX7JX4.js +0 -2
  530. package/dist/chunk-ESMPEKEV.js +0 -1
  531. package/dist/chunk-F672GV32.js +0 -1
  532. package/dist/chunk-FZMYDOWV.js +0 -1
  533. package/dist/chunk-GHBWHMRZ.js +0 -1
  534. package/dist/chunk-GLERH466.js +0 -1
  535. package/dist/chunk-GPW2V3RE.js +0 -1
  536. package/dist/chunk-HIDYF36O.js +0 -1
  537. package/dist/chunk-HITNVN6B.js +0 -3
  538. package/dist/chunk-HY4DJBA7.js +0 -5
  539. package/dist/chunk-KZIEYVXN.js +0 -1
  540. package/dist/chunk-L6NSJVJZ.js +0 -1
  541. package/dist/chunk-N4MQX6JU.js +0 -18
  542. package/dist/chunk-N7FHEL4D.js +0 -1
  543. package/dist/chunk-NTEURFZH.js +0 -1
  544. package/dist/chunk-OIVP6KFV.js +0 -1
  545. package/dist/chunk-OPHBU3LG.js +0 -1
  546. package/dist/chunk-OYQOZP2F.js +0 -5
  547. package/dist/chunk-PTZK576G.js +0 -1
  548. package/dist/chunk-QYADASLV.js +0 -1
  549. package/dist/chunk-ST7UXLWR.js +0 -1
  550. package/dist/chunk-SVY7VUYU.js +0 -1
  551. package/dist/chunk-TK3NWWD4.js +0 -1
  552. package/dist/chunk-TSOYJ743.js +0 -1
  553. package/dist/chunk-UNGSTR4X.js +0 -61
  554. package/dist/chunk-VIMF6LGM.js +0 -1
  555. package/dist/chunk-VJLMUKOI.js +0 -1
  556. package/dist/chunk-VN6RDSK2.js +0 -1
  557. package/dist/chunk-VV4N5P64.js +0 -1
  558. package/dist/chunk-W3I423PS.js +0 -1
  559. package/dist/chunk-WJR24TAG.js +0 -1
  560. package/dist/chunk-XTGKMHSW.js +0 -1
  561. package/dist/chunk-YBB7ZGTY.js +0 -1
  562. package/dist/chunk-Z4NPUARF.js +0 -1
  563. package/dist/chunk-ZGNQRPDT.js +0 -1
  564. package/dist/chunk-ZKPSFFKU.js +0 -1
  565. package/dist/chunk-ZLV5SQSX.js +0 -1
  566. package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
  567. package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
  568. package/dist/core/index.cjs +0 -1
  569. package/dist/core/index.d.cts +0 -3
  570. package/dist/core/index.d.ts +0 -3
  571. package/dist/core/index.js +0 -1
  572. package/dist/decay-BvOWTZ00.d.ts +0 -112
  573. package/dist/decay-CFlLvXUT.d.cts +0 -112
  574. package/dist/extra/browser.cjs +0 -1
  575. package/dist/extra/browser.d.cts +0 -4
  576. package/dist/extra/browser.d.ts +0 -4
  577. package/dist/extra/browser.js +0 -1
  578. package/dist/extra/index.cjs +0 -20
  579. package/dist/extra/index.d.cts +0 -17
  580. package/dist/extra/index.d.ts +0 -17
  581. package/dist/extra/index.js +0 -1
  582. package/dist/extra/node.cjs +0 -2
  583. package/dist/extra/node.js +0 -2
  584. package/dist/extra/operators.cjs +0 -1
  585. package/dist/extra/operators.d.cts +0 -958
  586. package/dist/extra/operators.d.ts +0 -958
  587. package/dist/extra/operators.js +0 -1
  588. package/dist/extra/reactive.cjs +0 -1
  589. package/dist/extra/reactive.d.cts +0 -353
  590. package/dist/extra/reactive.d.ts +0 -353
  591. package/dist/extra/reactive.js +0 -1
  592. package/dist/extra/render/index.cjs +0 -5
  593. package/dist/extra/render/index.js +0 -1
  594. package/dist/extra/sources.cjs +0 -3
  595. package/dist/extra/sources.js +0 -1
  596. package/dist/extra/storage-browser.cjs +0 -1
  597. package/dist/extra/storage-browser.d.cts +0 -37
  598. package/dist/extra/storage-browser.d.ts +0 -37
  599. package/dist/extra/storage-browser.js +0 -1
  600. package/dist/extra/storage-core.cjs +0 -1
  601. package/dist/extra/storage-core.d.cts +0 -28
  602. package/dist/extra/storage-core.d.ts +0 -28
  603. package/dist/extra/storage-core.js +0 -1
  604. package/dist/extra/storage-node.cjs +0 -1
  605. package/dist/extra/storage-node.d.cts +0 -2
  606. package/dist/extra/storage-node.d.ts +0 -2
  607. package/dist/extra/storage-node.js +0 -0
  608. package/dist/extra/storage-tiers-browser.cjs +0 -1
  609. package/dist/extra/storage-tiers-browser.d.cts +0 -120
  610. package/dist/extra/storage-tiers-browser.d.ts +0 -120
  611. package/dist/extra/storage-tiers-browser.js +0 -1
  612. package/dist/extra/storage-tiers-node.cjs +0 -1
  613. package/dist/extra/storage-tiers-node.d.cts +0 -210
  614. package/dist/extra/storage-tiers-node.d.ts +0 -210
  615. package/dist/extra/storage-tiers-node.js +0 -1
  616. package/dist/extra/storage-tiers.cjs +0 -1
  617. package/dist/extra/storage-tiers.d.cts +0 -412
  618. package/dist/extra/storage-tiers.d.ts +0 -412
  619. package/dist/extra/storage-tiers.js +0 -1
  620. package/dist/graph/index.cjs +0 -7
  621. package/dist/graph/index.d.cts +0 -7
  622. package/dist/graph/index.d.ts +0 -7
  623. package/dist/graph/index.js +0 -1
  624. package/dist/graph-CWvEUQAq.d.cts +0 -1861
  625. package/dist/graph-D9LFnda9.d.ts +0 -1861
  626. package/dist/index-5k1T6jl0.d.cts +0 -121
  627. package/dist/index-9770hRuQ.d.cts +0 -779
  628. package/dist/index-B1F8Enjf.d.ts +0 -704
  629. package/dist/index-BHskSB8v.d.ts +0 -3413
  630. package/dist/index-BIYAkbAi.d.cts +0 -26
  631. package/dist/index-BoJ5JHxI.d.ts +0 -557
  632. package/dist/index-BocU7pqs.d.ts +0 -779
  633. package/dist/index-BxNs2HB9.d.cts +0 -1858
  634. package/dist/index-C1T3d7V-.d.cts +0 -704
  635. package/dist/index-C5ri2Axc.d.cts +0 -301
  636. package/dist/index-C9l6OEBL.d.ts +0 -26
  637. package/dist/index-CC-AvFTy.d.cts +0 -557
  638. package/dist/index-CJF1URuX.d.ts +0 -121
  639. package/dist/index-CdTelp1M.d.ts +0 -202
  640. package/dist/index-Cj3WohTd.d.cts +0 -202
  641. package/dist/index-Co7uli2l.d.cts +0 -3413
  642. package/dist/index-D0aciIex.d.cts +0 -209
  643. package/dist/index-DHen9Klo.d.ts +0 -1858
  644. package/dist/index-Yq60JP3s.d.ts +0 -209
  645. package/dist/index-nozs3fFC.d.ts +0 -301
  646. package/dist/node-kK3CvTrR.d.cts +0 -1347
  647. package/dist/node-kK3CvTrR.d.ts +0 -1347
  648. package/dist/patterns/ai/browser.cjs +0 -8
  649. package/dist/patterns/ai/browser.js +0 -3
  650. package/dist/patterns/ai/index.cjs +0 -74
  651. package/dist/patterns/ai/index.d.cts +0 -20
  652. package/dist/patterns/ai/index.d.ts +0 -20
  653. package/dist/patterns/ai/index.js +0 -1
  654. package/dist/patterns/ai/node.cjs +0 -1
  655. package/dist/patterns/ai/node.js +0 -1
  656. package/dist/patterns/cqrs/index.cjs +0 -3
  657. package/dist/patterns/cqrs/index.d.cts +0 -8
  658. package/dist/patterns/cqrs/index.d.ts +0 -8
  659. package/dist/patterns/cqrs/index.js +0 -1
  660. package/dist/patterns/demo-shell/index.cjs +0 -5
  661. package/dist/patterns/demo-shell/index.d.cts +0 -7
  662. package/dist/patterns/demo-shell/index.d.ts +0 -7
  663. package/dist/patterns/demo-shell/index.js +0 -1
  664. package/dist/patterns/domain-templates/index.cjs +0 -3
  665. package/dist/patterns/domain-templates/index.d.cts +0 -6
  666. package/dist/patterns/domain-templates/index.d.ts +0 -6
  667. package/dist/patterns/domain-templates/index.js +0 -1
  668. package/dist/patterns/graphspec/index.cjs +0 -86
  669. package/dist/patterns/graphspec/index.d.cts +0 -8
  670. package/dist/patterns/graphspec/index.d.ts +0 -8
  671. package/dist/patterns/graphspec/index.js +0 -1
  672. package/dist/patterns/harness/index.cjs +0 -48
  673. package/dist/patterns/harness/index.d.cts +0 -13
  674. package/dist/patterns/harness/index.d.ts +0 -13
  675. package/dist/patterns/harness/index.js +0 -1
  676. package/dist/patterns/inspect/index.cjs +0 -3
  677. package/dist/patterns/inspect/index.d.cts +0 -9
  678. package/dist/patterns/inspect/index.d.ts +0 -9
  679. package/dist/patterns/inspect/index.js +0 -1
  680. package/dist/patterns/job-queue/index.cjs +0 -3
  681. package/dist/patterns/job-queue/index.d.cts +0 -9
  682. package/dist/patterns/job-queue/index.d.ts +0 -9
  683. package/dist/patterns/job-queue/index.js +0 -1
  684. package/dist/patterns/memory/index.cjs +0 -3
  685. package/dist/patterns/memory/index.d.cts +0 -8
  686. package/dist/patterns/memory/index.d.ts +0 -8
  687. package/dist/patterns/memory/index.js +0 -1
  688. package/dist/patterns/messaging/index.cjs +0 -3
  689. package/dist/patterns/messaging/index.d.cts +0 -7
  690. package/dist/patterns/messaging/index.d.ts +0 -7
  691. package/dist/patterns/messaging/index.js +0 -1
  692. package/dist/patterns/orchestration/index.cjs +0 -3
  693. package/dist/patterns/orchestration/index.d.cts +0 -8
  694. package/dist/patterns/orchestration/index.d.ts +0 -8
  695. package/dist/patterns/orchestration/index.js +0 -1
  696. package/dist/patterns/process/index.cjs +0 -3
  697. package/dist/patterns/process/index.d.cts +0 -10
  698. package/dist/patterns/process/index.d.ts +0 -10
  699. package/dist/patterns/process/index.js +0 -1
  700. package/dist/patterns/reactive-layout/index.cjs +0 -4
  701. package/dist/patterns/reactive-layout/index.d.cts +0 -7
  702. package/dist/patterns/reactive-layout/index.d.ts +0 -7
  703. package/dist/patterns/reactive-layout/index.js +0 -1
  704. package/dist/patterns/reduction/index.cjs +0 -3
  705. package/dist/patterns/reduction/index.d.cts +0 -6
  706. package/dist/patterns/reduction/index.d.ts +0 -6
  707. package/dist/patterns/reduction/index.js +0 -1
  708. package/dist/patterns/surface/index.cjs +0 -13
  709. package/dist/patterns/surface/index.d.cts +0 -9
  710. package/dist/patterns/surface/index.d.ts +0 -9
  711. package/dist/patterns/surface/index.js +0 -1
  712. package/dist/reactive-log-BKALbfal.d.ts +0 -223
  713. package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
  714. package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
  715. package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
  716. package/dist/resilience-6LYQJAC5.js +0 -1
  717. package/dist/sugar-DQjFmVqb.d.cts +0 -399
  718. package/dist/sugar-fhLIE7TT.d.ts +0 -399
  719. package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
  720. package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
@@ -1,1347 +0,0 @@
1
- /**
2
- * Who is performing an operation (attribution + ABAC input).
3
- *
4
- * @see GRAPHREFLY-SPEC — roadmap Phase 1.5 (Actor & Guard).
5
- */
6
- type Actor = {
7
- type: "human" | "llm" | "wallet" | "system" | string;
8
- id: string;
9
- } & Record<string, unknown>;
10
- /** Default actor when none is passed ({@link normalizeActor}). */
11
- declare const DEFAULT_ACTOR: Actor;
12
- /**
13
- * Fills missing `type` / `id` on an actor and returns {@link DEFAULT_ACTOR} when input is undefined.
14
- *
15
- * @param actor - Optional partial actor from a transport hint.
16
- * @returns A normalized `Actor` safe to pass to guards and graph APIs.
17
- *
18
- * @example
19
- * ```ts
20
- * import { normalizeActor } from "@graphrefly/graphrefly-ts";
21
- *
22
- * normalizeActor({ type: "human", id: "u1" });
23
- * ```
24
- */
25
- declare function normalizeActor(actor?: Actor): Actor;
26
-
27
- /**
28
- * GraphReFly message protocol — §1 `~/src/graphrefly/GRAPHREFLY-SPEC.md`.
29
- * Emissions are always `[[Type, Data?], ...]` (no single-tuple shorthand).
30
- *
31
- * This file is protocol-pure:
32
- * - Message type symbols (10 built-ins).
33
- * - `Message` / `Messages` tuple types.
34
- * - `MessageTypeRegistration` interface (shape of a registry entry).
35
- *
36
- * It does NOT own the registry, tier lookups, or any cross-cutting singleton
37
- * state — that lives in `GraphReFlyConfig` (see `config.ts`) so custom
38
- * protocols can build isolated instances. Import this module when you need
39
- * the symbol constants or the tuple types; import `config.ts` when you need
40
- * tier / wire-crossing / registry lookups.
41
- */
42
- /** Subscribe-time handshake. Delivered to each new sink at the top of `subscribe()`. Tier 0. */
43
- declare const START: unique symbol;
44
- /** Value delivery (`DATA`, value). Tier 3 — deferred inside `batch()`. */
45
- declare const DATA: unique symbol;
46
- /** Phase 1: value about to change. Tier 1 — immediate. */
47
- declare const DIRTY: unique symbol;
48
- /** Phase 2: dirty pass completed, value unchanged. Tier 3 — deferred inside `batch()`. */
49
- declare const RESOLVED: unique symbol;
50
- /** Clear cached state; do not auto-emit. Tier 1 — immediate. */
51
- declare const INVALIDATE: unique symbol;
52
- /** Suspend activity. Tier 2 — immediate. */
53
- declare const PAUSE: unique symbol;
54
- /** Resume after pause. Tier 2 — immediate. */
55
- declare const RESUME: unique symbol;
56
- /** Permanent cleanup. Tier 5 — deferred to batch phase 4. */
57
- declare const TEARDOWN: unique symbol;
58
- /** Clean termination. Tier 4 — deferred to batch phase 3. */
59
- declare const COMPLETE: unique symbol;
60
- /** Error termination. Tier 4 — deferred to batch phase 3. */
61
- declare const ERROR: unique symbol;
62
- /** One protocol tuple: `[Type, optional payload]`. */
63
- type Message = readonly [symbol, unknown?];
64
- /** A batch of tuples — the wire shape for `node.down()` / `node.up()`. */
65
- type Messages = readonly Message[];
66
- /** Singleton `[DIRTY]` tuple — payload-free, interned. */
67
- declare const DIRTY_MSG: Message;
68
- /** Singleton `[RESOLVED]` tuple — payload-free, interned. */
69
- declare const RESOLVED_MSG: Message;
70
- /** Singleton `[INVALIDATE]` tuple — payload-free, interned. */
71
- declare const INVALIDATE_MSG: Message;
72
- /** Singleton `[START]` tuple — payload-free, interned. */
73
- declare const START_MSG: Message;
74
- /** Singleton `[COMPLETE]` tuple — payload-free, interned. */
75
- declare const COMPLETE_MSG: Message;
76
- /** Singleton `[TEARDOWN]` tuple — payload-free, interned. */
77
- declare const TEARDOWN_MSG: Message;
78
- /** Pre-wrapped `[[DIRTY]]` for `_emit([DIRTY_ONLY_BATCH])`-style callers. */
79
- declare const DIRTY_ONLY_BATCH: Messages;
80
- /** Pre-wrapped `[[RESOLVED]]`. */
81
- declare const RESOLVED_ONLY_BATCH: Messages;
82
- /** Pre-wrapped `[[INVALIDATE]]`. */
83
- declare const INVALIDATE_ONLY_BATCH: Messages;
84
- /** Pre-wrapped `[[COMPLETE]]`. */
85
- declare const COMPLETE_ONLY_BATCH: Messages;
86
- /** Pre-wrapped `[[TEARDOWN]]`. */
87
- declare const TEARDOWN_ONLY_BATCH: Messages;
88
- /**
89
- * Per-type record stored in a {@link GraphReFlyConfig}'s registry.
90
- *
91
- * - `tier` — signal tier (0–5 built-in; custom tiers allowed but should fit
92
- * the phase model used by `batch.ts`).
93
- * - `wireCrossing` — when `true`, forwarded across SSE/WebSocket/worker
94
- * adapters. Defaults to `tier >= 3` if omitted in registration input.
95
- * - `metaPassthrough` — when `false`, this message type is filtered out of
96
- * `Graph.signal` deliveries to meta companion nodes (spec §2.3). Meta
97
- * companions still receive everything via their primary's own cascade.
98
- * Defaults to `true` (meta receives the message).
99
- */
100
- interface MessageTypeRegistration {
101
- tier: number;
102
- wireCrossing: boolean;
103
- metaPassthrough: boolean;
104
- }
105
- /**
106
- * Input accepted by {@link GraphReFlyConfig.registerMessageType}. Only `tier`
107
- * is required; `wireCrossing` defaults to `tier >= 3`; `metaPassthrough`
108
- * defaults to `true`.
109
- */
110
- interface MessageTypeRegistrationInput {
111
- tier: number;
112
- wireCrossing?: boolean;
113
- metaPassthrough?: boolean;
114
- }
115
-
116
- /**
117
- * Node versioning — GRAPHREFLY-SPEC §7.
118
- *
119
- * Progressive, optional versioning for node identity and change tracking.
120
- *
121
- * - **V0**: `id` + `version` — identity & change detection (~16 bytes overhead)
122
- * - **V1**: + `cid` + `prev` — content addressing & linked history (~60 bytes overhead)
123
- *
124
- * **Lifecycle notes:**
125
- * - Version advances only on DATA (not RESOLVED, INVALIDATE, or TEARDOWN).
126
- * - `resetOnTeardown` clears the cached value but does NOT reset versioning state.
127
- * After teardown, `v.cid` still reflects the last DATA value, not the cleared cache.
128
- * The invariant `hash(node.cache) === v.cid` only holds in `settled`/`resolved` status.
129
- * - Resubscribable nodes preserve versioning across subscription lifetimes (monotonic counter).
130
- */
131
- /** V0: identity + monotonic version counter. */
132
- type V0 = {
133
- readonly id: string;
134
- version: number;
135
- };
136
- /** V1: V0 + content-addressed identifier + previous cid link. */
137
- type V1 = V0 & {
138
- cid: string;
139
- prev: string | null;
140
- };
141
- /** Union of all versioning info shapes. */
142
- type NodeVersionInfo = V0 | V1;
143
- /** Supported versioning levels (extensible to 2, 3 later). */
144
- type VersioningLevel = 0 | 1;
145
- /** Function that hashes a value to a hex string (for V1 cid). */
146
- type HashFn = (value: unknown) => string;
147
- interface VersioningOptions {
148
- /** Override auto-generated id. */
149
- id?: string;
150
- /** Custom hash function for V1 cid (default: SHA-256 truncated to 16 hex chars). */
151
- hash?: HashFn;
152
- }
153
- /**
154
- * Default content hash: SHA-256 of deterministic JSON, truncated to 16 hex
155
- * chars (~64-bit). Uses {@link canonicalizeForHash} for cross-language parity
156
- * with Python `default_hash`.
157
- */
158
- declare function defaultHash(value: unknown): string;
159
- /**
160
- * Create initial versioning state for a node.
161
- *
162
- * @param level - 0 for V0, 1 for V1.
163
- * @param initialValue - The node's initial cached value (used for V1 cid).
164
- * @param opts - Optional overrides (id, hash).
165
- */
166
- declare function createVersioning(level: VersioningLevel, initialValue: unknown, opts?: VersioningOptions): NodeVersionInfo;
167
- /**
168
- * Advance versioning state after a DATA emission (value changed).
169
- *
170
- * Mutates `info` in place for performance (called on every DATA).
171
- * Only call when the cached value has actually changed (not on RESOLVED).
172
- *
173
- * @param info - The node's current versioning state.
174
- * @param newValue - The new cached value.
175
- * @param hashFn - Hash function (only used for V1).
176
- */
177
- declare function advanceVersion(info: NodeVersionInfo, newValue: unknown, hashFn: HashFn): void;
178
- /** Type guard: is this V1 versioning info? */
179
- declare function isV1(info: NodeVersionInfo): info is V1;
180
-
181
- /**
182
- * Singleton protocol config. Holds the message-type registry, the
183
- * `onMessage` / `onSubscribe` hooks, versioning defaults, and the freeze flag.
184
- *
185
- * Layering: this file is protocol-pure. It imports only from `messages.ts`
186
- * and declares opaque type shapes for handlers — the concrete default
187
- * implementations and the `defaultConfig` instance live in `node.ts` so that
188
- * handler bodies can touch `NodeImpl` internals without creating a cycle.
189
- *
190
- * Two access paths:
191
- * 1. **Default instance** (`defaultConfig` in `node.ts`) — use
192
- * `configure((cfg) => ...)` at app startup; every node implicitly binds to it.
193
- * 2. **Isolated instance** (`new GraphReFlyConfig(...)`) — pass via
194
- * `opts.config` for test isolation or custom protocol stacks.
195
- *
196
- * A config **freezes on first getter read** of any hook (`onMessage`,
197
- * `onSubscribe`). `NodeImpl`'s constructor intentionally touches one of these
198
- * on first use so configuration cannot drift once nodes exist.
199
- */
200
-
201
- /**
202
- * Minimal node surface visible to default handlers. Concrete `NodeImpl`
203
- * implements this plus a large set of package-private fields; handlers that
204
- * need the richer surface cast to the concrete type in `node.ts`.
205
- */
206
- interface NodeCtx {
207
- readonly name?: string;
208
- readonly status: string;
209
- readonly cache: unknown;
210
- }
211
- /** Imperative actions available inside a node's compute function (§5). */
212
- interface NodeActions {
213
- /**
214
- * Sugar for `down([[DATA, value]])`. One call = one wave with a
215
- * single DATA payload. The emit pipeline auto-prefixes `[DIRTY]`,
216
- * runs equals substitution against the live cache, and dispatches
217
- * to sinks with phase deferral. Diamond-safe by construction.
218
- */
219
- emit(value: unknown): void;
220
- /**
221
- * Send one or more messages downstream. Accepts either a single
222
- * {@link Message} tuple or a {@link Messages} array of tuples. One
223
- * call = one wave: the emit pipeline tier-sorts the input,
224
- * auto-prefixes `[DIRTY]` when a tier-3 payload is present and the
225
- * node isn't already dirty, runs equals substitution, then
226
- * dispatches. Multiple calls produce multiple waves.
227
- */
228
- down(messageOrMessages: Message | Messages): void;
229
- /**
230
- * Send one or more messages upstream. Accepts the same shapes as
231
- * {@link down}. Tier 3 (DATA/RESOLVED) and tier 4 (COMPLETE/ERROR)
232
- * are downstream-only and will throw — up is for DIRTY, INVALIDATE,
233
- * PAUSE, RESUME, and TEARDOWN only. No cache advance, no equals,
234
- * no framing — a plain forward to every dep.
235
- */
236
- up(messageOrMessages: Message | Messages): void;
237
- }
238
- /**
239
- * Message-flow context passed to {@link OnMessageHandler}.
240
- *
241
- * - `"down-in"` — message arriving from a dep (identified by `depIndex`).
242
- * - `"up-in"` — message arriving from a sink.
243
- */
244
- type MessageContext = {
245
- direction: "down-in";
246
- depIndex: number;
247
- } | {
248
- direction: "up-in";
249
- };
250
- /**
251
- * Per-sink context passed to {@link OnSubscribeHandler}.
252
- */
253
- interface SubscribeContext {
254
- /** Post-subscribe sink count. `1` means first subscriber after 0. */
255
- sinkCount: number;
256
- /** True when this subscribe cleared a resubscribable terminal state. */
257
- afterTerminalReset: boolean;
258
- }
259
- /**
260
- * Singleton message interceptor. Called for every message in either direction
261
- * before the default per-tier dispatch runs. Return `"consume"` to suppress
262
- * default handling.
263
- */
264
- type OnMessageHandler = (node: NodeCtx, msg: Message, ctx: MessageContext, actions: NodeActions) => "consume" | undefined;
265
- /**
266
- * Singleton subscribe ceremony. Fires for every sink subscribe on every node.
267
- * Default implementation emits the START handshake (+ cached DATA when
268
- * present) to the new sink. Return a cleanup function to run on unsubscribe.
269
- */
270
- type OnSubscribeHandler = (node: NodeCtx, sink: (messages: Messages) => void, ctx: SubscribeContext, actions: NodeActions) => (() => void) | undefined;
271
- /**
272
- * Event payload for {@link GlobalInspectorHook}. One event fires per outgoing
273
- * message batch from any node bound to the config.
274
- *
275
- * - `kind: "emit"` — fires after equals substitution (`finalMessages`) and
276
- * before sink dispatch. `messages` is the exact batch sinks see.
277
- */
278
- type GlobalInspectorEvent = {
279
- kind: "emit";
280
- node: NodeCtx;
281
- messages: Messages;
282
- };
283
- /**
284
- * Process-global observability hook for full-graph tracing
285
- * (Redux-DevTools-style action history). Fires from every node's `_emit`
286
- * waist whenever {@link GraphReFlyConfig.inspectorEnabled} is `true`.
287
- *
288
- * Distinct from per-node `_setInspectorHook` (which is the dep-message /
289
- * fn-run causal trace used by `Graph.observe(path, { causal, derived })`).
290
- * Use the global hook to record every emission across every node — useful for
291
- * time-travel debuggers, tracers, and replay tooling. Use the per-node hook
292
- * to attribute a single subscribed path's wave to its driving deps.
293
- *
294
- * Errors thrown from the hook are swallowed — instrumentation must not break
295
- * the data plane.
296
- */
297
- type GlobalInspectorHook = (event: GlobalInspectorEvent) => void;
298
- /**
299
- * Ghost-state recorder used by the fast-check protocol invariant suite to
300
- * mirror TLC invariants that reference TLA+ ghost variables (`cleanupWitness`,
301
- * `terminatedBy`, `nonVacuousInvalidateCount`) with no first-class runtime
302
- * representation. Attached to a `GraphReFlyConfig` via
303
- * {@link GraphReFlyConfig.rigorRecorder}; zero production cost when unset
304
- * (call sites in `NodeImpl` are guarded by a single `!= null` check).
305
- *
306
- * See `src/__tests__/properties/_invariants.ts` for the consumer side.
307
- *
308
- * Errors thrown from recorder methods are swallowed by `NodeImpl` — like
309
- * {@link GlobalInspectorHook}, instrumentation must not break the data plane.
310
- */
311
- interface RigorRecorder {
312
- /**
313
- * Fired at the non-vacuous branch of a node's INVALIDATE handler — the
314
- * `this._cached !== undefined` path where the cleanup hook runs and the
315
- * cache is reset. `prevValue` is the pre-reset `_cached` value. The
316
- * vacuous branch (diamond fan-in second arrival or never-populated
317
- * mid-chain derived) does NOT fire this hook, mirroring the TLA+
318
- * `cleanupWitness` append guard.
319
- */
320
- onNonVacuousInvalidate(node: NodeCtx, prevValue: unknown): void;
321
- /**
322
- * Fired when a node's status transitions to a terminal kind ("completed"
323
- * or "errored"). `autoComplete` / `autoError` are the node's configured
324
- * auto-terminal gates; `hasDeps` is `deps.length > 0`. Mirrors the TLA+
325
- * `terminatedBy` classification ghost — dep-cascade transitions can be
326
- * inferred by `hasDeps === true && autoX === true`.
327
- */
328
- onTerminalTransition(node: NodeCtx, kind: "completed" | "errored", autoComplete: boolean, autoError: boolean, hasDeps: boolean): void;
329
- }
330
- /**
331
- * Singleton protocol config.
332
- *
333
- * A config freezes on first getter read of any hook. After freeze, any
334
- * attempt to mutate (register a message type, set a hook) throws.
335
- */
336
- declare class GraphReFlyConfig {
337
- private _messageTypes;
338
- private _codecs;
339
- private _onMessage;
340
- private _onSubscribe;
341
- private _defaultVersioning;
342
- private _defaultHashFn;
343
- private _inspectorEnabled;
344
- private _globalInspector?;
345
- private _rigorRecorder?;
346
- private _frozen;
347
- /**
348
- * Pre-bound tier lookup — shared by every node bound to this config. Since
349
- * the registry is frozen on first hook access, this closure can be built
350
- * once in the constructor and handed directly to `downWithBatch` /
351
- * `_frameBatch` paths without per-node or per-emission `.bind(config)`
352
- * allocation.
353
- */
354
- readonly tierOf: (t: symbol) => number;
355
- constructor(init: {
356
- onMessage: OnMessageHandler;
357
- onSubscribe: OnSubscribeHandler;
358
- defaultVersioning?: VersioningLevel;
359
- defaultHashFn?: HashFn;
360
- });
361
- get onMessage(): OnMessageHandler;
362
- get onSubscribe(): OnSubscribeHandler;
363
- set onMessage(v: OnMessageHandler);
364
- set onSubscribe(v: OnSubscribeHandler);
365
- /**
366
- * Default versioning level applied to every node bound to this config,
367
- * unless the node's own `opts.versioning` provides an explicit override.
368
- * Setting this is only allowed before the config freezes (i.e., before
369
- * the first node is created) so every node in the graph sees a
370
- * consistent starting level. Individual nodes can still opt into a
371
- * higher level via `opts.versioning`, or post-hoc via
372
- * `NodeImpl._applyVersioning(level)` when the node is quiescent.
373
- *
374
- * v0 is the minimum opt-in — unversioned nodes (`undefined`) skip
375
- * the version counter entirely. v1 adds content-addressed cid.
376
- * Future levels (v2, v3) are reserved for linked-history and
377
- * cryptographic attestation extensions.
378
- */
379
- get defaultVersioning(): VersioningLevel | undefined;
380
- set defaultVersioning(v: VersioningLevel | undefined);
381
- /**
382
- * Default content-hash function applied to every versioned node bound
383
- * to this config, unless the node's own `opts.versioningHash` provides
384
- * an explicit override. Use this when a graph needs a non-default hash
385
- * — e.g., swap the vendored sync SHA-256 for a faster non-crypto hash
386
- * (xxHash, FNV-1a) in hot-path workloads, or a stronger hash when
387
- * versioning v1 cids are used as audit anchors.
388
- *
389
- * Only settable before the config freezes. Individual nodes can still
390
- * override via `opts.versioningHash`.
391
- */
392
- get defaultHashFn(): HashFn | undefined;
393
- set defaultHashFn(v: HashFn | undefined);
394
- /**
395
- * When `false`, structured observation options (`causal`, `timeline`)
396
- * and `Graph.trace()` writes are no-ops. Raw `Graph.observe()` always
397
- * works. Default: `true` outside production (`NODE_ENV !== "production"`).
398
- *
399
- * Settable at any time — inspector gating is an operational concern, not
400
- * a protocol invariant, so it does NOT require freeze before node creation.
401
- */
402
- get inspectorEnabled(): boolean;
403
- set inspectorEnabled(v: boolean);
404
- /**
405
- * Process-global observability hook (Redux-DevTools-style full-graph
406
- * tracer). Fires once per outgoing batch from every node bound to this
407
- * config, gated by {@link inspectorEnabled}. See {@link GlobalInspectorHook}.
408
- *
409
- * Settable at any time — like {@link inspectorEnabled} this is operational,
410
- * not protocol-shaping, so it does NOT trigger config freeze.
411
- */
412
- get globalInspector(): GlobalInspectorHook | undefined;
413
- set globalInspector(v: GlobalInspectorHook | undefined);
414
- /**
415
- * Ghost-state recorder for the fast-check protocol invariant suite. Attach
416
- * a {@link RigorRecorder} to capture TLA+-ghost events (cleanup witnesses,
417
- * terminal classification, batch-idle checks) that have no first-class
418
- * runtime surface; detach (`undefined`) for production, which is the
419
- * default. Settable at any time — like {@link globalInspector} this is
420
- * operational, not protocol-shaping, so it does NOT trigger config freeze.
421
- *
422
- * See `src/__tests__/properties/_invariants.ts` rigor mirror invariants
423
- * (#54–#58) for the consumer side. Call sites in `NodeImpl` fire at:
424
- * - the non-vacuous branch of `_onDepMessage`'s INVALIDATE handler
425
- * - every status transition to `"completed"` / `"errored"`.
426
- */
427
- get rigorRecorder(): RigorRecorder | undefined;
428
- set rigorRecorder(v: RigorRecorder | undefined);
429
- /**
430
- * Register a custom message type. Must be called before any node that
431
- * uses this config has been created — otherwise throws. Default
432
- * `wireCrossing` is `tier >= 3`.
433
- */
434
- registerMessageType(t: symbol, input: MessageTypeRegistrationInput): this;
435
- /** Tier for `t`. Unknown types default to tier 1 (immediate, after START). */
436
- messageTier(t: symbol): number;
437
- /**
438
- * Whether `t` is registered as wire-crossing. Unknown types default to
439
- * `true` (spec §1.3.6 forward-compat — unknowns cross the wire).
440
- */
441
- isWireCrossing(t: symbol): boolean;
442
- /** Convenience inverse of {@link isWireCrossing}. */
443
- isLocalOnly(t: symbol): boolean;
444
- /**
445
- * Whether `t` is forwarded to meta companions by `Graph.signal`. Defaults
446
- * to `true` for unknowns (forward-compat — new types pass through meta by
447
- * default; opt-in filter via `registerMessageType({metaPassthrough: false})`).
448
- */
449
- isMetaPassthrough(t: symbol): boolean;
450
- /** Whether `t` is a registered (built-in or custom) type. */
451
- isKnownMessageType(t: symbol): boolean;
452
- /**
453
- * Register a graph codec by `codec.name`. Used by the envelope-based
454
- * `graph.snapshot({format: "bytes", codec: name})` path and
455
- * `Graph.decode(bytes)` auto-dispatch. Must be called before any node
456
- * bound to this config is created — otherwise throws.
457
- *
458
- * Re-registering the same name overwrites, so user codecs can shadow
459
- * built-in ones before freeze (e.g., to swap a zstd-wrapped dag-cbor in
460
- * for `"dag-cbor"`).
461
- */
462
- registerCodec<T extends {
463
- readonly name: string;
464
- readonly version: number;
465
- }>(codec: T): this;
466
- /**
467
- * Resolve a registered codec by name. Returns `undefined` for unknown
468
- * names. Typed callers cast to their concrete codec interface (e.g.,
469
- * `config.lookupCodec<GraphCodec>("json")`) — this method stays
470
- * layer-pure (no import of graph-layer types into `core/`).
471
- */
472
- lookupCodec<T = {
473
- readonly name: string;
474
- readonly version: number;
475
- }>(name: string): T | undefined;
476
- /** @internal Used by tests and dev tooling — check freeze state without triggering it. */
477
- _isFrozen(): boolean;
478
- private _assertUnfrozen;
479
- }
480
- /**
481
- * Register the 10 built-in message types on a fresh config. Called by
482
- * `node.ts` when it constructs `defaultConfig` and by test code / advanced
483
- * users after `new GraphReFlyConfig(...)`.
484
- */
485
- declare function registerBuiltins(cfg: GraphReFlyConfig): void;
486
-
487
- /**
488
- * Actions checked by {@link NodeGuard}. `write` covers both {@link Node.down} and
489
- * {@link Node.up} today; finer-grained strings may be added later (e.g. `"write.data"`).
490
- */
491
- type GuardAction = "write" | "signal" | "observe" | (string & {});
492
- type NodeGuard = (actor: Actor, action: GuardAction) => boolean;
493
- type GuardDeniedDetails = {
494
- actor: Actor;
495
- action: GuardAction;
496
- /** Registry or options name when known */
497
- nodeName?: string;
498
- };
499
- /**
500
- * Thrown when a {@link NodeGuard} denies an action for a given actor.
501
- *
502
- * Carries the rejected `actor`, `action`, and optional `nodeName` for diagnostic
503
- * messages and middleware error handling.
504
- *
505
- * @example
506
- * ```ts
507
- * import { GuardDenied, policy } from "@graphrefly/graphrefly-ts";
508
- *
509
- * const guard = policy((allow) => { allow("observe"); });
510
- * try {
511
- * if (!guard({ type: "llm", id: "agent-1" }, "write")) {
512
- * throw new GuardDenied(
513
- * { actor: { type: "llm", id: "agent-1" }, action: "write", nodeName: "userInput" },
514
- * );
515
- * }
516
- * } catch (e) {
517
- * if (e instanceof GuardDenied) console.error(e.action, e.actor.type); // "write" "llm"
518
- * }
519
- * ```
520
- */
521
- declare class GuardDenied extends Error {
522
- readonly actor: Actor;
523
- readonly action: GuardAction;
524
- readonly nodeName?: string;
525
- /**
526
- * @param details - Actor, action, and optional node name for the denial.
527
- * @param message - Optional override for the default error message.
528
- */
529
- constructor(details: GuardDeniedDetails, message?: string);
530
- /** Qualified registry path when known (roadmap diagnostics: same as {@link nodeName}). */
531
- get node(): string | undefined;
532
- }
533
- type Where = (actor: Actor) => boolean;
534
- type PolicyAllow = (action: GuardAction | readonly GuardAction[], opts?: {
535
- where?: Where;
536
- }) => void;
537
- type PolicyDeny = (action: GuardAction | readonly GuardAction[], opts?: {
538
- where?: Where;
539
- }) => void;
540
- type PolicyRuleData = {
541
- effect: "allow" | "deny";
542
- action: GuardAction | readonly GuardAction[];
543
- actorType?: string | readonly string[];
544
- actorId?: string | readonly string[];
545
- claims?: Record<string, unknown>;
546
- };
547
- /**
548
- * Declarative guard builder. Precedence: any matching **deny** blocks even if an allow also matches.
549
- * If no rule matches, the guard returns `false` (deny-by-default). Aligned with graphrefly-py `policy()`.
550
- *
551
- * @param build - Callback that registers `allow(...)` / `deny(...)` rules in order.
552
- * @returns A `NodeGuard` for use as `node({ guard })`.
553
- *
554
- * @example
555
- * ```ts
556
- * const guard = policy((allow, deny) => {
557
- * allow("observe");
558
- * deny("write", { where: (a) => a.type === "llm" });
559
- * });
560
- * ```
561
- */
562
- declare function policy(build: (allow: PolicyAllow, deny: PolicyDeny) => void): NodeGuard;
563
- /**
564
- * Rebuild a declarative guard from persisted policy data (snapshot-safe).
565
- *
566
- * Rules are deny-overrides, same semantics as {@link policy}.
567
- */
568
- declare function policyFromRules(rules: readonly PolicyRuleData[]): NodeGuard;
569
- /**
570
- * Derives a best-effort `meta.access` hint string by probing `guard` with the
571
- * standard actor types `human`, `llm`, `wallet`, `system` for the `"write"` action
572
- * (roadmap 1.5). Aligned with graphrefly-py `access_hint_for_guard`.
573
- *
574
- * @param guard - Guard function to probe (typically from {@link policy}).
575
- * @returns `"restricted"` when no standard type is allowed; `"both"` when both
576
- * `human` and `llm` are allowed (plus optionally `system`); the single allowed
577
- * type name when only one passes; or a `"+"` joined list otherwise.
578
- *
579
- * @example
580
- * ```ts
581
- * import { policy, accessHintForGuard } from "@graphrefly/graphrefly-ts";
582
- *
583
- * const guardBoth = policy((allow) => { allow("write"); });
584
- * accessHintForGuard(guardBoth); // "both"
585
- *
586
- * const guardHuman = policy((allow) => {
587
- * allow("write", { where: (a) => a.type === "human" });
588
- * });
589
- * accessHintForGuard(guardHuman); // "human"
590
- * ```
591
- */
592
- declare function accessHintForGuard(guard: NodeGuard): string;
593
-
594
- /**
595
- * `NodeImpl` — the single GraphReFly node primitive.
596
- *
597
- * Per-dep state lives in a `DepRecord[]` — one entry per declared dep —
598
- * consolidating subscription cleanup, latest-data tracking, dirty/settled
599
- * flags, and terminal state into a single structure per dep.
600
- *
601
- * This file also owns the default singleton handlers (`defaultOnMessage`,
602
- * `defaultOnSubscribe`), the `defaultConfig` instance, and the public
603
- * `configure(...)` entry point. They live here because their bodies touch
604
- * `NodeImpl` internals; `config.ts` stays NodeImpl-agnostic.
605
- *
606
- * See GRAPHREFLY-SPEC §2 and COMPOSITION-GUIDE §1/§9 for the behavior
607
- * contract. See SESSION-foundation-redesign.md §§1–10 for design history.
608
- */
609
-
610
- /**
611
- * Lifecycle status of a node.
612
- *
613
- * @see GRAPHREFLY-SPEC.md §2.2
614
- */
615
- type NodeStatus = "sentinel" | "pending" | "dirty" | "settled" | "resolved" | "completed" | "errored";
616
- /** Callback that receives downstream message batches. */
617
- type NodeSink = (messages: Messages) => void;
618
- /**
619
- * Observability hook events fired by a per-node inspector. Used by
620
- * `Graph.observe(path, { causal, derived })` to build causal traces.
621
- *
622
- * - `"dep_message"` — fires in `_onDepMessage` before default dispatch,
623
- * one event per message received from a dep. Includes `depIndex` and
624
- * the raw `Message` tuple.
625
- * - `"run"` — fires in `_execFn` just before the user fn runs. Includes
626
- * the per-dep `prevData` snapshot that will be passed to fn.
627
- */
628
- type NodeInspectorHookEvent = {
629
- kind: "dep_message";
630
- depIndex: number;
631
- message: Message;
632
- } | {
633
- kind: "run";
634
- batchData: readonly (readonly unknown[] | undefined)[];
635
- prevData: readonly unknown[];
636
- };
637
- /** Callback attached to a node for per-message/per-run inspection. */
638
- type NodeInspectorHook = (event: NodeInspectorHookEvent) => void;
639
- /** Describe `type` for `Graph.describe` (GRAPHREFLY-SPEC Appendix B). */
640
- type NodeDescribeKind = "state" | "derived" | "producer" | "effect";
641
- /** Actor/delivery context for {@link Node.down} and {@link Node.up}. */
642
- type NodeTransportOptions = {
643
- actor?: Actor;
644
- /** When `true`, skips guard checks. */
645
- internal?: boolean;
646
- /** `signal` for `Graph.signal` deliveries; default `write`. */
647
- delivery?: "write" | "signal";
648
- };
649
- /**
650
- * Cleanup return shape from a node {@link NodeFn}.
651
- *
652
- * Two forms, discriminated on return type:
653
- *
654
- * - `() => void` — fires before the next fn run AND on deactivation AND on
655
- * INVALIDATE. The simplest form: one cleanup function for every transition
656
- * away from the current run. Use when the same teardown logic applies to
657
- * all three.
658
- *
659
- * - `{ beforeRun?, deactivate?, invalidate? }` — granular hooks. Each hook
660
- * fires exactly once on its named transition; missing hooks are no-ops.
661
- * Use when only some transitions should flush resources (e.g. a measurement
662
- * cache that should survive re-runs but reset on deactivation).
663
- *
664
- * - `beforeRun` fires before the next fn invocation (same point as the
665
- * function-form cleanup's pre-run hook).
666
- * - `deactivate` fires on deactivation (last-sink unsubscribe or TEARDOWN).
667
- * - `invalidate` fires on INVALIDATE (spec v0.4 graph-wide flush signal).
668
- *
669
- * Closure access: both forms are declared inside `NodeFn`, so hooks see the
670
- * same closure as the fn body (per-run locals, `ctx.store`, dep refs).
671
- */
672
- type NodeFnCleanup = (() => void) | {
673
- beforeRun?: () => void;
674
- deactivate?: () => void;
675
- invalidate?: () => void;
676
- };
677
- /**
678
- * Fn-time context exposing per-wave metadata and a per-node persistent
679
- * scratch pad.
680
- *
681
- * - `prevData[i]` — last DATA value from dep `i` as of the END of the
682
- * previous wave (i.e. the value that was stable before this wave started).
683
- * Use as the fallback when `data[i]` is `undefined` (not involved) or
684
- * `[]` (RESOLVED, no new values this wave).
685
- * `undefined` means dep `i` has never produced DATA (sentinel state).
686
- * `null` is a valid DATA value. `undefined` is not a valid DATA value —
687
- * the protocol reserves it as the "never sent" sentinel.
688
- * - `ctx.prevData[i] === undefined` → dep has never produced DATA
689
- * - `ctx.prevData[i] !== undefined` → last DATA value (may be `null`)
690
- * - `terminalDeps[i]` — runtime shape:
691
- * - `undefined` → dep `i` is still live.
692
- * - `true` → dep `i` sent COMPLETE.
693
- * - anything else → dep `i` sent ERROR, value is the error payload.
694
- * Type is `readonly unknown[]` because `true | unknown` collapses to
695
- * `unknown` anyway; the three states are documented contract, not type.
696
- * - `store` — mutable bag that persists across fn runs within one activation
697
- * cycle. Wiped on deactivation and on resubscribable terminal reset.
698
- */
699
- interface FnCtx {
700
- readonly prevData: readonly unknown[];
701
- readonly terminalDeps: readonly unknown[];
702
- readonly store: Record<string, unknown>;
703
- }
704
- /**
705
- * Compute function passed to `node(deps, fn, opts?)`.
706
- *
707
- * `data[i]` holds the batch of DATA values received from dep `i` during the
708
- * current wave. Shape contract:
709
- * - `undefined` — dep `i` was not involved in this wave (no DIRTY received).
710
- * - `[]` — dep `i` was involved (dirtied), but settled as RESOLVED (value
711
- * unchanged). Use `ctx.prevData[i]` to read its last known value from the
712
- * previous wave.
713
- * - `[v1, v2, ...]` — dep `i` sent one or more DATA values. `at(-1)` gives
714
- * the latest; iterate for multi-emission processing.
715
- *
716
- * Emission is explicit via `actions.emit(v)` (sugar: equals + framing) or
717
- * `actions.down(msgs)` (raw). Return a cleanup shape to register teardown:
718
- * `() => void` (fires on every transition) or
719
- * `{ beforeRun?, deactivate?, invalidate? }` (each hook fires on its named
720
- * transition only). See {@link NodeFnCleanup}. Any non-cleanup return value
721
- * is ignored. The `| void` leg lets arrow-block bodies satisfy `NodeFn`
722
- * without an explicit `return undefined`.
723
- *
724
- * Sugar constructors (`derived`, `effect`, `dynamicNode`) unwrap `data[i]`
725
- * to a single scalar (`at(-1)` with `ctx.prevData[i]` fallback) so their
726
- * user-facing fn signatures stay unchanged. Use raw `node()` when you need
727
- * the full batch array.
728
- */
729
- type NodeFn = (data: readonly (readonly unknown[] | undefined)[], actions: NodeActions, ctx: FnCtx) => NodeFnCleanup | void;
730
- /** Options accepted by every node constructor. */
731
- interface NodeOptions<T = unknown> {
732
- name?: string;
733
- describeKind?: NodeDescribeKind;
734
- equals?: (a: T, b: T) => boolean;
735
- /**
736
- * Pre-populate the cache at construction. `null` is a valid initial value.
737
- * `undefined` is treated as absent (not a valid DATA payload).
738
- */
739
- initial?: T | null;
740
- meta?: Record<string, unknown>;
741
- resubscribable?: boolean;
742
- resetOnTeardown?: boolean;
743
- /** Auto-emit `[[COMPLETE]]` when all deps complete. Default `true`. */
744
- completeWhenDepsComplete?: boolean;
745
- /**
746
- * Auto-propagate `[[ERROR]]` when any dep errors. Default `true`.
747
- * Set `false` only for rescue/catchError operators that handle errors
748
- * explicitly via `ctx.terminalDeps`.
749
- */
750
- errorWhenDepsError?: boolean;
751
- /**
752
- * First-run gate (§2.7). When `false` (default — matches the universal
753
- * contract "fn does not fire until every declared dep has delivered"), fn
754
- * is held until every declared dep has delivered at least one DATA or
755
- * terminal. Sugar constructors (`derived`, `effect`) inherit the default
756
- * so multi-parent activation produces one combined initial wave
757
- * `[[START], [DIRTY], [DATA, fn(init...)]]` instead of the sequential
758
- * `[[START], [DIRTY], [RESOLVED], [DIRTY], [DATA]]` shape produced by
759
- * per-dep push-on-subscribe firings.
760
- *
761
- * When `true`, fn fires as soon as `_dirtyDepCount === 0` regardless of
762
- * whether any dep is still sentinel. Operators like `withLatestFrom`,
763
- * `valve`, and worker-bridge aggregators that deliberately fire on
764
- * partial deps pass `partial: true` explicitly. Zero-dep producer-pattern
765
- * factories (`stratify`, `budgetGate`, etc.) are unaffected either way —
766
- * an empty `_deps` array has nothing for the gate to hold on.
767
- *
768
- * Gate scope: applies only until fn has fired once (`_hasCalledFnOnce`).
769
- * Subsequent waves, INVALIDATE, and `_addDep` do not re-gate. Terminal
770
- * reset (resubscribable node reconnect) resets `_hasCalledFnOnce` and
771
- * re-arms the gate.
772
- */
773
- partial?: boolean;
774
- /**
775
- * Tier-2 PAUSE/RESUME handling.
776
- * - `true` (default): wave completion suppressed while paused; fn fires
777
- * once on RESUME if gate is satisfied.
778
- * - `false`: node ignores PAUSE (sources like timers that must keep running).
779
- * - `"resumeAll"`: on RESUME, replay every buffered DATA (future).
780
- */
781
- pausable?: boolean | "resumeAll";
782
- guard?: NodeGuard;
783
- versioning?: VersioningLevel;
784
- versioningId?: string;
785
- versioningHash?: HashFn;
786
- /**
787
- * Override the config instance this node binds to. Defaults to
788
- * {@link defaultConfig}. Useful for test isolation and custom protocol
789
- * stacks. The first node that reads any hook on the config freezes it.
790
- */
791
- config?: GraphReFlyConfig;
792
- }
793
- /** A reactive node in the GraphReFly protocol. */
794
- interface Node<T = unknown> {
795
- readonly name?: string;
796
- readonly status: NodeStatus;
797
- /**
798
- * Current cached value. Returns `undefined` when the node is in
799
- * `"sentinel"` state (no DATA ever emitted). v5 reserves `undefined`
800
- * globally as the sentinel value — the valid DATA type is `T | null`.
801
- * Therefore `node.cache === undefined` is a valid "never emitted" guard.
802
- * `node.status` distinguishes the richer states (`"sentinel"`,
803
- * `"settled"`, `"errored"`, etc.) when you need more than has-value.
804
- */
805
- readonly cache: T | null | undefined;
806
- readonly meta: Record<string, Node>;
807
- readonly lastMutation: Readonly<{
808
- actor: Actor;
809
- timestamp_ns: number;
810
- }> | undefined;
811
- readonly v: Readonly<NodeVersionInfo> | undefined;
812
- /**
813
- * Send one or more messages downstream. Accepts either a single
814
- * {@link Message} tuple (e.g. `node.down([DATA, 42])`) or a
815
- * {@link Messages} array of tuples (e.g.
816
- * `node.down([[DIRTY], [DATA, 42]])`). One call = one wave: the
817
- * emit pipeline tier-sorts the input, auto-prefixes `[DIRTY]` when
818
- * any tier-3 payload is present and the node is not already dirty,
819
- * runs equals substitution against the live cache (§3.5.1), then
820
- * dispatches to sinks with phase deferral.
821
- */
822
- down(messageOrMessages: Message | Messages, options?: NodeTransportOptions): void;
823
- /**
824
- * Sugar for `down([[DATA, value]])`. One wave with a single DATA
825
- * payload — the pipeline adds the synthetic DIRTY prefix and runs
826
- * equals substitution against the live cache.
827
- */
828
- emit(value: T | undefined | null, options?: NodeTransportOptions): void;
829
- /**
830
- * Send one or more messages upstream. Accepts the same shapes as
831
- * {@link down}. Upstream messages are tier <3 + tier 5 only
832
- * (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN); tier-3/4 payloads
833
- * throw — DATA/RESOLVED/COMPLETE/ERROR are downstream-only in this
834
- * protocol. No equals substitution, no cache advance, no DIRTY
835
- * auto-prefix — the up direction just forwards to every dep.
836
- */
837
- up?(messageOrMessages: Message | Messages, options?: NodeTransportOptions): void;
838
- subscribe(sink: NodeSink, actor?: Actor): () => void;
839
- allowsObserve(actor: Actor): boolean;
840
- hasGuard(): boolean;
841
- }
842
- /**
843
- * Per-dep runtime state. One entry per upstream node.
844
- *
845
- * `terminal` is the single terminal-state slot, shaped to match
846
- * {@link FnCtx.terminalDeps}:
847
- * - `undefined` — dep is still live.
848
- * - `true` — dep sent COMPLETE.
849
- * - anything else — dep sent ERROR with that payload.
850
- *
851
- * `[ERROR, undefined]` is rejected at the dispatch boundary (`_emit`) per
852
- * spec §1.2 — `undefined` would collide with the "live" encoding here.
853
- * Always pass meaningful error values (Error objects, domain tags).
854
- */
855
- interface DepRecord {
856
- readonly node: Node;
857
- unsub: (() => void) | null;
858
- /**
859
- * Last DATA value from this dep as of the end of the previous completed
860
- * wave. `undefined` until dep has produced at least one DATA (sentinel).
861
- * Committed by `_execFn` after snapshotting `ctx.prevData` and before
862
- * `_clearWaveFlags`. `undefined` is reserved as the "never sent" sentinel —
863
- * `undefined` is not a valid DATA payload.
864
- */
865
- prevData: unknown;
866
- /** True while awaiting DATA/RESOLVED for the current wave. */
867
- dirty: boolean;
868
- /**
869
- * True if this dep was dirtied in the current wave (set in `_depDirtied`,
870
- * cleared in `_clearWaveFlags`). Distinguishes "RESOLVED" (`involvedThisWave
871
- * && dataBatch.length === 0`) from "not involved" (`!involvedThisWave`) in
872
- * the `data[i]` batch snapshot passed to fn.
873
- */
874
- involvedThisWave: boolean;
875
- /**
876
- * DATA values accumulated from this dep during the current wave.
877
- * Populated by `_depSettledAsData`, cleared by `_clearWaveFlags`.
878
- * Snapshotted (copied) by `_execFn` before `_clearWaveFlags` runs so
879
- * that fn always sees the full wave batch.
880
- */
881
- dataBatch: unknown[];
882
- /** Terminal-state slot — see JSDoc on {@link DepRecord}. */
883
- terminal: unknown;
884
- }
885
- /**
886
- * Default {@link GraphReFlyConfig} instance. Every `NodeImpl` constructed
887
- * without an explicit `opts.config` binds to this instance and freezes it
888
- * on first hook access.
889
- */
890
- declare const defaultConfig: GraphReFlyConfig;
891
- /**
892
- * Apply configuration to {@link defaultConfig}. Must be called before the
893
- * first node is created — otherwise throws. Custom message types, hook
894
- * overrides, etc. go through here at app startup.
895
- *
896
- * ```ts
897
- * configure((cfg) => {
898
- * cfg.registerMessageType(MY_TYPE, { tier: 3 });
899
- * cfg.onMessage = (node, msg, ctx, actions) => { ... };
900
- * });
901
- * ```
902
- */
903
- declare function configure(fn: (cfg: GraphReFlyConfig) => void): void;
904
-
905
- /**
906
- * Single-class node implementation. Covers state, producer, derived, effect,
907
- * and passthrough shapes. See `sugar.ts` for ergonomic factories and
908
- * `dynamicNode()` (sugar-level wrapper around plain `NodeImpl`).
909
- */
910
- declare class NodeImpl<T = unknown> implements Node<T> {
911
- readonly _optsName: string | undefined;
912
- readonly _describeKind: NodeDescribeKind | undefined;
913
- readonly meta: Record<string, Node>;
914
- /**
915
- * Cached `Object.keys(meta).length > 0` check. `meta` is frozen at
916
- * construction so this boolean never flips. Used by `_emit` to skip
917
- * the meta TEARDOWN fan-out block allocation on the common "no meta"
918
- * hot path.
919
- */
920
- readonly _hasMeta: boolean;
921
- readonly _config: GraphReFlyConfig;
922
- /** Mutable for autoTrackNode / Graph.connect() post-construction dep addition. */
923
- _deps: DepRecord[];
924
- _sinks: NodeSink | Set<NodeSink> | null;
925
- _sinkCount: number;
926
- _cached: T | undefined;
927
- _status: NodeStatus;
928
- _cleanup: NodeFnCleanup | undefined;
929
- _store: Record<string, unknown>;
930
- _waveHasNewData: boolean;
931
- _hasNewTerminal: boolean;
932
- _hasCalledFnOnce: boolean;
933
- _paused: boolean;
934
- _pendingWave: boolean;
935
- _isExecutingFn: boolean;
936
- _pendingRerun: boolean;
937
- _rerunDepth: number;
938
- /**
939
- * Count of deps currently in `dirty === true`. `_maybeRunFnOnSettlement`
940
- * treats `0` as "wave settled" — O(1) check for full dep settlement.
941
- */
942
- _dirtyDepCount: number;
943
- /**
944
- * Inside an explicit `batch(() => ...)` scope, every `_emit` accumulates
945
- * its already-framed messages here instead of dispatching synchronously.
946
- * At batch end, `_flushBatchPending` runs (registered via
947
- * `registerBatchFlushHook`) and delivers the whole accumulated batch as
948
- * one `downWithBatch` call — collapsing what would otherwise be K
949
- * separate sink invocations into one. This is the fix for the diamond
950
- * fan-in K+1 over-fire.
951
- *
952
- * `null` outside batch (or after flush). Only ever appended to within
953
- * a single explicit batch lifetime; reset to `null` on flush. State
954
- * updates (cache, version, status) still happen per-emit via
955
- * `_updateState` — only the downstream delivery is coalesced.
956
- */
957
- _batchPendingMessages: Message[] | null;
958
- /**
959
- * Set of active pause locks held against this node. Every `[PAUSE, lockId]`
960
- * adds its `lockId` to the set; every `[RESUME, lockId]` removes it.
961
- * `_paused` is a derived quantity: `_pauseLocks.size > 0`. Multi-pauser
962
- * correctness — one controller releasing its lock does NOT resume the
963
- * node while another controller still holds its lock.
964
- */
965
- _pauseLocks: Set<unknown> | null;
966
- /**
967
- * Buffered DATA messages held while paused. Only populated when
968
- * `_pausable === "resumeAll"` (bufferAll mode). On final lock release
969
- * the buffer is replayed through the node's outgoing pipeline in the
970
- * order received. Non-bufferAll pause mode drops DATA on the floor
971
- * (upstream is expected to honor PAUSE by suppressing production).
972
- */
973
- _pauseBuffer: Message[] | null;
974
- readonly _fn: NodeFn | undefined;
975
- readonly _equals: (a: T, b: T) => boolean;
976
- readonly _resubscribable: boolean;
977
- readonly _resetOnTeardown: boolean;
978
- readonly _autoComplete: boolean;
979
- readonly _autoError: boolean;
980
- readonly _pausable: boolean | "resumeAll";
981
- /**
982
- * @internal First-run-gate override. `false` (default) holds fn until every
983
- * dep has delivered DATA or a terminal — spec §2.7 first-run gate. `true`
984
- * disables the gate; fn fires as soon as `_dirtyDepCount === 0`, regardless
985
- * of dep sentinel state. Operators that need partial firing
986
- * (`withLatestFrom`, `valve`, worker-bridge aggregators) pass
987
- * `partial: true` explicitly at construction.
988
- */
989
- readonly _partial: boolean;
990
- readonly _guard: NodeGuard | undefined;
991
- /**
992
- * @internal Additional guards stacked at runtime via {@link NodeImpl._pushGuard}
993
- * (e.g. by `policyGate({ mode: "enforce" })`, roadmap §9.2). Effective
994
- * write/signal/observe checks AND the original `_guard` with every entry here.
995
- */
996
- _extraGuards: Set<NodeGuard> | undefined;
997
- _hashFn: HashFn;
998
- _versioning: NodeVersionInfo | undefined;
999
- /**
1000
- * Explicit versioning level, tracked separately from `_versioning` so
1001
- * monotonicity checks and future v2/v3 extensions don't rely on the
1002
- * fragile `"cid" in _versioning` shape discriminator. `undefined` means
1003
- * the node has no versioning attached; `0` / `1` / future levels name
1004
- * the tier. Mutated in lockstep with `_versioning` by the constructor
1005
- * and by `_applyVersioning`.
1006
- */
1007
- _versioningLevel: VersioningLevel | undefined;
1008
- _lastMutation: {
1009
- actor: Actor;
1010
- timestamp_ns: number;
1011
- } | undefined;
1012
- /**
1013
- * @internal Per-node inspector hooks for `Graph.observe(path,
1014
- * { causal, derived })`. Fires in `_onDepMessage` and `_execFn`.
1015
- * Attached via `_setInspectorHook` (returns a disposer). Multiple
1016
- * observers can attach simultaneously — all registered hooks fire for
1017
- * every event.
1018
- */
1019
- _inspectorHooks: Set<NodeInspectorHook> | undefined;
1020
- readonly _actions: NodeActions;
1021
- constructor(deps: readonly Node[], fn: NodeFn | undefined, opts: NodeOptions<T>);
1022
- private get _isTerminal();
1023
- get name(): string | undefined;
1024
- get status(): NodeStatus;
1025
- get cache(): T | undefined | null;
1026
- get lastMutation(): Readonly<{
1027
- actor: Actor;
1028
- timestamp_ns: number;
1029
- }> | undefined;
1030
- get v(): Readonly<NodeVersionInfo> | undefined;
1031
- hasGuard(): boolean;
1032
- /**
1033
- * @internal Retroactively attach (or upgrade) versioning state on this
1034
- * node. Intended for `Graph.setVersioning(level)` bulk application and
1035
- * for rare cases where a specific node needs to be bumped to a higher
1036
- * level (e.g., `v0 → v1`) after construction.
1037
- *
1038
- * **Safety:** the mutation is rejected mid-wave. Specifically,
1039
- * throws if the node is currently executing its fn (`_isExecutingFn`).
1040
- * Callers at quiescent points — before the first sink subscribes, or
1041
- * after all sinks unsubscribe, or between external `down()` / `emit()`
1042
- * invocations — are safe. The re-entrance window that motivated §10.6.4
1043
- * removal was the "transition `_versioning` from `undefined` to a fresh
1044
- * object mid-`_updateState`" case; that path is now guarded.
1045
- *
1046
- * **Monotonicity:** levels can only go up. Downgrade (e.g., `v1 → v0`)
1047
- * is a no-op — once a node carries higher-level metadata, dropping it
1048
- * mid-graph would tear the linked-history invariant for v1 and above.
1049
- *
1050
- * **Linked-history boundary (D1, 2026-04-13):** upgrading v0 → v1
1051
- * produces a **fresh history root**. The new v1 state has `cid =
1052
- * hash(currentCachedValue)` and `prev = null`, not a synthetic `prev`
1053
- * anchored to any previous v0 value. The v0 monotonic `version` counter
1054
- * is preserved across the upgrade, but the linked-cid chain (spec §7)
1055
- * starts fresh at the upgrade point. Downstream audit tools that walk
1056
- * `v.cid.prev` backwards through time will see a `null` boundary at
1057
- * the upgrade — **this is intentional**: v0 had no cid to link to, and
1058
- * fabricating one would lie about the hash. Callers that require an
1059
- * unbroken cid chain from birth must attach versioning at construction
1060
- * via `opts.versioning` or `config.defaultVersioning`, not retroactively.
1061
- *
1062
- * @param level - New minimum versioning level.
1063
- * @param opts - Optional id / hash overrides; applied only if the
1064
- * node currently has no versioning state.
1065
- */
1066
- _applyVersioning(level: VersioningLevel, opts?: {
1067
- id?: string;
1068
- hash?: HashFn;
1069
- }): void;
1070
- /**
1071
- * @internal Attach an inspector hook. Returns a disposer that removes
1072
- * the hook. Used by `Graph.observe(path, { causal, derived })` to build
1073
- * causal traces. Multiple hooks may be attached concurrently — all fire
1074
- * for every event in registration order. Passing `undefined` is a no-op
1075
- * and returns a no-op disposer.
1076
- */
1077
- _setInspectorHook(hook?: NodeInspectorHook): () => void;
1078
- /**
1079
- * @internal Push an additional guard onto this node. Effective enforcement
1080
- * is the AND of `_guard` and every guard pushed via this hook — any one
1081
- * rejecting throws {@link GuardDenied}. Returns a disposer that removes
1082
- * the pushed guard. Multiple guards may be stacked simultaneously.
1083
- *
1084
- * Used by `policyGate({ mode: "enforce" })` (roadmap §9.2) to overlay
1085
- * runtime constraint enforcement onto an existing graph without rebuilding
1086
- * its nodes. Pre-1.0 internal API; not part of the public surface.
1087
- *
1088
- * **Identity semantics:** guards are tracked in a `Set`, so pushing the
1089
- * same `NodeGuard` reference twice is a single registration. Wrap each
1090
- * push in a unique closure if independent stacking is needed.
1091
- *
1092
- * **Iteration order:** insertion-ordered (`Set` semantics). Determinism
1093
- * follows from single-threaded JS execution; nested re-entry from inside
1094
- * a guard body (push/pop while iterating) is undefined-but-survivable.
1095
- */
1096
- _pushGuard(guard: NodeGuard): () => void;
1097
- allowsObserve(actor: Actor): boolean;
1098
- private _checkGuard;
1099
- down(messageOrMessages: Message | Messages, options?: NodeTransportOptions): void;
1100
- emit(value: T | undefined | null, options?: NodeTransportOptions): void;
1101
- /**
1102
- * Upstream forward (spec §1.4). Carries tier-1/2/5 control-plane only:
1103
- * DIRTY (tier 1), PAUSE/RESUME (tier 2), INVALIDATE/TEARDOWN (tier 5).
1104
- * Tier-3/4 (DATA/RESOLVED/COMPLETE/ERROR) are rejected by
1105
- * `_validateUpTiers` — downstream-only by protocol.
1106
- *
1107
- * **Upstream-origin PAUSE applies at the PARENT's lockset via the parent's
1108
- * own `up()`, not at this source's `_pauseLocks` when `_deps.length === 0`.**
1109
- * At a leaf source, `up()` is a no-op: a subscription that calls
1110
- * `sink.up([[PAUSE, lockId]])` expecting the source itself to pause is
1111
- * NOT honored today. TLA+ `DeliverUp` encodes the target contract (source
1112
- * applies its own lock); the runtime falls short. No in-tree caller relies
1113
- * on upstream-origin PAUSE at a leaf, so this is documented as intentional
1114
- * for now (option (c) in docs/optimizations.md "Up-direction PAUSE
1115
- * semantics"). A future option (a) would tighten the runtime here; any
1116
- * new consumer needing leaf-source upstream PAUSE is the trigger.
1117
- *
1118
- * **LockId uniqueness is the caller's responsibility.** Locks are stored
1119
- * in a `Set<unknown>`; `Pause(n, 10)` and an upstream `UpPause(child, 10)`
1120
- * that reaches `n` insert the SAME element — one `Resume(n, 10)` clears
1121
- * both origins. Distinct pauser identities must use distinct lockIds.
1122
- * Surfaced by the rigor-infra TLC audit (docs/optimizations.md "LockId
1123
- * collision across up() and down() origin").
1124
- */
1125
- up(messageOrMessages: Message | Messages, options?: NodeTransportOptions): void;
1126
- /**
1127
- * @internal Internal up-path used by `actions.up(...)` from inside fn.
1128
- * Same tier validation as public `up`, but bypasses the guard check
1129
- * since the fn context is already inside an authorized operation.
1130
- */
1131
- private _emitUp;
1132
- /**
1133
- * @internal Enforce spec §1.2 — up-direction messages are restricted to
1134
- * tier 0–2 and tier 5 (START, DIRTY, INVALIDATE, PAUSE, RESUME,
1135
- * TEARDOWN). Tier 3 (DATA/RESOLVED) and tier 4 (COMPLETE/ERROR) are
1136
- * downstream-only. Emitting tier-3/4 via `up` would bypass equals
1137
- * substitution and cache advance entirely and is a protocol bug.
1138
- */
1139
- private _validateUpTiers;
1140
- subscribe(sink: NodeSink, actor?: Actor): () => void;
1141
- private _removeSink;
1142
- /**
1143
- * @internal First-sink activation. For a producer (no deps + fn),
1144
- * invokes fn once. For a compute node (has deps), subscribes to every
1145
- * dep with the pre-set-dirty trick so the first-run gate waits for
1146
- * every dep to settle at least once.
1147
- */
1148
- _activate(): void;
1149
- /**
1150
- * @internal Append a dep post-construction. Used by `autoTrackNode`
1151
- * (runtime dep discovery) and `Graph.connect()` (post-construction
1152
- * wiring). Subscribes immediately — if DATA arrives synchronously
1153
- * during subscribe and fn is currently executing, the re-run is
1154
- * deferred via `_pendingRerun` flag (see `_execFn` guard).
1155
- *
1156
- * **Dedup:** idempotent on duplicate `depNode` — if `depNode` is
1157
- * already in `_deps`, returns the existing index without mutating
1158
- * state. Callers can safely invoke `_addDep` without their own
1159
- * "already added" check. `autoTrackNode` still keeps a `depIndexMap`
1160
- * as a fast-path lookup for known deps (returning cached `data[idx]`
1161
- * without calling `_addDep` at all); this internal dedup is the
1162
- * backstop for any caller that doesn't track its own dep set.
1163
- *
1164
- * @returns The index of the new dep in `_deps`, or the existing index
1165
- * if the dep was already present.
1166
- */
1167
- _addDep(depNode: Node): number;
1168
- /**
1169
- * @internal Unsubscribes from deps, fires fn cleanup (both shapes),
1170
- * clears wave/store state, and (for compute nodes) drops `_cached` per
1171
- * the ROM/RAM rule. Idempotent: second call is a no-op.
1172
- *
1173
- * @param skipStatusUpdate — When `true`, the caller takes responsibility
1174
- * for setting `_status` after deactivation (e.g. TEARDOWN always sets
1175
- * `"sentinel"` unconditionally). When `false` (default), deactivation
1176
- * applies the ROM rule: compute nodes → `"sentinel"`, state nodes
1177
- * preserve their current status.
1178
- */
1179
- _deactivate(skipStatusUpdate?: boolean): void;
1180
- /**
1181
- * @internal Default per-tier dispatch for incoming dep messages. Called
1182
- * by `defaultOnMessage`. Updates the DepRecord, triggers wave
1183
- * completion, and forwards passthrough traffic.
1184
- */
1185
- _onDepMessage(depIndex: number, msg: Message): void;
1186
- /**
1187
- * Called when a dep transitions `dirty: false → true` (either from an
1188
- * incoming DIRTY, or pre-set during `_activate` / `_addDep` /
1189
- * `_depInvalidated`). No-op if the dep is already dirty. Fires the
1190
- * downstream DIRTY emit if we're the first to dirty this wave.
1191
- */
1192
- private _depDirtied;
1193
- /**
1194
- * Called when a dep delivers new DATA: clears dirty, stores the payload,
1195
- * marks wave-has-data, and — if this is the dep's first DATA — clears
1196
- * its sentinel slot so the first-run gate can open.
1197
- */
1198
- private _depSettledAsData;
1199
- /**
1200
- * Called when a dep emits RESOLVED (wave settled, value unchanged).
1201
- * Clears dirty; does NOT touch `prevData` / `terminal` / sentinel
1202
- * count — sentinel only exits on first DATA or terminal, not RESOLVED.
1203
- */
1204
- private _depSettledAsResolved;
1205
- /**
1206
- * Called when a dep delivers COMPLETE (`terminal = true`) or ERROR
1207
- * (`terminal = errorPayload`). Clears dirty, stores the terminal, and
1208
- * — if the dep had never contributed a DATA yet — leaves sentinel
1209
- * since the gate treats "terminated without data" as gate-open too.
1210
- */
1211
- private _depSettledAsTerminal;
1212
- /**
1213
- * Called when a dep emits INVALIDATE: clears prevData, terminal, and
1214
- * dataBatch. The dep is now back in the "never delivered a real value"
1215
- * state — `prevData === undefined` so the sentinel check in fn will fire.
1216
- */
1217
- private _depInvalidated;
1218
- private _maybeRunFnOnSettlement;
1219
- private _maybeAutoTerminalAfterWave;
1220
- /**
1221
- * @internal Runs the node fn once.
1222
- *
1223
- * Cleanup firing:
1224
- * - Function-form cleanup — fires here (pre-run) AND on deactivation AND
1225
- * on INVALIDATE. Cleared before the new fn runs.
1226
- * - Object-form cleanup — only `beforeRun` fires here; `deactivate` and
1227
- * `invalidate` hooks survive across re-runs. The cleanup reference
1228
- * itself is preserved so `deactivate`/`invalidate` still fire later.
1229
- */
1230
- private _execFn;
1231
- private _clearWaveFlags;
1232
- private _wrapFnError;
1233
- /**
1234
- * @internal Stable tier sort + synthetic DIRTY prefix for an outgoing
1235
- * batch. Fast path: already-monotone single-tier batches (the common
1236
- * case from interned singletons like `DIRTY_ONLY_BATCH`) return the
1237
- * input unchanged. General path: decorate-sort-undecorate into a new
1238
- * array, then prepend `[DIRTY]` after any tier-0 START entries when
1239
- * a tier-3 payload is present and the node isn't already dirty.
1240
- *
1241
- * Single source of truth for the spec §1.3.1 framing invariant. Every
1242
- * outgoing path hits `_frameBatch` exactly once via `_emit`.
1243
- */
1244
- private _frameBatch;
1245
- /**
1246
- * @internal The unified dispatch waist — one call = one wave.
1247
- * See `GRAPHREFLY-SPEC.md` §1.3.1 for protocol context — the stages
1248
- * below are the implementation order.
1249
- *
1250
- * Pipeline stages, in order:
1251
- *
1252
- * 1. Terminal filter — post-COMPLETE/ERROR only TEARDOWN/INVALIDATE
1253
- * still propagate so graph teardown and cache-clear still work.
1254
- * 2. Tier sort (stable) — the batch can be in any order when it
1255
- * arrives; the walker downstream (`downWithBatch`) assumes
1256
- * ascending tier monotone, and so does `_updateState`'s tier-3
1257
- * slice walk. This is the single source of truth for ordering.
1258
- * 3. Synthetic DIRTY prefix — if a tier-3 payload is present, no
1259
- * DIRTY is already in the batch, and the node isn't already in
1260
- * `"dirty"` status, prepend `[DIRTY]` after any tier-0 START
1261
- * entries. Guarantees spec §1.3.1 (DIRTY precedes DATA within
1262
- * the same batch) uniformly across every entry point.
1263
- * 4. PAUSE/RESUME lock bookkeeping (C0) — update `_pauseLocks`,
1264
- * derive `_paused`, filter unknown-lockId RESUME, replay
1265
- * bufferAll buffer on final lock release.
1266
- * 5. Meta TEARDOWN fan-out — notify meta children before
1267
- * `_updateState`'s TEARDOWN branch calls `_deactivate`. Hoisted
1268
- * out of the walk to keep `_updateState` re-entrance-free.
1269
- * 6. `_updateState` — walk the batch in tier order, advancing
1270
- * `_cached` / `_status` / `_versioning` and running equals
1271
- * substitution on tier-3 DATA (§3.5.1). Returns
1272
- * `{finalMessages, equalsError?}`.
1273
- * 7. `downWithBatch` dispatch (or bufferAll capture if paused with
1274
- * `pausable: "resumeAll"`).
1275
- * 8. Recursive ERROR emission if equals threw mid-walk.
1276
- */
1277
- _emit(messages: Messages): void;
1278
- /**
1279
- * @internal Walk an outgoing (already-framed) batch, updating own
1280
- * cache / status / versioning and running equals substitution on
1281
- * every tier-3 DATA (§3.5.1). Framing — tier sort and synthetic
1282
- * DIRTY prefix — has already happened upstream in `_frameBatch`.
1283
- * This walk trusts the input is in monotone tier order and that the
1284
- * spec §1.3.1 DIRTY/RESOLVED precedence invariant is already
1285
- * satisfied by the frame.
1286
- *
1287
- * Equals substitution: every DATA payload is compared against the
1288
- * live `_cached`; when equal, the tuple is rewritten to `[RESOLVED]`
1289
- * in a per-call copy and cache is not re-advanced. `.cache` remains
1290
- * coherent with "the last DATA payload this node actually sent
1291
- * downstream".
1292
- *
1293
- * Returns `{ finalMessages, equalsError? }`:
1294
- * - `finalMessages` — the array to deliver to sinks (may be
1295
- * `messages` unchanged, a rewritten copy with DATA→RESOLVED
1296
- * substitutions, or a truncated prefix when equals throws mid-walk).
1297
- * - `equalsError` — present only when the configured `equals` function
1298
- * threw on some DATA message. `_emit` delivers the prefix first,
1299
- * then emits a fresh ERROR batch via a recursive `_emit` call so
1300
- * subscribers observe `[...walked_prefix, ERROR]` in order.
1301
- */
1302
- private _updateState;
1303
- private _deliverToSinks;
1304
- /**
1305
- * @internal Dispatch entry point that respects the per-batch emit
1306
- * accumulator (Bug 2). Inside an explicit `batch()` scope, append to
1307
- * `_batchPendingMessages` and register a flush hook on first append.
1308
- * Outside batch — or during a drain (where `flushInProgress` is true
1309
- * but `batchDepth` is 0) — dispatch synchronously through `downWithBatch`.
1310
- *
1311
- * Per-emit state updates (`_frameBatch`, `_updateState`) have already
1312
- * happened by the time we reach here; only the **downstream delivery**
1313
- * is coalesced. Cache, version, and status are visible mid-batch on
1314
- * the emitting node itself.
1315
- */
1316
- private _dispatchOrAccumulate;
1317
- /**
1318
- * @internal Flushes the accumulated batch through `downWithBatch` and
1319
- * clears the pending state. Idempotent — safe to call when pending is
1320
- * already null or empty (e.g. on a `batch()` throw, where the hook
1321
- * fires for cleanup but the drainPhase queues are wiped after).
1322
- *
1323
- * Critical: the accumulated batch is interleaved per-emit framings like
1324
- * `[DIRTY, DATA(1), DIRTY, DATA(2)]` — non-monotone tier order. We must
1325
- * re-frame to sort by tier before handing to `downWithBatch`, which
1326
- * assumes pre-sorted input. `_frameBatch` also handles the synthetic
1327
- * DIRTY prepend rule (no-op here — `hasDirty` is true since each
1328
- * accumulated emit already carries its own DIRTY prefix).
1329
- */
1330
- private _flushBatchPending;
1331
- }
1332
- /**
1333
- * Creates a reactive {@link Node} — the single GraphReFly primitive (§2).
1334
- *
1335
- * Typical shapes:
1336
- * - `node([])` / `node({ initial: v })` — a manual source (state node).
1337
- * - `node(producerFn, opts)` — a producer that runs on first-subscribe.
1338
- * - `node(deps, computeFn, opts)` — a derived / effect node.
1339
- *
1340
- * For value-returning computations, prefer the sugar factories in `sugar.ts`
1341
- * (`state`, `derived`, `effect`, `producer`, `dynamicNode`), which wrap user
1342
- * fns with `actions.emit(userFn(data))`. Calling `node()` directly gives you
1343
- * the raw `NodeFn` contract: explicit emission via `actions`, cleanup return.
1344
- */
1345
- declare function node<T = unknown>(depsOrFn?: readonly Node[] | NodeFn | NodeOptions<T>, fnOrOpts?: NodeFn | NodeOptions<T>, optsArg?: NodeOptions<T>): Node<T>;
1346
-
1347
- export { type RigorRecorder as $, type Actor as A, type NodeInspectorHook as B, COMPLETE as C, DATA as D, ERROR as E, type FnCtx as F, type GlobalInspectorEvent as G, type HashFn as H, INVALIDATE as I, type NodeInspectorHookEvent as J, type NodeSink as K, type NodeStatus as L, type Messages as M, type Node as N, type NodeTransportOptions as O, type NodeVersionInfo as P, type OnMessageHandler as Q, type OnSubscribeHandler as R, PAUSE as S, type PolicyAllow as T, type PolicyDeny as U, type VersioningLevel as V, type PolicyRuleData as W, RESOLVED as X, RESOLVED_MSG as Y, RESOLVED_ONLY_BATCH as Z, RESUME as _, type NodeOptions as a, START as a0, START_MSG as a1, type SubscribeContext as a2, TEARDOWN as a3, TEARDOWN_MSG as a4, TEARDOWN_ONLY_BATCH as a5, type V0 as a6, type V1 as a7, type VersioningOptions as a8, accessHintForGuard as a9, advanceVersion as aa, configure as ab, createVersioning as ac, defaultConfig as ad, defaultHash as ae, isV1 as af, node as ag, normalizeActor as ah, policy as ai, policyFromRules as aj, registerBuiltins as ak, type NodeGuard as b, type NodeActions as c, COMPLETE_MSG as d, COMPLETE_ONLY_BATCH as e, DEFAULT_ACTOR as f, DIRTY as g, DIRTY_MSG as h, DIRTY_ONLY_BATCH as i, type DepRecord as j, type GlobalInspectorHook as k, GraphReFlyConfig as l, type GuardAction as m, GuardDenied as n, type GuardDeniedDetails as o, INVALIDATE_MSG as p, INVALIDATE_ONLY_BATCH as q, type Message as r, type MessageContext as s, type MessageTypeRegistration as t, type MessageTypeRegistrationInput as u, type NodeCtx as v, type NodeDescribeKind as w, type NodeFn as x, type NodeFnCleanup as y, NodeImpl as z };