@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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import 'effect';
|
|
2
|
+
import './module-doenaCsZ.cjs';
|
|
3
|
+
export { A as ActionTagsOfModule, I as InputExpr, K as KernelPorts, l as WithPolicyPatch, b as Workflow, i as WorkflowComposeResult, f as WorkflowDef, h as WorkflowFragment, j as WorkflowPart, d as WorkflowPolicy, g as WorkflowStaticIr, e as WorkflowStep, m as WorkflowStepsInput, c as WorkflowTrigger, y as call, x as callById, C as compose, s as constValue, w as delay, v as dispatch, k as forModule, z as fragment, E as fromJSON, D as make, u as merge, t as object, o as onAction, p as onInit, n as onStart, q as payload, r as payloadPath, B as withPolicy } from './Workflow-BlFG_20_.cjs';
|
|
4
|
+
import 'mutative';
|
|
5
|
+
import './Platform-C49Pv956.cjs';
|
|
6
|
+
import './action-DiMDD_0v.cjs';
|
|
7
|
+
import './ReadQuery-CafjlJQo.cjs';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import 'effect';
|
|
2
|
+
import './module-DqQ1U-Me.js';
|
|
3
|
+
export { A as ActionTagsOfModule, I as InputExpr, K as KernelPorts, l as WithPolicyPatch, b as Workflow, i as WorkflowComposeResult, f as WorkflowDef, h as WorkflowFragment, j as WorkflowPart, d as WorkflowPolicy, g as WorkflowStaticIr, e as WorkflowStep, m as WorkflowStepsInput, c as WorkflowTrigger, y as call, x as callById, C as compose, s as constValue, w as delay, v as dispatch, k as forModule, z as fragment, E as fromJSON, D as make, u as merge, t as object, o as onAction, p as onInit, n as onStart, q as payload, r as payloadPath, B as withPolicy } from './Workflow-CW9S_aAP.js';
|
|
4
|
+
import 'mutative';
|
|
5
|
+
import './Platform-C49Pv956.js';
|
|
6
|
+
import './action-DiMDD_0v.js';
|
|
7
|
+
import './ReadQuery-CafjlJQo.js';
|
package/dist/Workflow.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KernelPorts,
|
|
3
|
+
call,
|
|
4
|
+
callById,
|
|
5
|
+
compose,
|
|
6
|
+
constValue,
|
|
7
|
+
delay,
|
|
8
|
+
dispatch,
|
|
9
|
+
forModule,
|
|
10
|
+
fragment,
|
|
11
|
+
fromJSON,
|
|
12
|
+
make,
|
|
13
|
+
merge,
|
|
14
|
+
object,
|
|
15
|
+
onAction,
|
|
16
|
+
onInit,
|
|
17
|
+
onStart,
|
|
18
|
+
payload,
|
|
19
|
+
payloadPath,
|
|
20
|
+
withPolicy
|
|
21
|
+
} from "./chunk-GPBAZQ23.js";
|
|
22
|
+
import "./chunk-46FGVWRF.js";
|
|
23
|
+
import "./chunk-CCKP5Z6F.js";
|
|
24
|
+
import "./chunk-Y4VRBIS6.js";
|
|
25
|
+
import "./chunk-3VZYDNXZ.js";
|
|
26
|
+
import "./chunk-KLDVG3SY.js";
|
|
27
|
+
import "./chunk-AQ7L2QZ5.js";
|
|
28
|
+
import "./chunk-MYKNINNN.js";
|
|
29
|
+
import "./chunk-I4LCE5OY.js";
|
|
30
|
+
import "./chunk-ZC7MSQ5U.js";
|
|
31
|
+
import "./chunk-WYJUJV4L.js";
|
|
32
|
+
import "./chunk-4MZ7BT3R.js";
|
|
33
|
+
import "./chunk-PZ5AY32C.js";
|
|
34
|
+
export {
|
|
35
|
+
KernelPorts,
|
|
36
|
+
call,
|
|
37
|
+
callById,
|
|
38
|
+
compose,
|
|
39
|
+
constValue,
|
|
40
|
+
delay,
|
|
41
|
+
dispatch,
|
|
42
|
+
forModule,
|
|
43
|
+
fragment,
|
|
44
|
+
fromJSON,
|
|
45
|
+
make,
|
|
46
|
+
merge,
|
|
47
|
+
object,
|
|
48
|
+
onAction,
|
|
49
|
+
onInit,
|
|
50
|
+
onStart,
|
|
51
|
+
payload,
|
|
52
|
+
payloadPath,
|
|
53
|
+
withPolicy
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=Workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
layerFromContext,
|
|
3
3
|
resolve
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WWBMC24F.js";
|
|
5
5
|
import {
|
|
6
6
|
__export
|
|
7
7
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
layerFromContext2 as layerFromContext,
|
|
21
21
|
Root_exports
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-2A4UKO2D.js.map
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compile
|
|
3
|
+
} from "./chunk-53GVPGSM.js";
|
|
4
|
+
import {
|
|
5
|
+
attachExternalStoreDescriptor
|
|
6
|
+
} from "./chunk-MW4FA3MW.js";
|
|
7
|
+
import {
|
|
8
|
+
getGlobalHostScheduler
|
|
9
|
+
} from "./chunk-MYKNINNN.js";
|
|
10
|
+
import {
|
|
11
|
+
fnv1a32,
|
|
12
|
+
stableStringify
|
|
13
|
+
} from "./chunk-4MZ7BT3R.js";
|
|
14
|
+
import {
|
|
15
|
+
__export
|
|
16
|
+
} from "./chunk-PZ5AY32C.js";
|
|
17
|
+
|
|
18
|
+
// src/ExternalStore.ts
|
|
19
|
+
var ExternalStore_exports = {};
|
|
20
|
+
__export(ExternalStore_exports, {
|
|
21
|
+
fromModule: () => fromModule,
|
|
22
|
+
fromService: () => fromService,
|
|
23
|
+
fromStream: () => fromStream,
|
|
24
|
+
fromSubscriptionRef: () => fromSubscriptionRef
|
|
25
|
+
});
|
|
26
|
+
import { Effect, Fiber, Stream, SubscriptionRef } from "effect";
|
|
27
|
+
var makeError = (code, message) => Object.assign(new Error(message), { _tag: "ExternalStoreRuntimeError", code });
|
|
28
|
+
var hasOwn = (value, key) => !!value && typeof value === "object" && Object.prototype.hasOwnProperty.call(value, key);
|
|
29
|
+
var makeStoreId = (payload) => `es_${fnv1a32(stableStringify(payload))}`;
|
|
30
|
+
var defineDescriptor = (store, descriptor) => {
|
|
31
|
+
attachExternalStoreDescriptor(store, descriptor);
|
|
32
|
+
return store;
|
|
33
|
+
};
|
|
34
|
+
var makeNotifyScheduler = (listeners) => {
|
|
35
|
+
let scheduled = false;
|
|
36
|
+
return () => {
|
|
37
|
+
if (scheduled) return;
|
|
38
|
+
scheduled = true;
|
|
39
|
+
getGlobalHostScheduler().scheduleMicrotask(() => {
|
|
40
|
+
scheduled = false;
|
|
41
|
+
for (const listener of listeners) {
|
|
42
|
+
listener();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
var resolveTagId = (tag) => {
|
|
48
|
+
const id = tag.id;
|
|
49
|
+
if (typeof id === "string" && id.length > 0) return id;
|
|
50
|
+
const key = tag.key;
|
|
51
|
+
return typeof key === "string" && key.length > 0 ? key : void 0;
|
|
52
|
+
};
|
|
53
|
+
var resolveModuleIdOrThrow = (module) => {
|
|
54
|
+
if (module && typeof module === "object") {
|
|
55
|
+
const moduleId = module.moduleId;
|
|
56
|
+
if (typeof moduleId === "string" && moduleId.length > 0) return moduleId;
|
|
57
|
+
const id = module.id;
|
|
58
|
+
if (typeof id === "string" && id.length > 0) return id;
|
|
59
|
+
const tag = module.tag;
|
|
60
|
+
if (tag && (typeof tag === "object" || typeof tag === "function")) {
|
|
61
|
+
const tagId = tag.id;
|
|
62
|
+
if (typeof tagId === "string" && tagId.length > 0) return tagId;
|
|
63
|
+
}
|
|
64
|
+
const moduleTagId = module.id;
|
|
65
|
+
if (typeof moduleTagId === "string" && moduleTagId.length > 0) return moduleTagId;
|
|
66
|
+
}
|
|
67
|
+
throw makeError(
|
|
68
|
+
"external_store::unresolvable_module_id",
|
|
69
|
+
"[ExternalStore.fromModule] Failed to resolve moduleId.\nFix: pass a ModuleTag/Module/ModuleImpl/ModuleRuntime (has .id/.tag.id/.moduleId), not a read-only ModuleHandle."
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
var fromService = (tag, map) => {
|
|
73
|
+
const tagId = resolveTagId(tag);
|
|
74
|
+
if (!tagId) {
|
|
75
|
+
throw makeError(
|
|
76
|
+
"external_store::unresolved",
|
|
77
|
+
"[ExternalStore.fromService] Tag.id is missing; cannot build a stable storeId."
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
const storeId = makeStoreId({ kind: "service", tagId });
|
|
81
|
+
const store = {
|
|
82
|
+
getSnapshot: () => {
|
|
83
|
+
throw makeError(
|
|
84
|
+
"external_store::unresolved",
|
|
85
|
+
`[ExternalStore.fromService] Store is unresolved (tagId=${tagId}). Use it via StateTrait.externalStore install/runtime.`
|
|
86
|
+
);
|
|
87
|
+
},
|
|
88
|
+
subscribe: () => {
|
|
89
|
+
throw makeError(
|
|
90
|
+
"external_store::unresolved",
|
|
91
|
+
`[ExternalStore.fromService] Store is unresolved (tagId=${tagId}). Use it via StateTrait.externalStore install/runtime.`
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return defineDescriptor(store, { kind: "service", storeId, tagId, tag, map });
|
|
96
|
+
};
|
|
97
|
+
var nextAnonStoreSeq = 0;
|
|
98
|
+
var storeIdByRef = /* @__PURE__ */ new WeakMap();
|
|
99
|
+
var getOrAssignAnonStoreId = (key, prefix) => {
|
|
100
|
+
const existing = storeIdByRef.get(key);
|
|
101
|
+
if (existing) return existing;
|
|
102
|
+
nextAnonStoreSeq += 1;
|
|
103
|
+
const storeId = `${prefix}_u${nextAnonStoreSeq}`;
|
|
104
|
+
storeIdByRef.set(key, storeId);
|
|
105
|
+
return storeId;
|
|
106
|
+
};
|
|
107
|
+
var fromSubscriptionRef = (ref) => {
|
|
108
|
+
const storeId = getOrAssignAnonStoreId(ref, "es_ref");
|
|
109
|
+
let hasSnapshot = false;
|
|
110
|
+
let current;
|
|
111
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
112
|
+
const scheduleNotify = makeNotifyScheduler(listeners);
|
|
113
|
+
let fiber;
|
|
114
|
+
const ensureSubscription = () => {
|
|
115
|
+
if (fiber) return;
|
|
116
|
+
fiber = Effect.runFork(
|
|
117
|
+
Stream.runForEach(
|
|
118
|
+
ref.changes,
|
|
119
|
+
(value) => Effect.sync(() => {
|
|
120
|
+
current = value;
|
|
121
|
+
hasSnapshot = true;
|
|
122
|
+
scheduleNotify();
|
|
123
|
+
})
|
|
124
|
+
)
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
const refreshSnapshotIfStale = () => {
|
|
128
|
+
if (!hasSnapshot) return;
|
|
129
|
+
try {
|
|
130
|
+
const latest = Effect.runSync(SubscriptionRef.get(ref));
|
|
131
|
+
if (!Object.is(current, latest)) {
|
|
132
|
+
current = latest;
|
|
133
|
+
scheduleNotify();
|
|
134
|
+
}
|
|
135
|
+
} catch {
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const store = {
|
|
139
|
+
getSnapshot: () => {
|
|
140
|
+
if (hasSnapshot) return current;
|
|
141
|
+
current = Effect.runSync(SubscriptionRef.get(ref));
|
|
142
|
+
hasSnapshot = true;
|
|
143
|
+
return current;
|
|
144
|
+
},
|
|
145
|
+
subscribe: (listener) => {
|
|
146
|
+
listeners.add(listener);
|
|
147
|
+
ensureSubscription();
|
|
148
|
+
refreshSnapshotIfStale();
|
|
149
|
+
return () => {
|
|
150
|
+
listeners.delete(listener);
|
|
151
|
+
if (listeners.size > 0) return;
|
|
152
|
+
const running = fiber;
|
|
153
|
+
if (!running) return;
|
|
154
|
+
fiber = void 0;
|
|
155
|
+
Effect.runFork(Fiber.interrupt(running));
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
return defineDescriptor(store, { kind: "subscriptionRef", storeId, ref });
|
|
160
|
+
};
|
|
161
|
+
var fromStream = (stream, options) => {
|
|
162
|
+
const hasCurrent = hasOwn(options, "current");
|
|
163
|
+
const hasInitial = hasOwn(options, "initial");
|
|
164
|
+
if (!hasCurrent && !hasInitial) {
|
|
165
|
+
throw makeError(
|
|
166
|
+
"external_store::missing_initial",
|
|
167
|
+
"[ExternalStore.fromStream] Missing { initial } or { current } (Stream has no current snapshot)."
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
const initial = hasCurrent ? options.current : options.initial;
|
|
171
|
+
const initialHint = hasCurrent ? "current" : "initial";
|
|
172
|
+
const storeId = getOrAssignAnonStoreId(stream, "es_stream");
|
|
173
|
+
let current = initial;
|
|
174
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
175
|
+
const scheduleNotify = makeNotifyScheduler(listeners);
|
|
176
|
+
let fiber;
|
|
177
|
+
const ensureSubscription = () => {
|
|
178
|
+
if (fiber) return;
|
|
179
|
+
fiber = Effect.runFork(
|
|
180
|
+
Stream.runForEach(
|
|
181
|
+
stream,
|
|
182
|
+
(value) => Effect.sync(() => {
|
|
183
|
+
current = value;
|
|
184
|
+
scheduleNotify();
|
|
185
|
+
})
|
|
186
|
+
)
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
const store = {
|
|
190
|
+
getSnapshot: () => current,
|
|
191
|
+
subscribe: (listener) => {
|
|
192
|
+
listeners.add(listener);
|
|
193
|
+
ensureSubscription();
|
|
194
|
+
return () => {
|
|
195
|
+
listeners.delete(listener);
|
|
196
|
+
if (listeners.size > 0) return;
|
|
197
|
+
const running = fiber;
|
|
198
|
+
if (!running) return;
|
|
199
|
+
fiber = void 0;
|
|
200
|
+
Effect.runFork(Fiber.interrupt(running));
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
return defineDescriptor(store, { kind: "stream", storeId, stream, initial, initialHint });
|
|
205
|
+
};
|
|
206
|
+
var fromModule = (module, selector) => {
|
|
207
|
+
const moduleId = resolveModuleIdOrThrow(module);
|
|
208
|
+
const instanceId = module && typeof module === "object" && typeof module.instanceId === "string" && module.instanceId.length > 0 ? module.instanceId : void 0;
|
|
209
|
+
const compiled = compile(selector);
|
|
210
|
+
if (compiled.fallbackReason === "unstableSelectorId" || compiled.staticIr.fallbackReason === "unstableSelectorId") {
|
|
211
|
+
throw makeError(
|
|
212
|
+
"external_store::unstable_selector_id",
|
|
213
|
+
`[ExternalStore.fromModule] selectorId is unstable (fallbackReason=unstableSelectorId). Fix: add a stable debugKey, or pass an explicit ReadQuery (manual/static lane).`
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
const storeId = makeStoreId({ kind: "module", moduleId, selectorId: compiled.selectorId });
|
|
217
|
+
const store = {
|
|
218
|
+
getSnapshot: () => {
|
|
219
|
+
throw makeError(
|
|
220
|
+
"external_store::unresolved",
|
|
221
|
+
`[ExternalStore.fromModule] Store is unresolved (moduleId=${moduleId}, selectorId=${compiled.selectorId}). Use it via StateTrait.externalStore + TickScheduler/RuntimeStore (Module-as-Source).`
|
|
222
|
+
);
|
|
223
|
+
},
|
|
224
|
+
subscribe: () => {
|
|
225
|
+
throw makeError(
|
|
226
|
+
"external_store::unresolved",
|
|
227
|
+
`[ExternalStore.fromModule] Store is unresolved (moduleId=${moduleId}, selectorId=${compiled.selectorId}). Use it via StateTrait.externalStore + TickScheduler/RuntimeStore (Module-as-Source).`
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
return defineDescriptor(store, {
|
|
232
|
+
kind: "module",
|
|
233
|
+
storeId,
|
|
234
|
+
module,
|
|
235
|
+
moduleId,
|
|
236
|
+
...instanceId ? { instanceId } : {},
|
|
237
|
+
readQuery: compiled
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export {
|
|
242
|
+
fromService,
|
|
243
|
+
fromSubscriptionRef,
|
|
244
|
+
fromStream,
|
|
245
|
+
fromModule,
|
|
246
|
+
ExternalStore_exports
|
|
247
|
+
};
|
|
248
|
+
//# sourceMappingURL=chunk-2DE6D42I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ExternalStore.ts"],"sourcesContent":["import { Effect, Fiber, Stream, SubscriptionRef } from 'effect'\nimport type { Context } from 'effect'\nimport * as ReadQuery from './ReadQuery.js'\nimport { fnv1a32, stableStringify } from './internal/digest.js'\nimport { attachExternalStoreDescriptor, type ExternalStoreDescriptor } from './internal/external-store-descriptor.js'\nimport { getGlobalHostScheduler } from './internal/runtime/core/HostScheduler.js'\n\nexport type ExternalStore<T> = {\n readonly getSnapshot: () => T\n readonly getServerSnapshot?: () => T\n readonly subscribe: (listener: () => void) => () => void\n}\n\nexport interface ExternalStoreRuntimeError extends Error {\n readonly _tag: 'ExternalStoreRuntimeError'\n readonly code:\n | 'external_store::unresolved'\n | 'external_store::missing_initial'\n | 'external_store::unresolvable_module_id'\n | 'external_store::unstable_selector_id'\n}\n\nconst makeError = (code: ExternalStoreRuntimeError['code'], message: string): ExternalStoreRuntimeError =>\n Object.assign(new Error(message), { _tag: 'ExternalStoreRuntimeError' as const, code })\n\nconst hasOwn = (value: unknown, key: string): boolean =>\n !!value && typeof value === 'object' && Object.prototype.hasOwnProperty.call(value, key)\n\nconst makeStoreId = (payload: unknown): string => `es_${fnv1a32(stableStringify(payload))}`\n\nconst defineDescriptor = <T>(store: ExternalStore<T>, descriptor: ExternalStoreDescriptor): ExternalStore<T> => {\n attachExternalStoreDescriptor(store as object, descriptor)\n return store\n}\n\nconst makeNotifyScheduler = (listeners: Set<() => void>): (() => void) => {\n let scheduled = false\n return () => {\n if (scheduled) return\n scheduled = true\n getGlobalHostScheduler().scheduleMicrotask(() => {\n scheduled = false\n for (const listener of listeners) {\n listener()\n }\n })\n }\n}\n\nconst resolveTagId = (tag: Context.Tag<any, any>): string | undefined => {\n const id = (tag as any).id\n if (typeof id === 'string' && id.length > 0) return id\n\n const key = (tag as any).key\n return typeof key === 'string' && key.length > 0 ? key : undefined\n}\n\nconst resolveModuleIdOrThrow = (module: unknown): string => {\n if (module && typeof module === 'object') {\n const moduleId = (module as any).moduleId\n if (typeof moduleId === 'string' && moduleId.length > 0) return moduleId\n\n const id = (module as any).id\n if (typeof id === 'string' && id.length > 0) return id\n\n const tag = (module as any).tag\n if (tag && (typeof tag === 'object' || typeof tag === 'function')) {\n const tagId = (tag as any).id\n if (typeof tagId === 'string' && tagId.length > 0) return tagId\n }\n\n const moduleTagId = (module as any).id\n if (typeof moduleTagId === 'string' && moduleTagId.length > 0) return moduleTagId\n }\n\n throw makeError(\n 'external_store::unresolvable_module_id',\n '[ExternalStore.fromModule] Failed to resolve moduleId.\\n' +\n 'Fix: pass a ModuleTag/Module/ModuleImpl/ModuleRuntime (has .id/.tag.id/.moduleId), not a read-only ModuleHandle.',\n )\n}\n\n/**\n * Create an ExternalStore by resolving a service from the Effect Context.\n *\n * Notes:\n * - This sugar is intended to be used via `StateTrait.externalStore` (resolved during install/runtime).\n * - `map(service)` must return a sync `getSnapshot()` (no IO) and a `subscribe(listener)` that signals change.\n */\nexport const fromService = <Id, Svc, T>(\n tag: Context.Tag<Id, Svc>,\n map: (service: Svc) => ExternalStore<T>,\n): ExternalStore<T> => {\n const tagId = resolveTagId(tag as any)\n if (!tagId) {\n throw makeError(\n 'external_store::unresolved',\n '[ExternalStore.fromService] Tag.id is missing; cannot build a stable storeId.',\n )\n }\n\n const storeId = makeStoreId({ kind: 'service', tagId })\n\n const store: ExternalStore<T> = {\n getSnapshot: () => {\n throw makeError(\n 'external_store::unresolved',\n `[ExternalStore.fromService] Store is unresolved (tagId=${tagId}). Use it via StateTrait.externalStore install/runtime.`,\n )\n },\n subscribe: () => {\n throw makeError(\n 'external_store::unresolved',\n `[ExternalStore.fromService] Store is unresolved (tagId=${tagId}). Use it via StateTrait.externalStore install/runtime.`,\n )\n },\n }\n\n return defineDescriptor(store, { kind: 'service', storeId, tagId, tag: tag as any, map: map as any })\n}\n\nlet nextAnonStoreSeq = 0\nconst storeIdByRef = new WeakMap<object, string>()\n\nconst getOrAssignAnonStoreId = (key: object, prefix: string): string => {\n const existing = storeIdByRef.get(key)\n if (existing) return existing\n nextAnonStoreSeq += 1\n const storeId = `${prefix}_u${nextAnonStoreSeq}`\n storeIdByRef.set(key, storeId)\n return storeId\n}\n\n/**\n * Create an ExternalStore from a SubscriptionRef.\n *\n * Notes:\n * - `getSnapshot()` is implemented via `SubscriptionRef.get(ref)` (must be a synchronous pure read; do not hide IO inside).\n * - change notifications are batched via microtask (multiple updates in the same microtask trigger a single notify).\n */\nexport const fromSubscriptionRef = <T>(ref: SubscriptionRef.SubscriptionRef<T>): ExternalStore<T> => {\n const storeId = getOrAssignAnonStoreId(ref as any, 'es_ref')\n\n let hasSnapshot = false\n let current: T | undefined\n const listeners = new Set<() => void>()\n const scheduleNotify = makeNotifyScheduler(listeners)\n\n let fiber: Fiber.Fiber<void, any> | undefined\n\n const ensureSubscription = () => {\n if (fiber) return\n fiber = Effect.runFork(\n Stream.runForEach(ref.changes, (value) =>\n Effect.sync(() => {\n current = value\n hasSnapshot = true\n scheduleNotify()\n }),\n ),\n )\n }\n\n const refreshSnapshotIfStale = () => {\n if (!hasSnapshot) return\n try {\n const latest = Effect.runSync(SubscriptionRef.get(ref)) as T\n if (!Object.is(current, latest)) {\n current = latest\n scheduleNotify()\n }\n } catch {\n // best-effort\n }\n }\n\n const store: ExternalStore<T> = {\n getSnapshot: () => {\n if (hasSnapshot) return current as T\n current = Effect.runSync(SubscriptionRef.get(ref)) as T\n hasSnapshot = true\n return current\n },\n subscribe: (listener) => {\n listeners.add(listener)\n ensureSubscription()\n refreshSnapshotIfStale()\n return () => {\n listeners.delete(listener)\n if (listeners.size > 0) return\n const running = fiber\n if (!running) return\n fiber = undefined\n Effect.runFork(Fiber.interrupt(running))\n }\n },\n }\n\n return defineDescriptor(store, { kind: 'subscriptionRef', storeId, ref: ref as any })\n}\n\n/**\n * Create an ExternalStore from a Stream.\n *\n * Notes:\n * - Stream has no synchronous \"current\" snapshot; you MUST provide `{ initial }` (or `{ current }`).\n * - `{ initial }` may be stale if the stream already emitted before subscription; prefer `fromService/fromSubscriptionRef` for reliable current.\n */\nexport const fromStream = <A, E>(\n stream: Stream.Stream<A, E, never>,\n options?: { readonly initial?: A; readonly current?: A },\n): ExternalStore<A> => {\n const hasCurrent = hasOwn(options, 'current')\n const hasInitial = hasOwn(options, 'initial')\n\n if (!hasCurrent && !hasInitial) {\n throw makeError(\n 'external_store::missing_initial',\n '[ExternalStore.fromStream] Missing { initial } or { current } (Stream has no current snapshot).',\n )\n }\n\n const initial = hasCurrent ? (options as any).current : (options as any).initial\n const initialHint = hasCurrent ? ('current' as const) : ('initial' as const)\n\n const storeId = getOrAssignAnonStoreId(stream as any, 'es_stream')\n\n let current = initial as A\n const listeners = new Set<() => void>()\n const scheduleNotify = makeNotifyScheduler(listeners)\n\n let fiber: Fiber.Fiber<void, any> | undefined\n\n const ensureSubscription = () => {\n if (fiber) return\n fiber = Effect.runFork(\n Stream.runForEach(stream, (value) =>\n Effect.sync(() => {\n current = value\n scheduleNotify()\n }),\n ),\n )\n }\n\n const store: ExternalStore<A> = {\n getSnapshot: () => current,\n subscribe: (listener) => {\n listeners.add(listener)\n ensureSubscription()\n return () => {\n listeners.delete(listener)\n if (listeners.size > 0) return\n const running = fiber\n if (!running) return\n fiber = undefined\n Effect.runFork(Fiber.interrupt(running))\n }\n },\n }\n\n return defineDescriptor(store, { kind: 'stream', storeId, stream: stream as any, initial, initialHint })\n}\n\n/**\n * Module-as-Source: treat a module selector as an ExternalStore source (IR-recognizable dependency).\n *\n * Notes:\n * - `moduleId` must be resolvable; passing a read-only `ModuleHandle` is forbidden (fail-fast).\n * - selectorId must be stable: `ReadQuery.compile(selector)` must NOT fall back to `fallbackReason=\"unstableSelectorId\"` (fail-fast).\n * - Value semantics: the runtime does not clone; writeback stores the selector return value as-is (keep selectors small and stable).\n */\nexport const fromModule = <S, V>(module: unknown, selector: ReadQuery.ReadQueryInput<S, V>): ExternalStore<V> => {\n const moduleId = resolveModuleIdOrThrow(module)\n const instanceId =\n module && typeof module === 'object' && typeof (module as any).instanceId === 'string' && (module as any).instanceId.length > 0\n ? ((module as any).instanceId as string)\n : undefined\n const compiled = ReadQuery.compile(selector)\n\n if (compiled.fallbackReason === 'unstableSelectorId' || compiled.staticIr.fallbackReason === 'unstableSelectorId') {\n throw makeError(\n 'external_store::unstable_selector_id',\n `[ExternalStore.fromModule] selectorId is unstable (fallbackReason=unstableSelectorId). ` +\n 'Fix: add a stable debugKey, or pass an explicit ReadQuery (manual/static lane).',\n )\n }\n\n const storeId = makeStoreId({ kind: 'module', moduleId, selectorId: compiled.selectorId })\n\n const store: ExternalStore<V> = {\n getSnapshot: () => {\n throw makeError(\n 'external_store::unresolved',\n `[ExternalStore.fromModule] Store is unresolved (moduleId=${moduleId}, selectorId=${compiled.selectorId}). ` +\n 'Use it via StateTrait.externalStore + TickScheduler/RuntimeStore (Module-as-Source).',\n )\n },\n subscribe: () => {\n throw makeError(\n 'external_store::unresolved',\n `[ExternalStore.fromModule] Store is unresolved (moduleId=${moduleId}, selectorId=${compiled.selectorId}). ` +\n 'Use it via StateTrait.externalStore + TickScheduler/RuntimeStore (Module-as-Source).',\n )\n },\n }\n\n return defineDescriptor(store, {\n kind: 'module',\n storeId,\n module,\n moduleId,\n ...(instanceId ? { instanceId } : {}),\n readQuery: compiled,\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,QAAQ,OAAO,QAAQ,uBAAuB;AAsBvD,IAAM,YAAY,CAAC,MAAyC,YAC1D,OAAO,OAAO,IAAI,MAAM,OAAO,GAAG,EAAE,MAAM,6BAAsC,KAAK,CAAC;AAExF,IAAM,SAAS,CAAC,OAAgB,QAC9B,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,OAAO,UAAU,eAAe,KAAK,OAAO,GAAG;AAEzF,IAAM,cAAc,CAAC,YAA6B,MAAM,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 -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ReplayLog,
|
|
3
3
|
unsetAtPathMutating
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
inSyncTransactionFiber
|
|
7
|
-
} from "./chunk-ZFLHVFUC.js";
|
|
4
|
+
} from "./chunk-KSZQYSEH.js";
|
|
8
5
|
import {
|
|
9
6
|
getBoundInternals,
|
|
10
7
|
getModuleTraitsProgram
|
|
11
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KLDVG3SY.js";
|
|
9
|
+
import {
|
|
10
|
+
inSyncTransactionFiber
|
|
11
|
+
} from "./chunk-AQ7L2QZ5.js";
|
|
12
12
|
import {
|
|
13
13
|
__export
|
|
14
14
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -282,4 +282,4 @@ export {
|
|
|
282
282
|
install2 as install,
|
|
283
283
|
TraitLifecycle_exports
|
|
284
284
|
};
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-2DVLMSOE.js.map
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
forceSourceRefresh,
|
|
3
|
-
inSyncTransactionFiber,
|
|
4
|
-
makeTaskRunner
|
|
5
|
-
} from "./chunk-ZFLHVFUC.js";
|
|
6
1
|
import {
|
|
7
2
|
Tag
|
|
8
3
|
} from "./chunk-KL5ACTCT.js";
|
|
9
4
|
import {
|
|
10
5
|
resolve
|
|
11
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WWBMC24F.js";
|
|
12
7
|
import {
|
|
13
8
|
makeMatch,
|
|
14
9
|
makeMatchTag
|
|
@@ -18,25 +13,28 @@ import {
|
|
|
18
13
|
} from "./chunk-YS3AZQ2G.js";
|
|
19
14
|
import {
|
|
20
15
|
isFieldPathSegment
|
|
21
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZTFTABXV.js";
|
|
22
17
|
import {
|
|
23
18
|
getRuntimeInternals,
|
|
24
19
|
setBoundInternals
|
|
25
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KLDVG3SY.js";
|
|
26
21
|
import {
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
forceSourceRefresh,
|
|
23
|
+
inSyncTransactionFiber,
|
|
24
|
+
isDevEnv,
|
|
25
|
+
makeTaskRunner
|
|
26
|
+
} from "./chunk-AQ7L2QZ5.js";
|
|
29
27
|
import {
|
|
30
28
|
make
|
|
31
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-PVZEMNJY.js";
|
|
30
|
+
import {
|
|
31
|
+
RunSessionTag
|
|
32
|
+
} from "./chunk-I4LCE5OY.js";
|
|
32
33
|
import {
|
|
33
34
|
currentDiagnosticsLevel,
|
|
34
35
|
record,
|
|
35
36
|
toSerializableErrorSummary
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import {
|
|
38
|
-
RunSessionTag
|
|
39
|
-
} from "./chunk-OFADUJWJ.js";
|
|
37
|
+
} from "./chunk-ZC7MSQ5U.js";
|
|
40
38
|
|
|
41
39
|
// src/internal/runtime/core/mutativePatches.ts
|
|
42
40
|
import { create } from "mutative";
|
|
@@ -1096,4 +1094,4 @@ export {
|
|
|
1096
1094
|
emitInvalidPhaseDiagnosticIfNeeded,
|
|
1097
1095
|
make2 as make
|
|
1098
1096
|
};
|
|
1099
|
-
//# sourceMappingURL=chunk-
|
|
1097
|
+
//# sourceMappingURL=chunk-34CF6OGE.js.map
|