@graphrefly/ts 0.0.0 → 0.0.2

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 (405) hide show
  1. package/README.md +135 -0
  2. package/dist/actions-types-CSC3NMDl.d.ts +657 -0
  3. package/dist/actions-types-wl9Mgkmr.d.cts +657 -0
  4. package/dist/adapters/index.cjs +5219 -2974
  5. package/dist/adapters/index.cjs.map +1 -1
  6. package/dist/adapters/index.d.cts +204 -192
  7. package/dist/adapters/index.d.ts +204 -192
  8. package/dist/adapters/index.js +3685 -1833
  9. package/dist/adapters/index.js.map +1 -1
  10. package/dist/adapters/nestjs/microservices.cjs +841 -0
  11. package/dist/adapters/nestjs/microservices.cjs.map +1 -0
  12. package/dist/adapters/nestjs/microservices.d.cts +45 -0
  13. package/dist/adapters/nestjs/microservices.d.ts +45 -0
  14. package/dist/adapters/nestjs/microservices.js +206 -0
  15. package/dist/adapters/nestjs/microservices.js.map +1 -0
  16. package/dist/adapters/nestjs/native.cjs +1391 -0
  17. package/dist/adapters/nestjs/native.cjs.map +1 -0
  18. package/dist/adapters/nestjs/native.d.cts +111 -0
  19. package/dist/adapters/nestjs/native.d.ts +111 -0
  20. package/dist/adapters/nestjs/native.js +577 -0
  21. package/dist/adapters/nestjs/native.js.map +1 -0
  22. package/dist/adapters/nestjs/websockets.cjs +924 -0
  23. package/dist/adapters/nestjs/websockets.cjs.map +1 -0
  24. package/dist/adapters/nestjs/websockets.d.cts +47 -0
  25. package/dist/adapters/nestjs/websockets.d.ts +47 -0
  26. package/dist/adapters/nestjs/websockets.js +286 -0
  27. package/dist/adapters/nestjs/websockets.js.map +1 -0
  28. package/dist/adapters/nestjs.cjs +1085 -0
  29. package/dist/adapters/nestjs.cjs.map +1 -0
  30. package/dist/adapters/nestjs.d.cts +385 -0
  31. package/dist/adapters/nestjs.d.ts +385 -0
  32. package/dist/adapters/nestjs.js +112 -0
  33. package/dist/adapters/nestjs.js.map +1 -0
  34. package/dist/adapters/observe-storage.d.cts +4 -4
  35. package/dist/adapters/observe-storage.d.ts +4 -4
  36. package/dist/adapters/observe-storage.js +5 -4
  37. package/dist/adapters/observe-storage.js.map +1 -1
  38. package/dist/adapters/react.cjs +166 -0
  39. package/dist/adapters/react.cjs.map +1 -0
  40. package/dist/adapters/react.d.cts +31 -0
  41. package/dist/adapters/react.d.ts +31 -0
  42. package/dist/adapters/react.js +51 -0
  43. package/dist/adapters/react.js.map +1 -0
  44. package/dist/adapters/solid.cjs +157 -0
  45. package/dist/adapters/solid.cjs.map +1 -0
  46. package/dist/adapters/solid.d.cts +26 -0
  47. package/dist/adapters/solid.d.ts +26 -0
  48. package/dist/adapters/solid.js +48 -0
  49. package/dist/adapters/solid.js.map +1 -0
  50. package/dist/adapters/svelte.cjs +148 -0
  51. package/dist/adapters/svelte.cjs.map +1 -0
  52. package/dist/adapters/svelte.d.cts +31 -0
  53. package/dist/adapters/svelte.d.ts +31 -0
  54. package/dist/adapters/svelte.js +46 -0
  55. package/dist/adapters/svelte.js.map +1 -0
  56. package/dist/adapters/vue.cjs +155 -0
  57. package/dist/adapters/vue.cjs.map +1 -0
  58. package/dist/adapters/vue.d.cts +26 -0
  59. package/dist/adapters/vue.d.ts +26 -0
  60. package/dist/adapters/vue.js +46 -0
  61. package/dist/adapters/vue.js.map +1 -0
  62. package/dist/agent-runtime-types-core-CaXfKNtY.d.cts +406 -0
  63. package/dist/agent-runtime-types-core-hU299uIC.d.ts +406 -0
  64. package/dist/agent-runtime-types-tool-BEpSINol.d.ts +695 -0
  65. package/dist/agent-runtime-types-tool-DninPEzk.d.cts +695 -0
  66. package/dist/agentic-memory-retention-BmGX368S.d.ts +14 -0
  67. package/dist/agentic-memory-retention-Ih1qhX9Z.d.cts +14 -0
  68. package/dist/agentic-memory-types-CVSUS6XR.d.ts +473 -0
  69. package/dist/agentic-memory-types-FnnYlVUs.d.cts +473 -0
  70. package/dist/capability-admission-BW2CziT6.d.ts +102 -0
  71. package/dist/capability-admission-lwSecxXs.d.cts +102 -0
  72. package/dist/chunk-2KUAG2GZ.js +9693 -0
  73. package/dist/chunk-2KUAG2GZ.js.map +1 -0
  74. package/dist/chunk-2NJP6GO4.js +1320 -0
  75. package/dist/chunk-2NJP6GO4.js.map +1 -0
  76. package/dist/{chunk-GDL26N2T.js → chunk-3KN7NJDR.js} +2 -2
  77. package/dist/{chunk-COHO25CZ.js → chunk-4NWSNI4K.js} +2232 -1672
  78. package/dist/chunk-4NWSNI4K.js.map +1 -0
  79. package/dist/{chunk-Z2ANQ6JW.js → chunk-4Q77MMJY.js} +2 -2
  80. package/dist/chunk-6E76H4OU.js +132 -0
  81. package/dist/chunk-6E76H4OU.js.map +1 -0
  82. package/dist/chunk-7GOTIIQ7.js +819 -0
  83. package/dist/chunk-7GOTIIQ7.js.map +1 -0
  84. package/dist/{chunk-D6BG7U6A.js → chunk-7HZRJMN6.js} +3 -3
  85. package/dist/{chunk-SCRFRCGR.js → chunk-BSQGE5PS.js} +1 -1
  86. package/dist/{chunk-PKVBHGBM.js → chunk-CJIFGJQG.js} +7 -7
  87. package/dist/{chunk-G4M3NHRJ.js → chunk-CX6B6PO2.js} +93 -10
  88. package/dist/chunk-CX6B6PO2.js.map +1 -0
  89. package/dist/chunk-DGUM43GV.js +11 -0
  90. package/dist/chunk-DGUM43GV.js.map +1 -0
  91. package/dist/{chunk-JIMUDQN3.js → chunk-E4QCH32M.js} +449 -447
  92. package/dist/chunk-E4QCH32M.js.map +1 -0
  93. package/dist/{chunk-RIIOUTGM.js → chunk-ECURQ3HD.js} +19 -129
  94. package/dist/chunk-ECURQ3HD.js.map +1 -0
  95. package/dist/{chunk-2ILL7HQI.js → chunk-EOKT4QFF.js} +134 -128
  96. package/dist/chunk-EOKT4QFF.js.map +1 -0
  97. package/dist/{chunk-K3FXTC3I.js → chunk-HJACH5PU.js} +3 -3
  98. package/dist/{chunk-GTPCOEOZ.js → chunk-IDMLXLLG.js} +3 -3
  99. package/dist/{chunk-DKP56CSW.js → chunk-JKAYLDQV.js} +2 -2
  100. package/dist/{chunk-4VLAQHZI.js → chunk-K7FB3JTD.js} +17 -1
  101. package/dist/chunk-K7FB3JTD.js.map +1 -0
  102. package/dist/chunk-L6LDXRWE.js +219 -0
  103. package/dist/chunk-L6LDXRWE.js.map +1 -0
  104. package/dist/chunk-M7J6Z4IJ.js +1930 -0
  105. package/dist/chunk-M7J6Z4IJ.js.map +1 -0
  106. package/dist/chunk-MQEQMS7B.js +1009 -0
  107. package/dist/chunk-MQEQMS7B.js.map +1 -0
  108. package/dist/chunk-MTELVIYR.js +1421 -0
  109. package/dist/chunk-MTELVIYR.js.map +1 -0
  110. package/dist/chunk-PVC7WDKI.js +885 -0
  111. package/dist/chunk-PVC7WDKI.js.map +1 -0
  112. package/dist/chunk-RAHNUYA5.js +368 -0
  113. package/dist/chunk-RAHNUYA5.js.map +1 -0
  114. package/dist/{chunk-DK554R7P.js → chunk-S6HXABGL.js} +2 -1
  115. package/dist/chunk-S6HXABGL.js.map +1 -0
  116. package/dist/{chunk-I3IHOHCJ.js → chunk-SHZDP2MQ.js} +1181 -1001
  117. package/dist/chunk-SHZDP2MQ.js.map +1 -0
  118. package/dist/{chunk-Y3ZLRGHC.js → chunk-SIDJO2T4.js} +16 -16
  119. package/dist/chunk-STXRMPW4.js +4131 -0
  120. package/dist/chunk-STXRMPW4.js.map +1 -0
  121. package/dist/{chunk-JR4IKCR2.js → chunk-TPND5MJS.js} +5 -5
  122. package/dist/chunk-TQPCAIQI.js +612 -0
  123. package/dist/chunk-TQPCAIQI.js.map +1 -0
  124. package/dist/chunk-UT3MHJCW.js +49 -0
  125. package/dist/chunk-UT3MHJCW.js.map +1 -0
  126. package/dist/{chunk-TEW47IVR.js → chunk-VPEFSDME.js} +2 -2
  127. package/dist/{chunk-SWTLEQL6.js → chunk-WQIA3GFB.js} +2 -2
  128. package/dist/chunk-WQIA3GFB.js.map +1 -0
  129. package/dist/{chunk-DJC4CHLQ.js → chunk-YDWBXXQZ.js} +5 -5
  130. package/dist/{chunk-6PHB5CJS.js → chunk-ZLFRB6FI.js} +2 -2
  131. package/dist/composition/index.cjs +1256 -1059
  132. package/dist/composition/index.cjs.map +1 -1
  133. package/dist/composition/index.d.cts +4 -4
  134. package/dist/composition/index.d.ts +4 -4
  135. package/dist/composition/index.js +7 -6
  136. package/dist/core/index.cjs +1218 -1021
  137. package/dist/core/index.cjs.map +1 -1
  138. package/dist/core/index.d.cts +2 -2
  139. package/dist/core/index.d.ts +2 -2
  140. package/dist/core/index.js +5 -4
  141. package/dist/cqrs/index.cjs.map +1 -1
  142. package/dist/cqrs/index.d.cts +4 -4
  143. package/dist/cqrs/index.d.ts +4 -4
  144. package/dist/cqrs/index.js +3 -2
  145. package/dist/cqrs/index.js.map +1 -1
  146. package/dist/cqrs/messaging.cjs +312 -0
  147. package/dist/cqrs/messaging.cjs.map +1 -0
  148. package/dist/cqrs/messaging.d.cts +57 -0
  149. package/dist/cqrs/messaging.d.ts +57 -0
  150. package/dist/cqrs/messaging.js +274 -0
  151. package/dist/cqrs/messaging.js.map +1 -0
  152. package/dist/cqrs/work-queue.cjs +329 -0
  153. package/dist/cqrs/work-queue.cjs.map +1 -0
  154. package/dist/cqrs/work-queue.d.cts +90 -0
  155. package/dist/cqrs/work-queue.d.ts +90 -0
  156. package/dist/cqrs/work-queue.js +292 -0
  157. package/dist/cqrs/work-queue.js.map +1 -0
  158. package/dist/data/index.cjs +19 -0
  159. package/dist/data/index.cjs.map +1 -0
  160. package/dist/data/index.d.cts +36 -0
  161. package/dist/data/index.d.ts +36 -0
  162. package/dist/data/index.js +1 -0
  163. package/dist/data/index.js.map +1 -0
  164. package/dist/data-structures/index.cjs +1252 -1052
  165. package/dist/data-structures/index.cjs.map +1 -1
  166. package/dist/data-structures/index.d.cts +9 -8
  167. package/dist/data-structures/index.d.ts +9 -8
  168. package/dist/data-structures/index.js +9 -7
  169. package/dist/{describe-BZb7AS2y.d.ts → describe-B_A5fbXH.d.ts} +1 -1
  170. package/dist/{describe-Ciu8SUnN.d.cts → describe-CQRrkv-Q.d.cts} +1 -1
  171. package/dist/executors/tool-provider-adapters.cjs +3091 -0
  172. package/dist/executors/tool-provider-adapters.cjs.map +1 -0
  173. package/dist/executors/tool-provider-adapters.d.cts +174 -0
  174. package/dist/executors/tool-provider-adapters.d.ts +174 -0
  175. package/dist/executors/tool-provider-adapters.js +1336 -0
  176. package/dist/executors/tool-provider-adapters.js.map +1 -0
  177. package/dist/executors/tool-provider-runtime.cjs +5178 -0
  178. package/dist/executors/tool-provider-runtime.cjs.map +1 -0
  179. package/dist/executors/tool-provider-runtime.d.cts +17 -0
  180. package/dist/executors/tool-provider-runtime.d.ts +17 -0
  181. package/dist/executors/tool-provider-runtime.js +15 -0
  182. package/dist/executors/tool-provider-runtime.js.map +1 -0
  183. package/dist/executors/tool-provider.cjs +6392 -0
  184. package/dist/executors/tool-provider.cjs.map +1 -0
  185. package/dist/executors/tool-provider.d.cts +60 -0
  186. package/dist/executors/tool-provider.d.ts +60 -0
  187. package/dist/executors/tool-provider.js +89 -0
  188. package/dist/executors/tool-provider.js.map +1 -0
  189. package/dist/executors/work-queue.cjs +342 -0
  190. package/dist/executors/work-queue.cjs.map +1 -0
  191. package/dist/executors/work-queue.d.cts +90 -0
  192. package/dist/executors/work-queue.d.ts +90 -0
  193. package/dist/executors/work-queue.js +306 -0
  194. package/dist/executors/work-queue.js.map +1 -0
  195. package/dist/graph/index.cjs +1536 -1324
  196. package/dist/graph/index.cjs.map +1 -1
  197. package/dist/graph/index.d.cts +10 -9
  198. package/dist/graph/index.d.ts +10 -9
  199. package/dist/graph/index.js +22 -20
  200. package/dist/{graph-s23RbbFO.d.cts → graph-CWK3HLPB.d.cts} +134 -132
  201. package/dist/{graph-DfdF9zy4.d.ts → graph-ho5sotHP.d.ts} +134 -132
  202. package/dist/{index-SnzZu3x7.d.ts → index-CQWcE0Dw.d.ts} +18 -4
  203. package/dist/{index-CAEmLCYF.d.cts → index-DHA1i67c.d.cts} +18 -4
  204. package/dist/index.cjs +3331 -3020
  205. package/dist/index.cjs.map +1 -1
  206. package/dist/index.d.cts +14 -10
  207. package/dist/index.d.ts +14 -10
  208. package/dist/index.js +114 -108
  209. package/dist/inspection/boundary.cjs +98 -0
  210. package/dist/inspection/boundary.cjs.map +1 -0
  211. package/dist/inspection/boundary.d.cts +61 -0
  212. package/dist/inspection/boundary.d.ts +61 -0
  213. package/dist/inspection/boundary.js +75 -0
  214. package/dist/inspection/boundary.js.map +1 -0
  215. package/dist/measurements-C0mAvWU1.d.cts +164 -0
  216. package/dist/measurements-OMpCeBwh.d.ts +164 -0
  217. package/dist/{messages-BZqrGGm1.d.ts → messages-CAzUPPJM.d.cts} +10 -5
  218. package/dist/{messages-BZqrGGm1.d.cts → messages-CAzUPPJM.d.ts} +10 -5
  219. package/dist/messaging/index.cjs +756 -619
  220. package/dist/messaging/index.cjs.map +1 -1
  221. package/dist/messaging/index.d.cts +17 -226
  222. package/dist/messaging/index.d.ts +17 -226
  223. package/dist/messaging/index.js +19 -749
  224. package/dist/messaging/index.js.map +1 -1
  225. package/dist/operators/index.cjs +1256 -1059
  226. package/dist/operators/index.cjs.map +1 -1
  227. package/dist/operators/index.d.cts +6 -6
  228. package/dist/operators/index.d.ts +6 -6
  229. package/dist/operators/index.js +9 -8
  230. package/dist/orchestration/index.cjs +8664 -2617
  231. package/dist/orchestration/index.cjs.map +1 -1
  232. package/dist/orchestration/index.d.cts +171 -221
  233. package/dist/orchestration/index.d.ts +171 -221
  234. package/dist/orchestration/index.js +74 -982
  235. package/dist/orchestration/index.js.map +1 -1
  236. package/dist/orchestration/messaging.cjs +314 -0
  237. package/dist/orchestration/messaging.cjs.map +1 -0
  238. package/dist/orchestration/messaging.d.cts +56 -0
  239. package/dist/orchestration/messaging.d.ts +56 -0
  240. package/dist/orchestration/messaging.js +276 -0
  241. package/dist/orchestration/messaging.js.map +1 -0
  242. package/dist/orchestration/work-queue.cjs +1500 -0
  243. package/dist/orchestration/work-queue.cjs.map +1 -0
  244. package/dist/orchestration/work-queue.d.cts +196 -0
  245. package/dist/orchestration/work-queue.d.ts +196 -0
  246. package/dist/orchestration/work-queue.js +1289 -0
  247. package/dist/orchestration/work-queue.js.map +1 -0
  248. package/dist/patterns/event-flow.cjs +433 -0
  249. package/dist/patterns/event-flow.cjs.map +1 -0
  250. package/dist/patterns/event-flow.d.cts +115 -0
  251. package/dist/patterns/event-flow.d.ts +115 -0
  252. package/dist/patterns/event-flow.js +14 -0
  253. package/dist/patterns/event-flow.js.map +1 -0
  254. package/dist/patterns/index.cjs +748 -355
  255. package/dist/patterns/index.cjs.map +1 -1
  256. package/dist/patterns/index.d.cts +9 -5
  257. package/dist/patterns/index.d.ts +9 -5
  258. package/dist/patterns/index.js +13 -4
  259. package/dist/process-types-C9uMYz3i.d.ts +200 -0
  260. package/dist/process-types-h3uRlzDc.d.cts +200 -0
  261. package/dist/{reactive-collection-BxBqtIOE.d.cts → reactive-collection-B9R0Bl1P.d.cts} +11 -41
  262. package/dist/{reactive-collection-Cb1II1Fi.d.ts → reactive-collection-BXFrH0U2.d.ts} +11 -41
  263. package/dist/{reactive-collection-storage-D-KmjE0J.d.cts → reactive-collection-storage-BLGv8Xp8.d.cts} +5 -5
  264. package/dist/{reactive-collection-storage-BNiEc-Gd.d.ts → reactive-collection-storage-a4zD3665.d.ts} +5 -5
  265. package/dist/{reactive-map-BcB4KsQR.d.ts → reactive-map-C_8sOfdS.d.cts} +7 -6
  266. package/dist/{reactive-map-D-g3dv8I.d.cts → reactive-map-jle5dnok.d.ts} +7 -6
  267. package/dist/render/index.d.cts +3 -3
  268. package/dist/render/index.d.ts +3 -3
  269. package/dist/render/index.js +1 -0
  270. package/dist/scheduled-readiness-5rwQlyjV.d.ts +91 -0
  271. package/dist/scheduled-readiness-DpRY8jI0.d.cts +91 -0
  272. package/dist/semantic-memory-graph-C2ZUwIlq.d.ts +30 -0
  273. package/dist/semantic-memory-graph-DlZBD_Eu.d.cts +30 -0
  274. package/dist/{semantic-memory-graph-BYoIlP35.d.cts → semantic-memory-graph-types-BvzdqmkY.d.cts} +2 -28
  275. package/dist/{semantic-memory-graph-CxyXLms3.d.ts → semantic-memory-graph-types-Ci-OtahO.d.ts} +2 -28
  276. package/dist/solutions/index.cjs +6788 -2128
  277. package/dist/solutions/index.cjs.map +1 -1
  278. package/dist/solutions/index.d.cts +15 -519
  279. package/dist/solutions/index.d.ts +15 -519
  280. package/dist/solutions/index.js +91 -7
  281. package/dist/solutions/reactive-layout/browser/index.cjs +457 -0
  282. package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -0
  283. package/dist/solutions/reactive-layout/browser/index.d.cts +44 -0
  284. package/dist/solutions/reactive-layout/browser/index.d.ts +44 -0
  285. package/dist/solutions/reactive-layout/browser/index.js +69 -0
  286. package/dist/solutions/reactive-layout/browser/index.js.map +1 -0
  287. package/dist/solutions/reactive-layout/index.cjs +4494 -0
  288. package/dist/solutions/reactive-layout/index.cjs.map +1 -0
  289. package/dist/solutions/reactive-layout/index.d.cts +37 -0
  290. package/dist/solutions/reactive-layout/index.d.ts +37 -0
  291. package/dist/solutions/reactive-layout/index.js +146 -0
  292. package/dist/solutions/reactive-layout/index.js.map +1 -0
  293. package/dist/solutions/reactive-layout/node-canvas/index.cjs +555 -0
  294. package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -0
  295. package/dist/solutions/reactive-layout/node-canvas/index.d.cts +54 -0
  296. package/dist/solutions/reactive-layout/node-canvas/index.d.ts +54 -0
  297. package/dist/solutions/reactive-layout/node-canvas/index.js +131 -0
  298. package/dist/solutions/reactive-layout/node-canvas/index.js.map +1 -0
  299. package/dist/solutions/reactive-layout/react-native/index.cjs +504 -0
  300. package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -0
  301. package/dist/solutions/reactive-layout/react-native/index.d.cts +51 -0
  302. package/dist/solutions/reactive-layout/react-native/index.d.ts +51 -0
  303. package/dist/solutions/reactive-layout/react-native/index.js +77 -0
  304. package/dist/solutions/reactive-layout/react-native/index.js.map +1 -0
  305. package/dist/solutions/reactive-layout/skia/index.cjs +557 -0
  306. package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -0
  307. package/dist/solutions/reactive-layout/skia/index.d.cts +64 -0
  308. package/dist/solutions/reactive-layout/skia/index.d.ts +64 -0
  309. package/dist/solutions/reactive-layout/skia/index.js +70 -0
  310. package/dist/solutions/reactive-layout/skia/index.js.map +1 -0
  311. package/dist/solutions/work-item/actions.cjs +2345 -0
  312. package/dist/solutions/work-item/actions.cjs.map +1 -0
  313. package/dist/solutions/work-item/actions.d.cts +40 -0
  314. package/dist/solutions/work-item/actions.d.ts +40 -0
  315. package/dist/solutions/work-item/actions.js +2078 -0
  316. package/dist/solutions/work-item/actions.js.map +1 -0
  317. package/dist/solutions/work-item/scheduling.cjs +9797 -0
  318. package/dist/solutions/work-item/scheduling.cjs.map +1 -0
  319. package/dist/solutions/work-item/scheduling.d.cts +1868 -0
  320. package/dist/solutions/work-item/scheduling.d.ts +1868 -0
  321. package/dist/solutions/work-item/scheduling.js +146 -0
  322. package/dist/solutions/work-item/scheduling.js.map +1 -0
  323. package/dist/solutions/work-item/work-queue.cjs +306 -0
  324. package/dist/solutions/work-item/work-queue.cjs.map +1 -0
  325. package/dist/solutions/work-item/work-queue.d.cts +71 -0
  326. package/dist/solutions/work-item/work-queue.d.ts +71 -0
  327. package/dist/solutions/work-item/work-queue.js +270 -0
  328. package/dist/solutions/work-item/work-queue.js.map +1 -0
  329. package/dist/sources/browser.cjs +1399 -1052
  330. package/dist/sources/browser.cjs.map +1 -1
  331. package/dist/sources/browser.d.cts +33 -6
  332. package/dist/sources/browser.d.ts +33 -6
  333. package/dist/sources/browser.js +73 -6
  334. package/dist/sources/browser.js.map +1 -1
  335. package/dist/sources/index.cjs +1345 -1065
  336. package/dist/sources/index.cjs.map +1 -1
  337. package/dist/sources/index.d.cts +5 -5
  338. package/dist/sources/index.d.ts +5 -5
  339. package/dist/sources/index.js +7 -6
  340. package/dist/sources/node.cjs.map +1 -1
  341. package/dist/sources/node.d.cts +4 -4
  342. package/dist/sources/node.d.ts +4 -4
  343. package/dist/sources/node.js +2 -1
  344. package/dist/sources/node.js.map +1 -1
  345. package/dist/storage/browser.cjs +16 -0
  346. package/dist/storage/browser.cjs.map +1 -1
  347. package/dist/storage/browser.js +4 -3
  348. package/dist/storage/browser.js.map +1 -1
  349. package/dist/storage/index.cjs +16 -0
  350. package/dist/storage/index.cjs.map +1 -1
  351. package/dist/storage/index.d.cts +6 -5
  352. package/dist/storage/index.d.ts +6 -5
  353. package/dist/storage/index.js +10 -9
  354. package/dist/storage/node.cjs +16 -0
  355. package/dist/storage/node.cjs.map +1 -1
  356. package/dist/storage/node.js +4 -3
  357. package/dist/storage/node.js.map +1 -1
  358. package/dist/store-BmtEs9mG.d.ts +123 -0
  359. package/dist/store-PAAsYvML.d.cts +123 -0
  360. package/dist/testing/index.cjs +1 -0
  361. package/dist/testing/index.cjs.map +1 -1
  362. package/dist/testing/index.d.cts +1 -1
  363. package/dist/testing/index.d.ts +1 -1
  364. package/dist/testing/index.js +3 -2
  365. package/dist/types-BRNKoFHj.d.ts +357 -0
  366. package/dist/{types-h12mNYbq.d.ts → types-BS6CyR-x.d.cts} +49 -130
  367. package/dist/types-BWK2ay3e.d.cts +457 -0
  368. package/dist/types-BXKSAoE1.d.cts +357 -0
  369. package/dist/types-BaPpZItj.d.ts +457 -0
  370. package/dist/types-BhveCMg5.d.cts +274 -0
  371. package/dist/{types-bNMSWKqF.d.cts → types-C9NOgNJw.d.ts} +49 -130
  372. package/dist/types-CTsQ8Ww4.d.ts +274 -0
  373. package/dist/types-DL_05n2M.d.ts +34 -0
  374. package/dist/types-XDoqxYO9.d.cts +34 -0
  375. package/dist/work-item-runtime-types-BqtWnSCS.d.ts +138 -0
  376. package/dist/work-item-runtime-types-CHO03AKh.d.cts +138 -0
  377. package/dist/work-queue/index.cjs +1136 -0
  378. package/dist/work-queue/index.cjs.map +1 -0
  379. package/dist/work-queue/index.d.cts +21 -0
  380. package/dist/work-queue/index.d.ts +21 -0
  381. package/dist/work-queue/index.js +1082 -0
  382. package/dist/work-queue/index.js.map +1 -0
  383. package/package.json +603 -249
  384. package/dist/chunk-2ILL7HQI.js.map +0 -1
  385. package/dist/chunk-4VLAQHZI.js.map +0 -1
  386. package/dist/chunk-COHO25CZ.js.map +0 -1
  387. package/dist/chunk-DK554R7P.js.map +0 -1
  388. package/dist/chunk-G4M3NHRJ.js.map +0 -1
  389. package/dist/chunk-I3IHOHCJ.js.map +0 -1
  390. package/dist/chunk-JIMUDQN3.js.map +0 -1
  391. package/dist/chunk-RIIOUTGM.js.map +0 -1
  392. package/dist/chunk-SWTLEQL6.js.map +0 -1
  393. /package/dist/{chunk-GDL26N2T.js.map → chunk-3KN7NJDR.js.map} +0 -0
  394. /package/dist/{chunk-Z2ANQ6JW.js.map → chunk-4Q77MMJY.js.map} +0 -0
  395. /package/dist/{chunk-D6BG7U6A.js.map → chunk-7HZRJMN6.js.map} +0 -0
  396. /package/dist/{chunk-SCRFRCGR.js.map → chunk-BSQGE5PS.js.map} +0 -0
  397. /package/dist/{chunk-PKVBHGBM.js.map → chunk-CJIFGJQG.js.map} +0 -0
  398. /package/dist/{chunk-K3FXTC3I.js.map → chunk-HJACH5PU.js.map} +0 -0
  399. /package/dist/{chunk-GTPCOEOZ.js.map → chunk-IDMLXLLG.js.map} +0 -0
  400. /package/dist/{chunk-DKP56CSW.js.map → chunk-JKAYLDQV.js.map} +0 -0
  401. /package/dist/{chunk-Y3ZLRGHC.js.map → chunk-SIDJO2T4.js.map} +0 -0
  402. /package/dist/{chunk-JR4IKCR2.js.map → chunk-TPND5MJS.js.map} +0 -0
  403. /package/dist/{chunk-TEW47IVR.js.map → chunk-VPEFSDME.js.map} +0 -0
  404. /package/dist/{chunk-DJC4CHLQ.js.map → chunk-YDWBXXQZ.js.map} +0 -0
  405. /package/dist/{chunk-6PHB5CJS.js.map → chunk-ZLFRB6FI.js.map} +0 -0
@@ -0,0 +1,148 @@
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 __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/adapters/svelte.ts
21
+ var svelte_exports = {};
22
+ __export(svelte_exports, {
23
+ nodeReadable: () => nodeReadable,
24
+ nodeRecord: () => nodeRecord,
25
+ nodeWritable: () => nodeWritable
26
+ });
27
+ module.exports = __toCommonJS(svelte_exports);
28
+ var import_store = require("svelte/store");
29
+
30
+ // src/adapters/store.ts
31
+ function nodeSnapshot(node) {
32
+ return node.cache;
33
+ }
34
+ function subscribeNodeValues(node, run, opts = {}) {
35
+ const read = opts.getSnapshot ?? (() => nodeSnapshot(node));
36
+ if (opts.immediate) run(read());
37
+ let subscribing = true;
38
+ const skipSynchronousHandshakeData = opts.changesOnly || opts.immediate;
39
+ const sink = (msg, delivery) => {
40
+ switch (msg[0]) {
41
+ case "DATA":
42
+ if (skipSynchronousHandshakeData && subscribing && delivery === void 0) {
43
+ return;
44
+ }
45
+ run(msg[1]);
46
+ return;
47
+ case "ERROR":
48
+ opts.onError?.(msg[1]);
49
+ return;
50
+ case "COMPLETE":
51
+ opts.onComplete?.();
52
+ return;
53
+ }
54
+ };
55
+ const unsubscribe = node.subscribe(sink);
56
+ subscribing = false;
57
+ return unsubscribe;
58
+ }
59
+ function recordReadableStore(keysNode, factory, opts = {}) {
60
+ const read = () => {
61
+ const keys = keysNode.cache ?? [];
62
+ const out = {};
63
+ for (const key of keys) {
64
+ const nodes = factory(key);
65
+ const values = {};
66
+ for (const field of Object.keys(nodes)) {
67
+ values[field] = nodes[field].cache;
68
+ }
69
+ out[key] = values;
70
+ }
71
+ return out;
72
+ };
73
+ return {
74
+ get: read,
75
+ subscribe(run) {
76
+ const entryUnsubs = [];
77
+ const cleanupEntries = () => {
78
+ for (const unsub of entryUnsubs.splice(0)) unsub();
79
+ };
80
+ const sync = () => {
81
+ cleanupEntries();
82
+ for (const key of keysNode.cache ?? []) {
83
+ const nodes = factory(key);
84
+ for (const field of Object.keys(nodes)) {
85
+ entryUnsubs.push(
86
+ subscribeNodeValues(nodes[field], () => run(read()), {
87
+ changesOnly: true,
88
+ onError: opts.onError,
89
+ onComplete: opts.onComplete
90
+ })
91
+ );
92
+ }
93
+ }
94
+ run(read());
95
+ };
96
+ const keysUnsub = subscribeNodeValues(keysNode, sync, {
97
+ changesOnly: true,
98
+ onError: opts.onError,
99
+ onComplete: opts.onComplete
100
+ });
101
+ sync();
102
+ return () => {
103
+ keysUnsub();
104
+ cleanupEntries();
105
+ };
106
+ }
107
+ };
108
+ }
109
+
110
+ // src/adapters/svelte.ts
111
+ function nodeReadable(node) {
112
+ return (0, import_store.readable)(
113
+ nodeSnapshot(node),
114
+ (set) => subscribeNodeValues(node, set, { immediate: true })
115
+ );
116
+ }
117
+ function assertDataValue(value) {
118
+ if (value === void 0) {
119
+ throw new TypeError("nodeWritable: undefined is SENTINEL/no DATA, not a writable DATA value");
120
+ }
121
+ }
122
+ function nodeWritable(node) {
123
+ const store = nodeReadable(node);
124
+ return {
125
+ subscribe: store.subscribe,
126
+ set(value) {
127
+ assertDataValue(value);
128
+ node.set(value);
129
+ },
130
+ update(fn) {
131
+ const next = fn(nodeSnapshot(node));
132
+ assertDataValue(next);
133
+ node.set(next);
134
+ }
135
+ };
136
+ }
137
+ function nodeRecord(keysNode, factory) {
138
+ const store = recordReadableStore(keysNode, factory);
139
+ const read = () => store.get() ?? {};
140
+ return (0, import_store.readable)(read(), (set) => store.subscribe((value) => set(value ?? {})));
141
+ }
142
+ // Annotate the CommonJS export names for ESM import in node:
143
+ 0 && (module.exports = {
144
+ nodeReadable,
145
+ nodeRecord,
146
+ nodeWritable
147
+ });
148
+ //# sourceMappingURL=svelte.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/svelte.ts","../../src/adapters/store.ts"],"sourcesContent":["/**\n * Svelte node bindings for GraphReFly (D238).\n *\n * Svelte is imported only from this focused subpath.\n */\n\nimport { type Readable, readable } from \"svelte/store\";\nimport type { Node } from \"../node/node.js\";\nimport {\n\tnodeSnapshot,\n\trecordReadableStore,\n\tsubscribeNodeValues,\n\ttype WritableNode,\n} from \"./store.js\";\n\n/** A Svelte-readable store plus DATA-only write helpers. */\nexport interface NodeWritable<T> extends Readable<T | undefined> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\n/** Read a GraphReFly node as a Svelte readable store. */\nexport function nodeReadable<T>(node: Node<T>): Readable<T | undefined> {\n\treturn readable<T | undefined>(nodeSnapshot(node), (set) =>\n\t\tsubscribeNodeValues(node, set, { immediate: true }),\n\t);\n}\n\nfunction assertDataValue(value: unknown): void {\n\tif (value === undefined) {\n\t\tthrow new TypeError(\"nodeWritable: undefined is SENTINEL/no DATA, not a writable DATA value\");\n\t}\n}\n\n/** Bind a writable GraphReFly node as a Svelte store. */\nexport function nodeWritable<T>(node: WritableNode<T>): NodeWritable<T> {\n\tconst store = nodeReadable(node);\n\treturn {\n\t\tsubscribe: store.subscribe,\n\t\tset(value) {\n\t\t\tassertDataValue(value);\n\t\t\tnode.set(value);\n\t\t},\n\t\tupdate(fn) {\n\t\t\tconst next = fn(nodeSnapshot(node));\n\t\t\tassertDataValue(next);\n\t\t\tnode.set(next);\n\t\t},\n\t};\n}\n\n/**\n * Read a keyed record of nodes as a Svelte readable store.\n *\n * `factory` must have stable identity. Recreating it during component churn\n * rebuilds the record subscriptions.\n */\nexport function nodeRecord<K extends string, R extends Record<string, unknown>>(\n\tkeysNode: Node<readonly K[]>,\n\tfactory: (key: K) => { [P in keyof R]: Node<R[P]> },\n): Readable<Record<K, R>> {\n\tconst store = recordReadableStore(keysNode, factory);\n\tconst read = () => store.get() ?? ({} as Record<K, R>);\n\treturn readable(read(), (set) => store.subscribe((value) => set(value ?? ({} as Record<K, R>))));\n}\n","/**\n * Framework-neutral store adapters.\n *\n * Focused framework bindings build on this tiny Node-facing layer without\n * importing framework packages into the dependency-free adapters barrel\n * (D125/D238).\n */\n\nimport type { DeliveryMeta, Sink } from \"../ctx/types.js\";\nimport type { Node } from \"../node/node.js\";\n\n/** A minimal readable store contract shared by Svelte/Nanostores-style adapters. */\nexport interface ReadableStore<T> {\n\tget(): T | undefined;\n\tsubscribe(run: (value: T | undefined) => void): () => void;\n}\n\n/** A minimal writable store contract over a clean-slate writable node. */\nexport interface WritableStore<T> extends ReadableStore<T> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\n/** React `useSyncExternalStore`-compatible shape, without importing React. */\nexport interface ExternalStore<T> {\n\tgetSnapshot(): T | undefined;\n\tgetServerSnapshot(): T | undefined;\n\tsubscribe(onStoreChange: () => void): () => void;\n}\n\n/** Object-of-nodes factory used by record subscription adapters. */\nexport type NodeRecordFactory<K extends string, R extends Record<string, unknown>> = (key: K) => {\n\t[P in keyof R]: Node<R[P]>;\n};\n\n/** Zustand-compatible store API over a caller-owned clean-slate state node. */\nexport interface ZustandStoreApi<T extends object> {\n\tgetState(): T;\n\tsetState(partial: T | Partial<T> | ((state: T) => T | Partial<T>), replace?: boolean): void;\n\tgetInitialState(): T;\n\tsubscribe(listener: (state: T, prevState: T) => void): () => void;\n\tdestroy(): void;\n}\n\n/** Jotai-style atom facade over a caller-owned node. */\nexport interface JotaiAtom<T> {\n\tget(): T | undefined;\n\tsubscribe(callback: (value: T | undefined) => void): () => void;\n\treadonly _node: Node<T>;\n}\n\n/** Writable Jotai-style atom facade over a caller-owned writable node. */\nexport interface WritableJotaiAtom<T> extends JotaiAtom<T> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\n/** Nanostores-style atom facade over a caller-owned node. */\nexport interface NanoAtom<T> {\n\tget(): T | undefined;\n\tsubscribe(callback: (value: T | undefined) => void): () => void;\n\tlisten(callback: (value: T | undefined) => void): () => void;\n\treadonly _node: Node<T>;\n}\n\n/** Writable Nanostores-style atom facade over a caller-owned writable node. */\nexport interface WritableNanoAtom<T> extends NanoAtom<T> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\n/** TC39-Signals-style facade over a caller-owned node. */\nexport interface SignalLike<T> {\n\tget(): T | undefined;\n\tsubscribe(callback: (value: T | undefined) => void): () => void;\n\treadonly _node: Node<T>;\n}\n\n/** Writable TC39-Signals-style facade over a caller-owned writable node. */\nexport interface WritableSignalLike<T> extends SignalLike<T> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\nexport interface SubscribeValuesOptions<T> {\n\t/** Emit the current cache snapshot immediately. `undefined` means SENTINEL/no DATA. */\n\timmediate?: boolean;\n\t/** Suppress synchronous push-on-subscribe/replay DATA. Useful for change-only store listeners. */\n\tchangesOnly?: boolean;\n\tonError?: (error: unknown) => void;\n\tonComplete?: () => void;\n\t/** Custom cache reader for wrappers that keep their own snapshot object. */\n\tgetSnapshot?: () => T | undefined;\n}\n\nexport interface WritableNode<T> extends Node<T> {\n\tset(value: T): void;\n}\n\nexport interface WritableStoreOptions<T> extends SubscribeValuesOptions<T> {\n\t/** Override writes for adapters that need a framework-owned reducer. */\n\twrite?: (node: WritableNode<T>, value: T) => void;\n}\n\n/** Read a node cache without activating it. */\nexport function nodeSnapshot<T>(node: Node<T>): T | undefined {\n\treturn node.cache as T | undefined;\n}\n\n/**\n * Subscribe to DATA values from a Node. Protocol internals stay below the adapter boundary:\n * DATA drives value listeners, ERROR/COMPLETE route to optional lifecycle callbacks.\n */\nexport function subscribeNodeValues<T>(\n\tnode: Node<T>,\n\trun: (value: T | undefined) => void,\n\topts: SubscribeValuesOptions<T> = {},\n): () => void {\n\tconst read = opts.getSnapshot ?? (() => nodeSnapshot(node));\n\tif (opts.immediate) run(read());\n\n\tlet subscribing = true;\n\tconst skipSynchronousHandshakeData = opts.changesOnly || opts.immediate;\n\tconst sink: Sink = (msg, delivery?: DeliveryMeta) => {\n\t\tswitch (msg[0]) {\n\t\t\tcase \"DATA\":\n\t\t\t\tif (skipSynchronousHandshakeData && subscribing && delivery === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trun(msg[1] as T);\n\t\t\t\treturn;\n\t\t\tcase \"ERROR\":\n\t\t\t\topts.onError?.(msg[1]);\n\t\t\t\treturn;\n\t\t\tcase \"COMPLETE\":\n\t\t\t\topts.onComplete?.();\n\t\t\t\treturn;\n\t\t}\n\t};\n\tconst unsubscribe = node.subscribe(sink);\n\tsubscribing = false;\n\treturn unsubscribe;\n}\n\n/** Build a Svelte/Nanostores-style readable store from a clean-slate Node. */\nexport function readableStore<T>(\n\tnode: Node<T>,\n\topts: SubscribeValuesOptions<T> = {},\n): ReadableStore<T> {\n\treturn {\n\t\tget: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),\n\t\tsubscribe: (run) => subscribeNodeValues(node, run, { immediate: true, ...opts }),\n\t};\n}\n\nfunction hasWritableSet<T>(node: Node<T>): node is WritableNode<T> {\n\treturn typeof (node as { set?: unknown }).set === \"function\";\n}\n\nfunction defaultWrite<T>(node: WritableNode<T>, value: T): void {\n\tnode.set(value);\n}\n\n/** Build a writable store over a StateNode or compatible clean-slate writable Node. */\nexport function writableStore<T>(\n\tnode: WritableNode<T>,\n\topts?: WritableStoreOptions<T>,\n): WritableStore<T>;\nexport function writableStore<T>(\n\tnode: Node<T>,\n\topts: WritableStoreOptions<T> & { write: (node: WritableNode<T>, value: T) => void },\n): WritableStore<T>;\nexport function writableStore<T>(\n\tnode: Node<T>,\n\topts: WritableStoreOptions<T> = {},\n): WritableStore<T> {\n\tconst read = opts.getSnapshot ?? (() => nodeSnapshot(node));\n\tconst write = opts.write ?? (hasWritableSet(node) ? defaultWrite : undefined);\n\tif (!write) {\n\t\tthrow new TypeError(\"writableStore: node must expose set(value) or opts.write\");\n\t}\n\tconst writable = node as WritableNode<T>;\n\treturn {\n\t\tget: read,\n\t\tsubscribe: (run) => subscribeNodeValues(node, run, { immediate: true, ...opts }),\n\t\tset: (value) => write(writable, value),\n\t\tupdate: (fn) => write(writable, fn(read())),\n\t};\n}\n\n/** Build the tiny shape React's `useSyncExternalStore` expects, without importing React. */\nexport function externalStore<T>(\n\tnode: Node<T>,\n\topts: Pick<SubscribeValuesOptions<T>, \"getSnapshot\" | \"onError\" | \"onComplete\"> = {},\n): ExternalStore<T> {\n\tconst read = opts.getSnapshot ?? (() => nodeSnapshot(node));\n\treturn {\n\t\tgetSnapshot: read,\n\t\tgetServerSnapshot: read,\n\t\tsubscribe: (onStoreChange) =>\n\t\t\tsubscribeNodeValues(node, () => onStoreChange(), {\n\t\t\t\tchangesOnly: true,\n\t\t\t\tonError: opts.onError,\n\t\t\t\tonComplete: opts.onComplete,\n\t\t\t}),\n\t};\n}\n\n/** Build a framework-neutral keyed record store for focused framework record bindings. */\nexport function recordReadableStore<K extends string, R extends Record<string, unknown>>(\n\tkeysNode: Node<readonly K[]>,\n\tfactory: NodeRecordFactory<K, R>,\n\topts: SubscribeValuesOptions<Record<K, R>> = {},\n): ReadableStore<Record<K, R>> {\n\tconst read = () => {\n\t\tconst keys = keysNode.cache ?? [];\n\t\tconst out = {} as Record<K, R>;\n\t\tfor (const key of keys) {\n\t\t\tconst nodes = factory(key);\n\t\t\tconst values = {} as R;\n\t\t\tfor (const field of Object.keys(nodes) as Array<keyof R>) {\n\t\t\t\tvalues[field] = nodes[field].cache as R[keyof R];\n\t\t\t}\n\t\t\tout[key] = values;\n\t\t}\n\t\treturn out;\n\t};\n\n\treturn {\n\t\tget: read,\n\t\tsubscribe(run) {\n\t\t\tconst entryUnsubs: Array<() => void> = [];\n\t\t\tconst cleanupEntries = () => {\n\t\t\t\tfor (const unsub of entryUnsubs.splice(0)) unsub();\n\t\t\t};\n\t\t\tconst sync = () => {\n\t\t\t\tcleanupEntries();\n\t\t\t\tfor (const key of keysNode.cache ?? []) {\n\t\t\t\t\tconst nodes = factory(key);\n\t\t\t\t\tfor (const field of Object.keys(nodes) as Array<keyof R>) {\n\t\t\t\t\t\tentryUnsubs.push(\n\t\t\t\t\t\t\tsubscribeNodeValues(nodes[field], () => run(read()), {\n\t\t\t\t\t\t\t\tchangesOnly: true,\n\t\t\t\t\t\t\t\tonError: opts.onError,\n\t\t\t\t\t\t\t\tonComplete: opts.onComplete,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trun(read());\n\t\t\t};\n\t\t\tconst keysUnsub = subscribeNodeValues(keysNode, sync, {\n\t\t\t\tchangesOnly: true,\n\t\t\t\tonError: opts.onError,\n\t\t\t\tonComplete: opts.onComplete,\n\t\t\t});\n\t\t\tsync();\n\t\t\treturn () => {\n\t\t\t\tkeysUnsub();\n\t\t\t\tcleanupEntries();\n\t\t\t};\n\t\t},\n\t};\n}\n\n/** Build a Zustand-compatible StoreApi over a caller-owned clean-slate state node. */\nexport function zustandStore<T extends object>(\n\tnode: WritableNode<T>,\n\tinitialState?: T,\n\topts?: WritableStoreOptions<T>,\n): ZustandStoreApi<T>;\nexport function zustandStore<T extends object>(\n\tnode: Node<T>,\n\tinitialState: T | undefined,\n\topts: WritableStoreOptions<T> & { write: (node: WritableNode<T>, value: T) => void },\n): ZustandStoreApi<T>;\nexport function zustandStore<T extends object>(\n\tnode: Node<T>,\n\tinitialState: T = nodeSnapshot(node) as T,\n\topts: WritableStoreOptions<T> = {},\n): ZustandStoreApi<T> {\n\tconst listeners = new Set<() => void>();\n\tconst read = opts.getSnapshot ?? (() => nodeSnapshot(node));\n\tconst write = opts.write ?? (hasWritableSet(node) ? defaultWrite : undefined);\n\tif (!write) {\n\t\tthrow new TypeError(\"zustandStore: node must expose set(value) or opts.write\");\n\t}\n\tconst writable = node as WritableNode<T>;\n\tconst api: ZustandStoreApi<T> = {\n\t\tgetState: () => read() as T,\n\t\tsetState(partial, replace) {\n\t\t\tconst prev = api.getState();\n\t\t\tconst next = typeof partial === \"function\" ? partial(prev) : partial;\n\t\t\twrite(writable, replace ? (next as T) : ({ ...prev, ...next } as T));\n\t\t},\n\t\tgetInitialState: () => initialState,\n\t\tsubscribe(listener) {\n\t\t\tlet prev = api.getState();\n\t\t\tconst unsub = subscribeNodeValues(\n\t\t\t\tnode,\n\t\t\t\t() => {\n\t\t\t\t\tconst next = api.getState();\n\t\t\t\t\tlistener(next, prev);\n\t\t\t\t\tprev = next;\n\t\t\t\t},\n\t\t\t\t{ changesOnly: true, onError: opts.onError, onComplete: opts.onComplete },\n\t\t\t);\n\t\t\tlisteners.add(unsub);\n\t\t\treturn () => {\n\t\t\t\tif (!listeners.delete(unsub)) return;\n\t\t\t\tunsub();\n\t\t\t};\n\t\t},\n\t\tdestroy() {\n\t\t\tfor (const unsub of [...listeners]) {\n\t\t\t\tlisteners.delete(unsub);\n\t\t\t\tunsub();\n\t\t\t}\n\t\t},\n\t};\n\treturn api;\n}\n\n/** Build a Jotai-style atom facade over a caller-owned node. */\nexport function jotaiAtom<T>(\n\tnode: WritableNode<T>,\n\topts?: WritableStoreOptions<T>,\n): WritableJotaiAtom<T>;\nexport function jotaiAtom<T>(node: Node<T>, opts?: SubscribeValuesOptions<T>): JotaiAtom<T>;\nexport function jotaiAtom<T>(\n\tnode: Node<T> | WritableNode<T>,\n\topts: SubscribeValuesOptions<T> | WritableStoreOptions<T> = {},\n): JotaiAtom<T> | WritableJotaiAtom<T> {\n\tconst base: JotaiAtom<T> = {\n\t\tget: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),\n\t\tsubscribe: (callback) => subscribeNodeValues(node, callback, { changesOnly: true, ...opts }),\n\t\t_node: node,\n\t};\n\tif (hasWritableSet(node) || typeof (opts as WritableStoreOptions<T>).write === \"function\") {\n\t\tconst writable = writableStore(\n\t\t\tnode,\n\t\t\topts as WritableStoreOptions<T> & {\n\t\t\t\twrite: (node: WritableNode<T>, value: T) => void;\n\t\t\t},\n\t\t);\n\t\treturn { ...base, set: writable.set, update: writable.update };\n\t}\n\treturn base;\n}\n\n/** Build a Nanostores-style atom facade over a caller-owned node. */\nexport function nanoAtom<T>(\n\tnode: WritableNode<T>,\n\topts?: WritableStoreOptions<T>,\n): WritableNanoAtom<T>;\nexport function nanoAtom<T>(node: Node<T>, opts?: SubscribeValuesOptions<T>): NanoAtom<T>;\nexport function nanoAtom<T>(\n\tnode: Node<T> | WritableNode<T>,\n\topts: SubscribeValuesOptions<T> | WritableStoreOptions<T> = {},\n): NanoAtom<T> | WritableNanoAtom<T> {\n\tconst base: NanoAtom<T> = {\n\t\tget: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),\n\t\tsubscribe: (callback) => subscribeNodeValues(node, callback, { immediate: true, ...opts }),\n\t\tlisten: (callback) => subscribeNodeValues(node, callback, { changesOnly: true, ...opts }),\n\t\t_node: node,\n\t};\n\tif (hasWritableSet(node) || typeof (opts as WritableStoreOptions<T>).write === \"function\") {\n\t\tconst writable = writableStore(\n\t\t\tnode,\n\t\t\topts as WritableStoreOptions<T> & {\n\t\t\t\twrite: (node: WritableNode<T>, value: T) => void;\n\t\t\t},\n\t\t);\n\t\treturn { ...base, set: writable.set, update: writable.update };\n\t}\n\treturn base;\n}\n\n/** Build a TC39-Signals-style facade over a caller-owned node. */\nexport function signalFromNode<T>(\n\tnode: WritableNode<T>,\n\topts?: WritableStoreOptions<T>,\n): WritableSignalLike<T>;\nexport function signalFromNode<T>(node: Node<T>, opts?: SubscribeValuesOptions<T>): SignalLike<T>;\nexport function signalFromNode<T>(\n\tnode: Node<T> | WritableNode<T>,\n\topts: SubscribeValuesOptions<T> | WritableStoreOptions<T> = {},\n): SignalLike<T> | WritableSignalLike<T> {\n\tconst base: SignalLike<T> = {\n\t\tget: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),\n\t\tsubscribe: (callback) => subscribeNodeValues(node, callback, { changesOnly: true, ...opts }),\n\t\t_node: node,\n\t};\n\tif (hasWritableSet(node) || typeof (opts as WritableStoreOptions<T>).write === \"function\") {\n\t\tconst writable = writableStore(\n\t\t\tnode,\n\t\t\topts as WritableStoreOptions<T> & {\n\t\t\t\twrite: (node: WritableNode<T>, value: T) => void;\n\t\t\t},\n\t\t);\n\t\treturn { ...base, set: writable.set, update: writable.update };\n\t}\n\treturn base;\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,31 @@
1
+ import { Readable } from 'svelte/store';
2
+ import { N as Node } from '../types-BS6CyR-x.cjs';
3
+ import { W as WritableNode } from '../store-PAAsYvML.cjs';
4
+ import '../messages-CAzUPPJM.cjs';
5
+
6
+ /**
7
+ * Svelte node bindings for GraphReFly (D238).
8
+ *
9
+ * Svelte is imported only from this focused subpath.
10
+ */
11
+
12
+ /** A Svelte-readable store plus DATA-only write helpers. */
13
+ interface NodeWritable<T> extends Readable<T | undefined> {
14
+ set(value: T): void;
15
+ update(fn: (value: T | undefined) => T): void;
16
+ }
17
+ /** Read a GraphReFly node as a Svelte readable store. */
18
+ declare function nodeReadable<T>(node: Node<T>): Readable<T | undefined>;
19
+ /** Bind a writable GraphReFly node as a Svelte store. */
20
+ declare function nodeWritable<T>(node: WritableNode<T>): NodeWritable<T>;
21
+ /**
22
+ * Read a keyed record of nodes as a Svelte readable store.
23
+ *
24
+ * `factory` must have stable identity. Recreating it during component churn
25
+ * rebuilds the record subscriptions.
26
+ */
27
+ declare function nodeRecord<K extends string, R extends Record<string, unknown>>(keysNode: Node<readonly K[]>, factory: (key: K) => {
28
+ [P in keyof R]: Node<R[P]>;
29
+ }): Readable<Record<K, R>>;
30
+
31
+ export { type NodeWritable, nodeReadable, nodeRecord, nodeWritable };
@@ -0,0 +1,31 @@
1
+ import { Readable } from 'svelte/store';
2
+ import { N as Node } from '../types-C9NOgNJw.js';
3
+ import { W as WritableNode } from '../store-BmtEs9mG.js';
4
+ import '../messages-CAzUPPJM.js';
5
+
6
+ /**
7
+ * Svelte node bindings for GraphReFly (D238).
8
+ *
9
+ * Svelte is imported only from this focused subpath.
10
+ */
11
+
12
+ /** A Svelte-readable store plus DATA-only write helpers. */
13
+ interface NodeWritable<T> extends Readable<T | undefined> {
14
+ set(value: T): void;
15
+ update(fn: (value: T | undefined) => T): void;
16
+ }
17
+ /** Read a GraphReFly node as a Svelte readable store. */
18
+ declare function nodeReadable<T>(node: Node<T>): Readable<T | undefined>;
19
+ /** Bind a writable GraphReFly node as a Svelte store. */
20
+ declare function nodeWritable<T>(node: WritableNode<T>): NodeWritable<T>;
21
+ /**
22
+ * Read a keyed record of nodes as a Svelte readable store.
23
+ *
24
+ * `factory` must have stable identity. Recreating it during component churn
25
+ * rebuilds the record subscriptions.
26
+ */
27
+ declare function nodeRecord<K extends string, R extends Record<string, unknown>>(keysNode: Node<readonly K[]>, factory: (key: K) => {
28
+ [P in keyof R]: Node<R[P]>;
29
+ }): Readable<Record<K, R>>;
30
+
31
+ export { type NodeWritable, nodeReadable, nodeRecord, nodeWritable };
@@ -0,0 +1,46 @@
1
+ import {
2
+ nodeSnapshot,
3
+ recordReadableStore,
4
+ subscribeNodeValues
5
+ } from "../chunk-L6LDXRWE.js";
6
+ import "../chunk-DGUM43GV.js";
7
+
8
+ // src/adapters/svelte.ts
9
+ import { readable } from "svelte/store";
10
+ function nodeReadable(node) {
11
+ return readable(
12
+ nodeSnapshot(node),
13
+ (set) => subscribeNodeValues(node, set, { immediate: true })
14
+ );
15
+ }
16
+ function assertDataValue(value) {
17
+ if (value === void 0) {
18
+ throw new TypeError("nodeWritable: undefined is SENTINEL/no DATA, not a writable DATA value");
19
+ }
20
+ }
21
+ function nodeWritable(node) {
22
+ const store = nodeReadable(node);
23
+ return {
24
+ subscribe: store.subscribe,
25
+ set(value) {
26
+ assertDataValue(value);
27
+ node.set(value);
28
+ },
29
+ update(fn) {
30
+ const next = fn(nodeSnapshot(node));
31
+ assertDataValue(next);
32
+ node.set(next);
33
+ }
34
+ };
35
+ }
36
+ function nodeRecord(keysNode, factory) {
37
+ const store = recordReadableStore(keysNode, factory);
38
+ const read = () => store.get() ?? {};
39
+ return readable(read(), (set) => store.subscribe((value) => set(value ?? {})));
40
+ }
41
+ export {
42
+ nodeReadable,
43
+ nodeRecord,
44
+ nodeWritable
45
+ };
46
+ //# sourceMappingURL=svelte.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/svelte.ts"],"sourcesContent":["/**\n * Svelte node bindings for GraphReFly (D238).\n *\n * Svelte is imported only from this focused subpath.\n */\n\nimport { type Readable, readable } from \"svelte/store\";\nimport type { Node } from \"../node/node.js\";\nimport {\n\tnodeSnapshot,\n\trecordReadableStore,\n\tsubscribeNodeValues,\n\ttype WritableNode,\n} from \"./store.js\";\n\n/** A Svelte-readable store plus DATA-only write helpers. */\nexport interface NodeWritable<T> extends Readable<T | undefined> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\n/** Read a GraphReFly node as a Svelte readable store. */\nexport function nodeReadable<T>(node: Node<T>): Readable<T | undefined> {\n\treturn readable<T | undefined>(nodeSnapshot(node), (set) =>\n\t\tsubscribeNodeValues(node, set, { immediate: true }),\n\t);\n}\n\nfunction assertDataValue(value: unknown): void {\n\tif (value === undefined) {\n\t\tthrow new TypeError(\"nodeWritable: undefined is SENTINEL/no DATA, not a writable DATA value\");\n\t}\n}\n\n/** Bind a writable GraphReFly node as a Svelte store. */\nexport function nodeWritable<T>(node: WritableNode<T>): NodeWritable<T> {\n\tconst store = nodeReadable(node);\n\treturn {\n\t\tsubscribe: store.subscribe,\n\t\tset(value) {\n\t\t\tassertDataValue(value);\n\t\t\tnode.set(value);\n\t\t},\n\t\tupdate(fn) {\n\t\t\tconst next = fn(nodeSnapshot(node));\n\t\t\tassertDataValue(next);\n\t\t\tnode.set(next);\n\t\t},\n\t};\n}\n\n/**\n * Read a keyed record of nodes as a Svelte readable store.\n *\n * `factory` must have stable identity. Recreating it during component churn\n * rebuilds the record subscriptions.\n */\nexport function nodeRecord<K extends string, R extends Record<string, unknown>>(\n\tkeysNode: Node<readonly K[]>,\n\tfactory: (key: K) => { [P in keyof R]: Node<R[P]> },\n): Readable<Record<K, R>> {\n\tconst store = recordReadableStore(keysNode, factory);\n\tconst read = () => store.get() ?? ({} as Record<K, R>);\n\treturn readable(read(), (set) => store.subscribe((value) => set(value ?? ({} as Record<K, R>))));\n}\n"],"mappings":";;;;;;;;AAMA,SAAwB,gBAAgB;AAgBjC,SAAS,aAAgB,MAAwC;AACvE,SAAO;AAAA,IAAwB,aAAa,IAAI;AAAA,IAAG,CAAC,QACnD,oBAAoB,MAAM,KAAK,EAAE,WAAW,KAAK,CAAC;AAAA,EACnD;AACD;AAEA,SAAS,gBAAgB,OAAsB;AAC9C,MAAI,UAAU,QAAW;AACxB,UAAM,IAAI,UAAU,wEAAwE;AAAA,EAC7F;AACD;AAGO,SAAS,aAAgB,MAAwC;AACvE,QAAM,QAAQ,aAAa,IAAI;AAC/B,SAAO;AAAA,IACN,WAAW,MAAM;AAAA,IACjB,IAAI,OAAO;AACV,sBAAgB,KAAK;AACrB,WAAK,IAAI,KAAK;AAAA,IACf;AAAA,IACA,OAAO,IAAI;AACV,YAAM,OAAO,GAAG,aAAa,IAAI,CAAC;AAClC,sBAAgB,IAAI;AACpB,WAAK,IAAI,IAAI;AAAA,IACd;AAAA,EACD;AACD;AAQO,SAAS,WACf,UACA,SACyB;AACzB,QAAM,QAAQ,oBAAoB,UAAU,OAAO;AACnD,QAAM,OAAO,MAAM,MAAM,IAAI,KAAM,CAAC;AACpC,SAAO,SAAS,KAAK,GAAG,CAAC,QAAQ,MAAM,UAAU,CAAC,UAAU,IAAI,SAAU,CAAC,CAAkB,CAAC,CAAC;AAChG;","names":[]}
@@ -0,0 +1,155 @@
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 __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/adapters/vue.ts
21
+ var vue_exports = {};
22
+ __export(vue_exports, {
23
+ useNodeInput: () => useNodeInput,
24
+ useNodeRecord: () => useNodeRecord,
25
+ useNodeValue: () => useNodeValue
26
+ });
27
+ module.exports = __toCommonJS(vue_exports);
28
+ var import_vue = require("vue");
29
+
30
+ // src/adapters/store.ts
31
+ function nodeSnapshot(node) {
32
+ return node.cache;
33
+ }
34
+ function subscribeNodeValues(node, run, opts = {}) {
35
+ const read = opts.getSnapshot ?? (() => nodeSnapshot(node));
36
+ if (opts.immediate) run(read());
37
+ let subscribing = true;
38
+ const skipSynchronousHandshakeData = opts.changesOnly || opts.immediate;
39
+ const sink = (msg, delivery) => {
40
+ switch (msg[0]) {
41
+ case "DATA":
42
+ if (skipSynchronousHandshakeData && subscribing && delivery === void 0) {
43
+ return;
44
+ }
45
+ run(msg[1]);
46
+ return;
47
+ case "ERROR":
48
+ opts.onError?.(msg[1]);
49
+ return;
50
+ case "COMPLETE":
51
+ opts.onComplete?.();
52
+ return;
53
+ }
54
+ };
55
+ const unsubscribe = node.subscribe(sink);
56
+ subscribing = false;
57
+ return unsubscribe;
58
+ }
59
+ function readableStore(node, opts = {}) {
60
+ return {
61
+ get: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),
62
+ subscribe: (run) => subscribeNodeValues(node, run, { immediate: true, ...opts })
63
+ };
64
+ }
65
+ function recordReadableStore(keysNode, factory, opts = {}) {
66
+ const read = () => {
67
+ const keys = keysNode.cache ?? [];
68
+ const out = {};
69
+ for (const key of keys) {
70
+ const nodes = factory(key);
71
+ const values = {};
72
+ for (const field of Object.keys(nodes)) {
73
+ values[field] = nodes[field].cache;
74
+ }
75
+ out[key] = values;
76
+ }
77
+ return out;
78
+ };
79
+ return {
80
+ get: read,
81
+ subscribe(run) {
82
+ const entryUnsubs = [];
83
+ const cleanupEntries = () => {
84
+ for (const unsub of entryUnsubs.splice(0)) unsub();
85
+ };
86
+ const sync = () => {
87
+ cleanupEntries();
88
+ for (const key of keysNode.cache ?? []) {
89
+ const nodes = factory(key);
90
+ for (const field of Object.keys(nodes)) {
91
+ entryUnsubs.push(
92
+ subscribeNodeValues(nodes[field], () => run(read()), {
93
+ changesOnly: true,
94
+ onError: opts.onError,
95
+ onComplete: opts.onComplete
96
+ })
97
+ );
98
+ }
99
+ }
100
+ run(read());
101
+ };
102
+ const keysUnsub = subscribeNodeValues(keysNode, sync, {
103
+ changesOnly: true,
104
+ onError: opts.onError,
105
+ onComplete: opts.onComplete
106
+ });
107
+ sync();
108
+ return () => {
109
+ keysUnsub();
110
+ cleanupEntries();
111
+ };
112
+ }
113
+ };
114
+ }
115
+
116
+ // src/adapters/vue.ts
117
+ function assertDataValue(value) {
118
+ if (value === void 0) {
119
+ throw new TypeError("useNodeInput: undefined is SENTINEL/no DATA, not a writable DATA value");
120
+ }
121
+ }
122
+ function bindReadable(store) {
123
+ const value = (0, import_vue.shallowRef)(store.get());
124
+ const unsubscribe = store.subscribe((next) => {
125
+ value.value = next;
126
+ });
127
+ (0, import_vue.onScopeDispose)(unsubscribe);
128
+ return (0, import_vue.readonly)(value);
129
+ }
130
+ function useNodeValue(node) {
131
+ return bindReadable(readableStore(node));
132
+ }
133
+ function useNodeInput(node) {
134
+ return [
135
+ useNodeValue(node),
136
+ (value) => {
137
+ assertDataValue(value);
138
+ node.set(value);
139
+ }
140
+ ];
141
+ }
142
+ function useNodeRecord(keysNode, factory) {
143
+ const store = recordReadableStore(keysNode, factory);
144
+ return bindReadable({
145
+ get: () => store.get() ?? {},
146
+ subscribe: (run) => store.subscribe((value) => run(value ?? {}))
147
+ });
148
+ }
149
+ // Annotate the CommonJS export names for ESM import in node:
150
+ 0 && (module.exports = {
151
+ useNodeInput,
152
+ useNodeRecord,
153
+ useNodeValue
154
+ });
155
+ //# sourceMappingURL=vue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/vue.ts","../../src/adapters/store.ts"],"sourcesContent":["/**\n * Vue node bindings for GraphReFly (D238).\n *\n * Vue is imported only from this focused subpath.\n */\n\nimport { onScopeDispose, readonly, type ShallowRef, shallowRef } from \"vue\";\nimport type { Node } from \"../node/node.js\";\nimport { readableStore, recordReadableStore, type WritableNode } from \"./store.js\";\n\nfunction assertDataValue(value: unknown): void {\n\tif (value === undefined) {\n\t\tthrow new TypeError(\"useNodeInput: undefined is SENTINEL/no DATA, not a writable DATA value\");\n\t}\n}\n\nfunction bindReadable<T>(store: { get(): T; subscribe(run: (value: T) => void): () => void }) {\n\tconst value = shallowRef(store.get()) as ShallowRef<T>;\n\tconst unsubscribe = store.subscribe((next) => {\n\t\tvalue.value = next;\n\t});\n\tonScopeDispose(unsubscribe);\n\treturn readonly(value) as Readonly<ShallowRef<T>>;\n}\n\n/** Read a GraphReFly node as a Vue shallow ref. */\nexport function useNodeValue<T>(node: Node<T>): Readonly<ShallowRef<T | undefined>> {\n\treturn bindReadable(readableStore(node));\n}\n\n/** Bind a writable GraphReFly node as `[valueRef, setValue]`. */\nexport function useNodeInput<T>(\n\tnode: WritableNode<T>,\n): readonly [Readonly<ShallowRef<T | undefined>>, (value: T) => void] {\n\treturn [\n\t\tuseNodeValue(node),\n\t\t(value: T) => {\n\t\t\tassertDataValue(value);\n\t\t\tnode.set(value);\n\t\t},\n\t] as const;\n}\n\n/**\n * Read a keyed record of nodes as a Vue shallow ref.\n *\n * `factory` must have stable identity; callers should define it outside render\n * churn or memoize it in their composition function.\n */\nexport function useNodeRecord<K extends string, R extends Record<string, unknown>>(\n\tkeysNode: Node<readonly K[]>,\n\tfactory: (key: K) => { [P in keyof R]: Node<R[P]> },\n): Readonly<ShallowRef<Record<K, R>>> {\n\tconst store = recordReadableStore(keysNode, factory);\n\treturn bindReadable({\n\t\tget: () => store.get() ?? ({} as Record<K, R>),\n\t\tsubscribe: (run) => store.subscribe((value) => run(value ?? ({} as Record<K, R>))),\n\t});\n}\n","/**\n * Framework-neutral store adapters.\n *\n * Focused framework bindings build on this tiny Node-facing layer without\n * importing framework packages into the dependency-free adapters barrel\n * (D125/D238).\n */\n\nimport type { DeliveryMeta, Sink } from \"../ctx/types.js\";\nimport type { Node } from \"../node/node.js\";\n\n/** A minimal readable store contract shared by Svelte/Nanostores-style adapters. */\nexport interface ReadableStore<T> {\n\tget(): T | undefined;\n\tsubscribe(run: (value: T | undefined) => void): () => void;\n}\n\n/** A minimal writable store contract over a clean-slate writable node. */\nexport interface WritableStore<T> extends ReadableStore<T> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\n/** React `useSyncExternalStore`-compatible shape, without importing React. */\nexport interface ExternalStore<T> {\n\tgetSnapshot(): T | undefined;\n\tgetServerSnapshot(): T | undefined;\n\tsubscribe(onStoreChange: () => void): () => void;\n}\n\n/** Object-of-nodes factory used by record subscription adapters. */\nexport type NodeRecordFactory<K extends string, R extends Record<string, unknown>> = (key: K) => {\n\t[P in keyof R]: Node<R[P]>;\n};\n\n/** Zustand-compatible store API over a caller-owned clean-slate state node. */\nexport interface ZustandStoreApi<T extends object> {\n\tgetState(): T;\n\tsetState(partial: T | Partial<T> | ((state: T) => T | Partial<T>), replace?: boolean): void;\n\tgetInitialState(): T;\n\tsubscribe(listener: (state: T, prevState: T) => void): () => void;\n\tdestroy(): void;\n}\n\n/** Jotai-style atom facade over a caller-owned node. */\nexport interface JotaiAtom<T> {\n\tget(): T | undefined;\n\tsubscribe(callback: (value: T | undefined) => void): () => void;\n\treadonly _node: Node<T>;\n}\n\n/** Writable Jotai-style atom facade over a caller-owned writable node. */\nexport interface WritableJotaiAtom<T> extends JotaiAtom<T> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\n/** Nanostores-style atom facade over a caller-owned node. */\nexport interface NanoAtom<T> {\n\tget(): T | undefined;\n\tsubscribe(callback: (value: T | undefined) => void): () => void;\n\tlisten(callback: (value: T | undefined) => void): () => void;\n\treadonly _node: Node<T>;\n}\n\n/** Writable Nanostores-style atom facade over a caller-owned writable node. */\nexport interface WritableNanoAtom<T> extends NanoAtom<T> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\n/** TC39-Signals-style facade over a caller-owned node. */\nexport interface SignalLike<T> {\n\tget(): T | undefined;\n\tsubscribe(callback: (value: T | undefined) => void): () => void;\n\treadonly _node: Node<T>;\n}\n\n/** Writable TC39-Signals-style facade over a caller-owned writable node. */\nexport interface WritableSignalLike<T> extends SignalLike<T> {\n\tset(value: T): void;\n\tupdate(fn: (value: T | undefined) => T): void;\n}\n\nexport interface SubscribeValuesOptions<T> {\n\t/** Emit the current cache snapshot immediately. `undefined` means SENTINEL/no DATA. */\n\timmediate?: boolean;\n\t/** Suppress synchronous push-on-subscribe/replay DATA. Useful for change-only store listeners. */\n\tchangesOnly?: boolean;\n\tonError?: (error: unknown) => void;\n\tonComplete?: () => void;\n\t/** Custom cache reader for wrappers that keep their own snapshot object. */\n\tgetSnapshot?: () => T | undefined;\n}\n\nexport interface WritableNode<T> extends Node<T> {\n\tset(value: T): void;\n}\n\nexport interface WritableStoreOptions<T> extends SubscribeValuesOptions<T> {\n\t/** Override writes for adapters that need a framework-owned reducer. */\n\twrite?: (node: WritableNode<T>, value: T) => void;\n}\n\n/** Read a node cache without activating it. */\nexport function nodeSnapshot<T>(node: Node<T>): T | undefined {\n\treturn node.cache as T | undefined;\n}\n\n/**\n * Subscribe to DATA values from a Node. Protocol internals stay below the adapter boundary:\n * DATA drives value listeners, ERROR/COMPLETE route to optional lifecycle callbacks.\n */\nexport function subscribeNodeValues<T>(\n\tnode: Node<T>,\n\trun: (value: T | undefined) => void,\n\topts: SubscribeValuesOptions<T> = {},\n): () => void {\n\tconst read = opts.getSnapshot ?? (() => nodeSnapshot(node));\n\tif (opts.immediate) run(read());\n\n\tlet subscribing = true;\n\tconst skipSynchronousHandshakeData = opts.changesOnly || opts.immediate;\n\tconst sink: Sink = (msg, delivery?: DeliveryMeta) => {\n\t\tswitch (msg[0]) {\n\t\t\tcase \"DATA\":\n\t\t\t\tif (skipSynchronousHandshakeData && subscribing && delivery === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trun(msg[1] as T);\n\t\t\t\treturn;\n\t\t\tcase \"ERROR\":\n\t\t\t\topts.onError?.(msg[1]);\n\t\t\t\treturn;\n\t\t\tcase \"COMPLETE\":\n\t\t\t\topts.onComplete?.();\n\t\t\t\treturn;\n\t\t}\n\t};\n\tconst unsubscribe = node.subscribe(sink);\n\tsubscribing = false;\n\treturn unsubscribe;\n}\n\n/** Build a Svelte/Nanostores-style readable store from a clean-slate Node. */\nexport function readableStore<T>(\n\tnode: Node<T>,\n\topts: SubscribeValuesOptions<T> = {},\n): ReadableStore<T> {\n\treturn {\n\t\tget: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),\n\t\tsubscribe: (run) => subscribeNodeValues(node, run, { immediate: true, ...opts }),\n\t};\n}\n\nfunction hasWritableSet<T>(node: Node<T>): node is WritableNode<T> {\n\treturn typeof (node as { set?: unknown }).set === \"function\";\n}\n\nfunction defaultWrite<T>(node: WritableNode<T>, value: T): void {\n\tnode.set(value);\n}\n\n/** Build a writable store over a StateNode or compatible clean-slate writable Node. */\nexport function writableStore<T>(\n\tnode: WritableNode<T>,\n\topts?: WritableStoreOptions<T>,\n): WritableStore<T>;\nexport function writableStore<T>(\n\tnode: Node<T>,\n\topts: WritableStoreOptions<T> & { write: (node: WritableNode<T>, value: T) => void },\n): WritableStore<T>;\nexport function writableStore<T>(\n\tnode: Node<T>,\n\topts: WritableStoreOptions<T> = {},\n): WritableStore<T> {\n\tconst read = opts.getSnapshot ?? (() => nodeSnapshot(node));\n\tconst write = opts.write ?? (hasWritableSet(node) ? defaultWrite : undefined);\n\tif (!write) {\n\t\tthrow new TypeError(\"writableStore: node must expose set(value) or opts.write\");\n\t}\n\tconst writable = node as WritableNode<T>;\n\treturn {\n\t\tget: read,\n\t\tsubscribe: (run) => subscribeNodeValues(node, run, { immediate: true, ...opts }),\n\t\tset: (value) => write(writable, value),\n\t\tupdate: (fn) => write(writable, fn(read())),\n\t};\n}\n\n/** Build the tiny shape React's `useSyncExternalStore` expects, without importing React. */\nexport function externalStore<T>(\n\tnode: Node<T>,\n\topts: Pick<SubscribeValuesOptions<T>, \"getSnapshot\" | \"onError\" | \"onComplete\"> = {},\n): ExternalStore<T> {\n\tconst read = opts.getSnapshot ?? (() => nodeSnapshot(node));\n\treturn {\n\t\tgetSnapshot: read,\n\t\tgetServerSnapshot: read,\n\t\tsubscribe: (onStoreChange) =>\n\t\t\tsubscribeNodeValues(node, () => onStoreChange(), {\n\t\t\t\tchangesOnly: true,\n\t\t\t\tonError: opts.onError,\n\t\t\t\tonComplete: opts.onComplete,\n\t\t\t}),\n\t};\n}\n\n/** Build a framework-neutral keyed record store for focused framework record bindings. */\nexport function recordReadableStore<K extends string, R extends Record<string, unknown>>(\n\tkeysNode: Node<readonly K[]>,\n\tfactory: NodeRecordFactory<K, R>,\n\topts: SubscribeValuesOptions<Record<K, R>> = {},\n): ReadableStore<Record<K, R>> {\n\tconst read = () => {\n\t\tconst keys = keysNode.cache ?? [];\n\t\tconst out = {} as Record<K, R>;\n\t\tfor (const key of keys) {\n\t\t\tconst nodes = factory(key);\n\t\t\tconst values = {} as R;\n\t\t\tfor (const field of Object.keys(nodes) as Array<keyof R>) {\n\t\t\t\tvalues[field] = nodes[field].cache as R[keyof R];\n\t\t\t}\n\t\t\tout[key] = values;\n\t\t}\n\t\treturn out;\n\t};\n\n\treturn {\n\t\tget: read,\n\t\tsubscribe(run) {\n\t\t\tconst entryUnsubs: Array<() => void> = [];\n\t\t\tconst cleanupEntries = () => {\n\t\t\t\tfor (const unsub of entryUnsubs.splice(0)) unsub();\n\t\t\t};\n\t\t\tconst sync = () => {\n\t\t\t\tcleanupEntries();\n\t\t\t\tfor (const key of keysNode.cache ?? []) {\n\t\t\t\t\tconst nodes = factory(key);\n\t\t\t\t\tfor (const field of Object.keys(nodes) as Array<keyof R>) {\n\t\t\t\t\t\tentryUnsubs.push(\n\t\t\t\t\t\t\tsubscribeNodeValues(nodes[field], () => run(read()), {\n\t\t\t\t\t\t\t\tchangesOnly: true,\n\t\t\t\t\t\t\t\tonError: opts.onError,\n\t\t\t\t\t\t\t\tonComplete: opts.onComplete,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trun(read());\n\t\t\t};\n\t\t\tconst keysUnsub = subscribeNodeValues(keysNode, sync, {\n\t\t\t\tchangesOnly: true,\n\t\t\t\tonError: opts.onError,\n\t\t\t\tonComplete: opts.onComplete,\n\t\t\t});\n\t\t\tsync();\n\t\t\treturn () => {\n\t\t\t\tkeysUnsub();\n\t\t\t\tcleanupEntries();\n\t\t\t};\n\t\t},\n\t};\n}\n\n/** Build a Zustand-compatible StoreApi over a caller-owned clean-slate state node. */\nexport function zustandStore<T extends object>(\n\tnode: WritableNode<T>,\n\tinitialState?: T,\n\topts?: WritableStoreOptions<T>,\n): ZustandStoreApi<T>;\nexport function zustandStore<T extends object>(\n\tnode: Node<T>,\n\tinitialState: T | undefined,\n\topts: WritableStoreOptions<T> & { write: (node: WritableNode<T>, value: T) => void },\n): ZustandStoreApi<T>;\nexport function zustandStore<T extends object>(\n\tnode: Node<T>,\n\tinitialState: T = nodeSnapshot(node) as T,\n\topts: WritableStoreOptions<T> = {},\n): ZustandStoreApi<T> {\n\tconst listeners = new Set<() => void>();\n\tconst read = opts.getSnapshot ?? (() => nodeSnapshot(node));\n\tconst write = opts.write ?? (hasWritableSet(node) ? defaultWrite : undefined);\n\tif (!write) {\n\t\tthrow new TypeError(\"zustandStore: node must expose set(value) or opts.write\");\n\t}\n\tconst writable = node as WritableNode<T>;\n\tconst api: ZustandStoreApi<T> = {\n\t\tgetState: () => read() as T,\n\t\tsetState(partial, replace) {\n\t\t\tconst prev = api.getState();\n\t\t\tconst next = typeof partial === \"function\" ? partial(prev) : partial;\n\t\t\twrite(writable, replace ? (next as T) : ({ ...prev, ...next } as T));\n\t\t},\n\t\tgetInitialState: () => initialState,\n\t\tsubscribe(listener) {\n\t\t\tlet prev = api.getState();\n\t\t\tconst unsub = subscribeNodeValues(\n\t\t\t\tnode,\n\t\t\t\t() => {\n\t\t\t\t\tconst next = api.getState();\n\t\t\t\t\tlistener(next, prev);\n\t\t\t\t\tprev = next;\n\t\t\t\t},\n\t\t\t\t{ changesOnly: true, onError: opts.onError, onComplete: opts.onComplete },\n\t\t\t);\n\t\t\tlisteners.add(unsub);\n\t\t\treturn () => {\n\t\t\t\tif (!listeners.delete(unsub)) return;\n\t\t\t\tunsub();\n\t\t\t};\n\t\t},\n\t\tdestroy() {\n\t\t\tfor (const unsub of [...listeners]) {\n\t\t\t\tlisteners.delete(unsub);\n\t\t\t\tunsub();\n\t\t\t}\n\t\t},\n\t};\n\treturn api;\n}\n\n/** Build a Jotai-style atom facade over a caller-owned node. */\nexport function jotaiAtom<T>(\n\tnode: WritableNode<T>,\n\topts?: WritableStoreOptions<T>,\n): WritableJotaiAtom<T>;\nexport function jotaiAtom<T>(node: Node<T>, opts?: SubscribeValuesOptions<T>): JotaiAtom<T>;\nexport function jotaiAtom<T>(\n\tnode: Node<T> | WritableNode<T>,\n\topts: SubscribeValuesOptions<T> | WritableStoreOptions<T> = {},\n): JotaiAtom<T> | WritableJotaiAtom<T> {\n\tconst base: JotaiAtom<T> = {\n\t\tget: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),\n\t\tsubscribe: (callback) => subscribeNodeValues(node, callback, { changesOnly: true, ...opts }),\n\t\t_node: node,\n\t};\n\tif (hasWritableSet(node) || typeof (opts as WritableStoreOptions<T>).write === \"function\") {\n\t\tconst writable = writableStore(\n\t\t\tnode,\n\t\t\topts as WritableStoreOptions<T> & {\n\t\t\t\twrite: (node: WritableNode<T>, value: T) => void;\n\t\t\t},\n\t\t);\n\t\treturn { ...base, set: writable.set, update: writable.update };\n\t}\n\treturn base;\n}\n\n/** Build a Nanostores-style atom facade over a caller-owned node. */\nexport function nanoAtom<T>(\n\tnode: WritableNode<T>,\n\topts?: WritableStoreOptions<T>,\n): WritableNanoAtom<T>;\nexport function nanoAtom<T>(node: Node<T>, opts?: SubscribeValuesOptions<T>): NanoAtom<T>;\nexport function nanoAtom<T>(\n\tnode: Node<T> | WritableNode<T>,\n\topts: SubscribeValuesOptions<T> | WritableStoreOptions<T> = {},\n): NanoAtom<T> | WritableNanoAtom<T> {\n\tconst base: NanoAtom<T> = {\n\t\tget: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),\n\t\tsubscribe: (callback) => subscribeNodeValues(node, callback, { immediate: true, ...opts }),\n\t\tlisten: (callback) => subscribeNodeValues(node, callback, { changesOnly: true, ...opts }),\n\t\t_node: node,\n\t};\n\tif (hasWritableSet(node) || typeof (opts as WritableStoreOptions<T>).write === \"function\") {\n\t\tconst writable = writableStore(\n\t\t\tnode,\n\t\t\topts as WritableStoreOptions<T> & {\n\t\t\t\twrite: (node: WritableNode<T>, value: T) => void;\n\t\t\t},\n\t\t);\n\t\treturn { ...base, set: writable.set, update: writable.update };\n\t}\n\treturn base;\n}\n\n/** Build a TC39-Signals-style facade over a caller-owned node. */\nexport function signalFromNode<T>(\n\tnode: WritableNode<T>,\n\topts?: WritableStoreOptions<T>,\n): WritableSignalLike<T>;\nexport function signalFromNode<T>(node: Node<T>, opts?: SubscribeValuesOptions<T>): SignalLike<T>;\nexport function signalFromNode<T>(\n\tnode: Node<T> | WritableNode<T>,\n\topts: SubscribeValuesOptions<T> | WritableStoreOptions<T> = {},\n): SignalLike<T> | WritableSignalLike<T> {\n\tconst base: SignalLike<T> = {\n\t\tget: () => (opts.getSnapshot ?? (() => nodeSnapshot(node)))(),\n\t\tsubscribe: (callback) => subscribeNodeValues(node, callback, { changesOnly: true, ...opts }),\n\t\t_node: node,\n\t};\n\tif (hasWritableSet(node) || typeof (opts as WritableStoreOptions<T>).write === \"function\") {\n\t\tconst writable = writableStore(\n\t\t\tnode,\n\t\t\topts as WritableStoreOptions<T> & {\n\t\t\t\twrite: (node: WritableNode<T>, value: T) => void;\n\t\t\t},\n\t\t);\n\t\treturn { ...base, set: writable.set, update: writable.update };\n\t}\n\treturn base;\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,26 @@
1
+ import { ShallowRef } from 'vue';
2
+ import { N as Node } from '../types-BS6CyR-x.cjs';
3
+ import { W as WritableNode } from '../store-PAAsYvML.cjs';
4
+ import '../messages-CAzUPPJM.cjs';
5
+
6
+ /**
7
+ * Vue node bindings for GraphReFly (D238).
8
+ *
9
+ * Vue is imported only from this focused subpath.
10
+ */
11
+
12
+ /** Read a GraphReFly node as a Vue shallow ref. */
13
+ declare function useNodeValue<T>(node: Node<T>): Readonly<ShallowRef<T | undefined>>;
14
+ /** Bind a writable GraphReFly node as `[valueRef, setValue]`. */
15
+ declare function useNodeInput<T>(node: WritableNode<T>): readonly [Readonly<ShallowRef<T | undefined>>, (value: T) => void];
16
+ /**
17
+ * Read a keyed record of nodes as a Vue shallow ref.
18
+ *
19
+ * `factory` must have stable identity; callers should define it outside render
20
+ * churn or memoize it in their composition function.
21
+ */
22
+ declare function useNodeRecord<K extends string, R extends Record<string, unknown>>(keysNode: Node<readonly K[]>, factory: (key: K) => {
23
+ [P in keyof R]: Node<R[P]>;
24
+ }): Readonly<ShallowRef<Record<K, R>>>;
25
+
26
+ export { useNodeInput, useNodeRecord, useNodeValue };
@@ -0,0 +1,26 @@
1
+ import { ShallowRef } from 'vue';
2
+ import { N as Node } from '../types-C9NOgNJw.js';
3
+ import { W as WritableNode } from '../store-BmtEs9mG.js';
4
+ import '../messages-CAzUPPJM.js';
5
+
6
+ /**
7
+ * Vue node bindings for GraphReFly (D238).
8
+ *
9
+ * Vue is imported only from this focused subpath.
10
+ */
11
+
12
+ /** Read a GraphReFly node as a Vue shallow ref. */
13
+ declare function useNodeValue<T>(node: Node<T>): Readonly<ShallowRef<T | undefined>>;
14
+ /** Bind a writable GraphReFly node as `[valueRef, setValue]`. */
15
+ declare function useNodeInput<T>(node: WritableNode<T>): readonly [Readonly<ShallowRef<T | undefined>>, (value: T) => void];
16
+ /**
17
+ * Read a keyed record of nodes as a Vue shallow ref.
18
+ *
19
+ * `factory` must have stable identity; callers should define it outside render
20
+ * churn or memoize it in their composition function.
21
+ */
22
+ declare function useNodeRecord<K extends string, R extends Record<string, unknown>>(keysNode: Node<readonly K[]>, factory: (key: K) => {
23
+ [P in keyof R]: Node<R[P]>;
24
+ }): Readonly<ShallowRef<Record<K, R>>>;
25
+
26
+ export { useNodeInput, useNodeRecord, useNodeValue };
@@ -0,0 +1,46 @@
1
+ import {
2
+ readableStore,
3
+ recordReadableStore
4
+ } from "../chunk-L6LDXRWE.js";
5
+ import "../chunk-DGUM43GV.js";
6
+
7
+ // src/adapters/vue.ts
8
+ import { onScopeDispose, readonly, shallowRef } from "vue";
9
+ function assertDataValue(value) {
10
+ if (value === void 0) {
11
+ throw new TypeError("useNodeInput: undefined is SENTINEL/no DATA, not a writable DATA value");
12
+ }
13
+ }
14
+ function bindReadable(store) {
15
+ const value = shallowRef(store.get());
16
+ const unsubscribe = store.subscribe((next) => {
17
+ value.value = next;
18
+ });
19
+ onScopeDispose(unsubscribe);
20
+ return readonly(value);
21
+ }
22
+ function useNodeValue(node) {
23
+ return bindReadable(readableStore(node));
24
+ }
25
+ function useNodeInput(node) {
26
+ return [
27
+ useNodeValue(node),
28
+ (value) => {
29
+ assertDataValue(value);
30
+ node.set(value);
31
+ }
32
+ ];
33
+ }
34
+ function useNodeRecord(keysNode, factory) {
35
+ const store = recordReadableStore(keysNode, factory);
36
+ return bindReadable({
37
+ get: () => store.get() ?? {},
38
+ subscribe: (run) => store.subscribe((value) => run(value ?? {}))
39
+ });
40
+ }
41
+ export {
42
+ useNodeInput,
43
+ useNodeRecord,
44
+ useNodeValue
45
+ };
46
+ //# sourceMappingURL=vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/vue.ts"],"sourcesContent":["/**\n * Vue node bindings for GraphReFly (D238).\n *\n * Vue is imported only from this focused subpath.\n */\n\nimport { onScopeDispose, readonly, type ShallowRef, shallowRef } from \"vue\";\nimport type { Node } from \"../node/node.js\";\nimport { readableStore, recordReadableStore, type WritableNode } from \"./store.js\";\n\nfunction assertDataValue(value: unknown): void {\n\tif (value === undefined) {\n\t\tthrow new TypeError(\"useNodeInput: undefined is SENTINEL/no DATA, not a writable DATA value\");\n\t}\n}\n\nfunction bindReadable<T>(store: { get(): T; subscribe(run: (value: T) => void): () => void }) {\n\tconst value = shallowRef(store.get()) as ShallowRef<T>;\n\tconst unsubscribe = store.subscribe((next) => {\n\t\tvalue.value = next;\n\t});\n\tonScopeDispose(unsubscribe);\n\treturn readonly(value) as Readonly<ShallowRef<T>>;\n}\n\n/** Read a GraphReFly node as a Vue shallow ref. */\nexport function useNodeValue<T>(node: Node<T>): Readonly<ShallowRef<T | undefined>> {\n\treturn bindReadable(readableStore(node));\n}\n\n/** Bind a writable GraphReFly node as `[valueRef, setValue]`. */\nexport function useNodeInput<T>(\n\tnode: WritableNode<T>,\n): readonly [Readonly<ShallowRef<T | undefined>>, (value: T) => void] {\n\treturn [\n\t\tuseNodeValue(node),\n\t\t(value: T) => {\n\t\t\tassertDataValue(value);\n\t\t\tnode.set(value);\n\t\t},\n\t] as const;\n}\n\n/**\n * Read a keyed record of nodes as a Vue shallow ref.\n *\n * `factory` must have stable identity; callers should define it outside render\n * churn or memoize it in their composition function.\n */\nexport function useNodeRecord<K extends string, R extends Record<string, unknown>>(\n\tkeysNode: Node<readonly K[]>,\n\tfactory: (key: K) => { [P in keyof R]: Node<R[P]> },\n): Readonly<ShallowRef<Record<K, R>>> {\n\tconst store = recordReadableStore(keysNode, factory);\n\treturn bindReadable({\n\t\tget: () => store.get() ?? ({} as Record<K, R>),\n\t\tsubscribe: (run) => store.subscribe((value) => run(value ?? ({} as Record<K, R>))),\n\t});\n}\n"],"mappings":";;;;;;;AAMA,SAAS,gBAAgB,UAA2B,kBAAkB;AAItE,SAAS,gBAAgB,OAAsB;AAC9C,MAAI,UAAU,QAAW;AACxB,UAAM,IAAI,UAAU,wEAAwE;AAAA,EAC7F;AACD;AAEA,SAAS,aAAgB,OAAqE;AAC7F,QAAM,QAAQ,WAAW,MAAM,IAAI,CAAC;AACpC,QAAM,cAAc,MAAM,UAAU,CAAC,SAAS;AAC7C,UAAM,QAAQ;AAAA,EACf,CAAC;AACD,iBAAe,WAAW;AAC1B,SAAO,SAAS,KAAK;AACtB;AAGO,SAAS,aAAgB,MAAoD;AACnF,SAAO,aAAa,cAAc,IAAI,CAAC;AACxC;AAGO,SAAS,aACf,MACqE;AACrE,SAAO;AAAA,IACN,aAAa,IAAI;AAAA,IACjB,CAAC,UAAa;AACb,sBAAgB,KAAK;AACrB,WAAK,IAAI,KAAK;AAAA,IACf;AAAA,EACD;AACD;AAQO,SAAS,cACf,UACA,SACqC;AACrC,QAAM,QAAQ,oBAAoB,UAAU,OAAO;AACnD,SAAO,aAAa;AAAA,IACnB,KAAK,MAAM,MAAM,IAAI,KAAM,CAAC;AAAA,IAC5B,WAAW,CAAC,QAAQ,MAAM,UAAU,CAAC,UAAU,IAAI,SAAU,CAAC,CAAkB,CAAC;AAAA,EAClF,CAAC;AACF;","names":[]}