@keystrokehq/platform 0.1.3 → 0.1.5
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/{awk2-LA3USKJP-BE8esz9o.cjs → awk2-LA3USKJP-AIZOQ0nh.cjs} +2 -2
- package/dist/{awk2-LA3USKJP-BE8esz9o.cjs.map → awk2-LA3USKJP-AIZOQ0nh.cjs.map} +1 -1
- package/dist/{awk2-LA3USKJP-CU79F18c.mjs → awk2-LA3USKJP-CPcab6tL.mjs} +2 -2
- package/dist/{awk2-LA3USKJP-CU79F18c.mjs.map → awk2-LA3USKJP-CPcab6tL.mjs.map} +1 -1
- package/dist/{base64-C2AIWVNC-ESsdavRZ.mjs → base64-C2AIWVNC-BU7vFrSz.mjs} +2 -2
- package/dist/{base64-C2AIWVNC-ESsdavRZ.mjs.map → base64-C2AIWVNC-BU7vFrSz.mjs.map} +1 -1
- package/dist/{base64-C2AIWVNC-CGFeI4Fm.cjs → base64-C2AIWVNC-fWp5IaIt.cjs} +2 -2
- package/dist/{base64-C2AIWVNC-CGFeI4Fm.cjs.map → base64-C2AIWVNC-fWp5IaIt.cjs.map} +1 -1
- package/dist/{bash-YZ33HQZQ-Tqw_IzZM.mjs → bash-YZ33HQZQ-B7vkAJM1.mjs} +2 -2
- package/dist/{bash-YZ33HQZQ-Tqw_IzZM.mjs.map → bash-YZ33HQZQ-B7vkAJM1.mjs.map} +1 -1
- package/dist/{bash-YZ33HQZQ-Z8YFnXLG.cjs → bash-YZ33HQZQ-BfFH_xKv.cjs} +2 -2
- package/dist/{bash-YZ33HQZQ-Z8YFnXLG.cjs.map → bash-YZ33HQZQ-BfFH_xKv.cjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-B-Qi4MIN.mjs → cat-TSFMZVYS-BoRCwL0X.mjs} +3 -3
- package/dist/{cat-TSFMZVYS-B-Qi4MIN.mjs.map → cat-TSFMZVYS-BoRCwL0X.mjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-3tq36V6U.cjs → cat-TSFMZVYS-Lk2fLg0m.cjs} +3 -3
- package/dist/{cat-TSFMZVYS-3tq36V6U.cjs.map → cat-TSFMZVYS-Lk2fLg0m.cjs.map} +1 -1
- package/dist/{chunk-5H5SCKJM-DG2zdmBl.cjs → chunk-5H5SCKJM-Bf_pfjgz.cjs} +2 -2
- package/dist/{chunk-5H5SCKJM-DG2zdmBl.cjs.map → chunk-5H5SCKJM-Bf_pfjgz.cjs.map} +1 -1
- package/dist/{chunk-5H5SCKJM-jzOek3RA.mjs → chunk-5H5SCKJM-CCkl-6iR.mjs} +2 -2
- package/dist/{chunk-5H5SCKJM-jzOek3RA.mjs.map → chunk-5H5SCKJM-CCkl-6iR.mjs.map} +1 -1
- package/dist/{chunk-AQ6FYS2X-CWRY3oXA.cjs → chunk-AQ6FYS2X-C_kf5YCJ.cjs} +2 -2
- package/dist/{chunk-AQ6FYS2X-CWRY3oXA.cjs.map → chunk-AQ6FYS2X-C_kf5YCJ.cjs.map} +1 -1
- package/dist/{chunk-AQ6FYS2X-Bz4Sl0he.mjs → chunk-AQ6FYS2X-CaSbvwYS.mjs} +2 -2
- package/dist/{chunk-AQ6FYS2X-Bz4Sl0he.mjs.map → chunk-AQ6FYS2X-CaSbvwYS.mjs.map} +1 -1
- package/dist/{chunk-CHFEPBH4-Cg_Ca4ca.mjs → chunk-CHFEPBH4-Bk9Prhxt.mjs} +2 -2
- package/dist/{chunk-CHFEPBH4-Cg_Ca4ca.mjs.map → chunk-CHFEPBH4-Bk9Prhxt.mjs.map} +1 -1
- package/dist/{chunk-CHFEPBH4-BjRBtKoa.cjs → chunk-CHFEPBH4-Cdk9vq_c.cjs} +2 -2
- package/dist/{chunk-CHFEPBH4-BjRBtKoa.cjs.map → chunk-CHFEPBH4-Cdk9vq_c.cjs.map} +1 -1
- package/dist/{chunk-EBAPSGAO-TuSvdjDg.cjs → chunk-EBAPSGAO-9HAVo6nm.cjs} +2 -2
- package/dist/{chunk-EBAPSGAO-TuSvdjDg.cjs.map → chunk-EBAPSGAO-9HAVo6nm.cjs.map} +1 -1
- package/dist/{chunk-EBAPSGAO-BAjudTzg.mjs → chunk-EBAPSGAO-BPVz-6BX.mjs} +2 -2
- package/dist/{chunk-EBAPSGAO-BAjudTzg.mjs.map → chunk-EBAPSGAO-BPVz-6BX.mjs.map} +1 -1
- package/dist/{chunk-LEKBROJD-VngQ-bGK.cjs → chunk-LEKBROJD-4MTnJXG3.cjs} +2 -2
- package/dist/{chunk-LEKBROJD-VngQ-bGK.cjs.map → chunk-LEKBROJD-4MTnJXG3.cjs.map} +1 -1
- package/dist/{chunk-LEKBROJD-B7WoDbJJ.mjs → chunk-LEKBROJD-Bk_pJfFK.mjs} +2 -2
- package/dist/{chunk-LEKBROJD-B7WoDbJJ.mjs.map → chunk-LEKBROJD-Bk_pJfFK.mjs.map} +1 -1
- package/dist/{chunk-VPADYNBD-B7JoVwJq.mjs → chunk-VPADYNBD-Bc5abqkF.mjs} +2 -2
- package/dist/{chunk-VPADYNBD-B7JoVwJq.mjs.map → chunk-VPADYNBD-Bc5abqkF.mjs.map} +1 -1
- package/dist/{chunk-VPADYNBD-Ju6wgxLY.cjs → chunk-VPADYNBD-CS9VA1aJ.cjs} +2 -2
- package/dist/{chunk-VPADYNBD-Ju6wgxLY.cjs.map → chunk-VPADYNBD-CS9VA1aJ.cjs.map} +1 -1
- package/dist/{chunk-YCLFEX4T-BoIwWBSQ.mjs → chunk-YCLFEX4T-Cz2QbPh0.mjs} +2 -2
- package/dist/{chunk-YCLFEX4T-BoIwWBSQ.mjs.map → chunk-YCLFEX4T-Cz2QbPh0.mjs.map} +1 -1
- package/dist/{chunk-YCLFEX4T-81Ii8Wlf.cjs → chunk-YCLFEX4T-D65vwGHr.cjs} +2 -2
- package/dist/{chunk-YCLFEX4T-81Ii8Wlf.cjs.map → chunk-YCLFEX4T-D65vwGHr.cjs.map} +1 -1
- package/dist/{column-XT6UFXNQ-B8RfIkpb.mjs → column-XT6UFXNQ-BsXqWbAP.mjs} +2 -2
- package/dist/{column-XT6UFXNQ-B8RfIkpb.mjs.map → column-XT6UFXNQ-BsXqWbAP.mjs.map} +1 -1
- package/dist/{column-XT6UFXNQ-ieIKmRkh.cjs → column-XT6UFXNQ-CwtLFuCh.cjs} +2 -2
- package/dist/{column-XT6UFXNQ-ieIKmRkh.cjs.map → column-XT6UFXNQ-CwtLFuCh.cjs.map} +1 -1
- package/dist/{comm-VV2LDX2J-DEKxgGlr.mjs → comm-VV2LDX2J-BZdS-Fqy.mjs} +2 -2
- package/dist/{comm-VV2LDX2J-DEKxgGlr.mjs.map → comm-VV2LDX2J-BZdS-Fqy.mjs.map} +1 -1
- package/dist/{comm-VV2LDX2J-CdE-OYeG.cjs → comm-VV2LDX2J-YL8m_4d1.cjs} +2 -2
- package/dist/{comm-VV2LDX2J-CdE-OYeG.cjs.map → comm-VV2LDX2J-YL8m_4d1.cjs.map} +1 -1
- package/dist/{config-CXBff_fs.d.mts → config-DF8H5mS5.d.mts} +17 -13
- package/dist/{config-C78TqlE1.d.cts → config-DqyMT-Xg.d.cts} +17 -13
- package/dist/config.cjs +1 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/config.mjs.map +1 -1
- package/dist/{cp-BISAAS7A-CMVh32j_.mjs → cp-BISAAS7A-C0MVoZpt.mjs} +2 -2
- package/dist/{cp-BISAAS7A-CMVh32j_.mjs.map → cp-BISAAS7A-C0MVoZpt.mjs.map} +1 -1
- package/dist/{cp-BISAAS7A-C1ygPb-h.cjs → cp-BISAAS7A-Dx6QG-P9.cjs} +2 -2
- package/dist/{cp-BISAAS7A-C1ygPb-h.cjs.map → cp-BISAAS7A-Dx6QG-P9.cjs.map} +1 -1
- package/dist/{cut-OKARJCCV-CluNzLiu.mjs → cut-OKARJCCV-BKWEQwCZ.mjs} +3 -3
- package/dist/{cut-OKARJCCV-CluNzLiu.mjs.map → cut-OKARJCCV-BKWEQwCZ.mjs.map} +1 -1
- package/dist/{cut-OKARJCCV-S-g4hG3d.cjs → cut-OKARJCCV-C1CAocst.cjs} +3 -3
- package/dist/{cut-OKARJCCV-S-g4hG3d.cjs.map → cut-OKARJCCV-C1CAocst.cjs.map} +1 -1
- package/dist/{diff-MWJFIG7X-Xtqp7FtF.cjs → diff-MWJFIG7X-D5nTdPdk.cjs} +2 -2
- package/dist/{diff-MWJFIG7X-Xtqp7FtF.cjs.map → diff-MWJFIG7X-D5nTdPdk.cjs.map} +1 -1
- package/dist/{diff-MWJFIG7X-CuSut3C1.mjs → diff-MWJFIG7X-YTniIfbL.mjs} +2 -2
- package/dist/{diff-MWJFIG7X-CuSut3C1.mjs.map → diff-MWJFIG7X-YTniIfbL.mjs.map} +1 -1
- package/dist/{dist-D1Iv7_7S.cjs → dist-C3ioU2dM.cjs} +559 -329
- package/dist/{dist-D1Iv7_7S.cjs.map → dist-C3ioU2dM.cjs.map} +1 -1
- package/dist/{dist-70NUfApd.mjs → dist-CQMZgfp_.mjs} +518 -330
- package/dist/dist-CQMZgfp_.mjs.map +1 -0
- package/dist/{du-572XNP42-f68GOB47.cjs → du-572XNP42-B2vhVgxe.cjs} +2 -2
- package/dist/{du-572XNP42-f68GOB47.cjs.map → du-572XNP42-B2vhVgxe.cjs.map} +1 -1
- package/dist/{du-572XNP42-BTLDH4CK.mjs → du-572XNP42-CmxmrMJd.mjs} +2 -2
- package/dist/{du-572XNP42-BTLDH4CK.mjs.map → du-572XNP42-CmxmrMJd.mjs.map} +1 -1
- package/dist/{env-36M5BO7M-DHcnOUrA.cjs → env-36M5BO7M-Dj2YwzST.cjs} +2 -2
- package/dist/{env-36M5BO7M-DHcnOUrA.cjs.map → env-36M5BO7M-Dj2YwzST.cjs.map} +1 -1
- package/dist/{env-36M5BO7M-CjuGiDaW.mjs → env-36M5BO7M-DupdD4fz.mjs} +2 -2
- package/dist/{env-36M5BO7M-CjuGiDaW.mjs.map → env-36M5BO7M-DupdD4fz.mjs.map} +1 -1
- package/dist/{expand-JSPG6VOP-Cmm7S480.mjs → expand-JSPG6VOP-BtD3fO-u.mjs} +2 -2
- package/dist/{expand-JSPG6VOP-Cmm7S480.mjs.map → expand-JSPG6VOP-BtD3fO-u.mjs.map} +1 -1
- package/dist/{expand-JSPG6VOP-BAEvLz6y.cjs → expand-JSPG6VOP-C4VQzWfg.cjs} +2 -2
- package/dist/{expand-JSPG6VOP-BAEvLz6y.cjs.map → expand-JSPG6VOP-C4VQzWfg.cjs.map} +1 -1
- package/dist/{expr-5JAACS4X-C3PXSs0i.mjs → expr-5JAACS4X-C75E9ncn.mjs} +2 -2
- package/dist/{expr-5JAACS4X-C3PXSs0i.mjs.map → expr-5JAACS4X-C75E9ncn.mjs.map} +1 -1
- package/dist/{expr-5JAACS4X-BFLtaqNy.cjs → expr-5JAACS4X-DX-k1Bjo.cjs} +2 -2
- package/dist/{expr-5JAACS4X-BFLtaqNy.cjs.map → expr-5JAACS4X-DX-k1Bjo.cjs.map} +1 -1
- package/dist/{find-INTH3OLC-Bf3-4Zi2.cjs → find-INTH3OLC-2rIv2Sgt.cjs} +3 -3
- package/dist/{find-INTH3OLC-Bf3-4Zi2.cjs.map → find-INTH3OLC-2rIv2Sgt.cjs.map} +1 -1
- package/dist/{find-INTH3OLC-D6wBmhsd.mjs → find-INTH3OLC-B2oqqlwt.mjs} +3 -3
- package/dist/{find-INTH3OLC-D6wBmhsd.mjs.map → find-INTH3OLC-B2oqqlwt.mjs.map} +1 -1
- package/dist/{fold-4TQNYMSW-BIl_iV0S.cjs → fold-4TQNYMSW-DFQEjMsZ.cjs} +2 -2
- package/dist/{fold-4TQNYMSW-BIl_iV0S.cjs.map → fold-4TQNYMSW-DFQEjMsZ.cjs.map} +1 -1
- package/dist/{fold-4TQNYMSW-BVCyD8C0.mjs → fold-4TQNYMSW-DzA5SsAN.mjs} +2 -2
- package/dist/{fold-4TQNYMSW-BVCyD8C0.mjs.map → fold-4TQNYMSW-DzA5SsAN.mjs.map} +1 -1
- package/dist/{grep-V3LQVMRQ-BLwElJ9a.mjs → grep-V3LQVMRQ-CUJiTsKp.mjs} +4 -4
- package/dist/{grep-V3LQVMRQ-BLwElJ9a.mjs.map → grep-V3LQVMRQ-CUJiTsKp.mjs.map} +1 -1
- package/dist/{grep-V3LQVMRQ-BcfmH0yO.cjs → grep-V3LQVMRQ-D--OXkar.cjs} +4 -4
- package/dist/{grep-V3LQVMRQ-BcfmH0yO.cjs.map → grep-V3LQVMRQ-D--OXkar.cjs.map} +1 -1
- package/dist/{gzip-O5ASJAFY-B9ermjPq.cjs → gzip-O5ASJAFY-B3o0_eql.cjs} +2 -2
- package/dist/{gzip-O5ASJAFY-B9ermjPq.cjs.map → gzip-O5ASJAFY-B3o0_eql.cjs.map} +1 -1
- package/dist/{gzip-O5ASJAFY-BjVFU42g.mjs → gzip-O5ASJAFY-D8i6m9_W.mjs} +2 -2
- package/dist/{gzip-O5ASJAFY-BjVFU42g.mjs.map → gzip-O5ASJAFY-D8i6m9_W.mjs.map} +1 -1
- package/dist/{head-442HYESI-BGRcjEMI.mjs → head-442HYESI-BDYHKho-.mjs} +2 -2
- package/dist/{head-442HYESI-BGRcjEMI.mjs.map → head-442HYESI-BDYHKho-.mjs.map} +1 -1
- package/dist/{head-442HYESI-_RXn0SBi.cjs → head-442HYESI-Bztg6Xka.cjs} +2 -2
- package/dist/{head-442HYESI-_RXn0SBi.cjs.map → head-442HYESI-Bztg6Xka.cjs.map} +1 -1
- package/dist/{help-HZ6M2CKN-BCHt7Yu_.mjs → help-HZ6M2CKN-C95bcvt_.mjs} +2 -2
- package/dist/{help-HZ6M2CKN-BCHt7Yu_.mjs.map → help-HZ6M2CKN-C95bcvt_.mjs.map} +1 -1
- package/dist/{help-HZ6M2CKN-DJP0l3xk.cjs → help-HZ6M2CKN-CFA5POOW.cjs} +2 -2
- package/dist/{help-HZ6M2CKN-DJP0l3xk.cjs.map → help-HZ6M2CKN-CFA5POOW.cjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-Dq7eYKW0.mjs → html-to-markdown-JW4MSQZO-8YYzjAx0.mjs} +2 -2
- package/dist/{html-to-markdown-JW4MSQZO-Dq7eYKW0.mjs.map → html-to-markdown-JW4MSQZO-8YYzjAx0.mjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-yoaOs45E.cjs → html-to-markdown-JW4MSQZO-B3xkcb1w.cjs} +2 -2
- package/dist/{html-to-markdown-JW4MSQZO-yoaOs45E.cjs.map → html-to-markdown-JW4MSQZO-B3xkcb1w.cjs.map} +1 -1
- package/dist/{join-TBRGI3LQ-BU7FYSK3.mjs → join-TBRGI3LQ-Cb96ZaTF.mjs} +2 -2
- package/dist/{join-TBRGI3LQ-BU7FYSK3.mjs.map → join-TBRGI3LQ-Cb96ZaTF.mjs.map} +1 -1
- package/dist/{join-TBRGI3LQ-BOS3zpbh.cjs → join-TBRGI3LQ-CzBO0uid.cjs} +2 -2
- package/dist/{join-TBRGI3LQ-BOS3zpbh.cjs.map → join-TBRGI3LQ-CzBO0uid.cjs.map} +1 -1
- package/dist/{jq-4XLYLOS5-C-4KbpIO.cjs → jq-4XLYLOS5-Dmw7PtvC.cjs} +4 -4
- package/dist/{jq-4XLYLOS5-C-4KbpIO.cjs.map → jq-4XLYLOS5-Dmw7PtvC.cjs.map} +1 -1
- package/dist/{jq-4XLYLOS5-tfCBGz19.mjs → jq-4XLYLOS5-QEF-9JGc.mjs} +4 -4
- package/dist/{jq-4XLYLOS5-tfCBGz19.mjs.map → jq-4XLYLOS5-QEF-9JGc.mjs.map} +1 -1
- package/dist/{js-exec-N5KEZBH7--5grqRpb.cjs → js-exec-N5KEZBH7-BLGWy2LA.cjs} +4 -4
- package/dist/{js-exec-N5KEZBH7--5grqRpb.cjs.map → js-exec-N5KEZBH7-BLGWy2LA.cjs.map} +1 -1
- package/dist/{js-exec-N5KEZBH7-C5C01q6k.mjs → js-exec-N5KEZBH7-DWi8fMhN.mjs} +4 -4
- package/dist/{js-exec-N5KEZBH7-C5C01q6k.mjs.map → js-exec-N5KEZBH7-DWi8fMhN.mjs.map} +1 -1
- package/dist/{lib-CNke9ACR.mjs → lib-C8lgRYXp.mjs} +2 -2
- package/dist/{lib-CNke9ACR.mjs.map → lib-C8lgRYXp.mjs.map} +1 -1
- package/dist/{lib-CW0fuh-i.cjs → lib-ux1xJJmr.cjs} +2 -2
- package/dist/{lib-CW0fuh-i.cjs.map → lib-ux1xJJmr.cjs.map} +1 -1
- package/dist/{ln-4LGSXXGD-Cy8gNPMC.mjs → ln-4LGSXXGD-BtA5nI4o.mjs} +2 -2
- package/dist/{ln-4LGSXXGD-Cy8gNPMC.mjs.map → ln-4LGSXXGD-BtA5nI4o.mjs.map} +1 -1
- package/dist/{ln-4LGSXXGD-B0nikKzZ.cjs → ln-4LGSXXGD-CkQRVPru.cjs} +2 -2
- package/dist/{ln-4LGSXXGD-B0nikKzZ.cjs.map → ln-4LGSXXGD-CkQRVPru.cjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-DMYpsOhX.mjs → ls-ZJGQER7M-Bm9zc4KC.mjs} +2 -2
- package/dist/{ls-ZJGQER7M-DMYpsOhX.mjs.map → ls-ZJGQER7M-Bm9zc4KC.mjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-CaSRbmLC.cjs → ls-ZJGQER7M-H5DDO7bw.cjs} +2 -2
- package/dist/{ls-ZJGQER7M-CaSRbmLC.cjs.map → ls-ZJGQER7M-H5DDO7bw.cjs.map} +1 -1
- package/dist/{lzma-L8nnN88o.cjs → lzma-CjqgTQ5J.cjs} +2 -2
- package/dist/{lzma-L8nnN88o.cjs.map → lzma-CjqgTQ5J.cjs.map} +1 -1
- package/dist/{md5sum-SPU24VSG-wjaqw6M5.cjs → md5sum-SPU24VSG-B6JGibcS.cjs} +3 -3
- package/dist/{md5sum-SPU24VSG-wjaqw6M5.cjs.map → md5sum-SPU24VSG-B6JGibcS.cjs.map} +1 -1
- package/dist/{md5sum-SPU24VSG-DDehVi3L.mjs → md5sum-SPU24VSG-Dqy3agsE.mjs} +3 -3
- package/dist/{md5sum-SPU24VSG-DDehVi3L.mjs.map → md5sum-SPU24VSG-Dqy3agsE.mjs.map} +1 -1
- package/dist/{mkdir-MEPGZOB6-D6EapQqG.cjs → mkdir-MEPGZOB6-BFwkd4Z7.cjs} +2 -2
- package/dist/{mkdir-MEPGZOB6-D6EapQqG.cjs.map → mkdir-MEPGZOB6-BFwkd4Z7.cjs.map} +1 -1
- package/dist/{mkdir-MEPGZOB6-BoeUbSt6.mjs → mkdir-MEPGZOB6-CMrYu1Ht.mjs} +2 -2
- package/dist/{mkdir-MEPGZOB6-BoeUbSt6.mjs.map → mkdir-MEPGZOB6-CMrYu1Ht.mjs.map} +1 -1
- package/dist/{mv-W5BIQ646-ee9iH5gF.mjs → mv-W5BIQ646-CWgyAnYE.mjs} +2 -2
- package/dist/{mv-W5BIQ646-ee9iH5gF.mjs.map → mv-W5BIQ646-CWgyAnYE.mjs.map} +1 -1
- package/dist/{mv-W5BIQ646-Cl3grRdX.cjs → mv-W5BIQ646-hheW03eh.cjs} +2 -2
- package/dist/{mv-W5BIQ646-Cl3grRdX.cjs.map → mv-W5BIQ646-hheW03eh.cjs.map} +1 -1
- package/dist/{nl-WSDW7I4O-DttNn_cO.cjs → nl-WSDW7I4O-DcVnQp-1.cjs} +2 -2
- package/dist/{nl-WSDW7I4O-DttNn_cO.cjs.map → nl-WSDW7I4O-DcVnQp-1.cjs.map} +1 -1
- package/dist/{nl-WSDW7I4O-DveMZ08l.mjs → nl-WSDW7I4O-hZyrJS6m.mjs} +2 -2
- package/dist/{nl-WSDW7I4O-DveMZ08l.mjs.map → nl-WSDW7I4O-hZyrJS6m.mjs.map} +1 -1
- package/dist/{od-WOKFDJTP-DCy3_AZ5.mjs → od-WOKFDJTP-60QMVWxL.mjs} +2 -2
- package/dist/{od-WOKFDJTP-DCy3_AZ5.mjs.map → od-WOKFDJTP-60QMVWxL.mjs.map} +1 -1
- package/dist/{od-WOKFDJTP-BJWjPFho.cjs → od-WOKFDJTP-CIGKYa74.cjs} +2 -2
- package/dist/{od-WOKFDJTP-BJWjPFho.cjs.map → od-WOKFDJTP-CIGKYa74.cjs.map} +1 -1
- package/dist/{paste-7JC6S4DX-DEoyg9Vv.cjs → paste-7JC6S4DX-CC0xWPbo.cjs} +2 -2
- package/dist/{paste-7JC6S4DX-DEoyg9Vv.cjs.map → paste-7JC6S4DX-CC0xWPbo.cjs.map} +1 -1
- package/dist/{paste-7JC6S4DX-DL9UawIf.mjs → paste-7JC6S4DX-QB7MigtV.mjs} +2 -2
- package/dist/{paste-7JC6S4DX-DL9UawIf.mjs.map → paste-7JC6S4DX-QB7MigtV.mjs.map} +1 -1
- package/dist/{printf-TWGXF445-BlwG6dD2.mjs → printf-TWGXF445-BuI_jQx5.mjs} +2 -2
- package/dist/{printf-TWGXF445-BlwG6dD2.mjs.map → printf-TWGXF445-BuI_jQx5.mjs.map} +1 -1
- package/dist/{printf-TWGXF445-B1fsJl2X.cjs → printf-TWGXF445-bSICkDD6.cjs} +2 -2
- package/dist/{printf-TWGXF445-B1fsJl2X.cjs.map → printf-TWGXF445-bSICkDD6.cjs.map} +1 -1
- package/dist/{python3-POMOR4OA-qY8EzVSe.mjs → python3-POMOR4OA-CQv_ljO3.mjs} +3 -3
- package/dist/{python3-POMOR4OA-qY8EzVSe.mjs.map → python3-POMOR4OA-CQv_ljO3.mjs.map} +1 -1
- package/dist/{python3-POMOR4OA-B8aVGk7h.cjs → python3-POMOR4OA-D8YyzdQy.cjs} +3 -3
- package/dist/{python3-POMOR4OA-B8aVGk7h.cjs.map → python3-POMOR4OA-D8YyzdQy.cjs.map} +1 -1
- package/dist/{rev-5EHFX4EJ-Dxay6iFE.mjs → rev-5EHFX4EJ-BCHr71Dm.mjs} +2 -2
- package/dist/{rev-5EHFX4EJ-Dxay6iFE.mjs.map → rev-5EHFX4EJ-BCHr71Dm.mjs.map} +1 -1
- package/dist/{rev-5EHFX4EJ-B27blDxm.cjs → rev-5EHFX4EJ-BS2n_x9V.cjs} +2 -2
- package/dist/{rev-5EHFX4EJ-B27blDxm.cjs.map → rev-5EHFX4EJ-BS2n_x9V.cjs.map} +1 -1
- package/dist/{rg-S4FXYXWB-BL_fs0a0.cjs → rg-S4FXYXWB-Bol68AvR.cjs} +3 -3
- package/dist/{rg-S4FXYXWB-BL_fs0a0.cjs.map → rg-S4FXYXWB-Bol68AvR.cjs.map} +1 -1
- package/dist/{rg-S4FXYXWB-b3jjC2M6.mjs → rg-S4FXYXWB-C8PEpvTX.mjs} +3 -3
- package/dist/{rg-S4FXYXWB-b3jjC2M6.mjs.map → rg-S4FXYXWB-C8PEpvTX.mjs.map} +1 -1
- package/dist/{rm-SSGETQVQ-CskLcJOp.cjs → rm-SSGETQVQ-BPv10nPA.cjs} +2 -2
- package/dist/{rm-SSGETQVQ-CskLcJOp.cjs.map → rm-SSGETQVQ-BPv10nPA.cjs.map} +1 -1
- package/dist/{rm-SSGETQVQ-D0Grjo65.mjs → rm-SSGETQVQ-C1OgRoSu.mjs} +2 -2
- package/dist/{rm-SSGETQVQ-D0Grjo65.mjs.map → rm-SSGETQVQ-C1OgRoSu.mjs.map} +1 -1
- package/dist/{rmdir-OC4ZLPYA-BZ86Q3Wr.mjs → rmdir-OC4ZLPYA-BFuqEQ5J.mjs} +2 -2
- package/dist/{rmdir-OC4ZLPYA-BZ86Q3Wr.mjs.map → rmdir-OC4ZLPYA-BFuqEQ5J.mjs.map} +1 -1
- package/dist/{rmdir-OC4ZLPYA-Br6jTWJO.cjs → rmdir-OC4ZLPYA-DngaXCWg.cjs} +2 -2
- package/dist/{rmdir-OC4ZLPYA-Br6jTWJO.cjs.map → rmdir-OC4ZLPYA-DngaXCWg.cjs.map} +1 -1
- package/dist/run.cjs +1 -1
- package/dist/run.mjs +1 -1
- package/dist/{sed-S5UIK574-C0ikpRUI.mjs → sed-S5UIK574-C8OThvO-.mjs} +2 -2
- package/dist/{sed-S5UIK574-C0ikpRUI.mjs.map → sed-S5UIK574-C8OThvO-.mjs.map} +1 -1
- package/dist/{sed-S5UIK574-OUlTmK0x.cjs → sed-S5UIK574-CF78rdnK.cjs} +2 -2
- package/dist/{sed-S5UIK574-OUlTmK0x.cjs.map → sed-S5UIK574-CF78rdnK.cjs.map} +1 -1
- package/dist/{sha1sum-2PTOAFR6-hLKNluNQ.mjs → sha1sum-2PTOAFR6-BgSg3k-0.mjs} +3 -3
- package/dist/{sha1sum-2PTOAFR6-hLKNluNQ.mjs.map → sha1sum-2PTOAFR6-BgSg3k-0.mjs.map} +1 -1
- package/dist/{sha1sum-2PTOAFR6-B_DU8HD8.cjs → sha1sum-2PTOAFR6-C48qu6hM.cjs} +3 -3
- package/dist/{sha1sum-2PTOAFR6-B_DU8HD8.cjs.map → sha1sum-2PTOAFR6-C48qu6hM.cjs.map} +1 -1
- package/dist/{sha256sum-NS7D3IXX-c6RHEh31.mjs → sha256sum-NS7D3IXX-BML40mGR.mjs} +3 -3
- package/dist/{sha256sum-NS7D3IXX-c6RHEh31.mjs.map → sha256sum-NS7D3IXX-BML40mGR.mjs.map} +1 -1
- package/dist/{sha256sum-NS7D3IXX-YzzSU71d.cjs → sha256sum-NS7D3IXX-DTZ34xii.cjs} +3 -3
- package/dist/{sha256sum-NS7D3IXX-YzzSU71d.cjs.map → sha256sum-NS7D3IXX-DTZ34xii.cjs.map} +1 -1
- package/dist/{sleep-X22JJINO-lQ5Wi1rP.mjs → sleep-X22JJINO-BzDRKdtv.mjs} +2 -2
- package/dist/{sleep-X22JJINO-lQ5Wi1rP.mjs.map → sleep-X22JJINO-BzDRKdtv.mjs.map} +1 -1
- package/dist/{sleep-X22JJINO-DFWLmtic.cjs → sleep-X22JJINO-Dy9v8Z4n.cjs} +2 -2
- package/dist/{sleep-X22JJINO-DFWLmtic.cjs.map → sleep-X22JJINO-Dy9v8Z4n.cjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-Njc26SUn.mjs → sort-SW2YEO5B-ClyGJwMQ.mjs} +3 -3
- package/dist/{sort-SW2YEO5B-Njc26SUn.mjs.map → sort-SW2YEO5B-ClyGJwMQ.mjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-BlJCEbS7.cjs → sort-SW2YEO5B-DwbO0wml.cjs} +3 -3
- package/dist/{sort-SW2YEO5B-BlJCEbS7.cjs.map → sort-SW2YEO5B-DwbO0wml.cjs.map} +1 -1
- package/dist/{split-4KKZZXXE-DGFsDrFE.cjs → split-4KKZZXXE-D3kKToq-.cjs} +2 -2
- package/dist/{split-4KKZZXXE-DGFsDrFE.cjs.map → split-4KKZZXXE-D3kKToq-.cjs.map} +1 -1
- package/dist/{split-4KKZZXXE-C97QsnxB.mjs → split-4KKZZXXE-oyZFQtYU.mjs} +2 -2
- package/dist/{split-4KKZZXXE-C97QsnxB.mjs.map → split-4KKZZXXE-oyZFQtYU.mjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-HGqCZYuu.mjs → sqlite3-CGOEFJAO-BedLxgf_.mjs} +2 -2
- package/dist/{sqlite3-CGOEFJAO-HGqCZYuu.mjs.map → sqlite3-CGOEFJAO-BedLxgf_.mjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-D78UkTyw.cjs → sqlite3-CGOEFJAO-DUW1XIou.cjs} +2 -2
- package/dist/{sqlite3-CGOEFJAO-D78UkTyw.cjs.map → sqlite3-CGOEFJAO-DUW1XIou.cjs.map} +1 -1
- package/dist/{start-DAlaZ5zj.mjs → start-9_8ZcdaU.mjs} +337 -228
- package/dist/start-9_8ZcdaU.mjs.map +1 -0
- package/dist/{start-BX-bkX9K.cjs → start-CBrH4KOb.cjs} +337 -228
- package/dist/start-CBrH4KOb.cjs.map +1 -0
- package/dist/start.cjs +1 -1
- package/dist/start.d.cts +1 -1
- package/dist/start.d.mts +1 -1
- package/dist/start.mjs +1 -1
- package/dist/{strings-6WDHLGMX-CeJiCt-u.cjs → strings-6WDHLGMX-5ObhNSGS.cjs} +2 -2
- package/dist/{strings-6WDHLGMX-CeJiCt-u.cjs.map → strings-6WDHLGMX-5ObhNSGS.cjs.map} +1 -1
- package/dist/{strings-6WDHLGMX-Dix-GFiu.mjs → strings-6WDHLGMX-DXaUbNpx.mjs} +2 -2
- package/dist/{strings-6WDHLGMX-Dix-GFiu.mjs.map → strings-6WDHLGMX-DXaUbNpx.mjs.map} +1 -1
- package/dist/{tac-2STMMJYW-DlI5binK.cjs → tac-2STMMJYW-CLSjS7F2.cjs} +2 -2
- package/dist/{tac-2STMMJYW-DlI5binK.cjs.map → tac-2STMMJYW-CLSjS7F2.cjs.map} +1 -1
- package/dist/{tac-2STMMJYW-Bm0D_YqQ.mjs → tac-2STMMJYW-Ov0tcgNn.mjs} +2 -2
- package/dist/{tac-2STMMJYW-Bm0D_YqQ.mjs.map → tac-2STMMJYW-Ov0tcgNn.mjs.map} +1 -1
- package/dist/{tail-R4PCA2C4-TH4AUhAb.cjs → tail-R4PCA2C4-C018_ZAk.cjs} +2 -2
- package/dist/{tail-R4PCA2C4-TH4AUhAb.cjs.map → tail-R4PCA2C4-C018_ZAk.cjs.map} +1 -1
- package/dist/{tail-R4PCA2C4-7wsnh20i.mjs → tail-R4PCA2C4-KgqykSFz.mjs} +2 -2
- package/dist/{tail-R4PCA2C4-7wsnh20i.mjs.map → tail-R4PCA2C4-KgqykSFz.mjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-DELlRab1.cjs → tar-STHHZTZ6-BcBkmdCH.cjs} +4 -4
- package/dist/{tar-STHHZTZ6-DELlRab1.cjs.map → tar-STHHZTZ6-BcBkmdCH.cjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-gShA0vQ1.mjs → tar-STHHZTZ6-CCPYnq7u.mjs} +3 -3
- package/dist/{tar-STHHZTZ6-gShA0vQ1.mjs.map → tar-STHHZTZ6-CCPYnq7u.mjs.map} +1 -1
- package/dist/{tee-YUZ2FKCJ-D_BE3AiF.cjs → tee-YUZ2FKCJ-Cce_gOKf.cjs} +2 -2
- package/dist/{tee-YUZ2FKCJ-D_BE3AiF.cjs.map → tee-YUZ2FKCJ-Cce_gOKf.cjs.map} +1 -1
- package/dist/{tee-YUZ2FKCJ-6jGvzLuO.mjs → tee-YUZ2FKCJ-D7LOkjQo.mjs} +2 -2
- package/dist/{tee-YUZ2FKCJ-6jGvzLuO.mjs.map → tee-YUZ2FKCJ-D7LOkjQo.mjs.map} +1 -1
- package/dist/{time-D4LNBSWX-D7RWA_NU.mjs → time-D4LNBSWX-CvYHvswI.mjs} +2 -2
- package/dist/{time-D4LNBSWX-D7RWA_NU.mjs.map → time-D4LNBSWX-CvYHvswI.mjs.map} +1 -1
- package/dist/{time-D4LNBSWX-zKxg-wM1.cjs → time-D4LNBSWX-D9C8_lG9.cjs} +2 -2
- package/dist/{time-D4LNBSWX-zKxg-wM1.cjs.map → time-D4LNBSWX-D9C8_lG9.cjs.map} +1 -1
- package/dist/{timeout-YDCRSLPQ-D42ruxso.mjs → timeout-YDCRSLPQ-CacPbawx.mjs} +2 -2
- package/dist/{timeout-YDCRSLPQ-D42ruxso.mjs.map → timeout-YDCRSLPQ-CacPbawx.mjs.map} +1 -1
- package/dist/{timeout-YDCRSLPQ-DWs-ACr6.cjs → timeout-YDCRSLPQ-Ccs9ipQM.cjs} +2 -2
- package/dist/{timeout-YDCRSLPQ-DWs-ACr6.cjs.map → timeout-YDCRSLPQ-Ccs9ipQM.cjs.map} +1 -1
- package/dist/{touch-UA33VN3N-OcSMUASX.mjs → touch-UA33VN3N-D2ndvYPZ.mjs} +2 -2
- package/dist/{touch-UA33VN3N-OcSMUASX.mjs.map → touch-UA33VN3N-D2ndvYPZ.mjs.map} +1 -1
- package/dist/{touch-UA33VN3N-BALmWXCe.cjs → touch-UA33VN3N-Dxlmlbm_.cjs} +2 -2
- package/dist/{touch-UA33VN3N-BALmWXCe.cjs.map → touch-UA33VN3N-Dxlmlbm_.cjs.map} +1 -1
- package/dist/{tr-36LHWFRQ-DDHiAg_m.cjs → tr-36LHWFRQ-Bzq2x5-h.cjs} +2 -2
- package/dist/{tr-36LHWFRQ-DDHiAg_m.cjs.map → tr-36LHWFRQ-Bzq2x5-h.cjs.map} +1 -1
- package/dist/{tr-36LHWFRQ-BHhoJAPK.mjs → tr-36LHWFRQ-CWCuChgL.mjs} +2 -2
- package/dist/{tr-36LHWFRQ-BHhoJAPK.mjs.map → tr-36LHWFRQ-CWCuChgL.mjs.map} +1 -1
- package/dist/{tree-YLD52CNT-BqqLx-tM.cjs → tree-YLD52CNT-BQipj5RY.cjs} +2 -2
- package/dist/{tree-YLD52CNT-BqqLx-tM.cjs.map → tree-YLD52CNT-BQipj5RY.cjs.map} +1 -1
- package/dist/{tree-YLD52CNT-CuJMHpsw.mjs → tree-YLD52CNT-CDfF4vcr.mjs} +2 -2
- package/dist/{tree-YLD52CNT-CuJMHpsw.mjs.map → tree-YLD52CNT-CDfF4vcr.mjs.map} +1 -1
- package/dist/{unexpand-CADSA4VO-BORtdsy_.cjs → unexpand-CADSA4VO-C4qGbx-B.cjs} +2 -2
- package/dist/{unexpand-CADSA4VO-BORtdsy_.cjs.map → unexpand-CADSA4VO-C4qGbx-B.cjs.map} +1 -1
- package/dist/{unexpand-CADSA4VO-CHiw_MI4.mjs → unexpand-CADSA4VO-COvRSVlE.mjs} +2 -2
- package/dist/{unexpand-CADSA4VO-CHiw_MI4.mjs.map → unexpand-CADSA4VO-COvRSVlE.mjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-Byah97Ij.mjs → uniq-XSIZR6PB-C8bN8gfm.mjs} +3 -3
- package/dist/{uniq-XSIZR6PB-Byah97Ij.mjs.map → uniq-XSIZR6PB-C8bN8gfm.mjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-CyA5DoCP.cjs → uniq-XSIZR6PB-bJo9kdHr.cjs} +3 -3
- package/dist/{uniq-XSIZR6PB-CyA5DoCP.cjs.map → uniq-XSIZR6PB-bJo9kdHr.cjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-CPMTeSun.mjs → wc-LF7NU4LA-D4xFJZxz.mjs} +3 -3
- package/dist/{wc-LF7NU4LA-CPMTeSun.mjs.map → wc-LF7NU4LA-D4xFJZxz.mjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-DUBYnutH.cjs → wc-LF7NU4LA-NAR5lgIG.cjs} +3 -3
- package/dist/{wc-LF7NU4LA-DUBYnutH.cjs.map → wc-LF7NU4LA-NAR5lgIG.cjs.map} +1 -1
- package/dist/{xan-Y6WF3IRG-CLfddWd-.mjs → xan-Y6WF3IRG-D16SQobd.mjs} +6 -6
- package/dist/{xan-Y6WF3IRG-CLfddWd-.mjs.map → xan-Y6WF3IRG-D16SQobd.mjs.map} +1 -1
- package/dist/{xan-Y6WF3IRG-W4Yr19gE.cjs → xan-Y6WF3IRG-RigAd0GA.cjs} +6 -6
- package/dist/{xan-Y6WF3IRG-W4Yr19gE.cjs.map → xan-Y6WF3IRG-RigAd0GA.cjs.map} +1 -1
- package/dist/{xan-view-HDVKHFC2-B_Xy-tdc.mjs → xan-view-HDVKHFC2-CJ527xHS.mjs} +3 -3
- package/dist/{xan-view-HDVKHFC2-B_Xy-tdc.mjs.map → xan-view-HDVKHFC2-CJ527xHS.mjs.map} +1 -1
- package/dist/{xan-view-HDVKHFC2-CWkN0IJ1.cjs → xan-view-HDVKHFC2-pRqYeBi3.cjs} +3 -3
- package/dist/{xan-view-HDVKHFC2-CWkN0IJ1.cjs.map → xan-view-HDVKHFC2-pRqYeBi3.cjs.map} +1 -1
- package/dist/{xargs-MGZPH7AX-B_Ocy3BY.cjs → xargs-MGZPH7AX-C0bVMPGM.cjs} +2 -2
- package/dist/{xargs-MGZPH7AX-B_Ocy3BY.cjs.map → xargs-MGZPH7AX-C0bVMPGM.cjs.map} +1 -1
- package/dist/{xargs-MGZPH7AX-DDoz_2hL.mjs → xargs-MGZPH7AX-DWIn3Zwh.mjs} +2 -2
- package/dist/{xargs-MGZPH7AX-DDoz_2hL.mjs.map → xargs-MGZPH7AX-DWIn3Zwh.mjs.map} +1 -1
- package/dist/{yq-4QJW3EQG-mUhWBJBJ.mjs → yq-4QJW3EQG-CPcwcHbw.mjs} +3 -3
- package/dist/{yq-4QJW3EQG-mUhWBJBJ.mjs.map → yq-4QJW3EQG-CPcwcHbw.mjs.map} +1 -1
- package/dist/{yq-4QJW3EQG-BPBhjinw.cjs → yq-4QJW3EQG-CSTlai1q.cjs} +3 -3
- package/dist/{yq-4QJW3EQG-BPBhjinw.cjs.map → yq-4QJW3EQG-CSTlai1q.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/dist-70NUfApd.mjs.map +0 -1
- package/dist/start-BX-bkX9K.cjs.map +0 -1
- package/dist/start-DAlaZ5zj.mjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-C3ioU2dM.cjs");
|
|
2
2
|
let _keystrokehq_database = require("@keystrokehq/database");
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
require("node:path");
|
|
5
5
|
require("node:fs");
|
|
6
|
-
require("node:url");
|
|
7
6
|
let node_async_hooks = require("node:async_hooks");
|
|
7
|
+
require("node:url");
|
|
8
8
|
let _keystrokehq_platform_database = require("@keystrokehq/platform-database");
|
|
9
9
|
let _hono_node_server = require("@hono/node-server");
|
|
10
10
|
let _keystrokehq_auth = require("@keystrokehq/auth");
|
|
@@ -128,20 +128,11 @@ async function promoteProjectDeploy(input) {
|
|
|
128
128
|
const webhookRoutes = [...(0, _keystrokehq_runtime.extractWebhookRoutesFromManifest)(manifest), ...ephemeralRoutes];
|
|
129
129
|
if (webhookRoutes.length > 0) await (0, _keystrokehq_platform_database.ensureWebhookApiKeys)(project.id, webhookRoutes, project.id);
|
|
130
130
|
}
|
|
131
|
-
/**
|
|
132
|
-
function
|
|
133
|
-
if (
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
if (!artifactId) return {
|
|
137
|
-
action: "error",
|
|
138
|
-
message: `Project ${project.id} has no pending artifact`
|
|
139
|
-
};
|
|
140
|
-
if (!project.pendingArtifactId && project.activeArtifactId === artifactId && project.status === "active" && project.baseUrl && project.runtimeId) return { action: "skip" };
|
|
141
|
-
return {
|
|
142
|
-
action: "run",
|
|
143
|
-
artifactId
|
|
144
|
-
};
|
|
131
|
+
/** True when a project still needs an org worker rebuild after a runtime job finishes. */
|
|
132
|
+
function projectNeedsRuntimeFollowUp(project) {
|
|
133
|
+
if (project.status === "starting" && project.pendingArtifactId) return true;
|
|
134
|
+
if (project.pendingArtifactId && project.activeArtifactId !== project.pendingArtifactId) return true;
|
|
135
|
+
return false;
|
|
145
136
|
}
|
|
146
137
|
let runtimeQueue;
|
|
147
138
|
let runtimeQueueInit;
|
|
@@ -151,7 +142,7 @@ function configureProjectRuntimeScheduler(plugin) {
|
|
|
151
142
|
runtimeQueue = void 0;
|
|
152
143
|
runtimeQueueInit = void 0;
|
|
153
144
|
}
|
|
154
|
-
async function
|
|
145
|
+
async function getOrgRuntimeQueue() {
|
|
155
146
|
if (runtimeQueue) return runtimeQueue;
|
|
156
147
|
if (!runtimeQueueInit) runtimeQueueInit = (async () => {
|
|
157
148
|
const queue = await require_dist.createJobQueue({
|
|
@@ -163,27 +154,60 @@ async function getProjectRuntimeQueue() {
|
|
|
163
154
|
})();
|
|
164
155
|
return runtimeQueueInit;
|
|
165
156
|
}
|
|
166
|
-
function
|
|
157
|
+
function toOrgRuntimeJob(payload) {
|
|
167
158
|
const job = payload.payload;
|
|
168
|
-
if (!job?.
|
|
159
|
+
if (!job?.organizationId) throw new Error("Invalid org runtime job payload");
|
|
169
160
|
return {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
161
|
+
organizationId: job.organizationId,
|
|
162
|
+
triggerProjectId: job.triggerProjectId,
|
|
163
|
+
triggerArtifactId: job.triggerArtifactId
|
|
173
164
|
};
|
|
174
165
|
}
|
|
175
|
-
async function
|
|
176
|
-
|
|
166
|
+
async function resolveOrgProjects(job) {
|
|
167
|
+
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(job.organizationId);
|
|
168
|
+
const deploys = [];
|
|
169
|
+
for (const project of projects) {
|
|
170
|
+
const artifactId = project.id === job.triggerProjectId && job.triggerArtifactId ? job.triggerArtifactId : project.pendingArtifactId ?? project.activeArtifactId;
|
|
171
|
+
if (!artifactId) continue;
|
|
172
|
+
const artifact = await (0, _keystrokehq_platform_database.selectProjectArtifactById)(artifactId);
|
|
173
|
+
if (!artifact || artifact.projectId !== project.id || artifact.status !== "ready") {
|
|
174
|
+
if (project.id === job.triggerProjectId) throw new Error(`Project ${project.id} pending artifact is not ready`);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
deploys.push({
|
|
178
|
+
projectId: project.id,
|
|
179
|
+
name: project.name,
|
|
180
|
+
artifactId,
|
|
181
|
+
artifactStorageKey: artifact.storageKey
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (deploys.length === 0) throw new Error(`Organization ${job.organizationId} has no deployable projects`);
|
|
185
|
+
return deploys;
|
|
186
|
+
}
|
|
187
|
+
async function orgNeedsRuntimeFollowUp(organizationId) {
|
|
188
|
+
return (await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organizationId)).some(projectNeedsRuntimeFollowUp);
|
|
189
|
+
}
|
|
190
|
+
async function enqueueOrgRuntime(job) {
|
|
191
|
+
return (await getOrgRuntimeQueue()).enqueue({
|
|
177
192
|
kind: "runtime",
|
|
178
|
-
targetId: job.
|
|
179
|
-
runId:
|
|
193
|
+
targetId: job.organizationId,
|
|
194
|
+
runId: crypto.randomUUID(),
|
|
180
195
|
trigger: "api",
|
|
181
196
|
payload: job,
|
|
182
197
|
maxAttempts: 5,
|
|
183
|
-
dedupeKey: job.
|
|
198
|
+
dedupeKey: job.organizationId
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
async function enqueueProjectRuntime(job) {
|
|
202
|
+
const project = await (0, _keystrokehq_platform_database.selectProjectById)(job.projectId);
|
|
203
|
+
if (!project) throw new Error(`Project ${job.projectId} not found`);
|
|
204
|
+
return enqueueOrgRuntime({
|
|
205
|
+
organizationId: project.organizationId,
|
|
206
|
+
triggerProjectId: job.projectId,
|
|
207
|
+
triggerArtifactId: job.artifactId
|
|
184
208
|
});
|
|
185
209
|
}
|
|
186
|
-
async function
|
|
210
|
+
async function destroyOrgRuntime(runtime, input, runtimeId) {
|
|
187
211
|
if (!runtime.destroy) return;
|
|
188
212
|
try {
|
|
189
213
|
await runtime.destroy({
|
|
@@ -191,49 +215,60 @@ async function destroyProjectRuntime(runtime, input, runtimeId) {
|
|
|
191
215
|
hosting: input.hosting
|
|
192
216
|
});
|
|
193
217
|
} catch (destroyError) {
|
|
194
|
-
console.error(`[
|
|
218
|
+
console.error(`[org.runtime] failed to destroy runtime ${runtimeId}`, destroyError);
|
|
195
219
|
}
|
|
196
220
|
}
|
|
197
|
-
async function
|
|
221
|
+
async function handleOrgRuntimeJob(runtime, resolveStartInput, payload) {
|
|
198
222
|
if (payload.kind !== "runtime") return;
|
|
199
|
-
const job =
|
|
223
|
+
const job = toOrgRuntimeJob(payload);
|
|
200
224
|
try {
|
|
201
|
-
const
|
|
202
|
-
if (!
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
225
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(job.organizationId);
|
|
226
|
+
if (!organization) throw new Error(`Organization ${job.organizationId} not found`);
|
|
227
|
+
const projects = await resolveOrgProjects(job);
|
|
228
|
+
const input = await resolveStartInput(job);
|
|
229
|
+
const mergedInput = {
|
|
230
|
+
...input,
|
|
231
|
+
organizationId: job.organizationId,
|
|
232
|
+
projects,
|
|
233
|
+
previousRuntimeId: input.previousRuntimeId ?? organization.runtimeId
|
|
234
|
+
};
|
|
210
235
|
let result;
|
|
211
236
|
try {
|
|
212
|
-
result = await runtime.start(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
237
|
+
result = await runtime.start(mergedInput);
|
|
238
|
+
for (const project of projects) {
|
|
239
|
+
await promoteProjectDeploy({
|
|
240
|
+
projectId: project.projectId,
|
|
241
|
+
artifactId: project.artifactId,
|
|
242
|
+
baseUrl: result.baseUrl
|
|
243
|
+
});
|
|
244
|
+
await (0, _keystrokehq_platform_database.updateProjectActive)(project.projectId, {
|
|
245
|
+
baseUrl: result.baseUrl,
|
|
246
|
+
runtimeId: result.runtimeId
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
await (0, _keystrokehq_platform_database.updateOrganizationActive)(job.organizationId, {
|
|
250
|
+
baseUrl: result.baseUrl,
|
|
251
|
+
runtimeId: result.runtimeId
|
|
217
252
|
});
|
|
218
|
-
|
|
219
|
-
if (
|
|
253
|
+
if (mergedInput.previousRuntimeId) await destroyOrgRuntime(runtime, mergedInput, mergedInput.previousRuntimeId);
|
|
254
|
+
if (await orgNeedsRuntimeFollowUp(job.organizationId)) await enqueueOrgRuntime({ organizationId: job.organizationId });
|
|
220
255
|
} catch (error) {
|
|
221
|
-
if (result) await
|
|
256
|
+
if (result) await destroyOrgRuntime(runtime, mergedInput, result.runtimeId);
|
|
222
257
|
throw error;
|
|
223
258
|
}
|
|
224
259
|
} catch (error) {
|
|
225
|
-
console.error(`[
|
|
226
|
-
if (payload.exhaustedRetries) await (0, _keystrokehq_platform_database.
|
|
260
|
+
console.error(`[org.runtime] ${job.organizationId} failed`, error);
|
|
261
|
+
if (payload.exhaustedRetries) await (0, _keystrokehq_platform_database.updateOrganizationFailed)(job.organizationId, "Org runtime failed after retries");
|
|
227
262
|
throw error;
|
|
228
263
|
}
|
|
229
264
|
}
|
|
230
265
|
async function startProjectRuntimeWorker(runtime, options = {}) {
|
|
231
|
-
const queue = await
|
|
266
|
+
const queue = await getOrgRuntimeQueue();
|
|
232
267
|
const resolveStartInput = options.resolveStartInput ?? (async (job) => {
|
|
233
|
-
throw new Error(`
|
|
268
|
+
throw new Error(`Org runtime for ${job.organizationId} requires resolveStartInput with database credentials`);
|
|
234
269
|
});
|
|
235
270
|
await queue.startWorker(async (payload) => {
|
|
236
|
-
await
|
|
271
|
+
await handleOrgRuntimeJob(runtime, resolveStartInput, payload);
|
|
237
272
|
});
|
|
238
273
|
}
|
|
239
274
|
//#endregion
|
|
@@ -539,7 +574,7 @@ function requireOrganizationParam() {
|
|
|
539
574
|
};
|
|
540
575
|
}
|
|
541
576
|
//#endregion
|
|
542
|
-
//#region ../../packages/http/dist/with-public-project-runtime-
|
|
577
|
+
//#region ../../packages/http/dist/with-public-project-runtime-B7hmgjbi.mjs
|
|
543
578
|
const requestBackgroundTasks = new node_async_hooks.AsyncLocalStorage();
|
|
544
579
|
function runWithRequestBackgroundTasks(fn) {
|
|
545
580
|
return requestBackgroundTasks.run([], fn);
|
|
@@ -577,7 +612,7 @@ function withOrganizationProjectDatabase() {
|
|
|
577
612
|
}
|
|
578
613
|
//#endregion
|
|
579
614
|
//#region src/routes/account/users/me/avatar/GET.ts
|
|
580
|
-
const handler$
|
|
615
|
+
const handler$63 = async (c) => {
|
|
581
616
|
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(c.get("user").id);
|
|
582
617
|
if (!dbUser) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
583
618
|
return c.json(require_dist.UserAvatarSchema.parse({ url: dbUser.image ?? null }));
|
|
@@ -596,7 +631,7 @@ function avatarExtensionForContentType(contentType) {
|
|
|
596
631
|
}
|
|
597
632
|
//#endregion
|
|
598
633
|
//#region src/routes/account/users/me/avatar/presign/POST.ts
|
|
599
|
-
const handler$
|
|
634
|
+
const handler$62 = async (c) => {
|
|
600
635
|
const parsed = require_dist.PresignUserAvatarRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
601
636
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid avatar upload request" }), 400);
|
|
602
637
|
const extension = avatarExtensionForContentType(parsed.data.contentType);
|
|
@@ -636,7 +671,7 @@ async function deleteStoredImageIfOwned(input) {
|
|
|
636
671
|
}
|
|
637
672
|
//#endregion
|
|
638
673
|
//#region src/routes/account/users/me/avatar/PATCH.ts
|
|
639
|
-
const handler$
|
|
674
|
+
const handler$61 = async (c) => {
|
|
640
675
|
const parsed = require_dist.UserAvatarPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
641
676
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid avatar update" }), 400);
|
|
642
677
|
const user = c.get("user");
|
|
@@ -678,14 +713,14 @@ const handler$58 = async (c) => {
|
|
|
678
713
|
};
|
|
679
714
|
//#endregion
|
|
680
715
|
//#region src/routes/account/users/me/preferences/GET.ts
|
|
681
|
-
const handler$
|
|
716
|
+
const handler$60 = async (c) => {
|
|
682
717
|
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(c.get("user").id);
|
|
683
718
|
if (!dbUser) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
684
719
|
return c.json(require_dist.UserPreferencesSchema.parse(require_dist.normalizeUserPreferences(dbUser.preferences)));
|
|
685
720
|
};
|
|
686
721
|
//#endregion
|
|
687
722
|
//#region src/routes/account/users/me/preferences/PATCH.ts
|
|
688
|
-
const handler$
|
|
723
|
+
const handler$59 = async (c) => {
|
|
689
724
|
const parsed = require_dist.UserPreferencesPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
690
725
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid preferences update" }), 400);
|
|
691
726
|
const user = c.get("user");
|
|
@@ -700,9 +735,9 @@ const handler$56 = async (c) => {
|
|
|
700
735
|
};
|
|
701
736
|
//#endregion
|
|
702
737
|
//#region src/routes/account/organizations/GET.ts
|
|
703
|
-
const handler$
|
|
738
|
+
const handler$58 = async (c) => {
|
|
704
739
|
const memberships = await (0, _keystrokehq_platform_database.selectUserOrganizations)(c.get("user").id);
|
|
705
|
-
return c.json(require_dist.ListOrganizationsResponseSchema.parse(
|
|
740
|
+
return c.json(require_dist.ListOrganizationsResponseSchema.parse(memberships.map(require_dist.mapUserOrganization)));
|
|
706
741
|
};
|
|
707
742
|
//#endregion
|
|
708
743
|
//#region src/services/create-organization.ts
|
|
@@ -768,7 +803,7 @@ function createOrganizationHandler(deps) {
|
|
|
768
803
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid organization request" }), 400);
|
|
769
804
|
try {
|
|
770
805
|
const membership = await createOrganizationWithHosting(deps, user.id, parsed.data.name, parsed.data.slug);
|
|
771
|
-
return c.json(require_dist.CreateOrganizationResponseSchema.parse(
|
|
806
|
+
return c.json(require_dist.CreateOrganizationResponseSchema.parse(require_dist.mapUserOrganization(membership)), 201);
|
|
772
807
|
} catch (error) {
|
|
773
808
|
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return c.json(require_dist.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 409);
|
|
774
809
|
if (error instanceof zod.ZodError) return c.json(require_dist.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 400);
|
|
@@ -778,7 +813,7 @@ function createOrganizationHandler(deps) {
|
|
|
778
813
|
}
|
|
779
814
|
//#endregion
|
|
780
815
|
//#region src/routes/account/organizations/slug-available/GET.ts
|
|
781
|
-
const handler$
|
|
816
|
+
const handler$57 = async (c) => {
|
|
782
817
|
const parsed = require_dist.SlugAvailabilityQuerySchema.safeParse({
|
|
783
818
|
slug: c.req.query("slug"),
|
|
784
819
|
excludeOrganizationId: c.req.query("excludeOrganizationId")
|
|
@@ -789,15 +824,15 @@ const handler$54 = async (c) => {
|
|
|
789
824
|
};
|
|
790
825
|
//#endregion
|
|
791
826
|
//#region src/routes/account/organizations/[organizationId]/GET.ts
|
|
792
|
-
const handler$
|
|
827
|
+
const handler$56 = async (c) => {
|
|
793
828
|
const { organizationId } = c.get("organization");
|
|
794
829
|
const membership = await (0, _keystrokehq_platform_database.selectUserOrganizationMembership)(c.get("user").id, organizationId);
|
|
795
830
|
if (!membership) throw new Error(`Organization membership missing after param guard: ${organizationId}`);
|
|
796
|
-
return c.json(require_dist.ActiveOrganizationResponseSchema.parse(
|
|
831
|
+
return c.json(require_dist.ActiveOrganizationResponseSchema.parse(require_dist.mapUserOrganization(membership)));
|
|
797
832
|
};
|
|
798
833
|
//#endregion
|
|
799
834
|
//#region src/routes/account/organizations/[organizationId]/PATCH.ts
|
|
800
|
-
const handler$
|
|
835
|
+
const handler$55 = async (c) => {
|
|
801
836
|
const organization = c.get("organization");
|
|
802
837
|
const body = await c.req.json().catch(() => null);
|
|
803
838
|
const parsed = require_dist.UpdateOrganizationRequestSchema.safeParse(body);
|
|
@@ -810,10 +845,10 @@ const handler$52 = async (c) => {
|
|
|
810
845
|
if (parsed.data.name !== void 0) updated = await (0, _keystrokehq_platform_database.updateOrganizationName)(organization.organizationId, parsed.data.name);
|
|
811
846
|
if (parsed.data.slug !== void 0) updated = await (0, _keystrokehq_platform_database.updateOrganizationSlug)(organization.organizationId, parsed.data.slug);
|
|
812
847
|
if (!updated) throw new Error(`Organization update produced no result: ${organization.organizationId}`);
|
|
813
|
-
return c.json(require_dist.ActiveOrganizationResponseSchema.parse(
|
|
848
|
+
return c.json(require_dist.ActiveOrganizationResponseSchema.parse(require_dist.mapUserOrganization({
|
|
814
849
|
organization: updated,
|
|
815
850
|
role: organization.role
|
|
816
|
-
})
|
|
851
|
+
})));
|
|
817
852
|
} catch (error) {
|
|
818
853
|
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return c.json(require_dist.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 409);
|
|
819
854
|
if (error instanceof zod.ZodError) return c.json(require_dist.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 400);
|
|
@@ -822,7 +857,7 @@ const handler$52 = async (c) => {
|
|
|
822
857
|
};
|
|
823
858
|
//#endregion
|
|
824
859
|
//#region src/routes/account/organizations/[organizationId]/branding/GET.ts
|
|
825
|
-
const handler$
|
|
860
|
+
const handler$54 = async (c) => {
|
|
826
861
|
const { organizationId } = c.get("organization");
|
|
827
862
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
828
863
|
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
@@ -871,7 +906,7 @@ async function finalizeOrgLogoVariant(input) {
|
|
|
871
906
|
publicUrl: finalized.publicUrl
|
|
872
907
|
};
|
|
873
908
|
}
|
|
874
|
-
const handler$
|
|
909
|
+
const handler$53 = async (c) => {
|
|
875
910
|
const parsed = require_dist.OrganizationSidebarBrandingPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
876
911
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid branding update" }), 400);
|
|
877
912
|
const { organizationId } = c.get("organization");
|
|
@@ -899,7 +934,7 @@ const handler$50 = async (c) => {
|
|
|
899
934
|
};
|
|
900
935
|
//#endregion
|
|
901
936
|
//#region src/routes/account/organizations/[organizationId]/branding/logo/presign/POST.ts
|
|
902
|
-
const handler$
|
|
937
|
+
const handler$52 = async (c) => {
|
|
903
938
|
const parsed = require_dist.PresignOrgLogoRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
904
939
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid logo upload request" }), 400);
|
|
905
940
|
const extension = avatarExtensionForContentType(parsed.data.contentType);
|
|
@@ -990,7 +1025,7 @@ async function attachRanAsToDetail(detail, ranByUserId) {
|
|
|
990
1025
|
}
|
|
991
1026
|
//#endregion
|
|
992
1027
|
//#region src/routes/account/history/GET.ts
|
|
993
|
-
const handler$
|
|
1028
|
+
const handler$51 = async (c) => {
|
|
994
1029
|
const organization = c.get("organization");
|
|
995
1030
|
const ctx = accessContext(c);
|
|
996
1031
|
const query = require_dist.HistoryRunListQuerySchema.parse({
|
|
@@ -1013,7 +1048,7 @@ const handler$48 = async (c) => {
|
|
|
1013
1048
|
};
|
|
1014
1049
|
//#endregion
|
|
1015
1050
|
//#region src/routes/account/history/[runId]/GET.ts
|
|
1016
|
-
const handler$
|
|
1051
|
+
const handler$50 = async (c) => {
|
|
1017
1052
|
const runId = c.req.param("runId") ?? "";
|
|
1018
1053
|
if (!runId) return c.json(null, 404);
|
|
1019
1054
|
const core = await (0, _keystrokehq_database.findHistoryRunCore)(runId);
|
|
@@ -1064,7 +1099,7 @@ function toAgentSummary(row, options) {
|
|
|
1064
1099
|
}
|
|
1065
1100
|
//#endregion
|
|
1066
1101
|
//#region src/routes/account/agents/GET.ts
|
|
1067
|
-
const handler$
|
|
1102
|
+
const handler$49 = async (c) => {
|
|
1068
1103
|
const filter = await resolveListProjectIds(c, listScope(c, agentListScope(accessContext(c))), c.req.query("projectId"));
|
|
1069
1104
|
if (filter === "empty") return c.json(require_dist.AgentSummaryListResponseSchema.parse([]));
|
|
1070
1105
|
const rows = await (0, _keystrokehq_database.listActiveAgents)(filter);
|
|
@@ -1078,7 +1113,7 @@ function touchResourceActivityBestEffort(options) {
|
|
|
1078
1113
|
}
|
|
1079
1114
|
//#endregion
|
|
1080
1115
|
//#region src/routes/account/agents/[agentId]/GET.ts
|
|
1081
|
-
const handler$
|
|
1116
|
+
const handler$48 = async (c) => {
|
|
1082
1117
|
const agentId = c.req.param("agentId") ?? "";
|
|
1083
1118
|
const row = agentId ? await (0, _keystrokehq_database.selectActiveAgentById)(agentId) : void 0;
|
|
1084
1119
|
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist.AgentSummaryDetailResponseSchema.parse(null));
|
|
@@ -1113,7 +1148,7 @@ async function cancelHistoryRun(c, kind, cancel) {
|
|
|
1113
1148
|
}
|
|
1114
1149
|
//#endregion
|
|
1115
1150
|
//#region src/routes/account/agents/sessions/[sessionId]/cancel/POST.ts
|
|
1116
|
-
const handler$
|
|
1151
|
+
const handler$47 = (c) => cancelHistoryRun(c, "agent", _keystrokehq_database.cancelAgentSession);
|
|
1117
1152
|
//#endregion
|
|
1118
1153
|
//#region src/routes/account/resources/workflows.ts
|
|
1119
1154
|
function toWorkflowSummary(row, options) {
|
|
@@ -1130,7 +1165,7 @@ function toWorkflowSummary(row, options) {
|
|
|
1130
1165
|
}
|
|
1131
1166
|
//#endregion
|
|
1132
1167
|
//#region src/routes/account/workflows/GET.ts
|
|
1133
|
-
const handler$
|
|
1168
|
+
const handler$46 = async (c) => {
|
|
1134
1169
|
const filter = await resolveListProjectIds(c, listScope(c, workflowListScope(accessContext(c))), c.req.query("projectId"));
|
|
1135
1170
|
if (filter === "empty") return c.json(require_dist.WorkflowSummaryListResponseSchema.parse([]));
|
|
1136
1171
|
const rows = await (0, _keystrokehq_database.listActiveWorkflows)(filter);
|
|
@@ -1139,7 +1174,7 @@ const handler$43 = async (c) => {
|
|
|
1139
1174
|
};
|
|
1140
1175
|
//#endregion
|
|
1141
1176
|
//#region src/routes/account/workflows/[workflowId]/GET.ts
|
|
1142
|
-
const handler$
|
|
1177
|
+
const handler$45 = async (c) => {
|
|
1143
1178
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
1144
1179
|
const row = workflowId ? await (0, _keystrokehq_database.selectActiveWorkflowById)(workflowId) : void 0;
|
|
1145
1180
|
if (!row || !await canAccessProjectId(c, row.projectId, canAccessWorkflow)) return c.json(require_dist.WorkflowSummaryDetailResponseSchema.parse(null));
|
|
@@ -1154,7 +1189,7 @@ const handler$42 = async (c) => {
|
|
|
1154
1189
|
};
|
|
1155
1190
|
//#endregion
|
|
1156
1191
|
//#region src/routes/account/workflows/runs/[runId]/cancel/POST.ts
|
|
1157
|
-
const handler$
|
|
1192
|
+
const handler$44 = (c) => cancelHistoryRun(c, "workflow", _keystrokehq_database.cancelWorkflowRun);
|
|
1158
1193
|
//#endregion
|
|
1159
1194
|
//#region src/routes/account/resources/skills.ts
|
|
1160
1195
|
function toSkillSummary(row) {
|
|
@@ -1170,7 +1205,7 @@ function toSkillSummary(row) {
|
|
|
1170
1205
|
}
|
|
1171
1206
|
//#endregion
|
|
1172
1207
|
//#region src/routes/account/skills/GET.ts
|
|
1173
|
-
const handler$
|
|
1208
|
+
const handler$43 = async (c) => {
|
|
1174
1209
|
const filter = await resolveListProjectIds(c, listScope(c, skillListScope(accessContext(c))), c.req.query("projectId"));
|
|
1175
1210
|
if (filter === "empty") return c.json(require_dist.SkillSummaryListResponseSchema.parse([]));
|
|
1176
1211
|
const rows = await (0, _keystrokehq_database.listActiveSkills)(filter);
|
|
@@ -1178,7 +1213,7 @@ const handler$40 = async (c) => {
|
|
|
1178
1213
|
};
|
|
1179
1214
|
//#endregion
|
|
1180
1215
|
//#region src/routes/account/skills/[skillId]/GET.ts
|
|
1181
|
-
const handler$
|
|
1216
|
+
const handler$42 = async (c) => {
|
|
1182
1217
|
const skillId = c.req.param("skillId") ?? "";
|
|
1183
1218
|
const row = skillId ? await (0, _keystrokehq_database.selectActiveSkillById)(skillId) : void 0;
|
|
1184
1219
|
if (!row || !await canAccessProjectId(c, row.projectId, canAccessSkill)) return c.json(require_dist.SkillSummaryDetailResponseSchema.parse(null));
|
|
@@ -1225,7 +1260,7 @@ function latestRecentInteractionAt(recent) {
|
|
|
1225
1260
|
//#endregion
|
|
1226
1261
|
//#region src/routes/account/recents/GET.ts
|
|
1227
1262
|
const RECENTS_LIMIT = 50;
|
|
1228
|
-
const handler$
|
|
1263
|
+
const handler$41 = async (c) => {
|
|
1229
1264
|
const userId = c.get("user").id;
|
|
1230
1265
|
const organization = c.get("organization");
|
|
1231
1266
|
const grantedProjectIdsList = await grantedProjectIds(c, { kind: "member-only" });
|
|
@@ -1251,11 +1286,11 @@ const handler$38 = async (c) => {
|
|
|
1251
1286
|
};
|
|
1252
1287
|
//#endregion
|
|
1253
1288
|
//#region src/routes/account/projects/GET.ts
|
|
1254
|
-
const handler$
|
|
1289
|
+
const handler$40 = async (c) => {
|
|
1255
1290
|
const organization = c.get("organization");
|
|
1256
1291
|
const grantedProjectIdsList = await grantedProjectIds(c, listScope(c, projectListScope(accessContext(c))));
|
|
1257
1292
|
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: grantedProjectIdsList });
|
|
1258
|
-
return c.json(require_dist.ListProjectsResponseSchema.parse(
|
|
1293
|
+
return c.json(require_dist.ListProjectsResponseSchema.parse(projects.map(require_dist.mapProject)));
|
|
1259
1294
|
};
|
|
1260
1295
|
//#endregion
|
|
1261
1296
|
//#region src/routes/account/projects/metrics/merge-project-list-metrics.ts
|
|
@@ -1277,7 +1312,7 @@ function mergeProjectListMetrics(input) {
|
|
|
1277
1312
|
}
|
|
1278
1313
|
//#endregion
|
|
1279
1314
|
//#region src/routes/account/projects/metrics/GET.ts
|
|
1280
|
-
const handler$
|
|
1315
|
+
const handler$39 = async (c) => {
|
|
1281
1316
|
const organization = c.get("organization");
|
|
1282
1317
|
const grantedProjectIdsList = await grantedProjectIds(c, listScope(c, projectListScope(accessContext(c))));
|
|
1283
1318
|
const [resourceCounts, lastDeploymentAtByProject] = await Promise.all([(0, _keystrokehq_database.selectProjectResourceCounts)(grantedProjectIdsList !== void 0 ? { projectIds: grantedProjectIdsList } : void 0), (0, _keystrokehq_platform_database.selectLastDeploymentAtByProject)(organization.organizationId)]);
|
|
@@ -1289,22 +1324,22 @@ const handler$36 = async (c) => {
|
|
|
1289
1324
|
const allowed = new Set(grantedProjectIdsList);
|
|
1290
1325
|
metrics = Object.fromEntries(Object.entries(metrics).filter(([projectId]) => allowed.has(projectId)));
|
|
1291
1326
|
}
|
|
1292
|
-
return c.json(require_dist.ListProjectMetricsResponseSchema.parse(
|
|
1327
|
+
return c.json(require_dist.ListProjectMetricsResponseSchema.parse(metrics));
|
|
1293
1328
|
};
|
|
1294
1329
|
//#endregion
|
|
1295
1330
|
//#region src/routes/account/projects/POST.ts
|
|
1296
|
-
const handler$
|
|
1331
|
+
const handler$38 = async (c) => {
|
|
1297
1332
|
const organization = c.get("organization");
|
|
1298
1333
|
const user = c.get("user");
|
|
1299
1334
|
const body = await c.req.json().catch(() => null);
|
|
1300
1335
|
const parsed = require_dist.CreateProjectRequestSchema.safeParse(body);
|
|
1301
1336
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project name is required" }), 400);
|
|
1302
1337
|
const project = await (0, _keystrokehq_platform_database.createProjectForOrganization)(organization.organizationId, parsed.data.name, parsed.data.description, user.id);
|
|
1303
|
-
return c.json(require_dist.CreateProjectResponseSchema.parse(
|
|
1338
|
+
return c.json(require_dist.CreateProjectResponseSchema.parse(require_dist.mapProject(project)), 201);
|
|
1304
1339
|
};
|
|
1305
1340
|
//#endregion
|
|
1306
1341
|
//#region src/routes/account/projects/slug-available/GET.ts
|
|
1307
|
-
const handler$
|
|
1342
|
+
const handler$37 = async (c) => {
|
|
1308
1343
|
const organization = c.get("organization");
|
|
1309
1344
|
const parsed = require_dist.ProjectSlugAvailabilityQuerySchema.safeParse({
|
|
1310
1345
|
slug: c.req.query("slug"),
|
|
@@ -1316,12 +1351,12 @@ const handler$34 = async (c) => {
|
|
|
1316
1351
|
};
|
|
1317
1352
|
//#endregion
|
|
1318
1353
|
//#region src/routes/account/projects/[projectId]/GET.ts
|
|
1319
|
-
const handler$
|
|
1320
|
-
return c.json(require_dist.ProjectResponseSchema.parse(
|
|
1354
|
+
const handler$36 = async (c) => {
|
|
1355
|
+
return c.json(require_dist.ProjectResponseSchema.parse(routeProject(c.get("project"))));
|
|
1321
1356
|
};
|
|
1322
1357
|
//#endregion
|
|
1323
1358
|
//#region src/routes/account/projects/[projectId]/PATCH.ts
|
|
1324
|
-
const handler$
|
|
1359
|
+
const handler$35 = async (c) => {
|
|
1325
1360
|
const organization = c.get("organization");
|
|
1326
1361
|
const project = c.get("project");
|
|
1327
1362
|
const body = await c.req.json().catch(() => null);
|
|
@@ -1335,11 +1370,11 @@ const handler$32 = async (c) => {
|
|
|
1335
1370
|
throw error;
|
|
1336
1371
|
}
|
|
1337
1372
|
if (!updated) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
1338
|
-
return c.json(require_dist.ProjectResponseSchema.parse(
|
|
1373
|
+
return c.json(require_dist.ProjectResponseSchema.parse(require_dist.mapProject(updated)));
|
|
1339
1374
|
};
|
|
1340
1375
|
//#endregion
|
|
1341
1376
|
//#region src/routes/account/projects/[projectId]/DELETE.ts
|
|
1342
|
-
const handler$
|
|
1377
|
+
const handler$34 = async (c) => {
|
|
1343
1378
|
const organization = c.get("organization");
|
|
1344
1379
|
const project = c.get("project");
|
|
1345
1380
|
if (!await (0, _keystrokehq_platform_database.deleteProjectForOrganization)(organization.organizationId, project.id)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
@@ -1347,15 +1382,15 @@ const handler$31 = async (c) => {
|
|
|
1347
1382
|
};
|
|
1348
1383
|
//#endregion
|
|
1349
1384
|
//#region src/routes/account/projects/[projectId]/deployments/GET.ts
|
|
1350
|
-
const handler$
|
|
1385
|
+
const handler$33 = async (c) => {
|
|
1351
1386
|
const rows = await (0, _keystrokehq_platform_database.selectProjectDeployments)(c.get("project").id);
|
|
1352
|
-
return c.json(require_dist.ListProjectDeploymentsResponseSchema.parse(
|
|
1387
|
+
return c.json(require_dist.ListProjectDeploymentsResponseSchema.parse(rows.map(require_dist.mapProjectDeployment)));
|
|
1353
1388
|
};
|
|
1354
1389
|
//#endregion
|
|
1355
1390
|
//#region src/routes/account/projects/[projectId]/artifacts/POST.ts
|
|
1356
1391
|
const DEFAULT_PRESIGN_TTL_SECONDS$1 = 900;
|
|
1357
1392
|
const ARTIFACT_CONTENT_TYPE = "application/gzip";
|
|
1358
|
-
const handler$
|
|
1393
|
+
const handler$32 = async (c) => {
|
|
1359
1394
|
const project = c.get("project");
|
|
1360
1395
|
const { organizationId } = c.get("organization");
|
|
1361
1396
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
@@ -1383,7 +1418,7 @@ const handler$29 = async (c) => {
|
|
|
1383
1418
|
//#endregion
|
|
1384
1419
|
//#region src/routes/account/projects/[projectId]/artifacts/active/download/GET.ts
|
|
1385
1420
|
const DEFAULT_PRESIGN_TTL_SECONDS = 900;
|
|
1386
|
-
const handler$
|
|
1421
|
+
const handler$31 = async (c) => {
|
|
1387
1422
|
const project = c.get("project");
|
|
1388
1423
|
const { organizationId } = c.get("organization");
|
|
1389
1424
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
@@ -1402,7 +1437,7 @@ const handler$28 = async (c) => {
|
|
|
1402
1437
|
};
|
|
1403
1438
|
//#endregion
|
|
1404
1439
|
//#region src/routes/account/projects/[projectId]/artifacts/[artifactId]/complete/POST.ts
|
|
1405
|
-
const handler$
|
|
1440
|
+
const handler$30 = async (c) => {
|
|
1406
1441
|
const project = c.get("project");
|
|
1407
1442
|
const artifactId = c.req.param("artifactId");
|
|
1408
1443
|
if (!artifactId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
@@ -1441,7 +1476,7 @@ const handler$27 = async (c) => {
|
|
|
1441
1476
|
//#endregion
|
|
1442
1477
|
//#region src/routes/account/projects/[projectId]/artifacts/[artifactId]/source/presign/POST.ts
|
|
1443
1478
|
const SOURCE_BLOB_CONTENT_TYPE = "text/plain; charset=utf-8";
|
|
1444
|
-
const handler$
|
|
1479
|
+
const handler$29 = async (c) => {
|
|
1445
1480
|
const project = c.get("project");
|
|
1446
1481
|
const artifactId = c.req.param("artifactId");
|
|
1447
1482
|
if (!artifactId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
@@ -1469,7 +1504,7 @@ const handler$26 = async (c) => {
|
|
|
1469
1504
|
};
|
|
1470
1505
|
//#endregion
|
|
1471
1506
|
//#region src/routes/account/projects/[projectId]/artifacts/[artifactId]/source/manifest/POST.ts
|
|
1472
|
-
const handler$
|
|
1507
|
+
const handler$28 = async (c) => {
|
|
1473
1508
|
const project = c.get("project");
|
|
1474
1509
|
const artifactId = c.req.param("artifactId");
|
|
1475
1510
|
if (!artifactId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
@@ -1514,7 +1549,7 @@ function resolveSourcePaths(rows, kindDir, filePaths) {
|
|
|
1514
1549
|
}] : [];
|
|
1515
1550
|
});
|
|
1516
1551
|
}
|
|
1517
|
-
const handler$
|
|
1552
|
+
const handler$27 = async (c) => {
|
|
1518
1553
|
const project = c.get("project");
|
|
1519
1554
|
const active = await (0, _keystrokehq_platform_database.selectActiveArtifactSourceManifestForProject)(project.id);
|
|
1520
1555
|
if (!active || !active.sourceManifestJson) return c.json(require_dist.ListProjectFilesResponseSchema.parse({
|
|
@@ -1548,7 +1583,7 @@ const handler$24 = async (c) => {
|
|
|
1548
1583
|
};
|
|
1549
1584
|
//#endregion
|
|
1550
1585
|
//#region src/routes/account/projects/[projectId]/artifacts/[artifactId]/files/content/GET.ts
|
|
1551
|
-
const handler$
|
|
1586
|
+
const handler$26 = async (c) => {
|
|
1552
1587
|
const project = c.get("project");
|
|
1553
1588
|
const artifactId = c.req.param("artifactId");
|
|
1554
1589
|
if (!artifactId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
@@ -1577,24 +1612,25 @@ function createProjectReachabilityHandler(hosting) {
|
|
|
1577
1612
|
return async (c) => {
|
|
1578
1613
|
const project = c.get("project");
|
|
1579
1614
|
if (project.status !== "active") return c.json(require_dist.ProjectReachabilityResponseSchema.parse({ reachable: false }));
|
|
1615
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(project.organizationId);
|
|
1580
1616
|
const reachable = await require_dist.pingProjectTarget({
|
|
1581
|
-
baseUrl: project.baseUrl,
|
|
1582
|
-
runtimeId: project.runtimeId
|
|
1617
|
+
baseUrl: organization?.baseUrl ?? project.baseUrl,
|
|
1618
|
+
runtimeId: organization?.runtimeId ?? project.runtimeId
|
|
1583
1619
|
}, { plugin: hosting });
|
|
1584
1620
|
return c.json(require_dist.ProjectReachabilityResponseSchema.parse({ reachable }));
|
|
1585
1621
|
};
|
|
1586
1622
|
}
|
|
1587
1623
|
//#endregion
|
|
1588
1624
|
//#region src/routes/account/projects/[projectId]/members/GET.ts
|
|
1589
|
-
const handler$
|
|
1625
|
+
const handler$25 = async (c) => {
|
|
1590
1626
|
const project = c.get("project");
|
|
1591
1627
|
const currentUserId = c.get("user").id;
|
|
1592
1628
|
const members = await (0, _keystrokehq_platform_database.selectProjectMembers)(project.id);
|
|
1593
|
-
return c.json(require_dist.ListProjectMembersResponseSchema.parse(
|
|
1629
|
+
return c.json(require_dist.ListProjectMembersResponseSchema.parse(members.map((member) => require_dist.mapProjectMember(member, { isCurrentUser: member.id === currentUserId }))));
|
|
1594
1630
|
};
|
|
1595
1631
|
//#endregion
|
|
1596
1632
|
//#region src/routes/account/projects/[projectId]/members/POST.ts
|
|
1597
|
-
const handler$
|
|
1633
|
+
const handler$24 = async (c) => {
|
|
1598
1634
|
const organization = c.get("organization");
|
|
1599
1635
|
const project = c.get("project");
|
|
1600
1636
|
const body = await c.req.json().catch(() => null);
|
|
@@ -1606,11 +1642,11 @@ const handler$21 = async (c) => {
|
|
|
1606
1642
|
emails: parsed.data.emails,
|
|
1607
1643
|
role: parsed.data.role
|
|
1608
1644
|
});
|
|
1609
|
-
return c.json(require_dist.InviteProjectMembersResponseSchema.parse(
|
|
1645
|
+
return c.json(require_dist.InviteProjectMembersResponseSchema.parse(results));
|
|
1610
1646
|
};
|
|
1611
1647
|
//#endregion
|
|
1612
1648
|
//#region src/routes/account/projects/[projectId]/members/[userId]/PATCH.ts
|
|
1613
|
-
const handler$
|
|
1649
|
+
const handler$23 = async (c) => {
|
|
1614
1650
|
const project = c.get("project");
|
|
1615
1651
|
const userId = c.req.param("userId");
|
|
1616
1652
|
const body = await c.req.json().catch(() => null);
|
|
@@ -1619,7 +1655,7 @@ const handler$20 = async (c) => {
|
|
|
1619
1655
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid member update request" }), 400);
|
|
1620
1656
|
try {
|
|
1621
1657
|
const member = await (0, _keystrokehq_platform_database.updateProjectMemberRole)(project.id, userId, parsed.data.role);
|
|
1622
|
-
return c.json(require_dist.UpdateProjectMemberResponseSchema.parse(
|
|
1658
|
+
return c.json(require_dist.UpdateProjectMemberResponseSchema.parse(require_dist.mapProjectMember(member)));
|
|
1623
1659
|
} catch (error) {
|
|
1624
1660
|
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
1625
1661
|
throw error;
|
|
@@ -1627,7 +1663,7 @@ const handler$20 = async (c) => {
|
|
|
1627
1663
|
};
|
|
1628
1664
|
//#endregion
|
|
1629
1665
|
//#region src/routes/account/projects/[projectId]/members/[userId]/DELETE.ts
|
|
1630
|
-
const handler$
|
|
1666
|
+
const handler$22 = async (c) => {
|
|
1631
1667
|
const project = c.get("project");
|
|
1632
1668
|
const userId = c.req.param("userId");
|
|
1633
1669
|
if (!userId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
@@ -1641,7 +1677,7 @@ const handler$19 = async (c) => {
|
|
|
1641
1677
|
};
|
|
1642
1678
|
//#endregion
|
|
1643
1679
|
//#region src/routes/account/projects/[projectId]/members/me/DELETE.ts
|
|
1644
|
-
const handler$
|
|
1680
|
+
const handler$21 = async (c) => {
|
|
1645
1681
|
const project = c.get("project");
|
|
1646
1682
|
const userId = c.get("user").id;
|
|
1647
1683
|
try {
|
|
@@ -1654,13 +1690,13 @@ const handler$18 = async (c) => {
|
|
|
1654
1690
|
};
|
|
1655
1691
|
//#endregion
|
|
1656
1692
|
//#region src/routes/account/projects/[projectId]/settings/GET.ts
|
|
1657
|
-
const handler$
|
|
1693
|
+
const handler$20 = async (c) => {
|
|
1658
1694
|
const project = c.get("project");
|
|
1659
|
-
return c.json(require_dist.ProjectSettingsResponseSchema.parse(
|
|
1695
|
+
return c.json(require_dist.ProjectSettingsResponseSchema.parse(require_dist.mapProjectSettings(project)));
|
|
1660
1696
|
};
|
|
1661
1697
|
//#endregion
|
|
1662
1698
|
//#region src/routes/account/projects/[projectId]/settings/PATCH.ts
|
|
1663
|
-
const handler$
|
|
1699
|
+
const handler$19 = async (c) => {
|
|
1664
1700
|
const organization = c.get("organization");
|
|
1665
1701
|
const project = c.get("project");
|
|
1666
1702
|
const body = await c.req.json().catch(() => null);
|
|
@@ -1672,7 +1708,7 @@ const handler$16 = async (c) => {
|
|
|
1672
1708
|
invitePermission: parsed.data.invitePermission
|
|
1673
1709
|
});
|
|
1674
1710
|
if (!updated) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
1675
|
-
return c.json(require_dist.ProjectSettingsResponseSchema.parse(
|
|
1711
|
+
return c.json(require_dist.ProjectSettingsResponseSchema.parse(require_dist.mapProjectSettings(updated)));
|
|
1676
1712
|
};
|
|
1677
1713
|
//#endregion
|
|
1678
1714
|
//#region src/routes/account/credentials/enrich.ts
|
|
@@ -1694,8 +1730,12 @@ function canManageCredential(row, userId) {
|
|
|
1694
1730
|
if (row.scopeType === "user") return userId !== void 0 && row.scopeId === userId;
|
|
1695
1731
|
return true;
|
|
1696
1732
|
}
|
|
1697
|
-
/** Display name derived from the
|
|
1733
|
+
/** Display name derived from the app slug (org-custom slugs use the segment after `/`). */
|
|
1698
1734
|
function displayAppName(appId) {
|
|
1735
|
+
try {
|
|
1736
|
+
const parsed = require_dist.parseAppSlug(appId);
|
|
1737
|
+
if (parsed.kind === "org") return require_dist.displayCredentialAppName(parsed.name);
|
|
1738
|
+
} catch {}
|
|
1699
1739
|
return require_dist.displayCredentialAppName(appId);
|
|
1700
1740
|
}
|
|
1701
1741
|
/** Masked preview of a secret — last 4 chars revealed, the rest masked. Plaintext never returned. */
|
|
@@ -1782,10 +1822,10 @@ async function enrichCredentialInstances(rows, organizationId) {
|
|
|
1782
1822
|
}
|
|
1783
1823
|
//#endregion
|
|
1784
1824
|
//#region src/routes/account/credentials/GET.ts
|
|
1785
|
-
const handler$
|
|
1825
|
+
const handler$18 = async (c) => {
|
|
1786
1826
|
const organization = c.get("organization");
|
|
1787
1827
|
const credentials = await enrichCredentialInstances(await (0, _keystrokehq_database.listAllCredentialInstances)(), organization.organizationId);
|
|
1788
|
-
return c.json(require_dist.ListCredentialsResponseSchema.parse(
|
|
1828
|
+
return c.json(require_dist.ListCredentialsResponseSchema.parse(credentials));
|
|
1789
1829
|
};
|
|
1790
1830
|
//#endregion
|
|
1791
1831
|
//#region src/routes/account/credentials/POST.ts
|
|
@@ -1793,7 +1833,7 @@ function withTargetScope(target, fn) {
|
|
|
1793
1833
|
if (target.projectScope) return (0, _keystrokehq_database.runWithProjectScope)(target.projectScope, fn);
|
|
1794
1834
|
return fn();
|
|
1795
1835
|
}
|
|
1796
|
-
const handler$
|
|
1836
|
+
const handler$17 = async (c) => {
|
|
1797
1837
|
const organization = c.get("organization");
|
|
1798
1838
|
const user = c.get("user");
|
|
1799
1839
|
const parsed = require_dist.CreateCredentialsRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
@@ -1802,6 +1842,13 @@ const handler$14 = async (c) => {
|
|
|
1802
1842
|
return c.json({ error: message }, 400);
|
|
1803
1843
|
}
|
|
1804
1844
|
const input = parsed.data;
|
|
1845
|
+
if (input.connectionKind === "manual" && input.value) {
|
|
1846
|
+
const app = await (0, _keystrokehq_platform_database.selectAppForOrganization)(organization.organizationId, input.appId);
|
|
1847
|
+
if (app && (0, _keystrokehq_platform_database.hasCredentialFieldTemplate)(app)) {
|
|
1848
|
+
const validation = require_dist.validateCredentialValueAgainstFields(app.credentialFields, input.value);
|
|
1849
|
+
if (!validation.ok) return c.json({ error: validation.message }, 400);
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1805
1852
|
const resolvedProjects = [];
|
|
1806
1853
|
for (const slug of input.projects) {
|
|
1807
1854
|
const project = await (0, _keystrokehq_platform_database.selectProjectForOrganizationBySlug)(organization.organizationId, slug);
|
|
@@ -1838,7 +1885,7 @@ const handler$14 = async (c) => {
|
|
|
1838
1885
|
for (const target of targets) {
|
|
1839
1886
|
const siblings = await withTargetScope(target, () => (0, _keystrokehq_database.selectCredentialInstancesForScope)(input.appId, target.scopeType, target.scopeId));
|
|
1840
1887
|
const label = require_dist.resolveUniqueCredentialInstanceLabel({
|
|
1841
|
-
baseLabel: require_dist.buildCredentialInstanceLabel({
|
|
1888
|
+
baseLabel: input.label?.trim() || require_dist.buildCredentialInstanceLabel({
|
|
1842
1889
|
scopeType: target.scopeType,
|
|
1843
1890
|
appName,
|
|
1844
1891
|
projectName: target.projectName
|
|
@@ -1863,21 +1910,21 @@ const handler$14 = async (c) => {
|
|
|
1863
1910
|
if (row) rows.push(row);
|
|
1864
1911
|
}
|
|
1865
1912
|
const credentials = await enrichCredentialInstances(rows, organization.organizationId);
|
|
1866
|
-
return c.json(require_dist.CreateCredentialsResponseSchema.parse(
|
|
1913
|
+
return c.json(require_dist.CreateCredentialsResponseSchema.parse(credentials), 201);
|
|
1867
1914
|
};
|
|
1868
1915
|
//#endregion
|
|
1869
1916
|
//#region src/routes/account/credentials/[credentialId]/GET.ts
|
|
1870
|
-
const handler$
|
|
1917
|
+
const handler$16 = async (c) => {
|
|
1871
1918
|
const organization = c.get("organization");
|
|
1872
1919
|
const credentialId = c.req.param("credentialId") ?? "";
|
|
1873
1920
|
const row = credentialId ? await (0, _keystrokehq_database.selectCredentialInstanceById)(credentialId) : void 0;
|
|
1874
1921
|
if (!row || toAppCredentialScope(row.scopeType) === null) return c.json({ error: "Credential not found" }, 404);
|
|
1875
1922
|
const [credential] = await enrichCredentialInstances([row], organization.organizationId);
|
|
1876
|
-
return c.json(require_dist.GetCredentialResponseSchema.parse(
|
|
1923
|
+
return c.json(require_dist.GetCredentialResponseSchema.parse(credential));
|
|
1877
1924
|
};
|
|
1878
1925
|
//#endregion
|
|
1879
1926
|
//#region src/routes/account/credentials/[credentialId]/PATCH.ts
|
|
1880
|
-
const handler$
|
|
1927
|
+
const handler$15 = async (c) => {
|
|
1881
1928
|
const organization = c.get("organization");
|
|
1882
1929
|
const user = c.get("user");
|
|
1883
1930
|
const credentialId = c.req.param("credentialId") ?? "";
|
|
@@ -1930,7 +1977,7 @@ const handler$12 = async (c) => {
|
|
|
1930
1977
|
});
|
|
1931
1978
|
const updated = await (0, _keystrokehq_database.selectCredentialInstanceById)(credentialId);
|
|
1932
1979
|
const [credential] = await enrichCredentialInstances(updated ? [updated] : [], organization.organizationId);
|
|
1933
|
-
return c.json(require_dist.GetCredentialResponseSchema.parse(
|
|
1980
|
+
return c.json(require_dist.GetCredentialResponseSchema.parse(credential));
|
|
1934
1981
|
};
|
|
1935
1982
|
//#endregion
|
|
1936
1983
|
//#region src/routes/account/credentials/[credentialId]/DELETE.ts
|
|
@@ -1959,10 +2006,10 @@ function createDeleteCredentialHandler(options = {}) {
|
|
|
1959
2006
|
}
|
|
1960
2007
|
//#endregion
|
|
1961
2008
|
//#region src/routes/account/members/GET.ts
|
|
1962
|
-
const handler$
|
|
2009
|
+
const handler$14 = async (c) => {
|
|
1963
2010
|
const { organizationId } = c.get("organization");
|
|
1964
2011
|
const members = await (0, _keystrokehq_platform_database.selectOrganizationMembers)(organizationId);
|
|
1965
|
-
return c.json(require_dist.ListOrganizationMembersResponseSchema.parse(
|
|
2012
|
+
return c.json(require_dist.ListOrganizationMembersResponseSchema.parse(members.map(require_dist.mapOrganizationMember)));
|
|
1966
2013
|
};
|
|
1967
2014
|
//#endregion
|
|
1968
2015
|
//#region src/email/organization-invite-email.ts
|
|
@@ -2007,7 +2054,7 @@ async function sendOrganizationInviteEmail(payload, resend$1) {
|
|
|
2007
2054
|
}
|
|
2008
2055
|
//#endregion
|
|
2009
2056
|
//#region src/routes/account/members/invitations/POST.ts
|
|
2010
|
-
const handler$
|
|
2057
|
+
const handler$13 = async (c) => {
|
|
2011
2058
|
const user = c.get("user");
|
|
2012
2059
|
const organization = c.get("organization");
|
|
2013
2060
|
const body = await c.req.json().catch(() => null);
|
|
@@ -2029,11 +2076,11 @@ const handler$10 = async (c) => {
|
|
|
2029
2076
|
inviterName: inviter?.name
|
|
2030
2077
|
});
|
|
2031
2078
|
}
|
|
2032
|
-
return c.json(require_dist.InviteOrganizationMembersResponseSchema.parse(
|
|
2079
|
+
return c.json(require_dist.InviteOrganizationMembersResponseSchema.parse(results));
|
|
2033
2080
|
};
|
|
2034
2081
|
//#endregion
|
|
2035
2082
|
//#region src/routes/account/members/[userId]/PATCH.ts
|
|
2036
|
-
const handler$
|
|
2083
|
+
const handler$12 = async (c) => {
|
|
2037
2084
|
const { organizationId } = c.get("organization");
|
|
2038
2085
|
const userId = c.req.param("userId");
|
|
2039
2086
|
const body = await c.req.json().catch(() => null);
|
|
@@ -2042,7 +2089,7 @@ const handler$9 = async (c) => {
|
|
|
2042
2089
|
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid member update request" }), 400);
|
|
2043
2090
|
try {
|
|
2044
2091
|
const member = await (0, _keystrokehq_platform_database.updateOrganizationMemberRole)(organizationId, userId, parsed.data.role);
|
|
2045
|
-
return c.json(require_dist.UpdateOrganizationMemberResponseSchema.parse(
|
|
2092
|
+
return c.json(require_dist.UpdateOrganizationMemberResponseSchema.parse(require_dist.mapOrganizationMember(member)));
|
|
2046
2093
|
} catch (error) {
|
|
2047
2094
|
if (error instanceof _keystrokehq_platform_database.CannotModifyOwnerError || error instanceof _keystrokehq_platform_database.OrganizationMemberNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
2048
2095
|
throw error;
|
|
@@ -2050,7 +2097,7 @@ const handler$9 = async (c) => {
|
|
|
2050
2097
|
};
|
|
2051
2098
|
//#endregion
|
|
2052
2099
|
//#region src/routes/account/members/[userId]/DELETE.ts
|
|
2053
|
-
const handler$
|
|
2100
|
+
const handler$11 = async (c) => {
|
|
2054
2101
|
const { organizationId } = c.get("organization");
|
|
2055
2102
|
const userId = c.req.param("userId");
|
|
2056
2103
|
if (!userId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
@@ -2064,19 +2111,19 @@ const handler$8 = async (c) => {
|
|
|
2064
2111
|
};
|
|
2065
2112
|
//#endregion
|
|
2066
2113
|
//#region src/routes/account/invitations/GET.ts
|
|
2067
|
-
const handler$
|
|
2114
|
+
const handler$10 = async (c) => {
|
|
2068
2115
|
const invitations = await (0, _keystrokehq_platform_database.selectPendingInvitationsForUser)(c.get("user").id);
|
|
2069
|
-
return c.json(require_dist.ListOrganizationInvitationsResponseSchema.parse(
|
|
2116
|
+
return c.json(require_dist.ListOrganizationInvitationsResponseSchema.parse(invitations.map(require_dist.mapOrganizationInvitation)));
|
|
2070
2117
|
};
|
|
2071
2118
|
//#endregion
|
|
2072
2119
|
//#region src/routes/account/invitations/[invitationId]/accept/POST.ts
|
|
2073
|
-
const handler$
|
|
2120
|
+
const handler$9 = async (c) => {
|
|
2074
2121
|
const user = c.get("user");
|
|
2075
2122
|
const invitationId = c.req.param("invitationId");
|
|
2076
2123
|
if (!invitationId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invitation id is required" }), 400);
|
|
2077
2124
|
try {
|
|
2078
2125
|
const membership = await (0, _keystrokehq_platform_database.acceptInvitation)(invitationId, user.id);
|
|
2079
|
-
return c.json(require_dist.AcceptOrganizationInvitationResponseSchema.parse(
|
|
2126
|
+
return c.json(require_dist.AcceptOrganizationInvitationResponseSchema.parse(require_dist.mapUserOrganization(membership)));
|
|
2080
2127
|
} catch (error) {
|
|
2081
2128
|
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
2082
2129
|
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationForbiddenError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 403);
|
|
@@ -2086,7 +2133,7 @@ const handler$6 = async (c) => {
|
|
|
2086
2133
|
};
|
|
2087
2134
|
//#endregion
|
|
2088
2135
|
//#region src/routes/account/invitations/[invitationId]/decline/POST.ts
|
|
2089
|
-
const handler$
|
|
2136
|
+
const handler$8 = async (c) => {
|
|
2090
2137
|
const user = c.get("user");
|
|
2091
2138
|
const invitationId = c.req.param("invitationId");
|
|
2092
2139
|
if (!invitationId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invitation id is required" }), 400);
|
|
@@ -2111,14 +2158,83 @@ function appRowToCatalogEntry(row) {
|
|
|
2111
2158
|
integrationDescription: row.description,
|
|
2112
2159
|
...row.logo ? { logo: row.logo } : {},
|
|
2113
2160
|
authKind: row.authKind,
|
|
2114
|
-
oauthScopes: row.oauthScopes
|
|
2161
|
+
oauthScopes: row.oauthScopes,
|
|
2162
|
+
source: row.source,
|
|
2163
|
+
...(0, _keystrokehq_platform_database.hasCredentialFieldTemplate)(row) ? { credentialFields: row.credentialFields } : {}
|
|
2164
|
+
};
|
|
2165
|
+
}
|
|
2166
|
+
function appRowToCustomAppDetail(row) {
|
|
2167
|
+
if (row.source !== "custom" || row.authKind !== "api_key") throw new Error(`App is not a custom api_key app: ${row.slug}`);
|
|
2168
|
+
if (!(0, _keystrokehq_platform_database.hasCredentialFieldTemplate)(row)) throw new Error(`Custom app is missing credential fields: ${row.slug}`);
|
|
2169
|
+
return {
|
|
2170
|
+
id: row.slug,
|
|
2171
|
+
slug: row.slug,
|
|
2172
|
+
name: row.name,
|
|
2173
|
+
description: row.description,
|
|
2174
|
+
category: row.category,
|
|
2175
|
+
authKind: "api_key",
|
|
2176
|
+
source: "custom",
|
|
2177
|
+
credentialFields: row.credentialFields,
|
|
2178
|
+
createdAt: row.createdAt.toISOString(),
|
|
2179
|
+
updatedAt: row.updatedAt.toISOString()
|
|
2115
2180
|
};
|
|
2116
2181
|
}
|
|
2117
2182
|
//#endregion
|
|
2118
2183
|
//#region src/routes/account/apps/GET.ts
|
|
2184
|
+
const handler$7 = async (c) => {
|
|
2185
|
+
const apps = (await (0, _keystrokehq_platform_database.listAppsForOrganization)(c.get("organization").organizationId)).map(appRowToCatalogEntry);
|
|
2186
|
+
return c.json(require_dist.ListAppsResponseSchema.parse(apps));
|
|
2187
|
+
};
|
|
2188
|
+
//#endregion
|
|
2189
|
+
//#region src/routes/account/apps/POST.ts
|
|
2190
|
+
const handler$6 = async (c) => {
|
|
2191
|
+
const organization = c.get("organization");
|
|
2192
|
+
const parsed = require_dist.CreateCustomAppRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
2193
|
+
if (!parsed.success) {
|
|
2194
|
+
const message = parsed.error.issues[0]?.message ?? "Invalid request body";
|
|
2195
|
+
return c.json(require_dist.ErrorResponseSchema.parse({ error: message }), 400);
|
|
2196
|
+
}
|
|
2197
|
+
const org = await (0, _keystrokehq_platform_database.selectOrganizationById)(organization.organizationId);
|
|
2198
|
+
if (!org) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
2199
|
+
try {
|
|
2200
|
+
const row = await (0, _keystrokehq_platform_database.createOrgApp)({
|
|
2201
|
+
organizationId: organization.organizationId,
|
|
2202
|
+
orgSlug: org.slug,
|
|
2203
|
+
name: parsed.data.name,
|
|
2204
|
+
slug: parsed.data.slug,
|
|
2205
|
+
description: parsed.data.description,
|
|
2206
|
+
credentialFields: parsed.data.fields
|
|
2207
|
+
});
|
|
2208
|
+
return c.json(require_dist.CreateCustomAppResponseSchema.parse(appRowToCustomAppDetail(row)), 201);
|
|
2209
|
+
} catch (error) {
|
|
2210
|
+
if (error instanceof _keystrokehq_platform_database.OrgAppSlugTakenError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 409);
|
|
2211
|
+
throw error;
|
|
2212
|
+
}
|
|
2213
|
+
};
|
|
2214
|
+
//#endregion
|
|
2215
|
+
//#region src/routes/account/apps/slug-available/GET.ts
|
|
2216
|
+
const handler$5 = async (c) => {
|
|
2217
|
+
const organization = c.get("organization");
|
|
2218
|
+
const parsed = require_dist.AppSlugAvailabilityQuerySchema.safeParse({ slug: c.req.query("slug") });
|
|
2219
|
+
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
2220
|
+
const org = await (0, _keystrokehq_platform_database.selectOrganizationById)(organization.organizationId);
|
|
2221
|
+
if (!org) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
2222
|
+
const availability = await (0, _keystrokehq_platform_database.checkOrgAppSlugAvailability)(org.slug, parsed.data.slug);
|
|
2223
|
+
return c.json(require_dist.AppSlugAvailabilityResponseSchema.parse(availability));
|
|
2224
|
+
};
|
|
2225
|
+
//#endregion
|
|
2226
|
+
//#region src/routes/account/apps/[slug]/GET.ts
|
|
2119
2227
|
const handler$4 = async (c) => {
|
|
2120
|
-
const
|
|
2121
|
-
|
|
2228
|
+
const organization = c.get("organization");
|
|
2229
|
+
const slug = c.req.param("slug") ?? "";
|
|
2230
|
+
if (!slug) return c.json(require_dist.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
2231
|
+
const row = await (0, _keystrokehq_platform_database.selectAppForOrganization)(organization.organizationId, decodeURIComponent(slug));
|
|
2232
|
+
if (!row || row.source !== "custom") return c.json(require_dist.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
2233
|
+
try {
|
|
2234
|
+
return c.json(require_dist.GetCustomAppResponseSchema.parse(appRowToCustomAppDetail(row)));
|
|
2235
|
+
} catch {
|
|
2236
|
+
return c.json(require_dist.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
2237
|
+
}
|
|
2122
2238
|
};
|
|
2123
2239
|
//#endregion
|
|
2124
2240
|
//#region src/routes/account/api-keys/GET.ts
|
|
@@ -2128,14 +2244,14 @@ const handler$3 = async (c) => {
|
|
|
2128
2244
|
const records = apiKeyListScope(accessContext(c)).kind === "all" ? await (0, _keystrokehq_platform_database.listOrgPlatformApiKeysForOrganization)(organizationId) : await (0, _keystrokehq_platform_database.listOrgPlatformApiKeysForUser)(organizationId, user.id);
|
|
2129
2245
|
const creators = await (0, _keystrokehq_platform_database.selectUsersByIds)([...new Set(records.map((record) => record.createdByUserId))]);
|
|
2130
2246
|
const creatorsById = new Map(creators.map((creator) => [creator.id, creator]));
|
|
2131
|
-
return c.json(require_dist.ListApiKeysResponseSchema.parse(
|
|
2247
|
+
return c.json(require_dist.ListApiKeysResponseSchema.parse(records.map((record) => ({
|
|
2132
2248
|
id: record.id,
|
|
2133
2249
|
name: record.name,
|
|
2134
2250
|
keyPreview: record.keyPreview,
|
|
2135
2251
|
createdAt: record.createdAt.toISOString(),
|
|
2136
2252
|
createdBy: (0, _keystrokehq_platform_database.mapOrgPlatformApiKeyCreatorOrDeleted)(record.createdByUserId, creatorsById.get(record.createdByUserId)),
|
|
2137
2253
|
isCreatedByCurrentUser: record.createdByUserId === user.id
|
|
2138
|
-
}))
|
|
2254
|
+
}))));
|
|
2139
2255
|
};
|
|
2140
2256
|
//#endregion
|
|
2141
2257
|
//#region src/routes/account/api-keys/POST.ts
|
|
@@ -2312,71 +2428,74 @@ function mountAccountRoutes(options) {
|
|
|
2312
2428
|
const requireProjectManageMembers = authorize(projectActions.manageMembers);
|
|
2313
2429
|
const requireInvitableProjectRole = authorizePayload(require_dist.InviteProjectMembersRequestSchema, ({ c, ctx, body }) => canInviteToProject(ctx, { invitePermission: getProjectInvitePermission(c) }, body.role));
|
|
2314
2430
|
const requireOrgParam = requireOrganizationParam();
|
|
2315
|
-
account.get("/organizations", handler$
|
|
2316
|
-
account.get("/organizations/slug-available", handler$
|
|
2431
|
+
account.get("/organizations", handler$58);
|
|
2432
|
+
account.get("/organizations/slug-available", handler$57);
|
|
2317
2433
|
account.post("/organizations", createOrganizationHandler(options));
|
|
2318
|
-
account.get("/organizations/:organizationId", requireOrgParam, handler$
|
|
2319
|
-
account.patch("/organizations/:organizationId", requireOrgParam, requireOrgUpdate, handler$
|
|
2320
|
-
account.get("/organizations/:organizationId/branding", requireOrgParam, handler$
|
|
2321
|
-
account.patch("/organizations/:organizationId/branding", requireOrgParam, requireOrgUpdate, handler$
|
|
2322
|
-
account.post("/organizations/:organizationId/branding/logo/presign", requireOrgParam, requireOrgUpdate, handler$
|
|
2323
|
-
account.get("/invitations", handler$
|
|
2324
|
-
account.post("/invitations/:invitationId/accept", handler$
|
|
2325
|
-
account.post("/invitations/:invitationId/decline", handler$
|
|
2326
|
-
account.get("/users/me/avatar", handler$
|
|
2327
|
-
account.post("/users/me/avatar/presign", handler$
|
|
2328
|
-
account.patch("/users/me/avatar", handler$
|
|
2329
|
-
account.get("/users/me/preferences", handler$
|
|
2330
|
-
account.patch("/users/me/preferences", handler$
|
|
2331
|
-
|
|
2332
|
-
orgScoped.get("/
|
|
2333
|
-
orgScoped.post("/
|
|
2334
|
-
orgScoped.
|
|
2335
|
-
orgScoped.
|
|
2434
|
+
account.get("/organizations/:organizationId", requireOrgParam, handler$56);
|
|
2435
|
+
account.patch("/organizations/:organizationId", requireOrgParam, requireOrgUpdate, handler$55);
|
|
2436
|
+
account.get("/organizations/:organizationId/branding", requireOrgParam, handler$54);
|
|
2437
|
+
account.patch("/organizations/:organizationId/branding", requireOrgParam, requireOrgUpdate, handler$53);
|
|
2438
|
+
account.post("/organizations/:organizationId/branding/logo/presign", requireOrgParam, requireOrgUpdate, handler$52);
|
|
2439
|
+
account.get("/invitations", handler$10);
|
|
2440
|
+
account.post("/invitations/:invitationId/accept", handler$9);
|
|
2441
|
+
account.post("/invitations/:invitationId/decline", handler$8);
|
|
2442
|
+
account.get("/users/me/avatar", handler$63);
|
|
2443
|
+
account.post("/users/me/avatar/presign", handler$62);
|
|
2444
|
+
account.patch("/users/me/avatar", handler$61);
|
|
2445
|
+
account.get("/users/me/preferences", handler$60);
|
|
2446
|
+
account.patch("/users/me/preferences", handler$59);
|
|
2447
|
+
orgScoped.get("/apps", handler$7);
|
|
2448
|
+
orgScoped.get("/apps/slug-available", handler$5);
|
|
2449
|
+
orgScoped.post("/apps", requireOrgUpdate, handler$6);
|
|
2450
|
+
orgScoped.get("/apps/:slug", handler$4);
|
|
2451
|
+
orgScoped.get("/members", handler$14);
|
|
2452
|
+
orgScoped.post("/members/invitations", requireUserInvite, requireInvitableRole, handler$13);
|
|
2453
|
+
orgScoped.patch("/members/:userId", requireUserManage, handler$12);
|
|
2454
|
+
orgScoped.delete("/members/:userId", requireUserManage, handler$11);
|
|
2336
2455
|
orgScoped.get("/api-keys", handler$3);
|
|
2337
2456
|
orgScoped.post("/api-keys", requireApiKeyCreate, handler$2);
|
|
2338
2457
|
orgScoped.delete("/api-keys/:apiKeyId", handler$1);
|
|
2339
2458
|
const withOrgDb = withOrganizationProjectDatabase();
|
|
2340
|
-
orgScoped.get("/agents", withOrgDb, handler$
|
|
2341
|
-
orgScoped.get("/agents/:agentId", withOrgDb, handler$
|
|
2342
|
-
orgScoped.get("/workflows", withOrgDb, handler$
|
|
2343
|
-
orgScoped.get("/workflows/:workflowId", withOrgDb, handler$
|
|
2344
|
-
orgScoped.get("/skills", withOrgDb, handler$
|
|
2345
|
-
orgScoped.get("/skills/:skillId", withOrgDb, handler$
|
|
2346
|
-
orgScoped.get("/recents", withOrgDb, handler$
|
|
2347
|
-
orgScoped.get("/history", withOrgDb, handler$
|
|
2459
|
+
orgScoped.get("/agents", withOrgDb, handler$49);
|
|
2460
|
+
orgScoped.get("/agents/:agentId", withOrgDb, handler$48);
|
|
2461
|
+
orgScoped.get("/workflows", withOrgDb, handler$46);
|
|
2462
|
+
orgScoped.get("/workflows/:workflowId", withOrgDb, handler$45);
|
|
2463
|
+
orgScoped.get("/skills", withOrgDb, handler$43);
|
|
2464
|
+
orgScoped.get("/skills/:skillId", withOrgDb, handler$42);
|
|
2465
|
+
orgScoped.get("/recents", withOrgDb, handler$41);
|
|
2466
|
+
orgScoped.get("/history", withOrgDb, handler$51);
|
|
2348
2467
|
orgScoped.post("/team-requests", handler);
|
|
2349
|
-
orgScoped.get("/history/:runId", withOrgDb, handler$
|
|
2350
|
-
orgScoped.post("/workflows/runs/:runId/cancel", withOrgDb, handler$
|
|
2351
|
-
orgScoped.post("/agents/sessions/:sessionId/cancel", withOrgDb, handler$
|
|
2352
|
-
orgScoped.get("/credentials", withOrgDb, handler$
|
|
2353
|
-
orgScoped.post("/credentials", withOrgDb, handler$
|
|
2354
|
-
orgScoped.get("/credentials/:credentialId", withOrgDb, (c, next) => c.req.param("credentialId") === "instances" ? next() : handler$
|
|
2355
|
-
orgScoped.patch("/credentials/:credentialId", withOrgDb, handler$
|
|
2468
|
+
orgScoped.get("/history/:runId", withOrgDb, handler$50);
|
|
2469
|
+
orgScoped.post("/workflows/runs/:runId/cancel", withOrgDb, handler$44);
|
|
2470
|
+
orgScoped.post("/agents/sessions/:sessionId/cancel", withOrgDb, handler$47);
|
|
2471
|
+
orgScoped.get("/credentials", withOrgDb, handler$18);
|
|
2472
|
+
orgScoped.post("/credentials", withOrgDb, handler$17);
|
|
2473
|
+
orgScoped.get("/credentials/:credentialId", withOrgDb, (c, next) => c.req.param("credentialId") === "instances" ? next() : handler$16(c, next));
|
|
2474
|
+
orgScoped.patch("/credentials/:credentialId", withOrgDb, handler$15);
|
|
2356
2475
|
orgScoped.delete("/credentials/:credentialId", withOrgDb, deleteCredential);
|
|
2357
|
-
orgScoped.get("/projects", handler$
|
|
2358
|
-
orgScoped.get("/projects/slug-available", handler$
|
|
2359
|
-
orgScoped.get("/projects/metrics", withOrgDb, handler$
|
|
2360
|
-
orgScoped.post("/projects", handler$
|
|
2361
|
-
projectScoped.get("/:projectId", requireProject(), requireProjectMember, handler$
|
|
2362
|
-
projectScoped.patch("/:projectId", requireProject(), requireProjectMember, requireProjectUpdate, handler$
|
|
2363
|
-
projectScoped.delete("/:projectId", requireProject(), requireProjectMember, requireProjectDelete, handler$
|
|
2364
|
-
projectScoped.get("/:projectId/settings", requireProject(), requireProjectMember, handler$
|
|
2365
|
-
projectScoped.patch("/:projectId/settings", requireProject(), requireProjectMember, requireProjectUpdate, handler$
|
|
2366
|
-
projectScoped.get("/:projectId/members", requireProject(), requireProjectMember, handler$
|
|
2367
|
-
projectScoped.post("/:projectId/members", requireProject(), requireProjectMember, requireInvitableProjectRole, handler$
|
|
2368
|
-
projectScoped.patch("/:projectId/members/:userId", requireProject(), requireProjectMember, requireProjectManageMembers, handler$
|
|
2369
|
-
projectScoped.delete("/:projectId/members/:userId", requireProject(), requireProjectMember, requireProjectManageMembers, handler$
|
|
2370
|
-
projectScoped.delete("/:projectId/members/me", requireProject(), requireProjectMember, handler$
|
|
2476
|
+
orgScoped.get("/projects", handler$40);
|
|
2477
|
+
orgScoped.get("/projects/slug-available", handler$37);
|
|
2478
|
+
orgScoped.get("/projects/metrics", withOrgDb, handler$39);
|
|
2479
|
+
orgScoped.post("/projects", handler$38);
|
|
2480
|
+
projectScoped.get("/:projectId", requireProject(), requireProjectMember, handler$36);
|
|
2481
|
+
projectScoped.patch("/:projectId", requireProject(), requireProjectMember, requireProjectUpdate, handler$35);
|
|
2482
|
+
projectScoped.delete("/:projectId", requireProject(), requireProjectMember, requireProjectDelete, handler$34);
|
|
2483
|
+
projectScoped.get("/:projectId/settings", requireProject(), requireProjectMember, handler$20);
|
|
2484
|
+
projectScoped.patch("/:projectId/settings", requireProject(), requireProjectMember, requireProjectUpdate, handler$19);
|
|
2485
|
+
projectScoped.get("/:projectId/members", requireProject(), requireProjectMember, handler$25);
|
|
2486
|
+
projectScoped.post("/:projectId/members", requireProject(), requireProjectMember, requireInvitableProjectRole, handler$24);
|
|
2487
|
+
projectScoped.patch("/:projectId/members/:userId", requireProject(), requireProjectMember, requireProjectManageMembers, handler$23);
|
|
2488
|
+
projectScoped.delete("/:projectId/members/:userId", requireProject(), requireProjectMember, requireProjectManageMembers, handler$22);
|
|
2489
|
+
projectScoped.delete("/:projectId/members/me", requireProject(), requireProjectMember, handler$21);
|
|
2371
2490
|
projectScoped.get("/:projectId/reachability", requireProject(), requireProjectMember, createProjectReachabilityHandler(options.hosting));
|
|
2372
|
-
projectScoped.get("/:projectId/files", requireProject(), requireProjectMember, withOrgDb, handler$
|
|
2373
|
-
projectScoped.get("/:projectId/artifacts/:artifactId/files/content", requireProject(), requireProjectMember, handler$
|
|
2374
|
-
projectScoped.get("/:projectId/deployments", requireProject(), requireProjectMember, handler$
|
|
2375
|
-
projectScoped.get("/:projectId/artifacts/active/download", requireProject(), requireProjectMember, requireProjectDeploy, handler$
|
|
2376
|
-
projectScoped.post("/:projectId/artifacts", requireProject(), requireProjectMember, requireProjectDeploy, handler$
|
|
2377
|
-
projectScoped.post("/:projectId/artifacts/:artifactId/complete", requireProject(), requireProjectMember, requireProjectDeploy, handler$
|
|
2378
|
-
projectScoped.post("/:projectId/artifacts/:artifactId/source/presign", requireProject(), requireProjectMember, requireProjectDeploy, handler$
|
|
2379
|
-
projectScoped.post("/:projectId/artifacts/:artifactId/source/manifest", requireProject(), requireProjectMember, requireProjectDeploy, handler$
|
|
2491
|
+
projectScoped.get("/:projectId/files", requireProject(), requireProjectMember, withOrgDb, handler$27);
|
|
2492
|
+
projectScoped.get("/:projectId/artifacts/:artifactId/files/content", requireProject(), requireProjectMember, handler$26);
|
|
2493
|
+
projectScoped.get("/:projectId/deployments", requireProject(), requireProjectMember, handler$33);
|
|
2494
|
+
projectScoped.get("/:projectId/artifacts/active/download", requireProject(), requireProjectMember, requireProjectDeploy, handler$31);
|
|
2495
|
+
projectScoped.post("/:projectId/artifacts", requireProject(), requireProjectMember, requireProjectDeploy, handler$32);
|
|
2496
|
+
projectScoped.post("/:projectId/artifacts/:artifactId/complete", requireProject(), requireProjectMember, requireProjectDeploy, handler$30);
|
|
2497
|
+
projectScoped.post("/:projectId/artifacts/:artifactId/source/presign", requireProject(), requireProjectMember, requireProjectDeploy, handler$29);
|
|
2498
|
+
projectScoped.post("/:projectId/artifacts/:artifactId/source/manifest", requireProject(), requireProjectMember, requireProjectDeploy, handler$28);
|
|
2380
2499
|
orgScoped.route("/projects", projectScoped);
|
|
2381
2500
|
account.route("/", orgScoped);
|
|
2382
2501
|
return account;
|
|
@@ -2472,11 +2591,12 @@ const SandboxWriteBodySchema = SandboxSessionBodySchema.extend({
|
|
|
2472
2591
|
path: zod.z.string().trim().min(1),
|
|
2473
2592
|
content: zod.z.string()
|
|
2474
2593
|
});
|
|
2475
|
-
function mountInternalRoutes(workerToken, tokenRefresh, llmProxy, sandboxProxy) {
|
|
2594
|
+
function mountInternalRoutes(workerToken, tokenRefresh, llmProxy, sandboxProxy, mcp) {
|
|
2476
2595
|
const internal = new hono.Hono();
|
|
2477
2596
|
const protect = requireWorkerToken(workerToken);
|
|
2478
2597
|
const materialize = (0, _keystrokehq_runtime.createCredentialMaterializeHandler)(tokenRefresh);
|
|
2479
2598
|
internal.use("/*", protect);
|
|
2599
|
+
mcp?.mountInternalRoutes?.(internal, { withProjectScope });
|
|
2480
2600
|
internal.post("/projects/:projectId/credentials/materialize", async (c) => {
|
|
2481
2601
|
const response = await withProjectScope(c.req.param("projectId"), async () => materialize(c));
|
|
2482
2602
|
if (response === void 0) return c.json({ error: "Project not found" }, 404);
|
|
@@ -2629,7 +2749,7 @@ async function createApp(auth, options) {
|
|
|
2629
2749
|
}));
|
|
2630
2750
|
},
|
|
2631
2751
|
mountInternal: (app, { tokenRefresh }) => {
|
|
2632
|
-
app.route("/internal", mountInternalRoutes(options.hosting.workerRuntime.workerToken, tokenRefresh, options.llmProxy, options.sandboxProxy));
|
|
2752
|
+
app.route("/internal", mountInternalRoutes(options.hosting.workerRuntime.workerToken, tokenRefresh, options.llmProxy, options.sandboxProxy, options.mcp));
|
|
2633
2753
|
}
|
|
2634
2754
|
});
|
|
2635
2755
|
}
|
|
@@ -2653,45 +2773,34 @@ async function startPlatformServer(platformConfig, hooks = {}) {
|
|
|
2653
2773
|
if (usesPgBossScheduler(platformConfig)) await (0, _keystrokehq_platform_database.ensureProjectPgBossGrants)();
|
|
2654
2774
|
configureProjectRuntimeScheduler(platformConfig.scheduler);
|
|
2655
2775
|
await startProjectRuntimeWorker(runtime, { resolveStartInput: async (job) => {
|
|
2656
|
-
const
|
|
2657
|
-
if (!
|
|
2658
|
-
const
|
|
2659
|
-
if (resolved.action === "error") throw new Error(resolved.message);
|
|
2660
|
-
if (resolved.action === "skip") throw new Error(`Project ${job.projectId} has no deploy artifact to start`);
|
|
2661
|
-
const artifact = await (0, _keystrokehq_platform_database.selectProjectArtifactById)(resolved.artifactId);
|
|
2662
|
-
if (!artifact || artifact.status !== "ready") throw new Error(`Project ${job.projectId} pending artifact is not ready`);
|
|
2663
|
-
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(project.organizationId);
|
|
2664
|
-
if (!organization) throw new Error(`Organization not found for project ${job.projectId}`);
|
|
2776
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(job.organizationId);
|
|
2777
|
+
if (!organization) throw new Error(`Organization ${job.organizationId} not found`);
|
|
2778
|
+
const database = await (0, _keystrokehq_platform_database.resolveOrgRuntimeDatabase)(job.organizationId);
|
|
2665
2779
|
const workerRuntime = platformConfig.hosting.workerRuntime;
|
|
2666
2780
|
return {
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
projectId: project.id
|
|
2674
|
-
}),
|
|
2781
|
+
organizationId: job.organizationId,
|
|
2782
|
+
projects: [],
|
|
2783
|
+
database: {
|
|
2784
|
+
...database,
|
|
2785
|
+
organizationId: job.organizationId
|
|
2786
|
+
},
|
|
2675
2787
|
env: {
|
|
2676
2788
|
...(0, _keystrokehq_platform_database.orgWorkspacesRuntimeEnv)(organization, { containerEnv: process.env }),
|
|
2677
2789
|
...platformConfig.llmProxy?.workerEnv({
|
|
2678
2790
|
platformUrl: workerRuntime.platformUrl,
|
|
2679
|
-
workerToken: workerRuntime.workerToken
|
|
2680
|
-
projectId: project.id
|
|
2791
|
+
workerToken: workerRuntime.workerToken
|
|
2681
2792
|
}),
|
|
2682
2793
|
...platformConfig.sandboxProxy?.workerEnv({
|
|
2683
2794
|
platformUrl: workerRuntime.platformUrl,
|
|
2684
|
-
workerToken: workerRuntime.workerToken
|
|
2685
|
-
projectId: project.id
|
|
2795
|
+
workerToken: workerRuntime.workerToken
|
|
2686
2796
|
}),
|
|
2687
2797
|
...platformConfig.workerEnv?.({
|
|
2688
2798
|
platformUrl: workerRuntime.platformUrl,
|
|
2689
|
-
workerToken: workerRuntime.workerToken
|
|
2690
|
-
projectId: project.id
|
|
2799
|
+
workerToken: workerRuntime.workerToken
|
|
2691
2800
|
})
|
|
2692
2801
|
},
|
|
2693
2802
|
hosting: organization.hostingAppName ? { appName: organization.hostingAppName } : void 0,
|
|
2694
|
-
previousRuntimeId:
|
|
2803
|
+
previousRuntimeId: organization.runtimeId
|
|
2695
2804
|
};
|
|
2696
2805
|
} });
|
|
2697
2806
|
const webUrl = process.env.PUBLIC_WEB_URL;
|
|
@@ -2730,4 +2839,4 @@ Object.defineProperty(exports, "startPlatformServer", {
|
|
|
2730
2839
|
}
|
|
2731
2840
|
});
|
|
2732
2841
|
|
|
2733
|
-
//# sourceMappingURL=start-
|
|
2842
|
+
//# sourceMappingURL=start-CBrH4KOb.cjs.map
|