@logixjs/core 0.0.1
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/dist/Action-BkRHy2vg.d.cts +10 -0
- package/dist/Action-mqVvtEHt.d.ts +10 -0
- package/dist/Action.cjs +57 -0
- package/dist/Action.cjs.map +1 -0
- package/dist/Action.d.cts +2 -0
- package/dist/Action.d.ts +2 -0
- package/dist/Action.js +9 -0
- package/dist/Action.js.map +1 -0
- package/dist/Actions-AsQ07yTP.d.cts +22 -0
- package/dist/Actions-AsQ07yTP.d.ts +22 -0
- package/dist/Actions.cjs +19 -0
- package/dist/Actions.cjs.map +1 -0
- package/dist/Actions.d.cts +2 -0
- package/dist/Actions.d.ts +2 -0
- package/dist/Actions.js +2 -0
- package/dist/Actions.js.map +1 -0
- package/dist/Bound-BN1DQ_lM.d.ts +23 -0
- package/dist/Bound-BPIfH9SS.d.cts +23 -0
- package/dist/Bound.cjs +1532 -0
- package/dist/Bound.cjs.map +1 -0
- package/dist/Bound.d.cts +7 -0
- package/dist/Bound.d.ts +7 -0
- package/dist/Bound.js +25 -0
- package/dist/Bound.js.map +1 -0
- package/dist/Debug-B5q5Bkzx.d.ts +320 -0
- package/dist/Debug-Bq8Sqjcr.d.cts +320 -0
- package/dist/Debug.cjs +1821 -0
- package/dist/Debug.cjs.map +1 -0
- package/dist/Debug.d.cts +13 -0
- package/dist/Debug.d.ts +13 -0
- package/dist/Debug.js +76 -0
- package/dist/Debug.js.map +1 -0
- package/dist/EffectOp.cjs +169 -0
- package/dist/EffectOp.cjs.map +1 -0
- package/dist/EffectOp.d.cts +118 -0
- package/dist/EffectOp.d.ts +118 -0
- package/dist/EffectOp.js +28 -0
- package/dist/EffectOp.js.map +1 -0
- package/dist/Env-DuJ6JrU2.d.cts +10 -0
- package/dist/Env-DuJ6JrU2.d.ts +10 -0
- package/dist/Env.cjs +60 -0
- package/dist/Env.cjs.map +1 -0
- package/dist/Env.d.cts +1 -0
- package/dist/Env.d.ts +1 -0
- package/dist/Env.js +11 -0
- package/dist/Env.js.map +1 -0
- package/dist/Flow-1fZT8MpX.d.cts +152 -0
- package/dist/Flow-BhpjE22E.d.ts +152 -0
- package/dist/Flow.cjs +504 -0
- package/dist/Flow.cjs.map +1 -0
- package/dist/Flow.d.cts +8 -0
- package/dist/Flow.d.ts +8 -0
- package/dist/Flow.js +15 -0
- package/dist/Flow.js.map +1 -0
- package/dist/Handle-D8D1zPb_.d.cts +30 -0
- package/dist/Handle-D_cLW1Z3.d.ts +30 -0
- package/dist/Handle.cjs +42 -0
- package/dist/Handle.cjs.map +1 -0
- package/dist/Handle.d.cts +7 -0
- package/dist/Handle.d.ts +7 -0
- package/dist/Handle.js +10 -0
- package/dist/Handle.js.map +1 -0
- package/dist/Kernel-8kC-jOda.d.cts +171 -0
- package/dist/Kernel-CnGE1Fyk.d.ts +171 -0
- package/dist/Kernel.cjs +284 -0
- package/dist/Kernel.cjs.map +1 -0
- package/dist/Kernel.d.cts +14 -0
- package/dist/Kernel.d.ts +14 -0
- package/dist/Kernel.js +36 -0
- package/dist/Kernel.js.map +1 -0
- package/dist/Link-Db7975nU.d.ts +45 -0
- package/dist/Link-fX8x1eCK.d.cts +45 -0
- package/dist/Link.cjs +542 -0
- package/dist/Link.cjs.map +1 -0
- package/dist/Link.d.cts +7 -0
- package/dist/Link.d.ts +7 -0
- package/dist/Link.js +35 -0
- package/dist/Link.js.map +1 -0
- package/dist/Logic-BRjEMr-W.d.ts +38 -0
- package/dist/Logic-DRh4sDZj.d.cts +38 -0
- package/dist/Logic.cjs +37 -0
- package/dist/Logic.cjs.map +1 -0
- package/dist/Logic.d.cts +7 -0
- package/dist/Logic.d.ts +7 -0
- package/dist/Logic.js +10 -0
- package/dist/Logic.js.map +1 -0
- package/dist/MatchBuilder-0QOc-nlU.d.ts +14 -0
- package/dist/MatchBuilder-CJk5oCkR.d.cts +14 -0
- package/dist/MatchBuilder.cjs +85 -0
- package/dist/MatchBuilder.cjs.map +1 -0
- package/dist/MatchBuilder.d.cts +8 -0
- package/dist/MatchBuilder.d.ts +8 -0
- package/dist/MatchBuilder.js +11 -0
- package/dist/MatchBuilder.js.map +1 -0
- package/dist/Middleware.cjs +411 -0
- package/dist/Middleware.cjs.map +1 -0
- package/dist/Middleware.d.cts +88 -0
- package/dist/Middleware.d.ts +88 -0
- package/dist/Middleware.js +27 -0
- package/dist/Middleware.js.map +1 -0
- package/dist/Module-B_0xRDMR.d.cts +203 -0
- package/dist/Module-DnzluX2J.d.ts +203 -0
- package/dist/Module.cjs +13512 -0
- package/dist/Module.cjs.map +1 -0
- package/dist/Module.d.cts +8 -0
- package/dist/Module.d.ts +8 -0
- package/dist/Module.js +53 -0
- package/dist/Module.js.map +1 -0
- package/dist/ModuleTag-C8FHY_sY.d.ts +93 -0
- package/dist/ModuleTag-EGbgBMpZ.d.cts +93 -0
- package/dist/ModuleTag.cjs +12231 -0
- package/dist/ModuleTag.cjs.map +1 -0
- package/dist/ModuleTag.d.cts +8 -0
- package/dist/ModuleTag.d.ts +8 -0
- package/dist/ModuleTag.js +39 -0
- package/dist/ModuleTag.js.map +1 -0
- package/dist/Observability-COqEvp2C.d.cts +713 -0
- package/dist/Observability-cY4kLn0S.d.ts +713 -0
- package/dist/Observability.cjs +5865 -0
- package/dist/Observability.cjs.map +1 -0
- package/dist/Observability.d.cts +9 -0
- package/dist/Observability.d.ts +9 -0
- package/dist/Observability.js +41 -0
- package/dist/Observability.js.map +1 -0
- package/dist/Platform-C49Pv956.d.cts +21 -0
- package/dist/Platform-C49Pv956.d.ts +21 -0
- package/dist/Platform-CHX8o-U4.d.ts +51 -0
- package/dist/Platform-CVlv0xLQ.d.cts +51 -0
- package/dist/Platform.cjs +58 -0
- package/dist/Platform.cjs.map +1 -0
- package/dist/Platform.d.cts +4 -0
- package/dist/Platform.d.ts +4 -0
- package/dist/Platform.js +15 -0
- package/dist/Platform.js.map +1 -0
- package/dist/Process-CM9xbMdP.d.ts +92 -0
- package/dist/Process-mL8fHDSB.d.cts +92 -0
- package/dist/Process.cjs +575 -0
- package/dist/Process.cjs.map +1 -0
- package/dist/Process.d.cts +8 -0
- package/dist/Process.d.ts +8 -0
- package/dist/Process.js +42 -0
- package/dist/Process.js.map +1 -0
- package/dist/ReadQuery-BlMwhe-F.d.ts +30 -0
- package/dist/ReadQuery-CL5XlXts.d.cts +30 -0
- package/dist/ReadQuery-SinbStGF.d.cts +38 -0
- package/dist/ReadQuery-SinbStGF.d.ts +38 -0
- package/dist/ReadQuery.cjs +377 -0
- package/dist/ReadQuery.cjs.map +1 -0
- package/dist/ReadQuery.d.cts +2 -0
- package/dist/ReadQuery.d.ts +2 -0
- package/dist/ReadQuery.js +14 -0
- package/dist/ReadQuery.js.map +1 -0
- package/dist/Reflection-CQnKwPXj.d.ts +182 -0
- package/dist/Reflection-Kabo1mlU.d.cts +182 -0
- package/dist/Reflection.cjs +2954 -0
- package/dist/Reflection.cjs.map +1 -0
- package/dist/Reflection.d.cts +17 -0
- package/dist/Reflection.d.ts +17 -0
- package/dist/Reflection.js +40 -0
- package/dist/Reflection.js.map +1 -0
- package/dist/Resource-Dy1xD_DG.d.cts +75 -0
- package/dist/Resource-Dy1xD_DG.d.ts +75 -0
- package/dist/Resource.cjs +166 -0
- package/dist/Resource.cjs.map +1 -0
- package/dist/Resource.d.cts +3 -0
- package/dist/Resource.d.ts +3 -0
- package/dist/Resource.js +21 -0
- package/dist/Resource.js.map +1 -0
- package/dist/Root-7ADUMk4t.d.cts +29 -0
- package/dist/Root-7ADUMk4t.d.ts +29 -0
- package/dist/Root.cjs +125 -0
- package/dist/Root.cjs.map +1 -0
- package/dist/Root.d.cts +4 -0
- package/dist/Root.d.ts +4 -0
- package/dist/Root.js +12 -0
- package/dist/Root.js.map +1 -0
- package/dist/Runtime-B-aL-f29.d.cts +274 -0
- package/dist/Runtime-CtyzZG4i.d.ts +274 -0
- package/dist/Runtime.cjs +5740 -0
- package/dist/Runtime.cjs.map +1 -0
- package/dist/Runtime.d.cts +19 -0
- package/dist/Runtime.d.ts +19 -0
- package/dist/Runtime.js +62 -0
- package/dist/Runtime.js.map +1 -0
- package/dist/ScopeRegistry-D1owDNSm.d.cts +61 -0
- package/dist/ScopeRegistry-D1owDNSm.d.ts +61 -0
- package/dist/ScopeRegistry.cjs +152 -0
- package/dist/ScopeRegistry.cjs.map +1 -0
- package/dist/ScopeRegistry.d.cts +2 -0
- package/dist/ScopeRegistry.d.ts +2 -0
- package/dist/ScopeRegistry.js +16 -0
- package/dist/ScopeRegistry.js.map +1 -0
- package/dist/State-CU50R26M.d.cts +19 -0
- package/dist/State-CU50R26M.d.ts +19 -0
- package/dist/State.cjs +19 -0
- package/dist/State.cjs.map +1 -0
- package/dist/State.d.cts +2 -0
- package/dist/State.d.ts +2 -0
- package/dist/State.js +2 -0
- package/dist/State.js.map +1 -0
- package/dist/StateTrait-BGsZghTz.d.ts +122 -0
- package/dist/StateTrait-OWhbj12c.d.cts +122 -0
- package/dist/StateTrait.cjs +2737 -0
- package/dist/StateTrait.cjs.map +1 -0
- package/dist/StateTrait.d.cts +9 -0
- package/dist/StateTrait.d.ts +9 -0
- package/dist/StateTrait.js +39 -0
- package/dist/StateTrait.js.map +1 -0
- package/dist/TraitLifecycle-CwV5WPFX.d.cts +88 -0
- package/dist/TraitLifecycle-LdIWmKlg.d.ts +88 -0
- package/dist/TraitLifecycle.cjs +581 -0
- package/dist/TraitLifecycle.cjs.map +1 -0
- package/dist/TraitLifecycle.d.cts +8 -0
- package/dist/TraitLifecycle.d.ts +8 -0
- package/dist/TraitLifecycle.js +24 -0
- package/dist/TraitLifecycle.js.map +1 -0
- package/dist/action-DiMDD_0v.d.cts +35 -0
- package/dist/action-DiMDD_0v.d.ts +35 -0
- package/dist/chunk-24VULZ7A.js +76 -0
- package/dist/chunk-24VULZ7A.js.map +1 -0
- package/dist/chunk-3IYZ5IGG.js +17 -0
- package/dist/chunk-3IYZ5IGG.js.map +1 -0
- package/dist/chunk-3QMIVH35.js +43 -0
- package/dist/chunk-3QMIVH35.js.map +1 -0
- package/dist/chunk-3RMKLXHX.js +83 -0
- package/dist/chunk-3RMKLXHX.js.map +1 -0
- package/dist/chunk-3TMODYZV.js +111 -0
- package/dist/chunk-3TMODYZV.js.map +1 -0
- package/dist/chunk-3VG5TWQR.js +27 -0
- package/dist/chunk-3VG5TWQR.js.map +1 -0
- package/dist/chunk-4CQAV7YB.js +37 -0
- package/dist/chunk-4CQAV7YB.js.map +1 -0
- package/dist/chunk-4SO6JMZL.js +7 -0
- package/dist/chunk-4SO6JMZL.js.map +1 -0
- package/dist/chunk-66ALHVEX.js +40 -0
- package/dist/chunk-66ALHVEX.js.map +1 -0
- package/dist/chunk-76WT3HOR.js +397 -0
- package/dist/chunk-76WT3HOR.js.map +1 -0
- package/dist/chunk-ANLBCBDC.js +285 -0
- package/dist/chunk-ANLBCBDC.js.map +1 -0
- package/dist/chunk-AUIR5O6W.js +75 -0
- package/dist/chunk-AUIR5O6W.js.map +1 -0
- package/dist/chunk-BABLDP24.js +445 -0
- package/dist/chunk-BABLDP24.js.map +1 -0
- package/dist/chunk-BE3HW4FY.js +1099 -0
- package/dist/chunk-BE3HW4FY.js.map +1 -0
- package/dist/chunk-BZ2SHDN2.js +54 -0
- package/dist/chunk-BZ2SHDN2.js.map +1 -0
- package/dist/chunk-CW6T36TN.js +393 -0
- package/dist/chunk-CW6T36TN.js.map +1 -0
- package/dist/chunk-DFNM3WX2.js +632 -0
- package/dist/chunk-DFNM3WX2.js.map +1 -0
- package/dist/chunk-DMBALCE2.js +1034 -0
- package/dist/chunk-DMBALCE2.js.map +1 -0
- package/dist/chunk-EGK3KN7B.js +406 -0
- package/dist/chunk-EGK3KN7B.js.map +1 -0
- package/dist/chunk-EY4NZKDR.js +19 -0
- package/dist/chunk-EY4NZKDR.js.map +1 -0
- package/dist/chunk-G5ZBFPNU.js +23 -0
- package/dist/chunk-G5ZBFPNU.js.map +1 -0
- package/dist/chunk-GMPEOUP2.js +31 -0
- package/dist/chunk-GMPEOUP2.js.map +1 -0
- package/dist/chunk-IHVBV5C2.js +279 -0
- package/dist/chunk-IHVBV5C2.js.map +1 -0
- package/dist/chunk-IPF7E66P.js +23 -0
- package/dist/chunk-IPF7E66P.js.map +1 -0
- package/dist/chunk-JCXGZRMU.js +204 -0
- package/dist/chunk-JCXGZRMU.js.map +1 -0
- package/dist/chunk-JGIWG6SR.js +6359 -0
- package/dist/chunk-JGIWG6SR.js.map +1 -0
- package/dist/chunk-JWOYLO27.js +241 -0
- package/dist/chunk-JWOYLO27.js.map +1 -0
- package/dist/chunk-KIXAU3GM.js +137 -0
- package/dist/chunk-KIXAU3GM.js.map +1 -0
- package/dist/chunk-KL5ACTCT.js +8 -0
- package/dist/chunk-KL5ACTCT.js.map +1 -0
- package/dist/chunk-KP7MUZNX.js +83 -0
- package/dist/chunk-KP7MUZNX.js.map +1 -0
- package/dist/chunk-LEU6UA5J.js +1 -0
- package/dist/chunk-LEU6UA5J.js.map +1 -0
- package/dist/chunk-M2RGJPXX.js +35 -0
- package/dist/chunk-M2RGJPXX.js.map +1 -0
- package/dist/chunk-M3BFQ7HK.js +13 -0
- package/dist/chunk-M3BFQ7HK.js.map +1 -0
- package/dist/chunk-M3WTHJHJ.js +1051 -0
- package/dist/chunk-M3WTHJHJ.js.map +1 -0
- package/dist/chunk-M7IYCTJV.js +79 -0
- package/dist/chunk-M7IYCTJV.js.map +1 -0
- package/dist/chunk-NBD3KUOZ.js +838 -0
- package/dist/chunk-NBD3KUOZ.js.map +1 -0
- package/dist/chunk-NQZ2OSGR.js +151 -0
- package/dist/chunk-NQZ2OSGR.js.map +1 -0
- package/dist/chunk-NZJKFF45.js +106 -0
- package/dist/chunk-NZJKFF45.js.map +1 -0
- package/dist/chunk-OFADUJWJ.js +175 -0
- package/dist/chunk-OFADUJWJ.js.map +1 -0
- package/dist/chunk-OGWBVHB3.js +461 -0
- package/dist/chunk-OGWBVHB3.js.map +1 -0
- package/dist/chunk-PAYXCY6A.js +1696 -0
- package/dist/chunk-PAYXCY6A.js.map +1 -0
- package/dist/chunk-PYOE4VSI.js +1924 -0
- package/dist/chunk-PYOE4VSI.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-QCHIQWAJ.js +21 -0
- package/dist/chunk-QCHIQWAJ.js.map +1 -0
- package/dist/chunk-QMM6O4CD.js +71 -0
- package/dist/chunk-QMM6O4CD.js.map +1 -0
- package/dist/chunk-RNFE3ML2.js +22 -0
- package/dist/chunk-RNFE3ML2.js.map +1 -0
- package/dist/chunk-TAAPQVZN.js +23 -0
- package/dist/chunk-TAAPQVZN.js.map +1 -0
- package/dist/chunk-THATMZXD.js +21 -0
- package/dist/chunk-THATMZXD.js.map +1 -0
- package/dist/chunk-TKZ7MEIA.js +27 -0
- package/dist/chunk-TKZ7MEIA.js.map +1 -0
- package/dist/chunk-TQOBJYDP.js +7 -0
- package/dist/chunk-TQOBJYDP.js.map +1 -0
- package/dist/chunk-VZB726PE.js +93 -0
- package/dist/chunk-VZB726PE.js.map +1 -0
- package/dist/chunk-W3TEWHLO.js +568 -0
- package/dist/chunk-W3TEWHLO.js.map +1 -0
- package/dist/chunk-YS3AZQ2G.js +52 -0
- package/dist/chunk-YS3AZQ2G.js.map +1 -0
- package/dist/chunk-ZDTRWK5F.js +40 -0
- package/dist/chunk-ZDTRWK5F.js.map +1 -0
- package/dist/chunk-ZFLHVFUC.js +192 -0
- package/dist/chunk-ZFLHVFUC.js.map +1 -0
- package/dist/chunk-ZFY7U2FR.js +133 -0
- package/dist/chunk-ZFY7U2FR.js.map +1 -0
- package/dist/chunk-ZGDVUPTM.js +270 -0
- package/dist/chunk-ZGDVUPTM.js.map +1 -0
- package/dist/index.cjs +19700 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +195 -0
- package/dist/index.d.ts +195 -0
- package/dist/index.js +286 -0
- package/dist/index.js.map +1 -0
- package/dist/ir-BMP7yxJJ.d.cts +39 -0
- package/dist/ir-DUOz6H-5.d.ts +39 -0
- package/dist/module-B8CBqIZ_.d.cts +1191 -0
- package/dist/module-k7m3txak.d.ts +1191 -0
- package/dist/protocol-g_1897M2.d.cts +127 -0
- package/dist/protocol-g_1897M2.d.ts +127 -0
- package/package.json +162 -0
|
@@ -0,0 +1,838 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layer as layer2
|
|
3
|
+
} from "./chunk-3TMODYZV.js";
|
|
4
|
+
import {
|
|
5
|
+
withDebug
|
|
6
|
+
} from "./chunk-QMM6O4CD.js";
|
|
7
|
+
import {
|
|
8
|
+
getRuntimeByModuleAndInstance,
|
|
9
|
+
normalizeBoolean,
|
|
10
|
+
normalizeNonNegativeNumber,
|
|
11
|
+
normalizePositiveInt,
|
|
12
|
+
normalizePositiveNumber
|
|
13
|
+
} from "./chunk-JGIWG6SR.js";
|
|
14
|
+
import {
|
|
15
|
+
BootError,
|
|
16
|
+
DisposeError,
|
|
17
|
+
DisposeTimeoutError,
|
|
18
|
+
MainError,
|
|
19
|
+
closeProgramScope,
|
|
20
|
+
installGracefulShutdownHandlers,
|
|
21
|
+
makeApp,
|
|
22
|
+
makeProgramRunnerKernel,
|
|
23
|
+
provide
|
|
24
|
+
} from "./chunk-EGK3KN7B.js";
|
|
25
|
+
import {
|
|
26
|
+
make
|
|
27
|
+
} from "./chunk-BE3HW4FY.js";
|
|
28
|
+
import {
|
|
29
|
+
inSyncTransactionFiber,
|
|
30
|
+
isInSyncTransaction
|
|
31
|
+
} from "./chunk-ZFLHVFUC.js";
|
|
32
|
+
import {
|
|
33
|
+
devtoolsHubLayer,
|
|
34
|
+
layer,
|
|
35
|
+
runtimeLabel
|
|
36
|
+
} from "./chunk-W3TEWHLO.js";
|
|
37
|
+
import {
|
|
38
|
+
getRuntimeInternals
|
|
39
|
+
} from "./chunk-3RMKLXHX.js";
|
|
40
|
+
import {
|
|
41
|
+
ConcurrencyPolicyOverridesTag,
|
|
42
|
+
ConcurrencyPolicyTag,
|
|
43
|
+
StateTransactionConfigTag,
|
|
44
|
+
StateTransactionOverridesTag,
|
|
45
|
+
isDevEnv
|
|
46
|
+
} from "./chunk-3QMIVH35.js";
|
|
47
|
+
import {
|
|
48
|
+
runSessionLayer
|
|
49
|
+
} from "./chunk-OFADUJWJ.js";
|
|
50
|
+
import {
|
|
51
|
+
EffectOpMiddlewareTag
|
|
52
|
+
} from "./chunk-JWOYLO27.js";
|
|
53
|
+
import {
|
|
54
|
+
__export
|
|
55
|
+
} from "./chunk-PZ5AY32C.js";
|
|
56
|
+
|
|
57
|
+
// src/Runtime.ts
|
|
58
|
+
var Runtime_exports = {};
|
|
59
|
+
__export(Runtime_exports, {
|
|
60
|
+
BootError: () => BootError,
|
|
61
|
+
DisposeError: () => DisposeError,
|
|
62
|
+
DisposeTimeoutError: () => DisposeTimeoutError,
|
|
63
|
+
MainError: () => MainError,
|
|
64
|
+
applyTransactionSnapshot: () => applyTransactionSnapshot,
|
|
65
|
+
concurrencyPolicyOverridesLayer: () => concurrencyPolicyOverridesLayer,
|
|
66
|
+
make: () => make2,
|
|
67
|
+
openProgram: () => openProgram2,
|
|
68
|
+
runProgram: () => runProgram2,
|
|
69
|
+
setConcurrencyPolicyOverride: () => setConcurrencyPolicyOverride,
|
|
70
|
+
setTraitConvergeOverride: () => setTraitConvergeOverride,
|
|
71
|
+
stateTransactionOverridesLayer: () => stateTransactionOverridesLayer
|
|
72
|
+
});
|
|
73
|
+
import { Effect as Effect2, Layer, Option as Option2 } from "effect";
|
|
74
|
+
|
|
75
|
+
// src/internal/runtime/core/configValidation.ts
|
|
76
|
+
import { Schema } from "effect";
|
|
77
|
+
var PositiveIntSchema = Schema.Int.pipe(Schema.positive());
|
|
78
|
+
var PositiveNumberSchema = Schema.Number.pipe(Schema.positive());
|
|
79
|
+
var ConvergeModeSchema = Schema.Union(Schema.Literal("auto"), Schema.Literal("full"), Schema.Literal("dirty"));
|
|
80
|
+
var InstrumentationSchema = Schema.Union(Schema.Literal("full"), Schema.Literal("light"));
|
|
81
|
+
var ConcurrencyLimitSchema = Schema.Union(Schema.Literal("unbounded"), PositiveIntSchema);
|
|
82
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
83
|
+
var warnDevOnly = (label, issues) => {
|
|
84
|
+
if (!isDevEnv()) return;
|
|
85
|
+
if (issues.length === 0) return;
|
|
86
|
+
console.warn(
|
|
87
|
+
["[Logix] Invalid runtime config detected.", `context: ${label}`, "issues:"].concat(issues.map((i) => `- ${i}`)).join("\n")
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
var collectUnknownKeys = (obj, allowed, prefix) => {
|
|
91
|
+
const issues = [];
|
|
92
|
+
for (const key of Object.keys(obj)) {
|
|
93
|
+
if (!allowed.has(key)) {
|
|
94
|
+
issues.push(`${prefix}${key}: unknown key`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return issues;
|
|
98
|
+
};
|
|
99
|
+
var validateConcurrencyPolicyPatch = (obj, prefix) => {
|
|
100
|
+
const issues = [];
|
|
101
|
+
if ("concurrencyLimit" in obj && obj.concurrencyLimit != null) {
|
|
102
|
+
if (!Schema.is(ConcurrencyLimitSchema)(obj.concurrencyLimit)) {
|
|
103
|
+
issues.push(`${prefix}concurrencyLimit: expected positive int | "unbounded"`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if ("losslessBackpressureCapacity" in obj && obj.losslessBackpressureCapacity != null) {
|
|
107
|
+
if (normalizePositiveInt(obj.losslessBackpressureCapacity) == null) {
|
|
108
|
+
issues.push(`${prefix}losslessBackpressureCapacity: expected positive int`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if ("allowUnbounded" in obj && obj.allowUnbounded != null) {
|
|
112
|
+
if (normalizeBoolean(obj.allowUnbounded) == null) {
|
|
113
|
+
issues.push(`${prefix}allowUnbounded: expected boolean`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if ("pressureWarningThreshold" in obj && obj.pressureWarningThreshold != null) {
|
|
117
|
+
const threshold = obj.pressureWarningThreshold;
|
|
118
|
+
if (!isRecord(threshold)) {
|
|
119
|
+
issues.push(`${prefix}pressureWarningThreshold: expected object`);
|
|
120
|
+
} else {
|
|
121
|
+
const backlogCount = threshold["backlogCount"];
|
|
122
|
+
if (backlogCount != null) {
|
|
123
|
+
if (normalizePositiveInt(backlogCount) == null) {
|
|
124
|
+
issues.push(`${prefix}pressureWarningThreshold.backlogCount: expected positive int`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const backlogDurationMs = threshold["backlogDurationMs"];
|
|
128
|
+
if (backlogDurationMs != null) {
|
|
129
|
+
if (normalizePositiveNumber(backlogDurationMs) == null) {
|
|
130
|
+
issues.push(`${prefix}pressureWarningThreshold.backlogDurationMs: expected positive number`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if ("warningCooldownMs" in obj && obj.warningCooldownMs != null) {
|
|
136
|
+
if (normalizePositiveNumber(obj.warningCooldownMs) == null) {
|
|
137
|
+
issues.push(`${prefix}warningCooldownMs: expected positive number`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return issues;
|
|
141
|
+
};
|
|
142
|
+
var warnInvalidConcurrencyPolicyDevOnly = (value, label) => {
|
|
143
|
+
if (!isDevEnv()) return;
|
|
144
|
+
if (value == null) return;
|
|
145
|
+
if (!isRecord(value)) {
|
|
146
|
+
warnDevOnly(label, ["expected object"]);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const policy = value;
|
|
150
|
+
const issues = [];
|
|
151
|
+
issues.push(
|
|
152
|
+
...collectUnknownKeys(
|
|
153
|
+
policy,
|
|
154
|
+
/* @__PURE__ */ new Set([
|
|
155
|
+
"concurrencyLimit",
|
|
156
|
+
"losslessBackpressureCapacity",
|
|
157
|
+
"allowUnbounded",
|
|
158
|
+
"pressureWarningThreshold",
|
|
159
|
+
"warningCooldownMs",
|
|
160
|
+
"overridesByModuleId"
|
|
161
|
+
]),
|
|
162
|
+
""
|
|
163
|
+
)
|
|
164
|
+
);
|
|
165
|
+
issues.push(...validateConcurrencyPolicyPatch(policy, ""));
|
|
166
|
+
const overridesByModuleId = policy.overridesByModuleId;
|
|
167
|
+
if (overridesByModuleId != null) {
|
|
168
|
+
if (!isRecord(overridesByModuleId)) {
|
|
169
|
+
issues.push(`overridesByModuleId: expected record`);
|
|
170
|
+
} else {
|
|
171
|
+
for (const [moduleId, patch] of Object.entries(overridesByModuleId)) {
|
|
172
|
+
const prefix = `overridesByModuleId.${moduleId}.`;
|
|
173
|
+
if (patch == null) continue;
|
|
174
|
+
if (!isRecord(patch)) {
|
|
175
|
+
issues.push(`${prefix}<value>: expected object`);
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
issues.push(
|
|
179
|
+
...collectUnknownKeys(
|
|
180
|
+
patch,
|
|
181
|
+
/* @__PURE__ */ new Set([
|
|
182
|
+
"concurrencyLimit",
|
|
183
|
+
"losslessBackpressureCapacity",
|
|
184
|
+
"allowUnbounded",
|
|
185
|
+
"pressureWarningThreshold",
|
|
186
|
+
"warningCooldownMs"
|
|
187
|
+
]),
|
|
188
|
+
prefix
|
|
189
|
+
)
|
|
190
|
+
);
|
|
191
|
+
issues.push(...validateConcurrencyPolicyPatch(patch, prefix));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
warnDevOnly(label, issues);
|
|
196
|
+
};
|
|
197
|
+
var warnInvalidConcurrencyPolicyPatchDevOnly = (value, label) => {
|
|
198
|
+
if (!isDevEnv()) return;
|
|
199
|
+
if (value == null) return;
|
|
200
|
+
if (!isRecord(value)) {
|
|
201
|
+
warnDevOnly(label, ["expected object"]);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const issues = [];
|
|
205
|
+
issues.push(
|
|
206
|
+
...collectUnknownKeys(
|
|
207
|
+
value,
|
|
208
|
+
/* @__PURE__ */ new Set([
|
|
209
|
+
"concurrencyLimit",
|
|
210
|
+
"losslessBackpressureCapacity",
|
|
211
|
+
"allowUnbounded",
|
|
212
|
+
"pressureWarningThreshold",
|
|
213
|
+
"warningCooldownMs"
|
|
214
|
+
]),
|
|
215
|
+
""
|
|
216
|
+
)
|
|
217
|
+
);
|
|
218
|
+
issues.push(...validateConcurrencyPolicyPatch(value, ""));
|
|
219
|
+
warnDevOnly(label, issues);
|
|
220
|
+
};
|
|
221
|
+
var validateStateTransactionTraitOverrides = (obj, prefix) => {
|
|
222
|
+
const issues = [];
|
|
223
|
+
if ("traitConvergeMode" in obj && obj.traitConvergeMode != null) {
|
|
224
|
+
if (!Schema.is(ConvergeModeSchema)(obj.traitConvergeMode)) {
|
|
225
|
+
issues.push(`${prefix}traitConvergeMode: expected "auto" | "full" | "dirty"`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if ("traitConvergeBudgetMs" in obj && obj.traitConvergeBudgetMs != null) {
|
|
229
|
+
if (normalizePositiveNumber(obj.traitConvergeBudgetMs) == null) {
|
|
230
|
+
issues.push(`${prefix}traitConvergeBudgetMs: expected positive number`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if ("traitConvergeDecisionBudgetMs" in obj && obj.traitConvergeDecisionBudgetMs != null) {
|
|
234
|
+
if (normalizePositiveNumber(obj.traitConvergeDecisionBudgetMs) == null) {
|
|
235
|
+
issues.push(`${prefix}traitConvergeDecisionBudgetMs: expected positive number`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if ("traitConvergeTimeSlicing" in obj && obj.traitConvergeTimeSlicing != null) {
|
|
239
|
+
const timeSlicing = obj.traitConvergeTimeSlicing;
|
|
240
|
+
if (!isRecord(timeSlicing)) {
|
|
241
|
+
issues.push(`${prefix}traitConvergeTimeSlicing: expected object`);
|
|
242
|
+
} else {
|
|
243
|
+
const tsPrefix = `${prefix}traitConvergeTimeSlicing.`;
|
|
244
|
+
issues.push(...collectUnknownKeys(timeSlicing, /* @__PURE__ */ new Set(["enabled", "debounceMs", "maxLagMs"]), tsPrefix));
|
|
245
|
+
if ("enabled" in timeSlicing && timeSlicing.enabled != null) {
|
|
246
|
+
if (typeof timeSlicing.enabled !== "boolean") {
|
|
247
|
+
issues.push(`${tsPrefix}enabled: expected boolean`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if ("debounceMs" in timeSlicing && timeSlicing.debounceMs != null) {
|
|
251
|
+
if (normalizePositiveNumber(timeSlicing.debounceMs) == null) {
|
|
252
|
+
issues.push(`${tsPrefix}debounceMs: expected positive number`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if ("maxLagMs" in timeSlicing && timeSlicing.maxLagMs != null) {
|
|
256
|
+
if (normalizePositiveNumber(timeSlicing.maxLagMs) == null) {
|
|
257
|
+
issues.push(`${tsPrefix}maxLagMs: expected positive number`);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return issues;
|
|
263
|
+
};
|
|
264
|
+
var validateTxnLanesPatch = (obj, prefix) => {
|
|
265
|
+
const issues = [];
|
|
266
|
+
if ("enabled" in obj && obj.enabled != null) {
|
|
267
|
+
if (normalizeBoolean(obj.enabled) == null) {
|
|
268
|
+
issues.push(`${prefix}enabled: expected boolean`);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if ("overrideMode" in obj && obj.overrideMode != null) {
|
|
272
|
+
const raw = obj.overrideMode;
|
|
273
|
+
if (typeof raw !== "string" || raw !== "forced_off" && raw !== "forced_sync") {
|
|
274
|
+
issues.push(`${prefix}overrideMode: expected "forced_off" | "forced_sync"`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if ("budgetMs" in obj && obj.budgetMs != null) {
|
|
278
|
+
if (normalizeNonNegativeNumber(obj.budgetMs) == null) {
|
|
279
|
+
issues.push(`${prefix}budgetMs: expected non-negative number`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if ("debounceMs" in obj && obj.debounceMs != null) {
|
|
283
|
+
if (normalizeNonNegativeNumber(obj.debounceMs) == null) {
|
|
284
|
+
issues.push(`${prefix}debounceMs: expected non-negative number`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if ("maxLagMs" in obj && obj.maxLagMs != null) {
|
|
288
|
+
if (normalizeNonNegativeNumber(obj.maxLagMs) == null) {
|
|
289
|
+
issues.push(`${prefix}maxLagMs: expected non-negative number`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if ("allowCoalesce" in obj && obj.allowCoalesce != null) {
|
|
293
|
+
if (normalizeBoolean(obj.allowCoalesce) == null) {
|
|
294
|
+
issues.push(`${prefix}allowCoalesce: expected boolean`);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if ("yieldStrategy" in obj && obj.yieldStrategy != null) {
|
|
298
|
+
const raw = obj.yieldStrategy;
|
|
299
|
+
if (typeof raw !== "string" || raw !== "baseline" && raw !== "inputPending") {
|
|
300
|
+
issues.push(`${prefix}yieldStrategy: expected "baseline" | "inputPending"`);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return issues;
|
|
304
|
+
};
|
|
305
|
+
var warnInvalidStateTransactionTraitConvergeOverridesDevOnly = (value, label) => {
|
|
306
|
+
if (!isDevEnv()) return;
|
|
307
|
+
if (value == null) return;
|
|
308
|
+
if (!isRecord(value)) {
|
|
309
|
+
warnDevOnly(label, ["expected object"]);
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const issues = [];
|
|
313
|
+
issues.push(
|
|
314
|
+
...collectUnknownKeys(
|
|
315
|
+
value,
|
|
316
|
+
/* @__PURE__ */ new Set([
|
|
317
|
+
"traitConvergeBudgetMs",
|
|
318
|
+
"traitConvergeDecisionBudgetMs",
|
|
319
|
+
"traitConvergeMode",
|
|
320
|
+
"traitConvergeTimeSlicing"
|
|
321
|
+
]),
|
|
322
|
+
""
|
|
323
|
+
)
|
|
324
|
+
);
|
|
325
|
+
issues.push(...validateStateTransactionTraitOverrides(value, ""));
|
|
326
|
+
warnDevOnly(label, issues);
|
|
327
|
+
};
|
|
328
|
+
var warnInvalidStateTransactionRuntimeConfigDevOnly = (value, label) => {
|
|
329
|
+
if (!isDevEnv()) return;
|
|
330
|
+
if (value == null) return;
|
|
331
|
+
if (!isRecord(value)) {
|
|
332
|
+
warnDevOnly(label, ["expected object"]);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
const issues = [];
|
|
336
|
+
issues.push(
|
|
337
|
+
...collectUnknownKeys(
|
|
338
|
+
value,
|
|
339
|
+
/* @__PURE__ */ new Set([
|
|
340
|
+
"instrumentation",
|
|
341
|
+
"traitConvergeBudgetMs",
|
|
342
|
+
"traitConvergeDecisionBudgetMs",
|
|
343
|
+
"traitConvergeMode",
|
|
344
|
+
"traitConvergeTimeSlicing",
|
|
345
|
+
"traitConvergeOverridesByModuleId",
|
|
346
|
+
"txnLanes",
|
|
347
|
+
"txnLanesOverridesByModuleId"
|
|
348
|
+
]),
|
|
349
|
+
""
|
|
350
|
+
)
|
|
351
|
+
);
|
|
352
|
+
if ("instrumentation" in value && value.instrumentation != null) {
|
|
353
|
+
if (!Schema.is(InstrumentationSchema)(value.instrumentation)) {
|
|
354
|
+
issues.push(`instrumentation: expected "full" | "light"`);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
issues.push(...validateStateTransactionTraitOverrides(value, ""));
|
|
358
|
+
const txnLanes = value.txnLanes;
|
|
359
|
+
if (txnLanes != null) {
|
|
360
|
+
if (!isRecord(txnLanes)) {
|
|
361
|
+
issues.push(`txnLanes: expected object`);
|
|
362
|
+
} else {
|
|
363
|
+
const prefix = "txnLanes.";
|
|
364
|
+
issues.push(
|
|
365
|
+
...collectUnknownKeys(
|
|
366
|
+
txnLanes,
|
|
367
|
+
/* @__PURE__ */ new Set(["enabled", "overrideMode", "budgetMs", "debounceMs", "maxLagMs", "allowCoalesce", "yieldStrategy"]),
|
|
368
|
+
prefix
|
|
369
|
+
)
|
|
370
|
+
);
|
|
371
|
+
issues.push(...validateTxnLanesPatch(txnLanes, prefix));
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const overridesByModuleId = value.traitConvergeOverridesByModuleId;
|
|
375
|
+
if (overridesByModuleId != null) {
|
|
376
|
+
if (!isRecord(overridesByModuleId)) {
|
|
377
|
+
issues.push(`traitConvergeOverridesByModuleId: expected record`);
|
|
378
|
+
} else {
|
|
379
|
+
for (const [moduleId, patch] of Object.entries(overridesByModuleId)) {
|
|
380
|
+
const prefix = `traitConvergeOverridesByModuleId.${moduleId}.`;
|
|
381
|
+
if (patch == null) continue;
|
|
382
|
+
if (!isRecord(patch)) {
|
|
383
|
+
issues.push(`${prefix}<value>: expected object`);
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
issues.push(
|
|
387
|
+
...collectUnknownKeys(
|
|
388
|
+
patch,
|
|
389
|
+
/* @__PURE__ */ new Set([
|
|
390
|
+
"traitConvergeMode",
|
|
391
|
+
"traitConvergeBudgetMs",
|
|
392
|
+
"traitConvergeDecisionBudgetMs",
|
|
393
|
+
"traitConvergeTimeSlicing"
|
|
394
|
+
]),
|
|
395
|
+
prefix
|
|
396
|
+
)
|
|
397
|
+
);
|
|
398
|
+
issues.push(...validateStateTransactionTraitOverrides(patch, prefix));
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
const lanesOverridesByModuleId = value.txnLanesOverridesByModuleId;
|
|
403
|
+
if (lanesOverridesByModuleId != null) {
|
|
404
|
+
if (!isRecord(lanesOverridesByModuleId)) {
|
|
405
|
+
issues.push(`txnLanesOverridesByModuleId: expected record`);
|
|
406
|
+
} else {
|
|
407
|
+
for (const [moduleId, patch] of Object.entries(lanesOverridesByModuleId)) {
|
|
408
|
+
const prefix = `txnLanesOverridesByModuleId.${moduleId}.`;
|
|
409
|
+
if (patch == null) continue;
|
|
410
|
+
if (!isRecord(patch)) {
|
|
411
|
+
issues.push(`${prefix}<value>: expected object`);
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
issues.push(
|
|
415
|
+
...collectUnknownKeys(
|
|
416
|
+
patch,
|
|
417
|
+
/* @__PURE__ */ new Set([
|
|
418
|
+
"enabled",
|
|
419
|
+
"overrideMode",
|
|
420
|
+
"budgetMs",
|
|
421
|
+
"debounceMs",
|
|
422
|
+
"maxLagMs",
|
|
423
|
+
"allowCoalesce",
|
|
424
|
+
"yieldStrategy"
|
|
425
|
+
]),
|
|
426
|
+
prefix
|
|
427
|
+
)
|
|
428
|
+
);
|
|
429
|
+
issues.push(...validateTxnLanesPatch(patch, prefix));
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
warnDevOnly(label, issues);
|
|
434
|
+
};
|
|
435
|
+
var warnInvalidStateTransactionOverridesDevOnly = (value, label) => {
|
|
436
|
+
if (!isDevEnv()) return;
|
|
437
|
+
if (value == null) return;
|
|
438
|
+
if (!isRecord(value)) {
|
|
439
|
+
warnDevOnly(label, ["expected object"]);
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
const issues = [];
|
|
443
|
+
issues.push(
|
|
444
|
+
...collectUnknownKeys(
|
|
445
|
+
value,
|
|
446
|
+
/* @__PURE__ */ new Set([
|
|
447
|
+
"traitConvergeBudgetMs",
|
|
448
|
+
"traitConvergeDecisionBudgetMs",
|
|
449
|
+
"traitConvergeMode",
|
|
450
|
+
"traitConvergeTimeSlicing",
|
|
451
|
+
"traitConvergeOverridesByModuleId",
|
|
452
|
+
"txnLanes",
|
|
453
|
+
"txnLanesOverridesByModuleId"
|
|
454
|
+
]),
|
|
455
|
+
""
|
|
456
|
+
)
|
|
457
|
+
);
|
|
458
|
+
issues.push(...validateStateTransactionTraitOverrides(value, ""));
|
|
459
|
+
const txnLanes = value.txnLanes;
|
|
460
|
+
if (txnLanes != null) {
|
|
461
|
+
if (!isRecord(txnLanes)) {
|
|
462
|
+
issues.push(`txnLanes: expected object`);
|
|
463
|
+
} else {
|
|
464
|
+
const prefix = "txnLanes.";
|
|
465
|
+
issues.push(
|
|
466
|
+
...collectUnknownKeys(
|
|
467
|
+
txnLanes,
|
|
468
|
+
/* @__PURE__ */ new Set(["enabled", "overrideMode", "budgetMs", "debounceMs", "maxLagMs", "allowCoalesce"]),
|
|
469
|
+
prefix
|
|
470
|
+
)
|
|
471
|
+
);
|
|
472
|
+
issues.push(...validateTxnLanesPatch(txnLanes, prefix));
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
const overridesByModuleId = value.traitConvergeOverridesByModuleId;
|
|
476
|
+
if (overridesByModuleId != null) {
|
|
477
|
+
if (!isRecord(overridesByModuleId)) {
|
|
478
|
+
issues.push(`traitConvergeOverridesByModuleId: expected record`);
|
|
479
|
+
} else {
|
|
480
|
+
for (const [moduleId, patch] of Object.entries(overridesByModuleId)) {
|
|
481
|
+
const prefix = `traitConvergeOverridesByModuleId.${moduleId}.`;
|
|
482
|
+
if (patch == null) continue;
|
|
483
|
+
if (!isRecord(patch)) {
|
|
484
|
+
issues.push(`${prefix}<value>: expected object`);
|
|
485
|
+
continue;
|
|
486
|
+
}
|
|
487
|
+
issues.push(
|
|
488
|
+
...collectUnknownKeys(
|
|
489
|
+
patch,
|
|
490
|
+
/* @__PURE__ */ new Set([
|
|
491
|
+
"traitConvergeMode",
|
|
492
|
+
"traitConvergeBudgetMs",
|
|
493
|
+
"traitConvergeDecisionBudgetMs",
|
|
494
|
+
"traitConvergeTimeSlicing"
|
|
495
|
+
]),
|
|
496
|
+
prefix
|
|
497
|
+
)
|
|
498
|
+
);
|
|
499
|
+
issues.push(...validateStateTransactionTraitOverrides(patch, prefix));
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
const lanesOverridesByModuleId = value.txnLanesOverridesByModuleId;
|
|
504
|
+
if (lanesOverridesByModuleId != null) {
|
|
505
|
+
if (!isRecord(lanesOverridesByModuleId)) {
|
|
506
|
+
issues.push(`txnLanesOverridesByModuleId: expected record`);
|
|
507
|
+
} else {
|
|
508
|
+
for (const [moduleId, patch] of Object.entries(lanesOverridesByModuleId)) {
|
|
509
|
+
const prefix = `txnLanesOverridesByModuleId.${moduleId}.`;
|
|
510
|
+
if (patch == null) continue;
|
|
511
|
+
if (!isRecord(patch)) {
|
|
512
|
+
issues.push(`${prefix}<value>: expected object`);
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
issues.push(
|
|
516
|
+
...collectUnknownKeys(
|
|
517
|
+
patch,
|
|
518
|
+
/* @__PURE__ */ new Set(["enabled", "overrideMode", "budgetMs", "debounceMs", "maxLagMs", "allowCoalesce"]),
|
|
519
|
+
prefix
|
|
520
|
+
)
|
|
521
|
+
);
|
|
522
|
+
issues.push(...validateTxnLanesPatch(patch, prefix));
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
warnDevOnly(label, issues);
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
// src/internal/runtime/core/runner/ProgramRunner.ts
|
|
530
|
+
import { Cause, Effect, FiberRef, Option, Scope } from "effect";
|
|
531
|
+
|
|
532
|
+
// src/internal/runtime/core/runner/ProgramRunner.exitCode.ts
|
|
533
|
+
var isRecord2 = (value) => typeof value === "object" && value !== null;
|
|
534
|
+
var getProcess = () => globalThis.process;
|
|
535
|
+
var setExitCodeIfEnabled = (enabled, value) => {
|
|
536
|
+
if (!enabled) return;
|
|
537
|
+
const proc = getProcess();
|
|
538
|
+
if (!isRecord2(proc)) return;
|
|
539
|
+
const next = typeof value === "number" && Number.isInteger(value) ? value : 0;
|
|
540
|
+
proc.exitCode = next;
|
|
541
|
+
};
|
|
542
|
+
var setFailureExitCodeIfEnabled = (enabled) => {
|
|
543
|
+
if (!enabled) return;
|
|
544
|
+
const proc = getProcess();
|
|
545
|
+
if (!isRecord2(proc)) return;
|
|
546
|
+
proc.exitCode = 1;
|
|
547
|
+
};
|
|
548
|
+
var reportErrorIfEnabled = (enabled, error) => {
|
|
549
|
+
if (!enabled) return;
|
|
550
|
+
console.error(error);
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
// src/internal/runtime/core/runner/ProgramRunner.options.ts
|
|
554
|
+
var isRecord3 = (value) => typeof value === "object" && value !== null;
|
|
555
|
+
var resolveProgramRunnerOptions = (options) => {
|
|
556
|
+
const record = isRecord3(options) ? options : void 0;
|
|
557
|
+
const closeScopeTimeout = typeof record?.closeScopeTimeout === "number" ? record.closeScopeTimeout : 1e3;
|
|
558
|
+
const handleSignals = typeof record?.handleSignals === "boolean" ? record.handleSignals : true;
|
|
559
|
+
const exitCode = typeof record?.exitCode === "boolean" ? record.exitCode : false;
|
|
560
|
+
const reportError = typeof record?.reportError === "boolean" ? record.reportError : true;
|
|
561
|
+
const args = record?.args ?? void 0;
|
|
562
|
+
return {
|
|
563
|
+
closeScopeTimeout,
|
|
564
|
+
handleSignals,
|
|
565
|
+
args,
|
|
566
|
+
exitCode,
|
|
567
|
+
reportError
|
|
568
|
+
};
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
// src/internal/runtime/core/runner/ProgramRunner.ts
|
|
572
|
+
var openProgram = (makeRuntime, rootImpl, options) => Effect.gen(function* () {
|
|
573
|
+
const inTxn = yield* FiberRef.get(inSyncTransactionFiber);
|
|
574
|
+
if (inTxn) {
|
|
575
|
+
return yield* Effect.dieMessage(
|
|
576
|
+
"[Logix] Runtime.openProgram/runProgram is not allowed inside a synchronous StateTransaction body"
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
const runnerOptions = resolveProgramRunnerOptions(options);
|
|
580
|
+
const kernel = yield* makeProgramRunnerKernel(makeRuntime, rootImpl, options);
|
|
581
|
+
yield* Effect.addFinalizer(
|
|
582
|
+
() => kernel.close({
|
|
583
|
+
timeoutMs: runnerOptions.closeScopeTimeout,
|
|
584
|
+
onError: options?.onError
|
|
585
|
+
})
|
|
586
|
+
);
|
|
587
|
+
yield* kernel.installSignals(runnerOptions.handleSignals);
|
|
588
|
+
const moduleRuntime = yield* Effect.tryPromise({
|
|
589
|
+
try: () => kernel.runtime.runPromise(rootImpl.module),
|
|
590
|
+
catch: (error) => new BootError(kernel.identity, error)
|
|
591
|
+
});
|
|
592
|
+
kernel.setInstanceId(moduleRuntime.instanceId);
|
|
593
|
+
return kernel.toContext(moduleRuntime);
|
|
594
|
+
});
|
|
595
|
+
var runProgram = async (makeRuntime, rootImpl, main, options) => {
|
|
596
|
+
if (isInSyncTransaction()) {
|
|
597
|
+
throw new Error("[Logix] Runtime.openProgram/runProgram is not allowed inside a synchronous StateTransaction body");
|
|
598
|
+
}
|
|
599
|
+
const runnerOptions = resolveProgramRunnerOptions(options);
|
|
600
|
+
const identity = {
|
|
601
|
+
moduleId: String(rootImpl.module.id),
|
|
602
|
+
instanceId: "unknown"
|
|
603
|
+
};
|
|
604
|
+
const scope = Effect.runSync(Scope.make());
|
|
605
|
+
const runtime = makeRuntime(rootImpl, options);
|
|
606
|
+
let ctx;
|
|
607
|
+
let mainError;
|
|
608
|
+
let closeError;
|
|
609
|
+
let result;
|
|
610
|
+
try {
|
|
611
|
+
Effect.runSync(Scope.addFinalizer(scope, Effect.promise(() => runtime.dispose()).pipe(Effect.asVoid)));
|
|
612
|
+
if (runnerOptions.handleSignals) {
|
|
613
|
+
Effect.runSync(
|
|
614
|
+
installGracefulShutdownHandlers({
|
|
615
|
+
scope,
|
|
616
|
+
enabled: true
|
|
617
|
+
})
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
let moduleRuntime;
|
|
621
|
+
try {
|
|
622
|
+
moduleRuntime = await runtime.runPromise(rootImpl.module);
|
|
623
|
+
} catch (error) {
|
|
624
|
+
setFailureExitCodeIfEnabled(runnerOptions.exitCode);
|
|
625
|
+
reportErrorIfEnabled(runnerOptions.exitCode && runnerOptions.reportError, error);
|
|
626
|
+
result = {
|
|
627
|
+
_tag: "failure",
|
|
628
|
+
error: new BootError(identity, error)
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
if (result?._tag !== "failure") {
|
|
632
|
+
identity.instanceId = String(moduleRuntime.instanceId ?? "unknown");
|
|
633
|
+
ctx = {
|
|
634
|
+
scope,
|
|
635
|
+
runtime,
|
|
636
|
+
module: moduleRuntime,
|
|
637
|
+
$: make(rootImpl.module.shape, moduleRuntime)
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
if (ctx) {
|
|
641
|
+
try {
|
|
642
|
+
const value = await ctx.runtime.runPromise(main(ctx, runnerOptions.args));
|
|
643
|
+
setExitCodeIfEnabled(runnerOptions.exitCode, value);
|
|
644
|
+
result = { _tag: "success", value };
|
|
645
|
+
} catch (error) {
|
|
646
|
+
mainError = error;
|
|
647
|
+
setFailureExitCodeIfEnabled(runnerOptions.exitCode);
|
|
648
|
+
reportErrorIfEnabled(runnerOptions.exitCode && runnerOptions.reportError, error);
|
|
649
|
+
result = { _tag: "failure", error: new MainError(identity, error) };
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
} finally {
|
|
653
|
+
const exit = await Effect.runPromiseExit(
|
|
654
|
+
closeProgramScope({
|
|
655
|
+
scope,
|
|
656
|
+
timeoutMs: runnerOptions.closeScopeTimeout,
|
|
657
|
+
identity,
|
|
658
|
+
onError: options?.onError
|
|
659
|
+
})
|
|
660
|
+
);
|
|
661
|
+
if (exit._tag === "Failure") {
|
|
662
|
+
const failureOpt = Cause.failureOption(exit.cause);
|
|
663
|
+
if (Option.isSome(failureOpt)) {
|
|
664
|
+
const error = failureOpt.value;
|
|
665
|
+
if (mainError !== void 0 && error && typeof error === "object") {
|
|
666
|
+
error.mainError = mainError;
|
|
667
|
+
}
|
|
668
|
+
closeError = error;
|
|
669
|
+
} else {
|
|
670
|
+
const defectOpt = Cause.dieOption(exit.cause);
|
|
671
|
+
if (Option.isSome(defectOpt) && defectOpt.value instanceof Error) {
|
|
672
|
+
const error = defectOpt.value;
|
|
673
|
+
if (mainError !== void 0 && error && typeof error === "object") {
|
|
674
|
+
error.mainError = mainError;
|
|
675
|
+
}
|
|
676
|
+
closeError = error;
|
|
677
|
+
} else {
|
|
678
|
+
closeError = new Error(String(exit.cause));
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
if (closeError !== void 0) {
|
|
684
|
+
setFailureExitCodeIfEnabled(runnerOptions.exitCode);
|
|
685
|
+
reportErrorIfEnabled(runnerOptions.exitCode && runnerOptions.reportError, closeError);
|
|
686
|
+
throw closeError;
|
|
687
|
+
}
|
|
688
|
+
if (!result) {
|
|
689
|
+
setFailureExitCodeIfEnabled(runnerOptions.exitCode);
|
|
690
|
+
throw new Error("[Logix] ProgramRunner.runProgram: missing result");
|
|
691
|
+
}
|
|
692
|
+
if (result._tag === "failure") {
|
|
693
|
+
throw result.error;
|
|
694
|
+
}
|
|
695
|
+
return result.value;
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
// src/Runtime.ts
|
|
699
|
+
var resolveRootImpl = (root) => root?._tag === "ModuleImpl" ? root : root?.impl;
|
|
700
|
+
var make2 = (root, options) => {
|
|
701
|
+
const rootImpl = resolveRootImpl(root);
|
|
702
|
+
warnInvalidConcurrencyPolicyDevOnly(options?.concurrencyPolicy, "Runtime.make options.concurrencyPolicy");
|
|
703
|
+
warnInvalidStateTransactionRuntimeConfigDevOnly(options?.stateTransaction, "Runtime.make options.stateTransaction");
|
|
704
|
+
const debugLayer = options?.debug === true ? layer() : options?.debug ? layer(options.debug) : Layer.empty;
|
|
705
|
+
const userLayer = options?.layer ?? Layer.empty;
|
|
706
|
+
const userWithDebug = options?.debug ? Layer.mergeAll(userLayer, debugLayer) : userLayer;
|
|
707
|
+
let middlewareStack = options?.middleware ?? [];
|
|
708
|
+
const devtoolsOptions = options?.devtools === true ? {} : options?.devtools;
|
|
709
|
+
if (options?.devtools) {
|
|
710
|
+
const observerConfig = devtoolsOptions?.observer === false ? false : devtoolsOptions?.observer;
|
|
711
|
+
middlewareStack = withDebug(middlewareStack, {
|
|
712
|
+
logger: false,
|
|
713
|
+
observer: observerConfig
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
const effectOpLayer = middlewareStack.length > 0 ? Layer.succeed(EffectOpMiddlewareTag, {
|
|
717
|
+
stack: middlewareStack
|
|
718
|
+
}) : Layer.empty;
|
|
719
|
+
const baseLayer = options?.label != null ? Layer.mergeAll(runtimeLabel(options.label), userWithDebug) : userWithDebug;
|
|
720
|
+
const baseWithDevtools = options?.devtools ? devtoolsHubLayer(baseLayer, {
|
|
721
|
+
bufferSize: devtoolsOptions?.bufferSize,
|
|
722
|
+
diagnosticsLevel: devtoolsOptions?.diagnosticsLevel,
|
|
723
|
+
traitConvergeDiagnosticsSampling: devtoolsOptions?.traitConvergeDiagnosticsSampling
|
|
724
|
+
}) : baseLayer;
|
|
725
|
+
const appLayer = Layer.mergeAll(
|
|
726
|
+
runSessionLayer(),
|
|
727
|
+
layer2(),
|
|
728
|
+
baseWithDevtools,
|
|
729
|
+
effectOpLayer
|
|
730
|
+
);
|
|
731
|
+
const readQueryStrictGate = (() => {
|
|
732
|
+
const strictGate = options?.readQuery?.strictGate;
|
|
733
|
+
if (!strictGate) return void 0;
|
|
734
|
+
const mode = strictGate.mode ?? "off";
|
|
735
|
+
if (mode === "off") return void 0;
|
|
736
|
+
return {
|
|
737
|
+
mode,
|
|
738
|
+
requireStatic: strictGate.requireStatic,
|
|
739
|
+
denyFallbackReasons: strictGate.denyFallbackReasons
|
|
740
|
+
};
|
|
741
|
+
})();
|
|
742
|
+
const appConfig = {
|
|
743
|
+
layer: appLayer,
|
|
744
|
+
modules: [provide(rootImpl.module, rootImpl.layer)],
|
|
745
|
+
processes: rootImpl.processes ?? [],
|
|
746
|
+
onError: options?.onError,
|
|
747
|
+
stateTransaction: options?.stateTransaction,
|
|
748
|
+
concurrencyPolicy: options?.concurrencyPolicy,
|
|
749
|
+
readQueryStrictGate
|
|
750
|
+
};
|
|
751
|
+
const app = makeApp(appConfig);
|
|
752
|
+
return app.makeRuntime();
|
|
753
|
+
};
|
|
754
|
+
var openProgram2 = (root, options) => openProgram(
|
|
755
|
+
(rootImpl, runtimeOptions) => make2(rootImpl, runtimeOptions),
|
|
756
|
+
resolveRootImpl(root),
|
|
757
|
+
options
|
|
758
|
+
);
|
|
759
|
+
var runProgram2 = async (root, main, options) => runProgram(
|
|
760
|
+
(rootImpl, runtimeOptions) => make2(rootImpl, runtimeOptions),
|
|
761
|
+
resolveRootImpl(root),
|
|
762
|
+
main,
|
|
763
|
+
options
|
|
764
|
+
);
|
|
765
|
+
var stateTransactionOverridesLayer = (overrides) => {
|
|
766
|
+
warnInvalidStateTransactionOverridesDevOnly(overrides, "Runtime.stateTransactionOverridesLayer");
|
|
767
|
+
return Layer.succeed(StateTransactionOverridesTag, overrides);
|
|
768
|
+
};
|
|
769
|
+
var concurrencyPolicyOverridesLayer = (overrides) => {
|
|
770
|
+
warnInvalidConcurrencyPolicyDevOnly(overrides, "Runtime.concurrencyPolicyOverridesLayer");
|
|
771
|
+
return Layer.succeed(ConcurrencyPolicyOverridesTag, overrides);
|
|
772
|
+
};
|
|
773
|
+
var setTraitConvergeOverride = (runtime, moduleId, overrides) => {
|
|
774
|
+
warnInvalidStateTransactionTraitConvergeOverridesDevOnly(overrides, `Runtime.setTraitConvergeOverride(${moduleId})`);
|
|
775
|
+
runtime.runSync(
|
|
776
|
+
Effect2.gen(function* () {
|
|
777
|
+
const runtimeConfigOpt = yield* Effect2.serviceOption(StateTransactionConfigTag);
|
|
778
|
+
if (Option2.isNone(runtimeConfigOpt)) {
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
const runtimeConfig = runtimeConfigOpt.value;
|
|
782
|
+
const next = {
|
|
783
|
+
...runtimeConfig.traitConvergeOverridesByModuleId ?? {}
|
|
784
|
+
};
|
|
785
|
+
if (overrides) {
|
|
786
|
+
next[moduleId] = overrides;
|
|
787
|
+
} else {
|
|
788
|
+
delete next[moduleId];
|
|
789
|
+
}
|
|
790
|
+
runtimeConfig.traitConvergeOverridesByModuleId = next;
|
|
791
|
+
})
|
|
792
|
+
);
|
|
793
|
+
};
|
|
794
|
+
var setConcurrencyPolicyOverride = (runtime, moduleId, patch) => {
|
|
795
|
+
warnInvalidConcurrencyPolicyPatchDevOnly(patch, `Runtime.setConcurrencyPolicyOverride(${moduleId})`);
|
|
796
|
+
runtime.runSync(
|
|
797
|
+
Effect2.gen(function* () {
|
|
798
|
+
const runtimeConfigOpt = yield* Effect2.serviceOption(ConcurrencyPolicyTag);
|
|
799
|
+
if (Option2.isNone(runtimeConfigOpt)) {
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
const runtimeConfig = runtimeConfigOpt.value;
|
|
803
|
+
const next = {
|
|
804
|
+
...runtimeConfig.overridesByModuleId ?? {}
|
|
805
|
+
};
|
|
806
|
+
if (patch) {
|
|
807
|
+
next[moduleId] = patch;
|
|
808
|
+
} else {
|
|
809
|
+
delete next[moduleId];
|
|
810
|
+
}
|
|
811
|
+
runtimeConfig.overridesByModuleId = next;
|
|
812
|
+
})
|
|
813
|
+
);
|
|
814
|
+
};
|
|
815
|
+
var applyTransactionSnapshot = (moduleId, instanceId, txnId, mode) => Effect2.gen(function* () {
|
|
816
|
+
const runtime = getRuntimeByModuleAndInstance(moduleId, instanceId);
|
|
817
|
+
if (!runtime) {
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
try {
|
|
821
|
+
yield* getRuntimeInternals(runtime).txn.applyTransactionSnapshot(txnId, mode);
|
|
822
|
+
} catch {
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
});
|
|
826
|
+
|
|
827
|
+
export {
|
|
828
|
+
make2 as make,
|
|
829
|
+
openProgram2 as openProgram,
|
|
830
|
+
runProgram2 as runProgram,
|
|
831
|
+
stateTransactionOverridesLayer,
|
|
832
|
+
concurrencyPolicyOverridesLayer,
|
|
833
|
+
setTraitConvergeOverride,
|
|
834
|
+
setConcurrencyPolicyOverride,
|
|
835
|
+
applyTransactionSnapshot,
|
|
836
|
+
Runtime_exports
|
|
837
|
+
};
|
|
838
|
+
//# sourceMappingURL=chunk-NBD3KUOZ.js.map
|