@mastra/server 1.0.4 → 1.1.0-alpha.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/CHANGELOG.md +194 -0
- package/a2a/store.d.ts +1 -0
- package/auth.d.ts +1 -0
- package/dist/{chunk-3REGEJEN.js → chunk-24SISJRB.js} +6 -6
- package/dist/chunk-24SISJRB.js.map +1 -0
- package/dist/{chunk-MPUVSOEU.cjs → chunk-2HOMKKY4.cjs} +21 -15
- package/dist/chunk-2HOMKKY4.cjs.map +1 -0
- package/dist/{chunk-HCVDHEDD.cjs → chunk-37DO73XV.cjs} +217 -167
- package/dist/chunk-37DO73XV.cjs.map +1 -0
- package/dist/{chunk-T4SPG2GP.cjs → chunk-4HFYR562.cjs} +4 -4
- package/dist/chunk-4HFYR562.cjs.map +1 -0
- package/dist/{chunk-2CYGIE3E.js → chunk-4JAEBN6N.js} +212 -86
- package/dist/chunk-4JAEBN6N.js.map +1 -0
- package/dist/{chunk-AVRO3FIN.cjs → chunk-4LVJBXI2.cjs} +97 -4
- package/dist/chunk-4LVJBXI2.cjs.map +1 -0
- package/dist/chunk-4UNYZYBB.cjs +253 -0
- package/dist/chunk-4UNYZYBB.cjs.map +1 -0
- package/dist/{chunk-CGIGPJRU.js → chunk-5P2VGES5.js} +72 -79
- package/dist/chunk-5P2VGES5.js.map +1 -0
- package/dist/{chunk-YK63KHHB.cjs → chunk-6DHJKQLP.cjs} +513 -168
- package/dist/chunk-6DHJKQLP.cjs.map +1 -0
- package/dist/{chunk-PNZQCQY4.cjs → chunk-6G2RQWKA.cjs} +15 -15
- package/dist/chunk-6G2RQWKA.cjs.map +1 -0
- package/dist/{chunk-4EYONQIW.cjs → chunk-7D3UAMQM.cjs} +4 -4
- package/dist/chunk-7D3UAMQM.cjs.map +1 -0
- package/dist/{chunk-I27H7BEB.js → chunk-7XIMPDJV.js} +9 -6
- package/dist/chunk-7XIMPDJV.js.map +1 -0
- package/dist/{chunk-2CLS2PYJ.js → chunk-7YCFHDWX.js} +398 -56
- package/dist/chunk-7YCFHDWX.js.map +1 -0
- package/dist/{chunk-33CKPQS4.cjs → chunk-A2K5ZL47.cjs} +36 -16
- package/dist/chunk-A2K5ZL47.cjs.map +1 -0
- package/dist/chunk-AAHPYUEC.cjs +211 -0
- package/dist/chunk-AAHPYUEC.cjs.map +1 -0
- package/dist/{chunk-NUO7HPOV.cjs → chunk-AN42MFD5.cjs} +235 -109
- package/dist/chunk-AN42MFD5.cjs.map +1 -0
- package/dist/{chunk-XCEQ4GQW.cjs → chunk-AO7LIZRK.cjs} +88 -99
- package/dist/chunk-AO7LIZRK.cjs.map +1 -0
- package/dist/{chunk-4DJ7EJRB.cjs → chunk-AV3VZ6S3.cjs} +25 -21
- package/dist/chunk-AV3VZ6S3.cjs.map +1 -0
- package/dist/{chunk-KKY4MSZO.js → chunk-BWINB344.js} +30 -11
- package/dist/chunk-BWINB344.js.map +1 -0
- package/dist/{chunk-GHQZIEPS.js → chunk-C4NZAUUW.js} +104 -54
- package/dist/chunk-C4NZAUUW.js.map +1 -0
- package/dist/{chunk-7S7ALPCY.js → chunk-D5VCL56B.js} +97 -5
- package/dist/chunk-D5VCL56B.js.map +1 -0
- package/dist/{chunk-XB27LCKO.js → chunk-DHDVJ5II.js} +15 -9
- package/dist/chunk-DHDVJ5II.js.map +1 -0
- package/dist/{chunk-GNCALVLC.js → chunk-ED6NQBHF.js} +23 -4
- package/dist/chunk-ED6NQBHF.js.map +1 -0
- package/dist/{chunk-5VDI75UV.js → chunk-EV5H2JQU.js} +5 -4
- package/dist/chunk-EV5H2JQU.js.map +1 -0
- package/dist/{chunk-4R2Z655M.js → chunk-F2WTCJ5C.js} +145 -67
- package/dist/chunk-F2WTCJ5C.js.map +1 -0
- package/dist/{chunk-FWSKVWS7.cjs → chunk-FRRHYZR6.cjs} +4 -4
- package/dist/chunk-FRRHYZR6.cjs.map +1 -0
- package/dist/chunk-GDWZ2R7I.js +220 -0
- package/dist/chunk-GDWZ2R7I.js.map +1 -0
- package/dist/{chunk-N4EIZSG2.js → chunk-GXUBQJ74.js} +15 -11
- package/dist/chunk-GXUBQJ74.js.map +1 -0
- package/dist/{chunk-UK4FZWNW.cjs → chunk-H4VFL22H.cjs} +52 -53
- package/dist/chunk-H4VFL22H.cjs.map +1 -0
- package/dist/chunk-H66LLFDL.js +1 -1
- package/dist/chunk-H66LLFDL.js.map +1 -1
- package/dist/{chunk-QPFYN6B5.cjs → chunk-HDGF45K7.cjs} +17 -14
- package/dist/chunk-HDGF45K7.cjs.map +1 -0
- package/dist/{chunk-P3H4AZKI.cjs → chunk-HZINLMHL.cjs} +15 -15
- package/dist/chunk-HZINLMHL.cjs.map +1 -0
- package/dist/{chunk-AV3CN5ZR.cjs → chunk-I3CJUT6J.cjs} +36 -17
- package/dist/chunk-I3CJUT6J.cjs.map +1 -0
- package/dist/{chunk-DVSCJECS.js → chunk-IS3HHGL4.js} +6 -6
- package/dist/chunk-IS3HHGL4.js.map +1 -0
- package/dist/{chunk-WJ6DNHLW.cjs → chunk-JRM3DWRM.cjs} +34 -24
- package/dist/chunk-JRM3DWRM.cjs.map +1 -0
- package/dist/{chunk-YN3FWKVQ.js → chunk-JUGGEWCR.js} +10 -13
- package/dist/chunk-JUGGEWCR.js.map +1 -0
- package/dist/{chunk-LF2ZLOFP.js → chunk-K2SXZLA3.cjs} +285 -3
- package/dist/chunk-K2SXZLA3.cjs.map +1 -0
- package/dist/{chunk-XOUK3IYU.js → chunk-K4HSW5ZF.js} +4 -4
- package/dist/chunk-K4HSW5ZF.js.map +1 -0
- package/dist/chunk-KPHPNRVH.js +651 -0
- package/dist/chunk-KPHPNRVH.js.map +1 -0
- package/dist/chunk-L6AKFVEX.cjs +678 -0
- package/dist/chunk-L6AKFVEX.cjs.map +1 -0
- package/dist/{chunk-GU4EWMZB.cjs → chunk-LFNP3ACE.js} +244 -4
- package/dist/chunk-LFNP3ACE.js.map +1 -0
- package/dist/chunk-LFTVDHOD.js +200 -0
- package/dist/chunk-LFTVDHOD.js.map +1 -0
- package/dist/{chunk-ZQ2G6QKS.cjs → chunk-MZRJNOYJ.cjs} +175 -97
- package/dist/chunk-MZRJNOYJ.cjs.map +1 -0
- package/dist/{chunk-G2AMUTU4.js → chunk-OS7SAIRA.js} +6 -6
- package/dist/chunk-OS7SAIRA.js.map +1 -0
- package/dist/{chunk-L2E5RUVT.cjs → chunk-PWXUI3OG.cjs} +15 -15
- package/dist/chunk-PWXUI3OG.cjs.map +1 -0
- package/dist/chunk-QRPQWZZU.cjs +708 -0
- package/dist/chunk-QRPQWZZU.cjs.map +1 -0
- package/dist/chunk-QWOQET2T.js +689 -0
- package/dist/chunk-QWOQET2T.js.map +1 -0
- package/dist/{chunk-EUBTCHQC.js → chunk-RIX6WEJ2.js} +4 -4
- package/dist/chunk-RIX6WEJ2.js.map +1 -0
- package/dist/{chunk-7XPMKW4Y.cjs → chunk-SONAXR2M.cjs} +12 -9
- package/dist/chunk-SONAXR2M.cjs.map +1 -0
- package/dist/{chunk-FLLJIPD4.cjs → chunk-T5KH32UA.cjs} +6 -5
- package/dist/chunk-T5KH32UA.cjs.map +1 -0
- package/dist/{chunk-3FEYUHHJ.js → chunk-TCWPL26W.js} +10 -7
- package/dist/chunk-TCWPL26W.js.map +1 -0
- package/dist/chunk-USR6JK77.js +62 -0
- package/dist/chunk-USR6JK77.js.map +1 -0
- package/dist/chunk-VX3VN7FN.cjs +1 -1
- package/dist/chunk-VX3VN7FN.cjs.map +1 -1
- package/dist/{chunk-6MP2S6VI.cjs → chunk-VXPVROQJ.cjs} +56 -48
- package/dist/chunk-VXPVROQJ.cjs.map +1 -0
- package/dist/{chunk-CLAEGIP5.cjs → chunk-WWVDNKEF.cjs} +14 -17
- package/dist/chunk-WWVDNKEF.cjs.map +1 -0
- package/dist/{chunk-5NFRDYFN.js → chunk-XKLJYRAA.js} +4 -4
- package/dist/chunk-XKLJYRAA.js.map +1 -0
- package/dist/{chunk-TMS4LS2J.js → chunk-XUSAKRLX.js} +26 -16
- package/dist/chunk-XUSAKRLX.js.map +1 -0
- package/dist/{chunk-IVGQTL3T.js → chunk-XXBURIYX.js} +36 -28
- package/dist/chunk-XXBURIYX.js.map +1 -0
- package/dist/{chunk-H34VRYSF.js → chunk-ZFHZRI6C.js} +26 -27
- package/dist/chunk-ZFHZRI6C.js.map +1 -0
- package/dist/chunk-ZKMVCV4G.cjs +71 -0
- package/dist/chunk-ZKMVCV4G.cjs.map +1 -0
- package/dist/docs/README.md +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/SOURCE_MAP.json +1 -1
- package/dist/docs/server/01-custom-adapters.md +10 -10
- package/dist/docs/server/02-reference.md +22 -8
- package/dist/server/auth/helpers.d.ts +8 -1
- package/dist/server/auth/helpers.d.ts.map +1 -1
- package/dist/server/auth/index.cjs +42 -131
- package/dist/server/auth/index.cjs.map +1 -1
- package/dist/server/auth/index.js +1 -125
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/auth/path-pattern.d.ts +43 -0
- package/dist/server/auth/path-pattern.d.ts.map +1 -0
- package/dist/server/constants.d.ts +51 -0
- package/dist/server/constants.d.ts.map +1 -0
- package/dist/server/handlers/a2a.cjs +9 -9
- package/dist/server/handlers/a2a.d.ts.map +1 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +16 -16
- package/dist/server/handlers/agent-builder.d.ts.map +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agent-versions.cjs +60 -0
- package/dist/server/handlers/agent-versions.cjs.map +1 -0
- package/dist/server/handlers/agent-versions.d.ts +457 -0
- package/dist/server/handlers/agent-versions.d.ts.map +1 -0
- package/dist/server/handlers/agent-versions.js +3 -0
- package/dist/server/handlers/agent-versions.js.map +1 -0
- package/dist/server/handlers/agents.cjs +40 -28
- package/dist/server/handlers/agents.d.ts +58 -5
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/logs.cjs +4 -4
- package/dist/server/handlers/logs.d.ts.map +1 -1
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/mcp.cjs +9 -9
- package/dist/server/handlers/mcp.d.ts +22 -0
- package/dist/server/handlers/mcp.d.ts.map +1 -1
- package/dist/server/handlers/mcp.js +1 -1
- package/dist/server/handlers/memory.cjs +25 -25
- package/dist/server/handlers/memory.d.ts +25 -1
- package/dist/server/handlers/memory.d.ts.map +1 -1
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/observability.cjs +5 -5
- package/dist/server/handlers/observability.d.ts +1 -0
- package/dist/server/handlers/observability.d.ts.map +1 -1
- package/dist/server/handlers/observability.js +1 -1
- package/dist/server/handlers/processors.cjs +4 -4
- package/dist/server/handlers/processors.d.ts.map +1 -1
- package/dist/server/handlers/processors.js +1 -1
- package/dist/server/handlers/scores.cjs +7 -7
- package/dist/server/handlers/scores.d.ts.map +1 -1
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/stored-agents.cjs +6 -6
- package/dist/server/handlers/stored-agents.d.ts +51 -14
- package/dist/server/handlers/stored-agents.d.ts.map +1 -1
- package/dist/server/handlers/stored-agents.js +1 -1
- package/dist/server/handlers/system.cjs +2 -2
- package/dist/server/handlers/system.d.ts.map +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/handlers/tools.cjs +6 -6
- package/dist/server/handlers/tools.d.ts +3 -3
- package/dist/server/handlers/tools.d.ts.map +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +21 -5
- package/dist/server/handlers/utils.d.ts +26 -0
- package/dist/server/handlers/utils.d.ts.map +1 -1
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/vector.cjs +13 -13
- package/dist/server/handlers/vector.d.ts.map +1 -1
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -8
- package/dist/server/handlers/voice.d.ts.map +1 -1
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +24 -24
- package/dist/server/handlers/workflows.d.ts +2 -0
- package/dist/server/handlers/workflows.d.ts.map +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers/workspace.cjs +80 -0
- package/dist/server/handlers/workspace.cjs.map +1 -0
- package/dist/server/handlers/workspace.d.ts +591 -0
- package/dist/server/handlers/workspace.d.ts.map +1 -0
- package/dist/server/handlers/workspace.js +3 -0
- package/dist/server/handlers/workspace.js.map +1 -0
- package/dist/server/handlers.cjs +24 -24
- package/dist/server/handlers.js +12 -12
- package/dist/server/schemas/agent-versions.d.ts +1073 -0
- package/dist/server/schemas/agent-versions.d.ts.map +1 -0
- package/dist/server/schemas/agents.d.ts +30 -19
- package/dist/server/schemas/agents.d.ts.map +1 -1
- package/dist/server/schemas/memory.d.ts +83 -31
- package/dist/server/schemas/memory.d.ts.map +1 -1
- package/dist/server/schemas/stored-agents.d.ts +270 -60
- package/dist/server/schemas/stored-agents.d.ts.map +1 -1
- package/dist/server/schemas/workspace.d.ts +1107 -0
- package/dist/server/schemas/workspace.d.ts.map +1 -0
- package/dist/server/server-adapter/index.cjs +298 -160
- package/dist/server/server-adapter/index.cjs.map +1 -1
- package/dist/server/server-adapter/index.d.ts +56 -2
- package/dist/server/server-adapter/index.d.ts.map +1 -1
- package/dist/server/server-adapter/index.js +158 -23
- package/dist/server/server-adapter/index.js.map +1 -1
- package/dist/server/server-adapter/openapi-utils.d.ts +10 -0
- package/dist/server/server-adapter/openapi-utils.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/agents.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/index.d.ts +3 -1
- package/dist/server/server-adapter/routes/index.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/route-builder.d.ts +2 -1
- package/dist/server/server-adapter/routes/route-builder.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/stored-agents.d.ts +1 -1
- package/dist/server/server-adapter/routes/stored-agents.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/workspace.d.ts +8 -0
- package/dist/server/server-adapter/routes/workspace.d.ts.map +1 -0
- package/dist/server/utils.d.ts +13 -0
- package/dist/server/utils.d.ts.map +1 -1
- package/dist/{token-6GSAFR2W-K2BTU23I-5WBYUIGY.cjs → token-6GSAFR2W-ABXTQD64-MC4IMVOB.cjs} +9 -9
- package/dist/token-6GSAFR2W-ABXTQD64-MC4IMVOB.cjs.map +1 -0
- package/dist/{token-6GSAFR2W-VLY2XUPA-NCSASMWN.js → token-6GSAFR2W-ABXTQD64-Z6U2TA2C.js} +6 -6
- package/dist/token-6GSAFR2W-ABXTQD64-Z6U2TA2C.js.map +1 -0
- package/dist/{token-6GSAFR2W-KVDFAJ2M-EPLMGMHT.cjs → token-6GSAFR2W-F2L44NEJ-B3QIV63M.cjs} +9 -9
- package/dist/token-6GSAFR2W-F2L44NEJ-B3QIV63M.cjs.map +1 -0
- package/dist/{token-6GSAFR2W-KVDFAJ2M-VW443KIA.js → token-6GSAFR2W-F2L44NEJ-GFZ37A2V.js} +6 -6
- package/dist/token-6GSAFR2W-F2L44NEJ-GFZ37A2V.js.map +1 -0
- package/dist/{token-6GSAFR2W-VLY2XUPA-RKITWXKR.cjs → token-6GSAFR2W-WGTMOPEU-6HSZQUFZ.cjs} +9 -9
- package/dist/token-6GSAFR2W-WGTMOPEU-6HSZQUFZ.cjs.map +1 -0
- package/dist/{token-6GSAFR2W-K2BTU23I-NW33N3NU.js → token-6GSAFR2W-WGTMOPEU-JKP67ZX4.js} +6 -6
- package/dist/token-6GSAFR2W-WGTMOPEU-JKP67ZX4.js.map +1 -0
- package/dist/token-util-NEHG7TUY-4YJ4EPCL-MBTAVIJ3.js +8 -0
- package/dist/{token-util-NEHG7TUY-TIJ3LMSH-SGVKOKXF.js.map → token-util-NEHG7TUY-4YJ4EPCL-MBTAVIJ3.js.map} +1 -1
- package/dist/token-util-NEHG7TUY-4YJ4EPCL-SQ4NADRW.cjs +10 -0
- package/dist/{token-util-NEHG7TUY-DJYRKLRD-6TH3ODCN.cjs.map → token-util-NEHG7TUY-4YJ4EPCL-SQ4NADRW.cjs.map} +1 -1
- package/dist/token-util-NEHG7TUY-TV2H7N56-GGCGMPDG.js +8 -0
- package/dist/{token-util-NEHG7TUY-KSXDO2NO-WH6I3PH3.js.map → token-util-NEHG7TUY-TV2H7N56-GGCGMPDG.js.map} +1 -1
- package/dist/token-util-NEHG7TUY-TV2H7N56-R7OENTCJ.cjs +10 -0
- package/dist/{token-util-NEHG7TUY-KSXDO2NO-J6DEINGO.cjs.map → token-util-NEHG7TUY-TV2H7N56-R7OENTCJ.cjs.map} +1 -1
- package/dist/token-util-NEHG7TUY-XQP3QSPX-BL5O5N7R.cjs +10 -0
- package/dist/{token-util-NEHG7TUY-TIJ3LMSH-ANFISSXX.cjs.map → token-util-NEHG7TUY-XQP3QSPX-BL5O5N7R.cjs.map} +1 -1
- package/dist/token-util-NEHG7TUY-XQP3QSPX-YCJRRNXO.js +8 -0
- package/dist/{token-util-NEHG7TUY-DJYRKLRD-EACKYD4V.js.map → token-util-NEHG7TUY-XQP3QSPX-YCJRRNXO.js.map} +1 -1
- package/handlers/server/handlers.d.ts +1 -0
- package/handlers.d.ts +1 -0
- package/package.json +10 -8
- package/server-adapter.d.ts +1 -0
- package/dist/chunk-2CLS2PYJ.js.map +0 -1
- package/dist/chunk-2CYGIE3E.js.map +0 -1
- package/dist/chunk-33CKPQS4.cjs.map +0 -1
- package/dist/chunk-3FEYUHHJ.js.map +0 -1
- package/dist/chunk-3REGEJEN.js.map +0 -1
- package/dist/chunk-4DJ7EJRB.cjs.map +0 -1
- package/dist/chunk-4EYONQIW.cjs.map +0 -1
- package/dist/chunk-4R2Z655M.js.map +0 -1
- package/dist/chunk-5NFRDYFN.js.map +0 -1
- package/dist/chunk-5VDI75UV.js.map +0 -1
- package/dist/chunk-5W4RPVTK.cjs +0 -49
- package/dist/chunk-5W4RPVTK.cjs.map +0 -1
- package/dist/chunk-6MP2S6VI.cjs.map +0 -1
- package/dist/chunk-7S7ALPCY.js.map +0 -1
- package/dist/chunk-7XPMKW4Y.cjs.map +0 -1
- package/dist/chunk-AV3CN5ZR.cjs.map +0 -1
- package/dist/chunk-AVRO3FIN.cjs.map +0 -1
- package/dist/chunk-BRI4GUZ2.cjs +0 -280
- package/dist/chunk-BRI4GUZ2.cjs.map +0 -1
- package/dist/chunk-CGIGPJRU.js.map +0 -1
- package/dist/chunk-CLAEGIP5.cjs.map +0 -1
- package/dist/chunk-DVSCJECS.js.map +0 -1
- package/dist/chunk-EUBTCHQC.js.map +0 -1
- package/dist/chunk-FLLJIPD4.cjs.map +0 -1
- package/dist/chunk-FWSKVWS7.cjs.map +0 -1
- package/dist/chunk-G2AMUTU4.js.map +0 -1
- package/dist/chunk-GHQZIEPS.js.map +0 -1
- package/dist/chunk-GNCALVLC.js.map +0 -1
- package/dist/chunk-GU4EWMZB.cjs.map +0 -1
- package/dist/chunk-H34VRYSF.js.map +0 -1
- package/dist/chunk-HCVDHEDD.cjs.map +0 -1
- package/dist/chunk-I27H7BEB.js.map +0 -1
- package/dist/chunk-IVGQTL3T.js.map +0 -1
- package/dist/chunk-KKY4MSZO.js.map +0 -1
- package/dist/chunk-L2E5RUVT.cjs.map +0 -1
- package/dist/chunk-LF2ZLOFP.js.map +0 -1
- package/dist/chunk-MPUVSOEU.cjs.map +0 -1
- package/dist/chunk-N4EIZSG2.js.map +0 -1
- package/dist/chunk-NUO7HPOV.cjs.map +0 -1
- package/dist/chunk-P3H4AZKI.cjs.map +0 -1
- package/dist/chunk-PNZQCQY4.cjs.map +0 -1
- package/dist/chunk-QPFYN6B5.cjs.map +0 -1
- package/dist/chunk-T4SPG2GP.cjs.map +0 -1
- package/dist/chunk-TMS4LS2J.js.map +0 -1
- package/dist/chunk-UK4FZWNW.cjs.map +0 -1
- package/dist/chunk-WJ6DNHLW.cjs.map +0 -1
- package/dist/chunk-WLGJVDH4.js +0 -242
- package/dist/chunk-WLGJVDH4.js.map +0 -1
- package/dist/chunk-XB27LCKO.js.map +0 -1
- package/dist/chunk-XCEQ4GQW.cjs.map +0 -1
- package/dist/chunk-XOUK3IYU.js.map +0 -1
- package/dist/chunk-XWGAT2DA.js +0 -44
- package/dist/chunk-XWGAT2DA.js.map +0 -1
- package/dist/chunk-YK63KHHB.cjs.map +0 -1
- package/dist/chunk-YN3FWKVQ.js.map +0 -1
- package/dist/chunk-ZQ2G6QKS.cjs.map +0 -1
- package/dist/token-6GSAFR2W-K2BTU23I-5WBYUIGY.cjs.map +0 -1
- package/dist/token-6GSAFR2W-K2BTU23I-NW33N3NU.js.map +0 -1
- package/dist/token-6GSAFR2W-KVDFAJ2M-EPLMGMHT.cjs.map +0 -1
- package/dist/token-6GSAFR2W-KVDFAJ2M-VW443KIA.js.map +0 -1
- package/dist/token-6GSAFR2W-VLY2XUPA-NCSASMWN.js.map +0 -1
- package/dist/token-6GSAFR2W-VLY2XUPA-RKITWXKR.cjs.map +0 -1
- package/dist/token-util-NEHG7TUY-DJYRKLRD-6TH3ODCN.cjs +0 -10
- package/dist/token-util-NEHG7TUY-DJYRKLRD-EACKYD4V.js +0 -8
- package/dist/token-util-NEHG7TUY-KSXDO2NO-J6DEINGO.cjs +0 -10
- package/dist/token-util-NEHG7TUY-KSXDO2NO-WH6I3PH3.js +0 -8
- package/dist/token-util-NEHG7TUY-TIJ3LMSH-ANFISSXX.cjs +0 -10
- package/dist/token-util-NEHG7TUY-TIJ3LMSH-SGVKOKXF.js +0 -8
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkA2K5ZL47_cjs = require('./chunk-A2K5ZL47.cjs');
|
|
4
|
+
var chunkK2SXZLA3_cjs = require('./chunk-K2SXZLA3.cjs');
|
|
5
|
+
var chunkZKMVCV4G_cjs = require('./chunk-ZKMVCV4G.cjs');
|
|
5
6
|
var chunkMCYD5LW7_cjs = require('./chunk-MCYD5LW7.cjs');
|
|
6
|
-
var chunkAVRO3FIN_cjs = require('./chunk-AVRO3FIN.cjs');
|
|
7
7
|
var chunkSUKFO7UM_cjs = require('./chunk-SUKFO7UM.cjs');
|
|
8
|
+
var chunk4LVJBXI2_cjs = require('./chunk-4LVJBXI2.cjs');
|
|
8
9
|
var chunk64ITUOXI_cjs = require('./chunk-64ITUOXI.cjs');
|
|
9
10
|
var chunkO7I5CWRX_cjs = require('./chunk-O7I5CWRX.cjs');
|
|
10
11
|
var web = require('stream/web');
|
|
@@ -212,7 +213,7 @@ async function listWorkflowsFromSystem({ mastra, workflowId }) {
|
|
|
212
213
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
213
214
|
}
|
|
214
215
|
let workflow;
|
|
215
|
-
workflow =
|
|
216
|
+
workflow = chunkA2K5ZL47_cjs.WorkflowRegistry.getWorkflow(workflowId);
|
|
216
217
|
if (!workflow) {
|
|
217
218
|
try {
|
|
218
219
|
workflow = mastra.getWorkflowById(workflowId);
|
|
@@ -231,7 +232,6 @@ async function listWorkflowsFromSystem({ mastra, workflowId }) {
|
|
|
231
232
|
workflow = workflows[workflowId];
|
|
232
233
|
break;
|
|
233
234
|
}
|
|
234
|
-
break;
|
|
235
235
|
} catch (error) {
|
|
236
236
|
logger.debug("Error getting workflow from agent", error);
|
|
237
237
|
}
|
|
@@ -243,9 +243,9 @@ async function listWorkflowsFromSystem({ mastra, workflowId }) {
|
|
|
243
243
|
}
|
|
244
244
|
return { workflow };
|
|
245
245
|
}
|
|
246
|
-
var LIST_WORKFLOWS_ROUTE =
|
|
246
|
+
var LIST_WORKFLOWS_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
247
247
|
method: "GET",
|
|
248
|
-
path: "/
|
|
248
|
+
path: "/workflows",
|
|
249
249
|
responseType: "json",
|
|
250
250
|
queryParamSchema: z.z.object({
|
|
251
251
|
partial: z.z.string().optional()
|
|
@@ -254,12 +254,13 @@ var LIST_WORKFLOWS_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
254
254
|
summary: "List all workflows",
|
|
255
255
|
description: "Returns a list of all available workflows in the system",
|
|
256
256
|
tags: ["Workflows"],
|
|
257
|
+
requiresAuth: true,
|
|
257
258
|
handler: async ({ mastra, partial }) => {
|
|
258
259
|
try {
|
|
259
260
|
const workflows = mastra.listWorkflows({ serialized: false });
|
|
260
261
|
const isPartial = partial === "true";
|
|
261
262
|
const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
|
|
262
|
-
acc[key] =
|
|
263
|
+
acc[key] = chunkA2K5ZL47_cjs.getWorkflowInfo(workflow, isPartial);
|
|
263
264
|
return acc;
|
|
264
265
|
}, {});
|
|
265
266
|
return _workflows;
|
|
@@ -268,30 +269,31 @@ var LIST_WORKFLOWS_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
268
269
|
}
|
|
269
270
|
}
|
|
270
271
|
});
|
|
271
|
-
var GET_WORKFLOW_BY_ID_ROUTE =
|
|
272
|
+
var GET_WORKFLOW_BY_ID_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
272
273
|
method: "GET",
|
|
273
|
-
path: "/
|
|
274
|
+
path: "/workflows/:workflowId",
|
|
274
275
|
responseType: "json",
|
|
275
276
|
pathParamSchema: workflowIdPathParams,
|
|
276
277
|
responseSchema: workflowInfoSchema,
|
|
277
278
|
summary: "Get workflow by ID",
|
|
278
279
|
description: "Returns details for a specific workflow",
|
|
279
280
|
tags: ["Workflows"],
|
|
281
|
+
requiresAuth: true,
|
|
280
282
|
handler: async ({ mastra, workflowId }) => {
|
|
281
283
|
try {
|
|
282
284
|
if (!workflowId) {
|
|
283
285
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
284
286
|
}
|
|
285
287
|
const { workflow } = await listWorkflowsFromSystem({ mastra, workflowId });
|
|
286
|
-
return
|
|
288
|
+
return chunkA2K5ZL47_cjs.getWorkflowInfo(workflow);
|
|
287
289
|
} catch (error) {
|
|
288
290
|
return chunkSUKFO7UM_cjs.handleError(error, "Error getting workflow");
|
|
289
291
|
}
|
|
290
292
|
}
|
|
291
293
|
});
|
|
292
|
-
var LIST_WORKFLOW_RUNS_ROUTE =
|
|
294
|
+
var LIST_WORKFLOW_RUNS_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
293
295
|
method: "GET",
|
|
294
|
-
path: "/
|
|
296
|
+
path: "/workflows/:workflowId/runs",
|
|
295
297
|
responseType: "json",
|
|
296
298
|
pathParamSchema: workflowIdPathParams,
|
|
297
299
|
queryParamSchema: listWorkflowRunsQuerySchema,
|
|
@@ -299,8 +301,22 @@ var LIST_WORKFLOW_RUNS_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
299
301
|
summary: "List workflow runs",
|
|
300
302
|
description: "Returns a paginated list of execution runs for the specified workflow",
|
|
301
303
|
tags: ["Workflows"],
|
|
302
|
-
|
|
304
|
+
requiresAuth: true,
|
|
305
|
+
handler: async ({
|
|
306
|
+
mastra,
|
|
307
|
+
workflowId,
|
|
308
|
+
fromDate,
|
|
309
|
+
toDate,
|
|
310
|
+
page,
|
|
311
|
+
perPage,
|
|
312
|
+
limit,
|
|
313
|
+
offset,
|
|
314
|
+
resourceId,
|
|
315
|
+
status,
|
|
316
|
+
requestContext
|
|
317
|
+
}) => {
|
|
303
318
|
try {
|
|
319
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
304
320
|
if (!workflowId) {
|
|
305
321
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
306
322
|
}
|
|
@@ -327,7 +343,7 @@ var LIST_WORKFLOW_RUNS_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
327
343
|
toDate: toDate ? typeof toDate === "string" ? new Date(toDate) : toDate : void 0,
|
|
328
344
|
perPage: finalPerPage,
|
|
329
345
|
page: finalPage,
|
|
330
|
-
resourceId,
|
|
346
|
+
resourceId: effectiveResourceId,
|
|
331
347
|
status
|
|
332
348
|
}) || {
|
|
333
349
|
runs: [],
|
|
@@ -339,9 +355,9 @@ var LIST_WORKFLOW_RUNS_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
339
355
|
}
|
|
340
356
|
}
|
|
341
357
|
});
|
|
342
|
-
var GET_WORKFLOW_RUN_BY_ID_ROUTE =
|
|
358
|
+
var GET_WORKFLOW_RUN_BY_ID_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
343
359
|
method: "GET",
|
|
344
|
-
path: "/
|
|
360
|
+
path: "/workflows/:workflowId/runs/:runId",
|
|
345
361
|
responseType: "json",
|
|
346
362
|
pathParamSchema: workflowRunPathParams,
|
|
347
363
|
queryParamSchema: workflowRunResultQuerySchema,
|
|
@@ -349,8 +365,10 @@ var GET_WORKFLOW_RUN_BY_ID_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
349
365
|
summary: "Get workflow run by ID",
|
|
350
366
|
description: "Returns a workflow run with metadata and processed execution state. Use the fields query parameter to reduce payload size by requesting only specific fields (e.g., ?fields=status,result,metadata)",
|
|
351
367
|
tags: ["Workflows"],
|
|
352
|
-
|
|
368
|
+
requiresAuth: true,
|
|
369
|
+
handler: async ({ mastra, workflowId, runId, fields, withNestedWorkflows, requestContext }) => {
|
|
353
370
|
try {
|
|
371
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
354
372
|
if (!workflowId) {
|
|
355
373
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
356
374
|
}
|
|
@@ -370,23 +388,26 @@ var GET_WORKFLOW_RUN_BY_ID_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
370
388
|
if (!run) {
|
|
371
389
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
372
390
|
}
|
|
391
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
373
392
|
return run;
|
|
374
393
|
} catch (error) {
|
|
375
394
|
return chunkSUKFO7UM_cjs.handleError(error, "Error getting workflow run");
|
|
376
395
|
}
|
|
377
396
|
}
|
|
378
397
|
});
|
|
379
|
-
var DELETE_WORKFLOW_RUN_BY_ID_ROUTE =
|
|
398
|
+
var DELETE_WORKFLOW_RUN_BY_ID_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
380
399
|
method: "DELETE",
|
|
381
|
-
path: "/
|
|
400
|
+
path: "/workflows/:workflowId/runs/:runId",
|
|
382
401
|
responseType: "json",
|
|
383
402
|
pathParamSchema: workflowRunPathParams,
|
|
384
403
|
responseSchema: workflowControlResponseSchema,
|
|
385
404
|
summary: "Delete workflow run by ID",
|
|
386
405
|
description: "Deletes a specific workflow run by ID",
|
|
387
406
|
tags: ["Workflows"],
|
|
388
|
-
|
|
407
|
+
requiresAuth: true,
|
|
408
|
+
handler: async ({ mastra, workflowId, runId, requestContext }) => {
|
|
389
409
|
try {
|
|
410
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
390
411
|
if (!workflowId) {
|
|
391
412
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
392
413
|
}
|
|
@@ -397,6 +418,11 @@ var DELETE_WORKFLOW_RUN_BY_ID_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
397
418
|
if (!workflow) {
|
|
398
419
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
399
420
|
}
|
|
421
|
+
const run = await workflow.getWorkflowRunById(runId);
|
|
422
|
+
if (!run) {
|
|
423
|
+
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
424
|
+
}
|
|
425
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
400
426
|
await workflow.deleteWorkflowRunById(runId);
|
|
401
427
|
return { message: "Workflow run deleted" };
|
|
402
428
|
} catch (error) {
|
|
@@ -404,9 +430,9 @@ var DELETE_WORKFLOW_RUN_BY_ID_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
404
430
|
}
|
|
405
431
|
}
|
|
406
432
|
});
|
|
407
|
-
var CREATE_WORKFLOW_RUN_ROUTE =
|
|
433
|
+
var CREATE_WORKFLOW_RUN_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
408
434
|
method: "POST",
|
|
409
|
-
path: "/
|
|
435
|
+
path: "/workflows/:workflowId/create-run",
|
|
410
436
|
responseType: "json",
|
|
411
437
|
pathParamSchema: workflowIdPathParams,
|
|
412
438
|
queryParamSchema: chunkMCYD5LW7_cjs.optionalRunIdSchema,
|
|
@@ -415,8 +441,10 @@ var CREATE_WORKFLOW_RUN_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
415
441
|
summary: "Create workflow run",
|
|
416
442
|
description: "Creates a new workflow execution instance with an optional custom run ID",
|
|
417
443
|
tags: ["Workflows"],
|
|
418
|
-
|
|
444
|
+
requiresAuth: true,
|
|
445
|
+
handler: async ({ mastra, workflowId, runId, resourceId, disableScorers, requestContext }) => {
|
|
419
446
|
try {
|
|
447
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
420
448
|
if (!workflowId) {
|
|
421
449
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
422
450
|
}
|
|
@@ -424,16 +452,16 @@ var CREATE_WORKFLOW_RUN_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
424
452
|
if (!workflow) {
|
|
425
453
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
426
454
|
}
|
|
427
|
-
const run = await workflow.createRun({ runId, resourceId, disableScorers });
|
|
455
|
+
const run = await workflow.createRun({ runId, resourceId: effectiveResourceId, disableScorers });
|
|
428
456
|
return { runId: run.runId };
|
|
429
457
|
} catch (error) {
|
|
430
458
|
return chunkSUKFO7UM_cjs.handleError(error, "Error creating workflow run");
|
|
431
459
|
}
|
|
432
460
|
}
|
|
433
461
|
});
|
|
434
|
-
var STREAM_WORKFLOW_ROUTE =
|
|
462
|
+
var STREAM_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
435
463
|
method: "POST",
|
|
436
|
-
path: "/
|
|
464
|
+
path: "/workflows/:workflowId/stream",
|
|
437
465
|
responseType: "stream",
|
|
438
466
|
pathParamSchema: workflowIdPathParams,
|
|
439
467
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -441,8 +469,10 @@ var STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
441
469
|
summary: "Stream workflow execution",
|
|
442
470
|
description: "Executes a workflow and streams the results in real-time",
|
|
443
471
|
tags: ["Workflows"],
|
|
444
|
-
|
|
472
|
+
requiresAuth: true,
|
|
473
|
+
handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
|
|
445
474
|
try {
|
|
475
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
446
476
|
if (!workflowId) {
|
|
447
477
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
448
478
|
}
|
|
@@ -454,8 +484,8 @@ var STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
454
484
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
455
485
|
}
|
|
456
486
|
const serverCache = mastra.getServerCache();
|
|
457
|
-
const run = await workflow.createRun({ runId, resourceId });
|
|
458
|
-
const result = run.stream(params);
|
|
487
|
+
const run = await workflow.createRun({ runId, resourceId: effectiveResourceId });
|
|
488
|
+
const result = run.stream({ ...params, requestContext });
|
|
459
489
|
return result.fullStream.pipeThrough(
|
|
460
490
|
new web.TransformStream({
|
|
461
491
|
transform(chunk, controller) {
|
|
@@ -473,19 +503,21 @@ var STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
473
503
|
}
|
|
474
504
|
}
|
|
475
505
|
});
|
|
476
|
-
var RESUME_STREAM_WORKFLOW_ROUTE =
|
|
506
|
+
var RESUME_STREAM_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
477
507
|
method: "POST",
|
|
478
|
-
path: "/
|
|
508
|
+
path: "/workflows/:workflowId/resume-stream",
|
|
479
509
|
responseType: "stream",
|
|
480
510
|
pathParamSchema: workflowIdPathParams,
|
|
481
511
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
482
512
|
bodySchema: resumeBodySchema,
|
|
483
|
-
responseSchema:
|
|
513
|
+
responseSchema: chunkK2SXZLA3_cjs.streamResponseSchema,
|
|
484
514
|
summary: "Resume workflow stream",
|
|
485
515
|
description: "Resumes a suspended workflow execution and continues streaming results",
|
|
486
516
|
tags: ["Workflows"],
|
|
487
|
-
|
|
517
|
+
requiresAuth: true,
|
|
518
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
488
519
|
try {
|
|
520
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
489
521
|
if (!workflowId) {
|
|
490
522
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
491
523
|
}
|
|
@@ -500,9 +532,10 @@ var RESUME_STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
500
532
|
if (!run) {
|
|
501
533
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
502
534
|
}
|
|
535
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
503
536
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
504
537
|
const serverCache = mastra.getServerCache();
|
|
505
|
-
const stream = _run.resumeStream(params).fullStream.pipeThrough(
|
|
538
|
+
const stream = _run.resumeStream({ ...params, requestContext }).fullStream.pipeThrough(
|
|
506
539
|
new web.TransformStream({
|
|
507
540
|
transform(chunk, controller) {
|
|
508
541
|
if (serverCache) {
|
|
@@ -520,9 +553,9 @@ var RESUME_STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
520
553
|
}
|
|
521
554
|
}
|
|
522
555
|
});
|
|
523
|
-
var START_ASYNC_WORKFLOW_ROUTE =
|
|
556
|
+
var START_ASYNC_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
524
557
|
method: "POST",
|
|
525
|
-
path: "/
|
|
558
|
+
path: "/workflows/:workflowId/start-async",
|
|
526
559
|
responseType: "json",
|
|
527
560
|
pathParamSchema: workflowIdPathParams,
|
|
528
561
|
queryParamSchema: chunkMCYD5LW7_cjs.optionalRunIdSchema,
|
|
@@ -531,8 +564,10 @@ var START_ASYNC_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
531
564
|
summary: "Start workflow asynchronously",
|
|
532
565
|
description: "Starts a workflow execution asynchronously without streaming results",
|
|
533
566
|
tags: ["Workflows"],
|
|
534
|
-
|
|
567
|
+
requiresAuth: true,
|
|
568
|
+
handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
|
|
535
569
|
try {
|
|
570
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
536
571
|
if (!workflowId) {
|
|
537
572
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
538
573
|
}
|
|
@@ -540,17 +575,17 @@ var START_ASYNC_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
540
575
|
if (!workflow) {
|
|
541
576
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
542
577
|
}
|
|
543
|
-
const _run = await workflow.createRun({ runId });
|
|
544
|
-
const result = await _run.start(params);
|
|
578
|
+
const _run = await workflow.createRun({ runId, resourceId: effectiveResourceId });
|
|
579
|
+
const result = await _run.start({ ...params, requestContext });
|
|
545
580
|
return result;
|
|
546
581
|
} catch (error) {
|
|
547
582
|
return chunkSUKFO7UM_cjs.handleError(error, "Error starting async workflow");
|
|
548
583
|
}
|
|
549
584
|
}
|
|
550
585
|
});
|
|
551
|
-
var START_WORKFLOW_RUN_ROUTE =
|
|
586
|
+
var START_WORKFLOW_RUN_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
552
587
|
method: "POST",
|
|
553
|
-
path: "/
|
|
588
|
+
path: "/workflows/:workflowId/start",
|
|
554
589
|
responseType: "json",
|
|
555
590
|
pathParamSchema: workflowIdPathParams,
|
|
556
591
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -559,8 +594,10 @@ var START_WORKFLOW_RUN_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
559
594
|
summary: "Start specific workflow run",
|
|
560
595
|
description: "Starts execution of a specific workflow run by ID",
|
|
561
596
|
tags: ["Workflows"],
|
|
562
|
-
|
|
597
|
+
requiresAuth: true,
|
|
598
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
563
599
|
try {
|
|
600
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
564
601
|
if (!workflowId) {
|
|
565
602
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
566
603
|
}
|
|
@@ -575,9 +612,11 @@ var START_WORKFLOW_RUN_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
575
612
|
if (!run) {
|
|
576
613
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
577
614
|
}
|
|
615
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
578
616
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
579
617
|
void _run.start({
|
|
580
|
-
...params
|
|
618
|
+
...params,
|
|
619
|
+
requestContext
|
|
581
620
|
});
|
|
582
621
|
return { message: "Workflow run started" };
|
|
583
622
|
} catch (e) {
|
|
@@ -585,18 +624,20 @@ var START_WORKFLOW_RUN_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
585
624
|
}
|
|
586
625
|
}
|
|
587
626
|
});
|
|
588
|
-
var OBSERVE_STREAM_WORKFLOW_ROUTE =
|
|
627
|
+
var OBSERVE_STREAM_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
589
628
|
method: "POST",
|
|
590
|
-
path: "/
|
|
629
|
+
path: "/workflows/:workflowId/observe",
|
|
591
630
|
responseType: "stream",
|
|
592
631
|
pathParamSchema: workflowIdPathParams,
|
|
593
632
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
594
|
-
responseSchema:
|
|
633
|
+
responseSchema: chunkK2SXZLA3_cjs.streamResponseSchema,
|
|
595
634
|
summary: "Observe workflow stream",
|
|
596
635
|
description: "Observes and streams updates from an already running workflow execution",
|
|
597
636
|
tags: ["Workflows"],
|
|
598
|
-
|
|
637
|
+
requiresAuth: true,
|
|
638
|
+
handler: async ({ mastra, workflowId, runId, requestContext }) => {
|
|
599
639
|
try {
|
|
640
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
600
641
|
if (!workflowId) {
|
|
601
642
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
602
643
|
}
|
|
@@ -611,6 +652,7 @@ var OBSERVE_STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
611
652
|
if (!run) {
|
|
612
653
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
613
654
|
}
|
|
655
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
614
656
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
615
657
|
const serverCache = mastra.getServerCache();
|
|
616
658
|
if (!serverCache) {
|
|
@@ -655,9 +697,9 @@ var OBSERVE_STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
655
697
|
}
|
|
656
698
|
}
|
|
657
699
|
});
|
|
658
|
-
var RESUME_ASYNC_WORKFLOW_ROUTE =
|
|
700
|
+
var RESUME_ASYNC_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
659
701
|
method: "POST",
|
|
660
|
-
path: "/
|
|
702
|
+
path: "/workflows/:workflowId/resume-async",
|
|
661
703
|
responseType: "json",
|
|
662
704
|
pathParamSchema: workflowIdPathParams,
|
|
663
705
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -666,8 +708,10 @@ var RESUME_ASYNC_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
666
708
|
summary: "Resume workflow asynchronously",
|
|
667
709
|
description: "Resumes a suspended workflow execution asynchronously without streaming",
|
|
668
710
|
tags: ["Workflows"],
|
|
669
|
-
|
|
711
|
+
requiresAuth: true,
|
|
712
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
670
713
|
try {
|
|
714
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
671
715
|
if (!workflowId) {
|
|
672
716
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
673
717
|
}
|
|
@@ -682,17 +726,18 @@ var RESUME_ASYNC_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
682
726
|
if (!run) {
|
|
683
727
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
684
728
|
}
|
|
729
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
685
730
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
686
|
-
const result = await _run.resume(params);
|
|
731
|
+
const result = await _run.resume({ ...params, requestContext });
|
|
687
732
|
return result;
|
|
688
733
|
} catch (error) {
|
|
689
734
|
return chunkSUKFO7UM_cjs.handleError(error, "Error resuming workflow step");
|
|
690
735
|
}
|
|
691
736
|
}
|
|
692
737
|
});
|
|
693
|
-
var RESUME_WORKFLOW_ROUTE =
|
|
738
|
+
var RESUME_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
694
739
|
method: "POST",
|
|
695
|
-
path: "/
|
|
740
|
+
path: "/workflows/:workflowId/resume",
|
|
696
741
|
responseType: "json",
|
|
697
742
|
pathParamSchema: workflowIdPathParams,
|
|
698
743
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -701,8 +746,10 @@ var RESUME_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
701
746
|
summary: "Resume workflow",
|
|
702
747
|
description: "Resumes a suspended workflow execution from a specific step",
|
|
703
748
|
tags: ["Workflows"],
|
|
704
|
-
|
|
749
|
+
requiresAuth: true,
|
|
750
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
705
751
|
try {
|
|
752
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
706
753
|
if (!workflowId) {
|
|
707
754
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
708
755
|
}
|
|
@@ -717,17 +764,18 @@ var RESUME_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
717
764
|
if (!run) {
|
|
718
765
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
719
766
|
}
|
|
767
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
720
768
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
721
|
-
void _run.resume(params);
|
|
769
|
+
void _run.resume({ ...params, requestContext });
|
|
722
770
|
return { message: "Workflow run resumed" };
|
|
723
771
|
} catch (error) {
|
|
724
772
|
return chunkSUKFO7UM_cjs.handleError(error, "Error resuming workflow");
|
|
725
773
|
}
|
|
726
774
|
}
|
|
727
775
|
});
|
|
728
|
-
var RESTART_ASYNC_WORKFLOW_ROUTE =
|
|
776
|
+
var RESTART_ASYNC_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
729
777
|
method: "POST",
|
|
730
|
-
path: "/
|
|
778
|
+
path: "/workflows/:workflowId/restart-async",
|
|
731
779
|
responseType: "json",
|
|
732
780
|
pathParamSchema: workflowIdPathParams,
|
|
733
781
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -736,8 +784,10 @@ var RESTART_ASYNC_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
736
784
|
summary: "Restart workflow asynchronously",
|
|
737
785
|
description: "Restarts an active workflow execution asynchronously",
|
|
738
786
|
tags: ["Workflows"],
|
|
739
|
-
|
|
787
|
+
requiresAuth: true,
|
|
788
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
740
789
|
try {
|
|
790
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
741
791
|
if (!workflowId) {
|
|
742
792
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
743
793
|
}
|
|
@@ -752,17 +802,18 @@ var RESTART_ASYNC_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
752
802
|
if (!run) {
|
|
753
803
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
754
804
|
}
|
|
805
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
755
806
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
756
|
-
const result = await _run.restart(params);
|
|
807
|
+
const result = await _run.restart({ ...params, requestContext });
|
|
757
808
|
return result;
|
|
758
809
|
} catch (error) {
|
|
759
810
|
return chunkSUKFO7UM_cjs.handleError(error, "Error restarting workflow");
|
|
760
811
|
}
|
|
761
812
|
}
|
|
762
813
|
});
|
|
763
|
-
var RESTART_WORKFLOW_ROUTE =
|
|
814
|
+
var RESTART_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
764
815
|
method: "POST",
|
|
765
|
-
path: "/
|
|
816
|
+
path: "/workflows/:workflowId/restart",
|
|
766
817
|
responseType: "json",
|
|
767
818
|
pathParamSchema: workflowIdPathParams,
|
|
768
819
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -771,8 +822,10 @@ var RESTART_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
771
822
|
summary: "Restart workflow",
|
|
772
823
|
description: "Restarts an active workflow execution",
|
|
773
824
|
tags: ["Workflows"],
|
|
774
|
-
|
|
825
|
+
requiresAuth: true,
|
|
826
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
775
827
|
try {
|
|
828
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
776
829
|
if (!workflowId) {
|
|
777
830
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
778
831
|
}
|
|
@@ -787,23 +840,25 @@ var RESTART_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
787
840
|
if (!run) {
|
|
788
841
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
789
842
|
}
|
|
843
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
790
844
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
791
|
-
void _run.restart(params);
|
|
845
|
+
void _run.restart({ ...params, requestContext });
|
|
792
846
|
return { message: "Workflow run restarted" };
|
|
793
847
|
} catch (error) {
|
|
794
848
|
return chunkSUKFO7UM_cjs.handleError(error, "Error restarting workflow");
|
|
795
849
|
}
|
|
796
850
|
}
|
|
797
851
|
});
|
|
798
|
-
var RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE =
|
|
852
|
+
var RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
799
853
|
method: "POST",
|
|
800
|
-
path: "/
|
|
854
|
+
path: "/workflows/:workflowId/restart-all-active-workflow-runs-async",
|
|
801
855
|
responseType: "json",
|
|
802
856
|
pathParamSchema: workflowIdPathParams,
|
|
803
857
|
responseSchema: workflowControlResponseSchema,
|
|
804
858
|
summary: "Restart all active workflow runs asynchronously",
|
|
805
859
|
description: "Restarts all active workflow runs asynchronously",
|
|
806
860
|
tags: ["Workflows"],
|
|
861
|
+
requiresAuth: true,
|
|
807
862
|
handler: async ({ mastra, workflowId }) => {
|
|
808
863
|
try {
|
|
809
864
|
if (!workflowId) {
|
|
@@ -820,15 +875,16 @@ var RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ASYNC_ROUTE = chunkAVRO3FIN_cjs.createRoute
|
|
|
820
875
|
}
|
|
821
876
|
}
|
|
822
877
|
});
|
|
823
|
-
var RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE =
|
|
878
|
+
var RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
824
879
|
method: "POST",
|
|
825
|
-
path: "/
|
|
880
|
+
path: "/workflows/:workflowId/restart-all-active-workflow-runs",
|
|
826
881
|
responseType: "json",
|
|
827
882
|
pathParamSchema: workflowIdPathParams,
|
|
828
883
|
responseSchema: workflowControlResponseSchema,
|
|
829
884
|
summary: "Restart all active workflow runs",
|
|
830
885
|
description: "Restarts all active workflow runs",
|
|
831
886
|
tags: ["Workflows"],
|
|
887
|
+
requiresAuth: true,
|
|
832
888
|
handler: async ({ mastra, workflowId }) => {
|
|
833
889
|
try {
|
|
834
890
|
if (!workflowId) {
|
|
@@ -845,9 +901,9 @@ var RESTART_ALL_ACTIVE_WORKFLOW_RUNS_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
845
901
|
}
|
|
846
902
|
}
|
|
847
903
|
});
|
|
848
|
-
var TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE =
|
|
904
|
+
var TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
849
905
|
method: "POST",
|
|
850
|
-
path: "/
|
|
906
|
+
path: "/workflows/:workflowId/time-travel-async",
|
|
851
907
|
responseType: "json",
|
|
852
908
|
pathParamSchema: workflowIdPathParams,
|
|
853
909
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -856,8 +912,10 @@ var TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
856
912
|
summary: "Time travel workflow asynchronously",
|
|
857
913
|
description: "Time travels a workflow run asynchronously without streaming",
|
|
858
914
|
tags: ["Workflows"],
|
|
859
|
-
|
|
915
|
+
requiresAuth: true,
|
|
916
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
860
917
|
try {
|
|
918
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
861
919
|
if (!workflowId) {
|
|
862
920
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
863
921
|
}
|
|
@@ -872,17 +930,18 @@ var TIME_TRAVEL_ASYNC_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
872
930
|
if (!run) {
|
|
873
931
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
874
932
|
}
|
|
933
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
875
934
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
876
|
-
const result = await _run.timeTravel(params);
|
|
935
|
+
const result = await _run.timeTravel({ ...params, requestContext });
|
|
877
936
|
return result;
|
|
878
937
|
} catch (error) {
|
|
879
938
|
return chunkSUKFO7UM_cjs.handleError(error, "Error time traveling workflow");
|
|
880
939
|
}
|
|
881
940
|
}
|
|
882
941
|
});
|
|
883
|
-
var TIME_TRAVEL_WORKFLOW_ROUTE =
|
|
942
|
+
var TIME_TRAVEL_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
884
943
|
method: "POST",
|
|
885
|
-
path: "/
|
|
944
|
+
path: "/workflows/:workflowId/time-travel",
|
|
886
945
|
responseType: "json",
|
|
887
946
|
pathParamSchema: workflowIdPathParams,
|
|
888
947
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -891,8 +950,10 @@ var TIME_TRAVEL_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
891
950
|
summary: "Time travel workflow",
|
|
892
951
|
description: "Time travels a workflow run, starting from a specific step",
|
|
893
952
|
tags: ["Workflows"],
|
|
894
|
-
|
|
953
|
+
requiresAuth: true,
|
|
954
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
895
955
|
try {
|
|
956
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
896
957
|
if (!workflowId) {
|
|
897
958
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
898
959
|
}
|
|
@@ -907,17 +968,18 @@ var TIME_TRAVEL_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
907
968
|
if (!run) {
|
|
908
969
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
909
970
|
}
|
|
971
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
910
972
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
911
|
-
void _run.timeTravel(params);
|
|
973
|
+
void _run.timeTravel({ ...params, requestContext });
|
|
912
974
|
return { message: "Workflow run time travel started" };
|
|
913
975
|
} catch (error) {
|
|
914
976
|
return chunkSUKFO7UM_cjs.handleError(error, "Error time traveling workflow");
|
|
915
977
|
}
|
|
916
978
|
}
|
|
917
979
|
});
|
|
918
|
-
var TIME_TRAVEL_STREAM_WORKFLOW_ROUTE =
|
|
980
|
+
var TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
919
981
|
method: "POST",
|
|
920
|
-
path: "/
|
|
982
|
+
path: "/workflows/:workflowId/time-travel-stream",
|
|
921
983
|
responseType: "stream",
|
|
922
984
|
pathParamSchema: workflowIdPathParams,
|
|
923
985
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
@@ -925,8 +987,10 @@ var TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
925
987
|
summary: "Time travel workflow stream",
|
|
926
988
|
description: "Time travels a workflow run, starting from a specific step, and streams the results in real-time",
|
|
927
989
|
tags: ["Workflows"],
|
|
928
|
-
|
|
990
|
+
requiresAuth: true,
|
|
991
|
+
handler: async ({ mastra, workflowId, runId, requestContext, ...params }) => {
|
|
929
992
|
try {
|
|
993
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
930
994
|
if (!workflowId) {
|
|
931
995
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
932
996
|
}
|
|
@@ -937,9 +1001,14 @@ var TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
937
1001
|
if (!workflow) {
|
|
938
1002
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
939
1003
|
}
|
|
1004
|
+
const existingRun = await workflow.getWorkflowRunById(runId);
|
|
1005
|
+
if (!existingRun) {
|
|
1006
|
+
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
1007
|
+
}
|
|
1008
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(existingRun, effectiveResourceId);
|
|
940
1009
|
const serverCache = mastra.getServerCache();
|
|
941
|
-
const run = await workflow.createRun({ runId });
|
|
942
|
-
const result = run.timeTravelStream(params);
|
|
1010
|
+
const run = await workflow.createRun({ runId, resourceId: existingRun.resourceId });
|
|
1011
|
+
const result = run.timeTravelStream({ ...params, requestContext });
|
|
943
1012
|
return result.fullStream.pipeThrough(
|
|
944
1013
|
new web.TransformStream({
|
|
945
1014
|
transform(chunk, controller) {
|
|
@@ -957,17 +1026,19 @@ var TIME_TRAVEL_STREAM_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
957
1026
|
}
|
|
958
1027
|
}
|
|
959
1028
|
});
|
|
960
|
-
var CANCEL_WORKFLOW_RUN_ROUTE =
|
|
1029
|
+
var CANCEL_WORKFLOW_RUN_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
961
1030
|
method: "POST",
|
|
962
|
-
path: "/
|
|
1031
|
+
path: "/workflows/:workflowId/runs/:runId/cancel",
|
|
963
1032
|
responseType: "json",
|
|
964
1033
|
pathParamSchema: workflowRunPathParams,
|
|
965
1034
|
responseSchema: workflowControlResponseSchema,
|
|
966
1035
|
summary: "Cancel workflow run",
|
|
967
1036
|
description: "Cancels an in-progress workflow execution",
|
|
968
1037
|
tags: ["Workflows"],
|
|
969
|
-
|
|
1038
|
+
requiresAuth: true,
|
|
1039
|
+
handler: async ({ mastra, workflowId, runId, requestContext }) => {
|
|
970
1040
|
try {
|
|
1041
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
971
1042
|
if (!workflowId) {
|
|
972
1043
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
973
1044
|
}
|
|
@@ -982,6 +1053,7 @@ var CANCEL_WORKFLOW_RUN_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
982
1053
|
if (!run) {
|
|
983
1054
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
984
1055
|
}
|
|
1056
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
985
1057
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
986
1058
|
await _run.cancel();
|
|
987
1059
|
return { message: "Workflow run cancelled" };
|
|
@@ -990,19 +1062,21 @@ var CANCEL_WORKFLOW_RUN_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
990
1062
|
}
|
|
991
1063
|
}
|
|
992
1064
|
});
|
|
993
|
-
var STREAM_LEGACY_WORKFLOW_ROUTE =
|
|
1065
|
+
var STREAM_LEGACY_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
994
1066
|
method: "POST",
|
|
995
|
-
path: "/
|
|
1067
|
+
path: "/workflows/:workflowId/stream-legacy",
|
|
996
1068
|
responseType: "stream",
|
|
997
1069
|
pathParamSchema: workflowIdPathParams,
|
|
998
1070
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
999
1071
|
bodySchema: streamWorkflowBodySchema,
|
|
1000
|
-
responseSchema:
|
|
1072
|
+
responseSchema: chunkK2SXZLA3_cjs.streamResponseSchema,
|
|
1001
1073
|
summary: "[DEPRECATED] Stream workflow with legacy format",
|
|
1002
|
-
description: "Legacy endpoint for streaming workflow execution. Use /
|
|
1074
|
+
description: "Legacy endpoint for streaming workflow execution. Use /workflows/:workflowId/stream instead.",
|
|
1003
1075
|
tags: ["Workflows", "Legacy"],
|
|
1004
|
-
|
|
1076
|
+
requiresAuth: true,
|
|
1077
|
+
handler: async ({ mastra, workflowId, runId, resourceId, requestContext, ...params }) => {
|
|
1005
1078
|
try {
|
|
1079
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, resourceId);
|
|
1006
1080
|
if (!workflowId) {
|
|
1007
1081
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
1008
1082
|
}
|
|
@@ -1014,9 +1088,10 @@ var STREAM_LEGACY_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
1014
1088
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow not found" });
|
|
1015
1089
|
}
|
|
1016
1090
|
const serverCache = mastra.getServerCache();
|
|
1017
|
-
const run = await workflow.createRun({ runId });
|
|
1091
|
+
const run = await workflow.createRun({ runId, resourceId: effectiveResourceId });
|
|
1018
1092
|
const result = run.streamLegacy({
|
|
1019
1093
|
...params,
|
|
1094
|
+
requestContext,
|
|
1020
1095
|
onChunk: async (chunk) => {
|
|
1021
1096
|
if (serverCache) {
|
|
1022
1097
|
const cacheKey = runId;
|
|
@@ -1030,18 +1105,20 @@ var STREAM_LEGACY_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
1030
1105
|
}
|
|
1031
1106
|
}
|
|
1032
1107
|
});
|
|
1033
|
-
var OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE =
|
|
1108
|
+
var OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = chunk4LVJBXI2_cjs.createRoute({
|
|
1034
1109
|
method: "POST",
|
|
1035
|
-
path: "/
|
|
1110
|
+
path: "/workflows/:workflowId/observe-stream-legacy",
|
|
1036
1111
|
responseType: "stream",
|
|
1037
1112
|
pathParamSchema: workflowIdPathParams,
|
|
1038
1113
|
queryParamSchema: chunkMCYD5LW7_cjs.runIdSchema,
|
|
1039
|
-
responseSchema:
|
|
1114
|
+
responseSchema: chunkK2SXZLA3_cjs.streamResponseSchema,
|
|
1040
1115
|
summary: "[DEPRECATED] Observe workflow stream with legacy format",
|
|
1041
|
-
description: "Legacy endpoint for observing workflow stream. Use /
|
|
1116
|
+
description: "Legacy endpoint for observing workflow stream. Use /workflows/:workflowId/observe instead.",
|
|
1042
1117
|
tags: ["Workflows", "Legacy"],
|
|
1043
|
-
|
|
1118
|
+
requiresAuth: true,
|
|
1119
|
+
handler: async ({ mastra, workflowId, runId, requestContext }) => {
|
|
1044
1120
|
try {
|
|
1121
|
+
const effectiveResourceId = chunkZKMVCV4G_cjs.getEffectiveResourceId(requestContext, void 0);
|
|
1045
1122
|
if (!workflowId) {
|
|
1046
1123
|
throw new chunk64ITUOXI_cjs.HTTPException(400, { message: "Workflow ID is required" });
|
|
1047
1124
|
}
|
|
@@ -1056,6 +1133,7 @@ var OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE = chunkAVRO3FIN_cjs.createRoute({
|
|
|
1056
1133
|
if (!run) {
|
|
1057
1134
|
throw new chunk64ITUOXI_cjs.HTTPException(404, { message: "Workflow run not found" });
|
|
1058
1135
|
}
|
|
1136
|
+
await chunkZKMVCV4G_cjs.validateRunOwnership(run, effectiveResourceId);
|
|
1059
1137
|
const _run = await workflow.createRun({ runId, resourceId: run.resourceId });
|
|
1060
1138
|
const serverCache = mastra.getServerCache();
|
|
1061
1139
|
if (!serverCache) {
|
|
@@ -1113,5 +1191,5 @@ exports.workflowRunResultQuerySchema = workflowRunResultQuerySchema;
|
|
|
1113
1191
|
exports.workflowRunResultSchema = workflowRunResultSchema;
|
|
1114
1192
|
exports.workflowRunsResponseSchema = workflowRunsResponseSchema;
|
|
1115
1193
|
exports.workflows_exports = workflows_exports;
|
|
1116
|
-
//# sourceMappingURL=chunk-
|
|
1117
|
-
//# sourceMappingURL=chunk-
|
|
1194
|
+
//# sourceMappingURL=chunk-MZRJNOYJ.cjs.map
|
|
1195
|
+
//# sourceMappingURL=chunk-MZRJNOYJ.cjs.map
|