@logixjs/core 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/{Action-mqVvtEHt.d.ts → Action-DYl88bwj.d.ts} +1 -1
- package/dist/{Action-BkRHy2vg.d.cts → Action-DkxsI_DK.d.cts} +1 -1
- package/dist/Action.cjs.map +1 -1
- package/dist/Action.d.cts +1 -1
- package/dist/Action.d.ts +1 -1
- package/dist/Action.js +2 -2
- package/dist/{Actions-AsQ07yTP.d.cts → Actions-Dicm7jdc.d.cts} +2 -2
- package/dist/{Actions-AsQ07yTP.d.ts → Actions-Dicm7jdc.d.ts} +2 -2
- package/dist/Actions.cjs.map +1 -1
- package/dist/Actions.d.cts +1 -1
- package/dist/Actions.d.ts +1 -1
- package/dist/Actions.js +1 -1
- package/dist/{Bound-BN1DQ_lM.d.ts → Bound-1OJLzVIS.d.ts} +2 -2
- package/dist/{Bound-BPIfH9SS.d.cts → Bound-BMLrtQ1V.d.cts} +2 -2
- package/dist/Bound.cjs +1737 -399
- package/dist/Bound.cjs.map +1 -1
- package/dist/Bound.d.cts +5 -5
- package/dist/Bound.d.ts +5 -5
- package/dist/Bound.js +19 -17
- package/dist/{Debug-B5q5Bkzx.d.ts → Debug-DKrWP5H1.d.ts} +40 -22
- package/dist/{Debug-Bq8Sqjcr.d.cts → Debug-hIT44XsY.d.cts} +40 -22
- package/dist/Debug.cjs +1348 -318
- package/dist/Debug.cjs.map +1 -1
- package/dist/Debug.d.cts +12 -11
- package/dist/Debug.d.ts +12 -11
- package/dist/Debug.js +20 -11
- package/dist/EffectOp.cjs +15 -6
- package/dist/EffectOp.cjs.map +1 -1
- package/dist/EffectOp.js +3 -3
- package/dist/Env.cjs +772 -6
- package/dist/Env.cjs.map +1 -1
- package/dist/Env.js +5 -2
- package/dist/ExternalStore-DqJKKRJ4.d.ts +61 -0
- package/dist/ExternalStore-JC-gAgEI.d.cts +61 -0
- package/dist/ExternalStore.cjs +774 -0
- package/dist/ExternalStore.cjs.map +1 -0
- package/dist/ExternalStore.d.cts +8 -0
- package/dist/ExternalStore.d.ts +8 -0
- package/dist/ExternalStore.js +19 -0
- package/dist/ExternalStore.js.map +1 -0
- package/dist/{Flow-BhpjE22E.d.ts → Flow-CZmXRDqp.d.cts} +13 -4
- package/dist/{Flow-1fZT8MpX.d.cts → Flow-DIVDxz7R.d.ts} +13 -4
- package/dist/Flow.cjs +765 -148
- package/dist/Flow.cjs.map +1 -1
- package/dist/Flow.d.cts +6 -6
- package/dist/Flow.d.ts +6 -6
- package/dist/Flow.js +9 -8
- package/dist/{Handle-D_cLW1Z3.d.ts → Handle-Bo6cAFut.d.ts} +1 -1
- package/dist/{Handle-D8D1zPb_.d.cts → Handle-CfDvSqN7.d.cts} +1 -1
- package/dist/Handle.d.cts +5 -5
- package/dist/Handle.d.ts +5 -5
- package/dist/{Kernel-8kC-jOda.d.cts → Kernel-CuXBF9S_.d.cts} +16 -7
- package/dist/{Kernel-CnGE1Fyk.d.ts → Kernel-D9guNwRL.d.ts} +16 -7
- package/dist/Kernel.cjs +814 -26
- package/dist/Kernel.cjs.map +1 -1
- package/dist/Kernel.d.cts +13 -12
- package/dist/Kernel.d.ts +13 -12
- package/dist/Kernel.js +7 -4
- package/dist/{Link-Db7975nU.d.ts → Link-CUM0yUCH.d.ts} +10 -3
- package/dist/{Link-fX8x1eCK.d.cts → Link-NAfR6uGD.d.cts} +10 -3
- package/dist/Link.cjs +1294 -121
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.d.cts +5 -5
- package/dist/Link.d.ts +5 -5
- package/dist/Link.js +37 -29
- package/dist/{Logic-DRh4sDZj.d.cts → Logic-09VQpIj3.d.cts} +7 -4
- package/dist/{Logic-BRjEMr-W.d.ts → Logic-DKg7ghGy.d.ts} +7 -4
- package/dist/Logic.cjs +2 -1
- package/dist/Logic.cjs.map +1 -1
- package/dist/Logic.d.cts +5 -5
- package/dist/Logic.d.ts +5 -5
- package/dist/Logic.js +1 -1
- package/dist/{MatchBuilder-CJk5oCkR.d.cts → MatchBuilder-CsW5jgrL.d.ts} +1 -1
- package/dist/{MatchBuilder-0QOc-nlU.d.ts → MatchBuilder-Dksk07F4.d.cts} +1 -1
- package/dist/MatchBuilder.cjs +2 -2
- package/dist/MatchBuilder.cjs.map +1 -1
- package/dist/MatchBuilder.d.cts +6 -6
- package/dist/MatchBuilder.d.ts +6 -6
- package/dist/MatchBuilder.js +2 -2
- package/dist/Middleware-D8tUDLv_.d.cts +100 -0
- package/dist/Middleware-DS7CbTTN.d.ts +100 -0
- package/dist/Middleware.cjs +678 -58
- package/dist/Middleware.cjs.map +1 -1
- package/dist/Middleware.d.cts +2 -86
- package/dist/Middleware.d.ts +2 -86
- package/dist/Middleware.js +15 -12
- package/dist/{Module-DnzluX2J.d.ts → Module-B_Cntyms.d.ts} +54 -25
- package/dist/{Module-B_0xRDMR.d.cts → Module-CmNOVXzf.d.cts} +54 -25
- package/dist/Module.cjs +9331 -3317
- package/dist/Module.cjs.map +1 -1
- package/dist/Module.d.cts +7 -6
- package/dist/Module.d.ts +7 -6
- package/dist/Module.js +39 -31
- package/dist/ModuleTag-CGho_InD.d.ts +113 -0
- package/dist/ModuleTag-CITb8L_G.d.cts +113 -0
- package/dist/ModuleTag.cjs +7248 -2847
- package/dist/ModuleTag.cjs.map +1 -1
- package/dist/ModuleTag.d.cts +6 -6
- package/dist/ModuleTag.d.ts +6 -6
- package/dist/ModuleTag.js +35 -29
- package/dist/Observability-Bdhnx2Dv.d.ts +385 -0
- package/dist/Observability-DXGAFBIT.d.cts +385 -0
- package/dist/Observability.cjs +5093 -1556
- package/dist/Observability.cjs.map +1 -1
- package/dist/Observability.d.cts +6 -7
- package/dist/Observability.d.ts +6 -7
- package/dist/Observability.js +28 -23
- package/dist/{Platform-CHX8o-U4.d.ts → Platform-B4s8tg6C.d.cts} +4 -5
- package/dist/{Platform-C49Pv956.d.cts → Platform-BV_0MW7g.d.cts} +5 -2
- package/dist/{Platform-C49Pv956.d.ts → Platform-BV_0MW7g.d.ts} +5 -2
- package/dist/{Platform-CVlv0xLQ.d.cts → Platform-W0Mefy_e.d.ts} +4 -5
- package/dist/Platform.cjs +2 -1
- package/dist/Platform.cjs.map +1 -1
- package/dist/Platform.d.cts +2 -3
- package/dist/Platform.d.ts +2 -3
- package/dist/Platform.js +2 -2
- package/dist/{Process-CM9xbMdP.d.ts → Process-CO8G7HO9.d.cts} +30 -5
- package/dist/{Process-mL8fHDSB.d.cts → Process-Cyf6VNDR.d.ts} +30 -5
- package/dist/Process.cjs +1288 -120
- package/dist/Process.cjs.map +1 -1
- package/dist/Process.d.cts +6 -6
- package/dist/Process.d.ts +6 -6
- package/dist/Process.js +34 -26
- package/dist/ReadQuery-C_or5nLC.d.ts +128 -0
- package/dist/ReadQuery-DXLzCE0E.d.cts +614 -0
- package/dist/ReadQuery-DXLzCE0E.d.ts +614 -0
- package/dist/ReadQuery-Yve1lmUo.d.cts +128 -0
- package/dist/ReadQuery.cjs +290 -5
- package/dist/ReadQuery.cjs.map +1 -1
- package/dist/ReadQuery.d.cts +3 -2
- package/dist/ReadQuery.d.ts +3 -2
- package/dist/ReadQuery.js +23 -5
- package/dist/{Reflection-CQnKwPXj.d.ts → Reflection-B2Xi1e4Q.d.ts} +89 -7
- package/dist/{Reflection-Kabo1mlU.d.cts → Reflection-DNB4V4_e.d.cts} +89 -7
- package/dist/Reflection.cjs +3227 -1617
- package/dist/Reflection.cjs.map +1 -1
- package/dist/Reflection.d.cts +17 -15
- package/dist/Reflection.d.ts +17 -15
- package/dist/Reflection.js +33 -25
- package/dist/{Resource-Dy1xD_DG.d.cts → Resource-pKvQQ4x5.d.cts} +3 -3
- package/dist/{Resource-Dy1xD_DG.d.ts → Resource-pKvQQ4x5.d.ts} +3 -3
- package/dist/Resource.cjs +781 -15
- package/dist/Resource.cjs.map +1 -1
- package/dist/Resource.d.cts +1 -1
- package/dist/Resource.d.ts +1 -1
- package/dist/Resource.js +6 -3
- package/dist/{Root-7ADUMk4t.d.cts → Root-CCVuFHB6.d.cts} +3 -3
- package/dist/{Root-7ADUMk4t.d.ts → Root-CCVuFHB6.d.ts} +3 -3
- package/dist/Root.cjs +786 -20
- package/dist/Root.cjs.map +1 -1
- package/dist/Root.d.cts +2 -2
- package/dist/Root.d.ts +2 -2
- package/dist/Root.js +7 -3
- package/dist/{Runtime-CtyzZG4i.d.ts → Runtime-CRmvwK4I.d.ts} +70 -14
- package/dist/{Runtime-B-aL-f29.d.cts → Runtime-C_wJM9mN.d.cts} +70 -14
- package/dist/Runtime.cjs +4942 -1601
- package/dist/Runtime.cjs.map +1 -1
- package/dist/Runtime.d.cts +17 -15
- package/dist/Runtime.d.ts +17 -15
- package/dist/Runtime.js +44 -32
- package/dist/{ScopeRegistry-D1owDNSm.d.cts → ScopeRegistry-BhYzqWri.d.cts} +6 -6
- package/dist/{ScopeRegistry-D1owDNSm.d.ts → ScopeRegistry-BhYzqWri.d.ts} +6 -6
- package/dist/ScopeRegistry.cjs +776 -10
- package/dist/ScopeRegistry.cjs.map +1 -1
- package/dist/ScopeRegistry.d.cts +1 -1
- package/dist/ScopeRegistry.d.ts +1 -1
- package/dist/ScopeRegistry.js +6 -3
- package/dist/{State-CU50R26M.d.cts → State-rNFsFPTl.d.cts} +2 -2
- package/dist/{State-CU50R26M.d.ts → State-rNFsFPTl.d.ts} +2 -2
- package/dist/State.cjs.map +1 -1
- package/dist/State.d.cts +1 -1
- package/dist/State.d.ts +1 -1
- package/dist/State.js +1 -1
- package/dist/{StateTrait-BGsZghTz.d.ts → StateTrait-CijdwNb6.d.ts} +25 -8
- package/dist/{StateTrait-OWhbj12c.d.cts → StateTrait-Dltto6PU.d.cts} +25 -8
- package/dist/StateTrait.cjs +1890 -528
- package/dist/StateTrait.cjs.map +1 -1
- package/dist/StateTrait.d.cts +9 -7
- package/dist/StateTrait.d.ts +9 -7
- package/dist/StateTrait.js +18 -14
- package/dist/{TraitLifecycle-CwV5WPFX.d.cts → TraitLifecycle-BKzDqzLu.d.cts} +2 -2
- package/dist/{TraitLifecycle-LdIWmKlg.d.ts → TraitLifecycle-Cvo94uDB.d.ts} +2 -2
- package/dist/TraitLifecycle.cjs +630 -67
- package/dist/TraitLifecycle.cjs.map +1 -1
- package/dist/TraitLifecycle.d.cts +6 -6
- package/dist/TraitLifecycle.d.ts +6 -6
- package/dist/TraitLifecycle.js +8 -7
- package/dist/Workflow-C_OWr4dV.d.ts +415 -0
- package/dist/Workflow-DmydkHO8.d.cts +415 -0
- package/dist/Workflow.cjs +3150 -0
- package/dist/Workflow.cjs.map +1 -0
- package/dist/Workflow.d.cts +7 -0
- package/dist/Workflow.d.ts +7 -0
- package/dist/Workflow.js +58 -0
- package/dist/Workflow.js.map +1 -0
- package/dist/{action-DiMDD_0v.d.cts → action-BQxjPFEw.d.cts} +5 -5
- package/dist/{action-DiMDD_0v.d.ts → action-BQxjPFEw.d.ts} +5 -5
- package/dist/chunk-2XRLXDWR.js +276 -0
- package/dist/chunk-2XRLXDWR.js.map +1 -0
- package/dist/chunk-3L6QGFMM.js +701 -0
- package/dist/chunk-3L6QGFMM.js.map +1 -0
- package/dist/{chunk-GMPEOUP2.js → chunk-4MZ7BT3R.js} +2 -2
- package/dist/chunk-4MZ7BT3R.js.map +1 -0
- package/dist/{chunk-3IYZ5IGG.js → chunk-5WKUGEBY.js} +2 -2
- package/dist/{chunk-3RMKLXHX.js → chunk-63ZQ5RIN.js} +2 -2
- package/dist/{chunk-M3WTHJHJ.js → chunk-67DIEA53.js} +385 -148
- package/dist/chunk-67DIEA53.js.map +1 -0
- package/dist/{chunk-YS3AZQ2G.js → chunk-6HFAW2MH.js} +1 -1
- package/dist/chunk-6HFAW2MH.js.map +1 -0
- package/dist/{chunk-EY4NZKDR.js → chunk-6Y2TKCNY.js} +2 -2
- package/dist/{chunk-76WT3HOR.js → chunk-6YZOXFPQ.js} +25 -24
- package/dist/chunk-6YZOXFPQ.js.map +1 -0
- package/dist/{chunk-G5ZBFPNU.js → chunk-A2RQOJC7.js} +2 -2
- package/dist/{chunk-AUIR5O6W.js → chunk-AFSB6NKM.js} +13 -19
- package/dist/chunk-AFSB6NKM.js.map +1 -0
- package/dist/{chunk-JCXGZRMU.js → chunk-AO4JEOKD.js} +22 -23
- package/dist/chunk-AO4JEOKD.js.map +1 -0
- package/dist/{chunk-TAAPQVZN.js → chunk-AYELIQXR.js} +2 -2
- package/dist/{chunk-QMM6O4CD.js → chunk-BLHZW7DG.js} +15 -3
- package/dist/{chunk-QMM6O4CD.js.map → chunk-BLHZW7DG.js.map} +1 -1
- package/dist/{chunk-TQOBJYDP.js → chunk-CD4N74YC.js} +1 -1
- package/dist/chunk-CD4N74YC.js.map +1 -0
- package/dist/{chunk-ANLBCBDC.js → chunk-CGE2HBTH.js} +11 -11
- package/dist/chunk-CGE2HBTH.js.map +1 -0
- package/dist/{chunk-OFADUJWJ.js → chunk-CYYSQMLO.js} +5 -5
- package/dist/chunk-CYYSQMLO.js.map +1 -0
- package/dist/{chunk-66ALHVEX.js → chunk-EB46EYI7.js} +3 -3
- package/dist/{chunk-NZJKFF45.js → chunk-EKCDHWRK.js} +4 -4
- package/dist/chunk-EKCDHWRK.js.map +1 -0
- package/dist/{chunk-BABLDP24.js → chunk-EPQFNJU3.js} +152 -7
- package/dist/chunk-EPQFNJU3.js.map +1 -0
- package/dist/{chunk-OGWBVHB3.js → chunk-ESR6HGOY.js} +73 -14
- package/dist/chunk-ESR6HGOY.js.map +1 -0
- package/dist/{chunk-NBD3KUOZ.js → chunk-F6RP62H3.js} +150 -98
- package/dist/chunk-F6RP62H3.js.map +1 -0
- package/dist/chunk-FBYW3QDI.js +252 -0
- package/dist/chunk-FBYW3QDI.js.map +1 -0
- package/dist/{chunk-IPF7E66P.js → chunk-FYAODKVP.js} +2 -2
- package/dist/chunk-GNEN7NKO.js +908 -0
- package/dist/chunk-GNEN7NKO.js.map +1 -0
- package/dist/chunk-GWSM4KLB.js +763 -0
- package/dist/chunk-GWSM4KLB.js.map +1 -0
- package/dist/{chunk-4SO6JMZL.js → chunk-HDMXCUZL.js} +1 -1
- package/dist/chunk-HDMXCUZL.js.map +1 -0
- package/dist/{chunk-ZFY7U2FR.js → chunk-HJM5Y5NU.js} +43 -3
- package/dist/chunk-HJM5Y5NU.js.map +1 -0
- package/dist/{chunk-ZGDVUPTM.js → chunk-IOZ3VKPK.js} +129 -68
- package/dist/chunk-IOZ3VKPK.js.map +1 -0
- package/dist/{chunk-PYOE4VSI.js → chunk-IVXSVHO4.js} +303 -247
- package/dist/chunk-IVXSVHO4.js.map +1 -0
- package/dist/chunk-J3CWXIPV.js +242 -0
- package/dist/chunk-J3CWXIPV.js.map +1 -0
- package/dist/chunk-K6JQW266.js +42 -0
- package/dist/chunk-K6JQW266.js.map +1 -0
- package/dist/chunk-KMZYQF6Q.js +202 -0
- package/dist/chunk-KMZYQF6Q.js.map +1 -0
- package/dist/{chunk-JWOYLO27.js → chunk-LPPZDFTD.js} +22 -12
- package/dist/chunk-LPPZDFTD.js.map +1 -0
- package/dist/{chunk-PAYXCY6A.js → chunk-MYB2B5WX.js} +997 -576
- package/dist/chunk-MYB2B5WX.js.map +1 -0
- package/dist/chunk-MYKNINNN.js +228 -0
- package/dist/chunk-MYKNINNN.js.map +1 -0
- package/dist/chunk-NSQIRMVF.js +27 -0
- package/dist/{chunk-QCHIQWAJ.js.map → chunk-NSQIRMVF.js.map} +1 -1
- package/dist/chunk-NUDBM4MM.js +30 -0
- package/dist/chunk-NUDBM4MM.js.map +1 -0
- package/dist/chunk-NZMWWDAY.js +23 -0
- package/dist/chunk-NZMWWDAY.js.map +1 -0
- package/dist/{chunk-RNFE3ML2.js → chunk-OCUV2Y25.js} +4 -3
- package/dist/chunk-OCUV2Y25.js.map +1 -0
- package/dist/chunk-P4ZJOQA7.js +271 -0
- package/dist/chunk-P4ZJOQA7.js.map +1 -0
- package/dist/chunk-P6C5EZ3D.js +342 -0
- package/dist/chunk-P6C5EZ3D.js.map +1 -0
- package/dist/{chunk-CW6T36TN.js → chunk-PBD7BJUN.js} +62 -4
- package/dist/chunk-PBD7BJUN.js.map +1 -0
- package/dist/chunk-PBIUCQY3.js +696 -0
- package/dist/chunk-PBIUCQY3.js.map +1 -0
- package/dist/chunk-PD6YECQH.js +845 -0
- package/dist/chunk-PD6YECQH.js.map +1 -0
- package/dist/{chunk-M7IYCTJV.js → chunk-R4LFQGP3.js} +2 -2
- package/dist/chunk-RHJIGDUE.js +21 -0
- package/dist/chunk-RHJIGDUE.js.map +1 -0
- package/dist/{chunk-KP7MUZNX.js → chunk-RLXO27MW.js} +30 -8
- package/dist/chunk-RLXO27MW.js.map +1 -0
- package/dist/{chunk-DFNM3WX2.js → chunk-S44BEV4B.js} +168 -45
- package/dist/chunk-S44BEV4B.js.map +1 -0
- package/dist/chunk-S4S5N4BJ.js +1461 -0
- package/dist/chunk-S4S5N4BJ.js.map +1 -0
- package/dist/{chunk-BZ2SHDN2.js → chunk-SGTRAXXX.js} +3 -3
- package/dist/chunk-SGTRAXXX.js.map +1 -0
- package/dist/{chunk-M2RGJPXX.js → chunk-SJAE5PB5.js} +3 -3
- package/dist/{chunk-JGIWG6SR.js → chunk-SNPNHU3H.js} +3937 -1776
- package/dist/chunk-SNPNHU3H.js.map +1 -0
- package/dist/{chunk-IHVBV5C2.js → chunk-SOOBFXRR.js} +94 -71
- package/dist/chunk-SOOBFXRR.js.map +1 -0
- package/dist/{chunk-ZDTRWK5F.js → chunk-TAHFWKS6.js} +2 -2
- package/dist/chunk-UEFFTVPY.js +9 -0
- package/dist/chunk-UEFFTVPY.js.map +1 -0
- package/dist/{chunk-24VULZ7A.js → chunk-UR5BXLBP.js} +3 -3
- package/dist/chunk-UR5BXLBP.js.map +1 -0
- package/dist/{chunk-DMBALCE2.js → chunk-V2SBGVDO.js} +471 -186
- package/dist/chunk-V2SBGVDO.js.map +1 -0
- package/dist/chunk-VJLWD47W.js +23 -0
- package/dist/chunk-VJLWD47W.js.map +1 -0
- package/dist/{chunk-4CQAV7YB.js → chunk-W647DX5Z.js} +2 -2
- package/dist/{chunk-THATMZXD.js → chunk-WFIIU3YZ.js} +2 -2
- package/dist/{chunk-THATMZXD.js.map → chunk-WFIIU3YZ.js.map} +1 -1
- package/dist/chunk-YZDJMAKL.js +82 -0
- package/dist/chunk-YZDJMAKL.js.map +1 -0
- package/dist/{chunk-3TMODYZV.js → chunk-Z5XH6VHY.js} +5 -5
- package/dist/chunk-Z5XH6VHY.js.map +1 -0
- package/dist/{chunk-BE3HW4FY.js → chunk-ZBBMZMA6.js} +377 -170
- package/dist/chunk-ZBBMZMA6.js.map +1 -0
- package/dist/index.cjs +21224 -11714
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +195 -49
- package/dist/index.d.ts +195 -49
- package/dist/index.js +150 -74
- package/dist/index.js.map +1 -1
- package/dist/{ir-BMP7yxJJ.d.cts → ir-BSosEwc8.d.cts} +1 -1
- package/dist/{ir-DUOz6H-5.d.ts → ir-D-uqwL_4.d.ts} +1 -1
- package/dist/{module-B8CBqIZ_.d.cts → module-Ds4tarcI.d.cts} +230 -140
- package/dist/{module-k7m3txak.d.ts → module-Zd1Gn-Nj.d.ts} +230 -140
- package/package.json +20 -4
- package/dist/ModuleTag-C8FHY_sY.d.ts +0 -93
- package/dist/ModuleTag-EGbgBMpZ.d.cts +0 -93
- package/dist/Observability-COqEvp2C.d.cts +0 -713
- package/dist/Observability-cY4kLn0S.d.ts +0 -713
- package/dist/ReadQuery-BlMwhe-F.d.ts +0 -30
- package/dist/ReadQuery-CL5XlXts.d.cts +0 -30
- package/dist/ReadQuery-SinbStGF.d.cts +0 -38
- package/dist/ReadQuery-SinbStGF.d.ts +0 -38
- package/dist/chunk-24VULZ7A.js.map +0 -1
- package/dist/chunk-3QMIVH35.js +0 -43
- package/dist/chunk-3QMIVH35.js.map +0 -1
- package/dist/chunk-3TMODYZV.js.map +0 -1
- package/dist/chunk-4SO6JMZL.js.map +0 -1
- package/dist/chunk-76WT3HOR.js.map +0 -1
- package/dist/chunk-ANLBCBDC.js.map +0 -1
- package/dist/chunk-AUIR5O6W.js.map +0 -1
- package/dist/chunk-BABLDP24.js.map +0 -1
- package/dist/chunk-BE3HW4FY.js.map +0 -1
- package/dist/chunk-BZ2SHDN2.js.map +0 -1
- package/dist/chunk-CW6T36TN.js.map +0 -1
- package/dist/chunk-DFNM3WX2.js.map +0 -1
- package/dist/chunk-DMBALCE2.js.map +0 -1
- package/dist/chunk-EGK3KN7B.js +0 -406
- package/dist/chunk-EGK3KN7B.js.map +0 -1
- package/dist/chunk-GMPEOUP2.js.map +0 -1
- package/dist/chunk-IHVBV5C2.js.map +0 -1
- package/dist/chunk-JCXGZRMU.js.map +0 -1
- package/dist/chunk-JGIWG6SR.js.map +0 -1
- package/dist/chunk-JWOYLO27.js.map +0 -1
- package/dist/chunk-KIXAU3GM.js +0 -137
- package/dist/chunk-KIXAU3GM.js.map +0 -1
- package/dist/chunk-KL5ACTCT.js +0 -8
- package/dist/chunk-KL5ACTCT.js.map +0 -1
- package/dist/chunk-KP7MUZNX.js.map +0 -1
- package/dist/chunk-M3BFQ7HK.js +0 -13
- package/dist/chunk-M3BFQ7HK.js.map +0 -1
- package/dist/chunk-M3WTHJHJ.js.map +0 -1
- package/dist/chunk-NBD3KUOZ.js.map +0 -1
- package/dist/chunk-NQZ2OSGR.js +0 -151
- package/dist/chunk-NQZ2OSGR.js.map +0 -1
- package/dist/chunk-NZJKFF45.js.map +0 -1
- package/dist/chunk-OFADUJWJ.js.map +0 -1
- package/dist/chunk-OGWBVHB3.js.map +0 -1
- package/dist/chunk-PAYXCY6A.js.map +0 -1
- package/dist/chunk-PYOE4VSI.js.map +0 -1
- package/dist/chunk-QCHIQWAJ.js +0 -21
- package/dist/chunk-RNFE3ML2.js.map +0 -1
- package/dist/chunk-TKZ7MEIA.js +0 -27
- package/dist/chunk-TKZ7MEIA.js.map +0 -1
- package/dist/chunk-TQOBJYDP.js.map +0 -1
- package/dist/chunk-VZB726PE.js +0 -93
- package/dist/chunk-VZB726PE.js.map +0 -1
- package/dist/chunk-W3TEWHLO.js +0 -568
- package/dist/chunk-W3TEWHLO.js.map +0 -1
- package/dist/chunk-YS3AZQ2G.js.map +0 -1
- package/dist/chunk-ZFLHVFUC.js +0 -192
- package/dist/chunk-ZFLHVFUC.js.map +0 -1
- package/dist/chunk-ZFY7U2FR.js.map +0 -1
- package/dist/chunk-ZGDVUPTM.js.map +0 -1
- package/dist/protocol-g_1897M2.d.cts +0 -127
- package/dist/protocol-g_1897M2.d.ts +0 -127
- /package/dist/{chunk-3IYZ5IGG.js.map → chunk-5WKUGEBY.js.map} +0 -0
- /package/dist/{chunk-3RMKLXHX.js.map → chunk-63ZQ5RIN.js.map} +0 -0
- /package/dist/{chunk-EY4NZKDR.js.map → chunk-6Y2TKCNY.js.map} +0 -0
- /package/dist/{chunk-G5ZBFPNU.js.map → chunk-A2RQOJC7.js.map} +0 -0
- /package/dist/{chunk-TAAPQVZN.js.map → chunk-AYELIQXR.js.map} +0 -0
- /package/dist/{chunk-66ALHVEX.js.map → chunk-EB46EYI7.js.map} +0 -0
- /package/dist/{chunk-IPF7E66P.js.map → chunk-FYAODKVP.js.map} +0 -0
- /package/dist/{chunk-M7IYCTJV.js.map → chunk-R4LFQGP3.js.map} +0 -0
- /package/dist/{chunk-M2RGJPXX.js.map → chunk-SJAE5PB5.js.map} +0 -0
- /package/dist/{chunk-ZDTRWK5F.js.map → chunk-TAHFWKS6.js.map} +0 -0
- /package/dist/{chunk-4CQAV7YB.js.map → chunk-W647DX5Z.js.map} +0 -0
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isJsonValue,
|
|
3
|
+
projectJsonValue
|
|
4
|
+
} from "./chunk-LPPZDFTD.js";
|
|
5
|
+
import {
|
|
6
|
+
fnv1a32,
|
|
7
|
+
stableStringify
|
|
8
|
+
} from "./chunk-4MZ7BT3R.js";
|
|
9
|
+
|
|
10
|
+
// src/internal/workflow/errors.ts
|
|
11
|
+
var toJsonValue = (detail) => {
|
|
12
|
+
if (isJsonValue(detail)) return detail;
|
|
13
|
+
return projectJsonValue(detail).value;
|
|
14
|
+
};
|
|
15
|
+
var makeWorkflowError = (args) => {
|
|
16
|
+
const detailJson = args.detail !== void 0 ? toJsonValue(args.detail) : void 0;
|
|
17
|
+
const msg = args.detail !== void 0 ? `${args.message}
|
|
18
|
+
(detail=${stableStringify(detailJson)})` : args.message;
|
|
19
|
+
return Object.assign(new Error(msg), {
|
|
20
|
+
_tag: "WorkflowError",
|
|
21
|
+
code: args.code,
|
|
22
|
+
programId: args.programId,
|
|
23
|
+
source: args.source,
|
|
24
|
+
detail: detailJson
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/internal/workflow/inputExpr.ts
|
|
29
|
+
var decodePointerToken = (raw) => raw.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
30
|
+
var isIndexToken = (token) => token === "0" || !token.startsWith("0") && /^\d+$/.test(token);
|
|
31
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
32
|
+
var parseJsonPointer = (pointer) => {
|
|
33
|
+
if (pointer === "") return [];
|
|
34
|
+
if (!pointer.startsWith("/")) {
|
|
35
|
+
throw makeWorkflowError({
|
|
36
|
+
code: "WORKFLOW_INVALID_JSON_POINTER",
|
|
37
|
+
message: 'Invalid JSON Pointer (must be "" or start with "/").',
|
|
38
|
+
detail: { pointer }
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const raw = pointer.split("/").slice(1);
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const part of raw) {
|
|
44
|
+
const decoded = decodePointerToken(part);
|
|
45
|
+
out.push(isIndexToken(decoded) ? Number(decoded) : decoded);
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
};
|
|
49
|
+
var compileInputExpr = (expr, pathForError) => {
|
|
50
|
+
switch (expr.kind) {
|
|
51
|
+
case "payload":
|
|
52
|
+
return { kind: "payload" };
|
|
53
|
+
case "payload.path": {
|
|
54
|
+
const pointer = expr.pointer;
|
|
55
|
+
if (typeof pointer !== "string") {
|
|
56
|
+
throw makeWorkflowError({
|
|
57
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
58
|
+
message: "InputExpr.payload.path.pointer must be a string.",
|
|
59
|
+
source: { stepKey: pathForError?.stepKey },
|
|
60
|
+
detail: { pointer }
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return { kind: "payload.path", pointer, tokens: parseJsonPointer(pointer) };
|
|
64
|
+
}
|
|
65
|
+
case "const": {
|
|
66
|
+
const value = expr.value;
|
|
67
|
+
if (!isJsonValue(value)) {
|
|
68
|
+
throw makeWorkflowError({
|
|
69
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
70
|
+
message: "InputExpr.const.value must be JSON-serializable.",
|
|
71
|
+
source: { stepKey: pathForError?.stepKey },
|
|
72
|
+
detail: { value }
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return { kind: "const", value };
|
|
76
|
+
}
|
|
77
|
+
case "object": {
|
|
78
|
+
const fields = expr.fields;
|
|
79
|
+
if (!fields || typeof fields !== "object" || Array.isArray(fields)) {
|
|
80
|
+
throw makeWorkflowError({
|
|
81
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
82
|
+
message: "InputExpr.object.fields must be a record.",
|
|
83
|
+
source: { stepKey: pathForError?.stepKey }
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const entries = Object.entries(fields).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
87
|
+
return {
|
|
88
|
+
kind: "object",
|
|
89
|
+
fields: entries.map(([k, v]) => [k, compileInputExpr(v, pathForError)])
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
case "merge": {
|
|
93
|
+
const items = expr.items;
|
|
94
|
+
if (!Array.isArray(items)) {
|
|
95
|
+
throw makeWorkflowError({
|
|
96
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
97
|
+
message: "InputExpr.merge.items must be an array.",
|
|
98
|
+
source: { stepKey: pathForError?.stepKey }
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
for (const item of items) {
|
|
102
|
+
const kind = isRecord(item) ? item.kind : void 0;
|
|
103
|
+
if (kind !== "object") {
|
|
104
|
+
throw makeWorkflowError({
|
|
105
|
+
code: "WORKFLOW_INVALID_MERGE_ITEMS",
|
|
106
|
+
message: "InputExpr.merge.items must all be InputExpr.object.",
|
|
107
|
+
source: { stepKey: pathForError?.stepKey },
|
|
108
|
+
detail: { kind }
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
kind: "merge",
|
|
114
|
+
items: items.map((i) => compileInputExpr(i, pathForError))
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var isPlainRecord = (value) => {
|
|
120
|
+
if (typeof value !== "object" || value === null) return false;
|
|
121
|
+
if (Array.isArray(value)) return false;
|
|
122
|
+
const proto = Object.getPrototypeOf(value);
|
|
123
|
+
return proto === Object.prototype || proto === null;
|
|
124
|
+
};
|
|
125
|
+
var evalPointer = (root, tokens) => {
|
|
126
|
+
let current = root;
|
|
127
|
+
for (const token of tokens) {
|
|
128
|
+
if (current == null) return void 0;
|
|
129
|
+
if (Array.isArray(current) && typeof token === "number") {
|
|
130
|
+
current = current[token];
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (typeof current !== "object") return void 0;
|
|
134
|
+
const key = typeof token === "number" ? String(token) : token;
|
|
135
|
+
current = current[key];
|
|
136
|
+
}
|
|
137
|
+
return current;
|
|
138
|
+
};
|
|
139
|
+
var evalInputExpr = (expr, payload) => {
|
|
140
|
+
switch (expr.kind) {
|
|
141
|
+
case "payload":
|
|
142
|
+
return payload;
|
|
143
|
+
case "payload.path":
|
|
144
|
+
return evalPointer(payload, expr.tokens);
|
|
145
|
+
case "const":
|
|
146
|
+
return expr.value;
|
|
147
|
+
case "object": {
|
|
148
|
+
const out = {};
|
|
149
|
+
for (const [k, v] of expr.fields) {
|
|
150
|
+
out[k] = evalInputExpr(v, payload);
|
|
151
|
+
}
|
|
152
|
+
return out;
|
|
153
|
+
}
|
|
154
|
+
case "merge": {
|
|
155
|
+
const out = {};
|
|
156
|
+
for (const item of expr.items) {
|
|
157
|
+
const value = evalInputExpr(item, payload);
|
|
158
|
+
if (isPlainRecord(value)) {
|
|
159
|
+
for (const [k, v] of Object.entries(value)) {
|
|
160
|
+
out[k] = v;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return out;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// src/internal/workflow/compiler.ts
|
|
170
|
+
var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
171
|
+
var asNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
172
|
+
var asNonNegInt = (value) => {
|
|
173
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
174
|
+
const n = Math.floor(value);
|
|
175
|
+
return n >= 0 ? n : void 0;
|
|
176
|
+
};
|
|
177
|
+
var asPosInt = (value) => {
|
|
178
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
|
|
179
|
+
const n = Math.floor(value);
|
|
180
|
+
return n > 0 ? n : void 0;
|
|
181
|
+
};
|
|
182
|
+
var normalizeWorkflowDefV1 = (input) => {
|
|
183
|
+
const normalizeStep = (step) => {
|
|
184
|
+
if (!isRecord2(step)) return step;
|
|
185
|
+
if (step.kind !== "call") return step;
|
|
186
|
+
const raw = step;
|
|
187
|
+
const onSuccessRaw = Array.isArray(raw.onSuccess) ? raw.onSuccess : [];
|
|
188
|
+
const onFailureRaw = Array.isArray(raw.onFailure) ? raw.onFailure : [];
|
|
189
|
+
return {
|
|
190
|
+
...step,
|
|
191
|
+
onSuccess: onSuccessRaw.map(normalizeStep),
|
|
192
|
+
onFailure: onFailureRaw.map(normalizeStep)
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
const normalizeSteps = (steps) => steps.map(normalizeStep);
|
|
196
|
+
return {
|
|
197
|
+
...input,
|
|
198
|
+
steps: normalizeSteps(input.steps)
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
function validateWorkflowDefV1(def, options) {
|
|
202
|
+
if (!isRecord2(def)) {
|
|
203
|
+
throw makeWorkflowError({
|
|
204
|
+
code: "WORKFLOW_INVALID_DEF",
|
|
205
|
+
message: "WorkflowDef must be an object.",
|
|
206
|
+
detail: { def }
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (def.astVersion !== 1) {
|
|
210
|
+
throw makeWorkflowError({
|
|
211
|
+
code: "WORKFLOW_UNSUPPORTED_VERSION",
|
|
212
|
+
message: "Unsupported workflow astVersion.",
|
|
213
|
+
detail: { astVersion: def.astVersion }
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
if (!asNonEmptyString(def.localId)) {
|
|
217
|
+
throw makeWorkflowError({
|
|
218
|
+
code: "WORKFLOW_INVALID_DEF",
|
|
219
|
+
message: "WorkflowDef.localId must be a non-empty string.",
|
|
220
|
+
detail: { localId: def.localId }
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
const trigger = def.trigger;
|
|
224
|
+
if (!isRecord2(trigger)) {
|
|
225
|
+
throw makeWorkflowError({
|
|
226
|
+
code: "WORKFLOW_INVALID_TRIGGER",
|
|
227
|
+
message: "Workflow trigger must be an object.",
|
|
228
|
+
detail: { trigger }
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
if (trigger.kind === "action") {
|
|
232
|
+
if (!asNonEmptyString(trigger.actionTag)) {
|
|
233
|
+
throw makeWorkflowError({
|
|
234
|
+
code: "WORKFLOW_INVALID_TRIGGER",
|
|
235
|
+
message: "Workflow trigger.actionTag must be a non-empty string.",
|
|
236
|
+
detail: { trigger }
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
} else if (trigger.kind === "lifecycle") {
|
|
240
|
+
const phase = trigger.phase;
|
|
241
|
+
if (phase !== "onStart" && phase !== "onInit") {
|
|
242
|
+
throw makeWorkflowError({
|
|
243
|
+
code: "WORKFLOW_INVALID_TRIGGER",
|
|
244
|
+
message: 'Workflow trigger.phase must be "onStart" or "onInit".',
|
|
245
|
+
detail: { trigger }
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
} else {
|
|
249
|
+
throw makeWorkflowError({
|
|
250
|
+
code: "WORKFLOW_INVALID_TRIGGER",
|
|
251
|
+
message: 'Workflow trigger.kind must be "action" or "lifecycle".',
|
|
252
|
+
detail: { trigger }
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
if (!Array.isArray(def.steps)) {
|
|
256
|
+
throw makeWorkflowError({
|
|
257
|
+
code: "WORKFLOW_INVALID_DEF",
|
|
258
|
+
message: "WorkflowDef.steps must be an array.",
|
|
259
|
+
detail: { steps: def.steps }
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
const seenKeys = /* @__PURE__ */ new Set();
|
|
263
|
+
const visit = (step, fragmentId) => {
|
|
264
|
+
if (!isRecord2(step)) {
|
|
265
|
+
throw makeWorkflowError({
|
|
266
|
+
code: "WORKFLOW_INVALID_STEP",
|
|
267
|
+
message: "Workflow step must be an object.",
|
|
268
|
+
detail: { step },
|
|
269
|
+
source: fragmentId ? { fragmentId } : void 0
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
const key = asNonEmptyString(step.key);
|
|
273
|
+
if (!key) {
|
|
274
|
+
throw makeWorkflowError({
|
|
275
|
+
code: "WORKFLOW_INVALID_STEP",
|
|
276
|
+
message: "Workflow step.key must be a non-empty string.",
|
|
277
|
+
detail: { stepKey: step.key, kind: step.kind },
|
|
278
|
+
source: fragmentId ? { fragmentId } : void 0
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if (seenKeys.has(key)) {
|
|
282
|
+
throw makeWorkflowError({
|
|
283
|
+
code: "WORKFLOW_DUPLICATE_STEP_KEY",
|
|
284
|
+
message: `Duplicate stepKey "${key}" detected.`,
|
|
285
|
+
detail: { duplicateKey: key },
|
|
286
|
+
source: { stepKey: key, ...fragmentId ? { fragmentId } : null }
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
seenKeys.add(key);
|
|
290
|
+
if (step.kind === "dispatch") {
|
|
291
|
+
if (!asNonEmptyString(step.actionTag)) {
|
|
292
|
+
throw makeWorkflowError({
|
|
293
|
+
code: "WORKFLOW_INVALID_STEP",
|
|
294
|
+
message: "dispatch.actionTag must be a non-empty string.",
|
|
295
|
+
source: { stepKey: key, ...fragmentId ? { fragmentId } : null },
|
|
296
|
+
detail: { actionTag: step.actionTag }
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
const payload = step.payload;
|
|
300
|
+
if (payload !== void 0) {
|
|
301
|
+
validateInputExpr(payload, { stepKey: key });
|
|
302
|
+
}
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
if (step.kind === "delay") {
|
|
306
|
+
const ms = asNonNegInt(step.ms);
|
|
307
|
+
if (ms === void 0) {
|
|
308
|
+
throw makeWorkflowError({
|
|
309
|
+
code: "WORKFLOW_INVALID_STEP",
|
|
310
|
+
message: "delay.ms must be a non-negative integer.",
|
|
311
|
+
source: { stepKey: key, ...fragmentId ? { fragmentId } : null },
|
|
312
|
+
detail: { ms: step.ms }
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
if (step.kind === "call") {
|
|
318
|
+
if (!asNonEmptyString(step.serviceId)) {
|
|
319
|
+
throw makeWorkflowError({
|
|
320
|
+
code: "WORKFLOW_INVALID_SERVICE_ID",
|
|
321
|
+
message: "call.serviceId must be a non-empty string.",
|
|
322
|
+
source: { stepKey: key, ...fragmentId ? { fragmentId } : null },
|
|
323
|
+
detail: { serviceId: step.serviceId }
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
const inputExpr = step.input;
|
|
327
|
+
if (inputExpr !== void 0) {
|
|
328
|
+
validateInputExpr(inputExpr, { stepKey: key });
|
|
329
|
+
}
|
|
330
|
+
const timeoutMsRaw = step.timeoutMs;
|
|
331
|
+
if (timeoutMsRaw !== void 0 && asPosInt(timeoutMsRaw) === void 0) {
|
|
332
|
+
throw makeWorkflowError({
|
|
333
|
+
code: "WORKFLOW_INVALID_STEP",
|
|
334
|
+
message: "call.timeoutMs must be a positive integer (milliseconds).",
|
|
335
|
+
source: { stepKey: key, ...fragmentId ? { fragmentId } : null },
|
|
336
|
+
detail: { timeoutMs: timeoutMsRaw }
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
const retryRaw = step.retry;
|
|
340
|
+
if (retryRaw !== void 0) {
|
|
341
|
+
const times = isRecord2(retryRaw) ? asPosInt(retryRaw.times) : void 0;
|
|
342
|
+
if (times === void 0) {
|
|
343
|
+
throw makeWorkflowError({
|
|
344
|
+
code: "WORKFLOW_INVALID_STEP",
|
|
345
|
+
message: "call.retry.times must be a positive integer.",
|
|
346
|
+
source: { stepKey: key, ...fragmentId ? { fragmentId } : null },
|
|
347
|
+
detail: { retry: retryRaw }
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const onSuccess = Array.isArray(step.onSuccess) ? step.onSuccess : [];
|
|
352
|
+
const onFailure = Array.isArray(step.onFailure) ? step.onFailure : [];
|
|
353
|
+
for (const inner of onSuccess) visit(inner, fragmentId);
|
|
354
|
+
for (const inner of onFailure) visit(inner, fragmentId);
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
throw makeWorkflowError({
|
|
358
|
+
code: "WORKFLOW_INVALID_STEP",
|
|
359
|
+
message: "Unknown step kind.",
|
|
360
|
+
source: { stepKey: key, ...fragmentId ? { fragmentId } : null },
|
|
361
|
+
detail: { kind: step.kind }
|
|
362
|
+
});
|
|
363
|
+
};
|
|
364
|
+
const sources = def.sources;
|
|
365
|
+
const fragmentByStepKey = /* @__PURE__ */ new Map();
|
|
366
|
+
if (sources && typeof sources === "object") {
|
|
367
|
+
for (const [k, v] of Object.entries(sources)) {
|
|
368
|
+
fragmentByStepKey.set(k, isRecord2(v) ? asNonEmptyString(v.fragmentId) : void 0);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
for (const step of def.steps) {
|
|
372
|
+
const key = isRecord2(step) ? asNonEmptyString(step.key) : void 0;
|
|
373
|
+
const fragmentId = key ? fragmentByStepKey.get(key) : void 0;
|
|
374
|
+
visit(step, fragmentId);
|
|
375
|
+
}
|
|
376
|
+
const generator = isRecord2(def.meta) ? def.meta.generator : void 0;
|
|
377
|
+
if (generator !== void 0 && !isJsonValue(generator)) {
|
|
378
|
+
throw makeWorkflowError({
|
|
379
|
+
code: "WORKFLOW_INVALID_DEF",
|
|
380
|
+
message: "WorkflowDef.meta.generator must be JSON-serializable.",
|
|
381
|
+
detail: { generator }
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
const policy = isRecord2(def.policy) ? def.policy : void 0;
|
|
385
|
+
if (policy) {
|
|
386
|
+
const concurrency = policy.concurrency;
|
|
387
|
+
if (concurrency !== void 0 && concurrency !== "latest" && concurrency !== "exhaust" && concurrency !== "parallel") {
|
|
388
|
+
throw makeWorkflowError({
|
|
389
|
+
code: "WORKFLOW_INVALID_DEF",
|
|
390
|
+
message: "policy.concurrency must be latest|exhaust|parallel.",
|
|
391
|
+
detail: { concurrency }
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
const priority = policy.priority;
|
|
395
|
+
if (priority !== void 0 && priority !== "urgent" && priority !== "nonUrgent") {
|
|
396
|
+
throw makeWorkflowError({
|
|
397
|
+
code: "WORKFLOW_INVALID_DEF",
|
|
398
|
+
message: "policy.priority must be urgent|nonUrgent.",
|
|
399
|
+
detail: { priority }
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
void options?.moduleId;
|
|
404
|
+
}
|
|
405
|
+
var validateInputExpr = (expr, options) => {
|
|
406
|
+
const visit = (e) => {
|
|
407
|
+
if (!isRecord2(e)) {
|
|
408
|
+
throw makeWorkflowError({
|
|
409
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
410
|
+
message: "InputExpr must be an object.",
|
|
411
|
+
source: { stepKey: options?.stepKey },
|
|
412
|
+
detail: { expr: e }
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
const kind = e.kind;
|
|
416
|
+
switch (kind) {
|
|
417
|
+
case "payload":
|
|
418
|
+
return;
|
|
419
|
+
case "payload.path": {
|
|
420
|
+
const pointer = e.pointer;
|
|
421
|
+
if (typeof pointer !== "string") {
|
|
422
|
+
throw makeWorkflowError({
|
|
423
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
424
|
+
message: "InputExpr.payload.path.pointer must be a string.",
|
|
425
|
+
source: { stepKey: options?.stepKey },
|
|
426
|
+
detail: { pointer }
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
case "const": {
|
|
432
|
+
const value = e.value;
|
|
433
|
+
if (!isJsonValue(value)) {
|
|
434
|
+
throw makeWorkflowError({
|
|
435
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
436
|
+
message: "InputExpr.const.value must be JSON-serializable.",
|
|
437
|
+
source: { stepKey: options?.stepKey }
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
case "object": {
|
|
443
|
+
const fields = e.fields;
|
|
444
|
+
if (!isRecord2(fields)) {
|
|
445
|
+
throw makeWorkflowError({
|
|
446
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
447
|
+
message: "InputExpr.object.fields must be a record.",
|
|
448
|
+
source: { stepKey: options?.stepKey }
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
for (const v of Object.values(fields)) {
|
|
452
|
+
visit(v);
|
|
453
|
+
}
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
case "merge": {
|
|
457
|
+
const items = e.items;
|
|
458
|
+
if (!Array.isArray(items)) {
|
|
459
|
+
throw makeWorkflowError({
|
|
460
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
461
|
+
message: "InputExpr.merge.items must be an array.",
|
|
462
|
+
source: { stepKey: options?.stepKey }
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
for (const item of items) {
|
|
466
|
+
visit(item);
|
|
467
|
+
}
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
default:
|
|
471
|
+
throw makeWorkflowError({
|
|
472
|
+
code: "WORKFLOW_INVALID_INPUT_EXPR",
|
|
473
|
+
message: "Unknown InputExpr kind.",
|
|
474
|
+
source: { stepKey: options?.stepKey },
|
|
475
|
+
detail: { kind }
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
visit(expr);
|
|
480
|
+
};
|
|
481
|
+
var makeDigest = (prefix, value) => `${prefix}:${fnv1a32(stableStringify(value))}`;
|
|
482
|
+
var makeTriggerNodeId = (programId) => `wf_trigger_v1:${fnv1a32(programId)}`;
|
|
483
|
+
var makeStepNodeId = (programId, stepKey, kind) => `wf_node_v1:${fnv1a32(`${programId}\0${stepKey}\0${kind}`)}`;
|
|
484
|
+
var budgetJsonValue = (value) => projectJsonValue(value).value;
|
|
485
|
+
var budgetInputExpr = (expr) => {
|
|
486
|
+
switch (expr.kind) {
|
|
487
|
+
case "payload":
|
|
488
|
+
case "payload.path":
|
|
489
|
+
return expr;
|
|
490
|
+
case "const": {
|
|
491
|
+
const value = expr.value;
|
|
492
|
+
if (!isJsonValue(value)) return expr;
|
|
493
|
+
return { ...expr, value: budgetJsonValue(expr.value) };
|
|
494
|
+
}
|
|
495
|
+
case "object": {
|
|
496
|
+
const out = {};
|
|
497
|
+
for (const k of Object.keys(expr.fields).sort()) {
|
|
498
|
+
out[k] = budgetInputExpr(expr.fields[k]);
|
|
499
|
+
}
|
|
500
|
+
return { ...expr, fields: out };
|
|
501
|
+
}
|
|
502
|
+
case "merge":
|
|
503
|
+
return { ...expr, items: expr.items.map(budgetInputExpr) };
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
var toStaticStep = (step) => {
|
|
507
|
+
switch (step.kind) {
|
|
508
|
+
case "dispatch":
|
|
509
|
+
return {
|
|
510
|
+
kind: "dispatch",
|
|
511
|
+
actionTag: step.actionTag,
|
|
512
|
+
...step.payload ? { payload: budgetInputExpr(step.payload) } : null
|
|
513
|
+
};
|
|
514
|
+
case "delay":
|
|
515
|
+
return { kind: "delay", ms: step.ms };
|
|
516
|
+
case "call": {
|
|
517
|
+
const policy = step.timeoutMs !== void 0 || step.retry !== void 0 ? {
|
|
518
|
+
...step.timeoutMs !== void 0 ? { timeoutMs: step.timeoutMs } : null,
|
|
519
|
+
...step.retry !== void 0 ? { retry: { times: step.retry.times } } : null
|
|
520
|
+
} : void 0;
|
|
521
|
+
return {
|
|
522
|
+
kind: "call",
|
|
523
|
+
serviceId: step.serviceId,
|
|
524
|
+
...step.input ? { input: budgetInputExpr(step.input) } : null,
|
|
525
|
+
...policy ? { policy } : null
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
var compileWorkflowStaticIrV1 = (args) => {
|
|
531
|
+
const normalized = normalizeWorkflowDefV1(args.def);
|
|
532
|
+
validateWorkflowDefV1(normalized, { moduleId: args.moduleId });
|
|
533
|
+
const programId = `${args.moduleId}.${normalized.localId}`;
|
|
534
|
+
const triggerNodeId = makeTriggerNodeId(programId);
|
|
535
|
+
const fragmentByStepKey = /* @__PURE__ */ new Map();
|
|
536
|
+
if (normalized.sources && typeof normalized.sources === "object") {
|
|
537
|
+
for (const [k, v] of Object.entries(normalized.sources)) {
|
|
538
|
+
fragmentByStepKey.set(k, isRecord2(v) ? asNonEmptyString(v.fragmentId) : void 0);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
const nodesByKey = /* @__PURE__ */ new Map();
|
|
542
|
+
const collectNodes = (steps) => {
|
|
543
|
+
for (const step of steps) {
|
|
544
|
+
const id = makeStepNodeId(programId, step.key, step.kind);
|
|
545
|
+
nodesByKey.set(step.key, id);
|
|
546
|
+
if (step.kind === "call") {
|
|
547
|
+
collectNodes(step.onSuccess);
|
|
548
|
+
collectNodes(step.onFailure);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
collectNodes(normalized.steps);
|
|
553
|
+
const nodes = [
|
|
554
|
+
{
|
|
555
|
+
id: triggerNodeId,
|
|
556
|
+
kind: "trigger",
|
|
557
|
+
trigger: normalized.trigger
|
|
558
|
+
}
|
|
559
|
+
];
|
|
560
|
+
const addStepNodes = (steps) => {
|
|
561
|
+
for (const step of steps) {
|
|
562
|
+
const id = nodesByKey.get(step.key);
|
|
563
|
+
if (!id) continue;
|
|
564
|
+
const fragmentId = fragmentByStepKey.get(step.key);
|
|
565
|
+
nodes.push({
|
|
566
|
+
id,
|
|
567
|
+
kind: "step",
|
|
568
|
+
step: toStaticStep(step),
|
|
569
|
+
source: {
|
|
570
|
+
stepKey: step.key,
|
|
571
|
+
...fragmentId ? { fragmentId } : null
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
if (step.kind === "call") {
|
|
575
|
+
addStepNodes(step.onSuccess);
|
|
576
|
+
addStepNodes(step.onFailure);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
addStepNodes(normalized.steps);
|
|
581
|
+
const edges = [];
|
|
582
|
+
const pushEdge = (from, to, kind) => {
|
|
583
|
+
edges.push({ from, to, kind });
|
|
584
|
+
};
|
|
585
|
+
const compileBlock = (args2) => {
|
|
586
|
+
if (args2.steps.length === 0) {
|
|
587
|
+
if (args2.continuation) {
|
|
588
|
+
for (const from of args2.entryFrom) {
|
|
589
|
+
pushEdge(from, args2.continuation, args2.entryKind);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
const first = args2.steps[0];
|
|
595
|
+
const firstId = nodesByKey.get(first.key);
|
|
596
|
+
if (!firstId) {
|
|
597
|
+
throw makeWorkflowError({
|
|
598
|
+
code: "WORKFLOW_INVALID_STEP",
|
|
599
|
+
message: "Internal error: missing node id for stepKey.",
|
|
600
|
+
programId,
|
|
601
|
+
source: { stepKey: first.key }
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
for (const from of args2.entryFrom) {
|
|
605
|
+
pushEdge(from, firstId, args2.entryKind);
|
|
606
|
+
}
|
|
607
|
+
const compileStepAndTail = (step, tail, continuation) => {
|
|
608
|
+
const stepId = nodesByKey.get(step.key);
|
|
609
|
+
if (!stepId) return;
|
|
610
|
+
if (step.kind !== "call") {
|
|
611
|
+
compileBlock({ steps: tail, entryFrom: [stepId], entryKind: "next", continuation });
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
const cont = tail.length > 0 ? nodesByKey.get(tail[0].key) : continuation;
|
|
615
|
+
compileBlock({
|
|
616
|
+
steps: step.onSuccess,
|
|
617
|
+
entryFrom: [stepId],
|
|
618
|
+
entryKind: "success",
|
|
619
|
+
continuation: cont
|
|
620
|
+
});
|
|
621
|
+
compileBlock({
|
|
622
|
+
steps: step.onFailure,
|
|
623
|
+
entryFrom: [stepId],
|
|
624
|
+
entryKind: "failure",
|
|
625
|
+
continuation: cont
|
|
626
|
+
});
|
|
627
|
+
compileBlock({ steps: tail, entryFrom: [], entryKind: "next", continuation });
|
|
628
|
+
};
|
|
629
|
+
compileStepAndTail(first, args2.steps.slice(1), args2.continuation);
|
|
630
|
+
};
|
|
631
|
+
compileBlock({ steps: normalized.steps, entryFrom: [triggerNodeId], entryKind: "next", continuation: void 0 });
|
|
632
|
+
nodes.sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
633
|
+
edges.sort((a, b) => {
|
|
634
|
+
if (a.from !== b.from) return a.from < b.from ? -1 : 1;
|
|
635
|
+
if (a.to !== b.to) return a.to < b.to ? -1 : 1;
|
|
636
|
+
const ak = String(a.kind ?? "");
|
|
637
|
+
const bk = String(b.kind ?? "");
|
|
638
|
+
if (ak !== bk) return ak < bk ? -1 : 1;
|
|
639
|
+
return 0;
|
|
640
|
+
});
|
|
641
|
+
const meta = (() => {
|
|
642
|
+
const generator = normalized.meta?.generator;
|
|
643
|
+
if (generator === void 0) return void 0;
|
|
644
|
+
return { generator: budgetJsonValue(generator) };
|
|
645
|
+
})();
|
|
646
|
+
const irNoDigest = {
|
|
647
|
+
version: 1,
|
|
648
|
+
programId,
|
|
649
|
+
nodes,
|
|
650
|
+
edges,
|
|
651
|
+
policy: normalized.policy,
|
|
652
|
+
meta
|
|
653
|
+
};
|
|
654
|
+
const digest = makeDigest("workflow_ir_v1", irNoDigest);
|
|
655
|
+
return {
|
|
656
|
+
...irNoDigest,
|
|
657
|
+
digest
|
|
658
|
+
};
|
|
659
|
+
};
|
|
660
|
+
var compileWorkflowRuntimeStepsV1 = (args) => {
|
|
661
|
+
const normalized = normalizeWorkflowDefV1(args.def);
|
|
662
|
+
validateWorkflowDefV1(normalized);
|
|
663
|
+
const compileStep = (step) => {
|
|
664
|
+
const stepKey = step.key;
|
|
665
|
+
switch (step.kind) {
|
|
666
|
+
case "dispatch":
|
|
667
|
+
return {
|
|
668
|
+
kind: "dispatch",
|
|
669
|
+
key: step.key,
|
|
670
|
+
actionTag: step.actionTag,
|
|
671
|
+
...step.payload ? { payload: compileInputExpr(step.payload, { stepKey }) } : null
|
|
672
|
+
};
|
|
673
|
+
case "delay":
|
|
674
|
+
return { kind: "delay", key: step.key, ms: step.ms };
|
|
675
|
+
case "call": {
|
|
676
|
+
const retryTimes = step.retry?.times;
|
|
677
|
+
return {
|
|
678
|
+
kind: "call",
|
|
679
|
+
key: step.key,
|
|
680
|
+
serviceId: step.serviceId,
|
|
681
|
+
...step.input ? { input: compileInputExpr(step.input, { stepKey }) } : null,
|
|
682
|
+
...step.timeoutMs !== void 0 ? { timeoutMs: step.timeoutMs } : null,
|
|
683
|
+
...retryTimes !== void 0 ? { retryTimes } : null,
|
|
684
|
+
onSuccess: step.onSuccess.map(compileStep),
|
|
685
|
+
onFailure: step.onFailure.map(compileStep)
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
return normalized.steps.map(compileStep);
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
export {
|
|
694
|
+
makeWorkflowError,
|
|
695
|
+
evalInputExpr,
|
|
696
|
+
normalizeWorkflowDefV1,
|
|
697
|
+
validateWorkflowDefV1,
|
|
698
|
+
compileWorkflowStaticIrV1,
|
|
699
|
+
compileWorkflowRuntimeStepsV1
|
|
700
|
+
};
|
|
701
|
+
//# sourceMappingURL=chunk-3L6QGFMM.js.map
|