@keystrokehq/keystroke 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action.cjs +1 -1
- package/dist/action.mjs +1 -1
- package/dist/agent.cjs +4 -4
- package/dist/agent.mjs +3 -3
- package/dist/app.cjs +1 -1
- package/dist/app.mjs +1 -1
- package/dist/{awk2-LA3USKJP-Bsg1yxMI.cjs → awk2-LA3USKJP-XeySM1ul.cjs} +3 -3
- package/dist/{awk2-LA3USKJP-Bsg1yxMI.cjs.map → awk2-LA3USKJP-XeySM1ul.cjs.map} +1 -1
- package/dist/{base64-C2AIWVNC-CAa6k7ry.cjs → base64-C2AIWVNC-DrPwCXm9.cjs} +2 -2
- package/dist/{base64-C2AIWVNC-CAa6k7ry.cjs.map → base64-C2AIWVNC-DrPwCXm9.cjs.map} +1 -1
- package/dist/{bash-YZ33HQZQ-D0giTv18.cjs → bash-YZ33HQZQ-BQQtKpnm.cjs} +3 -3
- package/dist/{bash-YZ33HQZQ-D0giTv18.cjs.map → bash-YZ33HQZQ-BQQtKpnm.cjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-Agr76aCC.cjs → cat-TSFMZVYS-ClWyn05t.cjs} +4 -4
- package/dist/{cat-TSFMZVYS-Agr76aCC.cjs.map → cat-TSFMZVYS-ClWyn05t.cjs.map} +1 -1
- package/dist/{chunk-2JIPICV3-68V6ZUjO.cjs → chunk-2JIPICV3-BrRGqqh-.cjs} +2 -2
- package/dist/{chunk-2JIPICV3-68V6ZUjO.cjs.map → chunk-2JIPICV3-BrRGqqh-.cjs.map} +1 -1
- package/dist/{chunk-2VDTE5BV-BQqrRidX.cjs → chunk-2VDTE5BV-DIR6gQHC.cjs} +2 -2
- package/dist/{chunk-2VDTE5BV-BQqrRidX.cjs.map → chunk-2VDTE5BV-DIR6gQHC.cjs.map} +1 -1
- package/dist/{chunk-46RN27KI-Ix8DoKSJ.cjs → chunk-46RN27KI-CdSJriZa.cjs} +2 -2
- package/dist/{chunk-46RN27KI-Ix8DoKSJ.cjs.map → chunk-46RN27KI-CdSJriZa.cjs.map} +1 -1
- package/dist/{chunk-4JLVZKHC-DjiHpNEw.cjs → chunk-4JLVZKHC-BHn_tf7f.cjs} +2 -2
- package/dist/{chunk-4JLVZKHC-DjiHpNEw.cjs.map → chunk-4JLVZKHC-BHn_tf7f.cjs.map} +1 -1
- package/dist/{chunk-4N6J7B5P-DhOH1Syh.cjs → chunk-4N6J7B5P-KYJHQOBl.cjs} +2 -2
- package/dist/{chunk-4N6J7B5P-DhOH1Syh.cjs.map → chunk-4N6J7B5P-KYJHQOBl.cjs.map} +1 -1
- package/dist/{chunk-5H5SCKJM-Tnv523v9.cjs → chunk-5H5SCKJM-gj2XZLFt.cjs} +2 -2
- package/dist/{chunk-5H5SCKJM-Tnv523v9.cjs.map → chunk-5H5SCKJM-gj2XZLFt.cjs.map} +1 -1
- package/dist/{chunk-6LASZU3O-D_JFhTJE.cjs → chunk-6LASZU3O-DY4HiL1j.cjs} +2 -2
- package/dist/{chunk-6LASZU3O-D_JFhTJE.cjs.map → chunk-6LASZU3O-DY4HiL1j.cjs.map} +1 -1
- package/dist/{chunk-6VAT5Z2D-u0kcsLTj.cjs → chunk-6VAT5Z2D-dBFyz7S5.cjs} +3 -3
- package/dist/{chunk-6VAT5Z2D-u0kcsLTj.cjs.map → chunk-6VAT5Z2D-dBFyz7S5.cjs.map} +1 -1
- package/dist/{chunk-7JHM3L42-mvOABw38.cjs → chunk-7JHM3L42-Ci7VptmU.cjs} +3 -3
- package/dist/{chunk-7JHM3L42-mvOABw38.cjs.map → chunk-7JHM3L42-Ci7VptmU.cjs.map} +1 -1
- package/dist/{chunk-A4R2GWRF-BGEfai-r.cjs → chunk-A4R2GWRF-Bw0bFSwh.cjs} +2 -2
- package/dist/{chunk-A4R2GWRF-BGEfai-r.cjs.map → chunk-A4R2GWRF-Bw0bFSwh.cjs.map} +1 -1
- package/dist/{chunk-ACSZB4FE-B0N-X9Dz.cjs → chunk-ACSZB4FE-BcgKmI0V.cjs} +2 -2
- package/dist/{chunk-ACSZB4FE-B0N-X9Dz.cjs.map → chunk-ACSZB4FE-BcgKmI0V.cjs.map} +1 -1
- package/dist/{chunk-BVKWRAS6-DVtQSbtn.cjs → chunk-BVKWRAS6-BN2MZXW6.cjs} +2 -2
- package/dist/{chunk-BVKWRAS6-DVtQSbtn.cjs.map → chunk-BVKWRAS6-BN2MZXW6.cjs.map} +1 -1
- package/dist/{chunk-CBJVD2XA-D5HCpyR8.cjs → chunk-CBJVD2XA-DAx-d6Kw.cjs} +2 -2
- package/dist/{chunk-CBJVD2XA-D5HCpyR8.cjs.map → chunk-CBJVD2XA-DAx-d6Kw.cjs.map} +1 -1
- package/dist/{chunk-EBAPSGAO-D9TSE7uP.cjs → chunk-EBAPSGAO-CTlGCUl5.cjs} +2 -2
- package/dist/{chunk-EBAPSGAO-D9TSE7uP.cjs.map → chunk-EBAPSGAO-CTlGCUl5.cjs.map} +1 -1
- package/dist/{chunk-FAXLQUCQ-CjMjzZ2I.cjs → chunk-FAXLQUCQ-UipnjfNf.cjs} +2 -2
- package/dist/{chunk-FAXLQUCQ-CjMjzZ2I.cjs.map → chunk-FAXLQUCQ-UipnjfNf.cjs.map} +1 -1
- package/dist/{chunk-FJK43EBQ-Cuos7IK5.cjs → chunk-FJK43EBQ-3PnBCRo8.cjs} +2 -2
- package/dist/{chunk-FJK43EBQ-Cuos7IK5.cjs.map → chunk-FJK43EBQ-3PnBCRo8.cjs.map} +1 -1
- package/dist/{chunk-FW54FHZR-DLKAjtJl.cjs → chunk-FW54FHZR-CqDpu94r.cjs} +2 -2
- package/dist/{chunk-FW54FHZR-DLKAjtJl.cjs.map → chunk-FW54FHZR-CqDpu94r.cjs.map} +1 -1
- package/dist/{chunk-FX7KQCEA-Bk2TXrav.cjs → chunk-FX7KQCEA-DoYP2gf4.cjs} +2 -2
- package/dist/{chunk-FX7KQCEA-Bk2TXrav.cjs.map → chunk-FX7KQCEA-DoYP2gf4.cjs.map} +1 -1
- package/dist/{chunk-FZRQOL3C-CendgWMm.cjs → chunk-FZRQOL3C-3p1BNqqw.cjs} +2 -2
- package/dist/{chunk-FZRQOL3C-CendgWMm.cjs.map → chunk-FZRQOL3C-3p1BNqqw.cjs.map} +1 -1
- package/dist/{chunk-GGC5NEPZ-CAGLViKl.cjs → chunk-GGC5NEPZ-D_pB4XbU.cjs} +2 -2
- package/dist/{chunk-GGC5NEPZ-CAGLViKl.cjs.map → chunk-GGC5NEPZ-D_pB4XbU.cjs.map} +1 -1
- package/dist/{chunk-GIUR5SNU-DoYdeYwo.cjs → chunk-GIUR5SNU-xqqqaFfL.cjs} +2 -2
- package/dist/{chunk-GIUR5SNU-DoYdeYwo.cjs.map → chunk-GIUR5SNU-xqqqaFfL.cjs.map} +1 -1
- package/dist/{chunk-GJC3WVOW-e51hHrUv.cjs → chunk-GJC3WVOW-CpcIL9Y6.cjs} +2 -2
- package/dist/{chunk-GJC3WVOW-e51hHrUv.cjs.map → chunk-GJC3WVOW-CpcIL9Y6.cjs.map} +1 -1
- package/dist/{chunk-GSPYNYZA-BFTwDcSE.cjs → chunk-GSPYNYZA-COw3VUno.cjs} +2 -2
- package/dist/{chunk-GSPYNYZA-BFTwDcSE.cjs.map → chunk-GSPYNYZA-COw3VUno.cjs.map} +1 -1
- package/dist/{chunk-GTQIUQM6-BJ3uRl49.cjs → chunk-GTQIUQM6-DWT0sKaX.cjs} +2 -2
- package/dist/{chunk-GTQIUQM6-BJ3uRl49.cjs.map → chunk-GTQIUQM6-DWT0sKaX.cjs.map} +1 -1
- package/dist/{chunk-HJBTD7PY-BrF_3AqA.cjs → chunk-HJBTD7PY-CKZQpc_h.cjs} +2 -2
- package/dist/{chunk-HJBTD7PY-BrF_3AqA.cjs.map → chunk-HJBTD7PY-CKZQpc_h.cjs.map} +1 -1
- package/dist/{chunk-ICIEVHY5-DwD_mBxQ.cjs → chunk-ICIEVHY5-Cw2mPFoM.cjs} +3 -3
- package/dist/{chunk-ICIEVHY5-DwD_mBxQ.cjs.map → chunk-ICIEVHY5-Cw2mPFoM.cjs.map} +1 -1
- package/dist/{chunk-KD3KENL6-Cjqq9zgg.cjs → chunk-KD3KENL6-BA94hNks.cjs} +2 -2
- package/dist/{chunk-KD3KENL6-Cjqq9zgg.cjs.map → chunk-KD3KENL6-BA94hNks.cjs.map} +1 -1
- package/dist/{chunk-LEKBROJD-Dan-FkfJ.cjs → chunk-LEKBROJD-D6BOe6FQ.cjs} +2 -2
- package/dist/{chunk-LEKBROJD-Dan-FkfJ.cjs.map → chunk-LEKBROJD-D6BOe6FQ.cjs.map} +1 -1
- package/dist/{chunk-LNBPBRV4-i9oD7RNK.cjs → chunk-LNBPBRV4-spqBTlMR.cjs} +2 -2
- package/dist/{chunk-LNBPBRV4-i9oD7RNK.cjs.map → chunk-LNBPBRV4-spqBTlMR.cjs.map} +1 -1
- package/dist/{chunk-LPJEKUCB-D2Vshvt5.cjs → chunk-LPJEKUCB-DOgg2opJ.cjs} +2 -2
- package/dist/{chunk-LPJEKUCB-D2Vshvt5.cjs.map → chunk-LPJEKUCB-DOgg2opJ.cjs.map} +1 -1
- package/dist/{chunk-MLIO3BK2-8o-YWlna.cjs → chunk-MLIO3BK2-C8YjN7y9.cjs} +2 -2
- package/dist/{chunk-MLIO3BK2-8o-YWlna.cjs.map → chunk-MLIO3BK2-C8YjN7y9.cjs.map} +1 -1
- package/dist/{chunk-MQKGGNPS-DYzifY7S.cjs → chunk-MQKGGNPS-0LEqz-xf.cjs} +2 -2
- package/dist/{chunk-MQKGGNPS-DYzifY7S.cjs.map → chunk-MQKGGNPS-0LEqz-xf.cjs.map} +1 -1
- package/dist/{chunk-MZFCCXPZ-Cnv2B_Hu.cjs → chunk-MZFCCXPZ-C2-OqnUD.cjs} +2 -2
- package/dist/{chunk-MZFCCXPZ-Cnv2B_Hu.cjs.map → chunk-MZFCCXPZ-C2-OqnUD.cjs.map} +1 -1
- package/dist/{chunk-N6DXJ2JN-KqAa8cwh.cjs → chunk-N6DXJ2JN-C-D4d95Q.cjs} +3 -3
- package/dist/{chunk-N6DXJ2JN-KqAa8cwh.cjs.map → chunk-N6DXJ2JN-C-D4d95Q.cjs.map} +1 -1
- package/dist/{chunk-OVGANXCG-Dw-aZ-C-.cjs → chunk-OVGANXCG-CSxkKDAs.cjs} +2 -2
- package/dist/{chunk-OVGANXCG-Dw-aZ-C-.cjs.map → chunk-OVGANXCG-CSxkKDAs.cjs.map} +1 -1
- package/dist/{chunk-Q7H5W7YE-Dpax_RCC.cjs → chunk-Q7H5W7YE-InWpKZY5.cjs} +5 -5
- package/dist/{chunk-Q7H5W7YE-Dpax_RCC.cjs.map → chunk-Q7H5W7YE-InWpKZY5.cjs.map} +1 -1
- package/dist/{chunk-R74UQCKX-EZdevyKE.cjs → chunk-R74UQCKX-B8n0-8sL.cjs} +2 -2
- package/dist/{chunk-R74UQCKX-EZdevyKE.cjs.map → chunk-R74UQCKX-B8n0-8sL.cjs.map} +1 -1
- package/dist/{chunk-S3LEJEPP-BsUig8Jg.cjs → chunk-S3LEJEPP-Cx4wRlId.cjs} +2 -2
- package/dist/{chunk-S3LEJEPP-BsUig8Jg.cjs.map → chunk-S3LEJEPP-Cx4wRlId.cjs.map} +1 -1
- package/dist/{chunk-S443BAN4-CusYVjOU.cjs → chunk-S443BAN4-CK4Jd3Wr.cjs} +2 -2
- package/dist/{chunk-S443BAN4-CusYVjOU.cjs.map → chunk-S443BAN4-CK4Jd3Wr.cjs.map} +1 -1
- package/dist/{chunk-SJYEXC2Z-Cn51vvkR.cjs → chunk-SJYEXC2Z-DeDkIz68.cjs} +2 -2
- package/dist/{chunk-SJYEXC2Z-Cn51vvkR.cjs.map → chunk-SJYEXC2Z-DeDkIz68.cjs.map} +1 -1
- package/dist/{chunk-T4TFLF3R-CHr2VGrs.cjs → chunk-T4TFLF3R-CM1rHZ8N.cjs} +3 -3
- package/dist/{chunk-T4TFLF3R-CHr2VGrs.cjs.map → chunk-T4TFLF3R-CM1rHZ8N.cjs.map} +1 -1
- package/dist/{chunk-U73A73IE-DyTD9Bif.cjs → chunk-U73A73IE-D99RG5Wc.cjs} +2 -2
- package/dist/{chunk-U73A73IE-DyTD9Bif.cjs.map → chunk-U73A73IE-D99RG5Wc.cjs.map} +1 -1
- package/dist/{chunk-UP6MSJGD-BDPikXkp.cjs → chunk-UP6MSJGD-GmcmfQft.cjs} +2 -2
- package/dist/{chunk-UP6MSJGD-BDPikXkp.cjs.map → chunk-UP6MSJGD-GmcmfQft.cjs.map} +1 -1
- package/dist/{chunk-VLCHOJWK-syZp3Vmw.cjs → chunk-VLCHOJWK-DLOEC7xs.cjs} +3 -3
- package/dist/{chunk-VLCHOJWK-syZp3Vmw.cjs.map → chunk-VLCHOJWK-DLOEC7xs.cjs.map} +1 -1
- package/dist/{chunk-WVRWIZF5-DsIdQVnx.cjs → chunk-WVRWIZF5-B5z8SbAq.cjs} +3 -2
- package/dist/{chunk-WVRWIZF5-DsIdQVnx.cjs.map → chunk-WVRWIZF5-B5z8SbAq.cjs.map} +1 -1
- package/dist/{chunk-XCQWV4AU-DRpOqSMs.cjs → chunk-XCQWV4AU-BMG-IH_J.cjs} +2 -2
- package/dist/{chunk-XCQWV4AU-DRpOqSMs.cjs.map → chunk-XCQWV4AU-BMG-IH_J.cjs.map} +1 -1
- package/dist/{chunk-XDGLKIHR-SUFrvh5B.cjs → chunk-XDGLKIHR-BuEIWoRU.cjs} +2 -2
- package/dist/{chunk-XDGLKIHR-SUFrvh5B.cjs.map → chunk-XDGLKIHR-BuEIWoRU.cjs.map} +1 -1
- package/dist/{chunk-XHLMAZX2-DiuICHhP.cjs → chunk-XHLMAZX2-iZ14pqog.cjs} +2 -2
- package/dist/{chunk-XHLMAZX2-DiuICHhP.cjs.map → chunk-XHLMAZX2-iZ14pqog.cjs.map} +1 -1
- package/dist/{chunk-XYXUMFSU-D9CT51kI.cjs → chunk-XYXUMFSU-BeZU9dGd.cjs} +4 -4
- package/dist/{chunk-XYXUMFSU-D9CT51kI.cjs.map → chunk-XYXUMFSU-BeZU9dGd.cjs.map} +1 -1
- package/dist/{chunk-YCLFEX4T-DtyEjr9g.cjs → chunk-YCLFEX4T-BZYE_CVn.cjs} +2 -2
- package/dist/{chunk-YCLFEX4T-DtyEjr9g.cjs.map → chunk-YCLFEX4T-BZYE_CVn.cjs.map} +1 -1
- package/dist/{chunk-YS4NUBYX-7Ku8CDer.cjs → chunk-YS4NUBYX-BWAuwW1l.cjs} +2 -2
- package/dist/{chunk-YS4NUBYX-7Ku8CDer.cjs.map → chunk-YS4NUBYX-BWAuwW1l.cjs.map} +1 -1
- package/dist/{chunk-ZDIT6ST5-6YvPqwJ7.cjs → chunk-ZDIT6ST5-mgVtGdzi.cjs} +2 -2
- package/dist/{chunk-ZDIT6ST5-6YvPqwJ7.cjs.map → chunk-ZDIT6ST5-mgVtGdzi.cjs.map} +1 -1
- package/dist/{chunk-ZZKH2ELC-BxZGGGBF.cjs → chunk-ZZKH2ELC-IqguEy81.cjs} +2 -2
- package/dist/{chunk-ZZKH2ELC-BxZGGGBF.cjs.map → chunk-ZZKH2ELC-IqguEy81.cjs.map} +1 -1
- package/dist/client.cjs +33 -8
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts.map +1 -1
- package/dist/client.d.mts.map +1 -1
- package/dist/client.mjs +33 -8
- package/dist/client.mjs.map +1 -1
- package/dist/{column-XT6UFXNQ-CXUm4HFt.cjs → column-XT6UFXNQ-D2u-CrDc.cjs} +3 -3
- package/dist/{column-XT6UFXNQ-CXUm4HFt.cjs.map → column-XT6UFXNQ-D2u-CrDc.cjs.map} +1 -1
- package/dist/{comm-VV2LDX2J-BARQTdLU.cjs → comm-VV2LDX2J-Yy42VYO9.cjs} +3 -3
- package/dist/{comm-VV2LDX2J-BARQTdLU.cjs.map → comm-VV2LDX2J-Yy42VYO9.cjs.map} +1 -1
- package/dist/config.d.cts +2 -1
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +2 -1
- package/dist/config.d.mts.map +1 -1
- package/dist/{cp-BISAAS7A-BoFio3Zq.cjs → cp-BISAAS7A-XSnvjsGB.cjs} +3 -3
- package/dist/{cp-BISAAS7A-BoFio3Zq.cjs.map → cp-BISAAS7A-XSnvjsGB.cjs.map} +1 -1
- package/dist/credentials.cjs +1 -1
- package/dist/credentials.mjs +1 -1
- package/dist/{curl-LV5Y3AMS-Cdx6P1bc.cjs → curl-LV5Y3AMS-9HTFdNV4.cjs} +2 -2
- package/dist/{curl-LV5Y3AMS-Cdx6P1bc.cjs.map → curl-LV5Y3AMS-9HTFdNV4.cjs.map} +1 -1
- package/dist/{cut-OKARJCCV-DDw10hRu.cjs → cut-OKARJCCV-BkQDHldN.cjs} +4 -4
- package/dist/{cut-OKARJCCV-DDw10hRu.cjs.map → cut-OKARJCCV-BkQDHldN.cjs.map} +1 -1
- package/dist/{diff-MWJFIG7X-NvtUFxir.cjs → diff-MWJFIG7X-BHO0AB7d.cjs} +3 -3
- package/dist/{diff-MWJFIG7X-NvtUFxir.cjs.map → diff-MWJFIG7X-BHO0AB7d.cjs.map} +1 -1
- package/dist/{dist-DvZ4Dj_O.cjs → dist-BF8uTixs.cjs} +40 -10
- package/dist/dist-BF8uTixs.cjs.map +1 -0
- package/dist/{dist-sGyB6KsC.cjs → dist-BZaoAtmj.cjs} +3 -3
- package/dist/{dist-sGyB6KsC.cjs.map → dist-BZaoAtmj.cjs.map} +1 -1
- package/dist/{dist-CFKSzdSZ.mjs → dist-Bqsbf3hX.mjs} +38 -8
- package/dist/dist-Bqsbf3hX.mjs.map +1 -0
- package/dist/{dist-CDMCEgV0.cjs → dist-CHlytoPR.cjs} +74 -9
- package/dist/dist-CHlytoPR.cjs.map +1 -0
- package/dist/{dist-BWGuF7Bi.mjs → dist-D0HbZRpR.mjs} +63 -10
- package/dist/dist-D0HbZRpR.mjs.map +1 -0
- package/dist/{dist-DtLObwAS.mjs → dist-D_ZLF88C.mjs} +3 -3
- package/dist/{dist-DtLObwAS.mjs.map → dist-D_ZLF88C.mjs.map} +1 -1
- package/dist/{dist-DO51rYHS.cjs → dist-DqOzVzWO.cjs} +76 -76
- package/dist/{dist-DO51rYHS.cjs.map → dist-DqOzVzWO.cjs.map} +1 -1
- package/dist/{du-572XNP42-dDEEbTX1.cjs → du-572XNP42-Ci5n1Ogx.cjs} +2 -2
- package/dist/{du-572XNP42-dDEEbTX1.cjs.map → du-572XNP42-Ci5n1Ogx.cjs.map} +1 -1
- package/dist/{env-36M5BO7M-BAXuvwk7.cjs → env-36M5BO7M-BenXvlK4.cjs} +3 -3
- package/dist/{env-36M5BO7M-BAXuvwk7.cjs.map → env-36M5BO7M-BenXvlK4.cjs.map} +1 -1
- package/dist/{expand-JSPG6VOP-CeMMDAbH.cjs → expand-JSPG6VOP-CjkEn3pX.cjs} +3 -3
- package/dist/{expand-JSPG6VOP-CeMMDAbH.cjs.map → expand-JSPG6VOP-CjkEn3pX.cjs.map} +1 -1
- package/dist/{expansion-R25BK4W3-km42UsJs.cjs → expansion-R25BK4W3-DZdAzRFy.cjs} +2 -2
- package/dist/{expansion-R25BK4W3-km42UsJs.cjs.map → expansion-R25BK4W3-DZdAzRFy.cjs.map} +1 -1
- package/dist/{expr-5JAACS4X-DN6RUYi_.cjs → expr-5JAACS4X-BE97Pj1C.cjs} +3 -3
- package/dist/{expr-5JAACS4X-DN6RUYi_.cjs.map → expr-5JAACS4X-BE97Pj1C.cjs.map} +1 -1
- package/dist/{file-IPZJC3FQ-D8YmozYf.cjs → file-IPZJC3FQ-BHvdw59X.cjs} +2 -2
- package/dist/{file-IPZJC3FQ-D8YmozYf.cjs.map → file-IPZJC3FQ-BHvdw59X.cjs.map} +1 -1
- package/dist/{find-INTH3OLC-cCsh7QUd.cjs → find-INTH3OLC-CBMMzyRQ.cjs} +3 -3
- package/dist/{find-INTH3OLC-cCsh7QUd.cjs.map → find-INTH3OLC-CBMMzyRQ.cjs.map} +1 -1
- package/dist/{flag-coverage-XWSYNE72-xsiUZ2Uv.cjs → flag-coverage-XWSYNE72-TZpcGHnc.cjs} +54 -54
- package/dist/{flag-coverage-XWSYNE72-xsiUZ2Uv.cjs.map → flag-coverage-XWSYNE72-TZpcGHnc.cjs.map} +1 -1
- package/dist/{fold-4TQNYMSW-BgRS35yE.cjs → fold-4TQNYMSW-CgFJiPKu.cjs} +3 -3
- package/dist/{fold-4TQNYMSW-BgRS35yE.cjs.map → fold-4TQNYMSW-CgFJiPKu.cjs.map} +1 -1
- package/dist/{grep-V3LQVMRQ-D-wFiXtO.cjs → grep-V3LQVMRQ-DK2kayRm.cjs} +3 -3
- package/dist/{grep-V3LQVMRQ-D-wFiXtO.cjs.map → grep-V3LQVMRQ-DK2kayRm.cjs.map} +1 -1
- package/dist/{gzip-O5ASJAFY-lhZQgzvc.cjs → gzip-O5ASJAFY-CjSYBejX.cjs} +2 -2
- package/dist/{gzip-O5ASJAFY-lhZQgzvc.cjs.map → gzip-O5ASJAFY-CjSYBejX.cjs.map} +1 -1
- package/dist/{head-442HYESI-wfQsPgRD.cjs → head-442HYESI-CJR7SSlN.cjs} +2 -2
- package/dist/{head-442HYESI-wfQsPgRD.cjs.map → head-442HYESI-CJR7SSlN.cjs.map} +1 -1
- package/dist/{help-HZ6M2CKN-CvhvGBWT.cjs → help-HZ6M2CKN-CjWNE4rI.cjs} +3 -3
- package/dist/{help-HZ6M2CKN-CvhvGBWT.cjs.map → help-HZ6M2CKN-CjWNE4rI.cjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-DYP7i3n_.cjs → html-to-markdown-JW4MSQZO-BE1zSBBb.cjs} +3 -3
- package/dist/{html-to-markdown-JW4MSQZO-DYP7i3n_.cjs.map → html-to-markdown-JW4MSQZO-BE1zSBBb.cjs.map} +1 -1
- package/dist/index-BTz2OMAM.d.cts.map +1 -1
- package/dist/index-Cq2F2XdS.d.mts.map +1 -1
- package/dist/index-WT4ULMiw.d.cts.map +1 -1
- package/dist/index-WT4ULMiw.d.mts.map +1 -1
- package/dist/{join-TBRGI3LQ-bHNmcV0E.cjs → join-TBRGI3LQ-pEfJS23I.cjs} +3 -3
- package/dist/{join-TBRGI3LQ-bHNmcV0E.cjs.map → join-TBRGI3LQ-pEfJS23I.cjs.map} +1 -1
- package/dist/{jq-4XLYLOS5-DJJGyuG8.cjs → jq-4XLYLOS5-2vuSbClV.cjs} +5 -5
- package/dist/{jq-4XLYLOS5-DJJGyuG8.cjs.map → jq-4XLYLOS5-2vuSbClV.cjs.map} +1 -1
- package/dist/{js-exec-N5KEZBH7-D4Lzs88c.cjs → js-exec-N5KEZBH7-aU0Z-PSz.cjs} +4 -4
- package/dist/{js-exec-N5KEZBH7-D4Lzs88c.cjs.map → js-exec-N5KEZBH7-aU0Z-PSz.cjs.map} +1 -1
- package/dist/{ln-4LGSXXGD-Dea9eT1o.cjs → ln-4LGSXXGD-YmC44ShY.cjs} +3 -3
- package/dist/{ln-4LGSXXGD-Dea9eT1o.cjs.map → ln-4LGSXXGD-YmC44ShY.cjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-D3JTk2Ir.cjs → ls-ZJGQER7M-C1sbxE97.cjs} +2 -2
- package/dist/{ls-ZJGQER7M-D3JTk2Ir.cjs.map → ls-ZJGQER7M-C1sbxE97.cjs.map} +1 -1
- package/dist/{lzma-B-M5XH2f.cjs → lzma-BKh11ciM.cjs} +2 -2
- package/dist/{lzma-B-M5XH2f.cjs.map → lzma-BKh11ciM.cjs.map} +1 -1
- package/dist/{md5sum-SPU24VSG-Bgoo_S_9.cjs → md5sum-SPU24VSG-b5Te6zur.cjs} +4 -4
- package/dist/{md5sum-SPU24VSG-Bgoo_S_9.cjs.map → md5sum-SPU24VSG-b5Te6zur.cjs.map} +1 -1
- package/dist/{microsandbox-CFgApCam-BbimRbAs.cjs → microsandbox-CFgApCam-DfQPNLy0.cjs} +3 -3
- package/dist/{microsandbox-CFgApCam-BbimRbAs.cjs.map → microsandbox-CFgApCam-DfQPNLy0.cjs.map} +1 -1
- package/dist/{mistral-BUpUX0vh.cjs → mistral-BAq-vJbL.cjs} +2 -2
- package/dist/{mistral-BUpUX0vh.cjs.map → mistral-BAq-vJbL.cjs.map} +1 -1
- package/dist/{mistral-Cy4OBeve.mjs → mistral-kplxV6Rf.mjs} +2 -2
- package/dist/{mistral-Cy4OBeve.mjs.map → mistral-kplxV6Rf.mjs.map} +1 -1
- package/dist/{mkdir-MEPGZOB6-C92GPZZj.cjs → mkdir-MEPGZOB6-7B2tAIJv.cjs} +3 -3
- package/dist/{mkdir-MEPGZOB6-C92GPZZj.cjs.map → mkdir-MEPGZOB6-7B2tAIJv.cjs.map} +1 -1
- package/dist/{mv-W5BIQ646-C6uESvHR.cjs → mv-W5BIQ646-yyXc-Ujb.cjs} +3 -3
- package/dist/{mv-W5BIQ646-C6uESvHR.cjs.map → mv-W5BIQ646-yyXc-Ujb.cjs.map} +1 -1
- package/dist/{nl-WSDW7I4O-WUHtx6ar.cjs → nl-WSDW7I4O-DsbEGL-D.cjs} +3 -3
- package/dist/{nl-WSDW7I4O-WUHtx6ar.cjs.map → nl-WSDW7I4O-DsbEGL-D.cjs.map} +1 -1
- package/dist/{od-WOKFDJTP-DZ_PhGba.cjs → od-WOKFDJTP-DjE2_lCr.cjs} +3 -3
- package/dist/{od-WOKFDJTP-DZ_PhGba.cjs.map → od-WOKFDJTP-DjE2_lCr.cjs.map} +1 -1
- package/dist/{paste-7JC6S4DX-BNnL5s0G.cjs → paste-7JC6S4DX-DmPxl6a5.cjs} +3 -3
- package/dist/{paste-7JC6S4DX-BNnL5s0G.cjs.map → paste-7JC6S4DX-DmPxl6a5.cjs.map} +1 -1
- package/dist/{printf-TWGXF445-DGYRYvFv.cjs → printf-TWGXF445-B3BKBgxE.cjs} +3 -3
- package/dist/{printf-TWGXF445-DGYRYvFv.cjs.map → printf-TWGXF445-B3BKBgxE.cjs.map} +1 -1
- package/dist/{python3-POMOR4OA-UrjbAdgU.cjs → python3-POMOR4OA-BP_CZEWk.cjs} +4 -4
- package/dist/{python3-POMOR4OA-UrjbAdgU.cjs.map → python3-POMOR4OA-BP_CZEWk.cjs.map} +1 -1
- package/dist/{rev-5EHFX4EJ-C6bEospo.cjs → rev-5EHFX4EJ-DAakI-6k.cjs} +3 -3
- package/dist/{rev-5EHFX4EJ-C6bEospo.cjs.map → rev-5EHFX4EJ-DAakI-6k.cjs.map} +1 -1
- package/dist/{rg-S4FXYXWB-eo-s3QO6.cjs → rg-S4FXYXWB-DEomHCwR.cjs} +3 -3
- package/dist/{rg-S4FXYXWB-eo-s3QO6.cjs.map → rg-S4FXYXWB-DEomHCwR.cjs.map} +1 -1
- package/dist/{rm-SSGETQVQ-pVbmfXAZ.cjs → rm-SSGETQVQ-DdpxhvsO.cjs} +3 -3
- package/dist/{rm-SSGETQVQ-pVbmfXAZ.cjs.map → rm-SSGETQVQ-DdpxhvsO.cjs.map} +1 -1
- package/dist/{rmdir-OC4ZLPYA-joHTq5dL.cjs → rmdir-OC4ZLPYA-BZhaWGT-.cjs} +3 -3
- package/dist/{rmdir-OC4ZLPYA-joHTq5dL.cjs.map → rmdir-OC4ZLPYA-BZhaWGT-.cjs.map} +1 -1
- package/dist/sandbox.cjs +1 -1
- package/dist/{sed-S5UIK574-CjEsIkX0.cjs → sed-S5UIK574-CI-fUrPh.cjs} +3 -3
- package/dist/{sed-S5UIK574-CjEsIkX0.cjs.map → sed-S5UIK574-CI-fUrPh.cjs.map} +1 -1
- package/dist/{sha1sum-2PTOAFR6-Zxn2YEQ7.cjs → sha1sum-2PTOAFR6-CAJd2y1J.cjs} +4 -4
- package/dist/{sha1sum-2PTOAFR6-Zxn2YEQ7.cjs.map → sha1sum-2PTOAFR6-CAJd2y1J.cjs.map} +1 -1
- package/dist/{sha256sum-NS7D3IXX-D2UBSHMT.cjs → sha256sum-NS7D3IXX-CPZ2P-c1.cjs} +4 -4
- package/dist/{sha256sum-NS7D3IXX-D2UBSHMT.cjs.map → sha256sum-NS7D3IXX-CPZ2P-c1.cjs.map} +1 -1
- package/dist/{sleep-X22JJINO-Dw3qJ3u5.cjs → sleep-X22JJINO-B76R-Pss.cjs} +3 -3
- package/dist/{sleep-X22JJINO-Dw3qJ3u5.cjs.map → sleep-X22JJINO-B76R-Pss.cjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-CY3xZvLH.cjs → sort-SW2YEO5B-CZdvp6Km.cjs} +4 -4
- package/dist/{sort-SW2YEO5B-CY3xZvLH.cjs.map → sort-SW2YEO5B-CZdvp6Km.cjs.map} +1 -1
- package/dist/{split-4KKZZXXE-C0nde5vb.cjs → split-4KKZZXXE-B5lroooe.cjs} +3 -3
- package/dist/{split-4KKZZXXE-C0nde5vb.cjs.map → split-4KKZZXXE-B5lroooe.cjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-DEljm7cX.cjs → sqlite3-CGOEFJAO-PLMgG_Q5.cjs} +3 -3
- package/dist/{sqlite3-CGOEFJAO-DEljm7cX.cjs.map → sqlite3-CGOEFJAO-PLMgG_Q5.cjs.map} +1 -1
- package/dist/{sse-C0gnbJhp.cjs → sse-5bXReLPW.cjs} +2 -2
- package/dist/{sse-C0gnbJhp.cjs.map → sse-5bXReLPW.cjs.map} +1 -1
- package/dist/{sse-4YoGxYO1.mjs → sse-DQi5Gnnd.mjs} +2 -2
- package/dist/{sse-4YoGxYO1.mjs.map → sse-DQi5Gnnd.mjs.map} +1 -1
- package/dist/{strings-6WDHLGMX-h7oJ16OF.cjs → strings-6WDHLGMX-BrcsGUuA.cjs} +2 -2
- package/dist/{strings-6WDHLGMX-h7oJ16OF.cjs.map → strings-6WDHLGMX-BrcsGUuA.cjs.map} +1 -1
- package/dist/{tac-2STMMJYW-BtWvKy2f.cjs → tac-2STMMJYW-B9Oin-rx.cjs} +2 -2
- package/dist/{tac-2STMMJYW-BtWvKy2f.cjs.map → tac-2STMMJYW-B9Oin-rx.cjs.map} +1 -1
- package/dist/{tail-R4PCA2C4-BU60h82S.cjs → tail-R4PCA2C4-CFsgIEI9.cjs} +2 -2
- package/dist/{tail-R4PCA2C4-BU60h82S.cjs.map → tail-R4PCA2C4-CFsgIEI9.cjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-qjKeyHOT.cjs → tar-STHHZTZ6-gaTqCHHf.cjs} +3 -3
- package/dist/{tar-STHHZTZ6-qjKeyHOT.cjs.map → tar-STHHZTZ6-gaTqCHHf.cjs.map} +1 -1
- package/dist/{tee-YUZ2FKCJ-BFNL3v2H.cjs → tee-YUZ2FKCJ-DrbSvUds.cjs} +2 -2
- package/dist/{tee-YUZ2FKCJ-BFNL3v2H.cjs.map → tee-YUZ2FKCJ-DrbSvUds.cjs.map} +1 -1
- package/dist/{time-D4LNBSWX-C4MkGGMR.cjs → time-D4LNBSWX-Ct8F4-NH.cjs} +3 -3
- package/dist/{time-D4LNBSWX-C4MkGGMR.cjs.map → time-D4LNBSWX-Ct8F4-NH.cjs.map} +1 -1
- package/dist/{timeout-YDCRSLPQ-B0LndT3y.cjs → timeout-YDCRSLPQ-D7PLQA8X.cjs} +3 -3
- package/dist/{timeout-YDCRSLPQ-B0LndT3y.cjs.map → timeout-YDCRSLPQ-D7PLQA8X.cjs.map} +1 -1
- package/dist/{touch-UA33VN3N-ChlyRE9Q.cjs → touch-UA33VN3N-uwgwvBAt.cjs} +3 -3
- package/dist/{touch-UA33VN3N-ChlyRE9Q.cjs.map → touch-UA33VN3N-uwgwvBAt.cjs.map} +1 -1
- package/dist/{tr-36LHWFRQ-BTAACzqK.cjs → tr-36LHWFRQ-Ddbm-R1a.cjs} +3 -3
- package/dist/{tr-36LHWFRQ-BTAACzqK.cjs.map → tr-36LHWFRQ-Ddbm-R1a.cjs.map} +1 -1
- package/dist/{tree-YLD52CNT-BwNhql16.cjs → tree-YLD52CNT-CxN8fkK7.cjs} +2 -2
- package/dist/{tree-YLD52CNT-BwNhql16.cjs.map → tree-YLD52CNT-CxN8fkK7.cjs.map} +1 -1
- package/dist/trigger.cjs +1 -1
- package/dist/trigger.mjs +1 -1
- package/dist/{unexpand-CADSA4VO-rkuYIkQz.cjs → unexpand-CADSA4VO-DDe4J1y5.cjs} +3 -3
- package/dist/{unexpand-CADSA4VO-rkuYIkQz.cjs.map → unexpand-CADSA4VO-DDe4J1y5.cjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-DhpovdZb.cjs → uniq-XSIZR6PB-Cp2d_Goe.cjs} +4 -4
- package/dist/{uniq-XSIZR6PB-DhpovdZb.cjs.map → uniq-XSIZR6PB-Cp2d_Goe.cjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-wQgdjpdx.cjs → wc-LF7NU4LA-BRf69_3M.cjs} +4 -4
- package/dist/{wc-LF7NU4LA-wQgdjpdx.cjs.map → wc-LF7NU4LA-BRf69_3M.cjs.map} +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.mjs +1 -1
- package/dist/{xan-Y6WF3IRG-CMqV7U0I.cjs → xan-Y6WF3IRG-CDOh5uPZ.cjs} +5 -5
- package/dist/{xan-Y6WF3IRG-CMqV7U0I.cjs.map → xan-Y6WF3IRG-CDOh5uPZ.cjs.map} +1 -1
- package/dist/{xan-view-HDVKHFC2-DLpnDKhQ.cjs → xan-view-HDVKHFC2-BlBCPKgW.cjs} +3 -3
- package/dist/{xan-view-HDVKHFC2-DLpnDKhQ.cjs.map → xan-view-HDVKHFC2-BlBCPKgW.cjs.map} +1 -1
- package/dist/{xargs-MGZPH7AX-d_x__ghK.cjs → xargs-MGZPH7AX-CjfUpqN_.cjs} +3 -3
- package/dist/{xargs-MGZPH7AX-d_x__ghK.cjs.map → xargs-MGZPH7AX-CjfUpqN_.cjs.map} +1 -1
- package/dist/{yq-4QJW3EQG-CDSPxkds.cjs → yq-4QJW3EQG-BRt0uAiw.cjs} +4 -4
- package/dist/{yq-4QJW3EQG-CDSPxkds.cjs.map → yq-4QJW3EQG-BRt0uAiw.cjs.map} +1 -1
- package/package.json +3 -3
- package/dist/dist-BWGuF7Bi.mjs.map +0 -1
- package/dist/dist-CDMCEgV0.cjs.map +0 -1
- package/dist/dist-CFKSzdSZ.mjs.map +0 -1
- package/dist/dist-DvZ4Dj_O.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
2
|
-
const require_dist$1 = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-CHlytoPR.cjs");
|
|
2
|
+
const require_dist$1 = require("./dist-BF8uTixs.cjs");
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
let node_async_hooks = require("node:async_hooks");
|
|
5
5
|
//#region ../workflow/dist/index.mjs
|
|
@@ -600,4 +600,4 @@ Object.defineProperty(exports, "serializeWorkflowError", {
|
|
|
600
600
|
}
|
|
601
601
|
});
|
|
602
602
|
|
|
603
|
-
//# sourceMappingURL=dist-
|
|
603
|
+
//# sourceMappingURL=dist-BZaoAtmj.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dist-sGyB6KsC.cjs","names":["z","withSpan","logSystem","captureConsole","normalizeCredentialList","getActionCredentialRequirements","resolveActionCredentials","runWithMcpCredentialContext","executeAction","AsyncLocalStorage","registerWorkflowRunGetter","getRunSignal","getWorkflowRunHandle"],"sources":["../../workflow/dist/index.mjs"],"sourcesContent":["import { z } from \"zod\";\nimport { executeAction, getActionCredentialRequirements, getRunSignal, getWorkflowRunHandle, normalizeCredentialList, registerWorkflowRunGetter, runWithMcpCredentialContext } from \"@keystrokehq/action\";\nimport { captureConsole, logSystem, withSpan } from \"@keystrokehq/tracing\";\nimport { resolveActionCredentials } from \"@keystrokehq/credentials\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n//#region src/run-canceled-error.ts\nvar RunCanceledError = class extends Error {\n\tconstructor(runId) {\n\t\tsuper(runId ? `Workflow run ${runId} was canceled` : \"Workflow run was canceled\");\n\t\tthis.name = \"RunCanceledError\";\n\t}\n};\nfunction isRunCanceledError(error) {\n\treturn error instanceof RunCanceledError;\n}\n//#endregion\n//#region src/workflow-definition.ts\nconst zodSchema = z.custom((v) => v instanceof z.ZodType, \"must be a Zod schema\");\n/** Runtime validation for an unbranded workflow definition. */\nconst workflowCoreSchema = z.object({\n\tslug: z.string().trim().min(1),\n\tname: z.string().optional(),\n\tdescription: z.string().optional(),\n\tsubscription: z.object({ mode: z.enum([\"system\", \"subscribable\"]).optional() }).optional(),\n\tinput: zodSchema,\n\toutput: zodSchema,\n\trun: z.function()\n});\nconst WORKFLOW = Symbol.for(\"keystroke.workflow\");\n/**\n* Validates brand + shape via `workflowCoreSchema` so discovery and guards\n* reject malformed definitions.\n*/\nfunction isWorkflow(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(WORKFLOW in value) || value[WORKFLOW] !== true) return false;\n\treturn workflowCoreSchema.safeParse(value).success;\n}\n//#endregion\n//#region src/define-workflow.ts\nfunction defineWorkflow(def) {\n\tconst result = workflowCoreSchema.safeParse(def);\n\tif (!result.success) throw new Error(`Invalid workflow definition: ${formatIssues(result.error.issues)}`);\n\treturn {\n\t\t...result.data,\n\t\t[WORKFLOW]: true\n\t};\n}\nfunction formatIssues(issues) {\n\treturn issues.map((issue) => {\n\t\treturn `${issue.path.length > 0 ? `${issue.path.join(\".\")}: ` : \"\"}${issue.message}`;\n\t}).join(\"; \");\n}\n//#endregion\n//#region src/replay/error.ts\nfunction serializeWorkflowError(error) {\n\tif (error instanceof Error) return {\n\t\tname: error.name,\n\t\tmessage: error.message\n\t};\n\treturn { message: String(error) };\n}\n/** Rebuild an Error from a recorded error so replay re-raises the same failure. */\nfunction deserializeWorkflowError(data) {\n\tconst serialized = data;\n\tconst error = new Error(serialized?.message ?? \"Workflow step failed\");\n\tif (serialized?.name) error.name = serialized.name;\n\treturn error;\n}\n//#endregion\n//#region src/replay/duration.ts\nconst UNIT_MS = {\n\tms: 1,\n\ts: 1e3,\n\tm: 6e4,\n\th: 36e5,\n\td: 864e5\n};\n/** Resolve a sleep duration to an absolute resume time. */\nfunction resolveResumeAt(duration, now = /* @__PURE__ */ new Date()) {\n\tif (duration instanceof Date) return duration;\n\tif (typeof duration === \"number\") return new Date(now.getTime() + Math.max(0, duration));\n\treturn new Date(now.getTime() + parseDurationToMs(duration));\n}\nfunction parseDurationToMs(value) {\n\tconst match = /^(\\d+(?:\\.\\d+)?)\\s*(ms|s|m|h|d)$/.exec(value.trim());\n\tif (!match) throw new Error(`Invalid sleep duration \"${value}\". Use a number of ms, a Date, or a string like \"5s\", \"10m\", \"1h\".`);\n\tconst amount = Number(match[1]);\n\tconst unit = match[2];\n\treturn Math.round(amount * UNIT_MS[unit]);\n}\n//#endregion\n//#region src/replay/events-consumer.ts\n/** Indexes replay events by correlationId for O(1) cache-hit checks during replay. */\nvar EventsConsumer = class {\n\tbyCorrelationId = /* @__PURE__ */ new Map();\n\tconstructor(events) {\n\t\tfor (const event of events) {\n\t\t\tif (!event.correlationId) continue;\n\t\t\tconst list = this.byCorrelationId.get(event.correlationId);\n\t\t\tif (list) list.push(event);\n\t\t\telse this.byCorrelationId.set(event.correlationId, [event]);\n\t\t}\n\t}\n\tevents(correlationId) {\n\t\treturn this.byCorrelationId.get(correlationId) ?? [];\n\t}\n\thasEventType(correlationId, type) {\n\t\treturn this.events(correlationId).some((event) => event.type === type);\n\t}\n\t/**\n\t* Cache lookup for a step. Returns the recorded output on a `step_completed`,\n\t* re-raises the recorded error on a terminal `step_failed` (so a permanently\n\t* failed step is not re-executed), and otherwise reports a miss — including\n\t* when only `step_retrying` events exist (the step re-runs on the next pass).\n\t*/\n\tgetStepResult(correlationId) {\n\t\tconst events = this.events(correlationId);\n\t\tconst failed = events.find((event) => event.type === \"step_failed\");\n\t\tif (failed) throw deserializeWorkflowError(failed.data);\n\t\tconst completed = events.find((event) => event.type === \"step_completed\");\n\t\tif (completed) return {\n\t\t\tcompleted: true,\n\t\t\tresult: completed.data\n\t\t};\n\t\treturn { completed: false };\n\t}\n\t/** Number of prior `step_retrying` events recorded for a step (= failed attempts so far). */\n\tcountRetrying(correlationId) {\n\t\treturn this.events(correlationId).filter((event) => event.type === \"step_retrying\").length;\n\t}\n\tisSleepCompleted(correlationId) {\n\t\treturn this.hasEventType(correlationId, \"sleep_completed\");\n\t}\n\t/** Returns the persisted resumeAt for a scheduled-but-not-completed sleep, if any. */\n\tgetSleepResumeAt(correlationId) {\n\t\tconst scheduled = this.events(correlationId).find((event) => event.type === \"sleep_scheduled\");\n\t\tif (!scheduled) return;\n\t\tconst data = scheduled.data;\n\t\treturn data?.resumeAt ? new Date(data.resumeAt) : void 0;\n\t}\n\tgetHookToken(correlationId) {\n\t\treturn (this.events(correlationId).find((event) => event.type === \"hook_created\")?.data)?.token;\n\t}\n\tgetHookResult(correlationId) {\n\t\tconst resumed = this.events(correlationId).find((event) => event.type === \"hook_resumed\");\n\t\tif (!resumed) return { resolved: false };\n\t\treturn {\n\t\t\tresolved: true,\n\t\t\tpayload: resumed.data?.payload\n\t\t};\n\t}\n};\n//#endregion\n//#region src/replay/suspension.ts\n/** A promise that never settles — returned by a suspending primitive so the body parks. */\nfunction createPendingPromise() {\n\treturn new Promise(() => {});\n}\n/**\n* Collects pending items requested within a single tick and resolves once, so\n* parallel suspensions (e.g. Promise.all of two sleeps) batch into one suspension.\n*/\nvar SuspensionCoordinator = class {\n\titems = /* @__PURE__ */ new Map();\n\tscheduled = false;\n\tresolve;\n\tpromise;\n\tconstructor() {\n\t\tthis.promise = new Promise((resolve) => {\n\t\t\tthis.resolve = resolve;\n\t\t});\n\t}\n\trequest(item) {\n\t\tthis.items.set(item.correlationId, item);\n\t\tif (!this.scheduled) {\n\t\t\tthis.scheduled = true;\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthis.resolve([...this.items.values()]);\n\t\t\t});\n\t\t}\n\t}\n\twaitForSuspension() {\n\t\treturn this.promise;\n\t}\n};\n//#endregion\n//#region src/replay/replay-context.ts\nfunction createReplayState(params) {\n\treturn {\n\t\trunId: params.runId,\n\t\tconsumer: params.consumer,\n\t\tcoordinator: params.coordinator,\n\t\teventLog: params.eventLog,\n\t\tnewEvents: [],\n\t\tnow: params.now ?? /* @__PURE__ */ new Date(),\n\t\thookBaseUrl: params.hookBaseUrl,\n\t\tsleepCounter: 0,\n\t\thookCounter: 0,\n\t\tstepOccurrences: /* @__PURE__ */ new Map(),\n\t\tstepCorrelationIds: /* @__PURE__ */ new Set()\n\t};\n}\n/**\n* Allocate the correlation id for a step. An explicit `.stepId(x)` maps to\n* `step:x` (and must be unique within a run); otherwise the key is\n* `step:<actionKey>#<occurrence>` so that two calls to the same action get\n* distinct, replay-stable ids and inserting an unrelated call never shifts the\n* ids of later calls (unlike a single global ordinal).\n*/\nfunction nextStepCorrelationId(state, actionKey, explicitId) {\n\tif (explicitId !== void 0) {\n\t\tconst correlationId = `step:${explicitId}`;\n\t\tif (state.stepCorrelationIds.has(correlationId)) throw new Error(`Duplicate step id \"${explicitId}\" in workflow run ${state.runId}`);\n\t\tstate.stepCorrelationIds.add(correlationId);\n\t\treturn correlationId;\n\t}\n\tconst occurrence = state.stepOccurrences.get(actionKey) ?? 0;\n\tstate.stepOccurrences.set(actionKey, occurrence + 1);\n\tconst correlationId = `step:${actionKey}#${occurrence}`;\n\tstate.stepCorrelationIds.add(correlationId);\n\treturn correlationId;\n}\nfunction createSleep(state) {\n\treturn function sleep(duration) {\n\t\tconst correlationId = `sleep#${state.sleepCounter++}`;\n\t\tif (state.consumer.isSleepCompleted(correlationId)) return Promise.resolve();\n\t\tconst scheduledResumeAt = state.consumer.getSleepResumeAt(correlationId);\n\t\tconst resumeAt = scheduledResumeAt ?? resolveResumeAt(duration, state.now);\n\t\tif (scheduledResumeAt && resumeAt.getTime() <= state.now.getTime()) {\n\t\t\tstate.newEvents.push({\n\t\t\t\tid: `sleep_completed:${state.runId}:${correlationId}`,\n\t\t\t\trunId: state.runId,\n\t\t\t\ttype: \"sleep_completed\",\n\t\t\t\tcorrelationId\n\t\t\t});\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tif (!scheduledResumeAt) state.newEvents.push({\n\t\t\tid: `sleep_scheduled:${state.runId}:${correlationId}`,\n\t\t\trunId: state.runId,\n\t\t\ttype: \"sleep_scheduled\",\n\t\t\tcorrelationId,\n\t\t\tdata: { resumeAt: resumeAt.toISOString() }\n\t\t});\n\t\tstate.coordinator.request({\n\t\t\tkind: \"sleep\",\n\t\t\tcorrelationId,\n\t\t\tresumeAt\n\t\t});\n\t\treturn createPendingPromise();\n\t};\n}\nfunction createHook(state) {\n\treturn function hook(options) {\n\t\tconst correlationId = `hook#${state.hookCounter++}`;\n\t\tconst token = options?.token ?? state.consumer.getHookToken(correlationId) ?? `hook_${crypto.randomUUID()}`;\n\t\treturn {\n\t\t\ttoken,\n\t\t\tresumeUrl: state.hookBaseUrl ? `${state.hookBaseUrl}/hooks/${token}/resume` : `/hooks/${token}/resume`,\n\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\tconst result = state.consumer.getHookResult(correlationId);\n\t\t\t\tif (result.resolved) {\n\t\t\t\t\tconst payload = options?.schema ? options.schema.parse(result.payload) : result.payload;\n\t\t\t\t\treturn Promise.resolve(payload).then(onFulfilled, onRejected);\n\t\t\t\t}\n\t\t\t\tif (!state.consumer.hasEventType(correlationId, \"hook_created\")) state.newEvents.push({\n\t\t\t\t\tid: `hook_created:${state.runId}:${correlationId}`,\n\t\t\t\t\trunId: state.runId,\n\t\t\t\t\ttype: \"hook_created\",\n\t\t\t\t\tcorrelationId,\n\t\t\t\t\tdata: { token }\n\t\t\t\t});\n\t\t\t\tstate.coordinator.request({\n\t\t\t\t\tkind: \"hook\",\n\t\t\t\t\tcorrelationId,\n\t\t\t\t\ttoken\n\t\t\t\t});\n\t\t\t\treturn createPendingPromise().then(onFulfilled, onRejected);\n\t\t\t}\n\t\t};\n\t};\n}\n//#endregion\n//#region src/run-durable-step.ts\n/**\n* Shared durable-step shell: resolve a stable `correlation_id`, short-circuit\n* from the event log on a cache hit, otherwise execute and append\n* `step_completed` immediately (per-step crash durability). A thrown step\n* appends `step_retrying` (non-fatal, re-run on the next attempt) and\n* rethrows; the terminal `step_failed` is written by the job handler once the\n* queue exhausts retries.\n*/\nasync function runDurableStep(state, options) {\n\tconst { runId, consumer, eventLog } = state;\n\tgetRunSignal().throwIfAborted();\n\tconst correlationId = nextStepCorrelationId(state, options.key, options.id);\n\tconst cached = consumer.getStepResult(correlationId);\n\tconst metadata = {\n\t\trunId,\n\t\t[options.metadataKey]: options.key,\n\t\tcorrelationId\n\t};\n\tif (cached.completed) {\n\t\tawait withSpan({\n\t\t\tkind: options.kind,\n\t\t\tname: options.key,\n\t\t\trefId: `${runId}:${correlationId}`,\n\t\t\tmetadata: {\n\t\t\t\t...metadata,\n\t\t\t\treplayed: true\n\t\t\t}\n\t\t}, async () => {\n\t\t\tawait logSystem(\"info\", options.replayMessage, metadata);\n\t\t});\n\t\treturn options.parseCached ? options.parseCached(cached.result) : cached.result;\n\t}\n\treturn withSpan({\n\t\tkind: options.kind,\n\t\tname: options.key,\n\t\trefId: `${runId}:${correlationId}`,\n\t\tmetadata\n\t}, async () => captureConsole(async () => {\n\t\ttry {\n\t\t\tconst result = await options.execute(correlationId);\n\t\t\tawait eventLog.append({\n\t\t\t\tid: `step_completed:${runId}:${correlationId}`,\n\t\t\t\trunId,\n\t\t\t\ttype: \"step_completed\",\n\t\t\t\tcorrelationId,\n\t\t\t\tdata: result\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tconst attempt = consumer.countRetrying(correlationId);\n\t\t\tawait eventLog.append({\n\t\t\t\tid: `step_retrying:${runId}:${correlationId}:${attempt}`,\n\t\t\t\trunId,\n\t\t\t\ttype: \"step_retrying\",\n\t\t\t\tcorrelationId,\n\t\t\t\tdata: serializeWorkflowError(error)\n\t\t\t});\n\t\t\tstate.failedCorrelationId = correlationId;\n\t\t\tthrow error;\n\t\t}\n\t}));\n}\n//#endregion\n//#region src/create-action-runner.ts\nfunction withCredentialScopeOverride(requirements, scope) {\n\tif (!requirements || !scope) return requirements;\n\treturn normalizeCredentialList(requirements).map((requirement) => ({\n\t\t...requirement,\n\t\tscope\n\t}));\n}\n/** Builds the per-run action runner; durability lives in {@link runDurableStep}. */\nfunction createActionRunner(state, options = {}) {\n\treturn (action, input, runOptions) => runDurableStep(state, {\n\t\tkind: \"action\",\n\t\tkey: action.slug,\n\t\tid: runOptions?.id,\n\t\tmetadataKey: \"actionKey\",\n\t\treplayMessage: \"action replayed from checkpoint\",\n\t\tparseCached: (cached) => action.output.parse(cached),\n\t\texecute: async (correlationId) => {\n\t\t\tconst requirements = withCredentialScopeOverride(getActionCredentialRequirements(action), runOptions?.credentialScope);\n\t\t\tconst credentials = requirements?.length ? await resolveActionCredentials(requirements, {\n\t\t\t\tresolveCredentials: options.resolveCredentials,\n\t\t\t\tcontext: options.credentialContext,\n\t\t\t\toauthAdapter: options.oauthAdapter,\n\t\t\t\tconsumer: {\n\t\t\t\t\tkind: \"action\",\n\t\t\t\t\tname: action.slug,\n\t\t\t\t\tid: correlationId\n\t\t\t\t}\n\t\t\t}) : {};\n\t\t\treturn runWithMcpCredentialContext({\n\t\t\t\t...options.mcpCredentialContext,\n\t\t\t\tconsumerId: correlationId\n\t\t\t}, () => executeAction(action, input, credentials));\n\t\t}\n\t});\n}\n//#endregion\n//#region src/create-agent-step-runner.ts\n/**\n* Builds the per-run agent runner: each `agent.prompt()` in a workflow body\n* becomes a durable step keyed `step:<agentKey>#<occurrence>` (same scheme as\n* actions). The actual prompt execution is delegated to `runAgent`, supplied\n* by the host (server) via `executeWorkflow({ runAgent })`.\n*/\nfunction createAgentStepRunner(state, runAgent) {\n\treturn (agent, input, options) => {\n\t\tconst slug = agent.slug;\n\t\treturn runDurableStep(state, {\n\t\t\tkind: \"agent_session\",\n\t\t\tkey: slug,\n\t\t\tid: options?.id,\n\t\t\tmetadataKey: \"agentKey\",\n\t\t\treplayMessage: \"agent step replayed from checkpoint\",\n\t\t\texecute: (_correlationId) => runAgent(agent, input, options?.runPrompt)\n\t\t});\n\t};\n}\n//#endregion\n//#region src/create-llm-step-runner.ts\n/**\n* Builds the per-run LLM runner: each `promptLlm()` in a workflow body becomes a\n* durable step keyed `step:promptLlm#<occurrence>`. The actual LLM call is\n* delegated to `runLlm`, supplied by the host (server) via `executeWorkflow({ runLlm })`.\n*/\nfunction createLlmStepRunner(state, runLlm) {\n\treturn (opts) => runDurableStep(state, {\n\t\tkind: \"llm\",\n\t\tkey: \"promptLlm\",\n\t\tid: opts.stepId,\n\t\tmetadataKey: \"llmKey\",\n\t\treplayMessage: \"llm step replayed from checkpoint\",\n\t\tparseCached: (cached) => opts.outputSchema ? opts.outputSchema.parse(cached) : cached,\n\t\texecute: (_correlationId) => runLlm(opts)\n\t});\n}\n//#endregion\n//#region src/run-context.ts\nconst storage = new AsyncLocalStorage();\nregisterWorkflowRunGetter(() => {\n\tconst store = storage.getStore();\n\tif (!store) return;\n\treturn {\n\t\tactionRunner: store.actionRunner,\n\t\tagentRunner: store.agentRunner,\n\t\tllmRunner: store.llmRunner\n\t};\n});\nfunction runWithWorkflowContext(store, fn) {\n\treturn storage.run(store, fn);\n}\n//#endregion\n//#region src/replay/memory-event-log.ts\n/** In-memory durable log for inline execution and tests. */\nvar MemoryEventLog = class {\n\tevents = [];\n\tids = /* @__PURE__ */ new Set();\n\tasync append(event) {\n\t\tconst id = event.id ?? crypto.randomUUID();\n\t\tif (this.ids.has(id)) return false;\n\t\tthis.ids.add(id);\n\t\tthis.events.push({\n\t\t\tid,\n\t\t\trunId: event.runId,\n\t\t\tseq: this.events.length,\n\t\t\ttype: event.type,\n\t\t\tcorrelationId: event.correlationId ?? null,\n\t\t\tdata: event.data ?? null\n\t\t});\n\t\treturn true;\n\t}\n\tasync listReplay(runId) {\n\t\treturn this.events.filter((event) => event.runId === runId).map((event) => ({ ...event }));\n\t}\n};\n//#endregion\n//#region src/execute-workflow.ts\n/**\n* The single way to run a workflow: replay its event log from the top, execute\n* un-cached primitives, and either complete/fail or suspend at the first\n* un-satisfied sleep/hook. New events (sleep_scheduled/sleep_completed/\n* hook_created/run_completed/run_failed) are flushed before returning.\n*\n* Durability comes entirely from the log — a suspended run resumes by calling\n* this again with the same `runId` and event log once the sleep is due or the\n* hook is resumed.\n*/\nasync function executeWorkflow(workflow, input, options = {}) {\n\tconst runId = options.runId ?? crypto.randomUUID();\n\tconst eventLog = options.eventLog ?? new MemoryEventLog();\n\tconst signal = getRunSignal();\n\tconst consumer = new EventsConsumer(await eventLog.listReplay(runId));\n\tconst coordinator = new SuspensionCoordinator();\n\tconst state = createReplayState({\n\t\trunId,\n\t\tconsumer,\n\t\tcoordinator,\n\t\teventLog,\n\t\thookBaseUrl: options.hookBaseUrl,\n\t\tnow: options.now\n\t});\n\tconst actionRunner = createActionRunner(state, {\n\t\tresolveCredentials: options.resolveCredentials,\n\t\tcredentialContext: options.credentialContext,\n\t\toauthAdapter: options.oauthAdapter,\n\t\tmcpCredentialContext: { assignmentTarget: {\n\t\t\ttype: \"workflow\",\n\t\t\tkey: workflow.slug\n\t\t} }\n\t});\n\tconst ctx = {\n\t\trunId,\n\t\tsleep: createSleep(state),\n\t\thook: createHook(state),\n\t\t...options.context\n\t};\n\tconst agentRunner = options.runAgent ? createAgentStepRunner(state, options.runAgent) : void 0;\n\tconst llmRunner = options.runLlm ? createLlmStepRunner(state, options.runLlm) : void 0;\n\tconst validatedInput = workflow.input.parse(input);\n\tconst bodyPromise = runWithWorkflowContext({\n\t\tactionRunner,\n\t\tagentRunner,\n\t\tllmRunner,\n\t\trunId\n\t}, () => captureConsole(async () => workflow.run(validatedInput, ctx)));\n\tlet onAbort;\n\tconst waitForAbort = signal.aborted ? Promise.resolve({ type: \"canceled\" }) : new Promise((resolve) => {\n\t\tonAbort = () => resolve({ type: \"canceled\" });\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\tconst outcome = await Promise.race([\n\t\tbodyPromise.then((output) => ({\n\t\t\ttype: \"done\",\n\t\t\toutput\n\t\t}), (error) => ({\n\t\t\ttype: \"error\",\n\t\t\terror\n\t\t})),\n\t\tcoordinator.waitForSuspension().then((items) => ({\n\t\t\ttype: \"suspended\",\n\t\t\titems\n\t\t})),\n\t\twaitForAbort\n\t]);\n\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\tlet result;\n\tif (outcome.type === \"suspended\") {\n\t\tbodyPromise.catch(() => {});\n\t\tresult = {\n\t\t\tstatus: \"suspended\",\n\t\t\titems: outcome.items\n\t\t};\n\t} else if (outcome.type === \"done\") {\n\t\tconst output = workflow.output.parse(outcome.output);\n\t\tstate.newEvents.push({\n\t\t\tid: `run_completed:${runId}`,\n\t\t\trunId,\n\t\t\ttype: \"run_completed\",\n\t\t\tdata: { output }\n\t\t});\n\t\tresult = {\n\t\t\tstatus: \"completed\",\n\t\t\toutput\n\t\t};\n\t} else if (outcome.type === \"canceled\" || isRunCanceledError(outcome.error)) {\n\t\tbodyPromise.catch(() => {});\n\t\tstate.newEvents.push({\n\t\t\tid: `run_canceled:${runId}`,\n\t\t\trunId,\n\t\t\ttype: \"run_canceled\"\n\t\t});\n\t\tresult = { status: \"canceled\" };\n\t} else result = {\n\t\tstatus: \"failed\",\n\t\terror: outcome.error,\n\t\tfailedCorrelationId: state.failedCorrelationId\n\t};\n\tfor (const event of state.newEvents) await eventLog.append(event);\n\treturn result;\n}\n//#endregion\n//#region src/prompt-llm.ts\nfunction promptLlm(prompt, opts) {\n\tconst handle = getWorkflowRunHandle();\n\tif (!handle?.llmRunner) throw new Error(\"promptLlm must run inside a workflow with an injected llm executor (executeWorkflow({ runLlm })).\");\n\treturn handle.llmRunner({\n\t\tprompt,\n\t\t...opts\n\t});\n}\n//#endregion\nexport { MemoryEventLog, RunCanceledError, defineWorkflow, deserializeWorkflowError, executeWorkflow, isRunCanceledError, isWorkflow, promptLlm, serializeWorkflowError };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;AAMA,IAAI,mBAAmB,cAAc,MAAM;CAC1C,YAAY,OAAO;EAClB,MAAM,QAAQ,gBAAgB,MAAM,iBAAiB,2BAA2B;EAChF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MAAM,EAAE,OAAO;EAChB,CAAC;EACD,SAAS;GACR,QAAQ;GACR;EACD;CACD,OAAO,IAAI,QAAQ,SAAS,cAAc,mBAAmB,QAAQ,KAAK,GAAG;EAC5E,YAAY,YAAY,CAAC,CAAC;EAC1B,MAAM,UAAU,KAAK;GACpB,IAAI,gBAAgB;GACpB;GACA,MAAM;EACP,CAAC;EACD,SAAS,EAAE,QAAQ,WAAW;CAC/B,OAAO,SAAS;EACf,QAAQ;EACR,OAAO,QAAQ;EACf,qBAAqB,MAAM;CAC5B;CACA,KAAK,MAAM,SAAS,MAAM,WAAW,MAAM,SAAS,OAAO,KAAK;CAChE,OAAO;AACR;AAGA,SAAS,UAAU,QAAQ,MAAM;CAChC,MAAM,SAASS,aAAAA,qBAAqB;CACpC,IAAI,CAAC,QAAQ,WAAW,MAAM,IAAI,MAAM,mGAAmG;CAC3I,OAAO,OAAO,UAAU;EACvB;EACA,GAAG;CACJ,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"dist-BZaoAtmj.cjs","names":["z","withSpan","logSystem","captureConsole","normalizeCredentialList","getActionCredentialRequirements","resolveActionCredentials","runWithMcpCredentialContext","executeAction","AsyncLocalStorage","registerWorkflowRunGetter","getRunSignal","getWorkflowRunHandle"],"sources":["../../workflow/dist/index.mjs"],"sourcesContent":["import { z } from \"zod\";\nimport { executeAction, getActionCredentialRequirements, getRunSignal, getWorkflowRunHandle, normalizeCredentialList, registerWorkflowRunGetter, runWithMcpCredentialContext } from \"@keystrokehq/action\";\nimport { captureConsole, logSystem, withSpan } from \"@keystrokehq/tracing\";\nimport { resolveActionCredentials } from \"@keystrokehq/credentials\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n//#region src/run-canceled-error.ts\nvar RunCanceledError = class extends Error {\n\tconstructor(runId) {\n\t\tsuper(runId ? `Workflow run ${runId} was canceled` : \"Workflow run was canceled\");\n\t\tthis.name = \"RunCanceledError\";\n\t}\n};\nfunction isRunCanceledError(error) {\n\treturn error instanceof RunCanceledError;\n}\n//#endregion\n//#region src/workflow-definition.ts\nconst zodSchema = z.custom((v) => v instanceof z.ZodType, \"must be a Zod schema\");\n/** Runtime validation for an unbranded workflow definition. */\nconst workflowCoreSchema = z.object({\n\tslug: z.string().trim().min(1),\n\tname: z.string().optional(),\n\tdescription: z.string().optional(),\n\tsubscription: z.object({ mode: z.enum([\"system\", \"subscribable\"]).optional() }).optional(),\n\tinput: zodSchema,\n\toutput: zodSchema,\n\trun: z.function()\n});\nconst WORKFLOW = Symbol.for(\"keystroke.workflow\");\n/**\n* Validates brand + shape via `workflowCoreSchema` so discovery and guards\n* reject malformed definitions.\n*/\nfunction isWorkflow(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(WORKFLOW in value) || value[WORKFLOW] !== true) return false;\n\treturn workflowCoreSchema.safeParse(value).success;\n}\n//#endregion\n//#region src/define-workflow.ts\nfunction defineWorkflow(def) {\n\tconst result = workflowCoreSchema.safeParse(def);\n\tif (!result.success) throw new Error(`Invalid workflow definition: ${formatIssues(result.error.issues)}`);\n\treturn {\n\t\t...result.data,\n\t\t[WORKFLOW]: true\n\t};\n}\nfunction formatIssues(issues) {\n\treturn issues.map((issue) => {\n\t\treturn `${issue.path.length > 0 ? `${issue.path.join(\".\")}: ` : \"\"}${issue.message}`;\n\t}).join(\"; \");\n}\n//#endregion\n//#region src/replay/error.ts\nfunction serializeWorkflowError(error) {\n\tif (error instanceof Error) return {\n\t\tname: error.name,\n\t\tmessage: error.message\n\t};\n\treturn { message: String(error) };\n}\n/** Rebuild an Error from a recorded error so replay re-raises the same failure. */\nfunction deserializeWorkflowError(data) {\n\tconst serialized = data;\n\tconst error = new Error(serialized?.message ?? \"Workflow step failed\");\n\tif (serialized?.name) error.name = serialized.name;\n\treturn error;\n}\n//#endregion\n//#region src/replay/duration.ts\nconst UNIT_MS = {\n\tms: 1,\n\ts: 1e3,\n\tm: 6e4,\n\th: 36e5,\n\td: 864e5\n};\n/** Resolve a sleep duration to an absolute resume time. */\nfunction resolveResumeAt(duration, now = /* @__PURE__ */ new Date()) {\n\tif (duration instanceof Date) return duration;\n\tif (typeof duration === \"number\") return new Date(now.getTime() + Math.max(0, duration));\n\treturn new Date(now.getTime() + parseDurationToMs(duration));\n}\nfunction parseDurationToMs(value) {\n\tconst match = /^(\\d+(?:\\.\\d+)?)\\s*(ms|s|m|h|d)$/.exec(value.trim());\n\tif (!match) throw new Error(`Invalid sleep duration \"${value}\". Use a number of ms, a Date, or a string like \"5s\", \"10m\", \"1h\".`);\n\tconst amount = Number(match[1]);\n\tconst unit = match[2];\n\treturn Math.round(amount * UNIT_MS[unit]);\n}\n//#endregion\n//#region src/replay/events-consumer.ts\n/** Indexes replay events by correlationId for O(1) cache-hit checks during replay. */\nvar EventsConsumer = class {\n\tbyCorrelationId = /* @__PURE__ */ new Map();\n\tconstructor(events) {\n\t\tfor (const event of events) {\n\t\t\tif (!event.correlationId) continue;\n\t\t\tconst list = this.byCorrelationId.get(event.correlationId);\n\t\t\tif (list) list.push(event);\n\t\t\telse this.byCorrelationId.set(event.correlationId, [event]);\n\t\t}\n\t}\n\tevents(correlationId) {\n\t\treturn this.byCorrelationId.get(correlationId) ?? [];\n\t}\n\thasEventType(correlationId, type) {\n\t\treturn this.events(correlationId).some((event) => event.type === type);\n\t}\n\t/**\n\t* Cache lookup for a step. Returns the recorded output on a `step_completed`,\n\t* re-raises the recorded error on a terminal `step_failed` (so a permanently\n\t* failed step is not re-executed), and otherwise reports a miss — including\n\t* when only `step_retrying` events exist (the step re-runs on the next pass).\n\t*/\n\tgetStepResult(correlationId) {\n\t\tconst events = this.events(correlationId);\n\t\tconst failed = events.find((event) => event.type === \"step_failed\");\n\t\tif (failed) throw deserializeWorkflowError(failed.data);\n\t\tconst completed = events.find((event) => event.type === \"step_completed\");\n\t\tif (completed) return {\n\t\t\tcompleted: true,\n\t\t\tresult: completed.data\n\t\t};\n\t\treturn { completed: false };\n\t}\n\t/** Number of prior `step_retrying` events recorded for a step (= failed attempts so far). */\n\tcountRetrying(correlationId) {\n\t\treturn this.events(correlationId).filter((event) => event.type === \"step_retrying\").length;\n\t}\n\tisSleepCompleted(correlationId) {\n\t\treturn this.hasEventType(correlationId, \"sleep_completed\");\n\t}\n\t/** Returns the persisted resumeAt for a scheduled-but-not-completed sleep, if any. */\n\tgetSleepResumeAt(correlationId) {\n\t\tconst scheduled = this.events(correlationId).find((event) => event.type === \"sleep_scheduled\");\n\t\tif (!scheduled) return;\n\t\tconst data = scheduled.data;\n\t\treturn data?.resumeAt ? new Date(data.resumeAt) : void 0;\n\t}\n\tgetHookToken(correlationId) {\n\t\treturn (this.events(correlationId).find((event) => event.type === \"hook_created\")?.data)?.token;\n\t}\n\tgetHookResult(correlationId) {\n\t\tconst resumed = this.events(correlationId).find((event) => event.type === \"hook_resumed\");\n\t\tif (!resumed) return { resolved: false };\n\t\treturn {\n\t\t\tresolved: true,\n\t\t\tpayload: resumed.data?.payload\n\t\t};\n\t}\n};\n//#endregion\n//#region src/replay/suspension.ts\n/** A promise that never settles — returned by a suspending primitive so the body parks. */\nfunction createPendingPromise() {\n\treturn new Promise(() => {});\n}\n/**\n* Collects pending items requested within a single tick and resolves once, so\n* parallel suspensions (e.g. Promise.all of two sleeps) batch into one suspension.\n*/\nvar SuspensionCoordinator = class {\n\titems = /* @__PURE__ */ new Map();\n\tscheduled = false;\n\tresolve;\n\tpromise;\n\tconstructor() {\n\t\tthis.promise = new Promise((resolve) => {\n\t\t\tthis.resolve = resolve;\n\t\t});\n\t}\n\trequest(item) {\n\t\tthis.items.set(item.correlationId, item);\n\t\tif (!this.scheduled) {\n\t\t\tthis.scheduled = true;\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthis.resolve([...this.items.values()]);\n\t\t\t});\n\t\t}\n\t}\n\twaitForSuspension() {\n\t\treturn this.promise;\n\t}\n};\n//#endregion\n//#region src/replay/replay-context.ts\nfunction createReplayState(params) {\n\treturn {\n\t\trunId: params.runId,\n\t\tconsumer: params.consumer,\n\t\tcoordinator: params.coordinator,\n\t\teventLog: params.eventLog,\n\t\tnewEvents: [],\n\t\tnow: params.now ?? /* @__PURE__ */ new Date(),\n\t\thookBaseUrl: params.hookBaseUrl,\n\t\tsleepCounter: 0,\n\t\thookCounter: 0,\n\t\tstepOccurrences: /* @__PURE__ */ new Map(),\n\t\tstepCorrelationIds: /* @__PURE__ */ new Set()\n\t};\n}\n/**\n* Allocate the correlation id for a step. An explicit `.stepId(x)` maps to\n* `step:x` (and must be unique within a run); otherwise the key is\n* `step:<actionKey>#<occurrence>` so that two calls to the same action get\n* distinct, replay-stable ids and inserting an unrelated call never shifts the\n* ids of later calls (unlike a single global ordinal).\n*/\nfunction nextStepCorrelationId(state, actionKey, explicitId) {\n\tif (explicitId !== void 0) {\n\t\tconst correlationId = `step:${explicitId}`;\n\t\tif (state.stepCorrelationIds.has(correlationId)) throw new Error(`Duplicate step id \"${explicitId}\" in workflow run ${state.runId}`);\n\t\tstate.stepCorrelationIds.add(correlationId);\n\t\treturn correlationId;\n\t}\n\tconst occurrence = state.stepOccurrences.get(actionKey) ?? 0;\n\tstate.stepOccurrences.set(actionKey, occurrence + 1);\n\tconst correlationId = `step:${actionKey}#${occurrence}`;\n\tstate.stepCorrelationIds.add(correlationId);\n\treturn correlationId;\n}\nfunction createSleep(state) {\n\treturn function sleep(duration) {\n\t\tconst correlationId = `sleep#${state.sleepCounter++}`;\n\t\tif (state.consumer.isSleepCompleted(correlationId)) return Promise.resolve();\n\t\tconst scheduledResumeAt = state.consumer.getSleepResumeAt(correlationId);\n\t\tconst resumeAt = scheduledResumeAt ?? resolveResumeAt(duration, state.now);\n\t\tif (scheduledResumeAt && resumeAt.getTime() <= state.now.getTime()) {\n\t\t\tstate.newEvents.push({\n\t\t\t\tid: `sleep_completed:${state.runId}:${correlationId}`,\n\t\t\t\trunId: state.runId,\n\t\t\t\ttype: \"sleep_completed\",\n\t\t\t\tcorrelationId\n\t\t\t});\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\tif (!scheduledResumeAt) state.newEvents.push({\n\t\t\tid: `sleep_scheduled:${state.runId}:${correlationId}`,\n\t\t\trunId: state.runId,\n\t\t\ttype: \"sleep_scheduled\",\n\t\t\tcorrelationId,\n\t\t\tdata: { resumeAt: resumeAt.toISOString() }\n\t\t});\n\t\tstate.coordinator.request({\n\t\t\tkind: \"sleep\",\n\t\t\tcorrelationId,\n\t\t\tresumeAt\n\t\t});\n\t\treturn createPendingPromise();\n\t};\n}\nfunction createHook(state) {\n\treturn function hook(options) {\n\t\tconst correlationId = `hook#${state.hookCounter++}`;\n\t\tconst token = options?.token ?? state.consumer.getHookToken(correlationId) ?? `hook_${crypto.randomUUID()}`;\n\t\treturn {\n\t\t\ttoken,\n\t\t\tresumeUrl: state.hookBaseUrl ? `${state.hookBaseUrl}/hooks/${token}/resume` : `/hooks/${token}/resume`,\n\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\tconst result = state.consumer.getHookResult(correlationId);\n\t\t\t\tif (result.resolved) {\n\t\t\t\t\tconst payload = options?.schema ? options.schema.parse(result.payload) : result.payload;\n\t\t\t\t\treturn Promise.resolve(payload).then(onFulfilled, onRejected);\n\t\t\t\t}\n\t\t\t\tif (!state.consumer.hasEventType(correlationId, \"hook_created\")) state.newEvents.push({\n\t\t\t\t\tid: `hook_created:${state.runId}:${correlationId}`,\n\t\t\t\t\trunId: state.runId,\n\t\t\t\t\ttype: \"hook_created\",\n\t\t\t\t\tcorrelationId,\n\t\t\t\t\tdata: { token }\n\t\t\t\t});\n\t\t\t\tstate.coordinator.request({\n\t\t\t\t\tkind: \"hook\",\n\t\t\t\t\tcorrelationId,\n\t\t\t\t\ttoken\n\t\t\t\t});\n\t\t\t\treturn createPendingPromise().then(onFulfilled, onRejected);\n\t\t\t}\n\t\t};\n\t};\n}\n//#endregion\n//#region src/run-durable-step.ts\n/**\n* Shared durable-step shell: resolve a stable `correlation_id`, short-circuit\n* from the event log on a cache hit, otherwise execute and append\n* `step_completed` immediately (per-step crash durability). A thrown step\n* appends `step_retrying` (non-fatal, re-run on the next attempt) and\n* rethrows; the terminal `step_failed` is written by the job handler once the\n* queue exhausts retries.\n*/\nasync function runDurableStep(state, options) {\n\tconst { runId, consumer, eventLog } = state;\n\tgetRunSignal().throwIfAborted();\n\tconst correlationId = nextStepCorrelationId(state, options.key, options.id);\n\tconst cached = consumer.getStepResult(correlationId);\n\tconst metadata = {\n\t\trunId,\n\t\t[options.metadataKey]: options.key,\n\t\tcorrelationId\n\t};\n\tif (cached.completed) {\n\t\tawait withSpan({\n\t\t\tkind: options.kind,\n\t\t\tname: options.key,\n\t\t\trefId: `${runId}:${correlationId}`,\n\t\t\tmetadata: {\n\t\t\t\t...metadata,\n\t\t\t\treplayed: true\n\t\t\t}\n\t\t}, async () => {\n\t\t\tawait logSystem(\"info\", options.replayMessage, metadata);\n\t\t});\n\t\treturn options.parseCached ? options.parseCached(cached.result) : cached.result;\n\t}\n\treturn withSpan({\n\t\tkind: options.kind,\n\t\tname: options.key,\n\t\trefId: `${runId}:${correlationId}`,\n\t\tmetadata\n\t}, async () => captureConsole(async () => {\n\t\ttry {\n\t\t\tconst result = await options.execute(correlationId);\n\t\t\tawait eventLog.append({\n\t\t\t\tid: `step_completed:${runId}:${correlationId}`,\n\t\t\t\trunId,\n\t\t\t\ttype: \"step_completed\",\n\t\t\t\tcorrelationId,\n\t\t\t\tdata: result\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tconst attempt = consumer.countRetrying(correlationId);\n\t\t\tawait eventLog.append({\n\t\t\t\tid: `step_retrying:${runId}:${correlationId}:${attempt}`,\n\t\t\t\trunId,\n\t\t\t\ttype: \"step_retrying\",\n\t\t\t\tcorrelationId,\n\t\t\t\tdata: serializeWorkflowError(error)\n\t\t\t});\n\t\t\tstate.failedCorrelationId = correlationId;\n\t\t\tthrow error;\n\t\t}\n\t}));\n}\n//#endregion\n//#region src/create-action-runner.ts\nfunction withCredentialScopeOverride(requirements, scope) {\n\tif (!requirements || !scope) return requirements;\n\treturn normalizeCredentialList(requirements).map((requirement) => ({\n\t\t...requirement,\n\t\tscope\n\t}));\n}\n/** Builds the per-run action runner; durability lives in {@link runDurableStep}. */\nfunction createActionRunner(state, options = {}) {\n\treturn (action, input, runOptions) => runDurableStep(state, {\n\t\tkind: \"action\",\n\t\tkey: action.slug,\n\t\tid: runOptions?.id,\n\t\tmetadataKey: \"actionKey\",\n\t\treplayMessage: \"action replayed from checkpoint\",\n\t\tparseCached: (cached) => action.output.parse(cached),\n\t\texecute: async (correlationId) => {\n\t\t\tconst requirements = withCredentialScopeOverride(getActionCredentialRequirements(action), runOptions?.credentialScope);\n\t\t\tconst credentials = requirements?.length ? await resolveActionCredentials(requirements, {\n\t\t\t\tresolveCredentials: options.resolveCredentials,\n\t\t\t\tcontext: options.credentialContext,\n\t\t\t\toauthAdapter: options.oauthAdapter,\n\t\t\t\tconsumer: {\n\t\t\t\t\tkind: \"action\",\n\t\t\t\t\tname: action.slug,\n\t\t\t\t\tid: correlationId\n\t\t\t\t}\n\t\t\t}) : {};\n\t\t\treturn runWithMcpCredentialContext({\n\t\t\t\t...options.mcpCredentialContext,\n\t\t\t\tconsumerId: correlationId\n\t\t\t}, () => executeAction(action, input, credentials));\n\t\t}\n\t});\n}\n//#endregion\n//#region src/create-agent-step-runner.ts\n/**\n* Builds the per-run agent runner: each `agent.prompt()` in a workflow body\n* becomes a durable step keyed `step:<agentKey>#<occurrence>` (same scheme as\n* actions). The actual prompt execution is delegated to `runAgent`, supplied\n* by the host (server) via `executeWorkflow({ runAgent })`.\n*/\nfunction createAgentStepRunner(state, runAgent) {\n\treturn (agent, input, options) => {\n\t\tconst slug = agent.slug;\n\t\treturn runDurableStep(state, {\n\t\t\tkind: \"agent_session\",\n\t\t\tkey: slug,\n\t\t\tid: options?.id,\n\t\t\tmetadataKey: \"agentKey\",\n\t\t\treplayMessage: \"agent step replayed from checkpoint\",\n\t\t\texecute: (_correlationId) => runAgent(agent, input, options?.runPrompt)\n\t\t});\n\t};\n}\n//#endregion\n//#region src/create-llm-step-runner.ts\n/**\n* Builds the per-run LLM runner: each `promptLlm()` in a workflow body becomes a\n* durable step keyed `step:promptLlm#<occurrence>`. The actual LLM call is\n* delegated to `runLlm`, supplied by the host (server) via `executeWorkflow({ runLlm })`.\n*/\nfunction createLlmStepRunner(state, runLlm) {\n\treturn (opts) => runDurableStep(state, {\n\t\tkind: \"llm\",\n\t\tkey: \"promptLlm\",\n\t\tid: opts.stepId,\n\t\tmetadataKey: \"llmKey\",\n\t\treplayMessage: \"llm step replayed from checkpoint\",\n\t\tparseCached: (cached) => opts.outputSchema ? opts.outputSchema.parse(cached) : cached,\n\t\texecute: (_correlationId) => runLlm(opts)\n\t});\n}\n//#endregion\n//#region src/run-context.ts\nconst storage = new AsyncLocalStorage();\nregisterWorkflowRunGetter(() => {\n\tconst store = storage.getStore();\n\tif (!store) return;\n\treturn {\n\t\tactionRunner: store.actionRunner,\n\t\tagentRunner: store.agentRunner,\n\t\tllmRunner: store.llmRunner\n\t};\n});\nfunction runWithWorkflowContext(store, fn) {\n\treturn storage.run(store, fn);\n}\n//#endregion\n//#region src/replay/memory-event-log.ts\n/** In-memory durable log for inline execution and tests. */\nvar MemoryEventLog = class {\n\tevents = [];\n\tids = /* @__PURE__ */ new Set();\n\tasync append(event) {\n\t\tconst id = event.id ?? crypto.randomUUID();\n\t\tif (this.ids.has(id)) return false;\n\t\tthis.ids.add(id);\n\t\tthis.events.push({\n\t\t\tid,\n\t\t\trunId: event.runId,\n\t\t\tseq: this.events.length,\n\t\t\ttype: event.type,\n\t\t\tcorrelationId: event.correlationId ?? null,\n\t\t\tdata: event.data ?? null\n\t\t});\n\t\treturn true;\n\t}\n\tasync listReplay(runId) {\n\t\treturn this.events.filter((event) => event.runId === runId).map((event) => ({ ...event }));\n\t}\n};\n//#endregion\n//#region src/execute-workflow.ts\n/**\n* The single way to run a workflow: replay its event log from the top, execute\n* un-cached primitives, and either complete/fail or suspend at the first\n* un-satisfied sleep/hook. New events (sleep_scheduled/sleep_completed/\n* hook_created/run_completed/run_failed) are flushed before returning.\n*\n* Durability comes entirely from the log — a suspended run resumes by calling\n* this again with the same `runId` and event log once the sleep is due or the\n* hook is resumed.\n*/\nasync function executeWorkflow(workflow, input, options = {}) {\n\tconst runId = options.runId ?? crypto.randomUUID();\n\tconst eventLog = options.eventLog ?? new MemoryEventLog();\n\tconst signal = getRunSignal();\n\tconst consumer = new EventsConsumer(await eventLog.listReplay(runId));\n\tconst coordinator = new SuspensionCoordinator();\n\tconst state = createReplayState({\n\t\trunId,\n\t\tconsumer,\n\t\tcoordinator,\n\t\teventLog,\n\t\thookBaseUrl: options.hookBaseUrl,\n\t\tnow: options.now\n\t});\n\tconst actionRunner = createActionRunner(state, {\n\t\tresolveCredentials: options.resolveCredentials,\n\t\tcredentialContext: options.credentialContext,\n\t\toauthAdapter: options.oauthAdapter,\n\t\tmcpCredentialContext: { assignmentTarget: {\n\t\t\ttype: \"workflow\",\n\t\t\tkey: workflow.slug\n\t\t} }\n\t});\n\tconst ctx = {\n\t\trunId,\n\t\tsleep: createSleep(state),\n\t\thook: createHook(state),\n\t\t...options.context\n\t};\n\tconst agentRunner = options.runAgent ? createAgentStepRunner(state, options.runAgent) : void 0;\n\tconst llmRunner = options.runLlm ? createLlmStepRunner(state, options.runLlm) : void 0;\n\tconst validatedInput = workflow.input.parse(input);\n\tconst bodyPromise = runWithWorkflowContext({\n\t\tactionRunner,\n\t\tagentRunner,\n\t\tllmRunner,\n\t\trunId\n\t}, () => captureConsole(async () => workflow.run(validatedInput, ctx)));\n\tlet onAbort;\n\tconst waitForAbort = signal.aborted ? Promise.resolve({ type: \"canceled\" }) : new Promise((resolve) => {\n\t\tonAbort = () => resolve({ type: \"canceled\" });\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\tconst outcome = await Promise.race([\n\t\tbodyPromise.then((output) => ({\n\t\t\ttype: \"done\",\n\t\t\toutput\n\t\t}), (error) => ({\n\t\t\ttype: \"error\",\n\t\t\terror\n\t\t})),\n\t\tcoordinator.waitForSuspension().then((items) => ({\n\t\t\ttype: \"suspended\",\n\t\t\titems\n\t\t})),\n\t\twaitForAbort\n\t]);\n\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\tlet result;\n\tif (outcome.type === \"suspended\") {\n\t\tbodyPromise.catch(() => {});\n\t\tresult = {\n\t\t\tstatus: \"suspended\",\n\t\t\titems: outcome.items\n\t\t};\n\t} else if (outcome.type === \"done\") {\n\t\tconst output = workflow.output.parse(outcome.output);\n\t\tstate.newEvents.push({\n\t\t\tid: `run_completed:${runId}`,\n\t\t\trunId,\n\t\t\ttype: \"run_completed\",\n\t\t\tdata: { output }\n\t\t});\n\t\tresult = {\n\t\t\tstatus: \"completed\",\n\t\t\toutput\n\t\t};\n\t} else if (outcome.type === \"canceled\" || isRunCanceledError(outcome.error)) {\n\t\tbodyPromise.catch(() => {});\n\t\tstate.newEvents.push({\n\t\t\tid: `run_canceled:${runId}`,\n\t\t\trunId,\n\t\t\ttype: \"run_canceled\"\n\t\t});\n\t\tresult = { status: \"canceled\" };\n\t} else result = {\n\t\tstatus: \"failed\",\n\t\terror: outcome.error,\n\t\tfailedCorrelationId: state.failedCorrelationId\n\t};\n\tfor (const event of state.newEvents) await eventLog.append(event);\n\treturn result;\n}\n//#endregion\n//#region src/prompt-llm.ts\nfunction promptLlm(prompt, opts) {\n\tconst handle = getWorkflowRunHandle();\n\tif (!handle?.llmRunner) throw new Error(\"promptLlm must run inside a workflow with an injected llm executor (executeWorkflow({ runLlm })).\");\n\treturn handle.llmRunner({\n\t\tprompt,\n\t\t...opts\n\t});\n}\n//#endregion\nexport { MemoryEventLog, RunCanceledError, defineWorkflow, deserializeWorkflowError, executeWorkflow, isRunCanceledError, isWorkflow, promptLlm, serializeWorkflowError };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;AAMA,IAAI,mBAAmB,cAAc,MAAM;CAC1C,YAAY,OAAO;EA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AAU,KAAK;GACpB,IAAI,iBAAiB;GACrB;GACA,MAAM;GACN,MAAM,EAAE,OAAO;EAChB,CAAC;EACD,SAAS;GACR,QAAQ;GACR;EACD;CACD,OAAO,IAAI,QAAQ,SAAS,cAAc,mBAAmB,QAAQ,KAAK,GAAG;EAC5E,YAAY,YAAY,CAAC,CAAC;EAC1B,MAAM,UAAU,KAAK;GACpB,IAAI,gBAAgB;GACpB;GACA,MAAM;EACP,CAAC;EACD,SAAS,EAAE,QAAQ,WAAW;CAC/B,OAAO,SAAS;EACf,QAAQ;EACR,OAAO,QAAQ;EACf,qBAAqB,MAAM;CAC5B;CACA,KAAK,MAAM,SAAS,MAAM,WAAW,MAAM,SAAS,OAAO,KAAK;CAChE,OAAO;AACR;AAGA,SAAS,UAAU,QAAQ,MAAM;CAChC,MAAM,SAASS,aAAAA,qBAAqB;CACpC,IAAI,CAAC,QAAQ,WAAW,MAAM,IAAI,MAAM,mGAAmG;CAC3I,OAAO,OAAO,UAAU;EACvB;EACA,GAAG;CACJ,CAAC;AACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { a as __toESM, i as __require, t as __commonJSMin } from "./chunk-D0VCBZRD.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { O as mcpEntityId, S as buildConnectDeeplink, k as normalizeCredentialList } from "./dist-D0HbZRpR.mjs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
3
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
5
|
import "node:fs";
|
|
5
6
|
import "node:path";
|
|
@@ -3126,6 +3127,7 @@ function getDatabaseHandle$1() {
|
|
|
3126
3127
|
function getDbFromContext$1() {
|
|
3127
3128
|
return getDatabaseHandle$1().db;
|
|
3128
3129
|
}
|
|
3130
|
+
createRequire(import.meta.url);
|
|
3129
3131
|
function buildPgSchema$1(registry) {
|
|
3130
3132
|
return Object.fromEntries(Object.entries(registry).map(([name, { pg }]) => [name, pg]));
|
|
3131
3133
|
}
|
|
@@ -3447,7 +3449,8 @@ const credentialInstances = pgTable("credential_instances", {
|
|
|
3447
3449
|
sharedConnectionId: text$1("shared_connection_id"),
|
|
3448
3450
|
grantedScopes: jsonb("granted_scopes").$type(),
|
|
3449
3451
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
3450
|
-
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
3452
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
3453
|
+
lastUsedAt: timestamp("last_used_at", { withTimezone: true })
|
|
3451
3454
|
}, (table) => [uniqueIndex$1("credential_instances_project_scope_slug_unique").on(table.projectId, table.scopeType, table.scopeId, table.slug), index$1("credential_instances_project_app_slug_scope_idx").on(table.projectId, table.appSlug, table.scopeType, table.scopeId)]);
|
|
3452
3455
|
const credentialInstancesSqlite = sqliteTable("credential_instances", {
|
|
3453
3456
|
id: text("id").primaryKey(),
|
|
@@ -3466,7 +3469,8 @@ const credentialInstancesSqlite = sqliteTable("credential_instances", {
|
|
|
3466
3469
|
sharedConnectionId: text("shared_connection_id"),
|
|
3467
3470
|
grantedScopes: text("granted_scopes", { mode: "json" }).$type(),
|
|
3468
3471
|
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
3469
|
-
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
3472
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull(),
|
|
3473
|
+
lastUsedAt: integer("last_used_at", { mode: "timestamp_ms" })
|
|
3470
3474
|
}, (table) => [uniqueIndex("credential_instances_project_scope_slug_unique").on(table.projectId, table.scopeType, table.scopeId, table.slug), index("credential_instances_project_app_slug_scope_idx").on(table.projectId, table.appSlug, table.scopeType, table.scopeId)]);
|
|
3471
3475
|
const credentialAssignments = pgTable("credential_assignments", {
|
|
3472
3476
|
id: text$1("id").primaryKey(),
|
|
@@ -3861,6 +3865,10 @@ async function selectCredentialInstancesForScope(appSlug, scopeType, scopeId) {
|
|
|
3861
3865
|
const scopeCondition = scopeId === null ? and(eq(credentialInstances.scopeType, scopeType), isNull(credentialInstances.scopeId)) : and(eq(credentialInstances.scopeType, scopeType), eq(credentialInstances.scopeId, scopeId));
|
|
3862
3866
|
return db.select().from(credentialInstances).where(credentialScopeAnd(scopeType, eq(credentialInstances.appSlug, appSlug), scopeCondition));
|
|
3863
3867
|
}
|
|
3868
|
+
/** Record that a credential was just resolved/used. Targeted by id; never throws on a missing row. */
|
|
3869
|
+
async function touchCredentialInstanceLastUsed(id) {
|
|
3870
|
+
await getDb$1().update(credentialInstances).set({ lastUsedAt: /* @__PURE__ */ new Date() }).where(eq(credentialInstances.id, id));
|
|
3871
|
+
}
|
|
3864
3872
|
async function listCredentialAssignmentsByTarget(options) {
|
|
3865
3873
|
return getDb$1().select().from(credentialAssignments).where(scopedAnd$1(credentialAssignments, eq(credentialAssignments.targetType, options.targetType), eq(credentialAssignments.targetKey, options.targetKey)));
|
|
3866
3874
|
}
|
|
@@ -17254,7 +17262,7 @@ async function connectMcpServer(name, options) {
|
|
|
17254
17262
|
}
|
|
17255
17263
|
async function createTransport(url, transport, requestInit, fetchImpl) {
|
|
17256
17264
|
if (transport === "sse") {
|
|
17257
|
-
const { SSEClientTransport } = await import("./sse-
|
|
17265
|
+
const { SSEClientTransport } = await import("./sse-DQi5Gnnd.mjs");
|
|
17258
17266
|
return new SSEClientTransport(url, {
|
|
17259
17267
|
requestInit,
|
|
17260
17268
|
fetch: fetchImpl
|
|
@@ -17457,8 +17465,7 @@ const authVerificationsSqlite = sqliteTable("verification", {
|
|
|
17457
17465
|
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
17458
17466
|
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
17459
17467
|
}, (table) => [index("verification_identifier_idx").on(table.identifier)]);
|
|
17460
|
-
|
|
17461
|
-
//#region ../platform-database/dist/index.mjs
|
|
17468
|
+
createRequire(import.meta.url);
|
|
17462
17469
|
function buildPgSchema(registry) {
|
|
17463
17470
|
return Object.fromEntries(Object.entries(registry).map(([name, { pg }]) => [name, pg]));
|
|
17464
17471
|
}
|
|
@@ -17589,6 +17596,7 @@ const apps = pgTable("apps", {
|
|
|
17589
17596
|
authKind: text$1("auth_kind").$type().notNull(),
|
|
17590
17597
|
oauthScopes: jsonb("oauth_scopes").$type().notNull(),
|
|
17591
17598
|
credentialFields: jsonb("credential_fields").$type().notNull().default({}),
|
|
17599
|
+
credentialScheme: text$1("credential_scheme").$type(),
|
|
17592
17600
|
source: text$1("source").$type().notNull(),
|
|
17593
17601
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
17594
17602
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
@@ -17604,6 +17612,7 @@ const appsSqlite = sqliteTable("apps", {
|
|
|
17604
17612
|
authKind: text("auth_kind").$type().notNull(),
|
|
17605
17613
|
oauthScopes: text("oauth_scopes", { mode: "json" }).$type().notNull(),
|
|
17606
17614
|
credentialFields: text("credential_fields", { mode: "json" }).$type().notNull().default({}),
|
|
17615
|
+
credentialScheme: text("credential_scheme").$type(),
|
|
17607
17616
|
source: text("source").$type().notNull(),
|
|
17608
17617
|
createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull(),
|
|
17609
17618
|
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull()
|
|
@@ -18050,7 +18059,7 @@ async function resolveOAuthAccessToken(connection, app, tokenRefresh) {
|
|
|
18050
18059
|
return refreshed.accessToken;
|
|
18051
18060
|
}
|
|
18052
18061
|
//#endregion
|
|
18053
|
-
//#region ../credentials/dist/store-
|
|
18062
|
+
//#region ../credentials/dist/store-Bib92S-M.mjs
|
|
18054
18063
|
function normalizeRow(row) {
|
|
18055
18064
|
const { projectId: _projectId, ...rest } = row;
|
|
18056
18065
|
return rest;
|
|
@@ -18069,6 +18078,9 @@ async function selectCredentialInstanceById$1(id) {
|
|
|
18069
18078
|
async function selectCredentialInstancesForScope$1(appSlug, scopeType, scopeId) {
|
|
18070
18079
|
return (await selectCredentialInstancesForScope(appSlug, scopeType, scopeId)).map(normalizeLocalRow);
|
|
18071
18080
|
}
|
|
18081
|
+
async function touchCredentialInstanceLastUsed$1(id) {
|
|
18082
|
+
await touchCredentialInstanceLastUsed(id);
|
|
18083
|
+
}
|
|
18072
18084
|
//#endregion
|
|
18073
18085
|
//#region ../secrets/dist/index.mjs
|
|
18074
18086
|
const ALGORITHM = "aes-256-gcm";
|
|
@@ -18501,7 +18513,25 @@ function pickInstance(rows, key, consumer) {
|
|
|
18501
18513
|
consumer
|
|
18502
18514
|
});
|
|
18503
18515
|
}
|
|
18516
|
+
/** Throttle window for last-used writes so bursty runs don't hammer the same row. */
|
|
18517
|
+
const LAST_USED_THROTTLE_MS = 6e4;
|
|
18518
|
+
/**
|
|
18519
|
+
* Record that a credential was just resolved. Throttled (skip when touched within
|
|
18520
|
+
* {@link LAST_USED_THROTTLE_MS}) and best-effort: a write failure must never break resolution.
|
|
18521
|
+
*/
|
|
18522
|
+
async function touchLastUsed(row) {
|
|
18523
|
+
const last = row.lastUsedAt?.getTime();
|
|
18524
|
+
if (last !== void 0 && Date.now() - last < LAST_USED_THROTTLE_MS) return;
|
|
18525
|
+
try {
|
|
18526
|
+
await touchCredentialInstanceLastUsed$1(row.id);
|
|
18527
|
+
} catch {}
|
|
18528
|
+
}
|
|
18504
18529
|
async function resolveInstanceValue(row, requirement, backend) {
|
|
18530
|
+
const value = await materializeInstanceValue(row, requirement, backend);
|
|
18531
|
+
await touchLastUsed(row);
|
|
18532
|
+
return value;
|
|
18533
|
+
}
|
|
18534
|
+
async function materializeInstanceValue(row, requirement, backend) {
|
|
18505
18535
|
if (row.authKind === "keystroke") {
|
|
18506
18536
|
if (!row.connectionId) throw new MissingCredentialsError({
|
|
18507
18537
|
key: row.appSlug,
|
|
@@ -18786,4 +18816,4 @@ async function resolveActionCredentials(requirements, options) {
|
|
|
18786
18816
|
//#endregion
|
|
18787
18817
|
export { recordLlmUsageFromAssistantMessage as A, appendEvent as C, getProjectScopeId as D, getAgentByRoute as E, captureConsole as F, getTraceContext as I, logSystem as L, setSessionLiveMessage as M, setSessionTitle as N, getSession as O, touchSession as P, withSpan as R, addAgentSessionDuration as S, createSession as T, createFetchWithInit as _, resolveActionCredentials as a, JSONRPCMessageSchema as b, connectMcpDefinition as c, defineMcp as d, isMcp as f, extractWWWAuthenticateParams as g, auth as h, isCredentialError as i, resolveRunSourceFromTraceContext as j, listMessageEvents as k, connectMcpServer as l, UnauthorizedError as m, captureCredentialToolErrors as n, resolveMcpTools as o, createParser as p, createCredentialResolver as r, withCredentialAssignments as s, buildCredentialRunContext as t, connectMcpStdio as u, normalizeHeaders as v, clearLiveMessage as w, MESSAGE_EVENT_TYPE as x, zodToJsonSchema as y };
|
|
18788
18818
|
|
|
18789
|
-
//# sourceMappingURL=dist-
|
|
18819
|
+
//# sourceMappingURL=dist-Bqsbf3hX.mjs.map
|