@graphrefly/graphrefly 0.45.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (714) hide show
  1. package/README.md +1 -2
  2. package/dist/_internal-B23BagFd.d.cts +33 -0
  3. package/dist/_internal-B23BagFd.d.ts +33 -0
  4. package/dist/adaptive-rate-limiter-Dch_xYIi.d.cts +111 -0
  5. package/dist/adaptive-rate-limiter-Dch_xYIi.d.ts +111 -0
  6. package/dist/agents-C0Ji9ldU.d.cts +629 -0
  7. package/dist/agents-C9zexT7I.d.ts +629 -0
  8. package/dist/audit-BAXb3VOg.d.ts +246 -0
  9. package/dist/audit-C_bPfkqS.d.cts +246 -0
  10. package/dist/backoff-7KIK3WQW.js +24 -0
  11. package/dist/backoff-7KIK3WQW.js.map +1 -0
  12. package/dist/backoff-Bnb9OoPh.d.cts +6 -0
  13. package/dist/backoff-Bnb9OoPh.d.ts +6 -0
  14. package/dist/base/composition/index.cjs +811 -0
  15. package/dist/base/composition/index.cjs.map +1 -0
  16. package/dist/base/composition/index.d.cts +469 -0
  17. package/dist/base/composition/index.d.ts +469 -0
  18. package/dist/base/composition/index.js +40 -0
  19. package/dist/base/composition/index.js.map +1 -0
  20. package/dist/base/index.cjs +6336 -0
  21. package/dist/base/index.cjs.map +1 -0
  22. package/dist/base/index.d.cts +22 -0
  23. package/dist/base/index.d.ts +22 -0
  24. package/dist/base/index.js +259 -0
  25. package/dist/base/index.js.map +1 -0
  26. package/dist/base/io/index.cjs +3270 -0
  27. package/dist/base/io/index.cjs.map +1 -0
  28. package/dist/base/io/index.d.cts +2245 -0
  29. package/dist/base/io/index.d.ts +2245 -0
  30. package/dist/base/io/index.js +117 -0
  31. package/dist/base/io/index.js.map +1 -0
  32. package/dist/base/meta/index.cjs +43 -0
  33. package/dist/base/meta/index.cjs.map +1 -0
  34. package/dist/base/meta/index.d.cts +45 -0
  35. package/dist/base/meta/index.d.ts +45 -0
  36. package/dist/base/meta/index.js +13 -0
  37. package/dist/base/meta/index.js.map +1 -0
  38. package/dist/base/mutation/index.cjs +200 -0
  39. package/dist/base/mutation/index.cjs.map +1 -0
  40. package/dist/base/mutation/index.d.cts +177 -0
  41. package/dist/base/mutation/index.d.ts +177 -0
  42. package/dist/base/mutation/index.js +22 -0
  43. package/dist/base/mutation/index.js.map +1 -0
  44. package/dist/base/render/index.cjs +1120 -0
  45. package/dist/base/render/index.cjs.map +1 -0
  46. package/dist/base/render/index.d.cts +227 -0
  47. package/dist/base/render/index.d.ts +227 -0
  48. package/dist/base/render/index.js +24 -0
  49. package/dist/base/render/index.js.map +1 -0
  50. package/dist/base/sources/browser/index.cjs +172 -0
  51. package/dist/base/sources/browser/index.cjs.map +1 -0
  52. package/dist/base/sources/browser/index.d.cts +84 -0
  53. package/dist/base/sources/browser/index.d.ts +84 -0
  54. package/dist/base/sources/browser/index.js +151 -0
  55. package/dist/base/sources/browser/index.js.map +1 -0
  56. package/dist/base/sources/event/index.cjs +98 -0
  57. package/dist/base/sources/event/index.cjs.map +1 -0
  58. package/dist/base/sources/event/index.d.cts +91 -0
  59. package/dist/base/sources/event/index.d.ts +91 -0
  60. package/dist/base/sources/event/index.js +13 -0
  61. package/dist/base/sources/event/index.js.map +1 -0
  62. package/dist/base/sources/index.cjs +755 -0
  63. package/dist/base/sources/index.cjs.map +1 -0
  64. package/dist/base/sources/index.d.cts +357 -0
  65. package/dist/base/sources/index.d.ts +357 -0
  66. package/dist/base/sources/index.js +42 -0
  67. package/dist/base/sources/index.js.map +1 -0
  68. package/dist/base/sources/node/index.cjs +320 -0
  69. package/dist/base/sources/node/index.cjs.map +1 -0
  70. package/dist/base/sources/node/index.d.cts +185 -0
  71. package/dist/base/sources/node/index.d.ts +185 -0
  72. package/dist/base/sources/node/index.js +306 -0
  73. package/dist/base/sources/node/index.js.map +1 -0
  74. package/dist/base/utils/index.cjs +37 -0
  75. package/dist/base/utils/index.cjs.map +1 -0
  76. package/dist/base/utils/index.d.cts +37 -0
  77. package/dist/base/utils/index.d.ts +37 -0
  78. package/dist/base/utils/index.js +11 -0
  79. package/dist/base/utils/index.js.map +1 -0
  80. package/dist/base/worker/index.cjs +548 -0
  81. package/dist/base/worker/index.cjs.map +1 -0
  82. package/dist/base/worker/index.d.cts +207 -0
  83. package/dist/base/worker/index.d.ts +207 -0
  84. package/dist/base/worker/index.js +20 -0
  85. package/dist/base/worker/index.js.map +1 -0
  86. package/dist/breaker-C9skL3d8.d.ts +175 -0
  87. package/dist/breaker-ugSdq54q.d.cts +175 -0
  88. package/dist/cascading-CSSbKGrJ.d.ts +199 -0
  89. package/dist/cascading-baGkiihI.d.cts +199 -0
  90. package/dist/chunk-255UCBG4.js +58 -0
  91. package/dist/chunk-255UCBG4.js.map +1 -0
  92. package/dist/chunk-2LO3EL4W.js +1 -0
  93. package/dist/chunk-2LO3EL4W.js.map +1 -0
  94. package/dist/chunk-2OB3CEJS.js +1065 -0
  95. package/dist/chunk-2OB3CEJS.js.map +1 -0
  96. package/dist/chunk-36NMM65U.js +144 -0
  97. package/dist/chunk-36NMM65U.js.map +1 -0
  98. package/dist/chunk-3CEXCBN6.js +1 -0
  99. package/dist/chunk-3CEXCBN6.js.map +1 -0
  100. package/dist/chunk-3MUSLI6E.js +105 -0
  101. package/dist/chunk-3MUSLI6E.js.map +1 -0
  102. package/dist/chunk-3PSLNJDU.js +884 -0
  103. package/dist/chunk-3PSLNJDU.js.map +1 -0
  104. package/dist/chunk-3QZY5BI7.js +92 -0
  105. package/dist/chunk-3QZY5BI7.js.map +1 -0
  106. package/dist/chunk-42FQ27MQ.js +594 -0
  107. package/dist/chunk-42FQ27MQ.js.map +1 -0
  108. package/dist/chunk-4GYMCUDZ.js +1085 -0
  109. package/dist/chunk-4GYMCUDZ.js.map +1 -0
  110. package/dist/chunk-4S53H2KR.js +382 -0
  111. package/dist/chunk-4S53H2KR.js.map +1 -0
  112. package/dist/chunk-4XCHZRUJ.js +128 -0
  113. package/dist/chunk-4XCHZRUJ.js.map +1 -0
  114. package/dist/chunk-5THCXDWY.js +725 -0
  115. package/dist/chunk-5THCXDWY.js.map +1 -0
  116. package/dist/chunk-6XZYT4SW.js +256 -0
  117. package/dist/chunk-6XZYT4SW.js.map +1 -0
  118. package/dist/chunk-7EGRP2VX.js +76 -0
  119. package/dist/chunk-7EGRP2VX.js.map +1 -0
  120. package/dist/chunk-A7KV5UK4.js +150 -0
  121. package/dist/chunk-A7KV5UK4.js.map +1 -0
  122. package/dist/chunk-APY2SS5X.js +156 -0
  123. package/dist/chunk-APY2SS5X.js.map +1 -0
  124. package/dist/chunk-AZDQPQ3V.js +66 -0
  125. package/dist/chunk-AZDQPQ3V.js.map +1 -0
  126. package/dist/chunk-BU3SEFA5.js +90 -0
  127. package/dist/chunk-BU3SEFA5.js.map +1 -0
  128. package/dist/chunk-BXGZFGZ4.js +189 -0
  129. package/dist/chunk-BXGZFGZ4.js.map +1 -0
  130. package/dist/chunk-CGHORL6G.js +579 -0
  131. package/dist/chunk-CGHORL6G.js.map +1 -0
  132. package/dist/chunk-CXANAIZU.js +530 -0
  133. package/dist/chunk-CXANAIZU.js.map +1 -0
  134. package/dist/chunk-CZQHCKKG.js +1 -0
  135. package/dist/chunk-CZQHCKKG.js.map +1 -0
  136. package/dist/chunk-DKNHAICT.js +133 -0
  137. package/dist/chunk-DKNHAICT.js.map +1 -0
  138. package/dist/chunk-DM4OMPWK.js +584 -0
  139. package/dist/chunk-DM4OMPWK.js.map +1 -0
  140. package/dist/chunk-DMSNO6ZB.js +452 -0
  141. package/dist/chunk-DMSNO6ZB.js.map +1 -0
  142. package/dist/chunk-E5OZPDIW.js +229 -0
  143. package/dist/chunk-E5OZPDIW.js.map +1 -0
  144. package/dist/chunk-EVYY4X5A.js +509 -0
  145. package/dist/chunk-EVYY4X5A.js.map +1 -0
  146. package/dist/chunk-FDFD67UO.js +1 -0
  147. package/dist/chunk-FDFD67UO.js.map +1 -0
  148. package/dist/chunk-FMPF42Q4.js +13 -0
  149. package/dist/chunk-FMPF42Q4.js.map +1 -0
  150. package/dist/chunk-FR6RGA3B.js +1277 -0
  151. package/dist/chunk-FR6RGA3B.js.map +1 -0
  152. package/dist/chunk-FW23JYNQ.js +454 -0
  153. package/dist/chunk-FW23JYNQ.js.map +1 -0
  154. package/dist/chunk-GBCENOLN.js +1575 -0
  155. package/dist/chunk-GBCENOLN.js.map +1 -0
  156. package/dist/chunk-HL7HUJIX.js +1 -0
  157. package/dist/chunk-HL7HUJIX.js.map +1 -0
  158. package/dist/chunk-HULCUY35.js +2508 -0
  159. package/dist/chunk-HULCUY35.js.map +1 -0
  160. package/dist/chunk-IHTWQEDR.js +169 -0
  161. package/dist/chunk-IHTWQEDR.js.map +1 -0
  162. package/dist/chunk-IJRR6YAI.js +128 -0
  163. package/dist/chunk-IJRR6YAI.js.map +1 -0
  164. package/dist/chunk-JGFRAFDL.js +221 -0
  165. package/dist/chunk-JGFRAFDL.js.map +1 -0
  166. package/dist/chunk-KIIXR252.js +211 -0
  167. package/dist/chunk-KIIXR252.js.map +1 -0
  168. package/dist/chunk-KN3H5CNT.js +11 -0
  169. package/dist/chunk-KN3H5CNT.js.map +1 -0
  170. package/dist/chunk-KPG3DGLA.js +1 -0
  171. package/dist/chunk-KPG3DGLA.js.map +1 -0
  172. package/dist/chunk-KRNQ6RGQ.js +1 -0
  173. package/dist/chunk-KRNQ6RGQ.js.map +1 -0
  174. package/dist/chunk-LBAJK24K.js +1071 -0
  175. package/dist/chunk-LBAJK24K.js.map +1 -0
  176. package/dist/chunk-MLTPJMH6.js +417 -0
  177. package/dist/chunk-MLTPJMH6.js.map +1 -0
  178. package/dist/chunk-N3SZ7BMH.js +95 -0
  179. package/dist/chunk-N3SZ7BMH.js.map +1 -0
  180. package/dist/chunk-NDUD3IMO.js +540 -0
  181. package/dist/chunk-NDUD3IMO.js.map +1 -0
  182. package/dist/chunk-NY2PYHNC.js +873 -0
  183. package/dist/chunk-NY2PYHNC.js.map +1 -0
  184. package/dist/chunk-O3MT7DYI.js +225 -0
  185. package/dist/chunk-O3MT7DYI.js.map +1 -0
  186. package/dist/chunk-OCUDSN63.js +2386 -0
  187. package/dist/chunk-OCUDSN63.js.map +1 -0
  188. package/dist/chunk-OIWU3NYV.js +199 -0
  189. package/dist/chunk-OIWU3NYV.js.map +1 -0
  190. package/dist/chunk-OO5BM6CJ.js +1153 -0
  191. package/dist/chunk-OO5BM6CJ.js.map +1 -0
  192. package/dist/chunk-OQUIJT7A.js +1 -0
  193. package/dist/chunk-OQUIJT7A.js.map +1 -0
  194. package/dist/chunk-P5LBT622.js +105 -0
  195. package/dist/chunk-P5LBT622.js.map +1 -0
  196. package/dist/chunk-PKGQG5QQ.js +519 -0
  197. package/dist/chunk-PKGQG5QQ.js.map +1 -0
  198. package/dist/chunk-PKPO3JTZ.js +561 -0
  199. package/dist/chunk-PKPO3JTZ.js.map +1 -0
  200. package/dist/chunk-PL5UDIQ5.js +118 -0
  201. package/dist/chunk-PL5UDIQ5.js.map +1 -0
  202. package/dist/chunk-PZWISPIQ.js +432 -0
  203. package/dist/chunk-PZWISPIQ.js.map +1 -0
  204. package/dist/chunk-Q3EYOCZB.js +510 -0
  205. package/dist/chunk-Q3EYOCZB.js.map +1 -0
  206. package/dist/chunk-QMBYUVRL.js +15 -0
  207. package/dist/chunk-QMBYUVRL.js.map +1 -0
  208. package/dist/chunk-RAGGHLCV.js +200 -0
  209. package/dist/chunk-RAGGHLCV.js.map +1 -0
  210. package/dist/chunk-RGL53X5G.js +574 -0
  211. package/dist/chunk-RGL53X5G.js.map +1 -0
  212. package/dist/chunk-RJOG4IJU.js +1039 -0
  213. package/dist/chunk-RJOG4IJU.js.map +1 -0
  214. package/dist/chunk-SOOKUYVM.js +403 -0
  215. package/dist/chunk-SOOKUYVM.js.map +1 -0
  216. package/dist/chunk-T5BN5KG7.js +1 -0
  217. package/dist/chunk-T5BN5KG7.js.map +1 -0
  218. package/dist/chunk-TP7244Y6.js +207 -0
  219. package/dist/chunk-TP7244Y6.js.map +1 -0
  220. package/dist/chunk-TSBFTJKM.js +57 -0
  221. package/dist/chunk-TSBFTJKM.js.map +1 -0
  222. package/dist/chunk-URQ2CBBF.js +143 -0
  223. package/dist/chunk-URQ2CBBF.js.map +1 -0
  224. package/dist/chunk-W2BOPXTI.js +1 -0
  225. package/dist/chunk-W2BOPXTI.js.map +1 -0
  226. package/dist/chunk-WKSWLSCX.js +207 -0
  227. package/dist/chunk-WKSWLSCX.js.map +1 -0
  228. package/dist/chunk-Y52CS6YA.js +88 -0
  229. package/dist/chunk-Y52CS6YA.js.map +1 -0
  230. package/dist/chunk-YCBUWK77.js +92 -0
  231. package/dist/chunk-YCBUWK77.js.map +1 -0
  232. package/dist/chunk-YJ4U2D2C.js +314 -0
  233. package/dist/chunk-YJ4U2D2C.js.map +1 -0
  234. package/dist/chunk-Z4YXAUDN.js +239 -0
  235. package/dist/chunk-Z4YXAUDN.js.map +1 -0
  236. package/dist/chunk-Z6EGP5D7.js +92 -0
  237. package/dist/chunk-Z6EGP5D7.js.map +1 -0
  238. package/dist/compat/index.cjs +3083 -2
  239. package/dist/compat/index.cjs.map +1 -1
  240. package/dist/compat/index.d.cts +116 -1
  241. package/dist/compat/index.d.ts +116 -1
  242. package/dist/compat/index.js +175 -2
  243. package/dist/compat/index.js.map +1 -1
  244. package/dist/compat/jotai/index.cjs +130 -2
  245. package/dist/compat/jotai/index.cjs.map +1 -1
  246. package/dist/compat/jotai/index.d.cts +2 -1
  247. package/dist/compat/jotai/index.d.ts +2 -1
  248. package/dist/compat/jotai/index.js +7 -2
  249. package/dist/compat/jotai/index.js.map +1 -1
  250. package/dist/compat/nanostores/index.cjs +186 -2
  251. package/dist/compat/nanostores/index.cjs.map +1 -1
  252. package/dist/compat/nanostores/index.d.cts +2 -1
  253. package/dist/compat/nanostores/index.d.ts +2 -1
  254. package/dist/compat/nanostores/index.js +21 -2
  255. package/dist/compat/nanostores/index.js.map +1 -1
  256. package/dist/compat/nestjs/index.cjs +2224 -2
  257. package/dist/compat/nestjs/index.cjs.map +1 -1
  258. package/dist/compat/nestjs/index.d.cts +10 -1
  259. package/dist/compat/nestjs/index.d.ts +10 -1
  260. package/dist/compat/nestjs/index.js +77 -2
  261. package/dist/compat/nestjs/index.js.map +1 -1
  262. package/dist/compat/react/index.cjs +95 -2
  263. package/dist/compat/react/index.cjs.map +1 -1
  264. package/dist/compat/react/index.d.cts +2 -1
  265. package/dist/compat/react/index.d.ts +2 -1
  266. package/dist/compat/react/index.js +11 -2
  267. package/dist/compat/react/index.js.map +1 -1
  268. package/dist/compat/solid/index.cjs +82 -2
  269. package/dist/compat/solid/index.cjs.map +1 -1
  270. package/dist/compat/solid/index.d.cts +2 -1
  271. package/dist/compat/solid/index.d.ts +2 -1
  272. package/dist/compat/solid/index.js +11 -2
  273. package/dist/compat/solid/index.js.map +1 -1
  274. package/dist/compat/svelte/index.cjs +85 -2
  275. package/dist/compat/svelte/index.cjs.map +1 -1
  276. package/dist/compat/svelte/index.d.cts +2 -1
  277. package/dist/compat/svelte/index.d.ts +2 -1
  278. package/dist/compat/svelte/index.js +11 -2
  279. package/dist/compat/svelte/index.js.map +1 -1
  280. package/dist/compat/vue/index.cjs +100 -2
  281. package/dist/compat/vue/index.cjs.map +1 -1
  282. package/dist/compat/vue/index.d.cts +3 -1
  283. package/dist/compat/vue/index.d.ts +3 -1
  284. package/dist/compat/vue/index.js +11 -2
  285. package/dist/compat/vue/index.js.map +1 -1
  286. package/dist/compat/zustand/index.cjs +50 -2
  287. package/dist/compat/zustand/index.cjs.map +1 -1
  288. package/dist/compat/zustand/index.d.cts +2 -1
  289. package/dist/compat/zustand/index.d.ts +2 -1
  290. package/dist/compat/zustand/index.js +7 -2
  291. package/dist/compat/zustand/index.js.map +1 -1
  292. package/dist/distill-De6Rnn15.d.cts +48 -0
  293. package/dist/distill-De6Rnn15.d.ts +48 -0
  294. package/dist/external-register-CWyroXb_.d.cts +138 -0
  295. package/dist/external-register-CWyroXb_.d.ts +138 -0
  296. package/dist/fallback-Bx46zqky.d.cts +243 -0
  297. package/dist/fallback-pIWW8A2d.d.ts +243 -0
  298. package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
  299. package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
  300. package/dist/index-5SU_O78r.d.cts +754 -0
  301. package/dist/index-B6pxYJzO.d.cts +36 -0
  302. package/dist/index-B6pxYJzO.d.ts +36 -0
  303. package/dist/index-BFsng6v1.d.cts +44 -0
  304. package/dist/index-BFsng6v1.d.ts +44 -0
  305. package/dist/index-Bg-LwEt-.d.cts +45 -0
  306. package/dist/index-Bg-LwEt-.d.ts +45 -0
  307. package/dist/index-Brp888t0.d.cts +127 -0
  308. package/dist/index-Brp888t0.d.ts +127 -0
  309. package/dist/index-CDfk6jHN.d.cts +37 -0
  310. package/dist/index-CDfk6jHN.d.ts +37 -0
  311. package/dist/index-CEXCtYYJ.d.ts +754 -0
  312. package/dist/index-DLAxYaN5.d.cts +169 -0
  313. package/dist/index-DLAxYaN5.d.ts +169 -0
  314. package/dist/index-DeWbQzMe.d.cts +34 -0
  315. package/dist/index-DeWbQzMe.d.ts +34 -0
  316. package/dist/index-dX9IzPqj.d.cts +86 -0
  317. package/dist/index-dX9IzPqj.d.ts +86 -0
  318. package/dist/index.cjs +25950 -0
  319. package/dist/index.cjs.map +1 -1
  320. package/dist/index.d.cts +56 -42
  321. package/dist/index.d.ts +56 -42
  322. package/dist/index.js +849 -0
  323. package/dist/index.js.map +1 -1
  324. package/dist/layout-types-B5aiHYgk.d.cts +72 -0
  325. package/dist/layout-types-B5aiHYgk.d.ts +72 -0
  326. package/dist/memory-composers-BryDrRBX.d.cts +529 -0
  327. package/dist/memory-composers-CVQqPYEV.d.ts +529 -0
  328. package/dist/observable-BXQoW1P-.d.cts +36 -0
  329. package/dist/observable-BXQoW1P-.d.ts +36 -0
  330. package/dist/pipeline-graph-Ce47CB6Y.d.cts +145 -0
  331. package/dist/pipeline-graph-DXCwY9vG.d.ts +145 -0
  332. package/dist/presets/ai/index.cjs +4377 -0
  333. package/dist/presets/ai/index.cjs.map +1 -0
  334. package/dist/presets/ai/index.d.cts +98 -0
  335. package/dist/presets/ai/index.d.ts +98 -0
  336. package/dist/presets/ai/index.js +54 -0
  337. package/dist/presets/ai/index.js.map +1 -0
  338. package/dist/presets/harness/index.cjs +5929 -0
  339. package/dist/presets/harness/index.cjs.map +1 -0
  340. package/dist/presets/harness/index.d.cts +566 -0
  341. package/dist/presets/harness/index.d.ts +566 -0
  342. package/dist/presets/harness/index.js +71 -0
  343. package/dist/presets/harness/index.js.map +1 -0
  344. package/dist/presets/index.cjs +9782 -0
  345. package/dist/presets/index.cjs.map +1 -0
  346. package/dist/presets/index.d.cts +28 -0
  347. package/dist/presets/index.d.ts +28 -0
  348. package/dist/presets/index.js +129 -0
  349. package/dist/presets/index.js.map +1 -0
  350. package/dist/presets/inspect/index.cjs +1087 -0
  351. package/dist/presets/inspect/index.cjs.map +1 -0
  352. package/dist/presets/inspect/index.d.cts +172 -0
  353. package/dist/presets/inspect/index.d.ts +172 -0
  354. package/dist/presets/inspect/index.js +21 -0
  355. package/dist/presets/inspect/index.js.map +1 -0
  356. package/dist/presets/resilience/index.cjs +1593 -0
  357. package/dist/presets/resilience/index.cjs.map +1 -0
  358. package/dist/presets/resilience/index.d.cts +205 -0
  359. package/dist/presets/resilience/index.d.ts +205 -0
  360. package/dist/presets/resilience/index.js +18 -0
  361. package/dist/presets/resilience/index.js.map +1 -0
  362. package/dist/rate-limiter-CEALq4N1.d.ts +559 -0
  363. package/dist/rate-limiter-DpVbSYdH.d.cts +559 -0
  364. package/dist/reactive-layout-fswlBUvX.d.cts +195 -0
  365. package/dist/reactive-layout-fswlBUvX.d.ts +195 -0
  366. package/dist/retry-BDbRZ_gx.d.ts +125 -0
  367. package/dist/retry-DWuhjvsA.d.cts +125 -0
  368. package/dist/solutions/index.cjs +8200 -0
  369. package/dist/solutions/index.cjs.map +1 -0
  370. package/dist/solutions/index.d.cts +23 -0
  371. package/dist/solutions/index.d.ts +23 -0
  372. package/dist/solutions/index.js +55 -0
  373. package/dist/solutions/index.js.map +1 -0
  374. package/dist/spawnable-5mDY501F.d.cts +746 -0
  375. package/dist/spawnable-D3lR0oQu.d.ts +746 -0
  376. package/dist/status-U-rUI79b.d.cts +84 -0
  377. package/dist/status-U-rUI79b.d.ts +84 -0
  378. package/dist/timeout-U5O4ESK3.js +12 -0
  379. package/dist/timeout-U5O4ESK3.js.map +1 -0
  380. package/dist/types-BB5Lw-pB.d.cts +442 -0
  381. package/dist/types-BB5Lw-pB.d.ts +442 -0
  382. package/dist/types-CJWIMJiZ.d.ts +548 -0
  383. package/dist/types-vCq7ShIm.d.cts +548 -0
  384. package/dist/utils/ai/browser.cjs +2169 -0
  385. package/dist/utils/ai/browser.cjs.map +1 -0
  386. package/dist/utils/ai/browser.d.cts +129 -0
  387. package/dist/utils/ai/browser.d.ts +129 -0
  388. package/dist/utils/ai/browser.js +255 -0
  389. package/dist/utils/ai/browser.js.map +1 -0
  390. package/dist/utils/ai/index.cjs +8468 -0
  391. package/dist/utils/ai/index.cjs.map +1 -0
  392. package/dist/utils/ai/index.d.cts +1777 -0
  393. package/dist/utils/ai/index.d.ts +1777 -0
  394. package/dist/utils/ai/index.js +173 -0
  395. package/dist/utils/ai/index.js.map +1 -0
  396. package/dist/utils/ai/node.cjs +648 -0
  397. package/dist/utils/ai/node.cjs.map +1 -0
  398. package/dist/utils/ai/node.d.cts +57 -0
  399. package/dist/utils/ai/node.d.ts +57 -0
  400. package/dist/utils/ai/node.js +84 -0
  401. package/dist/utils/ai/node.js.map +1 -0
  402. package/dist/utils/cqrs/index.cjs +1036 -0
  403. package/dist/utils/cqrs/index.cjs.map +1 -0
  404. package/dist/utils/cqrs/index.d.cts +438 -0
  405. package/dist/utils/cqrs/index.d.ts +438 -0
  406. package/dist/utils/cqrs/index.js +18 -0
  407. package/dist/utils/cqrs/index.js.map +1 -0
  408. package/dist/utils/demo-shell/index.cjs +865 -0
  409. package/dist/utils/demo-shell/index.cjs.map +1 -0
  410. package/dist/utils/demo-shell/index.d.cts +90 -0
  411. package/dist/utils/demo-shell/index.d.ts +90 -0
  412. package/dist/utils/demo-shell/index.js +13 -0
  413. package/dist/utils/demo-shell/index.js.map +1 -0
  414. package/dist/utils/domain-templates/index.cjs +732 -0
  415. package/dist/utils/domain-templates/index.cjs.map +1 -0
  416. package/dist/utils/domain-templates/index.d.cts +214 -0
  417. package/dist/utils/domain-templates/index.d.ts +214 -0
  418. package/dist/utils/domain-templates/index.js +17 -0
  419. package/dist/utils/domain-templates/index.js.map +1 -0
  420. package/dist/utils/graphspec/index.cjs +1174 -0
  421. package/dist/utils/graphspec/index.cjs.map +1 -0
  422. package/dist/utils/graphspec/index.d.cts +449 -0
  423. package/dist/utils/graphspec/index.d.ts +449 -0
  424. package/dist/utils/graphspec/index.js +35 -0
  425. package/dist/utils/graphspec/index.js.map +1 -0
  426. package/dist/utils/harness/index.cjs +656 -0
  427. package/dist/utils/harness/index.cjs.map +1 -0
  428. package/dist/utils/harness/index.d.cts +542 -0
  429. package/dist/utils/harness/index.d.ts +542 -0
  430. package/dist/utils/harness/index.js +56 -0
  431. package/dist/utils/harness/index.js.map +1 -0
  432. package/dist/utils/index.cjs +17609 -0
  433. package/dist/utils/index.cjs.map +1 -0
  434. package/dist/utils/index.d.cts +96 -0
  435. package/dist/utils/index.d.ts +96 -0
  436. package/dist/utils/index.js +514 -0
  437. package/dist/utils/index.js.map +1 -0
  438. package/dist/utils/inspect/index.cjs +807 -0
  439. package/dist/utils/inspect/index.cjs.map +1 -0
  440. package/dist/utils/inspect/index.d.cts +123 -0
  441. package/dist/utils/inspect/index.d.ts +123 -0
  442. package/dist/utils/inspect/index.js +30 -0
  443. package/dist/utils/inspect/index.js.map +1 -0
  444. package/dist/utils/job-queue/index.cjs +717 -0
  445. package/dist/utils/job-queue/index.cjs.map +1 -0
  446. package/dist/utils/job-queue/index.d.cts +200 -0
  447. package/dist/utils/job-queue/index.d.ts +200 -0
  448. package/dist/utils/job-queue/index.js +18 -0
  449. package/dist/utils/job-queue/index.js.map +1 -0
  450. package/dist/utils/memory/index.cjs +1451 -0
  451. package/dist/utils/memory/index.cjs.map +1 -0
  452. package/dist/utils/memory/index.d.cts +582 -0
  453. package/dist/utils/memory/index.d.ts +582 -0
  454. package/dist/utils/memory/index.js +19 -0
  455. package/dist/utils/memory/index.js.map +1 -0
  456. package/dist/utils/messaging/index.cjs +666 -0
  457. package/dist/utils/messaging/index.cjs.map +1 -0
  458. package/dist/utils/messaging/index.d.cts +562 -0
  459. package/dist/utils/messaging/index.d.ts +562 -0
  460. package/dist/utils/messaging/index.js +50 -0
  461. package/dist/utils/messaging/index.js.map +1 -0
  462. package/dist/utils/orchestration/index.cjs +876 -0
  463. package/dist/utils/orchestration/index.cjs.map +1 -0
  464. package/dist/utils/orchestration/index.d.cts +233 -0
  465. package/dist/utils/orchestration/index.d.ts +233 -0
  466. package/dist/utils/orchestration/index.js +19 -0
  467. package/dist/utils/orchestration/index.js.map +1 -0
  468. package/dist/utils/process/index.cjs +743 -0
  469. package/dist/utils/process/index.cjs.map +1 -0
  470. package/dist/utils/process/index.d.cts +411 -0
  471. package/dist/utils/process/index.d.ts +411 -0
  472. package/dist/utils/process/index.js +14 -0
  473. package/dist/utils/process/index.js.map +1 -0
  474. package/dist/utils/reactive-layout/index.cjs +1607 -0
  475. package/dist/utils/reactive-layout/index.cjs.map +1 -0
  476. package/dist/utils/reactive-layout/index.d.cts +492 -0
  477. package/dist/utils/reactive-layout/index.d.ts +492 -0
  478. package/dist/utils/reactive-layout/index.js +52 -0
  479. package/dist/utils/reactive-layout/index.js.map +1 -0
  480. package/dist/utils/reduction/index.cjs +203 -0
  481. package/dist/utils/reduction/index.cjs.map +1 -0
  482. package/dist/utils/reduction/index.d.cts +102 -0
  483. package/dist/utils/reduction/index.d.ts +102 -0
  484. package/dist/utils/reduction/index.js +14 -0
  485. package/dist/utils/reduction/index.js.map +1 -0
  486. package/dist/utils/resilience/index.cjs +1617 -0
  487. package/dist/utils/resilience/index.cjs.map +1 -0
  488. package/dist/utils/resilience/index.d.cts +9 -0
  489. package/dist/utils/resilience/index.d.ts +9 -0
  490. package/dist/utils/resilience/index.js +44 -0
  491. package/dist/utils/resilience/index.js.map +1 -0
  492. package/dist/utils/surface/index.cjs +1070 -0
  493. package/dist/utils/surface/index.cjs.map +1 -0
  494. package/dist/utils/surface/index.d.cts +240 -0
  495. package/dist/utils/surface/index.d.ts +240 -0
  496. package/dist/utils/surface/index.js +30 -0
  497. package/dist/utils/surface/index.js.map +1 -0
  498. package/dist/utils/topology-view/index.cjs +620 -0
  499. package/dist/utils/topology-view/index.cjs.map +1 -0
  500. package/dist/utils/topology-view/index.d.cts +68 -0
  501. package/dist/utils/topology-view/index.d.ts +68 -0
  502. package/dist/utils/topology-view/index.js +11 -0
  503. package/dist/utils/topology-view/index.js.map +1 -0
  504. package/package.json +293 -237
  505. package/dist/core/index.cjs +0 -21
  506. package/dist/core/index.cjs.map +0 -1
  507. package/dist/core/index.d.cts +0 -1
  508. package/dist/core/index.d.ts +0 -1
  509. package/dist/core/index.js +0 -3
  510. package/dist/core/index.js.map +0 -1
  511. package/dist/extra/browser.cjs +0 -21
  512. package/dist/extra/browser.cjs.map +0 -1
  513. package/dist/extra/browser.d.cts +0 -1
  514. package/dist/extra/browser.d.ts +0 -1
  515. package/dist/extra/browser.js +0 -3
  516. package/dist/extra/browser.js.map +0 -1
  517. package/dist/extra/index.cjs +0 -21
  518. package/dist/extra/index.cjs.map +0 -1
  519. package/dist/extra/index.d.cts +0 -1
  520. package/dist/extra/index.d.ts +0 -1
  521. package/dist/extra/index.js +0 -3
  522. package/dist/extra/index.js.map +0 -1
  523. package/dist/extra/node.cjs +0 -21
  524. package/dist/extra/node.cjs.map +0 -1
  525. package/dist/extra/node.d.cts +0 -1
  526. package/dist/extra/node.d.ts +0 -1
  527. package/dist/extra/node.js +0 -3
  528. package/dist/extra/node.js.map +0 -1
  529. package/dist/extra/operators.cjs +0 -21
  530. package/dist/extra/operators.cjs.map +0 -1
  531. package/dist/extra/operators.d.cts +0 -1
  532. package/dist/extra/operators.d.ts +0 -1
  533. package/dist/extra/operators.js +0 -3
  534. package/dist/extra/operators.js.map +0 -1
  535. package/dist/extra/reactive.cjs +0 -21
  536. package/dist/extra/reactive.cjs.map +0 -1
  537. package/dist/extra/reactive.d.cts +0 -1
  538. package/dist/extra/reactive.d.ts +0 -1
  539. package/dist/extra/reactive.js +0 -3
  540. package/dist/extra/reactive.js.map +0 -1
  541. package/dist/extra/render/index.cjs +0 -21
  542. package/dist/extra/render/index.cjs.map +0 -1
  543. package/dist/extra/render/index.d.cts +0 -1
  544. package/dist/extra/render/index.d.ts +0 -1
  545. package/dist/extra/render/index.js +0 -3
  546. package/dist/extra/render/index.js.map +0 -1
  547. package/dist/extra/sources.cjs +0 -21
  548. package/dist/extra/sources.cjs.map +0 -1
  549. package/dist/extra/sources.d.cts +0 -1
  550. package/dist/extra/sources.d.ts +0 -1
  551. package/dist/extra/sources.js +0 -3
  552. package/dist/extra/sources.js.map +0 -1
  553. package/dist/extra/storage-browser.cjs +0 -21
  554. package/dist/extra/storage-browser.cjs.map +0 -1
  555. package/dist/extra/storage-browser.d.cts +0 -1
  556. package/dist/extra/storage-browser.d.ts +0 -1
  557. package/dist/extra/storage-browser.js +0 -3
  558. package/dist/extra/storage-browser.js.map +0 -1
  559. package/dist/extra/storage-core.cjs +0 -21
  560. package/dist/extra/storage-core.cjs.map +0 -1
  561. package/dist/extra/storage-core.d.cts +0 -1
  562. package/dist/extra/storage-core.d.ts +0 -1
  563. package/dist/extra/storage-core.js +0 -3
  564. package/dist/extra/storage-core.js.map +0 -1
  565. package/dist/extra/storage-node.cjs +0 -21
  566. package/dist/extra/storage-node.cjs.map +0 -1
  567. package/dist/extra/storage-node.d.cts +0 -1
  568. package/dist/extra/storage-node.d.ts +0 -1
  569. package/dist/extra/storage-node.js +0 -3
  570. package/dist/extra/storage-node.js.map +0 -1
  571. package/dist/extra/storage-tiers-browser.cjs +0 -21
  572. package/dist/extra/storage-tiers-browser.cjs.map +0 -1
  573. package/dist/extra/storage-tiers-browser.d.cts +0 -1
  574. package/dist/extra/storage-tiers-browser.d.ts +0 -1
  575. package/dist/extra/storage-tiers-browser.js +0 -3
  576. package/dist/extra/storage-tiers-browser.js.map +0 -1
  577. package/dist/extra/storage-tiers-node.cjs +0 -21
  578. package/dist/extra/storage-tiers-node.cjs.map +0 -1
  579. package/dist/extra/storage-tiers-node.d.cts +0 -1
  580. package/dist/extra/storage-tiers-node.d.ts +0 -1
  581. package/dist/extra/storage-tiers-node.js +0 -3
  582. package/dist/extra/storage-tiers-node.js.map +0 -1
  583. package/dist/extra/storage-tiers.cjs +0 -21
  584. package/dist/extra/storage-tiers.cjs.map +0 -1
  585. package/dist/extra/storage-tiers.d.cts +0 -1
  586. package/dist/extra/storage-tiers.d.ts +0 -1
  587. package/dist/extra/storage-tiers.js +0 -3
  588. package/dist/extra/storage-tiers.js.map +0 -1
  589. package/dist/extra/storage-wal.cjs +0 -21
  590. package/dist/extra/storage-wal.cjs.map +0 -1
  591. package/dist/extra/storage-wal.d.cts +0 -1
  592. package/dist/extra/storage-wal.d.ts +0 -1
  593. package/dist/extra/storage-wal.js +0 -3
  594. package/dist/extra/storage-wal.js.map +0 -1
  595. package/dist/graph/index.cjs +0 -21
  596. package/dist/graph/index.cjs.map +0 -1
  597. package/dist/graph/index.d.cts +0 -1
  598. package/dist/graph/index.d.ts +0 -1
  599. package/dist/graph/index.js +0 -3
  600. package/dist/graph/index.js.map +0 -1
  601. package/dist/patterns/ai/browser.cjs +0 -21
  602. package/dist/patterns/ai/browser.cjs.map +0 -1
  603. package/dist/patterns/ai/browser.d.cts +0 -1
  604. package/dist/patterns/ai/browser.d.ts +0 -1
  605. package/dist/patterns/ai/browser.js +0 -3
  606. package/dist/patterns/ai/browser.js.map +0 -1
  607. package/dist/patterns/ai/index.cjs +0 -21
  608. package/dist/patterns/ai/index.cjs.map +0 -1
  609. package/dist/patterns/ai/index.d.cts +0 -1
  610. package/dist/patterns/ai/index.d.ts +0 -1
  611. package/dist/patterns/ai/index.js +0 -3
  612. package/dist/patterns/ai/index.js.map +0 -1
  613. package/dist/patterns/ai/node.cjs +0 -21
  614. package/dist/patterns/ai/node.cjs.map +0 -1
  615. package/dist/patterns/ai/node.d.cts +0 -1
  616. package/dist/patterns/ai/node.d.ts +0 -1
  617. package/dist/patterns/ai/node.js +0 -3
  618. package/dist/patterns/ai/node.js.map +0 -1
  619. package/dist/patterns/cqrs/index.cjs +0 -21
  620. package/dist/patterns/cqrs/index.cjs.map +0 -1
  621. package/dist/patterns/cqrs/index.d.cts +0 -1
  622. package/dist/patterns/cqrs/index.d.ts +0 -1
  623. package/dist/patterns/cqrs/index.js +0 -3
  624. package/dist/patterns/cqrs/index.js.map +0 -1
  625. package/dist/patterns/demo-shell/index.cjs +0 -21
  626. package/dist/patterns/demo-shell/index.cjs.map +0 -1
  627. package/dist/patterns/demo-shell/index.d.cts +0 -1
  628. package/dist/patterns/demo-shell/index.d.ts +0 -1
  629. package/dist/patterns/demo-shell/index.js +0 -3
  630. package/dist/patterns/demo-shell/index.js.map +0 -1
  631. package/dist/patterns/domain-templates/index.cjs +0 -21
  632. package/dist/patterns/domain-templates/index.cjs.map +0 -1
  633. package/dist/patterns/domain-templates/index.d.cts +0 -1
  634. package/dist/patterns/domain-templates/index.d.ts +0 -1
  635. package/dist/patterns/domain-templates/index.js +0 -3
  636. package/dist/patterns/domain-templates/index.js.map +0 -1
  637. package/dist/patterns/graphspec/index.cjs +0 -21
  638. package/dist/patterns/graphspec/index.cjs.map +0 -1
  639. package/dist/patterns/graphspec/index.d.cts +0 -1
  640. package/dist/patterns/graphspec/index.d.ts +0 -1
  641. package/dist/patterns/graphspec/index.js +0 -3
  642. package/dist/patterns/graphspec/index.js.map +0 -1
  643. package/dist/patterns/harness/index.cjs +0 -21
  644. package/dist/patterns/harness/index.cjs.map +0 -1
  645. package/dist/patterns/harness/index.d.cts +0 -1
  646. package/dist/patterns/harness/index.d.ts +0 -1
  647. package/dist/patterns/harness/index.js +0 -3
  648. package/dist/patterns/harness/index.js.map +0 -1
  649. package/dist/patterns/inspect/index.cjs +0 -21
  650. package/dist/patterns/inspect/index.cjs.map +0 -1
  651. package/dist/patterns/inspect/index.d.cts +0 -1
  652. package/dist/patterns/inspect/index.d.ts +0 -1
  653. package/dist/patterns/inspect/index.js +0 -3
  654. package/dist/patterns/inspect/index.js.map +0 -1
  655. package/dist/patterns/job-queue/index.cjs +0 -21
  656. package/dist/patterns/job-queue/index.cjs.map +0 -1
  657. package/dist/patterns/job-queue/index.d.cts +0 -1
  658. package/dist/patterns/job-queue/index.d.ts +0 -1
  659. package/dist/patterns/job-queue/index.js +0 -3
  660. package/dist/patterns/job-queue/index.js.map +0 -1
  661. package/dist/patterns/memory/index.cjs +0 -21
  662. package/dist/patterns/memory/index.cjs.map +0 -1
  663. package/dist/patterns/memory/index.d.cts +0 -1
  664. package/dist/patterns/memory/index.d.ts +0 -1
  665. package/dist/patterns/memory/index.js +0 -3
  666. package/dist/patterns/memory/index.js.map +0 -1
  667. package/dist/patterns/messaging/index.cjs +0 -21
  668. package/dist/patterns/messaging/index.cjs.map +0 -1
  669. package/dist/patterns/messaging/index.d.cts +0 -1
  670. package/dist/patterns/messaging/index.d.ts +0 -1
  671. package/dist/patterns/messaging/index.js +0 -3
  672. package/dist/patterns/messaging/index.js.map +0 -1
  673. package/dist/patterns/orchestration/index.cjs +0 -21
  674. package/dist/patterns/orchestration/index.cjs.map +0 -1
  675. package/dist/patterns/orchestration/index.d.cts +0 -1
  676. package/dist/patterns/orchestration/index.d.ts +0 -1
  677. package/dist/patterns/orchestration/index.js +0 -3
  678. package/dist/patterns/orchestration/index.js.map +0 -1
  679. package/dist/patterns/process/index.cjs +0 -21
  680. package/dist/patterns/process/index.cjs.map +0 -1
  681. package/dist/patterns/process/index.d.cts +0 -1
  682. package/dist/patterns/process/index.d.ts +0 -1
  683. package/dist/patterns/process/index.js +0 -3
  684. package/dist/patterns/process/index.js.map +0 -1
  685. package/dist/patterns/reactive-layout/index.cjs +0 -21
  686. package/dist/patterns/reactive-layout/index.cjs.map +0 -1
  687. package/dist/patterns/reactive-layout/index.d.cts +0 -1
  688. package/dist/patterns/reactive-layout/index.d.ts +0 -1
  689. package/dist/patterns/reactive-layout/index.js +0 -3
  690. package/dist/patterns/reactive-layout/index.js.map +0 -1
  691. package/dist/patterns/reduction/index.cjs +0 -21
  692. package/dist/patterns/reduction/index.cjs.map +0 -1
  693. package/dist/patterns/reduction/index.d.cts +0 -1
  694. package/dist/patterns/reduction/index.d.ts +0 -1
  695. package/dist/patterns/reduction/index.js +0 -3
  696. package/dist/patterns/reduction/index.js.map +0 -1
  697. package/dist/patterns/surface/index.cjs +0 -21
  698. package/dist/patterns/surface/index.cjs.map +0 -1
  699. package/dist/patterns/surface/index.d.cts +0 -1
  700. package/dist/patterns/surface/index.d.ts +0 -1
  701. package/dist/patterns/surface/index.js +0 -3
  702. package/dist/patterns/surface/index.js.map +0 -1
  703. package/dist/patterns/topology-view/index.cjs +0 -21
  704. package/dist/patterns/topology-view/index.cjs.map +0 -1
  705. package/dist/patterns/topology-view/index.d.cts +0 -1
  706. package/dist/patterns/topology-view/index.d.ts +0 -1
  707. package/dist/patterns/topology-view/index.js +0 -3
  708. package/dist/patterns/topology-view/index.js.map +0 -1
  709. package/dist/testing/index.cjs +0 -21
  710. package/dist/testing/index.cjs.map +0 -1
  711. package/dist/testing/index.d.cts +0 -1
  712. package/dist/testing/index.d.ts +0 -1
  713. package/dist/testing/index.js +0 -3
  714. package/dist/testing/index.js.map +0 -1
@@ -0,0 +1,519 @@
1
+ import {
2
+ countCells,
3
+ truncateToCells
4
+ } from "./chunk-36NMM65U.js";
5
+ import {
6
+ sugiyamaLayout
7
+ } from "./chunk-DMSNO6ZB.js";
8
+
9
+ // src/base/render/_ascii-grid.ts
10
+ var UNICODE = {
11
+ horizontal: "\u2500",
12
+ vertical: "\u2502",
13
+ cornerTL: "\u250C",
14
+ cornerTR: "\u2510",
15
+ cornerBL: "\u2514",
16
+ cornerBR: "\u2518",
17
+ tDown: "\u252C",
18
+ tUp: "\u2534",
19
+ tRight: "\u251C",
20
+ tLeft: "\u2524",
21
+ cross: "\u253C",
22
+ arrowRight: "\u25B6",
23
+ arrowDown: "\u25BC",
24
+ arrowLeft: "\u25C0",
25
+ arrowUp: "\u25B2",
26
+ boxTL: "\u250C",
27
+ boxTR: "\u2510",
28
+ boxBL: "\u2514",
29
+ boxBR: "\u2518",
30
+ boxH: "\u2500",
31
+ boxV: "\u2502"
32
+ };
33
+ var ASCII = {
34
+ horizontal: "-",
35
+ vertical: "|",
36
+ cornerTL: "+",
37
+ cornerTR: "+",
38
+ cornerBL: "+",
39
+ cornerBR: "+",
40
+ tDown: "+",
41
+ tUp: "+",
42
+ tRight: "+",
43
+ tLeft: "+",
44
+ cross: "+",
45
+ arrowRight: ">",
46
+ arrowDown: "v",
47
+ arrowLeft: "<",
48
+ arrowUp: "^",
49
+ boxTL: "+",
50
+ boxTR: "+",
51
+ boxBL: "+",
52
+ boxBR: "+",
53
+ boxH: "-",
54
+ boxV: "|"
55
+ };
56
+ function renderGrid(layout, options) {
57
+ const glyphs = options.charset === "ascii" ? ASCII : UNICODE;
58
+ const width = layout.width;
59
+ const height = layout.height;
60
+ const grid = Array.from(
61
+ { length: height },
62
+ () => Array.from({ length: width }, () => " ")
63
+ );
64
+ const kind = Array.from(
65
+ { length: height },
66
+ () => Array.from({ length: width }, () => "empty")
67
+ );
68
+ for (const edge of layout.edges) {
69
+ drawEdge(grid, kind, glyphs, edge);
70
+ }
71
+ for (const box of layout.boxes) {
72
+ drawBox(grid, kind, glyphs, box, options.labelOf(box.id));
73
+ }
74
+ return grid.map((row) => stripTrailing(row.join(""))).join("\n");
75
+ }
76
+ function drawBox(grid, kind, glyphs, box, label) {
77
+ const { x, y, w, h } = box;
78
+ if (w < 2 || h < 2) {
79
+ if (h > 0) writeLabel(grid, kind, x, y, w, label);
80
+ return;
81
+ }
82
+ putBoxCell(grid, kind, x, y, glyphs.boxTL);
83
+ for (let cx = x + 1; cx < x + w - 1; cx += 1) putBoxCell(grid, kind, cx, y, glyphs.boxH);
84
+ putBoxCell(grid, kind, x + w - 1, y, glyphs.boxTR);
85
+ for (let cy = y + 1; cy < y + h - 1; cy += 1) {
86
+ putBoxCell(grid, kind, x, cy, glyphs.boxV);
87
+ for (let cx = x + 1; cx < x + w - 1; cx += 1) {
88
+ putBoxCellAs(grid, kind, cx, cy, " ", "empty");
89
+ }
90
+ putBoxCell(grid, kind, x + w - 1, cy, glyphs.boxV);
91
+ }
92
+ putBoxCell(grid, kind, x, y + h - 1, glyphs.boxBL);
93
+ for (let cx = x + 1; cx < x + w - 1; cx += 1) putBoxCell(grid, kind, cx, y + h - 1, glyphs.boxH);
94
+ putBoxCell(grid, kind, x + w - 1, y + h - 1, glyphs.boxBR);
95
+ const midY = y + Math.floor(h / 2);
96
+ writeLabel(grid, kind, x + 1, midY, w - 2, label);
97
+ }
98
+ function putBoxCell(grid, kind, x, y, glyph) {
99
+ const k = glyph === " " ? "empty" : glyph === "\u2500" || glyph === "-" ? "boxH" : glyph === "\u2502" || glyph === "|" ? "boxV" : "boxCorner";
100
+ putBoxCellAs(grid, kind, x, y, glyph, k);
101
+ }
102
+ function putBoxCellAs(grid, kind, x, y, glyph, k) {
103
+ if (y < 0 || y >= grid.length) return;
104
+ const row = grid[y];
105
+ if (x < 0 || x >= row.length) return;
106
+ row[x] = glyph;
107
+ kind[y][x] = k;
108
+ }
109
+ function writeLabel(grid, kind, x, y, maxWidthCells, label) {
110
+ if (y < 0 || y >= grid.length) return;
111
+ let cursor = x;
112
+ let cellsLeft = maxWidthCells;
113
+ for (const ch of label) {
114
+ const cw = countCells(ch);
115
+ if (cw === 0) continue;
116
+ if (cellsLeft < cw) break;
117
+ if (cursor >= 0 && cursor < grid[y].length) {
118
+ grid[y][cursor] = ch;
119
+ kind[y][cursor] = "label";
120
+ if (cw === 2 && cursor + 1 < grid[y].length) {
121
+ grid[y][cursor + 1] = "";
122
+ kind[y][cursor + 1] = "label";
123
+ }
124
+ }
125
+ cursor += cw;
126
+ cellsLeft -= cw;
127
+ }
128
+ while (cellsLeft > 0) {
129
+ if (cursor >= 0 && cursor < grid[y].length) {
130
+ grid[y][cursor] = " ";
131
+ kind[y][cursor] = "empty";
132
+ }
133
+ cursor += 1;
134
+ cellsLeft -= 1;
135
+ }
136
+ }
137
+ function drawEdge(grid, kind, glyphs, edge) {
138
+ const pts = edge.points;
139
+ if (pts.length < 2) return;
140
+ for (let i = 0; i + 1 < pts.length; i += 1) {
141
+ drawSegment(grid, kind, glyphs, pts[i], pts[i + 1]);
142
+ }
143
+ for (let i = 1; i + 1 < pts.length; i += 1) {
144
+ const a = pts[i - 1];
145
+ const b = pts[i];
146
+ const c = pts[i + 1];
147
+ const corner = cornerGlyph(a, b, c, glyphs);
148
+ if (corner) putEdgeCell(grid, kind, b.x, b.y, corner, "edgeCorner");
149
+ }
150
+ const tip = pts[pts.length - 1];
151
+ const prev = pts[pts.length - 2];
152
+ const arrow = arrowGlyph(prev, tip, glyphs);
153
+ if (arrow) putEdgeCell(grid, kind, tip.x, tip.y, arrow, "arrow");
154
+ }
155
+ function drawSegment(grid, kind, glyphs, a, b) {
156
+ if (a.x === b.x && a.y === b.y) return;
157
+ if (a.y === b.y) {
158
+ const y = a.y;
159
+ const x0 = Math.min(a.x, b.x);
160
+ const x1 = Math.max(a.x, b.x);
161
+ for (let x = x0; x <= x1; x += 1) {
162
+ putEdgeLine(grid, kind, x, y, glyphs, "h");
163
+ }
164
+ } else if (a.x === b.x) {
165
+ const x = a.x;
166
+ const y0 = Math.min(a.y, b.y);
167
+ const y1 = Math.max(a.y, b.y);
168
+ for (let y = y0; y <= y1; y += 1) {
169
+ putEdgeLine(grid, kind, x, y, glyphs, "v");
170
+ }
171
+ }
172
+ }
173
+ function putEdgeLine(grid, kind, x, y, glyphs, orientation) {
174
+ if (y < 0 || y >= grid.length) return;
175
+ const row = grid[y];
176
+ if (x < 0 || x >= row.length) return;
177
+ const existing = kind[y][x];
178
+ if (existing === "boxH" || existing === "boxV" || existing === "boxCorner" || existing === "label") {
179
+ return;
180
+ }
181
+ if (existing === "empty") {
182
+ row[x] = orientation === "h" ? glyphs.horizontal : glyphs.vertical;
183
+ kind[y][x] = orientation === "h" ? "edgeH" : "edgeV";
184
+ return;
185
+ }
186
+ if (existing === "edgeH" && orientation === "v") {
187
+ row[x] = glyphs.cross;
188
+ kind[y][x] = "edgeCorner";
189
+ return;
190
+ }
191
+ if (existing === "edgeV" && orientation === "h") {
192
+ row[x] = glyphs.cross;
193
+ kind[y][x] = "edgeCorner";
194
+ return;
195
+ }
196
+ }
197
+ function putEdgeCell(grid, kind, x, y, glyph, k) {
198
+ if (y < 0 || y >= grid.length) return;
199
+ const row = grid[y];
200
+ if (x < 0 || x >= row.length) return;
201
+ const existing = kind[y][x];
202
+ if (existing === "boxH" || existing === "boxV" || existing === "boxCorner" || existing === "label")
203
+ return;
204
+ row[x] = glyph;
205
+ kind[y][x] = k;
206
+ }
207
+ function cornerGlyph(a, b, c, glyphs) {
208
+ const inHoriz = a.y === b.y;
209
+ const outHoriz = b.y === c.y;
210
+ if (inHoriz === outHoriz) return void 0;
211
+ if (inHoriz) {
212
+ const fromLeft = a.x < b.x;
213
+ const goingDown = c.y > b.y;
214
+ if (fromLeft && goingDown) return glyphs.cornerTR;
215
+ if (fromLeft && !goingDown) return glyphs.cornerBR;
216
+ if (!fromLeft && goingDown) return glyphs.cornerTL;
217
+ return glyphs.cornerBL;
218
+ }
219
+ const fromAbove = a.y < b.y;
220
+ const goingRight = c.x > b.x;
221
+ if (fromAbove && goingRight) return glyphs.cornerBL;
222
+ if (fromAbove && !goingRight) return glyphs.cornerBR;
223
+ if (!fromAbove && goingRight) return glyphs.cornerTL;
224
+ return glyphs.cornerTR;
225
+ }
226
+ function arrowGlyph(prev, tip, glyphs) {
227
+ if (tip.x > prev.x) return glyphs.arrowRight;
228
+ if (tip.x < prev.x) return glyphs.arrowLeft;
229
+ if (tip.y > prev.y) return glyphs.arrowDown;
230
+ if (tip.y < prev.y) return glyphs.arrowUp;
231
+ return void 0;
232
+ }
233
+ function stripTrailing(line) {
234
+ let end = line.length;
235
+ while (end > 0 && line.charCodeAt(end - 1) === 32) end -= 1;
236
+ return line.slice(0, end);
237
+ }
238
+
239
+ // src/base/render/graph-spec-to-ascii.ts
240
+ var DEFAULT_LABEL_WIDTH = 24;
241
+ var LAYER_GAP = 4;
242
+ var NODE_GAP = 1;
243
+ var BOX_HEIGHT = 3;
244
+ function graphSpecToAscii(g, opts) {
245
+ const direction = normalizeAsciiDirection(opts?.direction);
246
+ const maxLabel = Math.max(3, opts?.maxLabelWidth ?? DEFAULT_LABEL_WIDTH);
247
+ const charset = opts?.asciiCharset ?? "unicode";
248
+ const paths = Object.keys(g.nodes).sort();
249
+ const nodeSet = new Set(paths);
250
+ const edges = g.edges.filter((e) => nodeSet.has(e.from) && nodeSet.has(e.to));
251
+ const labels = /* @__PURE__ */ new Map();
252
+ const widths = /* @__PURE__ */ new Map();
253
+ for (const p of paths) {
254
+ const label = truncateToCells(p, maxLabel);
255
+ labels.set(p, label);
256
+ widths.set(p, countCells(label) + 4);
257
+ }
258
+ const layout = sugiyamaLayout({
259
+ nodes: paths,
260
+ edges,
261
+ widthCells: (id) => widths.get(id) ?? 3,
262
+ heightCells: () => BOX_HEIGHT,
263
+ layerGap: LAYER_GAP,
264
+ nodeGap: NODE_GAP,
265
+ direction
266
+ });
267
+ const text = renderGrid(layout, {
268
+ charset,
269
+ labelOf: (id) => labels.get(id) ?? id
270
+ });
271
+ opts?.logger?.(text);
272
+ return text;
273
+ }
274
+ function normalizeAsciiDirection(direction) {
275
+ if (direction === void 0 || direction === "LR") return "LR";
276
+ if (direction === "TD") return "TD";
277
+ throw new Error(`ascii describe supports direction "LR" or "TD" only; got ${String(direction)}`);
278
+ }
279
+
280
+ // src/base/render/_internal.ts
281
+ function sortJsonValue(value) {
282
+ if (value === null || typeof value !== "object") {
283
+ return value;
284
+ }
285
+ if (Array.isArray(value)) {
286
+ return value.map(sortJsonValue);
287
+ }
288
+ const obj = value;
289
+ const keys = Object.keys(obj).sort();
290
+ const out = {};
291
+ for (const k of keys) {
292
+ out[k] = sortJsonValue(obj[k]);
293
+ }
294
+ return out;
295
+ }
296
+ function escapeMermaidLabel(value) {
297
+ return value.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
298
+ }
299
+ function escapeD2Label(value) {
300
+ return value.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
301
+ }
302
+ function d2DirectionFromGraphDirection(direction) {
303
+ if (direction === "TD") return "down";
304
+ if (direction === "BT") return "up";
305
+ if (direction === "RL") return "left";
306
+ return "right";
307
+ }
308
+ function collectDiagramArrows(described) {
309
+ const seen = /* @__PURE__ */ new Set();
310
+ const arrows = [];
311
+ function add(from, to) {
312
+ const key = `${from}\0${to}`;
313
+ if (seen.has(key)) return;
314
+ seen.add(key);
315
+ arrows.push([from, to]);
316
+ }
317
+ for (const [path, info] of Object.entries(described.nodes)) {
318
+ const deps = info.deps;
319
+ if (deps) {
320
+ for (const dep of deps) add(dep, path);
321
+ }
322
+ }
323
+ for (const edge of described.edges) add(edge.from, edge.to);
324
+ return arrows;
325
+ }
326
+ function normalizeDiagramDirection(direction) {
327
+ if (direction === void 0) return "LR";
328
+ if (direction === "TD" || direction === "LR" || direction === "BT" || direction === "RL") {
329
+ return direction;
330
+ }
331
+ throw new Error(
332
+ `invalid diagram direction ${String(direction)}; expected one of: TD, LR, BT, RL`
333
+ );
334
+ }
335
+ function describeData(value) {
336
+ if (typeof value === "string") return JSON.stringify(value);
337
+ if (typeof value === "number" || typeof value === "boolean" || value == null)
338
+ return String(value);
339
+ try {
340
+ return JSON.stringify(value);
341
+ } catch {
342
+ return "[unserializable]";
343
+ }
344
+ }
345
+
346
+ // src/base/render/graph-spec-to-d2.ts
347
+ function graphSpecToD2(g, opts) {
348
+ const direction = normalizeDiagramDirection(opts?.direction);
349
+ const paths = Object.keys(g.nodes).sort();
350
+ const ids = /* @__PURE__ */ new Map();
351
+ for (let i = 0; i < paths.length; i += 1) ids.set(paths[i], `n${i}`);
352
+ const lines = [`direction: ${d2DirectionFromGraphDirection(direction)}`];
353
+ for (const path of paths) {
354
+ const id = ids.get(path);
355
+ lines.push(`${id}: "${escapeD2Label(path)}"`);
356
+ }
357
+ for (const [from, to] of collectDiagramArrows(g)) {
358
+ const fromId = ids.get(from);
359
+ const toId = ids.get(to);
360
+ if (!fromId || !toId) continue;
361
+ lines.push(`${fromId} -> ${toId}`);
362
+ }
363
+ return lines.join("\n");
364
+ }
365
+
366
+ // src/base/render/graph-spec-to-json.ts
367
+ function graphSpecToJson(g, opts) {
368
+ const includeEdges = opts?.includeEdges ?? true;
369
+ const includeSubgraphs = opts?.includeSubgraphs ?? true;
370
+ const { expand: _expand, ...rest } = g;
371
+ const payload = {
372
+ ...rest,
373
+ edges: includeEdges ? g.edges : [],
374
+ subgraphs: includeSubgraphs ? g.subgraphs : []
375
+ };
376
+ const text = JSON.stringify(sortJsonValue(payload), null, opts?.indent ?? 2);
377
+ opts?.logger?.(text);
378
+ return text;
379
+ }
380
+
381
+ // src/base/render/graph-spec-to-mermaid.ts
382
+ function graphSpecToMermaid(g, opts) {
383
+ const direction = normalizeDiagramDirection(opts?.direction);
384
+ const paths = Object.keys(g.nodes).sort();
385
+ const ids = /* @__PURE__ */ new Map();
386
+ for (let i = 0; i < paths.length; i += 1) ids.set(paths[i], `n${i}`);
387
+ const lines = [`flowchart ${direction}`];
388
+ for (const path of paths) {
389
+ const id = ids.get(path);
390
+ lines.push(` ${id}["${escapeMermaidLabel(path)}"]`);
391
+ }
392
+ for (const [from, to] of collectDiagramArrows(g)) {
393
+ const fromId = ids.get(from);
394
+ const toId = ids.get(to);
395
+ if (!fromId || !toId) continue;
396
+ lines.push(` ${fromId} --> ${toId}`);
397
+ }
398
+ return lines.join("\n");
399
+ }
400
+
401
+ // src/base/render/graph-spec-to-mermaid-url.ts
402
+ function mermaidLiveUrl(mermaidSrc, opts) {
403
+ const theme = opts?.theme ?? "default";
404
+ const autoSync = opts?.autoSync ?? true;
405
+ const payload = { code: mermaidSrc, mermaid: { theme }, autoSync };
406
+ const json = JSON.stringify(payload);
407
+ const bytes = new TextEncoder().encode(json);
408
+ let binary = "";
409
+ for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
410
+ const b64 = globalThis.btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
411
+ return `https://mermaid.live/edit#base64:${b64}`;
412
+ }
413
+ function graphSpecToMermaidUrl(g, opts) {
414
+ const mermaidSrc = graphSpecToMermaid(g, opts);
415
+ return mermaidLiveUrl(mermaidSrc, opts);
416
+ }
417
+
418
+ // src/base/render/graph-spec-to-pretty.ts
419
+ function graphSpecToPretty(g, opts) {
420
+ const includeEdges = opts?.includeEdges ?? true;
421
+ const includeSubgraphs = opts?.includeSubgraphs ?? true;
422
+ const lines = [];
423
+ lines.push(`Graph ${g.name}`);
424
+ lines.push("Nodes:");
425
+ for (const path of Object.keys(g.nodes).sort()) {
426
+ const n = g.nodes[path];
427
+ lines.push(`- ${path} (${n.type}/${n.status}): ${describeData(n.value)}`);
428
+ }
429
+ if (includeEdges) {
430
+ lines.push("Edges:");
431
+ for (const edge of g.edges) {
432
+ lines.push(`- ${edge.from} -> ${edge.to}`);
433
+ }
434
+ }
435
+ if (includeSubgraphs) {
436
+ lines.push("Subgraphs:");
437
+ for (const sg of g.subgraphs) {
438
+ lines.push(`- ${sg}`);
439
+ }
440
+ }
441
+ const text = lines.join("\n");
442
+ opts?.logger?.(text);
443
+ return text;
444
+ }
445
+
446
+ // src/base/render/layout-frame-to-svg.ts
447
+ var SPECIAL_CHARS = {
448
+ "&": "&amp;",
449
+ "<": "&lt;",
450
+ ">": "&gt;",
451
+ '"': "&quot;",
452
+ "'": "&apos;"
453
+ };
454
+ function escapeXml(s) {
455
+ return s.replace(/[&<>"']/g, (c) => SPECIAL_CHARS[c] ?? c);
456
+ }
457
+ function layoutFrameToSvg(frame, opts) {
458
+ const cellW = opts?.cellWidth ?? 12;
459
+ const cellH = opts?.cellHeight ?? 18;
460
+ const pad = opts?.padding ?? 16;
461
+ const boxStroke = escapeXml(opts?.boxStroke ?? "#444");
462
+ const boxFill = escapeXml(opts?.boxFill ?? "#fff");
463
+ const edgeStroke = escapeXml(opts?.edgeStroke ?? "#888");
464
+ const textColor = escapeXml(opts?.textColor ?? "#111");
465
+ const fontFamily = opts?.fontFamily ?? "ui-monospace, monospace";
466
+ const fontSize = opts?.fontSize ?? 12;
467
+ let maxX = 0;
468
+ let maxY = 0;
469
+ for (const b of frame.boxes) {
470
+ maxX = Math.max(maxX, b.x + b.w);
471
+ maxY = Math.max(maxY, b.y + b.h);
472
+ }
473
+ for (const e of frame.edges) {
474
+ for (const [x, y] of e.points) {
475
+ maxX = Math.max(maxX, x);
476
+ maxY = Math.max(maxY, y);
477
+ }
478
+ }
479
+ const width = Math.max(1, maxX) * cellW + pad * 2;
480
+ const height = Math.max(1, maxY) * cellH + pad * 2;
481
+ const lines = [];
482
+ lines.push(
483
+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}" width="${width}" height="${height}">`
484
+ );
485
+ for (const e of frame.edges) {
486
+ if (e.points.length < 2) continue;
487
+ const pts = e.points.map(([x, y]) => `${x * cellW + pad},${y * cellH + pad}`).join(" ");
488
+ lines.push(
489
+ ` <polyline points="${pts}" fill="none" stroke="${edgeStroke}" stroke-width="1" data-from="${escapeXml(e.from)}" data-to="${escapeXml(e.to)}" data-dep-index="${e.depIndex}" />`
490
+ );
491
+ }
492
+ for (const b of frame.boxes) {
493
+ const px = b.x * cellW + pad;
494
+ const py = b.y * cellH + pad;
495
+ const pw = Math.max(1, b.w) * cellW;
496
+ const ph = Math.max(1, b.h) * cellH;
497
+ const local = b.id.includes("::") ? b.id.split("::").pop() ?? b.id : b.id;
498
+ lines.push(
499
+ ` <g data-id="${escapeXml(b.id)}">`,
500
+ ` <rect x="${px}" y="${py}" width="${pw}" height="${ph}" fill="${boxFill}" stroke="${boxStroke}" stroke-width="1" />`,
501
+ ` <text x="${px + pw / 2}" y="${py + ph / 2}" fill="${textColor}" font-family="${escapeXml(fontFamily)}" font-size="${fontSize}" text-anchor="middle" dominant-baseline="central">${escapeXml(local)}</text>`,
502
+ ` </g>`
503
+ );
504
+ }
505
+ lines.push("</svg>");
506
+ return lines.join("\n");
507
+ }
508
+
509
+ export {
510
+ graphSpecToAscii,
511
+ graphSpecToD2,
512
+ graphSpecToJson,
513
+ graphSpecToMermaid,
514
+ mermaidLiveUrl,
515
+ graphSpecToMermaidUrl,
516
+ graphSpecToPretty,
517
+ layoutFrameToSvg
518
+ };
519
+ //# sourceMappingURL=chunk-PKGQG5QQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/base/render/_ascii-grid.ts","../src/base/render/graph-spec-to-ascii.ts","../src/base/render/_internal.ts","../src/base/render/graph-spec-to-d2.ts","../src/base/render/graph-spec-to-json.ts","../src/base/render/graph-spec-to-mermaid.ts","../src/base/render/graph-spec-to-mermaid-url.ts","../src/base/render/graph-spec-to-pretty.ts","../src/base/render/layout-frame-to-svg.ts"],"sourcesContent":["/**\n * Character-grid blitter for the ASCII describe renderer.\n *\n * Given a [LayoutResult](./_layout-sugiyama.ts) (boxes + polyline edges on\n * an integer cell grid), produce a newline-joined string using Unicode\n * box-drawing glyphs (or plain ASCII when `charset: \"ascii\"` is requested).\n *\n * Invariants:\n * - Multi-cell CJK labels still count as 2 cells via\n * [_ascii-width.ts](./_ascii-width.ts).\n * - Edge crossings (two segments perpendicular at the same cell) collapse\n * to `┼` / `+`. Corner-vs-line collisions resolve to a corner glyph.\n * - Boxes overwrite edge glyphs — boxes are blitted last so an edge that\n * happens to pass under a box body is hidden.\n */\n\nimport { countCells } from \"./_ascii-width.js\";\nimport type { LayoutBox, LayoutEdge, LayoutResult } from \"./_layout-sugiyama.js\";\n\nexport type AsciiCharset = \"unicode\" | \"ascii\";\n\nexport type GridOptions = {\n\treadonly charset: AsciiCharset;\n\treadonly labelOf: (id: string) => string;\n};\n\ntype Glyphs = {\n\treadonly horizontal: string;\n\treadonly vertical: string;\n\treadonly cornerTL: string;\n\treadonly cornerTR: string;\n\treadonly cornerBL: string;\n\treadonly cornerBR: string;\n\treadonly tDown: string;\n\treadonly tUp: string;\n\treadonly tRight: string;\n\treadonly tLeft: string;\n\treadonly cross: string;\n\treadonly arrowRight: string;\n\treadonly arrowDown: string;\n\treadonly arrowLeft: string;\n\treadonly arrowUp: string;\n\treadonly boxTL: string;\n\treadonly boxTR: string;\n\treadonly boxBL: string;\n\treadonly boxBR: string;\n\treadonly boxH: string;\n\treadonly boxV: string;\n};\n\nconst UNICODE: Glyphs = {\n\thorizontal: \"─\",\n\tvertical: \"│\",\n\tcornerTL: \"┌\",\n\tcornerTR: \"┐\",\n\tcornerBL: \"└\",\n\tcornerBR: \"┘\",\n\ttDown: \"┬\",\n\ttUp: \"┴\",\n\ttRight: \"├\",\n\ttLeft: \"┤\",\n\tcross: \"┼\",\n\tarrowRight: \"▶\",\n\tarrowDown: \"▼\",\n\tarrowLeft: \"◀\",\n\tarrowUp: \"▲\",\n\tboxTL: \"┌\",\n\tboxTR: \"┐\",\n\tboxBL: \"└\",\n\tboxBR: \"┘\",\n\tboxH: \"─\",\n\tboxV: \"│\",\n};\n\nconst ASCII: Glyphs = {\n\thorizontal: \"-\",\n\tvertical: \"|\",\n\tcornerTL: \"+\",\n\tcornerTR: \"+\",\n\tcornerBL: \"+\",\n\tcornerBR: \"+\",\n\ttDown: \"+\",\n\ttUp: \"+\",\n\ttRight: \"+\",\n\ttLeft: \"+\",\n\tcross: \"+\",\n\tarrowRight: \">\",\n\tarrowDown: \"v\",\n\tarrowLeft: \"<\",\n\tarrowUp: \"^\",\n\tboxTL: \"+\",\n\tboxTR: \"+\",\n\tboxBL: \"+\",\n\tboxBR: \"+\",\n\tboxH: \"-\",\n\tboxV: \"|\",\n};\n\n// Set of glyphs considered \"edge lines\" when resolving collisions. A later\n// put() into an edge cell that conflicts produces `cross`; corners and\n// T-junctions are preserved (they carry more information).\ntype CellKind =\n\t| \"empty\"\n\t| \"boxH\"\n\t| \"boxV\"\n\t| \"boxCorner\"\n\t| \"edgeH\"\n\t| \"edgeV\"\n\t| \"edgeCorner\"\n\t| \"arrow\"\n\t| \"label\";\n\nexport function renderGrid(layout: LayoutResult, options: GridOptions): string {\n\tconst glyphs = options.charset === \"ascii\" ? ASCII : UNICODE;\n\tconst width = layout.width;\n\tconst height = layout.height;\n\tconst grid: string[][] = Array.from({ length: height }, () =>\n\t\tArray.from({ length: width }, () => \" \"),\n\t);\n\tconst kind: CellKind[][] = Array.from({ length: height }, () =>\n\t\tArray.from({ length: width }, () => \"empty\" as CellKind),\n\t);\n\n\t// 1. Draw edges first (boxes overwrite).\n\tfor (const edge of layout.edges) {\n\t\tdrawEdge(grid, kind, glyphs, edge);\n\t}\n\n\t// 2. Draw boxes on top.\n\tfor (const box of layout.boxes) {\n\t\tdrawBox(grid, kind, glyphs, box, options.labelOf(box.id));\n\t}\n\n\treturn grid.map((row) => stripTrailing(row.join(\"\"))).join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// Box drawing\n// ---------------------------------------------------------------------------\n\nfunction drawBox(\n\tgrid: string[][],\n\tkind: CellKind[][],\n\tglyphs: Glyphs,\n\tbox: LayoutBox,\n\tlabel: string,\n): void {\n\tconst { x, y, w, h } = box;\n\tif (w < 2 || h < 2) {\n\t\t// Degenerate — just paint the label.\n\t\tif (h > 0) writeLabel(grid, kind, x, y, w, label);\n\t\treturn;\n\t}\n\t// Top border\n\tputBoxCell(grid, kind, x, y, glyphs.boxTL);\n\tfor (let cx = x + 1; cx < x + w - 1; cx += 1) putBoxCell(grid, kind, cx, y, glyphs.boxH);\n\tputBoxCell(grid, kind, x + w - 1, y, glyphs.boxTR);\n\t// Middle rows — side borders + content (only middle row carries the label)\n\tfor (let cy = y + 1; cy < y + h - 1; cy += 1) {\n\t\tputBoxCell(grid, kind, x, cy, glyphs.boxV);\n\t\tfor (let cx = x + 1; cx < x + w - 1; cx += 1) {\n\t\t\tputBoxCellAs(grid, kind, cx, cy, \" \", \"empty\");\n\t\t}\n\t\tputBoxCell(grid, kind, x + w - 1, cy, glyphs.boxV);\n\t}\n\t// Bottom border\n\tputBoxCell(grid, kind, x, y + h - 1, glyphs.boxBL);\n\tfor (let cx = x + 1; cx < x + w - 1; cx += 1) putBoxCell(grid, kind, cx, y + h - 1, glyphs.boxH);\n\tputBoxCell(grid, kind, x + w - 1, y + h - 1, glyphs.boxBR);\n\t// Label in vertical middle (h >= 3 expected)\n\tconst midY = y + Math.floor(h / 2);\n\twriteLabel(grid, kind, x + 1, midY, w - 2, label);\n}\n\nfunction putBoxCell(\n\tgrid: string[][],\n\tkind: CellKind[][],\n\tx: number,\n\ty: number,\n\tglyph: string,\n): void {\n\tconst k: CellKind =\n\t\tglyph === \" \"\n\t\t\t? \"empty\"\n\t\t\t: glyph === \"─\" || glyph === \"-\"\n\t\t\t\t? \"boxH\"\n\t\t\t\t: glyph === \"│\" || glyph === \"|\"\n\t\t\t\t\t? \"boxV\"\n\t\t\t\t\t: \"boxCorner\";\n\tputBoxCellAs(grid, kind, x, y, glyph, k);\n}\n\nfunction putBoxCellAs(\n\tgrid: string[][],\n\tkind: CellKind[][],\n\tx: number,\n\ty: number,\n\tglyph: string,\n\tk: CellKind,\n): void {\n\tif (y < 0 || y >= grid.length) return;\n\tconst row = grid[y]!;\n\tif (x < 0 || x >= row.length) return;\n\trow[x] = glyph;\n\tkind[y]![x] = k;\n}\n\nfunction writeLabel(\n\tgrid: string[][],\n\tkind: CellKind[][],\n\tx: number,\n\ty: number,\n\tmaxWidthCells: number,\n\tlabel: string,\n): void {\n\t// The grid is cell-indexed (one array slot per terminal cell). Wide\n\t// characters (CJK, fullwidth) occupy TWO cells visually; we store the\n\t// char in the first slot and an empty string in the second slot so\n\t// join(\"\") collapses to a single visible wide glyph and neighboring\n\t// writes don't add spurious narrow spaces next to the wide char.\n\tif (y < 0 || y >= grid.length) return;\n\tlet cursor = x;\n\tlet cellsLeft = maxWidthCells;\n\tfor (const ch of label) {\n\t\tconst cw = countCells(ch);\n\t\tif (cw === 0) continue;\n\t\tif (cellsLeft < cw) break;\n\t\tif (cursor >= 0 && cursor < grid[y]!.length) {\n\t\t\tgrid[y]![cursor] = ch;\n\t\t\tkind[y]![cursor] = \"label\";\n\t\t\tif (cw === 2 && cursor + 1 < grid[y]!.length) {\n\t\t\t\tgrid[y]![cursor + 1] = \"\";\n\t\t\t\tkind[y]![cursor + 1] = \"label\";\n\t\t\t}\n\t\t}\n\t\tcursor += cw;\n\t\tcellsLeft -= cw;\n\t}\n\t// Pad remaining cells with spaces so any edge glyphs lurking under the\n\t// box body don't leak into the label row.\n\twhile (cellsLeft > 0) {\n\t\tif (cursor >= 0 && cursor < grid[y]!.length) {\n\t\t\tgrid[y]![cursor] = \" \";\n\t\t\tkind[y]![cursor] = \"empty\";\n\t\t}\n\t\tcursor += 1;\n\t\tcellsLeft -= 1;\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Edge drawing\n// ---------------------------------------------------------------------------\n\nfunction drawEdge(grid: string[][], kind: CellKind[][], glyphs: Glyphs, edge: LayoutEdge): void {\n\tconst pts = edge.points;\n\tif (pts.length < 2) return;\n\t// Draw segments\n\tfor (let i = 0; i + 1 < pts.length; i += 1) {\n\t\tdrawSegment(grid, kind, glyphs, pts[i]!, pts[i + 1]!);\n\t}\n\t// Draw corners at interior points\n\tfor (let i = 1; i + 1 < pts.length; i += 1) {\n\t\tconst a = pts[i - 1]!;\n\t\tconst b = pts[i]!;\n\t\tconst c = pts[i + 1]!;\n\t\tconst corner = cornerGlyph(a, b, c, glyphs);\n\t\tif (corner) putEdgeCell(grid, kind, b.x, b.y, corner, \"edgeCorner\");\n\t}\n\t// Arrow tip at the final point, aimed from the penultimate point.\n\t// Four cardinal directions — covers backward and upward tips produced\n\t// by routing past virtual nodes or dense-gutter fallbacks.\n\tconst tip = pts[pts.length - 1]!;\n\tconst prev = pts[pts.length - 2]!;\n\tconst arrow = arrowGlyph(prev, tip, glyphs);\n\tif (arrow) putEdgeCell(grid, kind, tip.x, tip.y, arrow, \"arrow\");\n}\n\nfunction drawSegment(\n\tgrid: string[][],\n\tkind: CellKind[][],\n\tglyphs: Glyphs,\n\ta: { x: number; y: number },\n\tb: { x: number; y: number },\n): void {\n\tif (a.x === b.x && a.y === b.y) return;\n\tif (a.y === b.y) {\n\t\t// Horizontal\n\t\tconst y = a.y;\n\t\tconst x0 = Math.min(a.x, b.x);\n\t\tconst x1 = Math.max(a.x, b.x);\n\t\tfor (let x = x0; x <= x1; x += 1) {\n\t\t\tputEdgeLine(grid, kind, x, y, glyphs, \"h\");\n\t\t}\n\t} else if (a.x === b.x) {\n\t\t// Vertical\n\t\tconst x = a.x;\n\t\tconst y0 = Math.min(a.y, b.y);\n\t\tconst y1 = Math.max(a.y, b.y);\n\t\tfor (let y = y0; y <= y1; y += 1) {\n\t\t\tputEdgeLine(grid, kind, x, y, glyphs, \"v\");\n\t\t}\n\t}\n\t// Diagonal shouldn't happen — routing is orthogonal.\n}\n\nfunction putEdgeLine(\n\tgrid: string[][],\n\tkind: CellKind[][],\n\tx: number,\n\ty: number,\n\tglyphs: Glyphs,\n\torientation: \"h\" | \"v\",\n): void {\n\tif (y < 0 || y >= grid.length) return;\n\tconst row = grid[y]!;\n\tif (x < 0 || x >= row.length) return;\n\tconst existing = kind[y]![x];\n\tif (\n\t\texisting === \"boxH\" ||\n\t\texisting === \"boxV\" ||\n\t\texisting === \"boxCorner\" ||\n\t\texisting === \"label\"\n\t) {\n\t\t// Box wins — do nothing. Boxes are drawn after edges, but if order\n\t\t// is reversed the edge must not clobber the box.\n\t\treturn;\n\t}\n\tif (existing === \"empty\") {\n\t\trow[x] = orientation === \"h\" ? glyphs.horizontal : glyphs.vertical;\n\t\tkind[y]![x] = orientation === \"h\" ? \"edgeH\" : \"edgeV\";\n\t\treturn;\n\t}\n\tif (existing === \"edgeH\" && orientation === \"v\") {\n\t\trow[x] = glyphs.cross;\n\t\tkind[y]![x] = \"edgeCorner\";\n\t\treturn;\n\t}\n\tif (existing === \"edgeV\" && orientation === \"h\") {\n\t\trow[x] = glyphs.cross;\n\t\tkind[y]![x] = \"edgeCorner\";\n\t\treturn;\n\t}\n\t// Same-orientation overlay: keep existing glyph.\n}\n\nfunction putEdgeCell(\n\tgrid: string[][],\n\tkind: CellKind[][],\n\tx: number,\n\ty: number,\n\tglyph: string,\n\tk: CellKind,\n): void {\n\tif (y < 0 || y >= grid.length) return;\n\tconst row = grid[y]!;\n\tif (x < 0 || x >= row.length) return;\n\tconst existing = kind[y]![x];\n\tif (\n\t\texisting === \"boxH\" ||\n\t\texisting === \"boxV\" ||\n\t\texisting === \"boxCorner\" ||\n\t\texisting === \"label\"\n\t)\n\t\treturn;\n\trow[x] = glyph;\n\tkind[y]![x] = k;\n}\n\n// ---------------------------------------------------------------------------\n// Corner + arrow glyph selection\n// ---------------------------------------------------------------------------\n\nfunction cornerGlyph(\n\ta: { x: number; y: number },\n\tb: { x: number; y: number },\n\tc: { x: number; y: number },\n\tglyphs: Glyphs,\n): string | undefined {\n\tconst inHoriz = a.y === b.y;\n\tconst outHoriz = b.y === c.y;\n\tif (inHoriz === outHoriz) return undefined; // not a turn\n\t// In from horizontal, out to vertical (or vice versa). Figure out which\n\t// of the four corners we're at.\n\tif (inHoriz) {\n\t\t// Coming from the left (a.x < b.x) or right (a.x > b.x)\n\t\tconst fromLeft = a.x < b.x;\n\t\tconst goingDown = c.y > b.y;\n\t\tif (fromLeft && goingDown) return glyphs.cornerTR;\n\t\tif (fromLeft && !goingDown) return glyphs.cornerBR;\n\t\tif (!fromLeft && goingDown) return glyphs.cornerTL;\n\t\treturn glyphs.cornerBL;\n\t}\n\t// Vertical in, horizontal out\n\tconst fromAbove = a.y < b.y;\n\tconst goingRight = c.x > b.x;\n\tif (fromAbove && goingRight) return glyphs.cornerBL;\n\tif (fromAbove && !goingRight) return glyphs.cornerBR;\n\tif (!fromAbove && goingRight) return glyphs.cornerTL;\n\treturn glyphs.cornerTR;\n}\n\nfunction arrowGlyph(\n\tprev: { x: number; y: number },\n\ttip: { x: number; y: number },\n\tglyphs: Glyphs,\n): string | undefined {\n\tif (tip.x > prev.x) return glyphs.arrowRight;\n\tif (tip.x < prev.x) return glyphs.arrowLeft;\n\tif (tip.y > prev.y) return glyphs.arrowDown;\n\tif (tip.y < prev.y) return glyphs.arrowUp;\n\treturn undefined; // zero-length segment — no tip\n}\n\n// ---------------------------------------------------------------------------\n// Output trimming\n// ---------------------------------------------------------------------------\n\nfunction stripTrailing(line: string): string {\n\t// Trim trailing spaces only; preserve internal grid alignment.\n\tlet end = line.length;\n\twhile (end > 0 && line.charCodeAt(end - 1) === 32) end -= 1;\n\treturn line.slice(0, end);\n}\n","/**\n * `graphSpecToAscii(g, opts?)` — stdout-native DAG flowchart renderer for a\n * {@link GraphDescribeOutput}.\n *\n * Zero external dependencies, graph-size independent via proper Sugiyama\n * (layer assignment → virtual-node splitting → barycenter crossing\n * minimization → median-aligned coordinate assignment → per-gutter\n * track-assigned orthogonal routing). See\n * [_layout-sugiyama.ts](./_layout-sugiyama.ts) for the layout pipeline and\n * [_ascii-grid.ts](./_ascii-grid.ts) for the character blitter.\n *\n * Pure function over the describe snapshot; no Graph instance dependency.\n *\n * @category extra\n */\n\nimport type { GraphDescribeOutput } from \"@graphrefly/pure-ts/graph\";\nimport { renderGrid } from \"./_ascii-grid.js\";\nimport { countCells, truncateToCells } from \"./_ascii-width.js\";\nimport type { LayoutDirection } from \"./_layout-sugiyama.js\";\nimport { sugiyamaLayout } from \"./_layout-sugiyama.js\";\n\nconst DEFAULT_LABEL_WIDTH = 24;\nconst LAYER_GAP = 4;\nconst NODE_GAP = 1;\nconst BOX_HEIGHT = 3;\n\nexport type GraphSpecToAsciiOptions = {\n\t/**\n\t * ASCII layout direction. ASCII grid semantics are meaningful only for\n\t * `\"LR\"` (default) and `\"TD\"`.\n\t */\n\tdirection?: LayoutDirection;\n\t/** Per-box label cell cap; longer labels are truncated with `…`. Default `24`. */\n\tmaxLabelWidth?: number;\n\t/** Glyph set: `\"unicode\"` (default, box-drawing) or `\"ascii\"` (`-|+<>v`). */\n\tasciiCharset?: \"unicode\" | \"ascii\";\n\t/** Optional logger hook; fires with the rendered text before return. */\n\tlogger?: (text: string) => void;\n};\n\nexport function graphSpecToAscii(g: GraphDescribeOutput, opts?: GraphSpecToAsciiOptions): string {\n\tconst direction = normalizeAsciiDirection(opts?.direction);\n\tconst maxLabel = Math.max(3, opts?.maxLabelWidth ?? DEFAULT_LABEL_WIDTH);\n\tconst charset = opts?.asciiCharset ?? \"unicode\";\n\n\t// Deterministic paths ordering — match the rest of describe rendering.\n\tconst paths = Object.keys(g.nodes).sort();\n\t// Drop edges whose endpoints aren't in the current visible path set\n\t// (respects actor filtering that the caller already applied).\n\tconst nodeSet = new Set(paths);\n\tconst edges = g.edges.filter((e) => nodeSet.has(e.from) && nodeSet.has(e.to));\n\n\t// Precompute truncated labels + cell widths so the layout knows box\n\t// dimensions without re-measuring.\n\tconst labels = new Map<string, string>();\n\tconst widths = new Map<string, number>();\n\tfor (const p of paths) {\n\t\tconst label = truncateToCells(p, maxLabel);\n\t\tlabels.set(p, label);\n\t\t// Box width = label cells + 2 side borders + 2 cells of padding.\n\t\twidths.set(p, countCells(label) + 4);\n\t}\n\n\tconst layout = sugiyamaLayout({\n\t\tnodes: paths,\n\t\tedges,\n\t\twidthCells: (id) => widths.get(id) ?? 3,\n\t\theightCells: () => BOX_HEIGHT,\n\t\tlayerGap: LAYER_GAP,\n\t\tnodeGap: NODE_GAP,\n\t\tdirection,\n\t});\n\n\tconst text = renderGrid(layout, {\n\t\tcharset,\n\t\tlabelOf: (id) => labels.get(id) ?? id,\n\t});\n\n\topts?.logger?.(text);\n\treturn text;\n}\n\nfunction normalizeAsciiDirection(direction: unknown): LayoutDirection {\n\tif (direction === undefined || direction === \"LR\") return \"LR\";\n\tif (direction === \"TD\") return \"TD\";\n\t// BT / RL are valid for the vector diagram formats but ASCII grid\n\t// semantics are meaningful only for LR and TD — reject early with a\n\t// clear message rather than silently ignoring.\n\tthrow new Error(`ascii describe supports direction \"LR\" or \"TD\" only; got ${String(direction)}`);\n}\n","/**\n * Internal helpers shared across renderers in `extra/render/`.\n *\n * These are pure functions over `GraphDescribeOutput` — no Graph instance\n * dependency. Extracted from `src/graph/graph.ts` (the consolidated\n * ex-dumpGraph / ex-graphSpecToMermaid / ex-graphSpecToD2 renderers) per\n * Tier 2.1 A2.\n */\n\nimport type { GraphDescribeOutput } from \"@graphrefly/pure-ts/graph\";\n\n/** Direction options for diagram exports. */\nexport type DiagramDirection = \"TD\" | \"LR\" | \"BT\" | \"RL\";\n\n/** Recursively sort object keys for deterministic JSON (git-diffable). */\nexport function sortJsonValue(value: unknown): unknown {\n\tif (value === null || typeof value !== \"object\") {\n\t\treturn value;\n\t}\n\tif (Array.isArray(value)) {\n\t\treturn value.map(sortJsonValue);\n\t}\n\tconst obj = value as Record<string, unknown>;\n\tconst keys = Object.keys(obj).sort();\n\tconst out: Record<string, unknown> = {};\n\tfor (const k of keys) {\n\t\tout[k] = sortJsonValue(obj[k]);\n\t}\n\treturn out;\n}\n\n/** Escape characters that are illegal inside a quoted Mermaid label. */\nexport function escapeMermaidLabel(value: string): string {\n\treturn value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"');\n}\n\n/** Escape characters that are illegal inside a quoted D2 label. */\nexport function escapeD2Label(value: string): string {\n\treturn value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"');\n}\n\n/** Map our 4-direction enum to D2's `direction:` keyword. */\nexport function d2DirectionFromGraphDirection(direction: DiagramDirection): string {\n\tif (direction === \"TD\") return \"down\";\n\tif (direction === \"BT\") return \"up\";\n\tif (direction === \"RL\") return \"left\";\n\treturn \"right\";\n}\n\n/** Collect deduplicated (from, to) arrows from deps + edges. */\nexport function collectDiagramArrows(described: GraphDescribeOutput): [string, string][] {\n\tconst seen = new Set<string>();\n\tconst arrows: [string, string][] = [];\n\tfunction add(from: string, to: string): void {\n\t\tconst key = `${from}\\0${to}`;\n\t\tif (seen.has(key)) return;\n\t\tseen.add(key);\n\t\tarrows.push([from, to]);\n\t}\n\tfor (const [path, info] of Object.entries(described.nodes)) {\n\t\tconst deps: string[] | undefined = (info as Record<string, unknown>).deps as\n\t\t\t| string[]\n\t\t\t| undefined;\n\t\tif (deps) {\n\t\t\tfor (const dep of deps) add(dep, path);\n\t\t}\n\t}\n\tfor (const edge of described.edges) add(edge.from, edge.to);\n\treturn arrows;\n}\n\n/** Default to \"LR\"; throw on unknown values to surface caller bugs early. */\nexport function normalizeDiagramDirection(direction: unknown): DiagramDirection {\n\tif (direction === undefined) return \"LR\";\n\tif (direction === \"TD\" || direction === \"LR\" || direction === \"BT\" || direction === \"RL\") {\n\t\treturn direction;\n\t}\n\tthrow new Error(\n\t\t`invalid diagram direction ${String(direction)}; expected one of: TD, LR, BT, RL`,\n\t);\n}\n\n/** JSON-aware single-value formatter (used by `graphSpecToPretty`). */\nexport function describeData(value: unknown): string {\n\tif (typeof value === \"string\") return JSON.stringify(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\" || value == null)\n\t\treturn String(value);\n\ttry {\n\t\treturn JSON.stringify(value);\n\t} catch {\n\t\treturn \"[unserializable]\";\n\t}\n}\n","/**\n * `graphSpecToD2(g, opts?)` — render a {@link GraphDescribeOutput} as D2\n * diagram text.\n *\n * Pure function over the describe snapshot; no Graph instance dependency.\n *\n * @category extra\n */\n\nimport type { GraphDescribeOutput } from \"@graphrefly/pure-ts/graph\";\nimport {\n\tcollectDiagramArrows,\n\ttype DiagramDirection,\n\td2DirectionFromGraphDirection,\n\tescapeD2Label,\n\tnormalizeDiagramDirection,\n} from \"./_internal.js\";\n\nexport type GraphSpecToD2Options = {\n\t/** Diagram direction; default `\"LR\"`. */\n\tdirection?: DiagramDirection;\n};\n\nexport function graphSpecToD2(g: GraphDescribeOutput, opts?: GraphSpecToD2Options): string {\n\tconst direction = normalizeDiagramDirection(opts?.direction);\n\tconst paths = Object.keys(g.nodes).sort();\n\tconst ids = new Map<string, string>();\n\tfor (let i = 0; i < paths.length; i += 1) ids.set(paths[i]!, `n${i}`);\n\tconst lines: string[] = [`direction: ${d2DirectionFromGraphDirection(direction)}`];\n\tfor (const path of paths) {\n\t\tconst id = ids.get(path)!;\n\t\tlines.push(`${id}: \"${escapeD2Label(path)}\"`);\n\t}\n\tfor (const [from, to] of collectDiagramArrows(g)) {\n\t\tconst fromId = ids.get(from);\n\t\tconst toId = ids.get(to);\n\t\tif (!fromId || !toId) continue;\n\t\tlines.push(`${fromId} -> ${toId}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n","/**\n * `graphSpecToJson(g, opts?)` — render a {@link GraphDescribeOutput} as\n * deterministic JSON text with sorted keys.\n *\n * Pure function over the describe snapshot; no Graph instance dependency.\n *\n * @category extra\n */\n\nimport type { GraphDescribeOutput } from \"@graphrefly/pure-ts/graph\";\nimport { sortJsonValue } from \"./_internal.js\";\n\nexport type GraphSpecToJsonOptions = {\n\t/** Include the Edges section (default `true`). */\n\tincludeEdges?: boolean;\n\t/** Include the Subgraphs section (default `true`). */\n\tincludeSubgraphs?: boolean;\n\t/** JSON indent (default `2`). */\n\tindent?: number;\n\t/** Optional logger hook; fires with the rendered text before return. */\n\tlogger?: (text: string) => void;\n};\n\nexport function graphSpecToJson(g: GraphDescribeOutput, opts?: GraphSpecToJsonOptions): string {\n\tconst includeEdges = opts?.includeEdges ?? true;\n\tconst includeSubgraphs = opts?.includeSubgraphs ?? true;\n\tconst { expand: _expand, ...rest } = g;\n\tconst payload: GraphDescribeOutput = {\n\t\t...rest,\n\t\tedges: includeEdges ? g.edges : [],\n\t\tsubgraphs: includeSubgraphs ? g.subgraphs : [],\n\t};\n\tconst text = JSON.stringify(sortJsonValue(payload), null, opts?.indent ?? 2);\n\topts?.logger?.(text);\n\treturn text;\n}\n","/**\n * `graphSpecToMermaid(g, opts?)` — render a {@link GraphDescribeOutput} as\n * Mermaid flowchart text.\n *\n * Pure function over the describe snapshot; no Graph instance dependency.\n * Compose with `derived` for live formatted output:\n *\n * ```ts\n * import { graphSpecToMermaid } from \"@graphrefly/graphrefly/extra/render\";\n * import { derived } from \"@graphrefly/graphrefly\";\n *\n * const live = derived(\n * [graph.describe({ reactive: true }).node],\n * ([g]) => graphSpecToMermaid(g),\n * );\n * ```\n *\n * @category extra\n */\n\nimport type { GraphDescribeOutput } from \"@graphrefly/pure-ts/graph\";\nimport {\n\tcollectDiagramArrows,\n\ttype DiagramDirection,\n\tescapeMermaidLabel,\n\tnormalizeDiagramDirection,\n} from \"./_internal.js\";\n\nexport type GraphSpecToMermaidOptions = {\n\t/** Diagram direction; default `\"LR\"`. */\n\tdirection?: DiagramDirection;\n};\n\nexport function graphSpecToMermaid(\n\tg: GraphDescribeOutput,\n\topts?: GraphSpecToMermaidOptions,\n): string {\n\tconst direction = normalizeDiagramDirection(opts?.direction);\n\tconst paths = Object.keys(g.nodes).sort();\n\tconst ids = new Map<string, string>();\n\tfor (let i = 0; i < paths.length; i += 1) ids.set(paths[i]!, `n${i}`);\n\tconst lines: string[] = [`flowchart ${direction}`];\n\tfor (const path of paths) {\n\t\tconst id = ids.get(path)!;\n\t\tlines.push(` ${id}[\"${escapeMermaidLabel(path)}\"]`);\n\t}\n\tfor (const [from, to] of collectDiagramArrows(g)) {\n\t\tconst fromId = ids.get(from);\n\t\tconst toId = ids.get(to);\n\t\tif (!fromId || !toId) continue;\n\t\tlines.push(` ${fromId} --> ${toId}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n","/**\n * `graphSpecToMermaidUrl(g, opts?)` — encode a {@link GraphDescribeOutput}\n * as a `https://mermaid.live/edit#base64:…` deep link.\n *\n * Round-trip with the mermaid.live editor's `/edit#base64:` share format —\n * payload is `base64url(JSON({code, mermaid: {theme}, ...}))`. No network\n * calls; the payload is encoded into the URL fragment.\n *\n * @category extra\n */\n\nimport type { GraphDescribeOutput } from \"@graphrefly/pure-ts/graph\";\nimport { type GraphSpecToMermaidOptions, graphSpecToMermaid } from \"./graph-spec-to-mermaid.js\";\n\nexport type MermaidLiveTheme = \"default\" | \"dark\" | \"forest\" | \"neutral\" | \"base\";\n\nexport type GraphSpecToMermaidUrlOptions = GraphSpecToMermaidOptions & {\n\ttheme?: MermaidLiveTheme;\n\tautoSync?: boolean;\n};\n\n/**\n * Encode an arbitrary mermaid source string to a `mermaid.live` deep link.\n * Exported separately so callers that already rendered mermaid text can\n * upgrade to a live-editor URL without re-rendering.\n */\nexport function mermaidLiveUrl(\n\tmermaidSrc: string,\n\topts?: { theme?: MermaidLiveTheme; autoSync?: boolean },\n): string {\n\tconst theme = opts?.theme ?? \"default\";\n\tconst autoSync = opts?.autoSync ?? true;\n\tconst payload = { code: mermaidSrc, mermaid: { theme }, autoSync };\n\tconst json = JSON.stringify(payload);\n\t// Browsers + Node both expose globalThis.btoa; encode UTF-8 bytes first so\n\t// non-ASCII node names don't explode btoa. Then url-safe base64 (`+/=`→`-_` strip).\n\tconst bytes = new TextEncoder().encode(json);\n\tlet binary = \"\";\n\tfor (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]!);\n\tconst b64 = globalThis.btoa(binary).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n\treturn `https://mermaid.live/edit#base64:${b64}`;\n}\n\nexport function graphSpecToMermaidUrl(\n\tg: GraphDescribeOutput,\n\topts?: GraphSpecToMermaidUrlOptions,\n): string {\n\tconst mermaidSrc = graphSpecToMermaid(g, opts);\n\treturn mermaidLiveUrl(mermaidSrc, opts);\n}\n","/**\n * `graphSpecToPretty(g, opts?)` — render a {@link GraphDescribeOutput} as\n * human-readable plaintext (Node list with values, plus optional Edges and\n * Subgraphs sections).\n *\n * Pure function over the describe snapshot; no Graph instance dependency.\n *\n * @category extra\n */\n\nimport type { GraphDescribeOutput } from \"@graphrefly/pure-ts/graph\";\nimport { describeData } from \"./_internal.js\";\n\nexport type GraphSpecToPrettyOptions = {\n\t/** Include the Edges section (default `true`). */\n\tincludeEdges?: boolean;\n\t/** Include the Subgraphs section (default `true`). */\n\tincludeSubgraphs?: boolean;\n\t/** Optional logger hook; fires with the rendered text before return. */\n\tlogger?: (text: string) => void;\n};\n\nexport function graphSpecToPretty(g: GraphDescribeOutput, opts?: GraphSpecToPrettyOptions): string {\n\tconst includeEdges = opts?.includeEdges ?? true;\n\tconst includeSubgraphs = opts?.includeSubgraphs ?? true;\n\tconst lines: string[] = [];\n\tlines.push(`Graph ${g.name}`);\n\tlines.push(\"Nodes:\");\n\tfor (const path of Object.keys(g.nodes).sort()) {\n\t\tconst n = g.nodes[path]!;\n\t\tlines.push(`- ${path} (${n.type}/${n.status}): ${describeData(n.value)}`);\n\t}\n\tif (includeEdges) {\n\t\tlines.push(\"Edges:\");\n\t\tfor (const edge of g.edges) {\n\t\t\tlines.push(`- ${edge.from} -> ${edge.to}`);\n\t\t}\n\t}\n\tif (includeSubgraphs) {\n\t\tlines.push(\"Subgraphs:\");\n\t\tfor (const sg of g.subgraphs) {\n\t\t\tlines.push(`- ${sg}`);\n\t\t}\n\t}\n\tconst text = lines.join(\"\\n\");\n\topts?.logger?.(text);\n\treturn text;\n}\n","/**\n * `layoutFrameToSvg(frame, opts?)` — render a {@link LayoutFrame} as an SVG\n * markup string.\n *\n * Universal-safe — emits a string, not a DOM tree. Browser code embeds via\n * `el.innerHTML = svg`; Node code writes to a file. Cell-grid coordinates from\n * the layout are scaled by `cellWidth` / `cellHeight` (default 12 × 18 px,\n * roughly matching a monospace baseline).\n *\n * Each box gets `data-id=\"<path>\"` for change-event highlighting; each edge\n * gets `data-from=\"<from>\" data-to=\"<to>\"` so renderers can animate flowing\n * data per `LayoutFrame.changes`.\n *\n * @category extra\n */\n\nimport type { LayoutFrame } from \"./layout-types.js\";\n\nexport interface LayoutFrameToSvgOptions {\n\t/** Pixel width of one cell. Default: `12`. */\n\treadonly cellWidth?: number;\n\t/** Pixel height of one cell. Default: `18`. */\n\treadonly cellHeight?: number;\n\t/** Outer margin in pixels. Default: `16`. */\n\treadonly padding?: number;\n\t/** Box stroke color. Default: `\"#444\"`. */\n\treadonly boxStroke?: string;\n\t/** Box fill color. Default: `\"#fff\"`. */\n\treadonly boxFill?: string;\n\t/** Edge stroke color. Default: `\"#888\"`. */\n\treadonly edgeStroke?: string;\n\t/** Box label text color. Default: `\"#111\"`. */\n\treadonly textColor?: string;\n\t/** Font family. Default: `\"ui-monospace, monospace\"`. */\n\treadonly fontFamily?: string;\n\t/** Font size in pixels. Default: `12`. */\n\treadonly fontSize?: number;\n}\n\nconst SPECIAL_CHARS: Record<string, string> = {\n\t\"&\": \"&amp;\",\n\t\"<\": \"&lt;\",\n\t\">\": \"&gt;\",\n\t'\"': \"&quot;\",\n\t\"'\": \"&apos;\",\n};\n\nfunction escapeXml(s: string): string {\n\treturn s.replace(/[&<>\"']/g, (c) => SPECIAL_CHARS[c] ?? c);\n}\n\n/**\n * Render a {@link LayoutFrame} to SVG markup. Pure function — call from\n * `derived` to drive a live `<svg>` element from a `topologyView` output.\n */\nexport function layoutFrameToSvg(frame: LayoutFrame, opts?: LayoutFrameToSvgOptions): string {\n\tconst cellW = opts?.cellWidth ?? 12;\n\tconst cellH = opts?.cellHeight ?? 18;\n\tconst pad = opts?.padding ?? 16;\n\t// /qa F-10: route option-bag string attributes through escapeXml so that\n\t// user-supplied themes (URL params, dashboard config, etc.) cannot inject\n\t// `\"/><script>...` and break out of the attribute. Numeric `fontSize` has\n\t// no XSS surface; escape only when caller passes a string.\n\tconst boxStroke = escapeXml(opts?.boxStroke ?? \"#444\");\n\tconst boxFill = escapeXml(opts?.boxFill ?? \"#fff\");\n\tconst edgeStroke = escapeXml(opts?.edgeStroke ?? \"#888\");\n\tconst textColor = escapeXml(opts?.textColor ?? \"#111\");\n\tconst fontFamily = opts?.fontFamily ?? \"ui-monospace, monospace\";\n\tconst fontSize = opts?.fontSize ?? 12;\n\n\tlet maxX = 0;\n\tlet maxY = 0;\n\tfor (const b of frame.boxes) {\n\t\tmaxX = Math.max(maxX, b.x + b.w);\n\t\tmaxY = Math.max(maxY, b.y + b.h);\n\t}\n\tfor (const e of frame.edges) {\n\t\tfor (const [x, y] of e.points) {\n\t\t\tmaxX = Math.max(maxX, x);\n\t\t\tmaxY = Math.max(maxY, y);\n\t\t}\n\t}\n\tconst width = Math.max(1, maxX) * cellW + pad * 2;\n\tconst height = Math.max(1, maxY) * cellH + pad * 2;\n\n\tconst lines: string[] = [];\n\tlines.push(\n\t\t`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 ${width} ${height}\" width=\"${width}\" height=\"${height}\">`,\n\t);\n\n\t// Edges first (so boxes overlay them at endpoints).\n\tfor (const e of frame.edges) {\n\t\tif (e.points.length < 2) continue;\n\t\tconst pts = e.points.map(([x, y]) => `${x * cellW + pad},${y * cellH + pad}`).join(\" \");\n\t\tlines.push(\n\t\t\t` <polyline points=\"${pts}\" fill=\"none\" stroke=\"${edgeStroke}\" stroke-width=\"1\" data-from=\"${escapeXml(e.from)}\" data-to=\"${escapeXml(e.to)}\" data-dep-index=\"${e.depIndex}\" />`,\n\t\t);\n\t}\n\n\t// Boxes.\n\tfor (const b of frame.boxes) {\n\t\tconst px = b.x * cellW + pad;\n\t\tconst py = b.y * cellH + pad;\n\t\tconst pw = Math.max(1, b.w) * cellW;\n\t\tconst ph = Math.max(1, b.h) * cellH;\n\t\t// Local segment for label so deeply-mounted nodes stay readable.\n\t\tconst local = b.id.includes(\"::\") ? (b.id.split(\"::\").pop() ?? b.id) : b.id;\n\t\tlines.push(\n\t\t\t` <g data-id=\"${escapeXml(b.id)}\">`,\n\t\t\t` <rect x=\"${px}\" y=\"${py}\" width=\"${pw}\" height=\"${ph}\" fill=\"${boxFill}\" stroke=\"${boxStroke}\" stroke-width=\"1\" />`,\n\t\t\t` <text x=\"${px + pw / 2}\" y=\"${py + ph / 2}\" fill=\"${textColor}\" font-family=\"${escapeXml(fontFamily)}\" font-size=\"${fontSize}\" text-anchor=\"middle\" dominant-baseline=\"central\">${escapeXml(local)}</text>`,\n\t\t\t` </g>`,\n\t\t);\n\t}\n\n\tlines.push(\"</svg>\");\n\treturn lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;AAkDA,IAAM,UAAkB;AAAA,EACvB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACP;AAEA,IAAM,QAAgB;AAAA,EACrB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACP;AAgBO,SAAS,WAAW,QAAsB,SAA8B;AAC9E,QAAM,SAAS,QAAQ,YAAY,UAAU,QAAQ;AACrD,QAAM,QAAQ,OAAO;AACrB,QAAM,SAAS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