@logixjs/core 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/{Bound-BN1DQ_lM.d.ts → Bound-CEa1ihvH.d.ts} +2 -2
- package/dist/{Bound-BPIfH9SS.d.cts → Bound-CNLNkC7c.d.cts} +2 -2
- package/dist/Bound.cjs +620 -163
- package/dist/Bound.cjs.map +1 -1
- package/dist/Bound.d.cts +3 -3
- package/dist/Bound.d.ts +3 -3
- package/dist/Bound.js +14 -14
- package/dist/{Debug-Bq8Sqjcr.d.cts → Debug-BhMYr-1i.d.cts} +3 -3
- package/dist/{Debug-B5q5Bkzx.d.ts → Debug-ByM7m4Ft.d.ts} +3 -3
- package/dist/Debug.cjs +553 -32
- package/dist/Debug.cjs.map +1 -1
- package/dist/Debug.d.cts +10 -8
- package/dist/Debug.d.ts +10 -8
- package/dist/Debug.js +12 -10
- package/dist/EffectOp.cjs.map +1 -1
- package/dist/EffectOp.js +2 -3
- package/dist/EffectOp.js.map +1 -1
- package/dist/Env.cjs +664 -6
- package/dist/Env.cjs.map +1 -1
- package/dist/Env.js +5 -2
- package/dist/ExternalStore-BAz83PVq.d.cts +60 -0
- package/dist/ExternalStore-BYWPbYs8.d.ts +60 -0
- package/dist/ExternalStore.cjs +746 -0
- package/dist/ExternalStore.cjs.map +1 -0
- package/dist/ExternalStore.d.cts +4 -0
- package/dist/ExternalStore.d.ts +4 -0
- package/dist/ExternalStore.js +19 -0
- package/dist/ExternalStore.js.map +1 -0
- package/dist/{Flow-1fZT8MpX.d.cts → Flow-BlSoMmhV.d.cts} +2 -2
- package/dist/{Flow-BhpjE22E.d.ts → Flow-CQSGve5c.d.ts} +2 -2
- package/dist/Flow.cjs +2 -2
- package/dist/Flow.cjs.map +1 -1
- package/dist/Flow.d.cts +4 -4
- package/dist/Flow.d.ts +4 -4
- package/dist/Flow.js +7 -8
- package/dist/{Handle-D_cLW1Z3.d.ts → Handle-B7PSmsrY.d.ts} +1 -1
- package/dist/{Handle-D8D1zPb_.d.cts → Handle-ByovhL-c.d.cts} +1 -1
- package/dist/Handle.d.cts +3 -3
- package/dist/Handle.d.ts +3 -3
- package/dist/{Kernel-CnGE1Fyk.d.ts → Kernel-DGSpS4GM.d.ts} +2 -2
- package/dist/{Kernel-8kC-jOda.d.cts → Kernel-DZAk-Mrn.d.cts} +2 -2
- package/dist/Kernel.cjs +680 -22
- package/dist/Kernel.cjs.map +1 -1
- package/dist/Kernel.d.cts +10 -8
- package/dist/Kernel.d.ts +10 -8
- package/dist/Kernel.js +7 -4
- package/dist/{Link-Db7975nU.d.ts → Link-Cm4eR9n0.d.ts} +10 -3
- package/dist/{Link-fX8x1eCK.d.cts → Link-DF8i8iWR.d.cts} +10 -3
- package/dist/Link.cjs +1128 -86
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.d.cts +3 -3
- package/dist/Link.d.ts +3 -3
- package/dist/Link.js +30 -25
- package/dist/{Logic-DRh4sDZj.d.cts → Logic-BcQA0AvE.d.cts} +1 -1
- package/dist/{Logic-BRjEMr-W.d.ts → Logic-OotSE1xw.d.ts} +1 -1
- package/dist/Logic.d.cts +3 -3
- package/dist/Logic.d.ts +3 -3
- package/dist/{MatchBuilder-CJk5oCkR.d.cts → MatchBuilder-BNDJ8waF.d.ts} +1 -1
- package/dist/{MatchBuilder-0QOc-nlU.d.ts → MatchBuilder-CvZ5WY1B.d.cts} +1 -1
- package/dist/MatchBuilder.d.cts +4 -4
- package/dist/MatchBuilder.d.ts +4 -4
- package/dist/Middleware-D8tUDLv_.d.cts +100 -0
- package/dist/Middleware-DS7CbTTN.d.ts +100 -0
- package/dist/Middleware.cjs +461 -13
- 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 +13 -11
- package/dist/{Module-DnzluX2J.d.ts → Module-CFj0I2yE.d.ts} +45 -18
- package/dist/{Module-B_0xRDMR.d.cts → Module-DpXPW9EQ.d.cts} +45 -18
- package/dist/Module.cjs +8583 -5741
- package/dist/Module.cjs.map +1 -1
- package/dist/Module.d.cts +5 -4
- package/dist/Module.d.ts +5 -4
- package/dist/Module.js +32 -27
- package/dist/ModuleTag-BcVF6z7B.d.ts +113 -0
- package/dist/ModuleTag-DuZXo_NS.d.cts +113 -0
- package/dist/ModuleTag.cjs +2609 -1232
- package/dist/ModuleTag.cjs.map +1 -1
- package/dist/ModuleTag.d.cts +4 -4
- package/dist/ModuleTag.d.ts +4 -4
- package/dist/ModuleTag.js +28 -25
- package/dist/{Observability-cY4kLn0S.d.ts → Observability-D-ZWeEVb.d.ts} +22 -15
- package/dist/{Observability-COqEvp2C.d.cts → Observability-V7sRMYTh.d.cts} +22 -15
- package/dist/Observability.cjs +1938 -640
- package/dist/Observability.cjs.map +1 -1
- package/dist/Observability.d.cts +4 -4
- package/dist/Observability.d.ts +4 -4
- package/dist/Observability.js +21 -19
- package/dist/{Process-mL8fHDSB.d.cts → Process-B55aJMFk.d.cts} +29 -4
- package/dist/{Process-CM9xbMdP.d.ts → Process-DvhFEwUS.d.ts} +29 -4
- package/dist/Process.cjs +1122 -85
- package/dist/Process.cjs.map +1 -1
- package/dist/Process.d.cts +4 -3
- package/dist/Process.d.ts +4 -3
- package/dist/Process.js +27 -22
- package/dist/{ReadQuery-BlMwhe-F.d.ts → ReadQuery-C4vZ8Prc.d.ts} +2 -2
- package/dist/{ReadQuery-SinbStGF.d.ts → ReadQuery-CafjlJQo.d.cts} +1 -1
- package/dist/{ReadQuery-SinbStGF.d.cts → ReadQuery-CafjlJQo.d.ts} +1 -1
- package/dist/{ReadQuery-CL5XlXts.d.cts → ReadQuery-mc0NgrFV.d.cts} +2 -2
- package/dist/ReadQuery.cjs +3 -3
- package/dist/ReadQuery.cjs.map +1 -1
- package/dist/ReadQuery.d.cts +2 -2
- package/dist/ReadQuery.d.ts +2 -2
- package/dist/ReadQuery.js +3 -3
- package/dist/{Reflection-CQnKwPXj.d.ts → Reflection-C8xZ267q.d.ts} +88 -7
- package/dist/{Reflection-Kabo1mlU.d.cts → Reflection-DP7Vsv3f.d.cts} +88 -7
- package/dist/Reflection.cjs +2934 -1553
- package/dist/Reflection.cjs.map +1 -1
- package/dist/Reflection.d.cts +14 -11
- package/dist/Reflection.d.ts +14 -11
- package/dist/Reflection.js +26 -21
- package/dist/Resource.cjs +670 -12
- package/dist/Resource.cjs.map +1 -1
- package/dist/Resource.js +6 -3
- package/dist/Root.cjs +675 -17
- package/dist/Root.cjs.map +1 -1
- package/dist/Root.js +7 -3
- package/dist/{Runtime-CtyzZG4i.d.ts → Runtime-BWc9YfUB.d.ts} +37 -7
- package/dist/{Runtime-B-aL-f29.d.cts → Runtime-PShIC4DW.d.cts} +37 -7
- package/dist/Runtime.cjs +1899 -809
- package/dist/Runtime.cjs.map +1 -1
- package/dist/Runtime.d.cts +14 -11
- package/dist/Runtime.d.ts +14 -11
- package/dist/Runtime.js +33 -28
- package/dist/ScopeRegistry.cjs +668 -10
- package/dist/ScopeRegistry.cjs.map +1 -1
- package/dist/ScopeRegistry.js +6 -3
- package/dist/{StateTrait-OWhbj12c.d.cts → StateTrait-CQsDlXJm.d.cts} +23 -6
- package/dist/{StateTrait-BGsZghTz.d.ts → StateTrait-YvJzVDKl.d.ts} +23 -6
- package/dist/StateTrait.cjs +1475 -370
- package/dist/StateTrait.cjs.map +1 -1
- package/dist/StateTrait.d.cts +7 -5
- package/dist/StateTrait.d.ts +7 -5
- package/dist/StateTrait.js +17 -14
- package/dist/{TraitLifecycle-LdIWmKlg.d.ts → TraitLifecycle-CjIBICAA.d.ts} +2 -2
- package/dist/{TraitLifecycle-CwV5WPFX.d.cts → TraitLifecycle-NmqGiXPC.d.cts} +2 -2
- package/dist/TraitLifecycle.cjs +489 -32
- package/dist/TraitLifecycle.cjs.map +1 -1
- package/dist/TraitLifecycle.d.cts +4 -4
- package/dist/TraitLifecycle.d.ts +4 -4
- package/dist/TraitLifecycle.js +7 -7
- package/dist/Workflow-BlFG_20_.d.cts +414 -0
- package/dist/Workflow-CW9S_aAP.d.ts +414 -0
- package/dist/Workflow.cjs +2977 -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 +55 -0
- package/dist/Workflow.js.map +1 -0
- package/dist/{chunk-G5ZBFPNU.js → chunk-2A4UKO2D.js} +2 -2
- package/dist/chunk-2DE6D42I.js +248 -0
- package/dist/chunk-2DE6D42I.js.map +1 -0
- package/dist/{chunk-ANLBCBDC.js → chunk-2DVLMSOE.js} +6 -6
- package/dist/{chunk-BE3HW4FY.js → chunk-34CF6OGE.js} +14 -16
- package/dist/chunk-34CF6OGE.js.map +1 -0
- package/dist/{chunk-ZFY7U2FR.js → chunk-3LPIXG56.js} +43 -3
- package/dist/chunk-3LPIXG56.js.map +1 -0
- package/dist/chunk-3VZYDNXZ.js +10 -0
- package/dist/chunk-3VZYDNXZ.js.map +1 -0
- package/dist/{chunk-3TMODYZV.js → chunk-3XO4HR6V.js} +2 -2
- package/dist/chunk-46FGVWRF.js +817 -0
- package/dist/chunk-46FGVWRF.js.map +1 -0
- package/dist/chunk-4LODUXFI.js +288 -0
- package/dist/chunk-4LODUXFI.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-TKZ7MEIA.js → chunk-53GVPGSM.js} +2 -2
- package/dist/{chunk-KP7MUZNX.js → chunk-5W2V2NVJ.js} +2 -2
- package/dist/chunk-5W2V2NVJ.js.map +1 -0
- package/dist/chunk-6DACKW3D.js +613 -0
- package/dist/chunk-6DACKW3D.js.map +1 -0
- package/dist/chunk-AQ7L2QZ5.js +1395 -0
- package/dist/chunk-AQ7L2QZ5.js.map +1 -0
- package/dist/{chunk-NZJKFF45.js → chunk-C2UZZQ76.js} +2 -2
- package/dist/chunk-CCKP5Z6F.js +701 -0
- package/dist/chunk-CCKP5Z6F.js.map +1 -0
- package/dist/chunk-CUKM2XUW.js +27 -0
- package/dist/{chunk-QCHIQWAJ.js.map → chunk-CUKM2XUW.js.map} +1 -1
- package/dist/{chunk-M2RGJPXX.js → chunk-DBD6Q6JH.js} +3 -3
- package/dist/{chunk-ZGDVUPTM.js → chunk-EB4RGQO3.js} +2 -2
- package/dist/{chunk-PAYXCY6A.js → chunk-G7ESIQTI.js} +12 -14
- package/dist/chunk-G7ESIQTI.js.map +1 -0
- package/dist/chunk-GPBAZQ23.js +348 -0
- package/dist/chunk-GPBAZQ23.js.map +1 -0
- package/dist/{chunk-OFADUJWJ.js → chunk-I4LCE5OY.js} +3 -5
- package/dist/{chunk-OFADUJWJ.js.map → chunk-I4LCE5OY.js.map} +1 -1
- package/dist/{chunk-DFNM3WX2.js → chunk-IMCC6TBN.js} +158 -39
- package/dist/chunk-IMCC6TBN.js.map +1 -0
- package/dist/{chunk-76WT3HOR.js → chunk-IROZNQAF.js} +22 -21
- package/dist/chunk-IROZNQAF.js.map +1 -0
- package/dist/{chunk-TAAPQVZN.js → chunk-ISKNULNH.js} +2 -2
- package/dist/chunk-J3CWXIPV.js +242 -0
- package/dist/chunk-J3CWXIPV.js.map +1 -0
- package/dist/{chunk-PYOE4VSI.js → chunk-JBKYRTCS.js} +224 -161
- package/dist/chunk-JBKYRTCS.js.map +1 -0
- package/dist/{chunk-66ALHVEX.js → chunk-KKIAYH4X.js} +3 -3
- package/dist/{chunk-3RMKLXHX.js → chunk-KLDVG3SY.js} +2 -2
- package/dist/{chunk-BABLDP24.js → chunk-KSZQYSEH.js} +3 -3
- package/dist/chunk-KSZQYSEH.js.map +1 -0
- package/dist/{chunk-CW6T36TN.js → chunk-M3M7JFAH.js} +4 -4
- package/dist/chunk-M3M7JFAH.js.map +1 -0
- package/dist/{chunk-THATMZXD.js → chunk-MLB253V2.js} +2 -2
- package/dist/{chunk-THATMZXD.js.map → chunk-MLB253V2.js.map} +1 -1
- package/dist/{chunk-JGIWG6SR.js → chunk-MS77U77X.js} +664 -550
- package/dist/chunk-MS77U77X.js.map +1 -0
- package/dist/chunk-MW4FA3MW.js +23 -0
- package/dist/chunk-MW4FA3MW.js.map +1 -0
- package/dist/chunk-MYKNINNN.js +228 -0
- package/dist/chunk-MYKNINNN.js.map +1 -0
- package/dist/{chunk-4CQAV7YB.js → chunk-O6TTQXTY.js} +2 -2
- package/dist/{chunk-NBD3KUOZ.js → chunk-OJDJ4VDQ.js} +35 -24
- package/dist/chunk-OJDJ4VDQ.js.map +1 -0
- package/dist/{chunk-NQZ2OSGR.js → chunk-PVZEMNJY.js} +9 -9
- package/dist/chunk-PVZEMNJY.js.map +1 -0
- package/dist/chunk-RN26DV2M.js +271 -0
- package/dist/chunk-RN26DV2M.js.map +1 -0
- package/dist/{chunk-JCXGZRMU.js → chunk-RQQW3IQC.js} +3 -3
- package/dist/chunk-RQQW3IQC.js.map +1 -0
- package/dist/{chunk-24VULZ7A.js → chunk-TKOGZDD6.js} +3 -3
- package/dist/{chunk-EGK3KN7B.js → chunk-TQYLVXGY.js} +70 -39
- package/dist/chunk-TQYLVXGY.js.map +1 -0
- package/dist/{chunk-QMM6O4CD.js → chunk-UACD2CL2.js} +15 -3
- package/dist/{chunk-QMM6O4CD.js.map → chunk-UACD2CL2.js.map} +1 -1
- package/dist/{chunk-M3WTHJHJ.js → chunk-VH575UTV.js} +30 -34
- package/dist/chunk-VH575UTV.js.map +1 -0
- package/dist/{chunk-AUIR5O6W.js → chunk-WWBMC24F.js} +9 -15
- package/dist/chunk-WWBMC24F.js.map +1 -0
- package/dist/{chunk-JWOYLO27.js → chunk-WYJUJV4L.js} +80 -7
- package/dist/chunk-WYJUJV4L.js.map +1 -0
- package/dist/{chunk-EY4NZKDR.js → chunk-XFMMPYNU.js} +2 -2
- package/dist/chunk-Y4VRBIS6.js +35 -0
- package/dist/chunk-Y4VRBIS6.js.map +1 -0
- package/dist/{chunk-DMBALCE2.js → chunk-ZC7MSQ5U.js} +77 -4
- package/dist/chunk-ZC7MSQ5U.js.map +1 -0
- package/dist/{chunk-OGWBVHB3.js → chunk-ZCK6SCOE.js} +67 -8
- package/dist/chunk-ZCK6SCOE.js.map +1 -0
- package/dist/{chunk-IHVBV5C2.js → chunk-ZTFTABXV.js} +2 -1
- package/dist/chunk-ZTFTABXV.js.map +1 -0
- package/dist/index.cjs +9532 -5017
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +163 -27
- package/dist/index.d.ts +163 -27
- package/dist/index.js +119 -56
- package/dist/index.js.map +1 -1
- package/dist/{ir-BMP7yxJJ.d.cts → ir-C-Zm_GlZ.d.cts} +1 -1
- package/dist/{ir-DUOz6H-5.d.ts → ir-DGyGiwVe.d.ts} +1 -1
- package/dist/{module-k7m3txak.d.ts → module-DqQ1U-Me.d.ts} +129 -100
- package/dist/{module-B8CBqIZ_.d.cts → module-doenaCsZ.d.cts} +129 -100
- package/package.json +12 -1
- package/dist/ModuleTag-C8FHY_sY.d.ts +0 -93
- package/dist/ModuleTag-EGbgBMpZ.d.cts +0 -93
- package/dist/chunk-3QMIVH35.js +0 -43
- package/dist/chunk-3QMIVH35.js.map +0 -1
- package/dist/chunk-76WT3HOR.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-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.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-KP7MUZNX.js.map +0 -1
- package/dist/chunk-M3WTHJHJ.js.map +0 -1
- package/dist/chunk-M7IYCTJV.js +0 -79
- package/dist/chunk-M7IYCTJV.js.map +0 -1
- package/dist/chunk-NBD3KUOZ.js.map +0 -1
- package/dist/chunk-NQZ2OSGR.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-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-ZFLHVFUC.js +0 -192
- package/dist/chunk-ZFLHVFUC.js.map +0 -1
- package/dist/chunk-ZFY7U2FR.js.map +0 -1
- /package/dist/{chunk-G5ZBFPNU.js.map → chunk-2A4UKO2D.js.map} +0 -0
- /package/dist/{chunk-ANLBCBDC.js.map → chunk-2DVLMSOE.js.map} +0 -0
- /package/dist/{chunk-3TMODYZV.js.map → chunk-3XO4HR6V.js.map} +0 -0
- /package/dist/{chunk-TKZ7MEIA.js.map → chunk-53GVPGSM.js.map} +0 -0
- /package/dist/{chunk-NZJKFF45.js.map → chunk-C2UZZQ76.js.map} +0 -0
- /package/dist/{chunk-M2RGJPXX.js.map → chunk-DBD6Q6JH.js.map} +0 -0
- /package/dist/{chunk-ZGDVUPTM.js.map → chunk-EB4RGQO3.js.map} +0 -0
- /package/dist/{chunk-TAAPQVZN.js.map → chunk-ISKNULNH.js.map} +0 -0
- /package/dist/{chunk-66ALHVEX.js.map → chunk-KKIAYH4X.js.map} +0 -0
- /package/dist/{chunk-3RMKLXHX.js.map → chunk-KLDVG3SY.js.map} +0 -0
- /package/dist/{chunk-4CQAV7YB.js.map → chunk-O6TTQXTY.js.map} +0 -0
- /package/dist/{chunk-24VULZ7A.js.map → chunk-TKOGZDD6.js.map} +0 -0
- /package/dist/{chunk-EY4NZKDR.js.map → chunk-XFMMPYNU.js.map} +0 -0
|
@@ -4,186 +4,51 @@ import {
|
|
|
4
4
|
parseListItemFieldPath,
|
|
5
5
|
setAtPathMutating,
|
|
6
6
|
toListItemValuePath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KSZQYSEH.js";
|
|
8
8
|
import {
|
|
9
9
|
Snapshot,
|
|
10
10
|
internal,
|
|
11
11
|
keyHash
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-C2UZZQ76.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "./chunk-
|
|
14
|
+
mergeCanonical,
|
|
15
|
+
sanitize
|
|
16
|
+
} from "./chunk-J3CWXIPV.js";
|
|
17
17
|
import {
|
|
18
18
|
compareFieldPath,
|
|
19
19
|
getFieldPathId,
|
|
20
20
|
makeFieldPathIdRegistry,
|
|
21
21
|
normalizeFieldPath
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZTFTABXV.js";
|
|
23
23
|
import {
|
|
24
24
|
getBoundInternals
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KLDVG3SY.js";
|
|
26
26
|
import {
|
|
27
27
|
ReplayModeConfigTag,
|
|
28
|
+
forceSourceRefresh,
|
|
29
|
+
inSyncTransactionFiber,
|
|
28
30
|
isDevEnv
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import {
|
|
31
|
-
record
|
|
32
|
-
} from "./chunk-DMBALCE2.js";
|
|
33
|
-
import {
|
|
34
|
-
fnv1a32,
|
|
35
|
-
stableStringify
|
|
36
|
-
} from "./chunk-GMPEOUP2.js";
|
|
31
|
+
} from "./chunk-AQ7L2QZ5.js";
|
|
37
32
|
import {
|
|
38
33
|
RunSessionTag,
|
|
39
34
|
make,
|
|
40
35
|
run
|
|
41
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-I4LCE5OY.js";
|
|
37
|
+
import {
|
|
38
|
+
currentDiagnosticsLevel,
|
|
39
|
+
record
|
|
40
|
+
} from "./chunk-ZC7MSQ5U.js";
|
|
42
41
|
import {
|
|
43
42
|
EffectOpMiddlewareTag
|
|
44
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WYJUJV4L.js";
|
|
44
|
+
import {
|
|
45
|
+
fnv1a32,
|
|
46
|
+
stableStringify
|
|
47
|
+
} from "./chunk-4MZ7BT3R.js";
|
|
45
48
|
|
|
46
49
|
// src/internal/state-trait/build.ts
|
|
47
50
|
import * as SchemaAST from "effect/SchemaAST";
|
|
48
51
|
|
|
49
|
-
// src/internal/state-trait/meta.ts
|
|
50
|
-
var uniqSortedStrings = (input) => {
|
|
51
|
-
const set = /* @__PURE__ */ new Set();
|
|
52
|
-
for (const item of input) {
|
|
53
|
-
const v = item.trim();
|
|
54
|
-
if (!v) continue;
|
|
55
|
-
set.add(v);
|
|
56
|
-
}
|
|
57
|
-
return Array.from(set).sort((a, b) => a.localeCompare(b));
|
|
58
|
-
};
|
|
59
|
-
var isPlainRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60
|
-
var sanitizeJsonValue = (input, depth) => {
|
|
61
|
-
if (input === null) return null;
|
|
62
|
-
if (typeof input === "string") return input;
|
|
63
|
-
if (typeof input === "boolean") return input;
|
|
64
|
-
if (typeof input === "number") {
|
|
65
|
-
return Number.isFinite(input) ? input : void 0;
|
|
66
|
-
}
|
|
67
|
-
if (depth >= 6) return void 0;
|
|
68
|
-
if (Array.isArray(input)) {
|
|
69
|
-
const out = [];
|
|
70
|
-
for (const item of input) {
|
|
71
|
-
const v = sanitizeJsonValue(item, depth + 1);
|
|
72
|
-
if (v !== void 0) out.push(v);
|
|
73
|
-
}
|
|
74
|
-
return out;
|
|
75
|
-
}
|
|
76
|
-
if (isPlainRecord(input)) {
|
|
77
|
-
const keys = Object.keys(input).sort();
|
|
78
|
-
const out = {};
|
|
79
|
-
for (const key of keys) {
|
|
80
|
-
const v = sanitizeJsonValue(input[key], depth + 1);
|
|
81
|
-
if (v !== void 0) out[key] = v;
|
|
82
|
-
}
|
|
83
|
-
return out;
|
|
84
|
-
}
|
|
85
|
-
return void 0;
|
|
86
|
-
};
|
|
87
|
-
var sanitize = (input) => {
|
|
88
|
-
if (input === null || input === void 0) return void 0;
|
|
89
|
-
if (typeof input !== "object" || Array.isArray(input)) return void 0;
|
|
90
|
-
const record2 = input;
|
|
91
|
-
const out = {};
|
|
92
|
-
const pickString = (key) => {
|
|
93
|
-
const value = record2[key];
|
|
94
|
-
if (typeof value !== "string") return;
|
|
95
|
-
const trimmed = value.trim();
|
|
96
|
-
if (!trimmed) return;
|
|
97
|
-
out[key] = trimmed;
|
|
98
|
-
};
|
|
99
|
-
pickString("label");
|
|
100
|
-
pickString("description");
|
|
101
|
-
pickString("group");
|
|
102
|
-
pickString("docsUrl");
|
|
103
|
-
pickString("cacheGroup");
|
|
104
|
-
const canonical = record2.canonical;
|
|
105
|
-
if (typeof canonical === "boolean") {
|
|
106
|
-
out.canonical = canonical;
|
|
107
|
-
}
|
|
108
|
-
const tagsRaw = record2.tags;
|
|
109
|
-
if (typeof tagsRaw === "string") {
|
|
110
|
-
const tags = uniqSortedStrings([tagsRaw]);
|
|
111
|
-
if (tags.length > 0) out.tags = tags;
|
|
112
|
-
} else if (Array.isArray(tagsRaw)) {
|
|
113
|
-
const tags = uniqSortedStrings(tagsRaw.filter((x) => typeof x === "string"));
|
|
114
|
-
if (tags.length > 0) out.tags = tags;
|
|
115
|
-
}
|
|
116
|
-
const annotations = {};
|
|
117
|
-
const annotationKeys = Object.keys(record2).filter((k) => k.startsWith("x-")).sort((a, b) => a.localeCompare(b));
|
|
118
|
-
for (const key of annotationKeys) {
|
|
119
|
-
const v = sanitizeJsonValue(record2[key], 0);
|
|
120
|
-
if (v !== void 0) annotations[key] = v;
|
|
121
|
-
}
|
|
122
|
-
const annotationsRaw = record2.annotations;
|
|
123
|
-
if (isPlainRecord(annotationsRaw)) {
|
|
124
|
-
const keys = Object.keys(annotationsRaw).filter((k) => k.startsWith("x-")).sort((a, b) => a.localeCompare(b));
|
|
125
|
-
for (const key of keys) {
|
|
126
|
-
const v = sanitizeJsonValue(annotationsRaw[key], 0);
|
|
127
|
-
if (v !== void 0) annotations[key] = v;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (Object.keys(annotations).length > 0) out.annotations = annotations;
|
|
131
|
-
return Object.keys(out).length > 0 ? out : void 0;
|
|
132
|
-
};
|
|
133
|
-
var stableStringify2 = (meta) => {
|
|
134
|
-
const out = {};
|
|
135
|
-
const keys = Object.keys(meta).sort();
|
|
136
|
-
for (const k of keys) {
|
|
137
|
-
out[k] = meta[k];
|
|
138
|
-
}
|
|
139
|
-
return JSON.stringify(out);
|
|
140
|
-
};
|
|
141
|
-
var equals = (a, b) => {
|
|
142
|
-
if (a === b) return true;
|
|
143
|
-
if (!a || !b) return false;
|
|
144
|
-
return stableStringify2(a) === stableStringify2(b);
|
|
145
|
-
};
|
|
146
|
-
var mergeCanonical = (current, incoming) => {
|
|
147
|
-
const existing = current.meta;
|
|
148
|
-
if (!existing) {
|
|
149
|
-
return {
|
|
150
|
-
meta: incoming.meta,
|
|
151
|
-
origin: incoming.origin,
|
|
152
|
-
conflicts: current.conflicts
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
if (equals(existing, incoming.meta)) {
|
|
156
|
-
return current;
|
|
157
|
-
}
|
|
158
|
-
const conflicts = [...current.conflicts ?? []];
|
|
159
|
-
const push = (conflict) => {
|
|
160
|
-
const exists = conflicts.some((c) => c.origin === conflict.origin && equals(c.meta, conflict.meta));
|
|
161
|
-
if (!exists) conflicts.push(conflict);
|
|
162
|
-
};
|
|
163
|
-
const existingCanonical = existing.canonical === true;
|
|
164
|
-
const incomingCanonical = incoming.meta.canonical === true;
|
|
165
|
-
if (!existingCanonical && incomingCanonical) {
|
|
166
|
-
push({
|
|
167
|
-
origin: current.origin ?? "unknown",
|
|
168
|
-
meta: existing
|
|
169
|
-
});
|
|
170
|
-
return {
|
|
171
|
-
meta: incoming.meta,
|
|
172
|
-
origin: incoming.origin,
|
|
173
|
-
conflicts
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
push({
|
|
177
|
-
origin: incoming.origin,
|
|
178
|
-
meta: incoming.meta
|
|
179
|
-
});
|
|
180
|
-
return {
|
|
181
|
-
meta: existing,
|
|
182
|
-
origin: current.origin ?? incoming.origin,
|
|
183
|
-
conflicts
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
|
|
187
52
|
// src/internal/state-trait/model.ts
|
|
188
53
|
var normalizeSpec = (spec) => {
|
|
189
54
|
const entries = [];
|
|
@@ -219,6 +84,14 @@ var normalizeSpec = (spec) => {
|
|
|
219
84
|
meta: { ...meta, deps, _fieldPath: fieldPath }
|
|
220
85
|
};
|
|
221
86
|
}
|
|
87
|
+
if (entry.kind === "externalStore") {
|
|
88
|
+
const meta = entry.meta;
|
|
89
|
+
return {
|
|
90
|
+
...entry,
|
|
91
|
+
fieldPath,
|
|
92
|
+
meta: { ...meta, _fieldPath: fieldPath }
|
|
93
|
+
};
|
|
94
|
+
}
|
|
222
95
|
if (entry.kind === "link") {
|
|
223
96
|
const meta = entry.meta;
|
|
224
97
|
const from = prefixDeps([meta.from], depPrefix)[0] ?? meta.from;
|
|
@@ -256,6 +129,7 @@ var normalizeSpec = (spec) => {
|
|
|
256
129
|
expandMaybeRecord(node.computed);
|
|
257
130
|
expandMaybeRecord(node.source);
|
|
258
131
|
expandMaybeRecord(node.link);
|
|
132
|
+
expandMaybeRecord(node.externalStore);
|
|
259
133
|
if (node.check) {
|
|
260
134
|
const rules = {};
|
|
261
135
|
const checkDepsPrefix = options?.checkDepsPrefix ?? (joinPrefix.endsWith("[]") ? joinPrefix : "");
|
|
@@ -348,6 +222,32 @@ var collectNodeMeta = (spec) => {
|
|
|
348
222
|
|
|
349
223
|
// src/internal/state-trait/build.ts
|
|
350
224
|
var nowPerf = () => typeof globalThis.performance !== "undefined" && typeof globalThis.performance.now === "function" ? globalThis.performance.now() : Date.now();
|
|
225
|
+
var collectMultipleWritersError = (entries) => {
|
|
226
|
+
const kindsByFieldPath = /* @__PURE__ */ new Map();
|
|
227
|
+
for (const entry of entries) {
|
|
228
|
+
if (entry.kind !== "computed" && entry.kind !== "link" && entry.kind !== "source" && entry.kind !== "externalStore") {
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
const set = kindsByFieldPath.get(entry.fieldPath) ?? /* @__PURE__ */ new Set();
|
|
232
|
+
set.add(entry.kind);
|
|
233
|
+
kindsByFieldPath.set(entry.fieldPath, set);
|
|
234
|
+
}
|
|
235
|
+
const conflicts = [];
|
|
236
|
+
for (const [fieldPath, kinds] of kindsByFieldPath.entries()) {
|
|
237
|
+
if (kinds.size <= 1) continue;
|
|
238
|
+
conflicts.push({ fieldPath, kinds: Array.from(kinds).sort() });
|
|
239
|
+
}
|
|
240
|
+
if (conflicts.length === 0) return void 0;
|
|
241
|
+
conflicts.sort((a, b) => a.fieldPath < b.fieldPath ? -1 : a.fieldPath > b.fieldPath ? 1 : 0);
|
|
242
|
+
const fields = conflicts.map((c) => c.fieldPath);
|
|
243
|
+
const primary = conflicts[0];
|
|
244
|
+
const kindSummary = primary.kinds.join(" + ");
|
|
245
|
+
return {
|
|
246
|
+
code: "MULTIPLE_WRITERS",
|
|
247
|
+
message: `[StateTrait.build] Multiple writers for field "${primary.fieldPath}" (${kindSummary}). Only one of computed/link/source/externalStore can write a fieldPath.`,
|
|
248
|
+
fields
|
|
249
|
+
};
|
|
250
|
+
};
|
|
351
251
|
var getConvergeWriterDeps = (entry) => {
|
|
352
252
|
if (entry.kind === "computed") {
|
|
353
253
|
return entry.meta?.deps ?? [];
|
|
@@ -476,6 +376,7 @@ var collectSchemaFieldPaths = (schema) => {
|
|
|
476
376
|
var buildConvergeIr = (stateSchema, entries) => {
|
|
477
377
|
const startedAt = nowPerf();
|
|
478
378
|
const generation = 0;
|
|
379
|
+
const multipleWritersError = collectMultipleWritersError(entries);
|
|
479
380
|
const writers = entries.filter((e) => e.kind === "computed" || e.kind === "link");
|
|
480
381
|
const writersKey = writers.map((entry) => `${entry.kind}:${entry.fieldPath}`).sort().join("|");
|
|
481
382
|
const depsKey = writers.map((entry) => {
|
|
@@ -487,7 +388,7 @@ var buildConvergeIr = (stateSchema, entries) => {
|
|
|
487
388
|
for (const entry of writers) {
|
|
488
389
|
writerByPath.set(entry.fieldPath, entry);
|
|
489
390
|
}
|
|
490
|
-
const topo = writers.length > 0 ? computeConvergeTopoOrder(writers) : { order: [] };
|
|
391
|
+
const topo = multipleWritersError ? { order: [] } : writers.length > 0 ? computeConvergeTopoOrder(writers) : { order: [] };
|
|
491
392
|
const stepsById = topo.configError ? [] : topo.order.map((path) => writerByPath.get(path));
|
|
492
393
|
const fieldPathTable = /* @__PURE__ */ new Map();
|
|
493
394
|
const addPath = (path) => {
|
|
@@ -540,7 +441,7 @@ var buildConvergeIr = (stateSchema, entries) => {
|
|
|
540
441
|
fieldPathsKey,
|
|
541
442
|
fieldPaths,
|
|
542
443
|
fieldPathIdRegistry,
|
|
543
|
-
...topo.configError ? { configError: topo.configError } : null,
|
|
444
|
+
...multipleWritersError ? { configError: multipleWritersError } : topo.configError ? { configError: topo.configError } : null,
|
|
544
445
|
stepsById,
|
|
545
446
|
stepOutFieldPathIdByStepId,
|
|
546
447
|
stepDepsFieldPathIdsByStepId,
|
|
@@ -696,6 +597,12 @@ var buildGraph = (entries, nodeMetaByFieldPath) => {
|
|
|
696
597
|
});
|
|
697
598
|
}
|
|
698
599
|
}
|
|
600
|
+
} else if (entry.kind === "externalStore") {
|
|
601
|
+
planSteps.push({
|
|
602
|
+
id: `external-store:${fieldPath}`,
|
|
603
|
+
kind: "external-store-sync",
|
|
604
|
+
targetFieldPath: fieldPath
|
|
605
|
+
});
|
|
699
606
|
} else if (entry.kind === "check") {
|
|
700
607
|
planSteps.push({
|
|
701
608
|
id: `check:${fieldPath}`,
|
|
@@ -836,7 +743,7 @@ var collectSchemaPaths = (entries) => {
|
|
|
836
743
|
}
|
|
837
744
|
}
|
|
838
745
|
}
|
|
839
|
-
return Array.from(byKey.entries()).sort((a, b) => a[0]
|
|
746
|
+
return Array.from(byKey.entries()).sort((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0).map(([, v]) => v);
|
|
840
747
|
};
|
|
841
748
|
var build = (stateSchema, spec) => {
|
|
842
749
|
const entries = normalizeSpec(spec);
|
|
@@ -888,7 +795,7 @@ var build = (stateSchema, spec) => {
|
|
|
888
795
|
};
|
|
889
796
|
};
|
|
890
797
|
|
|
891
|
-
// src/internal/state-trait/source.ts
|
|
798
|
+
// src/internal/state-trait/source.impl.ts
|
|
892
799
|
import { Effect, Fiber, FiberRef, Option } from "effect";
|
|
893
800
|
import { create } from "mutative";
|
|
894
801
|
|
|
@@ -1037,7 +944,7 @@ var trace = (fn, state) => {
|
|
|
1037
944
|
};
|
|
1038
945
|
};
|
|
1039
946
|
|
|
1040
|
-
// src/internal/state-trait/source.ts
|
|
947
|
+
// src/internal/state-trait/source.impl.ts
|
|
1041
948
|
var onceInRunSession = (key) => Effect.serviceOption(RunSessionTag).pipe(
|
|
1042
949
|
Effect.map((maybe) => Option.isSome(maybe) ? maybe.value.local.once(key) : true)
|
|
1043
950
|
);
|
|
@@ -1914,11 +1821,167 @@ var installSourceRefresh = (bound, step, entry) => {
|
|
|
1914
1821
|
return Effect.void;
|
|
1915
1822
|
};
|
|
1916
1823
|
|
|
1824
|
+
// src/internal/state-trait/converge-diagnostics.ts
|
|
1825
|
+
import { Effect as Effect2, FiberRef as FiberRef2, Option as Option2 } from "effect";
|
|
1826
|
+
import * as SchemaAST2 from "effect/SchemaAST";
|
|
1827
|
+
var onceKeysFallback = /* @__PURE__ */ new Set();
|
|
1828
|
+
var onceInRunSession2 = (key) => Effect2.serviceOption(RunSessionTag).pipe(
|
|
1829
|
+
Effect2.map((maybe) => {
|
|
1830
|
+
if (Option2.isSome(maybe)) {
|
|
1831
|
+
return maybe.value.local.once(key);
|
|
1832
|
+
}
|
|
1833
|
+
if (onceKeysFallback.has(key)) return false;
|
|
1834
|
+
onceKeysFallback.add(key);
|
|
1835
|
+
return true;
|
|
1836
|
+
})
|
|
1837
|
+
);
|
|
1838
|
+
var formatList2 = (items, limit = 10) => {
|
|
1839
|
+
if (items.length === 0) return "";
|
|
1840
|
+
if (items.length <= limit) return items.join(", ");
|
|
1841
|
+
return `${items.slice(0, limit).join(", ")}, \u2026(+${items.length - limit})`;
|
|
1842
|
+
};
|
|
1843
|
+
var emitDepsMismatch2 = (params) => {
|
|
1844
|
+
return Effect2.gen(function* () {
|
|
1845
|
+
const key = `${params.moduleId ?? "unknown"}::${params.instanceId ?? "unknown"}::${params.kind}::${params.fieldPath}`;
|
|
1846
|
+
const shouldEmit = yield* onceInRunSession2(`deps_mismatch:${key}`);
|
|
1847
|
+
if (!shouldEmit) return;
|
|
1848
|
+
yield* record({
|
|
1849
|
+
type: "diagnostic",
|
|
1850
|
+
moduleId: params.moduleId,
|
|
1851
|
+
instanceId: params.instanceId,
|
|
1852
|
+
code: "state_trait::deps_mismatch",
|
|
1853
|
+
severity: "warning",
|
|
1854
|
+
message: `[deps] ${params.kind} "${params.fieldPath}" declared=[${formatList2(params.diff.declared)}] reads=[${formatList2(params.diff.reads)}] missing=[${formatList2(params.diff.missing)}] unused=[${formatList2(params.diff.unused)}]`,
|
|
1855
|
+
hint: 'deps is the single source of truth for dependencies: incremental scheduling / reverse closures / performance optimizations rely on deps only. Keep deps consistent with actual reads; if you really depend on the whole object, declare a coarser-grained dep (e.g. "profile") to cover sub-field reads.',
|
|
1856
|
+
kind: `deps_mismatch:${params.kind}`
|
|
1857
|
+
});
|
|
1858
|
+
});
|
|
1859
|
+
};
|
|
1860
|
+
var schemaHasPath = (ast, segments, seen = /* @__PURE__ */ new Set()) => {
|
|
1861
|
+
if (segments.length === 0) return true;
|
|
1862
|
+
let current = ast;
|
|
1863
|
+
while (true) {
|
|
1864
|
+
if (SchemaAST2.isSuspend(current)) {
|
|
1865
|
+
if (seen.has(current)) {
|
|
1866
|
+
return true;
|
|
1867
|
+
}
|
|
1868
|
+
seen.add(current);
|
|
1869
|
+
current = current.f();
|
|
1870
|
+
continue;
|
|
1871
|
+
}
|
|
1872
|
+
if (SchemaAST2.isRefinement(current)) {
|
|
1873
|
+
current = current.from;
|
|
1874
|
+
continue;
|
|
1875
|
+
}
|
|
1876
|
+
break;
|
|
1877
|
+
}
|
|
1878
|
+
if (SchemaAST2.isTransformation(current)) {
|
|
1879
|
+
return schemaHasPath(current.to, segments, seen) || schemaHasPath(current.from, segments, seen);
|
|
1880
|
+
}
|
|
1881
|
+
if (SchemaAST2.isUnion(current)) {
|
|
1882
|
+
return current.types.some((t) => schemaHasPath(t, segments, seen));
|
|
1883
|
+
}
|
|
1884
|
+
if (SchemaAST2.isTupleType(current)) {
|
|
1885
|
+
const candidates = [];
|
|
1886
|
+
for (const e of current.elements) candidates.push(e.type);
|
|
1887
|
+
for (const r of current.rest) candidates.push(r.type);
|
|
1888
|
+
if (candidates.length === 0) return true;
|
|
1889
|
+
return candidates.some((t) => schemaHasPath(t, segments, seen));
|
|
1890
|
+
}
|
|
1891
|
+
if (SchemaAST2.isTypeLiteral(current)) {
|
|
1892
|
+
const [head, ...tail] = segments;
|
|
1893
|
+
for (const ps of current.propertySignatures) {
|
|
1894
|
+
if (String(ps.name) !== head) continue;
|
|
1895
|
+
return schemaHasPath(ps.type, tail, seen);
|
|
1896
|
+
}
|
|
1897
|
+
for (const sig of current.indexSignatures) {
|
|
1898
|
+
let param = sig.parameter;
|
|
1899
|
+
while (SchemaAST2.isRefinement(param)) {
|
|
1900
|
+
param = param.from;
|
|
1901
|
+
}
|
|
1902
|
+
const tag2 = param?._tag;
|
|
1903
|
+
if (tag2 === "StringKeyword" || tag2 === "TemplateLiteral") {
|
|
1904
|
+
return schemaHasPath(sig.type, tail, seen);
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
return false;
|
|
1908
|
+
}
|
|
1909
|
+
const tag = current?._tag;
|
|
1910
|
+
if (tag === "AnyKeyword" || tag === "UnknownKeyword" || tag === "ObjectKeyword" || tag === "Declaration") {
|
|
1911
|
+
return true;
|
|
1912
|
+
}
|
|
1913
|
+
return false;
|
|
1914
|
+
};
|
|
1915
|
+
var schemaHasFieldPath = (stateSchemaAst, path) => {
|
|
1916
|
+
if (!path) return true;
|
|
1917
|
+
if (path === "$root") return true;
|
|
1918
|
+
const normalized = normalizeFieldPath(path);
|
|
1919
|
+
if (!normalized) return false;
|
|
1920
|
+
const segs = normalized[0] === "$root" ? normalized.slice(1) : normalized;
|
|
1921
|
+
return schemaHasPath(stateSchemaAst, segs);
|
|
1922
|
+
};
|
|
1923
|
+
var formatSchemaMismatchLine = (ref) => {
|
|
1924
|
+
if (ref.kind === "fieldPath") {
|
|
1925
|
+
return `- ${ref.entryKind} "${ref.entryFieldPath}" fieldPath="${ref.path}"`;
|
|
1926
|
+
}
|
|
1927
|
+
if (ref.kind === "dep") {
|
|
1928
|
+
const rule = ref.ruleName ? ` rule="${ref.ruleName}"` : "";
|
|
1929
|
+
return `- ${ref.entryKind} "${ref.entryFieldPath}" deps="${ref.path}"${rule}`;
|
|
1930
|
+
}
|
|
1931
|
+
if (ref.kind === "link_from") {
|
|
1932
|
+
return `- link "${ref.entryFieldPath}" from="${ref.path}"`;
|
|
1933
|
+
}
|
|
1934
|
+
if (ref.kind === "check_writeback") {
|
|
1935
|
+
return `- check "${ref.entryFieldPath}" writeback="${ref.path}"`;
|
|
1936
|
+
}
|
|
1937
|
+
return `- ${ref.entryKind} "${ref.entryFieldPath}" path="${ref.path}"`;
|
|
1938
|
+
};
|
|
1939
|
+
var emitSchemaMismatch = (program, ctx) => Effect2.gen(function* () {
|
|
1940
|
+
if (!isDevEnv()) return;
|
|
1941
|
+
const level = yield* FiberRef2.get(currentDiagnosticsLevel);
|
|
1942
|
+
if (level === "off") return;
|
|
1943
|
+
const key = `${ctx.moduleId ?? "unknown"}::${ctx.instanceId}`;
|
|
1944
|
+
const shouldEmit = yield* onceInRunSession2(`schema_mismatch:${key}`);
|
|
1945
|
+
if (!shouldEmit) return;
|
|
1946
|
+
const refs = program.schemaPaths ?? [];
|
|
1947
|
+
if (refs.length === 0) return;
|
|
1948
|
+
const stateSchemaAst = program.stateSchema.ast;
|
|
1949
|
+
const mismatches = [];
|
|
1950
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1951
|
+
for (const ref of refs) {
|
|
1952
|
+
if (schemaHasFieldPath(stateSchemaAst, ref.path)) continue;
|
|
1953
|
+
const k = `${ref.kind}|${ref.entryKind}|${ref.entryFieldPath}|${ref.ruleName ?? ""}|${ref.path}`;
|
|
1954
|
+
if (seen.has(k)) continue;
|
|
1955
|
+
seen.add(k);
|
|
1956
|
+
mismatches.push(ref);
|
|
1957
|
+
}
|
|
1958
|
+
if (mismatches.length === 0) return;
|
|
1959
|
+
const limit = level === "light" ? 8 : 24;
|
|
1960
|
+
const lines = mismatches.slice(0, limit).map(formatSchemaMismatchLine);
|
|
1961
|
+
if (mismatches.length > limit) {
|
|
1962
|
+
lines.push(`- \u2026(+${mismatches.length - limit})`);
|
|
1963
|
+
}
|
|
1964
|
+
yield* record({
|
|
1965
|
+
type: "diagnostic",
|
|
1966
|
+
moduleId: ctx.moduleId,
|
|
1967
|
+
instanceId: ctx.instanceId,
|
|
1968
|
+
code: "state_trait::schema_mismatch",
|
|
1969
|
+
severity: "warning",
|
|
1970
|
+
message: `[schema] The following paths are not declared in stateSchema (total ${mismatches.length}):
|
|
1971
|
+
${lines.join("\n")}`,
|
|
1972
|
+
hint: "StateTrait writeback will create missing objects/fields. Declare all fieldPath/deps/link.from and errors.* writeback paths in stateSchema, or fix typos in trait paths.",
|
|
1973
|
+
kind: "schema_mismatch"
|
|
1974
|
+
});
|
|
1975
|
+
});
|
|
1976
|
+
|
|
1917
1977
|
export {
|
|
1978
|
+
onceInRunSession2 as onceInRunSession,
|
|
1979
|
+
emitDepsMismatch2 as emitDepsMismatch,
|
|
1980
|
+
emitSchemaMismatch,
|
|
1918
1981
|
diffDeps,
|
|
1919
1982
|
trace,
|
|
1920
1983
|
syncIdleInTransaction,
|
|
1921
1984
|
installSourceRefresh,
|
|
1922
1985
|
build
|
|
1923
1986
|
};
|
|
1924
|
-
//# sourceMappingURL=chunk-
|
|
1987
|
+
//# sourceMappingURL=chunk-JBKYRTCS.js.map
|