@logixjs/core 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/LICENSE +201 -0
  2. package/dist/{Action-mqVvtEHt.d.ts → Action-DYl88bwj.d.ts} +1 -1
  3. package/dist/{Action-BkRHy2vg.d.cts → Action-DkxsI_DK.d.cts} +1 -1
  4. package/dist/Action.cjs.map +1 -1
  5. package/dist/Action.d.cts +1 -1
  6. package/dist/Action.d.ts +1 -1
  7. package/dist/Action.js +2 -2
  8. package/dist/{Actions-AsQ07yTP.d.cts → Actions-Dicm7jdc.d.cts} +2 -2
  9. package/dist/{Actions-AsQ07yTP.d.ts → Actions-Dicm7jdc.d.ts} +2 -2
  10. package/dist/Actions.cjs.map +1 -1
  11. package/dist/Actions.d.cts +1 -1
  12. package/dist/Actions.d.ts +1 -1
  13. package/dist/Actions.js +1 -1
  14. package/dist/{Bound-BN1DQ_lM.d.ts → Bound-1OJLzVIS.d.ts} +2 -2
  15. package/dist/{Bound-BPIfH9SS.d.cts → Bound-BMLrtQ1V.d.cts} +2 -2
  16. package/dist/Bound.cjs +1737 -399
  17. package/dist/Bound.cjs.map +1 -1
  18. package/dist/Bound.d.cts +5 -5
  19. package/dist/Bound.d.ts +5 -5
  20. package/dist/Bound.js +19 -17
  21. package/dist/{Debug-B5q5Bkzx.d.ts → Debug-DKrWP5H1.d.ts} +40 -22
  22. package/dist/{Debug-Bq8Sqjcr.d.cts → Debug-hIT44XsY.d.cts} +40 -22
  23. package/dist/Debug.cjs +1348 -318
  24. package/dist/Debug.cjs.map +1 -1
  25. package/dist/Debug.d.cts +12 -11
  26. package/dist/Debug.d.ts +12 -11
  27. package/dist/Debug.js +20 -11
  28. package/dist/EffectOp.cjs +15 -6
  29. package/dist/EffectOp.cjs.map +1 -1
  30. package/dist/EffectOp.js +3 -3
  31. package/dist/Env.cjs +772 -6
  32. package/dist/Env.cjs.map +1 -1
  33. package/dist/Env.js +5 -2
  34. package/dist/ExternalStore-DqJKKRJ4.d.ts +61 -0
  35. package/dist/ExternalStore-JC-gAgEI.d.cts +61 -0
  36. package/dist/ExternalStore.cjs +774 -0
  37. package/dist/ExternalStore.cjs.map +1 -0
  38. package/dist/ExternalStore.d.cts +8 -0
  39. package/dist/ExternalStore.d.ts +8 -0
  40. package/dist/ExternalStore.js +19 -0
  41. package/dist/ExternalStore.js.map +1 -0
  42. package/dist/{Flow-BhpjE22E.d.ts → Flow-CZmXRDqp.d.cts} +13 -4
  43. package/dist/{Flow-1fZT8MpX.d.cts → Flow-DIVDxz7R.d.ts} +13 -4
  44. package/dist/Flow.cjs +765 -148
  45. package/dist/Flow.cjs.map +1 -1
  46. package/dist/Flow.d.cts +6 -6
  47. package/dist/Flow.d.ts +6 -6
  48. package/dist/Flow.js +9 -8
  49. package/dist/{Handle-D_cLW1Z3.d.ts → Handle-Bo6cAFut.d.ts} +1 -1
  50. package/dist/{Handle-D8D1zPb_.d.cts → Handle-CfDvSqN7.d.cts} +1 -1
  51. package/dist/Handle.d.cts +5 -5
  52. package/dist/Handle.d.ts +5 -5
  53. package/dist/{Kernel-8kC-jOda.d.cts → Kernel-CuXBF9S_.d.cts} +16 -7
  54. package/dist/{Kernel-CnGE1Fyk.d.ts → Kernel-D9guNwRL.d.ts} +16 -7
  55. package/dist/Kernel.cjs +814 -26
  56. package/dist/Kernel.cjs.map +1 -1
  57. package/dist/Kernel.d.cts +13 -12
  58. package/dist/Kernel.d.ts +13 -12
  59. package/dist/Kernel.js +7 -4
  60. package/dist/{Link-Db7975nU.d.ts → Link-CUM0yUCH.d.ts} +10 -3
  61. package/dist/{Link-fX8x1eCK.d.cts → Link-NAfR6uGD.d.cts} +10 -3
  62. package/dist/Link.cjs +1294 -121
  63. package/dist/Link.cjs.map +1 -1
  64. package/dist/Link.d.cts +5 -5
  65. package/dist/Link.d.ts +5 -5
  66. package/dist/Link.js +37 -29
  67. package/dist/{Logic-DRh4sDZj.d.cts → Logic-09VQpIj3.d.cts} +7 -4
  68. package/dist/{Logic-BRjEMr-W.d.ts → Logic-DKg7ghGy.d.ts} +7 -4
  69. package/dist/Logic.cjs +2 -1
  70. package/dist/Logic.cjs.map +1 -1
  71. package/dist/Logic.d.cts +5 -5
  72. package/dist/Logic.d.ts +5 -5
  73. package/dist/Logic.js +1 -1
  74. package/dist/{MatchBuilder-CJk5oCkR.d.cts → MatchBuilder-CsW5jgrL.d.ts} +1 -1
  75. package/dist/{MatchBuilder-0QOc-nlU.d.ts → MatchBuilder-Dksk07F4.d.cts} +1 -1
  76. package/dist/MatchBuilder.cjs +2 -2
  77. package/dist/MatchBuilder.cjs.map +1 -1
  78. package/dist/MatchBuilder.d.cts +6 -6
  79. package/dist/MatchBuilder.d.ts +6 -6
  80. package/dist/MatchBuilder.js +2 -2
  81. package/dist/Middleware-D8tUDLv_.d.cts +100 -0
  82. package/dist/Middleware-DS7CbTTN.d.ts +100 -0
  83. package/dist/Middleware.cjs +678 -58
  84. package/dist/Middleware.cjs.map +1 -1
  85. package/dist/Middleware.d.cts +2 -86
  86. package/dist/Middleware.d.ts +2 -86
  87. package/dist/Middleware.js +15 -12
  88. package/dist/{Module-DnzluX2J.d.ts → Module-B_Cntyms.d.ts} +54 -25
  89. package/dist/{Module-B_0xRDMR.d.cts → Module-CmNOVXzf.d.cts} +54 -25
  90. package/dist/Module.cjs +9331 -3317
  91. package/dist/Module.cjs.map +1 -1
  92. package/dist/Module.d.cts +7 -6
  93. package/dist/Module.d.ts +7 -6
  94. package/dist/Module.js +39 -31
  95. package/dist/ModuleTag-CGho_InD.d.ts +113 -0
  96. package/dist/ModuleTag-CITb8L_G.d.cts +113 -0
  97. package/dist/ModuleTag.cjs +7248 -2847
  98. package/dist/ModuleTag.cjs.map +1 -1
  99. package/dist/ModuleTag.d.cts +6 -6
  100. package/dist/ModuleTag.d.ts +6 -6
  101. package/dist/ModuleTag.js +35 -29
  102. package/dist/Observability-Bdhnx2Dv.d.ts +385 -0
  103. package/dist/Observability-DXGAFBIT.d.cts +385 -0
  104. package/dist/Observability.cjs +5093 -1556
  105. package/dist/Observability.cjs.map +1 -1
  106. package/dist/Observability.d.cts +6 -7
  107. package/dist/Observability.d.ts +6 -7
  108. package/dist/Observability.js +28 -23
  109. package/dist/{Platform-CHX8o-U4.d.ts → Platform-B4s8tg6C.d.cts} +4 -5
  110. package/dist/{Platform-C49Pv956.d.cts → Platform-BV_0MW7g.d.cts} +5 -2
  111. package/dist/{Platform-C49Pv956.d.ts → Platform-BV_0MW7g.d.ts} +5 -2
  112. package/dist/{Platform-CVlv0xLQ.d.cts → Platform-W0Mefy_e.d.ts} +4 -5
  113. package/dist/Platform.cjs +2 -1
  114. package/dist/Platform.cjs.map +1 -1
  115. package/dist/Platform.d.cts +2 -3
  116. package/dist/Platform.d.ts +2 -3
  117. package/dist/Platform.js +2 -2
  118. package/dist/{Process-CM9xbMdP.d.ts → Process-CO8G7HO9.d.cts} +30 -5
  119. package/dist/{Process-mL8fHDSB.d.cts → Process-Cyf6VNDR.d.ts} +30 -5
  120. package/dist/Process.cjs +1288 -120
  121. package/dist/Process.cjs.map +1 -1
  122. package/dist/Process.d.cts +6 -6
  123. package/dist/Process.d.ts +6 -6
  124. package/dist/Process.js +34 -26
  125. package/dist/ReadQuery-C_or5nLC.d.ts +128 -0
  126. package/dist/ReadQuery-DXLzCE0E.d.cts +614 -0
  127. package/dist/ReadQuery-DXLzCE0E.d.ts +614 -0
  128. package/dist/ReadQuery-Yve1lmUo.d.cts +128 -0
  129. package/dist/ReadQuery.cjs +290 -5
  130. package/dist/ReadQuery.cjs.map +1 -1
  131. package/dist/ReadQuery.d.cts +3 -2
  132. package/dist/ReadQuery.d.ts +3 -2
  133. package/dist/ReadQuery.js +23 -5
  134. package/dist/{Reflection-CQnKwPXj.d.ts → Reflection-B2Xi1e4Q.d.ts} +89 -7
  135. package/dist/{Reflection-Kabo1mlU.d.cts → Reflection-DNB4V4_e.d.cts} +89 -7
  136. package/dist/Reflection.cjs +3227 -1617
  137. package/dist/Reflection.cjs.map +1 -1
  138. package/dist/Reflection.d.cts +17 -15
  139. package/dist/Reflection.d.ts +17 -15
  140. package/dist/Reflection.js +33 -25
  141. package/dist/{Resource-Dy1xD_DG.d.cts → Resource-pKvQQ4x5.d.cts} +3 -3
  142. package/dist/{Resource-Dy1xD_DG.d.ts → Resource-pKvQQ4x5.d.ts} +3 -3
  143. package/dist/Resource.cjs +781 -15
  144. package/dist/Resource.cjs.map +1 -1
  145. package/dist/Resource.d.cts +1 -1
  146. package/dist/Resource.d.ts +1 -1
  147. package/dist/Resource.js +6 -3
  148. package/dist/{Root-7ADUMk4t.d.cts → Root-CCVuFHB6.d.cts} +3 -3
  149. package/dist/{Root-7ADUMk4t.d.ts → Root-CCVuFHB6.d.ts} +3 -3
  150. package/dist/Root.cjs +786 -20
  151. package/dist/Root.cjs.map +1 -1
  152. package/dist/Root.d.cts +2 -2
  153. package/dist/Root.d.ts +2 -2
  154. package/dist/Root.js +7 -3
  155. package/dist/{Runtime-CtyzZG4i.d.ts → Runtime-CRmvwK4I.d.ts} +70 -14
  156. package/dist/{Runtime-B-aL-f29.d.cts → Runtime-C_wJM9mN.d.cts} +70 -14
  157. package/dist/Runtime.cjs +4942 -1601
  158. package/dist/Runtime.cjs.map +1 -1
  159. package/dist/Runtime.d.cts +17 -15
  160. package/dist/Runtime.d.ts +17 -15
  161. package/dist/Runtime.js +44 -32
  162. package/dist/{ScopeRegistry-D1owDNSm.d.cts → ScopeRegistry-BhYzqWri.d.cts} +6 -6
  163. package/dist/{ScopeRegistry-D1owDNSm.d.ts → ScopeRegistry-BhYzqWri.d.ts} +6 -6
  164. package/dist/ScopeRegistry.cjs +776 -10
  165. package/dist/ScopeRegistry.cjs.map +1 -1
  166. package/dist/ScopeRegistry.d.cts +1 -1
  167. package/dist/ScopeRegistry.d.ts +1 -1
  168. package/dist/ScopeRegistry.js +6 -3
  169. package/dist/{State-CU50R26M.d.cts → State-rNFsFPTl.d.cts} +2 -2
  170. package/dist/{State-CU50R26M.d.ts → State-rNFsFPTl.d.ts} +2 -2
  171. package/dist/State.cjs.map +1 -1
  172. package/dist/State.d.cts +1 -1
  173. package/dist/State.d.ts +1 -1
  174. package/dist/State.js +1 -1
  175. package/dist/{StateTrait-BGsZghTz.d.ts → StateTrait-CijdwNb6.d.ts} +25 -8
  176. package/dist/{StateTrait-OWhbj12c.d.cts → StateTrait-Dltto6PU.d.cts} +25 -8
  177. package/dist/StateTrait.cjs +1890 -528
  178. package/dist/StateTrait.cjs.map +1 -1
  179. package/dist/StateTrait.d.cts +9 -7
  180. package/dist/StateTrait.d.ts +9 -7
  181. package/dist/StateTrait.js +18 -14
  182. package/dist/{TraitLifecycle-CwV5WPFX.d.cts → TraitLifecycle-BKzDqzLu.d.cts} +2 -2
  183. package/dist/{TraitLifecycle-LdIWmKlg.d.ts → TraitLifecycle-Cvo94uDB.d.ts} +2 -2
  184. package/dist/TraitLifecycle.cjs +630 -67
  185. package/dist/TraitLifecycle.cjs.map +1 -1
  186. package/dist/TraitLifecycle.d.cts +6 -6
  187. package/dist/TraitLifecycle.d.ts +6 -6
  188. package/dist/TraitLifecycle.js +8 -7
  189. package/dist/Workflow-C_OWr4dV.d.ts +415 -0
  190. package/dist/Workflow-DmydkHO8.d.cts +415 -0
  191. package/dist/Workflow.cjs +3150 -0
  192. package/dist/Workflow.cjs.map +1 -0
  193. package/dist/Workflow.d.cts +7 -0
  194. package/dist/Workflow.d.ts +7 -0
  195. package/dist/Workflow.js +58 -0
  196. package/dist/Workflow.js.map +1 -0
  197. package/dist/{action-DiMDD_0v.d.cts → action-BQxjPFEw.d.cts} +5 -5
  198. package/dist/{action-DiMDD_0v.d.ts → action-BQxjPFEw.d.ts} +5 -5
  199. package/dist/chunk-2XRLXDWR.js +276 -0
  200. package/dist/chunk-2XRLXDWR.js.map +1 -0
  201. package/dist/chunk-3L6QGFMM.js +701 -0
  202. package/dist/chunk-3L6QGFMM.js.map +1 -0
  203. package/dist/{chunk-GMPEOUP2.js → chunk-4MZ7BT3R.js} +2 -2
  204. package/dist/chunk-4MZ7BT3R.js.map +1 -0
  205. package/dist/{chunk-3IYZ5IGG.js → chunk-5WKUGEBY.js} +2 -2
  206. package/dist/{chunk-3RMKLXHX.js → chunk-63ZQ5RIN.js} +2 -2
  207. package/dist/{chunk-M3WTHJHJ.js → chunk-67DIEA53.js} +385 -148
  208. package/dist/chunk-67DIEA53.js.map +1 -0
  209. package/dist/{chunk-YS3AZQ2G.js → chunk-6HFAW2MH.js} +1 -1
  210. package/dist/chunk-6HFAW2MH.js.map +1 -0
  211. package/dist/{chunk-EY4NZKDR.js → chunk-6Y2TKCNY.js} +2 -2
  212. package/dist/{chunk-76WT3HOR.js → chunk-6YZOXFPQ.js} +25 -24
  213. package/dist/chunk-6YZOXFPQ.js.map +1 -0
  214. package/dist/{chunk-G5ZBFPNU.js → chunk-A2RQOJC7.js} +2 -2
  215. package/dist/{chunk-AUIR5O6W.js → chunk-AFSB6NKM.js} +13 -19
  216. package/dist/chunk-AFSB6NKM.js.map +1 -0
  217. package/dist/{chunk-JCXGZRMU.js → chunk-AO4JEOKD.js} +22 -23
  218. package/dist/chunk-AO4JEOKD.js.map +1 -0
  219. package/dist/{chunk-TAAPQVZN.js → chunk-AYELIQXR.js} +2 -2
  220. package/dist/{chunk-QMM6O4CD.js → chunk-BLHZW7DG.js} +15 -3
  221. package/dist/{chunk-QMM6O4CD.js.map → chunk-BLHZW7DG.js.map} +1 -1
  222. package/dist/{chunk-TQOBJYDP.js → chunk-CD4N74YC.js} +1 -1
  223. package/dist/chunk-CD4N74YC.js.map +1 -0
  224. package/dist/{chunk-ANLBCBDC.js → chunk-CGE2HBTH.js} +11 -11
  225. package/dist/chunk-CGE2HBTH.js.map +1 -0
  226. package/dist/{chunk-OFADUJWJ.js → chunk-CYYSQMLO.js} +5 -5
  227. package/dist/chunk-CYYSQMLO.js.map +1 -0
  228. package/dist/{chunk-66ALHVEX.js → chunk-EB46EYI7.js} +3 -3
  229. package/dist/{chunk-NZJKFF45.js → chunk-EKCDHWRK.js} +4 -4
  230. package/dist/chunk-EKCDHWRK.js.map +1 -0
  231. package/dist/{chunk-BABLDP24.js → chunk-EPQFNJU3.js} +152 -7
  232. package/dist/chunk-EPQFNJU3.js.map +1 -0
  233. package/dist/{chunk-OGWBVHB3.js → chunk-ESR6HGOY.js} +73 -14
  234. package/dist/chunk-ESR6HGOY.js.map +1 -0
  235. package/dist/{chunk-NBD3KUOZ.js → chunk-F6RP62H3.js} +150 -98
  236. package/dist/chunk-F6RP62H3.js.map +1 -0
  237. package/dist/chunk-FBYW3QDI.js +252 -0
  238. package/dist/chunk-FBYW3QDI.js.map +1 -0
  239. package/dist/{chunk-IPF7E66P.js → chunk-FYAODKVP.js} +2 -2
  240. package/dist/chunk-GNEN7NKO.js +908 -0
  241. package/dist/chunk-GNEN7NKO.js.map +1 -0
  242. package/dist/chunk-GWSM4KLB.js +763 -0
  243. package/dist/chunk-GWSM4KLB.js.map +1 -0
  244. package/dist/{chunk-4SO6JMZL.js → chunk-HDMXCUZL.js} +1 -1
  245. package/dist/chunk-HDMXCUZL.js.map +1 -0
  246. package/dist/{chunk-ZFY7U2FR.js → chunk-HJM5Y5NU.js} +43 -3
  247. package/dist/chunk-HJM5Y5NU.js.map +1 -0
  248. package/dist/{chunk-ZGDVUPTM.js → chunk-IOZ3VKPK.js} +129 -68
  249. package/dist/chunk-IOZ3VKPK.js.map +1 -0
  250. package/dist/{chunk-PYOE4VSI.js → chunk-IVXSVHO4.js} +303 -247
  251. package/dist/chunk-IVXSVHO4.js.map +1 -0
  252. package/dist/chunk-J3CWXIPV.js +242 -0
  253. package/dist/chunk-J3CWXIPV.js.map +1 -0
  254. package/dist/chunk-K6JQW266.js +42 -0
  255. package/dist/chunk-K6JQW266.js.map +1 -0
  256. package/dist/chunk-KMZYQF6Q.js +202 -0
  257. package/dist/chunk-KMZYQF6Q.js.map +1 -0
  258. package/dist/{chunk-JWOYLO27.js → chunk-LPPZDFTD.js} +22 -12
  259. package/dist/chunk-LPPZDFTD.js.map +1 -0
  260. package/dist/{chunk-PAYXCY6A.js → chunk-MYB2B5WX.js} +997 -576
  261. package/dist/chunk-MYB2B5WX.js.map +1 -0
  262. package/dist/chunk-MYKNINNN.js +228 -0
  263. package/dist/chunk-MYKNINNN.js.map +1 -0
  264. package/dist/chunk-NSQIRMVF.js +27 -0
  265. package/dist/{chunk-QCHIQWAJ.js.map → chunk-NSQIRMVF.js.map} +1 -1
  266. package/dist/chunk-NUDBM4MM.js +30 -0
  267. package/dist/chunk-NUDBM4MM.js.map +1 -0
  268. package/dist/chunk-NZMWWDAY.js +23 -0
  269. package/dist/chunk-NZMWWDAY.js.map +1 -0
  270. package/dist/{chunk-RNFE3ML2.js → chunk-OCUV2Y25.js} +4 -3
  271. package/dist/chunk-OCUV2Y25.js.map +1 -0
  272. package/dist/chunk-P4ZJOQA7.js +271 -0
  273. package/dist/chunk-P4ZJOQA7.js.map +1 -0
  274. package/dist/chunk-P6C5EZ3D.js +342 -0
  275. package/dist/chunk-P6C5EZ3D.js.map +1 -0
  276. package/dist/{chunk-CW6T36TN.js → chunk-PBD7BJUN.js} +62 -4
  277. package/dist/chunk-PBD7BJUN.js.map +1 -0
  278. package/dist/chunk-PBIUCQY3.js +696 -0
  279. package/dist/chunk-PBIUCQY3.js.map +1 -0
  280. package/dist/chunk-PD6YECQH.js +845 -0
  281. package/dist/chunk-PD6YECQH.js.map +1 -0
  282. package/dist/{chunk-M7IYCTJV.js → chunk-R4LFQGP3.js} +2 -2
  283. package/dist/chunk-RHJIGDUE.js +21 -0
  284. package/dist/chunk-RHJIGDUE.js.map +1 -0
  285. package/dist/{chunk-KP7MUZNX.js → chunk-RLXO27MW.js} +30 -8
  286. package/dist/chunk-RLXO27MW.js.map +1 -0
  287. package/dist/{chunk-DFNM3WX2.js → chunk-S44BEV4B.js} +168 -45
  288. package/dist/chunk-S44BEV4B.js.map +1 -0
  289. package/dist/chunk-S4S5N4BJ.js +1461 -0
  290. package/dist/chunk-S4S5N4BJ.js.map +1 -0
  291. package/dist/{chunk-BZ2SHDN2.js → chunk-SGTRAXXX.js} +3 -3
  292. package/dist/chunk-SGTRAXXX.js.map +1 -0
  293. package/dist/{chunk-M2RGJPXX.js → chunk-SJAE5PB5.js} +3 -3
  294. package/dist/{chunk-JGIWG6SR.js → chunk-SNPNHU3H.js} +3937 -1776
  295. package/dist/chunk-SNPNHU3H.js.map +1 -0
  296. package/dist/{chunk-IHVBV5C2.js → chunk-SOOBFXRR.js} +94 -71
  297. package/dist/chunk-SOOBFXRR.js.map +1 -0
  298. package/dist/{chunk-ZDTRWK5F.js → chunk-TAHFWKS6.js} +2 -2
  299. package/dist/chunk-UEFFTVPY.js +9 -0
  300. package/dist/chunk-UEFFTVPY.js.map +1 -0
  301. package/dist/{chunk-24VULZ7A.js → chunk-UR5BXLBP.js} +3 -3
  302. package/dist/chunk-UR5BXLBP.js.map +1 -0
  303. package/dist/{chunk-DMBALCE2.js → chunk-V2SBGVDO.js} +471 -186
  304. package/dist/chunk-V2SBGVDO.js.map +1 -0
  305. package/dist/chunk-VJLWD47W.js +23 -0
  306. package/dist/chunk-VJLWD47W.js.map +1 -0
  307. package/dist/{chunk-4CQAV7YB.js → chunk-W647DX5Z.js} +2 -2
  308. package/dist/{chunk-THATMZXD.js → chunk-WFIIU3YZ.js} +2 -2
  309. package/dist/{chunk-THATMZXD.js.map → chunk-WFIIU3YZ.js.map} +1 -1
  310. package/dist/chunk-YZDJMAKL.js +82 -0
  311. package/dist/chunk-YZDJMAKL.js.map +1 -0
  312. package/dist/{chunk-3TMODYZV.js → chunk-Z5XH6VHY.js} +5 -5
  313. package/dist/chunk-Z5XH6VHY.js.map +1 -0
  314. package/dist/{chunk-BE3HW4FY.js → chunk-ZBBMZMA6.js} +377 -170
  315. package/dist/chunk-ZBBMZMA6.js.map +1 -0
  316. package/dist/index.cjs +21224 -11714
  317. package/dist/index.cjs.map +1 -1
  318. package/dist/index.d.cts +195 -49
  319. package/dist/index.d.ts +195 -49
  320. package/dist/index.js +150 -74
  321. package/dist/index.js.map +1 -1
  322. package/dist/{ir-BMP7yxJJ.d.cts → ir-BSosEwc8.d.cts} +1 -1
  323. package/dist/{ir-DUOz6H-5.d.ts → ir-D-uqwL_4.d.ts} +1 -1
  324. package/dist/{module-B8CBqIZ_.d.cts → module-Ds4tarcI.d.cts} +230 -140
  325. package/dist/{module-k7m3txak.d.ts → module-Zd1Gn-Nj.d.ts} +230 -140
  326. package/package.json +20 -4
  327. package/dist/ModuleTag-C8FHY_sY.d.ts +0 -93
  328. package/dist/ModuleTag-EGbgBMpZ.d.cts +0 -93
  329. package/dist/Observability-COqEvp2C.d.cts +0 -713
  330. package/dist/Observability-cY4kLn0S.d.ts +0 -713
  331. package/dist/ReadQuery-BlMwhe-F.d.ts +0 -30
  332. package/dist/ReadQuery-CL5XlXts.d.cts +0 -30
  333. package/dist/ReadQuery-SinbStGF.d.cts +0 -38
  334. package/dist/ReadQuery-SinbStGF.d.ts +0 -38
  335. package/dist/chunk-24VULZ7A.js.map +0 -1
  336. package/dist/chunk-3QMIVH35.js +0 -43
  337. package/dist/chunk-3QMIVH35.js.map +0 -1
  338. package/dist/chunk-3TMODYZV.js.map +0 -1
  339. package/dist/chunk-4SO6JMZL.js.map +0 -1
  340. package/dist/chunk-76WT3HOR.js.map +0 -1
  341. package/dist/chunk-ANLBCBDC.js.map +0 -1
  342. package/dist/chunk-AUIR5O6W.js.map +0 -1
  343. package/dist/chunk-BABLDP24.js.map +0 -1
  344. package/dist/chunk-BE3HW4FY.js.map +0 -1
  345. package/dist/chunk-BZ2SHDN2.js.map +0 -1
  346. package/dist/chunk-CW6T36TN.js.map +0 -1
  347. package/dist/chunk-DFNM3WX2.js.map +0 -1
  348. package/dist/chunk-DMBALCE2.js.map +0 -1
  349. package/dist/chunk-EGK3KN7B.js +0 -406
  350. package/dist/chunk-EGK3KN7B.js.map +0 -1
  351. package/dist/chunk-GMPEOUP2.js.map +0 -1
  352. package/dist/chunk-IHVBV5C2.js.map +0 -1
  353. package/dist/chunk-JCXGZRMU.js.map +0 -1
  354. package/dist/chunk-JGIWG6SR.js.map +0 -1
  355. package/dist/chunk-JWOYLO27.js.map +0 -1
  356. package/dist/chunk-KIXAU3GM.js +0 -137
  357. package/dist/chunk-KIXAU3GM.js.map +0 -1
  358. package/dist/chunk-KL5ACTCT.js +0 -8
  359. package/dist/chunk-KL5ACTCT.js.map +0 -1
  360. package/dist/chunk-KP7MUZNX.js.map +0 -1
  361. package/dist/chunk-M3BFQ7HK.js +0 -13
  362. package/dist/chunk-M3BFQ7HK.js.map +0 -1
  363. package/dist/chunk-M3WTHJHJ.js.map +0 -1
  364. package/dist/chunk-NBD3KUOZ.js.map +0 -1
  365. package/dist/chunk-NQZ2OSGR.js +0 -151
  366. package/dist/chunk-NQZ2OSGR.js.map +0 -1
  367. package/dist/chunk-NZJKFF45.js.map +0 -1
  368. package/dist/chunk-OFADUJWJ.js.map +0 -1
  369. package/dist/chunk-OGWBVHB3.js.map +0 -1
  370. package/dist/chunk-PAYXCY6A.js.map +0 -1
  371. package/dist/chunk-PYOE4VSI.js.map +0 -1
  372. package/dist/chunk-QCHIQWAJ.js +0 -21
  373. package/dist/chunk-RNFE3ML2.js.map +0 -1
  374. package/dist/chunk-TKZ7MEIA.js +0 -27
  375. package/dist/chunk-TKZ7MEIA.js.map +0 -1
  376. package/dist/chunk-TQOBJYDP.js.map +0 -1
  377. package/dist/chunk-VZB726PE.js +0 -93
  378. package/dist/chunk-VZB726PE.js.map +0 -1
  379. package/dist/chunk-W3TEWHLO.js +0 -568
  380. package/dist/chunk-W3TEWHLO.js.map +0 -1
  381. package/dist/chunk-YS3AZQ2G.js.map +0 -1
  382. package/dist/chunk-ZFLHVFUC.js +0 -192
  383. package/dist/chunk-ZFLHVFUC.js.map +0 -1
  384. package/dist/chunk-ZFY7U2FR.js.map +0 -1
  385. package/dist/chunk-ZGDVUPTM.js.map +0 -1
  386. package/dist/protocol-g_1897M2.d.cts +0 -127
  387. package/dist/protocol-g_1897M2.d.ts +0 -127
  388. /package/dist/{chunk-3IYZ5IGG.js.map → chunk-5WKUGEBY.js.map} +0 -0
  389. /package/dist/{chunk-3RMKLXHX.js.map → chunk-63ZQ5RIN.js.map} +0 -0
  390. /package/dist/{chunk-EY4NZKDR.js.map → chunk-6Y2TKCNY.js.map} +0 -0
  391. /package/dist/{chunk-G5ZBFPNU.js.map → chunk-A2RQOJC7.js.map} +0 -0
  392. /package/dist/{chunk-TAAPQVZN.js.map → chunk-AYELIQXR.js.map} +0 -0
  393. /package/dist/{chunk-66ALHVEX.js.map → chunk-EB46EYI7.js.map} +0 -0
  394. /package/dist/{chunk-IPF7E66P.js.map → chunk-FYAODKVP.js.map} +0 -0
  395. /package/dist/{chunk-M7IYCTJV.js.map → chunk-R4LFQGP3.js.map} +0 -0
  396. /package/dist/{chunk-M2RGJPXX.js.map → chunk-SJAE5PB5.js.map} +0 -0
  397. /package/dist/{chunk-ZDTRWK5F.js.map → chunk-TAHFWKS6.js.map} +0 -0
  398. /package/dist/{chunk-4CQAV7YB.js.map → chunk-W647DX5Z.js.map} +0 -0
@@ -0,0 +1,696 @@
1
+ import {
2
+ ProcessRuntimeTag,
3
+ layer
4
+ } from "./chunk-MYB2B5WX.js";
5
+ import {
6
+ make
7
+ } from "./chunk-ZBBMZMA6.js";
8
+ import {
9
+ RootContextTag,
10
+ makeRootContext,
11
+ mergeRootContext,
12
+ readyRootContext
13
+ } from "./chunk-YZDJMAKL.js";
14
+ import {
15
+ ConcurrencyPolicyTag,
16
+ HostSchedulerTag,
17
+ ReadQueryStrictGateConfigTag,
18
+ SchedulingPolicySurfaceTag,
19
+ StateTransactionConfigTag,
20
+ declarativeLinkRuntimeLayer,
21
+ hostSchedulerLayer,
22
+ runtimeStoreLayer,
23
+ tickSchedulerLayer
24
+ } from "./chunk-S4S5N4BJ.js";
25
+
26
+ // src/internal/runtime/core/runner/ProgramRunner.errors.ts
27
+ var summarizeCause = (cause) => {
28
+ if (cause instanceof Error) {
29
+ return { name: cause.name, message: cause.message };
30
+ }
31
+ return { message: typeof cause === "string" ? cause : void 0 };
32
+ };
33
+ var ProgramRunnerErrorBase = class extends Error {
34
+ constructor(params) {
35
+ super(params.message);
36
+ this.moduleId = params.identity.moduleId;
37
+ this.instanceId = params.identity.instanceId;
38
+ this.entrypoint = params.entrypoint;
39
+ this.hint = params.hint;
40
+ }
41
+ toJSON() {
42
+ return {
43
+ _tag: this._tag,
44
+ name: this.name,
45
+ message: this.message,
46
+ moduleId: this.moduleId,
47
+ instanceId: this.instanceId,
48
+ entrypoint: this.entrypoint,
49
+ hint: this.hint
50
+ };
51
+ }
52
+ };
53
+ var BootError = class extends ProgramRunnerErrorBase {
54
+ constructor(identity, cause) {
55
+ super({
56
+ message: "[Logix] Program boot failed",
57
+ identity,
58
+ entrypoint: "boot",
59
+ hint: "Check that options.layer / imports / providers are complete, and that no dependencies are missing during assembly."
60
+ });
61
+ this._tag = "BootError";
62
+ this.name = "BootError";
63
+ this.cause = summarizeCause(cause);
64
+ }
65
+ toJSON() {
66
+ return { ...super.toJSON(), cause: this.cause };
67
+ }
68
+ };
69
+ var MainError = class extends ProgramRunnerErrorBase {
70
+ constructor(identity, cause) {
71
+ super({
72
+ message: "[Logix] Program main failed",
73
+ identity,
74
+ entrypoint: "main",
75
+ hint: "Main failed: ensure main handles domain errors explicitly, and check for interruption or missing dependencies."
76
+ });
77
+ this._tag = "MainError";
78
+ this.name = "MainError";
79
+ this.cause = summarizeCause(cause);
80
+ }
81
+ toJSON() {
82
+ return { ...super.toJSON(), cause: this.cause };
83
+ }
84
+ };
85
+ var DisposeError = class extends ProgramRunnerErrorBase {
86
+ constructor(identity, cause) {
87
+ super({
88
+ message: "[Logix] Program dispose failed",
89
+ identity,
90
+ entrypoint: "dispose",
91
+ hint: "Dispose failed: a finalizer may have thrown, or scope/resource handles may be invalid; check onError/logs."
92
+ });
93
+ this._tag = "DisposeError";
94
+ this.name = "DisposeError";
95
+ this.cause = summarizeCause(cause);
96
+ }
97
+ toJSON() {
98
+ return { ...super.toJSON(), cause: this.cause };
99
+ }
100
+ };
101
+ var DisposeTimeoutError = class extends ProgramRunnerErrorBase {
102
+ constructor(identity, params) {
103
+ super({
104
+ message: "[Logix] Program dispose timed out",
105
+ identity,
106
+ entrypoint: "dispose",
107
+ hint: "Dispose timed out: if the program cannot exit naturally, resources may not be released or background fibers are still running."
108
+ });
109
+ this._tag = "DisposeTimeout";
110
+ this.name = "DisposeTimeoutError";
111
+ this.timeoutMs = params.timeoutMs;
112
+ this.elapsedMs = params.elapsedMs;
113
+ this.suggestions = [
114
+ "Check for event listeners that were not unregistered (e.g. process.on / emitter.on).",
115
+ "Check for fibers that were not joined/interrupt (long-lived watchers / Stream.run*).",
116
+ "Check for resource handles that were not closed (timer / socket / file handle)."
117
+ ];
118
+ }
119
+ toJSON() {
120
+ return {
121
+ ...super.toJSON(),
122
+ timeoutMs: this.timeoutMs,
123
+ elapsedMs: this.elapsedMs,
124
+ suggestions: this.suggestions
125
+ };
126
+ }
127
+ };
128
+
129
+ // src/internal/runtime/AppRuntime.ts
130
+ import { Effect, Exit, Layer, ManagedRuntime, ServiceMap } from "effect";
131
+
132
+ // src/internal/runtime/core/AppAssemblyGraph.ts
133
+ var STAGE_DEFINITIONS = [
134
+ { stageId: "validate.modules", dependsOn: [] },
135
+ { stageId: "validate.tags", dependsOn: ["validate.modules"] },
136
+ { stageId: "build.baseLayer", dependsOn: ["validate.tags"] },
137
+ { stageId: "build.baseEnv", dependsOn: ["build.baseLayer"] },
138
+ { stageId: "build.moduleEnvs", dependsOn: ["build.baseEnv"] },
139
+ { stageId: "merge.env", dependsOn: ["build.moduleEnvs"] },
140
+ { stageId: "rootContext.merge", dependsOn: ["merge.env"] },
141
+ { stageId: "rootContext.ready", dependsOn: ["rootContext.merge"] },
142
+ { stageId: "process.install", dependsOn: ["rootContext.ready"] }
143
+ ];
144
+ var toSlimMessage = (error) => {
145
+ if (error instanceof Error && typeof error.message === "string" && error.message.length > 0) {
146
+ return error.message;
147
+ }
148
+ const message = error?.message;
149
+ if (typeof message === "string" && message.length > 0) {
150
+ return message;
151
+ }
152
+ if (typeof error === "string" && error.length > 0) {
153
+ return error;
154
+ }
155
+ try {
156
+ return JSON.stringify(error);
157
+ } catch {
158
+ return String(error);
159
+ }
160
+ };
161
+ var AppAssemblyGraph = class {
162
+ constructor(appId) {
163
+ this.appId = appId;
164
+ this.rootContextLifecycle = { state: "uninitialized" };
165
+ const mutableNodes = STAGE_DEFINITIONS.map((stage, index) => ({
166
+ stageId: stage.stageId,
167
+ stageSeq: index + 1,
168
+ dependsOn: stage.dependsOn,
169
+ status: "pending"
170
+ }));
171
+ this.nodes = mutableNodes;
172
+ this.nodeIndex = new Map(mutableNodes.map((node) => [node.stageId, node]));
173
+ }
174
+ reset() {
175
+ for (const node of this.nodes) {
176
+ node.status = "pending";
177
+ node.startedAtMs = void 0;
178
+ node.durationMs = void 0;
179
+ node.reasonCode = void 0;
180
+ node.message = void 0;
181
+ }
182
+ this.rootContextLifecycle = { state: "uninitialized" };
183
+ this.failure = void 0;
184
+ }
185
+ beginStage(stageId) {
186
+ const node = this.getNode(stageId);
187
+ if (node.status === "pending") {
188
+ node.status = "running";
189
+ node.startedAtMs = Date.now();
190
+ }
191
+ }
192
+ completeStage(stageId) {
193
+ const node = this.getNode(stageId);
194
+ node.status = "succeeded";
195
+ node.durationMs = this.computeDurationMs(node);
196
+ }
197
+ failStage(stageId, reasonCode, error) {
198
+ const node = this.getNode(stageId);
199
+ node.status = "failed";
200
+ node.durationMs = this.computeDurationMs(node);
201
+ node.reasonCode = reasonCode;
202
+ node.message = toSlimMessage(error);
203
+ this.failure = {
204
+ stageId,
205
+ stageSeq: node.stageSeq,
206
+ reasonCode,
207
+ message: node.message,
208
+ upstreamStages: node.dependsOn
209
+ };
210
+ if (stageId === "rootContext.merge" || stageId === "rootContext.ready") {
211
+ this.markRootContextFailed(reasonCode);
212
+ }
213
+ for (const currentNode of this.nodes) {
214
+ if (currentNode.stageSeq > node.stageSeq && currentNode.status === "pending") {
215
+ currentNode.status = "skipped";
216
+ }
217
+ }
218
+ }
219
+ ensureFailure(reasonCode, error) {
220
+ if (this.failure) {
221
+ return;
222
+ }
223
+ const fallbackNode = this.nodes.find((node) => node.status === "running") ?? this.nodes.find((node) => node.status === "pending") ?? this.nodes[this.nodes.length - 1];
224
+ if (!fallbackNode) {
225
+ return;
226
+ }
227
+ this.failStage(fallbackNode.stageId, reasonCode, error);
228
+ }
229
+ markRootContextMerged() {
230
+ const mergeStageSeq = this.getNode("rootContext.merge").stageSeq;
231
+ this.rootContextLifecycle = {
232
+ state: this.rootContextLifecycle.state === "ready" ? "ready" : "merged",
233
+ mergedAtStageSeq: mergeStageSeq,
234
+ readyAtStageSeq: this.rootContextLifecycle.readyAtStageSeq,
235
+ reasonCode: this.rootContextLifecycle.reasonCode
236
+ };
237
+ }
238
+ markRootContextReady() {
239
+ const readyStageSeq = this.getNode("rootContext.ready").stageSeq;
240
+ this.rootContextLifecycle = {
241
+ state: "ready",
242
+ mergedAtStageSeq: this.rootContextLifecycle.mergedAtStageSeq,
243
+ readyAtStageSeq: readyStageSeq,
244
+ reasonCode: void 0
245
+ };
246
+ }
247
+ buildReport(success) {
248
+ return {
249
+ version: 1,
250
+ appId: this.appId,
251
+ success,
252
+ nodes: this.nodes.map((node) => ({
253
+ stageId: node.stageId,
254
+ stageSeq: node.stageSeq,
255
+ dependsOn: node.dependsOn,
256
+ status: node.status,
257
+ durationMs: node.durationMs,
258
+ reasonCode: node.reasonCode,
259
+ message: node.message
260
+ })),
261
+ rootContextLifecycle: { ...this.rootContextLifecycle },
262
+ failure: this.failure ? { ...this.failure } : void 0
263
+ };
264
+ }
265
+ markRootContextFailed(reasonCode) {
266
+ this.rootContextLifecycle = {
267
+ state: "failed",
268
+ mergedAtStageSeq: this.rootContextLifecycle.mergedAtStageSeq,
269
+ readyAtStageSeq: this.rootContextLifecycle.readyAtStageSeq,
270
+ reasonCode
271
+ };
272
+ }
273
+ getNode(stageId) {
274
+ const node = this.nodeIndex.get(stageId);
275
+ if (!node) {
276
+ throw new Error(`[Logix] Unknown assembly stage: ${stageId}`);
277
+ }
278
+ return node;
279
+ }
280
+ computeDurationMs(node) {
281
+ if (node.startedAtMs === void 0) {
282
+ return void 0;
283
+ }
284
+ return Math.max(0, Date.now() - node.startedAtMs);
285
+ }
286
+ };
287
+
288
+ // src/internal/runtime/AppRuntime.ts
289
+ var getTagKey = (tag) => {
290
+ const anyTag = tag;
291
+ if (typeof anyTag.key === "string") {
292
+ return anyTag.key;
293
+ }
294
+ if (typeof anyTag._id === "string") {
295
+ return anyTag._id;
296
+ }
297
+ if (typeof anyTag.toString === "function") {
298
+ return anyTag.toString();
299
+ }
300
+ return "[unknown-tag]";
301
+ };
302
+ var buildTagIndex = (entries) => {
303
+ const index = /* @__PURE__ */ new Map();
304
+ for (const entry of entries) {
305
+ const ownerId = String(entry.module.id);
306
+ const moduleTag = entry.module;
307
+ const moduleKey = getTagKey(moduleTag);
308
+ const moduleInfo = {
309
+ key: moduleKey,
310
+ tag: moduleTag,
311
+ ownerModuleId: ownerId,
312
+ source: "module"
313
+ };
314
+ const existingModuleInfos = index.get(moduleKey);
315
+ if (existingModuleInfos) {
316
+ existingModuleInfos.push(moduleInfo);
317
+ } else {
318
+ index.set(moduleKey, [moduleInfo]);
319
+ }
320
+ if (entry.serviceTags && entry.serviceTags.length > 0) {
321
+ for (const tag of entry.serviceTags) {
322
+ const key = getTagKey(tag);
323
+ const info = {
324
+ key,
325
+ tag,
326
+ ownerModuleId: ownerId,
327
+ source: "service"
328
+ };
329
+ const existingInfos = index.get(key);
330
+ if (existingInfos) {
331
+ existingInfos.push(info);
332
+ } else {
333
+ index.set(key, [info]);
334
+ }
335
+ }
336
+ }
337
+ }
338
+ return index;
339
+ };
340
+ var validateTags = (entries) => {
341
+ const index = buildTagIndex(entries);
342
+ const collisions = [];
343
+ for (const [key, infos] of index) {
344
+ if (infos.length <= 1) {
345
+ continue;
346
+ }
347
+ const owners = /* @__PURE__ */ new Set();
348
+ for (const info of infos) {
349
+ owners.add(info.ownerModuleId);
350
+ }
351
+ if (owners.size > 1) {
352
+ collisions.push({ key, conflicts: infos });
353
+ }
354
+ }
355
+ if (collisions.length === 0) {
356
+ return;
357
+ }
358
+ const message = "[Logix] Tag collision detected:\n" + collisions.map((c) => {
359
+ const header = `- key: ${c.key}`;
360
+ const lines = c.conflicts.map((i) => ` - owner: ${i.ownerModuleId}, source: ${i.source}`);
361
+ return [header, ...lines].join("\n");
362
+ }).join("\n");
363
+ const error = Object.assign(new Error(message), {
364
+ _tag: "TagCollisionError",
365
+ collisions
366
+ });
367
+ throw error;
368
+ };
369
+ var makeApp = (config) => {
370
+ const appModuleIds = config.modules.map((entry) => String(entry.module.id));
371
+ const appId = appModuleIds.length === 1 ? appModuleIds[0] : appModuleIds.slice().sort().join("~");
372
+ const assemblyGraph = new AppAssemblyGraph(appId);
373
+ let latestAssemblyReport;
374
+ const failAndThrow = (stageId, reasonCode, error) => {
375
+ assemblyGraph.failStage(stageId, reasonCode, error);
376
+ latestAssemblyReport = assemblyGraph.buildReport(false);
377
+ throw error;
378
+ };
379
+ assemblyGraph.beginStage("validate.modules");
380
+ const seenIds = /* @__PURE__ */ new Set();
381
+ for (const entry of config.modules) {
382
+ const id = String(entry.module.id);
383
+ if (seenIds.has(id)) {
384
+ const error = new Error(
385
+ `[Logix] Duplicate Module ID/Tag detected: "${id}".
386
+ Ensure all modules in the application Runtime have unique IDs.`
387
+ );
388
+ failAndThrow("validate.modules", "boot::module_duplicate", error);
389
+ }
390
+ seenIds.add(id);
391
+ }
392
+ assemblyGraph.completeStage("validate.modules");
393
+ assemblyGraph.beginStage("validate.tags");
394
+ try {
395
+ validateTags(config.modules);
396
+ assemblyGraph.completeStage("validate.tags");
397
+ } catch (error) {
398
+ failAndThrow("validate.tags", "boot::tag_collision", error);
399
+ }
400
+ const stateTxnLayer = config.stateTransaction ? Layer.succeed(StateTransactionConfigTag, config.stateTransaction) : Layer.empty;
401
+ const resolvedSchedulingPolicy = config.schedulingPolicy ?? config.concurrencyPolicy;
402
+ const schedulingPolicyLayer = resolvedSchedulingPolicy ? Layer.succeed(SchedulingPolicySurfaceTag, resolvedSchedulingPolicy) : Layer.empty;
403
+ const readQueryStrictGateLayer = config.readQueryStrictGate ? Layer.succeed(ReadQueryStrictGateConfigTag, config.readQueryStrictGate) : Layer.empty;
404
+ const pinnedHostSchedulerLayer = config.hostScheduler !== void 0 ? Layer.succeed(HostSchedulerTag, config.hostScheduler) : void 0;
405
+ const tickServicesLayer = Layer.provideMerge(pinnedHostSchedulerLayer ?? hostSchedulerLayer)(
406
+ Layer.provideMerge(runtimeStoreLayer)(Layer.provideMerge(declarativeLinkRuntimeLayer)(tickSchedulerLayer()))
407
+ );
408
+ const appLayer = config.layer.pipe(Layer.provide(tickServicesLayer));
409
+ assemblyGraph.beginStage("build.baseLayer");
410
+ const baseLayer = Layer.mergeAll(
411
+ tickServicesLayer,
412
+ appLayer,
413
+ // If a HostScheduler override is requested, pin it as the final HostSchedulerTag value to avoid accidental divergence.
414
+ // (Build-time capture is handled above by injecting it into tickServicesLayer.)
415
+ pinnedHostSchedulerLayer ?? Layer.empty,
416
+ stateTxnLayer,
417
+ schedulingPolicyLayer,
418
+ // Keep explicit legacy alias provisioning in the Env merge path so older callsites that reference
419
+ // ConcurrencyPolicyTag keep identical behavior during phase-1 migration.
420
+ resolvedSchedulingPolicy ? Layer.succeed(ConcurrencyPolicyTag, resolvedSchedulingPolicy) : Layer.empty,
421
+ readQueryStrictGateLayer,
422
+ layer(),
423
+ Layer.effect(
424
+ RootContextTag,
425
+ makeRootContext({ appId, appModuleIds })
426
+ )
427
+ );
428
+ assemblyGraph.completeStage("build.baseLayer");
429
+ const runStage = (stageId, reasonCode, effect) => Effect.gen(function* () {
430
+ assemblyGraph.beginStage(stageId);
431
+ const exit = yield* Effect.exit(effect);
432
+ if (Exit.isSuccess(exit)) {
433
+ assemblyGraph.completeStage(stageId);
434
+ return exit.value;
435
+ }
436
+ assemblyGraph.failStage(stageId, reasonCode, exit.cause);
437
+ latestAssemblyReport = assemblyGraph.buildReport(false);
438
+ return yield* Effect.failCause(exit.cause);
439
+ });
440
+ const finalLayer = Layer.unwrap(
441
+ Effect.gen(function* () {
442
+ assemblyGraph.reset();
443
+ assemblyGraph.beginStage("validate.modules");
444
+ assemblyGraph.completeStage("validate.modules");
445
+ assemblyGraph.beginStage("validate.tags");
446
+ assemblyGraph.completeStage("validate.tags");
447
+ assemblyGraph.beginStage("build.baseLayer");
448
+ assemblyGraph.completeStage("build.baseLayer");
449
+ const scope = yield* Effect.scope;
450
+ const env = yield* Effect.gen(function* () {
451
+ const baseEnv = yield* runStage(
452
+ "build.baseEnv",
453
+ "boot::base_layer_build_failed",
454
+ Layer.buildWithScope(baseLayer, scope)
455
+ );
456
+ const moduleEnv = yield* runStage(
457
+ "build.moduleEnvs",
458
+ "boot::module_layer_build_failed",
459
+ config.modules.length > 0 ? Effect.provide(
460
+ Layer.buildWithScope(
461
+ config.modules.length === 1 ? config.modules[0].layer : config.modules.slice(1).reduce((acc, entry) => Layer.merge(acc, entry.layer), config.modules[0].layer),
462
+ scope
463
+ ),
464
+ baseEnv
465
+ ) : Effect.succeed(void 0)
466
+ );
467
+ const mergedEnv = yield* runStage(
468
+ "merge.env",
469
+ "boot::env_merge_failed",
470
+ Effect.sync(() => moduleEnv ? ServiceMap.merge(baseEnv, moduleEnv) : baseEnv)
471
+ );
472
+ const rootContext = yield* runStage(
473
+ "rootContext.merge",
474
+ "boot::root_context_merge_failed",
475
+ Effect.flatMap(
476
+ Effect.sync(() => ServiceMap.get(mergedEnv, RootContextTag)),
477
+ (root) => mergeRootContext(root, mergedEnv)
478
+ )
479
+ );
480
+ assemblyGraph.markRootContextMerged();
481
+ yield* runStage(
482
+ "rootContext.ready",
483
+ "boot::root_context_ready_failed",
484
+ readyRootContext(rootContext)
485
+ );
486
+ assemblyGraph.markRootContextReady();
487
+ const processRuntime = ServiceMap.get(
488
+ mergedEnv,
489
+ ProcessRuntimeTag
490
+ );
491
+ yield* runStage(
492
+ "process.install",
493
+ "boot::process_install_failed",
494
+ Effect.forEach(
495
+ config.processes,
496
+ (process) => Effect.gen(function* () {
497
+ const installation = yield* Effect.provide(
498
+ processRuntime.install(process, {
499
+ scope: { type: "app", appId },
500
+ enabled: true,
501
+ installedAt: "appRuntime"
502
+ }),
503
+ mergedEnv
504
+ );
505
+ if (installation === void 0) {
506
+ yield* Effect.provide(
507
+ config.onError ? Effect.catchCause(process, config.onError) : process,
508
+ mergedEnv
509
+ ).pipe(Effect.forkScoped());
510
+ }
511
+ }),
512
+ { discard: true }
513
+ )
514
+ );
515
+ return mergedEnv;
516
+ });
517
+ latestAssemblyReport = assemblyGraph.buildReport(true);
518
+ return Layer.effectServices(Effect.succeed(env));
519
+ }).pipe(
520
+ Effect.catchCause(
521
+ (cause) => Effect.gen(function* () {
522
+ assemblyGraph.ensureFailure("boot::unknown", cause);
523
+ latestAssemblyReport = assemblyGraph.buildReport(false);
524
+ return yield* Effect.failCause(cause);
525
+ })
526
+ )
527
+ )
528
+ );
529
+ return {
530
+ definition: config,
531
+ layer: finalLayer,
532
+ makeRuntime: () => ManagedRuntime.make(finalLayer),
533
+ getAssemblyReport: () => latestAssemblyReport
534
+ };
535
+ };
536
+ var provide = (module, resource) => {
537
+ const layer2 = isLayer(resource) ? resource : Layer.succeed(module, resource);
538
+ return { module, layer: layer2 };
539
+ };
540
+ var isLayer = (value) => Layer.isLayer(value);
541
+
542
+ // src/internal/runtime/core/runner/ProgramRunner.closeScope.ts
543
+ import { Cause, Effect as Effect2, Exit as Exit2, Scope } from "effect";
544
+ var closeProgramScope = (params) => {
545
+ return Effect2.gen(function* () {
546
+ const start = Date.now();
547
+ const result = yield* Effect2.promise(
548
+ () => new Promise((resolve) => {
549
+ const timer = setTimeout(() => resolve({ _tag: "Timeout" }), params.timeoutMs);
550
+ void Effect2.runPromiseExit(Scope.close(params.scope, Exit2.void)).then((exit2) => {
551
+ clearTimeout(timer);
552
+ resolve(exit2);
553
+ });
554
+ })
555
+ );
556
+ if (result._tag === "Timeout") {
557
+ const error = new DisposeTimeoutError(params.identity, {
558
+ timeoutMs: params.timeoutMs,
559
+ elapsedMs: Date.now() - start
560
+ });
561
+ if (typeof params.onError === "function") {
562
+ yield* params.onError(Cause.die(error)).pipe(Effect2.catchCause(() => Effect2.void));
563
+ }
564
+ return yield* Effect2.die(error);
565
+ }
566
+ const exit = result;
567
+ if (Exit2.isSuccess(exit)) {
568
+ return;
569
+ }
570
+ return yield* Effect2.die(new DisposeError(params.identity, exit.cause));
571
+ });
572
+ };
573
+
574
+ // src/internal/runtime/core/runner/ProgramRunner.signals.ts
575
+ import { Effect as Effect3, Exit as Exit3, Scope as Scope2 } from "effect";
576
+ var getProcess = () => globalThis.process;
577
+ var isNodeProcess = (value) => typeof value === "object" && value !== null && typeof value.on === "function";
578
+ var removeListener = (proc, event, handler) => {
579
+ if (typeof proc.off === "function") {
580
+ proc.off(event, handler);
581
+ return;
582
+ }
583
+ if (typeof proc.removeListener === "function") {
584
+ proc.removeListener(event, handler);
585
+ }
586
+ };
587
+ var installGracefulShutdownHandlers = (params) => {
588
+ if (!params.enabled) {
589
+ return Effect3.void;
590
+ }
591
+ const proc = getProcess();
592
+ if (!isNodeProcess(proc)) {
593
+ return Effect3.void;
594
+ }
595
+ const handler = () => {
596
+ const effect = params.onSignal ? params.onSignal() : Scope2.close(params.scope, Exit3.void).pipe(Effect3.asVoid);
597
+ void Effect3.runPromise(effect);
598
+ };
599
+ return Effect3.gen(function* () {
600
+ yield* Scope2.addFinalizer(
601
+ params.scope,
602
+ Effect3.sync(() => {
603
+ removeListener(proc, "SIGINT", handler);
604
+ removeListener(proc, "SIGTERM", handler);
605
+ })
606
+ );
607
+ yield* Effect3.sync(() => {
608
+ proc.on("SIGINT", handler);
609
+ proc.on("SIGTERM", handler);
610
+ });
611
+ });
612
+ };
613
+
614
+ // src/internal/runtime/core/runner/ProgramRunner.kernel.ts
615
+ import { Cause as Cause2, Effect as Effect4, Exit as Exit4, Scope as Scope3 } from "effect";
616
+ var makeProgramRunnerKernel = (makeRuntime, rootImpl, options) => Effect4.gen(function* () {
617
+ const identity = {
618
+ moduleId: String(rootImpl.module.id),
619
+ instanceId: "unknown"
620
+ };
621
+ const scope = yield* Scope3.make();
622
+ const runtime = makeRuntime(rootImpl, options);
623
+ const setInstanceId = (value) => {
624
+ identity.instanceId = typeof value === "string" && value.length > 0 ? value : String(value ?? "unknown");
625
+ };
626
+ const close = (params) => Effect4.gen(function* () {
627
+ const exit = yield* Effect4.exit(
628
+ closeProgramScope({
629
+ scope,
630
+ timeoutMs: params.timeoutMs,
631
+ identity,
632
+ onError: params.onError
633
+ })
634
+ );
635
+ if (Exit4.isSuccess(exit)) {
636
+ const disposeResult = yield* Effect4.promise(
637
+ () => new Promise((resolve) => {
638
+ const timer = setTimeout(() => resolve({ _tag: "Timeout" }), params.timeoutMs);
639
+ void runtime.dispose().then(
640
+ () => {
641
+ clearTimeout(timer);
642
+ resolve({ _tag: "Success" });
643
+ },
644
+ (error) => {
645
+ clearTimeout(timer);
646
+ resolve({ _tag: "Failure", error });
647
+ }
648
+ );
649
+ })
650
+ );
651
+ if (disposeResult._tag === "Timeout") {
652
+ return yield* Effect4.die(
653
+ new DisposeTimeoutError(identity, {
654
+ timeoutMs: params.timeoutMs,
655
+ elapsedMs: params.timeoutMs
656
+ })
657
+ );
658
+ }
659
+ if (disposeResult._tag === "Failure") {
660
+ return yield* Effect4.die(new DisposeError(identity, Cause2.die(disposeResult.error)));
661
+ }
662
+ return;
663
+ }
664
+ void runtime.dispose();
665
+ return yield* Effect4.failCause(exit.cause);
666
+ });
667
+ const installSignals = (enabled) => installGracefulShutdownHandlers({ scope, enabled });
668
+ const toContext = (moduleRuntime) => ({
669
+ scope,
670
+ runtime,
671
+ module: moduleRuntime,
672
+ $: make(rootImpl.module.shape, moduleRuntime)
673
+ });
674
+ return {
675
+ scope,
676
+ runtime,
677
+ identity,
678
+ installSignals,
679
+ close,
680
+ setInstanceId,
681
+ toContext
682
+ };
683
+ });
684
+
685
+ export {
686
+ BootError,
687
+ MainError,
688
+ DisposeError,
689
+ DisposeTimeoutError,
690
+ closeProgramScope,
691
+ installGracefulShutdownHandlers,
692
+ makeProgramRunnerKernel,
693
+ makeApp,
694
+ provide
695
+ };
696
+ //# sourceMappingURL=chunk-PBIUCQY3.js.map