@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.
- package/LICENSE +201 -0
- package/dist/{Action-mqVvtEHt.d.ts → Action-DYl88bwj.d.ts} +1 -1
- package/dist/{Action-BkRHy2vg.d.cts → Action-DkxsI_DK.d.cts} +1 -1
- package/dist/Action.cjs.map +1 -1
- package/dist/Action.d.cts +1 -1
- package/dist/Action.d.ts +1 -1
- package/dist/Action.js +2 -2
- package/dist/{Actions-AsQ07yTP.d.cts → Actions-Dicm7jdc.d.cts} +2 -2
- package/dist/{Actions-AsQ07yTP.d.ts → Actions-Dicm7jdc.d.ts} +2 -2
- package/dist/Actions.cjs.map +1 -1
- package/dist/Actions.d.cts +1 -1
- package/dist/Actions.d.ts +1 -1
- package/dist/Actions.js +1 -1
- package/dist/{Bound-BN1DQ_lM.d.ts → Bound-1OJLzVIS.d.ts} +2 -2
- package/dist/{Bound-BPIfH9SS.d.cts → Bound-BMLrtQ1V.d.cts} +2 -2
- package/dist/Bound.cjs +1737 -399
- package/dist/Bound.cjs.map +1 -1
- package/dist/Bound.d.cts +5 -5
- package/dist/Bound.d.ts +5 -5
- package/dist/Bound.js +19 -17
- package/dist/{Debug-B5q5Bkzx.d.ts → Debug-DKrWP5H1.d.ts} +40 -22
- package/dist/{Debug-Bq8Sqjcr.d.cts → Debug-hIT44XsY.d.cts} +40 -22
- package/dist/Debug.cjs +1348 -318
- package/dist/Debug.cjs.map +1 -1
- package/dist/Debug.d.cts +12 -11
- package/dist/Debug.d.ts +12 -11
- package/dist/Debug.js +20 -11
- package/dist/EffectOp.cjs +15 -6
- package/dist/EffectOp.cjs.map +1 -1
- package/dist/EffectOp.js +3 -3
- package/dist/Env.cjs +772 -6
- package/dist/Env.cjs.map +1 -1
- package/dist/Env.js +5 -2
- package/dist/ExternalStore-DqJKKRJ4.d.ts +61 -0
- package/dist/ExternalStore-JC-gAgEI.d.cts +61 -0
- package/dist/ExternalStore.cjs +774 -0
- package/dist/ExternalStore.cjs.map +1 -0
- package/dist/ExternalStore.d.cts +8 -0
- package/dist/ExternalStore.d.ts +8 -0
- package/dist/ExternalStore.js +19 -0
- package/dist/ExternalStore.js.map +1 -0
- package/dist/{Flow-BhpjE22E.d.ts → Flow-CZmXRDqp.d.cts} +13 -4
- package/dist/{Flow-1fZT8MpX.d.cts → Flow-DIVDxz7R.d.ts} +13 -4
- package/dist/Flow.cjs +765 -148
- package/dist/Flow.cjs.map +1 -1
- package/dist/Flow.d.cts +6 -6
- package/dist/Flow.d.ts +6 -6
- package/dist/Flow.js +9 -8
- package/dist/{Handle-D_cLW1Z3.d.ts → Handle-Bo6cAFut.d.ts} +1 -1
- package/dist/{Handle-D8D1zPb_.d.cts → Handle-CfDvSqN7.d.cts} +1 -1
- package/dist/Handle.d.cts +5 -5
- package/dist/Handle.d.ts +5 -5
- package/dist/{Kernel-8kC-jOda.d.cts → Kernel-CuXBF9S_.d.cts} +16 -7
- package/dist/{Kernel-CnGE1Fyk.d.ts → Kernel-D9guNwRL.d.ts} +16 -7
- package/dist/Kernel.cjs +814 -26
- package/dist/Kernel.cjs.map +1 -1
- package/dist/Kernel.d.cts +13 -12
- package/dist/Kernel.d.ts +13 -12
- package/dist/Kernel.js +7 -4
- package/dist/{Link-Db7975nU.d.ts → Link-CUM0yUCH.d.ts} +10 -3
- package/dist/{Link-fX8x1eCK.d.cts → Link-NAfR6uGD.d.cts} +10 -3
- package/dist/Link.cjs +1294 -121
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.d.cts +5 -5
- package/dist/Link.d.ts +5 -5
- package/dist/Link.js +37 -29
- package/dist/{Logic-DRh4sDZj.d.cts → Logic-09VQpIj3.d.cts} +7 -4
- package/dist/{Logic-BRjEMr-W.d.ts → Logic-DKg7ghGy.d.ts} +7 -4
- package/dist/Logic.cjs +2 -1
- package/dist/Logic.cjs.map +1 -1
- package/dist/Logic.d.cts +5 -5
- package/dist/Logic.d.ts +5 -5
- package/dist/Logic.js +1 -1
- package/dist/{MatchBuilder-CJk5oCkR.d.cts → MatchBuilder-CsW5jgrL.d.ts} +1 -1
- package/dist/{MatchBuilder-0QOc-nlU.d.ts → MatchBuilder-Dksk07F4.d.cts} +1 -1
- package/dist/MatchBuilder.cjs +2 -2
- package/dist/MatchBuilder.cjs.map +1 -1
- package/dist/MatchBuilder.d.cts +6 -6
- package/dist/MatchBuilder.d.ts +6 -6
- package/dist/MatchBuilder.js +2 -2
- package/dist/Middleware-D8tUDLv_.d.cts +100 -0
- package/dist/Middleware-DS7CbTTN.d.ts +100 -0
- package/dist/Middleware.cjs +678 -58
- package/dist/Middleware.cjs.map +1 -1
- package/dist/Middleware.d.cts +2 -86
- package/dist/Middleware.d.ts +2 -86
- package/dist/Middleware.js +15 -12
- package/dist/{Module-DnzluX2J.d.ts → Module-B_Cntyms.d.ts} +54 -25
- package/dist/{Module-B_0xRDMR.d.cts → Module-CmNOVXzf.d.cts} +54 -25
- package/dist/Module.cjs +9331 -3317
- package/dist/Module.cjs.map +1 -1
- package/dist/Module.d.cts +7 -6
- package/dist/Module.d.ts +7 -6
- package/dist/Module.js +39 -31
- package/dist/ModuleTag-CGho_InD.d.ts +113 -0
- package/dist/ModuleTag-CITb8L_G.d.cts +113 -0
- package/dist/ModuleTag.cjs +7248 -2847
- package/dist/ModuleTag.cjs.map +1 -1
- package/dist/ModuleTag.d.cts +6 -6
- package/dist/ModuleTag.d.ts +6 -6
- package/dist/ModuleTag.js +35 -29
- package/dist/Observability-Bdhnx2Dv.d.ts +385 -0
- package/dist/Observability-DXGAFBIT.d.cts +385 -0
- package/dist/Observability.cjs +5093 -1556
- package/dist/Observability.cjs.map +1 -1
- package/dist/Observability.d.cts +6 -7
- package/dist/Observability.d.ts +6 -7
- package/dist/Observability.js +28 -23
- package/dist/{Platform-CHX8o-U4.d.ts → Platform-B4s8tg6C.d.cts} +4 -5
- package/dist/{Platform-C49Pv956.d.cts → Platform-BV_0MW7g.d.cts} +5 -2
- package/dist/{Platform-C49Pv956.d.ts → Platform-BV_0MW7g.d.ts} +5 -2
- package/dist/{Platform-CVlv0xLQ.d.cts → Platform-W0Mefy_e.d.ts} +4 -5
- package/dist/Platform.cjs +2 -1
- package/dist/Platform.cjs.map +1 -1
- package/dist/Platform.d.cts +2 -3
- package/dist/Platform.d.ts +2 -3
- package/dist/Platform.js +2 -2
- package/dist/{Process-CM9xbMdP.d.ts → Process-CO8G7HO9.d.cts} +30 -5
- package/dist/{Process-mL8fHDSB.d.cts → Process-Cyf6VNDR.d.ts} +30 -5
- package/dist/Process.cjs +1288 -120
- package/dist/Process.cjs.map +1 -1
- package/dist/Process.d.cts +6 -6
- package/dist/Process.d.ts +6 -6
- package/dist/Process.js +34 -26
- package/dist/ReadQuery-C_or5nLC.d.ts +128 -0
- package/dist/ReadQuery-DXLzCE0E.d.cts +614 -0
- package/dist/ReadQuery-DXLzCE0E.d.ts +614 -0
- package/dist/ReadQuery-Yve1lmUo.d.cts +128 -0
- package/dist/ReadQuery.cjs +290 -5
- package/dist/ReadQuery.cjs.map +1 -1
- package/dist/ReadQuery.d.cts +3 -2
- package/dist/ReadQuery.d.ts +3 -2
- package/dist/ReadQuery.js +23 -5
- package/dist/{Reflection-CQnKwPXj.d.ts → Reflection-B2Xi1e4Q.d.ts} +89 -7
- package/dist/{Reflection-Kabo1mlU.d.cts → Reflection-DNB4V4_e.d.cts} +89 -7
- package/dist/Reflection.cjs +3227 -1617
- package/dist/Reflection.cjs.map +1 -1
- package/dist/Reflection.d.cts +17 -15
- package/dist/Reflection.d.ts +17 -15
- package/dist/Reflection.js +33 -25
- package/dist/{Resource-Dy1xD_DG.d.cts → Resource-pKvQQ4x5.d.cts} +3 -3
- package/dist/{Resource-Dy1xD_DG.d.ts → Resource-pKvQQ4x5.d.ts} +3 -3
- package/dist/Resource.cjs +781 -15
- package/dist/Resource.cjs.map +1 -1
- package/dist/Resource.d.cts +1 -1
- package/dist/Resource.d.ts +1 -1
- package/dist/Resource.js +6 -3
- package/dist/{Root-7ADUMk4t.d.cts → Root-CCVuFHB6.d.cts} +3 -3
- package/dist/{Root-7ADUMk4t.d.ts → Root-CCVuFHB6.d.ts} +3 -3
- package/dist/Root.cjs +786 -20
- package/dist/Root.cjs.map +1 -1
- package/dist/Root.d.cts +2 -2
- package/dist/Root.d.ts +2 -2
- package/dist/Root.js +7 -3
- package/dist/{Runtime-CtyzZG4i.d.ts → Runtime-CRmvwK4I.d.ts} +70 -14
- package/dist/{Runtime-B-aL-f29.d.cts → Runtime-C_wJM9mN.d.cts} +70 -14
- package/dist/Runtime.cjs +4942 -1601
- package/dist/Runtime.cjs.map +1 -1
- package/dist/Runtime.d.cts +17 -15
- package/dist/Runtime.d.ts +17 -15
- package/dist/Runtime.js +44 -32
- package/dist/{ScopeRegistry-D1owDNSm.d.cts → ScopeRegistry-BhYzqWri.d.cts} +6 -6
- package/dist/{ScopeRegistry-D1owDNSm.d.ts → ScopeRegistry-BhYzqWri.d.ts} +6 -6
- package/dist/ScopeRegistry.cjs +776 -10
- package/dist/ScopeRegistry.cjs.map +1 -1
- package/dist/ScopeRegistry.d.cts +1 -1
- package/dist/ScopeRegistry.d.ts +1 -1
- package/dist/ScopeRegistry.js +6 -3
- package/dist/{State-CU50R26M.d.cts → State-rNFsFPTl.d.cts} +2 -2
- package/dist/{State-CU50R26M.d.ts → State-rNFsFPTl.d.ts} +2 -2
- package/dist/State.cjs.map +1 -1
- package/dist/State.d.cts +1 -1
- package/dist/State.d.ts +1 -1
- package/dist/State.js +1 -1
- package/dist/{StateTrait-BGsZghTz.d.ts → StateTrait-CijdwNb6.d.ts} +25 -8
- package/dist/{StateTrait-OWhbj12c.d.cts → StateTrait-Dltto6PU.d.cts} +25 -8
- package/dist/StateTrait.cjs +1890 -528
- package/dist/StateTrait.cjs.map +1 -1
- package/dist/StateTrait.d.cts +9 -7
- package/dist/StateTrait.d.ts +9 -7
- package/dist/StateTrait.js +18 -14
- package/dist/{TraitLifecycle-CwV5WPFX.d.cts → TraitLifecycle-BKzDqzLu.d.cts} +2 -2
- package/dist/{TraitLifecycle-LdIWmKlg.d.ts → TraitLifecycle-Cvo94uDB.d.ts} +2 -2
- package/dist/TraitLifecycle.cjs +630 -67
- package/dist/TraitLifecycle.cjs.map +1 -1
- package/dist/TraitLifecycle.d.cts +6 -6
- package/dist/TraitLifecycle.d.ts +6 -6
- package/dist/TraitLifecycle.js +8 -7
- package/dist/Workflow-C_OWr4dV.d.ts +415 -0
- package/dist/Workflow-DmydkHO8.d.cts +415 -0
- package/dist/Workflow.cjs +3150 -0
- package/dist/Workflow.cjs.map +1 -0
- package/dist/Workflow.d.cts +7 -0
- package/dist/Workflow.d.ts +7 -0
- package/dist/Workflow.js +58 -0
- package/dist/Workflow.js.map +1 -0
- package/dist/{action-DiMDD_0v.d.cts → action-BQxjPFEw.d.cts} +5 -5
- package/dist/{action-DiMDD_0v.d.ts → action-BQxjPFEw.d.ts} +5 -5
- package/dist/chunk-2XRLXDWR.js +276 -0
- package/dist/chunk-2XRLXDWR.js.map +1 -0
- package/dist/chunk-3L6QGFMM.js +701 -0
- package/dist/chunk-3L6QGFMM.js.map +1 -0
- package/dist/{chunk-GMPEOUP2.js → chunk-4MZ7BT3R.js} +2 -2
- package/dist/chunk-4MZ7BT3R.js.map +1 -0
- package/dist/{chunk-3IYZ5IGG.js → chunk-5WKUGEBY.js} +2 -2
- package/dist/{chunk-3RMKLXHX.js → chunk-63ZQ5RIN.js} +2 -2
- package/dist/{chunk-M3WTHJHJ.js → chunk-67DIEA53.js} +385 -148
- package/dist/chunk-67DIEA53.js.map +1 -0
- package/dist/{chunk-YS3AZQ2G.js → chunk-6HFAW2MH.js} +1 -1
- package/dist/chunk-6HFAW2MH.js.map +1 -0
- package/dist/{chunk-EY4NZKDR.js → chunk-6Y2TKCNY.js} +2 -2
- package/dist/{chunk-76WT3HOR.js → chunk-6YZOXFPQ.js} +25 -24
- package/dist/chunk-6YZOXFPQ.js.map +1 -0
- package/dist/{chunk-G5ZBFPNU.js → chunk-A2RQOJC7.js} +2 -2
- package/dist/{chunk-AUIR5O6W.js → chunk-AFSB6NKM.js} +13 -19
- package/dist/chunk-AFSB6NKM.js.map +1 -0
- package/dist/{chunk-JCXGZRMU.js → chunk-AO4JEOKD.js} +22 -23
- package/dist/chunk-AO4JEOKD.js.map +1 -0
- package/dist/{chunk-TAAPQVZN.js → chunk-AYELIQXR.js} +2 -2
- package/dist/{chunk-QMM6O4CD.js → chunk-BLHZW7DG.js} +15 -3
- package/dist/{chunk-QMM6O4CD.js.map → chunk-BLHZW7DG.js.map} +1 -1
- package/dist/{chunk-TQOBJYDP.js → chunk-CD4N74YC.js} +1 -1
- package/dist/chunk-CD4N74YC.js.map +1 -0
- package/dist/{chunk-ANLBCBDC.js → chunk-CGE2HBTH.js} +11 -11
- package/dist/chunk-CGE2HBTH.js.map +1 -0
- package/dist/{chunk-OFADUJWJ.js → chunk-CYYSQMLO.js} +5 -5
- package/dist/chunk-CYYSQMLO.js.map +1 -0
- package/dist/{chunk-66ALHVEX.js → chunk-EB46EYI7.js} +3 -3
- package/dist/{chunk-NZJKFF45.js → chunk-EKCDHWRK.js} +4 -4
- package/dist/chunk-EKCDHWRK.js.map +1 -0
- package/dist/{chunk-BABLDP24.js → chunk-EPQFNJU3.js} +152 -7
- package/dist/chunk-EPQFNJU3.js.map +1 -0
- package/dist/{chunk-OGWBVHB3.js → chunk-ESR6HGOY.js} +73 -14
- package/dist/chunk-ESR6HGOY.js.map +1 -0
- package/dist/{chunk-NBD3KUOZ.js → chunk-F6RP62H3.js} +150 -98
- package/dist/chunk-F6RP62H3.js.map +1 -0
- package/dist/chunk-FBYW3QDI.js +252 -0
- package/dist/chunk-FBYW3QDI.js.map +1 -0
- package/dist/{chunk-IPF7E66P.js → chunk-FYAODKVP.js} +2 -2
- package/dist/chunk-GNEN7NKO.js +908 -0
- package/dist/chunk-GNEN7NKO.js.map +1 -0
- package/dist/chunk-GWSM4KLB.js +763 -0
- package/dist/chunk-GWSM4KLB.js.map +1 -0
- package/dist/{chunk-4SO6JMZL.js → chunk-HDMXCUZL.js} +1 -1
- package/dist/chunk-HDMXCUZL.js.map +1 -0
- package/dist/{chunk-ZFY7U2FR.js → chunk-HJM5Y5NU.js} +43 -3
- package/dist/chunk-HJM5Y5NU.js.map +1 -0
- package/dist/{chunk-ZGDVUPTM.js → chunk-IOZ3VKPK.js} +129 -68
- package/dist/chunk-IOZ3VKPK.js.map +1 -0
- package/dist/{chunk-PYOE4VSI.js → chunk-IVXSVHO4.js} +303 -247
- package/dist/chunk-IVXSVHO4.js.map +1 -0
- package/dist/chunk-J3CWXIPV.js +242 -0
- package/dist/chunk-J3CWXIPV.js.map +1 -0
- package/dist/chunk-K6JQW266.js +42 -0
- package/dist/chunk-K6JQW266.js.map +1 -0
- package/dist/chunk-KMZYQF6Q.js +202 -0
- package/dist/chunk-KMZYQF6Q.js.map +1 -0
- package/dist/{chunk-JWOYLO27.js → chunk-LPPZDFTD.js} +22 -12
- package/dist/chunk-LPPZDFTD.js.map +1 -0
- package/dist/{chunk-PAYXCY6A.js → chunk-MYB2B5WX.js} +997 -576
- package/dist/chunk-MYB2B5WX.js.map +1 -0
- package/dist/chunk-MYKNINNN.js +228 -0
- package/dist/chunk-MYKNINNN.js.map +1 -0
- package/dist/chunk-NSQIRMVF.js +27 -0
- package/dist/{chunk-QCHIQWAJ.js.map → chunk-NSQIRMVF.js.map} +1 -1
- package/dist/chunk-NUDBM4MM.js +30 -0
- package/dist/chunk-NUDBM4MM.js.map +1 -0
- package/dist/chunk-NZMWWDAY.js +23 -0
- package/dist/chunk-NZMWWDAY.js.map +1 -0
- package/dist/{chunk-RNFE3ML2.js → chunk-OCUV2Y25.js} +4 -3
- package/dist/chunk-OCUV2Y25.js.map +1 -0
- package/dist/chunk-P4ZJOQA7.js +271 -0
- package/dist/chunk-P4ZJOQA7.js.map +1 -0
- package/dist/chunk-P6C5EZ3D.js +342 -0
- package/dist/chunk-P6C5EZ3D.js.map +1 -0
- package/dist/{chunk-CW6T36TN.js → chunk-PBD7BJUN.js} +62 -4
- package/dist/chunk-PBD7BJUN.js.map +1 -0
- package/dist/chunk-PBIUCQY3.js +696 -0
- package/dist/chunk-PBIUCQY3.js.map +1 -0
- package/dist/chunk-PD6YECQH.js +845 -0
- package/dist/chunk-PD6YECQH.js.map +1 -0
- package/dist/{chunk-M7IYCTJV.js → chunk-R4LFQGP3.js} +2 -2
- package/dist/chunk-RHJIGDUE.js +21 -0
- package/dist/chunk-RHJIGDUE.js.map +1 -0
- package/dist/{chunk-KP7MUZNX.js → chunk-RLXO27MW.js} +30 -8
- package/dist/chunk-RLXO27MW.js.map +1 -0
- package/dist/{chunk-DFNM3WX2.js → chunk-S44BEV4B.js} +168 -45
- package/dist/chunk-S44BEV4B.js.map +1 -0
- package/dist/chunk-S4S5N4BJ.js +1461 -0
- package/dist/chunk-S4S5N4BJ.js.map +1 -0
- package/dist/{chunk-BZ2SHDN2.js → chunk-SGTRAXXX.js} +3 -3
- package/dist/chunk-SGTRAXXX.js.map +1 -0
- package/dist/{chunk-M2RGJPXX.js → chunk-SJAE5PB5.js} +3 -3
- package/dist/{chunk-JGIWG6SR.js → chunk-SNPNHU3H.js} +3937 -1776
- package/dist/chunk-SNPNHU3H.js.map +1 -0
- package/dist/{chunk-IHVBV5C2.js → chunk-SOOBFXRR.js} +94 -71
- package/dist/chunk-SOOBFXRR.js.map +1 -0
- package/dist/{chunk-ZDTRWK5F.js → chunk-TAHFWKS6.js} +2 -2
- package/dist/chunk-UEFFTVPY.js +9 -0
- package/dist/chunk-UEFFTVPY.js.map +1 -0
- package/dist/{chunk-24VULZ7A.js → chunk-UR5BXLBP.js} +3 -3
- package/dist/chunk-UR5BXLBP.js.map +1 -0
- package/dist/{chunk-DMBALCE2.js → chunk-V2SBGVDO.js} +471 -186
- package/dist/chunk-V2SBGVDO.js.map +1 -0
- package/dist/chunk-VJLWD47W.js +23 -0
- package/dist/chunk-VJLWD47W.js.map +1 -0
- package/dist/{chunk-4CQAV7YB.js → chunk-W647DX5Z.js} +2 -2
- package/dist/{chunk-THATMZXD.js → chunk-WFIIU3YZ.js} +2 -2
- package/dist/{chunk-THATMZXD.js.map → chunk-WFIIU3YZ.js.map} +1 -1
- package/dist/chunk-YZDJMAKL.js +82 -0
- package/dist/chunk-YZDJMAKL.js.map +1 -0
- package/dist/{chunk-3TMODYZV.js → chunk-Z5XH6VHY.js} +5 -5
- package/dist/chunk-Z5XH6VHY.js.map +1 -0
- package/dist/{chunk-BE3HW4FY.js → chunk-ZBBMZMA6.js} +377 -170
- package/dist/chunk-ZBBMZMA6.js.map +1 -0
- package/dist/index.cjs +21224 -11714
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +195 -49
- package/dist/index.d.ts +195 -49
- package/dist/index.js +150 -74
- package/dist/index.js.map +1 -1
- package/dist/{ir-BMP7yxJJ.d.cts → ir-BSosEwc8.d.cts} +1 -1
- package/dist/{ir-DUOz6H-5.d.ts → ir-D-uqwL_4.d.ts} +1 -1
- package/dist/{module-B8CBqIZ_.d.cts → module-Ds4tarcI.d.cts} +230 -140
- package/dist/{module-k7m3txak.d.ts → module-Zd1Gn-Nj.d.ts} +230 -140
- package/package.json +20 -4
- package/dist/ModuleTag-C8FHY_sY.d.ts +0 -93
- package/dist/ModuleTag-EGbgBMpZ.d.cts +0 -93
- package/dist/Observability-COqEvp2C.d.cts +0 -713
- package/dist/Observability-cY4kLn0S.d.ts +0 -713
- package/dist/ReadQuery-BlMwhe-F.d.ts +0 -30
- package/dist/ReadQuery-CL5XlXts.d.cts +0 -30
- package/dist/ReadQuery-SinbStGF.d.cts +0 -38
- package/dist/ReadQuery-SinbStGF.d.ts +0 -38
- package/dist/chunk-24VULZ7A.js.map +0 -1
- package/dist/chunk-3QMIVH35.js +0 -43
- package/dist/chunk-3QMIVH35.js.map +0 -1
- package/dist/chunk-3TMODYZV.js.map +0 -1
- package/dist/chunk-4SO6JMZL.js.map +0 -1
- package/dist/chunk-76WT3HOR.js.map +0 -1
- package/dist/chunk-ANLBCBDC.js.map +0 -1
- package/dist/chunk-AUIR5O6W.js.map +0 -1
- package/dist/chunk-BABLDP24.js.map +0 -1
- package/dist/chunk-BE3HW4FY.js.map +0 -1
- package/dist/chunk-BZ2SHDN2.js.map +0 -1
- package/dist/chunk-CW6T36TN.js.map +0 -1
- package/dist/chunk-DFNM3WX2.js.map +0 -1
- package/dist/chunk-DMBALCE2.js.map +0 -1
- package/dist/chunk-EGK3KN7B.js +0 -406
- package/dist/chunk-EGK3KN7B.js.map +0 -1
- package/dist/chunk-GMPEOUP2.js.map +0 -1
- package/dist/chunk-IHVBV5C2.js.map +0 -1
- package/dist/chunk-JCXGZRMU.js.map +0 -1
- package/dist/chunk-JGIWG6SR.js.map +0 -1
- package/dist/chunk-JWOYLO27.js.map +0 -1
- package/dist/chunk-KIXAU3GM.js +0 -137
- package/dist/chunk-KIXAU3GM.js.map +0 -1
- package/dist/chunk-KL5ACTCT.js +0 -8
- package/dist/chunk-KL5ACTCT.js.map +0 -1
- package/dist/chunk-KP7MUZNX.js.map +0 -1
- package/dist/chunk-M3BFQ7HK.js +0 -13
- package/dist/chunk-M3BFQ7HK.js.map +0 -1
- package/dist/chunk-M3WTHJHJ.js.map +0 -1
- package/dist/chunk-NBD3KUOZ.js.map +0 -1
- package/dist/chunk-NQZ2OSGR.js +0 -151
- package/dist/chunk-NQZ2OSGR.js.map +0 -1
- package/dist/chunk-NZJKFF45.js.map +0 -1
- package/dist/chunk-OFADUJWJ.js.map +0 -1
- package/dist/chunk-OGWBVHB3.js.map +0 -1
- package/dist/chunk-PAYXCY6A.js.map +0 -1
- package/dist/chunk-PYOE4VSI.js.map +0 -1
- package/dist/chunk-QCHIQWAJ.js +0 -21
- package/dist/chunk-RNFE3ML2.js.map +0 -1
- package/dist/chunk-TKZ7MEIA.js +0 -27
- package/dist/chunk-TKZ7MEIA.js.map +0 -1
- package/dist/chunk-TQOBJYDP.js.map +0 -1
- package/dist/chunk-VZB726PE.js +0 -93
- package/dist/chunk-VZB726PE.js.map +0 -1
- package/dist/chunk-W3TEWHLO.js +0 -568
- package/dist/chunk-W3TEWHLO.js.map +0 -1
- package/dist/chunk-YS3AZQ2G.js.map +0 -1
- package/dist/chunk-ZFLHVFUC.js +0 -192
- package/dist/chunk-ZFLHVFUC.js.map +0 -1
- package/dist/chunk-ZFY7U2FR.js.map +0 -1
- package/dist/chunk-ZGDVUPTM.js.map +0 -1
- package/dist/protocol-g_1897M2.d.cts +0 -127
- package/dist/protocol-g_1897M2.d.ts +0 -127
- /package/dist/{chunk-3IYZ5IGG.js.map → chunk-5WKUGEBY.js.map} +0 -0
- /package/dist/{chunk-3RMKLXHX.js.map → chunk-63ZQ5RIN.js.map} +0 -0
- /package/dist/{chunk-EY4NZKDR.js.map → chunk-6Y2TKCNY.js.map} +0 -0
- /package/dist/{chunk-G5ZBFPNU.js.map → chunk-A2RQOJC7.js.map} +0 -0
- /package/dist/{chunk-TAAPQVZN.js.map → chunk-AYELIQXR.js.map} +0 -0
- /package/dist/{chunk-66ALHVEX.js.map → chunk-EB46EYI7.js.map} +0 -0
- /package/dist/{chunk-IPF7E66P.js.map → chunk-FYAODKVP.js.map} +0 -0
- /package/dist/{chunk-M7IYCTJV.js.map → chunk-R4LFQGP3.js.map} +0 -0
- /package/dist/{chunk-M2RGJPXX.js.map → chunk-SJAE5PB5.js.map} +0 -0
- /package/dist/{chunk-ZDTRWK5F.js.map → chunk-TAHFWKS6.js.map} +0 -0
- /package/dist/{chunk-4CQAV7YB.js.map → chunk-W647DX5Z.js.map} +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeFieldPath
|
|
3
|
+
} from "./chunk-SOOBFXRR.js";
|
|
1
4
|
import {
|
|
2
5
|
__export
|
|
3
6
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -7,6 +10,14 @@ var parseSegments = (path) => {
|
|
|
7
10
|
if (!path) return [];
|
|
8
11
|
return path.split(".").map((seg) => /^[0-9]+$/.test(seg) ? Number(seg) : seg);
|
|
9
12
|
};
|
|
13
|
+
var isPrefixPath = (prefix, full) => {
|
|
14
|
+
if (prefix.length > full.length) return false;
|
|
15
|
+
for (let i = 0; i < prefix.length; i++) {
|
|
16
|
+
if (prefix[i] !== full[i]) return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
20
|
+
var overlapsPath = (a, b) => isPrefixPath(a, b) || isPrefixPath(b, a);
|
|
10
21
|
var getAtPath = (state, path) => {
|
|
11
22
|
if (!path || state == null) return state;
|
|
12
23
|
const segments = parseSegments(path);
|
|
@@ -53,7 +64,7 @@ var unsetAtPathMutating = (draft, path) => {
|
|
|
53
64
|
}
|
|
54
65
|
const last = segments[segments.length - 1];
|
|
55
66
|
if (Array.isArray(current) && typeof last === "number") {
|
|
56
|
-
current[last]
|
|
67
|
+
delete current[last];
|
|
57
68
|
return;
|
|
58
69
|
}
|
|
59
70
|
if (current && typeof current === "object") {
|
|
@@ -324,12 +335,12 @@ var RowIdStore = class {
|
|
|
324
335
|
list.push(path);
|
|
325
336
|
childrenByParent.set(parent, list);
|
|
326
337
|
}
|
|
327
|
-
const roots = (childrenByParent.get(void 0) ?? []).slice().sort(
|
|
338
|
+
const roots = (childrenByParent.get(void 0) ?? []).slice().sort();
|
|
328
339
|
const visit = (listPath, parentRowId, listValue) => {
|
|
329
340
|
const cfg = cfgByPath.get(listPath);
|
|
330
341
|
const items = Array.isArray(listValue) ? listValue : [];
|
|
331
342
|
const ids = this.ensureList(listPath, items, cfg?.trackBy, parentRowId);
|
|
332
|
-
const children = (childrenByParent.get(listPath) ?? []).slice().sort(
|
|
343
|
+
const children = (childrenByParent.get(listPath) ?? []).slice().sort();
|
|
333
344
|
if (children.length === 0) return;
|
|
334
345
|
for (let i = 0; i < items.length; i++) {
|
|
335
346
|
const row = items[i];
|
|
@@ -364,6 +375,139 @@ var collectListConfigs = (spec) => {
|
|
|
364
375
|
}
|
|
365
376
|
return configs;
|
|
366
377
|
};
|
|
378
|
+
var listConfigDirtyMatchPlanCache = /* @__PURE__ */ new WeakMap();
|
|
379
|
+
var getPathRootKey = (path) => path[0] ?? "";
|
|
380
|
+
var isRedundantDirtyRoot = (existingDirtyRoots, dirtyRoot) => {
|
|
381
|
+
for (const existing of existingDirtyRoots) {
|
|
382
|
+
if (isPrefixPath(existing, dirtyRoot)) {
|
|
383
|
+
return true;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
return false;
|
|
387
|
+
};
|
|
388
|
+
var upsertDirtyRoot = (existingDirtyRoots, dirtyRoot) => {
|
|
389
|
+
if (isRedundantDirtyRoot(existingDirtyRoots, dirtyRoot)) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
let nextLength = 0;
|
|
393
|
+
for (let i = 0; i < existingDirtyRoots.length; i++) {
|
|
394
|
+
const existing = existingDirtyRoots[i];
|
|
395
|
+
if (isPrefixPath(dirtyRoot, existing)) {
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
existingDirtyRoots[nextLength] = existing;
|
|
399
|
+
nextLength += 1;
|
|
400
|
+
}
|
|
401
|
+
existingDirtyRoots.length = nextLength;
|
|
402
|
+
existingDirtyRoots.push(dirtyRoot);
|
|
403
|
+
};
|
|
404
|
+
var buildListConfigDirtyMatchPlan = (listConfigs) => {
|
|
405
|
+
const listPaths = [];
|
|
406
|
+
const listPathsByRootKey = /* @__PURE__ */ new Map();
|
|
407
|
+
const trackByPathsByListPath = /* @__PURE__ */ new Map();
|
|
408
|
+
const seen = /* @__PURE__ */ new Set();
|
|
409
|
+
for (const cfg of listConfigs) {
|
|
410
|
+
const rawPath = typeof cfg.path === "string" ? cfg.path.trim() : "";
|
|
411
|
+
if (!rawPath) continue;
|
|
412
|
+
const normalized = normalizeFieldPath(rawPath);
|
|
413
|
+
if (!normalized || normalized.length === 0) {
|
|
414
|
+
return {
|
|
415
|
+
fallbackToDirtyAll: true,
|
|
416
|
+
listPaths: [],
|
|
417
|
+
listPathsByRootKey: /* @__PURE__ */ new Map(),
|
|
418
|
+
trackByPathsByListPath: /* @__PURE__ */ new Map()
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
const dedupeKey = JSON.stringify(normalized);
|
|
422
|
+
if (seen.has(dedupeKey)) continue;
|
|
423
|
+
seen.add(dedupeKey);
|
|
424
|
+
listPaths.push(normalized);
|
|
425
|
+
const rootKey = getPathRootKey(normalized);
|
|
426
|
+
const bucket = listPathsByRootKey.get(rootKey);
|
|
427
|
+
if (bucket) {
|
|
428
|
+
bucket.push(normalized);
|
|
429
|
+
} else {
|
|
430
|
+
listPathsByRootKey.set(rootKey, [normalized]);
|
|
431
|
+
}
|
|
432
|
+
const trackBy = typeof cfg.trackBy === "string" ? cfg.trackBy.trim() : "";
|
|
433
|
+
if (trackBy) {
|
|
434
|
+
const trackByNormalized = normalizeFieldPath(`${rawPath}.${trackBy}`);
|
|
435
|
+
if (!trackByNormalized || trackByNormalized.length === 0) {
|
|
436
|
+
return {
|
|
437
|
+
fallbackToDirtyAll: true,
|
|
438
|
+
listPaths: [],
|
|
439
|
+
listPathsByRootKey: /* @__PURE__ */ new Map(),
|
|
440
|
+
trackByPathsByListPath: /* @__PURE__ */ new Map()
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
trackByPathsByListPath.set(normalized, trackByNormalized);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return {
|
|
447
|
+
fallbackToDirtyAll: false,
|
|
448
|
+
listPaths,
|
|
449
|
+
listPathsByRootKey,
|
|
450
|
+
trackByPathsByListPath
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
var getListConfigDirtyMatchPlan = (listConfigs) => {
|
|
454
|
+
const cached = listConfigDirtyMatchPlanCache.get(listConfigs);
|
|
455
|
+
if (cached) return cached;
|
|
456
|
+
const next = buildListConfigDirtyMatchPlan(listConfigs);
|
|
457
|
+
listConfigDirtyMatchPlanCache.set(listConfigs, next);
|
|
458
|
+
return next;
|
|
459
|
+
};
|
|
460
|
+
var shouldReconcileListConfigsByDirtyEvidence = (args) => {
|
|
461
|
+
const { dirty, listConfigs, fieldPathIdRegistry } = args;
|
|
462
|
+
if (listConfigs.length === 0) return false;
|
|
463
|
+
if (dirty.dirtyAll) return true;
|
|
464
|
+
if (dirty.dirtyPathIds.length === 0) return false;
|
|
465
|
+
if (!fieldPathIdRegistry) return true;
|
|
466
|
+
const plan = getListConfigDirtyMatchPlan(listConfigs);
|
|
467
|
+
if (plan.fallbackToDirtyAll) return true;
|
|
468
|
+
if (plan.listPaths.length === 0) return false;
|
|
469
|
+
const fieldPaths = fieldPathIdRegistry.fieldPaths;
|
|
470
|
+
const dirtyRootsToProcessByRoot = /* @__PURE__ */ new Map();
|
|
471
|
+
for (const rawId of dirty.dirtyPathIds) {
|
|
472
|
+
if (!Number.isFinite(rawId)) {
|
|
473
|
+
return true;
|
|
474
|
+
}
|
|
475
|
+
const id = Math.floor(rawId);
|
|
476
|
+
if (id < 0) return true;
|
|
477
|
+
const dirtyPath = fieldPaths[id];
|
|
478
|
+
if (!dirtyPath) {
|
|
479
|
+
return true;
|
|
480
|
+
}
|
|
481
|
+
const rootKey = getPathRootKey(dirtyPath);
|
|
482
|
+
const existing = dirtyRootsToProcessByRoot.get(rootKey);
|
|
483
|
+
if (existing) {
|
|
484
|
+
upsertDirtyRoot(existing, dirtyPath);
|
|
485
|
+
continue;
|
|
486
|
+
}
|
|
487
|
+
dirtyRootsToProcessByRoot.set(rootKey, [dirtyPath]);
|
|
488
|
+
}
|
|
489
|
+
for (const [rootKey, dirtyRootsForRoot] of dirtyRootsToProcessByRoot) {
|
|
490
|
+
const candidates = plan.listPathsByRootKey.get(rootKey);
|
|
491
|
+
if (!candidates || candidates.length === 0) {
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
for (const dirtyRoot of dirtyRootsForRoot) {
|
|
495
|
+
for (const listPath of candidates) {
|
|
496
|
+
if (isPrefixPath(dirtyRoot, listPath)) {
|
|
497
|
+
return true;
|
|
498
|
+
}
|
|
499
|
+
const trackByPath = plan.trackByPathsByListPath.get(listPath);
|
|
500
|
+
if (trackByPath && overlapsPath(dirtyRoot, trackByPath)) {
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
if (!trackByPath && overlapsPath(dirtyRoot, listPath)) {
|
|
504
|
+
return true;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return false;
|
|
510
|
+
};
|
|
367
511
|
|
|
368
512
|
// src/internal/runtime/core/ReplayLog.ts
|
|
369
513
|
var ReplayLog_exports = {};
|
|
@@ -376,8 +520,8 @@ __export(ReplayLog_exports, {
|
|
|
376
520
|
resetCursor: () => resetCursor,
|
|
377
521
|
snapshot: () => snapshot
|
|
378
522
|
});
|
|
379
|
-
import {
|
|
380
|
-
var ReplayLog = class extends
|
|
523
|
+
import { Effect, Layer, ServiceMap } from "effect";
|
|
524
|
+
var ReplayLog = class extends ServiceMap.Service()("@logixjs/core/ReplayLog") {
|
|
381
525
|
};
|
|
382
526
|
var make = (initial) => {
|
|
383
527
|
const events = initial ? Array.from(initial) : [];
|
|
@@ -440,6 +584,7 @@ export {
|
|
|
440
584
|
parseListItemFieldPath,
|
|
441
585
|
toListItemValuePath,
|
|
442
586
|
RowIdStore,
|
|
443
|
-
collectListConfigs
|
|
587
|
+
collectListConfigs,
|
|
588
|
+
shouldReconcileListConfigsByDirtyEvidence
|
|
444
589
|
};
|
|
445
|
-
//# sourceMappingURL=chunk-
|
|
590
|
+
//# sourceMappingURL=chunk-EPQFNJU3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/state-trait/rowid.ts","../src/internal/runtime/core/ReplayLog.ts"],"sourcesContent":["import { normalizeFieldPath, type FieldPath, type FieldPathIdRegistry } from '../field-path.js'\nimport type { TxnDirtyEvidenceSnapshot } from '../runtime/core/StateTransaction.js'\n\nexport type RowId = string\n\nexport interface ListConfig {\n readonly path: string\n readonly trackBy?: string\n}\n\nexport type ListRemovalListener = (rowId: RowId) => void\n\ntype Segment = string | number\n\nconst parseSegments = (path: string): ReadonlyArray<Segment> => {\n if (!path) return []\n return path.split('.').map((seg) => (/^[0-9]+$/.test(seg) ? Number(seg) : seg))\n}\n\nconst isPrefixPath = (prefix: ReadonlyArray<string>, full: ReadonlyArray<string>): boolean => {\n if (prefix.length > full.length) return false\n for (let i = 0; i < prefix.length; i++) {\n if (prefix[i] !== full[i]) return false\n }\n return true\n}\n\nconst overlapsPath = (a: ReadonlyArray<string>, b: ReadonlyArray<string>): boolean => isPrefixPath(a, b) || isPrefixPath(b, a)\n\nexport const getAtPath = (state: any, path: string): any => {\n if (!path || state == null) return state\n const segments = parseSegments(path)\n let current: any = state\n for (const seg of segments) {\n if (current == null) return undefined\n if (typeof seg === 'number') {\n current = Array.isArray(current) ? current[seg] : current[String(seg)]\n continue\n }\n current = current[seg]\n }\n return current\n}\n\nexport const setAtPathMutating = (draft: unknown, path: string, value: unknown): void => {\n if (!path) return\n const segments = parseSegments(path)\n if (segments.length === 0) return\n\n let current: any = draft\n for (let i = 0; i < segments.length - 1; i++) {\n const key = segments[i]!\n const nextKey = segments[i + 1]!\n\n const next = current?.[key as any]\n if (next == null || typeof next !== 'object') {\n current[key as any] = typeof nextKey === 'number' ? [] : {}\n }\n current = current[key as any]\n }\n\n const last = segments[segments.length - 1]!\n current[last as any] = value\n}\n\nexport const unsetAtPathMutating = (draft: unknown, path: string): void => {\n if (!path) return\n const segments = parseSegments(path)\n if (segments.length === 0) return\n\n let current: any = draft\n for (let i = 0; i < segments.length - 1; i++) {\n const key = segments[i]!\n const next = current?.[key as any]\n if (next == null || typeof next !== 'object') {\n return\n }\n current = next\n }\n\n const last = segments[segments.length - 1]!\n if (Array.isArray(current) && typeof last === 'number') {\n // Keep arrays sparse (holes) rather than dense-undefined: improves perf in common \"sparse rows\" trees.\n delete current[last]\n return\n }\n\n if (current && typeof current === 'object') {\n delete current[last as any]\n }\n}\n\nexport const joinPath = (prefix: string, suffix: string): string => {\n if (!prefix) return suffix\n if (!suffix) return prefix\n return `${prefix}.${suffix}`\n}\n\nexport interface ListItemFieldPath {\n readonly listPath: string\n readonly itemPath: string\n}\n\n/**\n * parseListItemFieldPath:\n * - Recognize a list.item field path like \"items[].profileResource\".\n * - Supports nested arrays: returns listPath/itemPath for the innermost list.\n */\nexport const parseListItemFieldPath = (fieldPath: string): ListItemFieldPath | undefined => {\n const raw = typeof fieldPath === 'string' ? fieldPath.trim() : ''\n if (!raw) return undefined\n\n const segments = raw.split('.').filter(Boolean)\n let lastListSeg = -1\n for (let i = 0; i < segments.length; i++) {\n if (segments[i]!.endsWith('[]')) lastListSeg = i\n }\n if (lastListSeg < 0) return undefined\n\n const strip = (seg: string): string => (seg.endsWith('[]') ? seg.slice(0, -2) : seg)\n\n const listPath = segments\n .slice(0, lastListSeg + 1)\n .map(strip)\n .join('.')\n\n const itemPath = segments\n .slice(lastListSeg + 1)\n .map(strip)\n .join('.')\n\n return { listPath, itemPath }\n}\n\nexport const toListItemValuePath = (listPath: string, index: number, itemPath: string): string =>\n itemPath ? `${listPath}.${index}.${itemPath}` : `${listPath}.${index}`\n\ntype ListState = {\n readonly listPath: string\n readonly parentRowId?: RowId\n readonly itemsRef: ReadonlyArray<unknown>\n readonly ids: ReadonlyArray<RowId>\n readonly indexById: ReadonlyMap<RowId, number>\n readonly trackBy?: string\n}\n\nconst readTrackBy = (item: unknown, trackBy: string): unknown => {\n if (!item || typeof item !== 'object') return undefined\n const segments = trackBy.split('.')\n let current: any = item\n for (const seg of segments) {\n if (current == null) return undefined\n current = current[seg as any]\n }\n return current\n}\n\nconst didReorderByReference = (prevItems: ReadonlyArray<unknown>, nextItems: ReadonlyArray<unknown>): boolean => {\n const buckets = new Map<unknown, Array<number>>()\n for (let i = 0; i < prevItems.length; i++) {\n const item = prevItems[i]\n const list = buckets.get(item) ?? []\n list.push(i)\n buckets.set(item, list)\n }\n\n for (let nextIndex = 0; nextIndex < nextItems.length; nextIndex++) {\n const item = nextItems[nextIndex]\n const q = buckets.get(item)\n if (!q || q.length === 0) continue\n const prevIndex = q.shift()!\n if (prevIndex !== nextIndex) {\n return true\n }\n }\n\n return false\n}\n\nconst hasStableTrackByKeys = (items: ReadonlyArray<unknown>, trackBy: string): boolean =>\n items.every((item) => readTrackBy(item, trackBy) !== undefined)\n\nconst isSameTrackBySequence = (\n prevItems: ReadonlyArray<unknown>,\n nextItems: ReadonlyArray<unknown>,\n trackBy: string,\n): boolean => {\n if (prevItems.length !== nextItems.length) return false\n for (let i = 0; i < prevItems.length; i++) {\n if (!Object.is(readTrackBy(prevItems[i], trackBy), readTrackBy(nextItems[i], trackBy))) {\n return false\n }\n }\n return true\n}\n\nconst reconcileIds = (\n prev: ListState | undefined,\n nextItems: ReadonlyArray<unknown>,\n trackBy?: string,\n makeRowId?: () => RowId,\n): { readonly ids: ReadonlyArray<RowId>; readonly removed: ReadonlyArray<RowId> } => {\n const nextRowId =\n makeRowId ??\n (() => {\n let rowSeq = 0\n return () => {\n rowSeq += 1\n return `r${rowSeq}`\n }\n })()\n\n if (!prev) {\n return {\n ids: nextItems.map(() => nextRowId()),\n removed: [],\n }\n }\n\n if (prev.itemsRef === nextItems) {\n return {\n ids: prev.ids,\n removed: [],\n }\n }\n\n // Important: keep RowId stable under \"non-structural changes\" (field updates / object clones only),\n // otherwise in-flight state and caches would be invalidated needlessly.\n const sameLength = prev.itemsRef.length === nextItems.length\n if (sameLength) {\n // trackBy case: if the key sequence is identical, we can reuse old ids;\n // otherwise we must reconcile by key (avoid misclassifying clone+reorder as \"no reorder\").\n if (trackBy) {\n const canUseKeys = hasStableTrackByKeys(prev.itemsRef, trackBy) && hasStableTrackByKeys(nextItems, trackBy)\n if (canUseKeys) {\n if (isSameTrackBySequence(prev.itemsRef, nextItems, trackBy)) {\n return {\n ids: prev.ids,\n removed: [],\n }\n }\n } else {\n // If trackBy keys are not available, fall back to reference-level detection (keep stability for \"cloned but not reordered\").\n if (!didReorderByReference(prev.itemsRef, nextItems)) {\n return {\n ids: prev.ids,\n removed: [],\n }\n }\n }\n } else if (!didReorderByReference(prev.itemsRef, nextItems)) {\n return {\n ids: prev.ids,\n removed: [],\n }\n }\n }\n\n const keyOf = (item: unknown): unknown => {\n if (!trackBy) return item\n const k = readTrackBy(item, trackBy)\n return k !== undefined ? k : item\n }\n\n const buckets = new Map<unknown, Array<RowId>>()\n for (let i = 0; i < prev.itemsRef.length; i++) {\n const key = keyOf(prev.itemsRef[i])\n const list = buckets.get(key) ?? []\n list.push(prev.ids[i]!)\n buckets.set(key, list)\n }\n\n const ids: Array<RowId> = []\n for (let i = 0; i < nextItems.length; i++) {\n const key = keyOf(nextItems[i])\n const list = buckets.get(key)\n if (list && list.length > 0) {\n ids.push(list.shift()!)\n } else {\n ids.push(nextRowId())\n }\n }\n\n const removed: Array<RowId> = []\n for (const list of buckets.values()) {\n removed.push(...list)\n }\n\n return { ids, removed }\n}\n\nconst buildIndexById = (ids: ReadonlyArray<RowId>): ReadonlyMap<RowId, number> => {\n const map = new Map<RowId, number>()\n for (let i = 0; i < ids.length; i++) {\n map.set(ids[i]!, i)\n }\n return map\n}\n\nexport class RowIdStore {\n private readonly lists = new Map<string, ListState>()\n private readonly removalListeners = new Map<string, Set<ListRemovalListener>>()\n private readonly rowIdIndex = new Map<\n RowId,\n { readonly key: string; readonly listPath: string; readonly index: number }\n >()\n private nextRowSeq = 0\n\n constructor(private readonly instanceId?: string) {}\n\n private listKey = (listPath: string, parentRowId?: RowId): string =>\n parentRowId ? `${listPath}@@${parentRowId}` : listPath\n\n private makeRowId = (): RowId => {\n this.nextRowSeq += 1\n return this.instanceId ? `${this.instanceId}::r${this.nextRowSeq}` : `r${this.nextRowSeq}`\n }\n\n private notifyRemoved(listPath: string, rowId: RowId): void {\n const listeners = this.removalListeners.get(listPath)\n if (!listeners || listeners.size === 0) return\n for (const fn of listeners) {\n try {\n fn(rowId)\n } catch {\n // listener failures should never break runtime behavior\n }\n }\n }\n\n private removeDescendants(parentRowId: RowId): void {\n const keys: Array<string> = []\n for (const [k, st] of this.lists.entries()) {\n if (st.parentRowId === parentRowId) keys.push(k)\n }\n\n for (const key of keys) {\n const st = this.lists.get(key)\n if (!st) continue\n this.lists.delete(key)\n for (let i = 0; i < st.ids.length; i++) {\n const rowId = st.ids[i]!\n this.rowIdIndex.delete(rowId)\n this.notifyRemoved(st.listPath, rowId)\n this.removeDescendants(rowId)\n }\n }\n }\n\n onRemoved(listPath: string, listener: ListRemovalListener): () => void {\n const set = this.removalListeners.get(listPath) ?? new Set<ListRemovalListener>()\n set.add(listener)\n this.removalListeners.set(listPath, set)\n return () => {\n const current = this.removalListeners.get(listPath)\n if (!current) return\n current.delete(listener)\n if (current.size === 0) this.removalListeners.delete(listPath)\n }\n }\n\n getRowId(listPath: string, index: number, parentRowId?: RowId): RowId | undefined {\n const state = this.lists.get(this.listKey(listPath, parentRowId))\n return state ? state.ids[index] : undefined\n }\n\n getIndex(listPath: string, rowId: RowId): number | undefined {\n const info = this.rowIdIndex.get(rowId)\n if (!info) return undefined\n if (info.listPath !== listPath) return undefined\n return info.index\n }\n\n /**\n * ensureList:\n * - Align RowID mapping for the given listPath with the current items.\n * - Returns the latest ids (index -> RowId).\n */\n ensureList(\n listPath: string,\n items: ReadonlyArray<unknown>,\n trackBy?: string,\n parentRowId?: RowId,\n ): ReadonlyArray<RowId> {\n const key = this.listKey(listPath, parentRowId)\n const prev = this.lists.get(key)\n const { ids, removed } = reconcileIds(prev, items, trackBy ?? prev?.trackBy, this.makeRowId)\n\n const next: ListState = {\n listPath,\n parentRowId,\n itemsRef: items,\n ids,\n indexById: buildIndexById(ids),\n trackBy: trackBy ?? prev?.trackBy,\n }\n this.lists.set(key, next)\n\n if (removed.length > 0) {\n for (const rowId of removed) {\n this.rowIdIndex.delete(rowId)\n this.notifyRemoved(listPath, rowId)\n this.removeDescendants(rowId)\n }\n }\n\n // Refresh the reverse rowId -> index mapping (index changes are allowed).\n for (let i = 0; i < ids.length; i++) {\n const rowId = ids[i]!\n this.rowIdIndex.set(rowId, { key, listPath, index: i })\n }\n\n return ids\n }\n\n /**\n * updateAll:\n * - After each commit, align RowID mappings for all known lists.\n * - configs come from list declarations in StateTraitProgram.spec (may include trackBy).\n */\n updateAll(state: unknown, configs: ReadonlyArray<ListConfig>): void {\n const cfgByPath = new Map<string, ListConfig>()\n const paths: Array<string> = []\n for (const cfg of configs) {\n if (!cfg || typeof cfg.path !== 'string') continue\n const p = cfg.path.trim()\n if (!p) continue\n cfgByPath.set(p, cfg)\n paths.push(p)\n }\n\n const pathSet = new Set(paths)\n\n const parentOf = (path: string): string | undefined => {\n const segments = path.split('.').filter(Boolean)\n let best: string | undefined\n for (let i = 1; i < segments.length; i++) {\n const prefix = segments.slice(0, i).join('.')\n if (pathSet.has(prefix)) best = prefix\n }\n return best\n }\n\n const parentByPath = new Map<string, string | undefined>()\n const suffixByPath = new Map<string, string>()\n const childrenByParent = new Map<string | undefined, Array<string>>()\n\n for (const path of paths) {\n const parent = parentOf(path)\n parentByPath.set(path, parent)\n const suffix = parent ? path.slice(parent.length + 1) : path\n suffixByPath.set(path, suffix)\n const list = childrenByParent.get(parent) ?? []\n list.push(path)\n childrenByParent.set(parent, list)\n }\n\n // roots first (and deterministic traversal)\n const roots = (childrenByParent.get(undefined) ?? []).slice().sort()\n\n const visit = (listPath: string, parentRowId: RowId | undefined, listValue: unknown): void => {\n const cfg = cfgByPath.get(listPath)\n const items = Array.isArray(listValue) ? (listValue as ReadonlyArray<unknown>) : []\n const ids = this.ensureList(listPath, items, cfg?.trackBy, parentRowId)\n\n const children = (childrenByParent.get(listPath) ?? []).slice().sort()\n if (children.length === 0) return\n\n for (let i = 0; i < items.length; i++) {\n const row = items[i]\n const rowId = ids[i]\n if (!rowId) continue\n for (const childPath of children) {\n const suffix = suffixByPath.get(childPath) ?? ''\n const childValue = suffix ? getAtPath(row as any, suffix) : undefined\n visit(childPath, rowId, childValue)\n }\n }\n }\n\n for (const root of roots) {\n const value = getAtPath(state as any, root)\n visit(root, undefined, value)\n }\n }\n}\n\nexport const collectListConfigs = (spec: Record<string, unknown>): ReadonlyArray<ListConfig> => {\n const configs: Array<ListConfig> = []\n for (const key in spec) {\n if (!Object.prototype.hasOwnProperty.call(spec, key)) continue\n const raw = spec[key]\n if (!raw || typeof raw !== 'object') continue\n const tag = (raw as any)._tag\n if (tag !== 'StateTraitList') continue\n const trackBy = (raw as any).identityHint?.trackBy\n configs.push({\n path: key,\n trackBy: typeof trackBy === 'string' ? trackBy : undefined,\n })\n }\n return configs\n}\n\ntype ListConfigDirtyMatchPlan = {\n readonly fallbackToDirtyAll: boolean\n readonly listPaths: ReadonlyArray<FieldPath>\n readonly listPathsByRootKey: ReadonlyMap<string, ReadonlyArray<FieldPath>>\n /**\n * trackByPathsByListPath:\n * - key: normalized listPath (by reference)\n * - value: normalized full field path for the list item trackBy field (listPath + trackBy segments)\n *\n * Used to decide when RowId mappings must be reconciled even if the list root itself is not dirty:\n * - changing trackBy values can change row identity, which impacts in-flight gates and nested list bindings.\n */\n readonly trackByPathsByListPath: ReadonlyMap<FieldPath, FieldPath>\n}\n\nconst listConfigDirtyMatchPlanCache = new WeakMap<ReadonlyArray<ListConfig>, ListConfigDirtyMatchPlan>()\n\nconst getPathRootKey = (path: ReadonlyArray<string>): string => path[0] ?? ''\n\nconst isRedundantDirtyRoot = (existingDirtyRoots: ReadonlyArray<FieldPath>, dirtyRoot: FieldPath): boolean => {\n for (const existing of existingDirtyRoots) {\n if (isPrefixPath(existing, dirtyRoot)) {\n return true\n }\n }\n return false\n}\n\nconst upsertDirtyRoot = (existingDirtyRoots: Array<FieldPath>, dirtyRoot: FieldPath): void => {\n if (isRedundantDirtyRoot(existingDirtyRoots, dirtyRoot)) {\n return\n }\n\n let nextLength = 0\n for (let i = 0; i < existingDirtyRoots.length; i++) {\n const existing = existingDirtyRoots[i]!\n if (isPrefixPath(dirtyRoot, existing)) {\n continue\n }\n existingDirtyRoots[nextLength] = existing\n nextLength += 1\n }\n existingDirtyRoots.length = nextLength\n existingDirtyRoots.push(dirtyRoot)\n}\n\nconst buildListConfigDirtyMatchPlan = (listConfigs: ReadonlyArray<ListConfig>): ListConfigDirtyMatchPlan => {\n const listPaths: Array<FieldPath> = []\n const listPathsByRootKey = new Map<string, Array<FieldPath>>()\n const trackByPathsByListPath = new Map<FieldPath, FieldPath>()\n const seen = new Set<string>()\n\n for (const cfg of listConfigs) {\n const rawPath = typeof cfg.path === 'string' ? cfg.path.trim() : ''\n if (!rawPath) continue\n\n const normalized = normalizeFieldPath(rawPath)\n if (!normalized || normalized.length === 0) {\n // Conservative fallback: unknown list path encoding must not skip RowID alignment.\n return {\n fallbackToDirtyAll: true,\n listPaths: [],\n listPathsByRootKey: new Map(),\n trackByPathsByListPath: new Map(),\n }\n }\n\n const dedupeKey = JSON.stringify(normalized)\n if (seen.has(dedupeKey)) continue\n seen.add(dedupeKey)\n listPaths.push(normalized)\n\n const rootKey = getPathRootKey(normalized)\n const bucket = listPathsByRootKey.get(rootKey)\n if (bucket) {\n bucket.push(normalized)\n } else {\n listPathsByRootKey.set(rootKey, [normalized])\n }\n\n const trackBy = typeof cfg.trackBy === 'string' ? cfg.trackBy.trim() : ''\n if (trackBy) {\n const trackByNormalized = normalizeFieldPath(`${rawPath}.${trackBy}`)\n if (!trackByNormalized || trackByNormalized.length === 0) {\n // Conservative fallback: unknown trackBy encoding must not skip RowID alignment.\n return {\n fallbackToDirtyAll: true,\n listPaths: [],\n listPathsByRootKey: new Map(),\n trackByPathsByListPath: new Map(),\n }\n }\n trackByPathsByListPath.set(normalized, trackByNormalized)\n }\n }\n\n return {\n fallbackToDirtyAll: false,\n listPaths,\n listPathsByRootKey,\n trackByPathsByListPath,\n }\n}\n\nconst getListConfigDirtyMatchPlan = (listConfigs: ReadonlyArray<ListConfig>): ListConfigDirtyMatchPlan => {\n // Runtime keeps listConfigs identity stable between trait program rebuilds; cache keying by array reference is effective on hot commits.\n const cached = listConfigDirtyMatchPlanCache.get(listConfigs)\n if (cached) return cached\n\n const next = buildListConfigDirtyMatchPlan(listConfigs)\n listConfigDirtyMatchPlanCache.set(listConfigs, next)\n return next\n}\n\nexport const shouldReconcileListConfigsByDirtyEvidence = (args: {\n readonly dirty: TxnDirtyEvidenceSnapshot\n readonly listConfigs: ReadonlyArray<ListConfig>\n readonly fieldPathIdRegistry?: FieldPathIdRegistry\n}): boolean => {\n const { dirty, listConfigs, fieldPathIdRegistry } = args\n if (listConfigs.length === 0) return false\n if (dirty.dirtyAll) return true\n if (dirty.dirtyPathIds.length === 0) return false\n if (!fieldPathIdRegistry) return true\n\n const plan = getListConfigDirtyMatchPlan(listConfigs)\n if (plan.fallbackToDirtyAll) return true\n if (plan.listPaths.length === 0) return false\n\n const fieldPaths = fieldPathIdRegistry.fieldPaths\n const dirtyRootsToProcessByRoot = new Map<string, Array<FieldPath>>()\n\n for (const rawId of dirty.dirtyPathIds) {\n if (!Number.isFinite(rawId)) {\n // Conservative fallback: non-finite evidence must not skip RowID alignment.\n return true\n }\n const id = Math.floor(rawId)\n if (id < 0) return true\n\n const dirtyPath: FieldPath | undefined = fieldPaths[id]\n if (!dirtyPath) {\n // Conservative fallback: unknown pathId must not accidentally skip RowID alignment.\n return true\n }\n\n const rootKey = getPathRootKey(dirtyPath)\n const existing = dirtyRootsToProcessByRoot.get(rootKey)\n if (existing) {\n upsertDirtyRoot(existing, dirtyPath)\n continue\n }\n dirtyRootsToProcessByRoot.set(rootKey, [dirtyPath])\n }\n\n for (const [rootKey, dirtyRootsForRoot] of dirtyRootsToProcessByRoot) {\n const candidates = plan.listPathsByRootKey.get(rootKey)\n if (!candidates || candidates.length === 0) {\n continue\n }\n\n for (const dirtyRoot of dirtyRootsForRoot) {\n for (const listPath of candidates) {\n // 1) Structural changes: when the dirty root is at/above the list path (prefix),\n // we must reconcile because insert/remove/reorder in parent lists affects nested list bindings too.\n if (isPrefixPath(dirtyRoot, listPath)) {\n return true\n }\n\n // 2) TrackBy changes: even if the list root is not dirty, changing trackBy values can change row identity.\n const trackByPath = plan.trackByPathsByListPath.get(listPath)\n if (trackByPath && overlapsPath(dirtyRoot, trackByPath)) {\n return true\n }\n\n // 3) No trackBy: keep legacy behavior.\n // For reference-based identity, we must keep RowIdStore's itemsRef aligned even for nested field updates,\n // otherwise later structural changes (insert/remove/reorder) can churn RowIds and break in-flight writebacks.\n if (!trackByPath && overlapsPath(dirtyRoot, listPath)) {\n return true\n }\n }\n }\n }\n\n return false\n}\n","import { Effect, Layer, ServiceMap } from 'effect'\n\nexport type ResourceSnapshotPhase = 'idle' | 'loading' | 'success' | 'error'\n\nexport type ReplayLogEvent =\n | {\n readonly _tag: 'ResourceSnapshot'\n readonly resourceId: string\n readonly fieldPath: string\n readonly keyHash?: string\n /**\n * Optional: source concurrency policy (e.g. \"switch\" / \"exhaust-trailing\").\n * - Must remain slim & serializable.\n * - Used by Devtools/replay to explain why old results are dropped / why trailing happens.\n */\n readonly concurrency?: string\n readonly phase: ResourceSnapshotPhase\n readonly snapshot: unknown\n readonly timestamp: number\n readonly moduleId?: string\n readonly instanceId?: string\n }\n | {\n readonly _tag: 'InvalidateRequest'\n readonly timestamp: number\n readonly moduleId?: string\n readonly instanceId?: string\n readonly kind: 'resource' | 'query'\n readonly target: string\n readonly meta?: unknown\n }\n\nexport type ResourceSnapshotEvent = Extract<ReplayLogEvent, { readonly _tag: 'ResourceSnapshot' }>\n\nexport interface ReplayLogService {\n readonly record: (event: ReplayLogEvent) => Effect.Effect<void>\n readonly snapshot: Effect.Effect<ReadonlyArray<ReplayLogEvent>>\n readonly resetCursor: Effect.Effect<void>\n readonly consumeNext: (predicate: (event: ReplayLogEvent) => boolean) => Effect.Effect<ReplayLogEvent | undefined>\n readonly consumeNextResourceSnapshot: (params: {\n readonly resourceId: string\n readonly fieldPath: string\n readonly keyHash?: string\n readonly phase?: ResourceSnapshotPhase\n }) => Effect.Effect<ResourceSnapshotEvent | undefined>\n}\n\nexport class ReplayLog extends ServiceMap.Service<ReplayLog, ReplayLogService>()('@logixjs/core/ReplayLog') {}\n\nexport const make = (initial?: ReadonlyArray<ReplayLogEvent>): ReplayLogService => {\n const events: Array<ReplayLogEvent> = initial ? Array.from(initial) : []\n let cursor = 0\n\n const consumeNext = (predicate: (event: ReplayLogEvent) => boolean): Effect.Effect<ReplayLogEvent | undefined> =>\n Effect.sync(() => {\n for (let i = cursor; i < events.length; i++) {\n const event = events[i]\n if (!predicate(event)) continue\n cursor = i + 1\n return event\n }\n return undefined\n })\n\n const consumeNextResourceSnapshot = (params: {\n readonly resourceId: string\n readonly fieldPath: string\n readonly keyHash?: string\n readonly phase?: ResourceSnapshotPhase\n }): Effect.Effect<ResourceSnapshotEvent | undefined> =>\n consumeNext((event): event is ResourceSnapshotEvent => {\n if (event._tag !== 'ResourceSnapshot') return false\n if (event.resourceId !== params.resourceId) return false\n if (event.fieldPath !== params.fieldPath) return false\n if (params.keyHash !== undefined && event.keyHash !== params.keyHash) {\n return false\n }\n if (params.phase !== undefined && event.phase !== params.phase) {\n return false\n }\n return true\n }).pipe(Effect.map((event) => event as ResourceSnapshotEvent | undefined))\n\n return {\n record: (event) => Effect.sync(() => events.push(event)),\n snapshot: Effect.sync(() => events.slice()),\n resetCursor: Effect.sync(() => {\n cursor = 0\n }),\n consumeNext,\n consumeNextResourceSnapshot,\n }\n}\n\nexport const layer = (initial?: ReadonlyArray<ReplayLogEvent>): Layer.Layer<ReplayLog, never, never> =>\n Layer.succeed(ReplayLog, make(initial))\n\nexport const record = (event: ReplayLogEvent): Effect.Effect<void, never, ReplayLog> =>\n Effect.gen(function* () {\n const log = yield* ReplayLog\n yield* log.record(event)\n })\n\nexport const snapshot: Effect.Effect<ReadonlyArray<ReplayLogEvent>, never, ReplayLog> = Effect.gen(function* () {\n const log = yield* ReplayLog\n return yield* log.snapshot\n})\n\nexport const resetCursor: Effect.Effect<void, never, ReplayLog> = Effect.gen(function* () {\n const log = yield* ReplayLog\n yield* log.resetCursor\n})\n\nexport const consumeNextResourceSnapshot = (params: {\n readonly resourceId: string\n readonly fieldPath: string\n readonly keyHash?: string\n readonly phase?: ResourceSnapshotPhase\n}): Effect.Effect<ResourceSnapshotEvent | undefined, never, ReplayLog> =>\n Effect.gen(function* () {\n const log = yield* ReplayLog\n return yield* log.consumeNextResourceSnapshot(params)\n })\n"],"mappings":";;;;;;;;AAcA,IAAM,gBAAgB,CAAC,SAAyC;AAC9D,MAAI,CAAC,KAAM,QAAO,CAAC;AACnB,SAAO,KAAK,MAAM,GAAG,EAAE,IAAI,CAAC,QAAS,WAAW,KAAK,GAAG,IAAI,OAAO,GAAG,IAAI,GAAI;AAChF;AAEA,IAAM,eAAe,CAAC,QAA+B,SAAyC;AAC5F,MAAI,OAAO,SAAS,KAAK,OAAQ,QAAO;AACxC,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,QAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAG,QAAO;AAAA,EACpC;AACA,SAAO;AACT;AAEA,IAAM,eAAe,CAAC,GAA0B,MAAsC,aAAa,GAAG,CAAC,KAAK,aAAa,GAAG,CAAC;AAEtH,IAAM,YAAY,CAAC,OAAY,SAAsB;AAC1D,MAAI,CAAC,QAAQ,SAAS,KAAM,QAAO;AACnC,QAAM,WAAW,cAAc,IAAI;AACnC,MAAI,UAAe;AACnB,aAAW,OAAO,UAAU;AAC1B,QAAI,WAAW,KAAM,QAAO;AAC5B,QAAI,OAAO,QAAQ,UAAU;AAC3B,gBAAU,MAAM,QAAQ,OAAO,IAAI,QAAQ,GAAG,IAAI,QAAQ,OAAO,GAAG,CAAC;AACrE;AAAA,IACF;AACA,cAAU,QAAQ,GAAG;AAAA,EACvB;AACA,SAAO;AACT;AAEO,IAAM,oBAAoB,CAAC,OAAgB,MAAc,UAAyB;AACvF,MAAI,CAAC,KAAM;AACX,QAAM,WAAW,cAAc,IAAI;AACnC,MAAI,SA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,IAAI,aAAa;AACxF,QAAM,MAAM,OAAO;AACnB,SAAO,IAAI;AACb,CAAC;AAEM,IAAM,8BAA8B,CAAC,WAM1C,OAAO,IAAI,aAAa;AACtB,QAAM,MAAM,OAAO;AACnB,SAAO,OAAO,IAAI,4BAA4B,MAAM;AACtD,CAAC;","names":["consumeNextResourceSnapshot"]}
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
installOne,
|
|
3
|
+
mountAll
|
|
4
|
+
} from "./chunk-PD6YECQH.js";
|
|
1
5
|
import {
|
|
2
6
|
Reducer,
|
|
3
7
|
make
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6YZOXFPQ.js";
|
|
5
9
|
import {
|
|
6
10
|
attachLogicUnitMeta,
|
|
7
11
|
getLogicUnitMeta,
|
|
8
12
|
updateLogicUnitMeta
|
|
9
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NUDBM4MM.js";
|
|
10
14
|
import {
|
|
11
15
|
isActionToken,
|
|
12
16
|
normalizeActions
|
|
13
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6HFAW2MH.js";
|
|
14
18
|
import {
|
|
15
19
|
internal,
|
|
16
20
|
record
|
|
17
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GNEN7NKO.js";
|
|
18
22
|
import {
|
|
19
23
|
isDevEnv
|
|
20
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-S4S5N4BJ.js";
|
|
21
25
|
import {
|
|
22
26
|
__export
|
|
23
27
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -34,7 +38,7 @@ __export(Module_exports, {
|
|
|
34
38
|
unwrapImpl: () => unwrapImpl,
|
|
35
39
|
unwrapTag: () => unwrapTag
|
|
36
40
|
});
|
|
37
|
-
import {
|
|
41
|
+
import { Effect, ServiceMap } from "effect";
|
|
38
42
|
var attachLogicUnitMeta2 = (logic, meta) => attachLogicUnitMeta(logic, meta);
|
|
39
43
|
var MODULE_INTERNAL = /* @__PURE__ */ Symbol.for("logix.module.internal");
|
|
40
44
|
var MODULE_DECLARED_EFFECTS = /* @__PURE__ */ Symbol.for("logix.module.effects.declared");
|
|
@@ -42,7 +46,7 @@ var is = (value) => {
|
|
|
42
46
|
if (!value || typeof value !== "object") return false;
|
|
43
47
|
const kind = value._kind;
|
|
44
48
|
if (kind !== "ModuleDef" && kind !== "Module") return false;
|
|
45
|
-
return
|
|
49
|
+
return ServiceMap.isKey(value.tag);
|
|
46
50
|
};
|
|
47
51
|
var hasImpl = (value) => {
|
|
48
52
|
if (!is(value)) return false;
|
|
@@ -170,9 +174,9 @@ var makeOverrideDiagnosticsLogic = (tag, overrides) => {
|
|
|
170
174
|
return tag.logic(
|
|
171
175
|
() => Effect.gen(function* () {
|
|
172
176
|
if (!isDevEnv()) return;
|
|
173
|
-
const diagnosticsLevel = yield*
|
|
177
|
+
const diagnosticsLevel = yield* Effect.service(internal.currentDiagnosticsLevel).pipe(Effect.orDie);
|
|
174
178
|
if (diagnosticsLevel === "off") return;
|
|
175
|
-
const runtime = yield* tag;
|
|
179
|
+
const runtime = yield* Effect.service(tag).pipe(Effect.orDie);
|
|
176
180
|
yield* Effect.forEach(
|
|
177
181
|
overrides,
|
|
178
182
|
(o) => record({
|
|
@@ -188,7 +192,7 @@ to(#${o.to.order}) kind=${o.to.kind} name=${o.to.name ?? "unknown"} source=${for
|
|
|
188
192
|
}),
|
|
189
193
|
{ discard: true }
|
|
190
194
|
);
|
|
191
|
-
})
|
|
195
|
+
}).pipe(Effect.catchCause(() => Effect.void))
|
|
192
196
|
);
|
|
193
197
|
};
|
|
194
198
|
var makeDeclaredEffectsLogic = (tag, effects, moduleId) => {
|
|
@@ -365,6 +369,7 @@ function make2(id, def, extend) {
|
|
|
365
369
|
const imports = config.imports;
|
|
366
370
|
const processes = config.processes;
|
|
367
371
|
const stateTransaction = config.stateTransaction;
|
|
372
|
+
const workflowDefs = Array.isArray(config.__logix_workflowDefs) ? config.__logix_workflowDefs : [];
|
|
368
373
|
const mountedResult = (config.logics ?? []).reduce(
|
|
369
374
|
(acc, logic) => mountLogicUnit(acc.mounted, acc.overrides, { logic }),
|
|
370
375
|
{ mounted: [], overrides: [] }
|
|
@@ -394,6 +399,7 @@ function make2(id, def, extend) {
|
|
|
394
399
|
mounted: state.mounted,
|
|
395
400
|
overrides: state.overrides,
|
|
396
401
|
layers: state.layers,
|
|
402
|
+
workflowDefs: state.workflowDefs,
|
|
397
403
|
rebuild: () => buildImpl(state)
|
|
398
404
|
};
|
|
399
405
|
const mod = {
|
|
@@ -418,7 +424,8 @@ function make2(id, def, extend) {
|
|
|
418
424
|
return createModule({
|
|
419
425
|
mounted: next.mounted,
|
|
420
426
|
overrides: next.overrides,
|
|
421
|
-
layers: current.layers
|
|
427
|
+
layers: current.layers,
|
|
428
|
+
workflowDefs: current.workflowDefs
|
|
422
429
|
});
|
|
423
430
|
};
|
|
424
431
|
mod.withLayer = (layer) => {
|
|
@@ -426,18 +433,70 @@ function make2(id, def, extend) {
|
|
|
426
433
|
return createModule({
|
|
427
434
|
mounted: current.mounted,
|
|
428
435
|
overrides: current.overrides,
|
|
429
|
-
layers: [...current.layers, layer]
|
|
436
|
+
layers: [...current.layers, layer],
|
|
437
|
+
workflowDefs: current.workflowDefs
|
|
430
438
|
});
|
|
431
439
|
};
|
|
432
440
|
mod.withLayers = (...layers) => layers.reduce((acc, layer) => acc.withLayer(layer), mod);
|
|
441
|
+
mod.withWorkflow = (workflow) => {
|
|
442
|
+
const install = workflow?.install;
|
|
443
|
+
const logic = typeof install === "function" ? install(mod.tag) : installOne({ moduleTag: mod.tag, program: workflow });
|
|
444
|
+
const current = mod[MODULE_INTERNAL];
|
|
445
|
+
const next = mountLogicUnit(current.mounted, current.overrides, { logic });
|
|
446
|
+
const nextWorkflowDefs = [...current.workflowDefs, workflow.def];
|
|
447
|
+
return createModule({
|
|
448
|
+
mounted: next.mounted,
|
|
449
|
+
overrides: next.overrides,
|
|
450
|
+
layers: current.layers,
|
|
451
|
+
workflowDefs: nextWorkflowDefs
|
|
452
|
+
});
|
|
453
|
+
};
|
|
454
|
+
mod.withWorkflows = (workflows) => {
|
|
455
|
+
if (!Array.isArray(workflows) || workflows.length === 0) return mod;
|
|
456
|
+
const logic = mountAll({ moduleTag: mod.tag, programs: workflows });
|
|
457
|
+
const current = mod[MODULE_INTERNAL];
|
|
458
|
+
const next = mountLogicUnit(current.mounted, current.overrides, { logic });
|
|
459
|
+
const nextWorkflowDefs = [...current.workflowDefs, ...workflows.map((w) => w.def)];
|
|
460
|
+
return createModule({
|
|
461
|
+
mounted: next.mounted,
|
|
462
|
+
overrides: next.overrides,
|
|
463
|
+
layers: current.layers,
|
|
464
|
+
workflowDefs: nextWorkflowDefs
|
|
465
|
+
});
|
|
466
|
+
};
|
|
433
467
|
return mod;
|
|
434
468
|
};
|
|
435
469
|
return createModule({
|
|
436
470
|
mounted: mountedResult.mounted,
|
|
437
471
|
overrides: mountedResult.overrides,
|
|
438
|
-
layers: []
|
|
472
|
+
layers: [],
|
|
473
|
+
workflowDefs
|
|
439
474
|
});
|
|
440
475
|
};
|
|
476
|
+
const baseImplement = base.implement;
|
|
477
|
+
const withExtraLogics = (extraLogics, extraWorkflowDefs) => {
|
|
478
|
+
const next = { ...base };
|
|
479
|
+
next.withWorkflow = (workflow) => {
|
|
480
|
+
const install = workflow?.install;
|
|
481
|
+
const logic = typeof install === "function" ? install(next.tag) : installOne({ moduleTag: next.tag, program: workflow });
|
|
482
|
+
return withExtraLogics([...extraLogics, logic], [...extraWorkflowDefs, workflow.def]);
|
|
483
|
+
};
|
|
484
|
+
next.withWorkflows = (workflows) => {
|
|
485
|
+
if (!Array.isArray(workflows) || workflows.length === 0) return next;
|
|
486
|
+
const logic = mountAll({ moduleTag: next.tag, programs: workflows });
|
|
487
|
+
return withExtraLogics(
|
|
488
|
+
[...extraLogics, logic],
|
|
489
|
+
[...extraWorkflowDefs, ...workflows.map((w) => w.def)]
|
|
490
|
+
);
|
|
491
|
+
};
|
|
492
|
+
next.implement = (config) => {
|
|
493
|
+
const mergedLogics = [...config.logics ?? [], ...extraLogics];
|
|
494
|
+
return baseImplement({ ...config, logics: mergedLogics, __logix_workflowDefs: extraWorkflowDefs });
|
|
495
|
+
};
|
|
496
|
+
return next;
|
|
497
|
+
};
|
|
498
|
+
base.withWorkflow = (workflow) => withExtraLogics([], []).withWorkflow(workflow);
|
|
499
|
+
base.withWorkflows = (workflows) => withExtraLogics([], []).withWorkflows(workflows);
|
|
441
500
|
return base;
|
|
442
501
|
}
|
|
443
502
|
var Manage = {
|
|
@@ -458,4 +517,4 @@ export {
|
|
|
458
517
|
Manage,
|
|
459
518
|
Module_exports
|
|
460
519
|
};
|
|
461
|
-
//# sourceMappingURL=chunk-
|
|
520
|
+
//# sourceMappingURL=chunk-ESR6HGOY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Module.ts"],"sourcesContent":["import { Effect, Layer, Schema, ServiceMap } from 'effect'\nimport * as Debug from './Debug.js'\nimport * as Logic from './Logic.js'\nimport * as ModuleTagNS from './ModuleTag.js'\nimport type { Workflow } from './Workflow.js'\nimport * as Action from './internal/action.js'\nimport type { JsonValue } from './internal/observability/jsonValue.js'\nimport * as WorkflowRuntime from './internal/runtime/core/WorkflowRuntime.js'\nimport { isDevEnv } from './internal/runtime/core/env.js'\nimport * as LogicUnitMetaInternal from './internal/runtime/core/LogicUnitMeta.js'\nimport type {\n ActionsFromMap,\n ActionOf,\n AnyModuleShape,\n AnySchema,\n BoundApi,\n LogicEffect,\n ModuleLike,\n ModuleHandle,\n ModuleImpl,\n ModuleImplementStateTransactionOptions,\n ModuleLogic,\n ModuleRuntime,\n ModuleRuntimeOfShape,\n ModuleTag,\n ModuleShape,\n MutatorsFromMap,\n ReducersFromMap,\n StateChangeWithMeta,\n StateCommitMeta,\n StateCommitMode,\n StateCommitPriority,\n StateOf,\n ReadonlySubscriptionRef,\n} from './internal/module.js'\n\n/**\n * Module (definition object) public API.\n *\n * - Domain factories (Form / CRUD / ...) should return this object.\n * - `.tag` is the identity anchor (ModuleTag/Context.Tag), used by `$.use(...)` and Env injection.\n * - `.impl` is the assembly blueprint (ModuleImpl), consumed by React/Runtime entry points.\n * - `.logic()` only produces the logic value; `.withLogic/withLayer(s)` changes the runnable shape (immutable: returns a new object).\n */\n\nexport type {\n AnySchema,\n AnyModuleShape,\n ModuleShape,\n ModuleLogic,\n ModuleImpl,\n ModuleRuntime,\n ModuleRuntimeOfShape,\n ModuleHandle,\n ModuleTag,\n StateOf,\n ActionOf,\n ActionsFromMap,\n MutatorsFromMap,\n ReducersFromMap,\n BoundApi,\n LogicEffect,\n DispatchEffect,\n ActionForTag,\n BoundApiRootApi,\n BoundApiStateApi,\n BoundApiDispatchersApi,\n BoundApiDispatchApi,\n BoundApiLifecycleApi,\n BoundApiUseApi,\n BoundApiTraitsApi,\n BoundApiReducerApi,\n StateCommitMode,\n StateCommitPriority,\n StateCommitMeta,\n StateChangeWithMeta,\n ReadonlySubscriptionRef,\n} from './internal/module.js'\n\nexport interface DevSource {\n readonly file: string\n readonly line: number\n readonly column: number\n}\n\nexport interface ModuleDev {\n readonly source?: DevSource\n}\n\nexport interface LogicUnitOptions {\n readonly id?: string\n readonly kind?: string\n readonly name?: string\n readonly source?: DevSource\n}\n\nexport interface MountedLogicUnitSummary {\n readonly kind: string\n readonly id: string\n readonly derived?: boolean\n readonly name?: string\n}\n\nexport interface ModuleDescriptor {\n readonly id: string\n readonly moduleId: string\n readonly instanceId: string\n readonly actionKeys: ReadonlyArray<string>\n readonly logicUnits: ReadonlyArray<MountedLogicUnitSummary>\n readonly schemaKeys?: ReadonlyArray<string>\n readonly meta?: Record<string, JsonValue>\n readonly source?: DevSource\n}\n\nexport type HandleExtendFn<Sh extends AnyModuleShape, Ext extends object> = (\n runtime: ModuleRuntimeOfShape<Sh>,\n base: ModuleHandle<Sh>,\n) => Ext | (ModuleHandle<Sh> & Ext) | null | undefined\n\nexport type ModuleSelfHandleEffect<Sh extends AnyModuleShape, R = never, Ext extends object = {}> = LogicEffect<\n Sh,\n R,\n ModuleHandle<Sh> & Ext,\n never\n>\n\nexport type ModuleLogicApi<Sh extends AnyModuleShape, R = never, Ext extends object = {}> = BoundApi<Sh, R> & {\n readonly self: ModuleSelfHandleEffect<Sh, R, Ext>\n}\n\ntype LogicUnitMeta = LogicUnitMetaInternal.LogicUnitMeta\nconst attachLogicUnitMeta = <L extends object>(logic: L, meta: LogicUnitMeta): L =>\n LogicUnitMetaInternal.attachLogicUnitMeta(logic, meta as any) as any\n\ntype NoInfer_<T> = [T][T extends any ? 0 : never]\n\ntype MountedLogicUnit<Sh extends AnyModuleShape> = {\n readonly id: string\n readonly derived: boolean\n readonly kind: string\n readonly name?: string\n readonly source?: DevSource\n readonly logic: ModuleLogic<Sh, any, any>\n readonly origin?: {\n readonly explicitId?: string\n readonly defaultId?: string\n readonly derivedBase?: string\n }\n}\n\ntype LogicOverrideWarning = {\n readonly id: string\n readonly from: Pick<MountedLogicUnit<any>, 'kind' | 'name' | 'source'> & {\n readonly order: number\n }\n readonly to: Pick<MountedLogicUnit<any>, 'kind' | 'name' | 'source'> & {\n readonly order: number\n }\n}\n\ntype WorkflowDef = Workflow['def']\n\ntype ModuleInternal<Id extends string, Sh extends AnyModuleShape> = {\n readonly initial: StateOf<Sh>\n readonly imports?: ReadonlyArray<Layer.Layer<any, any, any> | ModuleImpl<any, AnyModuleShape, any>>\n readonly processes?: ReadonlyArray<Effect.Effect<void, any, any>>\n readonly stateTransaction?: ModuleImplementStateTransactionOptions\n readonly mounted: ReadonlyArray<MountedLogicUnit<Sh>>\n readonly overrides: ReadonlyArray<LogicOverrideWarning>\n readonly layers: ReadonlyArray<Layer.Layer<any, never, any>>\n readonly workflowDefs: ReadonlyArray<WorkflowDef>\n readonly rebuild: () => ModuleImpl<Id, Sh, any>\n}\n\nconst MODULE_INTERNAL = Symbol.for('logix.module.internal')\nconst MODULE_DECLARED_EFFECTS = Symbol.for('logix.module.effects.declared')\n\ntype ModuleDefBase<\n Id extends string = string,\n Sh extends AnyModuleShape = AnyModuleShape,\n Ext extends object = {},\n> = ModuleLike<Id, Sh, Ext> & {\n readonly shape: Sh\n readonly stateSchema: Sh['stateSchema']\n readonly actionSchema: Sh['actionSchema']\n /**\n * Raw ActionMap (tag -> payload schema).\n * - Mainly for DX/reflection; runtime contract is still based on tag.shape/actionSchema.\n */\n readonly actions: Sh['actionMap']\n /**\n * Raw reducers (if provided by the definition).\n * - Mainly for DX/reflection; runtime normalizes them into primary reducers inside ModuleTag/ModuleFactory.\n */\n readonly reducers?: ReducersFromMap<Sh['stateSchema'], Sh['actionMap']>\n readonly live: <R = never, E = never>(\n initial: StateOf<Sh>,\n ...logics: Array<ModuleLogic<Sh, R, E>>\n ) => Layer.Layer<ModuleRuntimeOfShape<Sh>, E, R>\n readonly schemas?: Record<string, unknown>\n readonly meta?: Record<string, JsonValue>\n readonly services?: Record<string, ServiceMap.Key<any, any>>\n readonly dev?: ModuleDev\n readonly logic: <R = never, E = unknown>(\n build: (\n api: ModuleLogicApi<Sh, R, Ext>,\n ) => ModuleLogic<Sh, R, E>,\n options?: LogicUnitOptions,\n ) => ModuleLogic<Sh, R, E>\n}\n\nexport type AnyModule = {\n readonly _kind: 'Module'\n readonly id: string\n readonly tag: ModuleTag<string, AnyModuleShape>\n readonly impl: ModuleImpl<any, AnyModuleShape, any>\n readonly actions: Record<string, AnySchema>\n readonly reducers?: Record<string, unknown>\n readonly schemas?: Record<string, unknown>\n readonly meta?: Record<string, JsonValue>\n readonly services?: Record<string, ServiceMap.Key<any, any>>\n readonly dev?: ModuleDev\n}\n\nexport type Module<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}, R = never> = ModuleDefBase<\n Id,\n Sh,\n Ext\n> & {\n readonly _kind: 'Module'\n readonly impl: ModuleImpl<Id, Sh, R>\n readonly withLogic: (logic: ModuleLogic<Sh, any, any>, options?: LogicUnitOptions) => Module<Id, Sh, Ext, R>\n readonly withLogics: (...inputs: ReadonlyArray<MountInput<Sh>>) => Module<Id, Sh, Ext, R>\n readonly withWorkflow: (workflow: Workflow) => Module<Id, Sh, Ext, R>\n readonly withWorkflows: (workflows: ReadonlyArray<Workflow>) => Module<Id, Sh, Ext, R>\n readonly withLayer: (layer: Layer.Layer<any, never, any>) => Module<Id, Sh, Ext, R>\n readonly withLayers: (...layers: ReadonlyArray<Layer.Layer<any, never, any>>) => Module<Id, Sh, Ext, R>\n}\n\nexport type ModuleDef<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}> = ModuleDefBase<\n Id,\n Sh,\n Ext\n> & {\n readonly _kind: 'ModuleDef'\n readonly withWorkflow: (workflow: Workflow) => ModuleDef<Id, Sh, Ext>\n readonly withWorkflows: (workflows: ReadonlyArray<Workflow>) => ModuleDef<Id, Sh, Ext>\n readonly implement: <R = never>(config: {\n readonly initial: StateOf<Sh>\n readonly logics?: Array<ModuleLogic<Sh, R, any>>\n readonly imports?: ReadonlyArray<Layer.Layer<any, any, any> | ModuleImpl<any, AnyModuleShape, any>>\n readonly processes?: ReadonlyArray<Effect.Effect<void, any, any>>\n readonly stateTransaction?: ModuleImplementStateTransactionOptions\n }) => Module<Id, Sh, Ext, R>\n}\n\nexport const is = (value: unknown): value is ModuleDefBase => {\n if (!value || typeof value !== 'object') return false\n const kind = (value as any)._kind\n if (kind !== 'ModuleDef' && kind !== 'Module') return false\n return ServiceMap.isKey((value as any).tag)\n}\n\nexport const hasImpl = (value: unknown): value is AnyModule => {\n if (!is(value)) return false\n return (\n typeof (value as any).impl === 'object' && (value as any).impl !== null && (value as any).impl._tag === 'ModuleImpl'\n )\n}\n\nexport const unwrapTag = <Id extends string, Sh extends AnyModuleShape>(\n module: ModuleLike<Id, Sh, any>,\n): ModuleTag<Id, Sh> => module.tag\n\nexport const unwrapImpl = <Id extends string, Sh extends AnyModuleShape>(\n module: AnyModule & { readonly id: Id; readonly tag: ModuleTag<Id, Sh> },\n): ModuleImpl<Id, Sh, any> => (module as any).impl as ModuleImpl<Id, Sh, any>\n\nexport const descriptor = (\n module: ModuleDefBase<string, AnyModuleShape, any>,\n runtime: ModuleRuntime<any, any>,\n): ModuleDescriptor => {\n const actionKeys = Object.keys((module.tag as any).shape?.actionMap ?? {})\n\n const internal = (module as any)[MODULE_INTERNAL] as ModuleInternal<string, AnyModuleShape> | undefined\n\n const logicUnits: ReadonlyArray<MountedLogicUnitSummary> = internal\n ? internal.mounted.map((u) => ({\n kind: u.kind,\n id: u.id,\n derived: u.derived ? true : undefined,\n name: u.name,\n }))\n : []\n\n const schemaKeys = module.schemas && typeof module.schemas === 'object' ? Object.keys(module.schemas) : undefined\n\n const meta = module.meta && typeof module.meta === 'object' ? module.meta : undefined\n\n const source = module.dev?.source\n\n return {\n id: module.id,\n moduleId: String(runtime.moduleId),\n instanceId: String(runtime.instanceId),\n actionKeys,\n logicUnits,\n schemaKeys,\n meta,\n source,\n }\n}\n\ntype MountInput<Sh extends AnyModuleShape> =\n | ModuleLogic<Sh, any, any>\n | readonly [ModuleLogic<Sh, any, any>, LogicUnitOptions]\n\nconst normalizeMountInput = <Sh extends AnyModuleShape>(\n input: MountInput<Sh>,\n): { readonly logic: ModuleLogic<Sh, any, any>; readonly options?: LogicUnitOptions } => {\n if (Array.isArray(input)) {\n return { logic: input[0], options: input[1] }\n }\n return { logic: input as ModuleLogic<Sh, any, any> }\n}\n\nconst resolveLogicUnit = <Sh extends AnyModuleShape>(\n existing: ReadonlyArray<MountedLogicUnit<Sh>>,\n logic: ModuleLogic<Sh, any, any>,\n options?: LogicUnitOptions,\n): MountedLogicUnit<Sh> => {\n const meta = LogicUnitMetaInternal.getLogicUnitMeta(logic)\n const explicitId = options?.id\n const defaultId = meta?.id\n\n const kind = (options?.kind ?? meta?.kind ?? 'user').trim() || 'user'\n const name =\n options?.name ?? meta?.name ?? (typeof defaultId === 'string' && defaultId.length > 0 ? defaultId : undefined)\n\n const source = options?.source ?? meta?.source\n\n if (typeof explicitId === 'string' && explicitId.trim().length > 0) {\n return {\n id: explicitId.trim(),\n derived: false,\n kind,\n name,\n source,\n logic,\n origin: { explicitId: explicitId.trim(), defaultId },\n }\n }\n\n if (typeof defaultId === 'string' && defaultId.trim().length > 0) {\n return {\n id: defaultId.trim(),\n derived: false,\n kind,\n name,\n source,\n logic,\n origin: { defaultId: defaultId.trim() },\n }\n }\n\n // Derived id: reproducible within the same composition order.\n const used = new Set(existing.map((u) => u.id))\n const baseRaw = (name ?? kind ?? 'logic').trim() || 'logic'\n const base = baseRaw.replace(/\\s+/g, '_')\n\n let n = 1\n while (used.has(`${base}#${n}`)) n += 1\n const derivedId = `${base}#${n}`\n\n return {\n id: derivedId,\n derived: true,\n kind,\n name: name ?? baseRaw,\n source,\n logic,\n origin: { derivedBase: baseRaw },\n }\n}\n\nconst mountLogicUnit = <Sh extends AnyModuleShape>(\n current: ReadonlyArray<MountedLogicUnit<Sh>>,\n overrides: ReadonlyArray<LogicOverrideWarning>,\n input: { readonly logic: ModuleLogic<Sh, any, any>; readonly options?: LogicUnitOptions },\n): {\n readonly mounted: ReadonlyArray<MountedLogicUnit<Sh>>\n readonly overrides: ReadonlyArray<LogicOverrideWarning>\n} => {\n const nextUnit = resolveLogicUnit(current, input.logic, input.options)\n // Write the resolved verdict back to logic meta for provenance/diagnostics (aligned with 022-module).\n LogicUnitMetaInternal.updateLogicUnitMeta(nextUnit.logic as any, {\n resolvedId: nextUnit.id,\n resolvedIdKind: nextUnit.derived ? 'derived' : 'explicit',\n resolvedKind: nextUnit.kind,\n resolvedName: nextUnit.name,\n resolvedSource: nextUnit.source as any,\n })\n\n const prevIndex = current.findIndex((u) => u.id === nextUnit.id)\n if (prevIndex < 0) {\n return { mounted: [...current, nextUnit], overrides }\n }\n\n const prev = current[prevIndex]\n const nextMounted = [...current.slice(0, prevIndex), ...current.slice(prevIndex + 1), nextUnit]\n\n const nextOverrides: ReadonlyArray<LogicOverrideWarning> = [\n ...overrides,\n {\n id: nextUnit.id,\n from: {\n kind: prev.kind,\n name: prev.name,\n source: prev.source,\n order: prevIndex,\n },\n to: {\n kind: nextUnit.kind,\n name: nextUnit.name,\n source: nextUnit.source,\n order: nextMounted.length - 1,\n },\n },\n ]\n\n return { mounted: nextMounted, overrides: nextOverrides }\n}\n\nconst formatSource = (source?: DevSource): string => {\n if (!source) return 'unknown'\n return `${source.file}:${source.line}:${source.column}`\n}\n\nconst makeOverrideDiagnosticsLogic = (\n tag: ModuleTag<any, AnyModuleShape>,\n overrides: ReadonlyArray<LogicOverrideWarning>,\n): ModuleLogic<any, any, never> => {\n if (overrides.length === 0) {\n return Effect.void as ModuleLogic<any, any, never>\n }\n\n return tag.logic<any, never>(() =>\n Effect.gen(function* () {\n if (!isDevEnv()) return\n\n const diagnosticsLevel = yield* Effect.service(Debug.internal.currentDiagnosticsLevel).pipe(Effect.orDie)\n if (diagnosticsLevel === 'off') return\n\n const runtime = (yield* Effect.service(tag).pipe(Effect.orDie)) as ModuleRuntime<any, any>\n\n yield* Effect.forEach(\n overrides,\n (o) =>\n Debug.record({\n type: 'diagnostic',\n moduleId: runtime.moduleId,\n instanceId: runtime.instanceId,\n code: 'module_logic::override',\n severity: 'warning',\n message: `logicUnitId \"${o.id}\" overridden (last-write-wins).`,\n hint:\n `from(#${o.from.order}) kind=${o.from.kind} name=${o.from.name ?? 'unknown'} source=${formatSource(o.from.source)}\\n` +\n `to(#${o.to.order}) kind=${o.to.kind} name=${o.to.name ?? 'unknown'} source=${formatSource(o.to.source)}`,\n kind: 'logic_unit_override',\n }),\n { discard: true },\n )\n }).pipe(Effect.catchCause(() => Effect.void)),\n )\n}\n\nconst makeDeclaredEffectsLogic = (\n tag: ModuleTag<any, AnyModuleShape>,\n effects: Record<string, ReadonlyArray<unknown> | undefined> | undefined,\n moduleId: string,\n): ModuleLogic<any, any, never> => {\n if (!effects || typeof effects !== 'object' || Object.keys(effects).length === 0) {\n return Effect.void as any\n }\n\n const logic = tag.logic(($) => ({\n setup: Effect.gen(function* () {\n const actions = ($ as any).actions as Record<string, Action.AnyActionToken>\n const effectApi = ($ as any).effect as\n | ((token: unknown, handler: (payload: unknown) => Effect.Effect<void, any, any>) => Effect.Effect<void, never, any>)\n | undefined\n if (typeof effectApi !== 'function') return\n\n const wrappedHandlers = new WeakMap<(...args: any[]) => any, (payload: unknown) => Effect.Effect<void, any, any>>()\n\n for (const actionTag of Object.keys(effects).sort()) {\n const token = actions[actionTag]\n if (!Action.isActionToken(token)) continue\n\n const handlers = effects[actionTag]\n if (!Array.isArray(handlers)) continue\n\n for (const handler of handlers) {\n if (typeof handler !== 'function') continue\n let wrapped = wrappedHandlers.get(handler)\n if (!wrapped) {\n wrapped = (payload: unknown) => (handler as any)($, payload)\n wrappedHandlers.set(handler, wrapped)\n }\n yield* effectApi(token, wrapped)\n }\n }\n }),\n run: Effect.void,\n })) as ModuleLogic<any, any, never>\n\n LogicUnitMetaInternal.attachLogicUnitMeta(logic as any, {\n id: '__logix_internal:effects:declared',\n kind: 'internal',\n name: 'effects:declared',\n moduleId,\n })\n\n return logic\n}\n\nconst makeLogicFactory = <Id extends string, Sh extends AnyModuleShape, Ext extends object>(\n selfModule: ModuleDefBase<Id, Sh, Ext>,\n): ModuleDefBase<Id, Sh, Ext>['logic'] => {\n const tag = selfModule.tag\n return (build, options) => {\n const eff = tag.logic((api) => {\n const withSelf = Object.create(api) as ModuleLogicApi<Sh, any, Ext>\n ;(withSelf as any).self = Effect.suspend(() => (api as any).use(selfModule as any))\n return build(withSelf as any)\n }) as ModuleLogic<Sh, any, any>\n\n const meta: LogicUnitMeta = {\n id: options?.id,\n kind: options?.kind,\n name: options?.name,\n source: options?.source,\n moduleId: selfModule.id,\n }\n\n return attachLogicUnitMeta(eff as any, meta) as any\n }\n}\n\ntype MakeDef<Id extends string, SSchema extends AnySchema, AMap extends Action.ActionDefs> = {\n readonly state: SSchema\n readonly actions: AMap\n readonly reducers?: ReducersFromMap<SSchema, NoInfer_<AMap>>\n readonly immerReducers?: MutatorsFromMap<SSchema, NoInfer_<AMap>>\n readonly effects?: EffectsFromMap<NoInfer_<AMap>>\n readonly traits?: unknown\n readonly schemas?: Record<string, unknown>\n readonly meta?: Record<string, JsonValue>\n readonly services?: Record<string, ServiceMap.Key<any, any>>\n readonly dev?: ModuleDev\n}\n\ntype AnyActionMap = Action.ActionDefs\ntype EmptyActionMap = Record<never, never>\n\ntype PayloadOfActionDef<V> = V extends Schema.Schema<any>\n ? Schema.Schema.Type<V>\n : V extends Action.ActionToken<any, infer P, any>\n ? P\n : never\n\ntype DeclaredEffectHandler<Payload> = ($: unknown, payload: Payload) => Effect.Effect<void, any, any>\n\ntype EffectsFromMap<M extends AnyActionMap> = {\n readonly [K in keyof M]?: ReadonlyArray<DeclaredEffectHandler<PayloadOfActionDef<M[K]>>>\n}\n\ntype MergeActionMap<Base extends AnyActionMap, Ext extends AnyActionMap> = {\n readonly [K in keyof Base | keyof Ext]: K extends keyof Ext ? Ext[K] : K extends keyof Base ? Base[K] : never\n}\n\n/**\n * Module.make \"app-side extension/override\" parameters (a two-stage responsibility split: domain library author → app developer).\n *\n * - `actions`: add-only (cannot override existing action schema); used to extend actionMap.\n * - `reducers`: add and override; used to override domain reducers or provide reducers for new actions.\n * - Other reflective fields (schemas/meta/services/dev) are shallow-merged (last-write-wins).\n */\nexport type MakeExtendDef<\n SSchema extends AnySchema,\n BaseActions extends AnyActionMap,\n ExtActions extends AnyActionMap = EmptyActionMap,\n> = {\n readonly actions?: ExtActions\n readonly reducers?: ReducersFromMap<SSchema, MergeActionMap<BaseActions, ExtActions>>\n readonly immerReducers?: MutatorsFromMap<SSchema, MergeActionMap<BaseActions, ExtActions>>\n readonly effects?: EffectsFromMap<MergeActionMap<BaseActions, ExtActions>>\n readonly schemas?: Record<string, unknown>\n readonly meta?: Record<string, JsonValue>\n readonly services?: Record<string, ServiceMap.Key<any, any>>\n readonly dev?: ModuleDev\n}\n\nconst mergeMakeDef = <\n Id extends string,\n SSchema extends AnySchema,\n BaseActions extends AnyActionMap,\n ExtActions extends AnyActionMap,\n>(\n base: MakeDef<Id, SSchema, BaseActions>,\n extend?: MakeExtendDef<SSchema, BaseActions, ExtActions>,\n): MakeDef<Id, SSchema, MergeActionMap<BaseActions, ExtActions>> => {\n const baseActions = base.actions as Record<string, AnySchema>\n const extActions = (extend?.actions ?? {}) as Record<string, AnySchema>\n\n for (const key of Object.keys(extActions)) {\n if (key in baseActions && baseActions[key] !== extActions[key]) {\n throw new Error(\n `[Logix.Module.make] action key \"${key}\" already exists; overriding action schemas is not supported (define a new action tag instead).`,\n )\n }\n }\n\n const mergedActionDefs = { ...(base.actions as any), ...(extend?.actions as any) } as MergeActionMap<\n BaseActions,\n ExtActions\n >\n const actions = Action.normalizeActions(mergedActionDefs)\n\n const mergeEffects = (): Record<string, ReadonlyArray<unknown>> | undefined => {\n const baseEffects = (base.effects ?? {}) as Record<string, unknown>\n const extEffects = (extend?.effects ?? {}) as Record<string, unknown>\n\n const keys = Array.from(new Set([...Object.keys(baseEffects), ...Object.keys(extEffects)])).sort()\n if (keys.length === 0) return undefined\n\n const out: Record<string, ReadonlyArray<unknown>> = {}\n for (const key of keys) {\n if (!(key in actions)) {\n throw new Error(`[Logix.Module.make] effect key \"${key}\" does not exist in actionMap.`)\n }\n\n const baseValue = baseEffects[key]\n const extValue = extEffects[key]\n const baseArr = Array.isArray(baseValue) ? baseValue : baseValue === undefined ? [] : null\n const extArr = Array.isArray(extValue) ? extValue : extValue === undefined ? [] : null\n\n if (baseArr === null) {\n throw new Error(`[Logix.Module.make] effects[\"${key}\"] must be an array of handlers.`)\n }\n if (extArr === null) {\n throw new Error(`[Logix.Module.make] effects[\"${key}\"] must be an array of handlers.`)\n }\n\n const merged = [...baseArr, ...extArr].filter((h) => h !== undefined)\n for (const h of merged) {\n if (typeof h !== 'function') {\n throw new Error(`[Logix.Module.make] effects[\"${key}\"] handlers must be functions.`)\n }\n }\n\n if (merged.length > 0) {\n out[key] = merged as ReadonlyArray<unknown>\n }\n }\n\n return Object.keys(out).length > 0 ? out : undefined\n }\n\n const effects = mergeEffects()\n\n const wrapImmerReducers = (mutators?: Record<string, ((draft: unknown, payload: unknown) => void) | undefined>) => {\n if (!mutators) return {}\n const out: Record<string, unknown> = {}\n for (const key of Object.keys(mutators)) {\n const mutator = mutators[key]\n if (typeof mutator !== 'function') continue\n out[key] = ModuleTagNS.Reducer.mutate(mutator as any)\n }\n return out\n }\n\n const reducers = {\n ...wrapImmerReducers(base.immerReducers as any),\n ...(base.reducers ?? {}),\n ...wrapImmerReducers(extend?.immerReducers as any),\n ...(extend?.reducers ?? {}),\n } as Record<string, unknown>\n\n for (const key of Object.keys(reducers)) {\n if (!(key in actions)) {\n throw new Error(`[Logix.Module.make] reducer key \"${key}\" does not exist in actionMap.`)\n }\n }\n\n const schemas =\n base.schemas || extend?.schemas ? { ...(base.schemas ?? {}), ...(extend?.schemas ?? {}) } : undefined\n\n const meta = base.meta || extend?.meta ? { ...(base.meta ?? {}), ...(extend?.meta ?? {}) } : undefined\n\n const services =\n base.services || extend?.services ? { ...(base.services ?? {}), ...(extend?.services ?? {}) } : undefined\n\n const dev = base.dev || extend?.dev ? { ...(base.dev ?? {}), ...(extend?.dev ?? {}) } : undefined\n\n return {\n ...base,\n actions: actions as any,\n reducers: Object.keys(reducers).length > 0 ? (reducers as any) : undefined,\n effects: effects as any,\n schemas,\n meta,\n services,\n dev,\n } as any\n}\n\nexport const Reducer = ModuleTagNS.Reducer\n\nexport type ActionTokenMap<ADefs extends Action.ActionDefs> = Action.NormalizedActionTokens<ADefs>\n\nexport type ActionUnionOf<ADefs extends Action.ActionDefs> = ActionsFromMap<ActionTokenMap<ADefs>>\n\nexport type ActionSchemaOf<ADefs extends Action.ActionDefs> = Schema.Schema<ActionUnionOf<ADefs>>\n\nexport type Shape<SSchema extends AnySchema, ADefs extends Action.ActionDefs> = ModuleShape<\n SSchema,\n ActionSchemaOf<ADefs>,\n ActionTokenMap<ADefs>\n>\n\nexport function make<\n Id extends string,\n SSchema extends AnySchema,\n AMap extends Action.ActionDefs,\n Ext extends object = {},\n>(\n id: Id,\n def: MakeDef<Id, SSchema, AMap>,\n): ModuleDef<Id, Shape<SSchema, AMap>, Ext>\n\nexport function make<\n Id extends string,\n SSchema extends AnySchema,\n AMap extends Action.ActionDefs,\n Ext extends object = {},\n ExtActions extends Action.ActionDefs = EmptyActionMap,\n>(\n id: Id,\n def: MakeDef<Id, SSchema, AMap>,\n extend: MakeExtendDef<SSchema, NoInfer_<AMap>, ExtActions>,\n): ModuleDef<Id, Shape<SSchema, MergeActionMap<AMap, ExtActions>>, Ext>\n\nexport function make(id: any, def: any, extend?: any): any {\n const merged = mergeMakeDef(def as any, extend as any)\n\n const tag = ModuleTagNS.make(id, {\n state: merged.state,\n actions: merged.actions,\n reducers: merged.reducers,\n traits: merged.traits,\n }) as unknown as ModuleTag<any, AnyModuleShape>\n\n if (merged.effects && typeof merged.effects === 'object' && Object.keys(merged.effects).length > 0) {\n Object.defineProperty(tag as any, MODULE_DECLARED_EFFECTS, {\n value: merged.effects,\n enumerable: false,\n configurable: true,\n writable: false,\n })\n }\n\n const base: any = {\n _kind: 'ModuleDef' as const,\n id,\n tag,\n shape: tag.shape,\n stateSchema: tag.stateSchema,\n actionSchema: tag.actionSchema,\n actions: merged.actions,\n reducers: merged.reducers,\n effects: merged.effects,\n live: tag.live,\n schemas: merged.schemas,\n meta: merged.meta,\n services: merged.services,\n dev: merged.dev,\n }\n\n base.logic = makeLogicFactory(base as any)\n\n base.implement = (config: any) => {\n type Sh = AnyModuleShape\n\n const initial = config.initial as any\n const imports = config.imports as any\n const processes = config.processes as any\n const stateTransaction = config.stateTransaction as any\n const workflowDefs: ReadonlyArray<WorkflowDef> = Array.isArray(config.__logix_workflowDefs)\n ? (config.__logix_workflowDefs as ReadonlyArray<WorkflowDef>)\n : []\n\n const mountedResult = (config.logics ?? []).reduce(\n (\n acc: {\n mounted: ReadonlyArray<MountedLogicUnit<any>>\n overrides: ReadonlyArray<LogicOverrideWarning>\n },\n logic: any,\n ) => mountLogicUnit(acc.mounted, acc.overrides, { logic }),\n { mounted: [] as const, overrides: [] as const },\n )\n\n type State = {\n readonly mounted: ReadonlyArray<MountedLogicUnit<any>>\n readonly overrides: ReadonlyArray<LogicOverrideWarning>\n readonly layers: ReadonlyArray<Layer.Layer<any, never, any>>\n readonly workflowDefs: ReadonlyArray<WorkflowDef>\n }\n\n const buildImpl = (state: State): ModuleImpl<any, AnyModuleShape, any> => {\n const diagnosticsLogic = makeOverrideDiagnosticsLogic(tag as any, state.overrides)\n const declaredEffectsLogic = makeDeclaredEffectsLogic(tag as any, merged.effects, id)\n const allLogics = [...state.mounted.map((u) => u.logic), declaredEffectsLogic, diagnosticsLogic]\n\n let impl = (tag as any).implement({\n initial,\n logics: allLogics,\n imports,\n processes,\n stateTransaction,\n }) as ModuleImpl<any, AnyModuleShape, any>\n\n for (const layer of state.layers) {\n impl = impl.withLayer(layer)\n }\n\n return impl\n }\n\n const createModule = (state: State): any => {\n const internal: ModuleInternal<any, AnyModuleShape> = {\n initial,\n imports,\n processes,\n stateTransaction,\n mounted: state.mounted,\n overrides: state.overrides,\n layers: state.layers,\n workflowDefs: state.workflowDefs,\n rebuild: () => buildImpl(state),\n }\n\n const mod: any = {\n ...base,\n _kind: 'Module' as const,\n impl: buildImpl(state),\n }\n\n Object.defineProperty(mod, MODULE_INTERNAL, {\n value: internal,\n enumerable: false,\n configurable: true,\n })\n\n mod.logic = makeLogicFactory(mod)\n\n mod.withLogic = (logic: any, options?: LogicUnitOptions) => mod.withLogics([logic, options] as any)\n\n mod.withLogics = (...inputs: ReadonlyArray<MountInput<any>>) => {\n const current = (mod as any)[MODULE_INTERNAL] as ModuleInternal<any, AnyModuleShape>\n const normalized = inputs.map(normalizeMountInput)\n const next = normalized.reduce((acc, item) => mountLogicUnit(acc.mounted, acc.overrides, item as any), {\n mounted: current.mounted,\n overrides: current.overrides,\n })\n\n return createModule({\n mounted: next.mounted,\n overrides: next.overrides,\n layers: current.layers,\n workflowDefs: current.workflowDefs,\n })\n }\n\n mod.withLayer = (layer: Layer.Layer<any, never, any>) => {\n const current = (mod as any)[MODULE_INTERNAL] as ModuleInternal<any, AnyModuleShape>\n return createModule({\n mounted: current.mounted,\n overrides: current.overrides,\n layers: [...current.layers, layer],\n workflowDefs: current.workflowDefs,\n })\n }\n\n mod.withLayers = (...layers: ReadonlyArray<Layer.Layer<any, never, any>>) =>\n layers.reduce((acc, layer) => acc.withLayer(layer), mod as any)\n\n mod.withWorkflow = (workflow: Workflow) => {\n const install = (workflow as any)?.install\n const logic =\n typeof install === 'function'\n ? install(mod.tag)\n : WorkflowRuntime.installOne({ moduleTag: mod.tag as any, program: workflow as any })\n\n const current = (mod as any)[MODULE_INTERNAL] as ModuleInternal<any, AnyModuleShape>\n const next = mountLogicUnit(current.mounted, current.overrides, { logic } as any)\n const nextWorkflowDefs = [...current.workflowDefs, (workflow as any).def as WorkflowDef]\n return createModule({\n mounted: next.mounted,\n overrides: next.overrides,\n layers: current.layers,\n workflowDefs: nextWorkflowDefs,\n })\n }\n\n mod.withWorkflows = (workflows: ReadonlyArray<Workflow>) => {\n if (!Array.isArray(workflows) || workflows.length === 0) return mod as any\n const logic = WorkflowRuntime.mountAll({ moduleTag: mod.tag as any, programs: workflows as any })\n const current = (mod as any)[MODULE_INTERNAL] as ModuleInternal<any, AnyModuleShape>\n const next = mountLogicUnit(current.mounted, current.overrides, { logic } as any)\n const nextWorkflowDefs = [...current.workflowDefs, ...workflows.map((w) => (w as any).def as WorkflowDef)]\n\n return createModule({\n mounted: next.mounted,\n overrides: next.overrides,\n layers: current.layers,\n workflowDefs: nextWorkflowDefs,\n })\n }\n\n return mod as any\n }\n\n return createModule({\n mounted: mountedResult.mounted,\n overrides: mountedResult.overrides,\n layers: [],\n workflowDefs,\n })\n }\n\n const baseImplement = base.implement\n\n const withExtraLogics = (\n extraLogics: ReadonlyArray<ModuleLogic<any, any, any>>,\n extraWorkflowDefs: ReadonlyArray<WorkflowDef>,\n ): any => {\n const next: any = { ...base }\n\n next.withWorkflow = (workflow: Workflow) => {\n const install = (workflow as any)?.install\n const logic =\n typeof install === 'function'\n ? install(next.tag)\n : WorkflowRuntime.installOne({ moduleTag: next.tag as any, program: workflow as any })\n return withExtraLogics([...extraLogics, logic as any], [...extraWorkflowDefs, (workflow as any).def as WorkflowDef])\n }\n\n next.withWorkflows = (workflows: ReadonlyArray<Workflow>) => {\n if (!Array.isArray(workflows) || workflows.length === 0) return next as any\n const logic = WorkflowRuntime.mountAll({ moduleTag: next.tag as any, programs: workflows as any })\n return withExtraLogics(\n [...extraLogics, logic as any],\n [...extraWorkflowDefs, ...workflows.map((w) => (w as any).def as WorkflowDef)],\n )\n }\n\n next.implement = (config: any) => {\n const mergedLogics = [...(config.logics ?? []), ...extraLogics]\n return baseImplement({ ...config, logics: mergedLogics, __logix_workflowDefs: extraWorkflowDefs })\n }\n\n return next as any\n }\n\n base.withWorkflow = (workflow: Workflow) => withExtraLogics([], []).withWorkflow(workflow)\n\n base.withWorkflows = (workflows: ReadonlyArray<Workflow>) => withExtraLogics([], []).withWorkflows(workflows)\n\n return base\n}\n\nexport const Manage = {\n make: <D extends (...args: any[]) => AnyModule>(config: {\n readonly kind?: string\n readonly define: D\n }): { readonly kind?: string; readonly make: D } => ({\n kind: config.kind,\n make: config.define,\n }),\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA,SAAS,QAAuB,kBAAkB;AAmIlD,IAAMC,uBAAsB,CAAmB,OAAU,SACjC,oBAAoB,OAAO,IAAW;AA0C9D,IAAM,kBAAkB,uBAAO,IAAI,uBAAuB;AAC1D,IAAM,0BAA0B,uBAAO,IAAI,+BAA+B;AAiFnE,IAAM,KAAK,CAAC,UAA2C;AAC5D,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;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