@graphrefly/graphrefly 0.43.0 → 0.45.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 (422) hide show
  1. package/README.md +21 -17
  2. package/dist/compat/index.cjs +20 -10
  3. package/dist/compat/index.cjs.map +1 -0
  4. package/dist/compat/index.d.cts +1 -22
  5. package/dist/compat/index.d.ts +1 -22
  6. package/dist/compat/index.js +3 -1
  7. package/dist/compat/index.js.map +1 -0
  8. package/dist/compat/jotai/index.cjs +21 -1
  9. package/dist/compat/jotai/index.cjs.map +1 -0
  10. package/dist/compat/jotai/index.d.cts +1 -2
  11. package/dist/compat/jotai/index.d.ts +1 -2
  12. package/dist/compat/jotai/index.js +3 -1
  13. package/dist/compat/jotai/index.js.map +1 -0
  14. package/dist/compat/nanostores/index.cjs +21 -1
  15. package/dist/compat/nanostores/index.cjs.map +1 -0
  16. package/dist/compat/nanostores/index.d.cts +1 -2
  17. package/dist/compat/nanostores/index.d.ts +1 -2
  18. package/dist/compat/nanostores/index.js +3 -1
  19. package/dist/compat/nanostores/index.js.map +1 -0
  20. package/dist/compat/nestjs/index.cjs +20 -10
  21. package/dist/compat/nestjs/index.cjs.map +1 -0
  22. package/dist/compat/nestjs/index.d.cts +1 -13
  23. package/dist/compat/nestjs/index.d.ts +1 -13
  24. package/dist/compat/nestjs/index.js +3 -1
  25. package/dist/compat/nestjs/index.js.map +1 -0
  26. package/dist/compat/react/index.cjs +21 -1
  27. package/dist/compat/react/index.cjs.map +1 -0
  28. package/dist/compat/react/index.d.cts +1 -2
  29. package/dist/compat/react/index.d.ts +1 -2
  30. package/dist/compat/react/index.js +3 -1
  31. package/dist/compat/react/index.js.map +1 -0
  32. package/dist/compat/solid/index.cjs +21 -1
  33. package/dist/compat/solid/index.cjs.map +1 -0
  34. package/dist/compat/solid/index.d.cts +1 -2
  35. package/dist/compat/solid/index.d.ts +1 -2
  36. package/dist/compat/solid/index.js +3 -1
  37. package/dist/compat/solid/index.js.map +1 -0
  38. package/dist/compat/svelte/index.cjs +21 -1
  39. package/dist/compat/svelte/index.cjs.map +1 -0
  40. package/dist/compat/svelte/index.d.cts +1 -2
  41. package/dist/compat/svelte/index.d.ts +1 -2
  42. package/dist/compat/svelte/index.js +3 -1
  43. package/dist/compat/svelte/index.js.map +1 -0
  44. package/dist/compat/vue/index.cjs +21 -1
  45. package/dist/compat/vue/index.cjs.map +1 -0
  46. package/dist/compat/vue/index.d.cts +1 -3
  47. package/dist/compat/vue/index.d.ts +1 -3
  48. package/dist/compat/vue/index.js +3 -1
  49. package/dist/compat/vue/index.js.map +1 -0
  50. package/dist/compat/zustand/index.cjs +21 -3
  51. package/dist/compat/zustand/index.cjs.map +1 -0
  52. package/dist/compat/zustand/index.d.cts +1 -6
  53. package/dist/compat/zustand/index.d.ts +1 -6
  54. package/dist/compat/zustand/index.js +3 -1
  55. package/dist/compat/zustand/index.js.map +1 -0
  56. package/dist/core/index.cjs +21 -1
  57. package/dist/core/index.cjs.map +1 -0
  58. package/dist/core/index.d.cts +1 -4
  59. package/dist/core/index.d.ts +1 -4
  60. package/dist/core/index.js +3 -1
  61. package/dist/core/index.js.map +1 -0
  62. package/dist/extra/browser.cjs +21 -1
  63. package/dist/extra/browser.cjs.map +1 -0
  64. package/dist/extra/browser.d.cts +1 -4
  65. package/dist/extra/browser.d.ts +1 -4
  66. package/dist/extra/browser.js +3 -1
  67. package/dist/extra/browser.js.map +1 -0
  68. package/dist/extra/index.cjs +20 -19
  69. package/dist/extra/index.cjs.map +1 -0
  70. package/dist/extra/index.d.cts +1 -17
  71. package/dist/extra/index.d.ts +1 -17
  72. package/dist/extra/index.js +3 -1
  73. package/dist/extra/index.js.map +1 -0
  74. package/dist/extra/node.cjs +21 -2
  75. package/dist/extra/node.cjs.map +1 -0
  76. package/dist/extra/node.d.cts +1 -187
  77. package/dist/extra/node.d.ts +1 -187
  78. package/dist/extra/node.js +3 -2
  79. package/dist/extra/node.js.map +1 -0
  80. package/dist/extra/operators.cjs +21 -1
  81. package/dist/extra/operators.cjs.map +1 -0
  82. package/dist/extra/operators.d.cts +1 -950
  83. package/dist/extra/operators.d.ts +1 -950
  84. package/dist/extra/operators.js +3 -1
  85. package/dist/extra/operators.js.map +1 -0
  86. package/dist/extra/reactive.cjs +21 -1
  87. package/dist/extra/reactive.cjs.map +1 -0
  88. package/dist/extra/reactive.d.cts +1 -353
  89. package/dist/extra/reactive.d.ts +1 -353
  90. package/dist/extra/reactive.js +3 -1
  91. package/dist/extra/reactive.js.map +1 -0
  92. package/dist/extra/render/index.cjs +21 -5
  93. package/dist/extra/render/index.cjs.map +1 -0
  94. package/dist/extra/render/index.d.cts +1 -183
  95. package/dist/extra/render/index.d.ts +1 -183
  96. package/dist/extra/render/index.js +3 -1
  97. package/dist/extra/render/index.js.map +1 -0
  98. package/dist/extra/sources.cjs +21 -3
  99. package/dist/extra/sources.cjs.map +1 -0
  100. package/dist/extra/sources.d.cts +1 -584
  101. package/dist/extra/sources.d.ts +1 -584
  102. package/dist/extra/sources.js +3 -1
  103. package/dist/extra/sources.js.map +1 -0
  104. package/dist/extra/storage-browser.cjs +21 -1
  105. package/dist/extra/storage-browser.cjs.map +1 -0
  106. package/dist/extra/storage-browser.d.cts +1 -37
  107. package/dist/extra/storage-browser.d.ts +1 -37
  108. package/dist/extra/storage-browser.js +3 -1
  109. package/dist/extra/storage-browser.js.map +1 -0
  110. package/dist/extra/storage-core.cjs +21 -1
  111. package/dist/extra/storage-core.cjs.map +1 -0
  112. package/dist/extra/storage-core.d.cts +1 -28
  113. package/dist/extra/storage-core.d.ts +1 -28
  114. package/dist/extra/storage-core.js +3 -1
  115. package/dist/extra/storage-core.js.map +1 -0
  116. package/dist/extra/storage-node.cjs +20 -0
  117. package/dist/extra/storage-node.cjs.map +1 -0
  118. package/dist/extra/storage-node.d.cts +1 -2
  119. package/dist/extra/storage-node.d.ts +1 -2
  120. package/dist/extra/storage-node.js +3 -0
  121. package/dist/extra/storage-node.js.map +1 -0
  122. package/dist/extra/storage-tiers-browser.cjs +21 -1
  123. package/dist/extra/storage-tiers-browser.cjs.map +1 -0
  124. package/dist/extra/storage-tiers-browser.d.cts +1 -120
  125. package/dist/extra/storage-tiers-browser.d.ts +1 -120
  126. package/dist/extra/storage-tiers-browser.js +3 -1
  127. package/dist/extra/storage-tiers-browser.js.map +1 -0
  128. package/dist/extra/storage-tiers-node.cjs +21 -1
  129. package/dist/extra/storage-tiers-node.cjs.map +1 -0
  130. package/dist/extra/storage-tiers-node.d.cts +1 -210
  131. package/dist/extra/storage-tiers-node.d.ts +1 -210
  132. package/dist/extra/storage-tiers-node.js +3 -1
  133. package/dist/extra/storage-tiers-node.js.map +1 -0
  134. package/dist/extra/storage-tiers.cjs +21 -1
  135. package/dist/extra/storage-tiers.cjs.map +1 -0
  136. package/dist/extra/storage-tiers.d.cts +1 -412
  137. package/dist/extra/storage-tiers.d.ts +1 -412
  138. package/dist/extra/storage-tiers.js +3 -1
  139. package/dist/extra/storage-tiers.js.map +1 -0
  140. package/dist/extra/storage-wal.cjs +21 -0
  141. package/dist/extra/storage-wal.cjs.map +1 -0
  142. package/dist/extra/storage-wal.d.cts +1 -0
  143. package/dist/extra/storage-wal.d.ts +1 -0
  144. package/dist/extra/storage-wal.js +3 -0
  145. package/dist/extra/storage-wal.js.map +1 -0
  146. package/dist/graph/index.cjs +21 -7
  147. package/dist/graph/index.cjs.map +1 -0
  148. package/dist/graph/index.d.cts +1 -7
  149. package/dist/graph/index.d.ts +1 -7
  150. package/dist/graph/index.js +3 -1
  151. package/dist/graph/index.js.map +1 -0
  152. package/dist/index.cjs +20 -227
  153. package/dist/index.cjs.map +1 -0
  154. package/dist/index.d.cts +45 -96
  155. package/dist/index.d.ts +45 -96
  156. package/dist/index.js +3 -1
  157. package/dist/index.js.map +1 -0
  158. package/dist/patterns/ai/browser.cjs +20 -7
  159. package/dist/patterns/ai/browser.cjs.map +1 -0
  160. package/dist/patterns/ai/browser.d.cts +1 -127
  161. package/dist/patterns/ai/browser.d.ts +1 -127
  162. package/dist/patterns/ai/browser.js +3 -3
  163. package/dist/patterns/ai/browser.js.map +1 -0
  164. package/dist/patterns/ai/index.cjs +20 -73
  165. package/dist/patterns/ai/index.cjs.map +1 -0
  166. package/dist/patterns/ai/index.d.cts +1 -21
  167. package/dist/patterns/ai/index.d.ts +1 -21
  168. package/dist/patterns/ai/index.js +3 -1
  169. package/dist/patterns/ai/index.js.map +1 -0
  170. package/dist/patterns/ai/node.cjs +21 -1
  171. package/dist/patterns/ai/node.cjs.map +1 -0
  172. package/dist/patterns/ai/node.d.cts +1 -59
  173. package/dist/patterns/ai/node.d.ts +1 -59
  174. package/dist/patterns/ai/node.js +3 -1
  175. package/dist/patterns/ai/node.js.map +1 -0
  176. package/dist/patterns/cqrs/index.cjs +21 -3
  177. package/dist/patterns/cqrs/index.cjs.map +1 -0
  178. package/dist/patterns/cqrs/index.d.cts +1 -8
  179. package/dist/patterns/cqrs/index.d.ts +1 -8
  180. package/dist/patterns/cqrs/index.js +3 -1
  181. package/dist/patterns/cqrs/index.js.map +1 -0
  182. package/dist/patterns/demo-shell/index.cjs +21 -5
  183. package/dist/patterns/demo-shell/index.cjs.map +1 -0
  184. package/dist/patterns/demo-shell/index.d.cts +1 -7
  185. package/dist/patterns/demo-shell/index.d.ts +1 -7
  186. package/dist/patterns/demo-shell/index.js +3 -1
  187. package/dist/patterns/demo-shell/index.js.map +1 -0
  188. package/dist/patterns/domain-templates/index.cjs +21 -3
  189. package/dist/patterns/domain-templates/index.cjs.map +1 -0
  190. package/dist/patterns/domain-templates/index.d.cts +1 -6
  191. package/dist/patterns/domain-templates/index.d.ts +1 -6
  192. package/dist/patterns/domain-templates/index.js +3 -1
  193. package/dist/patterns/domain-templates/index.js.map +1 -0
  194. package/dist/patterns/graphspec/index.cjs +21 -86
  195. package/dist/patterns/graphspec/index.cjs.map +1 -0
  196. package/dist/patterns/graphspec/index.d.cts +1 -8
  197. package/dist/patterns/graphspec/index.d.ts +1 -8
  198. package/dist/patterns/graphspec/index.js +3 -1
  199. package/dist/patterns/graphspec/index.js.map +1 -0
  200. package/dist/patterns/harness/index.cjs +21 -48
  201. package/dist/patterns/harness/index.cjs.map +1 -0
  202. package/dist/patterns/harness/index.d.cts +1 -14
  203. package/dist/patterns/harness/index.d.ts +1 -14
  204. package/dist/patterns/harness/index.js +3 -1
  205. package/dist/patterns/harness/index.js.map +1 -0
  206. package/dist/patterns/inspect/index.cjs +21 -3
  207. package/dist/patterns/inspect/index.cjs.map +1 -0
  208. package/dist/patterns/inspect/index.d.cts +1 -9
  209. package/dist/patterns/inspect/index.d.ts +1 -9
  210. package/dist/patterns/inspect/index.js +3 -1
  211. package/dist/patterns/inspect/index.js.map +1 -0
  212. package/dist/patterns/job-queue/index.cjs +21 -3
  213. package/dist/patterns/job-queue/index.cjs.map +1 -0
  214. package/dist/patterns/job-queue/index.d.cts +1 -9
  215. package/dist/patterns/job-queue/index.d.ts +1 -9
  216. package/dist/patterns/job-queue/index.js +3 -1
  217. package/dist/patterns/job-queue/index.js.map +1 -0
  218. package/dist/patterns/memory/index.cjs +21 -3
  219. package/dist/patterns/memory/index.cjs.map +1 -0
  220. package/dist/patterns/memory/index.d.cts +1 -8
  221. package/dist/patterns/memory/index.d.ts +1 -8
  222. package/dist/patterns/memory/index.js +3 -1
  223. package/dist/patterns/memory/index.js.map +1 -0
  224. package/dist/patterns/messaging/index.cjs +21 -3
  225. package/dist/patterns/messaging/index.cjs.map +1 -0
  226. package/dist/patterns/messaging/index.d.cts +1 -7
  227. package/dist/patterns/messaging/index.d.ts +1 -7
  228. package/dist/patterns/messaging/index.js +3 -1
  229. package/dist/patterns/messaging/index.js.map +1 -0
  230. package/dist/patterns/orchestration/index.cjs +21 -3
  231. package/dist/patterns/orchestration/index.cjs.map +1 -0
  232. package/dist/patterns/orchestration/index.d.cts +1 -9
  233. package/dist/patterns/orchestration/index.d.ts +1 -9
  234. package/dist/patterns/orchestration/index.js +3 -1
  235. package/dist/patterns/orchestration/index.js.map +1 -0
  236. package/dist/patterns/process/index.cjs +21 -1
  237. package/dist/patterns/process/index.cjs.map +1 -0
  238. package/dist/patterns/process/index.d.cts +1 -10
  239. package/dist/patterns/process/index.d.ts +1 -10
  240. package/dist/patterns/process/index.js +3 -1
  241. package/dist/patterns/process/index.js.map +1 -0
  242. package/dist/patterns/reactive-layout/index.cjs +21 -4
  243. package/dist/patterns/reactive-layout/index.cjs.map +1 -0
  244. package/dist/patterns/reactive-layout/index.d.cts +1 -7
  245. package/dist/patterns/reactive-layout/index.d.ts +1 -7
  246. package/dist/patterns/reactive-layout/index.js +3 -1
  247. package/dist/patterns/reactive-layout/index.js.map +1 -0
  248. package/dist/patterns/reduction/index.cjs +21 -3
  249. package/dist/patterns/reduction/index.cjs.map +1 -0
  250. package/dist/patterns/reduction/index.d.cts +1 -6
  251. package/dist/patterns/reduction/index.d.ts +1 -6
  252. package/dist/patterns/reduction/index.js +3 -1
  253. package/dist/patterns/reduction/index.js.map +1 -0
  254. package/dist/patterns/surface/index.cjs +21 -13
  255. package/dist/patterns/surface/index.cjs.map +1 -0
  256. package/dist/patterns/surface/index.d.cts +1 -9
  257. package/dist/patterns/surface/index.d.ts +1 -9
  258. package/dist/patterns/surface/index.js +3 -1
  259. package/dist/patterns/surface/index.js.map +1 -0
  260. package/dist/patterns/topology-view/index.cjs +21 -0
  261. package/dist/patterns/topology-view/index.cjs.map +1 -0
  262. package/dist/patterns/topology-view/index.d.cts +1 -0
  263. package/dist/patterns/topology-view/index.d.ts +1 -0
  264. package/dist/patterns/topology-view/index.js +3 -0
  265. package/dist/patterns/topology-view/index.js.map +1 -0
  266. package/dist/testing/index.cjs +21 -0
  267. package/dist/testing/index.cjs.map +1 -0
  268. package/dist/testing/index.d.cts +1 -0
  269. package/dist/testing/index.d.ts +1 -0
  270. package/dist/testing/index.js +3 -0
  271. package/dist/testing/index.js.map +1 -0
  272. package/package.json +608 -584
  273. package/dist/backoff-HPZMEZNF.js +0 -1
  274. package/dist/cascading-CH-_VwG9.d.cts +0 -199
  275. package/dist/cascading-OgKQZjsa.d.ts +0 -199
  276. package/dist/chunk-35JTVPOX.js +0 -1
  277. package/dist/chunk-3G5U5QNE.js +0 -5
  278. package/dist/chunk-3XDYJRYU.js +0 -1
  279. package/dist/chunk-4I45FVQS.js +0 -1
  280. package/dist/chunk-4VVTGLXJ.js +0 -1
  281. package/dist/chunk-4YAN45KM.js +0 -1
  282. package/dist/chunk-5QDBSZBV.js +0 -1
  283. package/dist/chunk-626TESAC.js +0 -3
  284. package/dist/chunk-6HOSXQKF.js +0 -1
  285. package/dist/chunk-6QZNQS5B.js +0 -1
  286. package/dist/chunk-C72GO4IZ.js +0 -1
  287. package/dist/chunk-CE72X3WO.js +0 -1
  288. package/dist/chunk-CK2E7BTU.js +0 -1
  289. package/dist/chunk-CLD3F4R5.js +0 -1
  290. package/dist/chunk-CUNIRONA.js +0 -1
  291. package/dist/chunk-D27JNOLZ.js +0 -1
  292. package/dist/chunk-D5RFJOZ2.js +0 -1
  293. package/dist/chunk-EBW4V6JN.js +0 -1
  294. package/dist/chunk-ESMPEKEV.js +0 -1
  295. package/dist/chunk-F3IGTWCQ.js +0 -1
  296. package/dist/chunk-F672GV32.js +0 -1
  297. package/dist/chunk-FDQGFWLF.js +0 -1
  298. package/dist/chunk-FG4TKHMC.js +0 -1
  299. package/dist/chunk-GPW2V3RE.js +0 -1
  300. package/dist/chunk-I7IGYPSL.js +0 -1
  301. package/dist/chunk-INQD2KRQ.js +0 -1
  302. package/dist/chunk-JNWRYDJN.js +0 -1
  303. package/dist/chunk-JQFH2DV6.js +0 -1
  304. package/dist/chunk-K2Q24F5T.js +0 -1
  305. package/dist/chunk-KGKJCHEK.js +0 -1
  306. package/dist/chunk-KRH66M4O.js +0 -1
  307. package/dist/chunk-KVV66NN2.js +0 -1
  308. package/dist/chunk-L6NSJVJZ.js +0 -1
  309. package/dist/chunk-LYCLF26R.js +0 -1
  310. package/dist/chunk-NNKJUORL.js +0 -1
  311. package/dist/chunk-NON4NLIC.js +0 -45
  312. package/dist/chunk-O2BLLH7M.js +0 -18
  313. package/dist/chunk-OCKEEPRJ.js +0 -2
  314. package/dist/chunk-OFZG3TB3.js +0 -9
  315. package/dist/chunk-OYJKFY7V.js +0 -1
  316. package/dist/chunk-P6C4WHZO.js +0 -5
  317. package/dist/chunk-PT7W5FCD.js +0 -5
  318. package/dist/chunk-Q4U3A3L5.js +0 -1
  319. package/dist/chunk-QE4IGY7I.js +0 -61
  320. package/dist/chunk-QYADASLV.js +0 -1
  321. package/dist/chunk-QYVXF7GW.js +0 -1
  322. package/dist/chunk-S3EEIPO7.js +0 -1
  323. package/dist/chunk-SUWT3ZON.js +0 -1
  324. package/dist/chunk-TPKQW72B.js +0 -1
  325. package/dist/chunk-TSOYJ743.js +0 -1
  326. package/dist/chunk-TZQPPQEQ.js +0 -1
  327. package/dist/chunk-V5A7M7RJ.js +0 -1
  328. package/dist/chunk-VIMF6LGM.js +0 -1
  329. package/dist/chunk-VJLMUKOI.js +0 -1
  330. package/dist/chunk-VN6RDSK2.js +0 -1
  331. package/dist/chunk-VNC3TMVY.js +0 -1
  332. package/dist/chunk-VOPGGIL7.js +0 -1
  333. package/dist/chunk-VQ4A6T2A.js +0 -1
  334. package/dist/chunk-XG62INFA.js +0 -1
  335. package/dist/chunk-Y4NI3X7O.js +0 -84
  336. package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
  337. package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
  338. package/dist/decay-2ZukgQ4o.d.cts +0 -112
  339. package/dist/decay-CdEBmDIs.d.ts +0 -112
  340. package/dist/fallback-CqYVLL6X.d.ts +0 -250
  341. package/dist/fallback-Ctlj2tMY.d.cts +0 -250
  342. package/dist/graph-7VguS7a4.d.ts +0 -1668
  343. package/dist/graph-C4SHb3Ly.d.cts +0 -1668
  344. package/dist/index-0rKFCVFp.d.cts +0 -557
  345. package/dist/index-B-i4_g3k.d.ts +0 -651
  346. package/dist/index-B5iz82A3.d.cts +0 -2655
  347. package/dist/index-BAOD98JD.d.cts +0 -754
  348. package/dist/index-BG0BN3PB.d.ts +0 -44
  349. package/dist/index-BJX94aud.d.cts +0 -34
  350. package/dist/index-BP8a88zx.d.ts +0 -385
  351. package/dist/index-BTQtTb_H.d.cts +0 -301
  352. package/dist/index-BVpm6noz.d.cts +0 -36
  353. package/dist/index-Bc41FuHp.d.cts +0 -291
  354. package/dist/index-BdGtBX-X.d.cts +0 -515
  355. package/dist/index-Bf7eqeSF.d.ts +0 -113
  356. package/dist/index-BiX1Nkgx.d.cts +0 -1844
  357. package/dist/index-BoLv_OfD.d.cts +0 -651
  358. package/dist/index-BojK2fwH.d.cts +0 -299
  359. package/dist/index-BsT7F2et.d.ts +0 -291
  360. package/dist/index-BwLvVVsy.d.cts +0 -189
  361. package/dist/index-C59mYFKp.d.ts +0 -121
  362. package/dist/index-C7O6r5fV.d.ts +0 -37
  363. package/dist/index-C9kSENB4.d.cts +0 -127
  364. package/dist/index-C9pjcz3l.d.cts +0 -209
  365. package/dist/index-CAC_rNzm.d.ts +0 -189
  366. package/dist/index-CCq87F7t.d.ts +0 -127
  367. package/dist/index-CDXc9zKM.d.cts +0 -26
  368. package/dist/index-CJK1JkYy.d.ts +0 -36
  369. package/dist/index-CLon-IWF.d.cts +0 -374
  370. package/dist/index-COD1kVoS.d.cts +0 -468
  371. package/dist/index-CPT7C_f1.d.ts +0 -374
  372. package/dist/index-CQG3D1cp.d.ts +0 -468
  373. package/dist/index-CZQXo5tH.d.ts +0 -209
  374. package/dist/index-CZjOhcBy.d.cts +0 -113
  375. package/dist/index-ChOyVLKm.d.cts +0 -86
  376. package/dist/index-CvrqGfNS.d.ts +0 -34
  377. package/dist/index-D-AEQVLo.d.ts +0 -2655
  378. package/dist/index-D4Y1cMG0.d.ts +0 -26
  379. package/dist/index-DBHK8O6H.d.ts +0 -301
  380. package/dist/index-DBevwHj_.d.ts +0 -515
  381. package/dist/index-DIOoAZUX.d.ts +0 -45
  382. package/dist/index-DSZ3ZCHF.d.ts +0 -3402
  383. package/dist/index-Dgs8zcj7.d.ts +0 -102
  384. package/dist/index-Dh_HJ82K.d.ts +0 -299
  385. package/dist/index-Dhc7a7Xo.d.cts +0 -102
  386. package/dist/index-Dmqp7KjD.d.ts +0 -86
  387. package/dist/index-Dn-wI9g4.d.ts +0 -231
  388. package/dist/index-Du7u1lSf.d.cts +0 -385
  389. package/dist/index-DwigL4lY.d.ts +0 -1844
  390. package/dist/index-DyR7eU5S.d.cts +0 -779
  391. package/dist/index-JZUPJIJy.d.ts +0 -779
  392. package/dist/index-K0_0eR8g.d.ts +0 -557
  393. package/dist/index-O16yXPK4.d.cts +0 -3402
  394. package/dist/index-O7fucFrU.d.cts +0 -121
  395. package/dist/index-RV_yDjOX.d.cts +0 -198
  396. package/dist/index-cm1GNcWE.d.ts +0 -754
  397. package/dist/index-f5IivDUX.d.cts +0 -37
  398. package/dist/index-hHcaFlJX.d.cts +0 -45
  399. package/dist/index-tJoTcnHh.d.cts +0 -231
  400. package/dist/index-wAzD9yVj.d.ts +0 -198
  401. package/dist/index-z96luz5O.d.cts +0 -44
  402. package/dist/meta-BgVAsg9j.d.ts +0 -102
  403. package/dist/meta-vE8bxW1E.d.cts +0 -102
  404. package/dist/node-ClS5yC-B.d.cts +0 -1347
  405. package/dist/node-ClS5yC-B.d.ts +0 -1347
  406. package/dist/observable-BsBzUrcI.d.ts +0 -36
  407. package/dist/observable-DLGPPtb8.d.cts +0 -36
  408. package/dist/pipeline-graph-DPqKDk59.d.cts +0 -137
  409. package/dist/pipeline-graph-loP57TBA.d.ts +0 -137
  410. package/dist/reactive-layout-Dsvob4zD.d.cts +0 -183
  411. package/dist/reactive-layout-v7KPvxoc.d.ts +0 -183
  412. package/dist/reactive-log-B00laMSQ.d.cts +0 -223
  413. package/dist/reactive-log-BezYsbA_.d.ts +0 -223
  414. package/dist/reactive-map-48mnZ-nu.d.cts +0 -296
  415. package/dist/reactive-map-BVVPdvmi.d.ts +0 -296
  416. package/dist/resilience-YIWPK4YC.js +0 -1
  417. package/dist/sugar-DLwvMr3F.d.ts +0 -223
  418. package/dist/sugar-DyVGtczU.d.cts +0 -223
  419. package/dist/topology-tree-BNGvuG82.d.ts +0 -25
  420. package/dist/topology-tree-BSdfSwMi.d.cts +0 -25
  421. package/dist/types-B1jDWVsM.d.cts +0 -442
  422. package/dist/types-DkzUUs0H.d.ts +0 -442
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// `@graphrefly/graphrefly` is a thin re-export layer over the chosen sibling\n// impl (per PART 13 of `archive/docs/SESSION-rust-port-architecture.md`).\n// Three siblings (D082): `@graphrefly/native` (napi-rs, Node fast path),\n// `@graphrefly/wasm` (wasm-bindgen, browser fast path opt-in subpath),\n// `@graphrefly/pure-ts` (universal fallback, permanent first-class peer per\n// D084). Until the facade build lands (Deferred 1 of PART 13), this shim\n// delegates everything to `@graphrefly/pure-ts` directly.\nexport * from \"@graphrefly/pure-ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAOA,0BAAc,gCAPd;","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,96 +1,45 @@
1
- export { i as compat, a as signals } from './index-O7fucFrU.cjs';
2
- export { b as batch, i as core, d as downWithBatch, a as isBatching, m as monotonicNs, w as wallClockNs } from './index-RV_yDjOX.cjs';
3
- export { A as AckableMessage, a as AdapterHandlers, B as BatchMessage, b as BridgeMessage, c as BudgetConstraint, d as BudgetGateOptions, e as BufferedSinkHandle, f as BundleTriad, C as CSVRow, g as CacheEvictionPolicy, h as CascadingCache, i as CascadingCacheOptions, j as CheckpointToRedisOptions, k as CheckpointToS3Options, l as ClickHouseClientLike, m as ClickHouseInsertClientLike, n as ClickHouseRow, o as CronSchedule, D as DrizzleQueryLike, E as EmitTriad, p as ErrorMessage, q as ExternalBundleOptions, r as ExternalRegister, F as FileWriterLike, s as FromCSVOptions, t as FromClickHouseWatchOptions, u as FromDrizzleOptions, v as FromHTTPOptions, w as FromHTTPPollOptions, x as FromHTTPStreamOptions, y as FromKafkaOptions, z as FromKyselyOptions, G as FromMCPOptions, H as FromNATSOptions, I as FromNDJSONOptions, J as FromOTelOptions, K as FromPrismaOptions, L as FromPrometheusOptions, M as FromPulsarOptions, N as FromRabbitMQOptions, O as FromRedisStreamOptions, P as FromSSEOptions, Q as FromSqliteOptions, R as FromStatsDOptions, S as FromSyslogOptions, T as FromWebSocketReconnectOptions, U as HTTPBundle, V as InitMessage, W as KafkaConsumerLike, X as KafkaMessage, Y as KafkaProducerLike, Z as KyselyQueryLike, _ as LokiClientLike, $ as LokiStream, a0 as MCPClientLike, a1 as MongoCollectionLike, a2 as NATSClientLike, a3 as NATSMessage, a4 as NATSSubscriptionLike, a5 as NativePubSubBackend, a6 as OTelBundle, a7 as OTelLog, a8 as OTelMetric, a9 as OTelRegister, aa as OTelSpan, ab as ParseSSEStreamOptions, ac as PostgresClientLike, ad as PrismaModelLike, ae as PrometheusMetric, af as PubSubBackend, ag as PubSubHub, ah as PubSubHubOptions, ai as PulsarConsumerLike, aj as PulsarMessage, ak as PulsarProducerLike, al as RabbitMQChannelLike, am as RabbitMQMessage, an as ReactiveSinkBackpressureOptions, ao as ReactiveSinkConfig, ap as ReactiveSinkHandle, aq as ReactiveSinkOptions, ar as ReactiveSinkRetryOptions, as as ReadyMessage, at as RedisCheckpointClientLike, au as RedisClientLike, av as RedisStreamEntry, aw as ResettableTimer, ax as S3ClientLike, ay as SSEEvent, az as SignalMessage, aA as SingleFromAnyOptions, aB as SinkFailure, aC as SinkHandle, aD as SinkTransportError, aE as SqliteDbLike, aF as SqliteIterableDbLike, aG as StatsDMetric, aH as StatsDRegister, aI as StratifyOptions, aJ as StratifyRule, aK as SyslogMessage, aL as SyslogRegister, aM as TempoClientLike, aN as ToCSVOptions, aO as ToClickHouseOptions, aP as ToFileOptions, aQ as ToHTTPOptions, aR as ToKafkaOptions, aS as ToLokiOptions, aT as ToMongoOptions, aU as ToNATSOptions, aV as ToPostgresOptions, aW as ToPulsarOptions, aX as ToRabbitMQOptions, aY as ToRedisStreamOptions, aZ as ToS3Options, a_ as ToSSEOptions, a$ as ToSqliteOptions, b0 as ToTempoOptions, b1 as ToWebSocketOptions, b2 as ValueMessage, b3 as WatermarkController, b4 as WatermarkOptions, b5 as WebSocketLike, b6 as WebSocketMessageEventLike, b7 as WebSocketRegister, b8 as WebhookRegister, b9 as WorkerBridge, ba as WorkerBridgeOptions, bb as WorkerSelfHandle, bc as WorkerSelfOptions, bd as WorkerTransport, be as budgetGate, bf as cascadingCache, bg as checkpointToRedis, bh as checkpointToS3, bi as createTransport, bj as createWatermarkController, bk as csvRows, bl as deserializeError, bm as domainMeta, bn as externalBundle, bo as externalProducer, bp as extra, bq as fromCSV, br as fromClickHouseWatch, bs as fromDrizzle, bt as fromHTTP, bu as fromHTTPPoll, bv as fromHTTPStream, bw as fromKafka, bx as fromKysely, by as fromMCP, bz as fromNATS, bA as fromNDJSON, bB as fromOTel, bC as fromPrisma, bD as fromPrometheus, bE as fromPulsar, bF as fromRabbitMQ, bG as fromRedisStream, bH as fromSSE, bI as fromSqlite, bJ as fromSqliteCursor, bK as fromStatsD, bL as fromSyslog, bM as fromWebSocket, bN as fromWebSocketReconnect, bO as fromWebhook, bP as lru, bQ as makeHttpError, bR as matchesCron, bS as nameToSignal, bT as ndjsonRows, bU as parseCron, bV as parsePrometheusText, bW as parseSSEStream, bX as parseStatsD, bY as parseSyslog, bZ as pubsub, b_ as reactiveSink, b$ as serializeError, c0 as signalToName, c1 as singleFromAny, c2 as singleNodeFromAny, c3 as stratify, c4 as toCSV, c5 as toClickHouse, c6 as toFile, c7 as toHTTP, c8 as toKafka, c9 as toLoki, ca as toMongo, cb as toNATS, cc as toPostgres, cd as toPulsar, ce as toRabbitMQ, cf as toReadableStream, cg as toRedisStream, ch as toS3, ci as toSSE, cj as toSSEBytes, ck as toSqlite, cl as toTempo, cm as toWebSocket, cn as workerBridge, co as workerSelf } from './index-O16yXPK4.cjs';
4
- export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, I as IslandReport, J as JsonCodec, L as LazyGraphCodec, O as ObservabilityCheck, c as ObservabilityDescribeFormat, d as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, V as ValidateNoIslandsResult, e as ValidateObservabilityOptions, f as ValidateObservabilityResult, W as WALEntry, g as createDagCborCodec, h as createDagCborZstdCodec, i as decodeEnvelope, j as encodeEnvelope, k as graph, r as registerBuiltinCodecs, l as replayWAL, s as sizeof, v as validateGraphObservability, m as validateNoIslands } from './index-0rKFCVFp.cjs';
5
- export { C as ChatMessage, L as LLMAdapter, a as LLMInvokeOptions, b as LLMResponse, S as StreamDelta, T as TokenUsage, c as ToolCall, d as ToolDefinition } from './types-B1jDWVsM.cjs';
6
- import { i as index$1 } from './index-B5iz82A3.cjs';
7
- import { i as index$2 } from './index-COD1kVoS.cjs';
8
- import { i as index$3 } from './index-Dhc7a7Xo.cjs';
9
- import { i as index$4 } from './index-tJoTcnHh.cjs';
10
- import { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory, i as index$5 } from './index-Du7u1lSf.cjs';
11
- import { i as index$6 } from './index-BiX1Nkgx.cjs';
12
- import { i as index$7 } from './index-DyR7eU5S.cjs';
13
- import { i as index$8 } from './index-BwLvVVsy.cjs';
14
- import { i as index$a } from './index-CLon-IWF.cjs';
15
- import { i as index$b } from './index-BTQtTb_H.cjs';
16
- import { i as index$c } from './index-CDXc9zKM.cjs';
17
- import { i as index$d } from './index-BojK2fwH.cjs';
18
- import { i as index$9 } from './index-BdGtBX-X.cjs';
19
- import { i as index$e } from './index-CZjOhcBy.cjs';
20
- import { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot, k as index$f } from './index-Bc41FuHp.cjs';
21
- export { A as Actor, C as COMPLETE, f as COMPLETE_MSG, g as COMPLETE_ONLY_BATCH, D as DATA, h as DEFAULT_ACTOR, i as DIRTY, j as DIRTY_MSG, k as DIRTY_ONLY_BATCH, l as DepRecord, E as ERROR, F as FnCtx, G as GlobalInspectorEvent, m as GlobalInspectorHook, n as GraphReFlyConfig, o as GuardAction, p as GuardDenied, q as GuardDeniedDetails, H as HashFn, I as INVALIDATE, r as INVALIDATE_MSG, s as INVALIDATE_ONLY_BATCH, t as Message, u as MessageContext, v as MessageTypeRegistration, w as MessageTypeRegistrationInput, M as Messages, N as Node, c as NodeActions, x as NodeCtx, e as NodeDescribeKind, y as NodeFn, d as NodeFnCleanup, b as NodeGuard, z as NodeImpl, B as NodeInspectorHook, J as NodeInspectorHookEvent, a as NodeOptions, K as NodeSink, L as NodeStatus, O as NodeTransportOptions, P as NodeVersionInfo, Q as OnMessageHandler, R as OnSubscribeHandler, S as PAUSE, T as PolicyAllow, U as PolicyDeny, W as PolicyRuleData, X as RESOLVED, Y as RESOLVED_MSG, Z as RESOLVED_ONLY_BATCH, _ as RESUME, $ as RigorRecorder, a0 as START, a1 as START_MSG, a2 as SubscribeContext, a3 as TEARDOWN, a4 as TEARDOWN_MSG, a5 as TEARDOWN_ONLY_BATCH, a6 as V0, a7 as V1, V as VersioningLevel, a8 as VersioningOptions, a9 as accessHintForGuard, aa as advanceVersion, ab as configure, ac as createVersioning, ad as defaultConfig, ae as defaultHash, af as isV1, ag as node, ah as normalizeActor, ai as policy, aj as policyFromRules, ak as registerBuiltins } from './node-ClS5yC-B.cjs';
22
- export { AppendCursor, AppendLoadResult, AppendLogStorageOptions, AppendLogStorageTier, BaseStorageTier, Codec, KvStorageOptions, KvStorageTier, SnapshotStorageOptions, SnapshotStorageTier, StorageBackend, appendLogStorage, dictKv, dictSnapshot, jsonCodec, jsonCodecFor, kvStorage, memoryAppendLog, memoryBackend, memoryKv, memorySnapshot, snapshotStorage } from './extra/storage-tiers.cjs';
23
- export { AsyncSourceOpts, EventTargetLike, FromCronOptions, NodeInput, ReactiveCounterBundle, awaitSettled, cached, defer, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, nodeSignal, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './extra/sources.cjs';
24
- export { A as AuditLogOpts, B as BaseAuditRecord, D as DEFAULT_AUDIT_GUARD, F as FailureMeta, L as LightMutationOpts, M as MutationOpts, S as SuccessMeta, W as WrapMutationOpts, a as appendAudit, b as bumpCursor, c as createAuditLog, l as lightMutation, r as registerCursor, d as registerCursorMap, t as tryIncrementBounded, w as wrapMutation } from './index-C9pjcz3l.cjs';
25
- export { A as AutoTrackOptions, D as DerivedFn, a as DynamicFn, E as EffectFn, P as PipeOperator, b as ProducerFn, T as TrackFn, c as autoTrackNode, d as derived, e as dynamicNode, f as effect, p as pipe, g as producer, s as state } from './sugar-DyVGtczU.cjs';
26
- export { B as BackoffPreset, a as BackoffStrategy, C as CircuitBreaker, b as CircuitBreakerOptions, c as CircuitOpenError, d as CircuitState, E as ExponentialBackoffOptions, F as FallbackInput, J as JitterMode, N as NS_PER_MS, e as NS_PER_SEC, R as RateLimiterOptions, f as RateLimiterOverflowError, g as RateLimiterOverflowPolicy, h as RetryOptions, S as StatusValue, T as TimeoutError, i as TokenBucket, W as WithBreakerBundle, j as WithStatusBundle, k as circuitBreaker, l as constant, m as decorrelatedJitter, n as exponential, o as fallback, p as fibonacci, q as linear, r as rateLimiter, s as resolveBackoffPreset, t as retry, u as timeout, v as tokenBucket, w as withBreaker, x as withMaxAttempts, y as withStatus } from './index-BoLv_OfD.cjs';
27
- export { C as CausalChain, c as CausalStep, D as DescribeChangeset, d as DescribeEvent, e as DescribeFilter, M as DescribeNodeMeta, E as ExplainPathOptions, f as GRAPH_META_SEGMENT, G as Graph, g as GraphActorOptions, h as GraphAttachStorageOptions, i as GraphCheckpointRecord, j as GraphDescribeOptions, b as GraphDescribeOutput, k as GraphDiagramDirection, l as GraphDiffChange, m as GraphDiffResult, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, r as GraphPersistSnapshot, s as GraphProfileOptions, t as GraphProfileResult, u as GraphVersionChange, v as GraphWALDiff, N as NodeProfile, O as ObserveChangeset, w as ObserveDetail, x as ObserveEvent, y as ObserveOptions, z as ObserveResult, A as ObserveTheme, B as ObserveThemeName, F as ObserveTier, R as ReachableDirection, H as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, I as TraceEntry, J as diffForWAL, K as explainPath, L as graphProfile, P as reachable, Q as topologyDiff } from './graph-C4SHb3Ly.cjs';
28
- export { C as ContentAddressedMissError, a as ContentAddressedMode, b as ContentAddressedStorage, c as ContentAddressedStorageOptions, d as canonicalJson, e as contentAddressedStorage } from './content-addressed-storage-4-ST1tYk.cjs';
29
- export { a as DescribeDetail, b as DescribeField, D as DescribeNodeOutput, f as factoryTag, p as placeholderArgs, r as resolveDescribeFields } from './meta-vE8bxW1E.cjs';
30
- export { D as DistillBundle, a as DistillOptions, E as Extraction, V as VerifiableBundle, b as VerifiableOptions, c as VerifyValue, d as decay, e as distill, v as verifiable } from './decay-2ZukgQ4o.cjs';
31
- export { IndexBackend, IndexRow, ListBackend, NativeIndexBackend, NativeListBackend, ReactiveIndexBundle, ReactiveIndexOptions, ReactiveListBundle, ReactiveListOptions, UpsertOptions, reactiveIndex, reactiveList } from './extra/reactive.cjs';
32
- export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, a as ReactiveLogBundle, R as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from './reactive-log-B00laMSQ.cjs';
33
- export { M as MapBackend, N as NativeMapBackend, a as NativeMapBackendOptions, R as ReactiveMapBundle, b as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from './reactive-map-48mnZ-nu.cjs';
34
- export { MergeMapOptions, TapObserver, ThrottleOptions, audit, buffer, bufferCount, bufferTime, catchError, combine, combineLatest, concat, concatMap, debounce, debounceTime, delay, distinctUntilChanged, elementAt, exhaustMap, filter, find, first, flatMap, interval, last, map, merge, mergeMap, onFirstData, pairwise, pausable, race, reduce, repeat, rescue, sample, scan, skip, switchMap, take, takeUntil, takeWhile, tap, tapFirst, throttle, throttleTime, valve, window, windowCount, windowTime, withLatestFrom, zip } from './extra/operators.cjs';
35
- export { StorageHandle, sortJsonValue, stableJsonString } from './extra/storage-core.cjs';
36
- export { T as ToObservableOptions, t as toObservable } from './observable-DLGPPtb8.cjs';
37
- export { i as jotai } from './index-ChOyVLKm.cjs';
38
- export { i as nanostores } from './index-C9kSENB4.cjs';
39
- export { i as nestjs } from './index-BAOD98JD.cjs';
40
- export { i as react } from './index-z96luz5O.cjs';
41
- export { i as solid } from './index-BVpm6noz.cjs';
42
- export { i as svelte } from './index-hHcaFlJX.cjs';
43
- export { i as vue } from './index-BJX94aud.cjs';
44
- export { w as watchTopologyTree } from './topology-tree-BSdfSwMi.cjs';
45
- export { i as zustand } from './index-f5IivDUX.cjs';
46
- import './cascading-CH-_VwG9.cjs';
47
- import './fallback-Ctlj2tMY.cjs';
48
- import './pipeline-graph-DPqKDk59.cjs';
49
- import './reactive-layout-Dsvob4zD.cjs';
50
- import 'rxjs';
51
- import '@nestjs/common';
52
- import '@nestjs/core';
53
- import 'vue';
54
-
55
- /**
56
- * Patterns layer: domain/solution helpers (Phase 4+).
57
- */
58
-
59
- declare const index_CatalogFnEntry: typeof CatalogFnEntry;
60
- declare const index_CatalogSourceEntry: typeof CatalogSourceEntry;
61
- declare const index_ConfigFieldSchema: typeof ConfigFieldSchema;
62
- declare const index_CreateGraphOptions: typeof CreateGraphOptions;
63
- declare const index_FnFactory: typeof FnFactory;
64
- declare const index_GraphSpec: typeof GraphSpec;
65
- declare const index_GraphSpecCatalog: typeof GraphSpecCatalog;
66
- declare const index_GraphSpecFeedbackEdge: typeof GraphSpecFeedbackEdge;
67
- declare const index_GraphSpecNode: typeof GraphSpecNode;
68
- declare const index_GraphSpecTemplate: typeof GraphSpecTemplate;
69
- declare const index_GraphSpecTemplateRef: typeof GraphSpecTemplateRef;
70
- declare const index_GraphSpecValidation: typeof GraphSpecValidation;
71
- declare const index_ReduceOptions: typeof ReduceOptions;
72
- declare const index_RestoreSnapshotOptions: typeof RestoreSnapshotOptions;
73
- declare const index_SNAPSHOT_WIRE_VERSION: typeof SNAPSHOT_WIRE_VERSION;
74
- declare const index_SaveSnapshotResult: typeof SaveSnapshotResult;
75
- declare const index_SourceFactory: typeof SourceFactory;
76
- declare const index_SurfaceError: typeof SurfaceError;
77
- declare const index_SurfaceErrorCode: typeof SurfaceErrorCode;
78
- declare const index_SurfaceErrorPayload: typeof SurfaceErrorPayload;
79
- declare const index_asSurfaceError: typeof asSurfaceError;
80
- declare const index_createGraph: typeof createGraph;
81
- declare const index_deleteSnapshot: typeof deleteSnapshot;
82
- declare const index_diffSnapshots: typeof diffSnapshots;
83
- declare const index_listSnapshots: typeof listSnapshots;
84
- declare const index_restoreSnapshot: typeof restoreSnapshot;
85
- declare const index_runReduction: typeof runReduction;
86
- declare const index_saveSnapshot: typeof saveSnapshot;
87
- declare namespace index {
88
- export { index_CatalogFnEntry as CatalogFnEntry, index_CatalogSourceEntry as CatalogSourceEntry, index_ConfigFieldSchema as ConfigFieldSchema, index_CreateGraphOptions as CreateGraphOptions, index_FnFactory as FnFactory, index_GraphSpec as GraphSpec, index_GraphSpecCatalog as GraphSpecCatalog, index_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, index_GraphSpecNode as GraphSpecNode, index_GraphSpecTemplate as GraphSpecTemplate, index_GraphSpecTemplateRef as GraphSpecTemplateRef, index_GraphSpecValidation as GraphSpecValidation, index_ReduceOptions as ReduceOptions, index_RestoreSnapshotOptions as RestoreSnapshotOptions, index_SNAPSHOT_WIRE_VERSION as SNAPSHOT_WIRE_VERSION, index_SaveSnapshotResult as SaveSnapshotResult, index_SourceFactory as SourceFactory, index_SurfaceError as SurfaceError, index_SurfaceErrorCode as SurfaceErrorCode, index_SurfaceErrorPayload as SurfaceErrorPayload, index$1 as ai, index_asSurfaceError as asSurfaceError, index$2 as cqrs, index_createGraph as createGraph, index_deleteSnapshot as deleteSnapshot, index$3 as demoShell, index_diffSnapshots as diffSnapshots, index$4 as domainTemplates, index$5 as graphspec, index$6 as harness, index$7 as inspect, index$8 as jobQueue, index$9 as layout, index_listSnapshots as listSnapshots, index$a as memory, index$b as messaging, index$c as orchestration, index$d as process, index$e as reduction, index_restoreSnapshot as restoreSnapshot, index_runReduction as runReduction, index_saveSnapshot as saveSnapshot, index$f as surface };
89
- }
90
-
91
- /**
92
- * GraphRefly — public API surface.
93
- */
94
- declare const version = "0.0.0";
95
-
96
- export { CatalogFnEntry, CatalogSourceEntry, ConfigFieldSchema, CreateGraphOptions, FnFactory, GraphSpec, GraphSpecCatalog, GraphSpecFeedbackEdge, GraphSpecNode, GraphSpecTemplate, GraphSpecTemplateRef, GraphSpecValidation, ReduceOptions, RestoreSnapshotOptions, SNAPSHOT_WIRE_VERSION, SaveSnapshotResult, SourceFactory, SurfaceError, SurfaceErrorCode, SurfaceErrorPayload, index$1 as ai, asSurfaceError, index$2 as cqrs, createGraph, deleteSnapshot, index$3 as demoShell, diffSnapshots, index$4 as domainTemplates, index$5 as graphspec, index$6 as harness, index$7 as inspect, index$8 as jobQueue, index$9 as layout, listSnapshots, index$a as memory, index$b as messaging, index$c as orchestration, index as patterns, index$d as process, index$e as reduction, restoreSnapshot, runReduction, saveSnapshot, index$f as surface, version };
1
+ export * from '@graphrefly/pure-ts';
2
+ import '@graphrefly/pure-ts/compat';
3
+ import '@graphrefly/pure-ts/core';
4
+ import '@graphrefly/pure-ts/extra/browser';
5
+ import '@graphrefly/pure-ts/extra';
6
+ import '@graphrefly/pure-ts/extra/node';
7
+ import '@graphrefly/pure-ts/extra/operators';
8
+ import '@graphrefly/pure-ts/extra/reactive';
9
+ import '@graphrefly/pure-ts/extra/sources';
10
+ import '@graphrefly/pure-ts/extra/storage-browser';
11
+ import '@graphrefly/pure-ts/extra/storage-core';
12
+ import '@graphrefly/pure-ts/extra/storage-node';
13
+ import '@graphrefly/pure-ts/extra/storage-tiers-browser';
14
+ import '@graphrefly/pure-ts/extra/storage-tiers-node';
15
+ import '@graphrefly/pure-ts/extra/storage-tiers';
16
+ import '@graphrefly/pure-ts/extra/storage-wal';
17
+ import '@graphrefly/pure-ts/graph';
18
+ import '@graphrefly/pure-ts/testing';
19
+ import '@graphrefly/pure-ts/compat/jotai';
20
+ import '@graphrefly/pure-ts/compat/nanostores';
21
+ import '@graphrefly/pure-ts/compat/nestjs';
22
+ import '@graphrefly/pure-ts/compat/react';
23
+ import '@graphrefly/pure-ts/compat/solid';
24
+ import '@graphrefly/pure-ts/compat/svelte';
25
+ import '@graphrefly/pure-ts/compat/vue';
26
+ import '@graphrefly/pure-ts/compat/zustand';
27
+ import '@graphrefly/pure-ts/extra/render';
28
+ import '@graphrefly/pure-ts/patterns/ai/browser';
29
+ import '@graphrefly/pure-ts/patterns/ai';
30
+ import '@graphrefly/pure-ts/patterns/ai/node';
31
+ import '@graphrefly/pure-ts/patterns/cqrs';
32
+ import '@graphrefly/pure-ts/patterns/demo-shell';
33
+ import '@graphrefly/pure-ts/patterns/domain-templates';
34
+ import '@graphrefly/pure-ts/patterns/graphspec';
35
+ import '@graphrefly/pure-ts/patterns/harness';
36
+ import '@graphrefly/pure-ts/patterns/inspect';
37
+ import '@graphrefly/pure-ts/patterns/job-queue';
38
+ import '@graphrefly/pure-ts/patterns/memory';
39
+ import '@graphrefly/pure-ts/patterns/messaging';
40
+ import '@graphrefly/pure-ts/patterns/orchestration';
41
+ import '@graphrefly/pure-ts/patterns/process';
42
+ import '@graphrefly/pure-ts/patterns/reactive-layout';
43
+ import '@graphrefly/pure-ts/patterns/reduction';
44
+ import '@graphrefly/pure-ts/patterns/surface';
45
+ import '@graphrefly/pure-ts/patterns/topology-view';
package/dist/index.d.ts CHANGED
@@ -1,96 +1,45 @@
1
- export { i as compat, a as signals } from './index-C59mYFKp.js';
2
- export { b as batch, i as core, d as downWithBatch, a as isBatching, m as monotonicNs, w as wallClockNs } from './index-wAzD9yVj.js';
3
- export { A as AckableMessage, a as AdapterHandlers, B as BatchMessage, b as BridgeMessage, c as BudgetConstraint, d as BudgetGateOptions, e as BufferedSinkHandle, f as BundleTriad, C as CSVRow, g as CacheEvictionPolicy, h as CascadingCache, i as CascadingCacheOptions, j as CheckpointToRedisOptions, k as CheckpointToS3Options, l as ClickHouseClientLike, m as ClickHouseInsertClientLike, n as ClickHouseRow, o as CronSchedule, D as DrizzleQueryLike, E as EmitTriad, p as ErrorMessage, q as ExternalBundleOptions, r as ExternalRegister, F as FileWriterLike, s as FromCSVOptions, t as FromClickHouseWatchOptions, u as FromDrizzleOptions, v as FromHTTPOptions, w as FromHTTPPollOptions, x as FromHTTPStreamOptions, y as FromKafkaOptions, z as FromKyselyOptions, G as FromMCPOptions, H as FromNATSOptions, I as FromNDJSONOptions, J as FromOTelOptions, K as FromPrismaOptions, L as FromPrometheusOptions, M as FromPulsarOptions, N as FromRabbitMQOptions, O as FromRedisStreamOptions, P as FromSSEOptions, Q as FromSqliteOptions, R as FromStatsDOptions, S as FromSyslogOptions, T as FromWebSocketReconnectOptions, U as HTTPBundle, V as InitMessage, W as KafkaConsumerLike, X as KafkaMessage, Y as KafkaProducerLike, Z as KyselyQueryLike, _ as LokiClientLike, $ as LokiStream, a0 as MCPClientLike, a1 as MongoCollectionLike, a2 as NATSClientLike, a3 as NATSMessage, a4 as NATSSubscriptionLike, a5 as NativePubSubBackend, a6 as OTelBundle, a7 as OTelLog, a8 as OTelMetric, a9 as OTelRegister, aa as OTelSpan, ab as ParseSSEStreamOptions, ac as PostgresClientLike, ad as PrismaModelLike, ae as PrometheusMetric, af as PubSubBackend, ag as PubSubHub, ah as PubSubHubOptions, ai as PulsarConsumerLike, aj as PulsarMessage, ak as PulsarProducerLike, al as RabbitMQChannelLike, am as RabbitMQMessage, an as ReactiveSinkBackpressureOptions, ao as ReactiveSinkConfig, ap as ReactiveSinkHandle, aq as ReactiveSinkOptions, ar as ReactiveSinkRetryOptions, as as ReadyMessage, at as RedisCheckpointClientLike, au as RedisClientLike, av as RedisStreamEntry, aw as ResettableTimer, ax as S3ClientLike, ay as SSEEvent, az as SignalMessage, aA as SingleFromAnyOptions, aB as SinkFailure, aC as SinkHandle, aD as SinkTransportError, aE as SqliteDbLike, aF as SqliteIterableDbLike, aG as StatsDMetric, aH as StatsDRegister, aI as StratifyOptions, aJ as StratifyRule, aK as SyslogMessage, aL as SyslogRegister, aM as TempoClientLike, aN as ToCSVOptions, aO as ToClickHouseOptions, aP as ToFileOptions, aQ as ToHTTPOptions, aR as ToKafkaOptions, aS as ToLokiOptions, aT as ToMongoOptions, aU as ToNATSOptions, aV as ToPostgresOptions, aW as ToPulsarOptions, aX as ToRabbitMQOptions, aY as ToRedisStreamOptions, aZ as ToS3Options, a_ as ToSSEOptions, a$ as ToSqliteOptions, b0 as ToTempoOptions, b1 as ToWebSocketOptions, b2 as ValueMessage, b3 as WatermarkController, b4 as WatermarkOptions, b5 as WebSocketLike, b6 as WebSocketMessageEventLike, b7 as WebSocketRegister, b8 as WebhookRegister, b9 as WorkerBridge, ba as WorkerBridgeOptions, bb as WorkerSelfHandle, bc as WorkerSelfOptions, bd as WorkerTransport, be as budgetGate, bf as cascadingCache, bg as checkpointToRedis, bh as checkpointToS3, bi as createTransport, bj as createWatermarkController, bk as csvRows, bl as deserializeError, bm as domainMeta, bn as externalBundle, bo as externalProducer, bp as extra, bq as fromCSV, br as fromClickHouseWatch, bs as fromDrizzle, bt as fromHTTP, bu as fromHTTPPoll, bv as fromHTTPStream, bw as fromKafka, bx as fromKysely, by as fromMCP, bz as fromNATS, bA as fromNDJSON, bB as fromOTel, bC as fromPrisma, bD as fromPrometheus, bE as fromPulsar, bF as fromRabbitMQ, bG as fromRedisStream, bH as fromSSE, bI as fromSqlite, bJ as fromSqliteCursor, bK as fromStatsD, bL as fromSyslog, bM as fromWebSocket, bN as fromWebSocketReconnect, bO as fromWebhook, bP as lru, bQ as makeHttpError, bR as matchesCron, bS as nameToSignal, bT as ndjsonRows, bU as parseCron, bV as parsePrometheusText, bW as parseSSEStream, bX as parseStatsD, bY as parseSyslog, bZ as pubsub, b_ as reactiveSink, b$ as serializeError, c0 as signalToName, c1 as singleFromAny, c2 as singleNodeFromAny, c3 as stratify, c4 as toCSV, c5 as toClickHouse, c6 as toFile, c7 as toHTTP, c8 as toKafka, c9 as toLoki, ca as toMongo, cb as toNATS, cc as toPostgres, cd as toPulsar, ce as toRabbitMQ, cf as toReadableStream, cg as toRedisStream, ch as toS3, ci as toSSE, cj as toSSEBytes, ck as toSqlite, cl as toTempo, cm as toWebSocket, cn as workerBridge, co as workerSelf } from './index-DSZ3ZCHF.js';
4
- export { E as ENVELOPE_VERSION, a as EvictedSubgraphInfo, b as EvictionPolicy, G as GraphCodec, I as IslandReport, J as JsonCodec, L as LazyGraphCodec, O as ObservabilityCheck, c as ObservabilityDescribeFormat, d as SIZEOF_OVERHEAD, S as SIZEOF_SYMBOL, V as ValidateNoIslandsResult, e as ValidateObservabilityOptions, f as ValidateObservabilityResult, W as WALEntry, g as createDagCborCodec, h as createDagCborZstdCodec, i as decodeEnvelope, j as encodeEnvelope, k as graph, r as registerBuiltinCodecs, l as replayWAL, s as sizeof, v as validateGraphObservability, m as validateNoIslands } from './index-K0_0eR8g.js';
5
- export { C as ChatMessage, L as LLMAdapter, a as LLMInvokeOptions, b as LLMResponse, S as StreamDelta, T as TokenUsage, c as ToolCall, d as ToolDefinition } from './types-DkzUUs0H.js';
6
- import { i as index$1 } from './index-D-AEQVLo.js';
7
- import { i as index$2 } from './index-CQG3D1cp.js';
8
- import { i as index$3 } from './index-Dgs8zcj7.js';
9
- import { i as index$4 } from './index-Dn-wI9g4.js';
10
- import { C as CatalogFnEntry, a as CatalogSourceEntry, b as ConfigFieldSchema, F as FnFactory, G as GraphSpec, c as GraphSpecCatalog, d as GraphSpecFeedbackEdge, e as GraphSpecNode, f as GraphSpecTemplate, g as GraphSpecTemplateRef, h as GraphSpecValidation, S as SourceFactory, i as index$5 } from './index-BP8a88zx.js';
11
- import { i as index$6 } from './index-DwigL4lY.js';
12
- import { i as index$7 } from './index-JZUPJIJy.js';
13
- import { i as index$8 } from './index-CAC_rNzm.js';
14
- import { i as index$a } from './index-CPT7C_f1.js';
15
- import { i as index$b } from './index-DBHK8O6H.js';
16
- import { i as index$c } from './index-D4Y1cMG0.js';
17
- import { i as index$d } from './index-Dh_HJ82K.js';
18
- import { i as index$9 } from './index-DBevwHj_.js';
19
- import { i as index$e } from './index-Bf7eqeSF.js';
20
- import { C as CreateGraphOptions, R as ReduceOptions, a as RestoreSnapshotOptions, S as SNAPSHOT_WIRE_VERSION, b as SaveSnapshotResult, c as SurfaceError, d as SurfaceErrorCode, e as SurfaceErrorPayload, f as asSurfaceError, g as createGraph, h as deleteSnapshot, i as diffSnapshots, l as listSnapshots, r as restoreSnapshot, j as runReduction, s as saveSnapshot, k as index$f } from './index-BsT7F2et.js';
21
- export { A as Actor, C as COMPLETE, f as COMPLETE_MSG, g as COMPLETE_ONLY_BATCH, D as DATA, h as DEFAULT_ACTOR, i as DIRTY, j as DIRTY_MSG, k as DIRTY_ONLY_BATCH, l as DepRecord, E as ERROR, F as FnCtx, G as GlobalInspectorEvent, m as GlobalInspectorHook, n as GraphReFlyConfig, o as GuardAction, p as GuardDenied, q as GuardDeniedDetails, H as HashFn, I as INVALIDATE, r as INVALIDATE_MSG, s as INVALIDATE_ONLY_BATCH, t as Message, u as MessageContext, v as MessageTypeRegistration, w as MessageTypeRegistrationInput, M as Messages, N as Node, c as NodeActions, x as NodeCtx, e as NodeDescribeKind, y as NodeFn, d as NodeFnCleanup, b as NodeGuard, z as NodeImpl, B as NodeInspectorHook, J as NodeInspectorHookEvent, a as NodeOptions, K as NodeSink, L as NodeStatus, O as NodeTransportOptions, P as NodeVersionInfo, Q as OnMessageHandler, R as OnSubscribeHandler, S as PAUSE, T as PolicyAllow, U as PolicyDeny, W as PolicyRuleData, X as RESOLVED, Y as RESOLVED_MSG, Z as RESOLVED_ONLY_BATCH, _ as RESUME, $ as RigorRecorder, a0 as START, a1 as START_MSG, a2 as SubscribeContext, a3 as TEARDOWN, a4 as TEARDOWN_MSG, a5 as TEARDOWN_ONLY_BATCH, a6 as V0, a7 as V1, V as VersioningLevel, a8 as VersioningOptions, a9 as accessHintForGuard, aa as advanceVersion, ab as configure, ac as createVersioning, ad as defaultConfig, ae as defaultHash, af as isV1, ag as node, ah as normalizeActor, ai as policy, aj as policyFromRules, ak as registerBuiltins } from './node-ClS5yC-B.js';
22
- export { AppendCursor, AppendLoadResult, AppendLogStorageOptions, AppendLogStorageTier, BaseStorageTier, Codec, KvStorageOptions, KvStorageTier, SnapshotStorageOptions, SnapshotStorageTier, StorageBackend, appendLogStorage, dictKv, dictSnapshot, jsonCodec, jsonCodecFor, kvStorage, memoryAppendLog, memoryBackend, memoryKv, memorySnapshot, snapshotStorage } from './extra/storage-tiers.js';
23
- export { AsyncSourceOpts, EventTargetLike, FromCronOptions, NodeInput, ReactiveCounterBundle, awaitSettled, cached, defer, empty, escapeRegexChar, firstValueFrom, firstWhere, forEach, fromAny, fromAsyncIter, fromCron, fromEvent, fromIter, fromPromise, fromRaf, fromTimer, globToRegExp, keepalive, matchesAnyPattern, never, nodeSignal, of, reactiveCounter, replay, share, shareReplay, throwError, toArray } from './extra/sources.js';
24
- export { A as AuditLogOpts, B as BaseAuditRecord, D as DEFAULT_AUDIT_GUARD, F as FailureMeta, L as LightMutationOpts, M as MutationOpts, S as SuccessMeta, W as WrapMutationOpts, a as appendAudit, b as bumpCursor, c as createAuditLog, l as lightMutation, r as registerCursor, d as registerCursorMap, t as tryIncrementBounded, w as wrapMutation } from './index-CZQXo5tH.js';
25
- export { A as AutoTrackOptions, D as DerivedFn, a as DynamicFn, E as EffectFn, P as PipeOperator, b as ProducerFn, T as TrackFn, c as autoTrackNode, d as derived, e as dynamicNode, f as effect, p as pipe, g as producer, s as state } from './sugar-DLwvMr3F.js';
26
- export { B as BackoffPreset, a as BackoffStrategy, C as CircuitBreaker, b as CircuitBreakerOptions, c as CircuitOpenError, d as CircuitState, E as ExponentialBackoffOptions, F as FallbackInput, J as JitterMode, N as NS_PER_MS, e as NS_PER_SEC, R as RateLimiterOptions, f as RateLimiterOverflowError, g as RateLimiterOverflowPolicy, h as RetryOptions, S as StatusValue, T as TimeoutError, i as TokenBucket, W as WithBreakerBundle, j as WithStatusBundle, k as circuitBreaker, l as constant, m as decorrelatedJitter, n as exponential, o as fallback, p as fibonacci, q as linear, r as rateLimiter, s as resolveBackoffPreset, t as retry, u as timeout, v as tokenBucket, w as withBreaker, x as withMaxAttempts, y as withStatus } from './index-B-i4_g3k.js';
27
- export { C as CausalChain, c as CausalStep, D as DescribeChangeset, d as DescribeEvent, e as DescribeFilter, M as DescribeNodeMeta, E as ExplainPathOptions, f as GRAPH_META_SEGMENT, G as Graph, g as GraphActorOptions, h as GraphAttachStorageOptions, i as GraphCheckpointRecord, j as GraphDescribeOptions, b as GraphDescribeOutput, k as GraphDiagramDirection, l as GraphDiffChange, m as GraphDiffResult, n as GraphFactoryContext, o as GraphNodeFactory, p as GraphObserveAll, q as GraphObserveOne, a as GraphOptions, r as GraphPersistSnapshot, s as GraphProfileOptions, t as GraphProfileResult, u as GraphVersionChange, v as GraphWALDiff, N as NodeProfile, O as ObserveChangeset, w as ObserveDetail, x as ObserveEvent, y as ObserveOptions, z as ObserveResult, A as ObserveTheme, B as ObserveThemeName, F as ObserveTier, R as ReachableDirection, H as ReachableOptions, S as SNAPSHOT_VERSION, T as TopologyEvent, I as TraceEntry, J as diffForWAL, K as explainPath, L as graphProfile, P as reachable, Q as topologyDiff } from './graph-7VguS7a4.js';
28
- export { C as ContentAddressedMissError, a as ContentAddressedMode, b as ContentAddressedStorage, c as ContentAddressedStorageOptions, d as canonicalJson, e as contentAddressedStorage } from './content-addressed-storage-DuYMjV7o.js';
29
- export { a as DescribeDetail, b as DescribeField, D as DescribeNodeOutput, f as factoryTag, p as placeholderArgs, r as resolveDescribeFields } from './meta-BgVAsg9j.js';
30
- export { D as DistillBundle, a as DistillOptions, E as Extraction, V as VerifiableBundle, b as VerifiableOptions, c as VerifyValue, d as decay, e as distill, v as verifiable } from './decay-CdEBmDIs.js';
31
- export { IndexBackend, IndexRow, ListBackend, NativeIndexBackend, NativeListBackend, ReactiveIndexBundle, ReactiveIndexOptions, ReactiveListBundle, ReactiveListOptions, UpsertOptions, reactiveIndex, reactiveList } from './extra/reactive.js';
32
- export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, a as ReactiveLogBundle, R as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from './reactive-log-BezYsbA_.js';
33
- export { M as MapBackend, N as NativeMapBackend, a as NativeMapBackendOptions, R as ReactiveMapBundle, b as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from './reactive-map-BVVPdvmi.js';
34
- export { MergeMapOptions, TapObserver, ThrottleOptions, audit, buffer, bufferCount, bufferTime, catchError, combine, combineLatest, concat, concatMap, debounce, debounceTime, delay, distinctUntilChanged, elementAt, exhaustMap, filter, find, first, flatMap, interval, last, map, merge, mergeMap, onFirstData, pairwise, pausable, race, reduce, repeat, rescue, sample, scan, skip, switchMap, take, takeUntil, takeWhile, tap, tapFirst, throttle, throttleTime, valve, window, windowCount, windowTime, withLatestFrom, zip } from './extra/operators.js';
35
- export { StorageHandle, sortJsonValue, stableJsonString } from './extra/storage-core.js';
36
- export { T as ToObservableOptions, t as toObservable } from './observable-BsBzUrcI.js';
37
- export { i as jotai } from './index-Dmqp7KjD.js';
38
- export { i as nanostores } from './index-CCq87F7t.js';
39
- export { i as nestjs } from './index-cm1GNcWE.js';
40
- export { i as react } from './index-BG0BN3PB.js';
41
- export { i as solid } from './index-CJK1JkYy.js';
42
- export { i as svelte } from './index-DIOoAZUX.js';
43
- export { i as vue } from './index-CvrqGfNS.js';
44
- export { w as watchTopologyTree } from './topology-tree-BNGvuG82.js';
45
- export { i as zustand } from './index-C7O6r5fV.js';
46
- import './cascading-OgKQZjsa.js';
47
- import './fallback-CqYVLL6X.js';
48
- import './pipeline-graph-loP57TBA.js';
49
- import './reactive-layout-v7KPvxoc.js';
50
- import 'rxjs';
51
- import '@nestjs/common';
52
- import '@nestjs/core';
53
- import 'vue';
54
-
55
- /**
56
- * Patterns layer: domain/solution helpers (Phase 4+).
57
- */
58
-
59
- declare const index_CatalogFnEntry: typeof CatalogFnEntry;
60
- declare const index_CatalogSourceEntry: typeof CatalogSourceEntry;
61
- declare const index_ConfigFieldSchema: typeof ConfigFieldSchema;
62
- declare const index_CreateGraphOptions: typeof CreateGraphOptions;
63
- declare const index_FnFactory: typeof FnFactory;
64
- declare const index_GraphSpec: typeof GraphSpec;
65
- declare const index_GraphSpecCatalog: typeof GraphSpecCatalog;
66
- declare const index_GraphSpecFeedbackEdge: typeof GraphSpecFeedbackEdge;
67
- declare const index_GraphSpecNode: typeof GraphSpecNode;
68
- declare const index_GraphSpecTemplate: typeof GraphSpecTemplate;
69
- declare const index_GraphSpecTemplateRef: typeof GraphSpecTemplateRef;
70
- declare const index_GraphSpecValidation: typeof GraphSpecValidation;
71
- declare const index_ReduceOptions: typeof ReduceOptions;
72
- declare const index_RestoreSnapshotOptions: typeof RestoreSnapshotOptions;
73
- declare const index_SNAPSHOT_WIRE_VERSION: typeof SNAPSHOT_WIRE_VERSION;
74
- declare const index_SaveSnapshotResult: typeof SaveSnapshotResult;
75
- declare const index_SourceFactory: typeof SourceFactory;
76
- declare const index_SurfaceError: typeof SurfaceError;
77
- declare const index_SurfaceErrorCode: typeof SurfaceErrorCode;
78
- declare const index_SurfaceErrorPayload: typeof SurfaceErrorPayload;
79
- declare const index_asSurfaceError: typeof asSurfaceError;
80
- declare const index_createGraph: typeof createGraph;
81
- declare const index_deleteSnapshot: typeof deleteSnapshot;
82
- declare const index_diffSnapshots: typeof diffSnapshots;
83
- declare const index_listSnapshots: typeof listSnapshots;
84
- declare const index_restoreSnapshot: typeof restoreSnapshot;
85
- declare const index_runReduction: typeof runReduction;
86
- declare const index_saveSnapshot: typeof saveSnapshot;
87
- declare namespace index {
88
- export { index_CatalogFnEntry as CatalogFnEntry, index_CatalogSourceEntry as CatalogSourceEntry, index_ConfigFieldSchema as ConfigFieldSchema, index_CreateGraphOptions as CreateGraphOptions, index_FnFactory as FnFactory, index_GraphSpec as GraphSpec, index_GraphSpecCatalog as GraphSpecCatalog, index_GraphSpecFeedbackEdge as GraphSpecFeedbackEdge, index_GraphSpecNode as GraphSpecNode, index_GraphSpecTemplate as GraphSpecTemplate, index_GraphSpecTemplateRef as GraphSpecTemplateRef, index_GraphSpecValidation as GraphSpecValidation, index_ReduceOptions as ReduceOptions, index_RestoreSnapshotOptions as RestoreSnapshotOptions, index_SNAPSHOT_WIRE_VERSION as SNAPSHOT_WIRE_VERSION, index_SaveSnapshotResult as SaveSnapshotResult, index_SourceFactory as SourceFactory, index_SurfaceError as SurfaceError, index_SurfaceErrorCode as SurfaceErrorCode, index_SurfaceErrorPayload as SurfaceErrorPayload, index$1 as ai, index_asSurfaceError as asSurfaceError, index$2 as cqrs, index_createGraph as createGraph, index_deleteSnapshot as deleteSnapshot, index$3 as demoShell, index_diffSnapshots as diffSnapshots, index$4 as domainTemplates, index$5 as graphspec, index$6 as harness, index$7 as inspect, index$8 as jobQueue, index$9 as layout, index_listSnapshots as listSnapshots, index$a as memory, index$b as messaging, index$c as orchestration, index$d as process, index$e as reduction, index_restoreSnapshot as restoreSnapshot, index_runReduction as runReduction, index_saveSnapshot as saveSnapshot, index$f as surface };
89
- }
90
-
91
- /**
92
- * GraphRefly — public API surface.
93
- */
94
- declare const version = "0.0.0";
95
-
96
- export { CatalogFnEntry, CatalogSourceEntry, ConfigFieldSchema, CreateGraphOptions, FnFactory, GraphSpec, GraphSpecCatalog, GraphSpecFeedbackEdge, GraphSpecNode, GraphSpecTemplate, GraphSpecTemplateRef, GraphSpecValidation, ReduceOptions, RestoreSnapshotOptions, SNAPSHOT_WIRE_VERSION, SaveSnapshotResult, SourceFactory, SurfaceError, SurfaceErrorCode, SurfaceErrorPayload, index$1 as ai, asSurfaceError, index$2 as cqrs, createGraph, deleteSnapshot, index$3 as demoShell, diffSnapshots, index$4 as domainTemplates, index$5 as graphspec, index$6 as harness, index$7 as inspect, index$8 as jobQueue, index$9 as layout, listSnapshots, index$a as memory, index$b as messaging, index$c as orchestration, index as patterns, index$d as process, index$e as reduction, restoreSnapshot, runReduction, saveSnapshot, index$f as surface, version };
1
+ export * from '@graphrefly/pure-ts';
2
+ import '@graphrefly/pure-ts/compat';
3
+ import '@graphrefly/pure-ts/core';
4
+ import '@graphrefly/pure-ts/extra/browser';
5
+ import '@graphrefly/pure-ts/extra';
6
+ import '@graphrefly/pure-ts/extra/node';
7
+ import '@graphrefly/pure-ts/extra/operators';
8
+ import '@graphrefly/pure-ts/extra/reactive';
9
+ import '@graphrefly/pure-ts/extra/sources';
10
+ import '@graphrefly/pure-ts/extra/storage-browser';
11
+ import '@graphrefly/pure-ts/extra/storage-core';
12
+ import '@graphrefly/pure-ts/extra/storage-node';
13
+ import '@graphrefly/pure-ts/extra/storage-tiers-browser';
14
+ import '@graphrefly/pure-ts/extra/storage-tiers-node';
15
+ import '@graphrefly/pure-ts/extra/storage-tiers';
16
+ import '@graphrefly/pure-ts/extra/storage-wal';
17
+ import '@graphrefly/pure-ts/graph';
18
+ import '@graphrefly/pure-ts/testing';
19
+ import '@graphrefly/pure-ts/compat/jotai';
20
+ import '@graphrefly/pure-ts/compat/nanostores';
21
+ import '@graphrefly/pure-ts/compat/nestjs';
22
+ import '@graphrefly/pure-ts/compat/react';
23
+ import '@graphrefly/pure-ts/compat/solid';
24
+ import '@graphrefly/pure-ts/compat/svelte';
25
+ import '@graphrefly/pure-ts/compat/vue';
26
+ import '@graphrefly/pure-ts/compat/zustand';
27
+ import '@graphrefly/pure-ts/extra/render';
28
+ import '@graphrefly/pure-ts/patterns/ai/browser';
29
+ import '@graphrefly/pure-ts/patterns/ai';
30
+ import '@graphrefly/pure-ts/patterns/ai/node';
31
+ import '@graphrefly/pure-ts/patterns/cqrs';
32
+ import '@graphrefly/pure-ts/patterns/demo-shell';
33
+ import '@graphrefly/pure-ts/patterns/domain-templates';
34
+ import '@graphrefly/pure-ts/patterns/graphspec';
35
+ import '@graphrefly/pure-ts/patterns/harness';
36
+ import '@graphrefly/pure-ts/patterns/inspect';
37
+ import '@graphrefly/pure-ts/patterns/job-queue';
38
+ import '@graphrefly/pure-ts/patterns/memory';
39
+ import '@graphrefly/pure-ts/patterns/messaging';
40
+ import '@graphrefly/pure-ts/patterns/orchestration';
41
+ import '@graphrefly/pure-ts/patterns/process';
42
+ import '@graphrefly/pure-ts/patterns/reactive-layout';
43
+ import '@graphrefly/pure-ts/patterns/reduction';
44
+ import '@graphrefly/pure-ts/patterns/surface';
45
+ import '@graphrefly/pure-ts/patterns/topology-view';
package/dist/index.js CHANGED
@@ -1 +1,3 @@
1
- import{a as T,b as j,c as k,d as v,e as C,f as D,g as S,h as b,i as q,j as A,k as g}from"./chunk-P6C4WHZO.js";import{J as n}from"./chunk-NON4NLIC.js";import{m as i}from"./chunk-EBW4V6JN.js";import{f as x}from"./chunk-3XDYJRYU.js";import{c}from"./chunk-INQD2KRQ.js";import{p as l}from"./chunk-QYVXF7GW.js";import{da as p}from"./chunk-QE4IGY7I.js";import{e as t}from"./chunk-SUWT3ZON.js";import{j as r}from"./chunk-OYJKFY7V.js";import{d as e}from"./chunk-JNWRYDJN.js";import"./chunk-PT7W5FCD.js";import"./chunk-Q4U3A3L5.js";import{b as m}from"./chunk-FG4TKHMC.js";import"./chunk-OCKEEPRJ.js";import"./chunk-D27JNOLZ.js";import{e as f}from"./chunk-I7IGYPSL.js";import{m as a}from"./chunk-Y4NI3X7O.js";import{d as s}from"./chunk-CUNIRONA.js";import{a as xt,b as y}from"./chunk-K2Q24F5T.js";import{b as Uo}from"./chunk-KRH66M4O.js";import{i as wo}from"./chunk-CLD3F4R5.js";import{G as mt}from"./chunk-OFZG3TB3.js";import{f as o}from"./chunk-VQ4A6T2A.js";import{d as ft}from"./chunk-VJLMUKOI.js";import{d as nt}from"./chunk-VIMF6LGM.js";import{d as it}from"./chunk-6QZNQS5B.js";import{d as ct}from"./chunk-GPW2V3RE.js";import{b as lt}from"./chunk-TPKQW72B.js";import{a as u}from"./chunk-4I45FVQS.js";import{a as hs,b as Ls,c as Cs,d as Ds,e as Ws,f as Xs,g as Ys,h as Zs,i as _s,j as $s,k as oa,l as M}from"./chunk-S3EEIPO7.js";import{a as ys,b as Ms}from"./chunk-6HOSXQKF.js";import{b as Vs}from"./chunk-TSOYJ743.js";import{$ as ls,A as Ft,B as Gt,C as Ht,D as Jt,E as Kt,F as Nt,G as Pt,H as Vt,I as Wt,J as Xt,K as Yt,L as Zt,M as _t,N as $t,O as os,P as rs,Q as es,R as ts,S as ss,T as as,U as ps,V as ms,W as fs,X as xs,Y as ns,Z as is,_ as cs,a as gt,aa as gs,b as ht,ba as vs,c as Lt,d as dt,e as ut,f as yt,g as Mt,h as Tt,i as jt,j as kt,k as vt,l as Ct,m as Dt,n as St,o as bt,p as qt,q as At,r as It,s as Ot,t as Qt,u as Rt,v as Ut,w as wt,x as zt,y as Bt,z as Et}from"./chunk-O2BLLH7M.js";import{a as Go,d as xe,e as ne,f as ie,g as ce,h as le,i as ge,j as he,k as Le,l as de,m as ue,n as ye}from"./chunk-VNC3TMVY.js";import{b as Ts,c as js,d as ks,e as Is,f as Os}from"./chunk-XG62INFA.js";import{a as Ps}from"./chunk-4YAN45KM.js";import{a as zo,b as We}from"./chunk-5QDBSZBV.js";import{a as _e,b as $e,c as ot,d as rt,e as et,f as tt,g as st,h as at,i as pt}from"./chunk-FDQGFWLF.js";import{a as Fo}from"./chunk-L6NSJVJZ.js";import{a as tr,b as sr,c as ar,d}from"./chunk-KVV66NN2.js";import"./chunk-3G5U5QNE.js";import"./chunk-C72GO4IZ.js";import{a as No,b as Po,c as Vo,d as Wo,e as Xo,g as Zo,h as _o,i as $o,j as or,k as rr,l as er}from"./chunk-626TESAC.js";import{a as Yo}from"./chunk-ESMPEKEV.js";import{a as Us,b as ws,c as zs,d as Bs,e as Es,f as Fs,g as Gs,h as Hs,i as Js,j as Ks,k as Ns}from"./chunk-D5RFJOZ2.js";import{a as Qs,b as Rs}from"./chunk-CE72X3WO.js";import{A as Gr,B as Hr,C as Jr,D as Kr,E as Nr,F as Pr,G as Vr,I as Wr,J as Xr,K as Yr,L as Zr,M as _r,N as $r,O as oe,P as re,Q as ee,R as te,S as se,T as ae,U as pe,V as me,W as fe,a as hr,b as Lr,c as dr,d as ur,e as yr,f as Mr,g as Tr,h as jr,i as kr,j as vr,k as Cr,l as Dr,m as Sr,n as br,o as qr,p as Ar,q as Ir,r as Or,s as Qr,t as Rr,u as Ur,v as wr,w as zr,x as Br,y as Er,z as Fr}from"./chunk-VOPGGIL7.js";import{a as pr,b as mr,c as fr,d as xr,e as nr,f as ir,g as cr,h as lr,i as gr}from"./chunk-4VVTGLXJ.js";import{a as Ho,b as Jo,c as Ko}from"./chunk-35JTVPOX.js";import{a as Ss,b as bs}from"./chunk-NNKJUORL.js";import{a as qs,b as As}from"./chunk-KGKJCHEK.js";import{a as ds,b as us}from"./chunk-TZQPPQEQ.js";import{a as Xe,b as Ye,c as Ze}from"./chunk-JQFH2DV6.js";import{A as Ke,B as Ne,C as Pe,D as Ve,a as Bo,b as Eo,c as Me,d as Te,e as je,f as ke,g as ve,h as Ce,i as De,j as Se,k as be,l as qe,m as Ae,n as Ie,o as Oe,p as Qe,q as Re,r as Ue,s as we,t as ze,u as Be,v as Ee,w as Fe,x as Ge,y as He,z as Je}from"./chunk-V5A7M7RJ.js";import{A as vo,B as Co,C as Do,D as So,E as bo,F as qo,G as Ao,H as Io,I as Oo,J as Qo,K as Ro,a as _,b as $,c as oo,d as ro,e as eo,f as to,g as so,h as ao,i as po,j as mo,k as fo,m as xo,n as no,o as io,p as co,q as lo,r as go,s as ho,t as Lo,u as uo,v as yo,w as Mo,x as To,y as jo,z as ko}from"./chunk-LYCLF26R.js";import{a as I,b as O,c as Q,d as R,e as U,f as w,g as z,h as B,i as E,j as F,k as G,l as H,m as J,n as K,o as N,p as P,q as V,r as W,s as X,t as Y,u as Z}from"./chunk-CK2E7BTU.js";import{b as L}from"./chunk-QYADASLV.js";var h={};L(h,{SNAPSHOT_WIRE_VERSION:()=>C,SurfaceError:()=>T,ai:()=>p,asSurfaceError:()=>j,cqrs:()=>o,createGraph:()=>k,deleteSnapshot:()=>A,demoShell:()=>m,diffSnapshots:()=>b,domainTemplates:()=>f,graphspec:()=>a,harness:()=>n,inspect:()=>i,jobQueue:()=>x,layout:()=>l,listSnapshots:()=>q,memory:()=>t,messaging:()=>r,orchestration:()=>e,process:()=>c,reduction:()=>s,restoreSnapshot:()=>S,runReduction:()=>v,saveSnapshot:()=>D,surface:()=>g});var ea="0.0.0";export{E as COMPLETE,N as COMPLETE_MSG,Y as COMPLETE_ONLY_BATCH,ne as CircuitOpenError,Ts as ContentAddressedMissError,O as DATA,po as DEFAULT_ACTOR,$e as DEFAULT_AUDIT_GUARD,Q as DIRTY,G as DIRTY_MSG,V as DIRTY_ONLY_BATCH,ro as ENVELOPE_VERSION,F as ERROR,_o as GRAPH_META_SEGMENT,or as Graph,lo as GraphReFlyConfig,ho as GuardDenied,U as INVALIDATE,J as INVALIDATE_MSG,X as INVALIDATE_ONLY_BATCH,_ as JsonCodec,pr as NS_PER_MS,mr as NS_PER_SEC,Ss as NativeIndexBackend,qs as NativeListBackend,Xe as NativeLogBackend,ds as NativeMapBackend,Cs as NativePubSubBackend,Do as NodeImpl,w as PAUSE,R as RESOLVED,H as RESOLVED_MSG,W as RESOLVED_ONLY_BATCH,z as RESUME,ge as RateLimiterOverflowError,Yo as ResettableTimer,No as SIZEOF_OVERHEAD,Po as SIZEOF_SYMBOL,$o as SNAPSHOT_VERSION,C as SNAPSHOT_WIRE_VERSION,I as START,K as START_MSG,T as SurfaceError,B as TEARDOWN,P as TEARDOWN_MSG,Z as TEARDOWN_ONLY_BATCH,de as TimeoutError,yo as accessHintForGuard,jo as advanceVersion,p as ai,et as appendAudit,Es as appendLogStorage,j as asSurfaceError,Vr as audit,Qo as autoTrackNode,Je as awaitSettled,xo as batch,Go as budgetGate,Wr as buffer,Xr as bufferCount,Zr as bufferTime,rt as bumpCursor,Fe as cached,js as canonicalJson,Ls as cascadingCache,fe as catchError,fs as checkpointToRedis,ms as checkpointToS3,ie as circuitBreaker,Or as combine,ae as combineLatest,y as compat,wr as concat,Fr as concatMap,Co as configure,fr as constant,ks as contentAddressedStorage,u as core,o as cqrs,ot as createAuditLog,$ as createDagCborCodec,oo as createDagCborZstdCodec,k as createGraph,_s as createTransport,To as createVersioning,We as createWatermarkController,Jt as csvRows,Kr as debounce,pe as debounceTime,Vs as decay,to as decodeEnvelope,cr as decorrelatedJitter,vo as defaultConfig,Mo as defaultHash,Ue as defer,Jr as delay,A as deleteSnapshot,m as demoShell,Ao as derived,Zs as deserializeError,Ks as dictKv,Ns as dictSnapshot,rr as diffForWAL,b as diffSnapshots,Ms as distill,Ar as distinctUntilChanged,Fo as domainMeta,f as domainTemplates,no as downWithBatch,Oo as dynamicNode,Io as effect,Dr as elementAt,Oe as empty,eo as encodeEnvelope,Me as escapeRegexChar,Er as exhaustMap,Wo as explainPath,nr as exponential,ht as externalBundle,gt as externalProducer,M as extra,Ko as factoryTag,ue as fallback,ir as fibonacci,Lr as filter,Cr as find,kr as first,Ge as firstValueFrom,He as firstWhere,Hr as flatMap,we as forEach,Ae as fromAny,qe as fromAsyncIter,Ht as fromCSV,Pt as fromClickHouseWatch,Ce as fromCron,ls as fromDrizzle,De as fromEvent,yt as fromHTTP,St as fromHTTPPoll,Dt as fromHTTPStream,Se as fromIter,Bt as fromKafka,gs as fromKysely,At as fromMCP,Xt as fromNATS,Nt as fromNDJSON,It as fromOTel,cs as fromPrisma,wt as fromPrometheus,be as fromPromise,Vt as fromPulsar,Zt as fromRabbitMQ,ve as fromRaf,Ft as fromRedisStream,Ct as fromSSE,xs as fromSqlite,ns as fromSqliteCursor,Rt as fromStatsD,Ot as fromSyslog,ke as fromTimer,dt as fromWebSocket,qt as fromWebSocketReconnect,ut as fromWebhook,Te as globToRegExp,d as graph,Zo as graphProfile,a as graphspec,n as harness,i as inspect,oe as interval,fo as isBatching,ko as isV1,x as jobQueue,Uo as jotai,Us as jsonCodec,ws as jsonCodecFor,Pe as keepalive,Fs as kvStorage,vr as last,l as layout,tt as lightMutation,xr as linear,q as listSnapshots,hs as lru,vs as makeHttpError,hr as map,je as matchesAnyPattern,Eo as matchesCron,t as memory,Hs as memoryAppendLog,zs as memoryBackend,Js as memoryKv,Gs as memorySnapshot,Rr as merge,Gr as mergeMap,Ze as mergeReactiveLogs,r as messaging,io as monotonicNs,Xs as nameToSignal,wo as nanostores,Kt as ndjsonRows,mt as nestjs,Qe as never,So as node,Ke as nodeSignal,mo as normalizeActor,Ie as of,br as onFirstData,e as orchestration,Ir as pairwise,Bo as parseCron,zt as parsePrometheusText,vt as parseSSEStream,Ut as parseStatsD,Qt as parseSyslog,h as patterns,ee as pausable,Ro as pipe,Jo as placeholderArgs,Lo as policy,uo as policyFromRules,c as process,qo as producer,Ds as pubsub,zr as race,he as rateLimiter,er as reachable,ft as react,Ve as reactiveCounter,bs as reactiveIndex,As as reactiveList,Ye as reactiveLog,us as reactiveMap,Lt as reactiveSink,ur as reduce,s as reduction,so as registerBuiltinCodecs,go as registerBuiltins,at as registerCursor,pt as registerCursorMap,re as repeat,Ee as replay,ao as replayWAL,te as rescue,gr as resolveBackoffPreset,Ho as resolveDescribeFields,S as restoreSnapshot,xe as retry,v as runReduction,Pr as sample,D as saveSnapshot,dr as scan,Ys as serializeError,Be as share,Ne as shareReplay,Ws as signalToName,xt as signals,Is as singleFromAny,Os as singleNodeFromAny,Vo as sizeof,Mr as skip,Bs as snapshotStorage,nt as solid,Qs as sortJsonValue,Rs as stableJsonString,bo as state,Ps as stratify,g as surface,it as svelte,Br as switchMap,yr as take,jr as takeUntil,Tr as takeWhile,Sr as tap,qr as tapFirst,Nr as throttle,me as throttleTime,Re as throwError,ye as timeout,ze as toArray,os as toCSV,rs as toClickHouse,$t as toFile,Mt as toHTTP,Et as toKafka,as as toLoki,ss as toMongo,Yt as toNATS,zo as toObservable,ts as toPostgres,Wt as toPulsar,_t as toRabbitMQ,kt as toReadableStream,Gt as toRedisStream,es as toS3,Tt as toSSE,jt as toSSEBytes,is as toSqlite,ps as toTempo,bt as toWebSocket,le as tokenBucket,Xo as topologyDiff,_e as tryIncrementBounded,ar as validateGraphObservability,sr as validateNoIslands,se as valve,ys as verifiable,ea as version,ct as vue,co as wallClockNs,tr as watchTopologyTree,$r as window,Yr as windowCount,_r as windowTime,ce as withBreaker,Qr as withLatestFrom,lr as withMaxAttempts,Le as withStatus,$s as workerBridge,oa as workerSelf,st as wrapMutation,Ur as zip,lt as zustand};
1
+ // src/index.ts
2
+ export * from "@graphrefly/pure-ts";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// `@graphrefly/graphrefly` is a thin re-export layer over the chosen sibling\n// impl (per PART 13 of `archive/docs/SESSION-rust-port-architecture.md`).\n// Three siblings (D082): `@graphrefly/native` (napi-rs, Node fast path),\n// `@graphrefly/wasm` (wasm-bindgen, browser fast path opt-in subpath),\n// `@graphrefly/pure-ts` (universal fallback, permanent first-class peer per\n// D084). Until the facade build lands (Deferred 1 of PART 13), this shim\n// delegates everything to `@graphrefly/pure-ts` directly.\nexport * from \"@graphrefly/pure-ts\";\n"],"mappings":";AAOA,cAAc;","names":[]}
@@ -1,8 +1,21 @@
1
- "use strict";var Kt=Object.create;var ee=Object.defineProperty;var Vt=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var zt=Object.getPrototypeOf,$t=Object.prototype.hasOwnProperty;var R=(e,t)=>()=>(e&&(t=e(e=0)),t);var qt=(e,t)=>{for(var n in t)ee(e,n,{get:t[n],enumerable:!0})},He=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Wt(t))!$t.call(e,s)&&s!==n&&ee(e,s,{get:()=>t[s],enumerable:!(r=Vt(t,s))||r.enumerable});return e};var Jt=(e,t,n)=>(n=e!=null?Kt(zt(e)):{},He(t||!e||!e.__esModule?ee(n,"default",{value:e,enumerable:!0}):n,e)),Qt=e=>He(ee({},"__esModule",{value:!0}),e);function w(){return Math.trunc(performance.now()*1e6)}function D(){return Date.now()*1e6}var L=R(()=>{"use strict"});function $e(){return we>0||Zt}function qe(){return we>0}function Je(e){we>0?en.push(e):e()}function te(e,t,n){if(t.length===0)return;if(t.length===1){let d=n(t[0][0]);if(d<3||!$e()){e(t);return}(d>=5?ze:d===4?We:Ve).push(()=>e(t));return}let r=t.length,s=r,i=r,a=r,o=0;for(;o<r&&n(t[o][0])<3;)o++;for(s=o;o<r&&n(t[o][0])===3;)o++;for(i=o;o<r&&n(t[o][0])===4;)o++;a=o;let c=$e();if(s>0){let d=t.slice(0,s);e(d)}if(i>s){let d=t.slice(s,i);c?Ve.push(()=>e(d)):e(d)}if(a>i){let d=t.slice(i,a);c?We.push(()=>e(d)):e(d)}if(r>a){let d=t.slice(a,r);c?ze.push(()=>e(d)):e(d)}}var we,Zt,Ve,We,ze,en,Qe=R(()=>{"use strict";we=0,Zt=!1,Ve=[],We=[],ze=[],en=[]});var G,E,P,I,U,B,Q,F,C,v,j,ve,tn,xe,nn,rn,_e,Ye,Xe,Ze,Se,ne=R(()=>{"use strict";G=Symbol.for("graphrefly/START"),E=Symbol.for("graphrefly/DATA"),P=Symbol.for("graphrefly/DIRTY"),I=Symbol.for("graphrefly/RESOLVED"),U=Symbol.for("graphrefly/INVALIDATE"),B=Symbol.for("graphrefly/PAUSE"),Q=Symbol.for("graphrefly/RESUME"),F=Symbol.for("graphrefly/TEARDOWN"),C=Symbol.for("graphrefly/COMPLETE"),v=Symbol.for("graphrefly/ERROR"),j=Object.freeze([P]),ve=Object.freeze([I]),tn=Object.freeze([U]),xe=Object.freeze([G]),nn=Object.freeze([C]),rn=Object.freeze([F]),_e=Object.freeze([j]),Ye=Object.freeze([ve]),Xe=Object.freeze([tn]),Ze=Object.freeze([nn]),Se=Object.freeze([rn])});function et(e){e.registerCodec(on)}var on,tt=R(()=>{"use strict";on={name:"json",version:1,contentType:"application/json",encode(e){let t=JSON.stringify(e);return new TextEncoder().encode(t)},decode(e,t){let n=new TextDecoder().decode(e);return JSON.parse(n)}}});function re(e){if(e==null)return sn;let{type:t,id:n,...r}=e;return{type:t??"system",id:n??"",...r}}var sn,nt=R(()=>{"use strict";sn={type:"system",id:""}});function rt(e){e.registerMessageType(G,{tier:0,wireCrossing:!1}),e.registerMessageType(P,{tier:1,wireCrossing:!1}),e.registerMessageType(U,{tier:1,wireCrossing:!1,metaPassthrough:!1}),e.registerMessageType(B,{tier:2,wireCrossing:!1}),e.registerMessageType(Q,{tier:2,wireCrossing:!1}),e.registerMessageType(E,{tier:3,wireCrossing:!0}),e.registerMessageType(I,{tier:3,wireCrossing:!0}),e.registerMessageType(C,{tier:4,wireCrossing:!0,metaPassthrough:!1}),e.registerMessageType(v,{tier:4,wireCrossing:!0,metaPassthrough:!1}),e.registerMessageType(F,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var oe,ot=R(()=>{"use strict";ne();oe=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(t){this._onMessage=t.onMessage,this._onSubscribe=t.onSubscribe,this._defaultVersioning=t.defaultVersioning,this._defaultHashFn=t.defaultHashFn,this.tierOf=n=>{let r=this._messageTypes.get(n);return r!=null?r.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(t){this._assertUnfrozen(),this._onMessage=t}set onSubscribe(t){this._assertUnfrozen(),this._onSubscribe=t}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(t){this._assertUnfrozen(),this._defaultVersioning=t}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(t){this._assertUnfrozen(),this._defaultHashFn=t}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(t){this._inspectorEnabled=t}get globalInspector(){return this._globalInspector}set globalInspector(t){this._globalInspector=t}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(t){this._rigorRecorder=t}registerMessageType(t,n){return this._assertUnfrozen(),this._messageTypes.set(t,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(t){let n=this._messageTypes.get(t);return n!=null?n.tier:1}isWireCrossing(t){let n=this._messageTypes.get(t);return n!=null?n.wireCrossing:!0}isLocalOnly(t){return!this.isWireCrossing(t)}isMetaPassthrough(t){let n=this._messageTypes.get(t);return n!=null?n.metaPassthrough:!0}isKnownMessageType(t){return this._messageTypes.has(t)}registerCodec(t){return this._assertUnfrozen(),this._codecs.set(t.name,t),this}lookupCodec(t){return this._codecs.get(t)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var H,st=R(()=>{"use strict";H=class extends Error{actor;action;nodeName;constructor(t,n){super(n??`GuardDenied: action "${String(t.action)}" denied for actor type "${String(t.actor.type)}"`),this.name="GuardDenied",this.actor=t.actor,this.action=t.action,this.nodeName=t.nodeName}get node(){return this.nodeName}}});function Ae(e){if(e===void 0)return null;if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError(`Cannot hash non-finite number: ${e}`);if(Number.isInteger(e)&&!Number.isSafeInteger(e))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${e}. Cross-language cid parity is not guaranteed for unsafe integers.`);return e}if(typeof e=="string"||typeof e=="boolean"||e===null)return e;if(Array.isArray(e))return e.map(Ae);if(typeof e=="object"&&e!==null){let t={};for(let n of Object.keys(e).sort())t[n]=Ae(e[n]);return t}return null}function dn(e){let t=cn.encode(e),n=t.length,r=n*8,s=n+9+63&-64,i=new Uint8Array(s);i.set(t),i[n]=128;let a=new DataView(i.buffer);a.setUint32(s-4,r>>>0,!1),a.setUint32(s-8,Math.floor(r/4294967296)>>>0,!1);let o=1779033703,c=3144134277,d=1013904242,l=2773480762,u=1359893119,p=2600822924,f=528734635,g=1541459225,y=new Uint32Array(64),m=(_,S)=>_>>>S|_<<32-S;for(let _=0;_<s;_+=64){for(let A=0;A<16;A++)y[A]=a.getUint32(_+A*4,!1);for(let A=16;A<64;A++){let z=y[A-15],$=y[A-2],Z=m(z,7)^m(z,18)^z>>>3,Te=m($,17)^m($,19)^$>>>10;y[A]=y[A-16]+Z+y[A-7]+Te>>>0}let S=o,M=c,k=d,b=l,T=u,x=p,N=f,ke=g;for(let A=0;A<64;A++){let z=m(T,6)^m(T,11)^m(T,25),$=T&x^~T&N,Z=ke+z+$+an[A]+y[A]>>>0,Te=m(S,2)^m(S,13)^m(S,22),jt=S&M^S&k^M&k,Ht=Te+jt>>>0;ke=N,N=x,x=T,T=b+Z>>>0,b=k,k=M,M=S,S=Z+Ht>>>0}o=o+S>>>0,c=c+M>>>0,d=d+k>>>0,l=l+b>>>0,u=u+T>>>0,p=p+x>>>0,f=f+N>>>0,g=g+ke>>>0}let h=_=>_.toString(16).padStart(8,"0");return h(o)+h(c)+h(d)+h(l)+h(u)+h(p)+h(f)+h(g)}function Re(e){let t=Ae(e??null),n=JSON.stringify(t);return dn(n).slice(0,16)}function ln(){let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();let t=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=t()+t()+t()+t();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function Ee(e,t,n){let r=n?.id??ln();if(e===0)return{id:r,version:0};let i=(n?.hash??Re)(t);return{id:r,version:0,cid:i,prev:null}}function it(e,t,n){e.version+=1,"cid"in e&&(e.prev=e.cid,e.cid=n(t))}var an,cn,at=R(()=>{"use strict";an=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),cn=new TextEncoder});function lt(e){return{node:e,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Ce(e){e.prevData=void 0,e.dirty=!1,e.involvedThisWave=!1,e.dataBatch.length=0,e.terminal=void 0}function se(e){return e.length===0?e:typeof e[0]=="symbol"?[e]:e}function pt(e,t,n){let r=ut(e)?e:[],s=typeof e=="function"?e:typeof t=="function"?t:void 0,i={};return ut(e)?i=(Me(t)?t:n)??{}:Me(e)?i=e:i=(Me(t)?t:n)??{},new ie(r,s,i)}var ct,dt,un,pn,Ne,ie,ut,Me,ft=R(()=>{"use strict";tt();nt();Qe();L();ot();st();ne();at();ct=()=>{},dt=100;un=(e,t,n,r)=>{n.direction==="down-in"&&e._onDepMessage(n.depIndex,t)},pn=(e,t,n,r)=>{let s=e;if(s._status==="completed"||s._status==="errored")return;let i=s._cached,a=i===void 0?[xe]:[xe,[E,i]];s._status==="dirty"&&a.push(j),te(t,a,s._config.tierOf)},Ne=new oe({onMessage:un,onSubscribe:pn});rt(Ne);et(Ne);ie=class e{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(t,n,r){this._config=r.config??Ne,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=n,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=t.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??Re;let s=r.versioning??this._config.defaultVersioning;this._versioningLevel=s,this._versioning=s!=null?Ee(s,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=t.map(lt);let i={};for(let[o,c]of Object.entries(r.meta??{})){let d={initial:c,name:`${r.name??"node"}:meta:${o}`,describeKind:"state",config:this._config};r.guard!=null&&(d.guard=r.guard),i[o]=new e([],void 0,d)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let a=this;this._actions={emit(o){a._emit([[E,o]])},down(o){a._emit(se(o))},up(o){a._emitUp(se(o))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(t,n){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let r=this._versioningLevel;if(r!=null&&t<=r)return;let s=n?.hash??this._hashFn;s!==this._hashFn&&(this._hashFn=s);let i=this._cached===void 0?void 0:this._cached,a=this._versioning,o=a?.id??n?.id,c=a?.version??0,d=Ee(t,i,{id:o,hash:s});d.version=c,this._versioning=d,this._versioningLevel=t}_setInspectorHook(t){return t==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(t),()=>{this._inspectorHooks?.delete(t),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(t){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(t),()=>{this._extraGuards?.delete(t),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(t){if(this._guard==null&&this._extraGuards==null)return!0;let n=re(t);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(n,"observe"))return!1}return!0}_checkGuard(t){if(t?.internal)return;let n=this._guard!=null||this._extraGuards!=null,r=t?.actor!=null;if(!n&&!r)return;let s=re(t?.actor),i=t?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(s,i))throw new H({actor:s,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(s,i))throw new H({actor:s,action:i,nodeName:this.name})}this._lastMutation={actor:s,timestamp_ns:D()}}down(t,n){let r=se(t);r.length!==0&&(this._checkGuard(n),this._emit(r))}emit(t,n){this._checkGuard(n),this._emit([[E,t]])}up(t,n){if(this._deps.length===0)return;let r=se(t);if(r.length===0)return;this._checkGuard(n);let s=n??{internal:!0};this._validateUpTiers(r);for(let i of this._deps)i.node.up?.(r,s)}_emitUp(t){if(this._deps.length!==0&&t.length!==0){this._validateUpTiers(t);for(let n of this._deps)n.node.up?.(t,{internal:!0})}}_validateUpTiers(t){let n=this._config.tierOf;for(let r of t){let s=n(r[0]);if(s===3||s===4)throw new Error(`Node "${this.name}": tier-${s} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(t,n){if(n!=null&&this._guard!=null){let c=re(n);if(!this._guard(c,"observe"))throw new H({actor:c,action:"observe",nodeName:this.name})}let s=this._isTerminal&&this._resubscribable;if(s){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let c of this._deps)Ce(c);if(this._partial===!1){for(let c of this._deps)if(c.prevData!==void 0||c.dataBatch.length!==0||c.terminal!==void 0||c.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let i;try{i=this._config.onSubscribe(this,t,{sinkCount:this._sinkCount,afterTerminalReset:s},this._actions)}catch(c){throw this._sinkCount-=1,c}this._sinks==null?this._sinks=t:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,t]):this._sinks.add(t);let a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(c){if(this._sinkCount-=1,this._removeSink(t),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}catch{}throw c}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let o=!1;return()=>{o||(o=!0,this._sinkCount-=1,this._removeSink(t),typeof i=="function"&&i(),this._sinks==null&&this._deactivate())}}_removeSink(t){if(this._sinks===t)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(t),this._sinks.size===1){let[n]=this._sinks;this._sinks=n}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let t=this._deps.length,n=0;try{for(let r=0;r<t;r++){let s=r,i=this._deps[r];i.unsub=ct,i.unsub=i.node.subscribe(a=>{if(i.unsub===null)return;let o=this._config.tierOf,c=!1;for(let d of a)o(d[0])>=3&&(c=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:s},this._actions);c&&this._maybeRunFnOnSettlement()}),n++}}catch(r){this._deps[n].unsub=null;for(let s=0;s<n;s++){let i=this._deps[s];if(i.unsub!=null){let a=i.unsub;i.unsub=null;try{a()}catch{}Ce(i)}}throw this._dirtyDepCount=0,r}}_addDep(t){for(let s=0;s<this._deps.length;s++)if(this._deps[s].node===t)return s;let n=this._deps.length,r=lt(t);if(this._deps.push(r),this._sinks==null)return n;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(_e),r.unsub=ct;try{r.unsub=t.subscribe(s=>{if(r.unsub===null)return;let i=this._config.tierOf,a=!1;for(let o of s)i(o[0])>=3&&(a=!0),this._config.onMessage(this,o,{direction:"down-in",depIndex:n},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(s){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,s}return n}_deactivate(t=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(r){this._emit([[v,this._wrapFnError("cleanup threw",r)]])}else if(n!=null&&typeof n=="object"){let r=n.deactivate;if(typeof r=="function")try{r()}catch(s){this._emit([[v,this._wrapFnError("cleanup.deactivate threw",s)]])}}for(let r of this._deps){if(r.unsub!=null){let s=r.unsub;r.unsub=null;try{s()}catch{}}Ce(r)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),t||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(t,n){let r=this._deps[t],s=n[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:t,message:n};for(let a of this._inspectorHooks)a(i)}if(s!==G){if(s===P){this._depDirtied(r);return}if(s===U){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(Xe);return}if(s===B||s===Q){this._emit([n]);return}if(s===F){this._emit(Se);return}if(s===E)this._depSettledAsData(r,n[1]);else if(s===I)this._depSettledAsResolved(r);else if(s===C)this._depSettledAsTerminal(r,!0);else if(s===v)this._depSettledAsTerminal(r,n[1]);else{this._emit([n]);return}if(!this._fn){(s===E||s===I)&&this._emit([n]),(s===C||s===v)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(t){t.dirty||(t.dirty=!0,t.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(_e))}_depSettledAsData(t,n){t.dirty&&(t.dirty=!1,this._dirtyDepCount--),t.involvedThisWave=!0,t.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(t){t.dirty&&(t.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(t,n){t.dirty&&(t.dirty=!1,this._dirtyDepCount--),t.terminal=n,t.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(t){t.prevData=void 0,t.terminal=void 0,t.dataBatch.length=0,t.dirty?t.involvedThisWave=!1:(t.dirty=!0,t.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let t=0;t<this._deps.length;t++){let n=this._deps[t];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(Ye),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let t=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(t!=null){this._autoError&&this._emit([[v,t.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(Ze)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let t=this._cleanup;if(typeof t=="function"){this._cleanup=void 0;try{t()}catch(a){this._emit([[v,this._wrapFnError("cleanup threw",a)]]);return}}else if(t!=null&&typeof t=="object"){let a=t.beforeRun;if(typeof a=="function"){t.beforeRun=void 0;try{a()}catch(o){this._emit([[v,this._wrapFnError("cleanup.beforeRun threw",o)]]);return}}}let n=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),r=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let o=n[a];o!=null&&o.length>0&&(this._deps[a].prevData=o[o.length-1])}let s=this._deps.map(a=>a.terminal),i={prevData:r,terminalDeps:s,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:n,prevData:r};for(let o of this._inspectorHooks)o(a)}this._isExecutingFn=!0;try{let a=this._fn(n,this._actions,i);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let o=a;(typeof o.beforeRun=="function"||typeof o.deactivate=="function"||typeof o.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[v,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>dt?(this._rerunDepth=0,this._emit([[v,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${dt} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let t of this._deps)t.involvedThisWave=!1,t.dataBatch.length=0}_wrapFnError(t,n){let r=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${t}: ${r}`,{cause:n})}_frameBatch(t){let n=this._config.tierOf;if(t.length===1)return n(t[0][0])===3&&this._status!=="dirty"?[j,t[0]]:t;let r=!0,s=!1,i=!1,a=-1;for(let c of t){let d=n(c[0]);d<a&&(r=!1),d===3&&(s=!0),c[0]===P&&(i=!0),a=d}let o=t;if(!r){let c=t.map((d,l)=>({m:d,i:l,tier:n(d[0])}));c.sort((d,l)=>d.tier-l.tier||d.i-l.i),o=c.map(d=>d.m)}if(s&&!i&&this._status!=="dirty"){let c=0;for(;c<o.length&&n(o[c][0])===0;)c++;return c===0?[j,...o]:[...o.slice(0,c),j,...o.slice(c)]}return o}_emit(t){if(t.length===0)return;for(let o=0;o<t.length;o++){let c=t[o];if(c[0]===v&&c[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let n=t;if(this._isTerminal&&!this._resubscribable){let o=t.filter(c=>c[0]===F||c[0]===U);if(o.length===0)return;n=o}n=this._frameBatch(n);let s=null;for(let o=0;o<n.length;o++){let c=n[o],d=c[0];if(d!==B&&d!==Q){s?.push(c);continue}if(c.length<2)throw new Error(`Node "${this.name}": [[${d===B?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let l=!0;if(this._pausable!==!1){let u=c[1];if(d===B)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(u),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(u))l=!1;else if(this._pauseLocks.delete(u),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let p=this._pauseBuffer;this._pauseBuffer=[],this._emit(p)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}l?s?.push(c):s==null&&(s=n.slice(0,o))}if(s!=null){if(s.length===0)return;n=s}if(this._hasMeta&&n.some(o=>o[0]===F))for(let o of Object.keys(this.meta))try{this.meta[o]._emit(Se)}catch{}let{finalMessages:i,equalsError:a}=this._updateState(n);if(i.length>0&&this._config.inspectorEnabled){let o=this._config.globalInspector;if(o!=null)try{o({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let o=this._config.tierOf,c=[];for(let d of i)o(d[0])===3?this._pauseBuffer.push(d):c.push(d);c.length>0&&this._dispatchOrAccumulate(c)}else this._dispatchOrAccumulate(i);a!=null&&this._emit([[v,a]])}_updateState(t){let n=this._config.tierOf,r,s,i=-1,a=0;for(let l of t)n(l[0])===3&&a++;let o=a<=1,c=-1;if(this._versioning!=null&&a>1){for(let l=t.length-1;l>=0;l--)if(t[l][0]===E){c=l;break}}for(let l=0;l<t.length;l++){let u=t[l],p=u[0];if(p===E){if(u.length>=2){let f=!1;if(o&&this._cached!==void 0)try{f=this._equals(this._cached,u[1])}catch(g){s=this._wrapFnError("equals threw",g),i=l;break}if(f){r==null&&(r=t.slice(0,l)),r.push(ve),this._status="resolved";continue}this._cached=u[1],this._versioning!=null&&(c<0||l===c)&&it(this._versioning,u[1],this._hashFn)}this._status="settled",r?.push(u)}else if(r?.push(u),p===P)this._status="dirty";else if(p===I)this._status="resolved";else if(p===C){this._status="completed";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===v){this._status="errored";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===U){if(this._cached!==void 0){let g=this._config.rigorRecorder;if(g!=null)try{g.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let f=this._cleanup;if(typeof f=="function"){this._cleanup=void 0;try{f()}catch{}}else if(f!=null&&typeof f=="object"){let g=f.invalidate;if(typeof g=="function")try{g()}catch{}}}else p===F&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=i>=0?r??t.slice(0,i):r??t;return s!=null?{finalMessages:d,equalsError:s}:{finalMessages:d}}_deliverToSinks=t=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(t);return}let n=[...this._sinks];for(let r of n)r(t)};_dispatchOrAccumulate(t){if(qe()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Je(()=>this._flushBatchPending()));for(let n of t)this._batchPendingMessages.push(n);return}te(this._deliverToSinks,t,this._config.tierOf)}_flushBatchPending(){let t=this._batchPendingMessages;if(t===null||(this._batchPendingMessages=null,t.length===0))return;let n=this._frameBatch(t);te(this._deliverToSinks,n,this._config.tierOf)}},ut=e=>Array.isArray(e),Me=e=>typeof e=="object"&&e!=null&&!Array.isArray(e)});function ae(e,t){return pt((r,s,i)=>e(s,i)??void 0,{describeKind:"producer",...t})}var mt=R(()=>{"use strict";ft()});function Le(e){return{describeKind:"producer",...e}}function gt(e,t){return ae(n=>{let r=!1;try{for(let s of e){if(r)return;n.emit(s)}r||n.down([[C]])}catch(s){r||n.down([[v,s]])}return()=>{r=!0}},Le(t))}function fn(e){return e!=null&&typeof e.then=="function"}function mn(e,t){let{signal:n,...r}=t??{};return ae(s=>{let i=!1,a=()=>{i||(i=!0,s.down([[v,n.reason]]))};if(n?.aborted){a();return}return n?.addEventListener("abort",a,{once:!0}),Promise.resolve(e).then(o=>{i||(i=!0,n?.removeEventListener("abort",a),s.emit(o),s.down([[C]]))},o=>{i||(i=!0,n?.removeEventListener("abort",a),s.down([[v,o]]))}),()=>{i=!0,n?.removeEventListener("abort",a)}},Le(r))}function gn(e,t){let{signal:n,...r}=t??{};return ae(s=>{let i=new AbortController,a=()=>i.abort(n?.reason);n?.aborted?i.abort(n.reason):n?.addEventListener("abort",a,{once:!0});let o=n??i.signal,c=!1,d=e[Symbol.asyncIterator](),l=()=>{c||o.aborted||Promise.resolve(d.next()).then(u=>{if(!(c||o.aborted)){if(u.done){s.down([[C]]);return}s.emit(u.value),l()}},u=>{!c&&!o.aborted&&s.down([[v,u]])})};return l(),()=>{c=!0,n?.removeEventListener("abort",a),i.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},Le(r))}function hn(e){return e!=null&&typeof e=="object"&&"cache"in e&&typeof e.subscribe=="function"}function Y(e,t){if(hn(e))return e;if(fn(e))return mn(e,t);if(e!=null){let n=e;if(typeof n[Symbol.asyncIterator]=="function")return gn(e,t);if(typeof n[Symbol.iterator]=="function")return gt(e,t)}return yn(e)}function yn(...e){return gt(e,void 0)}function K(e){return new Promise((t,n)=>{let r=!1,s=!1,i;i=e.subscribe(a=>{for(let o of a){if(r)return;if(o[0]===E){r=!0,t(o[1]),i?(i(),i=void 0):s=!0;return}if(o[0]===v){r=!0,n(o[1]),i?(i(),i=void 0):s=!0;return}if(o[0]===C){r=!0,n(new Error("completed without DATA")),i?(i(),i=void 0):s=!0;return}}}),s&&(i?.(),i=void 0)})}var ht=R(()=>{"use strict";ne();mt()});var ce=R(()=>{"use strict";ht()});var V,Oe=R(()=>{"use strict";V=class{_timer;_gen=0;start(t,n){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&n()},t)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});function bn(e){return e<0?0:e}function yt(e){let t=Math.max(1,e?.failureThreshold??5),n=bn(e?.cooldownNs??30*1e9),r=e?.cooldown??null,s=Math.max(1,e?.halfOpenMax??1),i=e?.now??w,a="closed",o=0,c=0,d=0,l=n,u=0;function p(){if(!r)return n;let y=r(c);return y!==null?y:n}function f(){a="open",l=p(),d=i(),u=0}return{canExecute(){return a==="closed"?!0:a==="open"?i()-d>=l?(a="half-open",u=1,!0):!1:u<s?(u++,!0):!1},recordSuccess(){a==="half-open"?(a="closed",o=0,c=0):a==="closed"&&(o=0)},recordFailure(y){if(a==="half-open"){c++,f();return}a==="closed"&&(o++,o>=t&&f())},get state(){return a},get failureCount(){return o},reset(){a="closed",o=0,c=0,u=0}}}var Rr,bt=R(()=>{"use strict";L();Rr=Object.freeze({droppedCount:0,pendingCount:0,paused:!1})});var kt=R(()=>{"use strict";bt()});var zn={};qt(zn,{chromeNanoAdapter:()=>q,cloudFirstPreset:()=>Kn,localFirstPreset:()=>Vn,offlinePreset:()=>Wn,webllmAdapter:()=>J});module.exports=Qt(zn);L();function Ke(){let e=new Error("aborted");return e.name="AbortError",e}function q(e={}){let t=e.streamMode??"accumulated",n=e.navigatorOverride??globalThis.navigator,r=()=>{let o=n?.ai;if(!o?.languageModel)throw new Error("chromeNanoAdapter: Chrome AI languageModel not available (requires Chrome 131+ with flag/OT).");return o},s=async o=>r().languageModel.create({systemPrompt:o?.systemPrompt??e.systemPrompt,temperature:o?.temperature??e.temperature,topK:e.topK,signal:o?.signal}),i=o=>{let c=[];for(let d of o)d.role!=="system"&&c.push(`${d.role}: ${d.content}`);return c.join(`
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2
16
 
3
- `)},a=()=>({input:{regular:0},output:{regular:0}});return{provider:"chrome-nano",model:"chrome-nano",async invoke(o,c){let d=await s(c);try{let l=i(o),u=w(),p=await d.prompt(l,{signal:c?.signal}),f=Math.max(0,(w()-u)/1e6);return{content:p,usage:a(),finishReason:"stop",latencyMs:f,model:"chrome-nano",provider:"chrome-nano"}}finally{d.destroy?.()}},async*stream(o,c){let d=await s(c);try{let l=i(o);if(t==="delta")for await(let u of d.promptStreaming(l,{signal:c?.signal})){if(c?.signal?.aborted)throw Ke();u&&(yield{type:"token",delta:u})}else{let u="";for await(let p of d.promptStreaming(l,{signal:c?.signal})){if(c?.signal?.aborted)throw Ke();let f=p.startsWith(u)?p.slice(u.length):p;u=p,f&&(yield{type:"token",delta:f})}}yield{type:"usage",usage:a()},yield{type:"finish",reason:"stop"}}finally{d.destroy?.()}}}}L();function Yt(){let e=new Error("aborted");return e.name="AbortError",e}function J(e){let t=e.engine,n=async()=>{if(t)return t;if(!Xt(e.navigatorOverride))throw new Error("webllmAdapter: WebGPU not available in this environment");let a=(await import("@mlc-ai/web-llm").catch(()=>{throw new Error("webllmAdapter: @mlc-ai/web-llm not installed. Add it as a peer dependency or pass opts.engine.")})).CreateMLCEngine;if(!a)throw new Error("webllmAdapter: @mlc-ai/web-llm missing CreateMLCEngine export");return t=await a(e.model,{initProgressCallback:e.initProgressCallback}),t},r=(i,a)=>{let o=[];a?.systemPrompt&&o.push({role:"system",content:a.systemPrompt});for(let c of i)o.push({role:c.role==="tool"?"user":c.role,content:c.content});return o},s=i=>({input:{regular:i?.prompt_tokens??0},output:{regular:i?.completion_tokens??0},raw:i});return{provider:"webllm",model:e.model,async invoke(i,a){let o=await n(),c=w(),d=await o.chat.completions.create({model:a?.model??e.model,messages:r(i,a),max_tokens:a?.maxTokens,temperature:a?.temperature},{signal:a?.signal}),l=Math.max(0,(w()-c)/1e6),u=d.choices?.[0];return{content:u?.message?.content??"",usage:s(d.usage),finishReason:u?.finish_reason,latencyMs:l,model:e.model,provider:"webllm"}},async*stream(i,a){let c=await(await n()).chat.completions.create({model:a?.model??e.model,messages:r(i,a),max_tokens:a?.maxTokens,temperature:a?.temperature,stream:!0},{signal:a?.signal}),d,l;for await(let u of c){if(a?.signal?.aborted)throw Yt();let p=u.choices?.[0];p?.delta?.content&&(yield{type:"token",delta:p.delta.content}),p?.finish_reason&&(l=p.finish_reason),u.usage&&(d=u.usage)}d&&(yield{type:"usage",usage:s(d)}),yield{type:"finish",reason:l??"stop"}}}}function Xt(e){let t=e??globalThis.navigator;return!!(t&&"gpu"in t&&t.gpu)}L();async function*W(e,t){let n=t?.parse??(k=>k),r=t?.signal,s=new TextDecoder,i="",a="message",o=[],c,d,l=[],u=()=>{if(o.length===0&&a==="message"&&c===void 0){o=[];return}let k=o.join(`
4
- `);l.push({event:a,data:n(k),id:c,retry:d}),a="message",o=[],c=void 0,d=void 0},p=k=>{if(k===""){u();return}if(k.startsWith(":"))return;let b=k.indexOf(":"),T=b<0?k:k.slice(0,b),x=b<0?"":k.slice(b+1);switch(x.startsWith(" ")&&(x=x.slice(1)),T){case"event":a=x;break;case"data":o.push(x);break;case"id":x.includes("\0")||(c=x);break;case"retry":{let N=Number(x);Number.isFinite(N)&&(d=N);break}}},f=(k,b)=>{i+=s.decode(k,{stream:!b});let T=i.split(/\r?\n/);i=T.pop()??"";for(let x of T)p(x)},g=e,y=e instanceof ReadableStream?e:g&&typeof g=="object"&&g.body instanceof ReadableStream?g.body:null,m,h,_=!1,S=()=>{_||(_=!0,m&&m.cancel().catch(()=>{}),h&&typeof h.return=="function"&&Promise.resolve(h.return()).catch(()=>{}))},M=()=>{S()};if(r){if(r.aborted)return;r.addEventListener("abort",M,{once:!0})}try{if(y){for(m=y.getReader();!r?.aborted;){let{value:k,done:b}=await m.read();if(b)break;for(f(k,!1);l.length>0;)yield l.shift()}f(new Uint8Array,!0)}else{for(h=e[Symbol.asyncIterator]();!r?.aborted;){let b=await h.next();if(b.done)break;for(f(b.value,!1);l.length>0;)yield l.shift()}f(new Uint8Array,!0)}if(i.trim()){for(let k of i.split(/\r?\n/))p(k);u()}for(;l.length>0;)yield l.shift()}finally{r&&r.removeEventListener("abort",M),S()}}async function O(e,t){let n;try{n=await e.text()}catch{n=""}let r=t??"HTTP",s=new Error(`${r} API ${e.status}: ${e.statusText}${n?` \u2014 ${n}`:""}`);return s.status=e.status,s.headers=e.headers,s}function Tt(e={}){return e.sdk?xn(e):vn(e)}function de(e,t,n,r){let s=t?.model??n;if(!s)throw new Error("anthropicAdapter: model must be set via options.model or invokeOpts.model");let{system:i,chat:a}=kn(e,t?.systemPrompt),o={model:s,messages:a.map(Tn),max_tokens:t?.maxTokens??4096};return i&&(o.system=i),t?.temperature!=null&&(o.temperature=t.temperature),t?.tools&&t.tools.length>0&&(o.tools=t.tools.map(wn)),t?.maxReasoningTokens!=null&&(o.thinking={type:"enabled",budget_tokens:t.maxReasoningTokens}),t?.cacheHint,r&&(o.stream=!0),t?.providerExtras&&Object.assign(o,t.providerExtras),o}function kn(e,t){let n=[];t&&n.push(t);let r=[];for(let s of e)s.role==="system"?n.push(s.content):r.push(s);return{system:n.length>0?n.join(`
5
-
6
- `):void 0,chat:r}}function Tn(e){if(e.role==="tool")return{role:"user",content:[{type:"tool_result",tool_use_id:e.toolCallId,content:e.content}]};if(e.role==="assistant"&&e.toolCalls&&e.toolCalls.length>0){let t=[];e.content&&t.push({type:"text",text:e.content});for(let n of e.toolCalls)t.push({type:"tool_use",id:n.id,name:n.name,input:n.arguments});return{role:"assistant",content:t}}return{role:e.role,content:e.content}}function wn(e){return{name:e.name,description:e.description,input_schema:e.parameters}}function le(e,t){if(!e)return{...t};let n={...e};return t.input_tokens!=null&&(n.input_tokens=t.input_tokens),t.output_tokens!=null&&(n.output_tokens=t.output_tokens),t.cache_read_input_tokens!=null&&(n.cache_read_input_tokens=t.cache_read_input_tokens),t.cache_creation_input_tokens!=null&&(n.cache_creation_input_tokens=t.cache_creation_input_tokens),t.cache_creation&&(n.cache_creation={...e.cache_creation??{},...t.cache_creation}),t.server_tool_use&&(n.server_tool_use={...e.server_tool_use??{},...t.server_tool_use}),n}function Pe(e){let t={input:{regular:e?.input_tokens??0},output:{regular:e?.output_tokens??0},raw:e};return e?.cache_read_input_tokens&&(t.input.cacheRead=e.cache_read_input_tokens),e?.cache_creation?(e.cache_creation.ephemeral_5m_input_tokens&&(t.input.cacheWrite5m=e.cache_creation.ephemeral_5m_input_tokens),e.cache_creation.ephemeral_1h_input_tokens&&(t.input.cacheWrite1h=e.cache_creation.ephemeral_1h_input_tokens)):e?.cache_creation_input_tokens&&(t.input.cacheWrite5m=e.cache_creation_input_tokens),e?.server_tool_use?.web_search_requests&&(t.auxiliary={webSearchRequests:e.server_tool_use.web_search_requests}),t}function wt(e,t){let n=[],r=[];for(let s of e.content)if(s.type==="text"&&typeof s.text=="string")n.push(s.text);else if(s.type==="tool_use"){let i=s;r.push({id:i.id,name:i.name,arguments:i.input??{}})}return{content:n.join(""),toolCalls:r.length>0?r:void 0,usage:Pe(e.usage),finishReason:e.stop_reason,latencyMs:t,model:e.model,provider:"anthropic"}}function vn(e){let t=e.apiKey??globalThis.process?.env?.ANTHROPIC_API_KEY,n=e.baseURL??"https://api.anthropic.com",r=e.anthropicVersion??"2023-06-01",s=e.fetchImpl??fetch,i=()=>{if(!t)throw new Error("anthropicAdapter: apiKey required for invoke/stream (or provide opts.sdk)");return{"x-api-key":t,"anthropic-version":r,"content-type":"application/json",...e.headers??{}}};return{provider:"anthropic",model:e.model,async invoke(a,o){let c=de(a,o,e.model,!1),d=w(),l=await s(`${n}/v1/messages`,{method:"POST",headers:i(),body:JSON.stringify(c),signal:o?.signal});if(!l.ok)throw await O(l,"Anthropic");let u=await l.json(),p=Math.max(0,(w()-d)/1e6);return wt(u,p)},async*stream(a,o){let c=de(a,o,e.model,!0),d=await s(`${n}/v1/messages`,{method:"POST",headers:{...i(),accept:"text/event-stream"},body:JSON.stringify(c),signal:o?.signal});if(!d.ok)throw await O(d,"Anthropic");if(!d.body)throw new Error("anthropicAdapter: streaming response has no body");let l,u,p=new Map;for await(let f of W(d.body,{signal:o?.signal})){let g=f.data;if(!g)continue;let y;try{y=JSON.parse(g)}catch{continue}switch(y.type){case"message_start":{l=le(l,y.message.usage);break}case"content_block_start":{let m=y,h=m.content_block;h.type==="tool_use"&&(p.set(m.index,{id:String(h.id??""),name:String(h.name??""),argBuf:""}),yield{type:"tool-call-delta",delta:{id:String(h.id??""),name:String(h.name??"")}});break}case"content_block_delta":{let m=y,h=m.delta;if(h.type==="text_delta"&&typeof h.text=="string")yield{type:"token",delta:h.text};else if(h.type==="input_json_delta"&&typeof h.partial_json=="string"){let _=p.get(m.index);_&&(_.argBuf+=h.partial_json),yield{type:"tool-call-delta",delta:{argumentsDelta:h.partial_json}}}else h.type==="thinking_delta"&&typeof h.thinking=="string"&&(yield{type:"thinking",delta:h.thinking});break}case"message_delta":{let m=y;m.delta.stop_reason&&(u=m.delta.stop_reason),m.delta.usage&&(l=le(l,m.delta.usage));break}case"message_stop":break}}l&&(yield{type:"usage",usage:Pe(l)}),yield{type:"finish",reason:u??"stop"}}}}function xn(e){let t=e.sdk;if(!t)throw new Error("sdkBackedAnthropic: sdk instance required");return{provider:"anthropic",model:e.model,async invoke(n,r){let s=de(n,r,e.model,!1),i=w(),a=await t.messages.create(s,{signal:r?.signal}),o=Math.max(0,(w()-i)/1e6);return wt(a,o)},async*stream(n,r){if(!t.messages.stream)throw new Error("sdkBackedAnthropic: SDK instance does not expose .messages.stream");let s=de(n,r,e.model,!0),i,a;for await(let o of t.messages.stream(s,{signal:r?.signal}))switch(o.type){case"message_start":i=le(i,o.message.usage);break;case"content_block_delta":{let c=o.delta;c?.type==="text_delta"&&typeof c.text=="string"?yield{type:"token",delta:c.text}:c?.type==="input_json_delta"&&typeof c.partial_json=="string"?yield{type:"tool-call-delta",delta:{argumentsDelta:c.partial_json}}:c?.type==="thinking_delta"&&typeof c.thinking=="string"&&(yield{type:"thinking",delta:c.thinking});break}case"message_delta":{let c=o;c.delta.stop_reason&&(a=c.delta.stop_reason),c.delta.usage&&(i=le(i,c.delta.usage));break}}i&&(yield{type:"usage",usage:Pe(i)}),yield{type:"finish",reason:a??"stop"}}}}Oe();function ue(){let e=new Error("aborted");return e.name="AbortError",e}function vt(e,t){return e<=0?Promise.resolve():t?.aborted?Promise.reject(ue()):new Promise((n,r)=>{let s=new V,i,a=()=>{s.cancel(),t&&i&&t.removeEventListener("abort",i)};s.start(e,()=>{a(),n()}),t&&(i=()=>{a(),r(ue())},t.addEventListener("abort",i,{once:!0}))})}function pe(e={}){let t=e.provider??"dry-run",n=e.model??"dry-run-v1",r=e.latencyMs??0,s=Math.max(1,e.streamChunkSize??16),i=e.respond??(o=>{let c=[...o].reverse().find(d=>d.role==="user");return c?`echo: ${c.content}`:"dry-run: no user message"}),a=e.usage??((o,c)=>{let d=o.reduce((l,u)=>l+u.content.length,0);return{input:{regular:Math.ceil(d/4)},output:{regular:Math.ceil(c.length/4)}}});return{provider:t,model:n,async invoke(o,c){if(await vt(r,c?.signal),c?.signal?.aborted)throw ue();let d=i(o,c),l=a(o,d);return{content:d,usage:l,finishReason:"stop",model:c?.model??n,provider:t,tier:c?.tier,metadata:{dryRun:!0}}},async*stream(o,c){let d=i(o,c),l=a(o,d),u=Math.ceil(d.length/s)||1,p=r>0?r/u:0;for(let f=0;f<d.length;f+=s){if(c?.signal?.aborted)throw ue();await vt(p,c?.signal),yield{type:"token",delta:d.slice(f,f+s)}}yield{type:"usage",usage:l},yield{type:"finish",reason:"stop"}}}}L();async function fe(e){let t=typeof e=="string"?new TextEncoder().encode(e):e,n=await globalThis.crypto.subtle.digest("SHA-256",t),r=new Uint8Array(n),s="";for(let i=0;i<r.length;i++)s+=xt[r[i]];return s}var xt=new Array(256);for(let e=0;e<256;e++)xt[e]=e.toString(16).padStart(2,"0");function Ie(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Ie);let t=e,n=Object.keys(t).sort(),r={};for(let s of n)r[s]=Ie(t[s]);return r}function _t(e){return JSON.stringify(Ie(e),void 0,0)}var _n=new TextEncoder,Sn=new TextDecoder("utf-8",{fatal:!0}),An={name:"json",version:1,encode(e){return _n.encode(_t(e))},decode(e){return JSON.parse(Sn.decode(e))}};function Rn(){let e=new Map;return{name:"memory",read(t){let n=e.get(t);return n===void 0?void 0:new Uint8Array(n)},write(t,n){e.set(t,new Uint8Array(n))},delete(t){e.delete(t)},list(t){let n=[...e.keys()];return t?n.filter(r=>r.startsWith(t)).sort():n.sort()}}}function En(e,t={}){let n=t.codec??An,r=t.name??e.name??"kv",s=t.compactEvery,i=new Map,a=0,o={name:r,debounceMs:t.debounceMs,compactEvery:s,filter:t.filter,save(d,l){if(!(t.filter&&!t.filter(d,l))&&(i.set(d,l),a+=1,s!==void 0&&a%s===0||!t.debounceMs))return c()},load(d){let l=e.read(d);if(l!==void 0)return l instanceof Uint8Array?l.length===0?void 0:n.decode(l):Promise.resolve(l).then(u=>u===void 0||u.length===0?void 0:n.decode(u))},delete(d){if(i.delete(d),!!e.delete)return e.delete(d)},list(d){return e.list?e.list(d):[]},async flush(){await c()},async rollback(){i=new Map}};function c(){if(i.size===0)return;let d=i;i=new Map;let l=[];for(let[u,p]of d){let f=n.encode(p),g=e.write(u,f);g instanceof Promise&&l.push(g)}if(l.length>0)return Promise.all(l).then(()=>{})}return o}function Fe(e){return En(Rn(),e)}L();var De=class extends Error{constructor(n,r){super(`content-addressed lookup miss in read-strict mode: ${n}`);this.key=n;this.context=r;this.name="ContentAddressedMissError"}};function Ue(e){let t=new Set,n=r=>{if(r===null||typeof r!="object")return r;let s=r;if(t.has(s))return{__cycle:!0};t.add(s);try{if(Array.isArray(r))return r.map(n);let i={};for(let a of Object.keys(r).sort())i[a]=n(r[a]);return i}finally{t.delete(s)}};return JSON.stringify(n(e))}function St(e){let{storage:t,keyContext:n,keyPrefix:r,mode:s="read-write"}=e,i=n??(o=>o);async function a(o){let c=Ue(i(o)),d=await fe(c);return r?`${r}:${d}`:d}return{keyFor:a,async lookup(o){if(s==="write")return;let c=await a(o),d=await t.load(c);if(d===void 0){if(s==="read-strict")throw new De(c,o);return}return d},async store(o,c){if(s==="read")return;let d=await a(o);await t.save(d,c)},async forget(o){if(s==="read"||s==="write"||!t.delete)return;let c=await a(o);await t.delete(c)}}}ce();function At(e,t={}){let n=t.keyFn??(s=>String(s)),r=new Map;return s=>{let i=n(s),a=r.get(i);if(a)return a;let o=e(s),c;o!=null&&typeof o.then=="function"?c=Promise.resolve(o):o!=null&&typeof o=="object"&&"subscribe"in o&&"cache"in o?c=K(o):o!=null&&typeof o=="object"&&Symbol.asyncIterator in o?c=(async()=>{let u=o[Symbol.asyncIterator]();try{let{value:p,done:f}=await u.next();if(f)throw new Error("singleFromAny: factory returned empty async iterable");return p}finally{await u.return?.()}})():o!=null&&typeof o=="object"&&Symbol.iterator in o?c=(async()=>{let u=o[Symbol.iterator]();try{let{value:p,done:f}=u.next();if(f)throw new Error("singleFromAny: factory returned empty iterable");return p}finally{u.return?.()}})():c=Promise.resolve(o);let d,l=()=>{r.get(i)===d&&r.delete(i)};return d=c.then(u=>(l(),u),u=>{throw l(),u}),r.set(i,d),d}}ce();Oe();function Rt(e){let{storage:t,mode:n="read-write",keyFn:r,keyPrefix:s="llm-replay"}=e,a=St({storage:t,keyPrefix:s,mode:n==="read-strict"?"read":n,keyContext:({messages:c,opts:d})=>{let{signal:l,keyContext:u,...p}=d??{};return{messages:c,opts:p}}});async function o(c,d){if(r){if(r.length<=1){let u={messages:c,opts:d,context:d?.keyContext},p=await r(u);return`${s}:${p}`}let l=await r(c,d);return`${s}:${l}`}return a.keyFor({messages:c,opts:d})}return{keyFor:o,async lookup(c,d){if(n!=="write"){if(r){let l=await o(c,d),u=await t.load(l);return u===void 0?void 0:u}return a.lookup({messages:c,opts:d})}},async store(c,d,l){if(n!=="read"){if(r){let u=await o(c,d);await t.save(u,l);return}await a.store({messages:c,opts:d},l)}},async forget(c,d){if(!(n==="read"||n==="write")&&t.delete){if(r){let l=await o(c,d);await t.delete(l);return}await a.forget({messages:c,opts:d})}}}}function Et(e,t,n){return{provider:n?.provider??e.provider,model:n?.model??e.model,capabilities:n?.capabilities??e.capabilities?.bind(e),invoke:t.invoke,stream:t.stream}}var Ct=Symbol.for("graphrefly.adapter.middlewareLayers");function me(e,t,n){let s=[...n?Cn(n):[],t];return Object.defineProperty(e,Ct,{value:Object.freeze(s),enumerable:!1,writable:!1,configurable:!1}),e}function Cn(e){let t=e[Ct];return Array.isArray(t)?t:[]}var X=class extends Error{constructor(n,r){super(`withReplayCache: no cached response for ${r} (key=${n}, mode=read-strict)`);this.key=n;this.method=r}name="ReplayCacheMissError"};function Mt(e,t){let n=t.mode??"read-write",r=t.cacheStreaming??!1,s=t.captureStreamCadence??!1,i=t.replaySpeed??1,a=t.keyPrefix??"llm-replay",o=n==="read"||n==="read-strict",c=Rt({storage:t.storage,mode:n==="write-only"?"write":n,keyFn:t.keyFn,keyPrefix:a}),d=p=>p<=0?Promise.resolve():new Promise(f=>{new V().start(p,()=>f())}),l=At(async({messages:p,invokeOpts:f})=>await K(Y(e.invoke(p,f))),{keyFn:({_precomputedKey:p})=>p}),u=Et(e,{async invoke(p,f){let g=await c.keyFor(p,f),y=await c.lookup(p,f);if(y?.response){let h=y.response;return{...h,metadata:{...h.metadata??{},replayCache:"hit"}}}if(n==="read-strict")throw new X(g,"invoke");let m=await l({messages:p,invokeOpts:f,_precomputedKey:g});return o||await c.store(p,f,{response:m,storedAtNs:D()}),m},async*stream(p,f){if(!r){for await(let b of e.stream(p,f))yield b;return}let g=await c.keyFor(p,f),y=await c.lookup(p,f);if(y){let b=y.response;if(y.streamChunks&&y.streamCadenceMs)for(let T=0;T<y.streamChunks.length;T++){let x=y.streamCadenceMs[T]??0,N=i>0?x/i:0;N>0&&await d(N),yield{type:"token",delta:y.streamChunks[T]?.delta??""}}else b.content&&(yield{type:"token",delta:b.content});b.usage&&(yield{type:"usage",usage:b.usage}),yield{type:"finish",reason:b.finishReason??"stop"};return}if(n==="read-strict")throw new X(g,"stream");let m="",h,_,S=[],M=[],k;for await(let b of e.stream(p,f)){if(b.type==="token"&&(m+=b.delta,s)){let T=w(),x=k===void 0?0:(T-k)/1e6;M.push(x),k=T,S.push({delta:b.delta})}b.type==="usage"&&(h=b.usage),b.type==="finish"&&(_=b.reason),yield b}if((m||h)&&!o){let T={response:{content:m,usage:h??{input:{regular:0},output:{regular:0}},finishReason:_,model:e.model??f?.model??"",provider:e.provider},storedAtNs:D(),...s?{streamChunks:S,streamCadenceMs:M}:{}};await c.store(p,f,T)}}});return me(u,"withReplayCache",e),u}var Nt=Ue;function Lt(e,t){return{content:"[fallback: no cached response available for this request]",usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:t,provider:e,metadata:{degraded:!0,reason:"no-fixture"}}}function Ot(e,t,n){return typeof e=="string"?{content:e,usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:n,provider:t,metadata:{degraded:!0,reason:"respond"}}:e}async function Mn(e,t){if("key"in e)return e.key;let n=Nt({messages:e.messages,opts:e.invokeOpts??{}}),r=await fe(n);return`${t}:${r}`}function Nn(e){let t={response:e.response,storedAtNs:D()};if("key"in e&&e.stream){let n=e.stream.chunks.filter(r=>r.type==="token");return{...t,streamChunks:n.map(r=>({delta:r.delta})),streamCadenceMs:e.stream.delaysMs??n.map(()=>0)}}return t}function Ln(e,t){let n=[];if(e.fixtures!=null&&n.push("fixtures"),e.fixturesStorage!=null&&n.push("fixturesStorage"),n.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\` and \`fixturesStorage\` are mutually exclusive; got both ${n.join(" and ")}. Pick one source. For filesystem directories use the node subpath's \`fallbackAdapter\`.`);if(e.fixtures){let r=Fe(),s=e.fixtures,i=(async()=>{for(let a of s){let o=await Mn(a,t);await r.save(o,Nn(a))}})();return i.catch(()=>{}),{tier:r,seedReady:i}}return e.fixturesStorage?{tier:e.fixturesStorage,seedReady:Promise.resolve()}:{tier:void 0,seedReady:Promise.resolve()}}function Pt(e={}){let t=e.provider??"fallback",n=e.model??"fallback",r=e.onMiss??"respond",s=e.keyPrefix??"fallback",i=e.record?e.record.adapter:r==="throw"?pe({provider:t,model:n,respond:()=>"[unreachable: read-strict mode throws on miss]"}):{provider:t,model:n,async invoke(l,u){let p=e.respond?e.respond(l,u):Lt(t,n);return Ot(p,t,n)},async*stream(l,u){let p=e.respond?e.respond(l,u):Lt(t,n),f=Ot(p,t,n);yield{type:"token",delta:f.content},f.usage&&(yield{type:"usage",usage:f.usage}),yield{type:"finish",reason:f.finishReason??"stop"}}},a,o=Promise.resolve();if(e.record){if(!e.record.storage)throw new TypeError("fallbackAdapter: `record.storage` is required in record mode. For filesystem `record.dir` convenience, use the node subpath's `fallbackAdapter`.");a=e.record.storage}else{let l=Ln(e,s);a=l.tier??Fe(),o=l.seedReady}let c=e.record?"read-write":r==="throw"?"read-strict":"read",d=Mt(i,{storage:a,mode:c,keyPrefix:s,cacheStreaming:!0,captureStreamCadence:!0,replaySpeed:e.replaySpeed,...e.keyFn?{keyFn:e.keyFn}:{}});return{provider:t,model:n,capabilities:d.capabilities?.bind(d),async invoke(l,u){return await o,d.invoke(l,u)},async*stream(l,u){await o;for await(let p of d.stream(l,u))yield p}}}L();function Ft(e={}){return e.sdk?Fn(e):In(e)}function ge(e,t){let n=[],r=[];t?.systemPrompt&&n.push(t.systemPrompt);for(let a of e){if(a.role==="system"){n.push(a.content);continue}if(a.role==="tool"){r.push({role:"user",parts:[{functionResponse:{name:a.name??a.toolCallId??"tool",response:{result:a.content}}}]});continue}if(a.role==="assistant"&&a.toolCalls&&a.toolCalls.length>0){let o=[];a.content&&o.push({text:a.content});for(let c of a.toolCalls)o.push({functionCall:{name:c.name,args:c.arguments}});r.push({role:"model",parts:o});continue}r.push({role:a.role==="assistant"?"model":"user",parts:[{text:a.content}]})}let s={contents:r};n.length>0&&(s.systemInstruction={role:"system",parts:[{text:n.join(`
7
-
8
- `)}]});let i={};return t?.maxTokens!=null&&(i.maxOutputTokens=t.maxTokens),t?.temperature!=null&&(i.temperature=t.temperature),t?.maxReasoningTokens!=null&&(i.thinkingConfig={thinkingBudget:t.maxReasoningTokens}),Object.keys(i).length>0&&(s.generationConfig=i),t?.tools&&t.tools.length>0&&(s.tools=[{functionDeclarations:t.tools.map(On)}]),t?.providerExtras&&Object.assign(s,t.providerExtras),s}function On(e){return{name:e.name,description:e.description,parameters:e.parameters}}function It(e,t,n){let r={},s=e.generationConfig;s&&(typeof s.maxOutputTokens=="number"&&(r.maxOutputTokens=s.maxOutputTokens),typeof s.temperature=="number"&&(r.temperature=s.temperature),s.thinkingConfig&&(r.thinkingConfig=s.thinkingConfig)),e.systemInstruction&&(r.systemInstruction=e.systemInstruction),e.tools&&(r.tools=e.tools);for(let[i,a]of Object.entries(e))i==="contents"||i==="generationConfig"||i==="systemInstruction"||i==="tools"||i==="abortSignal"||i==="model"||(r[i]=a);return n&&(r.abortSignal=n),{model:t,contents:e.contents,config:Object.keys(r).length>0?r:void 0}}function Be(e){let t={input:{regular:0},output:{regular:0},raw:e};if(!e)return t;let n=e.promptTokenCount??0,r=e.cachedContentTokenCount??0;if(t.input.regular=Math.max(0,n-r),r>0&&(t.input.cacheRead=r),e.toolUsePromptTokenCount&&(t.input.toolUse=e.toolUsePromptTokenCount),e.promptTokensDetails)for(let s of e.promptTokensDetails){let i=s.modality?.toLowerCase();i==="image"?t.input.image=(t.input.image??0)+s.tokenCount:i==="audio"?t.input.audio=(t.input.audio??0)+s.tokenCount:i==="video"&&(t.input.video=(t.input.video??0)+s.tokenCount)}return t.output.regular=e.candidatesTokenCount??0,e.thoughtsTokenCount&&(t.output.reasoning=e.thoughtsTokenCount),t}function Dt(e,t){let n=e.candidates?.[0],r=n?.content?.parts??[],s=[],i=[],a=0;for(let o of r)typeof o.text=="string"&&s.push(o.text),o.functionCall&&i.push({id:`${o.functionCall.name}-${a++}`,name:o.functionCall.name,arguments:o.functionCall.args??{}});return{content:s.join(""),toolCalls:i.length>0?i:void 0,usage:Be(e.usageMetadata),finishReason:n?.finishReason,latencyMs:t,model:e.modelVersion,provider:"google"}}function Pn(e){if(e.apiKey)return e.apiKey;let t=globalThis.process?.env;return t?.GOOGLE_API_KEY??t?.GEMINI_API_KEY}function In(e){let t=e.baseURL??"https://generativelanguage.googleapis.com/v1beta",n=e.fetchImpl??fetch,r=i=>{let a=i?.model??e.model;if(!a)throw new Error("googleAdapter: model must be set via options.model or invokeOpts.model");return a},s=()=>{let i=Pn(e);if(!i)throw new Error("googleAdapter: apiKey required for invoke/stream");return`key=${encodeURIComponent(i)}`};return{provider:"google",model:e.model,async invoke(i,a){let o=r(a),c=ge(i,a),d=w(),l=`${t}/models/${encodeURIComponent(o)}:generateContent?${s()}`,u=await n(l,{method:"POST",headers:{"content-type":"application/json",...e.headers??{}},body:JSON.stringify(c),signal:a?.signal});if(!u.ok)throw await O(u,"Google");let p=await u.json(),f=Math.max(0,(w()-d)/1e6);return Dt(p,f)},async*stream(i,a){let o=r(a),c=ge(i,a),d=`${t}/models/${encodeURIComponent(o)}:streamGenerateContent?alt=sse&${s()}`,l=await n(d,{method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream",...e.headers??{}},body:JSON.stringify(c),signal:a?.signal});if(!l.ok)throw await O(l,"Google");if(!l.body)throw new Error("googleAdapter: streaming response has no body");let u,p;for await(let f of W(l.body,{signal:a?.signal})){if(!f.data)continue;let g;try{g=JSON.parse(f.data)}catch{continue}let y=g.candidates?.[0];for(let m of y?.content?.parts??[])typeof m.text=="string"&&(m.thought?yield{type:"thinking",delta:m.text}:yield{type:"token",delta:m.text}),m.functionCall&&(yield{type:"tool-call-delta",delta:{name:m.functionCall.name,argumentsDelta:JSON.stringify(m.functionCall.args??{})}});y?.finishReason&&(p=y.finishReason),g.usageMetadata&&(u=g.usageMetadata)}u&&(yield{type:"usage",usage:Be(u)}),yield{type:"finish",reason:p??"stop"}}}}function Fn(e){let t=e.sdk;if(!t)throw new Error("sdkBackedGoogle: sdk instance required");return{provider:"google",model:e.model,async invoke(n,r){let s=ge(n,r),i=r?.model??e.model;if(!i)throw new Error("googleAdapter: model required");let a=It(s,i,r?.signal),o=w(),c=await t.models.generateContent(a),d=Math.max(0,(w()-o)/1e6);return Dt(c,d)},async*stream(n,r){if(!t.models.generateContentStream)throw new Error("sdkBackedGoogle: SDK instance does not expose generateContentStream");let s=ge(n,r),i=r?.model??e.model;if(!i)throw new Error("googleAdapter: model required");let a=It(s,i,r?.signal),o,c,d=await t.models.generateContentStream(a);for await(let l of d){let u=l.candidates?.[0];for(let p of u?.content?.parts??[])typeof p.text=="string"&&(p.thought?yield{type:"thinking",delta:p.text}:yield{type:"token",delta:p.text}),p.functionCall&&(yield{type:"tool-call-delta",delta:{name:p.functionCall.name,argumentsDelta:JSON.stringify(p.functionCall.args??{})}});u?.finishReason&&(c=u.finishReason),l.usageMetadata&&(o=l.usageMetadata)}o&&(yield{type:"usage",usage:Be(o)}),yield{type:"finish",reason:c??"stop"}}}}L();var Dn={openai:{baseURL:"https://api.openai.com/v1",apiKeyEnv:"OPENAI_API_KEY",provider:"openai"},openrouter:{baseURL:"https://openrouter.ai/api/v1",apiKeyEnv:"OPENROUTER_API_KEY",provider:"openrouter"},groq:{baseURL:"https://api.groq.com/openai/v1",apiKeyEnv:"GROQ_API_KEY",provider:"groq"},ollama:{baseURL:"http://localhost:11434/v1",provider:"ollama"},deepseek:{baseURL:"https://api.deepseek.com/v1",apiKeyEnv:"DEEPSEEK_API_KEY",provider:"deepseek"},xai:{baseURL:"https://api.x.ai/v1",apiKeyEnv:"XAI_API_KEY",provider:"xai"}};function Ut(e={}){return e.sdk?Hn(e):jn(e)}function he(e,t,n,r,s){let i=t?.model??n;if(!i)throw new Error("openAICompatAdapter: model must be set via options.model or invokeOpts.model");let a=e.map(Un);t?.systemPrompt&&!e.some(c=>c.role==="system")&&a.unshift({role:"system",content:t.systemPrompt});let o={model:i,messages:a};return t?.maxTokens!=null&&(o.max_tokens=t.maxTokens),t?.temperature!=null&&(o.temperature=t.temperature),t?.tools&&t.tools.length>0&&(o.tools=t.tools.map(Bn)),t?.maxReasoningTokens!=null&&(o.reasoning={max_tokens:t.maxReasoningTokens}),r&&(o.stream=!0,o.stream_options={include_usage:!0}),s&&Object.assign(o,s),t?.providerExtras&&Object.assign(o,t.providerExtras),o}function Un(e){return e.role==="tool"?{role:"tool",tool_call_id:e.toolCallId,content:e.content}:e.role==="assistant"&&e.toolCalls&&e.toolCalls.length>0?{role:"assistant",content:e.content||null,tool_calls:e.toolCalls.map(t=>({id:t.id,type:"function",function:{name:t.name,arguments:JSON.stringify(t.arguments)}}))}:{role:e.role,content:e.content}}function Bn(e){return{type:"function",function:{name:e.name,description:e.description,parameters:e.parameters}}}function Ge(e){let t={input:{regular:0},output:{regular:0},raw:e};if(!e)return t;let n=e.prompt_tokens??0,r=e.prompt_tokens_details?.cached_tokens??0;e.prompt_cache_hit_tokens!=null?(r=e.prompt_cache_hit_tokens,t.input.regular=e.prompt_cache_miss_tokens??Math.max(0,n-r)):t.input.regular=Math.max(0,n-r),r>0&&(t.input.cacheRead=r),e.prompt_tokens_details?.audio_tokens&&(t.input.audio=e.prompt_tokens_details.audio_tokens);let s=e.completion_tokens??0,i=e.completion_tokens_details?.reasoning_tokens??0;return t.output.regular=Math.max(0,s-i),i>0&&(t.output.reasoning=i),e.completion_tokens_details?.audio_tokens&&(t.output.audio=e.completion_tokens_details.audio_tokens),e.completion_tokens_details?.accepted_prediction_tokens&&(t.output.predictionAccepted=e.completion_tokens_details.accepted_prediction_tokens),e.completion_tokens_details?.rejected_prediction_tokens&&(t.output.predictionRejected=e.completion_tokens_details.rejected_prediction_tokens),t}function Bt(e,t,n){let r=e.choices[0],s=r?.message,i=s?.content??"",a=(s?.tool_calls??[]).map(o=>({id:o.id,name:o.function.name,arguments:Gn(o.function.arguments)}));return{content:i,toolCalls:a.length>0?a:void 0,usage:Ge(e.usage),finishReason:r?.finish_reason,latencyMs:t,model:e.model,provider:n}}function Gn(e){try{let t=JSON.parse(e);return typeof t=="object"&&t!=null?t:{_raw:e}}catch{return{_raw:e}}}function Gt(e){let t=e.preset??"openai",n=Dn[t],r=e.baseURL??n.baseURL,s=e.provider??n.provider,i=n.apiKeyEnv,a=e.apiKey??(i?globalThis.process?.env?.[i]:void 0);return{provider:s,baseURL:r,apiKey:a}}function jn(e){let{provider:t,baseURL:n,apiKey:r}=Gt(e),s=e.fetchImpl??fetch,i=t!=="ollama",a=()=>{let o={"content-type":"application/json",...e.headers??{}};if(i){if(!r)throw new Error(`openAICompatAdapter[${t}]: apiKey required for invoke/stream`);o.authorization=`Bearer ${r}`}return o};return{provider:t,model:e.model,async invoke(o,c){let d=he(o,c,e.model,!1,e.bodyExtras),l=w(),u=await s(`${n}/chat/completions`,{method:"POST",headers:a(),body:JSON.stringify(d),signal:c?.signal});if(!u.ok)throw await O(u,t);let p=await u.json(),f=Math.max(0,(w()-l)/1e6);return Bt(p,f,t)},async*stream(o,c){let d=he(o,c,e.model,!0,e.bodyExtras),l=await s(`${n}/chat/completions`,{method:"POST",headers:{...a(),accept:"text/event-stream"},body:JSON.stringify(d),signal:c?.signal});if(!l.ok)throw await O(l,t);if(!l.body)throw new Error(`openAICompatAdapter[${t}]: streaming response has no body`);let u,p;for await(let f of W(l.body,{signal:c?.signal})){if(!f.data||f.data==="[DONE]")continue;let g;try{g=JSON.parse(f.data)}catch{continue}let y=g.choices;if(y){let m=y[0];if(m?.delta?.content&&(yield{type:"token",delta:m.delta.content}),m?.delta?.reasoning_content&&(yield{type:"thinking",delta:m.delta.reasoning_content}),m?.delta?.tool_calls)for(let h of m.delta.tool_calls)yield{type:"tool-call-delta",delta:{id:h.id,name:h.function?.name,argumentsDelta:h.function?.arguments}};m?.finish_reason&&(p=m.finish_reason)}g.usage&&(u=g.usage,yield{type:"usage",usage:Ge(u)})}yield{type:"finish",reason:p??"stop"}}}}function Hn(e){let t=e.sdk;if(!t)throw new Error("sdkBackedOpenAI: sdk instance required");let{provider:n}=Gt(e);return{provider:n,model:e.model,async invoke(r,s){let i=he(r,s,e.model,!1,e.bodyExtras),a=w(),o=await t.chat.completions.create(i,{signal:s?.signal}),c=Math.max(0,(w()-a)/1e6);return Bt(o,c,n)},async*stream(r,s){let i=he(r,s,e.model,!0,e.bodyExtras),a=await t.chat.completions.create(i,{signal:s?.signal}),o,c;for await(let d of a){let l=d.choices;if(l){let p=l[0];if(p?.delta?.content&&(yield{type:"token",delta:p.delta.content}),p?.delta?.reasoning_content&&(yield{type:"thinking",delta:p.delta.reasoning_content}),p?.delta?.tool_calls)for(let f of p.delta.tool_calls)yield{type:"tool-call-delta",delta:{id:f.id,name:f.function?.name,argumentsDelta:f.function?.arguments}};p?.finish_reason&&(c=p.finish_reason)}let u=d.usage;u&&(o=u,yield{type:"usage",usage:Ge(u)})}yield{type:"finish",reason:c??"stop"}}}}function je(e){switch(e.provider){case"anthropic":{let t={apiKey:e.apiKey,model:e.model,baseURL:e.baseURL,headers:e.headers,sdk:e.sdk,fetchImpl:e.fetchImpl,...e.extras};return Tt(t)}case"google":{let t={apiKey:e.apiKey,model:e.model,baseURL:e.baseURL,headers:e.headers,sdk:e.sdk,fetchImpl:e.fetchImpl,...e.extras};return Ft(t)}case"dry-run":{let t={model:e.model,...e.extras};return pe(t)}case"fallback":{let t={provider:e.provider,model:e.model,...e.extras};return Pt(t)}case"openai":case"openrouter":case"groq":case"ollama":case"deepseek":case"xai":{let t={preset:e.provider,apiKey:e.apiKey,model:e.model,baseURL:e.baseURL,headers:e.headers,bodyExtras:e.bodyExtras,sdk:e.sdk,fetchImpl:e.fetchImpl,...e.extras};return Ut(t)}default:{let t=e.provider;throw new Error(`createAdapter: unknown provider: ${String(t)}`)}}}kt();ce();var ye=class extends Error{name="AllTiersExhaustedError";skipped;failed;constructor(t){let n=[];t.failed.size>0&&n.push(`failed=[${[...t.failed.keys()].join(",")}]`),t.skipped.length>0&&n.push(`skipped=[${t.skipped.map(r=>`${r.name}(${r.reason})`).join(",")}]`),super(`All LLM adapter tiers exhausted: ${n.join(" ")}`),this.skipped=t.skipped,this.failed=t.failed}};function be(e,t={}){if(e.length===0)throw new RangeError("cascadingLlmAdapter: tiers must be non-empty");let n=e.map(i=>({name:i.name,adapter:i.adapter,filter:i.filter,breaker:i.breaker?"canExecute"in i.breaker?i.breaker:yt(i.breaker):void 0})),r=t.streamRetryBeforeFirstChunk??!0,s={provider:"cascading",model:void 0,async invoke(i,a){let o=[],c=new Map;for(let l=0;l<n.length;l++){let u=n[l];if(u.filter&&!u.filter(i,a)){o.push({name:u.name,reason:"filter"});continue}if(u.breaker&&!u.breaker.canExecute()){o.push({name:u.name,reason:"breaker"});continue}try{let p=await K(Y(u.adapter.invoke(i,a)));return u.breaker?.recordSuccess(),{...p,metadata:{...p.metadata??{},tier:u.name}}}catch(p){c.set(u.name,p),u.breaker?.recordFailure(p);let f=n[l+1];f&&t.onFallback?.(u.name,f.name,p)}}let d={skipped:o,failed:c};throw t.onExhausted?.(d),new ye(d)},async*stream(i,a){let o=[],c=new Map;for(let l=0;l<n.length;l++){let u=n[l];if(u.filter&&!u.filter(i,a)){o.push({name:u.name,reason:"filter"});continue}if(u.breaker&&!u.breaker.canExecute()){o.push({name:u.name,reason:"breaker"});continue}let p=!1;try{for await(let f of u.adapter.stream(i,a))p=!0,yield f;u.breaker?.recordSuccess();return}catch(f){if(c.set(u.name,f),u.breaker?.recordFailure(f),p||!r)throw f;let g=n[l+1];g&&t.onFallback?.(u.name,g.name,f)}}let d={skipped:o,failed:c};throw t.onExhausted?.(d),new ye(d)}};return me(s,`cascade[${n.map(i=>i.name).join(",")}]`),s}function Kn(e){let t=[{name:"cloud",adapter:je(e.cloud)}];return e.webllmModel&&t.push({name:"webllm",adapter:J({model:e.webllmModel})}),e.chromeNano!==!1&&t.push({name:"chrome-nano",adapter:q(),filter:(n,r)=>!r?.tools||r.tools.length===0}),be(t,e.cascade)}function Vn(e){let t=[{name:"ollama",adapter:je({provider:"ollama",model:e.ollamaModel,baseURL:e.ollamaBaseURL})}];return e.webllmModel&&t.push({name:"webllm",adapter:J({model:e.webllmModel})}),e.chromeNano!==!1&&t.push({name:"chrome-nano",adapter:q(),filter:(n,r)=>!r?.tools||r.tools.length===0}),be(t,e.cascade)}function Wn(e){let t=[{name:"webllm",adapter:J({model:e.webllmModel})}];return e.chromeNano!==!1&&t.push({name:"chrome-nano",adapter:q(),filter:(n,r)=>!r?.tools||r.tools.length===0}),be(t,e.cascade)}0&&(module.exports={chromeNanoAdapter,cloudFirstPreset,localFirstPreset,offlinePreset,webllmAdapter});
17
+ // src/patterns/ai/browser.ts
18
+ var browser_exports = {};
19
+ module.exports = __toCommonJS(browser_exports);
20
+ __reExport(browser_exports, require("@graphrefly/pure-ts/patterns/ai/browser"), module.exports);
21
+ //# sourceMappingURL=browser.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/patterns/ai/browser.ts"],"sourcesContent":["// Phase 13.9.A shim — re-export from pure-TS sibling until\n// @graphrefly/native (napi binding) and per-milestone swap-overs land.\nexport * from \"@graphrefly/pure-ts/patterns/ai/browser\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,4BAAc,oDAFd;","names":[]}