@graphrefly/graphrefly 0.44.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 (420) 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 -3
  59. package/dist/core/index.d.ts +1 -3
  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 -958
  83. package/dist/extra/operators.d.ts +1 -958
  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 -95
  155. package/dist/index.d.ts +45 -95
  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 -20
  167. package/dist/patterns/ai/index.d.ts +1 -20
  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 -13
  203. package/dist/patterns/harness/index.d.ts +1 -13
  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 -8
  233. package/dist/patterns/orchestration/index.d.ts +1 -8
  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 -3
  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-BglDkMdX.d.cts +0 -199
  275. package/dist/cascading-MFgxu7Yo.d.ts +0 -199
  276. package/dist/chunk-2T7U5EU6.js +0 -1
  277. package/dist/chunk-3G5U5QNE.js +0 -5
  278. package/dist/chunk-4VVTGLXJ.js +0 -1
  279. package/dist/chunk-5M4CCMMD.js +0 -45
  280. package/dist/chunk-5QDBSZBV.js +0 -1
  281. package/dist/chunk-5XJ6B66J.js +0 -1
  282. package/dist/chunk-6QZNQS5B.js +0 -1
  283. package/dist/chunk-6X7AFUJV.js +0 -9
  284. package/dist/chunk-7K6PWTDQ.js +0 -1
  285. package/dist/chunk-7LIAPXJB.js +0 -1
  286. package/dist/chunk-7WPU3UHQ.js +0 -1
  287. package/dist/chunk-A5WCQ5NO.js +0 -1
  288. package/dist/chunk-APPIWSGD.js +0 -84
  289. package/dist/chunk-BEZWM2SY.js +0 -1
  290. package/dist/chunk-C72GO4IZ.js +0 -1
  291. package/dist/chunk-CB676TKJ.js +0 -1
  292. package/dist/chunk-CE6TI2TL.js +0 -1
  293. package/dist/chunk-CE72X3WO.js +0 -1
  294. package/dist/chunk-CK2E7BTU.js +0 -1
  295. package/dist/chunk-CLVB32RD.js +0 -1
  296. package/dist/chunk-CRVT7D2P.js +0 -1
  297. package/dist/chunk-D5RFJOZ2.js +0 -1
  298. package/dist/chunk-D7GPHKFH.js +0 -1
  299. package/dist/chunk-DHRX7JX4.js +0 -2
  300. package/dist/chunk-ESMPEKEV.js +0 -1
  301. package/dist/chunk-F672GV32.js +0 -1
  302. package/dist/chunk-FZMYDOWV.js +0 -1
  303. package/dist/chunk-GHBWHMRZ.js +0 -1
  304. package/dist/chunk-GLERH466.js +0 -1
  305. package/dist/chunk-GPW2V3RE.js +0 -1
  306. package/dist/chunk-HIDYF36O.js +0 -1
  307. package/dist/chunk-HITNVN6B.js +0 -3
  308. package/dist/chunk-HY4DJBA7.js +0 -5
  309. package/dist/chunk-KZIEYVXN.js +0 -1
  310. package/dist/chunk-L6NSJVJZ.js +0 -1
  311. package/dist/chunk-N4MQX6JU.js +0 -18
  312. package/dist/chunk-N7FHEL4D.js +0 -1
  313. package/dist/chunk-NTEURFZH.js +0 -1
  314. package/dist/chunk-OIVP6KFV.js +0 -1
  315. package/dist/chunk-OPHBU3LG.js +0 -1
  316. package/dist/chunk-OYQOZP2F.js +0 -5
  317. package/dist/chunk-PTZK576G.js +0 -1
  318. package/dist/chunk-QYADASLV.js +0 -1
  319. package/dist/chunk-ST7UXLWR.js +0 -1
  320. package/dist/chunk-SVY7VUYU.js +0 -1
  321. package/dist/chunk-TK3NWWD4.js +0 -1
  322. package/dist/chunk-TSOYJ743.js +0 -1
  323. package/dist/chunk-UNGSTR4X.js +0 -61
  324. package/dist/chunk-VIMF6LGM.js +0 -1
  325. package/dist/chunk-VJLMUKOI.js +0 -1
  326. package/dist/chunk-VN6RDSK2.js +0 -1
  327. package/dist/chunk-VV4N5P64.js +0 -1
  328. package/dist/chunk-W3I423PS.js +0 -1
  329. package/dist/chunk-WJR24TAG.js +0 -1
  330. package/dist/chunk-XTGKMHSW.js +0 -1
  331. package/dist/chunk-YBB7ZGTY.js +0 -1
  332. package/dist/chunk-Z4NPUARF.js +0 -1
  333. package/dist/chunk-ZGNQRPDT.js +0 -1
  334. package/dist/chunk-ZKPSFFKU.js +0 -1
  335. package/dist/chunk-ZLV5SQSX.js +0 -1
  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-BvOWTZ00.d.ts +0 -112
  339. package/dist/decay-CFlLvXUT.d.cts +0 -112
  340. package/dist/fallback-74oxi34l.d.cts +0 -250
  341. package/dist/fallback-DUyyBTBK.d.ts +0 -250
  342. package/dist/graph-CWvEUQAq.d.cts +0 -1861
  343. package/dist/graph-D9LFnda9.d.ts +0 -1861
  344. package/dist/index-5k1T6jl0.d.cts +0 -121
  345. package/dist/index-9770hRuQ.d.cts +0 -779
  346. package/dist/index-B-_tFaqV.d.cts +0 -468
  347. package/dist/index-B17QddL1.d.cts +0 -374
  348. package/dist/index-B1F8Enjf.d.ts +0 -704
  349. package/dist/index-B5S8ULbU.d.ts +0 -515
  350. package/dist/index-B8YnZpIR.d.ts +0 -102
  351. package/dist/index-BHskSB8v.d.ts +0 -3413
  352. package/dist/index-BIYAkbAi.d.cts +0 -26
  353. package/dist/index-BQSKmbuG.d.cts +0 -127
  354. package/dist/index-BaQaY_IQ.d.cts +0 -231
  355. package/dist/index-BmZXHqkE.d.ts +0 -36
  356. package/dist/index-BoJ5JHxI.d.ts +0 -557
  357. package/dist/index-BocU7pqs.d.ts +0 -779
  358. package/dist/index-BrPrLl4e.d.cts +0 -86
  359. package/dist/index-BxNs2HB9.d.cts +0 -1858
  360. package/dist/index-Byu-OpX_.d.ts +0 -113
  361. package/dist/index-C1T3d7V-.d.cts +0 -704
  362. package/dist/index-C5ri2Axc.d.cts +0 -301
  363. package/dist/index-C5stwKcw.d.cts +0 -44
  364. package/dist/index-C9l6OEBL.d.ts +0 -26
  365. package/dist/index-CBBLl_rc.d.ts +0 -127
  366. package/dist/index-CBGUK09R.d.ts +0 -754
  367. package/dist/index-CC-AvFTy.d.cts +0 -557
  368. package/dist/index-CJF1URuX.d.ts +0 -121
  369. package/dist/index-CK29LV56.d.cts +0 -34
  370. package/dist/index-CMh5Rz1y.d.ts +0 -385
  371. package/dist/index-CPQlGA29.d.ts +0 -34
  372. package/dist/index-CR8QpwX8.d.ts +0 -2680
  373. package/dist/index-CS0LTlB8.d.cts +0 -385
  374. package/dist/index-CSOmP7xT.d.cts +0 -291
  375. package/dist/index-CYq8vAyV.d.ts +0 -291
  376. package/dist/index-CZ3r5Rxp.d.ts +0 -374
  377. package/dist/index-CasX6Pfq.d.cts +0 -358
  378. package/dist/index-CdAlHFEt.d.ts +0 -44
  379. package/dist/index-CdTelp1M.d.ts +0 -202
  380. package/dist/index-CeFiHtAg.d.ts +0 -468
  381. package/dist/index-Cj3WohTd.d.cts +0 -202
  382. package/dist/index-Climxqsu.d.cts +0 -754
  383. package/dist/index-Co7uli2l.d.cts +0 -3413
  384. package/dist/index-CviRnE4K.d.ts +0 -45
  385. package/dist/index-Cwv0KWcU.d.cts +0 -102
  386. package/dist/index-CzLVrjxn.d.ts +0 -231
  387. package/dist/index-D0aciIex.d.cts +0 -209
  388. package/dist/index-DHen9Klo.d.ts +0 -1858
  389. package/dist/index-DV_1YuVk.d.cts +0 -221
  390. package/dist/index-Dc4AYqrJ.d.cts +0 -515
  391. package/dist/index-Dgl1HpPn.d.ts +0 -86
  392. package/dist/index-DisjX8a-.d.ts +0 -221
  393. package/dist/index-UPSiS-X7.d.cts +0 -2680
  394. package/dist/index-Yq60JP3s.d.ts +0 -209
  395. package/dist/index-ZVQhLa2i.d.cts +0 -37
  396. package/dist/index-_6ODbuOu.d.cts +0 -45
  397. package/dist/index-hcDJ8PSI.d.cts +0 -36
  398. package/dist/index-nozs3fFC.d.ts +0 -301
  399. package/dist/index-p09KSrTN.d.ts +0 -358
  400. package/dist/index-sqkqlb1p.d.ts +0 -37
  401. package/dist/index-tRCxuAXF.d.cts +0 -113
  402. package/dist/node-kK3CvTrR.d.cts +0 -1347
  403. package/dist/node-kK3CvTrR.d.ts +0 -1347
  404. package/dist/observable-DWjNfLvC.d.ts +0 -36
  405. package/dist/observable-e3eiPPFy.d.cts +0 -36
  406. package/dist/pipeline-graph-CIKhynsF.d.cts +0 -142
  407. package/dist/pipeline-graph-Sgj0gCwn.d.ts +0 -142
  408. package/dist/reactive-layout-DOTs9P3X.d.ts +0 -183
  409. package/dist/reactive-layout-DgctbqZo.d.cts +0 -183
  410. package/dist/reactive-log-BKALbfal.d.ts +0 -223
  411. package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
  412. package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
  413. package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
  414. package/dist/resilience-6LYQJAC5.js +0 -1
  415. package/dist/sugar-DQjFmVqb.d.cts +0 -399
  416. package/dist/sugar-fhLIE7TT.d.ts +0 -399
  417. package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
  418. package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
  419. package/dist/types-C0_yquda.d.cts +0 -442
  420. package/dist/types-CWFysE9E.d.ts +0 -442
@@ -1,353 +1 @@
1
- import { N as Node, V as VersioningLevel } from '../node-kK3CvTrR.js';
2
- 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-BKALbfal.js';
3
- 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-DS_SIAxv.js';
4
- import './storage-tiers.js';
5
-
6
- type IndexRow<K, V = unknown> = {
7
- readonly primary: K;
8
- readonly secondary: unknown;
9
- readonly value: V;
10
- };
11
- type ReactiveIndexOptions<K, V = unknown> = {
12
- /** Optional registry name for `describe()` / debugging. */
13
- name?: string;
14
- /**
15
- * Storage backend. Defaults to `NativeIndexBackend` (flat array + parallel `Map<K,IndexRow>`).
16
- * Users can plug in persistent / B-tree backends via the {@link IndexBackend} interface.
17
- */
18
- backend?: IndexBackend<K, V>;
19
- /**
20
- * Optional versioning level for the underlying `ordered` state node. Set at
21
- * construction time; cannot be changed later. Pass `0` for V0 identity +
22
- * monotonic version counter, or `1` for V1 + content-addressed cid.
23
- * (The `byPrimary` derived node inherits through the dep graph.)
24
- */
25
- versioning?: VersioningLevel;
26
- /**
27
- * Default row-equality used to short-circuit idempotent upserts. When
28
- * provided, every `upsert` / `upsertMany` that finds an existing primary
29
- * compares the stored and candidate rows via `equals(existing, next)` —
30
- * on `true` the call is a no-op (no version bump, no emission). Per-call
31
- * `UpsertOptions.equals` overrides this default. Analogous to
32
- * `NodeOptions.equals` on the core `node()` primitive.
33
- */
34
- equals?: (existing: IndexRow<K, V>, next: IndexRow<K, V>) => boolean;
35
- };
36
- type ReactiveIndexBundle<K, V = unknown> = {
37
- /** Rows sorted by `(secondary, primary)`. */
38
- readonly ordered: Node<readonly IndexRow<K, V>[]>;
39
- /** Map from primary key to stored value. */
40
- readonly byPrimary: Node<ReadonlyMap<K, V>>;
41
- /** O(1) primary-key existence check. */
42
- has: (primary: K) => boolean;
43
- /** O(1) value lookup by primary key. */
44
- get: (primary: K) => V | undefined;
45
- /** Number of rows currently in the index (O(1)). */
46
- readonly size: number;
47
- /**
48
- * Upserts a row. When `opts.equals(existing, next)` returns `true` for an
49
- * existing primary key, the upsert is a no-op (no version bump, no emission).
50
- * Useful for idempotent writes.
51
- *
52
- * @returns `true` if a new row was inserted (primary key was absent),
53
- * `false` if the primary key was already present (updated in place OR
54
- * skipped idempotently via `opts.equals`). D5(a).
55
- */
56
- upsert: (primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>) => boolean;
57
- /**
58
- * Bulk upsert — emits one snapshot for the whole batch. `opts.equals` applied
59
- * per-row. No-op if empty or all rows skipped.
60
- *
61
- * **Iterable consumption:** Consumes `rows` once (single-pass).
62
- */
63
- upsertMany: (rows: Iterable<{
64
- primary: K;
65
- secondary: unknown;
66
- value: V;
67
- }>, opts?: UpsertOptions<K, V>) => void;
68
- delete: (primary: K) => void;
69
- /**
70
- * Bulk delete — emits one snapshot for the whole batch. No-op if nothing was removed.
71
- *
72
- * **Iterable consumption:** Consumes `primaries` once (single-pass).
73
- */
74
- deleteMany: (primaries: Iterable<K>) => void;
75
- clear: () => void;
76
- /**
77
- * Releases internal keepalive subscriptions (on `byPrimary`) so the bundle
78
- * can be GC'd. Safe to call more than once (subsequent calls are no-ops).
79
- * Subsequent mutations after `dispose()` still execute on the backend but
80
- * `byPrimary` may stop updating if no external subscriber is attached.
81
- * D6(a).
82
- */
83
- dispose: () => void;
84
- };
85
- /**
86
- * Storage contract for {@link reactiveIndex}. Implementations own the mutable state and
87
- * expose a monotonic `version` counter that increments on every structural change.
88
- *
89
- * The reactive layer reads `version` to decide when to emit; it does not inspect
90
- * internal representation. Users can plug in B-tree / skip-list / persistent backends
91
- * without touching the reactive emission logic.
92
- *
93
- * @remarks Post-1.0 op-log changesets will extend this interface with a
94
- * `changesSince(version: number): Iterable<Change>` method. Current consumers
95
- * should treat all methods here as stable.
96
- *
97
- * @category extra
98
- */
99
- /**
100
- * Optional per-call options for {@link IndexBackend.upsert} and bulk upsert.
101
- *
102
- * @category extra
103
- */
104
- type UpsertOptions<K, V> = {
105
- /**
106
- * Skip the upsert if an existing row is considered equal to the proposed row.
107
- * Default: no skip — every upsert advances `version`. Provide for idempotent
108
- * keys (e.g., `(a, b) => a.secondary === b.secondary && a.value === b.value`).
109
- */
110
- equals?: (existing: IndexRow<K, V>, next: IndexRow<K, V>) => boolean;
111
- };
112
- interface IndexBackend<K, V = unknown> {
113
- /** Monotonic mutation counter; increments on every upsert/delete/clear that changes state. */
114
- readonly version: number;
115
- /** Number of rows currently stored. */
116
- readonly size: number;
117
- /** O(1) primary-key existence check. */
118
- has(primary: K): boolean;
119
- /** Value lookup by primary key. */
120
- get(primary: K): V | undefined;
121
- /**
122
- * Insert or replace a row. Returns `true` if a row was inserted (primary
123
- * didn't exist), `false` otherwise (updated OR skipped via `opts.equals`).
124
- *
125
- * **Atomicity contract:** Either fully succeeds or throws before any state
126
- * change; `version` advances only on state change.
127
- */
128
- upsert(primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>): boolean;
129
- /**
130
- * Atomic bulk upsert. Returns the number of rows that caused a state change
131
- * (inserts + non-skipped updates). Advances `version` at most once.
132
- * No-op if iterable is empty or all rows skipped by `opts.equals`.
133
- *
134
- * **Consumes `rows` once** — pass an array for multi-shot consumers.
135
- */
136
- upsertMany(rows: Iterable<{
137
- primary: K;
138
- secondary: unknown;
139
- value: V;
140
- }>, opts?: UpsertOptions<K, V>): number;
141
- /** Remove a row by primary key. Returns `true` if the row existed. Advances `version` only if true. */
142
- delete(primary: K): boolean;
143
- /**
144
- * Atomic bulk delete. Returns count removed. Advances `version` at most once.
145
- * No-op if no keys were present. Consumes `primaries` once.
146
- */
147
- deleteMany(primaries: Iterable<K>): number;
148
- /** Remove all rows. Returns the number removed. Advances `version` only if non-zero. */
149
- clear(): number;
150
- /** Rows in sorted `(secondary, primary)` order — fresh snapshot suitable for emission. */
151
- toArray(): readonly IndexRow<K, V>[];
152
- /** Primary-key → value map — fresh snapshot. */
153
- toPrimaryMap(): ReadonlyMap<K, V>;
154
- }
155
- /**
156
- * Default flat-array backend. Maintains `buf: IndexRow[]` sorted by `(secondary, primary)`
157
- * and a parallel `Map<K, IndexRow>` for O(1) primary-key lookup.
158
- *
159
- * **Complexity:**
160
- * - `has`, `get`: O(1)
161
- * - `upsert`: up to 2× O(log n) bisect (locate old + locate new) + up to 2× O(n) splice (remove-old + insert-new) = O(n)
162
- * - `upsertMany(k rows)`: O(k log n) bisect + O(k·n) splice worst case; single version bump
163
- * - `delete`: O(log n) bisect + O(n) splice = O(n)
164
- * - `deleteMany(k keys)`: O(k log n) + O(k·n) splice worst case; single version bump
165
- * - `clear`: O(1)
166
- * - `toArray`, `toPrimaryMap`: O(n)
167
- *
168
- * @category extra
169
- */
170
- declare class NativeIndexBackend<K, V = unknown> implements IndexBackend<K, V> {
171
- private _version;
172
- private readonly _buf;
173
- private readonly _byPrimary;
174
- get version(): number;
175
- get size(): number;
176
- has(primary: K): boolean;
177
- get(primary: K): V | undefined;
178
- upsert(primary: K, secondary: unknown, value: V, opts?: UpsertOptions<K, V>): boolean;
179
- upsertMany(rows: Iterable<{
180
- primary: K;
181
- secondary: unknown;
182
- value: V;
183
- }>, opts?: UpsertOptions<K, V>): number;
184
- delete(primary: K): boolean;
185
- deleteMany(primaries: Iterable<K>): number;
186
- clear(): number;
187
- toArray(): readonly IndexRow<K, V>[];
188
- toPrimaryMap(): ReadonlyMap<K, V>;
189
- }
190
- /**
191
- * Creates a reactive index: unique primary key per row, rows sorted by `(secondary, primary)` for ordered scans.
192
- *
193
- * @param options - Optional `name` for `describe()` / debugging, and optional `backend` (see {@link IndexBackend}).
194
- * @returns Bundle with `ordered` (sorted rows), `byPrimary` (map), O(1) `has` / `get` / `size`,
195
- * imperative `upsert` / `upsertMany` / `delete` / `deleteMany` / `clear`.
196
- *
197
- * @remarks
198
- * **Ordering:** `secondary` and `primary` are compared via a small total order: same primitive `typeof` uses
199
- * numeric/string/boolean/bigint comparison; mixed or object keys fall back to `String(a).localeCompare(String(b))`
200
- * (not identical to Python's rich comparison for exotic types).
201
- *
202
- * **Backend:** The default {@link NativeIndexBackend} offers O(1) primary-key lookups and O(n) upserts.
203
- * For scale beyond a few thousand rows, supply a user-pluggable persistent/B-tree backend via the
204
- * `backend` option — reactive emission semantics are unchanged.
205
- *
206
- * @example
207
- * ```ts
208
- * import { reactiveIndex } from "@graphrefly/graphrefly-ts";
209
- *
210
- * const idx = reactiveIndex<string, string>();
211
- * idx.upsert("id1", 10, "row-a");
212
- * idx.upsert("id2", 5, "row-b");
213
- * ```
214
- *
215
- * @category extra
216
- */
217
- declare function reactiveIndex<K, V = unknown>(options?: ReactiveIndexOptions<K, V>): ReactiveIndexBundle<K, V>;
218
-
219
- type ReactiveListOptions<T> = {
220
- name?: string;
221
- /**
222
- * Storage backend. Defaults to `NativeListBackend` (flat mutable array).
223
- * Users can plug in persistent / RRB-tree backends via the {@link ListBackend} interface.
224
- */
225
- backend?: ListBackend<T>;
226
- /**
227
- * Optional versioning level for the underlying `items` state node. Set at
228
- * construction time; cannot be changed later. Pass `0` for V0 identity +
229
- * monotonic version counter, or `1` for V1 + content-addressed cid.
230
- */
231
- versioning?: VersioningLevel;
232
- };
233
- type ReactiveListBundle<T> = {
234
- /** Emits `readonly T[]` on each structural change (two-phase). */
235
- readonly items: Node<readonly T[]>;
236
- /** Current entry count (O(1)). */
237
- readonly size: number;
238
- /** Positional access (O(1)); supports negative indices (Python-style). Returns `undefined` on out-of-range. */
239
- at: (index: number) => T | undefined;
240
- append: (value: T) => void;
241
- /** Push all values, emit one snapshot. No-op if `values` is empty. */
242
- appendMany: (values: readonly T[]) => void;
243
- /** Insert a value at `index`. Throws `RangeError` on out-of-range. */
244
- insert: (index: number, value: T) => void;
245
- /** Insert all values at `index` as one bulk op; emits one snapshot. No-op if `values` is empty. */
246
- insertMany: (index: number, values: readonly T[]) => void;
247
- /** Remove and return the value at `index` (default: last). Negative indices Python-style. Throws on empty / out-of-range. */
248
- pop: (index?: number) => T;
249
- clear: () => void;
250
- /**
251
- * Releases any internal keepalive subscriptions so the bundle can be
252
- * GC'd. `reactiveList` currently holds none (no internal derived nodes),
253
- * so `dispose()` is a no-op today — exposed for API parity with
254
- * `reactiveIndex.dispose` / `reactiveMap.dispose` / `reactiveLog.dispose`.
255
- * Idempotent. D6(a).
256
- */
257
- dispose: () => void;
258
- };
259
- /**
260
- * Storage contract for {@link reactiveList}. Implementations own the mutable state
261
- * and expose a monotonic `version` counter that increments on every structural change.
262
- *
263
- * The reactive layer reads `version` before and after each backend call; when it
264
- * advances, a snapshot is emitted.
265
- *
266
- * @remarks Post-1.0 op-log changesets will extend this interface with a
267
- * `changesSince(version: number): Iterable<Change>` method. Current consumers
268
- * should treat all methods here as stable.
269
- *
270
- * @category extra
271
- */
272
- interface ListBackend<T> {
273
- /** Monotonic mutation counter; increments on every structural change. */
274
- readonly version: number;
275
- /** Number of items currently stored. */
276
- readonly size: number;
277
- /** Positional access; `undefined` on out-of-range. */
278
- at(index: number): T | undefined;
279
- /** Append a single value. Advances `version`. */
280
- append(value: T): void;
281
- /** Append a batch. Advances `version` once. No-op if empty. */
282
- appendMany(values: readonly T[]): void;
283
- /** Insert at index; throws `RangeError` on out-of-range `0 <= index <= size`. Advances `version`. */
284
- insert(index: number, value: T): void;
285
- /** Bulk insert at index; throws on out-of-range. Advances `version` once. No-op if `values` empty. */
286
- insertMany(index: number, values: readonly T[]): void;
287
- /** Remove and return value at index; throws on empty / out-of-range. Advances `version`. */
288
- pop(index: number): T;
289
- /** Clear all entries. Returns count removed. Advances `version` only if non-zero. */
290
- clear(): number;
291
- /** Full snapshot as a fresh array. */
292
- toArray(): readonly T[];
293
- }
294
- /**
295
- * Default mutable-array backend.
296
- *
297
- * **Complexity:**
298
- * - `at`, `size`: O(1)
299
- * - `append`: O(1) amortized
300
- * - `appendMany(values)`, `insertMany(index, values)`: O(n + k) where k = values.length
301
- * - `insert`, `pop` (middle): O(n) due to splice
302
- * - `pop` (last): O(1)
303
- * - `clear`: O(1)
304
- * - `toArray`: O(n)
305
- *
306
- * @category extra
307
- */
308
- declare class NativeListBackend<T> implements ListBackend<T> {
309
- private _version;
310
- private readonly _buf;
311
- constructor(initial?: readonly T[]);
312
- get version(): number;
313
- get size(): number;
314
- at(index: number): T | undefined;
315
- append(value: T): void;
316
- appendMany(values: readonly T[]): void;
317
- insert(index: number, value: T): void;
318
- insertMany(index: number, values: readonly T[]): void;
319
- pop(index: number): T;
320
- clear(): number;
321
- toArray(): readonly T[];
322
- }
323
- /**
324
- * Creates a reactive list with immutable array snapshots.
325
- *
326
- * @param initial - Optional initial items (copied).
327
- * @param options - Optional `name` for `describe()` / debugging, or pluggable `backend`.
328
- * @returns Bundle with `items` (state node), `size` / `at`, `append` / `appendMany` / `insert` /
329
- * `insertMany` / `pop` / `clear`.
330
- *
331
- * @remarks
332
- * **No `maxSize`:** insert/pop-anywhere semantics make eviction-under-cap ambiguous.
333
- * For bounded append-heavy workloads use `reactiveLog` (head-trim is well-defined for
334
- * append-only).
335
- *
336
- * **Backend:** Default {@link NativeListBackend}. For persistent / RRB-tree semantics
337
- * supply a custom {@link ListBackend}. If you provide a `backend`, `initial` is ignored
338
- * — seed the backend directly.
339
- *
340
- * @example
341
- * ```ts
342
- * import { reactiveList } from "@graphrefly/graphrefly-ts";
343
- *
344
- * const list = reactiveList<string>(["a"], { name: "queue" });
345
- * list.append("b");
346
- * list.insertMany(1, ["x", "y"]);
347
- * ```
348
- *
349
- * @category extra
350
- */
351
- declare function reactiveList<T>(initial?: readonly T[], options?: ReactiveListOptions<T>): ReactiveListBundle<T>;
352
-
353
- export { type IndexBackend, type IndexRow, type ListBackend, NativeIndexBackend, NativeListBackend, type ReactiveIndexBundle, type ReactiveIndexOptions, type ReactiveListBundle, type ReactiveListOptions, type UpsertOptions, reactiveIndex, reactiveList };
1
+ export * from '@graphrefly/pure-ts/extra/reactive';
@@ -1 +1,3 @@
1
- import{a as p,b as t}from"../chunk-A5WCQ5NO.js";import{a as x,b as a}from"../chunk-GLERH466.js";import{a as f,b as m}from"../chunk-BEZWM2SY.js";import{a as o,b as r,c as e}from"../chunk-YBB7ZGTY.js";import"../chunk-CRVT7D2P.js";import"../chunk-NTEURFZH.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{p as NativeIndexBackend,x as NativeListBackend,o as NativeLogBackend,f as NativeMapBackend,e as mergeReactiveLogs,t as reactiveIndex,a as reactiveList,r as reactiveLog,m as reactiveMap};
1
+ // src/extra/reactive.ts
2
+ export * from "@graphrefly/pure-ts/extra/reactive";
3
+ //# sourceMappingURL=reactive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/extra/reactive.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/extra/reactive\";\n"],"mappings":";AAEA,cAAc;","names":[]}
@@ -1,5 +1,21 @@
1
- "use strict";var $=Object.defineProperty;var xn=Object.getOwnPropertyDescriptor;var cn=Object.getOwnPropertyNames;var pn=Object.prototype.hasOwnProperty;var hn=(n,e)=>{for(var s in e)$(n,s,{get:e[s],enumerable:!0})},gn=(n,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cn(e))!pn.call(n,r)&&r!==s&&$(n,r,{get:()=>e[r],enumerable:!(i=xn(e,r))||i.enumerable});return n};var yn=n=>gn($({},"__esModule",{value:!0}),n);var Vn={};hn(Vn,{mermaidLiveUrl:()=>N,toAscii:()=>nn,toD2:()=>sn,toJson:()=>an,toMermaid:()=>B,toMermaidUrl:()=>fn,toPretty:()=>ln});module.exports=yn(Vn);function j(n){return n>=768&&n<=879||n>=1155&&n<=1161||n>=1425&&n<=1469||n>=1552&&n<=1562||n>=1611&&n<=1631||n>=1648&&n===1648||n>=1750&&n<=1756||n>=1759&&n<=1764||n>=1767&&n<=1768||n>=1770&&n<=1773||n>=1840&&n<=1866||n>=1958&&n<=1968||n>=2304&&n<=2307||n>=2362&&n<=2383||n>=2385&&n<=2391||n>=2402&&n<=2403||n>=2433&&n<=2435||n>=2492&&n<=2509||n>=2561&&n<=2563||n>=2620&&n<=2641||n>=2672&&n<=2673||n>=2677&&n===2677||n>=3633&&n===3633||n>=3636&&n<=3642||n>=3655&&n<=3662||n>=3761&&n===3761||n>=3764&&n<=3772||n>=3784&&n<=3790||n>=7616&&n<=7679||n>=8400&&n<=8447||n>=65024&&n<=65039||n>=65056&&n<=65071||n===8205?0:n>=4352&&n<=4447||n>=8986&&n<=8987||n>=9001&&n<=9002||n>=9193&&n<=9203||n>=9208&&n<=9210||n>=9725&&n<=9726||n>=9748&&n<=9749||n>=9800&&n<=9811||n===9855||n===9875||n===9889||n>=9898&&n<=9899||n>=9917&&n<=9918||n>=9924&&n<=9925||n===9934||n===9940||n===9962||n>=9970&&n<=9971||n===9973||n===9978||n===9981||n===9986||n===9989||n>=9992&&n<=9997||n===9999||n>=10067&&n<=10069||n===10071||n>=10133&&n<=10135||n===10160||n===10175||n>=10548&&n<=10549||n>=11013&&n<=11015||n>=11035&&n<=11036||n===11088||n===11093||n>=11904&&n<=12350||n>=12352&&n<=12447||n>=12448&&n<=12543||n>=12549&&n<=12591||n>=12593&&n<=12686||n>=12688&&n<=12771||n>=12784&&n<=12830||n>=12832&&n<=12871||n>=12880&&n<=19903||n>=19968&&n<=40959||n>=43360&&n<=43388||n>=44032&&n<=55203||n>=63744&&n<=64255||n>=65040&&n<=65049||n>=65072&&n<=65131||n>=65281&&n<=65376||n>=65504&&n<=65510||n>=126980&&n===126980||n===127183||n>=127344&&n<=127345||n===127358||n===127359||n===127374||n>=127377&&n<=127386||n>=127456&&n<=127487||n>=127488&&n<=127490||n===127514||n===127535||n>=127538&&n<=127546||n>=127568&&n<=127569||n>=127744&&n<=129535||n>=129536&&n<=129791||n>=129792&&n<=130047||n>=131072&&n<=196605||n>=196608&&n<=262141?2:1}function S(n){let e=0;for(let s of n)e+=j(s.codePointAt(0));return e}function K(n,e){if(e<=0)return"";let s=0,i="";for(let r of n){let t=j(r.codePointAt(0));if(s+t>e){if(e<=1)return"\u2026";for(;s+1>e&&i.length>0;){let o=[...i].pop();i=i.slice(0,-o.length),s-=j(o.codePointAt(0))}return`${i}\u2026`}i+=r,s+=t}return i}var mn={horizontal:"\u2500",vertical:"\u2502",cornerTL:"\u250C",cornerTR:"\u2510",cornerBL:"\u2514",cornerBR:"\u2518",tDown:"\u252C",tUp:"\u2534",tRight:"\u251C",tLeft:"\u2524",cross:"\u253C",arrowRight:"\u25B6",arrowDown:"\u25BC",arrowLeft:"\u25C0",arrowUp:"\u25B2",boxTL:"\u250C",boxTR:"\u2510",boxBL:"\u2514",boxBR:"\u2518",boxH:"\u2500",boxV:"\u2502"},dn={horizontal:"-",vertical:"|",cornerTL:"+",cornerTR:"+",cornerBL:"+",cornerBR:"+",tDown:"+",tUp:"+",tRight:"+",tLeft:"+",cross:"+",arrowRight:">",arrowDown:"v",arrowLeft:"<",arrowUp:"^",boxTL:"+",boxTR:"+",boxBL:"+",boxBR:"+",boxH:"-",boxV:"|"};function W(n,e){let s=e.charset==="ascii"?dn:mn,i=n.width,r=n.height,t=Array.from({length:r},()=>Array.from({length:i},()=>" ")),o=Array.from({length:r},()=>Array.from({length:i},()=>"empty"));for(let a of n.edges)Ln(t,o,s,a);for(let a of n.boxes)bn(t,o,s,a,e.labelOf(a.id));return t.map(a=>Tn(a.join(""))).join(`
2
- `)}function bn(n,e,s,i,r){let{x:t,y:o,w:a,h:l}=i;if(a<2||l<2){l>0&&F(n,e,t,o,a,r);return}w(n,e,t,o,s.boxTL);for(let u=t+1;u<t+a-1;u+=1)w(n,e,u,o,s.boxH);w(n,e,t+a-1,o,s.boxTR);for(let u=o+1;u<o+l-1;u+=1){w(n,e,t,u,s.boxV);for(let c=t+1;c<t+a-1;c+=1)Y(n,e,c,u," ","empty");w(n,e,t+a-1,u,s.boxV)}w(n,e,t,o+l-1,s.boxBL);for(let u=t+1;u<t+a-1;u+=1)w(n,e,u,o+l-1,s.boxH);w(n,e,t+a-1,o+l-1,s.boxBR);let f=o+Math.floor(l/2);F(n,e,t+1,f,a-2,r)}function w(n,e,s,i,r){Y(n,e,s,i,r,r===" "?"empty":r==="\u2500"||r==="-"?"boxH":r==="\u2502"||r==="|"?"boxV":"boxCorner")}function Y(n,e,s,i,r,t){if(i<0||i>=n.length)return;let o=n[i];s<0||s>=o.length||(o[s]=r,e[i][s]=t)}function F(n,e,s,i,r,t){if(i<0||i>=n.length)return;let o=s,a=r;for(let l of t){let f=S(l);if(f!==0){if(a<f)break;o>=0&&o<n[i].length&&(n[i][o]=l,e[i][o]="label",f===2&&o+1<n[i].length&&(n[i][o+1]="",e[i][o+1]="label")),o+=f,a-=f}}for(;a>0;)o>=0&&o<n[i].length&&(n[i][o]=" ",e[i][o]="empty"),o+=1,a-=1}function Ln(n,e,s,i){let r=i.points;if(r.length<2)return;for(let l=0;l+1<r.length;l+=1)wn(n,e,s,r[l],r[l+1]);for(let l=1;l+1<r.length;l+=1){let f=r[l-1],u=r[l],c=r[l+1],x=Dn(f,u,c,s);x&&J(n,e,u.x,u.y,x,"edgeCorner")}let t=r[r.length-1],o=r[r.length-2],a=In(o,t,s);a&&J(n,e,t.x,t.y,a,"arrow")}function wn(n,e,s,i,r){if(!(i.x===r.x&&i.y===r.y)){if(i.y===r.y){let t=i.y,o=Math.min(i.x,r.x),a=Math.max(i.x,r.x);for(let l=o;l<=a;l+=1)k(n,e,l,t,s,"h")}else if(i.x===r.x){let t=i.x,o=Math.min(i.y,r.y),a=Math.max(i.y,r.y);for(let l=o;l<=a;l+=1)k(n,e,t,l,s,"v")}}}function k(n,e,s,i,r,t){if(i<0||i>=n.length)return;let o=n[i];if(s<0||s>=o.length)return;let a=e[i][s];if(!(a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label")){if(a==="empty"){o[s]=t==="h"?r.horizontal:r.vertical,e[i][s]=t==="h"?"edgeH":"edgeV";return}if(a==="edgeH"&&t==="v"){o[s]=r.cross,e[i][s]="edgeCorner";return}if(a==="edgeV"&&t==="h"){o[s]=r.cross,e[i][s]="edgeCorner";return}}}function J(n,e,s,i,r,t){if(i<0||i>=n.length)return;let o=n[i];if(s<0||s>=o.length)return;let a=e[i][s];a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label"||(o[s]=r,e[i][s]=t)}function Dn(n,e,s,i){let r=n.y===e.y,t=e.y===s.y;if(r===t)return;if(r){let l=n.x<e.x,f=s.y>e.y;return l&&f?i.cornerTR:l&&!f?i.cornerBR:!l&&f?i.cornerTL:i.cornerBL}let o=n.y<e.y,a=s.x>e.x;return o&&a?i.cornerBL:o&&!a?i.cornerBR:!o&&a?i.cornerTL:i.cornerTR}function In(n,e,s){if(e.x>n.x)return s.arrowRight;if(e.x<n.x)return s.arrowLeft;if(e.y>n.y)return s.arrowDown;if(e.y<n.y)return s.arrowUp}function Tn(n){let e=n.length;for(;e>0&&n.charCodeAt(e-1)===32;)e-=1;return n.slice(0,e)}function Q(n){let e=Mn(n);On(e),Cn(e),Rn(e),Sn(e,n);let s=En(e,n),{width:i,height:r}=Pn(e),t=[];for(let o of e.layers)for(let a of o)a.isVirtual||t.push({id:a.id,layer:a.layer,order:a.order,x:a.x,y:a.y,w:a.w,h:a.h});return{boxes:t,edges:s,width:i,height:r}}function Mn(n){let e=new Map;for(let r of n.nodes)e.set(r,{id:r,isVirtual:!1,layer:-1,order:0,x:0,y:0,w:n.widthCells(r),h:n.heightCells(r),in:[],out:[]});let s=[],i=0;for(let r of n.edges){if(r.from===r.to)continue;let t=e.get(r.from),o=e.get(r.to);if(!t||!o)continue;let a={chainId:i++,chainFrom:r.from,chainTo:r.to,fromId:r.from,toId:r.to,hopIndex:0,chainLen:1};t.out.push(a),o.in.push(a),s.push(a)}return{nodes:e,layers:[],hops:s}}function On(n){let e=new Map;for(let t of n.nodes.values())e.set(t.id,t.in.length);let s=[];for(let t of n.nodes.values())(e.get(t.id)??0)===0&&(t.layer=0,s.push(t));let i=new Set,r=0;for(;r<s.length;){let t=s[r++];if(!i.has(t.id)){i.add(t.id);for(let o of t.out){let a=n.nodes.get(o.toId);a.layer=Math.max(a.layer,t.layer+1);let l=(e.get(a.id)??0)-1;e.set(a.id,l),l<=0&&s.push(a)}}}for(let t of n.nodes.values())t.layer<0&&(t.layer=0)}function Cn(n){let e=Math.max(0,...Array.from(n.nodes.values(),t=>t.layer)),s=Array.from({length:e+1},()=>[]);for(let t of n.nodes.values())s[t.layer].push(t);let i=[],r=0;for(let t of n.hops){let o=n.nodes.get(t.fromId),a=n.nodes.get(t.toId),l=a.layer-o.layer;if(l<=0){o.out=o.out.filter(c=>c!==t),a.in=a.in.filter(c=>c!==t);continue}if(l===1){t.hopIndex=0,t.chainLen=1,i.push(t);continue}o.out=o.out.filter(c=>c!==t),a.in=a.in.filter(c=>c!==t);let f=o;for(let c=1;c<l;c+=1){let x=`__virt_${r++}__`,h={id:x,isVirtual:!0,layer:o.layer+c,order:0,x:0,y:0,w:0,h:1,in:[],out:[]};n.nodes.set(x,h),s[h.layer].push(h);let p={chainId:t.chainId,chainFrom:t.chainFrom,chainTo:t.chainTo,fromId:f.id,toId:x,hopIndex:c-1,chainLen:l};f.out.push(p),h.in.push(p),i.push(p),f=h}let u={chainId:t.chainId,chainFrom:t.chainFrom,chainTo:t.chainTo,fromId:f.id,toId:a.id,hopIndex:l-1,chainLen:l};f.out.push(u),a.in.push(u),i.push(u)}for(let t of s)for(let o=0;o<t.length;o+=1)t[o].order=o;n.layers=s,n.hops=i}function Rn(n){for(let s=0;s<4;s+=1){for(let i=1;i<n.layers.length;i+=1)X(n,n.layers[i],"in"),G(n.layers[i]);for(let i=n.layers.length-2;i>=0;i-=1)X(n,n.layers[i],"out"),G(n.layers[i])}for(let s=0;s<2;s+=1){let i=!1;for(let r=1;r<n.layers.length;r+=1){let t=n.layers[r];for(let o=0;o+1<t.length;o+=1){let a=q(n,t[o],t[o+1],"in");[t[o],t[o+1]]=[t[o+1],t[o]],G(t),q(n,t[o],t[o+1],"in")<a?i=!0:([t[o],t[o+1]]=[t[o+1],t[o]],G(t))}}if(!i)break}}function X(n,e,s){let i=new Map;for(let r of e){let t=s==="in"?r.in:r.out;if(t.length===0){i.set(r.id,r.order);continue}let o=0,a=0;for(let l of t){let f=n.nodes.get(s==="in"?l.fromId:l.toId);f&&(o+=f.order,a+=1)}i.set(r.id,a===0?r.order:o/a)}e.sort((r,t)=>{let o=i.get(r.id),a=i.get(t.id);return o!==a?o-a:r.order-t.order})}function G(n){for(let e=0;e<n.length;e+=1)n[e].order=e}function q(n,e,s,i){let r=i==="in"?e.in:e.out,t=i==="in"?s.in:s.out,o=0;for(let a of r)for(let l of t){let f=n.nodes.get(i==="in"?a.fromId:a.toId)?.order??0,u=n.nodes.get(i==="in"?l.fromId:l.toId)?.order??0;(e.order<s.order&&f>u||e.order>s.order&&f<u)&&(o+=1)}return o}function Sn(n,e){e.direction==="LR"?Gn(n,e):vn(n,e)}function Gn(n,e){let s=[],i=0;for(let r=0;r<n.layers.length;r+=1){s.push(i);let t=0;for(let o of n.layers[r])t=Math.max(t,o.w);i+=t+e.layerGap}for(let r=0;r<n.layers.length;r+=1)for(let t of n.layers[r])t.x=s[r];for(let r of n.layers){let t=0;for(let o of r)o.y=t,t+=o.h+e.nodeGap}Z(n,e,"y")}function vn(n,e){let s=[],i=0;for(let r=0;r<n.layers.length;r+=1){s.push(i);let t=0;for(let o of n.layers[r])t=Math.max(t,o.h);i+=t+e.layerGap}for(let r=0;r<n.layers.length;r+=1)for(let t of n.layers[r])t.y=s[r];for(let r of n.layers){let t=0;for(let o of r)o.x=t,t+=o.w+e.nodeGap}Z(n,e,"x")}function Z(n,e,s){let i=t=>s==="y"?t.h:t.w,r=e.nodeGap;for(let t=0;t<2;t+=1){let o=t===0?n.layers.slice(1):n.layers.slice(0,-1).reverse();for(let a of o){let l=new Map;for(let u of a){let c=t===0?u.in:u.out;if(c.length===0)continue;let x=[];for(let p of c){let y=n.nodes.get(t===0?p.fromId:p.toId);if(!y)continue;let m=s==="y"?y.y:y.x;x.push(m+Math.floor(i(y)/2))}if(x.length===0)continue;x.sort((p,y)=>p-y);let h=x[Math.floor(x.length/2)];l.set(u.id,h-Math.floor(i(u)/2))}let f=0;for(let u of a){let c=l.get(u.id),x=s==="y"?u.y:u.x,p=Math.max(c??x,f);s==="y"?u.y=p:u.x=p,f=p+i(u)+r}}}}function En(n,e){let s=new Map;for(let f of n.hops){let u=s.get(f.chainId);u?u.push(f):s.set(f.chainId,[f])}for(let f of s.values())f.sort((u,c)=>u.hopIndex-c.hopIndex);let i=e.direction==="LR",r=f=>i?f.x:f.y,t=f=>i?f.w:f.h,o=f=>i?f.y+Math.floor(f.h/2):f.x+Math.floor(f.w/2),a=new Map;for(let f=0;f+1<n.layers.length;f+=1){let u=n.layers[f],c=n.layers[f+1],x=0;for(let g of u)x=Math.max(x,r(g)+t(g));let h=Number.POSITIVE_INFINITY;for(let g of c)h=Math.min(h,r(g));let p=Number.isFinite(h)?h-1:x,y=Math.max(1,p-x+1),m=[];for(let g of u)for(let d of g.out)m.push(d);m.sort((g,d)=>{let b=o(n.nodes.get(g.fromId)),L=o(n.nodes.get(d.fromId));if(b!==L)return b-L;let O=o(n.nodes.get(g.toId)),M=o(n.nodes.get(d.toId));return O-M});let D=[],C=new Map;for(let g of m){let d=o(n.nodes.get(g.fromId)),b=o(n.nodes.get(g.toId)),L=Math.min(d,b),O=Math.max(d,b),M=-1;for(let R=0;R<D.length;R+=1){let _=D[R],U=!0;for(let z of _)if(z.lo<=O&&L<=z.hi){U=!1;break}if(U){_.push({lo:L,hi:O}),M=R;break}}M<0&&(D.push([{lo:L,hi:O}]),M=D.length-1),C.set(g,M)}let I=D.length,T=y>=Math.max(3,I+2),H=T?x+1:x,un=T?p-1:p,V=Math.max(1,un-H+1);for(let g of m){let d=C.get(g),b;if(I<=1)b=H+Math.floor(V/2);else{let L=(V-1)/(I-1);b=H+Math.floor(d*L)}a.set(g,Math.max(x,Math.min(p,b)))}}let l=[];for(let[,f]of s){let u=[];for(let x=0;x<f.length;x+=1){let h=f[x],p=n.nodes.get(h.fromId),y=n.nodes.get(h.toId),m=a.get(h),D=p.isVirtual?r(p):r(p)+t(p),C=y.isVirtual?r(y):r(y)-1,I=o(p),T=o(y);x===0&&v(u,i,D,I),I!==T&&(v(u,i,m,I),v(u,i,m,T)),v(u,i,C,T)}let c=f[0];l.push({from:c.chainFrom,to:c.chainTo,points:An(u)})}return l}function v(n,e,s,i){n.push(e?{x:s,y:i}:{x:i,y:s})}function An(n){let e=[];for(let s of n){let i=e[e.length-1];(!i||i.x!==s.x||i.y!==s.y)&&e.push(s)}return e}function Pn(n){let e=0,s=0;for(let i of n.layers)for(let r of i)e=Math.max(e,r.x+r.w),s=Math.max(s,r.y+r.h);return{width:e,height:s}}var Bn=24,Hn=4,$n=1,jn=3;function nn(n,e){let s=Nn(e?.direction),i=Math.max(3,e?.maxLabelWidth??Bn),r=e?.asciiCharset??"unicode",t=Object.keys(n.nodes).sort(),o=new Set(t),a=n.edges.filter(x=>o.has(x.from)&&o.has(x.to)),l=new Map,f=new Map;for(let x of t){let h=K(x,i);l.set(x,h),f.set(x,S(h)+4)}let u=Q({nodes:t,edges:a,widthCells:x=>f.get(x)??3,heightCells:()=>jn,layerGap:Hn,nodeGap:$n,direction:s}),c=W(u,{charset:r,labelOf:x=>l.get(x)??x});return e?.logger?.(c),c}function Nn(n){if(n===void 0||n==="LR")return"LR";if(n==="TD")return"TD";throw new Error(`ascii describe supports direction "LR" or "TD" only; got ${String(n)}`)}function E(n){if(n===null||typeof n!="object")return n;if(Array.isArray(n))return n.map(E);let e=n,s=Object.keys(e).sort(),i={};for(let r of s)i[r]=E(e[r]);return i}function tn(n){return n.replaceAll("\\","\\\\").replaceAll('"','\\"')}function rn(n){return n.replaceAll("\\","\\\\").replaceAll('"','\\"')}function en(n){return n==="TD"?"down":n==="BT"?"up":n==="RL"?"left":"right"}function A(n){let e=new Set,s=[];function i(r,t){let o=`${r}\0${t}`;e.has(o)||(e.add(o),s.push([r,t]))}for(let[r,t]of Object.entries(n.nodes)){let o=t.deps;if(o)for(let a of o)i(a,r)}for(let r of n.edges)i(r.from,r.to);return s}function P(n){if(n===void 0)return"LR";if(n==="TD"||n==="LR"||n==="BT"||n==="RL")return n;throw new Error(`invalid diagram direction ${String(n)}; expected one of: TD, LR, BT, RL`)}function on(n){if(typeof n=="string")return JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean"||n==null)return String(n);try{return JSON.stringify(n)}catch{return"[unserializable]"}}function sn(n,e){let s=P(e?.direction),i=Object.keys(n.nodes).sort(),r=new Map;for(let o=0;o<i.length;o+=1)r.set(i[o],`n${o}`);let t=[`direction: ${en(s)}`];for(let o of i){let a=r.get(o);t.push(`${a}: "${rn(o)}"`)}for(let[o,a]of A(n)){let l=r.get(o),f=r.get(a);!l||!f||t.push(`${l} -> ${f}`)}return t.join(`
3
- `)}function an(n,e){let s=e?.includeEdges??!0,i=e?.includeSubgraphs??!0,{expand:r,...t}=n,o={...t,edges:s?n.edges:[],subgraphs:i?n.subgraphs:[]},a=JSON.stringify(E(o),null,e?.indent??2);return e?.logger?.(a),a}function B(n,e){let s=P(e?.direction),i=Object.keys(n.nodes).sort(),r=new Map;for(let o=0;o<i.length;o+=1)r.set(i[o],`n${o}`);let t=[`flowchart ${s}`];for(let o of i){let a=r.get(o);t.push(` ${a}["${tn(o)}"]`)}for(let[o,a]of A(n)){let l=r.get(o),f=r.get(a);!l||!f||t.push(` ${l} --> ${f}`)}return t.join(`
4
- `)}function N(n,e){let s=e?.theme??"default",i=e?.autoSync??!0,t=JSON.stringify({code:n,mermaid:{theme:s},autoSync:i}),o=new TextEncoder().encode(t),a="";for(let f=0;f<o.length;f++)a+=String.fromCharCode(o[f]);return`https://mermaid.live/edit#base64:${globalThis.btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`}function fn(n,e){let s=B(n,e);return N(s,e)}function ln(n,e){let s=e?.includeEdges??!0,i=e?.includeSubgraphs??!0,r=[];r.push(`Graph ${n.name}`),r.push("Nodes:");for(let o of Object.keys(n.nodes).sort()){let a=n.nodes[o];r.push(`- ${o} (${a.type}/${a.status}): ${on(a.value)}`)}if(s){r.push("Edges:");for(let o of n.edges)r.push(`- ${o.from} -> ${o.to}`)}if(i){r.push("Subgraphs:");for(let o of n.subgraphs)r.push(`- ${o}`)}let t=r.join(`
5
- `);return e?.logger?.(t),t}0&&(module.exports={mermaidLiveUrl,toAscii,toD2,toJson,toMermaid,toMermaidUrl,toPretty});
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);
16
+
17
+ // src/extra/render/index.ts
18
+ var render_exports = {};
19
+ module.exports = __toCommonJS(render_exports);
20
+ __reExport(render_exports, require("@graphrefly/pure-ts/extra/render"), module.exports);
21
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/extra/render/index.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/extra/render\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,2BAAc,6CAFd;","names":[]}
@@ -1,183 +1 @@
1
- import { b as GraphDescribeOutput } from '../../graph-CWvEUQAq.cjs';
2
- import '../../node-kK3CvTrR.cjs';
3
- import '../../sugar-DQjFmVqb.cjs';
4
- import '../storage-core.cjs';
5
- import '../storage-tiers.cjs';
6
-
7
- /**
8
- * Internal helpers shared across renderers in `extra/render/`.
9
- *
10
- * These are pure functions over `GraphDescribeOutput` — no Graph instance
11
- * dependency. Extracted from `src/graph/graph.ts` (the consolidated
12
- * ex-dumpGraph / ex-toMermaid / ex-toD2 renderers) per Tier 2.1 A2.
13
- */
14
-
15
- /** Direction options for diagram exports. */
16
- type DiagramDirection = "TD" | "LR" | "BT" | "RL";
17
-
18
- /**
19
- * Sugiyama-style layered DAG layout on an integer grid.
20
- *
21
- * Pipeline:
22
- * 1. Longest-path layer assignment (sources at layer 0).
23
- * 2. Virtual-node splitting — every edge spanning more than one layer
24
- * becomes a chain of synthetic nodes on intermediate layers. Downstream
25
- * passes treat real and virtual nodes identically; crossing
26
- * minimization therefore works on wide + deep DAGs, not only
27
- * adjacent-layer cases.
28
- * 3. Crossing minimization — barycenter heuristic with alternating up /
29
- * down sweeps plus an adjacent-transposition polish pass.
30
- * 4. Coordinate assignment — greedy median-aligned packing with collision
31
- * resolution. Straightens vertical runs of virtual nodes so long edges
32
- * become straight lines where topology allows.
33
- * 5. Orthogonal edge routing — per-gutter x-track assignment; horizontal
34
- * segments sit at endpoint centerlines, vertical segments pack into the
35
- * gutter column range without overlap. Remaining crossings are
36
- * topologically unavoidable and will render as `┼` at draw time.
37
- *
38
- * Output coordinates are cell-grid integers (LR direction). TD rendering
39
- * swaps axes at draw time — the layout is direction-agnostic by
40
- * construction.
41
- *
42
- * Used only by [to-ascii.ts](./to-ascii.ts); not part of the public
43
- * `extra/render/index.ts` surface (underscore-prefixed).
44
- */
45
- type LayoutDirection = "LR" | "TD";
46
-
47
- /**
48
- * `toAscii(g, opts?)` — stdout-native DAG flowchart renderer for a
49
- * {@link GraphDescribeOutput}.
50
- *
51
- * Zero external dependencies, graph-size independent via proper Sugiyama
52
- * (layer assignment → virtual-node splitting → barycenter crossing
53
- * minimization → median-aligned coordinate assignment → per-gutter
54
- * track-assigned orthogonal routing). See
55
- * [_layout-sugiyama.ts](./_layout-sugiyama.ts) for the layout pipeline and
56
- * [_ascii-grid.ts](./_ascii-grid.ts) for the character blitter.
57
- *
58
- * Pure function over the describe snapshot; no Graph instance dependency.
59
- *
60
- * @category extra
61
- */
62
-
63
- type ToAsciiOptions = {
64
- /**
65
- * ASCII layout direction. ASCII grid semantics are meaningful only for
66
- * `"LR"` (default) and `"TD"`.
67
- */
68
- direction?: LayoutDirection;
69
- /** Per-box label cell cap; longer labels are truncated with `…`. Default `24`. */
70
- maxLabelWidth?: number;
71
- /** Glyph set: `"unicode"` (default, box-drawing) or `"ascii"` (`-|+<>v`). */
72
- asciiCharset?: "unicode" | "ascii";
73
- /** Optional logger hook; fires with the rendered text before return. */
74
- logger?: (text: string) => void;
75
- };
76
- declare function toAscii(g: GraphDescribeOutput, opts?: ToAsciiOptions): string;
77
-
78
- /**
79
- * `toD2(g, opts?)` — render a {@link GraphDescribeOutput} as D2 diagram text.
80
- *
81
- * Pure function over the describe snapshot; no Graph instance dependency.
82
- *
83
- * @category extra
84
- */
85
-
86
- type ToD2Options = {
87
- /** Diagram direction; default `"LR"`. */
88
- direction?: DiagramDirection;
89
- };
90
- declare function toD2(g: GraphDescribeOutput, opts?: ToD2Options): string;
91
-
92
- /**
93
- * `toJson(g, opts?)` — render a {@link GraphDescribeOutput} as deterministic
94
- * JSON text with sorted keys.
95
- *
96
- * Pure function over the describe snapshot; no Graph instance dependency.
97
- *
98
- * @category extra
99
- */
100
-
101
- type ToJsonOptions = {
102
- /** Include the Edges section (default `true`). */
103
- includeEdges?: boolean;
104
- /** Include the Subgraphs section (default `true`). */
105
- includeSubgraphs?: boolean;
106
- /** JSON indent (default `2`). */
107
- indent?: number;
108
- /** Optional logger hook; fires with the rendered text before return. */
109
- logger?: (text: string) => void;
110
- };
111
- declare function toJson(g: GraphDescribeOutput, opts?: ToJsonOptions): string;
112
-
113
- /**
114
- * `toMermaid(g, opts?)` — render a {@link GraphDescribeOutput} as Mermaid
115
- * flowchart text.
116
- *
117
- * Pure function over the describe snapshot; no Graph instance dependency.
118
- * Compose with `derived` for live formatted output:
119
- *
120
- * ```ts
121
- * import { toMermaid } from "@graphrefly/graphrefly/extra/render";
122
- * import { derived } from "@graphrefly/graphrefly";
123
- *
124
- * const live = derived([graph.describe({ reactive: true }).node], ([g]) => toMermaid(g));
125
- * ```
126
- *
127
- * @category extra
128
- */
129
-
130
- type ToMermaidOptions = {
131
- /** Diagram direction; default `"LR"`. */
132
- direction?: DiagramDirection;
133
- };
134
- declare function toMermaid(g: GraphDescribeOutput, opts?: ToMermaidOptions): string;
135
-
136
- /**
137
- * `toMermaidUrl(g, opts?)` — encode a {@link GraphDescribeOutput} as a
138
- * `https://mermaid.live/edit#base64:…` deep link.
139
- *
140
- * Round-trip with the mermaid.live editor's `/edit#base64:` share format —
141
- * payload is `base64url(JSON({code, mermaid: {theme}, ...}))`. No network
142
- * calls; the payload is encoded into the URL fragment.
143
- *
144
- * @category extra
145
- */
146
-
147
- type MermaidLiveTheme = "default" | "dark" | "forest" | "neutral" | "base";
148
- type ToMermaidUrlOptions = ToMermaidOptions & {
149
- theme?: MermaidLiveTheme;
150
- autoSync?: boolean;
151
- };
152
- /**
153
- * Encode an arbitrary mermaid source string to a `mermaid.live` deep link.
154
- * Exported separately so callers that already rendered mermaid text can
155
- * upgrade to a live-editor URL without re-rendering.
156
- */
157
- declare function mermaidLiveUrl(mermaidSrc: string, opts?: {
158
- theme?: MermaidLiveTheme;
159
- autoSync?: boolean;
160
- }): string;
161
- declare function toMermaidUrl(g: GraphDescribeOutput, opts?: ToMermaidUrlOptions): string;
162
-
163
- /**
164
- * `toPretty(g, opts?)` — render a {@link GraphDescribeOutput} as
165
- * human-readable plaintext (Node list with values, plus optional Edges and
166
- * Subgraphs sections).
167
- *
168
- * Pure function over the describe snapshot; no Graph instance dependency.
169
- *
170
- * @category extra
171
- */
172
-
173
- type ToPrettyOptions = {
174
- /** Include the Edges section (default `true`). */
175
- includeEdges?: boolean;
176
- /** Include the Subgraphs section (default `true`). */
177
- includeSubgraphs?: boolean;
178
- /** Optional logger hook; fires with the rendered text before return. */
179
- logger?: (text: string) => void;
180
- };
181
- declare function toPretty(g: GraphDescribeOutput, opts?: ToPrettyOptions): string;
182
-
183
- export { type DiagramDirection, type LayoutDirection, type MermaidLiveTheme, type ToAsciiOptions, type ToD2Options, type ToJsonOptions, type ToMermaidOptions, type ToMermaidUrlOptions, type ToPrettyOptions, mermaidLiveUrl, toAscii, toD2, toJson, toMermaid, toMermaidUrl, toPretty };
1
+ export * from '@graphrefly/pure-ts/extra/render';