@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
@@ -0,0 +1,43 @@
1
+ import{a as Fe}from"./chunk-UWA6D7UF.js";import{d as Pe}from"./chunk-OSZ22J7O.js";import{t as Z}from"./chunk-INQFTVZA.js";import{c as _e}from"./chunk-32N3JALT.js";import{g as $e,i as le}from"./chunk-J63M5U46.js";import{b as q}from"./chunk-D27JNOLZ.js";import{b as Me}from"./chunk-TSOYJ743.js";import{a as ue}from"./chunk-756D5TFD.js";import{f as Oe,i as we}from"./chunk-2BX4NB34.js";import{b as S,s as U,t as Ce,x as _}from"./chunk-FHRBBHJN.js";import{b as Ae}from"./chunk-35JTVPOX.js";import{b as X}from"./chunk-TZQPPQEQ.js";import{C as Se,m as z}from"./chunk-CKFQS2CJ.js";import{D as Ne,E as A,F as Q,G as b,H as $,o as V}from"./chunk-LYCLF26R.js";import{b as F,i as P,j as W}from"./chunk-CK2E7BTU.js";import{b as tt}from"./chunk-QYADASLV.js";var wt={};tt(wt,{DEFAULT_DECAY_RATE:()=>D,DEFAULT_EXECUTE_PROMPT:()=>de,DEFAULT_QUEUE_CONFIGS:()=>ee,DEFAULT_SEVERITY_WEIGHTS:()=>L,DEFAULT_TRIAGE_PROMPT:()=>ce,DEFAULT_VERIFY_PROMPT:()=>pe,HarnessGraph:()=>re,QUEUE_NAMES:()=>k,actuatorExecutor:()=>Ve,affectedTaskFilter:()=>pt,autoSolidify:()=>it,beforeAfterCompare:()=>dt,codeChangeBridge:()=>ft,createIntakeBridge:()=>ut,defaultErrorClassifier:()=>te,defaultLlmExecutor:()=>Qe,defaultLlmVerifier:()=>Ue,dispatchActuator:()=>at,effectivenessTracker:()=>yt,evalIntakeBridge:()=>lt,evalSource:()=>ct,evalVerifier:()=>Le,harnessEvalPair:()=>xt,harnessLoop:()=>It,harnessProfile:()=>Nt,harnessTrace:()=>St,notifyEffect:()=>mt,priorityScore:()=>ht,refineExecutor:()=>fe,resolvePromptFn:()=>B,strategyKey:()=>j,strategyModel:()=>me});function rt(e,t){return{outcome:"success",detail:`actuator applied ${t.intervention} for ${st(t.summary)}`,artifact:e}}function nt(e,t){let o=e instanceof Error?e.message:String(e);return{outcome:"failure",detail:`actuator threw on ${t.intervention}: ${o}`}}function ot(e){return`actuator skipped ${e.intervention} (shouldApply returned false)`}function st(e,t=80){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}function Ve(e){let t=e.name??"actuator-executor",o=e.toOutput??rt,s=e.onError??nt,n=e.skipDetail??ot;return d=>{let r=S(d,i=>i!=null,{name:`${t}/gate-in`}),a=_(r,i=>e.shouldApply&&!e.shouldApply(i)?Q(c=>(c.down([[F,{outcome:"failure",detail:n(i)}],[P]]),()=>{}),{name:`${t}/skip`}):Q(c=>{let m=new AbortController,f=!1,l=null,g=R=>{f||(f=!0,c.down([[F,R],[P]]),l?.(),l=null)},y;try{let R=e.apply(i,{signal:m.signal});y=z(R,{signal:m.signal})}catch(R){return g(s(R,i)),()=>{m.abort()}}return l=y.subscribe(R=>{for(let E of R){if(f)return;if(E[0]===F){g(o(E[1],i));return}if(E[0]===W){g(s(E[1],i));return}if(E[0]===P){g(s(new Error("actuator inner completed without emitting DATA"),i));return}}}),f&&l&&(l(),l=null),()=>{m.abort(),l?.(),l=null}},{name:`${t}/inner`}),{name:t});return S(a,i=>i!=null,{name:`${t}/gate-out`})}}function at(e){let t=e.name??"dispatch-actuator",o=e.default??null,s=o!=null;return Ve({apply:(n,d)=>{let r=Object.hasOwn(e.routes,n.intervention)?e.routes[n.intervention]:o;if(!r)throw new Error(`dispatchActuator: no route for intervention '${n.intervention}'`);return r(n,d)},shouldApply:n=>Object.hasOwn(e.routes,n.intervention)||s,skipDetail:n=>`no route for intervention '${n.intervention}'`,name:t})}function it(e){let t=e.name??"auto-solidify",o=e.extract??(n=>n.execution.artifact??null),s=e.predicate??(()=>!0);return Q(n=>{let d=null,r=!1,a=()=>{r||(r=!0,d?.(),d=null)},i=c=>{r||(n.down([[W,c]]),a())};return d=e.verifyResults.subscribe(c=>{if(!r)for(let m of c){if(r)return;if(m[0]!==F){if(m[0]===P){n.down([[P]]),a();return}continue}let f=m[1];if(f==null||!f.verified)continue;let l;try{l=s(f)}catch(y){i(y);return}if(!l)continue;let g;try{g=o(f)}catch(y){i(y);return}if(g!=null){try{e.write(g,f)}catch(y){i(y);return}n.down([[F,g]])}}}),r&&d&&(d(),d=null),()=>{a()}},{name:t})}function ut(e,t,o,s){return $([e],([n])=>{if(n==null)return;let d=o(n);for(let r of d)t.publish(r)},{name:s?.name??"intake-bridge"})}function lt(e,t,o){let s=o?.defaultSeverity??"medium";return $([e],([n])=>{if(n==null)return;let d=Array.isArray(n)?n:[n];for(let r of d)for(let a of r.tasks)if(!(a.valid&&a.judge_scores?.every(i=>i.pass))){if(!a.valid&&(!a.judge_scores||a.judge_scores.length===0)){t.publish({source:"eval",summary:`Task ${a.task_id} invalid (model: ${r.model})`,evidence:`Run ${r.run_id}: task produced invalid output`,affectsAreas:["graphspec"],affectsEvalTasks:[a.task_id],severity:s});continue}if(a.judge_scores)for(let i of a.judge_scores)i.pass||t.publish({source:"eval",summary:`${a.task_id}: ${i.claim} (model: ${r.model})`,evidence:i.reasoning,affectsAreas:["graphspec"],affectsEvalTasks:[a.task_id],severity:s})}},{name:o?.name??"eval-intake-bridge"})}function ct(e,t){return _(e,()=>z(t()))}function dt(e,t){return b([e,t],([o,s])=>{let n=o,d=s,r=new Map(n.tasks.map(l=>[l.task_id,l])),a=new Map(d.tasks.map(l=>[l.task_id,l])),i=new Set([...r.keys(),...a.keys()]),c=[],m=[],f=[];for(let l of i){let g=r.get(l),y=a.get(l),R=g?.valid??!1,E=y?.valid??!1,I=g?.judge_scores?g.judge_scores.filter(w=>w.pass).length:void 0,N=y?.judge_scores?y.judge_scores.filter(w=>w.pass).length:void 0,O=I!==void 0&&N!==void 0?N-I:void 0;c.push({taskId:l,before:R,after:E,scoreDiff:O}),R&&!E&&m.push(l),!R&&E&&f.push(l)}return{newFailures:m,resolved:f,taskDeltas:c,overallImproved:f.length>m.length}},{name:"eval-delta"})}function pt(e,t){let o=t==null?null:Array.isArray(t)?A(t):t,s=[e];return o&&s.push(o),b(s,n=>{let d=n[0],r=o?new Set(n[1]):null,a=new Set;for(let i of d)for(let c of i.affectsEvalTasks??[])(r==null||r.has(c))&&a.add(c);return[...a].sort()},{name:"affected-task-filter"})}function ft(e,t,o,s){let n=s?.defaultSeverity??"high";function d(a){let i=[];for(let c of a.lintErrors??[])i.push({source:"code-change",summary:`Lint: ${c.rule} in ${c.file}:${c.line}`,evidence:c.message,affectsAreas:[c.file],severity:n});for(let c of a.testFailures??[])i.push({source:"test",summary:`Test failure: ${c.testId}`,evidence:c.message,affectsAreas:[c.file],affectsEvalTasks:[c.testId],severity:n});return i}let r=o??d;return $([e],([a])=>{if(a!=null)for(let i of r(a))t.publish(i)},{name:s?.name??"code-change-bridge"})}function mt(e,t,o){return $([e.latest],([s])=>{s!=null&&t(s)},{name:o?.name??"notify-effect"})}var k=["auto-fix","needs-decision","investigation","backlog"],ee={"auto-fix":{gated:!1},"needs-decision":{gated:!0},investigation:{gated:!0},backlog:{gated:!1}},L={critical:100,high:70,medium:40,low:10},D=Math.LN2/(168*3600);function j(e,t){return`${e}\u2192${t}`}var gt=/\b(parse|json|config|validation|syntax)\b/i,te=e=>gt.test(e.detail)?"self-correctable":"structural",ce=`You are a triage classifier for a reactive collaboration harness.
2
+
3
+ Given an intake item, classify it and output JSON:
4
+ {
5
+ "rootCause": "composition" | "missing-fn" | "bad-docs" | "schema-gap" | "regression" | "unknown",
6
+ "intervention": "template" | "catalog-fn" | "docs" | "wrapper" | "schema-change" | "investigate",
7
+ "route": "auto-fix" | "needs-decision" | "investigation" | "backlog",
8
+ "priority": <number 0-100>,
9
+ "triageReasoning": "<one sentence>"
10
+ }
11
+
12
+ Strategy model (past effectiveness):
13
+ {{strategy}}
14
+
15
+ Intake item:
16
+ {{item}}`,de=`You are an implementation agent.
17
+
18
+ Given a triaged issue with root cause and intervention type, produce a fix.
19
+
20
+ Issue:
21
+ {{item}}
22
+
23
+ Output JSON:
24
+ {
25
+ "outcome": "success" | "failure" | "partial",
26
+ "detail": "<description of what was done or what failed>"
27
+ }`,pe=`You are a QA reviewer.
28
+
29
+ Given an execution result, verify whether the fix is correct.
30
+
31
+ Execution:
32
+ {{execution}}
33
+
34
+ Original issue:
35
+ {{item}}
36
+
37
+ Output JSON:
38
+ {
39
+ "verified": true/false,
40
+ "findings": ["<finding1>", ...],
41
+ "errorClass": "self-correctable" | "structural" // only if verified=false
42
+ }`;function B(e,t,o){if(typeof e=="function")return e;let s=e??t;return n=>o(s,n)}function yt(e){let t=X({name:e?.name??"effectiveness-entries"}),o=b([t.entries],([r])=>new Map(r),{name:`${e?.name??"effectiveness"}-snapshot`,equals:(r,a)=>{let i=r,c=a;if(i.size!==c.size)return!1;for(let[m,f]of i){let l=c.get(m);if(!l||f.attempts!==l.attempts||f.successes!==l.successes)return!1}return!0}});function s(r,a){let i=t.get(r),c=(i?.attempts??0)+1,m=(i?.successes??0)+(a?1:0);t.set(r,{key:r,attempts:c,successes:m,successRate:m/c})}function n(r){return t.get(r)}let d=Se(o);return{node:o,record:s,lookup:n,dispose:()=>{d(),t.dispose()}}}function Tt(e){let{best:t,score:o,status:s}=e,n=Number.isFinite(o)?o.toFixed(3):String(o),d=t??void 0;return s==="converged"?{outcome:"success",detail:`refineLoop converged at score ${n}`,artifact:d}:s==="budget"?{outcome:"partial",detail:`refineLoop hit budget at score ${n}`,artifact:d}:{outcome:"failure",detail:`refineLoop errored (status=${s})`,artifact:d}}function fe(e){let t=e.name??"refine-executor",o=e.toOutput??Tt;return s=>{let n=S(s,r=>r!=null,{name:`${t}/gate-in`}),d=_(n,r=>{let a=Fe(e.seedFrom(r),e.evaluator,e.strategy,{...e.refine,dataset:e.datasetFor(r),name:`${t}/inner`});return b([a.status,a.best,a.score],([i,c,m])=>{let f=i;return f!=="converged"&&f!=="budget"&&f!=="errored"?null:o({best:c,score:m,status:f})},{name:`${t}/output`})},{name:t});return S(d,r=>r!=null,{name:`${t}/gate-out`})}}function Et(e){if(e.length===0)return Number.NEGATIVE_INFINITY;let t=0;for(let o of e)t+=o.score;return t/e.length}function vt(e){let{passCount:t,total:o,meanScore:s,threshold:n,missingArtifact:d}=e,r=Number.isFinite(s)?s.toFixed(3):String(s),a=!d&&o>0&&s>=n,i=d?["EXECUTE stage did not emit an artifact; cannot verify reactively"]:a?[`${t}/${o} eval tasks passed; mean score ${r} \u2265 ${n}`]:o===0?["No eval tasks were selected for this item \u2014 cannot verify"]:[`${t}/${o} eval tasks passed; mean score ${r} < threshold ${n}`];return a?{verified:!0,findings:i}:{verified:!1,findings:i,errorClass:"structural"}}function Rt(e){return e.artifact??null}function Le(e){let t=e.name??"eval-verifier",o=e.threshold??.5,s=e.toOutput??vt,n=e.extractArtifact??Rt;return d=>{let r=S(d,i=>i!=null&&i[0]!=null&&i[1]!=null,{name:`${t}/gate-in`}),a=_(r,i=>{let[c,m]=i,f=n(c,m);if(f==null)return A(s({scores:[],meanScore:Number.NEGATIVE_INFINITY,passCount:0,total:0,threshold:o,missingArtifact:!0}));let l=A([f],{name:`${t}/candidates`}),g=A(e.datasetFor(m),{name:`${t}/dataset`}),y=e.evaluator(l,g);return b([y],([R])=>{let E=R;if(E==null)return null;let I=Et(E),N=E.filter(O=>O.score>=o).length;return s({scores:E,meanScore:I,passCount:N,total:E.length,threshold:o})},{name:`${t}/output`})},{name:t});return S(a,i=>i!=null,{name:`${t}/gate-out`})}}function xt(e){let t=e.name??"harness-pair",o=fe({name:`${t}-exec`,seedFrom:e.seedFrom,evaluator:e.evaluator,strategy:e.strategy,datasetFor:e.datasetFor,refine:e.refine}),s=Le({name:`${t}-verify`,evaluator:e.evaluator,datasetFor:e.datasetFor,threshold:e.threshold});return{executor:o,verifier:s}}function me(){let e=X({name:"strategy-entries"}),t=b([e.entries],([r])=>{let a=r;return new Map(a)},{name:"strategy-model",equals:(r,a)=>{let i=r,c=a;if(i.size!==c.size)return!1;for(let[m,f]of i){let l=c.get(m);if(!l||f.attempts!==l.attempts||f.successes!==l.successes)return!1}return!0}});function o(r,a,i){let c=j(r,a),m=e.get(c),f=(m?.attempts??0)+1,l=(m?.successes??0)+(i?1:0);e.set(c,{rootCause:r,intervention:a,attempts:f,successes:l,successRate:l/f})}function s(r,a){return e.get(j(r,a))}let n=t.subscribe(()=>{});function d(){n()}return{node:t,record:o,lookup:s,dispose:d}}function ht(e,t,o,s,n){let d={...L,...n?.severityWeights},r=n?.decayRate??D,a=n?.effectivenessThreshold??.7,i=n?.effectivenessBoost??15,c=[e,t,o];return s&&c.push(s),b(c,m=>{let f=m[0],l=m[1],g=m[2],y=s?m[3]:0,R=d[f.severity??"medium"],E=(V()-g)/1e9,I=Me(R,E,r,0),N=j(f.rootCause,f.intervention),O=l.get(N);return O&&O.successRate>=a&&(I+=i),I+=y*20,I},{name:"priority-score"})}var De="intake",bt="triage-output",je="retry",Ge="verify-results",He="__unrouted";function Qe(e,t){let o=B(t,de,(s,n)=>s.replace("{{item}}",JSON.stringify(n)));return s=>Z(e,[s],o,{name:"execute",format:"json"})}function Ue(e,t){let o=B(t,pe,(s,n)=>{let[d,r]=n;return s.replace("{{execution}}",JSON.stringify(d)).replace("{{item}}",JSON.stringify(r))});return s=>Z(e,[s],n=>n==null?"":o(n),{name:"verify",format:"json"})}var re=class extends we{queues;jobs;gates;queueTopics;strategy;totalRetries;totalReingestions;priorityScores;constructor(t,o,s,n,d,r,a,i,c){super(t),this.queues=o,this.queueTopics=s,this.jobs=n,this.gates=d,this.strategy=r,this.totalRetries=a,this.totalReingestions=i,this.priorityScores=c}get intake(){return this.queues.topic(De)}get verifyResults(){return this.queues.topic(Ge)}get retry(){return this.queues.topic(je)}get unrouted(){return this.queues.topic(He)}stageNodes(){let t=this.queues,o=r=>t.has(r)?`queues::${r}::latest`:null,s=r=>r==null?[]:[r],n=k.flatMap(r=>s(o(r))),d=[];for(let[r]of this.gates)d.push(`gates::${r}/gate`);return[{label:"INTAKE",paths:s(o("intake"))},{label:"TRIAGE",paths:["triage"]},{label:"QUEUE",paths:n},{label:"GATE",paths:d},{label:"EXECUTE",paths:["execute"]},{label:"VERIFY",paths:s(o("verify-results"))},{label:"REFLECT",paths:["reflect"]},{label:"STRATEGY",paths:["strategy"]}]}};function It(e,t){let o=t.adapter,s=t.maxRetries??2,n=t.retainedLimit??1e3,d=t.errorClassifier??te,r=new Map;for(let u of k)r.set(u,{...ee[u],...t.queues?.[u]});let a=$e(`${e}/queues`,{defaultTopicOptions:{retainedLimit:n}}),i=a.topic(De),c=a.topic(bt),m=a.topic(je),f=a.topic(Ge),l=new Map;for(let u of k)l.set(u,a.topic(u));let g=a.topic(He),y=me(),R=U(i.latest,y.node),E=B(t.triagePrompt,ce,(u,p)=>{let[T,x]=p;return u.replace("{{strategy}}",JSON.stringify(Array.from(x.entries()))).replace("{{item}}",JSON.stringify(T))}),I=Z(o,[R],u=>{let p=u;return!p||!p[0]?"":E(p)},{name:"triage",format:"json"}),N=U(I,R),w=$([N],([u])=>{if(u==null)return;let[p,T]=u;if(!p?.route)return;let x=T?.[0],C={...p,...x};c.publish(C)}).subscribe(()=>{}),Be=new Set(k);for(let u of k)le(`bridge/${u}`,c,l.get(u),{map:p=>p.route===u?p:void 0});le("bridge/__unrouted",c,g,{map:u=>Be.has(u.route)?void 0:u});let G=new Map,ne=new Map;for(let u of k)G.set(u,Pe(`jobs/${u}`));let ge=[];for(let u of k){let p=l.get(u),T=G.get(u),x=new WeakSet,C=$([p.events],([ie])=>{let H=ie??[];for(let h of H){if(x.has(h))continue;x.add(h);let M=T.enqueue(h);ne.set(q(h),{route:u,id:M})}},{name:`jobs/${u}-mirror`});ge.push(C.subscribe(()=>{}))}function ye(u){let p=q(u),T=ne.get(p);T&&(G.get(T.route)?.removeById(T.id),ne.delete(p))}let Te=_e("gates"),Y=new Map;for(let u of k){let p=r.get(u);if(!p.gated)continue;let T=l.get(u),x=Te.approvalGate(`${u}/gate`,T.latest,{maxPending:p.maxPending,startOpen:p.startOpen});Y.set(u,x)}let J=[];for(let u of k)r.get(u).gated&&Y.has(u)?J.push(Y.get(u).node):J.push(l.get(u).latest);J.push(m.latest);let oe=Ce(...J),Ee=(t.executor??Qe(o,t.executePrompt))(oe),se=U(Ee,oe),ve=(t.verifier??Ue(o,t.verifyPrompt))(se),Re=U(ve,se),xe=t.maxReingestions??1,Ye=Math.min(t.maxTotalRetries??s*10,100),Je=Math.min(t.maxTotalReingestions??xe*10,100),he=A(0),be=A(0);function Ke(u,p,T){let x={item:T,outcome:p?.outcome??"failure",detail:p?.detail??"unknown",artifact:p?.artifact};return{item:T,execution:x,verified:u.verified,findings:u.findings??[],errorClass:u.errorClass}}function We(u,p){y.record(p.rootCause,p.intervention,!0),f.publish(u),ye(p)}function ze(u,p){let T=q(p),x=p.$retries??0,C={...p,$retries:x+1,summary:`[RETRY ${x+1}/${s}] ${T} \u2014 Previous attempt failed: ${u.findings.join("; ")}`,relatedTo:[T]};m.publish(C)}function Ie(u,p){y.record(p.rootCause,p.intervention,!1),f.publish(u),ye(p);let T=q(p),x=p.$reingestions??0;x<xe&&ue(be,Je)&&i.publish({source:p.source,summary:`Verification failed for: ${T}`,evidence:u.findings.join(`
43
+ `),affectsAreas:p.affectsAreas,affectsEvalTasks:p.affectsEvalTasks,severity:p.severity??"high",relatedTo:[T],$reingestions:x+1})}let ae=Ne([Re],(u,p)=>{let T=u[0];if(T==null||T.length===0)return;let x=T[T.length-1];if(x==null)return;let[C,ie]=x,[H,h]=ie??[null,null];if(!C||!h)return;if(H==null){Ie({item:h,execution:{item:h,outcome:"failure",detail:"executor returned null"},verified:!1,findings:["executor returned null"],errorClass:"structural"},h);return}let M=Ke(C,H,h);if(M.verified){We(M,h);return}let Ze=M.errorClass??d({item:h,outcome:H.outcome,detail:M.findings.join("; ")}),et=h.$retries??0;Ze==="self-correctable"&&et<s&&ue(he,Ye)?ze(M,h):Ie(M,h)}),Xe=ae.subscribe(()=>{}),ke=b([ae],()=>null,{name:"reflect",equals:()=>!1}),K;t.priority&&(K=kt(l,y,t));let v=new re(e,a,l,G,Y,y,he,be,K);v.addDisposer(w),v.addDisposer(Xe),v.addDisposer(y.dispose);for(let u of ge)v.addDisposer(u);if(v.add(I,{name:"triage"}),v.add(oe,{name:"execute-input"}),v.add(Ee,{name:"execute"}),v.add(se,{name:"execute-context"}),v.add(ve,{name:"verify"}),v.add(Re,{name:"verify-context"}),v.add(ae,{name:"verify-dispatch"}),v.add(ke,{name:"reflect"}),v.add(y.node,{name:"strategy"}),v.addDisposer(ke.subscribe(()=>{})),K)for(let[u,p]of K)v.add(p,{name:`priority/${u}`}),v.addDisposer(p.subscribe(()=>{}));v.mount("queues",a),v.mount("gates",Te);for(let[u,p]of G)v.mount(`jobs/${u}`,p);return v.tagFactory("harnessLoop",Ae(t)),v}function kt(e,t,o){if(!o.lastInteractionNs)throw new Error("harnessLoop: `opts.priority` requires `opts.lastInteractionNs` \u2014 pass a Node<number> (e.g. `fromTimer(60_000)` or a `state(monotonicNs())` you bump on human interaction). Priority scores only decay when this node settles; an internal default would freeze age at construction time.");let s=o.lastInteractionNs,n=o.priority??{},d={...L,...n.severityWeights},r=n.decayRate??D,a=n.effectivenessThreshold??.7,i=n.effectivenessBoost??15,c=new Map;for(let[m,f]of e){let l=b([f.latest,t.node,s],g=>{let y=g[0];if(y==null)return 0;let R=d[y.severity??"medium"]??40,E=(V()-g[2])/1e9,I=R*Math.exp(-r*Math.max(0,E)),N=`${y.rootCause}\u2192${y.intervention}`,w=g[1]?.get(N);return w&&w.successRate>=a&&(I+=i),I},{name:`priority/${m}`});c.set(m,l)}return c}function Nt(e,t){let o=Oe(e,t),s={};for(let n of k){let d=e.queues.has(n)?e.queues.topic(n):null;s[n]=d?.retained().length??0}return{...o,queueDepths:s,strategyEntries:e.strategy.node.cache?.size??0,totalRetries:e.totalRetries.cache??0,totalReingestions:e.totalReingestions.cache??0}}function At(e){let t={};for(let{label:o,paths:s}of e.stageNodes())for(let n of s)t[n]=o;return t}function St(e,t){let o=t?.logger===null?null:t?.logger??console.log,s=t?.detail??"summary",n=V(),d=[],r=[],a=At(e);function i(){return(V()-n)/1e9}function c(m,f,l){let g={elapsed:i(),stage:m,type:f};s!=="summary"&&(g.summary=Ot(l)),s==="full"&&(g.data=l),r.push(g)}for(let[m,f]of Object.entries(a))try{let l=e.observe(m,{format:"stage-log",stageLabels:a,logger:o?g=>o(g):()=>{},includeTypes:["data","error","complete"]});l.onEvent(g=>{g.type==="data"?c(f,"data",g.data):g.type==="error"?c(f,"error",g.data):g.type==="complete"&&c(f,"complete",void 0)}),d.push(l)}catch(l){let g=l instanceof Error?l.message:String(l);c(f,"error",`observe-unavailable: ${m} \u2014 ${g}`),o&&o(`[${i().toFixed(3)}s] ${f.padEnd(9)} \u2717 observe-unavailable: ${g}`)}return{get events(){return r},dispose(){for(let m of d)m.dispose();d.length=0}}}function Ot(e){if(e==null)return"null";if(typeof e=="string")return qe(e,80);if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{let t=JSON.stringify(e);return qe(t,120)}catch{return String(e)}}function qe(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}export{Ve as a,at as b,it as c,ut as d,lt as e,ct as f,dt as g,pt as h,ft as i,mt as j,k,ee as l,L as m,D as n,j as o,te as p,ce as q,de as r,pe as s,B as t,yt as u,fe as v,Le as w,xt as x,me as y,ht as z,Qe as A,Ue as B,re as C,It as D,Nt as E,St as F,wt as G};
@@ -1 +1 @@
1
- import{C as O}from"./chunk-RZ5HKPGI.js";import{D as H,E as A,G as k,m as D}from"./chunk-LYCLF26R.js";import{b as N,c as $,d as K,i as B,j as E}from"./chunk-CK2E7BTU.js";var C=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(n,t){if(t!==void 0&&t<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=t,t!==void 0){if(this._buf=new Array(t),n&&n.length>0){let s=Math.min(n.length,t),h=n.length-s;for(let o=0;o<s;o++)this._buf[o]=n[h+o];this._size=s}}else this._buf=n?[...n]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(n){if(!Number.isInteger(n))return;let t=n>=0?n:this._size+n;if(!(t<0||t>=this._size))return this._maxSize!==void 0?this._buf[(this._head+t)%this._maxSize]:this._buf[t]}append(n){this._rawAppend(n),this._version+=1}appendMany(n){if(n.length===0)return;let t=this._maxSize!==void 0&&n.length>this._maxSize?n.length-this._maxSize:0;for(let s=t;s<n.length;s++)this._rawAppend(n[s]);this._version+=1}clear(){if(this._size===0)return 0;let n=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let t=0;t<n;t++)this._buf[(this._head+t)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,n}trimHead(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return 0;let t=Math.min(n,this._size);if(this._maxSize===void 0)this._buf.splice(0,t);else{for(let s=0;s<t;s++)this._buf[(this._head+s)%this._maxSize]=void 0;this._head=(this._head+t)%this._maxSize}return this._size-=t,this._version+=1,t}slice(n,t){if(!Number.isInteger(n)||n<0)throw new RangeError(`slice: start must be a non-negative integer (got ${n})`);if(t!==void 0&&(!Number.isInteger(t)||t<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${t})`);let s=t===void 0?this._size:Math.min(Math.max(t,0),this._size),h=Math.min(n,this._size);if(h>=s)return[];let o=s-h;if(this._maxSize===void 0)return this._buf.slice(h,s);let b=new Array(o);for(let r=0;r<o;r++)b[r]=this._buf[(this._head+h+r)%this._maxSize];return b}tail(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`tail: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return[];let t=Math.min(n,this._size);return this.slice(this._size-t,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let n=new Array(this._size);for(let t=0;t<this._size;t++)n[t]=this._buf[(this._head+t)%this._maxSize];return n}snapshot(){return this.toArray()}restore(n){if(this._maxSize===void 0){this._buf.length=0;for(let t=0;t<n.length;t++)this._buf.push(n[t]);this._size=this._buf.length}else{let t=this._maxSize;for(let o=0;o<t;o++)this._buf[o]=void 0;this._head=0;let s=Math.min(n.length,t),h=n.length-s;for(let o=0;o<s;o++)this._buf[o]=n[h+o];this._size=s}this._version+=1}_rawAppend(n){if(this._maxSize===void 0){this._buf.push(n),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=n,this._size+=1):(this._buf[this._head]=n,this._head=(this._head+1)%this._maxSize)}};function x(g){return g.subscribe(()=>{})}var G=64;function Q(g,n={}){let{name:t,maxSize:s,versioning:h,guard:o,backend:b}=n,r=b??new C(g,s),m=A(r.toArray(),{name:t,describeKind:"state",equals:(e,i)=>e===i,...h!=null?{versioning:h}:{},...o!=null?{guard:o}:{}});function w(){let e=r.toArray();D(()=>{m.down([[$]],{internal:!0}),m.down([[N,e]],{internal:!0})})}let u=new Map,l=new Map,_=new Map;function M(e,i){return`${e}:${i===void 0?"END":i}`}function y(e){if(e.size<G)return;let i=e.keys().next();if(i.done)return;let d=e.get(i.value);d!==void 0&&d.dispose(),e.delete(i.value)}function v(e){let i=r.version;try{return e()}finally{r.version!==i&&w()}}function P(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);let i=u.get(e);if(i!==void 0)return u.delete(e),u.set(e,i),i.node;y(u);let d=k([m],([f])=>{let c=f;return e===0||c.length===0?[]:c.slice(Math.max(0,c.length-e))},{initial:r.tail(e),describeKind:"derived"}),a=x(d);return u.set(e,{node:d,dispose:a}),d}function j(e,i){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(i!==void 0&&(!Number.isInteger(i)||i<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${i})`);let d=M(e,i),a=l.get(d);if(a!==void 0)return l.delete(d),l.set(d,a),a.node;y(l);let f=k([m],([p])=>{let T=p;return i===void 0?T.slice(e):T.slice(e,i)},{initial:r.slice(e,i),describeKind:"derived"}),c=x(f);return l.set(d,{node:f,dispose:c}),f}function q(e){let i=_.get(e);if(i!==void 0)return i.node;let d=k([m,e],([f,c])=>{let p=f,T=Math.max(0,Math.trunc(c??0));return p.slice(T)},{initial:[],describeKind:"derived"}),a=x(d);return _.set(e,{node:d,dispose:a}),d}let L,S;function R(){L===void 0&&(L=H([m],(e,i,d)=>{let a=e[0],c=a!=null&&a.length>0?a.at(-1):d.prevData[0];if(c==null||c.length===0){i.down([[K]]);return}i.emit(c[c.length-1])},{name:t!=null?`${t}::lastValue`:"lastValue",describeKind:"derived",initial:r.size===0?void 0:r.at(r.size-1)}),S=k([m],([e])=>e.length>0,{name:t!=null?`${t}::hasLatest`:"hasLatest",describeKind:"derived",initial:r.size>0}),x(L),x(S))}let I={entries:m,get size(){return r.size},at(e){return r.at(e)},append(e){v(()=>r.append(e))},appendMany(e){e.length!==0&&v(()=>r.appendMany(e))},clear(){v(()=>r.clear())},trimHead(e){v(()=>r.trimHead(e))},withLatest(){return R(),m},get lastValue(){return R(),L},get hasLatest(){return R(),S},view(e){switch(e.kind){case"tail":return P(e.n);case"slice":return j(e.start,e.stop);case"fromCursor":return q(e.cursor)}},attach(e){let i=e.subscribe(d=>{for(let a of d)a[0]===N&&I.append(a[1])});return()=>i()},attachStorage(e){if(e.length===0)return()=>{};let i=new Map;for(let a of e)i.set(a,r.size);(async()=>{for(let a of e)if(typeof a.loadEntries=="function")try{let f=await Promise.resolve(a.loadEntries());f.entries.length>0&&r.size===0&&(r.restore(f.entries),i.set(a,f.entries.length),w());break}catch{}})();let d=m.subscribe(a=>{for(let f of a){if(f[0]!==N)continue;let c=f[1];for(let p of e){let T=i.get(p)??0;if(c.length<T){try{let z=p.appendEntries(c);z instanceof Promise&&z.catch(()=>{})}catch{}i.set(p,c.length);continue}if(c.length===T)continue;let F=c.slice(T);i.set(p,c.length);try{let z=p.appendEntries(F);z instanceof Promise&&z.catch(()=>{})}catch{}}}});return()=>d()},disposeAllViews(){for(let e of u.values())e.dispose();u.clear();for(let e of l.values())e.dispose();l.clear();for(let e of _.values())e.dispose();_.clear()},dispose(){for(let e of u.values())e.dispose();u.clear();for(let e of l.values())e.dispose();l.clear();for(let e of _.values())e.dispose();_.clear()}};return I}var V=new WeakMap;function Z(g){let n=V.get(g);if(n)return n;let t=g.map(u=>u.cache??[]),s=t.flat(),h=A(s,{name:"mergeReactiveLogs",describeKind:"state",equals:(u,l)=>u===l}),o=g.map((u,l)=>[...t[l]??[]]),b=[];for(let u=0;u<g.length;u++){let l=u,_=g[l].subscribe(M=>{for(let y of M)if(y[0]===N)o[l]=[...y[1]],h.emit(o.flat());else if(y[0]===B){o[l]=[];let v=b[l];v!==void 0&&(b[l]=void 0,v())}else y[0]===E&&h.down([[E,y[1]]])});b.push(_)}let r=O(h),m=!1,w={node:h,dispose(){if(!m){m=!0;for(let u of b)u?.();b.length=0,r(),V.delete(g)}}};return V.set(g,w),w}export{C as a,Q as b,Z as c};
1
+ import{C as O}from"./chunk-CKFQS2CJ.js";import{D as H,E as A,G as k,m as D}from"./chunk-LYCLF26R.js";import{b as N,c as $,d as K,i as B,j as E}from"./chunk-CK2E7BTU.js";var C=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(n,t){if(t!==void 0&&t<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=t,t!==void 0){if(this._buf=new Array(t),n&&n.length>0){let s=Math.min(n.length,t),h=n.length-s;for(let o=0;o<s;o++)this._buf[o]=n[h+o];this._size=s}}else this._buf=n?[...n]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(n){if(!Number.isInteger(n))return;let t=n>=0?n:this._size+n;if(!(t<0||t>=this._size))return this._maxSize!==void 0?this._buf[(this._head+t)%this._maxSize]:this._buf[t]}append(n){this._rawAppend(n),this._version+=1}appendMany(n){if(n.length===0)return;let t=this._maxSize!==void 0&&n.length>this._maxSize?n.length-this._maxSize:0;for(let s=t;s<n.length;s++)this._rawAppend(n[s]);this._version+=1}clear(){if(this._size===0)return 0;let n=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let t=0;t<n;t++)this._buf[(this._head+t)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,n}trimHead(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return 0;let t=Math.min(n,this._size);if(this._maxSize===void 0)this._buf.splice(0,t);else{for(let s=0;s<t;s++)this._buf[(this._head+s)%this._maxSize]=void 0;this._head=(this._head+t)%this._maxSize}return this._size-=t,this._version+=1,t}slice(n,t){if(!Number.isInteger(n)||n<0)throw new RangeError(`slice: start must be a non-negative integer (got ${n})`);if(t!==void 0&&(!Number.isInteger(t)||t<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${t})`);let s=t===void 0?this._size:Math.min(Math.max(t,0),this._size),h=Math.min(n,this._size);if(h>=s)return[];let o=s-h;if(this._maxSize===void 0)return this._buf.slice(h,s);let b=new Array(o);for(let r=0;r<o;r++)b[r]=this._buf[(this._head+h+r)%this._maxSize];return b}tail(n){if(!Number.isInteger(n)||n<0)throw new RangeError(`tail: n must be a non-negative integer (got ${n})`);if(n===0||this._size===0)return[];let t=Math.min(n,this._size);return this.slice(this._size-t,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let n=new Array(this._size);for(let t=0;t<this._size;t++)n[t]=this._buf[(this._head+t)%this._maxSize];return n}snapshot(){return this.toArray()}restore(n){if(this._maxSize===void 0){this._buf.length=0;for(let t=0;t<n.length;t++)this._buf.push(n[t]);this._size=this._buf.length}else{let t=this._maxSize;for(let o=0;o<t;o++)this._buf[o]=void 0;this._head=0;let s=Math.min(n.length,t),h=n.length-s;for(let o=0;o<s;o++)this._buf[o]=n[h+o];this._size=s}this._version+=1}_rawAppend(n){if(this._maxSize===void 0){this._buf.push(n),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=n,this._size+=1):(this._buf[this._head]=n,this._head=(this._head+1)%this._maxSize)}};function x(g){return g.subscribe(()=>{})}var G=64;function Q(g,n={}){let{name:t,maxSize:s,versioning:h,guard:o,backend:b}=n,r=b??new C(g,s),m=A(r.toArray(),{name:t,describeKind:"state",equals:(e,i)=>e===i,...h!=null?{versioning:h}:{},...o!=null?{guard:o}:{}});function w(){let e=r.toArray();D(()=>{m.down([[$]],{internal:!0}),m.down([[N,e]],{internal:!0})})}let u=new Map,l=new Map,_=new Map;function M(e,i){return`${e}:${i===void 0?"END":i}`}function y(e){if(e.size<G)return;let i=e.keys().next();if(i.done)return;let d=e.get(i.value);d!==void 0&&d.dispose(),e.delete(i.value)}function v(e){let i=r.version;try{return e()}finally{r.version!==i&&w()}}function P(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);let i=u.get(e);if(i!==void 0)return u.delete(e),u.set(e,i),i.node;y(u);let d=k([m],([f])=>{let c=f;return e===0||c.length===0?[]:c.slice(Math.max(0,c.length-e))},{initial:r.tail(e),describeKind:"derived"}),a=x(d);return u.set(e,{node:d,dispose:a}),d}function j(e,i){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(i!==void 0&&(!Number.isInteger(i)||i<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${i})`);let d=M(e,i),a=l.get(d);if(a!==void 0)return l.delete(d),l.set(d,a),a.node;y(l);let f=k([m],([p])=>{let T=p;return i===void 0?T.slice(e):T.slice(e,i)},{initial:r.slice(e,i),describeKind:"derived"}),c=x(f);return l.set(d,{node:f,dispose:c}),f}function q(e){let i=_.get(e);if(i!==void 0)return i.node;let d=k([m,e],([f,c])=>{let p=f,T=Math.max(0,Math.trunc(c??0));return p.slice(T)},{initial:[],describeKind:"derived"}),a=x(d);return _.set(e,{node:d,dispose:a}),d}let L,S;function R(){L===void 0&&(L=H([m],(e,i,d)=>{let a=e[0],c=a!=null&&a.length>0?a.at(-1):d.prevData[0];if(c==null||c.length===0){i.down([[K]]);return}i.emit(c[c.length-1])},{name:t!=null?`${t}::lastValue`:"lastValue",describeKind:"derived",initial:r.size===0?void 0:r.at(r.size-1)}),S=k([m],([e])=>e.length>0,{name:t!=null?`${t}::hasLatest`:"hasLatest",describeKind:"derived",initial:r.size>0}),x(L),x(S))}let I={entries:m,get size(){return r.size},at(e){return r.at(e)},append(e){v(()=>r.append(e))},appendMany(e){e.length!==0&&v(()=>r.appendMany(e))},clear(){v(()=>r.clear())},trimHead(e){v(()=>r.trimHead(e))},withLatest(){return R(),m},get lastValue(){return R(),L},get hasLatest(){return R(),S},view(e){switch(e.kind){case"tail":return P(e.n);case"slice":return j(e.start,e.stop);case"fromCursor":return q(e.cursor)}},attach(e){let i=e.subscribe(d=>{for(let a of d)a[0]===N&&I.append(a[1])});return()=>i()},attachStorage(e){if(e.length===0)return()=>{};let i=new Map;for(let a of e)i.set(a,r.size);(async()=>{for(let a of e)if(typeof a.loadEntries=="function")try{let f=await Promise.resolve(a.loadEntries());f.entries.length>0&&r.size===0&&(r.restore(f.entries),i.set(a,f.entries.length),w());break}catch{}})();let d=m.subscribe(a=>{for(let f of a){if(f[0]!==N)continue;let c=f[1];for(let p of e){let T=i.get(p)??0;if(c.length<T){try{let z=p.appendEntries(c);z instanceof Promise&&z.catch(()=>{})}catch{}i.set(p,c.length);continue}if(c.length===T)continue;let F=c.slice(T);i.set(p,c.length);try{let z=p.appendEntries(F);z instanceof Promise&&z.catch(()=>{})}catch{}}}});return()=>d()},disposeAllViews(){for(let e of u.values())e.dispose();u.clear();for(let e of l.values())e.dispose();l.clear();for(let e of _.values())e.dispose();_.clear()},dispose(){for(let e of u.values())e.dispose();u.clear();for(let e of l.values())e.dispose();l.clear();for(let e of _.values())e.dispose();_.clear()}};return I}var V=new WeakMap;function Z(g){let n=V.get(g);if(n)return n;let t=g.map(u=>u.cache??[]),s=t.flat(),h=A(s,{name:"mergeReactiveLogs",describeKind:"state",equals:(u,l)=>u===l}),o=g.map((u,l)=>[...t[l]??[]]),b=[];for(let u=0;u<g.length;u++){let l=u,_=g[l].subscribe(M=>{for(let y of M)if(y[0]===N)o[l]=[...y[1]],h.emit(o.flat());else if(y[0]===B){o[l]=[];let v=b[l];v!==void 0&&(b[l]=void 0,v())}else y[0]===E&&h.down([[E,y[1]]])});b.push(_)}let r=O(h),m=!1,w={node:h,dispose(){if(!m){m=!0;for(let u of b)u?.();b.length=0,r(),V.delete(g)}}};return V.set(g,w),w}export{C as a,Q as b,Z as c};
@@ -0,0 +1,84 @@
1
+ import{b as X}from"./chunk-LYM4PBMV.js";import{g as Q,i as U}from"./chunk-2BX4NB34.js";import{E as z,F as W,G as Y,H as V}from"./chunk-LYCLF26R.js";import{b as ie}from"./chunk-QYADASLV.js";var he={};ie(he,{compileSpec:()=>ue,decompileSpec:()=>me,extractFnFactory:()=>te,extractSourceFactory:()=>ne,generateCatalogPrompt:()=>oe,isRichFnEntry:()=>T,isRichSourceEntry:()=>I,llmCompose:()=>ye,llmRefine:()=>ae,specDiff:()=>ge,validateSpec:()=>q,validateSpecAgainstCatalog:()=>K});function M(n){let e=n.meta?.factory;return typeof e=="string"?e:void 0}function C(n){let e=n.meta?.factoryArgs;return e!=null&&typeof e=="object"?e:{}}function Z(n){let e=C(n);return"initial"in e?e.initial:n.value}function T(n){return typeof n=="object"&&n!==null&&"factory"in n}function I(n){return typeof n=="object"&&n!==null&&"factory"in n}function te(n){return T(n)?n.factory:n}function ne(n){return I(n)?n.factory:n}function oe(n){let e=[];if(n.fns){let o=new Map;for(let[s,f]of Object.entries(n.fns)){let p=T(f)?f.tags?.[0]??"Other":"Other";o.has(p)||o.set(p,[]),o.get(p).push(ce(s,f))}for(let[s,f]of o)e.push(`${s}:
2
+ ${f.join(`
3
+ `)}`)}if(n.sources){let o=[];for(let[s,f]of Object.entries(n.sources))o.push(pe(s,f));o.length>0&&e.push(`Sources:
4
+ ${o.join(`
5
+ `)}`)}return e.join(`
6
+
7
+ `)}function ce(n,e){if(!T(e))return`- ${n}`;let o=`- ${n}: ${e.description}`;if(e.configSchema){let s=Object.entries(e.configSchema).map(([f,p])=>{let u=`${f}: ${p.type}`;return p.enum&&(u+=` (${p.enum.join("|")})`),p.required===!1&&(u+="?"),u});o+=`. Config: { ${s.join(", ")} }`}return o}function pe(n,e){if(!I(e))return`- ${n}`;let o=`- ${n}: ${e.description}`;if(e.configSchema){let s=Object.entries(e.configSchema).map(([f,p])=>{let u=`${f}: ${p.type}`;return p.required===!1&&(u+="?"),u});o+=`. Config: { ${s.join(", ")} }`}return o}function K(n,e){let o=[],s=new Set(Object.keys(e.fns??{})),f=new Set(Object.keys(e.sources??{}));for(let[p,u]of Object.entries(n.nodes)){if(u.type==="template")continue;let i=u,r=M(i);if(r==null)continue;let t=i.type==="producer";if(i.type==="state"&&r==="state")continue;if(t){let h=f.has(r),l=s.has(r);if(!h&&!l&&(f.size>0||s.size>0)){let b=J(r,f)??J(r,s);o.push(`Node "${p}": source "${r}" not found in catalog`+(b?`. Did you mean "${b}"?`:""))}}else if(s.size>0&&!s.has(r))if(f.has(r))o.push(`Node "${p}": fn "${r}" is a source, not a function. Use it as a producer source instead, or use a function from: ${[...s].join(", ")}`);else{let h=J(r,s);o.push(`Node "${p}": fn "${r}" not found in catalog`+(h?`. Did you mean "${h}"?`:""))}let m=C(i);if(!t&&e.fns?.[r]){let h=e.fns[r];if(T(h)&&h.configSchema){for(let[l,b]of Object.entries(h.configSchema))if(b.required!==!1&&!(l in m)&&o.push(`Node "${p}": config missing required field "${l}"`),l in m&&b.enum){let S=m[l];b.enum.includes(S)||o.push(`Node "${p}": config.${l} = ${JSON.stringify(S)}, expected one of: ${b.enum.join(", ")}`)}}}if(t&&e.sources?.[r]){let h=e.sources[r];if(I(h)&&h.configSchema){for(let[l,b]of Object.entries(h.configSchema))if(b.required!==!1&&!(l in m)&&o.push(`Node "${p}": config missing required field "${l}"`),l in m&&b.enum){let S=m[l];b.enum.includes(S)||o.push(`Node "${p}": config.${l} = ${JSON.stringify(S)}, expected one of: ${b.enum.join(", ")}`)}}}}if(n.templates)for(let[p,u]of Object.entries(n.templates))for(let[i,r]of Object.entries(u.nodes)){let t=M(r);if(t!=null&&!(r.type==="state"&&t==="state")&&r.type!=="producer"&&s.size>0&&!s.has(t)){let m=J(t,s);o.push(`Template "${p}" node "${i}": fn "${t}" not found in catalog`+(m?`. Did you mean "${m}"?`:""))}}return{valid:o.length===0,errors:o,warnings:[]}}function J(n,e){let o=null,s=1/0,f=n.toLowerCase();for(let p of e){let u=fe(f,p.toLowerCase());u<s&&u<=Math.max(3,Math.floor(n.length/2))&&(s=u,o=p)}return o}function fe(n,e){let o=n.length,s=e.length,f=Array.from({length:o+1},(p,u)=>Array.from({length:s+1},(i,r)=>u===0?r:r===0?u:0));for(let p=1;p<=o;p++)for(let u=1;u<=s;u++)f[p][u]=n[p-1]===e[u-1]?f[p-1][u-1]:1+Math.min(f[p-1][u],f[p][u-1],f[p-1][u-1]);return f[o][s]}var ee=new Set(["state","producer","derived","effect","operator","template"]),de=new Set(["state","producer","derived","effect","operator"]);function q(n){let e=[],o=[];if(n==null||typeof n!="object")return{valid:!1,errors:["GraphSpec must be a non-null object"],warnings:o};let s=n;if((typeof s.name!="string"||s.name.length===0)&&e.push("Missing or empty 'name' field"),s.nodes==null||typeof s.nodes!="object"||Array.isArray(s.nodes))return e.push("Missing or invalid 'nodes' field (must be an object)"),{valid:!1,errors:e,warnings:o};let f=new Set(Object.keys(s.nodes)),p=new Map,u=new Map;if(s.templates!=null&&typeof s.templates=="object"&&!Array.isArray(s.templates)){for(let[i,r]of Object.entries(s.templates))if(r!=null&&typeof r=="object"){let t=r;u.set(i,{params:Array.isArray(t.params)?t.params:[]})}}if(s.templates!=null)if(typeof s.templates!="object"||Array.isArray(s.templates))e.push("'templates' must be an object");else for(let[i,r]of Object.entries(s.templates)){if(r==null||typeof r!="object"){e.push(`Template "${i}": must be an object`);continue}let t=r;if(Array.isArray(t.params)||e.push(`Template "${i}": missing 'params' array`),t.nodes==null||typeof t.nodes!="object"||Array.isArray(t.nodes))e.push(`Template "${i}": missing or invalid 'nodes' object`);else{let m=new Set(Array.isArray(t.params)?t.params:[]),h=new Set(Object.keys(t.nodes));for(let[l,b]of Object.entries(t.nodes)){if(b==null||typeof b!="object"){e.push(`Template "${i}" node "${l}": must be an object`);continue}let S=b;if((typeof S.type!="string"||!de.has(S.type))&&e.push(`Template "${i}" node "${l}": invalid type`),Array.isArray(S.deps))for(let g of S.deps)!h.has(g)&&!m.has(g)&&e.push(`Template "${i}" node "${l}": dep "${g}" is not an inner node or param`)}typeof t.output!="string"?e.push(`Template "${i}": missing 'output' string`):t.nodes[t.output]||e.push(`Template "${i}": output "${t.output}" is not a declared node`)}}for(let[i,r]of Object.entries(s.nodes)){if(r==null||typeof r!="object"){e.push(`Node "${i}": must be an object`);continue}let t=r;if(typeof t.type!="string"||!ee.has(t.type)){e.push(`Node "${i}": invalid type "${String(t.type)}" (expected: ${[...ee].join(", ")})`);continue}if(p.set(i,t.type),t.type==="template")if(typeof t.template!="string"||!u.has(t.template))e.push(`Node "${i}": template "${String(t.template)}" not found in templates`);else if(t.bind==null||typeof t.bind!="object"||Array.isArray(t.bind))e.push(`Node "${i}": template ref requires 'bind' object`);else{let m=u.get(t.template),h=t.bind;for(let l of m.params)l in h||e.push(`Node "${i}": template param "${l}" is not bound (template "${t.template}")`);for(let[,l]of Object.entries(h))typeof l=="string"&&!f.has(l)&&e.push(`Node "${i}": bind target "${l}" does not reference an existing node`)}else{if(Array.isArray(t.deps))for(let m of t.deps)m===i?e.push(`Node "${i}": self-referencing dep`):f.has(m)||e.push(`Node "${i}": dep "${m}" does not reference an existing node`);(t.type==="derived"||t.type==="effect"||t.type==="operator")&&!Array.isArray(t.deps)&&e.push(`Node "${i}": ${t.type} node should have a 'deps' array`)}}if(s.feedback!=null)if(!Array.isArray(s.feedback))e.push("'feedback' must be an array");else for(let i=0;i<s.feedback.length;i++){let r=s.feedback[i];if(r==null||typeof r!="object"){e.push(`Feedback [${i}]: must be an object`);continue}let t=r;typeof t.from!="string"||!f.has(t.from)?e.push(`Feedback [${i}]: 'from' "${String(t.from)}" does not reference an existing node`):p.get(t.from)==="effect"&&o.push(`Feedback [${i}]: 'from' "${t.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 t.from=="string"&&t.from===t.to&&e.push(`Feedback [${i}]: 'from' and 'to' must be different nodes`),typeof t.to!="string"||!f.has(t.to)?e.push(`Feedback [${i}]: 'to' "${String(t.to)}" does not reference an existing node`):typeof t.to=="string"&&p.get(t.to)!=="state"&&e.push(`Feedback [${i}]: 'to' node "${t.to}" must be a state node (got "${p.get(t.to)??"unknown"}")`)}return{valid:e.length===0,errors:e,warnings:o}}function ue(n,e){let o=q(n);if(!o.valid)throw new Error(`compileSpec: invalid GraphSpec:
8
+ ${o.errors.join(`
9
+ `)}`);let s=n.factory,f=n.factoryArgs;if(typeof s=="string"){let a=e?.catalog?.graphFactories?.[s];if(a)return a(f)}let p=e?.catalog??{},u=e?.onMissing??"placeholder",i=new U(n.name),r=n.templates??{},t=K(n,p);if(!t.valid)throw new Error(`compileSpec: catalog validation errors:
10
+ ${t.errors.join(`
11
+ `)}`);let m=[],h=(a,d,y)=>{m.push({path:a,kind:d,name:y})},l=a=>{let d=p.fns?.[a];return d?te(d):void 0},b=a=>{let d=p.sources?.[a];return d?ne(d):void 0},S=a=>{if(!a)return;let d={};for(let[y,w]of Object.entries(a))y==="factory"||y==="factoryArgs"||(d[y]=w);return Object.keys(d).length>0?d:void 0},g=new Map,x=[];for(let[a,d]of Object.entries(n.nodes)){if(d.type==="template")continue;let y=d,w=M(y),k=C(y);if(y.type==="state"){let v=Z(y),R=z(v,{name:a,meta:S(y.meta)});i.add(R,{name:a}),g.set(a,R)}else if(y.type==="producer"){let v=w?b(w):void 0,R=w?l(w):void 0;if(v){let N=v(k);i.add(N,{name:a}),g.set(a,N)}else if(R){let N=R([],k);i.add(N,{name:a}),g.set(a,N)}else{w&&h(a,"source",w);let N=W(()=>{},{name:a,meta:{...S(y.meta),_specSource:w}});i.add(N,{name:a}),g.set(a,N)}}else x.push([a,y])}let L=!0,c=new Map(x);for(;c.size>0&&L;){L=!1;for(let[a,d]of[...c.entries()]){let y=d.deps??[];if(!y.every(F=>g.has(F)))continue;let w=y.map(F=>g.get(F)),k=M(d),v=C(d),R=k?l(k):void 0,N;R?N=R(w,v):d.type==="effect"?(k&&h(a,"fn",k),N=V(w,()=>{})):(k&&h(a,"fn",k),N=Y(w,F=>F[0])),i.add(N,{name:a}),g.set(a,N),c.delete(a),L=!0}}if(c.size>0){let a=[...c.keys()].sort().join(", ");throw new Error(`compileSpec: unresolvable deps for nodes: ${a}`)}for(let[a,d]of Object.entries(n.nodes)){if(d.type!=="template")continue;let y=d,w=r[y.template],k=new U(a),v=new Map,R=[];for(let[$,j]of Object.entries(w.nodes)){let P=(j.deps??[]).map(A=>A.startsWith("$")&&y.bind[A]?y.bind[A]:A),H={...j,deps:P},G=M(j),E=C(j);if(j.type==="state"){let A=Z(j),_=z(A,{name:$,meta:S(j.meta)});k.add(_,{name:$}),v.set($,_)}else if(j.type==="producer"){let A=G?b(G):void 0,_=G?l(G):void 0;if(A){let O=A(E);k.add(O,{name:$}),v.set($,O)}else if(_){let O=_([],E);k.add(O,{name:$}),v.set($,O)}else{G&&h(`${a}.${$}`,"source",G);let O=W(()=>{},{name:$,meta:{...S(j.meta),_specSource:G}});k.add(O,{name:$}),v.set($,O)}}else R.push([$,H])}let N=!0,F=new Map(R);for(;F.size>0&&N;){N=!1;for(let[$,j]of[...F.entries()]){let P=j.deps??[];if(!P.every(D=>v.has(D)||g.has(D)))continue;let G=P.map(D=>v.get(D)??g.get(D)),E=M(j),A=C(j),_=E?l(E):void 0,O;_?O=_(G,A):j.type==="effect"?(E&&h(`${a}.${$}`,"fn",E),O=V(G,()=>{})):(E&&h(`${a}.${$}`,"fn",E),O=Y(G,D=>D[0])),k.add(O,{name:$}),v.set($,O),F.delete($),N=!0}}if(F.size>0){let $=[...F.keys()].sort().join(", ");throw new Error(`compileSpec: template "${y.template}" has unresolvable deps: ${$}`)}i.mount(a,k);let B=`${a}::${w.output}`;g.set(a,i.resolve(B));try{let $=i.resolve(B);$.meta._templateName?.emit(y.template),$.meta._templateBind?.emit(y.bind)}catch{}}for(let a of n.feedback??[])X(i,a.from,a.to,{maxIterations:a.maxIterations});if(m.length>0){if(u==="error"){let a=m.map(d=>` - ${d.path}: missing ${d.kind} "${d.name}"`);throw new Error(`compileSpec: ${m.length} catalog entr${m.length===1?"y":"ies"} missing \u2014 pass them via opts.catalog or set opts.onMissing to "warn"/"placeholder":
12
+ ${a.join(`
13
+ `)}`)}if(u==="warn"){let a=e?.onWarn??(d=>console.warn(d));for(let d of m)a(`compileSpec: ${d.path} references missing ${d.kind} "${d.name}" \u2014 substituted placeholder`)}}return i}var le=new Set(["reduction","reduction_type","_specFn","_specSource","_templateName","_templateBind","feedbackFrom","feedbackTo","_internal"]);function me(n){let e=n.describe({detail:"spec"}),o=`::${Q}::`,s=/^__feedback_(?!effect_)(.+)$/,f=[],p=new Set;for(let[r,t]of Object.entries(e.nodes))t.meta?.factory!=null&&!r.includes("::")&&p.add(r);let u={};for(let[r,t]of Object.entries(e.nodes)){if(r.includes(o))continue;let m=r.indexOf("::");if(m>0&&p.has(r.slice(0,m)))continue;if(s.exec(r)){let g=t.meta;g?.feedbackFrom&&g?.feedbackTo&&f.push({from:g.feedbackFrom,to:g.feedbackTo,...g.maxIterations?{maxIterations:g.maxIterations}:{}});continue}if(t.meta?._internal||r.startsWith("__feedback_effect_")||r.startsWith("__bridge_"))continue;let l=t.meta,b=l;if(l&&Object.keys(l).length>0){let g={};for(let[x,L]of Object.entries(l))le.has(x)||(g[x]=L);g.factory==="withStatus"?(delete g.status,delete g.error):g.factory==="withBreaker"?delete g.breakerState:g.factory==="verifiable"&&delete g.sourceVersion,b=Object.keys(g).length>0?g:void 0}let S={...t};b===void 0?delete S.meta:S.meta=b,u[r]=S}let i={...e,nodes:u};return delete i.expand,f.length>0&&(i.feedback=f),i}function ge(n,e){let o=[];n.name!==e.name&&o.push({type:"changed",path:"name",detail:`"${n.name}" \u2192 "${e.name}"`});let s=new Set(Object.keys(n.nodes)),f=new Set(Object.keys(e.nodes));for(let c of f)if(!s.has(c)){let a=e.nodes[c];o.push({type:"added",path:`nodes.${c}`,detail:`type: ${a.type}`})}for(let c of s)f.has(c)||o.push({type:"removed",path:`nodes.${c}`});for(let c of s){if(!f.has(c))continue;let a=n.nodes[c],d=e.nodes[c];if(JSON.stringify(a)!==JSON.stringify(d)){let y=[];a.type!==d.type&&y.push(`type: ${a.type} \u2192 ${d.type}`),JSON.stringify(a.deps)!==JSON.stringify(d.deps)&&y.push("deps changed");let w=a.type==="template"?void 0:M(a),k=d.type==="template"?void 0:M(d);w!==k&&y.push(`fn: ${w} \u2192 ${k}`);let v=a.type==="template"?void 0:C(a),R=d.type==="template"?void 0:C(d);JSON.stringify(v)!==JSON.stringify(R)&&y.push("config changed"),o.push({type:"changed",path:`nodes.${c}`,detail:y.join("; ")||"modified"})}}let p=n.templates??{},u=e.templates??{},i=new Set(Object.keys(p)),r=new Set(Object.keys(u));for(let c of r)i.has(c)||o.push({type:"added",path:`templates.${c}`});for(let c of i)r.has(c)||o.push({type:"removed",path:`templates.${c}`});for(let c of i)r.has(c)&&JSON.stringify(p[c])!==JSON.stringify(u[c])&&o.push({type:"changed",path:`templates.${c}`,detail:"template definition changed"});let t=n.feedback??[],m=e.feedback??[],h=new Set(t.map(c=>`${c.from}->${c.to}`)),l=new Set(m.map(c=>`${c.from}->${c.to}`));for(let c of m){let a=`${c.from}->${c.to}`;h.has(a)||o.push({type:"added",path:`feedback.${a}`,detail:`maxIterations: ${c.maxIterations??10}`})}for(let c of t){let a=`${c.from}->${c.to}`;l.has(a)||o.push({type:"removed",path:`feedback.${a}`})}for(let c of t){let a=`${c.from}->${c.to}`,d=m.find(y=>y.from===c.from&&y.to===c.to);d&&JSON.stringify(c)!==JSON.stringify(d)&&o.push({type:"changed",path:`feedback.${a}`,detail:`maxIterations: ${c.maxIterations??10} \u2192 ${d.maxIterations??10}`})}let b=o.filter(c=>c.type==="added").length,S=o.filter(c=>c.type==="removed").length,g=o.filter(c=>c.type==="changed").length,x=[];b&&x.push(`${b} added`),S&&x.push(`${S} removed`),g&&x.push(`${g} changed`);let L=x.length>0?x.join(", "):"no changes";return{entries:o,summary:L}}var se=`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",
22
+ "deps": ["<dep_node_name>", ...],
23
+ "value": <initial_value>,
24
+ "meta": {
25
+ "factory": "<catalog_factory_name>",
26
+ "factoryArgs": { ... },
27
+ "description": "<purpose>"
28
+ }
29
+ },
30
+ "<template_instance>": {
31
+ "type": "template",
32
+ "template": "<template_name>",
33
+ "bind": { "$param": "node_name" }
34
+ }
35
+ },
36
+ "templates": {
37
+ "<template_name>": {
38
+ "params": ["$param1", "$param2"],
39
+ "nodes": { ... },
40
+ "output": "<output_node>"
41
+ }
42
+ },
43
+ "feedback": [
44
+ { "from": "<condition_node>", "to": "<state_node>", "maxIterations": 10 }
45
+ ]
46
+ }
47
+
48
+ Rules:
49
+ - "state" nodes hold user/LLM-writable values (knobs). Stamp the initial value
50
+ in "meta.factoryArgs.initial" (or as the top-level "value" field \u2014 both work).
51
+ - "derived" nodes compute from deps using a catalog function named in
52
+ "meta.factory"; pass any config via "meta.factoryArgs".
53
+ - "effect" nodes produce side effects from deps; same meta.factory shape as derived.
54
+ - "producer" nodes generate values from a catalog source named in "meta.factory";
55
+ pass any config via "meta.factoryArgs".
56
+ - Use "templates" when the same subgraph pattern repeats (e.g., per-source resilience).
57
+ - Use "feedback" for bounded cycles where a derived value writes back to a state node.
58
+ - meta.description is required for every node.
59
+ - Return ONLY valid JSON, no markdown fences or commentary.`;function re(n){let e=n.match(/^```(?:json)?\s*([\s\S]*?)\s*```[\s\S]*$/);return e?e[1]:n}async function ye(n,e,o){let s=se,f=o?.catalogDescription??(o?.catalog?oe(o.catalog):void 0);f&&(s+=`
60
+
61
+ Available catalog (use ONLY these names):
62
+ ${f}`),o?.systemPromptExtra&&(s+=`
63
+
64
+ ${o.systemPromptExtra}`);let p=[{role:"system",content:s},{role:"user",content:n}],r=(await e.invoke(p,{model:o?.model,temperature:o?.temperature??0,maxTokens:o?.maxTokens})).content.trim();r.startsWith("```")&&(r=re(r));let t;try{t=JSON.parse(r)}catch{throw new Error(`llmCompose: LLM response is not valid JSON: ${r.slice(0,200)}`)}let m=q(t);if(!m.valid)throw new Error(`llmCompose: invalid GraphSpec:
65
+ ${m.errors.join(`
66
+ `)}`);let h=t;if(o?.catalog){let l=o.maxAutoRefine??0;for(let b=0;b<=l;b++){let S=K(h,o.catalog);if(S.valid)break;if(b===l)throw new Error(`llmCompose: catalog validation failed after ${l} refine attempts:
67
+ ${S.errors.join(`
68
+ `)}`);h=await ae(h,`Fix these catalog errors:
69
+ ${S.errors.join(`
70
+ `)}
71
+
72
+ Use ONLY functions and sources from the catalog.`,e,{...o,catalogDescription:f})}}return h}async function ae(n,e,o,s){let f=se;s?.catalogDescription&&(f+=`
73
+
74
+ Available catalog:
75
+ ${s.catalogDescription}`),s?.systemPromptExtra&&(f+=`
76
+
77
+ ${s.systemPromptExtra}`);let p=[{role:"system",content:f},{role:"user",content:`Current GraphSpec:
78
+ ${JSON.stringify(n,null,2)}
79
+
80
+ Modification request: ${e}
81
+
82
+ Return the complete modified GraphSpec as JSON.`}],r=(await o.invoke(p,{model:s?.model,temperature:s?.temperature??0,maxTokens:s?.maxTokens})).content.trim();r.startsWith("```")&&(r=re(r));let t;try{t=JSON.parse(r)}catch{throw new Error(`llmRefine: LLM response is not valid JSON: ${r.slice(0,200)}`)}let m=q(t);if(!m.valid)throw new Error(`llmRefine: invalid GraphSpec:
83
+ ${m.errors.join(`
84
+ `)}`);return t}export{T as a,I as b,te as c,ne as d,oe as e,K as f,q as g,ue as h,me as i,ge as j,ye as k,ae as l,he as m};