@graphrefly/graphrefly 0.41.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/dist/{cascading-Cxs1eztH.d.cts → cascading-CH-_VwG9.d.cts} +2 -2
  2. package/dist/{cascading-BNfxffgc.d.ts → cascading-OgKQZjsa.d.ts} +2 -2
  3. package/dist/{chunk-L77I47VU.js → chunk-2K5RXLAH.js} +1 -1
  4. package/dist/chunk-3ERTUW2J.js +45 -0
  5. package/dist/chunk-3K7HA4Y6.js +1 -0
  6. package/dist/chunk-3ZZX7M25.js +1 -0
  7. package/dist/chunk-4QH6VJF4.js +1 -0
  8. package/dist/{chunk-M3FQSXEW.js → chunk-5QRRKBUT.js} +1 -1
  9. package/dist/chunk-5ST42ESJ.js +1 -0
  10. package/dist/{chunk-AK5RHMC5.js → chunk-6YFZMUMR.js} +1 -1
  11. package/dist/{chunk-SC27WTSG.js → chunk-7ARY3Y3T.js} +1 -1
  12. package/dist/chunk-7B7ELAT2.js +1 -0
  13. package/dist/{chunk-F7VUYPP6.js → chunk-7VKFXLZQ.js} +1 -1
  14. package/dist/chunk-ACMJ2ZPS.js +3 -0
  15. package/dist/{chunk-7PQLZMOG.js → chunk-AGNM6RS6.js} +1 -1
  16. package/dist/chunk-AS3TV2TV.js +1 -0
  17. package/dist/{chunk-CGNOWGV6.js → chunk-CISGGAIF.js} +1 -1
  18. package/dist/{chunk-ZAJ7J7TO.js → chunk-DEJTNNQC.js} +1 -1
  19. package/dist/{chunk-AI7QC7J6.js → chunk-FDZAZNRO.js} +1 -1
  20. package/dist/{chunk-OV5AA6HJ.js → chunk-FUZ6S2DY.js} +1 -1
  21. package/dist/{chunk-G3M3IMEV.js → chunk-G5VBJ5K6.js} +1 -1
  22. package/dist/{chunk-KNVCCBIU.js → chunk-HZKW2AAB.js} +1 -1
  23. package/dist/{chunk-CYOSWFT2.js → chunk-IZM3UEH3.js} +3 -3
  24. package/dist/{chunk-UISPDFJ3.js → chunk-KCACBSJH.js} +1 -1
  25. package/dist/{chunk-GI4Q7PNY.js → chunk-KT5DTRBP.js} +1 -1
  26. package/dist/{chunk-33N4TU3X.js → chunk-KY2LMAXU.js} +1 -1
  27. package/dist/{chunk-TT4C7DXW.js → chunk-LDQ3IUIP.js} +1 -1
  28. package/dist/chunk-LPRWATHB.js +61 -0
  29. package/dist/{chunk-X7QKTXXC.js → chunk-NWXQIOIB.js} +3 -3
  30. package/dist/{chunk-VV62MIG4.js → chunk-Q7QQQA3I.js} +1 -1
  31. package/dist/chunk-VE5SIZEM.js +1 -0
  32. package/dist/chunk-VRALOYRD.js +1 -0
  33. package/dist/{chunk-5VEZLQFN.js → chunk-WHMUB5QB.js} +1 -1
  34. package/dist/chunk-XLQPNNIC.js +1 -0
  35. package/dist/{chunk-YQRN4CIV.js → chunk-YGL7FPVQ.js} +1 -1
  36. package/dist/compat/index.cjs +5 -5
  37. package/dist/compat/index.d.cts +16 -16
  38. package/dist/compat/index.d.ts +16 -16
  39. package/dist/compat/index.js +1 -1
  40. package/dist/compat/jotai/index.d.cts +2 -2
  41. package/dist/compat/jotai/index.d.ts +2 -2
  42. package/dist/compat/nanostores/index.d.cts +2 -2
  43. package/dist/compat/nanostores/index.d.ts +2 -2
  44. package/dist/compat/nestjs/index.cjs +5 -5
  45. package/dist/compat/nestjs/index.d.cts +8 -8
  46. package/dist/compat/nestjs/index.d.ts +8 -8
  47. package/dist/compat/nestjs/index.js +1 -1
  48. package/dist/compat/react/index.d.cts +2 -2
  49. package/dist/compat/react/index.d.ts +2 -2
  50. package/dist/compat/solid/index.d.cts +2 -2
  51. package/dist/compat/solid/index.d.ts +2 -2
  52. package/dist/compat/svelte/index.d.cts +2 -2
  53. package/dist/compat/svelte/index.d.ts +2 -2
  54. package/dist/compat/vue/index.d.cts +2 -2
  55. package/dist/compat/vue/index.d.ts +2 -2
  56. package/dist/compat/zustand/index.cjs +3 -3
  57. package/dist/compat/zustand/index.d.cts +4 -4
  58. package/dist/compat/zustand/index.d.ts +4 -4
  59. package/dist/compat/zustand/index.js +1 -1
  60. package/dist/core/index.d.cts +4 -4
  61. package/dist/core/index.d.ts +4 -4
  62. package/dist/{decay-C25AyNAj.d.cts → decay-2ZukgQ4o.d.cts} +2 -2
  63. package/dist/{decay-BnrlbxSv.d.ts → decay-CdEBmDIs.d.ts} +2 -2
  64. package/dist/extra/browser.d.cts +1 -1
  65. package/dist/extra/browser.d.ts +1 -1
  66. package/dist/extra/index.cjs +14 -14
  67. package/dist/extra/index.d.cts +10 -11
  68. package/dist/extra/index.d.ts +10 -11
  69. package/dist/extra/index.js +1 -1
  70. package/dist/extra/node.cjs +2 -2
  71. package/dist/extra/node.d.cts +1 -1
  72. package/dist/extra/node.d.ts +1 -1
  73. package/dist/extra/node.js +1 -1
  74. package/dist/extra/operators.cjs +1 -1
  75. package/dist/extra/operators.d.cts +1 -1
  76. package/dist/extra/operators.d.ts +1 -1
  77. package/dist/extra/operators.js +1 -1
  78. package/dist/extra/reactive.d.cts +3 -3
  79. package/dist/extra/reactive.d.ts +3 -3
  80. package/dist/extra/reactive.js +1 -1
  81. package/dist/extra/render/index.d.cts +3 -3
  82. package/dist/extra/render/index.d.ts +3 -3
  83. package/dist/extra/sources.cjs +3 -1
  84. package/dist/extra/sources.d.cts +1 -1
  85. package/dist/extra/sources.d.ts +1 -1
  86. package/dist/extra/sources.js +1 -1
  87. package/dist/extra/storage-browser.d.cts +1 -1
  88. package/dist/extra/storage-browser.d.ts +1 -1
  89. package/dist/{fallback-CMZl39L5.d.ts → fallback-CqYVLL6X.d.ts} +1 -1
  90. package/dist/{fallback-8JYU8tlT.d.cts → fallback-Ctlj2tMY.d.cts} +1 -1
  91. package/dist/graph/index.cjs +7 -7
  92. package/dist/graph/index.d.cts +5 -5
  93. package/dist/graph/index.d.ts +5 -5
  94. package/dist/graph/index.js +1 -1
  95. package/dist/{graph-BkIkog4h.d.ts → graph-7VguS7a4.d.ts} +3 -3
  96. package/dist/{graph-E6likq7w.d.cts → graph-C4SHb3Ly.d.cts} +3 -3
  97. package/dist/{index-DktLSZOc.d.cts → index-2B7u2pVn.d.cts} +4 -4
  98. package/dist/{index-DGD4_fj6.d.cts → index-3NmAfcH0.d.cts} +8 -5
  99. package/dist/{index-DfOK_oL5.d.ts → index-4Uz-e_fL.d.ts} +372 -17
  100. package/dist/{index-BAQrjuZF.d.ts → index-B-i4_g3k.d.ts} +2 -2
  101. package/dist/{index-DpiGqtrs.d.cts → index-B11anra4.d.cts} +441 -381
  102. package/dist/{index-WSlcjhQF.d.ts → index-B3OTH1dV.d.ts} +124 -13
  103. package/dist/{index-2n8Eai6M.d.ts → index-BG0BN3PB.d.ts} +1 -1
  104. package/dist/{index-z8WFPVI8.d.cts → index-BJX94aud.d.cts} +1 -1
  105. package/dist/{index-DhLyOHYZ.d.ts → index-BP8a88zx.d.ts} +11 -4
  106. package/dist/{index-Cnr1WrlX.d.cts → index-BTQtTb_H.d.cts} +14 -3
  107. package/dist/{index-BaA-xpSw.d.ts → index-BUYXac2c.d.ts} +3 -3
  108. package/dist/{index-DOBLxOti.d.cts → index-BVpm6noz.d.cts} +1 -1
  109. package/dist/{index-DhnsQfa3.d.ts → index-Bbkgpt5t.d.ts} +441 -381
  110. package/dist/{index-Cczxgd2D.d.ts → index-Bc41FuHp.d.cts} +3 -3
  111. package/dist/{index-BiHUBEKq.d.cts → index-BdGtBX-X.d.cts} +3 -3
  112. package/dist/index-BeT2r7sk.d.ts +760 -0
  113. package/dist/{index-da2V5vPy.d.ts → index-Bf7eqeSF.d.ts} +2 -2
  114. package/dist/{index-bXXLSvor.d.ts → index-Bn4zHYLj.d.ts} +4 -4
  115. package/dist/{index-DGTo1yka.d.cts → index-BoLv_OfD.d.cts} +2 -2
  116. package/dist/{index-B72TQQHd.d.cts → index-BsT7F2et.d.ts} +3 -3
  117. package/dist/{index-Bd91Nmf4.d.cts → index-BtAsBp8K.d.cts} +4 -4
  118. package/dist/{index-DgJc8Zgc.d.cts → index-C0-Jv1kP.d.cts} +81 -5
  119. package/dist/{index-C6ZUaos7.d.ts → index-C7O6r5fV.d.ts} +1 -1
  120. package/dist/{index-CL7oilfm.d.cts → index-C9kSENB4.d.cts} +1 -1
  121. package/dist/{index-yLt-aPMp.d.ts → index-CCq87F7t.d.ts} +1 -1
  122. package/dist/{index-DQQCOIt8.d.cts → index-CEMx8n40.d.cts} +10 -5
  123. package/dist/{index-BilOa6AE.d.cts → index-CJIuLu2f.d.cts} +124 -13
  124. package/dist/{index-B2RUoIUz.d.ts → index-CJK1JkYy.d.ts} +1 -1
  125. package/dist/{index-CG33HeBW.d.ts → index-CJQm0g38.d.ts} +8 -5
  126. package/dist/index-CPNSy-U0.d.cts +760 -0
  127. package/dist/{index-A3U3CSve.d.cts → index-CZjOhcBy.d.cts} +2 -2
  128. package/dist/{index-CAP3UGsq.d.ts → index-CZmcDtFn.d.ts} +1 -1
  129. package/dist/{index-DYTBbF8T.d.cts → index-ChOyVLKm.d.cts} +1 -1
  130. package/dist/{index-eaQuGJnv.d.ts → index-CpyNFqkB.d.ts} +3 -3
  131. package/dist/{index-BJSZxSFX.d.ts → index-CvrqGfNS.d.ts} +1 -1
  132. package/dist/{index-DuRsN9ae.d.cts → index-D-Xs74HZ.d.cts} +372 -17
  133. package/dist/{index-C5cQ7Gfx.d.ts → index-D6egPFAL.d.ts} +4 -4
  134. package/dist/{index-CD2dBMet.d.ts → index-D8l8hNXn.d.ts} +10 -5
  135. package/dist/{index-40ZT4MHj.d.ts → index-DBHK8O6H.d.ts} +14 -3
  136. package/dist/{index-DVDapw2k.d.cts → index-DBIqYS43.d.cts} +35 -21
  137. package/dist/{index-3k4Gg6-n.d.ts → index-DBevwHj_.d.ts} +3 -3
  138. package/dist/{index-Ctb7_2sG.d.ts → index-DIOoAZUX.d.ts} +1 -1
  139. package/dist/{index-BQ1fR4li.d.ts → index-DO9XxMzS.d.ts} +35 -21
  140. package/dist/{index-CQtWm7jS.d.ts → index-DQo8xBgd.d.ts} +9 -9
  141. package/dist/{index-DH4fm2Ck.d.ts → index-Dgs8zcj7.d.ts} +2 -2
  142. package/dist/{index-CtFNGe-m.d.cts → index-Dhc7a7Xo.d.cts} +2 -2
  143. package/dist/{index-MxYuWOrf.d.cts → index-DmAgG5CI.d.cts} +3 -3
  144. package/dist/{index-CoM4rzyB.d.ts → index-Dmqp7KjD.d.ts} +1 -1
  145. package/dist/{index-B6iTqKtJ.d.ts → index-Dn-wI9g4.d.ts} +2 -2
  146. package/dist/{index-C-dkXOpB.d.cts → index-Du7u1lSf.d.cts} +11 -4
  147. package/dist/{index-DVAlsmEU.d.cts → index-HoU88d5U.d.cts} +3 -3
  148. package/dist/{index-CRm0YIzC.d.cts → index-LIpQQE9f.d.cts} +9 -9
  149. package/dist/{index-CgnCFhr2.d.cts → index-f5IivDUX.d.cts} +1 -1
  150. package/dist/{index-PgwvGWa1.d.cts → index-hHcaFlJX.d.cts} +1 -1
  151. package/dist/{index-I1cCY3ZI.d.ts → index-pT8sCpOJ.d.ts} +81 -5
  152. package/dist/{index-D4uimgee.d.cts → index-sl4NyzQx.d.cts} +1 -1
  153. package/dist/{index-tV3AA9hI.d.cts → index-tJoTcnHh.d.cts} +2 -2
  154. package/dist/{index-D3ayz3hy.d.cts → index-z96luz5O.d.cts} +1 -1
  155. package/dist/index.cjs +48 -48
  156. package/dist/index.d.cts +45 -50
  157. package/dist/index.d.ts +45 -50
  158. package/dist/index.js +1 -1
  159. package/dist/{meta-D8OyedKp.d.ts → meta-BgVAsg9j.d.ts} +1 -1
  160. package/dist/{meta-Ct9nqQS5.d.cts → meta-vE8bxW1E.d.cts} +1 -1
  161. package/dist/{node-BYInONRr.d.cts → node-ClS5yC-B.d.cts} +1 -1
  162. package/dist/{node-BYInONRr.d.ts → node-ClS5yC-B.d.ts} +1 -1
  163. package/dist/{observable-DO8DDEzv.d.ts → observable-BsBzUrcI.d.ts} +1 -1
  164. package/dist/{observable-DMIlYJV1.d.cts → observable-DLGPPtb8.d.cts} +1 -1
  165. package/dist/patterns/ai/browser.d.cts +4 -4
  166. package/dist/patterns/ai/browser.d.ts +4 -4
  167. package/dist/patterns/ai/browser.js +1 -1
  168. package/dist/patterns/ai/index.cjs +17 -17
  169. package/dist/patterns/ai/index.d.cts +17 -17
  170. package/dist/patterns/ai/index.d.ts +17 -17
  171. package/dist/patterns/ai/index.js +1 -1
  172. package/dist/patterns/ai/node.d.cts +4 -4
  173. package/dist/patterns/ai/node.d.ts +4 -4
  174. package/dist/patterns/ai/node.js +1 -1
  175. package/dist/patterns/cqrs/index.cjs +3 -3
  176. package/dist/patterns/cqrs/index.d.cts +6 -6
  177. package/dist/patterns/cqrs/index.d.ts +6 -6
  178. package/dist/patterns/cqrs/index.js +1 -1
  179. package/dist/patterns/demo-shell/index.cjs +5 -5
  180. package/dist/patterns/demo-shell/index.d.cts +5 -5
  181. package/dist/patterns/demo-shell/index.d.ts +5 -5
  182. package/dist/patterns/demo-shell/index.js +1 -1
  183. package/dist/patterns/domain-templates/index.cjs +3 -3
  184. package/dist/patterns/domain-templates/index.d.cts +4 -4
  185. package/dist/patterns/domain-templates/index.d.ts +4 -4
  186. package/dist/patterns/domain-templates/index.js +1 -1
  187. package/dist/patterns/graphspec/index.cjs +12 -12
  188. package/dist/patterns/graphspec/index.d.cts +5 -5
  189. package/dist/patterns/graphspec/index.d.ts +5 -5
  190. package/dist/patterns/graphspec/index.js +1 -1
  191. package/dist/patterns/harness/index.cjs +10 -8
  192. package/dist/patterns/harness/index.d.cts +11 -12
  193. package/dist/patterns/harness/index.d.ts +11 -12
  194. package/dist/patterns/harness/index.js +1 -1
  195. package/dist/patterns/inspect/index.cjs +3 -0
  196. package/dist/patterns/inspect/index.d.cts +9 -0
  197. package/dist/patterns/inspect/index.d.ts +9 -0
  198. package/dist/patterns/inspect/index.js +1 -0
  199. package/dist/patterns/job-queue/index.cjs +3 -3
  200. package/dist/patterns/job-queue/index.d.cts +6 -6
  201. package/dist/patterns/job-queue/index.d.ts +6 -6
  202. package/dist/patterns/job-queue/index.js +1 -1
  203. package/dist/patterns/memory/index.cjs +3 -3
  204. package/dist/patterns/memory/index.d.cts +6 -6
  205. package/dist/patterns/memory/index.d.ts +6 -6
  206. package/dist/patterns/memory/index.js +1 -1
  207. package/dist/patterns/messaging/index.cjs +3 -3
  208. package/dist/patterns/messaging/index.d.cts +5 -5
  209. package/dist/patterns/messaging/index.d.ts +5 -5
  210. package/dist/patterns/messaging/index.js +1 -1
  211. package/dist/patterns/orchestration/index.cjs +3 -3
  212. package/dist/patterns/orchestration/index.d.cts +7 -7
  213. package/dist/patterns/orchestration/index.d.ts +7 -7
  214. package/dist/patterns/orchestration/index.js +1 -1
  215. package/dist/patterns/process/index.cjs +1 -1
  216. package/dist/patterns/process/index.d.cts +7 -7
  217. package/dist/patterns/process/index.d.ts +7 -7
  218. package/dist/patterns/process/index.js +1 -1
  219. package/dist/patterns/reactive-layout/index.cjs +4 -4
  220. package/dist/patterns/reactive-layout/index.d.cts +5 -5
  221. package/dist/patterns/reactive-layout/index.d.ts +5 -5
  222. package/dist/patterns/reactive-layout/index.js +1 -1
  223. package/dist/patterns/reduction/index.cjs +3 -3
  224. package/dist/patterns/reduction/index.d.cts +4 -4
  225. package/dist/patterns/reduction/index.d.ts +4 -4
  226. package/dist/patterns/reduction/index.js +1 -1
  227. package/dist/patterns/surface/index.cjs +8 -8
  228. package/dist/patterns/surface/index.d.cts +6 -6
  229. package/dist/patterns/surface/index.d.ts +6 -6
  230. package/dist/patterns/surface/index.js +1 -1
  231. package/dist/{pipeline-graph-MWrQZXCq.d.cts → pipeline-graph-WBlobVhU.d.cts} +5 -5
  232. package/dist/{pipeline-graph-CB4La-UW.d.ts → pipeline-graph-v8fMvqNk.d.ts} +5 -5
  233. package/dist/{reactive-layout-BtZfUKuL.d.cts → reactive-layout-Dsvob4zD.d.cts} +2 -2
  234. package/dist/{reactive-layout-KJj4E2dT.d.ts → reactive-layout-v7KPvxoc.d.ts} +2 -2
  235. package/dist/{reactive-log-_zeEnB9H.d.cts → reactive-log-B00laMSQ.d.cts} +1 -1
  236. package/dist/{reactive-log-BlAsPLl2.d.ts → reactive-log-BezYsbA_.d.ts} +1 -1
  237. package/dist/{reactive-map-6P_k3AQM.d.cts → reactive-map-48mnZ-nu.d.cts} +1 -1
  238. package/dist/{reactive-map-CjXByDV-.d.ts → reactive-map-BVVPdvmi.d.ts} +1 -1
  239. package/dist/resilience-445VFFXQ.js +1 -0
  240. package/dist/{sugar-BhfjgetH.d.ts → sugar-CH-2ZY90.d.ts} +1 -1
  241. package/dist/{sugar-DzePN5-g.d.cts → sugar-DStZfUEK.d.cts} +1 -1
  242. package/dist/{topology-tree-mF7Emqzm.d.ts → topology-tree-BNGvuG82.d.ts} +1 -1
  243. package/dist/{topology-tree-3LBKFsUo.d.cts → topology-tree-BSdfSwMi.d.cts} +1 -1
  244. package/dist/{types-1Dhoi7HM.d.cts → types-B1jDWVsM.d.cts} +1 -1
  245. package/dist/{types-39jk0kaV.d.ts → types-DkzUUs0H.d.ts} +1 -1
  246. package/package.json +11 -51
  247. package/dist/budget-gate-CmmVtasH.d.ts +0 -115
  248. package/dist/budget-gate-DiP_nK0n.d.cts +0 -115
  249. package/dist/chunk-2W553JJC.js +0 -1
  250. package/dist/chunk-4MKL6Q3K.js +0 -1
  251. package/dist/chunk-5B3JDG5F.js +0 -1
  252. package/dist/chunk-5QSXEMXG.js +0 -1
  253. package/dist/chunk-5TEFC2ZX.js +0 -1
  254. package/dist/chunk-5TOPVRN6.js +0 -1
  255. package/dist/chunk-EC2WNSZ7.js +0 -1
  256. package/dist/chunk-ELAASRBT.js +0 -3
  257. package/dist/chunk-H5SCWHWP.js +0 -1
  258. package/dist/chunk-OLIKJUKI.js +0 -1
  259. package/dist/chunk-POXANAJ6.js +0 -3
  260. package/dist/chunk-RSMEXK53.js +0 -43
  261. package/dist/chunk-SGS4OJGS.js +0 -1
  262. package/dist/chunk-URJ2VFNC.js +0 -1
  263. package/dist/chunk-VXPLLA4P.js +0 -1
  264. package/dist/chunk-WZYB3JQS.js +0 -1
  265. package/dist/chunk-Z6X7B6A4.js +0 -61
  266. package/dist/index-8s-Qm-gz.d.ts +0 -218
  267. package/dist/index-BgjS2b8N.d.ts +0 -366
  268. package/dist/index-BmSQLAZo.d.cts +0 -244
  269. package/dist/index-CGhMJNHb.d.cts +0 -128
  270. package/dist/index-CUIkE1l9.d.cts +0 -230
  271. package/dist/index-Ck35nA-T.d.ts +0 -244
  272. package/dist/index-CuPUehFa.d.cts +0 -218
  273. package/dist/index-D1Gc7wV5.d.ts +0 -230
  274. package/dist/index-N2MAxt7_.d.ts +0 -128
  275. package/dist/index-t6L2qpHh.d.cts +0 -366
  276. package/dist/patterns/audit/index.cjs +0 -3
  277. package/dist/patterns/audit/index.d.cts +0 -8
  278. package/dist/patterns/audit/index.d.ts +0 -8
  279. package/dist/patterns/audit/index.js +0 -1
  280. package/dist/patterns/guarded-execution/index.cjs +0 -3
  281. package/dist/patterns/guarded-execution/index.d.cts +0 -9
  282. package/dist/patterns/guarded-execution/index.d.ts +0 -9
  283. package/dist/patterns/guarded-execution/index.js +0 -1
  284. package/dist/patterns/lens/index.cjs +0 -3
  285. package/dist/patterns/lens/index.d.cts +0 -7
  286. package/dist/patterns/lens/index.d.ts +0 -7
  287. package/dist/patterns/lens/index.js +0 -1
  288. package/dist/patterns/refine-loop/index.cjs +0 -5
  289. package/dist/patterns/refine-loop/index.d.cts +0 -9
  290. package/dist/patterns/refine-loop/index.d.ts +0 -9
  291. package/dist/patterns/refine-loop/index.js +0 -1
  292. package/dist/patterns/resilient-pipeline/index.cjs +0 -3
  293. package/dist/patterns/resilient-pipeline/index.d.cts +0 -8
  294. package/dist/patterns/resilient-pipeline/index.d.ts +0 -8
  295. package/dist/patterns/resilient-pipeline/index.js +0 -1
  296. package/dist/resilience-JISHQD2F.js +0 -1
@@ -1,218 +0,0 @@
1
- import { N as Node, A as Actor, P as PolicyRuleData } from './node-BYInONRr.js';
2
- import { G as Graph, b as GraphDescribeOutput, a as GraphOptions, d as GraphDescribeOptions, D as DescribeFilter } from './graph-BkIkog4h.js';
3
- import { P as PolicyGateGraph, a as PolicyViolation } from './index-Ck35nA-T.js';
4
- import { T as TopicGraph } from './index-40ZT4MHj.js';
5
-
6
- /**
7
- * Composable safety layer (roadmap §9.0b — Tier 5.1 Wave-B rebuild).
8
- *
9
- * {@link guardedExecution} wraps any {@link Graph} with:
10
- *
11
- * - {@link policyGate} — reactive ABAC (Tier 2.3 rename of `policyEnforcer`),
12
- * policies stored as a `Node` so LLMs / humans can update them at runtime.
13
- * Full transitive dynamic coverage via `watchTopologyTree`.
14
- * - Reactive {@link GuardedExecutionGraph.scopedDescribeNode} — a thin
15
- * delegate over `target.describe({ reactive: true, actor })` that re-derives
16
- * on every settle (topology change, error transition, actor swap).
17
- * - The enforcer's `violations` topic is republished as `violations` on
18
- * the wrapper, composable with {@link graphLens}'s `health`.
19
- * - The wrapper-level `lints` topic surfaces non-policy diagnostic warnings
20
- * (`empty-policies` / `audit-no-effect` / `no-actor`) so misconfigurations
21
- * are caught reactively rather than via thrown errors at scattered call sites.
22
- * - The `scope` derived publishes the current configuration tuple
23
- * (`{actor, mode, policiesCount}`) for dashboards.
24
- *
25
- * V1 scope: policies + actor + reactive scoped describe + lints + scope.
26
- * Budget-as-option is NOT in V1 — it requires a cost-tracking design that
27
- * hasn't landed yet. Callers who need a budget limit today append a
28
- * budget-aware {@link PolicyRuleData} to the policies list (check current
29
- * cost and `deny` when exhausted).
30
- *
31
- * @module
32
- */
33
-
34
- /** Diagnostic warning published on {@link GuardedExecutionGraph.lints}. */
35
- interface GuardedExecutionLint {
36
- /**
37
- * - `"empty-policies"` — `policies` Node emitted an empty array in
38
- * `mode: "enforce"`. Static empty arrays throw at construction; this
39
- * covers the reactive case.
40
- * - `"audit-no-effect"` — `mode: "audit"` plus the target has no per-node
41
- * guards, so `scopedDescribeNode` filters by per-node guards only and
42
- * policies will never gate visibility (they still populate `violations`
43
- * on writes).
44
- * - `"no-actor"` — neither a wrapper-configured nor per-call actor was
45
- * supplied. `scopedDescribeNode` falls back to "describe everything"
46
- * for the corresponding subscription.
47
- */
48
- kind: "empty-policies" | "audit-no-effect" | "no-actor";
49
- message: string;
50
- timestamp_ns: number;
51
- }
52
- /** Configuration tuple published on {@link GuardedExecutionGraph.scope}. */
53
- interface GuardedScope {
54
- /** The wrapper-configured default actor, or `null` when none configured. */
55
- actor: Actor | null;
56
- mode: "audit" | "enforce";
57
- /** Current policy count (reactive — re-emits on `policies` Node updates). */
58
- policiesCount: number;
59
- }
60
- /** Options for {@link guardedExecution}. */
61
- interface GuardedExecutionOptions {
62
- /**
63
- * Policies enforced against every guarded write. Static list or a live
64
- * `Node<readonly PolicyRuleData[]>` (LLM-updatable).
65
- *
66
- * **Empty-policies handling:**
67
- * - Static empty array + `mode: "enforce"` throws `RangeError` at
68
- * construction (deny-by-default is almost certainly a misconfiguration).
69
- * - Node-supplied empty array + `mode: "enforce"` emits a one-time
70
- * `"empty-policies"` lint on first such emission (the wrapper can't
71
- * throw mid-run — surface the warning reactively).
72
- * - `mode: "audit"` tolerates empty policies (no guards stacked; policies
73
- * only feed the `violations` channel on writes).
74
- */
75
- policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>;
76
- /**
77
- * Default actor used when the caller invokes
78
- * {@link GuardedExecutionGraph.scopedDescribeNode} without an override.
79
- * Accepts a static {@link Actor} or a `Node<Actor>` — when a Node is
80
- * supplied, the reactive describe re-derives on every actor emission so
81
- * harnesses binding a per-turn actor get a single live describe Node
82
- * instead of re-creating one per turn.
83
- *
84
- * Omit to scope per-call only. A `"no-actor"` lint fires once per instance
85
- * if neither a configured nor per-call actor is ever supplied (the
86
- * resulting describe is unscoped — full visibility).
87
- */
88
- actor?: Actor | Node<Actor>;
89
- /**
90
- * `"enforce"` (default) — push guards onto target nodes so disallowed
91
- * writes throw {@link GuardDenied}.
92
- * `"audit"` — record would-be denials to the `violations` topic without
93
- * blocking writes.
94
- */
95
- mode?: "audit" | "enforce";
96
- /** Ring-buffer cap for the `violations` topic. Default 1000 (inherited from policyGate). */
97
- violationsLimit?: number;
98
- /** Ring-buffer cap for the `lints` topic. Default 64 — each lint kind fires at most once per instance. */
99
- lintsLimit?: number;
100
- /** Wrapper graph name. Default `${target.name}_guarded`. */
101
- name?: string;
102
- /** Wrapper graph options. */
103
- graph?: GraphOptions;
104
- }
105
- /**
106
- * Wrapper over a target {@link Graph} providing reactive ABAC + reactive
107
- * scoped describe + diagnostic lints. Mounts a {@link PolicyGateGraph} under
108
- * `enforcer`, a {@link TopicGraph} of {@link GuardedExecutionLint} under
109
- * `lints`, and a `scope` derived publishing `{actor, mode, policiesCount}`.
110
- *
111
- * @category patterns
112
- */
113
- declare class GuardedExecutionGraph extends Graph {
114
- readonly enforcer: PolicyGateGraph;
115
- readonly violations: TopicGraph<PolicyViolation>;
116
- readonly lints: TopicGraph<GuardedExecutionLint>;
117
- readonly scope: Node<GuardedScope>;
118
- /**
119
- * Canonical reactive describe scoped to the wrapper's configured `actor`.
120
- * Subscribes ONCE at construction; lifecycle owned by the wrapper (disposed
121
- * on `wrapper.destroy()`). Use this property for the common case
122
- * (long-lived consumer wanting "describe scoped to my actor"); use
123
- * {@link scopedDescribeNode} only when a per-call actor override or
124
- * different `detail`/`fields` is required.
125
- *
126
- * Re-derives on every settle of the target graph: structural changes,
127
- * status transitions (errors flip nodes into `"errored"`), and actor
128
- * emissions (when a `Node<Actor>` is bound, including the SENTINEL bridge
129
- * applied internally — see qa G1B).
130
- */
131
- readonly scopedDescribe: Node<GraphDescribeOutput>;
132
- private readonly _target;
133
- private readonly _actorNode;
134
- private readonly _mode;
135
- private readonly _firedLintKinds;
136
- constructor(target: Graph, opts: GuardedExecutionOptions);
137
- private _fireLint;
138
- /**
139
- * **Per-call escape hatch.** Prefer {@link scopedDescribe} (the mounted
140
- * property) for the common case of "describe scoped to my actor." Use
141
- * this method ONLY when you need a per-call actor override or different
142
- * `detail`/`fields`/`filter`.
143
- *
144
- * Returns a live `Node<GraphDescribeOutput>` scoped to the supplied (or
145
- * configured) actor, plus an explicit `dispose` for caller-controlled
146
- * lifecycle. Re-derives on every settle of the target graph: structural
147
- * changes, status transitions, and actor emissions (when a `Node<Actor>`
148
- * is bound).
149
- *
150
- * **Lifecycle (qa G1A — EC1 fix).** Each call instantiates a fresh
151
- * `target.describe({reactive: true})` handle (with its own version state,
152
- * observe handle, transitive topology subscriptions, derived + keepalive).
153
- * The caller MUST invoke the returned `dispose()` when finished to release
154
- * these resources. Disposers ARE also tracked on the wrapper graph so
155
- * `wrapper.destroy()` cleans up any handles the caller forgot — but a
156
- * long-lived wrapper with heavy per-call usage will leak until destroy
157
- * unless `dispose()` is called explicitly.
158
- *
159
- * @param actorOverride - Optional per-call override. Static {@link Actor}
160
- * or `Node<Actor>`. Omit to use the wrapper-configured default.
161
- * @param opts - Standard {@link GraphDescribeOptions} fields (`detail`,
162
- * `fields`, `filter`). `actor` / `reactive` / `reactiveName` are
163
- * controlled by the wrapper.
164
- * @returns `{node, dispose}` — `node` is the live describe Node; `dispose`
165
- * tears down the underlying reactive describe subscription idempotently.
166
- */
167
- scopedDescribeNode(actorOverride?: Actor | Node<Actor>, opts?: Omit<GraphDescribeOptions, "actor" | "reactive" | "reactiveName">): {
168
- node: Node<GraphDescribeOutput>;
169
- dispose: () => void;
170
- };
171
- /** The wrapped graph (escape hatch for tooling). */
172
- get target(): Graph;
173
- }
174
- /**
175
- * Wrap a {@link Graph} with {@link policyGate} plus a reactive scoped describe
176
- * lens. Returns a {@link GuardedExecutionGraph} that can be mounted, diffed,
177
- * or composed with {@link graphLens}.
178
- *
179
- * @param target - The graph to guard.
180
- * @param opts - See {@link GuardedExecutionOptions}.
181
- *
182
- * @example
183
- * ```ts
184
- * const guarded = guardedExecution(app, {
185
- * actor: state<Actor>({ type: "human", id: "alice" }), // reactive — re-derive on swap
186
- * policies: [
187
- * { effect: "allow", action: "read", actorType: "human" },
188
- * { effect: "deny", action: "write", pathPattern: "system::*" },
189
- * ],
190
- * mode: "enforce",
191
- * });
192
- *
193
- * // Canonical: subscribe to the mounted reactive describe (no per-call leak).
194
- * guarded.scopedDescribe.subscribe((msgs) => { /* live describe per actor / topology change *\/ });
195
- * // Per-call escape hatch (different actor / detail) — caller manages dispose.
196
- * const detailed = guarded.scopedDescribeNode(undefined, { detail: "standard" });
197
- * try { detailed.node.subscribe(/* … *\/); } finally { detailed.dispose(); }
198
- * guarded.violations.events.subscribe(msgs => console.log("violations:", msgs));
199
- * guarded.lints.events.subscribe(msgs => console.warn("lints:", msgs));
200
- * guarded.scope.subscribe(msgs => console.log("scope:", msgs));
201
- * ```
202
- *
203
- * @category patterns
204
- */
205
- declare function guardedExecution(target: Graph, opts: GuardedExecutionOptions): GuardedExecutionGraph;
206
-
207
- declare const index_DescribeFilter: typeof DescribeFilter;
208
- type index_GuardedExecutionGraph = GuardedExecutionGraph;
209
- declare const index_GuardedExecutionGraph: typeof GuardedExecutionGraph;
210
- type index_GuardedExecutionLint = GuardedExecutionLint;
211
- type index_GuardedExecutionOptions = GuardedExecutionOptions;
212
- type index_GuardedScope = GuardedScope;
213
- declare const index_guardedExecution: typeof guardedExecution;
214
- declare namespace index {
215
- export { index_DescribeFilter as DescribeFilter, index_GuardedExecutionGraph as GuardedExecutionGraph, type index_GuardedExecutionLint as GuardedExecutionLint, type index_GuardedExecutionOptions as GuardedExecutionOptions, type index_GuardedScope as GuardedScope, index_guardedExecution as guardedExecution };
216
- }
217
-
218
- export { GuardedExecutionGraph as G, type GuardedExecutionLint as a, type GuardedExecutionOptions as b, type GuardedScope as c, guardedExecution as g, index as i };
@@ -1,366 +0,0 @@
1
- import { N as Node } from './node-BYInONRr.js';
2
- import { NodeInput } from './extra/sources.js';
3
- import { a as GraphOptions, G as Graph } from './graph-BkIkog4h.js';
4
- import { T as TopicGraph } from './index-40ZT4MHj.js';
5
-
6
- /**
7
- * refineLoop — universal prompt/artifact optimization loop as a reactive Graph.
8
- *
9
- * Roadmap §9.8 (Wave 2.5). The loop is a 4-topic reactive pipeline:
10
- *
11
- * iterationTrigger ──▶ GENERATE ──▶ EVALUATE ──▶ ANALYZE ──▶ DECIDE
12
- * │ │
13
- * └─────── feedback + trigger ◀─────┘
14
- *
15
- * Each stage is a `TopicGraph` so dispatches stay O(1) per subscriber (cursor-
16
- * based) and every iteration is observable, replayable, and checkpointable.
17
- *
18
- * Composition invariants (from COMPOSITION-GUIDE):
19
- * - §7 feedback cycle: only `iterationTrigger` drives re-generation. Strategy
20
- * + feedback + dataset are read via closure updaters (§28 factory-time seed)
21
- * so mid-run swaps apply to the NEXT iteration, never retrigger the current.
22
- * - §28 factory-time seed: strategy, lastFeedback, prevCandidates, dataset
23
- * closures captured at wiring time + updated via subscribe handlers so the
24
- * first activation doesn't drop the initial pair.
25
- * - §32 nested-drain state-mirror: the decide-effect writes `lastFeedback`
26
- * BEFORE bumping `iterationTrigger` inside its `batch()`, guaranteeing the
27
- * mirror is current when the next-iteration wave reaches the generate fn.
28
- * - §19 terminal-emission: history / best emit once per iteration (settled),
29
- * not on every intermediate wave.
30
- * - §27 attachSnapshotStorage: the whole graph is checkpointable — pause overnight,
31
- * resume tomorrow from the exact iteration count, candidate set, strategy.
32
- *
33
- * Scope clamp (v1): core factory + `RefineStrategy<T>` + `blindVariation` and
34
- * `errorCritique` built-ins + budget gating + checkpoint/resume.
35
- * `mutateAndRefine` / registry / `autoSelectStrategy` / `optimizeCatalog` /
36
- * `refineExecutor` are deferred.
37
- *
38
- * @module
39
- */
40
-
41
- /** A single task row — the unit the evaluator scores one candidate against. */
42
- interface DatasetItem {
43
- readonly id: string;
44
- readonly [k: string]: unknown;
45
- }
46
- /**
47
- * One candidate's score on one task. Higher is better by convention.
48
- *
49
- * Set `candidateIndex` when the evaluator fans out scores across multiple
50
- * candidates (e.g. `candidates × tasks`). `pickBest` aggregates mean scores
51
- * per `candidateIndex` when present; when absent, falls back to positional
52
- * alignment (`scores[i]` ↔ `candidates[i]`).
53
- */
54
- interface EvalResult {
55
- readonly taskId: string;
56
- readonly score: number;
57
- readonly error?: string;
58
- readonly detail?: unknown;
59
- /** 0-based index into the `candidates` batch this score belongs to. */
60
- readonly candidateIndex?: number;
61
- }
62
- /** Aggregated feedback the strategy produces from a scores batch. */
63
- interface Feedback {
64
- readonly summary: string;
65
- readonly critique?: unknown;
66
- readonly weakTasks?: readonly string[];
67
- readonly score: number;
68
- }
69
- /**
70
- * Strategy interface — plain object, no base class. Strategies implement three
71
- * pure hooks; the loop infrastructure wraps them in reactive nodes so every
72
- * decision is visible in `describe()`.
73
- *
74
- * `generate` may be sync or async. Async generates yield a microtask per
75
- * iteration — that's what gives `pause()` / `setStrategy()` a window to
76
- * interleave. **A fully synchronous `generate` will drain the entire loop
77
- * during factory activation** (all iterations run before `refineLoop()`
78
- * returns), which is usually not what you want for observable, steerable
79
- * loops. Real strategies that call LLMs / evals are async and Just Work;
80
- * custom sync strategies for tests are fine but should be marked `async`
81
- * to match real cadence.
82
- */
83
- interface RefineStrategy<T> {
84
- readonly name: string;
85
- /** Produce initial candidates from the seed. Called at iteration 0. */
86
- seed(seed: T): readonly T[];
87
- /** Reduce scores to feedback. Pure function. */
88
- analyze(scores: readonly EvalResult[], candidates: readonly T[]): Feedback;
89
- /**
90
- * Generate next-iteration candidates from feedback + prior candidates.
91
- * Async allowed — the loop awaits via `fromAny`.
92
- */
93
- generate(feedback: Feedback, candidates: readonly T[]): Promise<readonly T[]> | readonly T[];
94
- }
95
- /**
96
- * Evaluator shape — Shape 4 (2026-04-22): both `candidates` and `dataset` are
97
- * reactive nodes; the evaluator's returned node IS the EVALUATE topic's source
98
- * (no glue). Implementers can batch-eval (e.g. `funnel` with concurrency) or
99
- * map per-candidate — user's code.
100
- *
101
- * **`EvalResult.candidateIndex` semantics.** Optional per-result field.
102
- * When present, multi-candidate aggregators ({@link errorCritique}'s
103
- * `pickBest`) score per index, picking the candidate with the highest
104
- * mean score. When absent across all results, those aggregators fall back
105
- * to positional matching against `candidates[0]` — meaning a strategy that
106
- * generates >1 candidate but emits unindexed scores effectively only ever
107
- * critiques the first candidate. Set `candidateIndex` whenever the
108
- * evaluator's score corresponds to a specific candidate in the batch.
109
- */
110
- type Evaluator<T> = (candidates: Node<readonly T[]>, dataset: Node<readonly DatasetItem[]>) => Node<readonly EvalResult[]>;
111
- /**
112
- * Early-stop controls. Each field fans into its own derived node; the four
113
- * combine via `||` into `converged: Node<boolean>`. Callers see exactly
114
- * which rule tripped via `status` / the DECIDE topic's `reason`.
115
- */
116
- interface ConvergenceOptions {
117
- /** Stop when aggregate score has not improved for N iterations. */
118
- patience?: number;
119
- /** Stop when aggregate score reaches or exceeds this. */
120
- minScore?: number;
121
- /** Stop when absolute delta between consecutive scores falls below this. */
122
- minDelta?: number;
123
- /** Stop after N total evaluations (iteration count × per-iter candidates). */
124
- maxEvaluations?: number;
125
- /** Stop after N iterations. Always set a finite bound in production. */
126
- maxIterations?: number;
127
- }
128
- /** Emitted to the GENERATE topic each time the strategy produces a batch. */
129
- interface GenerateEvent<T> {
130
- readonly iteration: number;
131
- readonly candidates: readonly T[];
132
- readonly timestamp_ns: number;
133
- }
134
- /** Emitted to the EVALUATE topic when scores settle for an iteration. */
135
- interface EvaluateEvent<T> {
136
- readonly iteration: number;
137
- readonly candidates: readonly T[];
138
- readonly scores: readonly EvalResult[];
139
- readonly timestamp_ns: number;
140
- }
141
- /** Emitted to the ANALYZE topic — strategy's reduction over scores. */
142
- interface AnalyzeEvent<T> {
143
- readonly iteration: number;
144
- readonly candidates: readonly T[];
145
- readonly feedback: Feedback;
146
- readonly timestamp_ns: number;
147
- }
148
- /** Emitted to the DECIDE topic — branch taken this iteration. */
149
- interface DecideEvent {
150
- readonly iteration: number;
151
- readonly decision: "continue" | "converged" | "budget" | "paused";
152
- readonly reason?: string;
153
- readonly timestamp_ns: number;
154
- }
155
- type RefineStatus = "running" | "converged" | "budget" | "paused" | "errored";
156
- interface Iteration<T> {
157
- readonly n: number;
158
- readonly candidates: readonly T[];
159
- readonly scores: readonly EvalResult[];
160
- readonly feedback: Feedback;
161
- /** `null` iff the candidate batch for this iteration was empty. */
162
- readonly best: T | null;
163
- readonly bestScore: number;
164
- readonly timestamp_ns: number;
165
- }
166
- interface RefineLoopOptions extends ConvergenceOptions {
167
- /** Reactive dataset OR a plain array (auto-wrapped into `state`). */
168
- dataset: NodeInput<readonly DatasetItem[]> | readonly DatasetItem[];
169
- /** Total teacher calls cap across iterations. Default: unlimited. */
170
- budget?: number;
171
- /** Graph name. Default: `"refine-loop"`. */
172
- name?: string;
173
- /** Extra graph options forwarded to the underlying `Graph`. */
174
- graph?: GraphOptions;
175
- }
176
- /**
177
- * Return type — extends Graph so all observability tools (`describe`,
178
- * `explain`, `observe`, `attachSnapshotStorage`, `snapshot`) Just Work.
179
- */
180
- interface RefineLoopGraph<T> extends Graph {
181
- readonly best: Node<T | null>;
182
- readonly score: Node<number>;
183
- readonly status: Node<RefineStatus>;
184
- readonly history: Node<readonly Iteration<T>[]>;
185
- readonly strategy: Node<RefineStrategy<T>>;
186
- readonly iteration: Node<number>;
187
- /** Stage topics — subscribe for per-stage streaming / cursor consumers. */
188
- readonly generate: TopicGraph<GenerateEvent<T>>;
189
- readonly evaluate: TopicGraph<EvaluateEvent<T>>;
190
- readonly analyze: TopicGraph<AnalyzeEvent<T>>;
191
- readonly decide: TopicGraph<DecideEvent>;
192
- /** Swap the active strategy mid-run (human-in-the-loop handoff). */
193
- setStrategy(next: RefineStrategy<T>): void;
194
- /** Pause after the current iteration completes. */
195
- pause(): void;
196
- /** Resume a paused loop. */
197
- resume(): void;
198
- }
199
- declare function refineLoop<T>(seed: T, evaluator: Evaluator<T>, initialStrategy: RefineStrategy<T>, opts: RefineLoopOptions): RefineLoopGraph<T>;
200
- /**
201
- * Context passed to a `blindVariation` teacher per call. `reportCost` is a
202
- * per-call hook — see `BlindVariationOptions.tokens`.
203
- */
204
- interface BlindVariationContext<T> {
205
- readonly prior: T;
206
- /**
207
- * Report tokens consumed by this teacher call. Aggregated per iteration
208
- * and flushed to `opts.tokens` in the strategy's `finally` block so
209
- * partial spend is preserved when the teacher throws mid-batch.
210
- */
211
- readonly reportCost: (tokens: number) => void;
212
- }
213
- interface BlindVariationOptions<T> {
214
- /** Name — default: `"blindVariation"`. */
215
- name?: string;
216
- /** Number of candidates generated per iteration. Default: 4. */
217
- width?: number;
218
- /**
219
- * Run teacher calls in parallel via `Promise.all`. Default `true` — the
220
- * common case (independent LLM calls). Set `false` to run sequentially
221
- * via `for/await` when teachers share stateful resources (rate limiters,
222
- * rolling context, serial API ordering) that don't tolerate concurrency.
223
- */
224
- parallel?: boolean;
225
- /**
226
- * Optional cost counter node. Running total tokens reported via
227
- * `ctx.reportCost` during each iteration is added to this node in the
228
- * strategy's `finally` block — fires on success AND on teacher throw so
229
- * partial spend is never lost. User owns the node; wire to `budgetGate`,
230
- * `attachSnapshotStorage`, telemetry, etc.
231
- */
232
- tokens?: Node<number>;
233
- /**
234
- * Teacher — given `{prior, reportCost}`, produce one variant. Async
235
- * allowed. Called `width` times per iteration. Call `ctx.reportCost(n)`
236
- * to track tokens consumed per call (optional, no-op if `opts.tokens`
237
- * is not set).
238
- */
239
- teacher: (ctx: BlindVariationContext<T>) => Promise<T> | T;
240
- }
241
- /**
242
- * Simplest built-in strategy: generate N variants per iteration via the
243
- * supplied `teacher`; no feedback-informed steering (equivalent to Random
244
- * Search). Validates the loop infrastructure end-to-end and is the baseline
245
- * every other strategy should outperform.
246
- *
247
- * `analyze` records the mean score and flags the worst task — strategies that
248
- * care about per-task critique layer on top.
249
- */
250
- declare function blindVariation<T>(opts: BlindVariationOptions<T>): RefineStrategy<T>;
251
- /**
252
- * Context passed to an `errorCritique` teacher. `critique` is the pre-formatted
253
- * summary a prompt template can drop in verbatim; `failures` carries the
254
- * structured evidence (per-task error / score / detail) for richer prompts.
255
- */
256
- interface ErrorCritiqueContext<T> {
257
- readonly prior: T;
258
- readonly critique: string;
259
- readonly failures: readonly EvalResult[];
260
- /**
261
- * Report tokens consumed by this teacher call. Aggregated per iteration
262
- * and flushed to `opts.tokens` in the strategy's `finally` block so
263
- * partial spend is preserved when the teacher throws mid-batch.
264
- */
265
- readonly reportCost: (tokens: number) => void;
266
- }
267
- interface ErrorCritiqueOptions<T> {
268
- /** Name — default: `"errorCritique"`. */
269
- name?: string;
270
- /** Number of candidates generated per iteration. Default: 4. */
271
- width?: number;
272
- /**
273
- * Cut-off below which a task is classified as a failure and fed into the
274
- * critique. Default: the batch mean — any task scoring below the batch
275
- * mean is a failure. Pass a number for an absolute cut-off, or a function
276
- * for per-batch computation (e.g. a percentile). When the default mean
277
- * is non-finite (NaN / ±Infinity from a degenerate evaluator), ALL scores
278
- * are treated as failures so the critique loop continues to steer.
279
- */
280
- failureThreshold?: number | ((scores: readonly EvalResult[]) => number);
281
- /** Cap on failure samples packed into the critique. Default: 5. */
282
- maxFailureSamples?: number;
283
- /**
284
- * Format failures into the `critique` string passed to the teacher. Default
285
- * joins `- taskId (score=N) | error: …` lines. Override to shape LLM prompts.
286
- *
287
- * **Note:** the `feedback` argument is a shell with `{score, weakTasks}`
288
- * populated; `summary` is empty because `analyze` computes the final summary
289
- * AFTER `formatCritique` runs (the summary embeds the formatted count).
290
- * Rely on `failures` and `feedback.score` — do not read `feedback.summary`
291
- * here.
292
- */
293
- formatCritique?: (failures: readonly EvalResult[], feedback: Feedback) => string;
294
- /**
295
- * Run teacher calls in parallel via `Promise.all`. Default `true` — the
296
- * common case (independent LLM calls). Set `false` to run sequentially
297
- * via `for/await` when teachers share stateful resources (rate limiters,
298
- * rolling context, serial API ordering) that don't tolerate concurrency.
299
- */
300
- parallel?: boolean;
301
- /**
302
- * Optional cost counter node. Running total tokens reported via
303
- * `ctx.reportCost` during each iteration is added to this node in the
304
- * strategy's `finally` block — fires on success AND on teacher throw so
305
- * partial spend is never lost. User owns the node; wire to `budgetGate`,
306
- * `attachSnapshotStorage`, telemetry, etc.
307
- */
308
- tokens?: Node<number>;
309
- /**
310
- * Teacher — given `{prior, critique, failures, reportCost}`, produce one
311
- * refined variant. Called `width` times per iteration. Async allowed.
312
- * Call `ctx.reportCost(n)` to track tokens consumed per call (optional,
313
- * no-op if `opts.tokens` is not set).
314
- */
315
- teacher: (ctx: ErrorCritiqueContext<T>) => Promise<T> | T;
316
- }
317
- /**
318
- * Critique-driven strategy (ProTeGi-style "textual gradient"). Each iteration:
319
- * 1. `analyze` classifies tasks scoring below a threshold as failures, picks
320
- * the best candidate from the batch, and packs both plus a formatted
321
- * critique string into `feedback.critique` as a private payload.
322
- * 2. `generate` unpacks that payload and calls the teacher with
323
- * `{prior, critique, failures, reportCost}` `width` times, returning the
324
- * refined batch.
325
- *
326
- * The teacher receives a pre-formatted string (drop into an LLM prompt) AND
327
- * the structured failure list (for richer prompts that want per-task detail).
328
- * Throws on empty candidate batches — matches `blindVariation`'s contract
329
- * (no silent zero-candidate cycles).
330
- *
331
- * When `setStrategy()` swaps this strategy in mid-run, the first `generate`
332
- * may receive a `Feedback` produced by the prior strategy (no private payload);
333
- * the fallback path uses `candidates[last]` as the prior and the feedback
334
- * summary as the critique, so the loop keeps running without a stall. When a
335
- * private payload IS present, `priv.critiqueText` takes precedence over any
336
- * edits a caller made to `feedback.summary` — treat `critique` as the
337
- * strategy-owned channel.
338
- */
339
- declare function errorCritique<T>(opts: ErrorCritiqueOptions<T>): RefineStrategy<T>;
340
-
341
- type index_AnalyzeEvent<T> = AnalyzeEvent<T>;
342
- type index_BlindVariationContext<T> = BlindVariationContext<T>;
343
- type index_BlindVariationOptions<T> = BlindVariationOptions<T>;
344
- type index_ConvergenceOptions = ConvergenceOptions;
345
- type index_DatasetItem = DatasetItem;
346
- type index_DecideEvent = DecideEvent;
347
- type index_ErrorCritiqueContext<T> = ErrorCritiqueContext<T>;
348
- type index_ErrorCritiqueOptions<T> = ErrorCritiqueOptions<T>;
349
- type index_EvalResult = EvalResult;
350
- type index_EvaluateEvent<T> = EvaluateEvent<T>;
351
- type index_Evaluator<T> = Evaluator<T>;
352
- type index_Feedback = Feedback;
353
- type index_GenerateEvent<T> = GenerateEvent<T>;
354
- type index_Iteration<T> = Iteration<T>;
355
- type index_RefineLoopGraph<T> = RefineLoopGraph<T>;
356
- type index_RefineLoopOptions = RefineLoopOptions;
357
- type index_RefineStatus = RefineStatus;
358
- type index_RefineStrategy<T> = RefineStrategy<T>;
359
- declare const index_blindVariation: typeof blindVariation;
360
- declare const index_errorCritique: typeof errorCritique;
361
- declare const index_refineLoop: typeof refineLoop;
362
- declare namespace index {
363
- export { type index_AnalyzeEvent as AnalyzeEvent, type index_BlindVariationContext as BlindVariationContext, type index_BlindVariationOptions as BlindVariationOptions, type index_ConvergenceOptions as ConvergenceOptions, type index_DatasetItem as DatasetItem, type index_DecideEvent as DecideEvent, type index_ErrorCritiqueContext as ErrorCritiqueContext, type index_ErrorCritiqueOptions as ErrorCritiqueOptions, type index_EvalResult as EvalResult, type index_EvaluateEvent as EvaluateEvent, type index_Evaluator as Evaluator, type index_Feedback as Feedback, type index_GenerateEvent as GenerateEvent, type index_Iteration as Iteration, type index_RefineLoopGraph as RefineLoopGraph, type index_RefineLoopOptions as RefineLoopOptions, type index_RefineStatus as RefineStatus, type index_RefineStrategy as RefineStrategy, index_blindVariation as blindVariation, index_errorCritique as errorCritique, index_refineLoop as refineLoop };
364
- }
365
-
366
- export { type AnalyzeEvent as A, type BlindVariationContext as B, type ConvergenceOptions as C, type DatasetItem as D, type Evaluator as E, type Feedback as F, type GenerateEvent as G, type Iteration as I, type RefineStrategy as R, type EvalResult as a, type RefineLoopOptions as b, type RefineStatus as c, type BlindVariationOptions as d, type DecideEvent as e, type ErrorCritiqueContext as f, type ErrorCritiqueOptions as g, type EvaluateEvent as h, index as i, type RefineLoopGraph as j, blindVariation as k, errorCritique as l, refineLoop as r };