@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
package/dist/Debug.cjs
CHANGED
|
@@ -52,9 +52,9 @@ __export(Debug_exports, {
|
|
|
52
52
|
withPrettyLogger: () => withPrettyLogger
|
|
53
53
|
});
|
|
54
54
|
module.exports = __toCommonJS(Debug_exports);
|
|
55
|
-
var
|
|
55
|
+
var import_effect10 = require("effect");
|
|
56
56
|
|
|
57
|
-
// src/internal/runtime/core/DebugSink.ts
|
|
57
|
+
// src/internal/runtime/core/DebugSink.record.ts
|
|
58
58
|
var import_effect3 = require("effect");
|
|
59
59
|
|
|
60
60
|
// src/internal/observability/jsonValue.ts
|
|
@@ -146,11 +146,12 @@ var toJsonValueInternal = (input, options, stats, seen, depth) => {
|
|
|
146
146
|
stats.nonSerializable += 1;
|
|
147
147
|
return truncateString(String(input), options.maxStringLength, stats);
|
|
148
148
|
}
|
|
149
|
-
const
|
|
150
|
-
const limit = Math.min(
|
|
149
|
+
const keys = Object.keys(input).sort();
|
|
150
|
+
const limit = Math.min(keys.length, options.maxObjectKeys);
|
|
151
151
|
const out = {};
|
|
152
152
|
for (let i = 0; i < limit; i++) {
|
|
153
|
-
const
|
|
153
|
+
const rawKey = keys[i];
|
|
154
|
+
const rawValue = input[rawKey];
|
|
154
155
|
const key = truncateString(rawKey, options.maxStringLength, stats);
|
|
155
156
|
if (rawValue === void 0) {
|
|
156
157
|
stats.dropped += 1;
|
|
@@ -158,9 +159,9 @@ var toJsonValueInternal = (input, options, stats, seen, depth) => {
|
|
|
158
159
|
}
|
|
159
160
|
out[key] = toJsonValueInternal(rawValue, options, stats, seen, depth + 1);
|
|
160
161
|
}
|
|
161
|
-
if (
|
|
162
|
+
if (keys.length > limit) {
|
|
162
163
|
stats.oversized += 1;
|
|
163
|
-
out.__truncatedKeys =
|
|
164
|
+
out.__truncatedKeys = keys.length - limit;
|
|
164
165
|
}
|
|
165
166
|
return out;
|
|
166
167
|
};
|
|
@@ -297,7 +298,7 @@ var currentLinkId = import_effect2.FiberRef.unsafeMake(void 0);
|
|
|
297
298
|
var EffectOpMiddlewareTag = class extends import_effect2.Context.Tag("Logix/EffectOpMiddleware")() {
|
|
298
299
|
};
|
|
299
300
|
|
|
300
|
-
// src/internal/runtime/core/DebugSink.ts
|
|
301
|
+
// src/internal/runtime/core/DebugSink.record.ts
|
|
301
302
|
var currentDebugSinks = import_effect3.FiberRef.unsafeMake([]);
|
|
302
303
|
var currentRuntimeLabel = import_effect3.FiberRef.unsafeMake(void 0);
|
|
303
304
|
var currentTxnId = import_effect3.FiberRef.unsafeMake(void 0);
|
|
@@ -855,10 +856,83 @@ var toRuntimeDebugEventRef = (event, options) => {
|
|
|
855
856
|
meta: metaProjection.value
|
|
856
857
|
});
|
|
857
858
|
}
|
|
859
|
+
case "warn:priority-inversion": {
|
|
860
|
+
const e = event;
|
|
861
|
+
const metaInput = isLightLike ? {
|
|
862
|
+
tickSeq: e.tickSeq,
|
|
863
|
+
reason: e.reason,
|
|
864
|
+
selectorId: e.selectorId
|
|
865
|
+
} : {
|
|
866
|
+
tickSeq: e.tickSeq,
|
|
867
|
+
reason: e.reason,
|
|
868
|
+
selectorId: e.selectorId
|
|
869
|
+
};
|
|
870
|
+
const metaProjection = projectJsonValue(metaInput);
|
|
871
|
+
options?.onMetaProjection?.({
|
|
872
|
+
stats: metaProjection.stats,
|
|
873
|
+
downgrade: metaProjection.downgrade
|
|
874
|
+
});
|
|
875
|
+
downgrade = mergeDowngrade2(downgrade, metaProjection.downgrade);
|
|
876
|
+
return withDowngrade({
|
|
877
|
+
...base,
|
|
878
|
+
kind: "diagnostic",
|
|
879
|
+
label: e.type,
|
|
880
|
+
meta: metaProjection.value
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
case "warn:microtask-starvation": {
|
|
884
|
+
const e = event;
|
|
885
|
+
const metaInput = isLightLike ? {
|
|
886
|
+
tickSeq: e.tickSeq,
|
|
887
|
+
microtaskChainDepth: e.microtaskChainDepth
|
|
888
|
+
} : {
|
|
889
|
+
tickSeq: e.tickSeq,
|
|
890
|
+
microtaskChainDepth: e.microtaskChainDepth
|
|
891
|
+
};
|
|
892
|
+
const metaProjection = projectJsonValue(metaInput);
|
|
893
|
+
options?.onMetaProjection?.({
|
|
894
|
+
stats: metaProjection.stats,
|
|
895
|
+
downgrade: metaProjection.downgrade
|
|
896
|
+
});
|
|
897
|
+
downgrade = mergeDowngrade2(downgrade, metaProjection.downgrade);
|
|
898
|
+
return withDowngrade({
|
|
899
|
+
...base,
|
|
900
|
+
kind: "diagnostic",
|
|
901
|
+
label: e.type,
|
|
902
|
+
meta: metaProjection.value
|
|
903
|
+
});
|
|
904
|
+
}
|
|
858
905
|
default: {
|
|
859
906
|
if (typeof event.type !== "string" || !event.type.startsWith("trace:")) {
|
|
860
907
|
return void 0;
|
|
861
908
|
}
|
|
909
|
+
if (event.type === "trace:tick") {
|
|
910
|
+
const data = event.data;
|
|
911
|
+
const metaInput = isLightLike ? {
|
|
912
|
+
tickSeq: data?.tickSeq,
|
|
913
|
+
phase: data?.phase,
|
|
914
|
+
schedule: data?.schedule,
|
|
915
|
+
triggerSummary: data?.triggerSummary,
|
|
916
|
+
anchors: data?.anchors,
|
|
917
|
+
budget: data?.budget,
|
|
918
|
+
backlog: data?.backlog,
|
|
919
|
+
result: data?.result
|
|
920
|
+
} : {
|
|
921
|
+
data
|
|
922
|
+
};
|
|
923
|
+
const metaProjection2 = projectJsonValue(metaInput);
|
|
924
|
+
options?.onMetaProjection?.({
|
|
925
|
+
stats: metaProjection2.stats,
|
|
926
|
+
downgrade: metaProjection2.downgrade
|
|
927
|
+
});
|
|
928
|
+
downgrade = mergeDowngrade2(downgrade, metaProjection2.downgrade);
|
|
929
|
+
return withDowngrade({
|
|
930
|
+
...base,
|
|
931
|
+
kind: "devtools",
|
|
932
|
+
label: event.type,
|
|
933
|
+
meta: metaProjection2.value
|
|
934
|
+
});
|
|
935
|
+
}
|
|
862
936
|
if (event.type === "trace:txn-lane") {
|
|
863
937
|
const data = event.data;
|
|
864
938
|
const evidence = data?.evidence ?? data;
|
|
@@ -1244,6 +1318,146 @@ var exportEvidencePackage = (options) => {
|
|
|
1244
1318
|
};
|
|
1245
1319
|
};
|
|
1246
1320
|
|
|
1321
|
+
// src/internal/runtime/core/HostScheduler.ts
|
|
1322
|
+
var noopCancel = () => {
|
|
1323
|
+
};
|
|
1324
|
+
var safeNowMs = () => {
|
|
1325
|
+
const perf = globalThis.performance;
|
|
1326
|
+
if (perf && typeof perf.now === "function") {
|
|
1327
|
+
try {
|
|
1328
|
+
const v = perf.now();
|
|
1329
|
+
if (typeof v === "number" && Number.isFinite(v)) return v;
|
|
1330
|
+
} catch {
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
return Date.now();
|
|
1334
|
+
};
|
|
1335
|
+
var safeQueueMicrotask = (cb) => {
|
|
1336
|
+
const qm = globalThis.queueMicrotask;
|
|
1337
|
+
if (typeof qm === "function") {
|
|
1338
|
+
try {
|
|
1339
|
+
qm(cb);
|
|
1340
|
+
return;
|
|
1341
|
+
} catch {
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
try {
|
|
1345
|
+
Promise.resolve().then(cb);
|
|
1346
|
+
} catch {
|
|
1347
|
+
setTimeout(cb, 0);
|
|
1348
|
+
}
|
|
1349
|
+
};
|
|
1350
|
+
var safeSetTimeout = (ms, cb) => {
|
|
1351
|
+
const id = setTimeout(cb, ms);
|
|
1352
|
+
return () => {
|
|
1353
|
+
try {
|
|
1354
|
+
clearTimeout(id);
|
|
1355
|
+
} catch {
|
|
1356
|
+
}
|
|
1357
|
+
};
|
|
1358
|
+
};
|
|
1359
|
+
var makeMessageChannelMacrotask = () => {
|
|
1360
|
+
const MC = globalThis.MessageChannel;
|
|
1361
|
+
if (typeof MC !== "function") return void 0;
|
|
1362
|
+
let channel;
|
|
1363
|
+
try {
|
|
1364
|
+
channel = new MC();
|
|
1365
|
+
} catch {
|
|
1366
|
+
return void 0;
|
|
1367
|
+
}
|
|
1368
|
+
const queue = [];
|
|
1369
|
+
let scheduled = false;
|
|
1370
|
+
const flush = () => {
|
|
1371
|
+
scheduled = false;
|
|
1372
|
+
const tasks = queue.splice(0, queue.length);
|
|
1373
|
+
for (const t of tasks) {
|
|
1374
|
+
if (t.canceled) continue;
|
|
1375
|
+
try {
|
|
1376
|
+
t.cb();
|
|
1377
|
+
} catch {
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
try {
|
|
1382
|
+
channel.port1.onmessage = flush;
|
|
1383
|
+
} catch {
|
|
1384
|
+
return void 0;
|
|
1385
|
+
}
|
|
1386
|
+
const schedule = (cb) => {
|
|
1387
|
+
const task = { canceled: false, cb };
|
|
1388
|
+
queue.push(task);
|
|
1389
|
+
if (!scheduled) {
|
|
1390
|
+
scheduled = true;
|
|
1391
|
+
try {
|
|
1392
|
+
channel.port2.postMessage(void 0);
|
|
1393
|
+
} catch {
|
|
1394
|
+
scheduled = false;
|
|
1395
|
+
return safeSetTimeout(0, cb);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
return () => {
|
|
1399
|
+
task.canceled = true;
|
|
1400
|
+
};
|
|
1401
|
+
};
|
|
1402
|
+
return schedule;
|
|
1403
|
+
};
|
|
1404
|
+
var makeSetImmediateMacrotask = () => {
|
|
1405
|
+
const si = globalThis.setImmediate;
|
|
1406
|
+
const ci = globalThis.clearImmediate;
|
|
1407
|
+
if (typeof si !== "function") return void 0;
|
|
1408
|
+
return (cb) => {
|
|
1409
|
+
let id;
|
|
1410
|
+
try {
|
|
1411
|
+
id = si(cb);
|
|
1412
|
+
} catch {
|
|
1413
|
+
return safeSetTimeout(0, cb);
|
|
1414
|
+
}
|
|
1415
|
+
return () => {
|
|
1416
|
+
if (typeof ci !== "function") return;
|
|
1417
|
+
try {
|
|
1418
|
+
ci(id);
|
|
1419
|
+
} catch {
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
};
|
|
1423
|
+
};
|
|
1424
|
+
var makeRaf = () => {
|
|
1425
|
+
const raf = globalThis.requestAnimationFrame;
|
|
1426
|
+
const cancel = globalThis.cancelAnimationFrame;
|
|
1427
|
+
if (typeof raf !== "function") return void 0;
|
|
1428
|
+
return (cb) => {
|
|
1429
|
+
let id;
|
|
1430
|
+
try {
|
|
1431
|
+
id = raf(cb);
|
|
1432
|
+
} catch {
|
|
1433
|
+
return noopCancel;
|
|
1434
|
+
}
|
|
1435
|
+
return () => {
|
|
1436
|
+
if (typeof cancel !== "function") return;
|
|
1437
|
+
try {
|
|
1438
|
+
cancel(id);
|
|
1439
|
+
} catch {
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
};
|
|
1443
|
+
};
|
|
1444
|
+
var makeDefaultHostScheduler = () => {
|
|
1445
|
+
const macrotask = makeSetImmediateMacrotask() ?? makeMessageChannelMacrotask() ?? ((cb) => safeSetTimeout(0, cb));
|
|
1446
|
+
const raf = makeRaf();
|
|
1447
|
+
return {
|
|
1448
|
+
nowMs: safeNowMs,
|
|
1449
|
+
scheduleMicrotask: safeQueueMicrotask,
|
|
1450
|
+
scheduleMacrotask: macrotask,
|
|
1451
|
+
scheduleAnimationFrame: (cb) => raf?.(cb) ?? macrotask(cb),
|
|
1452
|
+
scheduleTimeout: safeSetTimeout
|
|
1453
|
+
};
|
|
1454
|
+
};
|
|
1455
|
+
var globalHostScheduler;
|
|
1456
|
+
var getGlobalHostScheduler = () => {
|
|
1457
|
+
globalHostScheduler ?? (globalHostScheduler = makeDefaultHostScheduler());
|
|
1458
|
+
return globalHostScheduler;
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1247
1461
|
// src/internal/runtime/core/DevtoolsHub.ts
|
|
1248
1462
|
var instances = /* @__PURE__ */ new Map();
|
|
1249
1463
|
var latestStates = /* @__PURE__ */ new Map();
|
|
@@ -1312,9 +1526,10 @@ var currentSnapshot = {
|
|
|
1312
1526
|
var listeners = /* @__PURE__ */ new Set();
|
|
1313
1527
|
var notifyScheduled = false;
|
|
1314
1528
|
var scheduleNotify = () => {
|
|
1529
|
+
if (listeners.size === 0) return;
|
|
1315
1530
|
if (notifyScheduled) return;
|
|
1316
1531
|
notifyScheduled = true;
|
|
1317
|
-
|
|
1532
|
+
getGlobalHostScheduler().scheduleMicrotask(() => {
|
|
1318
1533
|
notifyScheduled = false;
|
|
1319
1534
|
for (const listener of listeners) {
|
|
1320
1535
|
listener();
|
|
@@ -1539,7 +1754,290 @@ var appendConvergeStaticIrCollectors = (collectors) => import_effect5.Layer.fibe
|
|
|
1539
1754
|
]);
|
|
1540
1755
|
|
|
1541
1756
|
// src/internal/runtime/core/env.ts
|
|
1757
|
+
var import_effect9 = require("effect");
|
|
1758
|
+
|
|
1759
|
+
// src/internal/runtime/core/RuntimeStore.ts
|
|
1760
|
+
var parseTopicKey = (topicKey) => {
|
|
1761
|
+
const idx = topicKey.indexOf("::");
|
|
1762
|
+
if (idx <= 0) return void 0;
|
|
1763
|
+
const moduleId = topicKey.slice(0, idx);
|
|
1764
|
+
const rest = topicKey.slice(idx + 2);
|
|
1765
|
+
if (rest.length === 0) return void 0;
|
|
1766
|
+
const idx2 = rest.indexOf("::");
|
|
1767
|
+
if (idx2 < 0) {
|
|
1768
|
+
return { kind: "module", moduleInstanceKey: `${moduleId}::${rest}` };
|
|
1769
|
+
}
|
|
1770
|
+
const instanceId = rest.slice(0, idx2);
|
|
1771
|
+
const suffix = rest.slice(idx2 + 2);
|
|
1772
|
+
if (suffix.startsWith("rq:")) {
|
|
1773
|
+
const selectorId = suffix.slice("rq:".length);
|
|
1774
|
+
if (selectorId.length === 0) return void 0;
|
|
1775
|
+
return {
|
|
1776
|
+
kind: "readQuery",
|
|
1777
|
+
moduleInstanceKey: `${moduleId}::${instanceId}`,
|
|
1778
|
+
selectorId
|
|
1779
|
+
};
|
|
1780
|
+
}
|
|
1781
|
+
return { kind: "module", moduleInstanceKey: `${moduleId}::${instanceId}` };
|
|
1782
|
+
};
|
|
1783
|
+
var makeRuntimeStore = () => {
|
|
1784
|
+
let tickSeq = 0;
|
|
1785
|
+
const moduleStates = /* @__PURE__ */ new Map();
|
|
1786
|
+
const topicVersions = /* @__PURE__ */ new Map();
|
|
1787
|
+
const topicPriorities = /* @__PURE__ */ new Map();
|
|
1788
|
+
const listenersByTopic = /* @__PURE__ */ new Map();
|
|
1789
|
+
const subscriberCountByModule = /* @__PURE__ */ new Map();
|
|
1790
|
+
const getTopicVersion = (topicKey) => topicVersions.get(topicKey) ?? 0;
|
|
1791
|
+
const getTopicPriority = (topicKey) => topicPriorities.get(topicKey) ?? "normal";
|
|
1792
|
+
const commitTopicBump = (topicKey, priority) => {
|
|
1793
|
+
const prev = topicVersions.get(topicKey) ?? 0;
|
|
1794
|
+
topicVersions.set(topicKey, prev + 1);
|
|
1795
|
+
topicPriorities.set(topicKey, priority);
|
|
1796
|
+
};
|
|
1797
|
+
const subscribeTopic = (topicKey, listener) => {
|
|
1798
|
+
const info = parseTopicKey(topicKey);
|
|
1799
|
+
const existing = listenersByTopic.get(topicKey);
|
|
1800
|
+
const set = existing ?? /* @__PURE__ */ new Set();
|
|
1801
|
+
const alreadyHas = set.has(listener);
|
|
1802
|
+
if (!alreadyHas) {
|
|
1803
|
+
set.add(listener);
|
|
1804
|
+
}
|
|
1805
|
+
if (!existing) {
|
|
1806
|
+
listenersByTopic.set(topicKey, set);
|
|
1807
|
+
}
|
|
1808
|
+
if (!alreadyHas && info) {
|
|
1809
|
+
const prev = subscriberCountByModule.get(info.moduleInstanceKey) ?? 0;
|
|
1810
|
+
subscriberCountByModule.set(info.moduleInstanceKey, prev + 1);
|
|
1811
|
+
}
|
|
1812
|
+
return () => {
|
|
1813
|
+
const current = listenersByTopic.get(topicKey);
|
|
1814
|
+
if (!current) return;
|
|
1815
|
+
const deleted = current.delete(listener);
|
|
1816
|
+
if (deleted && info) {
|
|
1817
|
+
const prev = subscriberCountByModule.get(info.moduleInstanceKey) ?? 0;
|
|
1818
|
+
const next = prev - 1;
|
|
1819
|
+
if (next <= 0) {
|
|
1820
|
+
subscriberCountByModule.delete(info.moduleInstanceKey);
|
|
1821
|
+
} else {
|
|
1822
|
+
subscriberCountByModule.set(info.moduleInstanceKey, next);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
if (current.size === 0) {
|
|
1826
|
+
listenersByTopic.delete(topicKey);
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
};
|
|
1830
|
+
const getTopicSubscriberCount = (topicKey) => listenersByTopic.get(topicKey)?.size ?? 0;
|
|
1831
|
+
const getModuleSubscriberCount = (moduleInstanceKey) => subscriberCountByModule.get(moduleInstanceKey) ?? 0;
|
|
1832
|
+
const registerModuleInstance = (args) => {
|
|
1833
|
+
moduleStates.set(args.moduleInstanceKey, args.initialState);
|
|
1834
|
+
if (!topicVersions.has(args.moduleInstanceKey)) {
|
|
1835
|
+
topicVersions.set(args.moduleInstanceKey, 0);
|
|
1836
|
+
topicPriorities.set(args.moduleInstanceKey, "normal");
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
const unregisterModuleInstance = (moduleInstanceKey) => {
|
|
1840
|
+
moduleStates.delete(moduleInstanceKey);
|
|
1841
|
+
};
|
|
1842
|
+
const commitTick = (args) => {
|
|
1843
|
+
tickSeq = args.tickSeq;
|
|
1844
|
+
for (const [key, commit] of args.accepted.modules) {
|
|
1845
|
+
moduleStates.set(key, commit.state);
|
|
1846
|
+
}
|
|
1847
|
+
const changedTopics = /* @__PURE__ */ new Map();
|
|
1848
|
+
for (const [topicKey, priority] of args.accepted.dirtyTopics) {
|
|
1849
|
+
commitTopicBump(topicKey, priority);
|
|
1850
|
+
const listeners2 = Array.from(listenersByTopic.get(topicKey) ?? []);
|
|
1851
|
+
if (listeners2.length > 0) {
|
|
1852
|
+
changedTopics.set(topicKey, { priority, listeners: listeners2 });
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
return { changedTopics };
|
|
1856
|
+
};
|
|
1857
|
+
const getModuleState = (moduleInstanceKey) => moduleStates.get(moduleInstanceKey);
|
|
1858
|
+
const dispose = () => {
|
|
1859
|
+
moduleStates.clear();
|
|
1860
|
+
topicVersions.clear();
|
|
1861
|
+
topicPriorities.clear();
|
|
1862
|
+
listenersByTopic.clear();
|
|
1863
|
+
subscriberCountByModule.clear();
|
|
1864
|
+
};
|
|
1865
|
+
return {
|
|
1866
|
+
getTickSeq: () => tickSeq,
|
|
1867
|
+
getModuleState,
|
|
1868
|
+
getTopicVersion,
|
|
1869
|
+
getTopicPriority,
|
|
1870
|
+
subscribeTopic,
|
|
1871
|
+
getTopicSubscriberCount,
|
|
1872
|
+
getModuleSubscriberCount,
|
|
1873
|
+
registerModuleInstance,
|
|
1874
|
+
unregisterModuleInstance,
|
|
1875
|
+
commitTick,
|
|
1876
|
+
dispose
|
|
1877
|
+
};
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1880
|
+
// src/internal/runtime/core/TickScheduler.ts
|
|
1881
|
+
var import_effect7 = require("effect");
|
|
1882
|
+
|
|
1883
|
+
// src/internal/runtime/core/TaskRunner.ts
|
|
1542
1884
|
var import_effect6 = require("effect");
|
|
1885
|
+
var inSyncTransactionFiber = import_effect6.FiberRef.unsafeMake(false);
|
|
1886
|
+
var forceSourceRefresh = import_effect6.FiberRef.unsafeMake(false);
|
|
1887
|
+
|
|
1888
|
+
// src/internal/runtime/core/DeclarativeLinkRuntime.ts
|
|
1889
|
+
var import_effect8 = require("effect");
|
|
1890
|
+
var makeDeclarativeLinkRuntime = () => {
|
|
1891
|
+
const moduleAsSourceById = /* @__PURE__ */ new Map();
|
|
1892
|
+
const moduleAsSourceIdsBySource = /* @__PURE__ */ new Map();
|
|
1893
|
+
const declarativeById = /* @__PURE__ */ new Map();
|
|
1894
|
+
const declarativeReadNodesBySource = /* @__PURE__ */ new Map();
|
|
1895
|
+
const registerModuleAsSourceLink = (link) => {
|
|
1896
|
+
const stored = {
|
|
1897
|
+
...link,
|
|
1898
|
+
hasValue: false,
|
|
1899
|
+
lastValue: void 0
|
|
1900
|
+
};
|
|
1901
|
+
moduleAsSourceById.set(link.id, stored);
|
|
1902
|
+
const set = moduleAsSourceIdsBySource.get(link.sourceModuleInstanceKey) ?? /* @__PURE__ */ new Set();
|
|
1903
|
+
set.add(link.id);
|
|
1904
|
+
moduleAsSourceIdsBySource.set(link.sourceModuleInstanceKey, set);
|
|
1905
|
+
return () => {
|
|
1906
|
+
moduleAsSourceById.delete(link.id);
|
|
1907
|
+
const current = moduleAsSourceIdsBySource.get(link.sourceModuleInstanceKey);
|
|
1908
|
+
if (!current) return;
|
|
1909
|
+
current.delete(link.id);
|
|
1910
|
+
if (current.size === 0) {
|
|
1911
|
+
moduleAsSourceIdsBySource.delete(link.sourceModuleInstanceKey);
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
};
|
|
1915
|
+
const registerDeclarativeLink = (link) => {
|
|
1916
|
+
const readNodeById = /* @__PURE__ */ new Map();
|
|
1917
|
+
for (const n of link.readNodes) {
|
|
1918
|
+
readNodeById.set(n.nodeId, n);
|
|
1919
|
+
}
|
|
1920
|
+
const dispatchNodeById = /* @__PURE__ */ new Map();
|
|
1921
|
+
for (const n of link.dispatchNodes) {
|
|
1922
|
+
dispatchNodeById.set(n.nodeId, n);
|
|
1923
|
+
}
|
|
1924
|
+
const incomingByDispatch = /* @__PURE__ */ new Map();
|
|
1925
|
+
for (const e of link.ir.edges) {
|
|
1926
|
+
const to = e.to;
|
|
1927
|
+
const isDispatch = dispatchNodeById.has(to);
|
|
1928
|
+
if (!isDispatch) continue;
|
|
1929
|
+
incomingByDispatch.set(to, (incomingByDispatch.get(to) ?? 0) + 1);
|
|
1930
|
+
const count = incomingByDispatch.get(to) ?? 0;
|
|
1931
|
+
if (count > 1) {
|
|
1932
|
+
throw new Error(
|
|
1933
|
+
`[DeclarativeLinkRuntime] Invalid DeclarativeLinkIR: dispatch node has multiple incoming edges (linkId=${link.linkId}, nodeId=${to}).`
|
|
1934
|
+
);
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
const dispatchTargetsByReadNode = /* @__PURE__ */ new Map();
|
|
1938
|
+
for (const e of link.ir.edges) {
|
|
1939
|
+
const from = e.from;
|
|
1940
|
+
const to = e.to;
|
|
1941
|
+
if (!readNodeById.has(from)) continue;
|
|
1942
|
+
if (!dispatchNodeById.has(to)) continue;
|
|
1943
|
+
const list = dispatchTargetsByReadNode.get(from) ?? [];
|
|
1944
|
+
list.push(to);
|
|
1945
|
+
dispatchTargetsByReadNode.set(from, list);
|
|
1946
|
+
}
|
|
1947
|
+
const stored = {
|
|
1948
|
+
...link,
|
|
1949
|
+
readNodeById,
|
|
1950
|
+
dispatchNodeById,
|
|
1951
|
+
dispatchTargetsByReadNode,
|
|
1952
|
+
readNodeState: /* @__PURE__ */ new Map()
|
|
1953
|
+
};
|
|
1954
|
+
declarativeById.set(link.linkId, stored);
|
|
1955
|
+
for (const n of link.readNodes) {
|
|
1956
|
+
const list = declarativeReadNodesBySource.get(n.moduleInstanceKey) ?? [];
|
|
1957
|
+
list.push({ linkId: link.linkId, nodeId: n.nodeId });
|
|
1958
|
+
declarativeReadNodesBySource.set(n.moduleInstanceKey, list);
|
|
1959
|
+
}
|
|
1960
|
+
return () => {
|
|
1961
|
+
declarativeById.delete(link.linkId);
|
|
1962
|
+
for (const n of link.readNodes) {
|
|
1963
|
+
const list = declarativeReadNodesBySource.get(n.moduleInstanceKey);
|
|
1964
|
+
if (!list) continue;
|
|
1965
|
+
const next = list.filter((x) => !(x.linkId === link.linkId && x.nodeId === n.nodeId));
|
|
1966
|
+
if (next.length === 0) {
|
|
1967
|
+
declarativeReadNodesBySource.delete(n.moduleInstanceKey);
|
|
1968
|
+
} else {
|
|
1969
|
+
declarativeReadNodesBySource.set(n.moduleInstanceKey, next);
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
};
|
|
1973
|
+
};
|
|
1974
|
+
const applyForSources = (args) => import_effect8.Effect.gen(function* () {
|
|
1975
|
+
let scheduled = false;
|
|
1976
|
+
for (const sourceKey of args.changedModuleInstanceKeys) {
|
|
1977
|
+
const ids = moduleAsSourceIdsBySource.get(sourceKey);
|
|
1978
|
+
if (!ids || ids.size === 0) continue;
|
|
1979
|
+
const commit = args.acceptedModules.get(sourceKey);
|
|
1980
|
+
if (!commit) continue;
|
|
1981
|
+
for (const id of ids) {
|
|
1982
|
+
const link = moduleAsSourceById.get(id);
|
|
1983
|
+
if (!link) continue;
|
|
1984
|
+
let selected;
|
|
1985
|
+
try {
|
|
1986
|
+
selected = link.readQuery.select(commit.state);
|
|
1987
|
+
} catch {
|
|
1988
|
+
continue;
|
|
1989
|
+
}
|
|
1990
|
+
const nextValue = link.computeValue(selected);
|
|
1991
|
+
if (link.hasValue && link.equalsValue(link.lastValue, nextValue)) {
|
|
1992
|
+
continue;
|
|
1993
|
+
}
|
|
1994
|
+
link.hasValue = true;
|
|
1995
|
+
link.lastValue = nextValue;
|
|
1996
|
+
scheduled = true;
|
|
1997
|
+
yield* link.applyValue(nextValue);
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
for (const sourceKey of args.changedModuleInstanceKeys) {
|
|
2001
|
+
const refs = declarativeReadNodesBySource.get(sourceKey);
|
|
2002
|
+
if (!refs || refs.length === 0) continue;
|
|
2003
|
+
const commit = args.acceptedModules.get(sourceKey);
|
|
2004
|
+
if (!commit) continue;
|
|
2005
|
+
for (const ref of refs) {
|
|
2006
|
+
const link = declarativeById.get(ref.linkId);
|
|
2007
|
+
if (!link) continue;
|
|
2008
|
+
const readNode = link.readNodeById.get(ref.nodeId);
|
|
2009
|
+
if (!readNode) continue;
|
|
2010
|
+
let value;
|
|
2011
|
+
try {
|
|
2012
|
+
value = readNode.readQuery.select(commit.state);
|
|
2013
|
+
} catch {
|
|
2014
|
+
continue;
|
|
2015
|
+
}
|
|
2016
|
+
const state = link.readNodeState.get(ref.nodeId) ?? { hasValue: false, lastValue: void 0 };
|
|
2017
|
+
const changed = !state.hasValue || !Object.is(state.lastValue, value);
|
|
2018
|
+
if (!changed) continue;
|
|
2019
|
+
state.hasValue = true;
|
|
2020
|
+
state.lastValue = value;
|
|
2021
|
+
link.readNodeState.set(ref.nodeId, state);
|
|
2022
|
+
const targets = link.dispatchTargetsByReadNode.get(ref.nodeId) ?? [];
|
|
2023
|
+
for (const dispatchNodeId of targets) {
|
|
2024
|
+
const node = link.dispatchNodeById.get(dispatchNodeId);
|
|
2025
|
+
if (!node) continue;
|
|
2026
|
+
scheduled = true;
|
|
2027
|
+
yield* node.dispatch(value);
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
return { scheduled };
|
|
2032
|
+
});
|
|
2033
|
+
return {
|
|
2034
|
+
registerModuleAsSourceLink,
|
|
2035
|
+
registerDeclarativeLink,
|
|
2036
|
+
applyForSources
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
|
|
2040
|
+
// src/internal/runtime/core/env.ts
|
|
1543
2041
|
var getNodeEnv = () => {
|
|
1544
2042
|
try {
|
|
1545
2043
|
const env = globalThis?.process?.env;
|
|
@@ -1549,17 +2047,40 @@ var getNodeEnv = () => {
|
|
|
1549
2047
|
}
|
|
1550
2048
|
};
|
|
1551
2049
|
var isDevEnv = () => getNodeEnv() !== "production";
|
|
1552
|
-
var StateTransactionConfigTagImpl = class extends
|
|
2050
|
+
var StateTransactionConfigTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/StateTransactionRuntimeConfig")() {
|
|
2051
|
+
};
|
|
2052
|
+
var ReadQueryStrictGateConfigTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/ReadQueryStrictGateRuntimeConfig")() {
|
|
2053
|
+
};
|
|
2054
|
+
var ReplayModeConfigTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/ReplayModeConfig")() {
|
|
1553
2055
|
};
|
|
1554
|
-
var
|
|
2056
|
+
var StateTransactionOverridesTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/StateTransactionOverrides")() {
|
|
1555
2057
|
};
|
|
1556
|
-
var
|
|
2058
|
+
var ConcurrencyPolicyTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/ConcurrencyPolicy")() {
|
|
1557
2059
|
};
|
|
1558
|
-
var
|
|
2060
|
+
var ConcurrencyPolicyOverridesTagImpl = class extends import_effect9.Context.Tag("@logixjs/core/ConcurrencyPolicyOverrides")() {
|
|
1559
2061
|
};
|
|
1560
|
-
var
|
|
2062
|
+
var RuntimeStoreTag = class extends import_effect9.Context.Tag("@logixjs/core/RuntimeStore")() {
|
|
1561
2063
|
};
|
|
1562
|
-
var
|
|
2064
|
+
var runtimeStoreLayer = import_effect9.Layer.scoped(
|
|
2065
|
+
RuntimeStoreTag,
|
|
2066
|
+
import_effect9.Effect.acquireRelease(
|
|
2067
|
+
import_effect9.Effect.sync(() => makeRuntimeStore()),
|
|
2068
|
+
(store) => import_effect9.Effect.sync(() => store.dispose())
|
|
2069
|
+
)
|
|
2070
|
+
);
|
|
2071
|
+
var HostSchedulerTag = class extends import_effect9.Context.Tag("@logixjs/core/HostScheduler")() {
|
|
2072
|
+
};
|
|
2073
|
+
var hostSchedulerLayer = import_effect9.Layer.succeed(
|
|
2074
|
+
HostSchedulerTag,
|
|
2075
|
+
getGlobalHostScheduler()
|
|
2076
|
+
);
|
|
2077
|
+
var DeclarativeLinkRuntimeTag = class extends import_effect9.Context.Tag("@logixjs/core/DeclarativeLinkRuntime")() {
|
|
2078
|
+
};
|
|
2079
|
+
var declarativeLinkRuntimeLayer = import_effect9.Layer.succeed(
|
|
2080
|
+
DeclarativeLinkRuntimeTag,
|
|
2081
|
+
makeDeclarativeLinkRuntime()
|
|
2082
|
+
);
|
|
2083
|
+
var TickSchedulerTag = class extends import_effect9.Context.Tag("@logixjs/core/TickScheduler")() {
|
|
1563
2084
|
};
|
|
1564
2085
|
|
|
1565
2086
|
// src/internal/debug/ModuleTraitsRegistry.ts
|
|
@@ -1629,13 +2150,13 @@ var startDevtoolsRun2 = startDevtoolsRun;
|
|
|
1629
2150
|
var setInstanceLabel2 = setInstanceLabel;
|
|
1630
2151
|
var getInstanceLabel2 = getInstanceLabel;
|
|
1631
2152
|
var exportEvidencePackage2 = (options) => exportDevtoolsEvidencePackage(options);
|
|
1632
|
-
var diagnosticsLevel = (level) =>
|
|
2153
|
+
var diagnosticsLevel = (level) => import_effect10.Layer.fiberRefLocallyScopedWith(currentDiagnosticsLevel, () => level);
|
|
1633
2154
|
var traitConvergeDiagnosticsSampling2 = (config) => traitConvergeDiagnosticsSampling(config);
|
|
1634
2155
|
var isDevtoolsEnabled2 = isDevtoolsEnabled;
|
|
1635
2156
|
var makeModuleRuntimeCounterSink = () => {
|
|
1636
2157
|
const counts = /* @__PURE__ */ new Map();
|
|
1637
2158
|
const sink = {
|
|
1638
|
-
record: (event) =>
|
|
2159
|
+
record: (event) => import_effect10.Effect.sync(() => {
|
|
1639
2160
|
if (event.type === "module:init") {
|
|
1640
2161
|
const moduleId = event.moduleId ?? "unknown";
|
|
1641
2162
|
const runtimeLabel2 = "runtimeLabel" in event && event.runtimeLabel ? event.runtimeLabel : "unknown";
|
|
@@ -1664,7 +2185,7 @@ var makeModuleRuntimeCounterSink = () => {
|
|
|
1664
2185
|
var makeRingBufferSink = (capacity = 1e3) => {
|
|
1665
2186
|
const buffer = [];
|
|
1666
2187
|
const sink = {
|
|
1667
|
-
record: (event) =>
|
|
2188
|
+
record: (event) => import_effect10.Effect.sync(() => {
|
|
1668
2189
|
if (capacity <= 0) {
|
|
1669
2190
|
return;
|
|
1670
2191
|
}
|
|
@@ -1704,21 +2225,21 @@ var layer = (options) => {
|
|
|
1704
2225
|
}
|
|
1705
2226
|
}
|
|
1706
2227
|
})();
|
|
1707
|
-
return diagnostics ?
|
|
2228
|
+
return diagnostics ? import_effect10.Layer.mergeAll(sinks, diagnosticsLevel(diagnostics)) : sinks;
|
|
1708
2229
|
};
|
|
1709
|
-
var withPrettyLogger = (base, options) =>
|
|
2230
|
+
var withPrettyLogger = (base, options) => import_effect10.Layer.merge(
|
|
1710
2231
|
base,
|
|
1711
|
-
|
|
2232
|
+
import_effect10.Logger.replace(import_effect10.Logger.defaultLogger, import_effect10.Logger.prettyLogger(options))
|
|
1712
2233
|
);
|
|
1713
|
-
var replace = (sinks) =>
|
|
1714
|
-
var appendSinks = (sinks) =>
|
|
2234
|
+
var replace = (sinks) => import_effect10.Layer.locallyScoped(internal.currentDebugSinks, sinks);
|
|
2235
|
+
var appendSinks = (sinks) => import_effect10.Layer.fiberRefLocallyScopedWith(currentDebugSinks, (current) => [
|
|
1715
2236
|
...current,
|
|
1716
2237
|
...sinks
|
|
1717
2238
|
]);
|
|
1718
2239
|
function devtoolsHubLayer(baseOrOptions, maybeOptions) {
|
|
1719
2240
|
const isLayerValue = (value) => typeof value === "object" && value !== null && "_op_layer" in value;
|
|
1720
2241
|
const hasBase = isLayerValue(baseOrOptions);
|
|
1721
|
-
const base = hasBase ? baseOrOptions :
|
|
2242
|
+
const base = hasBase ? baseOrOptions : import_effect10.Layer.empty;
|
|
1722
2243
|
const options = hasBase ? maybeOptions : baseOrOptions;
|
|
1723
2244
|
configureDevtoolsHub(options);
|
|
1724
2245
|
const append = appendSinks([devtoolsHubSink]);
|
|
@@ -1726,13 +2247,13 @@ function devtoolsHubLayer(baseOrOptions, maybeOptions) {
|
|
|
1726
2247
|
devtoolsHubConvergeStaticIrCollector
|
|
1727
2248
|
]);
|
|
1728
2249
|
const enableExportableDiagnostics = diagnosticsLevel(options?.diagnosticsLevel ?? "light");
|
|
1729
|
-
const convergeSamplingLayer = options?.traitConvergeDiagnosticsSampling ? traitConvergeDiagnosticsSampling2(options.traitConvergeDiagnosticsSampling) :
|
|
1730
|
-
return
|
|
1731
|
-
|
|
2250
|
+
const convergeSamplingLayer = options?.traitConvergeDiagnosticsSampling ? traitConvergeDiagnosticsSampling2(options.traitConvergeDiagnosticsSampling) : import_effect10.Layer.empty;
|
|
2251
|
+
return import_effect10.Layer.provideMerge(
|
|
2252
|
+
import_effect10.Layer.mergeAll(append, enableExportableDiagnostics, convergeSamplingLayer, appendConvergeStaticIr),
|
|
1732
2253
|
base
|
|
1733
2254
|
);
|
|
1734
2255
|
}
|
|
1735
|
-
var runtimeLabel = (label) =>
|
|
2256
|
+
var runtimeLabel = (label) => import_effect10.Layer.fiberRefLocallyScopedWith(internal.currentRuntimeLabel, () => label);
|
|
1736
2257
|
var getModuleTraits = (module2) => {
|
|
1737
2258
|
const moduleTag = module2.tag ? module2.tag : module2;
|
|
1738
2259
|
const program = getModuleTraitsProgram(moduleTag);
|
|
@@ -1777,13 +2298,13 @@ var getModuleFinalTraits = (runtime) => {
|
|
|
1777
2298
|
var isLayer = (value) => typeof value === "object" && value !== null && "_op_layer" in value;
|
|
1778
2299
|
function traceLayer(baseOrHandler, maybeOnTrace) {
|
|
1779
2300
|
const hasBase = isLayer(baseOrHandler);
|
|
1780
|
-
const base = hasBase ? baseOrHandler :
|
|
2301
|
+
const base = hasBase ? baseOrHandler : import_effect10.Layer.empty;
|
|
1781
2302
|
const onTrace = hasBase ? maybeOnTrace : baseOrHandler;
|
|
1782
2303
|
const traceSink = {
|
|
1783
|
-
record: (event) => typeof event.type === "string" && event.type.startsWith("trace:") ? onTrace ? onTrace(event) :
|
|
2304
|
+
record: (event) => typeof event.type === "string" && event.type.startsWith("trace:") ? onTrace ? onTrace(event) : import_effect10.Effect.logDebug({ traceEvent: event }) : import_effect10.Effect.void
|
|
1784
2305
|
};
|
|
1785
|
-
const appendTrace =
|
|
1786
|
-
return
|
|
2306
|
+
const appendTrace = import_effect10.Layer.fiberRefLocallyScopedWith(currentDebugSinks, (sinks) => [...sinks, traceSink]);
|
|
2307
|
+
return import_effect10.Layer.provideMerge(appendTrace, base);
|
|
1787
2308
|
}
|
|
1788
2309
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1789
2310
|
0 && (module.exports = {
|