@graphrefly/graphrefly 0.45.0 → 0.47.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 (714) hide show
  1. package/README.md +1 -2
  2. package/dist/_internal-B23BagFd.d.cts +33 -0
  3. package/dist/_internal-B23BagFd.d.ts +33 -0
  4. package/dist/adaptive-rate-limiter-Dch_xYIi.d.cts +111 -0
  5. package/dist/adaptive-rate-limiter-Dch_xYIi.d.ts +111 -0
  6. package/dist/agents-C0Ji9ldU.d.cts +629 -0
  7. package/dist/agents-C9zexT7I.d.ts +629 -0
  8. package/dist/audit-BAXb3VOg.d.ts +246 -0
  9. package/dist/audit-C_bPfkqS.d.cts +246 -0
  10. package/dist/backoff-7KIK3WQW.js +24 -0
  11. package/dist/backoff-7KIK3WQW.js.map +1 -0
  12. package/dist/backoff-Bnb9OoPh.d.cts +6 -0
  13. package/dist/backoff-Bnb9OoPh.d.ts +6 -0
  14. package/dist/base/composition/index.cjs +865 -0
  15. package/dist/base/composition/index.cjs.map +1 -0
  16. package/dist/base/composition/index.d.cts +468 -0
  17. package/dist/base/composition/index.d.ts +468 -0
  18. package/dist/base/composition/index.js +40 -0
  19. package/dist/base/composition/index.js.map +1 -0
  20. package/dist/base/index.cjs +6390 -0
  21. package/dist/base/index.cjs.map +1 -0
  22. package/dist/base/index.d.cts +21 -0
  23. package/dist/base/index.d.ts +21 -0
  24. package/dist/base/index.js +259 -0
  25. package/dist/base/index.js.map +1 -0
  26. package/dist/base/io/index.cjs +3270 -0
  27. package/dist/base/io/index.cjs.map +1 -0
  28. package/dist/base/io/index.d.cts +2245 -0
  29. package/dist/base/io/index.d.ts +2245 -0
  30. package/dist/base/io/index.js +117 -0
  31. package/dist/base/io/index.js.map +1 -0
  32. package/dist/base/meta/index.cjs +43 -0
  33. package/dist/base/meta/index.cjs.map +1 -0
  34. package/dist/base/meta/index.d.cts +45 -0
  35. package/dist/base/meta/index.d.ts +45 -0
  36. package/dist/base/meta/index.js +13 -0
  37. package/dist/base/meta/index.js.map +1 -0
  38. package/dist/base/mutation/index.cjs +200 -0
  39. package/dist/base/mutation/index.cjs.map +1 -0
  40. package/dist/base/mutation/index.d.cts +177 -0
  41. package/dist/base/mutation/index.d.ts +177 -0
  42. package/dist/base/mutation/index.js +22 -0
  43. package/dist/base/mutation/index.js.map +1 -0
  44. package/dist/base/render/index.cjs +1120 -0
  45. package/dist/base/render/index.cjs.map +1 -0
  46. package/dist/base/render/index.d.cts +227 -0
  47. package/dist/base/render/index.d.ts +227 -0
  48. package/dist/base/render/index.js +24 -0
  49. package/dist/base/render/index.js.map +1 -0
  50. package/dist/base/sources/browser/index.cjs +172 -0
  51. package/dist/base/sources/browser/index.cjs.map +1 -0
  52. package/dist/base/sources/browser/index.d.cts +84 -0
  53. package/dist/base/sources/browser/index.d.ts +84 -0
  54. package/dist/base/sources/browser/index.js +151 -0
  55. package/dist/base/sources/browser/index.js.map +1 -0
  56. package/dist/base/sources/event/index.cjs +98 -0
  57. package/dist/base/sources/event/index.cjs.map +1 -0
  58. package/dist/base/sources/event/index.d.cts +91 -0
  59. package/dist/base/sources/event/index.d.ts +91 -0
  60. package/dist/base/sources/event/index.js +13 -0
  61. package/dist/base/sources/event/index.js.map +1 -0
  62. package/dist/base/sources/index.cjs +755 -0
  63. package/dist/base/sources/index.cjs.map +1 -0
  64. package/dist/base/sources/index.d.cts +357 -0
  65. package/dist/base/sources/index.d.ts +357 -0
  66. package/dist/base/sources/index.js +42 -0
  67. package/dist/base/sources/index.js.map +1 -0
  68. package/dist/base/sources/node/index.cjs +320 -0
  69. package/dist/base/sources/node/index.cjs.map +1 -0
  70. package/dist/base/sources/node/index.d.cts +185 -0
  71. package/dist/base/sources/node/index.d.ts +185 -0
  72. package/dist/base/sources/node/index.js +306 -0
  73. package/dist/base/sources/node/index.js.map +1 -0
  74. package/dist/base/utils/index.cjs +37 -0
  75. package/dist/base/utils/index.cjs.map +1 -0
  76. package/dist/base/utils/index.d.cts +37 -0
  77. package/dist/base/utils/index.d.ts +37 -0
  78. package/dist/base/utils/index.js +11 -0
  79. package/dist/base/utils/index.js.map +1 -0
  80. package/dist/base/worker/index.cjs +548 -0
  81. package/dist/base/worker/index.cjs.map +1 -0
  82. package/dist/base/worker/index.d.cts +207 -0
  83. package/dist/base/worker/index.d.ts +207 -0
  84. package/dist/base/worker/index.js +20 -0
  85. package/dist/base/worker/index.js.map +1 -0
  86. package/dist/breaker-C9skL3d8.d.ts +175 -0
  87. package/dist/breaker-ugSdq54q.d.cts +175 -0
  88. package/dist/cascading-CSSbKGrJ.d.ts +199 -0
  89. package/dist/cascading-baGkiihI.d.cts +199 -0
  90. package/dist/chunk-22SG74BD.js +207 -0
  91. package/dist/chunk-22SG74BD.js.map +1 -0
  92. package/dist/chunk-255UCBG4.js +58 -0
  93. package/dist/chunk-255UCBG4.js.map +1 -0
  94. package/dist/chunk-2LO3EL4W.js +1 -0
  95. package/dist/chunk-2LO3EL4W.js.map +1 -0
  96. package/dist/chunk-2OB3CEJS.js +1065 -0
  97. package/dist/chunk-2OB3CEJS.js.map +1 -0
  98. package/dist/chunk-36NMM65U.js +144 -0
  99. package/dist/chunk-36NMM65U.js.map +1 -0
  100. package/dist/chunk-3CEXCBN6.js +1 -0
  101. package/dist/chunk-3CEXCBN6.js.map +1 -0
  102. package/dist/chunk-3MUSLI6E.js +105 -0
  103. package/dist/chunk-3MUSLI6E.js.map +1 -0
  104. package/dist/chunk-3PSLNJDU.js +884 -0
  105. package/dist/chunk-3PSLNJDU.js.map +1 -0
  106. package/dist/chunk-42FQ27MQ.js +594 -0
  107. package/dist/chunk-42FQ27MQ.js.map +1 -0
  108. package/dist/chunk-4GYMCUDZ.js +1085 -0
  109. package/dist/chunk-4GYMCUDZ.js.map +1 -0
  110. package/dist/chunk-4S53H2KR.js +382 -0
  111. package/dist/chunk-4S53H2KR.js.map +1 -0
  112. package/dist/chunk-4XCHZRUJ.js +128 -0
  113. package/dist/chunk-4XCHZRUJ.js.map +1 -0
  114. package/dist/chunk-5IMMNARC.js +1153 -0
  115. package/dist/chunk-5IMMNARC.js.map +1 -0
  116. package/dist/chunk-6XZYT4SW.js +256 -0
  117. package/dist/chunk-6XZYT4SW.js.map +1 -0
  118. package/dist/chunk-7EGRP2VX.js +76 -0
  119. package/dist/chunk-7EGRP2VX.js.map +1 -0
  120. package/dist/chunk-A7KV5UK4.js +150 -0
  121. package/dist/chunk-A7KV5UK4.js.map +1 -0
  122. package/dist/chunk-APY2SS5X.js +156 -0
  123. package/dist/chunk-APY2SS5X.js.map +1 -0
  124. package/dist/chunk-AZDQPQ3V.js +66 -0
  125. package/dist/chunk-AZDQPQ3V.js.map +1 -0
  126. package/dist/chunk-BU3SEFA5.js +90 -0
  127. package/dist/chunk-BU3SEFA5.js.map +1 -0
  128. package/dist/chunk-BXGZFGZ4.js +189 -0
  129. package/dist/chunk-BXGZFGZ4.js.map +1 -0
  130. package/dist/chunk-CGHORL6G.js +579 -0
  131. package/dist/chunk-CGHORL6G.js.map +1 -0
  132. package/dist/chunk-CXANAIZU.js +530 -0
  133. package/dist/chunk-CXANAIZU.js.map +1 -0
  134. package/dist/chunk-CZQHCKKG.js +1 -0
  135. package/dist/chunk-CZQHCKKG.js.map +1 -0
  136. package/dist/chunk-DKNHAICT.js +133 -0
  137. package/dist/chunk-DKNHAICT.js.map +1 -0
  138. package/dist/chunk-DM4OMPWK.js +584 -0
  139. package/dist/chunk-DM4OMPWK.js.map +1 -0
  140. package/dist/chunk-DMSNO6ZB.js +452 -0
  141. package/dist/chunk-DMSNO6ZB.js.map +1 -0
  142. package/dist/chunk-E5OZPDIW.js +229 -0
  143. package/dist/chunk-E5OZPDIW.js.map +1 -0
  144. package/dist/chunk-EHRRQ4IC.js +211 -0
  145. package/dist/chunk-EHRRQ4IC.js.map +1 -0
  146. package/dist/chunk-EVYY4X5A.js +509 -0
  147. package/dist/chunk-EVYY4X5A.js.map +1 -0
  148. package/dist/chunk-FDFD67UO.js +1 -0
  149. package/dist/chunk-FDFD67UO.js.map +1 -0
  150. package/dist/chunk-FMPF42Q4.js +13 -0
  151. package/dist/chunk-FMPF42Q4.js.map +1 -0
  152. package/dist/chunk-FW23JYNQ.js +454 -0
  153. package/dist/chunk-FW23JYNQ.js.map +1 -0
  154. package/dist/chunk-GWRNLJNW.js +2508 -0
  155. package/dist/chunk-GWRNLJNW.js.map +1 -0
  156. package/dist/chunk-HL7HUJIX.js +1 -0
  157. package/dist/chunk-HL7HUJIX.js.map +1 -0
  158. package/dist/chunk-IHTWQEDR.js +169 -0
  159. package/dist/chunk-IHTWQEDR.js.map +1 -0
  160. package/dist/chunk-IJRR6YAI.js +128 -0
  161. package/dist/chunk-IJRR6YAI.js.map +1 -0
  162. package/dist/chunk-JGFRAFDL.js +221 -0
  163. package/dist/chunk-JGFRAFDL.js.map +1 -0
  164. package/dist/chunk-JKTC747G.js +725 -0
  165. package/dist/chunk-JKTC747G.js.map +1 -0
  166. package/dist/chunk-KN3H5CNT.js +11 -0
  167. package/dist/chunk-KN3H5CNT.js.map +1 -0
  168. package/dist/chunk-KPG3DGLA.js +1 -0
  169. package/dist/chunk-KPG3DGLA.js.map +1 -0
  170. package/dist/chunk-KRNQ6RGQ.js +1 -0
  171. package/dist/chunk-KRNQ6RGQ.js.map +1 -0
  172. package/dist/chunk-MLTPJMH6.js +417 -0
  173. package/dist/chunk-MLTPJMH6.js.map +1 -0
  174. package/dist/chunk-N3SZ7BMH.js +95 -0
  175. package/dist/chunk-N3SZ7BMH.js.map +1 -0
  176. package/dist/chunk-NDUD3IMO.js +540 -0
  177. package/dist/chunk-NDUD3IMO.js.map +1 -0
  178. package/dist/chunk-NY2PYHNC.js +873 -0
  179. package/dist/chunk-NY2PYHNC.js.map +1 -0
  180. package/dist/chunk-O3MT7DYI.js +225 -0
  181. package/dist/chunk-O3MT7DYI.js.map +1 -0
  182. package/dist/chunk-OCUDSN63.js +2386 -0
  183. package/dist/chunk-OCUDSN63.js.map +1 -0
  184. package/dist/chunk-OIWU3NYV.js +199 -0
  185. package/dist/chunk-OIWU3NYV.js.map +1 -0
  186. package/dist/chunk-OQUIJT7A.js +1 -0
  187. package/dist/chunk-OQUIJT7A.js.map +1 -0
  188. package/dist/chunk-P5LBT622.js +105 -0
  189. package/dist/chunk-P5LBT622.js.map +1 -0
  190. package/dist/chunk-PKGQG5QQ.js +519 -0
  191. package/dist/chunk-PKGQG5QQ.js.map +1 -0
  192. package/dist/chunk-PKPO3JTZ.js +561 -0
  193. package/dist/chunk-PKPO3JTZ.js.map +1 -0
  194. package/dist/chunk-PL5UDIQ5.js +118 -0
  195. package/dist/chunk-PL5UDIQ5.js.map +1 -0
  196. package/dist/chunk-PZWISPIQ.js +432 -0
  197. package/dist/chunk-PZWISPIQ.js.map +1 -0
  198. package/dist/chunk-Q3EYOCZB.js +510 -0
  199. package/dist/chunk-Q3EYOCZB.js.map +1 -0
  200. package/dist/chunk-QMBYUVRL.js +15 -0
  201. package/dist/chunk-QMBYUVRL.js.map +1 -0
  202. package/dist/chunk-RAGGHLCV.js +200 -0
  203. package/dist/chunk-RAGGHLCV.js.map +1 -0
  204. package/dist/chunk-RJOG4IJU.js +1039 -0
  205. package/dist/chunk-RJOG4IJU.js.map +1 -0
  206. package/dist/chunk-SOOKUYVM.js +403 -0
  207. package/dist/chunk-SOOKUYVM.js.map +1 -0
  208. package/dist/chunk-T5BN5KG7.js +1 -0
  209. package/dist/chunk-T5BN5KG7.js.map +1 -0
  210. package/dist/chunk-TNX5ZGDJ.js +574 -0
  211. package/dist/chunk-TNX5ZGDJ.js.map +1 -0
  212. package/dist/chunk-TP7244Y6.js +207 -0
  213. package/dist/chunk-TP7244Y6.js.map +1 -0
  214. package/dist/chunk-TSBFTJKM.js +57 -0
  215. package/dist/chunk-TSBFTJKM.js.map +1 -0
  216. package/dist/chunk-URQ2CBBF.js +143 -0
  217. package/dist/chunk-URQ2CBBF.js.map +1 -0
  218. package/dist/chunk-VLAGJZSL.js +1079 -0
  219. package/dist/chunk-VLAGJZSL.js.map +1 -0
  220. package/dist/chunk-W2BOPXTI.js +1 -0
  221. package/dist/chunk-W2BOPXTI.js.map +1 -0
  222. package/dist/chunk-Y52CS6YA.js +88 -0
  223. package/dist/chunk-Y52CS6YA.js.map +1 -0
  224. package/dist/chunk-YCBUWK77.js +92 -0
  225. package/dist/chunk-YCBUWK77.js.map +1 -0
  226. package/dist/chunk-YJ4U2D2C.js +314 -0
  227. package/dist/chunk-YJ4U2D2C.js.map +1 -0
  228. package/dist/chunk-Z4YXAUDN.js +239 -0
  229. package/dist/chunk-Z4YXAUDN.js.map +1 -0
  230. package/dist/chunk-Z65DVDEQ.js +146 -0
  231. package/dist/chunk-Z65DVDEQ.js.map +1 -0
  232. package/dist/chunk-Z6EGP5D7.js +92 -0
  233. package/dist/chunk-Z6EGP5D7.js.map +1 -0
  234. package/dist/chunk-ZT4WMQW4.js +1575 -0
  235. package/dist/chunk-ZT4WMQW4.js.map +1 -0
  236. package/dist/chunk-ZVXXDWIB.js +1282 -0
  237. package/dist/chunk-ZVXXDWIB.js.map +1 -0
  238. package/dist/compat/index.cjs +3150 -6
  239. package/dist/compat/index.cjs.map +1 -1
  240. package/dist/compat/index.d.cts +116 -1
  241. package/dist/compat/index.d.ts +116 -1
  242. package/dist/compat/index.js +175 -2
  243. package/dist/compat/index.js.map +1 -1
  244. package/dist/compat/jotai/index.cjs +130 -2
  245. package/dist/compat/jotai/index.cjs.map +1 -1
  246. package/dist/compat/jotai/index.d.cts +2 -1
  247. package/dist/compat/jotai/index.d.ts +2 -1
  248. package/dist/compat/jotai/index.js +7 -2
  249. package/dist/compat/jotai/index.js.map +1 -1
  250. package/dist/compat/nanostores/index.cjs +186 -2
  251. package/dist/compat/nanostores/index.cjs.map +1 -1
  252. package/dist/compat/nanostores/index.d.cts +2 -1
  253. package/dist/compat/nanostores/index.d.ts +2 -1
  254. package/dist/compat/nanostores/index.js +21 -2
  255. package/dist/compat/nanostores/index.js.map +1 -1
  256. package/dist/compat/nestjs/index.cjs +2291 -6
  257. package/dist/compat/nestjs/index.cjs.map +1 -1
  258. package/dist/compat/nestjs/index.d.cts +10 -1
  259. package/dist/compat/nestjs/index.d.ts +10 -1
  260. package/dist/compat/nestjs/index.js +76 -2
  261. package/dist/compat/nestjs/index.js.map +1 -1
  262. package/dist/compat/react/index.cjs +95 -2
  263. package/dist/compat/react/index.cjs.map +1 -1
  264. package/dist/compat/react/index.d.cts +2 -1
  265. package/dist/compat/react/index.d.ts +2 -1
  266. package/dist/compat/react/index.js +11 -2
  267. package/dist/compat/react/index.js.map +1 -1
  268. package/dist/compat/solid/index.cjs +82 -2
  269. package/dist/compat/solid/index.cjs.map +1 -1
  270. package/dist/compat/solid/index.d.cts +2 -1
  271. package/dist/compat/solid/index.d.ts +2 -1
  272. package/dist/compat/solid/index.js +11 -2
  273. package/dist/compat/solid/index.js.map +1 -1
  274. package/dist/compat/svelte/index.cjs +85 -2
  275. package/dist/compat/svelte/index.cjs.map +1 -1
  276. package/dist/compat/svelte/index.d.cts +2 -1
  277. package/dist/compat/svelte/index.d.ts +2 -1
  278. package/dist/compat/svelte/index.js +11 -2
  279. package/dist/compat/svelte/index.js.map +1 -1
  280. package/dist/compat/vue/index.cjs +100 -2
  281. package/dist/compat/vue/index.cjs.map +1 -1
  282. package/dist/compat/vue/index.d.cts +3 -1
  283. package/dist/compat/vue/index.d.ts +3 -1
  284. package/dist/compat/vue/index.js +11 -2
  285. package/dist/compat/vue/index.js.map +1 -1
  286. package/dist/compat/zustand/index.cjs +50 -2
  287. package/dist/compat/zustand/index.cjs.map +1 -1
  288. package/dist/compat/zustand/index.d.cts +2 -1
  289. package/dist/compat/zustand/index.d.ts +2 -1
  290. package/dist/compat/zustand/index.js +7 -2
  291. package/dist/compat/zustand/index.js.map +1 -1
  292. package/dist/distill-De6Rnn15.d.cts +48 -0
  293. package/dist/distill-De6Rnn15.d.ts +48 -0
  294. package/dist/external-register-CWyroXb_.d.cts +138 -0
  295. package/dist/external-register-CWyroXb_.d.ts +138 -0
  296. package/dist/fallback-Bx46zqky.d.cts +243 -0
  297. package/dist/fallback-pIWW8A2d.d.ts +243 -0
  298. package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
  299. package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
  300. package/dist/index-B6pxYJzO.d.cts +36 -0
  301. package/dist/index-B6pxYJzO.d.ts +36 -0
  302. package/dist/index-BFsng6v1.d.cts +44 -0
  303. package/dist/index-BFsng6v1.d.ts +44 -0
  304. package/dist/index-B_p8tnvf.d.cts +770 -0
  305. package/dist/index-Bg-LwEt-.d.cts +45 -0
  306. package/dist/index-Bg-LwEt-.d.ts +45 -0
  307. package/dist/index-Brp888t0.d.cts +127 -0
  308. package/dist/index-Brp888t0.d.ts +127 -0
  309. package/dist/index-CDfk6jHN.d.cts +37 -0
  310. package/dist/index-CDfk6jHN.d.ts +37 -0
  311. package/dist/index-DLAxYaN5.d.cts +169 -0
  312. package/dist/index-DLAxYaN5.d.ts +169 -0
  313. package/dist/index-DeWbQzMe.d.cts +34 -0
  314. package/dist/index-DeWbQzMe.d.ts +34 -0
  315. package/dist/index-_HDSmPyp.d.ts +770 -0
  316. package/dist/index-dX9IzPqj.d.cts +86 -0
  317. package/dist/index-dX9IzPqj.d.ts +86 -0
  318. package/dist/index.cjs +26009 -0
  319. package/dist/index.cjs.map +1 -1
  320. package/dist/index.d.cts +55 -42
  321. package/dist/index.d.ts +55 -42
  322. package/dist/index.js +849 -0
  323. package/dist/index.js.map +1 -1
  324. package/dist/layout-types-B5aiHYgk.d.cts +72 -0
  325. package/dist/layout-types-B5aiHYgk.d.ts +72 -0
  326. package/dist/memory-composers-BryDrRBX.d.cts +529 -0
  327. package/dist/memory-composers-CVQqPYEV.d.ts +529 -0
  328. package/dist/observable-B25XqCbZ.d.cts +59 -0
  329. package/dist/observable-B25XqCbZ.d.ts +59 -0
  330. package/dist/pipeline-graph-Ce47CB6Y.d.cts +145 -0
  331. package/dist/pipeline-graph-DXCwY9vG.d.ts +145 -0
  332. package/dist/presets/ai/index.cjs +4377 -0
  333. package/dist/presets/ai/index.cjs.map +1 -0
  334. package/dist/presets/ai/index.d.cts +98 -0
  335. package/dist/presets/ai/index.d.ts +98 -0
  336. package/dist/presets/ai/index.js +54 -0
  337. package/dist/presets/ai/index.js.map +1 -0
  338. package/dist/presets/harness/index.cjs +5929 -0
  339. package/dist/presets/harness/index.cjs.map +1 -0
  340. package/dist/presets/harness/index.d.cts +566 -0
  341. package/dist/presets/harness/index.d.ts +566 -0
  342. package/dist/presets/harness/index.js +71 -0
  343. package/dist/presets/harness/index.js.map +1 -0
  344. package/dist/presets/index.cjs +9782 -0
  345. package/dist/presets/index.cjs.map +1 -0
  346. package/dist/presets/index.d.cts +28 -0
  347. package/dist/presets/index.d.ts +28 -0
  348. package/dist/presets/index.js +129 -0
  349. package/dist/presets/index.js.map +1 -0
  350. package/dist/presets/inspect/index.cjs +1087 -0
  351. package/dist/presets/inspect/index.cjs.map +1 -0
  352. package/dist/presets/inspect/index.d.cts +172 -0
  353. package/dist/presets/inspect/index.d.ts +172 -0
  354. package/dist/presets/inspect/index.js +21 -0
  355. package/dist/presets/inspect/index.js.map +1 -0
  356. package/dist/presets/resilience/index.cjs +1593 -0
  357. package/dist/presets/resilience/index.cjs.map +1 -0
  358. package/dist/presets/resilience/index.d.cts +205 -0
  359. package/dist/presets/resilience/index.d.ts +205 -0
  360. package/dist/presets/resilience/index.js +18 -0
  361. package/dist/presets/resilience/index.js.map +1 -0
  362. package/dist/rate-limiter-CEALq4N1.d.ts +559 -0
  363. package/dist/rate-limiter-DpVbSYdH.d.cts +559 -0
  364. package/dist/reactive-layout-fswlBUvX.d.cts +195 -0
  365. package/dist/reactive-layout-fswlBUvX.d.ts +195 -0
  366. package/dist/retry-BDbRZ_gx.d.ts +125 -0
  367. package/dist/retry-DWuhjvsA.d.cts +125 -0
  368. package/dist/solutions/index.cjs +8200 -0
  369. package/dist/solutions/index.cjs.map +1 -0
  370. package/dist/solutions/index.d.cts +23 -0
  371. package/dist/solutions/index.d.ts +23 -0
  372. package/dist/solutions/index.js +55 -0
  373. package/dist/solutions/index.js.map +1 -0
  374. package/dist/spawnable-5mDY501F.d.cts +746 -0
  375. package/dist/spawnable-D3lR0oQu.d.ts +746 -0
  376. package/dist/status-U-rUI79b.d.cts +84 -0
  377. package/dist/status-U-rUI79b.d.ts +84 -0
  378. package/dist/timeout-U5O4ESK3.js +12 -0
  379. package/dist/timeout-U5O4ESK3.js.map +1 -0
  380. package/dist/types-BB5Lw-pB.d.cts +442 -0
  381. package/dist/types-BB5Lw-pB.d.ts +442 -0
  382. package/dist/types-CJWIMJiZ.d.ts +548 -0
  383. package/dist/types-vCq7ShIm.d.cts +548 -0
  384. package/dist/utils/ai/browser.cjs +2169 -0
  385. package/dist/utils/ai/browser.cjs.map +1 -0
  386. package/dist/utils/ai/browser.d.cts +129 -0
  387. package/dist/utils/ai/browser.d.ts +129 -0
  388. package/dist/utils/ai/browser.js +255 -0
  389. package/dist/utils/ai/browser.js.map +1 -0
  390. package/dist/utils/ai/index.cjs +8468 -0
  391. package/dist/utils/ai/index.cjs.map +1 -0
  392. package/dist/utils/ai/index.d.cts +1777 -0
  393. package/dist/utils/ai/index.d.ts +1777 -0
  394. package/dist/utils/ai/index.js +173 -0
  395. package/dist/utils/ai/index.js.map +1 -0
  396. package/dist/utils/ai/node.cjs +648 -0
  397. package/dist/utils/ai/node.cjs.map +1 -0
  398. package/dist/utils/ai/node.d.cts +57 -0
  399. package/dist/utils/ai/node.d.ts +57 -0
  400. package/dist/utils/ai/node.js +84 -0
  401. package/dist/utils/ai/node.js.map +1 -0
  402. package/dist/utils/cqrs/index.cjs +1036 -0
  403. package/dist/utils/cqrs/index.cjs.map +1 -0
  404. package/dist/utils/cqrs/index.d.cts +438 -0
  405. package/dist/utils/cqrs/index.d.ts +438 -0
  406. package/dist/utils/cqrs/index.js +18 -0
  407. package/dist/utils/cqrs/index.js.map +1 -0
  408. package/dist/utils/demo-shell/index.cjs +865 -0
  409. package/dist/utils/demo-shell/index.cjs.map +1 -0
  410. package/dist/utils/demo-shell/index.d.cts +90 -0
  411. package/dist/utils/demo-shell/index.d.ts +90 -0
  412. package/dist/utils/demo-shell/index.js +13 -0
  413. package/dist/utils/demo-shell/index.js.map +1 -0
  414. package/dist/utils/domain-templates/index.cjs +732 -0
  415. package/dist/utils/domain-templates/index.cjs.map +1 -0
  416. package/dist/utils/domain-templates/index.d.cts +214 -0
  417. package/dist/utils/domain-templates/index.d.ts +214 -0
  418. package/dist/utils/domain-templates/index.js +17 -0
  419. package/dist/utils/domain-templates/index.js.map +1 -0
  420. package/dist/utils/graphspec/index.cjs +1174 -0
  421. package/dist/utils/graphspec/index.cjs.map +1 -0
  422. package/dist/utils/graphspec/index.d.cts +449 -0
  423. package/dist/utils/graphspec/index.d.ts +449 -0
  424. package/dist/utils/graphspec/index.js +35 -0
  425. package/dist/utils/graphspec/index.js.map +1 -0
  426. package/dist/utils/harness/index.cjs +656 -0
  427. package/dist/utils/harness/index.cjs.map +1 -0
  428. package/dist/utils/harness/index.d.cts +542 -0
  429. package/dist/utils/harness/index.d.ts +542 -0
  430. package/dist/utils/harness/index.js +56 -0
  431. package/dist/utils/harness/index.js.map +1 -0
  432. package/dist/utils/index.cjs +17614 -0
  433. package/dist/utils/index.cjs.map +1 -0
  434. package/dist/utils/index.d.cts +96 -0
  435. package/dist/utils/index.d.ts +96 -0
  436. package/dist/utils/index.js +514 -0
  437. package/dist/utils/index.js.map +1 -0
  438. package/dist/utils/inspect/index.cjs +807 -0
  439. package/dist/utils/inspect/index.cjs.map +1 -0
  440. package/dist/utils/inspect/index.d.cts +123 -0
  441. package/dist/utils/inspect/index.d.ts +123 -0
  442. package/dist/utils/inspect/index.js +30 -0
  443. package/dist/utils/inspect/index.js.map +1 -0
  444. package/dist/utils/job-queue/index.cjs +717 -0
  445. package/dist/utils/job-queue/index.cjs.map +1 -0
  446. package/dist/utils/job-queue/index.d.cts +200 -0
  447. package/dist/utils/job-queue/index.d.ts +200 -0
  448. package/dist/utils/job-queue/index.js +18 -0
  449. package/dist/utils/job-queue/index.js.map +1 -0
  450. package/dist/utils/memory/index.cjs +1456 -0
  451. package/dist/utils/memory/index.cjs.map +1 -0
  452. package/dist/utils/memory/index.d.cts +660 -0
  453. package/dist/utils/memory/index.d.ts +660 -0
  454. package/dist/utils/memory/index.js +19 -0
  455. package/dist/utils/memory/index.js.map +1 -0
  456. package/dist/utils/messaging/index.cjs +666 -0
  457. package/dist/utils/messaging/index.cjs.map +1 -0
  458. package/dist/utils/messaging/index.d.cts +562 -0
  459. package/dist/utils/messaging/index.d.ts +562 -0
  460. package/dist/utils/messaging/index.js +50 -0
  461. package/dist/utils/messaging/index.js.map +1 -0
  462. package/dist/utils/orchestration/index.cjs +876 -0
  463. package/dist/utils/orchestration/index.cjs.map +1 -0
  464. package/dist/utils/orchestration/index.d.cts +233 -0
  465. package/dist/utils/orchestration/index.d.ts +233 -0
  466. package/dist/utils/orchestration/index.js +19 -0
  467. package/dist/utils/orchestration/index.js.map +1 -0
  468. package/dist/utils/process/index.cjs +743 -0
  469. package/dist/utils/process/index.cjs.map +1 -0
  470. package/dist/utils/process/index.d.cts +411 -0
  471. package/dist/utils/process/index.d.ts +411 -0
  472. package/dist/utils/process/index.js +14 -0
  473. package/dist/utils/process/index.js.map +1 -0
  474. package/dist/utils/reactive-layout/index.cjs +1607 -0
  475. package/dist/utils/reactive-layout/index.cjs.map +1 -0
  476. package/dist/utils/reactive-layout/index.d.cts +492 -0
  477. package/dist/utils/reactive-layout/index.d.ts +492 -0
  478. package/dist/utils/reactive-layout/index.js +52 -0
  479. package/dist/utils/reactive-layout/index.js.map +1 -0
  480. package/dist/utils/reduction/index.cjs +203 -0
  481. package/dist/utils/reduction/index.cjs.map +1 -0
  482. package/dist/utils/reduction/index.d.cts +102 -0
  483. package/dist/utils/reduction/index.d.ts +102 -0
  484. package/dist/utils/reduction/index.js +14 -0
  485. package/dist/utils/reduction/index.js.map +1 -0
  486. package/dist/utils/resilience/index.cjs +1617 -0
  487. package/dist/utils/resilience/index.cjs.map +1 -0
  488. package/dist/utils/resilience/index.d.cts +9 -0
  489. package/dist/utils/resilience/index.d.ts +9 -0
  490. package/dist/utils/resilience/index.js +44 -0
  491. package/dist/utils/resilience/index.js.map +1 -0
  492. package/dist/utils/surface/index.cjs +1070 -0
  493. package/dist/utils/surface/index.cjs.map +1 -0
  494. package/dist/utils/surface/index.d.cts +240 -0
  495. package/dist/utils/surface/index.d.ts +240 -0
  496. package/dist/utils/surface/index.js +30 -0
  497. package/dist/utils/surface/index.js.map +1 -0
  498. package/dist/utils/topology-view/index.cjs +620 -0
  499. package/dist/utils/topology-view/index.cjs.map +1 -0
  500. package/dist/utils/topology-view/index.d.cts +68 -0
  501. package/dist/utils/topology-view/index.d.ts +68 -0
  502. package/dist/utils/topology-view/index.js +11 -0
  503. package/dist/utils/topology-view/index.js.map +1 -0
  504. package/package.json +293 -241
  505. package/dist/core/index.cjs +0 -21
  506. package/dist/core/index.cjs.map +0 -1
  507. package/dist/core/index.d.cts +0 -1
  508. package/dist/core/index.d.ts +0 -1
  509. package/dist/core/index.js +0 -3
  510. package/dist/core/index.js.map +0 -1
  511. package/dist/extra/browser.cjs +0 -21
  512. package/dist/extra/browser.cjs.map +0 -1
  513. package/dist/extra/browser.d.cts +0 -1
  514. package/dist/extra/browser.d.ts +0 -1
  515. package/dist/extra/browser.js +0 -3
  516. package/dist/extra/browser.js.map +0 -1
  517. package/dist/extra/index.cjs +0 -21
  518. package/dist/extra/index.cjs.map +0 -1
  519. package/dist/extra/index.d.cts +0 -1
  520. package/dist/extra/index.d.ts +0 -1
  521. package/dist/extra/index.js +0 -3
  522. package/dist/extra/index.js.map +0 -1
  523. package/dist/extra/node.cjs +0 -21
  524. package/dist/extra/node.cjs.map +0 -1
  525. package/dist/extra/node.d.cts +0 -1
  526. package/dist/extra/node.d.ts +0 -1
  527. package/dist/extra/node.js +0 -3
  528. package/dist/extra/node.js.map +0 -1
  529. package/dist/extra/operators.cjs +0 -21
  530. package/dist/extra/operators.cjs.map +0 -1
  531. package/dist/extra/operators.d.cts +0 -1
  532. package/dist/extra/operators.d.ts +0 -1
  533. package/dist/extra/operators.js +0 -3
  534. package/dist/extra/operators.js.map +0 -1
  535. package/dist/extra/reactive.cjs +0 -21
  536. package/dist/extra/reactive.cjs.map +0 -1
  537. package/dist/extra/reactive.d.cts +0 -1
  538. package/dist/extra/reactive.d.ts +0 -1
  539. package/dist/extra/reactive.js +0 -3
  540. package/dist/extra/reactive.js.map +0 -1
  541. package/dist/extra/render/index.cjs +0 -21
  542. package/dist/extra/render/index.cjs.map +0 -1
  543. package/dist/extra/render/index.d.cts +0 -1
  544. package/dist/extra/render/index.d.ts +0 -1
  545. package/dist/extra/render/index.js +0 -3
  546. package/dist/extra/render/index.js.map +0 -1
  547. package/dist/extra/sources.cjs +0 -21
  548. package/dist/extra/sources.cjs.map +0 -1
  549. package/dist/extra/sources.d.cts +0 -1
  550. package/dist/extra/sources.d.ts +0 -1
  551. package/dist/extra/sources.js +0 -3
  552. package/dist/extra/sources.js.map +0 -1
  553. package/dist/extra/storage-browser.cjs +0 -21
  554. package/dist/extra/storage-browser.cjs.map +0 -1
  555. package/dist/extra/storage-browser.d.cts +0 -1
  556. package/dist/extra/storage-browser.d.ts +0 -1
  557. package/dist/extra/storage-browser.js +0 -3
  558. package/dist/extra/storage-browser.js.map +0 -1
  559. package/dist/extra/storage-core.cjs +0 -21
  560. package/dist/extra/storage-core.cjs.map +0 -1
  561. package/dist/extra/storage-core.d.cts +0 -1
  562. package/dist/extra/storage-core.d.ts +0 -1
  563. package/dist/extra/storage-core.js +0 -3
  564. package/dist/extra/storage-core.js.map +0 -1
  565. package/dist/extra/storage-node.cjs +0 -21
  566. package/dist/extra/storage-node.cjs.map +0 -1
  567. package/dist/extra/storage-node.d.cts +0 -1
  568. package/dist/extra/storage-node.d.ts +0 -1
  569. package/dist/extra/storage-node.js +0 -3
  570. package/dist/extra/storage-node.js.map +0 -1
  571. package/dist/extra/storage-tiers-browser.cjs +0 -21
  572. package/dist/extra/storage-tiers-browser.cjs.map +0 -1
  573. package/dist/extra/storage-tiers-browser.d.cts +0 -1
  574. package/dist/extra/storage-tiers-browser.d.ts +0 -1
  575. package/dist/extra/storage-tiers-browser.js +0 -3
  576. package/dist/extra/storage-tiers-browser.js.map +0 -1
  577. package/dist/extra/storage-tiers-node.cjs +0 -21
  578. package/dist/extra/storage-tiers-node.cjs.map +0 -1
  579. package/dist/extra/storage-tiers-node.d.cts +0 -1
  580. package/dist/extra/storage-tiers-node.d.ts +0 -1
  581. package/dist/extra/storage-tiers-node.js +0 -3
  582. package/dist/extra/storage-tiers-node.js.map +0 -1
  583. package/dist/extra/storage-tiers.cjs +0 -21
  584. package/dist/extra/storage-tiers.cjs.map +0 -1
  585. package/dist/extra/storage-tiers.d.cts +0 -1
  586. package/dist/extra/storage-tiers.d.ts +0 -1
  587. package/dist/extra/storage-tiers.js +0 -3
  588. package/dist/extra/storage-tiers.js.map +0 -1
  589. package/dist/extra/storage-wal.cjs +0 -21
  590. package/dist/extra/storage-wal.cjs.map +0 -1
  591. package/dist/extra/storage-wal.d.cts +0 -1
  592. package/dist/extra/storage-wal.d.ts +0 -1
  593. package/dist/extra/storage-wal.js +0 -3
  594. package/dist/extra/storage-wal.js.map +0 -1
  595. package/dist/graph/index.cjs +0 -21
  596. package/dist/graph/index.cjs.map +0 -1
  597. package/dist/graph/index.d.cts +0 -1
  598. package/dist/graph/index.d.ts +0 -1
  599. package/dist/graph/index.js +0 -3
  600. package/dist/graph/index.js.map +0 -1
  601. package/dist/patterns/ai/browser.cjs +0 -21
  602. package/dist/patterns/ai/browser.cjs.map +0 -1
  603. package/dist/patterns/ai/browser.d.cts +0 -1
  604. package/dist/patterns/ai/browser.d.ts +0 -1
  605. package/dist/patterns/ai/browser.js +0 -3
  606. package/dist/patterns/ai/browser.js.map +0 -1
  607. package/dist/patterns/ai/index.cjs +0 -21
  608. package/dist/patterns/ai/index.cjs.map +0 -1
  609. package/dist/patterns/ai/index.d.cts +0 -1
  610. package/dist/patterns/ai/index.d.ts +0 -1
  611. package/dist/patterns/ai/index.js +0 -3
  612. package/dist/patterns/ai/index.js.map +0 -1
  613. package/dist/patterns/ai/node.cjs +0 -21
  614. package/dist/patterns/ai/node.cjs.map +0 -1
  615. package/dist/patterns/ai/node.d.cts +0 -1
  616. package/dist/patterns/ai/node.d.ts +0 -1
  617. package/dist/patterns/ai/node.js +0 -3
  618. package/dist/patterns/ai/node.js.map +0 -1
  619. package/dist/patterns/cqrs/index.cjs +0 -21
  620. package/dist/patterns/cqrs/index.cjs.map +0 -1
  621. package/dist/patterns/cqrs/index.d.cts +0 -1
  622. package/dist/patterns/cqrs/index.d.ts +0 -1
  623. package/dist/patterns/cqrs/index.js +0 -3
  624. package/dist/patterns/cqrs/index.js.map +0 -1
  625. package/dist/patterns/demo-shell/index.cjs +0 -21
  626. package/dist/patterns/demo-shell/index.cjs.map +0 -1
  627. package/dist/patterns/demo-shell/index.d.cts +0 -1
  628. package/dist/patterns/demo-shell/index.d.ts +0 -1
  629. package/dist/patterns/demo-shell/index.js +0 -3
  630. package/dist/patterns/demo-shell/index.js.map +0 -1
  631. package/dist/patterns/domain-templates/index.cjs +0 -21
  632. package/dist/patterns/domain-templates/index.cjs.map +0 -1
  633. package/dist/patterns/domain-templates/index.d.cts +0 -1
  634. package/dist/patterns/domain-templates/index.d.ts +0 -1
  635. package/dist/patterns/domain-templates/index.js +0 -3
  636. package/dist/patterns/domain-templates/index.js.map +0 -1
  637. package/dist/patterns/graphspec/index.cjs +0 -21
  638. package/dist/patterns/graphspec/index.cjs.map +0 -1
  639. package/dist/patterns/graphspec/index.d.cts +0 -1
  640. package/dist/patterns/graphspec/index.d.ts +0 -1
  641. package/dist/patterns/graphspec/index.js +0 -3
  642. package/dist/patterns/graphspec/index.js.map +0 -1
  643. package/dist/patterns/harness/index.cjs +0 -21
  644. package/dist/patterns/harness/index.cjs.map +0 -1
  645. package/dist/patterns/harness/index.d.cts +0 -1
  646. package/dist/patterns/harness/index.d.ts +0 -1
  647. package/dist/patterns/harness/index.js +0 -3
  648. package/dist/patterns/harness/index.js.map +0 -1
  649. package/dist/patterns/inspect/index.cjs +0 -21
  650. package/dist/patterns/inspect/index.cjs.map +0 -1
  651. package/dist/patterns/inspect/index.d.cts +0 -1
  652. package/dist/patterns/inspect/index.d.ts +0 -1
  653. package/dist/patterns/inspect/index.js +0 -3
  654. package/dist/patterns/inspect/index.js.map +0 -1
  655. package/dist/patterns/job-queue/index.cjs +0 -21
  656. package/dist/patterns/job-queue/index.cjs.map +0 -1
  657. package/dist/patterns/job-queue/index.d.cts +0 -1
  658. package/dist/patterns/job-queue/index.d.ts +0 -1
  659. package/dist/patterns/job-queue/index.js +0 -3
  660. package/dist/patterns/job-queue/index.js.map +0 -1
  661. package/dist/patterns/memory/index.cjs +0 -21
  662. package/dist/patterns/memory/index.cjs.map +0 -1
  663. package/dist/patterns/memory/index.d.cts +0 -1
  664. package/dist/patterns/memory/index.d.ts +0 -1
  665. package/dist/patterns/memory/index.js +0 -3
  666. package/dist/patterns/memory/index.js.map +0 -1
  667. package/dist/patterns/messaging/index.cjs +0 -21
  668. package/dist/patterns/messaging/index.cjs.map +0 -1
  669. package/dist/patterns/messaging/index.d.cts +0 -1
  670. package/dist/patterns/messaging/index.d.ts +0 -1
  671. package/dist/patterns/messaging/index.js +0 -3
  672. package/dist/patterns/messaging/index.js.map +0 -1
  673. package/dist/patterns/orchestration/index.cjs +0 -21
  674. package/dist/patterns/orchestration/index.cjs.map +0 -1
  675. package/dist/patterns/orchestration/index.d.cts +0 -1
  676. package/dist/patterns/orchestration/index.d.ts +0 -1
  677. package/dist/patterns/orchestration/index.js +0 -3
  678. package/dist/patterns/orchestration/index.js.map +0 -1
  679. package/dist/patterns/process/index.cjs +0 -21
  680. package/dist/patterns/process/index.cjs.map +0 -1
  681. package/dist/patterns/process/index.d.cts +0 -1
  682. package/dist/patterns/process/index.d.ts +0 -1
  683. package/dist/patterns/process/index.js +0 -3
  684. package/dist/patterns/process/index.js.map +0 -1
  685. package/dist/patterns/reactive-layout/index.cjs +0 -21
  686. package/dist/patterns/reactive-layout/index.cjs.map +0 -1
  687. package/dist/patterns/reactive-layout/index.d.cts +0 -1
  688. package/dist/patterns/reactive-layout/index.d.ts +0 -1
  689. package/dist/patterns/reactive-layout/index.js +0 -3
  690. package/dist/patterns/reactive-layout/index.js.map +0 -1
  691. package/dist/patterns/reduction/index.cjs +0 -21
  692. package/dist/patterns/reduction/index.cjs.map +0 -1
  693. package/dist/patterns/reduction/index.d.cts +0 -1
  694. package/dist/patterns/reduction/index.d.ts +0 -1
  695. package/dist/patterns/reduction/index.js +0 -3
  696. package/dist/patterns/reduction/index.js.map +0 -1
  697. package/dist/patterns/surface/index.cjs +0 -21
  698. package/dist/patterns/surface/index.cjs.map +0 -1
  699. package/dist/patterns/surface/index.d.cts +0 -1
  700. package/dist/patterns/surface/index.d.ts +0 -1
  701. package/dist/patterns/surface/index.js +0 -3
  702. package/dist/patterns/surface/index.js.map +0 -1
  703. package/dist/patterns/topology-view/index.cjs +0 -21
  704. package/dist/patterns/topology-view/index.cjs.map +0 -1
  705. package/dist/patterns/topology-view/index.d.cts +0 -1
  706. package/dist/patterns/topology-view/index.d.ts +0 -1
  707. package/dist/patterns/topology-view/index.js +0 -3
  708. package/dist/patterns/topology-view/index.js.map +0 -1
  709. package/dist/testing/index.cjs +0 -21
  710. package/dist/testing/index.cjs.map +0 -1
  711. package/dist/testing/index.d.cts +0 -1
  712. package/dist/testing/index.d.ts +0 -1
  713. package/dist/testing/index.js +0 -3
  714. package/dist/testing/index.js.map +0 -1
@@ -0,0 +1,629 @@
1
+ import { NodeInput, ReactiveMapBundle } from '@graphrefly/pure-ts/extra';
2
+ import { Graph, GraphOptions } from '@graphrefly/pure-ts/graph';
3
+ import { c as LLMResponse, j as ToolCall, L as LLMAdapter, k as ToolDefinition, i as TokenUsage } from './types-BB5Lw-pB.cjs';
4
+ import { Node } from '@graphrefly/pure-ts/core';
5
+ import { C as ChatStreamGraph, o as ToolRegistryGraph, q as ToolResult, d as MemoryTiersBundle, h as MemoryWithTiersGraph, m as RetrievalQuery, R as RetrievalEntry, e as MemoryTiersOptions } from './memory-composers-BryDrRBX.cjs';
6
+ import { D as DistillBundle, E as Extraction } from './distill-De6Rnn15.cjs';
7
+ import { VectorIndexGraph, KnowledgeGraph } from './utils/memory/index.cjs';
8
+
9
+ /**
10
+ * Reactive agent loop — autonomous multi-turn LLM agent with tool execution.
11
+ */
12
+ type AgentLoopStatus = "idle" | "thinking" | "acting" | "done" | "error";
13
+
14
+ type AgentLoopOptions = {
15
+ graph?: GraphOptions;
16
+ adapter: LLMAdapter;
17
+ tools?: readonly ToolDefinition[];
18
+ systemPrompt?: string;
19
+ maxTurns?: number;
20
+ stopWhen?: (response: LLMResponse) => boolean;
21
+ onToolCall?: (call: ToolCall) => void;
22
+ maxMessages?: number;
23
+ model?: string;
24
+ temperature?: number;
25
+ maxTokens?: number;
26
+ /**
27
+ * Reactive tool-call splice (COMPOSITION-GUIDE §31 "interception is security").
28
+ * When set, the raw `toolCalls` node is piped through this transform before
29
+ * reaching the executor. The transform is a pure reactive composition —
30
+ * `(calls: Node<readonly ToolCall[]>) => Node<readonly ToolCall[]>` — so the
31
+ * gate is visible in `describe()` / `explain()` as a real edge (no hidden
32
+ * imperative wraps; §24).
33
+ *
34
+ * Typical uses:
35
+ * - **Filter / block** — `derived([calls, policy], ([raw, p]) => raw.filter(p))`
36
+ * - **Throttle / debounce** — `throttle(calls, windowMs)`
37
+ * - **Human-in-the-loop approval** — pipe through a `gate` controller so
38
+ * calls wait for human approval before reaching the executor.
39
+ *
40
+ * The public `agent.toolCalls` node surfaces the POST-intercept stream, so
41
+ * audit / telemetry consumers see what the executor actually runs. The raw
42
+ * pre-intercept stream is not exposed — tests that need it should run
43
+ * without `interceptToolCalls` set (the identity case).
44
+ */
45
+ interceptToolCalls?: (calls: Node<readonly ToolCall[]>) => Node<readonly ToolCall[]>;
46
+ };
47
+ /**
48
+ * Reactive agent loop.
49
+ *
50
+ * The loop is a reactive state machine wired entirely from graph primitives:
51
+ * `chat.messages` + `tools.schemas` + gating state feed a `promptInput`
52
+ * derived; `switchMap` turns non-null inputs into an LLM invocation via
53
+ * `fromAny(adapter.invoke(...))`. The LLM response drives chat writes and
54
+ * status transitions via effects. Tool calls flow through a reactive
55
+ * executor (`retrySource` + `rescue`) that retries once on error and
56
+ * surfaces terminal errors as JSON-shaped `ToolResult` payloads for the
57
+ * LLM to react to.
58
+ *
59
+ * **No imperative control flow inside the reactive layer** (spec §5.8-5.12):
60
+ * no `while` loops, no manual `await adapter.invoke`, no polling.
61
+ * `agent.run()` is a thin `awaitSettled` bridge so callers can still `await`
62
+ * the loop if they want a Promise.
63
+ *
64
+ * Public surface:
65
+ * - `chat` / `tools` — subgraphs (imperative `append` at boundary, reactive `executeReactive` for tool invocation)
66
+ * - `status` / `turn` / `aborted` — state nodes with explicit initials
67
+ * - `lastResponse` / `toolCalls` / `toolResults` — reactive outputs (SENTINEL until first emission; callers use `awaitSettled` / `subscribe`)
68
+ * - `run(userMessage?, signal?)` — optional user append + Promise bridge
69
+ * - `abort()` — imperative abort shim; flips `aborted` state
70
+ *
71
+ * **Lifecycle: single-mount.** `AgentLoopGraph` instances expect to be
72
+ * constructed once and used until `destroy()`. The internal closure mirrors
73
+ * (`latestTurn` / `latestAborted` / `latestStatus`) are wired by
74
+ * subscribe-and-capture at construction time; their `addDisposer`-registered
75
+ * subscriptions are torn down on subgraph unmount or `destroy()`. After
76
+ * teardown the mirrors freeze at their last value, so re-using a destroyed
77
+ * instance — calling `run()` again, or remounting under a new parent —
78
+ * would silently feed stale mirror data into reactive fn bodies. If you
79
+ * need to "reset" an agent, build a fresh `AgentLoopGraph` instance instead
80
+ * of recycling.
81
+ */
82
+ declare class AgentLoopGraph extends Graph {
83
+ readonly chat: ChatStreamGraph;
84
+ readonly tools: ToolRegistryGraph;
85
+ /** Current agent status. `initial: "idle"` — always has a real value. */
86
+ readonly status: Node<AgentLoopStatus>;
87
+ /** Turn count (completed LLM invocations this run). `initial: 0`. */
88
+ readonly turn: Node<number>;
89
+ /** Aborted flag; flipped by `abort()` or external `AbortSignal`. `initial: false`. */
90
+ readonly aborted: Node<boolean>;
91
+ /**
92
+ * Most recent LLM response. State-backed mirror driven by the response
93
+ * effect. **Stays SENTINEL** (`cache === undefined`, no DATA emitted)
94
+ * until the first real response — bridge subscribers see no spurious
95
+ * push-on-subscribe DATA. After a real response, holds the latest
96
+ * `LLMResponse`. Reset between `run()` calls via `[[INVALIDATE]]` (clears
97
+ * cache back to SENTINEL) so a second run with a pre-aborted signal
98
+ * cannot leak the prior run's response. Bridge with
99
+ * `awaitSettled(lastResponse)` for the first DATA as a Promise; consumers
100
+ * inside reactive fns gate on `ctx.prevData[i] === undefined`.
101
+ */
102
+ readonly lastResponse: Node<LLMResponse>;
103
+ /** Tool-call batch emitted by the most recent LLM response. SENTINEL. */
104
+ readonly toolCalls: Node<readonly ToolCall[]>;
105
+ /** Tool-result batch (one entry per call) after reactive execution. SENTINEL. */
106
+ readonly toolResults: Node<readonly ToolResult[]>;
107
+ private readonly _terminalResult;
108
+ private readonly _disposeRunWiring;
109
+ /** Guards against overlapping `run()` calls. */
110
+ private _running;
111
+ /**
112
+ * Abort controller for the currently-running `adapter.invoke`. Minted per
113
+ * switchMap project; aborted when the reactive `aborted` node flips true
114
+ * OR when the caller's external `AbortSignal` fires. Threaded into
115
+ * `adapter.invoke({ signal })` AND `fromAny(promise, { signal })`, so the
116
+ * reactive layer sees ERROR when the wire call is cancelled.
117
+ */
118
+ private _currentAbortController;
119
+ constructor(name: string, opts: AgentLoopOptions);
120
+ /**
121
+ * Bridge to `Promise<LLMResponse>` over the reactive pipeline.
122
+ *
123
+ * - If `userMessage` is provided, appends it as a user message and
124
+ * transitions status to `"thinking"` to kick the loop.
125
+ * - If `signal` is provided, binds it to the reactive `aborted` node
126
+ * AND threads into `adapter.invoke({ signal })` so the wire call can
127
+ * cancel mid-flight. The reactive `aborted` state + effect 3 guarantee
128
+ * that even an adapter that ignores `signal` will stop emitting into
129
+ * the agent graph.
130
+ * - Resolves when `status === "done"` with the final LLM response.
131
+ * Rejects with `AbortError` when the abort signal fires pre-response.
132
+ * Rejects with the stage error when `status === "error"`.
133
+ *
134
+ * **Concurrency:** `run()` refuses to overlap with a pending call on the
135
+ * same agent. Attempting to call `run()` while a previous `run()` is
136
+ * still in-flight throws a `RangeError` immediately. Stale-resolution
137
+ * safety is provided by `awaitSettled({skipCurrent: true})`, which
138
+ * ignores the cached initial DATA from any previous run and resolves
139
+ * only on a fresh post-subscribe emission of `_terminalResult`.
140
+ */
141
+ run(userMessage?: string, signal?: AbortSignal): Promise<LLMResponse | null>;
142
+ /**
143
+ * Flip the reactive `aborted` state. Equivalent to setting an external
144
+ * `AbortSignal` — the pipeline observes and transitions to `"done"`.
145
+ */
146
+ abort(): void;
147
+ destroy(): void;
148
+ }
149
+ declare function agentLoop(name: string, opts: AgentLoopOptions): AgentLoopGraph;
150
+
151
+ type AgentMemoryOptions<TMem = unknown> = {
152
+ graph?: GraphOptions;
153
+ /** LLM adapter for extraction and consolidation. */
154
+ adapter?: LLMAdapter;
155
+ /** System prompt for the extractor LLM. */
156
+ extractPrompt?: string;
157
+ /** Custom extractFn (overrides adapter + extractPrompt). */
158
+ extractFn?: (raw: unknown, existing: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
159
+ /** System prompt for the consolidation LLM. */
160
+ consolidatePrompt?: string;
161
+ /** Custom consolidateFn (overrides adapter + consolidatePrompt). */
162
+ consolidateFn?: (entries: ReadonlyMap<string, TMem>) => NodeInput<Extraction<TMem>>;
163
+ /** Reactive trigger for consolidation (caller supplies e.g. `fromTimer`). */
164
+ consolidateTrigger?: NodeInput<unknown>;
165
+ /** Score function for budget packing (required). */
166
+ score: (mem: TMem, context: unknown) => number;
167
+ /** Cost function for budget packing (required). */
168
+ cost: (mem: TMem) => number;
169
+ /** Token budget for compact view (default 2000). */
170
+ budget?: number;
171
+ /** Context node for scoring. */
172
+ context?: NodeInput<unknown>;
173
+ /** Admission filter (default: admit all). */
174
+ admissionFilter?: (candidate: unknown) => boolean;
175
+ /** Vector index dimensions (> 0 enables vector index for retrieval). */
176
+ vectorDimensions?: number;
177
+ /**
178
+ * B12: optional accessor for an entry's hierarchical context breadcrumb
179
+ * (e.g. `["projects", "auth", "tokens"]`). When supplied alongside
180
+ * `contextWeight > 0`, retrieval applies a score boost for entries whose
181
+ * context shares a prefix with the query's `context`. Entries without
182
+ * a breadcrumb are scored flatly.
183
+ */
184
+ contextOf?: (mem: TMem) => readonly string[] | undefined;
185
+ /**
186
+ * B12: hierarchical context boost multiplier. Score is scaled by
187
+ * `(1 + contextWeight * sharedDepth / queryDepth)` when both the query
188
+ * and entry supply a `context`. Default: 0.
189
+ */
190
+ contextWeight?: number;
191
+ /** Extract embedding vector from a memory entry (enables vector index). */
192
+ embedFn?: (mem: TMem) => readonly number[] | undefined;
193
+ /** Enable knowledge graph for entity/relation tracking. */
194
+ enableKnowledgeGraph?: boolean;
195
+ /** Extract entities and relations from a memory entry. */
196
+ entityFn?: (key: string, mem: TMem) => {
197
+ entities?: Array<{
198
+ id: string;
199
+ value: unknown;
200
+ }>;
201
+ relations?: Array<{
202
+ from: string;
203
+ to: string;
204
+ relation: string;
205
+ weight?: number;
206
+ }>;
207
+ } | undefined;
208
+ /** 3-tier storage configuration. Omit to use single-tier (existing behavior). */
209
+ tiers?: MemoryTiersOptions<TMem>;
210
+ /** Retrieval pipeline configuration. Requires vector index or knowledge graph. */
211
+ retrieval?: {
212
+ /** Max candidates from vector search (default 20). */
213
+ topK?: number;
214
+ /** KG expansion depth in hops (default 1). */
215
+ graphDepth?: number;
216
+ };
217
+ /** Periodic reflection/consolidation configuration. */
218
+ reflection?: {
219
+ /** Interval in ms between consolidation runs (default 300_000 = 5 min). */
220
+ interval?: number;
221
+ /** Enable/disable periodic reflection (default true when consolidateFn is available). */
222
+ enabled?: boolean;
223
+ };
224
+ };
225
+ /**
226
+ * Pre-wired agentic memory graph. Sugar over `distill` plus the
227
+ * `memoryWithVectors` / `memoryWithKG` / `memoryWithTiers` / `memoryRetrieval`
228
+ * composers. Power users who want a subset of capabilities can call those
229
+ * composers directly; this class bundles them into one ergonomic Graph subclass.
230
+ *
231
+ * Mounts:
232
+ * - `tiers/*` — present when `opts.tiers` configured (replaces the
233
+ * default distill bundle).
234
+ * - `vectors/*` — present when `opts.vectorDimensions > 0 && opts.embedFn`.
235
+ * - `knowledge/*` — present when `opts.enableKnowledgeGraph`.
236
+ * - `retrieval/*` — present when vectors or kg configured.
237
+ *
238
+ * When `opts.tiers` is omitted, `store` / `compact` / `size` are added as
239
+ * top-level nodes on this graph (visible in `describe()` / `explain()`).
240
+ */
241
+ declare class AgentMemoryGraph<TMem = unknown> extends Graph {
242
+ readonly distillBundle: DistillBundle<TMem>;
243
+ readonly compact: Node<Array<{
244
+ key: string;
245
+ value: TMem;
246
+ score: number;
247
+ }>>;
248
+ readonly size: Node<number>;
249
+ /** Vector index bundle (null if not enabled). */
250
+ readonly vectors: VectorIndexGraph<TMem> | null;
251
+ /** Knowledge graph (null if not enabled). */
252
+ readonly kg: KnowledgeGraph<unknown, string> | null;
253
+ /** Memory tiers bundle (null if not configured). */
254
+ readonly memoryTiers: MemoryTiersBundle<TMem> | null;
255
+ /**
256
+ * The mounted `MemoryWithTiersGraph` subgraph (null when `opts.tiers` was
257
+ * omitted). Surfaces the inner graph for `describe()` / `explain()` walks
258
+ * and for callers that need direct access to the tiers subgraph (e.g.
259
+ * to register additional disposers or attach storage). Companion to
260
+ * `memoryTiers`, which carries only the bundle's reactive surface (B5e).
261
+ */
262
+ readonly tiers: MemoryWithTiersGraph<unknown, TMem> | null;
263
+ /**
264
+ * Reactive consumer API. Given a reactive `RetrievalQuery | null` source,
265
+ * returns a `Node` emitting the packed retrieval results. Composable with
266
+ * graph topology — subscribe it, chain it into `promptNode`, or switchMap
267
+ * over a user-input node.
268
+ *
269
+ * Each call mounts its own per-input subgraph at
270
+ * `retrieval::retrieve_${id}` (via `MemoryRetrievalGraph`); concurrent
271
+ * calls don't share state mirrors. One-shot consumers wrap with
272
+ * `awaitSettled(retrieveReactive(query))`.
273
+ *
274
+ * Null when no retrieval pipeline is configured.
275
+ *
276
+ * **QA F-9 (2026-04-30):** the prior `retrieval` / `retrievalTrace`
277
+ * shared state-node mirrors have been dropped. Use `retrieveReactive`
278
+ * for per-call reactive results; one-shot trace consumers should
279
+ * subscribe to the projection's upstream `result` derived directly
280
+ * via `view.target.resolve("retrieval::retrieve_${id}::result")`.
281
+ */
282
+ readonly retrieveReactive: ((queryInput: NodeInput<RetrievalQuery | null>) => Node<ReadonlyArray<RetrievalEntry<TMem>>>) | null;
283
+ constructor(name: string, source: NodeInput<unknown>, opts: AgentMemoryOptions<TMem>);
284
+ }
285
+ /**
286
+ * Pre-wired agentic memory graph. Sugar over `distill` plus the
287
+ * `memoryWithVectors` / `memoryWithKG` / `memoryWithTiers` / `memoryRetrieval`
288
+ * composers. Power users who want a subset of capabilities can call those
289
+ * composers directly; this factory bundles them into one ergonomic call.
290
+ *
291
+ * Returns an {@link AgentMemoryGraph} subclass instance — `instanceof
292
+ * AgentMemoryGraph` narrows in callers (e.g. Phase 13.G `agent(spec)`).
293
+ */
294
+ declare function agentMemory<TMem = unknown>(name: string, source: NodeInput<unknown>, opts: AgentMemoryOptions<TMem>): AgentMemoryGraph<TMem>;
295
+
296
+ /**
297
+ * Phase 13.G — `AgentBundle<TIn, TOut>` interface + `class AgentGraph extends Graph`.
298
+ *
299
+ * Source: `archive/docs/SESSION-multi-agent-gap-analysis.md` G1 lock B.
300
+ *
301
+ * Composes the existing substrate (`agentLoop`, `toolRegistry`,
302
+ * `agentMemory`) into a typed inbox/outbox subgraph that other parts of a
303
+ * multi-agent system can wire to. Sibling preset `agent()` (in
304
+ * `./agents.ts`) is the ergonomic factory; this file is the contract.
305
+ *
306
+ * **Cross-cut #1 lock (no `agent.run()`):** caller-side runtime entry is
307
+ * `bundle.in.emit(input)` + `awaitSettled(bundle.out)`. The legacy
308
+ * `agentLoop.run()` is still available on `bundle.graph.loop` for
309
+ * single-shot Promise-bridge use cases, but `agent()` does NOT expose a
310
+ * `run()` method on the bundle.
311
+ *
312
+ * **Memory partition default:** private memory per agent (each `agent(...)`
313
+ * call creates its own `AgentMemoryGraph` if none passed). Pass an explicit
314
+ * shared instance for §29 handoff context-transfer.
315
+ */
316
+
317
+ /**
318
+ * Lifecycle status of an {@link AgentGraph}.
319
+ *
320
+ * - `idle` — no input has been received since construction or last reset.
321
+ * - `running` — inputs are flowing through the underlying agentLoop
322
+ * (collapses the loop's `thinking` + `acting` substates so consumers
323
+ * don't have to model the tool-call inner loop).
324
+ * - `verifying` — verifier subgraph is in flight (reserved; lights up when
325
+ * the verifier slot is added in a future wave per G7 recipe).
326
+ * - `done` — the most recent input has settled with a verified response.
327
+ * - `error` — the loop or verifier produced a terminal error.
328
+ *
329
+ * **Note (Phase 13.G, 2026-05-01):** v1 of `agent()` has no built-in
330
+ * verifier slot — `verifying` is reserved but never produced. When a
331
+ * verifier consumer surfaces, this enum widens (non-breaking type
332
+ * widening; existing consumers see the same `idle | running | done | error`
333
+ * subset).
334
+ */
335
+ type AgentStatus = "idle" | "running" | "verifying" | "done" | "error";
336
+ /**
337
+ * Aggregated cost for an agent's run, surfaced as a `Node<CostState>` on
338
+ * the bundle. **Wraps the canonical {@link TokenUsage}** so consumers get
339
+ * the full provider-disaggregated token classes (cache-read /
340
+ * cache-write-5m / cache-write-1h / audio / image / video / tool-use /
341
+ * reasoning / prediction-accepted / prediction-rejected / extensions /
342
+ * auxiliary non-token costs / raw escape-hatch) without losing fidelity
343
+ * for downstream pricing. USD conversion is a downstream `derived` over
344
+ * `usage`.
345
+ *
346
+ * - `usage` — accumulated {@link TokenUsage} across all turns of the
347
+ * current input.
348
+ * - `turns` — number of completed agentLoop iterations (LLM invocations).
349
+ *
350
+ * **Counter scope:** resets to {@link ZERO_COST} on each new `bundle.in`
351
+ * emit (per-input cost rather than per-agent-lifetime). Sum across multiple
352
+ * inputs by snapshotting `cost` at `done` and accumulating externally —
353
+ * a per-lifetime cost is a downstream `scan` over this.
354
+ *
355
+ * **Helpers.** Use `sumInputTokens(usage)` / `sumOutputTokens(usage)` from
356
+ * `@graphrefly/graphrefly-ts` to flatten to scalars when the caller wants
357
+ * a single number.
358
+ */
359
+ interface CostState {
360
+ readonly usage: TokenUsage;
361
+ readonly turns: number;
362
+ }
363
+ /** Empty cost. Used as the initial value and the per-input reset baseline. */
364
+ declare const ZERO_COST: CostState;
365
+ /**
366
+ * Accumulates two {@link TokenUsage} snapshots. All field classes are
367
+ * summed; optional fields propagate as `undefined` when absent from both
368
+ * sides, otherwise treated as 0 for the missing side. `auxiliary` and
369
+ * `extensions` merge by key. `raw` is dropped — it's a per-call escape
370
+ * hatch, not summable.
371
+ *
372
+ * @category extra
373
+ */
374
+ declare function addUsage(a: TokenUsage, b: TokenUsage): TokenUsage;
375
+ /**
376
+ * Spec for {@link agent} (in `./agents.ts`). Required fields are minimal —
377
+ * `name` and `adapter` cover the common case where the input is a string
378
+ * and the output is the raw `LLMResponse`. Optional fields shape the
379
+ * agent's behavior:
380
+ *
381
+ * - **Mappers** (`inMapper` / `outMapper`) translate between caller-typed
382
+ * `TIn` / `TOut` and the loop's internal `string` / `LLMResponse`. Default
383
+ * identity mappers are wired automatically when `TIn` extends `string`
384
+ * and `TOut` extends `LLMResponse`.
385
+ * - **`tools`** is a reactive `NodeInput<readonly ToolDefinition[]>` —
386
+ * `agent()` subscribes and reconciles the underlying `toolRegistry`'s
387
+ * registrations on each emit. Static-array form is also accepted.
388
+ * - **`memory`** is an explicit `AgentMemoryGraph` instance for shared
389
+ * memory across agents (§29 handoff context transfer). Default: private
390
+ * memory per agent (each `agent()` call mints its own).
391
+ * - **`maxIterations`** caps the underlying agentLoop's tool-call inner
392
+ * loop. Default 10 (matches `agentLoop`).
393
+ * - **Verifier slot** is intentionally not in v1 — G7 reframe locks it as
394
+ * a caller-composed recipe. When a real consumer surfaces, a
395
+ * `verifier?: (out: Node<TOut>) => NodeInput<VerifierResult>` field
396
+ * lands here additively.
397
+ */
398
+ interface AgentSpec<TIn, TOut> {
399
+ /** Local mount name when wired to a parent graph. Required. */
400
+ readonly name: string;
401
+ /** LLM adapter for the underlying agentLoop. Required. */
402
+ readonly adapter: LLMAdapter;
403
+ /** Optional system prompt. Static today; reactive widening pending. */
404
+ readonly systemPrompt?: string;
405
+ /**
406
+ * Optional reactive tool list. When a Node, the agent subscribes and
407
+ * reconciles the underlying `toolRegistry` registrations on each emit
408
+ * (additions registered, removals unregistered). When a static array,
409
+ * tools are registered once at construction.
410
+ */
411
+ readonly tools?: Node<readonly ToolDefinition[]> | readonly ToolDefinition[];
412
+ /**
413
+ * Optional shared memory. Default: private (agent mints its own
414
+ * `AgentMemoryGraph` if needed; not yet wired into the loop's chat —
415
+ * that wiring is a separate follow-up). Pass an explicit instance to
416
+ * share memory across agents for §29 handoff context transfer.
417
+ */
418
+ readonly memory?: AgentMemoryGraph<unknown>;
419
+ /**
420
+ * Maps caller-typed input → string for the underlying chat. Defaults to
421
+ * identity when `TIn extends string`; required otherwise.
422
+ */
423
+ readonly inMapper?: (input: TIn) => string;
424
+ /**
425
+ * Maps the agentLoop's `LLMResponse` → caller-typed output. Defaults to
426
+ * identity when `TOut extends LLMResponse`; required otherwise.
427
+ */
428
+ readonly outMapper?: (response: LLMResponse) => TOut;
429
+ /** Caps tool-call inner-loop iterations. Default 10. */
430
+ readonly maxIterations?: number;
431
+ /** Escape hatch for non-core fields. Surfaced in `describe()` via meta. */
432
+ readonly meta?: Record<string, unknown>;
433
+ }
434
+ /**
435
+ * Public contract for an agent — typed inbox/outbox + lifecycle / cost
436
+ * observables + the underlying graph for inspection / mounting.
437
+ *
438
+ * **Reactive entry:** caller writes to `in` (e.g. `bundle.in.emit(input)`).
439
+ * The agent reactively kicks the underlying loop and produces `out`.
440
+ *
441
+ * **Reactive exit:** caller reads `out` via `subscribe` (continuous) or
442
+ * `awaitSettled(out)` (single-shot). Both `in` and `out` stay SENTINEL
443
+ * (`cache === undefined`) until the first real emission — no `null`
444
+ * push-on-subscribe trap (per `feedback_use_prevdata_for_sentinel`).
445
+ *
446
+ * **Cross-graph wiring:** the bundle's `graph` is mountable under any
447
+ * parent via `parent.mount(name, bundle.graph)`. After mount, the bundle's
448
+ * Nodes are reachable through both the bundle reference (direct) and via
449
+ * `parent.node("<name>::out")` etc. (qualified path).
450
+ */
451
+ interface AgentBundle<TIn, TOut> {
452
+ readonly in: Node<TIn>;
453
+ readonly out: Node<TOut>;
454
+ readonly status: Node<AgentStatus>;
455
+ readonly cost: Node<CostState>;
456
+ readonly graph: AgentGraph<TIn, TOut>;
457
+ }
458
+ /**
459
+ * Graph subclass implementing {@link AgentBundle}. Mounts an inner
460
+ * {@link AgentLoopGraph} at `loop/`; `in` / `out` / `status` / `cost`
461
+ * surface the bundle contract as top-level nodes.
462
+ *
463
+ * Construction is internal — use the {@link agent} factory in
464
+ * `./agents.ts` for normal use. Direct `new AgentGraph(name, spec)` is
465
+ * supported for callers that want full control over mount order.
466
+ *
467
+ * **Topology:**
468
+ * ```
469
+ * <name>
470
+ * ├── loop (AgentLoopGraph subgraph)
471
+ * │ ├── chat
472
+ * │ ├── tools
473
+ * │ ├── status / turn / aborted / lastResponse / ...
474
+ * ├── in (Node<TIn>, SENTINEL until first emit)
475
+ * ├── out (Node<TOut>, SENTINEL until first response)
476
+ * ├── status (Node<AgentStatus>, mirror of loop.status)
477
+ * └── cost (Node<CostState>)
478
+ * ```
479
+ *
480
+ * **Lifecycle:**
481
+ * - On `in` emit: `inMapper` projects to `string`; appended to
482
+ * `loop.chat`; loop status reset (`turn=0`, `aborted=false`,
483
+ * `status="thinking"`); per-input cost counters reset to zero.
484
+ * - On `loop.lastResponse` emit: cost rolls forward; `out` emits
485
+ * `outMapper(response)`.
486
+ * - On `loop.status="done"`: agent's status emits `"done"`.
487
+ * - On `loop.status="error"` (or any ERROR propagation): agent's status
488
+ * emits `"error"`.
489
+ */
490
+ declare class AgentGraph<TIn, TOut> extends Graph {
491
+ /** The agent's typed inbox. Writable; `in.emit(value)` kicks the loop. */
492
+ readonly in: Node<TIn>;
493
+ /** The agent's typed outbox. SENTINEL until first response. */
494
+ readonly out: Node<TOut>;
495
+ /** Lifecycle status (translated from the underlying loop's substates). */
496
+ readonly status: Node<AgentStatus>;
497
+ /** Cumulative cost for the current / most-recent input. */
498
+ readonly cost: Node<CostState>;
499
+ /** The underlying agentLoop — exposed for inspection / advanced wiring. */
500
+ readonly loop: AgentLoopGraph;
501
+ /** Optional shared memory subgraph (mounted at `memory/` if provided). */
502
+ readonly memory: AgentMemoryGraph<unknown> | null;
503
+ constructor(spec: AgentSpec<TIn, TOut>, opts?: GraphOptions);
504
+ }
505
+
506
+ /**
507
+ * Phase 13.H — `agent(spec)` preset + `presetRegistry` sugar.
508
+ *
509
+ * Source: `archive/docs/SESSION-multi-agent-gap-analysis.md` G1 + G2.
510
+ *
511
+ * `agent()` is the ergonomic factory — given a parent Graph and an
512
+ * `AgentSpec`, mints an `AgentGraph`, mounts it under the parent at
513
+ * `spec.name`, and returns the `AgentBundle` contract.
514
+ *
515
+ * `presetRegistry()` is thin sugar over `reactiveMap` — a typed reactive
516
+ * map of `<id, preset>`. Pairs with `materialize` (Phase 13.C) for
517
+ * dynamic preset selection: callers store specs / factories / configs in
518
+ * the registry and `materialize` mounts the matching one based on a
519
+ * routing key.
520
+ *
521
+ * **Cross-cut #1 lock:** no `agent.run()` imperative sugar — caller-side
522
+ * runtime is `bundle.in.emit(input)` + `awaitSettled(bundle.out)`.
523
+ */
524
+
525
+ /**
526
+ * Mints an {@link AgentGraph} from `spec`, mounts it under `parent` at
527
+ * `spec.name`, and returns the {@link AgentBundle} contract.
528
+ *
529
+ * **Default type parameters.** When called without explicit type params,
530
+ * `TIn` defaults to `string` and `TOut` to `LLMResponse` — the common
531
+ * case where the caller writes a user message and reads the raw response.
532
+ * Custom types require both `inMapper` and `outMapper` in the spec; the
533
+ * default mappers throw at runtime if `TIn` / `TOut` aren't string /
534
+ * LLMResponse.
535
+ *
536
+ * **Memory partition default.** Each `agent()` call mints its own
537
+ * `AgentMemoryGraph` if `spec.memory` is omitted (private memory; the
538
+ * common case). Pass an explicit shared instance — e.g.
539
+ * `agent(parent, { ..., memory: sharedMemory })` for two agents — to
540
+ * implement §29 handoff context transfer.
541
+ *
542
+ * **Reactive entry / exit:**
543
+ * - `bundle.in.emit(input)` kicks the loop reactively (no imperative
544
+ * `.run()` per cross-cut #1 lock).
545
+ * - `awaitSettled(bundle.out, { skipCurrent: true })` resolves on the
546
+ * first response after the kick. `skipCurrent` matters for the second
547
+ * call onward — `out` caches the prior response.
548
+ *
549
+ * **Mounting.** The factory mounts under `parent.mount(spec.name, ...)`.
550
+ * The slot name must be free on `parent` at construction time. To keep
551
+ * the agent unmounted, construct `new AgentGraph(spec)` directly.
552
+ *
553
+ * @example
554
+ * ```ts
555
+ * import { agent, awaitSettled, Graph } from "@graphrefly/graphrefly-ts";
556
+ *
557
+ * const parent = new Graph("parent");
558
+ * const a = agent(parent, {
559
+ * name: "researcher",
560
+ * adapter: openaiAdapter,
561
+ * systemPrompt: "Research the user's question carefully.",
562
+ * });
563
+ * a.in.emit("What's the capital of France?");
564
+ * const resp = await awaitSettled(a.out, { skipCurrent: true });
565
+ * ```
566
+ *
567
+ * @category patterns
568
+ */
569
+ declare function agent<TIn = string, TOut = LLMResponse>(parent: Graph, spec: AgentSpec<TIn, TOut>): AgentBundle<TIn, TOut>;
570
+ /**
571
+ * The bundle returned by {@link presetRegistry}. Wraps a `reactiveMap`
572
+ * with imperative `put` / `remove` shortcuts and exposes the underlying
573
+ * `registry` for direct reactive consumption (`.entries` is a
574
+ * `Node<ReadonlyMap<string, TPreset>>`).
575
+ *
576
+ * Use the `registry.entries` Node directly with {@link materialize} (Phase
577
+ * 13.C) — pass it as the `factories` argument when `TPreset` is itself
578
+ * a `() => Graph` factory thunk, or transform via `derived` when
579
+ * `TPreset` is a richer spec type that needs a `spec → factory` adapter.
580
+ */
581
+ interface PresetRegistryBundle<TPreset> {
582
+ /**
583
+ * The underlying reactive map. `registry.entries` is the
584
+ * `Node<ReadonlyMap<string, TPreset>>` — pass directly to
585
+ * {@link materialize} when preset shape matches the factories arg.
586
+ */
587
+ readonly registry: ReactiveMapBundle<string, TPreset>;
588
+ /** Imperative add / replace. Always emits a fresh snapshot. */
589
+ put(id: string, preset: TPreset): void;
590
+ /** Imperative remove. Returns `true` if the id was present. */
591
+ remove(id: string): boolean;
592
+ }
593
+ /**
594
+ * Thin sugar over `reactiveMap` — a typed registry of `<id, preset>` for
595
+ * agent / strategy / persona / skill catalogs.
596
+ *
597
+ * **Generic over preset shape.** `TPreset` is open — could be an
598
+ * {@link AgentSpec}, a `() => Graph` factory thunk, a static config
599
+ * object, or anything else. Decoupled from `agent()` so the same primitive
600
+ * powers harnessLoop strategy registries, pipelineGraph stage catalogs,
601
+ * etc.
602
+ *
603
+ * **Composes with `materialize`.** When `TPreset` is a `() => Graph`
604
+ * factory, pass `registry.entries` directly to
605
+ * {@link materialize} as the `factories` argument. When `TPreset` is a
606
+ * spec, transform via `derived` to build a `Map<id, () => Graph>` adapter:
607
+ *
608
+ * ```ts
609
+ * const presets = presetRegistry<AgentSpec<string, LLMResponse>>();
610
+ * presets.put("researcher", { name: "researcher", adapter, systemPrompt: "..." });
611
+ *
612
+ * // Adapter: spec → factory.
613
+ * const factories = derived(
614
+ * [presets.registry.entries],
615
+ * ([m]) => new Map(
616
+ * [...m].map(([id, spec]) => [id, () => new AgentGraph(spec)]),
617
+ * ),
618
+ * );
619
+ * const slot = materialize(activeKey, factories, parent);
620
+ * ```
621
+ *
622
+ * @param initial - Optional initial entries.
623
+ * @returns {@link PresetRegistryBundle}.
624
+ *
625
+ * @category patterns
626
+ */
627
+ declare function presetRegistry<TPreset>(initial?: ReadonlyMap<string, TPreset>): PresetRegistryBundle<TPreset>;
628
+
629
+ export { type AgentBundle as A, type CostState as C, type PresetRegistryBundle as P, ZERO_COST as Z, AgentGraph as a, AgentLoopGraph as b, type AgentLoopOptions as c, type AgentLoopStatus as d, AgentMemoryGraph as e, type AgentMemoryOptions as f, type AgentSpec as g, type AgentStatus as h, addUsage as i, agent as j, agentLoop as k, agentMemory as l, presetRegistry as p };