@logixjs/core 0.0.1 → 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 (300) hide show
  1. package/LICENSE +201 -0
  2. package/dist/{Bound-BN1DQ_lM.d.ts → Bound-CEa1ihvH.d.ts} +2 -2
  3. package/dist/{Bound-BPIfH9SS.d.cts → Bound-CNLNkC7c.d.cts} +2 -2
  4. package/dist/Bound.cjs +620 -163
  5. package/dist/Bound.cjs.map +1 -1
  6. package/dist/Bound.d.cts +3 -3
  7. package/dist/Bound.d.ts +3 -3
  8. package/dist/Bound.js +14 -14
  9. package/dist/{Debug-Bq8Sqjcr.d.cts → Debug-BhMYr-1i.d.cts} +3 -3
  10. package/dist/{Debug-B5q5Bkzx.d.ts → Debug-ByM7m4Ft.d.ts} +3 -3
  11. package/dist/Debug.cjs +553 -32
  12. package/dist/Debug.cjs.map +1 -1
  13. package/dist/Debug.d.cts +10 -8
  14. package/dist/Debug.d.ts +10 -8
  15. package/dist/Debug.js +12 -10
  16. package/dist/EffectOp.cjs.map +1 -1
  17. package/dist/EffectOp.js +2 -3
  18. package/dist/EffectOp.js.map +1 -1
  19. package/dist/Env.cjs +664 -6
  20. package/dist/Env.cjs.map +1 -1
  21. package/dist/Env.js +5 -2
  22. package/dist/ExternalStore-BAz83PVq.d.cts +60 -0
  23. package/dist/ExternalStore-BYWPbYs8.d.ts +60 -0
  24. package/dist/ExternalStore.cjs +746 -0
  25. package/dist/ExternalStore.cjs.map +1 -0
  26. package/dist/ExternalStore.d.cts +4 -0
  27. package/dist/ExternalStore.d.ts +4 -0
  28. package/dist/ExternalStore.js +19 -0
  29. package/dist/ExternalStore.js.map +1 -0
  30. package/dist/{Flow-1fZT8MpX.d.cts → Flow-BlSoMmhV.d.cts} +2 -2
  31. package/dist/{Flow-BhpjE22E.d.ts → Flow-CQSGve5c.d.ts} +2 -2
  32. package/dist/Flow.cjs +2 -2
  33. package/dist/Flow.cjs.map +1 -1
  34. package/dist/Flow.d.cts +4 -4
  35. package/dist/Flow.d.ts +4 -4
  36. package/dist/Flow.js +7 -8
  37. package/dist/{Handle-D_cLW1Z3.d.ts → Handle-B7PSmsrY.d.ts} +1 -1
  38. package/dist/{Handle-D8D1zPb_.d.cts → Handle-ByovhL-c.d.cts} +1 -1
  39. package/dist/Handle.d.cts +3 -3
  40. package/dist/Handle.d.ts +3 -3
  41. package/dist/{Kernel-CnGE1Fyk.d.ts → Kernel-DGSpS4GM.d.ts} +2 -2
  42. package/dist/{Kernel-8kC-jOda.d.cts → Kernel-DZAk-Mrn.d.cts} +2 -2
  43. package/dist/Kernel.cjs +680 -22
  44. package/dist/Kernel.cjs.map +1 -1
  45. package/dist/Kernel.d.cts +10 -8
  46. package/dist/Kernel.d.ts +10 -8
  47. package/dist/Kernel.js +7 -4
  48. package/dist/{Link-Db7975nU.d.ts → Link-Cm4eR9n0.d.ts} +10 -3
  49. package/dist/{Link-fX8x1eCK.d.cts → Link-DF8i8iWR.d.cts} +10 -3
  50. package/dist/Link.cjs +1128 -86
  51. package/dist/Link.cjs.map +1 -1
  52. package/dist/Link.d.cts +3 -3
  53. package/dist/Link.d.ts +3 -3
  54. package/dist/Link.js +30 -25
  55. package/dist/{Logic-DRh4sDZj.d.cts → Logic-BcQA0AvE.d.cts} +1 -1
  56. package/dist/{Logic-BRjEMr-W.d.ts → Logic-OotSE1xw.d.ts} +1 -1
  57. package/dist/Logic.d.cts +3 -3
  58. package/dist/Logic.d.ts +3 -3
  59. package/dist/{MatchBuilder-CJk5oCkR.d.cts → MatchBuilder-BNDJ8waF.d.ts} +1 -1
  60. package/dist/{MatchBuilder-0QOc-nlU.d.ts → MatchBuilder-CvZ5WY1B.d.cts} +1 -1
  61. package/dist/MatchBuilder.d.cts +4 -4
  62. package/dist/MatchBuilder.d.ts +4 -4
  63. package/dist/Middleware-D8tUDLv_.d.cts +100 -0
  64. package/dist/Middleware-DS7CbTTN.d.ts +100 -0
  65. package/dist/Middleware.cjs +461 -13
  66. package/dist/Middleware.cjs.map +1 -1
  67. package/dist/Middleware.d.cts +2 -86
  68. package/dist/Middleware.d.ts +2 -86
  69. package/dist/Middleware.js +13 -11
  70. package/dist/{Module-DnzluX2J.d.ts → Module-CFj0I2yE.d.ts} +45 -18
  71. package/dist/{Module-B_0xRDMR.d.cts → Module-DpXPW9EQ.d.cts} +45 -18
  72. package/dist/Module.cjs +8583 -5741
  73. package/dist/Module.cjs.map +1 -1
  74. package/dist/Module.d.cts +5 -4
  75. package/dist/Module.d.ts +5 -4
  76. package/dist/Module.js +32 -27
  77. package/dist/ModuleTag-BcVF6z7B.d.ts +113 -0
  78. package/dist/ModuleTag-DuZXo_NS.d.cts +113 -0
  79. package/dist/ModuleTag.cjs +2609 -1232
  80. package/dist/ModuleTag.cjs.map +1 -1
  81. package/dist/ModuleTag.d.cts +4 -4
  82. package/dist/ModuleTag.d.ts +4 -4
  83. package/dist/ModuleTag.js +28 -25
  84. package/dist/{Observability-cY4kLn0S.d.ts → Observability-D-ZWeEVb.d.ts} +22 -15
  85. package/dist/{Observability-COqEvp2C.d.cts → Observability-V7sRMYTh.d.cts} +22 -15
  86. package/dist/Observability.cjs +1938 -640
  87. package/dist/Observability.cjs.map +1 -1
  88. package/dist/Observability.d.cts +4 -4
  89. package/dist/Observability.d.ts +4 -4
  90. package/dist/Observability.js +21 -19
  91. package/dist/{Process-mL8fHDSB.d.cts → Process-B55aJMFk.d.cts} +29 -4
  92. package/dist/{Process-CM9xbMdP.d.ts → Process-DvhFEwUS.d.ts} +29 -4
  93. package/dist/Process.cjs +1122 -85
  94. package/dist/Process.cjs.map +1 -1
  95. package/dist/Process.d.cts +4 -3
  96. package/dist/Process.d.ts +4 -3
  97. package/dist/Process.js +27 -22
  98. package/dist/{ReadQuery-BlMwhe-F.d.ts → ReadQuery-C4vZ8Prc.d.ts} +2 -2
  99. package/dist/{ReadQuery-SinbStGF.d.ts → ReadQuery-CafjlJQo.d.cts} +1 -1
  100. package/dist/{ReadQuery-SinbStGF.d.cts → ReadQuery-CafjlJQo.d.ts} +1 -1
  101. package/dist/{ReadQuery-CL5XlXts.d.cts → ReadQuery-mc0NgrFV.d.cts} +2 -2
  102. package/dist/ReadQuery.cjs +3 -3
  103. package/dist/ReadQuery.cjs.map +1 -1
  104. package/dist/ReadQuery.d.cts +2 -2
  105. package/dist/ReadQuery.d.ts +2 -2
  106. package/dist/ReadQuery.js +3 -3
  107. package/dist/{Reflection-CQnKwPXj.d.ts → Reflection-C8xZ267q.d.ts} +88 -7
  108. package/dist/{Reflection-Kabo1mlU.d.cts → Reflection-DP7Vsv3f.d.cts} +88 -7
  109. package/dist/Reflection.cjs +2934 -1553
  110. package/dist/Reflection.cjs.map +1 -1
  111. package/dist/Reflection.d.cts +14 -11
  112. package/dist/Reflection.d.ts +14 -11
  113. package/dist/Reflection.js +26 -21
  114. package/dist/Resource.cjs +670 -12
  115. package/dist/Resource.cjs.map +1 -1
  116. package/dist/Resource.js +6 -3
  117. package/dist/Root.cjs +675 -17
  118. package/dist/Root.cjs.map +1 -1
  119. package/dist/Root.js +7 -3
  120. package/dist/{Runtime-CtyzZG4i.d.ts → Runtime-BWc9YfUB.d.ts} +37 -7
  121. package/dist/{Runtime-B-aL-f29.d.cts → Runtime-PShIC4DW.d.cts} +37 -7
  122. package/dist/Runtime.cjs +1899 -809
  123. package/dist/Runtime.cjs.map +1 -1
  124. package/dist/Runtime.d.cts +14 -11
  125. package/dist/Runtime.d.ts +14 -11
  126. package/dist/Runtime.js +33 -28
  127. package/dist/ScopeRegistry.cjs +668 -10
  128. package/dist/ScopeRegistry.cjs.map +1 -1
  129. package/dist/ScopeRegistry.js +6 -3
  130. package/dist/{StateTrait-OWhbj12c.d.cts → StateTrait-CQsDlXJm.d.cts} +23 -6
  131. package/dist/{StateTrait-BGsZghTz.d.ts → StateTrait-YvJzVDKl.d.ts} +23 -6
  132. package/dist/StateTrait.cjs +1475 -370
  133. package/dist/StateTrait.cjs.map +1 -1
  134. package/dist/StateTrait.d.cts +7 -5
  135. package/dist/StateTrait.d.ts +7 -5
  136. package/dist/StateTrait.js +17 -14
  137. package/dist/{TraitLifecycle-LdIWmKlg.d.ts → TraitLifecycle-CjIBICAA.d.ts} +2 -2
  138. package/dist/{TraitLifecycle-CwV5WPFX.d.cts → TraitLifecycle-NmqGiXPC.d.cts} +2 -2
  139. package/dist/TraitLifecycle.cjs +489 -32
  140. package/dist/TraitLifecycle.cjs.map +1 -1
  141. package/dist/TraitLifecycle.d.cts +4 -4
  142. package/dist/TraitLifecycle.d.ts +4 -4
  143. package/dist/TraitLifecycle.js +7 -7
  144. package/dist/Workflow-BlFG_20_.d.cts +414 -0
  145. package/dist/Workflow-CW9S_aAP.d.ts +414 -0
  146. package/dist/Workflow.cjs +2977 -0
  147. package/dist/Workflow.cjs.map +1 -0
  148. package/dist/Workflow.d.cts +7 -0
  149. package/dist/Workflow.d.ts +7 -0
  150. package/dist/Workflow.js +55 -0
  151. package/dist/Workflow.js.map +1 -0
  152. package/dist/{chunk-G5ZBFPNU.js → chunk-2A4UKO2D.js} +2 -2
  153. package/dist/chunk-2DE6D42I.js +248 -0
  154. package/dist/chunk-2DE6D42I.js.map +1 -0
  155. package/dist/{chunk-ANLBCBDC.js → chunk-2DVLMSOE.js} +6 -6
  156. package/dist/{chunk-BE3HW4FY.js → chunk-34CF6OGE.js} +14 -16
  157. package/dist/chunk-34CF6OGE.js.map +1 -0
  158. package/dist/{chunk-ZFY7U2FR.js → chunk-3LPIXG56.js} +43 -3
  159. package/dist/chunk-3LPIXG56.js.map +1 -0
  160. package/dist/chunk-3VZYDNXZ.js +10 -0
  161. package/dist/chunk-3VZYDNXZ.js.map +1 -0
  162. package/dist/{chunk-3TMODYZV.js → chunk-3XO4HR6V.js} +2 -2
  163. package/dist/chunk-46FGVWRF.js +817 -0
  164. package/dist/chunk-46FGVWRF.js.map +1 -0
  165. package/dist/chunk-4LODUXFI.js +288 -0
  166. package/dist/chunk-4LODUXFI.js.map +1 -0
  167. package/dist/{chunk-GMPEOUP2.js → chunk-4MZ7BT3R.js} +2 -2
  168. package/dist/chunk-4MZ7BT3R.js.map +1 -0
  169. package/dist/{chunk-TKZ7MEIA.js → chunk-53GVPGSM.js} +2 -2
  170. package/dist/{chunk-KP7MUZNX.js → chunk-5W2V2NVJ.js} +2 -2
  171. package/dist/chunk-5W2V2NVJ.js.map +1 -0
  172. package/dist/chunk-6DACKW3D.js +613 -0
  173. package/dist/chunk-6DACKW3D.js.map +1 -0
  174. package/dist/chunk-AQ7L2QZ5.js +1395 -0
  175. package/dist/chunk-AQ7L2QZ5.js.map +1 -0
  176. package/dist/{chunk-NZJKFF45.js → chunk-C2UZZQ76.js} +2 -2
  177. package/dist/chunk-CCKP5Z6F.js +701 -0
  178. package/dist/chunk-CCKP5Z6F.js.map +1 -0
  179. package/dist/chunk-CUKM2XUW.js +27 -0
  180. package/dist/{chunk-QCHIQWAJ.js.map → chunk-CUKM2XUW.js.map} +1 -1
  181. package/dist/{chunk-M2RGJPXX.js → chunk-DBD6Q6JH.js} +3 -3
  182. package/dist/{chunk-ZGDVUPTM.js → chunk-EB4RGQO3.js} +2 -2
  183. package/dist/{chunk-PAYXCY6A.js → chunk-G7ESIQTI.js} +12 -14
  184. package/dist/chunk-G7ESIQTI.js.map +1 -0
  185. package/dist/chunk-GPBAZQ23.js +348 -0
  186. package/dist/chunk-GPBAZQ23.js.map +1 -0
  187. package/dist/{chunk-OFADUJWJ.js → chunk-I4LCE5OY.js} +3 -5
  188. package/dist/{chunk-OFADUJWJ.js.map → chunk-I4LCE5OY.js.map} +1 -1
  189. package/dist/{chunk-DFNM3WX2.js → chunk-IMCC6TBN.js} +158 -39
  190. package/dist/chunk-IMCC6TBN.js.map +1 -0
  191. package/dist/{chunk-76WT3HOR.js → chunk-IROZNQAF.js} +22 -21
  192. package/dist/chunk-IROZNQAF.js.map +1 -0
  193. package/dist/{chunk-TAAPQVZN.js → chunk-ISKNULNH.js} +2 -2
  194. package/dist/chunk-J3CWXIPV.js +242 -0
  195. package/dist/chunk-J3CWXIPV.js.map +1 -0
  196. package/dist/{chunk-PYOE4VSI.js → chunk-JBKYRTCS.js} +224 -161
  197. package/dist/chunk-JBKYRTCS.js.map +1 -0
  198. package/dist/{chunk-66ALHVEX.js → chunk-KKIAYH4X.js} +3 -3
  199. package/dist/{chunk-3RMKLXHX.js → chunk-KLDVG3SY.js} +2 -2
  200. package/dist/{chunk-BABLDP24.js → chunk-KSZQYSEH.js} +3 -3
  201. package/dist/chunk-KSZQYSEH.js.map +1 -0
  202. package/dist/{chunk-CW6T36TN.js → chunk-M3M7JFAH.js} +4 -4
  203. package/dist/chunk-M3M7JFAH.js.map +1 -0
  204. package/dist/{chunk-THATMZXD.js → chunk-MLB253V2.js} +2 -2
  205. package/dist/{chunk-THATMZXD.js.map → chunk-MLB253V2.js.map} +1 -1
  206. package/dist/{chunk-JGIWG6SR.js → chunk-MS77U77X.js} +664 -550
  207. package/dist/chunk-MS77U77X.js.map +1 -0
  208. package/dist/chunk-MW4FA3MW.js +23 -0
  209. package/dist/chunk-MW4FA3MW.js.map +1 -0
  210. package/dist/chunk-MYKNINNN.js +228 -0
  211. package/dist/chunk-MYKNINNN.js.map +1 -0
  212. package/dist/{chunk-4CQAV7YB.js → chunk-O6TTQXTY.js} +2 -2
  213. package/dist/{chunk-NBD3KUOZ.js → chunk-OJDJ4VDQ.js} +35 -24
  214. package/dist/chunk-OJDJ4VDQ.js.map +1 -0
  215. package/dist/{chunk-NQZ2OSGR.js → chunk-PVZEMNJY.js} +9 -9
  216. package/dist/chunk-PVZEMNJY.js.map +1 -0
  217. package/dist/chunk-RN26DV2M.js +271 -0
  218. package/dist/chunk-RN26DV2M.js.map +1 -0
  219. package/dist/{chunk-JCXGZRMU.js → chunk-RQQW3IQC.js} +3 -3
  220. package/dist/chunk-RQQW3IQC.js.map +1 -0
  221. package/dist/{chunk-24VULZ7A.js → chunk-TKOGZDD6.js} +3 -3
  222. package/dist/{chunk-EGK3KN7B.js → chunk-TQYLVXGY.js} +70 -39
  223. package/dist/chunk-TQYLVXGY.js.map +1 -0
  224. package/dist/{chunk-QMM6O4CD.js → chunk-UACD2CL2.js} +15 -3
  225. package/dist/{chunk-QMM6O4CD.js.map → chunk-UACD2CL2.js.map} +1 -1
  226. package/dist/{chunk-M3WTHJHJ.js → chunk-VH575UTV.js} +30 -34
  227. package/dist/chunk-VH575UTV.js.map +1 -0
  228. package/dist/{chunk-AUIR5O6W.js → chunk-WWBMC24F.js} +9 -15
  229. package/dist/chunk-WWBMC24F.js.map +1 -0
  230. package/dist/{chunk-JWOYLO27.js → chunk-WYJUJV4L.js} +80 -7
  231. package/dist/chunk-WYJUJV4L.js.map +1 -0
  232. package/dist/{chunk-EY4NZKDR.js → chunk-XFMMPYNU.js} +2 -2
  233. package/dist/chunk-Y4VRBIS6.js +35 -0
  234. package/dist/chunk-Y4VRBIS6.js.map +1 -0
  235. package/dist/{chunk-DMBALCE2.js → chunk-ZC7MSQ5U.js} +77 -4
  236. package/dist/chunk-ZC7MSQ5U.js.map +1 -0
  237. package/dist/{chunk-OGWBVHB3.js → chunk-ZCK6SCOE.js} +67 -8
  238. package/dist/chunk-ZCK6SCOE.js.map +1 -0
  239. package/dist/{chunk-IHVBV5C2.js → chunk-ZTFTABXV.js} +2 -1
  240. package/dist/chunk-ZTFTABXV.js.map +1 -0
  241. package/dist/index.cjs +9532 -5017
  242. package/dist/index.cjs.map +1 -1
  243. package/dist/index.d.cts +163 -27
  244. package/dist/index.d.ts +163 -27
  245. package/dist/index.js +119 -56
  246. package/dist/index.js.map +1 -1
  247. package/dist/{ir-BMP7yxJJ.d.cts → ir-C-Zm_GlZ.d.cts} +1 -1
  248. package/dist/{ir-DUOz6H-5.d.ts → ir-DGyGiwVe.d.ts} +1 -1
  249. package/dist/{module-k7m3txak.d.ts → module-DqQ1U-Me.d.ts} +129 -100
  250. package/dist/{module-B8CBqIZ_.d.cts → module-doenaCsZ.d.cts} +129 -100
  251. package/package.json +12 -1
  252. package/dist/ModuleTag-C8FHY_sY.d.ts +0 -93
  253. package/dist/ModuleTag-EGbgBMpZ.d.cts +0 -93
  254. package/dist/chunk-3QMIVH35.js +0 -43
  255. package/dist/chunk-3QMIVH35.js.map +0 -1
  256. package/dist/chunk-76WT3HOR.js.map +0 -1
  257. package/dist/chunk-AUIR5O6W.js.map +0 -1
  258. package/dist/chunk-BABLDP24.js.map +0 -1
  259. package/dist/chunk-BE3HW4FY.js.map +0 -1
  260. package/dist/chunk-CW6T36TN.js.map +0 -1
  261. package/dist/chunk-DFNM3WX2.js.map +0 -1
  262. package/dist/chunk-DMBALCE2.js.map +0 -1
  263. package/dist/chunk-EGK3KN7B.js.map +0 -1
  264. package/dist/chunk-GMPEOUP2.js.map +0 -1
  265. package/dist/chunk-IHVBV5C2.js.map +0 -1
  266. package/dist/chunk-JCXGZRMU.js.map +0 -1
  267. package/dist/chunk-JGIWG6SR.js.map +0 -1
  268. package/dist/chunk-JWOYLO27.js.map +0 -1
  269. package/dist/chunk-KIXAU3GM.js +0 -137
  270. package/dist/chunk-KIXAU3GM.js.map +0 -1
  271. package/dist/chunk-KP7MUZNX.js.map +0 -1
  272. package/dist/chunk-M3WTHJHJ.js.map +0 -1
  273. package/dist/chunk-M7IYCTJV.js +0 -79
  274. package/dist/chunk-M7IYCTJV.js.map +0 -1
  275. package/dist/chunk-NBD3KUOZ.js.map +0 -1
  276. package/dist/chunk-NQZ2OSGR.js.map +0 -1
  277. package/dist/chunk-OGWBVHB3.js.map +0 -1
  278. package/dist/chunk-PAYXCY6A.js.map +0 -1
  279. package/dist/chunk-PYOE4VSI.js.map +0 -1
  280. package/dist/chunk-QCHIQWAJ.js +0 -21
  281. package/dist/chunk-VZB726PE.js +0 -93
  282. package/dist/chunk-VZB726PE.js.map +0 -1
  283. package/dist/chunk-W3TEWHLO.js +0 -568
  284. package/dist/chunk-W3TEWHLO.js.map +0 -1
  285. package/dist/chunk-ZFLHVFUC.js +0 -192
  286. package/dist/chunk-ZFLHVFUC.js.map +0 -1
  287. package/dist/chunk-ZFY7U2FR.js.map +0 -1
  288. /package/dist/{chunk-G5ZBFPNU.js.map → chunk-2A4UKO2D.js.map} +0 -0
  289. /package/dist/{chunk-ANLBCBDC.js.map → chunk-2DVLMSOE.js.map} +0 -0
  290. /package/dist/{chunk-3TMODYZV.js.map → chunk-3XO4HR6V.js.map} +0 -0
  291. /package/dist/{chunk-TKZ7MEIA.js.map → chunk-53GVPGSM.js.map} +0 -0
  292. /package/dist/{chunk-NZJKFF45.js.map → chunk-C2UZZQ76.js.map} +0 -0
  293. /package/dist/{chunk-M2RGJPXX.js.map → chunk-DBD6Q6JH.js.map} +0 -0
  294. /package/dist/{chunk-ZGDVUPTM.js.map → chunk-EB4RGQO3.js.map} +0 -0
  295. /package/dist/{chunk-TAAPQVZN.js.map → chunk-ISKNULNH.js.map} +0 -0
  296. /package/dist/{chunk-66ALHVEX.js.map → chunk-KKIAYH4X.js.map} +0 -0
  297. /package/dist/{chunk-3RMKLXHX.js.map → chunk-KLDVG3SY.js.map} +0 -0
  298. /package/dist/{chunk-4CQAV7YB.js.map → chunk-O6TTQXTY.js.map} +0 -0
  299. /package/dist/{chunk-24VULZ7A.js.map → chunk-TKOGZDD6.js.map} +0 -0
  300. /package/dist/{chunk-EY4NZKDR.js.map → chunk-XFMMPYNU.js.map} +0 -0
package/dist/Kernel.cjs CHANGED
@@ -35,7 +35,7 @@ __export(Kernel_exports, {
35
35
  runtimeServicesRegistryLayer: () => runtimeServicesRegistryLayer
36
36
  });
37
37
  module.exports = __toCommonJS(Kernel_exports);
38
- var import_effect5 = require("effect");
38
+ var import_effect12 = require("effect");
39
39
 
40
40
  // src/internal/runtime/core/FullCutoverGate.ts
41
41
  var CutoverCoverageMatrix = {
@@ -54,7 +54,7 @@ var parseFallbackServiceIds = (overridesApplied) => {
54
54
  const serviceId = entry.slice(colon + 1, eq);
55
55
  if (serviceId.length > 0) out.add(serviceId);
56
56
  }
57
- return Array.from(out).sort((a, b) => a.localeCompare(b));
57
+ return Array.from(out).sort();
58
58
  };
59
59
  var collectMissingServiceIds = (args) => {
60
60
  const bindingByServiceId = /* @__PURE__ */ new Map();
@@ -110,10 +110,645 @@ var evaluateFullCutoverGate = (args) => {
110
110
  };
111
111
 
112
112
  // src/internal/runtime/core/RuntimeKernel.ts
113
- var import_effect2 = require("effect");
113
+ var import_effect9 = require("effect");
114
114
 
115
115
  // src/internal/runtime/core/env.ts
116
+ var import_effect8 = require("effect");
117
+
118
+ // src/internal/runtime/core/HostScheduler.ts
119
+ var noopCancel = () => {
120
+ };
121
+ var safeNowMs = () => {
122
+ const perf = globalThis.performance;
123
+ if (perf && typeof perf.now === "function") {
124
+ try {
125
+ const v = perf.now();
126
+ if (typeof v === "number" && Number.isFinite(v)) return v;
127
+ } catch {
128
+ }
129
+ }
130
+ return Date.now();
131
+ };
132
+ var safeQueueMicrotask = (cb) => {
133
+ const qm = globalThis.queueMicrotask;
134
+ if (typeof qm === "function") {
135
+ try {
136
+ qm(cb);
137
+ return;
138
+ } catch {
139
+ }
140
+ }
141
+ try {
142
+ Promise.resolve().then(cb);
143
+ } catch {
144
+ setTimeout(cb, 0);
145
+ }
146
+ };
147
+ var safeSetTimeout = (ms, cb) => {
148
+ const id = setTimeout(cb, ms);
149
+ return () => {
150
+ try {
151
+ clearTimeout(id);
152
+ } catch {
153
+ }
154
+ };
155
+ };
156
+ var makeMessageChannelMacrotask = () => {
157
+ const MC = globalThis.MessageChannel;
158
+ if (typeof MC !== "function") return void 0;
159
+ let channel;
160
+ try {
161
+ channel = new MC();
162
+ } catch {
163
+ return void 0;
164
+ }
165
+ const queue = [];
166
+ let scheduled = false;
167
+ const flush = () => {
168
+ scheduled = false;
169
+ const tasks = queue.splice(0, queue.length);
170
+ for (const t of tasks) {
171
+ if (t.canceled) continue;
172
+ try {
173
+ t.cb();
174
+ } catch {
175
+ }
176
+ }
177
+ };
178
+ try {
179
+ channel.port1.onmessage = flush;
180
+ } catch {
181
+ return void 0;
182
+ }
183
+ const schedule = (cb) => {
184
+ const task = { canceled: false, cb };
185
+ queue.push(task);
186
+ if (!scheduled) {
187
+ scheduled = true;
188
+ try {
189
+ channel.port2.postMessage(void 0);
190
+ } catch {
191
+ scheduled = false;
192
+ return safeSetTimeout(0, cb);
193
+ }
194
+ }
195
+ return () => {
196
+ task.canceled = true;
197
+ };
198
+ };
199
+ return schedule;
200
+ };
201
+ var makeSetImmediateMacrotask = () => {
202
+ const si = globalThis.setImmediate;
203
+ const ci = globalThis.clearImmediate;
204
+ if (typeof si !== "function") return void 0;
205
+ return (cb) => {
206
+ let id;
207
+ try {
208
+ id = si(cb);
209
+ } catch {
210
+ return safeSetTimeout(0, cb);
211
+ }
212
+ return () => {
213
+ if (typeof ci !== "function") return;
214
+ try {
215
+ ci(id);
216
+ } catch {
217
+ }
218
+ };
219
+ };
220
+ };
221
+ var makeRaf = () => {
222
+ const raf = globalThis.requestAnimationFrame;
223
+ const cancel = globalThis.cancelAnimationFrame;
224
+ if (typeof raf !== "function") return void 0;
225
+ return (cb) => {
226
+ let id;
227
+ try {
228
+ id = raf(cb);
229
+ } catch {
230
+ return noopCancel;
231
+ }
232
+ return () => {
233
+ if (typeof cancel !== "function") return;
234
+ try {
235
+ cancel(id);
236
+ } catch {
237
+ }
238
+ };
239
+ };
240
+ };
241
+ var makeDefaultHostScheduler = () => {
242
+ const macrotask = makeSetImmediateMacrotask() ?? makeMessageChannelMacrotask() ?? ((cb) => safeSetTimeout(0, cb));
243
+ const raf = makeRaf();
244
+ return {
245
+ nowMs: safeNowMs,
246
+ scheduleMicrotask: safeQueueMicrotask,
247
+ scheduleMacrotask: macrotask,
248
+ scheduleAnimationFrame: (cb) => raf?.(cb) ?? macrotask(cb),
249
+ scheduleTimeout: safeSetTimeout
250
+ };
251
+ };
252
+ var globalHostScheduler;
253
+ var getGlobalHostScheduler = () => {
254
+ globalHostScheduler ?? (globalHostScheduler = makeDefaultHostScheduler());
255
+ return globalHostScheduler;
256
+ };
257
+
258
+ // src/internal/runtime/core/RuntimeStore.ts
259
+ var parseTopicKey = (topicKey) => {
260
+ const idx = topicKey.indexOf("::");
261
+ if (idx <= 0) return void 0;
262
+ const moduleId = topicKey.slice(0, idx);
263
+ const rest = topicKey.slice(idx + 2);
264
+ if (rest.length === 0) return void 0;
265
+ const idx2 = rest.indexOf("::");
266
+ if (idx2 < 0) {
267
+ return { kind: "module", moduleInstanceKey: `${moduleId}::${rest}` };
268
+ }
269
+ const instanceId = rest.slice(0, idx2);
270
+ const suffix = rest.slice(idx2 + 2);
271
+ if (suffix.startsWith("rq:")) {
272
+ const selectorId = suffix.slice("rq:".length);
273
+ if (selectorId.length === 0) return void 0;
274
+ return {
275
+ kind: "readQuery",
276
+ moduleInstanceKey: `${moduleId}::${instanceId}`,
277
+ selectorId
278
+ };
279
+ }
280
+ return { kind: "module", moduleInstanceKey: `${moduleId}::${instanceId}` };
281
+ };
282
+ var makeRuntimeStore = () => {
283
+ let tickSeq = 0;
284
+ const moduleStates = /* @__PURE__ */ new Map();
285
+ const topicVersions = /* @__PURE__ */ new Map();
286
+ const topicPriorities = /* @__PURE__ */ new Map();
287
+ const listenersByTopic = /* @__PURE__ */ new Map();
288
+ const subscriberCountByModule = /* @__PURE__ */ new Map();
289
+ const getTopicVersion = (topicKey) => topicVersions.get(topicKey) ?? 0;
290
+ const getTopicPriority = (topicKey) => topicPriorities.get(topicKey) ?? "normal";
291
+ const commitTopicBump = (topicKey, priority) => {
292
+ const prev = topicVersions.get(topicKey) ?? 0;
293
+ topicVersions.set(topicKey, prev + 1);
294
+ topicPriorities.set(topicKey, priority);
295
+ };
296
+ const subscribeTopic = (topicKey, listener) => {
297
+ const info = parseTopicKey(topicKey);
298
+ const existing = listenersByTopic.get(topicKey);
299
+ const set = existing ?? /* @__PURE__ */ new Set();
300
+ const alreadyHas = set.has(listener);
301
+ if (!alreadyHas) {
302
+ set.add(listener);
303
+ }
304
+ if (!existing) {
305
+ listenersByTopic.set(topicKey, set);
306
+ }
307
+ if (!alreadyHas && info) {
308
+ const prev = subscriberCountByModule.get(info.moduleInstanceKey) ?? 0;
309
+ subscriberCountByModule.set(info.moduleInstanceKey, prev + 1);
310
+ }
311
+ return () => {
312
+ const current = listenersByTopic.get(topicKey);
313
+ if (!current) return;
314
+ const deleted = current.delete(listener);
315
+ if (deleted && info) {
316
+ const prev = subscriberCountByModule.get(info.moduleInstanceKey) ?? 0;
317
+ const next = prev - 1;
318
+ if (next <= 0) {
319
+ subscriberCountByModule.delete(info.moduleInstanceKey);
320
+ } else {
321
+ subscriberCountByModule.set(info.moduleInstanceKey, next);
322
+ }
323
+ }
324
+ if (current.size === 0) {
325
+ listenersByTopic.delete(topicKey);
326
+ }
327
+ };
328
+ };
329
+ const getTopicSubscriberCount = (topicKey) => listenersByTopic.get(topicKey)?.size ?? 0;
330
+ const getModuleSubscriberCount = (moduleInstanceKey) => subscriberCountByModule.get(moduleInstanceKey) ?? 0;
331
+ const registerModuleInstance = (args) => {
332
+ moduleStates.set(args.moduleInstanceKey, args.initialState);
333
+ if (!topicVersions.has(args.moduleInstanceKey)) {
334
+ topicVersions.set(args.moduleInstanceKey, 0);
335
+ topicPriorities.set(args.moduleInstanceKey, "normal");
336
+ }
337
+ };
338
+ const unregisterModuleInstance = (moduleInstanceKey) => {
339
+ moduleStates.delete(moduleInstanceKey);
340
+ };
341
+ const commitTick = (args) => {
342
+ tickSeq = args.tickSeq;
343
+ for (const [key, commit] of args.accepted.modules) {
344
+ moduleStates.set(key, commit.state);
345
+ }
346
+ const changedTopics = /* @__PURE__ */ new Map();
347
+ for (const [topicKey, priority] of args.accepted.dirtyTopics) {
348
+ commitTopicBump(topicKey, priority);
349
+ const listeners = Array.from(listenersByTopic.get(topicKey) ?? []);
350
+ if (listeners.length > 0) {
351
+ changedTopics.set(topicKey, { priority, listeners });
352
+ }
353
+ }
354
+ return { changedTopics };
355
+ };
356
+ const getModuleState = (moduleInstanceKey) => moduleStates.get(moduleInstanceKey);
357
+ const dispose = () => {
358
+ moduleStates.clear();
359
+ topicVersions.clear();
360
+ topicPriorities.clear();
361
+ listenersByTopic.clear();
362
+ subscriberCountByModule.clear();
363
+ };
364
+ return {
365
+ getTickSeq: () => tickSeq,
366
+ getModuleState,
367
+ getTopicVersion,
368
+ getTopicPriority,
369
+ subscribeTopic,
370
+ getTopicSubscriberCount,
371
+ getModuleSubscriberCount,
372
+ registerModuleInstance,
373
+ unregisterModuleInstance,
374
+ commitTick,
375
+ dispose
376
+ };
377
+ };
378
+
379
+ // src/internal/runtime/core/TickScheduler.ts
380
+ var import_effect6 = require("effect");
381
+
382
+ // src/internal/runtime/core/DebugSink.record.ts
383
+ var import_effect3 = require("effect");
384
+
385
+ // src/internal/observability/jsonValue.ts
386
+ var defaultOptions = {
387
+ maxDepth: 6,
388
+ maxObjectKeys: 32,
389
+ maxArrayLength: 32,
390
+ maxStringLength: 256,
391
+ maxJsonBytes: 4 * 1024,
392
+ oversizedPreviewBytes: 256
393
+ };
394
+
395
+ // src/internal/runtime/core/errorSummary.ts
116
396
  var import_effect = require("effect");
397
+
398
+ // src/internal/runtime/core/EffectOpCore.ts
399
+ var import_effect2 = require("effect");
400
+ var currentLinkId = import_effect2.FiberRef.unsafeMake(void 0);
401
+ var EffectOpMiddlewareTag = class extends import_effect2.Context.Tag("Logix/EffectOpMiddleware")() {
402
+ };
403
+
404
+ // src/internal/runtime/core/DebugSink.record.ts
405
+ var currentDebugSinks = import_effect3.FiberRef.unsafeMake([]);
406
+ var currentRuntimeLabel = import_effect3.FiberRef.unsafeMake(void 0);
407
+ var currentTxnId = import_effect3.FiberRef.unsafeMake(void 0);
408
+ var currentOpSeq = import_effect3.FiberRef.unsafeMake(void 0);
409
+ var currentDiagnosticsLevel = import_effect3.FiberRef.unsafeMake("off");
410
+ var currentTraitConvergeDiagnosticsSampling = import_effect3.FiberRef.unsafeMake({
411
+ sampleEveryN: 32,
412
+ topK: 3
413
+ });
414
+ var browserLifecycleSeen = /* @__PURE__ */ new Set();
415
+ var browserDiagnosticSeen = /* @__PURE__ */ new Set();
416
+ var lifecycleErrorLog = (event) => {
417
+ const moduleId = event.moduleId ?? "unknown";
418
+ const causePretty = (() => {
419
+ try {
420
+ return import_effect3.Cause.pretty(event.cause, {
421
+ renderErrorCause: true
422
+ });
423
+ } catch {
424
+ try {
425
+ return JSON.stringify(event.cause, null, 2);
426
+ } catch {
427
+ return String(event.cause);
428
+ }
429
+ }
430
+ })();
431
+ const message = `[Logix][module=${moduleId}] lifecycle:error
432
+ ${causePretty}`;
433
+ return import_effect3.Effect.logError(message).pipe(
434
+ import_effect3.Effect.annotateLogs({
435
+ "logix.moduleId": moduleId,
436
+ "logix.event": "lifecycle:error",
437
+ "logix.cause": causePretty
438
+ })
439
+ );
440
+ };
441
+ var diagnosticLog = (event) => {
442
+ const moduleId = event.moduleId ?? "unknown";
443
+ const header = `[Logix][module=${moduleId}] diagnostic(${event.severity})`;
444
+ const detail = `code=${event.code} message=${event.message}${event.actionTag ? ` action=${event.actionTag}` : ""}${event.hint ? `
445
+ hint: ${event.hint}` : ""}`;
446
+ const msg = `${header}
447
+ ${detail}`;
448
+ const base = event.severity === "warning" ? import_effect3.Effect.logWarning(msg) : event.severity === "info" ? import_effect3.Effect.logInfo(msg) : import_effect3.Effect.logError(msg);
449
+ const annotations = {
450
+ "logix.moduleId": moduleId,
451
+ "logix.event": `diagnostic(${event.severity})`,
452
+ "logix.diagnostic.code": event.code,
453
+ "logix.diagnostic.message": event.message
454
+ };
455
+ if (event.hint) {
456
+ annotations["logix.diagnostic.hint"] = event.hint;
457
+ }
458
+ if (event.actionTag) {
459
+ annotations["logix.diagnostic.actionTag"] = event.actionTag;
460
+ }
461
+ return base.pipe(import_effect3.Effect.annotateLogs(annotations));
462
+ };
463
+ var noopLayer = import_effect3.Layer.locallyScoped(currentDebugSinks, []);
464
+ var errorOnlySink = {
465
+ record: (event) => event.type === "lifecycle:error" ? lifecycleErrorLog(event) : event.type === "diagnostic" && event.severity !== "info" ? diagnosticLog(event) : import_effect3.Effect.void
466
+ };
467
+ var errorOnlyLayer = import_effect3.Layer.locallyScoped(currentDebugSinks, [errorOnlySink]);
468
+ var consoleSink = {
469
+ record: (event) => event.type === "lifecycle:error" ? lifecycleErrorLog(event) : event.type === "diagnostic" ? diagnosticLog(event) : import_effect3.Effect.logDebug({ debugEvent: event })
470
+ };
471
+ var consoleLayer = import_effect3.Layer.locallyScoped(currentDebugSinks, [consoleSink]);
472
+ var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
473
+ var renderBrowserConsoleEvent = (event) => {
474
+ if (typeof event.type === "string" && event.type.startsWith("trace:")) {
475
+ const moduleId = event.moduleId ?? "unknown";
476
+ const type = event.type;
477
+ return import_effect3.Effect.sync(() => {
478
+ console.groupCollapsed(
479
+ "%c[Logix]%c trace %c" + moduleId + "%c " + String(type),
480
+ "color:#6b7280;font-weight:bold",
481
+ // tag
482
+ "color:#3b82f6",
483
+ // label
484
+ "color:#9ca3af",
485
+ // module id
486
+ "color:#6b7280"
487
+ // type
488
+ );
489
+ console.log(event);
490
+ console.groupEnd();
491
+ });
492
+ }
493
+ if (event.type === "lifecycle:error") {
494
+ const moduleId = event.moduleId ?? "unknown";
495
+ const causePretty = (() => {
496
+ try {
497
+ return import_effect3.Cause.pretty(event.cause, { renderErrorCause: true });
498
+ } catch {
499
+ try {
500
+ return JSON.stringify(event.cause, null, 2);
501
+ } catch {
502
+ return String(event.cause);
503
+ }
504
+ }
505
+ })();
506
+ const key = `${moduleId}|${causePretty}`;
507
+ if (browserLifecycleSeen.has(key)) {
508
+ return import_effect3.Effect.void;
509
+ }
510
+ browserLifecycleSeen.add(key);
511
+ return import_effect3.Effect.sync(() => {
512
+ console.groupCollapsed(
513
+ "%c[Logix]%c lifecycle:error %c" + moduleId,
514
+ "color:#ef4444;font-weight:bold",
515
+ // tag
516
+ "color:#ef4444",
517
+ // label
518
+ "color:#9ca3af"
519
+ // module id
520
+ );
521
+ console.error(causePretty);
522
+ console.groupEnd();
523
+ });
524
+ }
525
+ if (event.type === "diagnostic") {
526
+ const moduleId = event.moduleId ?? "unknown";
527
+ const detail = `code=${event.code} message=${event.message}${event.actionTag ? ` action=${event.actionTag}` : ""}${event.hint ? `
528
+ hint: ${event.hint}` : ""}`;
529
+ const color = event.severity === "warning" ? "color:#d97706" : event.severity === "info" ? "color:#3b82f6" : "color:#ef4444";
530
+ const label = event.severity === "warning" ? "diagnostic(warning)" : event.severity === "info" ? "diagnostic(info)" : "diagnostic(error)";
531
+ const key = `${moduleId}|${event.code}|${event.message}`;
532
+ if (browserDiagnosticSeen.has(key)) {
533
+ return import_effect3.Effect.void;
534
+ }
535
+ browserDiagnosticSeen.add(key);
536
+ return import_effect3.Effect.sync(() => {
537
+ console.groupCollapsed(
538
+ "%c[Logix]%c " + label + "%c module=" + moduleId,
539
+ "color:#6b7280;font-weight:bold",
540
+ color,
541
+ "color:#9ca3af"
542
+ );
543
+ if (event.severity === "warning") {
544
+ console.warn(detail);
545
+ } else if (event.severity === "info") {
546
+ console.info(detail);
547
+ } else {
548
+ console.error(detail);
549
+ }
550
+ console.groupEnd();
551
+ });
552
+ }
553
+ return import_effect3.Effect.void;
554
+ };
555
+ var browserConsoleSink = {
556
+ record: (event) => {
557
+ if (!isBrowser) {
558
+ return event.type === "lifecycle:error" ? lifecycleErrorLog(event) : event.type === "diagnostic" ? diagnosticLog(event) : import_effect3.Effect.logDebug({ debugEvent: event });
559
+ }
560
+ return renderBrowserConsoleEvent(event);
561
+ }
562
+ };
563
+ var browserConsoleLayer = import_effect3.Layer.locallyScoped(currentDebugSinks, [browserConsoleSink]);
564
+ var browserDiagnosticConsoleSink = {
565
+ record: (event) => {
566
+ if (!isBrowser) {
567
+ return event.type === "lifecycle:error" ? lifecycleErrorLog(event) : event.type === "diagnostic" && event.severity !== "info" ? diagnosticLog(event) : import_effect3.Effect.void;
568
+ }
569
+ return event.type === "lifecycle:error" || event.type === "diagnostic" && event.severity !== "info" ? renderBrowserConsoleEvent(event) : import_effect3.Effect.void;
570
+ }
571
+ };
572
+ var browserDiagnosticConsoleLayer = import_effect3.Layer.locallyScoped(currentDebugSinks, [browserDiagnosticConsoleSink]);
573
+ var browserPrettyLoggerLayer = import_effect3.Logger.replace(
574
+ import_effect3.Logger.defaultLogger,
575
+ import_effect3.Logger.prettyLogger({ mode: "browser", colors: true })
576
+ );
577
+
578
+ // src/internal/runtime/core/DevtoolsHub.ts
579
+ var import_effect4 = require("effect");
580
+ var lastRunTs = 0;
581
+ var lastRunTsSeq = 0;
582
+ var nextRunId = () => {
583
+ const ts = Date.now();
584
+ if (ts === lastRunTs) {
585
+ lastRunTsSeq += 1;
586
+ } else {
587
+ lastRunTs = ts;
588
+ lastRunTsSeq = 0;
589
+ }
590
+ return lastRunTsSeq === 0 ? `run-${ts}` : `run-${ts}.${lastRunTsSeq}`;
591
+ };
592
+ var currentRunId = nextRunId();
593
+
594
+ // src/internal/runtime/core/TaskRunner.ts
595
+ var import_effect5 = require("effect");
596
+ var inSyncTransactionFiber = import_effect5.FiberRef.unsafeMake(false);
597
+ var forceSourceRefresh = import_effect5.FiberRef.unsafeMake(false);
598
+
599
+ // src/internal/runtime/core/DeclarativeLinkRuntime.ts
600
+ var import_effect7 = require("effect");
601
+ var makeDeclarativeLinkRuntime = () => {
602
+ const moduleAsSourceById = /* @__PURE__ */ new Map();
603
+ const moduleAsSourceIdsBySource = /* @__PURE__ */ new Map();
604
+ const declarativeById = /* @__PURE__ */ new Map();
605
+ const declarativeReadNodesBySource = /* @__PURE__ */ new Map();
606
+ const registerModuleAsSourceLink = (link) => {
607
+ const stored = {
608
+ ...link,
609
+ hasValue: false,
610
+ lastValue: void 0
611
+ };
612
+ moduleAsSourceById.set(link.id, stored);
613
+ const set = moduleAsSourceIdsBySource.get(link.sourceModuleInstanceKey) ?? /* @__PURE__ */ new Set();
614
+ set.add(link.id);
615
+ moduleAsSourceIdsBySource.set(link.sourceModuleInstanceKey, set);
616
+ return () => {
617
+ moduleAsSourceById.delete(link.id);
618
+ const current = moduleAsSourceIdsBySource.get(link.sourceModuleInstanceKey);
619
+ if (!current) return;
620
+ current.delete(link.id);
621
+ if (current.size === 0) {
622
+ moduleAsSourceIdsBySource.delete(link.sourceModuleInstanceKey);
623
+ }
624
+ };
625
+ };
626
+ const registerDeclarativeLink = (link) => {
627
+ const readNodeById = /* @__PURE__ */ new Map();
628
+ for (const n of link.readNodes) {
629
+ readNodeById.set(n.nodeId, n);
630
+ }
631
+ const dispatchNodeById = /* @__PURE__ */ new Map();
632
+ for (const n of link.dispatchNodes) {
633
+ dispatchNodeById.set(n.nodeId, n);
634
+ }
635
+ const incomingByDispatch = /* @__PURE__ */ new Map();
636
+ for (const e of link.ir.edges) {
637
+ const to = e.to;
638
+ const isDispatch = dispatchNodeById.has(to);
639
+ if (!isDispatch) continue;
640
+ incomingByDispatch.set(to, (incomingByDispatch.get(to) ?? 0) + 1);
641
+ const count = incomingByDispatch.get(to) ?? 0;
642
+ if (count > 1) {
643
+ throw new Error(
644
+ `[DeclarativeLinkRuntime] Invalid DeclarativeLinkIR: dispatch node has multiple incoming edges (linkId=${link.linkId}, nodeId=${to}).`
645
+ );
646
+ }
647
+ }
648
+ const dispatchTargetsByReadNode = /* @__PURE__ */ new Map();
649
+ for (const e of link.ir.edges) {
650
+ const from = e.from;
651
+ const to = e.to;
652
+ if (!readNodeById.has(from)) continue;
653
+ if (!dispatchNodeById.has(to)) continue;
654
+ const list = dispatchTargetsByReadNode.get(from) ?? [];
655
+ list.push(to);
656
+ dispatchTargetsByReadNode.set(from, list);
657
+ }
658
+ const stored = {
659
+ ...link,
660
+ readNodeById,
661
+ dispatchNodeById,
662
+ dispatchTargetsByReadNode,
663
+ readNodeState: /* @__PURE__ */ new Map()
664
+ };
665
+ declarativeById.set(link.linkId, stored);
666
+ for (const n of link.readNodes) {
667
+ const list = declarativeReadNodesBySource.get(n.moduleInstanceKey) ?? [];
668
+ list.push({ linkId: link.linkId, nodeId: n.nodeId });
669
+ declarativeReadNodesBySource.set(n.moduleInstanceKey, list);
670
+ }
671
+ return () => {
672
+ declarativeById.delete(link.linkId);
673
+ for (const n of link.readNodes) {
674
+ const list = declarativeReadNodesBySource.get(n.moduleInstanceKey);
675
+ if (!list) continue;
676
+ const next = list.filter((x) => !(x.linkId === link.linkId && x.nodeId === n.nodeId));
677
+ if (next.length === 0) {
678
+ declarativeReadNodesBySource.delete(n.moduleInstanceKey);
679
+ } else {
680
+ declarativeReadNodesBySource.set(n.moduleInstanceKey, next);
681
+ }
682
+ }
683
+ };
684
+ };
685
+ const applyForSources = (args) => import_effect7.Effect.gen(function* () {
686
+ let scheduled = false;
687
+ for (const sourceKey of args.changedModuleInstanceKeys) {
688
+ const ids = moduleAsSourceIdsBySource.get(sourceKey);
689
+ if (!ids || ids.size === 0) continue;
690
+ const commit = args.acceptedModules.get(sourceKey);
691
+ if (!commit) continue;
692
+ for (const id of ids) {
693
+ const link = moduleAsSourceById.get(id);
694
+ if (!link) continue;
695
+ let selected;
696
+ try {
697
+ selected = link.readQuery.select(commit.state);
698
+ } catch {
699
+ continue;
700
+ }
701
+ const nextValue = link.computeValue(selected);
702
+ if (link.hasValue && link.equalsValue(link.lastValue, nextValue)) {
703
+ continue;
704
+ }
705
+ link.hasValue = true;
706
+ link.lastValue = nextValue;
707
+ scheduled = true;
708
+ yield* link.applyValue(nextValue);
709
+ }
710
+ }
711
+ for (const sourceKey of args.changedModuleInstanceKeys) {
712
+ const refs = declarativeReadNodesBySource.get(sourceKey);
713
+ if (!refs || refs.length === 0) continue;
714
+ const commit = args.acceptedModules.get(sourceKey);
715
+ if (!commit) continue;
716
+ for (const ref of refs) {
717
+ const link = declarativeById.get(ref.linkId);
718
+ if (!link) continue;
719
+ const readNode = link.readNodeById.get(ref.nodeId);
720
+ if (!readNode) continue;
721
+ let value;
722
+ try {
723
+ value = readNode.readQuery.select(commit.state);
724
+ } catch {
725
+ continue;
726
+ }
727
+ const state = link.readNodeState.get(ref.nodeId) ?? { hasValue: false, lastValue: void 0 };
728
+ const changed = !state.hasValue || !Object.is(state.lastValue, value);
729
+ if (!changed) continue;
730
+ state.hasValue = true;
731
+ state.lastValue = value;
732
+ link.readNodeState.set(ref.nodeId, state);
733
+ const targets = link.dispatchTargetsByReadNode.get(ref.nodeId) ?? [];
734
+ for (const dispatchNodeId of targets) {
735
+ const node = link.dispatchNodeById.get(dispatchNodeId);
736
+ if (!node) continue;
737
+ scheduled = true;
738
+ yield* node.dispatch(value);
739
+ }
740
+ }
741
+ }
742
+ return { scheduled };
743
+ });
744
+ return {
745
+ registerModuleAsSourceLink,
746
+ registerDeclarativeLink,
747
+ applyForSources
748
+ };
749
+ };
750
+
751
+ // src/internal/runtime/core/env.ts
117
752
  var getNodeEnv = () => {
118
753
  try {
119
754
  const env = globalThis?.process?.env;
@@ -123,31 +758,54 @@ var getNodeEnv = () => {
123
758
  }
124
759
  };
125
760
  var isDevEnv = () => getNodeEnv() !== "production";
126
- var StateTransactionConfigTagImpl = class extends import_effect.Context.Tag("@logixjs/core/StateTransactionRuntimeConfig")() {
761
+ var StateTransactionConfigTagImpl = class extends import_effect8.Context.Tag("@logixjs/core/StateTransactionRuntimeConfig")() {
762
+ };
763
+ var ReadQueryStrictGateConfigTagImpl = class extends import_effect8.Context.Tag("@logixjs/core/ReadQueryStrictGateRuntimeConfig")() {
764
+ };
765
+ var ReplayModeConfigTagImpl = class extends import_effect8.Context.Tag("@logixjs/core/ReplayModeConfig")() {
127
766
  };
128
- var ReadQueryStrictGateConfigTagImpl = class extends import_effect.Context.Tag("@logixjs/core/ReadQueryStrictGateRuntimeConfig")() {
767
+ var StateTransactionOverridesTagImpl = class extends import_effect8.Context.Tag("@logixjs/core/StateTransactionOverrides")() {
129
768
  };
130
- var ReplayModeConfigTagImpl = class extends import_effect.Context.Tag("@logixjs/core/ReplayModeConfig")() {
769
+ var ConcurrencyPolicyTagImpl = class extends import_effect8.Context.Tag("@logixjs/core/ConcurrencyPolicy")() {
131
770
  };
132
- var StateTransactionOverridesTagImpl = class extends import_effect.Context.Tag("@logixjs/core/StateTransactionOverrides")() {
771
+ var ConcurrencyPolicyOverridesTagImpl = class extends import_effect8.Context.Tag("@logixjs/core/ConcurrencyPolicyOverrides")() {
133
772
  };
134
- var ConcurrencyPolicyTagImpl = class extends import_effect.Context.Tag("@logixjs/core/ConcurrencyPolicy")() {
773
+ var RuntimeStoreTag = class extends import_effect8.Context.Tag("@logixjs/core/RuntimeStore")() {
135
774
  };
136
- var ConcurrencyPolicyOverridesTagImpl = class extends import_effect.Context.Tag("@logixjs/core/ConcurrencyPolicyOverrides")() {
775
+ var runtimeStoreLayer = import_effect8.Layer.scoped(
776
+ RuntimeStoreTag,
777
+ import_effect8.Effect.acquireRelease(
778
+ import_effect8.Effect.sync(() => makeRuntimeStore()),
779
+ (store) => import_effect8.Effect.sync(() => store.dispose())
780
+ )
781
+ );
782
+ var HostSchedulerTag = class extends import_effect8.Context.Tag("@logixjs/core/HostScheduler")() {
783
+ };
784
+ var hostSchedulerLayer = import_effect8.Layer.succeed(
785
+ HostSchedulerTag,
786
+ getGlobalHostScheduler()
787
+ );
788
+ var DeclarativeLinkRuntimeTag = class extends import_effect8.Context.Tag("@logixjs/core/DeclarativeLinkRuntime")() {
789
+ };
790
+ var declarativeLinkRuntimeLayer = import_effect8.Layer.succeed(
791
+ DeclarativeLinkRuntimeTag,
792
+ makeDeclarativeLinkRuntime()
793
+ );
794
+ var TickSchedulerTag = class extends import_effect8.Context.Tag("@logixjs/core/TickScheduler")() {
137
795
  };
138
796
 
139
797
  // src/internal/runtime/core/RuntimeKernel.ts
140
- var RuntimeServicesRuntimeConfigTagImpl = class extends import_effect2.Context.Tag("@logixjs/core/RuntimeServicesRuntimeConfig")() {
798
+ var RuntimeServicesRuntimeConfigTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/RuntimeServicesRuntimeConfig")() {
141
799
  };
142
800
  var RuntimeServicesRuntimeConfigTag = RuntimeServicesRuntimeConfigTagImpl;
143
- var RuntimeServicesProviderOverridesTagImpl = class extends import_effect2.Context.Tag("@logixjs/core/RuntimeServicesProviderOverrides")() {
801
+ var RuntimeServicesProviderOverridesTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/RuntimeServicesProviderOverrides")() {
144
802
  };
145
- var RuntimeServicesInstanceOverridesTagImpl = class extends import_effect2.Context.Tag("@logixjs/core/RuntimeServicesInstanceOverrides")() {
803
+ var RuntimeServicesInstanceOverridesTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/RuntimeServicesInstanceOverrides")() {
146
804
  };
147
- var FullCutoverGateModeTagImpl = class extends import_effect2.Context.Tag("@logixjs/core/FullCutoverGateMode")() {
805
+ var FullCutoverGateModeTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/FullCutoverGateMode")() {
148
806
  };
149
807
  var FullCutoverGateModeTag = FullCutoverGateModeTagImpl;
150
- var RuntimeServicesRegistryTagImpl = class extends import_effect2.Context.Tag("@logixjs/core/RuntimeServicesRegistry")() {
808
+ var RuntimeServicesRegistryTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/RuntimeServicesRegistry")() {
151
809
  };
152
810
  var RuntimeServicesRegistryTag = RuntimeServicesRegistryTagImpl;
153
811
  var RUNTIME_SERVICES_EVIDENCE = /* @__PURE__ */ Symbol.for("@logixjs/core/runtimeServicesEvidence");
@@ -183,7 +841,7 @@ var getRuntimeServicesEvidence = (runtime) => {
183
841
  };
184
842
 
185
843
  // src/internal/runtime/core/KernelRef.ts
186
- var import_effect3 = require("effect");
844
+ var import_effect10 = require("effect");
187
845
  var isKernelId = (value) => typeof value === "string" && value.length > 0 && /^[a-z0-9-]+$/.test(value);
188
846
  var defaultKernelImplementationRef = {
189
847
  kernelId: "core",
@@ -212,7 +870,7 @@ var isKernelImplementationRef = (value) => {
212
870
  }
213
871
  return true;
214
872
  };
215
- var KernelImplementationRefTagImpl = class extends import_effect3.Context.Tag("@logixjs/core/KernelImplementationRef")() {
873
+ var KernelImplementationRefTagImpl = class extends import_effect10.Context.Tag("@logixjs/core/KernelImplementationRef")() {
216
874
  };
217
875
  var KernelImplementationRefTag = KernelImplementationRefTagImpl;
218
876
  var KERNEL_IMPLEMENTATION_REF = /* @__PURE__ */ Symbol.for("@logixjs/core/kernelImplementationRef");
@@ -238,8 +896,8 @@ var getKernelImplementationRef = (runtime) => {
238
896
  };
239
897
 
240
898
  // src/internal/runtime/core/RuntimeServiceBuiltins.ts
241
- var import_effect4 = require("effect");
242
- var RuntimeServiceBuiltinsTag = class extends import_effect4.Context.Tag("@logixjs/core/RuntimeServiceBuiltins")() {
899
+ var import_effect11 = require("effect");
900
+ var RuntimeServiceBuiltinsTag = class extends import_effect11.Context.Tag("@logixjs/core/RuntimeServiceBuiltins")() {
243
901
  };
244
902
 
245
903
  // src/Kernel.ts
@@ -256,14 +914,14 @@ var evaluateFullCutoverGate2 = (args) => {
256
914
  });
257
915
  };
258
916
  var KernelContractMetaAllowlist = [];
259
- var kernelLayer = (ref) => import_effect5.Layer.succeed(KernelImplementationRefTag, ref);
260
- var runtimeDefaultServicesOverridesLayer = (services) => import_effect5.Layer.succeed(RuntimeServicesRuntimeConfigTag, {
917
+ var kernelLayer = (ref) => import_effect12.Layer.succeed(KernelImplementationRefTag, ref);
918
+ var runtimeDefaultServicesOverridesLayer = (services) => import_effect12.Layer.succeed(RuntimeServicesRuntimeConfigTag, {
261
919
  services
262
920
  });
263
921
  var getRuntimeServicesEvidence2 = getRuntimeServicesEvidence;
264
922
  var getKernelImplementationRef2 = getKernelImplementationRef;
265
- var runtimeServicesRegistryLayer = (registry) => import_effect5.Layer.succeed(RuntimeServicesRegistryTag, registry);
266
- var fullCutoverGateModeLayer = (mode) => import_effect5.Layer.succeed(FullCutoverGateModeTag, mode);
923
+ var runtimeServicesRegistryLayer = (registry) => import_effect12.Layer.succeed(RuntimeServicesRegistryTag, registry);
924
+ var fullCutoverGateModeLayer = (mode) => import_effect12.Layer.succeed(FullCutoverGateModeTag, mode);
267
925
  var isKernelFullyActivated = (evidence) => !evidence.overridesApplied.some((s) => s.includes("fallback="));
268
926
  // Annotate the CommonJS export names for ESM import in node:
269
927
  0 && (module.exports = {