@graphrefly/graphrefly 0.38.0 → 0.40.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 (321) hide show
  1. package/dist/budget-gate-CmmVtasH.d.ts +115 -0
  2. package/dist/budget-gate-DiP_nK0n.d.cts +115 -0
  3. package/dist/{cascading-BsJ4GbnS.d.ts → cascading-BNfxffgc.d.ts} +2 -2
  4. package/dist/{cascading-B25wxpRa.d.cts → cascading-Cxs1eztH.d.cts} +2 -2
  5. package/dist/chunk-2BX4NB34.js +3 -0
  6. package/dist/{chunk-6VFC334U.js → chunk-2DMKW2AD.js} +1 -1
  7. package/dist/{chunk-4BDQXBXE.js → chunk-2QXRYP7Q.js} +1 -1
  8. package/dist/chunk-32N3JALT.js +1 -0
  9. package/dist/chunk-35JTVPOX.js +1 -0
  10. package/dist/chunk-3G5U5QNE.js +5 -0
  11. package/dist/{chunk-PHXZRR6C.js → chunk-4I45FVQS.js} +1 -1
  12. package/dist/{chunk-B5S7KTGP.js → chunk-6I726LZU.js} +1 -1
  13. package/dist/{chunk-NV63VQHI.js → chunk-6VWBPSSY.js} +1 -1
  14. package/dist/chunk-6XVD5TZV.js +1 -0
  15. package/dist/chunk-756D5TFD.js +1 -0
  16. package/dist/{chunk-DSOVKKTI.js → chunk-7Q4ZD3YW.js} +1 -1
  17. package/dist/{chunk-TMVY7OWG.js → chunk-B7LCDQEV.js} +1 -1
  18. package/dist/chunk-C72GO4IZ.js +1 -0
  19. package/dist/{chunk-RZ5HKPGI.js → chunk-CKFQS2CJ.js} +1 -1
  20. package/dist/chunk-D27JNOLZ.js +1 -0
  21. package/dist/chunk-ECQRP2UT.js +1 -0
  22. package/dist/{chunk-6773HURD.js → chunk-FHRBBHJN.js} +1 -1
  23. package/dist/{chunk-UVLZX2OU.js → chunk-I2DEVPMU.js} +1 -1
  24. package/dist/chunk-INQFTVZA.js +61 -0
  25. package/dist/{chunk-6KZZ6XQE.js → chunk-J63M5U46.js} +1 -1
  26. package/dist/{chunk-POCWFIJ7.js → chunk-JKBOIJ22.js} +1 -1
  27. package/dist/chunk-K2Z7UENB.js +1 -0
  28. package/dist/chunk-L6NSJVJZ.js +1 -0
  29. package/dist/{chunk-K5C67OGE.js → chunk-LCGAVGGV.js} +2 -2
  30. package/dist/chunk-LYM4PBMV.js +1 -0
  31. package/dist/{chunk-O2BLVQU4.js → chunk-MNZIKXK4.js} +1 -1
  32. package/dist/chunk-N43XM7BM.js +1 -0
  33. package/dist/{chunk-FWGIZP3W.js → chunk-OSZ22J7O.js} +1 -1
  34. package/dist/{chunk-FAYEMS5M.js → chunk-PPUYQ66A.js} +1 -1
  35. package/dist/{chunk-SP5O2MIX.js → chunk-QSK3RRII.js} +1 -1
  36. package/dist/chunk-RZJDIV2G.js +1 -0
  37. package/dist/chunk-SSCGRYJ2.js +1 -0
  38. package/dist/chunk-SVFKHUCW.js +1 -0
  39. package/dist/chunk-TSOYJ743.js +1 -0
  40. package/dist/{chunk-O245YLM5.js → chunk-UWA6D7UF.js} +1 -1
  41. package/dist/chunk-VMF23LGB.js +1 -0
  42. package/dist/chunk-WL6LFPJB.js +1 -0
  43. package/dist/chunk-WUT362QV.js +1 -0
  44. package/dist/chunk-XJLYLLIJ.js +1 -0
  45. package/dist/{chunk-IBGE62GZ.js → chunk-XW4YDF6G.js} +1 -1
  46. package/dist/chunk-YKD7WUYJ.js +43 -0
  47. package/dist/{chunk-7KZZLWZ6.js → chunk-YXDRGKXP.js} +1 -1
  48. package/dist/chunk-Z4F3DOWS.js +84 -0
  49. package/dist/compat/index.cjs +9 -13
  50. package/dist/compat/index.d.cts +16 -16
  51. package/dist/compat/index.d.ts +16 -16
  52. package/dist/compat/index.js +1 -1
  53. package/dist/compat/jotai/index.d.cts +2 -2
  54. package/dist/compat/jotai/index.d.ts +2 -2
  55. package/dist/compat/nanostores/index.d.cts +2 -2
  56. package/dist/compat/nanostores/index.d.ts +2 -2
  57. package/dist/compat/nestjs/index.cjs +7 -11
  58. package/dist/compat/nestjs/index.d.cts +8 -8
  59. package/dist/compat/nestjs/index.d.ts +8 -8
  60. package/dist/compat/nestjs/index.js +1 -1
  61. package/dist/compat/react/index.d.cts +2 -2
  62. package/dist/compat/react/index.d.ts +2 -2
  63. package/dist/compat/solid/index.d.cts +2 -2
  64. package/dist/compat/solid/index.d.ts +2 -2
  65. package/dist/compat/svelte/index.d.cts +2 -2
  66. package/dist/compat/svelte/index.d.ts +2 -2
  67. package/dist/compat/vue/index.d.cts +2 -2
  68. package/dist/compat/vue/index.d.ts +2 -2
  69. package/dist/compat/zustand/index.cjs +3 -7
  70. package/dist/compat/zustand/index.d.cts +4 -4
  71. package/dist/compat/zustand/index.d.ts +4 -4
  72. package/dist/compat/zustand/index.js +1 -1
  73. package/dist/core/index.cjs +1 -1
  74. package/dist/core/index.d.cts +4 -4
  75. package/dist/core/index.d.ts +4 -4
  76. package/dist/core/index.js +1 -1
  77. package/dist/{composite-DTOlDuch.d.ts → decay-BnrlbxSv.d.ts} +39 -3
  78. package/dist/{composite-CgG0MqHm.d.cts → decay-C25AyNAj.d.cts} +39 -3
  79. package/dist/extra/browser.d.cts +1 -1
  80. package/dist/extra/browser.d.ts +1 -1
  81. package/dist/extra/index.cjs +16 -20
  82. package/dist/extra/index.d.cts +11 -9
  83. package/dist/extra/index.d.ts +11 -9
  84. package/dist/extra/index.js +1 -1
  85. package/dist/extra/node.cjs +2 -2
  86. package/dist/extra/node.d.cts +1 -1
  87. package/dist/extra/node.d.ts +1 -1
  88. package/dist/extra/node.js +1 -1
  89. package/dist/extra/operators.cjs +1 -1
  90. package/dist/extra/operators.d.cts +1 -1
  91. package/dist/extra/operators.d.ts +1 -1
  92. package/dist/extra/operators.js +1 -1
  93. package/dist/extra/reactive.cjs +1 -1
  94. package/dist/extra/reactive.d.cts +3 -3
  95. package/dist/extra/reactive.d.ts +3 -3
  96. package/dist/extra/reactive.js +1 -1
  97. package/dist/extra/render/index.cjs +5 -0
  98. package/dist/extra/render/index.d.cts +183 -0
  99. package/dist/extra/render/index.d.ts +183 -0
  100. package/dist/extra/render/index.js +1 -0
  101. package/dist/extra/sources.cjs +1 -1
  102. package/dist/extra/sources.d.cts +1 -1
  103. package/dist/extra/sources.d.ts +1 -1
  104. package/dist/extra/sources.js +1 -1
  105. package/dist/extra/storage-browser.d.cts +1 -1
  106. package/dist/extra/storage-browser.d.ts +1 -1
  107. package/dist/{fallback-axI2cXwt.d.cts → fallback-8JYU8tlT.d.cts} +1 -1
  108. package/dist/{fallback-DuEXfA4F.d.ts → fallback-CMZl39L5.d.ts} +1 -1
  109. package/dist/graph/index.cjs +7 -7
  110. package/dist/graph/index.d.cts +5 -5
  111. package/dist/graph/index.d.ts +5 -5
  112. package/dist/graph/index.js +1 -1
  113. package/dist/{graph-BjW1taJl.d.ts → graph-BkIkog4h.d.ts} +76 -100
  114. package/dist/{graph-CHsVwf9S.d.cts → graph-E6likq7w.d.cts} +76 -100
  115. package/dist/{index-CIcu6fIR.d.ts → index-2n8Eai6M.d.ts} +1 -1
  116. package/dist/{index-BwOsJfLJ.d.ts → index-3k4Gg6-n.d.ts} +3 -3
  117. package/dist/{index-BUFCHvOR.d.ts → index-40ZT4MHj.d.ts} +3 -3
  118. package/dist/index-8s-Qm-gz.d.ts +218 -0
  119. package/dist/index-A3U3CSve.d.cts +113 -0
  120. package/dist/{index-CDvC1m5p.d.ts → index-B2RUoIUz.d.ts} +1 -1
  121. package/dist/{index-Byp771zP.d.ts → index-B6iTqKtJ.d.ts} +2 -2
  122. package/dist/{index-D-B7U42V.d.cts → index-B72TQQHd.d.cts} +2 -2
  123. package/dist/{resilience-Bys63Cpd.d.ts → index-BAQrjuZF.d.ts} +202 -26
  124. package/dist/{index-BiomL7AW.d.ts → index-BJSZxSFX.d.ts} +1 -1
  125. package/dist/index-BQ1fR4li.d.ts +210 -0
  126. package/dist/{index-D7-RSD93.d.cts → index-BTHOTC0Q.d.cts} +4 -4
  127. package/dist/{index-CEVzBWeB.d.ts → index-BaA-xpSw.d.ts} +26 -19
  128. package/dist/{index-CAV-3RpJ.d.cts → index-Bd91Nmf4.d.cts} +4 -4
  129. package/dist/{index-BI1wMfyc.d.ts → index-BgjS2b8N.d.ts} +3 -3
  130. package/dist/{index-Bpr0Pwgl.d.cts → index-BiHUBEKq.d.cts} +3 -3
  131. package/dist/{index-UsU9ptzs.d.cts → index-BilOa6AE.d.cts} +55 -9
  132. package/dist/{index-DJVQ-t07.d.ts → index-BmSQLAZo.d.cts} +41 -48
  133. package/dist/{index-DTDVDzhA.d.ts → index-C-dkXOpB.d.cts} +56 -54
  134. package/dist/{index-B-ORMr3k.d.ts → index-C5cQ7Gfx.d.ts} +4 -4
  135. package/dist/{index-ML6vHKXK.d.ts → index-C6ZUaos7.d.ts} +1 -1
  136. package/dist/{index-Vz7KPfgz.d.ts → index-CAP3UGsq.d.ts} +1 -1
  137. package/dist/{index-BFaALJxR.d.ts → index-CD2dBMet.d.ts} +10 -8
  138. package/dist/index-CGhMJNHb.d.cts +128 -0
  139. package/dist/{index-B3D_z0Z6.d.cts → index-CL7oilfm.d.cts} +1 -1
  140. package/dist/{index-Bn0uZEL4.d.ts → index-CQtWm7jS.d.ts} +9 -9
  141. package/dist/{index-CM-i58FY.d.cts → index-CRm0YIzC.d.cts} +9 -9
  142. package/dist/index-CUIkE1l9.d.cts +230 -0
  143. package/dist/{index-CijfwEWx.d.ts → index-Cczxgd2D.d.ts} +2 -2
  144. package/dist/{index-CAbHN_rP.d.cts → index-CgnCFhr2.d.cts} +1 -1
  145. package/dist/{index-B2IUcH13.d.cts → index-Ck35nA-T.d.ts} +41 -48
  146. package/dist/{index-BpMZzX9P.d.cts → index-Cnr1WrlX.d.cts} +3 -3
  147. package/dist/{index-JYtN9uqM.d.ts → index-CoM4rzyB.d.ts} +1 -1
  148. package/dist/{index-Ckil6miL.d.cts → index-CtFNGe-m.d.cts} +2 -2
  149. package/dist/{index-BjWZARLy.d.ts → index-Ctb7_2sG.d.ts} +1 -1
  150. package/dist/index-CuPUehFa.d.cts +218 -0
  151. package/dist/index-D1Gc7wV5.d.ts +230 -0
  152. package/dist/{index-DqICM_I7.d.ts → index-D1IEZUsj.d.ts} +67 -9
  153. package/dist/{index-BFuVcqL8.d.cts → index-D3ayz3hy.d.cts} +1 -1
  154. package/dist/{index-CQsqqEVz.d.cts → index-D4uimgee.d.cts} +1 -1
  155. package/dist/{resilience-BWP2c7Af.d.cts → index-DGTo1yka.d.cts} +202 -26
  156. package/dist/{index-BmWuVdER.d.ts → index-DH4fm2Ck.d.ts} +2 -2
  157. package/dist/{index-BkQqf1EF.d.cts → index-DJ_MPOJ5.d.cts} +67 -9
  158. package/dist/{index-9xhIaM-w.d.cts → index-DOBLxOti.d.cts} +1 -1
  159. package/dist/{index-BqcgiSQg.d.cts → index-DQQCOIt8.d.cts} +10 -8
  160. package/dist/{index-DJNAWzcH.d.cts → index-DVAlsmEU.d.cts} +26 -19
  161. package/dist/index-DVDapw2k.d.cts +210 -0
  162. package/dist/{index-D_QQ_dTD.d.cts → index-DYTBbF8T.d.cts} +1 -1
  163. package/dist/{index-BgzPO43H.d.cts → index-DgJc8Zgc.d.cts} +6 -6
  164. package/dist/{index-Czk3r0yA.d.cts → index-DhLyOHYZ.d.ts} +56 -54
  165. package/dist/{index-CrlHFsiT.d.ts → index-DhnsQfa3.d.ts} +100 -118
  166. package/dist/{index-Bub6x_D4.d.cts → index-DktLSZOc.d.cts} +37 -90
  167. package/dist/{index-BaSy4L6w.d.cts → index-DpiGqtrs.d.cts} +100 -118
  168. package/dist/{index-D-HZ7sP4.d.ts → index-I1cCY3ZI.d.ts} +6 -6
  169. package/dist/{index-D9vBTuzo.d.ts → index-IUCY0OFN.d.ts} +4 -4
  170. package/dist/{index-DeSsvHDD.d.cts → index-MxYuWOrf.d.cts} +3 -3
  171. package/dist/index-N2MAxt7_.d.ts +128 -0
  172. package/dist/{index-CpZKtdMw.d.cts → index-PgwvGWa1.d.cts} +1 -1
  173. package/dist/{index-AUqWe_fX.d.ts → index-WSlcjhQF.d.ts} +55 -9
  174. package/dist/{index-Di7OdwlO.d.ts → index-bXXLSvor.d.ts} +37 -90
  175. package/dist/index-da2V5vPy.d.ts +113 -0
  176. package/dist/{index-DY2f2b9z.d.ts → index-eaQuGJnv.d.ts} +3 -3
  177. package/dist/{index-BsgxnHN8.d.cts → index-t6L2qpHh.d.cts} +3 -3
  178. package/dist/{index-C-3UXnHT.d.cts → index-tV3AA9hI.d.cts} +2 -2
  179. package/dist/{index-8OxXae3g.d.ts → index-yLt-aPMp.d.ts} +1 -1
  180. package/dist/{index-CqSJ25A9.d.cts → index-z8WFPVI8.d.cts} +1 -1
  181. package/dist/index.cjs +63 -59
  182. package/dist/index.d.cts +48 -47
  183. package/dist/index.d.ts +48 -47
  184. package/dist/index.js +1 -1
  185. package/dist/{meta-DreaEM_a.d.cts → meta-Ct9nqQS5.d.cts} +11 -7
  186. package/dist/{meta-BYqlATmg.d.ts → meta-D8OyedKp.d.ts} +11 -7
  187. package/dist/{node-fSc-hCv8.d.cts → node-BYInONRr.d.cts} +3 -3
  188. package/dist/{node-fSc-hCv8.d.ts → node-BYInONRr.d.ts} +3 -3
  189. package/dist/{observable-Cqty11jG.d.cts → observable-DMIlYJV1.d.cts} +1 -1
  190. package/dist/{observable-EAV_rNfM.d.ts → observable-DO8DDEzv.d.ts} +1 -1
  191. package/dist/patterns/ai/browser.cjs +5 -5
  192. package/dist/patterns/ai/browser.d.cts +4 -4
  193. package/dist/patterns/ai/browser.d.ts +4 -4
  194. package/dist/patterns/ai/browser.js +1 -1
  195. package/dist/patterns/ai/index.cjs +16 -20
  196. package/dist/patterns/ai/index.d.cts +17 -17
  197. package/dist/patterns/ai/index.d.ts +17 -17
  198. package/dist/patterns/ai/index.js +1 -1
  199. package/dist/patterns/ai/node.cjs +1 -1
  200. package/dist/patterns/ai/node.d.cts +4 -4
  201. package/dist/patterns/ai/node.d.ts +4 -4
  202. package/dist/patterns/ai/node.js +1 -1
  203. package/dist/patterns/audit/index.cjs +3 -7
  204. package/dist/patterns/audit/index.d.cts +6 -6
  205. package/dist/patterns/audit/index.d.ts +6 -6
  206. package/dist/patterns/audit/index.js +1 -1
  207. package/dist/patterns/cqrs/index.cjs +3 -7
  208. package/dist/patterns/cqrs/index.d.cts +6 -6
  209. package/dist/patterns/cqrs/index.d.ts +6 -6
  210. package/dist/patterns/cqrs/index.js +1 -1
  211. package/dist/patterns/demo-shell/index.cjs +5 -8
  212. package/dist/patterns/demo-shell/index.d.cts +5 -5
  213. package/dist/patterns/demo-shell/index.d.ts +5 -5
  214. package/dist/patterns/demo-shell/index.js +1 -1
  215. package/dist/patterns/domain-templates/index.cjs +3 -7
  216. package/dist/patterns/domain-templates/index.d.cts +4 -4
  217. package/dist/patterns/domain-templates/index.d.ts +4 -4
  218. package/dist/patterns/domain-templates/index.js +1 -1
  219. package/dist/patterns/graphspec/index.cjs +37 -37
  220. package/dist/patterns/graphspec/index.d.cts +5 -5
  221. package/dist/patterns/graphspec/index.d.ts +5 -5
  222. package/dist/patterns/graphspec/index.js +1 -1
  223. package/dist/patterns/guarded-execution/index.cjs +3 -7
  224. package/dist/patterns/guarded-execution/index.d.cts +7 -7
  225. package/dist/patterns/guarded-execution/index.d.ts +7 -7
  226. package/dist/patterns/guarded-execution/index.js +1 -1
  227. package/dist/patterns/harness/index.cjs +8 -12
  228. package/dist/patterns/harness/index.d.cts +12 -12
  229. package/dist/patterns/harness/index.d.ts +12 -12
  230. package/dist/patterns/harness/index.js +1 -1
  231. package/dist/patterns/job-queue/index.cjs +3 -7
  232. package/dist/patterns/job-queue/index.d.cts +6 -6
  233. package/dist/patterns/job-queue/index.d.ts +6 -6
  234. package/dist/patterns/job-queue/index.js +1 -1
  235. package/dist/patterns/lens/index.cjs +3 -7
  236. package/dist/patterns/lens/index.d.cts +5 -6
  237. package/dist/patterns/lens/index.d.ts +5 -6
  238. package/dist/patterns/lens/index.js +1 -1
  239. package/dist/patterns/memory/index.cjs +3 -7
  240. package/dist/patterns/memory/index.d.cts +6 -6
  241. package/dist/patterns/memory/index.d.ts +6 -6
  242. package/dist/patterns/memory/index.js +1 -1
  243. package/dist/patterns/messaging/index.cjs +3 -7
  244. package/dist/patterns/messaging/index.d.cts +5 -5
  245. package/dist/patterns/messaging/index.d.ts +5 -5
  246. package/dist/patterns/messaging/index.js +1 -1
  247. package/dist/patterns/orchestration/index.cjs +3 -7
  248. package/dist/patterns/orchestration/index.d.cts +8 -8
  249. package/dist/patterns/orchestration/index.d.ts +8 -8
  250. package/dist/patterns/orchestration/index.js +1 -1
  251. package/dist/patterns/process/index.cjs +1 -1
  252. package/dist/patterns/process/index.d.cts +7 -7
  253. package/dist/patterns/process/index.d.ts +7 -7
  254. package/dist/patterns/process/index.js +1 -1
  255. package/dist/patterns/reactive-layout/index.cjs +4 -8
  256. package/dist/patterns/reactive-layout/index.d.cts +5 -5
  257. package/dist/patterns/reactive-layout/index.d.ts +5 -5
  258. package/dist/patterns/reactive-layout/index.js +1 -1
  259. package/dist/patterns/reduction/index.cjs +3 -7
  260. package/dist/patterns/reduction/index.d.cts +4 -4
  261. package/dist/patterns/reduction/index.d.ts +4 -4
  262. package/dist/patterns/reduction/index.js +1 -1
  263. package/dist/patterns/refine-loop/index.cjs +5 -9
  264. package/dist/patterns/refine-loop/index.d.cts +6 -6
  265. package/dist/patterns/refine-loop/index.d.ts +6 -6
  266. package/dist/patterns/refine-loop/index.js +1 -1
  267. package/dist/patterns/resilient-pipeline/index.cjs +3 -1
  268. package/dist/patterns/resilient-pipeline/index.d.cts +6 -6
  269. package/dist/patterns/resilient-pipeline/index.d.ts +6 -6
  270. package/dist/patterns/resilient-pipeline/index.js +1 -1
  271. package/dist/patterns/surface/index.cjs +12 -16
  272. package/dist/patterns/surface/index.d.cts +6 -6
  273. package/dist/patterns/surface/index.d.ts +6 -6
  274. package/dist/patterns/surface/index.js +1 -1
  275. package/dist/{pipeline-graph-9JBbmRxA.d.ts → pipeline-graph-CB4La-UW.d.ts} +34 -17
  276. package/dist/{pipeline-graph-DuHpXSOn.d.cts → pipeline-graph-MWrQZXCq.d.cts} +34 -17
  277. package/dist/{reactive-layout-BMLDB4Vd.d.cts → reactive-layout-BtZfUKuL.d.cts} +2 -2
  278. package/dist/{reactive-layout-D-tRiNhg.d.ts → reactive-layout-KJj4E2dT.d.ts} +2 -2
  279. package/dist/{reactive-log-BgWSA1fg.d.ts → reactive-log-BlAsPLl2.d.ts} +2 -2
  280. package/dist/{reactive-log-C3IMAGpT.d.cts → reactive-log-_zeEnB9H.d.cts} +2 -2
  281. package/dist/{reactive-map-DmgeADH8.d.cts → reactive-map-6P_k3AQM.d.cts} +2 -2
  282. package/dist/{reactive-map-CHyeCf4D.d.ts → reactive-map-CjXByDV-.d.ts} +2 -2
  283. package/dist/resilience-S33JV6XC.js +1 -0
  284. package/dist/{sugar-D13E2M_z.d.ts → sugar-BhfjgetH.d.ts} +1 -1
  285. package/dist/{sugar-DgaGJcI6.d.cts → sugar-DzePN5-g.d.cts} +1 -1
  286. package/dist/{topology-tree-jrZue3ao.d.cts → topology-tree-3LBKFsUo.d.cts} +1 -1
  287. package/dist/{topology-tree-D47-nI6Z.d.ts → topology-tree-mF7Emqzm.d.ts} +1 -1
  288. package/dist/{types-BMSGPlpO.d.cts → types-1Dhoi7HM.d.cts} +1 -1
  289. package/dist/{types-CidcBDuk.d.ts → types-39jk0kaV.d.ts} +1 -1
  290. package/package.json +11 -1
  291. package/dist/chunk-2YFDSYEF.js +0 -1
  292. package/dist/chunk-5BGFS2XH.js +0 -1
  293. package/dist/chunk-CMTN3KPT.js +0 -80
  294. package/dist/chunk-DQJLC6YY.js +0 -1
  295. package/dist/chunk-G7JN6LCB.js +0 -1
  296. package/dist/chunk-KJEAIIIY.js +0 -43
  297. package/dist/chunk-LV3ACS5J.js +0 -1
  298. package/dist/chunk-NBGPXQSP.js +0 -1
  299. package/dist/chunk-NN3QPJ6U.js +0 -1
  300. package/dist/chunk-NSAZ6PR6.js +0 -1
  301. package/dist/chunk-O32GJOUJ.js +0 -1
  302. package/dist/chunk-QEVSIVSF.js +0 -1
  303. package/dist/chunk-QMC2PLNM.js +0 -7
  304. package/dist/chunk-QOJFR6GS.js +0 -1
  305. package/dist/chunk-SFK7MN7S.js +0 -1
  306. package/dist/chunk-TB7JKSVS.js +0 -61
  307. package/dist/chunk-UAXFKMAG.js +0 -1
  308. package/dist/chunk-XIMFHEKV.js +0 -1
  309. package/dist/chunk-XLMYQB6F.js +0 -1
  310. package/dist/chunk-XLYF4LBH.js +0 -1
  311. package/dist/imperative-audit-ahAE65a9.d.cts +0 -28
  312. package/dist/imperative-audit-ahAE65a9.d.ts +0 -28
  313. package/dist/index-5dNRlW7J.d.ts +0 -135
  314. package/dist/index-BWUMIt7J.d.cts +0 -135
  315. package/dist/index-BhzwpIJc.d.cts +0 -105
  316. package/dist/index-BsZk9T8y.d.ts +0 -105
  317. package/dist/index-C56XZiDe.d.cts +0 -163
  318. package/dist/index-CpdnP-0y.d.cts +0 -186
  319. package/dist/index-DKrIuF-r.d.ts +0 -163
  320. package/dist/index-DOU1Ee_k.d.ts +0 -186
  321. package/dist/resilience-LGBK236C.js +0 -1
@@ -1,9 +1,9 @@
1
- export { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory } from '../../index-DTDVDzhA.js';
2
- export { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot } from '../../index-CijfwEWx.js';
3
- import '../../node-fSc-hCv8.js';
4
- import '../../graph-BjW1taJl.js';
5
- import '../../meta-BYqlATmg.js';
1
+ export { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory } from '../../index-DhLyOHYZ.js';
2
+ export { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot } from '../../index-Cczxgd2D.js';
3
+ import '../../meta-D8OyedKp.js';
4
+ import '../../node-BYInONRr.js';
5
+ import '../../graph-BkIkog4h.js';
6
6
  import '../../extra/storage-core.js';
7
7
  import '../../extra/storage-tiers.js';
8
- import '../../types-CidcBDuk.js';
8
+ import '../../types-39jk0kaV.js';
9
9
  import '../../extra/sources.js';
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"../../chunk-O2BLVQU4.js";import"../../chunk-CMTN3KPT.js";import"../../chunk-XLMYQB6F.js";import"../../chunk-O32GJOUJ.js";import"../../chunk-QMC2PLNM.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-6773HURD.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-DQJLC6YY.js";import"../../chunk-TZQPPQEQ.js";import"../../chunk-RZ5HKPGI.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{e as SNAPSHOT_WIRE_VERSION,a as SurfaceError,b as asSurfaceError,c as createGraph,j as deleteSnapshot,h as diffSnapshots,i as listSnapshots,g as restoreSnapshot,d as runReduction,f as saveSnapshot};
1
+ import{a,b,c,d,e,f,g,h,i,j}from"../../chunk-MNZIKXK4.js";import"../../chunk-Z4F3DOWS.js";import"../../chunk-LYM4PBMV.js";import"../../chunk-756D5TFD.js";import"../../chunk-L6NSJVJZ.js";import"../../chunk-2BX4NB34.js";import"../../chunk-SGS4OJGS.js";import"../../chunk-ESMPEKEV.js";import"../../chunk-FHRBBHJN.js";import"../../chunk-4VVTGLXJ.js";import"../../chunk-35JTVPOX.js";import"../../chunk-YXDRGKXP.js";import"../../chunk-CKFQS2CJ.js";import"../../chunk-LYCLF26R.js";import"../../chunk-CK2E7BTU.js";import"../../chunk-QYADASLV.js";export{e as SNAPSHOT_WIRE_VERSION,a as SurfaceError,b as asSurfaceError,c as createGraph,j as deleteSnapshot,h as diffSnapshots,i as listSnapshots,g as restoreSnapshot,d as runReduction,f as saveSnapshot};
@@ -1,18 +1,22 @@
1
- import { a as Node, c as NodeActions } from './node-fSc-hCv8.js';
2
- import { D as DerivedFn } from './sugar-D13E2M_z.js';
3
- import { R as ReactiveLogBundle } from './reactive-log-BgWSA1fg.js';
4
- import { G as Graph, a as GraphOptions } from './graph-BjW1taJl.js';
5
- import { B as BaseAuditRecord } from './imperative-audit-ahAE65a9.js';
1
+ import { N as Node, c as NodeActions } from './node-BYInONRr.js';
2
+ import { D as DerivedFn } from './sugar-BhfjgetH.js';
3
+ import { B as BaseAuditRecord } from './index-BQ1fR4li.js';
4
+ import { a as ReactiveLogBundle } from './reactive-log-BlAsPLl2.js';
5
+ import { G as Graph, a as GraphOptions } from './graph-BkIkog4h.js';
6
6
 
7
7
  /**
8
8
  * PipelineGraph subclass (Wave A.1 Unit 1 — locked 2026-04-24).
9
9
  *
10
10
  * Specialized {@link Graph} that hosts workflow-DAG sugar methods:
11
- * `task` / `classify` / `combine` / `approval` / `gate` / `catch`. The
12
- * legacy `pipeline` / `task` / `branch` / `join` / `subPipeline` /
13
- * `approval` / `gate` / `loop` / `onFailure` factories from
14
- * {@link ./index} continue to work for migration ease; new code should
15
- * prefer methods on this class.
11
+ * `task` / `classify` / `combine` / `approval` / `approvalGate` / `catch`.
12
+ * The legacy `pipeline` / `task` / `branch` / `join` / `subPipeline` /
13
+ * `approval` / `loop` / `onFailure` factories from {@link ./index} continue
14
+ * to work for migration ease; new code should prefer methods on this class.
15
+ *
16
+ * **Tier 2.3 rename:** the prior `gate(...)` method is now `approvalGate(...)`,
17
+ * disambiguating it from the other gate-family primitives (`budgetGate` for
18
+ * numeric constraints, `valve` for boolean switching, `policyGate` for ABAC
19
+ * rules). The "gating dimension" here is **human judgment**.
16
20
  *
17
21
  * Construction: `pipelineGraph(name, opts?)` or `new PipelineGraph(name, opts)`.
18
22
  */
@@ -64,15 +68,28 @@ interface GateController<T> {
64
68
  open(): void;
65
69
  close(): void;
66
70
  }
71
+ /**
72
+ * Terminal-cause discriminator for the {@link PipelineGraph.catch} recovery
73
+ * handler. Tier 1.6.3 status-enum migration: was `{ kind: "complete" | "error" }`
74
+ * pre-1.0; aligned with the canonical lifecycle enum
75
+ * (`status: "running" | "completed" | "errored" | "cancelled"`). The variant
76
+ * structure is preserved — `errored` still carries `error: unknown` and
77
+ * `completed` carries no payload.
78
+ */
67
79
  type TerminalCause = {
68
- kind: "error";
80
+ kind: "errored";
69
81
  error: unknown;
70
82
  } | {
71
- kind: "complete";
83
+ kind: "completed";
72
84
  };
73
85
  interface CatchOptions<T> {
74
- /** Default `"error"`; `"complete"` recovers COMPLETE; `"terminal"` recovers either. */
75
- on?: "error" | "complete" | "terminal";
86
+ /**
87
+ * Which terminal cause to recover. Default `"errored"` (Tier 1.6.3 rename
88
+ * of `"error"`). `"completed"` recovers COMPLETE; `"terminal"` recovers
89
+ * either. Aligns with the canonical lifecycle enum that
90
+ * {@link TerminalCause.kind} now uses.
91
+ */
92
+ on?: "errored" | "completed" | "terminal";
76
93
  completeWhenDepsComplete?: boolean;
77
94
  meta?: Record<string, unknown>;
78
95
  handlerVersion?: {
@@ -103,12 +120,12 @@ declare class PipelineGraph extends Graph {
103
120
  }): Node<{
104
121
  [K in keyof R]: unknown;
105
122
  }>;
106
- gate<T>(name: string, source: StepRef, opts?: GateOptions<T>): GateController<T>;
123
+ approvalGate<T>(name: string, source: StepRef, opts?: GateOptions<T>): GateController<T>;
107
124
  /**
108
125
  * Reactive approval step: passes items through when `approver` is truthy;
109
126
  * holds at most one pending item (maxPending: 1) when falsy. A thin alias
110
- * over `gate({ approver, maxPending: 1 })` — use `gate()` directly for
111
- * finer control (maxPending, onceOnly, manual approve/reject).
127
+ * over `approvalGate({ approver, maxPending: 1 })` — use `approvalGate()`
128
+ * directly for finer control (maxPending, onceOnly, manual approve/reject).
112
129
  */
113
130
  approval<T>(name: string, source: StepRef, approver: Node<unknown>, opts?: Omit<GateOptions<T>, "approver" | "maxPending">): GateController<T>;
114
131
  catch<T>(name: string, source: StepRef, recover: (cause: TerminalCause, actions: NodeActions) => T, opts?: CatchOptions<T>): Node<T>;
@@ -1,18 +1,22 @@
1
- import { a as Node, c as NodeActions } from './node-fSc-hCv8.cjs';
2
- import { D as DerivedFn } from './sugar-DgaGJcI6.cjs';
3
- import { R as ReactiveLogBundle } from './reactive-log-C3IMAGpT.cjs';
4
- import { G as Graph, a as GraphOptions } from './graph-CHsVwf9S.cjs';
5
- import { B as BaseAuditRecord } from './imperative-audit-ahAE65a9.cjs';
1
+ import { N as Node, c as NodeActions } from './node-BYInONRr.cjs';
2
+ import { D as DerivedFn } from './sugar-DzePN5-g.cjs';
3
+ import { B as BaseAuditRecord } from './index-DVDapw2k.cjs';
4
+ import { a as ReactiveLogBundle } from './reactive-log-_zeEnB9H.cjs';
5
+ import { G as Graph, a as GraphOptions } from './graph-E6likq7w.cjs';
6
6
 
7
7
  /**
8
8
  * PipelineGraph subclass (Wave A.1 Unit 1 — locked 2026-04-24).
9
9
  *
10
10
  * Specialized {@link Graph} that hosts workflow-DAG sugar methods:
11
- * `task` / `classify` / `combine` / `approval` / `gate` / `catch`. The
12
- * legacy `pipeline` / `task` / `branch` / `join` / `subPipeline` /
13
- * `approval` / `gate` / `loop` / `onFailure` factories from
14
- * {@link ./index} continue to work for migration ease; new code should
15
- * prefer methods on this class.
11
+ * `task` / `classify` / `combine` / `approval` / `approvalGate` / `catch`.
12
+ * The legacy `pipeline` / `task` / `branch` / `join` / `subPipeline` /
13
+ * `approval` / `loop` / `onFailure` factories from {@link ./index} continue
14
+ * to work for migration ease; new code should prefer methods on this class.
15
+ *
16
+ * **Tier 2.3 rename:** the prior `gate(...)` method is now `approvalGate(...)`,
17
+ * disambiguating it from the other gate-family primitives (`budgetGate` for
18
+ * numeric constraints, `valve` for boolean switching, `policyGate` for ABAC
19
+ * rules). The "gating dimension" here is **human judgment**.
16
20
  *
17
21
  * Construction: `pipelineGraph(name, opts?)` or `new PipelineGraph(name, opts)`.
18
22
  */
@@ -64,15 +68,28 @@ interface GateController<T> {
64
68
  open(): void;
65
69
  close(): void;
66
70
  }
71
+ /**
72
+ * Terminal-cause discriminator for the {@link PipelineGraph.catch} recovery
73
+ * handler. Tier 1.6.3 status-enum migration: was `{ kind: "complete" | "error" }`
74
+ * pre-1.0; aligned with the canonical lifecycle enum
75
+ * (`status: "running" | "completed" | "errored" | "cancelled"`). The variant
76
+ * structure is preserved — `errored` still carries `error: unknown` and
77
+ * `completed` carries no payload.
78
+ */
67
79
  type TerminalCause = {
68
- kind: "error";
80
+ kind: "errored";
69
81
  error: unknown;
70
82
  } | {
71
- kind: "complete";
83
+ kind: "completed";
72
84
  };
73
85
  interface CatchOptions<T> {
74
- /** Default `"error"`; `"complete"` recovers COMPLETE; `"terminal"` recovers either. */
75
- on?: "error" | "complete" | "terminal";
86
+ /**
87
+ * Which terminal cause to recover. Default `"errored"` (Tier 1.6.3 rename
88
+ * of `"error"`). `"completed"` recovers COMPLETE; `"terminal"` recovers
89
+ * either. Aligns with the canonical lifecycle enum that
90
+ * {@link TerminalCause.kind} now uses.
91
+ */
92
+ on?: "errored" | "completed" | "terminal";
76
93
  completeWhenDepsComplete?: boolean;
77
94
  meta?: Record<string, unknown>;
78
95
  handlerVersion?: {
@@ -103,12 +120,12 @@ declare class PipelineGraph extends Graph {
103
120
  }): Node<{
104
121
  [K in keyof R]: unknown;
105
122
  }>;
106
- gate<T>(name: string, source: StepRef, opts?: GateOptions<T>): GateController<T>;
123
+ approvalGate<T>(name: string, source: StepRef, opts?: GateOptions<T>): GateController<T>;
107
124
  /**
108
125
  * Reactive approval step: passes items through when `approver` is truthy;
109
126
  * holds at most one pending item (maxPending: 1) when falsy. A thin alias
110
- * over `gate({ approver, maxPending: 1 })` — use `gate()` directly for
111
- * finer control (maxPending, onceOnly, manual approve/reject).
127
+ * over `approvalGate({ approver, maxPending: 1 })` — use `approvalGate()`
128
+ * directly for finer control (maxPending, onceOnly, manual approve/reject).
112
129
  */
113
130
  approval<T>(name: string, source: StepRef, approver: Node<unknown>, opts?: Omit<GateOptions<T>, "approver" | "maxPending">): GateController<T>;
114
131
  catch<T>(name: string, source: StepRef, recover: (cause: TerminalCause, actions: NodeActions) => T, opts?: CatchOptions<T>): Node<T>;
@@ -1,5 +1,5 @@
1
- import { a as Node } from './node-fSc-hCv8.cjs';
2
- import { G as Graph } from './graph-CHsVwf9S.cjs';
1
+ import { N as Node } from './node-BYInONRr.cjs';
2
+ import { G as Graph } from './graph-E6likq7w.cjs';
3
3
 
4
4
  /** Pluggable measurement backend. */
5
5
  interface MeasurementAdapter {
@@ -1,5 +1,5 @@
1
- import { a as Node } from './node-fSc-hCv8.js';
2
- import { G as Graph } from './graph-BjW1taJl.js';
1
+ import { N as Node } from './node-BYInONRr.js';
2
+ import { G as Graph } from './graph-BkIkog4h.js';
3
3
 
4
4
  /** Pluggable measurement backend. */
5
5
  interface MeasurementAdapter {
@@ -1,4 +1,4 @@
1
- import { a as Node, V as VersioningLevel, f as NodeGuard } from './node-fSc-hCv8.js';
1
+ import { V as VersioningLevel, b as NodeGuard, N as Node } from './node-BYInONRr.js';
2
2
  import { AppendLogStorageTier } from './extra/storage-tiers.js';
3
3
 
4
4
  type ReactiveLogOptions<T> = {
@@ -220,4 +220,4 @@ interface MergedReactiveLog<T> {
220
220
  */
221
221
  declare function mergeReactiveLogs<T>(logs: readonly Node<readonly T[]>[]): MergedReactiveLog<T>;
222
222
 
223
- export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type ReactiveLogBundle as R, type ViewSpec as V, type ReactiveLogOptions as a, mergeReactiveLogs as m, reactiveLog as r };
223
+ export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type ReactiveLogOptions as R, type ViewSpec as V, type ReactiveLogBundle as a, mergeReactiveLogs as m, reactiveLog as r };
@@ -1,4 +1,4 @@
1
- import { a as Node, V as VersioningLevel, f as NodeGuard } from './node-fSc-hCv8.cjs';
1
+ import { V as VersioningLevel, b as NodeGuard, N as Node } from './node-BYInONRr.cjs';
2
2
  import { AppendLogStorageTier } from './extra/storage-tiers.cjs';
3
3
 
4
4
  type ReactiveLogOptions<T> = {
@@ -220,4 +220,4 @@ interface MergedReactiveLog<T> {
220
220
  */
221
221
  declare function mergeReactiveLogs<T>(logs: readonly Node<readonly T[]>[]): MergedReactiveLog<T>;
222
222
 
223
- export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type ReactiveLogBundle as R, type ViewSpec as V, type ReactiveLogOptions as a, mergeReactiveLogs as m, reactiveLog as r };
223
+ export { type LogBackend as L, type MergedReactiveLog as M, NativeLogBackend as N, type ReactiveLogOptions as R, type ViewSpec as V, type ReactiveLogBundle as a, mergeReactiveLogs as m, reactiveLog as r };
@@ -1,4 +1,4 @@
1
- import { a as Node, V as VersioningLevel, N as NodeOptions } from './node-fSc-hCv8.cjs';
1
+ import { N as Node, V as VersioningLevel, a as NodeOptions } from './node-BYInONRr.cjs';
2
2
 
3
3
  type ReactiveMapOptions<K, V> = {
4
4
  /** Optional registry name for `describe()` / debugging. */
@@ -293,4 +293,4 @@ declare class NativeMapBackend<K, V> implements MapBackend<K, V> {
293
293
  */
294
294
  declare function reactiveMap<K, V>(options?: ReactiveMapOptions<K, V>): ReactiveMapBundle<K, V>;
295
295
 
296
- export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type ReactiveMapOptions as a, type NativeMapBackendOptions as b, type ReactiveMapRetention as c, reactiveMap as r };
296
+ export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type NativeMapBackendOptions as a, type ReactiveMapOptions as b, type ReactiveMapRetention as c, reactiveMap as r };
@@ -1,4 +1,4 @@
1
- import { a as Node, V as VersioningLevel, N as NodeOptions } from './node-fSc-hCv8.js';
1
+ import { N as Node, V as VersioningLevel, a as NodeOptions } from './node-BYInONRr.js';
2
2
 
3
3
  type ReactiveMapOptions<K, V> = {
4
4
  /** Optional registry name for `describe()` / debugging. */
@@ -293,4 +293,4 @@ declare class NativeMapBackend<K, V> implements MapBackend<K, V> {
293
293
  */
294
294
  declare function reactiveMap<K, V>(options?: ReactiveMapOptions<K, V>): ReactiveMapBundle<K, V>;
295
295
 
296
- export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type ReactiveMapOptions as a, type NativeMapBackendOptions as b, type ReactiveMapRetention as c, reactiveMap as r };
296
+ export { type MapBackend as M, NativeMapBackend as N, type ReactiveMapBundle as R, type NativeMapBackendOptions as a, type ReactiveMapOptions as b, type ReactiveMapRetention as c, reactiveMap as r };
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-RZJDIV2G.js";import"./chunk-L6NSJVJZ.js";import"./chunk-SGS4OJGS.js";import"./chunk-ESMPEKEV.js";import"./chunk-4VVTGLXJ.js";import"./chunk-35JTVPOX.js";import"./chunk-CKFQS2CJ.js";import"./chunk-LYCLF26R.js";import"./chunk-CK2E7BTU.js";import"./chunk-QYADASLV.js";export{c as CircuitOpenError,g as RateLimiterOverflowError,j as TimeoutError,a as budgetGate,d as circuitBreaker,k as fallback,h as rateLimiter,b as retry,l as timeout,f as tokenBucket,e as withBreaker,i as withStatus};
@@ -1,4 +1,4 @@
1
- import { N as NodeOptions, F as FnCtx, a as Node, c as NodeActions, d as NodeFnCleanup } from './node-fSc-hCv8.js';
1
+ import { a as NodeOptions, F as FnCtx, N as Node, c as NodeActions, d as NodeFnCleanup } from './node-BYInONRr.js';
2
2
 
3
3
  /**
4
4
  * Sugar constructors over the raw `node()` primitive.
@@ -1,4 +1,4 @@
1
- import { N as NodeOptions, F as FnCtx, a as Node, c as NodeActions, d as NodeFnCleanup } from './node-fSc-hCv8.cjs';
1
+ import { a as NodeOptions, F as FnCtx, N as Node, c as NodeActions, d as NodeFnCleanup } from './node-BYInONRr.cjs';
2
2
 
3
3
  /**
4
4
  * Sugar constructors over the raw `node()` primitive.
@@ -1,4 +1,4 @@
1
- import { G as Graph, T as TopologyEvent } from './graph-CHsVwf9S.cjs';
1
+ import { G as Graph, T as TopologyEvent } from './graph-E6likq7w.cjs';
2
2
 
3
3
  /**
4
4
  * Subscribe to structural changes across `graph` and every transitively
@@ -1,4 +1,4 @@
1
- import { G as Graph, T as TopologyEvent } from './graph-BjW1taJl.js';
1
+ import { G as Graph, T as TopologyEvent } from './graph-BkIkog4h.js';
2
2
 
3
3
  /**
4
4
  * Subscribe to structural changes across `graph` and every transitively
@@ -1,4 +1,4 @@
1
- import { a as Node } from './node-fSc-hCv8.cjs';
1
+ import { N as Node } from './node-BYInONRr.cjs';
2
2
  import { NodeInput } from './extra/sources.cjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as Node } from './node-fSc-hCv8.js';
1
+ import { N as Node } from './node-BYInONRr.js';
2
2
  import { NodeInput } from './extra/sources.js';
3
3
 
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphrefly/graphrefly",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319",
5
5
  "description": "Reactive harness layer for agent workflows. Describe automations in plain language, trace every decision, enforce policies, persist checkpoints. Zero dependencies.",
6
6
  "repository": {
@@ -157,6 +157,16 @@
157
157
  "default": "./dist/extra/storage-tiers-browser.cjs"
158
158
  }
159
159
  },
160
+ "./extra/render": {
161
+ "import": {
162
+ "types": "./dist/extra/render/index.d.ts",
163
+ "default": "./dist/extra/render/index.js"
164
+ },
165
+ "require": {
166
+ "types": "./dist/extra/render/index.d.cts",
167
+ "default": "./dist/extra/render/index.cjs"
168
+ }
169
+ },
160
170
  "./graph": {
161
171
  "import": {
162
172
  "types": "./dist/graph/index.d.ts",
@@ -1 +0,0 @@
1
- import{a as O,b as H,c as j,d as E,e as W,f as ne}from"./chunk-SP5O2MIX.js";import{a as N}from"./chunk-O32GJOUJ.js";import{b as X,k as T}from"./chunk-QMC2PLNM.js";import{D as I,E as y,G as L,o as S}from"./chunk-LYCLF26R.js";import{b as te}from"./chunk-QYADASLV.js";var ie={};te(ie,{CanvasMeasureAdapter:()=>$,CliMeasureAdapter:()=>D,ImageSizeAdapter:()=>J,NodeCanvasMeasureAdapter:()=>q,PrecomputedAdapter:()=>V,SvgBoundsAdapter:()=>z,analyzeAndMeasure:()=>O,carveTextLineSlots:()=>E,circleIntervalForBand:()=>Q,computeBlockFlow:()=>_,computeCharPositions:()=>W,computeFlowLines:()=>ee,computeLineBreaks:()=>H,computeTotalHeight:()=>U,layoutNextLine:()=>j,measureBlock:()=>Y,measureBlocks:()=>K,reactiveBlockLayout:()=>re,reactiveFlowLayout:()=>se,reactiveLayout:()=>ne,rectIntervalForBand:()=>Z});var D=class{cellPx;constructor(t){this.cellPx=t?.cellPx??8}measureSegment(t,n){return{width:X(t)*this.cellPx}}},G=class extends Error{name="KeyError"},V=class{metrics;fallback;constructor(t){this.metrics=t.metrics;let n=t.fallback??"per-char";if(n!=="per-char"&&n!=="error")throw new Error(`fallback must be 'per-char' or 'error', got ${JSON.stringify(t.fallback)}`);this.fallback=n}measureSegment(t,n){let i=this.metrics[n];if(i){let o=i[t];if(o!==void 0)return{width:o}}if(this.fallback==="error")throw new G(`PrecomputedAdapter: no metrics for segment ${JSON.stringify(t)} in font ${JSON.stringify(n)}`);let r=0;if(i)for(let o of t){let l=i[o];l!==void 0&&(r+=l)}return{width:r}}},$=class{ctx=null;currentFont="";emojiCorrection;constructor(t){this.emojiCorrection=t?.emojiCorrection??1}getContext(){if(!this.ctx){if(typeof OffscreenCanvas>"u")throw new Error("CanvasMeasureAdapter requires a browser environment with OffscreenCanvas support. Use CliMeasureAdapter or NodeCanvasMeasureAdapter for Node.js.");let n=new OffscreenCanvas(0,0).getContext("2d");if(!n)throw new Error("CanvasMeasureAdapter: failed to get 2d context");this.ctx=n}return this.ctx}measureSegment(t,n){let i=this.getContext();n!==this.currentFont&&(i.font=n,this.currentFont=n);let r=i.measureText(t).width;return this.emojiCorrection!==1&&new RegExp("\\p{Emoji_Presentation}","u").test(t)&&(r*=this.emojiCorrection),{width:r}}clearCache(){this.currentFont=""}},q=class{ctx=null;currentFont="";canvasModule;constructor(t){this.canvasModule=t}getContext(){if(!this.ctx){let n=this.canvasModule.createCanvas(0,0).getContext("2d");if(!n)throw new Error("NodeCanvasMeasureAdapter: failed to get 2d context");this.ctx=n}return this.ctx}measureSegment(t,n){let i=this.getContext();return n!==this.currentFont&&(i.font=n,this.currentFont=n),{width:i.measureText(t).width}}clearCache(){this.currentFont=""}},z=class{measureSvg(t){let n=t.match(/viewBox\s*=\s*["']([^"']+)["']/);if(n){let o=n[1].trim().split(/[\s,]+/);if(o.length>=4){let l=Number.parseFloat(o[2]),a=Number.parseFloat(o[3]);if(Number.isFinite(l)&&Number.isFinite(a)&&l>0&&a>0)return{width:l,height:a};throw new Error("SvgBoundsAdapter: viewBox width/height are missing, non-finite, or not positive")}}let i=t.match(/<svg[^>]*\bwidth\s*=\s*["']?([\d.]+)/),r=t.match(/<svg[^>]*\bheight\s*=\s*["']?([\d.]+)/);if(i&&r){let o=Number.parseFloat(i[1]),l=Number.parseFloat(r[1]);if(Number.isFinite(o)&&Number.isFinite(l)&&o>0&&l>0)return{width:o,height:l};throw new Error("SvgBoundsAdapter: svg width/height attributes are non-finite or not positive")}throw new Error("SvgBoundsAdapter: cannot determine dimensions \u2014 SVG has no viewBox or width/height attributes")}},J=class{sizes;constructor(t){this.sizes=new Map(Object.entries(t))}measureImage(t){let n=this.sizes.get(t);if(!n)throw new Error(`ImageSizeAdapter: no dimensions registered for ${JSON.stringify(t)}`);return{width:n.width,height:n.height}}};function Y(e,t,n,i,r,o,l){switch(e.type){case"text":{let a=e.font??r,m=e.lineHeight??o,d=O(e.text,a,n.text,i),w=H(d,t,n.text,a,i),v=W(w,d,m),B=w.lineCount*m,c=0;for(let x of w.lines)x.width>c&&(c=x.width);return{index:l,type:"text",width:Math.min(c,t),height:B,textSegments:d,textLineBreaks:w,textCharPositions:v}}case"image":{let a,m;if(e.naturalWidth!=null&&e.naturalHeight!=null)a=e.naturalWidth,m=e.naturalHeight;else if(n.image){let d=n.image.measureImage(e.src);a=d.width,m=d.height}else throw new Error(`Image block at index ${l} has no naturalWidth/naturalHeight and no ImageMeasurer adapter`);return a>t&&(m=m*t/a,a=t),{index:l,type:"image",width:a,height:m}}case"svg":{let a,m;if(e.viewBox)a=e.viewBox.width,m=e.viewBox.height;else if(n.svg){let d=n.svg.measureSvg(e.content);a=d.width,m=d.height}else throw new Error(`SVG block at index ${l} has no viewBox and no SvgMeasurer adapter`);return a>t&&(m=m*t/a,a=t),{index:l,type:"svg",width:a,height:m}}}}function K(e,t,n,i,r,o){return e.map((l,a)=>Y(l,t,n,i,r,o,a))}function _(e,t){let n=[],i=0;for(let r=0;r<e.length;r++){let o=e[r];n.push({...o,x:0,y:i}),i+=o.height+(r<e.length-1?t:0)}return n}function U(e){if(e.length===0)return 0;let t=e[e.length-1];return t.y+t.height}function re(e){let{adapters:t,name:n="reactive-block-layout",defaultFont:i="16px sans-serif",defaultLineHeight:r=20}=e,o=new T(n),l=new Map,a=y(e.blocks??[],{name:"blocks"}),m=y(Math.max(0,e.maxWidth??800),{name:"max-width"}),d=y(e.gap??0,{name:"gap"}),w=I([a,m],(c,x,s)=>{let p=c[0]!=null&&c[0].length>0?c[0].at(-1):s.prevData[0],h=c[1]!=null&&c[1].length>0?c[1].at(-1):s.prevData[1],g=S(),u=K(p,h,t,l,i,r),f=S()-g,b=w.meta;b&&(N(b["block-count"],u.length),N(b["layout-time-ns"],f)),x.emit(u);let C=()=>{l.clear(),t.text.clearCache?.()};return{deactivate:C,invalidate:C}},{name:"measured-blocks",describeKind:"derived",meta:{"block-count":0,"layout-time-ns":0},equals:(c,x)=>{let s=c,p=x;if(s==null||p==null)return s===p;if(s.length!==p.length)return!1;for(let h=0;h<s.length;h++){let g=s[h],u=p[h];if(g.type!==u.type||g.width!==u.width||g.height!==u.height||g.index!==u.index)return!1}return!0}}),v=L([w,d],([c,x])=>_(c,x),{name:"block-flow",equals:(c,x)=>{let s=c,p=x;if(s==null||p==null)return s===p;if(s.length!==p.length)return!1;for(let h=0;h<s.length;h++){let g=s[h],u=p[h];if(g.x!==u.x||g.y!==u.y||g.width!==u.width||g.height!==u.height)return!1}return!0}}),B=L([v],([c])=>U(c),{name:"total-height"});return o.add(a,{name:"blocks"}),o.add(m,{name:"max-width"}),o.add(d,{name:"gap"}),o.add(w,{name:"measured-blocks"}),o.add(v,{name:"block-flow"}),o.add(B,{name:"total-height"}),{graph:o,setBlocks:c=>o.set("blocks",c),setMaxWidth:c=>o.set("max-width",Math.max(0,c)),setGap:c=>o.set("gap",c),measuredBlocks:w,blockFlow:v,totalHeight:B}}function Q(e,t,n){let i=e.hPad??0,r=e.vPad??0,o=t-r,l=n+r;if(o>=e.cy+e.r||l<=e.cy-e.r)return null;let a=e.cy>=o&&e.cy<=l?0:e.cy<o?o-e.cy:e.cy-l;if(a>=e.r)return null;let m=Math.sqrt(e.r*e.r-a*a);return{left:e.cx-m-i,right:e.cx+m+i}}function Z(e,t,n){let i=e.hPad??0,r=e.vPad??0;return n<=e.y-r||t>=e.y+e.h+r?null:{left:e.x-i,right:e.x+e.w+i}}function oe(e,t,n){return e.kind==="circle"?Q(e,t,n):Z(e,t,n)}function ee(e,t,n,i,r,o,l){let a=l?.paragraphSpacing??r,m=[],d={segmentIndex:0,graphemeIndex:0};if(e.length===0||n.count<=0||r<=0)return{lines:m,cursor:d};let w=t.paddingX??0,v=t.paddingY??0,B=Math.max(0,t.width-w*2),c=Math.max(0,t.height-v*2),x=n.gap*Math.max(0,n.count-1),s=Math.max(0,(B-x)/n.count);if(s<=0)return{lines:m,cursor:d};e:for(let p=0;p<n.count;p++){let h=w+p*(s+n.gap),g=h+s,u=v;for(;u+r<=v+c;){let f=u+r,b=[];for(let k=0;k<i.length;k++){let M=oe(i[k],u,f);M!==null&&b.push(M)}let C=E({left:h,right:g},b,o);if(C.length===0){u+=r;continue}let P=!1;for(let k=0;k<C.length;k++){let M=C[k],R=M.right-M.left,F=j(e,d,R);if(F===null)return{lines:m,cursor:d};if(F.text.length===0&&F.width===0){d=F.end,P=!0;break}m.push({x:M.left,y:u,width:F.width,slotWidth:R,text:F.text,columnIndex:p,flushToRight:M.right<g-.5}),d=F.end}if(P){u+=a;continue}if(u+=r,d.segmentIndex>=e.length)break e}if(d.segmentIndex>=e.length)break}return{lines:m,cursor:d}}function se(e){let{adapter:t,name:n="reactive-flow-layout",minSlotWidth:i=20}=e,r=new T(n),o=new Map,l=y(e.text??"",{name:"text"}),a=y(e.font??"16px sans-serif",{name:"font"}),m=y(e.lineHeight??20,{name:"line-height"}),d=y(e.container??{width:800,height:600,paddingX:0,paddingY:0},{name:"container"}),w=y(e.columns??{count:1,gap:0},{name:"columns"}),v=y(e.obstacles??[],{name:"obstacles"}),B=y(e.paragraphSpacing??null,{name:"paragraph-spacing"}),c=I([l,a],(s,p,h)=>{let g=s[0],u=g!=null&&g.length>0?g.at(-1):h.prevData[0],f=s[1],b=f!=null&&f.length>0?f.at(-1):h.prevData[1],C=O(u,b,t,o);p.emit(C);let P=()=>{o.clear(),t.clearCache?.()};return{deactivate:P,invalidate:P}},{name:"segments",describeKind:"derived"}),x=L([c,d,w,v,m,B],([s,p,h,g,u,f])=>{let b=s,C=S(),P=f??u,{lines:k,cursor:M}=ee(b,p,h,g,u,i,{paragraphSpacing:P}),R=S()-C,F=Math.max(0,b.length-M.segmentIndex),A=x.meta;return A&&(N(A["line-count"],k.length),N(A["layout-time-ns"],R),N(A["overflow-segments"],F)),k},{name:"flow-lines",meta:{"line-count":0,"layout-time-ns":0,"overflow-segments":0},equals:(s,p)=>{let h=s,g=p;if(h.length!==g.length)return!1;for(let u=0;u<h.length;u++){let f=h[u],b=g[u];if(f.x!==b.x||f.y!==b.y||f.width!==b.width||f.slotWidth!==b.slotWidth||f.text!==b.text||f.columnIndex!==b.columnIndex||f.flushToRight!==b.flushToRight)return!1}return!0}});return r.add(l,{name:"text"}),r.add(a,{name:"font"}),r.add(m,{name:"line-height"}),r.add(d,{name:"container"}),r.add(w,{name:"columns"}),r.add(v,{name:"obstacles"}),r.add(B,{name:"paragraph-spacing"}),r.add(c,{name:"segments"}),r.add(x,{name:"flow-lines"}),{graph:r,setText:s=>r.set("text",s),setFont:s=>r.set("font",s),setLineHeight:s=>r.set("line-height",s),setContainer:s=>r.set("container",s),setColumns:s=>r.set("columns",s),setObstacles:s=>r.set("obstacles",s),setParagraphSpacing:s=>r.set("paragraph-spacing",s),segments:c,flowLines:x}}export{D as a,V as b,$ as c,q as d,z as e,J as f,Y as g,K as h,_ as i,U as j,re as k,Q as l,Z as m,ee as n,se as o,ie as p};
@@ -1 +0,0 @@
1
- import{a as Xt,b as Yt}from"./chunk-FAYEMS5M.js";import{$ as qt,A as vt,B as xt,C as Tt,D as wt,E as Et,F as Nt,G as Mt,H as St,I as Rt,J as Wt,K as Ot,L as Bt,M as It,N as Lt,O as jt,P as Ct,Q as Vt,R as Pt,S as At,T as zt,U as Kt,V as Dt,W as Ut,X as _t,Y as $t,Z as Ft,_ as Ht,a as rn,aa as Gt,b as on,ba as tr,c as Qn,d as Xn,e as Yn,f as Zn,g as et,h as nt,i as tt,j as rt,k as ot,l as st,m as it,n as at,o as ct,p as dt,q as ft,r as ut,s as pt,t as lt,u as mt,v as gt,w as bt,x as yt,y as kt,z as ht}from"./chunk-K5C67OGE.js";import{a as Z,b as ee,c as ne,d as te,e as re,f as oe,g as se,h as ie,i as ae,j as ce,k as de}from"./chunk-XIMFHEKV.js";import{b as Zt,c as er,d as nr,e as ar,f as cr}from"./chunk-B5S7KTGP.js";import{a as Tr}from"./chunk-4BDQXBXE.js";import{a as be,b as Ze}from"./chunk-5QDBSZBV.js";import{a as fe}from"./chunk-QMC2PLNM.js";import{a as Y}from"./chunk-ESMPEKEV.js";import{a as ur,b as pr,c as lr,d as mr,e as gr,f as br,g as yr,h as kr,i as hr,j as vr,k as xr}from"./chunk-D5RFJOZ2.js";import{a as dr,b as fr}from"./chunk-CE72X3WO.js";import{A as Rn,B as Wn,C as On,D as Bn,E as In,F as Ln,G as jn,I as Cn,J as Vn,K as Pn,L as An,M as zn,N as Kn,O as Dn,P as Un,Q as _n,R as $n,S as Fn,T as Hn,U as qn,V as Gn,W as Jn,a as U,b as J,c as sn,d as an,e as cn,f as dn,g as fn,h as un,i as Q,j as pn,k as ln,l as mn,m as gn,n as bn,o as yn,p as kn,q as hn,r as vn,s as xn,t as X,u as Tn,v as wn,w as En,x as Nn,y as Mn,z as Sn}from"./chunk-6773HURD.js";import{c as he,d as ve,e as xe,f as Te,g as we,h as Ee,i as Ne}from"./chunk-4VVTGLXJ.js";import{a as rr,b as or}from"./chunk-NNKJUORL.js";import{a as sr,b as ir}from"./chunk-KGKJCHEK.js";import{a as Jt,b as Qt}from"./chunk-TZQPPQEQ.js";import{a as en,b as nn,c as tn}from"./chunk-7KZZLWZ6.js";import{A as Je,B as Qe,C as Xe,D as Ye,a as ye,b as ke,c as Me,d as Se,e as Re,f as G,g as We,h as Oe,i as Be,j as Ie,k as Le,l as je,m as Ce,n as Ve,o as Pe,p as Ae,q as ze,r as Ke,s as De,t as Ue,u as _e,v as $e,w as Fe,x as He,y as qe,z as Ge}from"./chunk-RZ5HKPGI.js";import{A as K,D as j,E as O,H as D,m as B}from"./chunk-LYCLF26R.js";import{b as h,e as $,f as F,g as H,h as S,i as q,j as W}from"./chunk-CK2E7BTU.js";import{b as ge}from"./chunk-QYADASLV.js";var Wr={};ge(Wr,{CircuitOpenError:()=>ee,ContentAddressedMissError:()=>Zt,NS_PER_MS:()=>NS_PER_MS,NS_PER_SEC:()=>NS_PER_SEC,NativeIndexBackend:()=>rr,NativeListBackend:()=>sr,NativeLogBackend:()=>en,NativeMapBackend:()=>Jt,NativePubSubBackend:()=>_,RateLimiterOverflowError:()=>oe,ResettableTimer:()=>Y,TimeoutError:()=>ae,appendLogStorage:()=>gr,audit:()=>jn,awaitSettled:()=>Ge,buffer:()=>Cn,bufferCount:()=>Vn,bufferTime:()=>An,cached:()=>Fe,canonicalJson:()=>er,cascadingCache:()=>wr,catchError:()=>Jn,checkpointToRedis:()=>Ut,checkpointToS3:()=>Dt,circuitBreaker:()=>ne,combine:()=>vn,combineLatest:()=>Hn,concat:()=>wn,concatMap:()=>Sn,constant:()=>he,contentAddressedStorage:()=>nr,createTransport:()=>L,createWatermarkController:()=>Ze,csvRows:()=>wt,debounce:()=>Bn,debounceTime:()=>qn,decorrelatedJitter:()=>we,defer:()=>Ke,delay:()=>On,deserializeError:()=>A,dictKv:()=>vr,dictSnapshot:()=>xr,distill:()=>Yt,distinctUntilChanged:()=>kn,elementAt:()=>mn,empty:()=>Pe,escapeRegexChar:()=>Me,exhaustMap:()=>Mn,exponential:()=>xe,externalBundle:()=>on,externalProducer:()=>rn,fallback:()=>ce,fibonacci:()=>Te,filter:()=>J,find:()=>ln,first:()=>Q,firstValueFrom:()=>He,firstWhere:()=>qe,flatMap:()=>Wn,forEach:()=>De,fromAny:()=>Ce,fromAsyncIter:()=>je,fromCSV:()=>Tt,fromClickHouseWatch:()=>Mt,fromCron:()=>Oe,fromDrizzle:()=>qt,fromEvent:()=>Be,fromHTTP:()=>Zn,fromHTTPPoll:()=>at,fromHTTPStream:()=>it,fromIter:()=>Ie,fromKafka:()=>kt,fromKysely:()=>Gt,fromMCP:()=>ft,fromNATS:()=>Wt,fromNDJSON:()=>Nt,fromOTel:()=>ut,fromPrisma:()=>Ht,fromPrometheus:()=>bt,fromPromise:()=>Le,fromPulsar:()=>St,fromRabbitMQ:()=>Bt,fromRaf:()=>We,fromRedisStream:()=>vt,fromSSE:()=>st,fromSqlite:()=>_t,fromSqliteCursor:()=>$t,fromStatsD:()=>mt,fromSyslog:()=>pt,fromTimer:()=>G,fromWebSocket:()=>Xn,fromWebSocketReconnect:()=>dt,fromWebhook:()=>Yn,globToRegExp:()=>Se,interval:()=>Dn,jsonCodec:()=>ur,jsonCodecFor:()=>pr,keepalive:()=>Xe,kvStorage:()=>br,last:()=>pn,linear:()=>ve,lru:()=>ue,makeHttpError:()=>tr,map:()=>U,matchesAnyPattern:()=>Re,matchesCron:()=>ke,memoryAppendLog:()=>kr,memoryBackend:()=>lr,memoryKv:()=>hr,memorySnapshot:()=>yr,merge:()=>X,mergeMap:()=>Rn,mergeReactiveLogs:()=>tn,nameToSignal:()=>V,ndjsonRows:()=>Et,never:()=>Ae,nodeSignal:()=>Je,of:()=>Ve,onFirstData:()=>bn,pairwise:()=>hn,parseCron:()=>ye,parsePrometheusText:()=>yt,parseSSEStream:()=>ot,parseStatsD:()=>gt,parseSyslog:()=>lt,pausable:()=>_n,pubsub:()=>Er,race:()=>En,rateLimiter:()=>se,reactiveCounter:()=>Ye,reactiveIndex:()=>or,reactiveList:()=>ir,reactiveLog:()=>nn,reactiveMap:()=>Qt,reactiveSink:()=>Qn,reduce:()=>an,repeat:()=>Un,replay:()=>$e,rescue:()=>$n,resolveBackoffPreset:()=>Ne,retry:()=>Z,sample:()=>Ln,scan:()=>sn,serializeError:()=>P,share:()=>_e,shareReplay:()=>Qe,signalToName:()=>I,singleFromAny:()=>ar,singleNodeFromAny:()=>cr,skip:()=>dn,snapshotStorage:()=>mr,sortJsonValue:()=>dr,stableJsonString:()=>fr,stratify:()=>Tr,switchMap:()=>Nn,take:()=>cn,takeUntil:()=>un,takeWhile:()=>fn,tap:()=>gn,tapFirst:()=>yn,throttle:()=>In,throttleTime:()=>Gn,throwError:()=>ze,timeout:()=>de,toArray:()=>Ue,toCSV:()=>jt,toClickHouse:()=>Ct,toFile:()=>Lt,toHTTP:()=>et,toKafka:()=>ht,toLoki:()=>zt,toMongo:()=>At,toNATS:()=>Ot,toObservable:()=>be,toPostgres:()=>Pt,toPulsar:()=>Rt,toRabbitMQ:()=>It,toReadableStream:()=>rt,toRedisStream:()=>xt,toS3:()=>Vt,toSSE:()=>nt,toSSEBytes:()=>tt,toSqlite:()=>Ft,toTempo:()=>Kt,toWebSocket:()=>ct,tokenBucket:()=>re,topologyDiff:()=>fe,valve:()=>Fn,verifiable:()=>Xt,window:()=>Kn,windowCount:()=>Pn,windowTime:()=>zn,withBreaker:()=>te,withLatestFrom:()=>xn,withMaxAttempts:()=>Ee,withStatus:()=>ie,workerBridge:()=>le,workerSelf:()=>me,zip:()=>Tn});function ue(){let e=new Map,r=null,n=null;function p(t){t.prev?t.prev.next=t.next:r=t.next,t.next?t.next.prev=t.prev:n=t.prev,t.prev=null,t.next=null}function l(t){t.next=r,t.prev=null,r&&(r.prev=t),r=t,n===null&&(n=t)}return{insert(t){if(e.has(t)){this.touch(t);return}let f={key:t,prev:null,next:null};e.set(t,f),l(f)},touch(t){let f=e.get(t);f&&(p(f),l(f))},delete(t){let f=e.get(t);f&&(p(f),e.delete(t))},evict(t){let f=[];for(let v=0;v<t&&n!==null;v++){let N=n;f.push(N.key),p(N),e.delete(N.key)}return f},size(){return e.size}}}function pe(e){return e!=null&&typeof e.then=="function"}function C(e){pe(e)&&e.catch(()=>{})}function wr(e,r){let n=new Map,p=r?.maxSize??0,l=p>0?r?.eviction??ue():null,t=r?.writeThrough??!1;function f(o,u,m){for(let g=0;g<m;g++)try{C(e[g].save(o,u))}catch{}}function v(o,u,m=0){for(let g=m;g<e.length;g++){let w;try{w=e[g].load(o)}catch{continue}if(pe(w)){let T=g;w.then(M=>{M!==void 0?(u.down([[h,M]]),f(o,M,T)):v(o,u,T+1)},()=>{v(o,u,T+1)});return}if(w!==void 0){u.down([[h,w]]),f(o,w,g);return}}}function N(){if(!(!l||p<=0))for(;l.size()>=p;){let o=l.evict(1);if(o.length===0)break;for(let u of o){let m=n.get(u);if(m){let g=m.cache;if(m.status!=="sentinel"&&e.length>0){let w=e.length-1;try{C(e[w].save(u,g))}catch{}for(let T=0;T<w;T++)try{let M=e[T].delete;M&&C(M.call(e[T],u))}catch{}}m.down([[S]])}n.delete(u)}}}return{load(o){let u=n.get(o);if(u)return l?.touch(o),u;l&&p>0&&l.size()>=p&&N();let m=O(void 0);return n.set(o,m),l?.insert(o),v(o,m),m},save(o,u){if(t)for(let g of e)try{C(g.save(o,u))}catch{}else if(e[0])try{C(e[0].save(o,u))}catch{}let m=n.get(o);if(m)m.down([[h,u]]),l?.touch(o);else{l&&p>0&&l.size()>=p&&N();let g=O(u);n.set(o,g),l?.insert(o)}},invalidate(o){let u=n.get(o);u&&v(o,u)},delete(o){l?.delete(o);let u=n.get(o);u&&u.down([[S]]),n.delete(o);for(let m of e)try{let g=m.delete;g&&C(g.call(m,o))}catch{}},has(o){return n.has(o)},get size(){return n.size}}}var _=class{_version=0;_topics=new Set;get version(){return this._version}get topicCount(){return this._topics.size}hasTopic(r){return this._topics.has(r)}topicNames(){return this._topics.values()}createTopic(r){return this._topics.has(r)?!1:(this._topics.add(r),this._version+=1,!0)}removeTopic(r){let n=this._topics.delete(r);return n&&(this._version+=1),n}};function Er(e={}){let{backend:r}=e,n=r??new _,p=new Map;function l(t){let f=p.get(t);return f===void 0&&(f=j({describeKind:"state"}),p.set(t,f),n.createTopic(t)),f}return{topic(t){return l(t)},publish(t,f){l(t).emit(f)},publishMany(t){B(()=>{for(let[f,v]of t)l(f).emit(v)})},removeTopic(t){let f=p.get(t);return f===void 0?!1:(p.delete(t),n.removeTopic(t),f.down([[S]]),!0)},has(t){return n.hasTopic(t)},get size(){return n.topicCount},topicNames(){return n.topicNames()}}}var Nr=new Map([[$,"INVALIDATE"],[F,"PAUSE"],[H,"RESUME"],[S,"TEARDOWN"],[q,"COMPLETE"],[W,"ERROR"]]),Mr=new Map([["INVALIDATE",$],["PAUSE",F],["RESUME",H],["TEARDOWN",S],["COMPLETE",q],["ERROR",W]]);function I(e){let r=Nr.get(e);return r||(Symbol.keyFor(e)??"UNKNOWN")}function V(e){let r=Mr.get(e);if(r)return r;if(e&&e!=="UNKNOWN")return Symbol.for(e)}function P(e){return e instanceof Error?{message:e.message,name:e.name,stack:e.stack}:{message:String(e),name:"Error"}}function A(e){let r=new Error(e.message);return r.name=e.name,e.stack&&(r.stack=e.stack),r}function L(e){if(typeof MessagePort<"u"&&e instanceof MessagePort)return{post(r,n){e.postMessage(r,n??[])},listen(r){let n=p=>r(p.data);return e.addEventListener("message",n),e.start(),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof SharedWorker<"u"&&e instanceof SharedWorker)return L(e.port);if(typeof Worker<"u"&&e instanceof Worker)return{post(r,n){e.postMessage(r,n??[])},listen(r){let n=p=>r(p.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.terminate()}};if(typeof BroadcastChannel<"u"&&e instanceof BroadcastChannel)return{post(r,n){n&&n.length>0&&console.warn("[graphrefly] WorkerTransport: BroadcastChannel does not support Transferable objects. The transfer argument is ignored and objects will be cloned instead."),e.postMessage(r)},listen(r){let n=p=>r(p.data);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},terminate(){e.close()}};if(typeof ServiceWorker<"u"&&e instanceof ServiceWorker)return{post(r,n){e.postMessage(r,n??[])},listen(r){let n=p=>{p.source===e&&r(p.data)};return navigator.serviceWorker.addEventListener("message",n),()=>navigator.serviceWorker.removeEventListener("message",n)}};throw new Error("createTransport: unsupported target type. Expected Worker, SharedWorker, ServiceWorker, BroadcastChannel, or MessagePort.")}function Sr(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function le(e,r){let n=Sr(e)?e:L(e),p=r.name??"workerBridge",l=Object.entries(r.expose??{}),t=r.import??[],f=r.transfer??{},v=O("connecting",{name:`${p}::meta::status`}),N=O(null,{name:`${p}::meta::error`}),o=new Map,u=new Map;for(let c of t){let a=O(void 0,{name:`${p}::${c}`});o.set(c,a)}let m;if(l.length>0){let c=l.map(([,d])=>d),a=j(c,(d,i)=>{let k={};for(let y=0;y<l.length;y++){let[R]=l[y],E=d[y];E!=null&&E.length>0&&(k[R]=E.at(-1))}Object.keys(k).length!==0&&i.emit(k)},{name:`${p}::aggregated`,partial:!0});m=D([a],d=>{let i=d[0];if(i==null||Object.keys(i).length===0)return;let k=[];for(let E of Object.keys(i)){let z=f[E];z&&k.push(...z(i[E]))}let y;for(let[E,z]of l)E in i&&z.v!=null&&(y==null&&(y={}),y[E]=z.v.version);let R={t:"b",u:i,...y?{v:y}:{}};try{n.post(R,k.length>0?k:void 0)}catch(E){N.down([[h,E instanceof Error?E:new Error(String(E))]])}}).subscribe(()=>{})}let g=!1,w=n.listen(c=>{if(g)return;let a=c;switch(a.t){case"r":{B(()=>{for(let[d,i]of Object.entries(a.stores)){let k=o.get(d);k&&k.down([[h,i]])}}),v.down([[h,"connected"]]);let s={};for(let[d,i]of l)s[d]=i.cache;n.post({t:"i",stores:s});break}case"v":{let s=o.get(a.s);s&&s.down([[h,a.d]]);break}case"b":{B(()=>{for(let[s,d]of Object.entries(a.u)){let i=a.v?.[s];if(i!=null){let y=u.get(s);if(y!=null&&i<=y)continue;u.set(s,i)}let k=o.get(s);k&&k.down([[h,d]])}});break}case"e":{let s=o.get(a.s);s&&s.down([[W,A(a.err)]]);break}case"s":{let s=V(a.sig);if(!s)break;let d=a.s==="*"?[...o.values()]:o.has(a.s)?[o.get(a.s)]:[];for(let i of d)i.down(a.d===void 0?[[s]]:[[s,a.d]]);break}}}),T=[];for(let[c,a]of l){let s=a.subscribe((d=>{if(!g)for(let i of d){let k=i[0];k!==h&&(K.isLocalOnly(k)||(k===W?n.post({t:"e",s:c,err:P(i[1])}):n.post({t:"s",s:c,sig:I(k),d:i.length>1?i[1]:void 0})))}}));T.push(s)}let M;if(r.timeoutMs!=null&&r.timeoutMs>0){let c=G(r.timeoutMs),a=J(v,d=>d==="connected");M=Q(X(U(c,()=>"timeout"),U(a,()=>"ready"))).subscribe(d=>{for(let i of d)i[0]===h&&i[1]==="timeout"&&(N.down([[h,new Error("Worker bridge handshake timeout")]]),x())})}function x(){if(!g){g=!0,M?.(),n.post({t:"s",s:"*",sig:I(S)}),m&&m();for(let c of T)c();T.length=0,w(),v.down([[h,"closed"]]),u.clear(),o.clear()}}let b={meta:{status:v,error:N},destroy:x};for(let[c,a]of o)b[c]=a;return b}function Rr(e){return typeof e=="object"&&e!==null&&typeof e.post=="function"&&typeof e.listen=="function"}function me(e,r){let n=Rr(e)?e:L(e),p=r.import??[],l=r.transfer??{},t=new Map,f=new Map,v={};for(let x of p){let b=O(void 0,{name:`worker::${x}`});t.set(x,b),v[x]=b}let N=r.expose(v),o=Object.entries(N),u,m=!1;if(o.length>0){let x=o.map(([,a])=>a),b=j(x,(a,s)=>{let d={};for(let i=0;i<o.length;i++){let[k]=o[i],y=a[i];y!=null&&y.length>0&&(d[k]=y.at(-1))}Object.keys(d).length!==0&&s.emit(d)},{name:"workerSelf::aggregated",partial:!0});u=D([b],a=>{if(m)return;let s=a[0];if(s==null||Object.keys(s).length===0)return;let d=[];for(let y of Object.keys(s)){let R=l[y];R&&d.push(...R(s[y]))}let i;for(let[y,R]of o)y in s&&R.v!=null&&(i==null&&(i={}),i[y]=R.v.version);let k={t:"b",u:s,...i?{v:i}:{}};try{n.post(k,d.length>0?d:void 0)}catch{}}).subscribe(()=>{})}let g=[];for(let[x,b]of o){let c=b.subscribe((a=>{if(!m)for(let s of a){let d=s[0];d!==h&&(K.isLocalOnly(d)||(d===W?n.post({t:"e",s:x,err:P(s[1])}):n.post({t:"s",s:x,sig:I(d),d:s.length>1?s[1]:void 0})))}}));g.push(c)}let w=n.listen(x=>{if(m)return;let b=x;switch(b.t){case"i":{B(()=>{for(let[c,a]of Object.entries(b.stores)){let s=t.get(c);s&&s.down([[h,a]])}});break}case"v":{let c=t.get(b.s);c&&c.down([[h,b.d]]);break}case"b":{B(()=>{for(let[c,a]of Object.entries(b.u)){let s=b.v?.[c];if(s!=null){let i=f.get(c);if(i!=null&&s<=i)continue;f.set(c,s)}let d=t.get(c);d&&d.down([[h,a]])}});break}case"e":{let c=t.get(b.s);c&&c.down([[W,A(b.err)]]);break}case"s":{let c=V(b.sig);if(!c)break;if(c===S&&b.s==="*"){M();return}let a=b.s==="*"?[...t.values()]:t.has(b.s)?[t.get(b.s)]:[];for(let s of a)s.down(b.d===void 0?[[c]]:[[c,b.d]]);break}}}),T={};for(let[x,b]of o)T[x]=b.cache;n.post({t:"r",stores:T});function M(){if(!m){m=!0,u&&u();for(let x of g)x();g.length=0,w(),n.terminate?.(),f.clear(),t.clear()}}return{destroy:M}}export{ue as a,wr as b,_ as c,Er as d,I as e,V as f,P as g,A as h,L as i,le as j,me as k,Wr as l};
@@ -1,80 +0,0 @@
1
- import{b as V}from"./chunk-XLMYQB6F.js";import{h as U,k as W}from"./chunk-QMC2PLNM.js";import{E as D,F as P,G as J,H as I}from"./chunk-LYCLF26R.js";import{b as oe}from"./chunk-QYADASLV.js";var me={};oe(me,{compileSpec:()=>pe,decompileGraph:()=>Z,decompileSpec:()=>de,extractFnFactory:()=>H,extractSourceFactory:()=>Q,generateCatalogPrompt:()=>X,isRichFnEntry:()=>L,isRichSourceEntry:()=>q,llmCompose:()=>ue,llmRefine:()=>ne,specDiff:()=>le,validateSpec:()=>T,validateSpecAgainstCatalog:()=>Y});function L(r){return typeof r=="object"&&r!==null&&"factory"in r}function q(r){return typeof r=="object"&&r!==null&&"factory"in r}function H(r){return L(r)?r.factory:r}function Q(r){return q(r)?r.factory:r}function B(r){let t=r.meta;if(!t||typeof t.factory!="string")return r;let s=t.factory,a=t.factoryArgs??{},i={...r},f=!1;if(r.type==="producer"?i.source==null&&i.fn==null&&(i.source=s,f=!0):i.fn==null&&(i.fn=s,f=!0),i.config==null&&(i.config=a),!f&&(i.meta??t)===t){let l={...t};delete l.factory,delete l.factoryArgs,Object.keys(l).length>0?i.meta=l:i.meta=void 0}return i}function se(r){let t={},s=!1;for(let[l,n]of Object.entries(r.nodes)){if(n.type==="template"){t[l]=n;continue}let c=B(n);t[l]=c,c!==n&&(s=!0)}let a=r.templates,i;if(a){i={};for(let[l,n]of Object.entries(a)){let c={},o=!1;for(let[S,N]of Object.entries(n.nodes)){let w=B(N);c[S]=w,w!==N&&(o=!0)}i[l]=o?{...n,nodes:c}:n,o&&(s=!0)}}if(!s)return r;let f={...r,nodes:t};return i&&(f.templates=i),f}function X(r){let t=[];if(r.fns){let s=new Map;for(let[a,i]of Object.entries(r.fns)){let f=L(i)?i.tags?.[0]??"Other":"Other";s.has(f)||s.set(f,[]),s.get(f).push(re(a,i))}for(let[a,i]of s)t.push(`${a}:
2
- ${i.join(`
3
- `)}`)}if(r.sources){let s=[];for(let[a,i]of Object.entries(r.sources))s.push(ae(a,i));s.length>0&&t.push(`Sources:
4
- ${s.join(`
5
- `)}`)}return t.join(`
6
-
7
- `)}function re(r,t){if(!L(t))return`- ${r}`;let s=`- ${r}: ${t.description}`;if(t.configSchema){let a=Object.entries(t.configSchema).map(([i,f])=>{let l=`${i}: ${f.type}`;return f.enum&&(l+=` (${f.enum.join("|")})`),f.required===!1&&(l+="?"),l});s+=`. Config: { ${a.join(", ")} }`}return s}function ae(r,t){if(!q(t))return`- ${r}`;let s=`- ${r}: ${t.description}`;if(t.configSchema){let a=Object.entries(t.configSchema).map(([i,f])=>{let l=`${i}: ${f.type}`;return f.required===!1&&(l+="?"),l});s+=`. Config: { ${a.join(", ")} }`}return s}function Y(r,t){let s=[],a=new Set(Object.keys(t.fns??{})),i=new Set(Object.keys(t.sources??{}));for(let[f,l]of Object.entries(r.nodes)){if(l.type==="template")continue;let n=l;if(n.fn&&a.size>0&&!a.has(n.fn))if(i.has(n.fn))s.push(`Node "${f}": fn "${n.fn}" is a source, not a function. Use it as a producer source instead, or use a function from: ${[...a].join(", ")}`);else{let c=z(n.fn,a);s.push(`Node "${f}": fn "${n.fn}" not found in catalog`+(c?`. Did you mean "${c}"?`:""))}if(n.source&&i.size>0&&!i.has(n.source))if(a.has(n.source))s.push(`Node "${f}": source "${n.source}" is a function, not a source. Use it as fn instead, or use a source from: ${[...i].join(", ")}`);else{let c=z(n.source,i);s.push(`Node "${f}": source "${n.source}" not found in catalog`+(c?`. Did you mean "${c}"?`:""))}if(n.fn&&n.config&&t.fns?.[n.fn]){let c=t.fns[n.fn];if(L(c)&&c.configSchema){for(let[o,S]of Object.entries(c.configSchema))if(S.required!==!1&&!(o in n.config)&&s.push(`Node "${f}": config missing required field "${o}"`),o in n.config&&S.enum){let N=n.config[o];S.enum.includes(N)||s.push(`Node "${f}": config.${o} = ${JSON.stringify(N)}, expected one of: ${S.enum.join(", ")}`)}}}}if(r.templates){for(let[f,l]of Object.entries(r.templates))for(let[n,c]of Object.entries(l.nodes))if(c.fn&&a.size>0&&!a.has(c.fn)){let o=z(c.fn,a);s.push(`Template "${f}" node "${n}": fn "${c.fn}" not found in catalog`+(o?`. Did you mean "${o}"?`:""))}}return{valid:s.length===0,errors:s,warnings:[]}}function z(r,t){let s=null,a=1/0,i=r.toLowerCase();for(let f of t){let l=ie(i,f.toLowerCase());l<a&&l<=Math.max(3,Math.floor(r.length/2))&&(a=l,s=f)}return s}function ie(r,t){let s=r.length,a=t.length,i=Array.from({length:s+1},(f,l)=>Array.from({length:a+1},(n,c)=>l===0?c:c===0?l:0));for(let f=1;f<=s;f++)for(let l=1;l<=a;l++)i[f][l]=r[f-1]===t[l-1]?i[f-1][l-1]:1+Math.min(i[f-1][l],i[f][l-1],i[f-1][l-1]);return i[s][a]}var K=new Set(["state","producer","derived","effect","operator","template"]),ce=new Set(["state","producer","derived","effect","operator"]);function T(r){let t=[],s=[];if(r==null||typeof r!="object")return{valid:!1,errors:["GraphSpec must be a non-null object"],warnings:s};let a=r;if((typeof a.name!="string"||a.name.length===0)&&t.push("Missing or empty 'name' field"),a.nodes==null||typeof a.nodes!="object"||Array.isArray(a.nodes))return t.push("Missing or invalid 'nodes' field (must be an object)"),{valid:!1,errors:t,warnings:s};let i=new Set(Object.keys(a.nodes)),f=new Map,l=new Map;if(a.templates!=null&&typeof a.templates=="object"&&!Array.isArray(a.templates)){for(let[n,c]of Object.entries(a.templates))if(c!=null&&typeof c=="object"){let o=c;l.set(n,{params:Array.isArray(o.params)?o.params:[]})}}if(a.templates!=null)if(typeof a.templates!="object"||Array.isArray(a.templates))t.push("'templates' must be an object");else for(let[n,c]of Object.entries(a.templates)){if(c==null||typeof c!="object"){t.push(`Template "${n}": must be an object`);continue}let o=c;if(Array.isArray(o.params)||t.push(`Template "${n}": missing 'params' array`),o.nodes==null||typeof o.nodes!="object"||Array.isArray(o.nodes))t.push(`Template "${n}": missing or invalid 'nodes' object`);else{let S=new Set(Array.isArray(o.params)?o.params:[]),N=new Set(Object.keys(o.nodes));for(let[w,g]of Object.entries(o.nodes)){if(g==null||typeof g!="object"){t.push(`Template "${n}" node "${w}": must be an object`);continue}let u=g;if((typeof u.type!="string"||!ce.has(u.type))&&t.push(`Template "${n}" node "${w}": invalid type`),Array.isArray(u.deps))for(let b of u.deps)!N.has(b)&&!S.has(b)&&t.push(`Template "${n}" node "${w}": dep "${b}" is not an inner node or param`)}typeof o.output!="string"?t.push(`Template "${n}": missing 'output' string`):o.nodes[o.output]||t.push(`Template "${n}": output "${o.output}" is not a declared node`)}}for(let[n,c]of Object.entries(a.nodes)){if(c==null||typeof c!="object"){t.push(`Node "${n}": must be an object`);continue}let o=c;if(typeof o.type!="string"||!K.has(o.type)){t.push(`Node "${n}": invalid type "${String(o.type)}" (expected: ${[...K].join(", ")})`);continue}if(f.set(n,o.type),o.type==="template")if(typeof o.template!="string"||!l.has(o.template))t.push(`Node "${n}": template "${String(o.template)}" not found in templates`);else if(o.bind==null||typeof o.bind!="object"||Array.isArray(o.bind))t.push(`Node "${n}": template ref requires 'bind' object`);else{let S=l.get(o.template),N=o.bind;for(let w of S.params)w in N||t.push(`Node "${n}": template param "${w}" is not bound (template "${o.template}")`);for(let[,w]of Object.entries(N))typeof w=="string"&&!i.has(w)&&t.push(`Node "${n}": bind target "${w}" does not reference an existing node`)}else{if(Array.isArray(o.deps))for(let S of o.deps)S===n?t.push(`Node "${n}": self-referencing dep`):i.has(S)||t.push(`Node "${n}": dep "${S}" does not reference an existing node`);(o.type==="derived"||o.type==="effect"||o.type==="operator")&&!Array.isArray(o.deps)&&t.push(`Node "${n}": ${o.type} node should have a 'deps' array`)}}if(a.feedback!=null)if(!Array.isArray(a.feedback))t.push("'feedback' must be an array");else for(let n=0;n<a.feedback.length;n++){let c=a.feedback[n];if(c==null||typeof c!="object"){t.push(`Feedback [${n}]: must be an object`);continue}let o=c;typeof o.from!="string"||!i.has(o.from)?t.push(`Feedback [${n}]: 'from' "${String(o.from)}" does not reference an existing node`):f.get(o.from)==="effect"&&s.push(`Feedback [${n}]: 'from' "${o.from}" is an effect node \u2014 effects emit no DATA, so the feedback edge will never fire. Did you mean a derived/state node upstream?`),typeof o.from=="string"&&o.from===o.to&&t.push(`Feedback [${n}]: 'from' and 'to' must be different nodes`),typeof o.to!="string"||!i.has(o.to)?t.push(`Feedback [${n}]: 'to' "${String(o.to)}" does not reference an existing node`):typeof o.to=="string"&&f.get(o.to)!=="state"&&t.push(`Feedback [${n}]: 'to' node "${o.to}" must be a state node (got "${f.get(o.to)??"unknown"}")`)}return{valid:t.length===0,errors:t,warnings:s}}function pe(r,t){let s=T(r);if(!s.valid)throw new Error(`compileSpec: invalid GraphSpec:
8
- ${s.errors.join(`
9
- `)}`);let a=r.factory,i=r.factoryArgs;if(typeof a=="string"){let e=t?.catalog?.graphFactories?.[a];if(e)return e(i)}r=se(r);let f=t?.catalog??{},l=t?.onMissing??"placeholder",n=new W(r.name),c=r.templates??{},o=Y(r,f);if(!o.valid)throw new Error(`compileSpec: catalog validation errors:
10
- ${o.errors.join(`
11
- `)}`);let S=[],N=(e,p,d)=>{if(d){S.push({path:e,kind:"source",name:d});return}p&&S.push({path:e,kind:"fn",name:p})},w=e=>{let p=f.fns?.[e];return p?H(p):void 0},g=e=>{let p=f.sources?.[e];return p?Q(p):void 0},u=new Map,b=[];for(let[e,p]of Object.entries(r.nodes)){if(p.type==="template")continue;let d=p;if(d.type==="state"){let k=D(d.initial,{name:e,meta:d.meta?{...d.meta}:void 0});n.add(k,{name:e}),u.set(e,k)}else if(d.type==="producer"){let k=d.source?g(d.source):void 0,R=d.fn?w(d.fn):void 0;if(k){let y=k(d.config??{});n.add(y,{name:e}),u.set(e,y)}else if(R){let y=R([],d.config??{});n.add(y,{name:e}),u.set(e,y)}else{N(e,d.fn,d.source);let y=P(()=>{},{name:e,meta:{...d.meta,_specFn:d.fn,_specSource:d.source}});n.add(y,{name:e}),u.set(e,y)}}else b.push([e,d])}let $=!0,j=new Map(b);for(;j.size>0&&$;){$=!1;for(let[e,p]of[...j.entries()]){let d=p.deps??[];if(!d.every(G=>u.has(G)))continue;let k=d.map(G=>u.get(G)),R=p.fn?w(p.fn):void 0,y;R?y=R(k,p.config??{}):p.type==="effect"?(p.fn&&N(e,p.fn,void 0),y=I(k,()=>{})):(p.fn&&N(e,p.fn,void 0),y=J(k,G=>G[0])),n.add(y,{name:e}),u.set(e,y),j.delete(e),$=!0}}if(j.size>0){let e=[...j.keys()].sort().join(", ");throw new Error(`compileSpec: unresolvable deps for nodes: ${e}`)}for(let[e,p]of Object.entries(r.nodes)){if(p.type!=="template")continue;let d=p,k=c[d.template],R=new W(e),y=new Map,G=[];for(let[h,m]of Object.entries(k.nodes)){let F=(m.deps??[]).map(v=>v.startsWith("$")&&d.bind[v]?d.bind[v]:v),A={...m,deps:F};if(m.type==="state"){let v=D(m.initial,{name:h,meta:m.meta?{...m.meta}:void 0});R.add(v,{name:h}),y.set(h,v)}else if(m.type==="producer"){let v=m.source?g(m.source):void 0,M=m.fn?w(m.fn):void 0;if(v){let x=v(m.config??{});R.add(x,{name:h}),y.set(h,x)}else if(M){let x=M([],m.config??{});R.add(x,{name:h}),y.set(h,x)}else{N(`${e}.${h}`,m.fn,m.source);let x=P(()=>{},{name:h,meta:{...m.meta,_specFn:m.fn,_specSource:m.source}});R.add(x,{name:h}),y.set(h,x)}}else G.push([h,A])}let O=!0,E=new Map(G);for(;E.size>0&&O;){O=!1;for(let[h,m]of[...E.entries()]){let F=m.deps??[];if(!F.every(C=>y.has(C)||u.has(C)))continue;let v=F.map(C=>y.get(C)??u.get(C)),M=m.fn?w(m.fn):void 0,x;M?x=M(v,m.config??{}):m.type==="effect"?(m.fn&&N(`${e}.${h}`,m.fn,void 0),x=I(v,()=>{})):(m.fn&&N(`${e}.${h}`,m.fn,void 0),x=J(v,C=>C[0])),R.add(x,{name:h}),y.set(h,x),E.delete(h),O=!0}}if(E.size>0){let h=[...E.keys()].sort().join(", ");throw new Error(`compileSpec: template "${d.template}" has unresolvable deps: ${h}`)}n.mount(e,R);let _=`${e}::${k.output}`;u.set(e,n.resolve(_));try{let h=n.resolve(_);h.meta._templateName?.emit(d.template),h.meta._templateBind?.emit(d.bind)}catch{}}for(let e of r.feedback??[])V(n,e.from,e.to,{maxIterations:e.maxIterations});if(S.length>0){if(l==="error"){let e=S.map(p=>` - ${p.path}: missing ${p.kind} "${p.name}"`);throw new Error(`compileSpec: ${S.length} catalog entr${S.length===1?"y":"ies"} missing \u2014 pass them via opts.catalog or set opts.onMissing to "warn"/"placeholder":
12
- ${e.join(`
13
- `)}`)}if(l==="warn"){let e=t?.onWarn??(p=>console.warn(p));for(let p of S)e(`compileSpec: ${p.path} references missing ${p.kind} "${p.name}" \u2014 substituted placeholder`)}}return n}var fe=new Set(["reduction","reduction_type","_specFn","_specSource","_templateName","_templateBind","feedbackFrom","feedbackTo","_internal"]);function de(r){return Z(r)}function Z(r){let t=r.describe({detail:"standard"}),s={},a=[],i=`::${U}::`,f=/^__feedback_(?!effect_)(.+)$/,l=new Set;for(let g of Object.keys(t.nodes)){if(g.includes(i))continue;let u=f.exec(g);if(u){l.add(u[1]);let b=t.nodes[g]?.meta;b?.feedbackFrom&&b?.feedbackTo&&a.push({from:b.feedbackFrom,to:b.feedbackTo,...b.maxIterations?{maxIterations:b.maxIterations}:{}})}}for(let[g,u]of Object.entries(t.nodes)){if(g.includes(i)||f.test(g)||u.meta?._internal||g.startsWith("__feedback_effect_")||g.startsWith("__bridge_")||g.includes("::"))continue;let b={type:u.type};if(u.deps.length>0&&(b.deps=u.deps.filter($=>!$.includes("::"))),u.type==="state"&&u.value!==void 0&&(b.initial=u.value),u.meta&&Object.keys(u.meta).length>0){let $={};for(let[j,e]of Object.entries(u.meta))fe.has(j)||($[j]=e);$.factory==="withStatus"?(delete $.status,delete $.error):$.factory==="withBreaker"?delete $.breakerState:$.factory==="verifiable"&&delete $.sourceVersion,Object.keys($).length>0&&(b.meta=$)}s[g]=b}let n={},c={},o=new Set;for(let g of t.subgraphs){let u=`${g}::`;for(let[b,$]of Object.entries(t.nodes)){if(!b.startsWith(u)||b.includes(i))continue;let j=$.meta;if(j?._templateName&&j?._templateBind){let e=j._templateName,p=j._templateBind;if(!n[e]){let d={},k=new Set,R=`${g}::`;for(let[h,m]of Object.entries(t.nodes)){if(!h.startsWith(R)||h.includes(i))continue;let F=h.slice(R.length);F.includes("::")||(k.add(F),d[F]={type:m.type,...m.deps.length>0?{deps:m.deps.map(A=>A.startsWith(R)?A.slice(R.length):A)}:{}})}let y=[],G=new Map;for(let h of Object.values(d))for(let m of h.deps??[])if(!k.has(m)&&!G.has(m)){let F=`$${m}`;y.push(F),G.set(m,F)}for(let h of Object.values(d))h.deps&&(h.deps=h.deps.map(m=>G.get(m)??m));let O=new Set;for(let h of Object.values(d))for(let m of h.deps??[])k.has(m)&&O.add(m);let _=[...k].filter(h=>!O.has(h))[0]??[...k].pop();n[e]={params:y,nodes:d,output:_}}delete s[g],c[g]={type:"template",template:e,bind:p},o.add(g);break}}}let S=new Map;for(let g of t.subgraphs){if(o.has(g))continue;let u={},b=`${g}::`;for(let[j,e]of Object.entries(t.nodes)){if(j.includes(i)||!j.startsWith(b))continue;let p=j.slice(b.length);p.includes("::")||(u[p]={type:e.type,...e.deps.length>0?{deps:e.deps.map(d=>d.startsWith(b)?d.slice(b.length):d)}:{}})}let $=JSON.stringify(Object.fromEntries(Object.entries(u).sort(([j],[e])=>j.localeCompare(e)).map(([j,e])=>[j,{type:e.type,deps:e.deps??[]}])));S.has($)||S.set($,[]),S.get($).push({name:g,nodes:u})}for(let[,g]of S){if(g.length<2)continue;let u=`${g[0].name}_template`,b=g[0].nodes,$=new Set(Object.keys(b)),j=[],e=new Map;for(let y of Object.values(b))for(let G of y.deps??[])if(!$.has(G)&&!e.has(G)){let O=`$${G}`;j.push(O),e.set(G,O)}let p=new Set;for(let y of Object.values(b))for(let G of y.deps??[])$.has(G)&&p.add(G);let k=[...$].filter(y=>!p.has(y))[0]??[...$].pop(),R={};for(let[y,G]of Object.entries(b))R[y]={...G,deps:G.deps?.map(O=>e.get(O)??O)};n[u]={params:j,nodes:R,output:k};for(let y of g){delete s[y.name];let G={},O=new Set(Object.keys(y.nodes));for(let E of Object.values(y.nodes))for(let _ of E.deps??[])if(!O.has(_)){let h=e.get(_)??`$${_}`;G[h]=_}c[y.name]={type:"template",template:u,bind:G}}}let N={...s,...c},w={name:t.name,nodes:N};return Object.keys(n).length>0&&(w.templates=n),a.length>0&&(w.feedback=a),t.factory!==void 0&&(w.factory=t.factory),t.factoryArgs!==void 0&&(w.factoryArgs=t.factoryArgs),w}function le(r,t){let s=[];r.name!==t.name&&s.push({type:"changed",path:"name",detail:`"${r.name}" \u2192 "${t.name}"`});let a=new Set(Object.keys(r.nodes)),i=new Set(Object.keys(t.nodes));for(let e of i)if(!a.has(e)){let p=t.nodes[e];s.push({type:"added",path:`nodes.${e}`,detail:`type: ${p.type}`})}for(let e of a)i.has(e)||s.push({type:"removed",path:`nodes.${e}`});for(let e of a){if(!i.has(e))continue;let p=r.nodes[e],d=t.nodes[e];if(JSON.stringify(p)!==JSON.stringify(d)){let k=[];p.type!==d.type&&k.push(`type: ${p.type} \u2192 ${d.type}`),JSON.stringify(p.deps)!==JSON.stringify(d.deps)&&k.push("deps changed"),p.fn!==d.fn&&k.push(`fn: ${p.fn} \u2192 ${d.fn}`),JSON.stringify(p.config)!==JSON.stringify(d.config)&&k.push("config changed"),s.push({type:"changed",path:`nodes.${e}`,detail:k.join("; ")||"modified"})}}let f=r.templates??{},l=t.templates??{},n=new Set(Object.keys(f)),c=new Set(Object.keys(l));for(let e of c)n.has(e)||s.push({type:"added",path:`templates.${e}`});for(let e of n)c.has(e)||s.push({type:"removed",path:`templates.${e}`});for(let e of n)c.has(e)&&JSON.stringify(f[e])!==JSON.stringify(l[e])&&s.push({type:"changed",path:`templates.${e}`,detail:"template definition changed"});let o=r.feedback??[],S=t.feedback??[],N=new Set(o.map(e=>`${e.from}->${e.to}`)),w=new Set(S.map(e=>`${e.from}->${e.to}`));for(let e of S){let p=`${e.from}->${e.to}`;N.has(p)||s.push({type:"added",path:`feedback.${p}`,detail:`maxIterations: ${e.maxIterations??10}`})}for(let e of o){let p=`${e.from}->${e.to}`;w.has(p)||s.push({type:"removed",path:`feedback.${p}`})}for(let e of o){let p=`${e.from}->${e.to}`,d=S.find(k=>k.from===e.from&&k.to===e.to);d&&JSON.stringify(e)!==JSON.stringify(d)&&s.push({type:"changed",path:`feedback.${p}`,detail:`maxIterations: ${e.maxIterations??10} \u2192 ${d.maxIterations??10}`})}let g=s.filter(e=>e.type==="added").length,u=s.filter(e=>e.type==="removed").length,b=s.filter(e=>e.type==="changed").length,$=[];g&&$.push(`${g} added`),u&&$.push(`${u} removed`),b&&$.push(`${b} changed`);let j=$.length>0?$.join(", "):"no changes";return{entries:s,summary:j}}var ee=`You are a graph architect for GraphReFly, a reactive graph protocol.
14
-
15
- Given a natural-language description, produce a JSON GraphSpec with this structure:
16
-
17
- {
18
- "name": "<graph_name>",
19
- "nodes": {
20
- "<node_name>": {
21
- "type": "state" | "derived" | "producer" | "effect" | "operator",
22
- "deps": ["<dep_node_name>", ...],
23
- "fn": "<catalog_function_name>",
24
- "source": "<catalog_source_name>",
25
- "config": { ... },
26
- "initial": <value>,
27
- "meta": { "description": "<purpose>" }
28
- },
29
- "<template_instance>": {
30
- "type": "template",
31
- "template": "<template_name>",
32
- "bind": { "$param": "node_name" }
33
- }
34
- },
35
- "templates": {
36
- "<template_name>": {
37
- "params": ["$param1", "$param2"],
38
- "nodes": { ... },
39
- "output": "<output_node>"
40
- }
41
- },
42
- "feedback": [
43
- { "from": "<condition_node>", "to": "<state_node>", "maxIterations": 10 }
44
- ]
45
- }
46
-
47
- Rules:
48
- - "state" nodes hold user/LLM-writable values (knobs). Use "initial" for default values.
49
- - "derived" nodes compute from deps using a named "fn".
50
- - "effect" nodes produce side effects from deps.
51
- - "producer" nodes generate values from a named "source".
52
- - Use "templates" when the same subgraph pattern repeats (e.g., per-source resilience).
53
- - Use "feedback" for bounded cycles where a derived value writes back to a state node.
54
- - meta.description is required for every node.
55
- - Return ONLY valid JSON, no markdown fences or commentary.`;function te(r){let t=r.match(/^```(?:json)?\s*([\s\S]*?)\s*```[\s\S]*$/);return t?t[1]:r}async function ue(r,t,s){let a=ee,i=s?.catalogDescription??(s?.catalog?X(s.catalog):void 0);i&&(a+=`
56
-
57
- Available catalog (use ONLY these names):
58
- ${i}`),s?.systemPromptExtra&&(a+=`
59
-
60
- ${s.systemPromptExtra}`);let f=[{role:"system",content:a},{role:"user",content:r}],c=(await t.invoke(f,{model:s?.model,temperature:s?.temperature??0,maxTokens:s?.maxTokens})).content.trim();c.startsWith("```")&&(c=te(c));let o;try{o=JSON.parse(c)}catch{throw new Error(`llmCompose: LLM response is not valid JSON: ${c.slice(0,200)}`)}let S=T(o);if(!S.valid)throw new Error(`llmCompose: invalid GraphSpec:
61
- ${S.errors.join(`
62
- `)}`);let N=o;if(s?.catalog){let w=s.maxAutoRefine??0;for(let g=0;g<=w;g++){let u=Y(N,s.catalog);if(u.valid)break;if(g===w)throw new Error(`llmCompose: catalog validation failed after ${w} refine attempts:
63
- ${u.errors.join(`
64
- `)}`);N=await ne(N,`Fix these catalog errors:
65
- ${u.errors.join(`
66
- `)}
67
-
68
- Use ONLY functions and sources from the catalog.`,t,{...s,catalogDescription:i})}}return N}async function ne(r,t,s,a){let i=ee;a?.catalogDescription&&(i+=`
69
-
70
- Available catalog:
71
- ${a.catalogDescription}`),a?.systemPromptExtra&&(i+=`
72
-
73
- ${a.systemPromptExtra}`);let f=[{role:"system",content:i},{role:"user",content:`Current GraphSpec:
74
- ${JSON.stringify(r,null,2)}
75
-
76
- Modification request: ${t}
77
-
78
- Return the complete modified GraphSpec as JSON.`}],c=(await s.invoke(f,{model:a?.model,temperature:a?.temperature??0,maxTokens:a?.maxTokens})).content.trim();c.startsWith("```")&&(c=te(c));let o;try{o=JSON.parse(c)}catch{throw new Error(`llmRefine: LLM response is not valid JSON: ${c.slice(0,200)}`)}let S=T(o);if(!S.valid)throw new Error(`llmRefine: invalid GraphSpec:
79
- ${S.errors.join(`
80
- `)}`);return o}export{L as a,q as b,H as c,Q as d,X as e,Y as f,T as g,pe as h,de as i,Z as j,le as k,ue as l,ne as m,me as n};
@@ -1 +0,0 @@
1
- import{C as p,v as f}from"./chunk-LYCLF26R.js";function w(t,n){if(n!=null&&n.length>0)return new Set(n);switch(t){case"standard":return new Set(["type","status","value","deps","meta","v"]);case"full":return null;case"spec":return new Set(["type","deps","meta"]);default:return new Set(["type","deps"])}}function m(t){return t._describeKind!=null?t._describeKind:t._deps.length>0?"derived":t._fn!=null?"producer":"state"}function v(t){let n=new WeakSet,e={};for(let[r,o]of y(t))e[r]=d(o,n);return e}function d(t,n){if(t==null)return t;let e=typeof t;if(e==="boolean"||e==="number"||e==="string")return t;if(e==="function")return"<function>";if(Array.isArray(t))return n.has(t)?"<cycle>":(n.add(t),t.map(r=>d(r,n)));if(e==="object"){let r=t;if(n.has(r))return"<cycle>";n.add(r);try{if(typeof r.subscribe=="function"&&"cache"in r)return"<Node>"}catch{return"<unserializable>"}let o={};for(let[i,u]of y(r))o[i]=d(u,n);return o}return"<unserializable>"}function y(t){let n=[],e;try{e=Object.keys(t)}catch{return n}for(let r of e)try{n.push([r,t[r]])}catch{n.push([r,"<unserializable>"])}return n}function D(t,n){let e={factory:t};return n!==void 0&&(e.factoryArgs=n),e}function b(t){let n={};for(let[e,r]of Object.entries(t.meta))try{n[e]=r.cache}catch{}return n}function N(t,n){let e=n==null,r=!e&&n!=null?[...n].filter(s=>s.startsWith("meta.")).map(s=>s.slice(5)):null,o=e||n.has("meta")||r!=null&&r.length>0,i="state",u=[];t instanceof p&&(i=m(t),u=t._deps.map(s=>s.node.name??""));let a={type:i,deps:u};(e||n.has("status"))&&(a.status=t.status);let c=t instanceof p?t._guard:void 0;if(o){let s={...b(t)};if(c!=null&&s.access===void 0&&(s.access=f(c)),r!=null&&r.length>0&&!n.has("meta")){let g={};for(let l of r)l in s&&(g[l]=s[l]);a.meta=g}else a.meta=s}if(t.name!=null&&(a.name=t.name),e||n.has("value")){t.status==="sentinel"&&(a.sentinel=!0);try{a.value=t.cache}catch{}}if((e||n.has("v"))&&t.v!=null){let s={id:t.v.id,version:t.v.version};"cid"in t.v&&(s.cid=t.v.cid,s.prev=t.v.prev),a.v=s}return(e||n.has("guard"))&&c!=null&&(a.guard=f(c)),(e||n.has("lastMutation"))&&t.lastMutation!=null&&(a.lastMutation=t.lastMutation),a}export{w as a,v as b,D as c,N as d};
@@ -1 +0,0 @@
1
- import{e as P}from"./chunk-XLYF4LBH.js";import{c as S}from"./chunk-O32GJOUJ.js";import{a as w}from"./chunk-NSAZ6PR6.js";import{k as O,m as R}from"./chunk-QMC2PLNM.js";import{b as _}from"./chunk-TZQPPQEQ.js";import{C as T}from"./chunk-RZ5HKPGI.js";import{E as k,G as x,o as H}from"./chunk-LYCLF26R.js";import{b as M}from"./chunk-QYADASLV.js";var B={};M(B,{LensGraph:()=>C,graphLens:()=>N,watchTopologyTree:()=>w});function v(e){return S("lens",e)}function E(e){let t=Object.keys(e.nodes),o=new Map,n=new Map;for(let s of t){let a=e.nodes[s]?.deps??[];o.set(s,a);for(let h of a)n.has(h)||n.set(h,new Set),n.get(h).add(s)}let r=[],c=[];for(let s of t)(o.get(s)??[]).length===0&&r.push(s),n.has(s)||c.push(s);r.sort(),c.sort();let p=e.edges.length,f=0,m=1,g=2,d=new Map;for(let s of t)d.set(s,f);let y=!1,l=new Map,u=s=>{let a=d.get(s)??f;if(a===m)return y=!0,0;if(a===g)return l.get(s)??0;d.set(s,m);let h=0,b=n.get(s);if(b!=null)for(let F of b){let G=u(F);G+1>h&&(h=G+1)}return d.set(s,g),l.set(s,h),h},i=0;for(let s of r){let a=u(s);a>i&&(i=a)}for(let s of t)d.get(s)===f&&u(s);return{nodeCount:t.length,edgeCount:p,subgraphCount:e.subgraphs.length,sources:r,sinks:c,depth:i,hasCycles:y}}function $(e){let t=[];for(let[o,n]of Object.entries(e.nodes)){if(n.status!=="errored")continue;let r={path:o,status:"errored"},c=R(e,o,"upstream",{});for(let p of c)if(p!==o&&e.nodes[p]?.status==="errored"){r.upstreamCause=p;break}t.push(r)}return t.sort((o,n)=>o.path<n.path?-1:o.path>n.path?1:0),{ok:t.length===0,problems:t}}function q(e,t){return e.nodeCount===t.nodeCount&&e.edgeCount===t.edgeCount&&e.subgraphCount===t.subgraphCount&&e.depth===t.depth&&e.hasCycles===t.hasCycles&&D(e.sources,t.sources)&&D(e.sinks,t.sinks)}function L(e,t){if(e.ok!==t.ok||e.problems.length!==t.problems.length)return!1;for(let o=0;o<e.problems.length;o++){let n=e.problems[o],r=t.problems[o];if(n.path!==r.path||n.status!==r.status||n.upstreamCause!==r.upstreamCause)return!1}return!0}function D(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var C=class extends O{stats;health;flow;_target;constructor(t,o={}){super(o.name??`${t.name}_lens`,o.graph),this._target=t;let n=0,r=0,c=k(0,{name:"stats_tick"}),p=k(0,{name:"health_tick"});this.add(c,{name:"stats_tick"}),this.add(p,{name:"health_tick"});let f={name:"flow"};o.maxFlowPaths!=null&&(f.maxSize=o.maxFlowPaths),this.flow=_(f),this.add(this.flow.entries,{name:"flow"});let m=o.pathFilter,g=w(t,(l,u,i)=>{if(n+=1,c.emit(n),r+=1,p.emit(r),l.kind==="removed")if(l.nodeKind==="node"){let s=`${i}${l.name}`;this.flow.delete(s)}else{let s=`${i}${l.name}::`,a=[];for(let h of l.audit.nodes){let b=h===""?`${i}${l.name}`:`${s}${h}`;a.push(b)}a.length>0&&this.flow.deleteMany(a)}});this.addDisposer(g);let d=t.observe({timeline:!0,structured:!0}),y=d.onEvent(l=>{let u=l.type;if((u==="error"||u==="complete"||u==="data"||u==="teardown")&&(r+=1,p.emit(r)),u==="data"){let i=l.path??"";if(!i||m!=null&&!m(i))return;let s=this.flow.get(i),a=s!=null?s.count+1:1;this.flow.set(i,{path:i,count:a,lastUpdate_ns:H()})}});this.addDisposer(()=>{y(),d.dispose()}),this.stats=x([c],()=>E(t.describe({detail:"minimal"})),{name:"stats",describeKind:"derived",equals:q,meta:v("stats")}),this.add(this.stats,{name:"stats"}),this.addDisposer(T(this.stats)),this.health=x([p],()=>$(t.describe({detail:"standard"})),{name:"health",describeKind:"derived",equals:L,meta:v("health")}),this.add(this.health,{name:"health"}),this.addDisposer(T(this.health))}why(t,o,n){let r=P(this._target,t,o,n);return this.addDisposer(r.dispose),r}get target(){return this._target}};function N(e,t){return new C(e,t)}export{C as a,N as b,B as c};