@keystrokehq/platform 0.1.57 → 0.1.59
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-BKpYBhCq.mjs → awk2-LA3USKJP-COeIINTX.mjs} +2 -2
- package/dist/{awk2-LA3USKJP-BKpYBhCq.mjs.map → awk2-LA3USKJP-COeIINTX.mjs.map} +1 -1
- package/dist/{awk2-LA3USKJP-B-FrhBQ1.cjs → awk2-LA3USKJP-EiXwpEAu.cjs} +2 -2
- package/dist/{awk2-LA3USKJP-B-FrhBQ1.cjs.map → awk2-LA3USKJP-EiXwpEAu.cjs.map} +1 -1
- package/dist/{base64-C2AIWVNC-B03A3RGy.mjs → base64-C2AIWVNC-BAxca331.mjs} +2 -2
- package/dist/{base64-C2AIWVNC-B03A3RGy.mjs.map → base64-C2AIWVNC-BAxca331.mjs.map} +1 -1
- package/dist/{base64-C2AIWVNC-DzvAs4Pp.cjs → base64-C2AIWVNC-DgZJ2v_J.cjs} +2 -2
- package/dist/{base64-C2AIWVNC-DzvAs4Pp.cjs.map → base64-C2AIWVNC-DgZJ2v_J.cjs.map} +1 -1
- package/dist/{bash-YZ33HQZQ-DB2_t12O.cjs → bash-YZ33HQZQ-BP90pBnK.cjs} +2 -2
- package/dist/{bash-YZ33HQZQ-DB2_t12O.cjs.map → bash-YZ33HQZQ-BP90pBnK.cjs.map} +1 -1
- package/dist/{bash-YZ33HQZQ-BXIQsuYx.mjs → bash-YZ33HQZQ-N0zD0_4M.mjs} +2 -2
- package/dist/{bash-YZ33HQZQ-BXIQsuYx.mjs.map → bash-YZ33HQZQ-N0zD0_4M.mjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-_P4t1grN.mjs → cat-TSFMZVYS-B2pEgqfx.mjs} +3 -3
- package/dist/{cat-TSFMZVYS-_P4t1grN.mjs.map → cat-TSFMZVYS-B2pEgqfx.mjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-D31-RFvn.cjs → cat-TSFMZVYS-DSSGhDJS.cjs} +3 -3
- package/dist/{cat-TSFMZVYS-D31-RFvn.cjs.map → cat-TSFMZVYS-DSSGhDJS.cjs.map} +1 -1
- package/dist/{chunk-5H5SCKJM-DdjolPqF.mjs → chunk-5H5SCKJM-BVVWDMF2.mjs} +2 -2
- package/dist/{chunk-5H5SCKJM-DdjolPqF.mjs.map → chunk-5H5SCKJM-BVVWDMF2.mjs.map} +1 -1
- package/dist/{chunk-5H5SCKJM-B9ad3eHF.cjs → chunk-5H5SCKJM-_V6YfuSY.cjs} +2 -2
- package/dist/{chunk-5H5SCKJM-B9ad3eHF.cjs.map → chunk-5H5SCKJM-_V6YfuSY.cjs.map} +1 -1
- package/dist/{chunk-AQ6FYS2X-BKET21tH.mjs → chunk-AQ6FYS2X-CKetsdk7.mjs} +2 -2
- package/dist/{chunk-AQ6FYS2X-BKET21tH.mjs.map → chunk-AQ6FYS2X-CKetsdk7.mjs.map} +1 -1
- package/dist/{chunk-AQ6FYS2X-CHxBlTzA.cjs → chunk-AQ6FYS2X-DesMK8CT.cjs} +2 -2
- package/dist/{chunk-AQ6FYS2X-CHxBlTzA.cjs.map → chunk-AQ6FYS2X-DesMK8CT.cjs.map} +1 -1
- package/dist/{chunk-CHFEPBH4-DmQjuPli.cjs → chunk-CHFEPBH4-BqKf7cQB.cjs} +2 -2
- package/dist/{chunk-CHFEPBH4-DmQjuPli.cjs.map → chunk-CHFEPBH4-BqKf7cQB.cjs.map} +1 -1
- package/dist/{chunk-CHFEPBH4-DnGhauKV.mjs → chunk-CHFEPBH4-DDPnnCtx.mjs} +2 -2
- package/dist/{chunk-CHFEPBH4-DnGhauKV.mjs.map → chunk-CHFEPBH4-DDPnnCtx.mjs.map} +1 -1
- package/dist/{chunk-EBAPSGAO-BWVkR9nM.mjs → chunk-EBAPSGAO-CREYfHcA.mjs} +2 -2
- package/dist/{chunk-EBAPSGAO-BWVkR9nM.mjs.map → chunk-EBAPSGAO-CREYfHcA.mjs.map} +1 -1
- package/dist/{chunk-EBAPSGAO-Vy3lQ5QN.cjs → chunk-EBAPSGAO-DIFjYqdk.cjs} +2 -2
- package/dist/{chunk-EBAPSGAO-Vy3lQ5QN.cjs.map → chunk-EBAPSGAO-DIFjYqdk.cjs.map} +1 -1
- package/dist/{chunk-LEKBROJD-1f8bgJeH.cjs → chunk-LEKBROJD-Bs9jE3g_.cjs} +2 -2
- package/dist/{chunk-LEKBROJD-1f8bgJeH.cjs.map → chunk-LEKBROJD-Bs9jE3g_.cjs.map} +1 -1
- package/dist/{chunk-LEKBROJD-DGDeYgVW.mjs → chunk-LEKBROJD-CgWnvhcS.mjs} +2 -2
- package/dist/{chunk-LEKBROJD-DGDeYgVW.mjs.map → chunk-LEKBROJD-CgWnvhcS.mjs.map} +1 -1
- package/dist/{chunk-VPADYNBD-CTiaSkfK.mjs → chunk-VPADYNBD-DZ8gQX_P.mjs} +2 -2
- package/dist/{chunk-VPADYNBD-CTiaSkfK.mjs.map → chunk-VPADYNBD-DZ8gQX_P.mjs.map} +1 -1
- package/dist/{chunk-VPADYNBD-DH78AK35.cjs → chunk-VPADYNBD-Dpngv0I6.cjs} +2 -2
- package/dist/{chunk-VPADYNBD-DH78AK35.cjs.map → chunk-VPADYNBD-Dpngv0I6.cjs.map} +1 -1
- package/dist/{chunk-YCLFEX4T-DgHe4Pi2.mjs → chunk-YCLFEX4T-A_2zCFCZ.mjs} +2 -2
- package/dist/{chunk-YCLFEX4T-DgHe4Pi2.mjs.map → chunk-YCLFEX4T-A_2zCFCZ.mjs.map} +1 -1
- package/dist/{chunk-YCLFEX4T-eUA_u8Qn.cjs → chunk-YCLFEX4T-Bv_XSqMl.cjs} +2 -2
- package/dist/{chunk-YCLFEX4T-eUA_u8Qn.cjs.map → chunk-YCLFEX4T-Bv_XSqMl.cjs.map} +1 -1
- package/dist/{column-XT6UFXNQ-D79lEaRW.cjs → column-XT6UFXNQ-DPi4gmqo.cjs} +2 -2
- package/dist/{column-XT6UFXNQ-D79lEaRW.cjs.map → column-XT6UFXNQ-DPi4gmqo.cjs.map} +1 -1
- package/dist/{column-XT6UFXNQ-DHEQS2GF.mjs → column-XT6UFXNQ-iPRSOasb.mjs} +2 -2
- package/dist/{column-XT6UFXNQ-DHEQS2GF.mjs.map → column-XT6UFXNQ-iPRSOasb.mjs.map} +1 -1
- package/dist/{comm-VV2LDX2J-CGTT44MW.cjs → comm-VV2LDX2J-CvMsuXP7.cjs} +2 -2
- package/dist/{comm-VV2LDX2J-CGTT44MW.cjs.map → comm-VV2LDX2J-CvMsuXP7.cjs.map} +1 -1
- package/dist/{comm-VV2LDX2J-DXysDls5.mjs → comm-VV2LDX2J-kD1sglqu.mjs} +2 -2
- package/dist/{comm-VV2LDX2J-DXysDls5.mjs.map → comm-VV2LDX2J-kD1sglqu.mjs.map} +1 -1
- package/dist/{config-Cag8eQBs.d.cts → config-D0P7vutz.d.cts} +3 -3
- package/dist/{config-BNc4kGsi.d.mts → config-DUP9VbSy.d.mts} +3 -3
- package/dist/config.cjs +4 -3
- 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 +2 -1
- package/dist/config.mjs.map +1 -1
- package/dist/{cp-BISAAS7A-DOes4Hvy.mjs → cp-BISAAS7A-CFaBUCS_.mjs} +2 -2
- package/dist/{cp-BISAAS7A-DOes4Hvy.mjs.map → cp-BISAAS7A-CFaBUCS_.mjs.map} +1 -1
- package/dist/{cp-BISAAS7A-D5jsC_Ja.cjs → cp-BISAAS7A-DV-khTq3.cjs} +2 -2
- package/dist/{cp-BISAAS7A-D5jsC_Ja.cjs.map → cp-BISAAS7A-DV-khTq3.cjs.map} +1 -1
- package/dist/{cut-OKARJCCV-BYu5BKVF.cjs → cut-OKARJCCV-Cya3If_4.cjs} +3 -3
- package/dist/{cut-OKARJCCV-BYu5BKVF.cjs.map → cut-OKARJCCV-Cya3If_4.cjs.map} +1 -1
- package/dist/{cut-OKARJCCV-CWQykrKH.mjs → cut-OKARJCCV-Db-5eS9I.mjs} +3 -3
- package/dist/{cut-OKARJCCV-CWQykrKH.mjs.map → cut-OKARJCCV-Db-5eS9I.mjs.map} +1 -1
- package/dist/{diff-MWJFIG7X-5bs9LJjA.cjs → diff-MWJFIG7X-Cb2UPg-x.cjs} +2 -2
- package/dist/{diff-MWJFIG7X-5bs9LJjA.cjs.map → diff-MWJFIG7X-Cb2UPg-x.cjs.map} +1 -1
- package/dist/{diff-MWJFIG7X-WDZxzXoa.mjs → diff-MWJFIG7X-DQIdBSfs.mjs} +2 -2
- package/dist/{diff-MWJFIG7X-WDZxzXoa.mjs.map → diff-MWJFIG7X-DQIdBSfs.mjs.map} +1 -1
- package/dist/dist-D9Dtsxze.cjs +7991 -0
- package/dist/dist-D9Dtsxze.cjs.map +1 -0
- package/dist/{dist-B4jpVn62.cjs → dist-F6d9RAsW.cjs} +234 -8148
- package/dist/dist-F6d9RAsW.cjs.map +1 -0
- package/dist/{dist-CFKAFYn8.mjs → dist-n3wzpgC3.mjs} +67 -7949
- package/dist/dist-n3wzpgC3.mjs.map +1 -0
- package/dist/dist-xE6TWIG_.mjs +7926 -0
- package/dist/dist-xE6TWIG_.mjs.map +1 -0
- package/dist/{du-572XNP42-B6fFobEW.cjs → du-572XNP42-CHilb3Um.cjs} +2 -2
- package/dist/{du-572XNP42-B6fFobEW.cjs.map → du-572XNP42-CHilb3Um.cjs.map} +1 -1
- package/dist/{du-572XNP42-DQdhgiDu.mjs → du-572XNP42-DgMHEwz0.mjs} +2 -2
- package/dist/{du-572XNP42-DQdhgiDu.mjs.map → du-572XNP42-DgMHEwz0.mjs.map} +1 -1
- package/dist/{env-36M5BO7M-8lRqqbej.mjs → env-36M5BO7M-B5Y2xF7k.mjs} +2 -2
- package/dist/{env-36M5BO7M-8lRqqbej.mjs.map → env-36M5BO7M-B5Y2xF7k.mjs.map} +1 -1
- package/dist/{env-36M5BO7M-BGZ_rxhn.cjs → env-36M5BO7M-BwsU4q72.cjs} +2 -2
- package/dist/{env-36M5BO7M-BGZ_rxhn.cjs.map → env-36M5BO7M-BwsU4q72.cjs.map} +1 -1
- package/dist/{expand-JSPG6VOP-ttcSq3Mp.mjs → expand-JSPG6VOP-BFcwehai.mjs} +2 -2
- package/dist/{expand-JSPG6VOP-ttcSq3Mp.mjs.map → expand-JSPG6VOP-BFcwehai.mjs.map} +1 -1
- package/dist/{expand-JSPG6VOP-DXrRwA0x.cjs → expand-JSPG6VOP-Bp7vf3Gr.cjs} +2 -2
- package/dist/{expand-JSPG6VOP-DXrRwA0x.cjs.map → expand-JSPG6VOP-Bp7vf3Gr.cjs.map} +1 -1
- package/dist/{expr-5JAACS4X-D9wogLfS.mjs → expr-5JAACS4X-DenrreBF.mjs} +2 -2
- package/dist/{expr-5JAACS4X-D9wogLfS.mjs.map → expr-5JAACS4X-DenrreBF.mjs.map} +1 -1
- package/dist/{expr-5JAACS4X-DH_22zQv.cjs → expr-5JAACS4X-YvElPb9i.cjs} +2 -2
- package/dist/{expr-5JAACS4X-DH_22zQv.cjs.map → expr-5JAACS4X-YvElPb9i.cjs.map} +1 -1
- package/dist/{find-INTH3OLC-DpnElQT3.cjs → find-INTH3OLC-B2XFsSzh.cjs} +3 -3
- package/dist/{find-INTH3OLC-DpnElQT3.cjs.map → find-INTH3OLC-B2XFsSzh.cjs.map} +1 -1
- package/dist/{find-INTH3OLC-aFwVFFAB.mjs → find-INTH3OLC-aEynORdR.mjs} +3 -3
- package/dist/{find-INTH3OLC-aFwVFFAB.mjs.map → find-INTH3OLC-aEynORdR.mjs.map} +1 -1
- package/dist/{fold-4TQNYMSW-DZ55VvYj.mjs → fold-4TQNYMSW-B5h-AMVx.mjs} +2 -2
- package/dist/{fold-4TQNYMSW-DZ55VvYj.mjs.map → fold-4TQNYMSW-B5h-AMVx.mjs.map} +1 -1
- package/dist/{fold-4TQNYMSW-BhPIukTe.cjs → fold-4TQNYMSW-golZ77tb.cjs} +2 -2
- package/dist/{fold-4TQNYMSW-BhPIukTe.cjs.map → fold-4TQNYMSW-golZ77tb.cjs.map} +1 -1
- package/dist/{grep-V3LQVMRQ-BKuD8_-n.mjs → grep-V3LQVMRQ-CAog-whs.mjs} +4 -4
- package/dist/{grep-V3LQVMRQ-BKuD8_-n.mjs.map → grep-V3LQVMRQ-CAog-whs.mjs.map} +1 -1
- package/dist/{grep-V3LQVMRQ-CAxqwuZO.cjs → grep-V3LQVMRQ-DCZEJA6l.cjs} +4 -4
- package/dist/{grep-V3LQVMRQ-CAxqwuZO.cjs.map → grep-V3LQVMRQ-DCZEJA6l.cjs.map} +1 -1
- package/dist/{gzip-O5ASJAFY-CV-D3pVh.mjs → gzip-O5ASJAFY-BBGQgiu9.mjs} +2 -2
- package/dist/{gzip-O5ASJAFY-CV-D3pVh.mjs.map → gzip-O5ASJAFY-BBGQgiu9.mjs.map} +1 -1
- package/dist/{gzip-O5ASJAFY-DzFAjkUi.cjs → gzip-O5ASJAFY-_cqZbTVt.cjs} +2 -2
- package/dist/{gzip-O5ASJAFY-DzFAjkUi.cjs.map → gzip-O5ASJAFY-_cqZbTVt.cjs.map} +1 -1
- package/dist/{head-442HYESI-Ch7PCV9u.mjs → head-442HYESI-CUW1cJCn.mjs} +2 -2
- package/dist/{head-442HYESI-Ch7PCV9u.mjs.map → head-442HYESI-CUW1cJCn.mjs.map} +1 -1
- package/dist/{head-442HYESI-DBgu0rxy.cjs → head-442HYESI-CWNiHfdm.cjs} +2 -2
- package/dist/{head-442HYESI-DBgu0rxy.cjs.map → head-442HYESI-CWNiHfdm.cjs.map} +1 -1
- package/dist/{help-HZ6M2CKN-DbsB_kKH.mjs → help-HZ6M2CKN-BIWGeuQS.mjs} +2 -2
- package/dist/{help-HZ6M2CKN-DbsB_kKH.mjs.map → help-HZ6M2CKN-BIWGeuQS.mjs.map} +1 -1
- package/dist/{help-HZ6M2CKN-D4id4lQj.cjs → help-HZ6M2CKN-C0TB6hHz.cjs} +2 -2
- package/dist/{help-HZ6M2CKN-D4id4lQj.cjs.map → help-HZ6M2CKN-C0TB6hHz.cjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-DP2L09BX.mjs → html-to-markdown-JW4MSQZO-CgthY8Q9.mjs} +3 -3
- package/dist/{html-to-markdown-JW4MSQZO-DP2L09BX.mjs.map → html-to-markdown-JW4MSQZO-CgthY8Q9.mjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-DRRXghB2.cjs → html-to-markdown-JW4MSQZO-S08U6O6w.cjs} +3 -3
- package/dist/{html-to-markdown-JW4MSQZO-DRRXghB2.cjs.map → html-to-markdown-JW4MSQZO-S08U6O6w.cjs.map} +1 -1
- package/dist/internal.cjs +2 -1
- package/dist/internal.d.cts +10 -1
- package/dist/internal.d.mts +10 -1
- package/dist/internal.mjs +2 -2
- package/dist/{join-TBRGI3LQ-Dcylcfrm.cjs → join-TBRGI3LQ-BMhB7arN.cjs} +2 -2
- package/dist/{join-TBRGI3LQ-Dcylcfrm.cjs.map → join-TBRGI3LQ-BMhB7arN.cjs.map} +1 -1
- package/dist/{join-TBRGI3LQ-B8IO8JE_.mjs → join-TBRGI3LQ-C9n88HlW.mjs} +2 -2
- package/dist/{join-TBRGI3LQ-B8IO8JE_.mjs.map → join-TBRGI3LQ-C9n88HlW.mjs.map} +1 -1
- package/dist/{jq-4XLYLOS5-CLIHFVFj.mjs → jq-4XLYLOS5-CK8Z9vQm.mjs} +4 -4
- package/dist/{jq-4XLYLOS5-CLIHFVFj.mjs.map → jq-4XLYLOS5-CK8Z9vQm.mjs.map} +1 -1
- package/dist/{jq-4XLYLOS5-B_XqkngJ.cjs → jq-4XLYLOS5-DgAyQA8F.cjs} +4 -4
- package/dist/{jq-4XLYLOS5-B_XqkngJ.cjs.map → jq-4XLYLOS5-DgAyQA8F.cjs.map} +1 -1
- package/dist/{js-exec-N5KEZBH7-CgXIs_Pr.mjs → js-exec-N5KEZBH7--CJAf2PU.mjs} +4 -4
- package/dist/{js-exec-N5KEZBH7-CgXIs_Pr.mjs.map → js-exec-N5KEZBH7--CJAf2PU.mjs.map} +1 -1
- package/dist/{js-exec-N5KEZBH7-Brko8dVy.cjs → js-exec-N5KEZBH7-BvZ482TM.cjs} +4 -4
- package/dist/{js-exec-N5KEZBH7-Brko8dVy.cjs.map → js-exec-N5KEZBH7-BvZ482TM.cjs.map} +1 -1
- package/dist/{lib-Cqerwy2i.cjs → lib-CebrcHyc.cjs} +2 -2
- package/dist/{lib-Cqerwy2i.cjs.map → lib-CebrcHyc.cjs.map} +1 -1
- package/dist/{lib-A_imGqAQ.mjs → lib-QX0XVsFw.mjs} +2 -2
- package/dist/{lib-A_imGqAQ.mjs.map → lib-QX0XVsFw.mjs.map} +1 -1
- package/dist/{ln-4LGSXXGD-DfnyRHs0.cjs → ln-4LGSXXGD-CVHG-LHe.cjs} +2 -2
- package/dist/{ln-4LGSXXGD-DfnyRHs0.cjs.map → ln-4LGSXXGD-CVHG-LHe.cjs.map} +1 -1
- package/dist/{ln-4LGSXXGD-BYt_Jm67.mjs → ln-4LGSXXGD-Cg1BaXAY.mjs} +2 -2
- package/dist/{ln-4LGSXXGD-BYt_Jm67.mjs.map → ln-4LGSXXGD-Cg1BaXAY.mjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-qsnDp7Cd.mjs → ls-ZJGQER7M-D-5XVT_t.mjs} +2 -2
- package/dist/{ls-ZJGQER7M-qsnDp7Cd.mjs.map → ls-ZJGQER7M-D-5XVT_t.mjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-BaDncpr_.cjs → ls-ZJGQER7M-G_rXnMxc.cjs} +2 -2
- package/dist/{ls-ZJGQER7M-BaDncpr_.cjs.map → ls-ZJGQER7M-G_rXnMxc.cjs.map} +1 -1
- package/dist/{lzma-BGvGj1-O.cjs → lzma-DCZImIjr.cjs} +2 -2
- package/dist/{lzma-BGvGj1-O.cjs.map → lzma-DCZImIjr.cjs.map} +1 -1
- package/dist/{md5sum-SPU24VSG-dMIUV5CQ.mjs → md5sum-SPU24VSG-BoM3CJhj.mjs} +3 -3
- package/dist/{md5sum-SPU24VSG-dMIUV5CQ.mjs.map → md5sum-SPU24VSG-BoM3CJhj.mjs.map} +1 -1
- package/dist/{md5sum-SPU24VSG-PRoX8J93.cjs → md5sum-SPU24VSG-DJc6P_zh.cjs} +3 -3
- package/dist/{md5sum-SPU24VSG-PRoX8J93.cjs.map → md5sum-SPU24VSG-DJc6P_zh.cjs.map} +1 -1
- package/dist/{mkdir-MEPGZOB6-DPsM58SX.mjs → mkdir-MEPGZOB6-D5wyeAZU.mjs} +2 -2
- package/dist/{mkdir-MEPGZOB6-DPsM58SX.mjs.map → mkdir-MEPGZOB6-D5wyeAZU.mjs.map} +1 -1
- package/dist/{mkdir-MEPGZOB6-Cz_m28ZY.cjs → mkdir-MEPGZOB6-RJ9PodCk.cjs} +2 -2
- package/dist/{mkdir-MEPGZOB6-Cz_m28ZY.cjs.map → mkdir-MEPGZOB6-RJ9PodCk.cjs.map} +1 -1
- package/dist/{mv-W5BIQ646-Br51zxas.mjs → mv-W5BIQ646-1-b5c58P.mjs} +2 -2
- package/dist/{mv-W5BIQ646-Br51zxas.mjs.map → mv-W5BIQ646-1-b5c58P.mjs.map} +1 -1
- package/dist/{mv-W5BIQ646-B5xNiEmL.cjs → mv-W5BIQ646-DHf6gcf5.cjs} +2 -2
- package/dist/{mv-W5BIQ646-B5xNiEmL.cjs.map → mv-W5BIQ646-DHf6gcf5.cjs.map} +1 -1
- package/dist/{nl-WSDW7I4O-DC2kRPJz.mjs → nl-WSDW7I4O-5BJZqLHX.mjs} +2 -2
- package/dist/{nl-WSDW7I4O-DC2kRPJz.mjs.map → nl-WSDW7I4O-5BJZqLHX.mjs.map} +1 -1
- package/dist/{nl-WSDW7I4O-BKdvn50C.cjs → nl-WSDW7I4O-CGiBG5hY.cjs} +2 -2
- package/dist/{nl-WSDW7I4O-BKdvn50C.cjs.map → nl-WSDW7I4O-CGiBG5hY.cjs.map} +1 -1
- package/dist/{od-WOKFDJTP-WHD7o2Sj.mjs → od-WOKFDJTP-7FoQYKIp.mjs} +2 -2
- package/dist/{od-WOKFDJTP-WHD7o2Sj.mjs.map → od-WOKFDJTP-7FoQYKIp.mjs.map} +1 -1
- package/dist/{od-WOKFDJTP-BV4wg7WM.cjs → od-WOKFDJTP-DnbYyXMK.cjs} +2 -2
- package/dist/{od-WOKFDJTP-BV4wg7WM.cjs.map → od-WOKFDJTP-DnbYyXMK.cjs.map} +1 -1
- package/dist/{paste-7JC6S4DX-Ub9H7JaO.cjs → paste-7JC6S4DX-Baf-TyfK.cjs} +2 -2
- package/dist/{paste-7JC6S4DX-Ub9H7JaO.cjs.map → paste-7JC6S4DX-Baf-TyfK.cjs.map} +1 -1
- package/dist/{paste-7JC6S4DX-CdJj-cJI.mjs → paste-7JC6S4DX-iCiRRowi.mjs} +2 -2
- package/dist/{paste-7JC6S4DX-CdJj-cJI.mjs.map → paste-7JC6S4DX-iCiRRowi.mjs.map} +1 -1
- package/dist/{printf-TWGXF445-cMCHS5Pl.cjs → printf-TWGXF445-2W-UkWB9.cjs} +3 -3
- package/dist/{printf-TWGXF445-cMCHS5Pl.cjs.map → printf-TWGXF445-2W-UkWB9.cjs.map} +1 -1
- package/dist/{printf-TWGXF445-CFdLOO7W.mjs → printf-TWGXF445-C4XURAFD.mjs} +3 -3
- package/dist/{printf-TWGXF445-CFdLOO7W.mjs.map → printf-TWGXF445-C4XURAFD.mjs.map} +1 -1
- package/dist/{python3-POMOR4OA-5ooXQ2zU.cjs → python3-POMOR4OA-CE8T2OSD.cjs} +3 -3
- package/dist/{python3-POMOR4OA-5ooXQ2zU.cjs.map → python3-POMOR4OA-CE8T2OSD.cjs.map} +1 -1
- package/dist/{python3-POMOR4OA-NwucWAHw.mjs → python3-POMOR4OA-amB0VBNE.mjs} +3 -3
- package/dist/{python3-POMOR4OA-NwucWAHw.mjs.map → python3-POMOR4OA-amB0VBNE.mjs.map} +1 -1
- package/dist/{rev-5EHFX4EJ-hwUj0q3P.mjs → rev-5EHFX4EJ-6revLkqi.mjs} +2 -2
- package/dist/{rev-5EHFX4EJ-hwUj0q3P.mjs.map → rev-5EHFX4EJ-6revLkqi.mjs.map} +1 -1
- package/dist/{rev-5EHFX4EJ-CwkYMyBV.cjs → rev-5EHFX4EJ-IeLStYKe.cjs} +2 -2
- package/dist/{rev-5EHFX4EJ-CwkYMyBV.cjs.map → rev-5EHFX4EJ-IeLStYKe.cjs.map} +1 -1
- package/dist/{rg-S4FXYXWB-CYYTczwS.mjs → rg-S4FXYXWB-BU09MYZd.mjs} +3 -3
- package/dist/{rg-S4FXYXWB-CYYTczwS.mjs.map → rg-S4FXYXWB-BU09MYZd.mjs.map} +1 -1
- package/dist/{rg-S4FXYXWB-BG3g_KJu.cjs → rg-S4FXYXWB-DjNm1dTd.cjs} +3 -3
- package/dist/{rg-S4FXYXWB-BG3g_KJu.cjs.map → rg-S4FXYXWB-DjNm1dTd.cjs.map} +1 -1
- package/dist/{rm-SSGETQVQ-dEV4Y3ni.mjs → rm-SSGETQVQ-CMfZGpP7.mjs} +2 -2
- package/dist/{rm-SSGETQVQ-dEV4Y3ni.mjs.map → rm-SSGETQVQ-CMfZGpP7.mjs.map} +1 -1
- package/dist/{rm-SSGETQVQ-CTu2eV97.cjs → rm-SSGETQVQ-CNhakQtS.cjs} +2 -2
- package/dist/{rm-SSGETQVQ-CTu2eV97.cjs.map → rm-SSGETQVQ-CNhakQtS.cjs.map} +1 -1
- package/dist/{rmdir-OC4ZLPYA-Dg-oze5t.cjs → rmdir-OC4ZLPYA-BnttX2D-.cjs} +2 -2
- package/dist/{rmdir-OC4ZLPYA-Dg-oze5t.cjs.map → rmdir-OC4ZLPYA-BnttX2D-.cjs.map} +1 -1
- package/dist/{rmdir-OC4ZLPYA-DCHxah99.mjs → rmdir-OC4ZLPYA-t2j-2qTf.mjs} +2 -2
- package/dist/{rmdir-OC4ZLPYA-DCHxah99.mjs.map → rmdir-OC4ZLPYA-t2j-2qTf.mjs.map} +1 -1
- package/dist/run.cjs +1 -1
- package/dist/run.mjs +1 -1
- package/dist/{sed-S5UIK574-CwxPWXOK.mjs → sed-S5UIK574-Da376UD_.mjs} +2 -2
- package/dist/{sed-S5UIK574-CwxPWXOK.mjs.map → sed-S5UIK574-Da376UD_.mjs.map} +1 -1
- package/dist/{sed-S5UIK574-CsHy53JY.cjs → sed-S5UIK574-R0AllmY5.cjs} +2 -2
- package/dist/{sed-S5UIK574-CsHy53JY.cjs.map → sed-S5UIK574-R0AllmY5.cjs.map} +1 -1
- package/dist/{sha1sum-2PTOAFR6-BiGcLll7.cjs → sha1sum-2PTOAFR6-Cb87rznZ.cjs} +3 -3
- package/dist/{sha1sum-2PTOAFR6-BiGcLll7.cjs.map → sha1sum-2PTOAFR6-Cb87rznZ.cjs.map} +1 -1
- package/dist/{sha1sum-2PTOAFR6-DGJWinX9.mjs → sha1sum-2PTOAFR6-CsCx87rr.mjs} +3 -3
- package/dist/{sha1sum-2PTOAFR6-DGJWinX9.mjs.map → sha1sum-2PTOAFR6-CsCx87rr.mjs.map} +1 -1
- package/dist/{sha256sum-NS7D3IXX-DELyNXeL.mjs → sha256sum-NS7D3IXX-ClcqLXpk.mjs} +3 -3
- package/dist/{sha256sum-NS7D3IXX-DELyNXeL.mjs.map → sha256sum-NS7D3IXX-ClcqLXpk.mjs.map} +1 -1
- package/dist/{sha256sum-NS7D3IXX-ByJJnbYS.cjs → sha256sum-NS7D3IXX-eI_HTXFT.cjs} +3 -3
- package/dist/{sha256sum-NS7D3IXX-ByJJnbYS.cjs.map → sha256sum-NS7D3IXX-eI_HTXFT.cjs.map} +1 -1
- package/dist/{sleep-X22JJINO-DhLUU2PM.mjs → sleep-X22JJINO-BetuZXZ0.mjs} +2 -2
- package/dist/{sleep-X22JJINO-DhLUU2PM.mjs.map → sleep-X22JJINO-BetuZXZ0.mjs.map} +1 -1
- package/dist/{sleep-X22JJINO-CvnSRv60.cjs → sleep-X22JJINO-DMZ_ZWjc.cjs} +2 -2
- package/dist/{sleep-X22JJINO-CvnSRv60.cjs.map → sleep-X22JJINO-DMZ_ZWjc.cjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-Ddct_1Pz.mjs → sort-SW2YEO5B-DHY8HafY.mjs} +3 -3
- package/dist/{sort-SW2YEO5B-Ddct_1Pz.mjs.map → sort-SW2YEO5B-DHY8HafY.mjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-DGCFWtWG.cjs → sort-SW2YEO5B-DZ7UyOF0.cjs} +3 -3
- package/dist/{sort-SW2YEO5B-DGCFWtWG.cjs.map → sort-SW2YEO5B-DZ7UyOF0.cjs.map} +1 -1
- package/dist/{split-4KKZZXXE-BEJyVNsf.mjs → split-4KKZZXXE-Ci8BT8-z.mjs} +2 -2
- package/dist/{split-4KKZZXXE-BEJyVNsf.mjs.map → split-4KKZZXXE-Ci8BT8-z.mjs.map} +1 -1
- package/dist/{split-4KKZZXXE-ByLojKTe.cjs → split-4KKZZXXE-Dd-geAGj.cjs} +2 -2
- package/dist/{split-4KKZZXXE-ByLojKTe.cjs.map → split-4KKZZXXE-Dd-geAGj.cjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-DQRqib0Z.cjs → sqlite3-CGOEFJAO-DihhT2Kw.cjs} +3 -3
- package/dist/{sqlite3-CGOEFJAO-DQRqib0Z.cjs.map → sqlite3-CGOEFJAO-DihhT2Kw.cjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-gHSY7dKq.mjs → sqlite3-CGOEFJAO-HUn9a6wW.mjs} +3 -3
- package/dist/{sqlite3-CGOEFJAO-gHSY7dKq.mjs.map → sqlite3-CGOEFJAO-HUn9a6wW.mjs.map} +1 -1
- package/dist/{start-Br3WcDhS.cjs → start-DV5tMkuC.cjs} +624 -526
- package/dist/{start-Br3WcDhS.cjs.map → start-DV5tMkuC.cjs.map} +1 -1
- package/dist/{start-CVrMV6Nm.mjs → start-MLNBN7iD.mjs} +197 -99
- package/dist/start-MLNBN7iD.mjs.map +1 -0
- package/dist/start.cjs +1 -1
- package/dist/start.d.cts +2 -2
- package/dist/start.d.mts +2 -2
- package/dist/start.mjs +1 -1
- package/dist/{strings-6WDHLGMX-BIHR-Oic.mjs → strings-6WDHLGMX-BaHk50QP.mjs} +2 -2
- package/dist/{strings-6WDHLGMX-BIHR-Oic.mjs.map → strings-6WDHLGMX-BaHk50QP.mjs.map} +1 -1
- package/dist/{strings-6WDHLGMX-WPAnQiM1.cjs → strings-6WDHLGMX-xO8shNFt.cjs} +2 -2
- package/dist/{strings-6WDHLGMX-WPAnQiM1.cjs.map → strings-6WDHLGMX-xO8shNFt.cjs.map} +1 -1
- package/dist/{tac-2STMMJYW-CvWfS99b.cjs → tac-2STMMJYW-CV76eEod.cjs} +2 -2
- package/dist/{tac-2STMMJYW-CvWfS99b.cjs.map → tac-2STMMJYW-CV76eEod.cjs.map} +1 -1
- package/dist/{tac-2STMMJYW-DN6xIAaj.mjs → tac-2STMMJYW-Ch-yVMJm.mjs} +2 -2
- package/dist/{tac-2STMMJYW-DN6xIAaj.mjs.map → tac-2STMMJYW-Ch-yVMJm.mjs.map} +1 -1
- package/dist/{tail-R4PCA2C4-DdF1DSLe.mjs → tail-R4PCA2C4-B3yEmx6J.mjs} +2 -2
- package/dist/{tail-R4PCA2C4-DdF1DSLe.mjs.map → tail-R4PCA2C4-B3yEmx6J.mjs.map} +1 -1
- package/dist/{tail-R4PCA2C4-CLtzcEHX.cjs → tail-R4PCA2C4-M7TfHc5A.cjs} +2 -2
- package/dist/{tail-R4PCA2C4-CLtzcEHX.cjs.map → tail-R4PCA2C4-M7TfHc5A.cjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-TZY6AcaY.cjs → tar-STHHZTZ6-C65UwZ-m.cjs} +5 -5
- package/dist/{tar-STHHZTZ6-TZY6AcaY.cjs.map → tar-STHHZTZ6-C65UwZ-m.cjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-DCcIG6Cv.mjs → tar-STHHZTZ6-Cqi-mYPI.mjs} +4 -4
- package/dist/{tar-STHHZTZ6-DCcIG6Cv.mjs.map → tar-STHHZTZ6-Cqi-mYPI.mjs.map} +1 -1
- package/dist/{tee-YUZ2FKCJ-B9ev06k9.cjs → tee-YUZ2FKCJ-CxXiyU8f.cjs} +2 -2
- package/dist/{tee-YUZ2FKCJ-B9ev06k9.cjs.map → tee-YUZ2FKCJ-CxXiyU8f.cjs.map} +1 -1
- package/dist/{tee-YUZ2FKCJ-BQC8HOFI.mjs → tee-YUZ2FKCJ-Dd4bK2cr.mjs} +2 -2
- package/dist/{tee-YUZ2FKCJ-BQC8HOFI.mjs.map → tee-YUZ2FKCJ-Dd4bK2cr.mjs.map} +1 -1
- package/dist/{time-D4LNBSWX-Cr1NZ3c8.cjs → time-D4LNBSWX-CIGSeHrc.cjs} +2 -2
- package/dist/{time-D4LNBSWX-Cr1NZ3c8.cjs.map → time-D4LNBSWX-CIGSeHrc.cjs.map} +1 -1
- package/dist/{time-D4LNBSWX-CYzen7kN.mjs → time-D4LNBSWX-DXQbAEcT.mjs} +2 -2
- package/dist/{time-D4LNBSWX-CYzen7kN.mjs.map → time-D4LNBSWX-DXQbAEcT.mjs.map} +1 -1
- package/dist/{timeout-YDCRSLPQ-ByvOqYSS.cjs → timeout-YDCRSLPQ-B1Au3y0U.cjs} +2 -2
- package/dist/{timeout-YDCRSLPQ-ByvOqYSS.cjs.map → timeout-YDCRSLPQ-B1Au3y0U.cjs.map} +1 -1
- package/dist/{timeout-YDCRSLPQ-C7CNkf1N.mjs → timeout-YDCRSLPQ-CB1HuEoO.mjs} +2 -2
- package/dist/{timeout-YDCRSLPQ-C7CNkf1N.mjs.map → timeout-YDCRSLPQ-CB1HuEoO.mjs.map} +1 -1
- package/dist/{touch-UA33VN3N-CmQHc2uV.cjs → touch-UA33VN3N-BI5b1z8B.cjs} +2 -2
- package/dist/{touch-UA33VN3N-CmQHc2uV.cjs.map → touch-UA33VN3N-BI5b1z8B.cjs.map} +1 -1
- package/dist/{touch-UA33VN3N--2WSdwPu.mjs → touch-UA33VN3N-lLlL75xu.mjs} +2 -2
- package/dist/{touch-UA33VN3N--2WSdwPu.mjs.map → touch-UA33VN3N-lLlL75xu.mjs.map} +1 -1
- package/dist/{tr-36LHWFRQ-0CbdJnRX.cjs → tr-36LHWFRQ-CHdDZtaG.cjs} +2 -2
- package/dist/{tr-36LHWFRQ-0CbdJnRX.cjs.map → tr-36LHWFRQ-CHdDZtaG.cjs.map} +1 -1
- package/dist/{tr-36LHWFRQ-BsmlOeIS.mjs → tr-36LHWFRQ-D9Cq56K4.mjs} +2 -2
- package/dist/{tr-36LHWFRQ-BsmlOeIS.mjs.map → tr-36LHWFRQ-D9Cq56K4.mjs.map} +1 -1
- package/dist/{tree-YLD52CNT-D4dMPqQt.mjs → tree-YLD52CNT-BN9bSe6p.mjs} +2 -2
- package/dist/{tree-YLD52CNT-D4dMPqQt.mjs.map → tree-YLD52CNT-BN9bSe6p.mjs.map} +1 -1
- package/dist/{tree-YLD52CNT-C4k8Skzj.cjs → tree-YLD52CNT-DXhn-rP6.cjs} +2 -2
- package/dist/{tree-YLD52CNT-C4k8Skzj.cjs.map → tree-YLD52CNT-DXhn-rP6.cjs.map} +1 -1
- package/dist/{unexpand-CADSA4VO-BsnuqR9R.mjs → unexpand-CADSA4VO-9zcEZRXf.mjs} +2 -2
- package/dist/{unexpand-CADSA4VO-BsnuqR9R.mjs.map → unexpand-CADSA4VO-9zcEZRXf.mjs.map} +1 -1
- package/dist/{unexpand-CADSA4VO-Cc3MKP3o.cjs → unexpand-CADSA4VO-BlHSZxo6.cjs} +2 -2
- package/dist/{unexpand-CADSA4VO-Cc3MKP3o.cjs.map → unexpand-CADSA4VO-BlHSZxo6.cjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-DOVYyWW1.mjs → uniq-XSIZR6PB-D7gp7Anb.mjs} +3 -3
- package/dist/{uniq-XSIZR6PB-DOVYyWW1.mjs.map → uniq-XSIZR6PB-D7gp7Anb.mjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-cdjEkS0S.cjs → uniq-XSIZR6PB-JNQs4drO.cjs} +3 -3
- package/dist/{uniq-XSIZR6PB-cdjEkS0S.cjs.map → uniq-XSIZR6PB-JNQs4drO.cjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-BdOBKH91.cjs → wc-LF7NU4LA-Bmz4Q8cg.cjs} +3 -3
- package/dist/{wc-LF7NU4LA-BdOBKH91.cjs.map → wc-LF7NU4LA-Bmz4Q8cg.cjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-DtGpuB_1.mjs → wc-LF7NU4LA-CQqwx__m.mjs} +3 -3
- package/dist/{wc-LF7NU4LA-DtGpuB_1.mjs.map → wc-LF7NU4LA-CQqwx__m.mjs.map} +1 -1
- package/dist/with-project-scope-C6387HzP.mjs +49 -0
- package/dist/with-project-scope-C6387HzP.mjs.map +1 -0
- package/dist/with-project-scope-C75VxS8M.cjs +66 -0
- package/dist/with-project-scope-C75VxS8M.cjs.map +1 -0
- package/dist/{xan-Y6WF3IRG-eg_sMEg7.cjs → xan-Y6WF3IRG-BFJXmEuw.cjs} +6 -6
- package/dist/{xan-Y6WF3IRG-eg_sMEg7.cjs.map → xan-Y6WF3IRG-BFJXmEuw.cjs.map} +1 -1
- package/dist/{xan-Y6WF3IRG-ZMwjkD4r.mjs → xan-Y6WF3IRG-Bh-MBcAz.mjs} +6 -6
- package/dist/{xan-Y6WF3IRG-ZMwjkD4r.mjs.map → xan-Y6WF3IRG-Bh-MBcAz.mjs.map} +1 -1
- package/dist/{xan-view-HDVKHFC2-DQ3JdJFx.cjs → xan-view-HDVKHFC2-Bzx4rK-d.cjs} +3 -3
- package/dist/{xan-view-HDVKHFC2-DQ3JdJFx.cjs.map → xan-view-HDVKHFC2-Bzx4rK-d.cjs.map} +1 -1
- package/dist/{xan-view-HDVKHFC2-DY4NVZrE.mjs → xan-view-HDVKHFC2-DBQz9k1L.mjs} +3 -3
- package/dist/{xan-view-HDVKHFC2-DY4NVZrE.mjs.map → xan-view-HDVKHFC2-DBQz9k1L.mjs.map} +1 -1
- package/dist/{xargs-MGZPH7AX-DkExQfH-.mjs → xargs-MGZPH7AX-BJThEzeV.mjs} +2 -2
- package/dist/{xargs-MGZPH7AX-DkExQfH-.mjs.map → xargs-MGZPH7AX-BJThEzeV.mjs.map} +1 -1
- package/dist/{xargs-MGZPH7AX-CDarFNjo.cjs → xargs-MGZPH7AX-h7a9gC9t.cjs} +2 -2
- package/dist/{xargs-MGZPH7AX-CDarFNjo.cjs.map → xargs-MGZPH7AX-h7a9gC9t.cjs.map} +1 -1
- package/dist/{yq-4QJW3EQG-Xxny992l.cjs → yq-4QJW3EQG-8c37KJef.cjs} +3 -3
- package/dist/{yq-4QJW3EQG-Xxny992l.cjs.map → yq-4QJW3EQG-8c37KJef.cjs.map} +1 -1
- package/dist/{yq-4QJW3EQG-CTS00zxI.mjs → yq-4QJW3EQG-C4U4Cp_b.mjs} +3 -3
- package/dist/{yq-4QJW3EQG-CTS00zxI.mjs.map → yq-4QJW3EQG-C4U4Cp_b.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/dist-B4jpVn62.cjs.map +0 -1
- package/dist/dist-CFKAFYn8.mjs.map +0 -1
- package/dist/start-CVrMV6Nm.mjs.map +0 -1
- package/dist/with-project-scope-Cz_Tmvau.cjs +0 -27
- package/dist/with-project-scope-Cz_Tmvau.cjs.map +0 -1
- package/dist/with-project-scope-DWwbN8Qs.mjs +0 -22
- package/dist/with-project-scope-DWwbN8Qs.mjs.map +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-D9Dtsxze.cjs");
|
|
2
|
+
const require_dist$1 = require("./dist-F6d9RAsW.cjs");
|
|
2
3
|
require("./chunk-BZUGFHVS-7RRM7Jpb.cjs");
|
|
3
4
|
const require_chunk_TN7HHBQW = require("./chunk-TN7HHBQW-D_SK6w5n.cjs");
|
|
4
|
-
const require_with_project_scope = require("./with-project-scope-
|
|
5
|
+
const require_with_project_scope = require("./with-project-scope-C75VxS8M.cjs");
|
|
6
|
+
let node_crypto = require("node:crypto");
|
|
5
7
|
require("node:fs/promises");
|
|
6
8
|
let _keystrokehq_database = require("@keystrokehq/database");
|
|
7
9
|
let zod = require("zod");
|
|
8
10
|
let node_async_hooks = require("node:async_hooks");
|
|
9
11
|
let _keystrokehq_platform_database = require("@keystrokehq/platform-database");
|
|
10
|
-
let node_crypto = require("node:crypto");
|
|
11
12
|
let node_fs = require("node:fs");
|
|
12
13
|
node_fs = require_dist.__toESM(node_fs, 1);
|
|
13
14
|
let node_path = require("node:path");
|
|
@@ -22873,43 +22874,43 @@ var tt = [
|
|
|
22873
22874
|
},
|
|
22874
22875
|
{
|
|
22875
22876
|
name: "cat",
|
|
22876
|
-
load: async () => (await Promise.resolve().then(() => require("./cat-TSFMZVYS-
|
|
22877
|
+
load: async () => (await Promise.resolve().then(() => require("./cat-TSFMZVYS-DSSGhDJS.cjs"))).catCommand
|
|
22877
22878
|
},
|
|
22878
22879
|
{
|
|
22879
22880
|
name: "printf",
|
|
22880
|
-
load: async () => (await Promise.resolve().then(() => require("./printf-TWGXF445-
|
|
22881
|
+
load: async () => (await Promise.resolve().then(() => require("./printf-TWGXF445-2W-UkWB9.cjs"))).printfCommand
|
|
22881
22882
|
},
|
|
22882
22883
|
{
|
|
22883
22884
|
name: "ls",
|
|
22884
|
-
load: async () => (await Promise.resolve().then(() => require("./ls-ZJGQER7M-
|
|
22885
|
+
load: async () => (await Promise.resolve().then(() => require("./ls-ZJGQER7M-G_rXnMxc.cjs"))).lsCommand
|
|
22885
22886
|
},
|
|
22886
22887
|
{
|
|
22887
22888
|
name: "mkdir",
|
|
22888
|
-
load: async () => (await Promise.resolve().then(() => require("./mkdir-MEPGZOB6-
|
|
22889
|
+
load: async () => (await Promise.resolve().then(() => require("./mkdir-MEPGZOB6-RJ9PodCk.cjs"))).mkdirCommand
|
|
22889
22890
|
},
|
|
22890
22891
|
{
|
|
22891
22892
|
name: "rmdir",
|
|
22892
|
-
load: async () => (await Promise.resolve().then(() => require("./rmdir-OC4ZLPYA-
|
|
22893
|
+
load: async () => (await Promise.resolve().then(() => require("./rmdir-OC4ZLPYA-BnttX2D-.cjs"))).rmdirCommand
|
|
22893
22894
|
},
|
|
22894
22895
|
{
|
|
22895
22896
|
name: "touch",
|
|
22896
|
-
load: async () => (await Promise.resolve().then(() => require("./touch-UA33VN3N-
|
|
22897
|
+
load: async () => (await Promise.resolve().then(() => require("./touch-UA33VN3N-BI5b1z8B.cjs"))).touchCommand
|
|
22897
22898
|
},
|
|
22898
22899
|
{
|
|
22899
22900
|
name: "rm",
|
|
22900
|
-
load: async () => (await Promise.resolve().then(() => require("./rm-SSGETQVQ-
|
|
22901
|
+
load: async () => (await Promise.resolve().then(() => require("./rm-SSGETQVQ-CNhakQtS.cjs"))).rmCommand
|
|
22901
22902
|
},
|
|
22902
22903
|
{
|
|
22903
22904
|
name: "cp",
|
|
22904
|
-
load: async () => (await Promise.resolve().then(() => require("./cp-BISAAS7A-
|
|
22905
|
+
load: async () => (await Promise.resolve().then(() => require("./cp-BISAAS7A-DV-khTq3.cjs"))).cpCommand
|
|
22905
22906
|
},
|
|
22906
22907
|
{
|
|
22907
22908
|
name: "mv",
|
|
22908
|
-
load: async () => (await Promise.resolve().then(() => require("./mv-W5BIQ646-
|
|
22909
|
+
load: async () => (await Promise.resolve().then(() => require("./mv-W5BIQ646-DHf6gcf5.cjs"))).mvCommand
|
|
22909
22910
|
},
|
|
22910
22911
|
{
|
|
22911
22912
|
name: "ln",
|
|
22912
|
-
load: async () => (await Promise.resolve().then(() => require("./ln-4LGSXXGD-
|
|
22913
|
+
load: async () => (await Promise.resolve().then(() => require("./ln-4LGSXXGD-CVHG-LHe.cjs"))).lnCommand
|
|
22913
22914
|
},
|
|
22914
22915
|
{
|
|
22915
22916
|
name: "chmod",
|
|
@@ -22925,15 +22926,15 @@ var tt = [
|
|
|
22925
22926
|
},
|
|
22926
22927
|
{
|
|
22927
22928
|
name: "head",
|
|
22928
|
-
load: async () => (await Promise.resolve().then(() => require("./head-442HYESI-
|
|
22929
|
+
load: async () => (await Promise.resolve().then(() => require("./head-442HYESI-CWNiHfdm.cjs"))).headCommand
|
|
22929
22930
|
},
|
|
22930
22931
|
{
|
|
22931
22932
|
name: "tail",
|
|
22932
|
-
load: async () => (await Promise.resolve().then(() => require("./tail-R4PCA2C4-
|
|
22933
|
+
load: async () => (await Promise.resolve().then(() => require("./tail-R4PCA2C4-M7TfHc5A.cjs"))).tailCommand
|
|
22933
22934
|
},
|
|
22934
22935
|
{
|
|
22935
22936
|
name: "wc",
|
|
22936
|
-
load: async () => (await Promise.resolve().then(() => require("./wc-LF7NU4LA-
|
|
22937
|
+
load: async () => (await Promise.resolve().then(() => require("./wc-LF7NU4LA-Bmz4Q8cg.cjs"))).wcCommand
|
|
22937
22938
|
},
|
|
22938
22939
|
{
|
|
22939
22940
|
name: "stat",
|
|
@@ -22941,95 +22942,95 @@ var tt = [
|
|
|
22941
22942
|
},
|
|
22942
22943
|
{
|
|
22943
22944
|
name: "grep",
|
|
22944
|
-
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-
|
|
22945
|
+
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-DCZEJA6l.cjs"))).grepCommand
|
|
22945
22946
|
},
|
|
22946
22947
|
{
|
|
22947
22948
|
name: "fgrep",
|
|
22948
|
-
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-
|
|
22949
|
+
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-DCZEJA6l.cjs"))).fgrepCommand
|
|
22949
22950
|
},
|
|
22950
22951
|
{
|
|
22951
22952
|
name: "egrep",
|
|
22952
|
-
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-
|
|
22953
|
+
load: async () => (await Promise.resolve().then(() => require("./grep-V3LQVMRQ-DCZEJA6l.cjs"))).egrepCommand
|
|
22953
22954
|
},
|
|
22954
22955
|
{
|
|
22955
22956
|
name: "rg",
|
|
22956
|
-
load: async () => (await Promise.resolve().then(() => require("./rg-S4FXYXWB-
|
|
22957
|
+
load: async () => (await Promise.resolve().then(() => require("./rg-S4FXYXWB-DjNm1dTd.cjs"))).rgCommand
|
|
22957
22958
|
},
|
|
22958
22959
|
{
|
|
22959
22960
|
name: "sed",
|
|
22960
|
-
load: async () => (await Promise.resolve().then(() => require("./sed-S5UIK574-
|
|
22961
|
+
load: async () => (await Promise.resolve().then(() => require("./sed-S5UIK574-R0AllmY5.cjs"))).sedCommand
|
|
22961
22962
|
},
|
|
22962
22963
|
{
|
|
22963
22964
|
name: "awk",
|
|
22964
|
-
load: async () => (await Promise.resolve().then(() => require("./awk2-LA3USKJP-
|
|
22965
|
+
load: async () => (await Promise.resolve().then(() => require("./awk2-LA3USKJP-EiXwpEAu.cjs"))).awkCommand2
|
|
22965
22966
|
},
|
|
22966
22967
|
{
|
|
22967
22968
|
name: "sort",
|
|
22968
|
-
load: async () => (await Promise.resolve().then(() => require("./sort-SW2YEO5B-
|
|
22969
|
+
load: async () => (await Promise.resolve().then(() => require("./sort-SW2YEO5B-DZ7UyOF0.cjs"))).sortCommand
|
|
22969
22970
|
},
|
|
22970
22971
|
{
|
|
22971
22972
|
name: "uniq",
|
|
22972
|
-
load: async () => (await Promise.resolve().then(() => require("./uniq-XSIZR6PB-
|
|
22973
|
+
load: async () => (await Promise.resolve().then(() => require("./uniq-XSIZR6PB-JNQs4drO.cjs"))).uniqCommand
|
|
22973
22974
|
},
|
|
22974
22975
|
{
|
|
22975
22976
|
name: "comm",
|
|
22976
|
-
load: async () => (await Promise.resolve().then(() => require("./comm-VV2LDX2J-
|
|
22977
|
+
load: async () => (await Promise.resolve().then(() => require("./comm-VV2LDX2J-CvMsuXP7.cjs"))).commCommand
|
|
22977
22978
|
},
|
|
22978
22979
|
{
|
|
22979
22980
|
name: "cut",
|
|
22980
|
-
load: async () => (await Promise.resolve().then(() => require("./cut-OKARJCCV-
|
|
22981
|
+
load: async () => (await Promise.resolve().then(() => require("./cut-OKARJCCV-Cya3If_4.cjs"))).cutCommand
|
|
22981
22982
|
},
|
|
22982
22983
|
{
|
|
22983
22984
|
name: "paste",
|
|
22984
|
-
load: async () => (await Promise.resolve().then(() => require("./paste-7JC6S4DX-
|
|
22985
|
+
load: async () => (await Promise.resolve().then(() => require("./paste-7JC6S4DX-Baf-TyfK.cjs"))).pasteCommand
|
|
22985
22986
|
},
|
|
22986
22987
|
{
|
|
22987
22988
|
name: "tr",
|
|
22988
|
-
load: async () => (await Promise.resolve().then(() => require("./tr-36LHWFRQ-
|
|
22989
|
+
load: async () => (await Promise.resolve().then(() => require("./tr-36LHWFRQ-CHdDZtaG.cjs"))).trCommand
|
|
22989
22990
|
},
|
|
22990
22991
|
{
|
|
22991
22992
|
name: "rev",
|
|
22992
|
-
load: async () => (await Promise.resolve().then(() => require("./rev-5EHFX4EJ-
|
|
22993
|
+
load: async () => (await Promise.resolve().then(() => require("./rev-5EHFX4EJ-IeLStYKe.cjs"))).rev
|
|
22993
22994
|
},
|
|
22994
22995
|
{
|
|
22995
22996
|
name: "nl",
|
|
22996
|
-
load: async () => (await Promise.resolve().then(() => require("./nl-WSDW7I4O-
|
|
22997
|
+
load: async () => (await Promise.resolve().then(() => require("./nl-WSDW7I4O-CGiBG5hY.cjs"))).nl
|
|
22997
22998
|
},
|
|
22998
22999
|
{
|
|
22999
23000
|
name: "fold",
|
|
23000
|
-
load: async () => (await Promise.resolve().then(() => require("./fold-4TQNYMSW-
|
|
23001
|
+
load: async () => (await Promise.resolve().then(() => require("./fold-4TQNYMSW-golZ77tb.cjs"))).fold
|
|
23001
23002
|
},
|
|
23002
23003
|
{
|
|
23003
23004
|
name: "expand",
|
|
23004
|
-
load: async () => (await Promise.resolve().then(() => require("./expand-JSPG6VOP-
|
|
23005
|
+
load: async () => (await Promise.resolve().then(() => require("./expand-JSPG6VOP-Bp7vf3Gr.cjs"))).expand
|
|
23005
23006
|
},
|
|
23006
23007
|
{
|
|
23007
23008
|
name: "unexpand",
|
|
23008
|
-
load: async () => (await Promise.resolve().then(() => require("./unexpand-CADSA4VO-
|
|
23009
|
+
load: async () => (await Promise.resolve().then(() => require("./unexpand-CADSA4VO-BlHSZxo6.cjs"))).unexpand
|
|
23009
23010
|
},
|
|
23010
23011
|
{
|
|
23011
23012
|
name: "strings",
|
|
23012
|
-
load: async () => (await Promise.resolve().then(() => require("./strings-6WDHLGMX-
|
|
23013
|
+
load: async () => (await Promise.resolve().then(() => require("./strings-6WDHLGMX-xO8shNFt.cjs"))).strings
|
|
23013
23014
|
},
|
|
23014
23015
|
{
|
|
23015
23016
|
name: "split",
|
|
23016
|
-
load: async () => (await Promise.resolve().then(() => require("./split-4KKZZXXE-
|
|
23017
|
+
load: async () => (await Promise.resolve().then(() => require("./split-4KKZZXXE-Dd-geAGj.cjs"))).split
|
|
23017
23018
|
},
|
|
23018
23019
|
{
|
|
23019
23020
|
name: "column",
|
|
23020
|
-
load: async () => (await Promise.resolve().then(() => require("./column-XT6UFXNQ-
|
|
23021
|
+
load: async () => (await Promise.resolve().then(() => require("./column-XT6UFXNQ-DPi4gmqo.cjs"))).column
|
|
23021
23022
|
},
|
|
23022
23023
|
{
|
|
23023
23024
|
name: "join",
|
|
23024
|
-
load: async () => (await Promise.resolve().then(() => require("./join-TBRGI3LQ-
|
|
23025
|
+
load: async () => (await Promise.resolve().then(() => require("./join-TBRGI3LQ-BMhB7arN.cjs"))).join
|
|
23025
23026
|
},
|
|
23026
23027
|
{
|
|
23027
23028
|
name: "tee",
|
|
23028
|
-
load: async () => (await Promise.resolve().then(() => require("./tee-YUZ2FKCJ-
|
|
23029
|
+
load: async () => (await Promise.resolve().then(() => require("./tee-YUZ2FKCJ-CxXiyU8f.cjs"))).teeCommand
|
|
23029
23030
|
},
|
|
23030
23031
|
{
|
|
23031
23032
|
name: "find",
|
|
23032
|
-
load: async () => (await Promise.resolve().then(() => require("./find-INTH3OLC-
|
|
23033
|
+
load: async () => (await Promise.resolve().then(() => require("./find-INTH3OLC-B2XFsSzh.cjs"))).findCommand
|
|
23033
23034
|
},
|
|
23034
23035
|
{
|
|
23035
23036
|
name: "basename",
|
|
@@ -23041,19 +23042,19 @@ var tt = [
|
|
|
23041
23042
|
},
|
|
23042
23043
|
{
|
|
23043
23044
|
name: "tree",
|
|
23044
|
-
load: async () => (await Promise.resolve().then(() => require("./tree-YLD52CNT-
|
|
23045
|
+
load: async () => (await Promise.resolve().then(() => require("./tree-YLD52CNT-DXhn-rP6.cjs"))).treeCommand
|
|
23045
23046
|
},
|
|
23046
23047
|
{
|
|
23047
23048
|
name: "du",
|
|
23048
|
-
load: async () => (await Promise.resolve().then(() => require("./du-572XNP42-
|
|
23049
|
+
load: async () => (await Promise.resolve().then(() => require("./du-572XNP42-CHilb3Um.cjs"))).duCommand
|
|
23049
23050
|
},
|
|
23050
23051
|
{
|
|
23051
23052
|
name: "env",
|
|
23052
|
-
load: async () => (await Promise.resolve().then(() => require("./env-36M5BO7M-
|
|
23053
|
+
load: async () => (await Promise.resolve().then(() => require("./env-36M5BO7M-BwsU4q72.cjs"))).envCommand
|
|
23053
23054
|
},
|
|
23054
23055
|
{
|
|
23055
23056
|
name: "printenv",
|
|
23056
|
-
load: async () => (await Promise.resolve().then(() => require("./env-36M5BO7M-
|
|
23057
|
+
load: async () => (await Promise.resolve().then(() => require("./env-36M5BO7M-BwsU4q72.cjs"))).printenvCommand
|
|
23057
23058
|
},
|
|
23058
23059
|
{
|
|
23059
23060
|
name: "alias",
|
|
@@ -23069,7 +23070,7 @@ var tt = [
|
|
|
23069
23070
|
},
|
|
23070
23071
|
{
|
|
23071
23072
|
name: "xargs",
|
|
23072
|
-
load: async () => (await Promise.resolve().then(() => require("./xargs-MGZPH7AX-
|
|
23073
|
+
load: async () => (await Promise.resolve().then(() => require("./xargs-MGZPH7AX-h7a9gC9t.cjs"))).xargsCommand
|
|
23073
23074
|
},
|
|
23074
23075
|
{
|
|
23075
23076
|
name: "true",
|
|
@@ -23085,23 +23086,23 @@ var tt = [
|
|
|
23085
23086
|
},
|
|
23086
23087
|
{
|
|
23087
23088
|
name: "bash",
|
|
23088
|
-
load: async () => (await Promise.resolve().then(() => require("./bash-YZ33HQZQ-
|
|
23089
|
+
load: async () => (await Promise.resolve().then(() => require("./bash-YZ33HQZQ-BP90pBnK.cjs"))).bashCommand
|
|
23089
23090
|
},
|
|
23090
23091
|
{
|
|
23091
23092
|
name: "sh",
|
|
23092
|
-
load: async () => (await Promise.resolve().then(() => require("./bash-YZ33HQZQ-
|
|
23093
|
+
load: async () => (await Promise.resolve().then(() => require("./bash-YZ33HQZQ-BP90pBnK.cjs"))).shCommand
|
|
23093
23094
|
},
|
|
23094
23095
|
{
|
|
23095
23096
|
name: "jq",
|
|
23096
|
-
load: async () => (await Promise.resolve().then(() => require("./jq-4XLYLOS5-
|
|
23097
|
+
load: async () => (await Promise.resolve().then(() => require("./jq-4XLYLOS5-DgAyQA8F.cjs"))).jqCommand
|
|
23097
23098
|
},
|
|
23098
23099
|
{
|
|
23099
23100
|
name: "base64",
|
|
23100
|
-
load: async () => (await Promise.resolve().then(() => require("./base64-C2AIWVNC-
|
|
23101
|
+
load: async () => (await Promise.resolve().then(() => require("./base64-C2AIWVNC-DgZJ2v_J.cjs"))).base64Command
|
|
23101
23102
|
},
|
|
23102
23103
|
{
|
|
23103
23104
|
name: "diff",
|
|
23104
|
-
load: async () => (await Promise.resolve().then(() => require("./diff-MWJFIG7X-
|
|
23105
|
+
load: async () => (await Promise.resolve().then(() => require("./diff-MWJFIG7X-Cb2UPg-x.cjs"))).diffCommand
|
|
23105
23106
|
},
|
|
23106
23107
|
{
|
|
23107
23108
|
name: "date",
|
|
@@ -23109,15 +23110,15 @@ var tt = [
|
|
|
23109
23110
|
},
|
|
23110
23111
|
{
|
|
23111
23112
|
name: "sleep",
|
|
23112
|
-
load: async () => (await Promise.resolve().then(() => require("./sleep-X22JJINO-
|
|
23113
|
+
load: async () => (await Promise.resolve().then(() => require("./sleep-X22JJINO-DMZ_ZWjc.cjs"))).sleepCommand
|
|
23113
23114
|
},
|
|
23114
23115
|
{
|
|
23115
23116
|
name: "timeout",
|
|
23116
|
-
load: async () => (await Promise.resolve().then(() => require("./timeout-YDCRSLPQ-
|
|
23117
|
+
load: async () => (await Promise.resolve().then(() => require("./timeout-YDCRSLPQ-B1Au3y0U.cjs"))).timeoutCommand
|
|
23117
23118
|
},
|
|
23118
23119
|
{
|
|
23119
23120
|
name: "time",
|
|
23120
|
-
load: async () => (await Promise.resolve().then(() => require("./time-D4LNBSWX-
|
|
23121
|
+
load: async () => (await Promise.resolve().then(() => require("./time-D4LNBSWX-CIGSeHrc.cjs"))).timeCommand
|
|
23121
23122
|
},
|
|
23122
23123
|
{
|
|
23123
23124
|
name: "seq",
|
|
@@ -23125,19 +23126,19 @@ var tt = [
|
|
|
23125
23126
|
},
|
|
23126
23127
|
{
|
|
23127
23128
|
name: "expr",
|
|
23128
|
-
load: async () => (await Promise.resolve().then(() => require("./expr-5JAACS4X-
|
|
23129
|
+
load: async () => (await Promise.resolve().then(() => require("./expr-5JAACS4X-YvElPb9i.cjs"))).exprCommand
|
|
23129
23130
|
},
|
|
23130
23131
|
{
|
|
23131
23132
|
name: "md5sum",
|
|
23132
|
-
load: async () => (await Promise.resolve().then(() => require("./md5sum-SPU24VSG-
|
|
23133
|
+
load: async () => (await Promise.resolve().then(() => require("./md5sum-SPU24VSG-DJc6P_zh.cjs"))).md5sumCommand
|
|
23133
23134
|
},
|
|
23134
23135
|
{
|
|
23135
23136
|
name: "sha1sum",
|
|
23136
|
-
load: async () => (await Promise.resolve().then(() => require("./sha1sum-2PTOAFR6-
|
|
23137
|
+
load: async () => (await Promise.resolve().then(() => require("./sha1sum-2PTOAFR6-Cb87rznZ.cjs"))).sha1sumCommand
|
|
23137
23138
|
},
|
|
23138
23139
|
{
|
|
23139
23140
|
name: "sha256sum",
|
|
23140
|
-
load: async () => (await Promise.resolve().then(() => require("./sha256sum-NS7D3IXX-
|
|
23141
|
+
load: async () => (await Promise.resolve().then(() => require("./sha256sum-NS7D3IXX-eI_HTXFT.cjs"))).sha256sumCommand
|
|
23141
23142
|
},
|
|
23142
23143
|
{
|
|
23143
23144
|
name: "file",
|
|
@@ -23145,11 +23146,11 @@ var tt = [
|
|
|
23145
23146
|
},
|
|
23146
23147
|
{
|
|
23147
23148
|
name: "html-to-markdown",
|
|
23148
|
-
load: async () => (await Promise.resolve().then(() => require("./html-to-markdown-JW4MSQZO-
|
|
23149
|
+
load: async () => (await Promise.resolve().then(() => require("./html-to-markdown-JW4MSQZO-S08U6O6w.cjs"))).htmlToMarkdownCommand
|
|
23149
23150
|
},
|
|
23150
23151
|
{
|
|
23151
23152
|
name: "help",
|
|
23152
|
-
load: async () => (await Promise.resolve().then(() => require("./help-HZ6M2CKN-
|
|
23153
|
+
load: async () => (await Promise.resolve().then(() => require("./help-HZ6M2CKN-C0TB6hHz.cjs"))).helpCommand
|
|
23153
23154
|
},
|
|
23154
23155
|
{
|
|
23155
23156
|
name: "which",
|
|
@@ -23157,7 +23158,7 @@ var tt = [
|
|
|
23157
23158
|
},
|
|
23158
23159
|
{
|
|
23159
23160
|
name: "tac",
|
|
23160
|
-
load: async () => (await Promise.resolve().then(() => require("./tac-2STMMJYW-
|
|
23161
|
+
load: async () => (await Promise.resolve().then(() => require("./tac-2STMMJYW-CV76eEod.cjs"))).tac
|
|
23161
23162
|
},
|
|
23162
23163
|
{
|
|
23163
23164
|
name: "hostname",
|
|
@@ -23169,49 +23170,49 @@ var tt = [
|
|
|
23169
23170
|
},
|
|
23170
23171
|
{
|
|
23171
23172
|
name: "od",
|
|
23172
|
-
load: async () => (await Promise.resolve().then(() => require("./od-WOKFDJTP-
|
|
23173
|
+
load: async () => (await Promise.resolve().then(() => require("./od-WOKFDJTP-DnbYyXMK.cjs"))).od
|
|
23173
23174
|
},
|
|
23174
23175
|
{
|
|
23175
23176
|
name: "gzip",
|
|
23176
|
-
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-
|
|
23177
|
+
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-_cqZbTVt.cjs"))).gzipCommand
|
|
23177
23178
|
},
|
|
23178
23179
|
{
|
|
23179
23180
|
name: "gunzip",
|
|
23180
|
-
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-
|
|
23181
|
+
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-_cqZbTVt.cjs"))).gunzipCommand
|
|
23181
23182
|
},
|
|
23182
23183
|
{
|
|
23183
23184
|
name: "zcat",
|
|
23184
|
-
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-
|
|
23185
|
+
load: async () => (await Promise.resolve().then(() => require("./gzip-O5ASJAFY-_cqZbTVt.cjs"))).zcatCommand
|
|
23185
23186
|
}
|
|
23186
23187
|
];
|
|
23187
23188
|
(typeof __BROWSER__ > "u" || !__BROWSER__) && (tt.push({
|
|
23188
23189
|
name: "tar",
|
|
23189
|
-
load: async () => (await Promise.resolve().then(() => require("./tar-STHHZTZ6-
|
|
23190
|
+
load: async () => (await Promise.resolve().then(() => require("./tar-STHHZTZ6-C65UwZ-m.cjs"))).tarCommand
|
|
23190
23191
|
}), tt.push({
|
|
23191
23192
|
name: "yq",
|
|
23192
|
-
load: async () => (await Promise.resolve().then(() => require("./yq-4QJW3EQG-
|
|
23193
|
+
load: async () => (await Promise.resolve().then(() => require("./yq-4QJW3EQG-8c37KJef.cjs"))).yqCommand
|
|
23193
23194
|
}), tt.push({
|
|
23194
23195
|
name: "xan",
|
|
23195
|
-
load: async () => (await Promise.resolve().then(() => require("./xan-Y6WF3IRG-
|
|
23196
|
+
load: async () => (await Promise.resolve().then(() => require("./xan-Y6WF3IRG-BFJXmEuw.cjs"))).xanCommand
|
|
23196
23197
|
}), tt.push({
|
|
23197
23198
|
name: "sqlite3",
|
|
23198
|
-
load: async () => (await Promise.resolve().then(() => require("./sqlite3-CGOEFJAO-
|
|
23199
|
+
load: async () => (await Promise.resolve().then(() => require("./sqlite3-CGOEFJAO-DihhT2Kw.cjs"))).sqlite3Command
|
|
23199
23200
|
}));
|
|
23200
23201
|
var Yt = [];
|
|
23201
23202
|
(typeof __BROWSER__ > "u" || !__BROWSER__) && (Yt.push({
|
|
23202
23203
|
name: "python3",
|
|
23203
|
-
load: async () => (await Promise.resolve().then(() => require("./python3-POMOR4OA-
|
|
23204
|
+
load: async () => (await Promise.resolve().then(() => require("./python3-POMOR4OA-CE8T2OSD.cjs"))).python3Command
|
|
23204
23205
|
}), Yt.push({
|
|
23205
23206
|
name: "python",
|
|
23206
|
-
load: async () => (await Promise.resolve().then(() => require("./python3-POMOR4OA-
|
|
23207
|
+
load: async () => (await Promise.resolve().then(() => require("./python3-POMOR4OA-CE8T2OSD.cjs"))).pythonCommand
|
|
23207
23208
|
}));
|
|
23208
23209
|
var Qt = [];
|
|
23209
23210
|
(typeof __BROWSER__ > "u" || !__BROWSER__) && (Qt.push({
|
|
23210
23211
|
name: "js-exec",
|
|
23211
|
-
load: async () => (await Promise.resolve().then(() => require("./js-exec-N5KEZBH7-
|
|
23212
|
+
load: async () => (await Promise.resolve().then(() => require("./js-exec-N5KEZBH7-BvZ482TM.cjs"))).jsExecCommand
|
|
23212
23213
|
}), Qt.push({
|
|
23213
23214
|
name: "node",
|
|
23214
|
-
load: async () => (await Promise.resolve().then(() => require("./js-exec-N5KEZBH7-
|
|
23215
|
+
load: async () => (await Promise.resolve().then(() => require("./js-exec-N5KEZBH7-BvZ482TM.cjs"))).nodeStubCommand
|
|
23215
23216
|
}));
|
|
23216
23217
|
new TextEncoder();
|
|
23217
23218
|
Object.freeze({
|
|
@@ -24198,7 +24199,7 @@ function resolvePlatformOriginForModelCatalog() {
|
|
|
24198
24199
|
if (fromKeystroke) return fromKeystroke.replace(/\/+$/, "");
|
|
24199
24200
|
const fromPlatform = process.env.PLATFORM_URL?.trim();
|
|
24200
24201
|
if (fromPlatform) return fromPlatform.replace(/\/+$/, "");
|
|
24201
|
-
return require_dist.DEFAULT_CLOUD_PLATFORM_ORIGIN;
|
|
24202
|
+
return require_dist$1.DEFAULT_CLOUD_PLATFORM_ORIGIN;
|
|
24202
24203
|
}
|
|
24203
24204
|
async function fetchPublicModelIds() {
|
|
24204
24205
|
if (cachedModelIds) return cachedModelIds;
|
|
@@ -24208,7 +24209,7 @@ async function fetchPublicModelIds() {
|
|
|
24208
24209
|
try {
|
|
24209
24210
|
const response = await fetch(`${platformOrigin}/api/public/models`, { headers: { accept: "application/json" } });
|
|
24210
24211
|
if (!response.ok) throw new Error(`Failed to fetch public model catalog (${response.status})`);
|
|
24211
|
-
const parsed = require_dist.PublicModelsResponseSchema.safeParse(await response.json());
|
|
24212
|
+
const parsed = require_dist$1.PublicModelsResponseSchema.safeParse(await response.json());
|
|
24212
24213
|
if (!parsed.success || parsed.data.models.length === 0) throw new Error("Public model catalog response had no models");
|
|
24213
24214
|
cachedModelIds = new Set(parsed.data.models);
|
|
24214
24215
|
return cachedModelIds;
|
|
@@ -24297,7 +24298,8 @@ const webhookSourceSchema = zod.z.object({
|
|
|
24297
24298
|
const cronSourceSchema = zod.z.object({
|
|
24298
24299
|
kind: zod.z.literal("cron"),
|
|
24299
24300
|
...baseSourceShape,
|
|
24300
|
-
schedule: cronScheduleSchema
|
|
24301
|
+
schedule: cronScheduleSchema,
|
|
24302
|
+
payload: require_dist$1.cronPayloadSchema.optional()
|
|
24301
24303
|
});
|
|
24302
24304
|
const pollSourceSchema = zod.z.object({
|
|
24303
24305
|
kind: zod.z.literal("poll"),
|
|
@@ -24335,8 +24337,8 @@ zod.z.preprocess(normalizeLegacySlugFields, zod.z.discriminatedUnion("target", [
|
|
|
24335
24337
|
//#endregion
|
|
24336
24338
|
//#region ../../packages/projects/dist/index.mjs
|
|
24337
24339
|
async function resolveDeployManifest(input) {
|
|
24338
|
-
if (input.artifactManifest != null) return require_dist.parseStoredRouteManifest(input.artifactManifest);
|
|
24339
|
-
return require_dist.parseStoredRouteManifest(require_dist.extractRouteManifestFromArtifact(input.artifactBytes));
|
|
24340
|
+
if (input.artifactManifest != null) return require_dist$1.parseStoredRouteManifest(input.artifactManifest);
|
|
24341
|
+
return require_dist$1.parseStoredRouteManifest(require_dist$1.extractRouteManifestFromArtifact(input.artifactBytes));
|
|
24340
24342
|
}
|
|
24341
24343
|
/** Cut over activeArtifactId, then sync org project registry from the artifact manifest. */
|
|
24342
24344
|
async function promoteProjectDeploy(input) {
|
|
@@ -24346,7 +24348,7 @@ async function promoteProjectDeploy(input) {
|
|
|
24346
24348
|
if (!artifact || artifact.projectId !== input.projectId) throw new Error(`Artifact ${input.artifactId} not found for project ${input.projectId}`);
|
|
24347
24349
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(project.organizationId);
|
|
24348
24350
|
if (!organization) throw new Error(`Organization not found for project ${input.projectId}`);
|
|
24349
|
-
if (!input.artifactBytes && artifact.manifestJson == null) throw new require_dist.RouteManifestNotFoundError("Artifact has no stored route manifest; rebuild and redeploy");
|
|
24351
|
+
if (!input.artifactBytes && artifact.manifestJson == null) throw new require_dist$1.RouteManifestNotFoundError("Artifact has no stored route manifest; rebuild and redeploy");
|
|
24350
24352
|
const manifest = await resolveDeployManifest({
|
|
24351
24353
|
artifactId: input.artifactId,
|
|
24352
24354
|
artifactManifest: artifact.manifestJson,
|
|
@@ -24407,9 +24409,9 @@ function configureProjectRuntimeScheduler(plugin) {
|
|
|
24407
24409
|
async function getOrgRuntimeQueue() {
|
|
24408
24410
|
if (runtimeQueue) return runtimeQueue;
|
|
24409
24411
|
if (!runtimeQueueInit) runtimeQueueInit = (async () => {
|
|
24410
|
-
const queue = await require_dist.createJobQueue({
|
|
24412
|
+
const queue = await require_dist$1.createJobQueue({
|
|
24411
24413
|
scope: "platform",
|
|
24412
|
-
plugin: runtimeSchedulerPlugin ?? require_dist.defaultSchedulerPlugin()
|
|
24414
|
+
plugin: runtimeSchedulerPlugin ?? require_dist$1.defaultSchedulerPlugin()
|
|
24413
24415
|
});
|
|
24414
24416
|
runtimeQueue = queue;
|
|
24415
24417
|
return queue;
|
|
@@ -24757,7 +24759,7 @@ function getProjectInvitePermission(c) {
|
|
|
24757
24759
|
//#endregion
|
|
24758
24760
|
//#region ../../packages/http/dist/require-session-wsbtjGYi.mjs
|
|
24759
24761
|
function resolveActiveOrganizationId(c) {
|
|
24760
|
-
const header = c.req.header(require_dist.ACTIVE_ORG_HEADER)?.trim();
|
|
24762
|
+
const header = c.req.header(require_dist$1.ACTIVE_ORG_HEADER)?.trim();
|
|
24761
24763
|
if (header) return header;
|
|
24762
24764
|
return c.get("apiKeyAuth")?.organizationId;
|
|
24763
24765
|
}
|
|
@@ -24765,7 +24767,7 @@ async function resolveOrganizationContext(c) {
|
|
|
24765
24767
|
const organizationId = resolveActiveOrganizationId(c);
|
|
24766
24768
|
if (!organizationId) return {
|
|
24767
24769
|
ok: false,
|
|
24768
|
-
response: c.json(require_dist.ErrorResponseSchema.parse({
|
|
24770
|
+
response: c.json(require_dist$1.ErrorResponseSchema.parse({
|
|
24769
24771
|
error: "Select an organization to continue",
|
|
24770
24772
|
code: "needs_org_selection"
|
|
24771
24773
|
}), 409)
|
|
@@ -24773,12 +24775,12 @@ async function resolveOrganizationContext(c) {
|
|
|
24773
24775
|
const apiKeyAuth = c.get("apiKeyAuth");
|
|
24774
24776
|
if (apiKeyAuth && apiKeyAuth.organizationId !== organizationId) return {
|
|
24775
24777
|
ok: false,
|
|
24776
|
-
response: c.json(require_dist.ErrorResponseSchema.parse({ error: "Forbidden" }), 403)
|
|
24778
|
+
response: c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Forbidden" }), 403)
|
|
24777
24779
|
};
|
|
24778
24780
|
const membership = await (0, _keystrokehq_platform_database.selectUserOrganizationMembership)(c.get("user").id, organizationId);
|
|
24779
24781
|
if (!membership) return {
|
|
24780
24782
|
ok: false,
|
|
24781
|
-
response: c.json(require_dist.ErrorResponseSchema.parse({ error: "Forbidden" }), 403)
|
|
24783
|
+
response: c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Forbidden" }), 403)
|
|
24782
24784
|
};
|
|
24783
24785
|
return {
|
|
24784
24786
|
ok: true,
|
|
@@ -24792,7 +24794,7 @@ async function resolveOrganizationContext(c) {
|
|
|
24792
24794
|
}
|
|
24793
24795
|
function requireVerifiedOrganization() {
|
|
24794
24796
|
return async (c, next) => {
|
|
24795
|
-
if (!c.get("organization").verified) return c.json(require_dist.ErrorResponseSchema.parse({
|
|
24797
|
+
if (!c.get("organization").verified) return c.json(require_dist$1.ErrorResponseSchema.parse({
|
|
24796
24798
|
error: "This organization is pending verification",
|
|
24797
24799
|
code: "org_unverified"
|
|
24798
24800
|
}), 403);
|
|
@@ -24811,10 +24813,10 @@ function requireProject() {
|
|
|
24811
24813
|
return async (c, next) => {
|
|
24812
24814
|
const organization = c.get("organization");
|
|
24813
24815
|
const projectId = c.req.param("projectId")?.trim();
|
|
24814
|
-
if (!projectId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project id is required" }), 400);
|
|
24816
|
+
if (!projectId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Project id is required" }), 400);
|
|
24815
24817
|
const [project, organizationRow] = await Promise.all([(0, _keystrokehq_platform_database.selectProjectForOrganization)(organization.organizationId, projectId), (0, _keystrokehq_platform_database.selectOrganizationById)(organization.organizationId)]);
|
|
24816
|
-
if (!project) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
24817
|
-
if (!organizationRow) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
24818
|
+
if (!project) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
24819
|
+
if (!organizationRow) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
24818
24820
|
c.set("project", project);
|
|
24819
24821
|
await (0, _keystrokehq_platform_database.runWithWorkspaceContext)({
|
|
24820
24822
|
organizationId: organization.organizationId,
|
|
@@ -24825,13 +24827,13 @@ function requireProject() {
|
|
|
24825
24827
|
};
|
|
24826
24828
|
}
|
|
24827
24829
|
function routeProject(project) {
|
|
24828
|
-
return require_dist.mapProject(project);
|
|
24830
|
+
return require_dist$1.mapProject(project);
|
|
24829
24831
|
}
|
|
24830
24832
|
function forbidden(c) {
|
|
24831
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: "Forbidden" }), 403);
|
|
24833
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Forbidden" }), 403);
|
|
24832
24834
|
}
|
|
24833
24835
|
function notFound(c, message = "Not found") {
|
|
24834
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: message }), 404);
|
|
24836
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: message }), 404);
|
|
24835
24837
|
}
|
|
24836
24838
|
function requireProjectMembership() {
|
|
24837
24839
|
return async (c, next) => {
|
|
@@ -24925,9 +24927,9 @@ function authorizePayload(schema, allow) {
|
|
|
24925
24927
|
function requireOrganizationParam() {
|
|
24926
24928
|
return async (c, next) => {
|
|
24927
24929
|
const organizationId = c.req.param("organizationId")?.trim();
|
|
24928
|
-
if (!organizationId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization id is required" }), 400);
|
|
24930
|
+
if (!organizationId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization id is required" }), 400);
|
|
24929
24931
|
const membership = await (0, _keystrokehq_platform_database.selectUserOrganizationMembership)(c.get("user").id, organizationId);
|
|
24930
|
-
if (!membership) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Forbidden" }), 403);
|
|
24932
|
+
if (!membership) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Forbidden" }), 403);
|
|
24931
24933
|
c.set("organization", {
|
|
24932
24934
|
organizationId: membership.organization.id,
|
|
24933
24935
|
organizationName: membership.organization.name,
|
|
@@ -24969,8 +24971,8 @@ function withOrganizationProjectDatabase() {
|
|
|
24969
24971
|
//#region src/routes/account/users/me/avatar/GET.ts
|
|
24970
24972
|
const handler$95 = async (c) => {
|
|
24971
24973
|
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(c.get("user").id);
|
|
24972
|
-
if (!dbUser) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
24973
|
-
return c.json(require_dist.UserAvatarSchema.parse({ url: dbUser.image ?? null }));
|
|
24974
|
+
if (!dbUser) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
24975
|
+
return c.json(require_dist$1.UserAvatarSchema.parse({ url: dbUser.image ?? null }));
|
|
24974
24976
|
};
|
|
24975
24977
|
//#endregion
|
|
24976
24978
|
//#region src/lib/user-avatar-content-type.ts
|
|
@@ -24987,16 +24989,16 @@ function avatarExtensionForContentType(contentType) {
|
|
|
24987
24989
|
//#endregion
|
|
24988
24990
|
//#region src/routes/account/users/me/avatar/presign/POST.ts
|
|
24989
24991
|
const handler$94 = async (c) => {
|
|
24990
|
-
const parsed = require_dist.PresignUserAvatarRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
24991
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid avatar upload request" }), 400);
|
|
24992
|
+
const parsed = require_dist$1.PresignUserAvatarRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
24993
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid avatar upload request" }), 400);
|
|
24992
24994
|
const extension = avatarExtensionForContentType(parsed.data.contentType);
|
|
24993
|
-
if (!extension) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Unsupported image type" }), 400);
|
|
24994
|
-
const storageKey = require_dist.userAvatarStorageKey(c.get("user").id, extension);
|
|
24995
|
-
const uploadUrl = await require_dist.createAssetsStorageClient().presignPut({
|
|
24995
|
+
if (!extension) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Unsupported image type" }), 400);
|
|
24996
|
+
const storageKey = require_dist$1.userAvatarStorageKey(c.get("user").id, extension);
|
|
24997
|
+
const uploadUrl = await require_dist$1.createAssetsStorageClient().presignPut({
|
|
24996
24998
|
key: storageKey,
|
|
24997
24999
|
contentType: parsed.data.contentType
|
|
24998
25000
|
});
|
|
24999
|
-
return c.json(require_dist.PresignUserAvatarResponseSchema.parse({
|
|
25001
|
+
return c.json(require_dist$1.PresignUserAvatarResponseSchema.parse({
|
|
25000
25002
|
uploadUrl,
|
|
25001
25003
|
storageKey
|
|
25002
25004
|
}));
|
|
@@ -25027,72 +25029,72 @@ async function deleteStoredImageIfOwned(input) {
|
|
|
25027
25029
|
//#endregion
|
|
25028
25030
|
//#region src/routes/account/users/me/avatar/PATCH.ts
|
|
25029
25031
|
const handler$93 = async (c) => {
|
|
25030
|
-
const parsed = require_dist.UserAvatarPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
25031
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid avatar update" }), 400);
|
|
25032
|
+
const parsed = require_dist$1.UserAvatarPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
25033
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid avatar update" }), 400);
|
|
25032
25034
|
const user = c.get("user");
|
|
25033
25035
|
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(user.id);
|
|
25034
|
-
if (!dbUser) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
25035
|
-
const storage = require_dist.createAssetsStorageClient();
|
|
25036
|
+
if (!dbUser) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
25037
|
+
const storage = require_dist$1.createAssetsStorageClient();
|
|
25036
25038
|
const { storageKey } = parsed.data;
|
|
25037
25039
|
if (storageKey === null) {
|
|
25038
25040
|
await deleteStoredImageIfOwned({
|
|
25039
25041
|
storage,
|
|
25040
25042
|
url: dbUser.image,
|
|
25041
|
-
isOwnedPublicUrl: require_dist.isKeystrokeAssetsAvatarPublicUrl,
|
|
25042
|
-
keyFromPublicUrl: require_dist.keystrokeAssetsAvatarKeyFromPublicUrl
|
|
25043
|
+
isOwnedPublicUrl: require_dist$1.isKeystrokeAssetsAvatarPublicUrl,
|
|
25044
|
+
keyFromPublicUrl: require_dist$1.keystrokeAssetsAvatarKeyFromPublicUrl
|
|
25043
25045
|
});
|
|
25044
25046
|
await (0, _keystrokehq_platform_database.updateUserById)(user.id, {
|
|
25045
25047
|
image: null,
|
|
25046
25048
|
updatedAt: /* @__PURE__ */ new Date()
|
|
25047
25049
|
});
|
|
25048
|
-
return c.json(require_dist.UserAvatarSchema.parse({ url: null }));
|
|
25050
|
+
return c.json(require_dist$1.UserAvatarSchema.parse({ url: null }));
|
|
25049
25051
|
}
|
|
25050
25052
|
const finalized = await finalizeStoredImageUpload({
|
|
25051
25053
|
storage,
|
|
25052
25054
|
storageKey,
|
|
25053
|
-
isValidStorageKey: (key) => require_dist.isUserAvatarStorageKey(key, user.id),
|
|
25054
|
-
buildPublicUrl: require_dist.publicKeystrokeAssetsObjectUrl
|
|
25055
|
+
isValidStorageKey: (key) => require_dist$1.isUserAvatarStorageKey(key, user.id),
|
|
25056
|
+
buildPublicUrl: require_dist$1.publicKeystrokeAssetsObjectUrl
|
|
25055
25057
|
});
|
|
25056
|
-
if (!finalized.ok) return c.json(require_dist.ErrorResponseSchema.parse({ error: finalized.error }), 400);
|
|
25058
|
+
if (!finalized.ok) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: finalized.error }), 400);
|
|
25057
25059
|
if (dbUser.image && dbUser.image !== finalized.publicUrl) await deleteStoredImageIfOwned({
|
|
25058
25060
|
storage,
|
|
25059
25061
|
url: dbUser.image,
|
|
25060
|
-
isOwnedPublicUrl: require_dist.isKeystrokeAssetsAvatarPublicUrl,
|
|
25061
|
-
keyFromPublicUrl: require_dist.keystrokeAssetsAvatarKeyFromPublicUrl
|
|
25062
|
+
isOwnedPublicUrl: require_dist$1.isKeystrokeAssetsAvatarPublicUrl,
|
|
25063
|
+
keyFromPublicUrl: require_dist$1.keystrokeAssetsAvatarKeyFromPublicUrl
|
|
25062
25064
|
});
|
|
25063
25065
|
await (0, _keystrokehq_platform_database.updateUserById)(user.id, {
|
|
25064
25066
|
image: finalized.publicUrl,
|
|
25065
25067
|
updatedAt: /* @__PURE__ */ new Date()
|
|
25066
25068
|
});
|
|
25067
|
-
return c.json(require_dist.UserAvatarSchema.parse({ url: finalized.publicUrl }));
|
|
25069
|
+
return c.json(require_dist$1.UserAvatarSchema.parse({ url: finalized.publicUrl }));
|
|
25068
25070
|
};
|
|
25069
25071
|
//#endregion
|
|
25070
25072
|
//#region src/routes/account/users/me/preferences/GET.ts
|
|
25071
25073
|
const handler$92 = async (c) => {
|
|
25072
25074
|
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(c.get("user").id);
|
|
25073
|
-
if (!dbUser) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
25074
|
-
return c.json(require_dist.UserPreferencesSchema.parse(require_dist.normalizeUserPreferences(dbUser.preferences)));
|
|
25075
|
+
if (!dbUser) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
25076
|
+
return c.json(require_dist$1.UserPreferencesSchema.parse(require_dist$1.normalizeUserPreferences(dbUser.preferences)));
|
|
25075
25077
|
};
|
|
25076
25078
|
//#endregion
|
|
25077
25079
|
//#region src/routes/account/users/me/preferences/PATCH.ts
|
|
25078
25080
|
const handler$91 = async (c) => {
|
|
25079
|
-
const parsed = require_dist.UserPreferencesPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
25080
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid preferences update" }), 400);
|
|
25081
|
+
const parsed = require_dist$1.UserPreferencesPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
25082
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid preferences update" }), 400);
|
|
25081
25083
|
const user = c.get("user");
|
|
25082
25084
|
const dbUser = await (0, _keystrokehq_platform_database.selectUserById)(user.id);
|
|
25083
|
-
if (!dbUser) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
25084
|
-
const next = require_dist.mergeUserPreferences(require_dist.normalizeUserPreferences(dbUser.preferences), parsed.data);
|
|
25085
|
+
if (!dbUser) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "User not found" }), 404);
|
|
25086
|
+
const next = require_dist$1.mergeUserPreferences(require_dist$1.normalizeUserPreferences(dbUser.preferences), parsed.data);
|
|
25085
25087
|
await (0, _keystrokehq_platform_database.updateUserById)(user.id, {
|
|
25086
25088
|
preferences: next,
|
|
25087
25089
|
updatedAt: /* @__PURE__ */ new Date()
|
|
25088
25090
|
});
|
|
25089
|
-
return c.json(require_dist.UserPreferencesSchema.parse(next));
|
|
25091
|
+
return c.json(require_dist$1.UserPreferencesSchema.parse(next));
|
|
25090
25092
|
};
|
|
25091
25093
|
//#endregion
|
|
25092
25094
|
//#region src/routes/account/organizations/GET.ts
|
|
25093
25095
|
const handler$90 = async (c) => {
|
|
25094
25096
|
const memberships = await (0, _keystrokehq_platform_database.selectUserOrganizations)(c.get("user").id);
|
|
25095
|
-
return c.json(require_dist.ListOrganizationsResponseSchema.parse(memberships.map(require_dist.mapUserOrganization)));
|
|
25097
|
+
return c.json(require_dist$1.ListOrganizationsResponseSchema.parse(memberships.map(require_dist$1.mapUserOrganization)));
|
|
25096
25098
|
};
|
|
25097
25099
|
//#endregion
|
|
25098
25100
|
//#region src/services/create-organization.ts
|
|
@@ -25145,7 +25147,7 @@ function organizationSlugErrorBody(error) {
|
|
|
25145
25147
|
const message = error.issues[0]?.message ?? "Invalid organization slug";
|
|
25146
25148
|
return {
|
|
25147
25149
|
error: message,
|
|
25148
|
-
code: require_dist.organizationSlugErrorCodeFromMessage(message)
|
|
25150
|
+
code: require_dist$1.organizationSlugErrorCodeFromMessage(message)
|
|
25149
25151
|
};
|
|
25150
25152
|
}
|
|
25151
25153
|
//#endregion
|
|
@@ -25154,14 +25156,14 @@ function createOrganizationHandler(deps) {
|
|
|
25154
25156
|
return async (c) => {
|
|
25155
25157
|
const user = c.get("user");
|
|
25156
25158
|
const body = await c.req.json().catch(() => null);
|
|
25157
|
-
const parsed = require_dist.CreateOrganizationRequestSchema.safeParse(body);
|
|
25158
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid organization request" }), 400);
|
|
25159
|
+
const parsed = require_dist$1.CreateOrganizationRequestSchema.safeParse(body);
|
|
25160
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid organization request" }), 400);
|
|
25159
25161
|
try {
|
|
25160
25162
|
const membership = await createOrganizationWithHosting(deps, user.id, parsed.data.name, parsed.data.slug);
|
|
25161
|
-
return c.json(require_dist.CreateOrganizationResponseSchema.parse(require_dist.mapUserOrganization(membership)), 201);
|
|
25163
|
+
return c.json(require_dist$1.CreateOrganizationResponseSchema.parse(require_dist$1.mapUserOrganization(membership)), 201);
|
|
25162
25164
|
} catch (error) {
|
|
25163
|
-
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return c.json(require_dist.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 409);
|
|
25164
|
-
if (error instanceof zod.ZodError) return c.json(require_dist.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 400);
|
|
25165
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return c.json(require_dist$1.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 409);
|
|
25166
|
+
if (error instanceof zod.ZodError) return c.json(require_dist$1.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 400);
|
|
25165
25167
|
throw error;
|
|
25166
25168
|
}
|
|
25167
25169
|
};
|
|
@@ -25169,13 +25171,13 @@ function createOrganizationHandler(deps) {
|
|
|
25169
25171
|
//#endregion
|
|
25170
25172
|
//#region src/routes/account/organizations/slug-available/GET.ts
|
|
25171
25173
|
const handler$89 = async (c) => {
|
|
25172
|
-
const parsed = require_dist.SlugAvailabilityQuerySchema.safeParse({
|
|
25174
|
+
const parsed = require_dist$1.SlugAvailabilityQuerySchema.safeParse({
|
|
25173
25175
|
slug: c.req.query("slug"),
|
|
25174
25176
|
excludeOrganizationId: c.req.query("excludeOrganizationId")
|
|
25175
25177
|
});
|
|
25176
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
25178
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
25177
25179
|
const availability = await (0, _keystrokehq_platform_database.checkOrganizationSlugAvailability)(parsed.data.slug, parsed.data.excludeOrganizationId);
|
|
25178
|
-
return c.json(require_dist.SlugAvailabilityResponseSchema.parse(availability));
|
|
25180
|
+
return c.json(require_dist$1.SlugAvailabilityResponseSchema.parse(availability));
|
|
25179
25181
|
};
|
|
25180
25182
|
//#endregion
|
|
25181
25183
|
//#region src/routes/account/organizations/[organizationId]/GET.ts
|
|
@@ -25183,30 +25185,30 @@ const handler$88 = async (c) => {
|
|
|
25183
25185
|
const { organizationId } = c.get("organization");
|
|
25184
25186
|
const membership = await (0, _keystrokehq_platform_database.selectUserOrganizationMembership)(c.get("user").id, organizationId);
|
|
25185
25187
|
if (!membership) throw new Error(`Organization membership missing after param guard: ${organizationId}`);
|
|
25186
|
-
return c.json(require_dist.ActiveOrganizationResponseSchema.parse(require_dist.mapUserOrganization(membership)));
|
|
25188
|
+
return c.json(require_dist$1.ActiveOrganizationResponseSchema.parse(require_dist$1.mapUserOrganization(membership)));
|
|
25187
25189
|
};
|
|
25188
25190
|
//#endregion
|
|
25189
25191
|
//#region src/routes/account/organizations/[organizationId]/PATCH.ts
|
|
25190
25192
|
const handler$87 = async (c) => {
|
|
25191
25193
|
const organization = c.get("organization");
|
|
25192
25194
|
const body = await c.req.json().catch(() => null);
|
|
25193
|
-
const parsed = require_dist.UpdateOrganizationRequestSchema.safeParse(body);
|
|
25195
|
+
const parsed = require_dist$1.UpdateOrganizationRequestSchema.safeParse(body);
|
|
25194
25196
|
if (!parsed.success) {
|
|
25195
|
-
const errorBody = parsed.error.issues.some((issue) => issue.path[0] === "slug") ? organizationSlugErrorBody(parsed.error) : require_dist.validationErrorResponse(parsed.error, "Invalid organization update");
|
|
25196
|
-
return c.json(require_dist.ErrorResponseSchema.parse(errorBody), 400);
|
|
25197
|
+
const errorBody = parsed.error.issues.some((issue) => issue.path[0] === "slug") ? organizationSlugErrorBody(parsed.error) : require_dist$1.validationErrorResponse(parsed.error, "Invalid organization update");
|
|
25198
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse(errorBody), 400);
|
|
25197
25199
|
}
|
|
25198
25200
|
try {
|
|
25199
25201
|
let updated;
|
|
25200
25202
|
if (parsed.data.name !== void 0) updated = await (0, _keystrokehq_platform_database.updateOrganizationName)(organization.organizationId, parsed.data.name);
|
|
25201
25203
|
if (parsed.data.slug !== void 0) updated = await (0, _keystrokehq_platform_database.updateOrganizationSlug)(organization.organizationId, parsed.data.slug);
|
|
25202
25204
|
if (!updated) throw new Error(`Organization update produced no result: ${organization.organizationId}`);
|
|
25203
|
-
return c.json(require_dist.ActiveOrganizationResponseSchema.parse(require_dist.mapUserOrganization({
|
|
25205
|
+
return c.json(require_dist$1.ActiveOrganizationResponseSchema.parse(require_dist$1.mapUserOrganization({
|
|
25204
25206
|
organization: updated,
|
|
25205
25207
|
role: organization.role
|
|
25206
25208
|
})));
|
|
25207
25209
|
} catch (error) {
|
|
25208
|
-
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return c.json(require_dist.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 409);
|
|
25209
|
-
if (error instanceof zod.ZodError) return c.json(require_dist.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 400);
|
|
25210
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationSlugTakenError) return c.json(require_dist$1.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 409);
|
|
25211
|
+
if (error instanceof zod.ZodError) return c.json(require_dist$1.ErrorResponseSchema.parse(organizationSlugErrorBody(error)), 400);
|
|
25210
25212
|
throw error;
|
|
25211
25213
|
}
|
|
25212
25214
|
};
|
|
@@ -25215,8 +25217,8 @@ const handler$87 = async (c) => {
|
|
|
25215
25217
|
const handler$86 = async (c) => {
|
|
25216
25218
|
const { organizationId } = c.get("organization");
|
|
25217
25219
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
25218
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
25219
|
-
return c.json(require_dist.OrganizationSidebarBrandingSchema.parse((0, _keystrokehq_platform_database.organizationRowToSidebarBranding)(organization)));
|
|
25220
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
25221
|
+
return c.json(require_dist$1.OrganizationSidebarBrandingSchema.parse((0, _keystrokehq_platform_database.organizationRowToSidebarBranding)(organization)));
|
|
25220
25222
|
};
|
|
25221
25223
|
//#endregion
|
|
25222
25224
|
//#region src/routes/account/organizations/[organizationId]/branding/PATCH.ts
|
|
@@ -25230,13 +25232,13 @@ const LOGO_VARIANTS = [{
|
|
|
25230
25232
|
urlField: "logoDarkUrl"
|
|
25231
25233
|
}];
|
|
25232
25234
|
async function finalizeOrgLogoVariant(input) {
|
|
25233
|
-
const storage = require_dist.createAssetsStorageClient();
|
|
25235
|
+
const storage = require_dist$1.createAssetsStorageClient();
|
|
25234
25236
|
if (input.storageKey === null) {
|
|
25235
25237
|
await deleteStoredImageIfOwned({
|
|
25236
25238
|
storage,
|
|
25237
25239
|
url: input.currentUrl,
|
|
25238
|
-
isOwnedPublicUrl: require_dist.isKeystrokeAssetsOrgLogoPublicUrl,
|
|
25239
|
-
keyFromPublicUrl: require_dist.keystrokeAssetsOrgLogoKeyFromPublicUrl
|
|
25240
|
+
isOwnedPublicUrl: require_dist$1.isKeystrokeAssetsOrgLogoPublicUrl,
|
|
25241
|
+
keyFromPublicUrl: require_dist$1.keystrokeAssetsOrgLogoKeyFromPublicUrl
|
|
25240
25242
|
});
|
|
25241
25243
|
return {
|
|
25242
25244
|
ok: true,
|
|
@@ -25246,15 +25248,15 @@ async function finalizeOrgLogoVariant(input) {
|
|
|
25246
25248
|
const finalized = await finalizeStoredImageUpload({
|
|
25247
25249
|
storage,
|
|
25248
25250
|
storageKey: input.storageKey,
|
|
25249
|
-
isValidStorageKey: (key) => require_dist.isOrgLogoStorageKey(key, input.organizationId, input.variant),
|
|
25250
|
-
buildPublicUrl: require_dist.publicKeystrokeAssetsObjectUrl
|
|
25251
|
+
isValidStorageKey: (key) => require_dist$1.isOrgLogoStorageKey(key, input.organizationId, input.variant),
|
|
25252
|
+
buildPublicUrl: require_dist$1.publicKeystrokeAssetsObjectUrl
|
|
25251
25253
|
});
|
|
25252
25254
|
if (!finalized.ok) return finalized;
|
|
25253
25255
|
if (input.currentUrl && input.currentUrl !== finalized.publicUrl) await deleteStoredImageIfOwned({
|
|
25254
25256
|
storage,
|
|
25255
25257
|
url: input.currentUrl,
|
|
25256
|
-
isOwnedPublicUrl: require_dist.isKeystrokeAssetsOrgLogoPublicUrl,
|
|
25257
|
-
keyFromPublicUrl: require_dist.keystrokeAssetsOrgLogoKeyFromPublicUrl
|
|
25258
|
+
isOwnedPublicUrl: require_dist$1.isKeystrokeAssetsOrgLogoPublicUrl,
|
|
25259
|
+
keyFromPublicUrl: require_dist$1.keystrokeAssetsOrgLogoKeyFromPublicUrl
|
|
25258
25260
|
});
|
|
25259
25261
|
return {
|
|
25260
25262
|
ok: true,
|
|
@@ -25262,11 +25264,11 @@ async function finalizeOrgLogoVariant(input) {
|
|
|
25262
25264
|
};
|
|
25263
25265
|
}
|
|
25264
25266
|
const handler$85 = async (c) => {
|
|
25265
|
-
const parsed = require_dist.OrganizationSidebarBrandingPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
25266
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid branding update" }), 400);
|
|
25267
|
+
const parsed = require_dist$1.OrganizationSidebarBrandingPatchSchema.safeParse(await c.req.json().catch(() => null));
|
|
25268
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid branding update" }), 400);
|
|
25267
25269
|
const { organizationId } = c.get("organization");
|
|
25268
25270
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
25269
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
25271
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
25270
25272
|
const dbUpdate = {
|
|
25271
25273
|
customLogoEnabled: parsed.data.customLogoEnabled,
|
|
25272
25274
|
customLogoExplicitlyDisabled: parsed.data.customLogoExplicitlyDisabled,
|
|
@@ -25281,26 +25283,26 @@ const handler$85 = async (c) => {
|
|
|
25281
25283
|
storageKey,
|
|
25282
25284
|
currentUrl: organization[urlField]
|
|
25283
25285
|
});
|
|
25284
|
-
if (!result.ok) return c.json(require_dist.ErrorResponseSchema.parse({ error: result.error }), 400);
|
|
25286
|
+
if (!result.ok) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: result.error }), 400);
|
|
25285
25287
|
dbUpdate[urlField] = result.publicUrl;
|
|
25286
25288
|
}
|
|
25287
25289
|
const updated = await (0, _keystrokehq_platform_database.updateOrganizationSidebarBranding)(organizationId, dbUpdate);
|
|
25288
|
-
return c.json(require_dist.OrganizationSidebarBrandingSchema.parse((0, _keystrokehq_platform_database.organizationRowToSidebarBranding)(updated)));
|
|
25290
|
+
return c.json(require_dist$1.OrganizationSidebarBrandingSchema.parse((0, _keystrokehq_platform_database.organizationRowToSidebarBranding)(updated)));
|
|
25289
25291
|
};
|
|
25290
25292
|
//#endregion
|
|
25291
25293
|
//#region src/routes/account/organizations/[organizationId]/branding/logo/presign/POST.ts
|
|
25292
25294
|
const handler$84 = async (c) => {
|
|
25293
|
-
const parsed = require_dist.PresignOrgLogoRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
25294
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid logo upload request" }), 400);
|
|
25295
|
+
const parsed = require_dist$1.PresignOrgLogoRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
25296
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid logo upload request" }), 400);
|
|
25295
25297
|
const extension = avatarExtensionForContentType(parsed.data.contentType);
|
|
25296
|
-
if (!extension) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Unsupported image type" }), 400);
|
|
25298
|
+
if (!extension) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Unsupported image type" }), 400);
|
|
25297
25299
|
const { organizationId } = c.get("organization");
|
|
25298
|
-
const storageKey = require_dist.orgLogoStorageKey(organizationId, parsed.data.variant, extension);
|
|
25299
|
-
const uploadUrl = await require_dist.createAssetsStorageClient().presignPut({
|
|
25300
|
+
const storageKey = require_dist$1.orgLogoStorageKey(organizationId, parsed.data.variant, extension);
|
|
25301
|
+
const uploadUrl = await require_dist$1.createAssetsStorageClient().presignPut({
|
|
25300
25302
|
key: storageKey,
|
|
25301
25303
|
contentType: parsed.data.contentType
|
|
25302
25304
|
});
|
|
25303
|
-
return c.json(require_dist.PresignOrgLogoResponseSchema.parse({
|
|
25305
|
+
return c.json(require_dist$1.PresignOrgLogoResponseSchema.parse({
|
|
25304
25306
|
uploadUrl,
|
|
25305
25307
|
storageKey
|
|
25306
25308
|
}));
|
|
@@ -25393,14 +25395,14 @@ async function attachRanAsToDetail(detail, ranByUserId) {
|
|
|
25393
25395
|
const handler$83 = async (c) => {
|
|
25394
25396
|
const organization = c.get("organization");
|
|
25395
25397
|
const ctx = accessContext(c);
|
|
25396
|
-
const query = require_dist.HistoryRunListQuerySchema.parse({
|
|
25398
|
+
const query = require_dist$1.HistoryRunListQuerySchema.parse({
|
|
25397
25399
|
project: c.req.query("project")?.trim() || void 0,
|
|
25398
25400
|
status: c.req.query("status")?.trim() || void 0,
|
|
25399
25401
|
kind: c.req.query("kind")?.trim() || void 0
|
|
25400
25402
|
});
|
|
25401
25403
|
const scope = listScope(c, historyListScope(ctx));
|
|
25402
25404
|
const filter = await resolveListProjectIds(c, scope, query.project);
|
|
25403
|
-
if (filter === "empty") return c.json(require_dist.HistoryRunListResponseSchema.parse([]));
|
|
25405
|
+
if (filter === "empty") return c.json(require_dist$1.HistoryRunListResponseSchema.parse([]));
|
|
25404
25406
|
const runs = await (0, _keystrokehq_database.listHistoryRuns)({
|
|
25405
25407
|
...filter,
|
|
25406
25408
|
...query.status ? { status: query.status } : {},
|
|
@@ -25409,7 +25411,7 @@ const handler$83 = async (c) => {
|
|
|
25409
25411
|
const grantedProjectIdsList = await grantedProjectIds(c, scope);
|
|
25410
25412
|
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: grantedProjectIdsList });
|
|
25411
25413
|
const historyRuns = await enrichHistoryRuns(runs, new Map(projects.map((project) => [project.id, project.name])));
|
|
25412
|
-
return c.json(require_dist.HistoryRunListResponseSchema.parse(historyRuns));
|
|
25414
|
+
return c.json(require_dist$1.HistoryRunListResponseSchema.parse(historyRuns));
|
|
25413
25415
|
};
|
|
25414
25416
|
//#endregion
|
|
25415
25417
|
//#region src/routes/account/history/[runId]/GET.ts
|
|
@@ -25431,14 +25433,14 @@ const handler$82 = async (c) => {
|
|
|
25431
25433
|
return (0, _keystrokehq_database.buildHistoryAgentSessionDetail)(agent.slug, runId);
|
|
25432
25434
|
});
|
|
25433
25435
|
if (!detail) return c.json(null, 404);
|
|
25434
|
-
return c.json(require_dist.HistoryRunDetailResponseSchema.parse(await attachRanAsToDetail(detail, core.ranByUserId)));
|
|
25436
|
+
return c.json(require_dist$1.HistoryRunDetailResponseSchema.parse(await attachRanAsToDetail(detail, core.ranByUserId)));
|
|
25435
25437
|
};
|
|
25436
25438
|
//#endregion
|
|
25437
25439
|
//#region src/routes/account/resources/common.ts
|
|
25438
25440
|
/** Derive a human display name from a resource slug when no explicit name is stored. */
|
|
25439
25441
|
function titleCaseKey(slug) {
|
|
25440
25442
|
const normalized = slug.split(/[/_-]+/).filter(Boolean).join(" ");
|
|
25441
|
-
if (!normalized) return require_dist.PLATFORM_RESOURCE_UNSUPPORTED_TEXT;
|
|
25443
|
+
if (!normalized) return require_dist$1.PLATFORM_RESOURCE_UNSUPPORTED_TEXT;
|
|
25442
25444
|
return normalized.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
25443
25445
|
}
|
|
25444
25446
|
//#endregion
|
|
@@ -25449,7 +25451,7 @@ function formatModel(model) {
|
|
|
25449
25451
|
}
|
|
25450
25452
|
function toAgentSummary(row, options) {
|
|
25451
25453
|
const name = row.name?.trim() || titleCaseKey(row.slug);
|
|
25452
|
-
return require_dist.AgentSummarySchema.parse({
|
|
25454
|
+
return require_dist$1.AgentSummarySchema.parse({
|
|
25453
25455
|
id: row.id,
|
|
25454
25456
|
slug: row.slug,
|
|
25455
25457
|
name,
|
|
@@ -25464,7 +25466,7 @@ function toAgentSummary(row, options) {
|
|
|
25464
25466
|
credentialCount: row.credentialCount ?? void 0,
|
|
25465
25467
|
apps: (row.appSlugs ?? []).map((id) => ({
|
|
25466
25468
|
id,
|
|
25467
|
-
label: require_dist.displayCredentialAppName(id)
|
|
25469
|
+
label: require_dist$1.displayCredentialAppName(id)
|
|
25468
25470
|
})),
|
|
25469
25471
|
lastRunAt: options?.lastRunAt?.toISOString()
|
|
25470
25472
|
});
|
|
@@ -25473,10 +25475,10 @@ function toAgentSummary(row, options) {
|
|
|
25473
25475
|
//#region src/routes/account/agents/GET.ts
|
|
25474
25476
|
const handler$81 = async (c) => {
|
|
25475
25477
|
const filter = await resolveListProjectIds(c, listScope(c, agentListScope(accessContext(c))), c.req.query("projectId"));
|
|
25476
|
-
if (filter === "empty") return c.json(require_dist.AgentSummaryListResponseSchema.parse([]));
|
|
25478
|
+
if (filter === "empty") return c.json(require_dist$1.AgentSummaryListResponseSchema.parse([]));
|
|
25477
25479
|
const rows = await (0, _keystrokehq_database.listActiveAgents)(filter);
|
|
25478
25480
|
const lastRunAtById = await (0, _keystrokehq_database.selectAgentLastRunAtByIds)(rows.map((row) => row.id));
|
|
25479
|
-
return c.json(require_dist.AgentSummaryListResponseSchema.parse(rows.map((row) => toAgentSummary(row, { lastRunAt: lastRunAtById.get(row.id) ?? null }))));
|
|
25481
|
+
return c.json(require_dist$1.AgentSummaryListResponseSchema.parse(rows.map((row) => toAgentSummary(row, { lastRunAt: lastRunAtById.get(row.id) ?? null }))));
|
|
25480
25482
|
};
|
|
25481
25483
|
//#endregion
|
|
25482
25484
|
//#region src/routes/account/lib/touch-resource-activity.ts
|
|
@@ -25488,7 +25490,7 @@ function touchResourceActivityBestEffort(options) {
|
|
|
25488
25490
|
const handler$80 = async (c) => {
|
|
25489
25491
|
const agentId = c.req.param("agentId") ?? "";
|
|
25490
25492
|
const row = agentId ? await (0, _keystrokehq_database.selectActiveAgentById)(agentId) : void 0;
|
|
25491
|
-
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist.AgentSummaryDetailResponseSchema.parse(null));
|
|
25493
|
+
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist$1.AgentSummaryDetailResponseSchema.parse(null));
|
|
25492
25494
|
touchResourceActivityBestEffort({
|
|
25493
25495
|
userId: c.get("user").id,
|
|
25494
25496
|
projectId: row.projectId,
|
|
@@ -25498,7 +25500,7 @@ const handler$80 = async (c) => {
|
|
|
25498
25500
|
const lastRunAtById = await (0, _keystrokehq_database.selectAgentLastRunAtByIds)([row.id]);
|
|
25499
25501
|
const parsedModel = row.model ? AgentModelIdSchema.safeParse(row.model) : void 0;
|
|
25500
25502
|
const capabilities = parsedModel?.success ? await resolveModelCapabilities(parsedModel.data) : void 0;
|
|
25501
|
-
return c.json(require_dist.AgentSummaryDetailResponseSchema.parse(toAgentSummary(row, {
|
|
25503
|
+
return c.json(require_dist$1.AgentSummaryDetailResponseSchema.parse(toAgentSummary(row, {
|
|
25502
25504
|
lastRunAt: lastRunAtById.get(row.id) ?? null,
|
|
25503
25505
|
capabilities
|
|
25504
25506
|
})));
|
|
@@ -25511,17 +25513,17 @@ function relativePathsFromStorageKeys(prefix, keys) {
|
|
|
25511
25513
|
const handler$79 = async (c) => {
|
|
25512
25514
|
const agentId = c.req.param("agentId") ?? "";
|
|
25513
25515
|
const row = agentId ? await (0, _keystrokehq_database.selectActiveAgentById)(agentId) : void 0;
|
|
25514
|
-
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist.ListAgentMemoryFilesResponseSchema.parse({ files: [] }), 404);
|
|
25516
|
+
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist$1.ListAgentMemoryFilesResponseSchema.parse({ files: [] }), 404);
|
|
25515
25517
|
const { organizationId } = c.get("organization");
|
|
25516
25518
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
25517
|
-
if (!organization) return c.json(require_dist.ListAgentMemoryFilesResponseSchema.parse({ files: [] }), 404);
|
|
25519
|
+
if (!organization) return c.json(require_dist$1.ListAgentMemoryFilesResponseSchema.parse({ files: [] }), 404);
|
|
25518
25520
|
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
25519
25521
|
const prefix = agentMemoryStoragePrefix(row.id);
|
|
25520
|
-
const files = orderMemoryRelativePaths(relativePathsFromStorageKeys(prefix, await storage.listObjects(prefix))).map((path) => require_dist.AgentMemoryFileSummarySchema.parse({
|
|
25521
|
-
id: require_dist.agentMemoryFileId(path),
|
|
25522
|
+
const files = orderMemoryRelativePaths(relativePathsFromStorageKeys(prefix, await storage.listObjects(prefix))).map((path) => require_dist$1.AgentMemoryFileSummarySchema.parse({
|
|
25523
|
+
id: require_dist$1.agentMemoryFileId(path),
|
|
25522
25524
|
path
|
|
25523
25525
|
}));
|
|
25524
|
-
return c.json(require_dist.ListAgentMemoryFilesResponseSchema.parse({ files }));
|
|
25526
|
+
return c.json(require_dist$1.ListAgentMemoryFilesResponseSchema.parse({ files }));
|
|
25525
25527
|
};
|
|
25526
25528
|
//#endregion
|
|
25527
25529
|
//#region src/routes/account/agents/[agentId]/memory/files/content/GET.ts
|
|
@@ -25536,17 +25538,17 @@ function isStorageNotFoundError(error) {
|
|
|
25536
25538
|
const handler$78 = async (c) => {
|
|
25537
25539
|
const agentId = c.req.param("agentId") ?? "";
|
|
25538
25540
|
const path = c.req.query("path");
|
|
25539
|
-
if (!path) return c.json(require_dist.ErrorResponseSchema.parse({ error: "File path is required" }), 400);
|
|
25541
|
+
if (!path) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "File path is required" }), 400);
|
|
25540
25542
|
const row = agentId ? await (0, _keystrokehq_database.selectActiveAgentById)(agentId) : void 0;
|
|
25541
|
-
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Agent not found" }), 404);
|
|
25543
|
+
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Agent not found" }), 404);
|
|
25542
25544
|
const { organizationId } = c.get("organization");
|
|
25543
25545
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
25544
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
25546
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
25545
25547
|
let relativePath;
|
|
25546
25548
|
try {
|
|
25547
25549
|
relativePath = resolveMemoryRelativePath((0, node_path.join)((0, node_os.tmpdir)(), "agent-memory"), path);
|
|
25548
25550
|
} catch (error) {
|
|
25549
|
-
if ((error instanceof Error ? error.message : "Invalid file path").includes("must stay within")) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid file path" }), 400);
|
|
25551
|
+
if ((error instanceof Error ? error.message : "Invalid file path").includes("must stay within")) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid file path" }), 400);
|
|
25550
25552
|
throw error;
|
|
25551
25553
|
}
|
|
25552
25554
|
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
@@ -25554,7 +25556,7 @@ const handler$78 = async (c) => {
|
|
|
25554
25556
|
try {
|
|
25555
25557
|
bytes = await storage.getObject(agentMemoryFileStorageKey(row.id, relativePath));
|
|
25556
25558
|
} catch (error) {
|
|
25557
|
-
if (isStorageNotFoundError(error)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "File not found" }), 404);
|
|
25559
|
+
if (isStorageNotFoundError(error)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "File not found" }), 404);
|
|
25558
25560
|
throw error;
|
|
25559
25561
|
}
|
|
25560
25562
|
c.header("Content-Type", "text/plain; charset=utf-8");
|
|
@@ -25590,40 +25592,40 @@ function workspaceRelativePathsFromStorageKeys(keys) {
|
|
|
25590
25592
|
const handler$77 = async (c) => {
|
|
25591
25593
|
const agentId = c.req.param("agentId") ?? "";
|
|
25592
25594
|
const row = agentId ? await (0, _keystrokehq_database.selectActiveAgentById)(agentId) : void 0;
|
|
25593
|
-
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist.ListAgentWorkspaceFilesResponseSchema.parse({ files: [] }), 404);
|
|
25595
|
+
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist$1.ListAgentWorkspaceFilesResponseSchema.parse({ files: [] }), 404);
|
|
25594
25596
|
const { organizationId } = c.get("organization");
|
|
25595
25597
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
25596
|
-
if (!organization) return c.json(require_dist.ListAgentWorkspaceFilesResponseSchema.parse({ files: [] }), 404);
|
|
25598
|
+
if (!organization) return c.json(require_dist$1.ListAgentWorkspaceFilesResponseSchema.parse({ files: [] }), 404);
|
|
25597
25599
|
const storage = (0, _keystrokehq_platform_database.createOrgAgentStorageClient)(organization, row.id);
|
|
25598
25600
|
let keys;
|
|
25599
25601
|
try {
|
|
25600
25602
|
keys = await storage.listObjects("");
|
|
25601
25603
|
} catch (error) {
|
|
25602
|
-
if (require_dist.isStorageBucketNotFoundError(error)) return c.json(require_dist.ListAgentWorkspaceFilesResponseSchema.parse({ files: [] }));
|
|
25604
|
+
if (require_dist$1.isStorageBucketNotFoundError(error)) return c.json(require_dist$1.ListAgentWorkspaceFilesResponseSchema.parse({ files: [] }));
|
|
25603
25605
|
throw error;
|
|
25604
25606
|
}
|
|
25605
|
-
const files = workspaceRelativePathsFromStorageKeys(keys).map((path) => require_dist.AgentWorkspaceFileSummarySchema.parse({
|
|
25606
|
-
id: require_dist.agentWorkspaceFileId(path),
|
|
25607
|
+
const files = workspaceRelativePathsFromStorageKeys(keys).map((path) => require_dist$1.AgentWorkspaceFileSummarySchema.parse({
|
|
25608
|
+
id: require_dist$1.agentWorkspaceFileId(path),
|
|
25607
25609
|
path
|
|
25608
25610
|
}));
|
|
25609
|
-
return c.json(require_dist.ListAgentWorkspaceFilesResponseSchema.parse({ files }));
|
|
25611
|
+
return c.json(require_dist$1.ListAgentWorkspaceFilesResponseSchema.parse({ files }));
|
|
25610
25612
|
};
|
|
25611
25613
|
//#endregion
|
|
25612
25614
|
//#region src/routes/account/agents/[agentId]/workspace/files/content/GET.ts
|
|
25613
25615
|
const handler$76 = async (c) => {
|
|
25614
25616
|
const agentId = c.req.param("agentId") ?? "";
|
|
25615
25617
|
const path = c.req.query("path");
|
|
25616
|
-
if (!path) return c.json(require_dist.ErrorResponseSchema.parse({ error: "File path is required" }), 400);
|
|
25618
|
+
if (!path) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "File path is required" }), 400);
|
|
25617
25619
|
const row = agentId ? await (0, _keystrokehq_database.selectActiveAgentById)(agentId) : void 0;
|
|
25618
|
-
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Agent not found" }), 404);
|
|
25620
|
+
if (!row || !await canAccessProjectId(c, row.projectId, canAccessAgent)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Agent not found" }), 404);
|
|
25619
25621
|
const { organizationId } = c.get("organization");
|
|
25620
25622
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
25621
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
25623
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
25622
25624
|
let relativePath;
|
|
25623
25625
|
try {
|
|
25624
25626
|
relativePath = resolveWorkspaceRelativePath((0, node_path.join)((0, node_os.tmpdir)(), "agent-workspace"), path);
|
|
25625
25627
|
} catch (error) {
|
|
25626
|
-
if ((error instanceof Error ? error.message : "Invalid file path").includes("must stay within")) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid file path" }), 400);
|
|
25628
|
+
if ((error instanceof Error ? error.message : "Invalid file path").includes("must stay within")) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid file path" }), 400);
|
|
25627
25629
|
throw error;
|
|
25628
25630
|
}
|
|
25629
25631
|
const storage = (0, _keystrokehq_platform_database.createOrgAgentStorageClient)(organization, row.id);
|
|
@@ -25631,7 +25633,7 @@ const handler$76 = async (c) => {
|
|
|
25631
25633
|
try {
|
|
25632
25634
|
bytes = await storage.getObject(relativePath);
|
|
25633
25635
|
} catch (error) {
|
|
25634
|
-
if (require_dist.isStorageNotFoundError(error)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "File not found" }), 404);
|
|
25636
|
+
if (require_dist$1.isStorageNotFoundError(error)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "File not found" }), 404);
|
|
25635
25637
|
throw error;
|
|
25636
25638
|
}
|
|
25637
25639
|
c.header("Content-Type", "text/plain; charset=utf-8");
|
|
@@ -25655,7 +25657,7 @@ async function cancelHistoryRun(c, kind, cancel) {
|
|
|
25655
25657
|
const grantedProjectIdsList = await grantedProjectIds(c, historyListScope(accessContext(c)));
|
|
25656
25658
|
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organizationContext.organizationId, { grantedProjectIds: grantedProjectIdsList });
|
|
25657
25659
|
const historyRun = await enrichHistoryRun(run, new Map(projects.map((project) => [project.id, project.name])));
|
|
25658
|
-
return c.json(require_dist.HistoryRunCancelResponseSchema.parse(historyRun));
|
|
25660
|
+
return c.json(require_dist$1.HistoryRunCancelResponseSchema.parse(historyRun));
|
|
25659
25661
|
}
|
|
25660
25662
|
//#endregion
|
|
25661
25663
|
//#region src/routes/account/agents/sessions/[sessionId]/cancel/POST.ts
|
|
@@ -25663,7 +25665,7 @@ const handler$75 = (c) => cancelHistoryRun(c, "agent", _keystrokehq_database.can
|
|
|
25663
25665
|
//#endregion
|
|
25664
25666
|
//#region src/routes/account/resources/workflows.ts
|
|
25665
25667
|
function toWorkflowSummary(row, options) {
|
|
25666
|
-
return require_dist.WorkflowSummarySchema.parse({
|
|
25668
|
+
return require_dist$1.WorkflowSummarySchema.parse({
|
|
25667
25669
|
id: row.id,
|
|
25668
25670
|
slug: row.slug,
|
|
25669
25671
|
name: row.name.trim(),
|
|
@@ -25678,17 +25680,17 @@ function toWorkflowSummary(row, options) {
|
|
|
25678
25680
|
//#region src/routes/account/workflows/GET.ts
|
|
25679
25681
|
const handler$74 = async (c) => {
|
|
25680
25682
|
const filter = await resolveListProjectIds(c, listScope(c, workflowListScope(accessContext(c))), c.req.query("projectId"));
|
|
25681
|
-
if (filter === "empty") return c.json(require_dist.WorkflowSummaryListResponseSchema.parse([]));
|
|
25683
|
+
if (filter === "empty") return c.json(require_dist$1.WorkflowSummaryListResponseSchema.parse([]));
|
|
25682
25684
|
const rows = await (0, _keystrokehq_database.listActiveWorkflows)(filter);
|
|
25683
25685
|
const lastRunAtById = await (0, _keystrokehq_database.selectWorkflowLastRunAtByIds)(rows.map((row) => row.id));
|
|
25684
|
-
return c.json(require_dist.WorkflowSummaryListResponseSchema.parse(rows.map((row) => toWorkflowSummary(row, { lastRunAt: lastRunAtById.get(row.id) ?? null }))));
|
|
25686
|
+
return c.json(require_dist$1.WorkflowSummaryListResponseSchema.parse(rows.map((row) => toWorkflowSummary(row, { lastRunAt: lastRunAtById.get(row.id) ?? null }))));
|
|
25685
25687
|
};
|
|
25686
25688
|
//#endregion
|
|
25687
25689
|
//#region src/routes/account/workflows/[workflowId]/GET.ts
|
|
25688
25690
|
const handler$73 = async (c) => {
|
|
25689
25691
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
25690
25692
|
const row = workflowId ? await (0, _keystrokehq_database.selectActiveWorkflowById)(workflowId) : void 0;
|
|
25691
|
-
if (!row || !await canAccessProjectId(c, row.projectId, canAccessWorkflow)) return c.json(require_dist.WorkflowSummaryDetailResponseSchema.parse(null));
|
|
25693
|
+
if (!row || !await canAccessProjectId(c, row.projectId, canAccessWorkflow)) return c.json(require_dist$1.WorkflowSummaryDetailResponseSchema.parse(null));
|
|
25692
25694
|
touchResourceActivityBestEffort({
|
|
25693
25695
|
userId: c.get("user").id,
|
|
25694
25696
|
projectId: row.projectId,
|
|
@@ -25696,7 +25698,7 @@ const handler$73 = async (c) => {
|
|
|
25696
25698
|
resourceId: row.id
|
|
25697
25699
|
});
|
|
25698
25700
|
const lastRunAtById = await (0, _keystrokehq_database.selectWorkflowLastRunAtByIds)([row.id]);
|
|
25699
|
-
return c.json(require_dist.WorkflowSummaryDetailResponseSchema.parse(toWorkflowSummary(row, { lastRunAt: lastRunAtById.get(row.id) ?? null })));
|
|
25701
|
+
return c.json(require_dist$1.WorkflowSummaryDetailResponseSchema.parse(toWorkflowSummary(row, { lastRunAt: lastRunAtById.get(row.id) ?? null })));
|
|
25700
25702
|
};
|
|
25701
25703
|
//#endregion
|
|
25702
25704
|
//#region src/routes/account/workflows/resolve.ts
|
|
@@ -25712,13 +25714,13 @@ async function resolveWorkflow(c, workflowId) {
|
|
|
25712
25714
|
async function loadWorkflowManifestEntry(projectId, slug) {
|
|
25713
25715
|
const manifestJson = await (0, _keystrokehq_platform_database.selectActiveArtifactManifestForProject)(projectId);
|
|
25714
25716
|
if (!manifestJson) return null;
|
|
25715
|
-
return require_dist.parseStoredRouteManifest(manifestJson).entries.find((item) => item.kind === "workflow" && item.slug === slug) ?? null;
|
|
25717
|
+
return require_dist$1.parseStoredRouteManifest(manifestJson).entries.find((item) => item.kind === "workflow" && item.slug === slug) ?? null;
|
|
25716
25718
|
}
|
|
25717
25719
|
/** The full active-deploy route manifest for a project (canvas needs the whole entry set). */
|
|
25718
25720
|
async function loadActiveManifest(projectId) {
|
|
25719
25721
|
const manifestJson = await (0, _keystrokehq_platform_database.selectActiveArtifactManifestForProject)(projectId);
|
|
25720
25722
|
if (!manifestJson) return null;
|
|
25721
|
-
return require_dist.parseStoredRouteManifest(manifestJson);
|
|
25723
|
+
return require_dist$1.parseStoredRouteManifest(manifestJson);
|
|
25722
25724
|
}
|
|
25723
25725
|
//#endregion
|
|
25724
25726
|
//#region src/routes/account/workflows/[workflowId]/canvas/build-canvas.ts
|
|
@@ -25736,7 +25738,7 @@ function indexManifest(entries) {
|
|
|
25736
25738
|
};
|
|
25737
25739
|
}
|
|
25738
25740
|
function fieldsFromSchema(schema) {
|
|
25739
|
-
return require_dist.jsonSchemaToWorkflowInputSchema(schema ?? {}).fields;
|
|
25741
|
+
return require_dist$1.jsonSchemaToWorkflowInputSchema(schema ?? {}).fields;
|
|
25740
25742
|
}
|
|
25741
25743
|
/** A read-only inspector row showing a captured llm option as a literal value. */
|
|
25742
25744
|
function llmOptionRow(key, label, value) {
|
|
@@ -26076,13 +26078,13 @@ const ANNOTATIONS_GENERATOR_VERSION = "wf-canvas-annotations-v1";
|
|
|
26076
26078
|
const handler$72 = async (c) => {
|
|
26077
26079
|
const { organizationId } = c.get("organization");
|
|
26078
26080
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
26079
|
-
if (!workflowId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26081
|
+
if (!workflowId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26080
26082
|
const resolved = await resolveWorkflow(c, workflowId);
|
|
26081
|
-
if (!resolved) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26083
|
+
if (!resolved) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26082
26084
|
const { row, projectId } = resolved;
|
|
26083
26085
|
const manifest = await loadActiveManifest(projectId);
|
|
26084
26086
|
const workflowEntry = manifest?.entries.find((entry) => entry.kind === "workflow" && entry.slug === row.slug);
|
|
26085
|
-
if (!workflowEntry || workflowEntry.kind !== "workflow" || !workflowEntry.flowGraph) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Canvas not available" }), 404);
|
|
26087
|
+
if (!workflowEntry || workflowEntry.kind !== "workflow" || !workflowEntry.flowGraph) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Canvas not available" }), 404);
|
|
26086
26088
|
const triggers = await (0, _keystrokehq_database.listWorkspaceTriggers)([projectId]);
|
|
26087
26089
|
const { graph, nodeMetadata, codeBlocks } = buildWorkflowCanvas({
|
|
26088
26090
|
workflowSlug: row.slug,
|
|
@@ -26090,7 +26092,7 @@ const handler$72 = async (c) => {
|
|
|
26090
26092
|
entries: manifest?.entries ?? [],
|
|
26091
26093
|
triggers
|
|
26092
26094
|
});
|
|
26093
|
-
const model = require_dist.DEFAULT_WORKFLOW_CANVAS_MODEL;
|
|
26095
|
+
const model = require_dist$1.DEFAULT_WORKFLOW_CANVAS_MODEL;
|
|
26094
26096
|
const graphHash = (0, node_crypto.createHash)("sha256").update(JSON.stringify(workflowEntry.flowGraph)).digest("hex");
|
|
26095
26097
|
const hash = (0, node_crypto.createHash)("sha256").update(JSON.stringify({
|
|
26096
26098
|
source: workflowEntry.flowGraphSourceHash ?? "",
|
|
@@ -26098,7 +26100,7 @@ const handler$72 = async (c) => {
|
|
|
26098
26100
|
model,
|
|
26099
26101
|
version: ANNOTATIONS_GENERATOR_VERSION
|
|
26100
26102
|
})).digest("hex");
|
|
26101
|
-
if (codeBlocks.length === 0) return c.json(require_dist.WorkflowCanvasSchema.parse({
|
|
26103
|
+
if (codeBlocks.length === 0) return c.json(require_dist$1.WorkflowCanvasSchema.parse({
|
|
26102
26104
|
graph,
|
|
26103
26105
|
nodeMetadata,
|
|
26104
26106
|
annotations: {},
|
|
@@ -26110,7 +26112,7 @@ const handler$72 = async (c) => {
|
|
|
26110
26112
|
const cache = await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.selectWorkflowCanvasAnnotations)(workflowId));
|
|
26111
26113
|
const cached = cache?.annotations ?? {};
|
|
26112
26114
|
if (cache && cache.hash === hash) {
|
|
26113
|
-
if (cache.status === "ready" || cache.status === "failed") return c.json(require_dist.WorkflowCanvasSchema.parse({
|
|
26115
|
+
if (cache.status === "ready" || cache.status === "failed") return c.json(require_dist$1.WorkflowCanvasSchema.parse({
|
|
26114
26116
|
graph,
|
|
26115
26117
|
nodeMetadata,
|
|
26116
26118
|
annotations: cached,
|
|
@@ -26119,7 +26121,7 @@ const handler$72 = async (c) => {
|
|
|
26119
26121
|
generatedAt: cache.generatedAt ? cache.generatedAt.toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
26120
26122
|
model: cache.model ?? model
|
|
26121
26123
|
}));
|
|
26122
|
-
if (cache.status === "generating") return c.json(require_dist.WorkflowCanvasSchema.parse({
|
|
26124
|
+
if (cache.status === "generating") return c.json(require_dist$1.WorkflowCanvasSchema.parse({
|
|
26123
26125
|
graph,
|
|
26124
26126
|
nodeMetadata,
|
|
26125
26127
|
annotations: cached,
|
|
@@ -26130,7 +26132,7 @@ const handler$72 = async (c) => {
|
|
|
26130
26132
|
}));
|
|
26131
26133
|
}
|
|
26132
26134
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
26133
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26135
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26134
26136
|
await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.setWorkflowCanvasAnnotationsGenerating)(workflowId, hash));
|
|
26135
26137
|
try {
|
|
26136
26138
|
await (await (0, _keystrokehq_http.getProjectScheduler)(organization, projectId)).enqueue({
|
|
@@ -26154,7 +26156,7 @@ const handler$72 = async (c) => {
|
|
|
26154
26156
|
});
|
|
26155
26157
|
} catch {
|
|
26156
26158
|
await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.updateWorkflowCanvasAnnotations)(workflowId, { status: "failed" }));
|
|
26157
|
-
return c.json(require_dist.WorkflowCanvasSchema.parse({
|
|
26159
|
+
return c.json(require_dist$1.WorkflowCanvasSchema.parse({
|
|
26158
26160
|
graph,
|
|
26159
26161
|
nodeMetadata,
|
|
26160
26162
|
annotations: {},
|
|
@@ -26164,7 +26166,7 @@ const handler$72 = async (c) => {
|
|
|
26164
26166
|
model
|
|
26165
26167
|
}));
|
|
26166
26168
|
}
|
|
26167
|
-
return c.json(require_dist.WorkflowCanvasSchema.parse({
|
|
26169
|
+
return c.json(require_dist$1.WorkflowCanvasSchema.parse({
|
|
26168
26170
|
graph,
|
|
26169
26171
|
nodeMetadata,
|
|
26170
26172
|
annotations: {},
|
|
@@ -26250,17 +26252,17 @@ function toBinding(key, description) {
|
|
|
26250
26252
|
*/
|
|
26251
26253
|
const handler$71 = async (c) => {
|
|
26252
26254
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
26253
|
-
if (!workflowId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26255
|
+
if (!workflowId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26254
26256
|
const resolved = await resolveWorkflow(c, workflowId);
|
|
26255
|
-
if (!resolved) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26257
|
+
if (!resolved) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26256
26258
|
const { row, projectId } = resolved;
|
|
26257
26259
|
const manifest = await loadActiveManifest(projectId);
|
|
26258
26260
|
const workflowEntry = manifest?.entries.find((entry) => entry.kind === "workflow" && entry.slug === row.slug);
|
|
26259
|
-
if (!workflowEntry || workflowEntry.kind !== "workflow" || !workflowEntry.flowGraph) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Canvas not available" }), 404);
|
|
26261
|
+
if (!workflowEntry || workflowEntry.kind !== "workflow" || !workflowEntry.flowGraph) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Canvas not available" }), 404);
|
|
26260
26262
|
const nodeRequirements = collectStepCredentialRequirements(workflowEntry.flowGraph, manifest?.entries ?? []);
|
|
26261
26263
|
const userId = c.get("user").id;
|
|
26262
26264
|
const bindings = await (0, _keystrokehq_database.runWithProjectScope)(projectId, async () => {
|
|
26263
|
-
const context = await require_dist.withCredentialAssignments({
|
|
26265
|
+
const context = await require_dist$1.withCredentialAssignments({
|
|
26264
26266
|
orgId: (0, _keystrokehq_database.getServerTenantScopeId)(),
|
|
26265
26267
|
projectId: (0, _keystrokehq_database.getProjectScopeId)(),
|
|
26266
26268
|
userId,
|
|
@@ -26274,7 +26276,7 @@ const handler$71 = async (c) => {
|
|
|
26274
26276
|
const consumerId = `step:${nodeId}`;
|
|
26275
26277
|
const nodeBindings = [];
|
|
26276
26278
|
for (const requirement of requirements) {
|
|
26277
|
-
const description = await require_dist.describeCredentialBinding({
|
|
26279
|
+
const description = await require_dist$1.describeCredentialBinding({
|
|
26278
26280
|
key: requirement.key,
|
|
26279
26281
|
...requirement.scope ? { scope: requirement.scope } : {},
|
|
26280
26282
|
consumerId,
|
|
@@ -26286,7 +26288,7 @@ const handler$71 = async (c) => {
|
|
|
26286
26288
|
}
|
|
26287
26289
|
return result;
|
|
26288
26290
|
});
|
|
26289
|
-
return c.json(require_dist.WorkflowCanvasCredentialBindingsSchema.parse(bindings));
|
|
26291
|
+
return c.json(require_dist$1.WorkflowCanvasCredentialBindingsSchema.parse(bindings));
|
|
26290
26292
|
};
|
|
26291
26293
|
//#endregion
|
|
26292
26294
|
//#region src/routes/account/workflows/[workflowId]/canvas/build-run-overlay.ts
|
|
@@ -26406,15 +26408,15 @@ function toCanvasRunStatus(status) {
|
|
|
26406
26408
|
const handler$70 = async (c) => {
|
|
26407
26409
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
26408
26410
|
const runId = c.req.param("runId") ?? "";
|
|
26409
|
-
if (!workflowId.trim() || !runId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid workflow or run id" }), 400);
|
|
26411
|
+
if (!workflowId.trim() || !runId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid workflow or run id" }), 400);
|
|
26410
26412
|
const resolved = await resolveWorkflow(c, workflowId);
|
|
26411
|
-
if (!resolved) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26413
|
+
if (!resolved) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26412
26414
|
const { row, projectId } = resolved;
|
|
26413
26415
|
const run = await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.selectWorkflowRunForWorkflow)(row.slug, runId));
|
|
26414
|
-
if (!run) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Run not found" }), 404);
|
|
26416
|
+
if (!run) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Run not found" }), 404);
|
|
26415
26417
|
const manifest = await loadActiveManifest(projectId);
|
|
26416
26418
|
const workflowEntry = manifest?.entries.find((entry) => entry.kind === "workflow" && entry.slug === row.slug);
|
|
26417
|
-
if (!workflowEntry || workflowEntry.kind !== "workflow" || !workflowEntry.flowGraph) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Canvas not available" }), 404);
|
|
26419
|
+
if (!workflowEntry || workflowEntry.kind !== "workflow" || !workflowEntry.flowGraph) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Canvas not available" }), 404);
|
|
26418
26420
|
const triggers = await (0, _keystrokehq_database.listWorkspaceTriggers)([projectId]);
|
|
26419
26421
|
const { graph } = buildWorkflowCanvas({
|
|
26420
26422
|
workflowSlug: row.slug,
|
|
@@ -26429,7 +26431,7 @@ const handler$70 = async (c) => {
|
|
|
26429
26431
|
events,
|
|
26430
26432
|
runStatus
|
|
26431
26433
|
});
|
|
26432
|
-
return c.json(require_dist.WorkflowCanvasRunSchema.parse({
|
|
26434
|
+
return c.json(require_dist$1.WorkflowCanvasRunSchema.parse({
|
|
26433
26435
|
runId,
|
|
26434
26436
|
status: runStatus,
|
|
26435
26437
|
startedAt: (run.startedAt ?? run.triggeredAt).toISOString(),
|
|
@@ -26450,9 +26452,9 @@ async function loadWorkflowSource(organization, projectId, sourcePath) {
|
|
|
26450
26452
|
try {
|
|
26451
26453
|
const artifact = await (0, _keystrokehq_platform_database.selectActiveProjectArtifactForProject)(projectId);
|
|
26452
26454
|
if (!artifact?.sourceManifestJson) return null;
|
|
26453
|
-
const file = require_dist.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson).files.find((entry) => entry.path === sourcePath);
|
|
26455
|
+
const file = require_dist$1.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson).files.find((entry) => entry.path === sourcePath);
|
|
26454
26456
|
if (!file) return null;
|
|
26455
|
-
const bytes = await (0, _keystrokehq_platform_database.createOrgStorageClient)(organization).getObject(require_dist.projectSourceBlobKey(projectId, file.hash));
|
|
26457
|
+
const bytes = await (0, _keystrokehq_platform_database.createOrgStorageClient)(organization).getObject(require_dist$1.projectSourceBlobKey(projectId, file.hash));
|
|
26456
26458
|
return new TextDecoder().decode(bytes);
|
|
26457
26459
|
} catch {
|
|
26458
26460
|
return null;
|
|
@@ -26461,13 +26463,13 @@ async function loadWorkflowSource(organization, projectId, sourcePath) {
|
|
|
26461
26463
|
const handler$69 = async (c) => {
|
|
26462
26464
|
const { organizationId } = c.get("organization");
|
|
26463
26465
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
26464
|
-
if (!workflowId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26466
|
+
if (!workflowId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26465
26467
|
const resolved = await resolveWorkflow(c, workflowId);
|
|
26466
|
-
if (!resolved) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26468
|
+
if (!resolved) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26467
26469
|
const { row, projectId } = resolved;
|
|
26468
26470
|
const manifest = await loadActiveManifest(projectId);
|
|
26469
26471
|
const workflowEntry = manifest?.entries.find((entry) => entry.kind === "workflow" && entry.slug === row.slug);
|
|
26470
|
-
if (!workflowEntry || workflowEntry.kind !== "workflow" || !workflowEntry.flowGraph) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Overview not available" }), 404);
|
|
26472
|
+
if (!workflowEntry || workflowEntry.kind !== "workflow" || !workflowEntry.flowGraph) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Overview not available" }), 404);
|
|
26471
26473
|
const triggers = await (0, _keystrokehq_database.listWorkspaceTriggers)([projectId]);
|
|
26472
26474
|
const { graph, nodeMetadata } = buildWorkflowCanvas({
|
|
26473
26475
|
workflowSlug: row.slug,
|
|
@@ -26492,7 +26494,7 @@ const handler$69 = async (c) => {
|
|
|
26492
26494
|
...meta?.toolCount !== void 0 ? { toolCount: meta.toolCount } : {}
|
|
26493
26495
|
};
|
|
26494
26496
|
});
|
|
26495
|
-
const model = require_dist.DEFAULT_WORKFLOW_OVERVIEW_MODEL;
|
|
26497
|
+
const model = require_dist$1.DEFAULT_WORKFLOW_OVERVIEW_MODEL;
|
|
26496
26498
|
const graphHash = (0, node_crypto.createHash)("sha256").update(JSON.stringify(workflowEntry.flowGraph)).digest("hex");
|
|
26497
26499
|
const hash = (0, node_crypto.createHash)("sha256").update(JSON.stringify({
|
|
26498
26500
|
source: workflowEntry.flowGraphSourceHash ?? "",
|
|
@@ -26504,7 +26506,7 @@ const handler$69 = async (c) => {
|
|
|
26504
26506
|
const cache = await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.selectWorkflowOverview)(workflowId));
|
|
26505
26507
|
const cachedPhases = cache?.phases ?? [];
|
|
26506
26508
|
if (cache && cache.hash === hash) {
|
|
26507
|
-
if (cache.status === "ready" || cache.status === "failed") return c.json(require_dist.WorkspaceWorkflowOverviewSchema.parse({
|
|
26509
|
+
if (cache.status === "ready" || cache.status === "failed") return c.json(require_dist$1.WorkspaceWorkflowOverviewSchema.parse({
|
|
26508
26510
|
status: "ready",
|
|
26509
26511
|
summary: cache.summary ?? "",
|
|
26510
26512
|
phases: cachedPhases,
|
|
@@ -26512,7 +26514,7 @@ const handler$69 = async (c) => {
|
|
|
26512
26514
|
generatedAt: cache.generatedAt ? cache.generatedAt.toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
26513
26515
|
model: cache.model ?? model
|
|
26514
26516
|
}));
|
|
26515
|
-
if (cache.status === "generating") return c.json(require_dist.WorkspaceWorkflowOverviewSchema.parse({
|
|
26517
|
+
if (cache.status === "generating") return c.json(require_dist$1.WorkspaceWorkflowOverviewSchema.parse({
|
|
26516
26518
|
status: "generating",
|
|
26517
26519
|
summary: cache.summary ?? "",
|
|
26518
26520
|
phases: [],
|
|
@@ -26522,7 +26524,7 @@ const handler$69 = async (c) => {
|
|
|
26522
26524
|
}));
|
|
26523
26525
|
}
|
|
26524
26526
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
26525
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26527
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26526
26528
|
await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.setWorkflowOverviewGenerating)(workflowId, hash));
|
|
26527
26529
|
const source = await loadWorkflowSource(organization, projectId, workflowEntry.moduleFile);
|
|
26528
26530
|
try {
|
|
@@ -26550,7 +26552,7 @@ const handler$69 = async (c) => {
|
|
|
26550
26552
|
} catch {
|
|
26551
26553
|
await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.updateWorkflowOverview)(workflowId, { status: "failed" }));
|
|
26552
26554
|
}
|
|
26553
|
-
return c.json(require_dist.WorkspaceWorkflowOverviewSchema.parse({
|
|
26555
|
+
return c.json(require_dist$1.WorkspaceWorkflowOverviewSchema.parse({
|
|
26554
26556
|
status: "generating",
|
|
26555
26557
|
summary: "",
|
|
26556
26558
|
phases: [],
|
|
@@ -26563,13 +26565,13 @@ const handler$69 = async (c) => {
|
|
|
26563
26565
|
//#region src/routes/account/workflows/[workflowId]/run-inputs/GET.ts
|
|
26564
26566
|
const handler$68 = async (c) => {
|
|
26565
26567
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
26566
|
-
if (!workflowId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26568
|
+
if (!workflowId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26567
26569
|
const resolved = await resolveWorkflow(c, workflowId);
|
|
26568
|
-
if (!resolved) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26570
|
+
if (!resolved) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26569
26571
|
const { row, projectId } = resolved;
|
|
26570
|
-
const schema = require_dist.jsonSchemaToWorkflowInputSchema((await loadWorkflowManifestEntry(projectId, row.slug))?.requestSchema ?? {});
|
|
26572
|
+
const schema = require_dist$1.jsonSchemaToWorkflowInputSchema((await loadWorkflowManifestEntry(projectId, row.slug))?.requestSchema ?? {});
|
|
26571
26573
|
const values = await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.selectWorkflowRunInputValues)(workflowId));
|
|
26572
|
-
return c.json(require_dist.WorkflowRunInputsSchema.parse({
|
|
26574
|
+
return c.json(require_dist$1.WorkflowRunInputsSchema.parse({
|
|
26573
26575
|
schema,
|
|
26574
26576
|
values
|
|
26575
26577
|
}));
|
|
@@ -26578,21 +26580,21 @@ const handler$68 = async (c) => {
|
|
|
26578
26580
|
//#region src/routes/account/workflows/[workflowId]/run-inputs/PUT.ts
|
|
26579
26581
|
const handler$67 = async (c) => {
|
|
26580
26582
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
26581
|
-
if (!workflowId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26583
|
+
if (!workflowId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26582
26584
|
const resolved = await resolveWorkflow(c, workflowId);
|
|
26583
|
-
if (!resolved) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26585
|
+
if (!resolved) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26584
26586
|
let body;
|
|
26585
26587
|
try {
|
|
26586
|
-
body = require_dist.WorkflowRunInputsPutBodySchema.parse(await c.req.json());
|
|
26588
|
+
body = require_dist$1.WorkflowRunInputsPutBodySchema.parse(await c.req.json());
|
|
26587
26589
|
} catch {
|
|
26588
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid request body" }), 400);
|
|
26590
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid request body" }), 400);
|
|
26589
26591
|
}
|
|
26590
26592
|
const { row, projectId } = resolved;
|
|
26591
|
-
const schema = require_dist.jsonSchemaToWorkflowInputSchema((await loadWorkflowManifestEntry(projectId, row.slug))?.requestSchema ?? {});
|
|
26592
|
-
const validation = require_dist.validateWorkflowRunInputValues(schema, body);
|
|
26593
|
-
if (!validation.ok) return c.json(require_dist.ErrorResponseSchema.parse({ error: validation.error }), 400);
|
|
26593
|
+
const schema = require_dist$1.jsonSchemaToWorkflowInputSchema((await loadWorkflowManifestEntry(projectId, row.slug))?.requestSchema ?? {});
|
|
26594
|
+
const validation = require_dist$1.validateWorkflowRunInputValues(schema, body);
|
|
26595
|
+
if (!validation.ok) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: validation.error }), 400);
|
|
26594
26596
|
await (0, _keystrokehq_database.runWithProjectScope)(projectId, () => (0, _keystrokehq_database.updateWorkflowRunInputValues)(workflowId, body));
|
|
26595
|
-
return c.json(require_dist.WorkflowRunInputsSchema.parse({
|
|
26597
|
+
return c.json(require_dist$1.WorkflowRunInputsSchema.parse({
|
|
26596
26598
|
schema,
|
|
26597
26599
|
values: body
|
|
26598
26600
|
}));
|
|
@@ -26611,20 +26613,20 @@ function parseRunInput(requestSchema, input) {
|
|
|
26611
26613
|
const handler$66 = async (c) => {
|
|
26612
26614
|
const { organizationId } = c.get("organization");
|
|
26613
26615
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
26614
|
-
if (!workflowId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26616
|
+
if (!workflowId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26615
26617
|
const resolved = await resolveWorkflow(c, workflowId);
|
|
26616
|
-
if (!resolved) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26618
|
+
if (!resolved) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26617
26619
|
const { row, projectId } = resolved;
|
|
26618
26620
|
const workflowEntry = (await loadActiveManifest(projectId))?.entries.find((entry) => entry.kind === "workflow" && entry.slug === row.slug);
|
|
26619
|
-
if (!workflowEntry || workflowEntry.kind !== "workflow") return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not deployed" }), 404);
|
|
26621
|
+
if (!workflowEntry || workflowEntry.kind !== "workflow") return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not deployed" }), 404);
|
|
26620
26622
|
let body = {};
|
|
26621
26623
|
if ((c.req.header("content-type") ?? "").includes("application/json")) try {
|
|
26622
26624
|
body = await c.req.json();
|
|
26623
26625
|
} catch {
|
|
26624
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid JSON body" }), 400);
|
|
26626
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid JSON body" }), 400);
|
|
26625
26627
|
}
|
|
26626
26628
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
26627
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26629
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26628
26630
|
const userId = c.get("user").id;
|
|
26629
26631
|
try {
|
|
26630
26632
|
const runId = await (0, _keystrokehq_database.runWithProjectScope)(projectId, async () => {
|
|
@@ -26639,7 +26641,7 @@ const handler$66 = async (c) => {
|
|
|
26639
26641
|
});
|
|
26640
26642
|
return c.json({ runId }, 202);
|
|
26641
26643
|
} catch (error) {
|
|
26642
|
-
if (error instanceof zod.ZodError) return c.json(require_dist.validationErrorResponse(error, "Invalid workflow input"), 400);
|
|
26644
|
+
if (error instanceof zod.ZodError) return c.json(require_dist$1.validationErrorResponse(error, "Invalid workflow input"), 400);
|
|
26643
26645
|
throw error;
|
|
26644
26646
|
}
|
|
26645
26647
|
};
|
|
@@ -26647,12 +26649,12 @@ const handler$66 = async (c) => {
|
|
|
26647
26649
|
//#region src/routes/account/workflows/[workflowId]/runs/GET.ts
|
|
26648
26650
|
const handler$65 = async (c) => {
|
|
26649
26651
|
const workflowId = c.req.param("workflowId") ?? "";
|
|
26650
|
-
if (!workflowId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26652
|
+
if (!workflowId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid workflow id" }), 400);
|
|
26651
26653
|
const resolved = await resolveWorkflow(c, workflowId);
|
|
26652
|
-
if (!resolved) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26654
|
+
if (!resolved) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Workflow not found" }), 404);
|
|
26653
26655
|
const { row, projectId } = resolved;
|
|
26654
26656
|
const scope = listScope(c, projectListScope(accessContext(c)));
|
|
26655
|
-
if (await resolveListProjectIds(c, scope, projectId) === "empty") return c.json(require_dist.HistoryRunListResponseSchema.parse([]));
|
|
26657
|
+
if (await resolveListProjectIds(c, scope, projectId) === "empty") return c.json(require_dist$1.HistoryRunListResponseSchema.parse([]));
|
|
26656
26658
|
const runs = await (0, _keystrokehq_database.listHistoryRuns)({
|
|
26657
26659
|
kind: "workflow",
|
|
26658
26660
|
projectIds: [projectId],
|
|
@@ -26664,7 +26666,7 @@ const handler$65 = async (c) => {
|
|
|
26664
26666
|
const { organizationId } = c.get("organization");
|
|
26665
26667
|
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organizationId, { grantedProjectIds: await grantedProjectIds(c, scope) });
|
|
26666
26668
|
const projectNameById = new Map(projects.map((project) => [project.id, project.name]));
|
|
26667
|
-
return c.json(require_dist.HistoryRunListResponseSchema.parse(await enrichHistoryRuns(runs, projectNameById)));
|
|
26669
|
+
return c.json(require_dist$1.HistoryRunListResponseSchema.parse(await enrichHistoryRuns(runs, projectNameById)));
|
|
26668
26670
|
};
|
|
26669
26671
|
//#endregion
|
|
26670
26672
|
//#region src/routes/account/workflows/runs/[runId]/cancel/POST.ts
|
|
@@ -26673,7 +26675,7 @@ const handler$64 = (c) => cancelHistoryRun(c, "workflow", _keystrokehq_database.
|
|
|
26673
26675
|
//#region src/routes/account/resources/skills.ts
|
|
26674
26676
|
function toSkillSummary(row) {
|
|
26675
26677
|
const name = row.name?.trim() || titleCaseKey(row.slug);
|
|
26676
|
-
return require_dist.SkillSummarySchema.parse({
|
|
26678
|
+
return require_dist$1.SkillSummarySchema.parse({
|
|
26677
26679
|
id: row.id,
|
|
26678
26680
|
slug: row.slug,
|
|
26679
26681
|
name,
|
|
@@ -26687,23 +26689,23 @@ function toSkillSummary(row) {
|
|
|
26687
26689
|
//#region src/routes/account/skills/GET.ts
|
|
26688
26690
|
const handler$63 = async (c) => {
|
|
26689
26691
|
const filter = await resolveListProjectIds(c, listScope(c, skillListScope(accessContext(c))), c.req.query("projectId"));
|
|
26690
|
-
if (filter === "empty") return c.json(require_dist.SkillSummaryListResponseSchema.parse([]));
|
|
26692
|
+
if (filter === "empty") return c.json(require_dist$1.SkillSummaryListResponseSchema.parse([]));
|
|
26691
26693
|
const rows = await (0, _keystrokehq_database.listActiveSkills)(filter);
|
|
26692
|
-
return c.json(require_dist.SkillSummaryListResponseSchema.parse(rows.map(toSkillSummary)));
|
|
26694
|
+
return c.json(require_dist$1.SkillSummaryListResponseSchema.parse(rows.map(toSkillSummary)));
|
|
26693
26695
|
};
|
|
26694
26696
|
//#endregion
|
|
26695
26697
|
//#region src/routes/account/skills/[skillId]/GET.ts
|
|
26696
26698
|
const handler$62 = async (c) => {
|
|
26697
26699
|
const skillId = c.req.param("skillId") ?? "";
|
|
26698
26700
|
const row = skillId ? await (0, _keystrokehq_database.selectActiveSkillById)(skillId) : void 0;
|
|
26699
|
-
if (!row || !await canAccessProjectId(c, row.projectId, canAccessSkill)) return c.json(require_dist.SkillSummaryDetailResponseSchema.parse(null));
|
|
26701
|
+
if (!row || !await canAccessProjectId(c, row.projectId, canAccessSkill)) return c.json(require_dist$1.SkillSummaryDetailResponseSchema.parse(null));
|
|
26700
26702
|
touchResourceActivityBestEffort({
|
|
26701
26703
|
userId: c.get("user").id,
|
|
26702
26704
|
projectId: row.projectId,
|
|
26703
26705
|
resourceKind: "skill",
|
|
26704
26706
|
resourceId: row.id
|
|
26705
26707
|
});
|
|
26706
|
-
return c.json(require_dist.SkillSummaryDetailResponseSchema.parse(toSkillSummary(row)));
|
|
26708
|
+
return c.json(require_dist$1.SkillSummaryDetailResponseSchema.parse(toSkillSummary(row)));
|
|
26707
26709
|
};
|
|
26708
26710
|
//#endregion
|
|
26709
26711
|
//#region src/routes/account/triggers/enrich.ts
|
|
@@ -26724,7 +26726,7 @@ function buildTriggerWebhookUrl(record, tokenByProjectRoute) {
|
|
|
26724
26726
|
const route = webhookRouteFromEndpoint(record.webhookEndpoint);
|
|
26725
26727
|
const token = tokenByProjectRoute.get(webhookTokenKey(record.projectId, route));
|
|
26726
26728
|
if (!token) return null;
|
|
26727
|
-
const platformOrigin = require_dist.resolveExternalPlatformOrigin();
|
|
26729
|
+
const platformOrigin = require_dist$1.resolveExternalPlatformOrigin();
|
|
26728
26730
|
if (!platformOrigin) return null;
|
|
26729
26731
|
return `${`${platformOrigin.replace(/\/$/, "")}/api/projects/${encodeURIComponent(record.projectId)}`}${route.startsWith("/") ? route : `/${route}`}?token=${encodeURIComponent(token)}`;
|
|
26730
26732
|
}
|
|
@@ -26804,7 +26806,7 @@ const handler$61 = async (c) => {
|
|
|
26804
26806
|
const organization = c.get("organization");
|
|
26805
26807
|
const scope = listScope(c, projectListScope(accessContext(c)));
|
|
26806
26808
|
const filter = await resolveListProjectIds(c, scope, c.req.query("projectId"));
|
|
26807
|
-
if (filter === "empty") return c.json(require_dist.WorkspaceTriggerListResponseSchema.parse([]));
|
|
26809
|
+
if (filter === "empty") return c.json(require_dist$1.WorkspaceTriggerListResponseSchema.parse([]));
|
|
26808
26810
|
const [records, projects, webhookKeys] = await Promise.all([
|
|
26809
26811
|
(0, _keystrokehq_database.listWorkspaceTriggers)(filter.projectIds),
|
|
26810
26812
|
(0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: await grantedProjectIds(c, scope) }),
|
|
@@ -26812,38 +26814,38 @@ const handler$61 = async (c) => {
|
|
|
26812
26814
|
]);
|
|
26813
26815
|
const projectNameById = new Map(projects.map((project) => [project.id, project.name]));
|
|
26814
26816
|
const tokens = webhookTokensByProjectRoute(webhookKeys);
|
|
26815
|
-
return c.json(require_dist.WorkspaceTriggerListResponseSchema.parse(records.map((record) => toWorkspaceTriggerDetail(record, projectNameById.get(record.projectId) ?? "Unknown project", buildTriggerWebhookUrl(record, tokens)))));
|
|
26817
|
+
return c.json(require_dist$1.WorkspaceTriggerListResponseSchema.parse(records.map((record) => toWorkspaceTriggerDetail(record, projectNameById.get(record.projectId) ?? "Unknown project", buildTriggerWebhookUrl(record, tokens)))));
|
|
26816
26818
|
};
|
|
26817
26819
|
//#endregion
|
|
26818
26820
|
//#region src/routes/account/triggers/[triggerId]/GET.ts
|
|
26819
26821
|
const handler$60 = async (c) => {
|
|
26820
26822
|
const organization = c.get("organization");
|
|
26821
26823
|
const triggerId = c.req.param("triggerId") ?? "";
|
|
26822
|
-
if (!triggerId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid trigger id" }), 400);
|
|
26824
|
+
if (!triggerId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid trigger id" }), 400);
|
|
26823
26825
|
const scope = listScope(c, projectListScope(accessContext(c)));
|
|
26824
26826
|
const filter = await resolveListProjectIds(c, scope);
|
|
26825
|
-
if (filter === "empty") return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26827
|
+
if (filter === "empty") return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26826
26828
|
const record = (await (0, _keystrokehq_database.listWorkspaceTriggers)(filter.projectIds)).find((entry) => entry.id === triggerId);
|
|
26827
|
-
if (!record) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26829
|
+
if (!record) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26828
26830
|
const [projects, webhookKeys] = await Promise.all([(0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: await grantedProjectIds(c, scope) }), (0, _keystrokehq_platform_database.listWebhookApiKeysForProject)(record.projectId)]);
|
|
26829
26831
|
const projectName = projects.find((project) => project.id === record.projectId)?.name ?? "Unknown project";
|
|
26830
26832
|
const webhookUrl = buildTriggerWebhookUrl(record, webhookTokensByProjectRoute(webhookKeys));
|
|
26831
|
-
return c.json(require_dist.WorkspaceTriggerDetailSchema.parse(toWorkspaceTriggerDetail(record, projectName, webhookUrl)));
|
|
26833
|
+
return c.json(require_dist$1.WorkspaceTriggerDetailSchema.parse(toWorkspaceTriggerDetail(record, projectName, webhookUrl)));
|
|
26832
26834
|
};
|
|
26833
26835
|
//#endregion
|
|
26834
26836
|
//#region src/routes/account/triggers/[triggerId]/runs/GET.ts
|
|
26835
26837
|
const handler$59 = async (c) => {
|
|
26836
26838
|
const triggerId = c.req.param("triggerId") ?? "";
|
|
26837
|
-
if (!triggerId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid trigger id" }), 400);
|
|
26839
|
+
if (!triggerId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid trigger id" }), 400);
|
|
26838
26840
|
const filter = await resolveListProjectIds(c, listScope(c, projectListScope(accessContext(c))));
|
|
26839
|
-
if (filter === "empty") return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26840
|
-
const query = require_dist.TriggerRunListQuerySchema.parse({
|
|
26841
|
+
if (filter === "empty") return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26842
|
+
const query = require_dist$1.TriggerRunListQuerySchema.parse({
|
|
26841
26843
|
limit: c.req.query("limit"),
|
|
26842
26844
|
cursor: c.req.query("cursor")?.trim() || void 0,
|
|
26843
26845
|
triggerType: c.req.query("triggerType")?.trim() || void 0
|
|
26844
26846
|
});
|
|
26845
26847
|
const record = (await (0, _keystrokehq_database.listWorkspaceTriggers)(filter.projectIds)).find((entry) => entry.id === triggerId);
|
|
26846
|
-
if (!record) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26848
|
+
if (!record) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26847
26849
|
const result = await (0, _keystrokehq_database.listWorkspaceTriggerRunRows)({
|
|
26848
26850
|
projectId: record.projectId,
|
|
26849
26851
|
triggerId: record.id,
|
|
@@ -26851,8 +26853,8 @@ const handler$59 = async (c) => {
|
|
|
26851
26853
|
cursor: query.cursor,
|
|
26852
26854
|
triggerType: query.triggerType
|
|
26853
26855
|
});
|
|
26854
|
-
if (!result) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26855
|
-
return c.json(require_dist.WorkspaceTriggerRunListResponseSchema.parse({
|
|
26856
|
+
if (!result) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26857
|
+
return c.json(require_dist$1.WorkspaceTriggerRunListResponseSchema.parse({
|
|
26856
26858
|
items: result.items.map((item) => toWorkspaceTriggerRunSummary(item, record.assignments)),
|
|
26857
26859
|
nextCursor: result.nextCursor
|
|
26858
26860
|
}));
|
|
@@ -26862,25 +26864,25 @@ const handler$59 = async (c) => {
|
|
|
26862
26864
|
const handler$58 = async (c) => {
|
|
26863
26865
|
const { organizationId } = c.get("organization");
|
|
26864
26866
|
const triggerId = c.req.param("triggerId") ?? "";
|
|
26865
|
-
if (!triggerId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid trigger id" }), 400);
|
|
26867
|
+
if (!triggerId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid trigger id" }), 400);
|
|
26866
26868
|
const filter = await resolveListProjectIds(c, listScope(c, projectListScope(accessContext(c))));
|
|
26867
|
-
if (filter === "empty") return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26869
|
+
if (filter === "empty") return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26868
26870
|
const record = (await (0, _keystrokehq_database.listWorkspaceTriggers)(filter.projectIds)).find((entry) => entry.id === triggerId);
|
|
26869
|
-
if (!record) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26871
|
+
if (!record) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26870
26872
|
const artifact = await (0, _keystrokehq_platform_database.selectActiveProjectArtifactForProject)(record.projectId);
|
|
26871
|
-
if (!artifact || !artifact.sourceManifestJson) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Source not found" }), 404);
|
|
26872
|
-
const file = require_dist.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson).files.find((entry) => entry.path === record.sourcePath);
|
|
26873
|
-
if (!file) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Source file not found" }), 404);
|
|
26873
|
+
if (!artifact || !artifact.sourceManifestJson) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Source not found" }), 404);
|
|
26874
|
+
const file = require_dist$1.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson).files.find((entry) => entry.path === record.sourcePath);
|
|
26875
|
+
if (!file) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Source file not found" }), 404);
|
|
26874
26876
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
26875
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26877
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26876
26878
|
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
26877
26879
|
let bytes;
|
|
26878
26880
|
try {
|
|
26879
|
-
bytes = await storage.getObject(require_dist.projectSourceBlobKey(record.projectId, file.hash));
|
|
26881
|
+
bytes = await storage.getObject(require_dist$1.projectSourceBlobKey(record.projectId, file.hash));
|
|
26880
26882
|
} catch {
|
|
26881
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: "Source file contents not found" }), 404);
|
|
26883
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Source file contents not found" }), 404);
|
|
26882
26884
|
}
|
|
26883
|
-
return c.json(require_dist.WorkspaceTriggerFileSchema.parse({
|
|
26885
|
+
return c.json(require_dist$1.WorkspaceTriggerFileSchema.parse({
|
|
26884
26886
|
path: record.sourcePath,
|
|
26885
26887
|
contents: new TextDecoder().decode(bytes)
|
|
26886
26888
|
}));
|
|
@@ -26888,7 +26890,7 @@ const handler$58 = async (c) => {
|
|
|
26888
26890
|
//#endregion
|
|
26889
26891
|
//#region src/routes/account/triggers/[triggerId]/overview/GET.ts
|
|
26890
26892
|
function envelope(row, status, hash) {
|
|
26891
|
-
return require_dist.WorkspaceTriggerOverviewSchema.parse({
|
|
26893
|
+
return require_dist$1.WorkspaceTriggerOverviewSchema.parse({
|
|
26892
26894
|
status,
|
|
26893
26895
|
markdown: row.overviewMarkdown ?? "",
|
|
26894
26896
|
hash,
|
|
@@ -26899,25 +26901,25 @@ function envelope(row, status, hash) {
|
|
|
26899
26901
|
const handler$57 = async (c) => {
|
|
26900
26902
|
const { organizationId } = c.get("organization");
|
|
26901
26903
|
const triggerId = c.req.param("triggerId") ?? "";
|
|
26902
|
-
if (!triggerId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid trigger id" }), 400);
|
|
26904
|
+
if (!triggerId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid trigger id" }), 400);
|
|
26903
26905
|
const filter = await resolveListProjectIds(c, listScope(c, projectListScope(accessContext(c))));
|
|
26904
|
-
if (filter === "empty") return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26906
|
+
if (filter === "empty") return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26905
26907
|
const record = (await (0, _keystrokehq_database.listWorkspaceTriggers)(filter.projectIds)).find((entry) => entry.id === triggerId);
|
|
26906
|
-
if (!record) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26908
|
+
if (!record) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26907
26909
|
const row = await (0, _keystrokehq_database.runWithProjectScope)(record.projectId, () => (0, _keystrokehq_database.selectTriggerById)(triggerId));
|
|
26908
|
-
if (!row) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26910
|
+
if (!row) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26909
26911
|
if (row.triggerHash && row.overviewStatus === "ready" && row.overviewHash === row.triggerHash) return c.json(envelope(row, "ready", row.triggerHash));
|
|
26910
26912
|
if (row.triggerHash && row.overviewStatus === "generating" && row.overviewHash === row.triggerHash) return c.json(envelope(row, "generating", row.triggerHash));
|
|
26911
26913
|
const artifact = await (0, _keystrokehq_platform_database.selectActiveProjectArtifactForProject)(record.projectId);
|
|
26912
|
-
const file = (artifact?.sourceManifestJson ? require_dist.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson) : null)?.files.find((entry) => entry.path === record.sourcePath) ?? null;
|
|
26914
|
+
const file = (artifact?.sourceManifestJson ? require_dist$1.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson) : null)?.files.find((entry) => entry.path === record.sourcePath) ?? null;
|
|
26913
26915
|
if (!file) return c.json(envelope(row, "ready", row.triggerHash ?? row.overviewHash ?? ""));
|
|
26914
26916
|
const effectiveHash = row.triggerHash ?? file.hash;
|
|
26915
26917
|
if (row.overviewStatus === "ready" && row.overviewHash === effectiveHash) return c.json(envelope(row, "ready", effectiveHash));
|
|
26916
26918
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
26917
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26919
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
26918
26920
|
let sourceContents;
|
|
26919
26921
|
try {
|
|
26920
|
-
const bytes = await (0, _keystrokehq_platform_database.createOrgStorageClient)(organization).getObject(require_dist.projectSourceBlobKey(record.projectId, file.hash));
|
|
26922
|
+
const bytes = await (0, _keystrokehq_platform_database.createOrgStorageClient)(organization).getObject(require_dist$1.projectSourceBlobKey(record.projectId, file.hash));
|
|
26921
26923
|
sourceContents = new TextDecoder().decode(bytes);
|
|
26922
26924
|
} catch {
|
|
26923
26925
|
await (0, _keystrokehq_database.runWithProjectScope)(record.projectId, () => (0, _keystrokehq_database.updateTriggerOverview)(triggerId, { status: "failed" }));
|
|
@@ -26936,7 +26938,7 @@ const handler$57 = async (c) => {
|
|
|
26936
26938
|
triggerId,
|
|
26937
26939
|
projectId: record.projectId,
|
|
26938
26940
|
triggerHash: effectiveHash,
|
|
26939
|
-
model: require_dist.DEFAULT_TRIGGER_OVERVIEW_MODEL,
|
|
26941
|
+
model: require_dist$1.DEFAULT_TRIGGER_OVERVIEW_MODEL,
|
|
26940
26942
|
input: {
|
|
26941
26943
|
name: record.name,
|
|
26942
26944
|
description: record.description,
|
|
@@ -26960,35 +26962,35 @@ const handler$56 = async (c) => {
|
|
|
26960
26962
|
const organization = c.get("organization");
|
|
26961
26963
|
const triggerId = c.req.param("triggerId") ?? "";
|
|
26962
26964
|
const attachmentId = c.req.param("attachmentId") ?? "";
|
|
26963
|
-
if (!triggerId.trim() || !attachmentId.trim()) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid trigger or attachment id" }), 400);
|
|
26964
|
-
const parsed = require_dist.TriggerAttachmentUpdateRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
26965
|
+
if (!triggerId.trim() || !attachmentId.trim()) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid trigger or attachment id" }), 400);
|
|
26966
|
+
const parsed = require_dist$1.TriggerAttachmentUpdateRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
26965
26967
|
if (!parsed.success) {
|
|
26966
26968
|
const message = parsed.error.issues[0]?.message ?? "Invalid request body";
|
|
26967
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: message }), 400);
|
|
26969
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: message }), 400);
|
|
26968
26970
|
}
|
|
26969
26971
|
const scope = listScope(c, projectListScope(accessContext(c)));
|
|
26970
26972
|
const filter = await resolveListProjectIds(c, scope);
|
|
26971
|
-
if (filter === "empty") return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26973
|
+
if (filter === "empty") return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26972
26974
|
const record = (await (0, _keystrokehq_database.listWorkspaceTriggers)(filter.projectIds)).find((entry) => entry.id === triggerId);
|
|
26973
|
-
if (!record) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26974
|
-
if (!record.assignments.find((entry) => entry.attachmentId === attachmentId)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Attachment not found" }), 404);
|
|
26975
|
+
if (!record) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26976
|
+
if (!record.assignments.find((entry) => entry.attachmentId === attachmentId)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Attachment not found" }), 404);
|
|
26975
26977
|
if (!await canPerformProjectAction(c, record.projectId, projectActions.deploy)) return forbidden(c);
|
|
26976
26978
|
if (!await (0, _keystrokehq_database.runWithProjectScope)(record.projectId, () => (0, _keystrokehq_database.setTriggerAttachmentEnabledState)({
|
|
26977
26979
|
triggerId,
|
|
26978
26980
|
attachmentId,
|
|
26979
26981
|
enabled: parsed.data.enabled
|
|
26980
|
-
}))) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Attachment not found" }), 404);
|
|
26982
|
+
}))) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Attachment not found" }), 404);
|
|
26981
26983
|
const refreshed = (await (0, _keystrokehq_database.listWorkspaceTriggers)([record.projectId])).find((entry) => entry.id === triggerId);
|
|
26982
|
-
if (!refreshed) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26984
|
+
if (!refreshed) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Trigger not found" }), 404);
|
|
26983
26985
|
const [projects, webhookKeys] = await Promise.all([(0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: await grantedProjectIds(c, scope) }), (0, _keystrokehq_platform_database.listWebhookApiKeysForProject)(refreshed.projectId)]);
|
|
26984
26986
|
const projectName = projects.find((project) => project.id === refreshed.projectId)?.name ?? "Unknown project";
|
|
26985
26987
|
const webhookUrl = buildTriggerWebhookUrl(refreshed, webhookTokensByProjectRoute(webhookKeys));
|
|
26986
|
-
return c.json(require_dist.WorkspaceTriggerDetailSchema.parse(toWorkspaceTriggerDetail(refreshed, projectName, webhookUrl)));
|
|
26988
|
+
return c.json(require_dist$1.WorkspaceTriggerDetailSchema.parse(toWorkspaceTriggerDetail(refreshed, projectName, webhookUrl)));
|
|
26987
26989
|
};
|
|
26988
26990
|
//#endregion
|
|
26989
26991
|
//#region src/routes/account/resources/recents.ts
|
|
26990
26992
|
function toRecentResource(activity, resource, projectName) {
|
|
26991
|
-
return require_dist.RecentResourceSchema.parse({
|
|
26993
|
+
return require_dist$1.RecentResourceSchema.parse({
|
|
26992
26994
|
id: activity.id,
|
|
26993
26995
|
resourceKind: activity.resourceKind,
|
|
26994
26996
|
resourceId: activity.resourceId,
|
|
@@ -27042,7 +27044,7 @@ const handler$55 = async (c) => {
|
|
|
27042
27044
|
skill: new Map(skills.map((row) => [row.id, hydratedResourceFromAgentRow(row)]))
|
|
27043
27045
|
};
|
|
27044
27046
|
const recents = visibleActivities.map((activity) => hydrateRecentResource(activity, lookup, projectNameById)).filter((recent) => recent !== null).sort((left, right) => latestRecentInteractionAt(right) - latestRecentInteractionAt(left));
|
|
27045
|
-
return c.json(require_dist.RecentResourceListResponseSchema.parse(recents));
|
|
27047
|
+
return c.json(require_dist$1.RecentResourceListResponseSchema.parse(recents));
|
|
27046
27048
|
};
|
|
27047
27049
|
//#endregion
|
|
27048
27050
|
//#region src/routes/account/projects/GET.ts
|
|
@@ -27050,7 +27052,7 @@ const handler$54 = async (c) => {
|
|
|
27050
27052
|
const organization = c.get("organization");
|
|
27051
27053
|
const grantedProjectIdsList = await grantedProjectIds(c, listScope(c, projectListScope(accessContext(c))));
|
|
27052
27054
|
const projects = await (0, _keystrokehq_platform_database.selectProjectsByOrganizationId)(organization.organizationId, { grantedProjectIds: grantedProjectIdsList });
|
|
27053
|
-
return c.json(require_dist.ListProjectsResponseSchema.parse(projects.map(require_dist.mapProject)));
|
|
27055
|
+
return c.json(require_dist$1.ListProjectsResponseSchema.parse(projects.map(require_dist$1.mapProject)));
|
|
27054
27056
|
};
|
|
27055
27057
|
//#endregion
|
|
27056
27058
|
//#region src/routes/account/projects/metrics/merge-project-list-metrics.ts
|
|
@@ -27084,7 +27086,7 @@ const handler$53 = async (c) => {
|
|
|
27084
27086
|
const allowed = new Set(grantedProjectIdsList);
|
|
27085
27087
|
metrics = Object.fromEntries(Object.entries(metrics).filter(([projectId]) => allowed.has(projectId)));
|
|
27086
27088
|
}
|
|
27087
|
-
return c.json(require_dist.ListProjectMetricsResponseSchema.parse(metrics));
|
|
27089
|
+
return c.json(require_dist$1.ListProjectMetricsResponseSchema.parse(metrics));
|
|
27088
27090
|
};
|
|
27089
27091
|
//#endregion
|
|
27090
27092
|
//#region src/routes/account/projects/POST.ts
|
|
@@ -27092,27 +27094,27 @@ const handler$52 = async (c) => {
|
|
|
27092
27094
|
const organization = c.get("organization");
|
|
27093
27095
|
const user = c.get("user");
|
|
27094
27096
|
const body = await c.req.json().catch(() => null);
|
|
27095
|
-
const parsed = require_dist.CreateProjectRequestSchema.safeParse(body);
|
|
27096
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project name is required" }), 400);
|
|
27097
|
+
const parsed = require_dist$1.CreateProjectRequestSchema.safeParse(body);
|
|
27098
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Project name is required" }), 400);
|
|
27097
27099
|
const project = await (0, _keystrokehq_platform_database.createProjectForOrganization)(organization.organizationId, parsed.data.name, parsed.data.description, user.id);
|
|
27098
|
-
return c.json(require_dist.CreateProjectResponseSchema.parse(require_dist.mapProject(project)), 201);
|
|
27100
|
+
return c.json(require_dist$1.CreateProjectResponseSchema.parse(require_dist$1.mapProject(project)), 201);
|
|
27099
27101
|
};
|
|
27100
27102
|
//#endregion
|
|
27101
27103
|
//#region src/routes/account/projects/slug-available/GET.ts
|
|
27102
27104
|
const handler$51 = async (c) => {
|
|
27103
27105
|
const organization = c.get("organization");
|
|
27104
|
-
const parsed = require_dist.ProjectSlugAvailabilityQuerySchema.safeParse({
|
|
27106
|
+
const parsed = require_dist$1.ProjectSlugAvailabilityQuerySchema.safeParse({
|
|
27105
27107
|
slug: c.req.query("slug"),
|
|
27106
27108
|
excludeProjectId: c.req.query("excludeProjectId")
|
|
27107
27109
|
});
|
|
27108
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
27110
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
27109
27111
|
const availability = await (0, _keystrokehq_platform_database.checkProjectSlugAvailability)(organization.organizationId, parsed.data.slug, parsed.data.excludeProjectId);
|
|
27110
|
-
return c.json(require_dist.ProjectSlugAvailabilityResponseSchema.parse(availability));
|
|
27112
|
+
return c.json(require_dist$1.ProjectSlugAvailabilityResponseSchema.parse(availability));
|
|
27111
27113
|
};
|
|
27112
27114
|
//#endregion
|
|
27113
27115
|
//#region src/routes/account/projects/[projectId]/GET.ts
|
|
27114
27116
|
const handler$50 = async (c) => {
|
|
27115
|
-
return c.json(require_dist.ProjectResponseSchema.parse(routeProject(c.get("project"))));
|
|
27117
|
+
return c.json(require_dist$1.ProjectResponseSchema.parse(routeProject(c.get("project"))));
|
|
27116
27118
|
};
|
|
27117
27119
|
//#endregion
|
|
27118
27120
|
//#region src/routes/account/projects/[projectId]/PATCH.ts
|
|
@@ -27120,31 +27122,31 @@ const handler$49 = async (c) => {
|
|
|
27120
27122
|
const organization = c.get("organization");
|
|
27121
27123
|
const project = c.get("project");
|
|
27122
27124
|
const body = await c.req.json().catch(() => null);
|
|
27123
|
-
const parsed = require_dist.UpdateProjectRequestSchema.safeParse(body);
|
|
27124
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid project update request" }), 400);
|
|
27125
|
+
const parsed = require_dist$1.UpdateProjectRequestSchema.safeParse(body);
|
|
27126
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid project update request" }), 400);
|
|
27125
27127
|
let updated;
|
|
27126
27128
|
try {
|
|
27127
27129
|
updated = await (0, _keystrokehq_platform_database.updateProjectForOrganization)(organization.organizationId, project.id, parsed.data);
|
|
27128
27130
|
} catch (error) {
|
|
27129
|
-
if (error instanceof _keystrokehq_platform_database.ProjectSlugTakenError) return c.json(require_dist.ErrorResponseSchema.parse({ error: require_dist.PROJECT_SLUG_TAKEN_MESSAGE }), 409);
|
|
27131
|
+
if (error instanceof _keystrokehq_platform_database.ProjectSlugTakenError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: require_dist$1.PROJECT_SLUG_TAKEN_MESSAGE }), 409);
|
|
27130
27132
|
throw error;
|
|
27131
27133
|
}
|
|
27132
|
-
if (!updated) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
27133
|
-
return c.json(require_dist.ProjectResponseSchema.parse(require_dist.mapProject(updated)));
|
|
27134
|
+
if (!updated) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
27135
|
+
return c.json(require_dist$1.ProjectResponseSchema.parse(require_dist$1.mapProject(updated)));
|
|
27134
27136
|
};
|
|
27135
27137
|
//#endregion
|
|
27136
27138
|
//#region src/routes/account/projects/[projectId]/DELETE.ts
|
|
27137
27139
|
const handler$48 = async (c) => {
|
|
27138
27140
|
const organization = c.get("organization");
|
|
27139
27141
|
const project = c.get("project");
|
|
27140
|
-
if (!await (0, _keystrokehq_platform_database.deleteProjectForOrganization)(organization.organizationId, project.id)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
27142
|
+
if (!await (0, _keystrokehq_platform_database.deleteProjectForOrganization)(organization.organizationId, project.id)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
27141
27143
|
return c.body(null, 204);
|
|
27142
27144
|
};
|
|
27143
27145
|
//#endregion
|
|
27144
27146
|
//#region src/routes/account/projects/[projectId]/deployments/GET.ts
|
|
27145
27147
|
const handler$47 = async (c) => {
|
|
27146
27148
|
const rows = await (0, _keystrokehq_platform_database.selectProjectDeployments)(c.get("project").id);
|
|
27147
|
-
return c.json(require_dist.ListProjectDeploymentsResponseSchema.parse(rows.map(require_dist.mapProjectDeployment)));
|
|
27149
|
+
return c.json(require_dist$1.ListProjectDeploymentsResponseSchema.parse(rows.map(require_dist$1.mapProjectDeployment)));
|
|
27148
27150
|
};
|
|
27149
27151
|
//#endregion
|
|
27150
27152
|
//#region src/routes/account/projects/[projectId]/artifacts/POST.ts
|
|
@@ -27156,7 +27158,7 @@ const handler$46 = async (c) => {
|
|
|
27156
27158
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
27157
27159
|
if (!organization) return c.json({ error: "Organization not found" }, 404);
|
|
27158
27160
|
const artifactId = crypto.randomUUID();
|
|
27159
|
-
const storageKey = require_dist.projectArtifactKey(project.id, artifactId);
|
|
27161
|
+
const storageKey = require_dist$1.projectArtifactKey(project.id, artifactId);
|
|
27160
27162
|
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
27161
27163
|
const artifact = await (0, _keystrokehq_platform_database.insertProjectArtifact)({
|
|
27162
27164
|
id: artifactId,
|
|
@@ -27169,8 +27171,8 @@ const handler$46 = async (c) => {
|
|
|
27169
27171
|
contentType: ARTIFACT_CONTENT_TYPE,
|
|
27170
27172
|
expiresInSeconds: DEFAULT_PRESIGN_TTL_SECONDS$1
|
|
27171
27173
|
});
|
|
27172
|
-
return c.json(require_dist.CreateProjectArtifactResponseSchema.parse({
|
|
27173
|
-
artifact: require_dist.mapProjectArtifact(artifact),
|
|
27174
|
+
return c.json(require_dist$1.CreateProjectArtifactResponseSchema.parse({
|
|
27175
|
+
artifact: require_dist$1.mapProjectArtifact(artifact),
|
|
27174
27176
|
uploadUrl,
|
|
27175
27177
|
expiresInSeconds: DEFAULT_PRESIGN_TTL_SECONDS$1
|
|
27176
27178
|
}), 201);
|
|
@@ -27189,7 +27191,7 @@ const handler$45 = async (c) => {
|
|
|
27189
27191
|
key: artifact.storageKey,
|
|
27190
27192
|
expiresInSeconds: DEFAULT_PRESIGN_TTL_SECONDS
|
|
27191
27193
|
});
|
|
27192
|
-
return c.json(require_dist.DownloadActiveProjectArtifactResponseSchema.parse({
|
|
27194
|
+
return c.json(require_dist$1.DownloadActiveProjectArtifactResponseSchema.parse({
|
|
27193
27195
|
artifactId: artifact.id,
|
|
27194
27196
|
downloadUrl,
|
|
27195
27197
|
expiresInSeconds: DEFAULT_PRESIGN_TTL_SECONDS
|
|
@@ -27200,20 +27202,20 @@ const handler$45 = async (c) => {
|
|
|
27200
27202
|
const handler$44 = async (c) => {
|
|
27201
27203
|
const project = c.get("project");
|
|
27202
27204
|
const active = await (0, _keystrokehq_platform_database.selectActiveArtifactSourceManifestForProject)(project.id);
|
|
27203
|
-
if (!active?.sourceManifestJson) return c.json(require_dist.ErrorResponseSchema.parse({ error: "No active source for project" }), 404);
|
|
27205
|
+
if (!active?.sourceManifestJson) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "No active source for project" }), 404);
|
|
27204
27206
|
const { organizationId } = c.get("organization");
|
|
27205
27207
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
27206
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27207
|
-
const manifest = require_dist.StoredProjectSourceManifestSchema.parse(active.sourceManifestJson);
|
|
27208
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27209
|
+
const manifest = require_dist$1.StoredProjectSourceManifestSchema.parse(active.sourceManifestJson);
|
|
27208
27210
|
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
27209
27211
|
let files;
|
|
27210
27212
|
try {
|
|
27211
|
-
files = await require_dist.loadProjectSourceFiles(storage, project.id, manifest);
|
|
27213
|
+
files = await require_dist$1.loadProjectSourceFiles(storage, project.id, manifest);
|
|
27212
27214
|
} catch (error) {
|
|
27213
27215
|
const message = error instanceof Error ? error.message : "Failed to load source files";
|
|
27214
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: message }), 400);
|
|
27216
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: message }), 400);
|
|
27215
27217
|
}
|
|
27216
|
-
return c.json(require_dist.DownloadActiveProjectSourceResponseSchema.parse({
|
|
27218
|
+
return c.json(require_dist$1.DownloadActiveProjectSourceResponseSchema.parse({
|
|
27217
27219
|
artifactId: active.artifactId,
|
|
27218
27220
|
files
|
|
27219
27221
|
}));
|
|
@@ -27223,20 +27225,20 @@ const handler$44 = async (c) => {
|
|
|
27223
27225
|
const handler$43 = async (c) => {
|
|
27224
27226
|
const project = c.get("project");
|
|
27225
27227
|
const artifactId = c.req.param("artifactId");
|
|
27226
|
-
if (!artifactId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
27228
|
+
if (!artifactId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
27227
27229
|
const existing = await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id);
|
|
27228
|
-
if (!existing) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
27229
|
-
if (existing.status === "ready") return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact already completed" }), 409);
|
|
27230
|
+
if (!existing) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
27231
|
+
if (existing.status === "ready") return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact already completed" }), 409);
|
|
27230
27232
|
const { organizationId } = c.get("organization");
|
|
27231
27233
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
27232
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27234
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27233
27235
|
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
27234
27236
|
const head = await storage.headObject(existing.storageKey);
|
|
27235
|
-
if (!head || head.contentLength <= 0) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact upload not found in storage" }), 400);
|
|
27237
|
+
if (!head || head.contentLength <= 0) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact upload not found in storage" }), 400);
|
|
27236
27238
|
try {
|
|
27237
27239
|
const artifactBytes = await storage.getObject(existing.storageKey);
|
|
27238
|
-
if (!artifactBytes || artifactBytes.byteLength <= 0) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact upload not found in storage" }), 400);
|
|
27239
|
-
const manifestJson = require_dist.parseStoredRouteManifest(require_dist.extractRouteManifestFromArtifact(Buffer.from(artifactBytes)));
|
|
27240
|
+
if (!artifactBytes || artifactBytes.byteLength <= 0) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact upload not found in storage" }), 400);
|
|
27241
|
+
const manifestJson = require_dist$1.parseStoredRouteManifest(require_dist$1.extractRouteManifestFromArtifact(Buffer.from(artifactBytes)));
|
|
27240
27242
|
await validateAgentModelIds(agentModelIdsFromStoredManifest(manifestJson));
|
|
27241
27243
|
const result = await (0, _keystrokehq_platform_database.completeProjectArtifact)({
|
|
27242
27244
|
artifactId,
|
|
@@ -27248,13 +27250,13 @@ const handler$43 = async (c) => {
|
|
|
27248
27250
|
name: project.name,
|
|
27249
27251
|
artifactId
|
|
27250
27252
|
});
|
|
27251
|
-
return c.json(require_dist.CompleteProjectArtifactResponseSchema.parse({
|
|
27252
|
-
artifact: require_dist.mapProjectArtifact(result.artifact),
|
|
27253
|
-
project: require_dist.mapProject(result.project)
|
|
27253
|
+
return c.json(require_dist$1.CompleteProjectArtifactResponseSchema.parse({
|
|
27254
|
+
artifact: require_dist$1.mapProjectArtifact(result.artifact),
|
|
27255
|
+
project: require_dist$1.mapProject(result.project)
|
|
27254
27256
|
}));
|
|
27255
27257
|
} catch (error) {
|
|
27256
27258
|
const message = error instanceof Error ? error.message : "Failed to complete artifact";
|
|
27257
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: message }), 400);
|
|
27259
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: message }), 400);
|
|
27258
27260
|
}
|
|
27259
27261
|
};
|
|
27260
27262
|
//#endregion
|
|
@@ -27263,17 +27265,17 @@ const SOURCE_BLOB_CONTENT_TYPE = "text/plain; charset=utf-8";
|
|
|
27263
27265
|
const handler$42 = async (c) => {
|
|
27264
27266
|
const project = c.get("project");
|
|
27265
27267
|
const artifactId = c.req.param("artifactId");
|
|
27266
|
-
if (!artifactId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
27267
|
-
if (!await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
27268
|
-
const parsed = require_dist.PresignProjectSourceRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27269
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid blob list" }), 400);
|
|
27268
|
+
if (!artifactId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
27269
|
+
if (!await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
27270
|
+
const parsed = require_dist$1.PresignProjectSourceRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27271
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid blob list" }), 400);
|
|
27270
27272
|
const { organizationId } = c.get("organization");
|
|
27271
27273
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
27272
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27274
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27273
27275
|
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
27274
27276
|
const hashes = [...new Set(parsed.data.blobs.map((blob) => blob.hash))];
|
|
27275
27277
|
const uploads = await Promise.all(hashes.map(async (hash) => {
|
|
27276
|
-
const key = require_dist.projectSourceBlobKey(project.id, hash);
|
|
27278
|
+
const key = require_dist$1.projectSourceBlobKey(project.id, hash);
|
|
27277
27279
|
const head = await storage.headObject(key);
|
|
27278
27280
|
if (head && head.contentLength > 0) return null;
|
|
27279
27281
|
return {
|
|
@@ -27284,20 +27286,20 @@ const handler$42 = async (c) => {
|
|
|
27284
27286
|
})
|
|
27285
27287
|
};
|
|
27286
27288
|
}));
|
|
27287
|
-
return c.json(require_dist.PresignProjectSourceResponseSchema.parse({ uploads: uploads.filter((upload) => upload !== null) }));
|
|
27289
|
+
return c.json(require_dist$1.PresignProjectSourceResponseSchema.parse({ uploads: uploads.filter((upload) => upload !== null) }));
|
|
27288
27290
|
};
|
|
27289
27291
|
//#endregion
|
|
27290
27292
|
//#region src/routes/account/projects/[projectId]/artifacts/[artifactId]/source/manifest/POST.ts
|
|
27291
27293
|
const handler$41 = async (c) => {
|
|
27292
27294
|
const project = c.get("project");
|
|
27293
27295
|
const artifactId = c.req.param("artifactId");
|
|
27294
|
-
if (!artifactId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
27295
|
-
if (!await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
27296
|
-
const parsed = require_dist.UploadProjectSourceManifestRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27297
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid source manifest" }), 400);
|
|
27298
|
-
const manifest = require_dist.StoredProjectSourceManifestSchema.parse({
|
|
27296
|
+
if (!artifactId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
27297
|
+
if (!await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
27298
|
+
const parsed = require_dist$1.UploadProjectSourceManifestRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27299
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid source manifest" }), 400);
|
|
27300
|
+
const manifest = require_dist$1.StoredProjectSourceManifestSchema.parse({
|
|
27299
27301
|
files: parsed.data.files.map((file) => ({
|
|
27300
|
-
id: require_dist.projectFileId(file.path),
|
|
27302
|
+
id: require_dist$1.projectFileId(file.path),
|
|
27301
27303
|
path: file.path,
|
|
27302
27304
|
hash: file.hash
|
|
27303
27305
|
})),
|
|
@@ -27308,7 +27310,7 @@ const handler$41 = async (c) => {
|
|
|
27308
27310
|
projectId: project.id,
|
|
27309
27311
|
sourceManifestJson: manifest
|
|
27310
27312
|
});
|
|
27311
|
-
return c.json(require_dist.UploadProjectSourceResponseSchema.parse({
|
|
27313
|
+
return c.json(require_dist$1.UploadProjectSourceResponseSchema.parse({
|
|
27312
27314
|
ok: true,
|
|
27313
27315
|
fileCount: manifest.files.length
|
|
27314
27316
|
}), 201);
|
|
@@ -27318,27 +27320,27 @@ const handler$41 = async (c) => {
|
|
|
27318
27320
|
function extensionFromUpload(contentType, filename) {
|
|
27319
27321
|
const fromName = filename.includes(".") ? filename.split(".").pop()?.toLowerCase() : void 0;
|
|
27320
27322
|
if (fromName && /^[a-z0-9]+$/.test(fromName)) return fromName;
|
|
27321
|
-
return require_dist.chatAttachmentExtension(contentType) ?? "bin";
|
|
27323
|
+
return require_dist$1.chatAttachmentExtension(contentType) ?? "bin";
|
|
27322
27324
|
}
|
|
27323
27325
|
const handler$40 = async (c) => {
|
|
27324
27326
|
const project = c.get("project");
|
|
27325
27327
|
const slug = c.req.param("slug");
|
|
27326
|
-
if (!slug) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Agent slug is required" }), 400);
|
|
27328
|
+
if (!slug) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Agent slug is required" }), 400);
|
|
27327
27329
|
const agent = await (0, _keystrokehq_database.runWithProjectScope)(project.id, () => (0, _keystrokehq_database.selectAgentBySlug)(slug));
|
|
27328
|
-
if (!agent || agent.projectId !== project.id) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Agent not found" }), 404);
|
|
27329
|
-
const parsed = require_dist.PresignChatAttachmentRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27330
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid presign request" }), 400);
|
|
27331
|
-
if (!require_dist.isAllowedChatAttachmentMediaType(parsed.data.contentType)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Unsupported content type" }), 400);
|
|
27330
|
+
if (!agent || agent.projectId !== project.id) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Agent not found" }), 404);
|
|
27331
|
+
const parsed = require_dist$1.PresignChatAttachmentRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27332
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid presign request" }), 400);
|
|
27333
|
+
if (!require_dist$1.isAllowedChatAttachmentMediaType(parsed.data.contentType)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Unsupported content type" }), 400);
|
|
27332
27334
|
const { organizationId } = c.get("organization");
|
|
27333
27335
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
27334
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27336
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27335
27337
|
const ext = extensionFromUpload(parsed.data.contentType, parsed.data.filename);
|
|
27336
|
-
const storageKey = require_dist.chatAttachmentStorageKey(project.id, crypto.randomUUID(), ext);
|
|
27338
|
+
const storageKey = require_dist$1.chatAttachmentStorageKey(project.id, crypto.randomUUID(), ext);
|
|
27337
27339
|
const uploadUrl = await (0, _keystrokehq_platform_database.createOrgStorageClient)(organization).presignPut({
|
|
27338
27340
|
key: storageKey,
|
|
27339
27341
|
contentType: parsed.data.contentType
|
|
27340
27342
|
});
|
|
27341
|
-
return c.json(require_dist.PresignChatAttachmentResponseSchema.parse({
|
|
27343
|
+
return c.json(require_dist$1.PresignChatAttachmentResponseSchema.parse({
|
|
27342
27344
|
uploadUrl,
|
|
27343
27345
|
storageKey
|
|
27344
27346
|
}));
|
|
@@ -27349,14 +27351,14 @@ const handler$39 = async (c) => {
|
|
|
27349
27351
|
const project = c.get("project");
|
|
27350
27352
|
const slug = c.req.param("slug");
|
|
27351
27353
|
const keyParam = c.req.param("key");
|
|
27352
|
-
if (!slug || !keyParam) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Attachment key is required" }), 400);
|
|
27354
|
+
if (!slug || !keyParam) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Attachment key is required" }), 400);
|
|
27353
27355
|
const storageKey = keyParam.split("/").map((segment) => decodeURIComponent(segment)).join("/");
|
|
27354
|
-
if (!require_dist.isChatAttachmentStorageKey(storageKey, project.id)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Attachment not found" }), 404);
|
|
27356
|
+
if (!require_dist$1.isChatAttachmentStorageKey(storageKey, project.id)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Attachment not found" }), 404);
|
|
27355
27357
|
const agent = await (0, _keystrokehq_database.runWithProjectScope)(project.id, () => (0, _keystrokehq_database.selectAgentBySlug)(slug));
|
|
27356
|
-
if (!agent || agent.projectId !== project.id) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Agent not found" }), 404);
|
|
27358
|
+
if (!agent || agent.projectId !== project.id) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Agent not found" }), 404);
|
|
27357
27359
|
const { organizationId } = c.get("organization");
|
|
27358
27360
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
27359
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27361
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27360
27362
|
const url = await (0, _keystrokehq_platform_database.createOrgStorageClient)(organization).presignGet({ key: storageKey });
|
|
27361
27363
|
return c.redirect(url, 302);
|
|
27362
27364
|
};
|
|
@@ -27383,18 +27385,18 @@ function resolveSourcePaths(rows, kindDir, filePaths) {
|
|
|
27383
27385
|
const handler$38 = async (c) => {
|
|
27384
27386
|
const project = c.get("project");
|
|
27385
27387
|
const active = await (0, _keystrokehq_platform_database.selectActiveArtifactSourceManifestForProject)(project.id);
|
|
27386
|
-
if (!active || !active.sourceManifestJson) return c.json(require_dist.ListProjectFilesResponseSchema.parse({
|
|
27388
|
+
if (!active || !active.sourceManifestJson) return c.json(require_dist$1.ListProjectFilesResponseSchema.parse({
|
|
27387
27389
|
artifactId: active?.artifactId ?? null,
|
|
27388
27390
|
files: []
|
|
27389
27391
|
}));
|
|
27390
|
-
const manifest = require_dist.StoredProjectSourceManifestSchema.parse(active.sourceManifestJson);
|
|
27392
|
+
const manifest = require_dist$1.StoredProjectSourceManifestSchema.parse(active.sourceManifestJson);
|
|
27391
27393
|
const [agents, workflows, skills] = await Promise.all([
|
|
27392
27394
|
(0, _keystrokehq_database.listActiveAgents)({ projectIds: [project.id] }),
|
|
27393
27395
|
(0, _keystrokehq_database.listActiveWorkflows)({ projectIds: [project.id] }),
|
|
27394
27396
|
(0, _keystrokehq_database.listActiveSkills)({ projectIds: [project.id] })
|
|
27395
27397
|
]);
|
|
27396
27398
|
const filePaths = manifest.files.map((file) => file.path);
|
|
27397
|
-
const resources = require_dist.ProjectSourceResourcesSchema.parse({
|
|
27399
|
+
const resources = require_dist$1.ProjectSourceResourcesSchema.parse({
|
|
27398
27400
|
agents: resolveSourcePaths(agents, "agents", filePaths),
|
|
27399
27401
|
workflows: resolveSourcePaths(workflows, "workflows", filePaths),
|
|
27400
27402
|
skills: skills.map((row) => ({
|
|
@@ -27402,7 +27404,7 @@ const handler$38 = async (c) => {
|
|
|
27402
27404
|
path: row.moduleFile
|
|
27403
27405
|
}))
|
|
27404
27406
|
});
|
|
27405
|
-
return c.json(require_dist.ListProjectFilesResponseSchema.parse({
|
|
27407
|
+
return c.json(require_dist$1.ListProjectFilesResponseSchema.parse({
|
|
27406
27408
|
artifactId: active.artifactId,
|
|
27407
27409
|
files: manifest.files.map((file) => ({
|
|
27408
27410
|
id: file.id,
|
|
@@ -27417,22 +27419,22 @@ const handler$38 = async (c) => {
|
|
|
27417
27419
|
const handler$37 = async (c) => {
|
|
27418
27420
|
const project = c.get("project");
|
|
27419
27421
|
const artifactId = c.req.param("artifactId");
|
|
27420
|
-
if (!artifactId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
27422
|
+
if (!artifactId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact id is required" }), 400);
|
|
27421
27423
|
const path = c.req.query("path");
|
|
27422
|
-
if (!path) return c.json(require_dist.ErrorResponseSchema.parse({ error: "File path is required" }), 400);
|
|
27424
|
+
if (!path) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "File path is required" }), 400);
|
|
27423
27425
|
const artifact = await (0, _keystrokehq_platform_database.selectProjectArtifactForProject)(artifactId, project.id);
|
|
27424
|
-
if (!artifact || !artifact.sourceManifestJson) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
27425
|
-
const file = require_dist.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson).files.find((entry) => entry.path === path);
|
|
27426
|
-
if (!file) return c.json(require_dist.ErrorResponseSchema.parse({ error: "File not found" }), 404);
|
|
27426
|
+
if (!artifact || !artifact.sourceManifestJson) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Artifact not found" }), 404);
|
|
27427
|
+
const file = require_dist$1.StoredProjectSourceManifestSchema.parse(artifact.sourceManifestJson).files.find((entry) => entry.path === path);
|
|
27428
|
+
if (!file) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "File not found" }), 404);
|
|
27427
27429
|
const { organizationId } = c.get("organization");
|
|
27428
27430
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
27429
|
-
if (!organization) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27431
|
+
if (!organization) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
27430
27432
|
const storage = (0, _keystrokehq_platform_database.createOrgStorageClient)(organization);
|
|
27431
27433
|
let bytes;
|
|
27432
27434
|
try {
|
|
27433
|
-
bytes = await storage.getObject(require_dist.projectSourceBlobKey(project.id, file.hash));
|
|
27435
|
+
bytes = await storage.getObject(require_dist$1.projectSourceBlobKey(project.id, file.hash));
|
|
27434
27436
|
} catch {
|
|
27435
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: "File contents not found" }), 404);
|
|
27437
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "File contents not found" }), 404);
|
|
27436
27438
|
}
|
|
27437
27439
|
c.header("Content-Type", "text/plain; charset=utf-8");
|
|
27438
27440
|
return c.body(new TextDecoder().decode(bytes));
|
|
@@ -27442,13 +27444,13 @@ const handler$37 = async (c) => {
|
|
|
27442
27444
|
function createProjectReachabilityHandler(hosting) {
|
|
27443
27445
|
return async (c) => {
|
|
27444
27446
|
const project = c.get("project");
|
|
27445
|
-
if (project.status !== "active") return c.json(require_dist.ProjectReachabilityResponseSchema.parse({ reachable: false }));
|
|
27447
|
+
if (project.status !== "active") return c.json(require_dist$1.ProjectReachabilityResponseSchema.parse({ reachable: false }));
|
|
27446
27448
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(project.organizationId);
|
|
27447
27449
|
const reachable = await require_dist.pingProjectTarget({
|
|
27448
27450
|
baseUrl: organization?.baseUrl ?? project.baseUrl,
|
|
27449
27451
|
runtimeId: organization?.runtimeId ?? project.runtimeId
|
|
27450
27452
|
}, { plugin: hosting });
|
|
27451
|
-
return c.json(require_dist.ProjectReachabilityResponseSchema.parse({ reachable }));
|
|
27453
|
+
return c.json(require_dist$1.ProjectReachabilityResponseSchema.parse({ reachable }));
|
|
27452
27454
|
};
|
|
27453
27455
|
}
|
|
27454
27456
|
//#endregion
|
|
@@ -27457,7 +27459,7 @@ const handler$36 = async (c) => {
|
|
|
27457
27459
|
const project = c.get("project");
|
|
27458
27460
|
const currentUserId = c.get("user").id;
|
|
27459
27461
|
const members = await (0, _keystrokehq_platform_database.selectProjectMembers)(project.id);
|
|
27460
|
-
return c.json(require_dist.ListProjectMembersResponseSchema.parse(members.map((member) => require_dist.mapProjectMember(member, { isCurrentUser: member.id === currentUserId }))));
|
|
27462
|
+
return c.json(require_dist$1.ListProjectMembersResponseSchema.parse(members.map((member) => require_dist$1.mapProjectMember(member, { isCurrentUser: member.id === currentUserId }))));
|
|
27461
27463
|
};
|
|
27462
27464
|
//#endregion
|
|
27463
27465
|
//#region src/routes/account/projects/[projectId]/members/POST.ts
|
|
@@ -27465,15 +27467,15 @@ const handler$35 = async (c) => {
|
|
|
27465
27467
|
const organization = c.get("organization");
|
|
27466
27468
|
const project = c.get("project");
|
|
27467
27469
|
const body = await c.req.json().catch(() => null);
|
|
27468
|
-
const parsed = require_dist.InviteProjectMembersRequestSchema.safeParse(body);
|
|
27469
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid invite request" }), 400);
|
|
27470
|
+
const parsed = require_dist$1.InviteProjectMembersRequestSchema.safeParse(body);
|
|
27471
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid invite request" }), 400);
|
|
27470
27472
|
const results = await (0, _keystrokehq_platform_database.inviteProjectMembers)({
|
|
27471
27473
|
projectId: project.id,
|
|
27472
27474
|
organizationId: organization.organizationId,
|
|
27473
27475
|
emails: parsed.data.emails,
|
|
27474
27476
|
role: parsed.data.role
|
|
27475
27477
|
});
|
|
27476
|
-
return c.json(require_dist.InviteProjectMembersResponseSchema.parse(results));
|
|
27478
|
+
return c.json(require_dist$1.InviteProjectMembersResponseSchema.parse(results));
|
|
27477
27479
|
};
|
|
27478
27480
|
//#endregion
|
|
27479
27481
|
//#region src/routes/account/projects/[projectId]/members/[userId]/PATCH.ts
|
|
@@ -27481,14 +27483,14 @@ const handler$34 = async (c) => {
|
|
|
27481
27483
|
const project = c.get("project");
|
|
27482
27484
|
const userId = c.req.param("userId");
|
|
27483
27485
|
const body = await c.req.json().catch(() => null);
|
|
27484
|
-
const parsed = require_dist.UpdateProjectMemberRequestSchema.safeParse(body);
|
|
27485
|
-
if (!userId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
27486
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid member update request" }), 400);
|
|
27486
|
+
const parsed = require_dist$1.UpdateProjectMemberRequestSchema.safeParse(body);
|
|
27487
|
+
if (!userId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
27488
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid member update request" }), 400);
|
|
27487
27489
|
try {
|
|
27488
27490
|
const member = await (0, _keystrokehq_platform_database.updateProjectMemberRole)(project.id, userId, parsed.data.role);
|
|
27489
|
-
return c.json(require_dist.UpdateProjectMemberResponseSchema.parse(require_dist.mapProjectMember(member)));
|
|
27491
|
+
return c.json(require_dist$1.UpdateProjectMemberResponseSchema.parse(require_dist$1.mapProjectMember(member)));
|
|
27490
27492
|
} catch (error) {
|
|
27491
|
-
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27493
|
+
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27492
27494
|
throw error;
|
|
27493
27495
|
}
|
|
27494
27496
|
};
|
|
@@ -27497,12 +27499,12 @@ const handler$34 = async (c) => {
|
|
|
27497
27499
|
const handler$33 = async (c) => {
|
|
27498
27500
|
const project = c.get("project");
|
|
27499
27501
|
const userId = c.req.param("userId");
|
|
27500
|
-
if (!userId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
27502
|
+
if (!userId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
27501
27503
|
try {
|
|
27502
27504
|
await (0, _keystrokehq_platform_database.removeProjectMember)(project.id, userId);
|
|
27503
27505
|
return c.body(null, 204);
|
|
27504
27506
|
} catch (error) {
|
|
27505
|
-
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27507
|
+
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27506
27508
|
throw error;
|
|
27507
27509
|
}
|
|
27508
27510
|
};
|
|
@@ -27515,7 +27517,7 @@ const handler$32 = async (c) => {
|
|
|
27515
27517
|
await (0, _keystrokehq_platform_database.removeProjectMember)(project.id, userId);
|
|
27516
27518
|
return c.body(null, 204);
|
|
27517
27519
|
} catch (error) {
|
|
27518
|
-
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27520
|
+
if (error instanceof _keystrokehq_platform_database.ProjectMemberNotFoundError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27519
27521
|
throw error;
|
|
27520
27522
|
}
|
|
27521
27523
|
};
|
|
@@ -27523,7 +27525,7 @@ const handler$32 = async (c) => {
|
|
|
27523
27525
|
//#region src/routes/account/projects/[projectId]/settings/GET.ts
|
|
27524
27526
|
const handler$31 = async (c) => {
|
|
27525
27527
|
const project = c.get("project");
|
|
27526
|
-
return c.json(require_dist.ProjectSettingsResponseSchema.parse(require_dist.mapProjectSettings(project)));
|
|
27528
|
+
return c.json(require_dist$1.ProjectSettingsResponseSchema.parse(require_dist$1.mapProjectSettings(project)));
|
|
27527
27529
|
};
|
|
27528
27530
|
//#endregion
|
|
27529
27531
|
//#region src/routes/account/projects/[projectId]/settings/PATCH.ts
|
|
@@ -27531,15 +27533,15 @@ const handler$30 = async (c) => {
|
|
|
27531
27533
|
const organization = c.get("organization");
|
|
27532
27534
|
const project = c.get("project");
|
|
27533
27535
|
const body = await c.req.json().catch(() => null);
|
|
27534
|
-
const parsed = require_dist.UpdateProjectSettingsRequestSchema.safeParse(body);
|
|
27535
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid project settings request" }), 400);
|
|
27536
|
+
const parsed = require_dist$1.UpdateProjectSettingsRequestSchema.safeParse(body);
|
|
27537
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid project settings request" }), 400);
|
|
27536
27538
|
const updated = await (0, _keystrokehq_platform_database.updateProjectSettings)(organization.organizationId, project.id, {
|
|
27537
27539
|
description: parsed.data.description,
|
|
27538
27540
|
defaultMemberRole: parsed.data.defaultRole,
|
|
27539
27541
|
invitePermission: parsed.data.invitePermission
|
|
27540
27542
|
});
|
|
27541
|
-
if (!updated) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
27542
|
-
return c.json(require_dist.ProjectSettingsResponseSchema.parse(require_dist.mapProjectSettings(updated)));
|
|
27543
|
+
if (!updated) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Project not found" }), 404);
|
|
27544
|
+
return c.json(require_dist$1.ProjectSettingsResponseSchema.parse(require_dist$1.mapProjectSettings(updated)));
|
|
27543
27545
|
};
|
|
27544
27546
|
//#endregion
|
|
27545
27547
|
//#region src/routes/account/credentials/enrich.ts
|
|
@@ -27564,10 +27566,10 @@ function canManageCredential(row, userId) {
|
|
|
27564
27566
|
/** Display name derived from the app slug (org-custom slugs use the segment after `/`). */
|
|
27565
27567
|
function displayAppName(appId) {
|
|
27566
27568
|
try {
|
|
27567
|
-
const parsed = require_dist.parseAppSlug(appId);
|
|
27568
|
-
if (parsed.kind === "org") return require_dist.displayCredentialAppName(parsed.name);
|
|
27569
|
+
const parsed = require_dist$1.parseAppSlug(appId);
|
|
27570
|
+
if (parsed.kind === "org") return require_dist$1.displayCredentialAppName(parsed.name);
|
|
27569
27571
|
} catch {}
|
|
27570
|
-
return require_dist.displayCredentialAppName(appId);
|
|
27572
|
+
return require_dist$1.displayCredentialAppName(appId);
|
|
27571
27573
|
}
|
|
27572
27574
|
/** Masked preview of a secret — last 4 chars revealed, the rest masked. Plaintext never returned. */
|
|
27573
27575
|
function maskSecretPreview(value) {
|
|
@@ -27576,7 +27578,7 @@ function maskSecretPreview(value) {
|
|
|
27576
27578
|
return `${"•".repeat(Math.min(trimmed.length - 4, 20))}${trimmed.slice(-4)}`;
|
|
27577
27579
|
}
|
|
27578
27580
|
async function readSecretKeyPreviews(instanceId) {
|
|
27579
|
-
const payload = await require_dist.readCredentialInstanceSecret(instanceId);
|
|
27581
|
+
const payload = await require_dist$1.readCredentialInstanceSecret(instanceId);
|
|
27580
27582
|
if (!payload) return null;
|
|
27581
27583
|
let parsed;
|
|
27582
27584
|
try {
|
|
@@ -27687,7 +27689,7 @@ const handler$29 = async (c) => {
|
|
|
27687
27689
|
userId: user.id,
|
|
27688
27690
|
projectIds
|
|
27689
27691
|
})), organization.organizationId);
|
|
27690
|
-
return c.json(require_dist.ListCredentialsResponseSchema.parse(credentials));
|
|
27692
|
+
return c.json(require_dist$1.ListCredentialsResponseSchema.parse(credentials));
|
|
27691
27693
|
};
|
|
27692
27694
|
//#endregion
|
|
27693
27695
|
//#region src/routes/account/credentials/POST.ts
|
|
@@ -27698,7 +27700,7 @@ function withTargetScope(target, fn) {
|
|
|
27698
27700
|
const handler$28 = async (c) => {
|
|
27699
27701
|
const organization = c.get("organization");
|
|
27700
27702
|
const user = c.get("user");
|
|
27701
|
-
const parsed = require_dist.CreateCredentialsRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27703
|
+
const parsed = require_dist$1.CreateCredentialsRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27702
27704
|
if (!parsed.success) {
|
|
27703
27705
|
const message = parsed.error.issues[0]?.message ?? "Invalid request body";
|
|
27704
27706
|
return c.json({ error: message }, 400);
|
|
@@ -27707,7 +27709,7 @@ const handler$28 = async (c) => {
|
|
|
27707
27709
|
if (input.connectionKind === "manual" && input.value) {
|
|
27708
27710
|
const app = await (0, _keystrokehq_platform_database.selectAppForOrganization)(organization.organizationId, input.appId);
|
|
27709
27711
|
if (app && (0, _keystrokehq_platform_database.hasCredentialFieldTemplate)(app)) {
|
|
27710
|
-
const validation = require_dist.validateCredentialValueAgainstFields(app.credentialFields, input.value);
|
|
27712
|
+
const validation = require_dist$1.validateCredentialValueAgainstFields(app.credentialFields, input.value);
|
|
27711
27713
|
if (!validation.ok) return c.json({ error: validation.message }, 400);
|
|
27712
27714
|
}
|
|
27713
27715
|
}
|
|
@@ -27736,7 +27738,7 @@ const handler$28 = async (c) => {
|
|
|
27736
27738
|
scopeId: user.id
|
|
27737
27739
|
}] : []
|
|
27738
27740
|
];
|
|
27739
|
-
const appName = require_dist.displayCredentialAppName(input.appId);
|
|
27741
|
+
const appName = require_dist$1.displayCredentialAppName(input.appId);
|
|
27740
27742
|
const siblingCounts = /* @__PURE__ */ new Map();
|
|
27741
27743
|
for (const target of targets) {
|
|
27742
27744
|
const siblings = await withTargetScope(target, () => (0, _keystrokehq_database.selectCredentialInstancesForScope)(input.appId, target.scopeType, target.scopeId));
|
|
@@ -27746,8 +27748,8 @@ const handler$28 = async (c) => {
|
|
|
27746
27748
|
const createdIds = [];
|
|
27747
27749
|
for (const target of targets) {
|
|
27748
27750
|
const siblings = await withTargetScope(target, () => (0, _keystrokehq_database.selectCredentialInstancesForScope)(input.appId, target.scopeType, target.scopeId));
|
|
27749
|
-
const label = require_dist.resolveUniqueCredentialInstanceLabel({
|
|
27750
|
-
baseLabel: input.label?.trim() || require_dist.buildCredentialInstanceLabel({
|
|
27751
|
+
const label = require_dist$1.resolveUniqueCredentialInstanceLabel({
|
|
27752
|
+
baseLabel: input.label?.trim() || require_dist$1.buildCredentialInstanceLabel({
|
|
27751
27753
|
scopeType: target.scopeType,
|
|
27752
27754
|
appName,
|
|
27753
27755
|
projectName: target.projectName
|
|
@@ -27755,7 +27757,7 @@ const handler$28 = async (c) => {
|
|
|
27755
27757
|
takenLabels: siblings.map((row) => row.label)
|
|
27756
27758
|
});
|
|
27757
27759
|
const id = crypto.randomUUID();
|
|
27758
|
-
await withTargetScope(target, () => require_dist.setCredentialInstanceSecret({
|
|
27760
|
+
await withTargetScope(target, () => require_dist$1.setCredentialInstanceSecret({
|
|
27759
27761
|
id,
|
|
27760
27762
|
key: input.appId,
|
|
27761
27763
|
scopeType: target.scopeType,
|
|
@@ -27772,7 +27774,7 @@ const handler$28 = async (c) => {
|
|
|
27772
27774
|
if (row) rows.push(row);
|
|
27773
27775
|
}
|
|
27774
27776
|
const credentials = await enrichCredentialInstances(rows, organization.organizationId);
|
|
27775
|
-
return c.json(require_dist.CreateCredentialsResponseSchema.parse(credentials), 201);
|
|
27777
|
+
return c.json(require_dist$1.CreateCredentialsResponseSchema.parse(credentials), 201);
|
|
27776
27778
|
};
|
|
27777
27779
|
//#endregion
|
|
27778
27780
|
//#region src/routes/account/credentials/[credentialId]/GET.ts
|
|
@@ -27782,7 +27784,7 @@ const handler$27 = async (c) => {
|
|
|
27782
27784
|
const row = credentialId ? await (0, _keystrokehq_database.selectCredentialInstanceById)(credentialId) : void 0;
|
|
27783
27785
|
if (!row || toAppCredentialScope(row.scopeType) === null) return c.json({ error: "Credential not found" }, 404);
|
|
27784
27786
|
const [credential] = await enrichCredentialInstances([row], organization.organizationId);
|
|
27785
|
-
return c.json(require_dist.GetCredentialResponseSchema.parse(credential));
|
|
27787
|
+
return c.json(require_dist$1.GetCredentialResponseSchema.parse(credential));
|
|
27786
27788
|
};
|
|
27787
27789
|
//#endregion
|
|
27788
27790
|
//#region src/routes/account/credentials/[credentialId]/PATCH.ts
|
|
@@ -27793,7 +27795,7 @@ const handler$26 = async (c) => {
|
|
|
27793
27795
|
const existing = credentialId ? await (0, _keystrokehq_database.selectCredentialInstanceById)(credentialId) : void 0;
|
|
27794
27796
|
if (!existing || toAppCredentialScope(existing.scopeType) === null) return c.json({ error: "Credential not found" }, 404);
|
|
27795
27797
|
if (!canManageCredential(existing, user.id)) return c.json({ error: "Forbidden" }, 403);
|
|
27796
|
-
const parsed = require_dist.UpdateCredentialRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27798
|
+
const parsed = require_dist$1.UpdateCredentialRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
27797
27799
|
if (!parsed.success) {
|
|
27798
27800
|
const message = parsed.error.issues[0]?.message ?? "Invalid request body";
|
|
27799
27801
|
return c.json({ error: message }, 400);
|
|
@@ -27808,7 +27810,7 @@ const handler$26 = async (c) => {
|
|
|
27808
27810
|
if (labelChanged) {
|
|
27809
27811
|
const siblings = await withCredentialRowScope(existing, () => (0, _keystrokehq_database.selectCredentialInstancesForScope)(existing.appSlug, existing.scopeType, existing.scopeId));
|
|
27810
27812
|
if (siblings.some((row) => row.id !== credentialId && (row.label ?? row.name ?? null) === label)) return c.json({ error: "A credential with this label already exists" }, 409);
|
|
27811
|
-
slug = require_dist.deriveCredentialInstanceSlug({
|
|
27813
|
+
slug = require_dist$1.deriveCredentialInstanceSlug({
|
|
27812
27814
|
appSlug: existing.appSlug,
|
|
27813
27815
|
name: label,
|
|
27814
27816
|
takenSlugs: siblings.filter((row) => row.id !== credentialId).map((row) => row.slug)
|
|
@@ -27817,7 +27819,7 @@ const handler$26 = async (c) => {
|
|
|
27817
27819
|
}
|
|
27818
27820
|
await withCredentialRowScope(existing, async () => {
|
|
27819
27821
|
if (parsed.data.value) {
|
|
27820
|
-
await require_dist.setCredentialInstanceSecret({
|
|
27822
|
+
await require_dist$1.setCredentialInstanceSecret({
|
|
27821
27823
|
id: existing.id,
|
|
27822
27824
|
key: existing.appSlug,
|
|
27823
27825
|
slug,
|
|
@@ -27855,7 +27857,7 @@ const handler$26 = async (c) => {
|
|
|
27855
27857
|
});
|
|
27856
27858
|
const updated = await (0, _keystrokehq_database.selectCredentialInstanceById)(credentialId);
|
|
27857
27859
|
const [credential] = await enrichCredentialInstances(updated ? [updated] : [], organization.organizationId);
|
|
27858
|
-
return c.json(require_dist.GetCredentialResponseSchema.parse(credential));
|
|
27860
|
+
return c.json(require_dist$1.GetCredentialResponseSchema.parse(credential));
|
|
27859
27861
|
};
|
|
27860
27862
|
//#endregion
|
|
27861
27863
|
//#region src/routes/account/credentials/[credentialId]/DELETE.ts
|
|
@@ -27877,7 +27879,7 @@ function createDeleteCredentialHandler(options = {}) {
|
|
|
27877
27879
|
await options.mcp.revokeConnection((0, _keystrokehq_http.resolveMcpEntityId)(existing), existing.connectionId);
|
|
27878
27880
|
}
|
|
27879
27881
|
}
|
|
27880
|
-
} else await require_dist.deleteCredentialInstanceSecret(existing.id);
|
|
27882
|
+
} else await require_dist$1.deleteCredentialInstanceSecret(existing.id);
|
|
27881
27883
|
await (0, _keystrokehq_database.deleteCredentialInstanceById)(credentialId);
|
|
27882
27884
|
return c.body(null, 204);
|
|
27883
27885
|
};
|
|
@@ -27887,7 +27889,7 @@ function createDeleteCredentialHandler(options = {}) {
|
|
|
27887
27889
|
const handler$25 = async (c) => {
|
|
27888
27890
|
const { organizationId } = c.get("organization");
|
|
27889
27891
|
const members = await (0, _keystrokehq_platform_database.selectOrganizationMembers)(organizationId);
|
|
27890
|
-
return c.json(require_dist.ListOrganizationMembersResponseSchema.parse(members.map(require_dist.mapOrganizationMember)));
|
|
27892
|
+
return c.json(require_dist$1.ListOrganizationMembersResponseSchema.parse(members.map(require_dist$1.mapOrganizationMember)));
|
|
27891
27893
|
};
|
|
27892
27894
|
//#endregion
|
|
27893
27895
|
//#region src/email/organization-invite-email.ts
|
|
@@ -27895,7 +27897,7 @@ function envValue(name) {
|
|
|
27895
27897
|
return process.env[name]?.trim() || void 0;
|
|
27896
27898
|
}
|
|
27897
27899
|
function resolveOrganizationInviteUrl(invitationId) {
|
|
27898
|
-
return `${(envValue("PUBLIC_WEB_URL") ?? "http://localhost:3000").replace(/\/$/, "")}${require_dist.organizationInvitationAcceptPath(invitationId)}`;
|
|
27900
|
+
return `${(envValue("PUBLIC_WEB_URL") ?? "http://localhost:3000").replace(/\/$/, "")}${require_dist$1.organizationInvitationAcceptPath(invitationId)}`;
|
|
27899
27901
|
}
|
|
27900
27902
|
function resolveResendApiKey() {
|
|
27901
27903
|
return envValue("RESEND_API_KEY");
|
|
@@ -27936,8 +27938,8 @@ const handler$24 = async (c) => {
|
|
|
27936
27938
|
const user = c.get("user");
|
|
27937
27939
|
const organization = c.get("organization");
|
|
27938
27940
|
const body = await c.req.json().catch(() => null);
|
|
27939
|
-
const parsed = require_dist.InviteOrganizationMembersRequestSchema.safeParse(body);
|
|
27940
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid invite request" }), 400);
|
|
27941
|
+
const parsed = require_dist$1.InviteOrganizationMembersRequestSchema.safeParse(body);
|
|
27942
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid invite request" }), 400);
|
|
27941
27943
|
const results = await (0, _keystrokehq_platform_database.inviteOrganizationMembers)({
|
|
27942
27944
|
organizationId: organization.organizationId,
|
|
27943
27945
|
invitedByUserId: user.id,
|
|
@@ -27954,7 +27956,7 @@ const handler$24 = async (c) => {
|
|
|
27954
27956
|
inviterName: inviter?.name
|
|
27955
27957
|
});
|
|
27956
27958
|
}
|
|
27957
|
-
return c.json(require_dist.InviteOrganizationMembersResponseSchema.parse(results));
|
|
27959
|
+
return c.json(require_dist$1.InviteOrganizationMembersResponseSchema.parse(results));
|
|
27958
27960
|
};
|
|
27959
27961
|
//#endregion
|
|
27960
27962
|
//#region src/routes/account/members/[userId]/PATCH.ts
|
|
@@ -27962,14 +27964,14 @@ const handler$23 = async (c) => {
|
|
|
27962
27964
|
const { organizationId } = c.get("organization");
|
|
27963
27965
|
const userId = c.req.param("userId");
|
|
27964
27966
|
const body = await c.req.json().catch(() => null);
|
|
27965
|
-
const parsed = require_dist.UpdateOrganizationMemberRequestSchema.safeParse(body);
|
|
27966
|
-
if (!userId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
27967
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid member update request" }), 400);
|
|
27967
|
+
const parsed = require_dist$1.UpdateOrganizationMemberRequestSchema.safeParse(body);
|
|
27968
|
+
if (!userId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
27969
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid member update request" }), 400);
|
|
27968
27970
|
try {
|
|
27969
27971
|
const member = await (0, _keystrokehq_platform_database.updateOrganizationMemberRole)(organizationId, userId, parsed.data.role);
|
|
27970
|
-
return c.json(require_dist.UpdateOrganizationMemberResponseSchema.parse(require_dist.mapOrganizationMember(member)));
|
|
27972
|
+
return c.json(require_dist$1.UpdateOrganizationMemberResponseSchema.parse(require_dist$1.mapOrganizationMember(member)));
|
|
27971
27973
|
} catch (error) {
|
|
27972
|
-
if (error instanceof _keystrokehq_platform_database.CannotModifyOwnerError || error instanceof _keystrokehq_platform_database.OrganizationMemberNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27974
|
+
if (error instanceof _keystrokehq_platform_database.CannotModifyOwnerError || error instanceof _keystrokehq_platform_database.OrganizationMemberNotFoundError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27973
27975
|
throw error;
|
|
27974
27976
|
}
|
|
27975
27977
|
};
|
|
@@ -27978,12 +27980,12 @@ const handler$23 = async (c) => {
|
|
|
27978
27980
|
const handler$22 = async (c) => {
|
|
27979
27981
|
const { organizationId } = c.get("organization");
|
|
27980
27982
|
const userId = c.req.param("userId");
|
|
27981
|
-
if (!userId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
27983
|
+
if (!userId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "User id is required" }), 400);
|
|
27982
27984
|
try {
|
|
27983
27985
|
await (0, _keystrokehq_platform_database.removeOrganizationMember)(organizationId, userId);
|
|
27984
27986
|
return c.body(null, 204);
|
|
27985
27987
|
} catch (error) {
|
|
27986
|
-
if (error instanceof _keystrokehq_platform_database.CannotModifyOwnerError || error instanceof _keystrokehq_platform_database.OrganizationMemberNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27988
|
+
if (error instanceof _keystrokehq_platform_database.CannotModifyOwnerError || error instanceof _keystrokehq_platform_database.OrganizationMemberNotFoundError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 400);
|
|
27987
27989
|
throw error;
|
|
27988
27990
|
}
|
|
27989
27991
|
};
|
|
@@ -27991,21 +27993,21 @@ const handler$22 = async (c) => {
|
|
|
27991
27993
|
//#region src/routes/account/invitations/GET.ts
|
|
27992
27994
|
const handler$21 = async (c) => {
|
|
27993
27995
|
const invitations = await (0, _keystrokehq_platform_database.selectPendingInvitationsForUser)(c.get("user").id);
|
|
27994
|
-
return c.json(require_dist.ListOrganizationInvitationsResponseSchema.parse(invitations.map(require_dist.mapOrganizationInvitation)));
|
|
27996
|
+
return c.json(require_dist$1.ListOrganizationInvitationsResponseSchema.parse(invitations.map(require_dist$1.mapOrganizationInvitation)));
|
|
27995
27997
|
};
|
|
27996
27998
|
//#endregion
|
|
27997
27999
|
//#region src/routes/account/invitations/[invitationId]/accept/POST.ts
|
|
27998
28000
|
const handler$20 = async (c) => {
|
|
27999
28001
|
const user = c.get("user");
|
|
28000
28002
|
const invitationId = c.req.param("invitationId");
|
|
28001
|
-
if (!invitationId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invitation id is required" }), 400);
|
|
28003
|
+
if (!invitationId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invitation id is required" }), 400);
|
|
28002
28004
|
try {
|
|
28003
28005
|
const membership = await (0, _keystrokehq_platform_database.acceptInvitation)(invitationId, user.id);
|
|
28004
|
-
return c.json(require_dist.AcceptOrganizationInvitationResponseSchema.parse(require_dist.mapUserOrganization(membership)));
|
|
28006
|
+
return c.json(require_dist$1.AcceptOrganizationInvitationResponseSchema.parse(require_dist$1.mapUserOrganization(membership)));
|
|
28005
28007
|
} catch (error) {
|
|
28006
|
-
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
28007
|
-
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationForbiddenError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 403);
|
|
28008
|
-
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationExpiredError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 410);
|
|
28008
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationNotFoundError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
28009
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationForbiddenError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 403);
|
|
28010
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationExpiredError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 410);
|
|
28009
28011
|
throw error;
|
|
28010
28012
|
}
|
|
28011
28013
|
};
|
|
@@ -28014,13 +28016,13 @@ const handler$20 = async (c) => {
|
|
|
28014
28016
|
const handler$19 = async (c) => {
|
|
28015
28017
|
const user = c.get("user");
|
|
28016
28018
|
const invitationId = c.req.param("invitationId");
|
|
28017
|
-
if (!invitationId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invitation id is required" }), 400);
|
|
28019
|
+
if (!invitationId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invitation id is required" }), 400);
|
|
28018
28020
|
try {
|
|
28019
28021
|
await (0, _keystrokehq_platform_database.declineInvitation)(invitationId, user.id);
|
|
28020
|
-
return c.json(require_dist.DeclineOrganizationInvitationResponseSchema.parse({ success: true }));
|
|
28022
|
+
return c.json(require_dist$1.DeclineOrganizationInvitationResponseSchema.parse({ success: true }));
|
|
28021
28023
|
} catch (error) {
|
|
28022
|
-
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
28023
|
-
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationForbiddenError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 403);
|
|
28024
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationNotFoundError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
28025
|
+
if (error instanceof _keystrokehq_platform_database.OrganizationInvitationForbiddenError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 403);
|
|
28024
28026
|
throw error;
|
|
28025
28027
|
}
|
|
28026
28028
|
};
|
|
@@ -28092,21 +28094,21 @@ function appRowToCustomAppDetail(row) {
|
|
|
28092
28094
|
//#region src/routes/account/apps/GET.ts
|
|
28093
28095
|
const handler$18 = async (c) => {
|
|
28094
28096
|
const apps = (await (0, _keystrokehq_platform_database.listAppsForOrganization)(c.get("organization").organizationId)).map(appRowToCatalogEntry);
|
|
28095
|
-
return c.json(require_dist.ListAppsResponseSchema.parse(apps));
|
|
28097
|
+
return c.json(require_dist$1.ListAppsResponseSchema.parse(apps));
|
|
28096
28098
|
};
|
|
28097
28099
|
//#endregion
|
|
28098
28100
|
//#region src/routes/account/apps/POST.ts
|
|
28099
28101
|
const handler$17 = async (c) => {
|
|
28100
28102
|
const organization = c.get("organization");
|
|
28101
|
-
const parsed = require_dist.CreateCustomAppRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28103
|
+
const parsed = require_dist$1.CreateCustomAppRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28102
28104
|
if (!parsed.success) {
|
|
28103
28105
|
const message = parsed.error.issues[0]?.message ?? "Invalid request body";
|
|
28104
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: message }), 400);
|
|
28106
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: message }), 400);
|
|
28105
28107
|
}
|
|
28106
28108
|
const org = await (0, _keystrokehq_platform_database.selectOrganizationById)(organization.organizationId);
|
|
28107
|
-
if (!org) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
28109
|
+
if (!org) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
28108
28110
|
const authKind = parsed.data.authKind ?? (parsed.data.source === "custom" ? "api_key" : void 0);
|
|
28109
|
-
if (!authKind) return c.json(require_dist.ErrorResponseSchema.parse({ error: "authKind is required" }), 400);
|
|
28111
|
+
if (!authKind) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "authKind is required" }), 400);
|
|
28110
28112
|
try {
|
|
28111
28113
|
const row = await (0, _keystrokehq_platform_database.createOrgApp)({
|
|
28112
28114
|
organizationId: organization.organizationId,
|
|
@@ -28121,22 +28123,22 @@ const handler$17 = async (c) => {
|
|
|
28121
28123
|
credentialScheme: parsed.data.credentialScheme,
|
|
28122
28124
|
oauthScopes: parsed.data.oauthScopes
|
|
28123
28125
|
});
|
|
28124
|
-
return c.json(require_dist.CreateCustomAppResponseSchema.parse(appRowToCustomAppDetail(row)), 201);
|
|
28126
|
+
return c.json(require_dist$1.CreateCustomAppResponseSchema.parse(appRowToCustomAppDetail(row)), 201);
|
|
28125
28127
|
} catch (error) {
|
|
28126
|
-
if (error instanceof _keystrokehq_platform_database.OrgAppSlugTakenError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 409);
|
|
28128
|
+
if (error instanceof _keystrokehq_platform_database.OrgAppSlugTakenError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 409);
|
|
28127
28129
|
throw error;
|
|
28128
28130
|
}
|
|
28129
28131
|
};
|
|
28130
28132
|
//#endregion
|
|
28131
28133
|
//#region src/routes/account/apps/discover/POST.ts
|
|
28132
28134
|
const handler$16 = async (c) => {
|
|
28133
|
-
const parsed = require_dist.McpDiscoverRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28135
|
+
const parsed = require_dist$1.McpDiscoverRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28134
28136
|
if (!parsed.success) return c.json({ error: "Invalid request body" }, 400);
|
|
28135
28137
|
try {
|
|
28136
|
-
const result = await require_dist.discoverMcpApp(parsed.data.url);
|
|
28137
|
-
return c.json(require_dist.McpDiscoverResponseSchema.parse(result));
|
|
28138
|
+
const result = await require_dist$1.discoverMcpApp(parsed.data.url);
|
|
28139
|
+
return c.json(require_dist$1.McpDiscoverResponseSchema.parse(result));
|
|
28138
28140
|
} catch (error) {
|
|
28139
|
-
if (error instanceof require_dist.PublicHttpUrlError) return c.json({ error: error.message }, 400);
|
|
28141
|
+
if (error instanceof require_dist$1.PublicHttpUrlError) return c.json({ error: error.message }, 400);
|
|
28140
28142
|
const message = error instanceof Error ? error.message : "Failed to discover MCP server";
|
|
28141
28143
|
return c.json({ error: message }, 502);
|
|
28142
28144
|
}
|
|
@@ -28144,11 +28146,11 @@ const handler$16 = async (c) => {
|
|
|
28144
28146
|
//#endregion
|
|
28145
28147
|
//#region src/routes/account/apps/discover-openapi/POST.ts
|
|
28146
28148
|
const handler$15 = async (c) => {
|
|
28147
|
-
const parsed = require_dist.OpenApiDiscoverRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28149
|
+
const parsed = require_dist$1.OpenApiDiscoverRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28148
28150
|
if (!parsed.success) return c.json({ error: "Invalid request body" }, 400);
|
|
28149
28151
|
try {
|
|
28150
|
-
const result = await require_dist.discoverOpenApiApp(parsed.data.url);
|
|
28151
|
-
return c.json(require_dist.OpenApiDiscoverResponseSchema.parse(result));
|
|
28152
|
+
const result = await require_dist$1.discoverOpenApiApp(parsed.data.url);
|
|
28153
|
+
return c.json(require_dist$1.OpenApiDiscoverResponseSchema.parse(result));
|
|
28152
28154
|
} catch (error) {
|
|
28153
28155
|
const message = error instanceof Error ? error.message : "Failed to discover OpenAPI spec";
|
|
28154
28156
|
return c.json({ error: message }, 502);
|
|
@@ -28157,11 +28159,11 @@ const handler$15 = async (c) => {
|
|
|
28157
28159
|
//#endregion
|
|
28158
28160
|
//#region src/routes/account/apps/discover-graphql/POST.ts
|
|
28159
28161
|
const handler$14 = async (c) => {
|
|
28160
|
-
const parsed = require_dist.GraphqlDiscoverRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28162
|
+
const parsed = require_dist$1.GraphqlDiscoverRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28161
28163
|
if (!parsed.success) return c.json({ error: "Invalid request body" }, 400);
|
|
28162
28164
|
try {
|
|
28163
|
-
const result = await require_dist.discoverGraphqlApp(parsed.data.url);
|
|
28164
|
-
return c.json(require_dist.GraphqlDiscoverResponseSchema.parse(result));
|
|
28165
|
+
const result = await require_dist$1.discoverGraphqlApp(parsed.data.url);
|
|
28166
|
+
return c.json(require_dist$1.GraphqlDiscoverResponseSchema.parse(result));
|
|
28165
28167
|
} catch (error) {
|
|
28166
28168
|
const message = error instanceof Error ? error.message : "Failed to discover GraphQL endpoint";
|
|
28167
28169
|
return c.json({ error: message }, 502);
|
|
@@ -28174,7 +28176,7 @@ const handler$13 = async (c) => {
|
|
|
28174
28176
|
const user = c.get("user");
|
|
28175
28177
|
const appSlug = c.req.param("slug")?.trim();
|
|
28176
28178
|
if (!appSlug) return c.json({ error: "App slug is required" }, 400);
|
|
28177
|
-
const parsed = require_dist.StartMcpOAuthConnectionInputSchema.safeParse({
|
|
28179
|
+
const parsed = require_dist$1.StartMcpOAuthConnectionInputSchema.safeParse({
|
|
28178
28180
|
...await c.req.json().catch(() => ({})),
|
|
28179
28181
|
appSlug
|
|
28180
28182
|
});
|
|
@@ -28192,7 +28194,7 @@ const handler$13 = async (c) => {
|
|
|
28192
28194
|
projectNamesById[project.id] = project.name;
|
|
28193
28195
|
}
|
|
28194
28196
|
try {
|
|
28195
|
-
const result = await require_dist.beginMcpOAuthConnect({
|
|
28197
|
+
const result = await require_dist$1.beginMcpOAuthConnect({
|
|
28196
28198
|
app,
|
|
28197
28199
|
input: parsed.data,
|
|
28198
28200
|
organizationId: organization.organizationId,
|
|
@@ -28206,7 +28208,7 @@ const handler$13 = async (c) => {
|
|
|
28206
28208
|
},
|
|
28207
28209
|
projectNamesById
|
|
28208
28210
|
});
|
|
28209
|
-
return c.json(require_dist.StartMcpOAuthConnectionResultSchema.parse(result));
|
|
28211
|
+
return c.json(require_dist$1.StartMcpOAuthConnectionResultSchema.parse(result));
|
|
28210
28212
|
} catch (error) {
|
|
28211
28213
|
const message = error instanceof Error ? error.message : "Failed to start MCP OAuth connection";
|
|
28212
28214
|
return c.json({ error: message }, 500);
|
|
@@ -28243,11 +28245,11 @@ const handler$12 = async (c) => {
|
|
|
28243
28245
|
if (!code || !state) return c.json({ error: "Missing code or state" }, 400);
|
|
28244
28246
|
let appSlug = "mcp";
|
|
28245
28247
|
try {
|
|
28246
|
-
const payload = require_dist.decodeOAuthState(state);
|
|
28248
|
+
const payload = require_dist$1.decodeOAuthState(state);
|
|
28247
28249
|
appSlug = payload.appSlug;
|
|
28248
28250
|
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(payload.organizationId);
|
|
28249
28251
|
if (!organization) return c.json({ error: "Organization not found" }, 404);
|
|
28250
|
-
const result = await (0, _keystrokehq_platform_database.runWithOrganizationScope)(organization.id, () => (0, _keystrokehq_database.runWithProjectDatabase)((0, _keystrokehq_platform_database.resolveOrgProjectDatabaseOptions)(organization), () => (0, _keystrokehq_database.runWithTenantScope)(organization.id, () => require_dist.completeMcpOAuthConnect({
|
|
28252
|
+
const result = await (0, _keystrokehq_platform_database.runWithOrganizationScope)(organization.id, () => (0, _keystrokehq_database.runWithProjectDatabase)((0, _keystrokehq_platform_database.resolveOrgProjectDatabaseOptions)(organization), () => (0, _keystrokehq_database.runWithTenantScope)(organization.id, () => require_dist$1.completeMcpOAuthConnect({
|
|
28251
28253
|
state,
|
|
28252
28254
|
code
|
|
28253
28255
|
}))));
|
|
@@ -28277,25 +28279,25 @@ const handler$12 = async (c) => {
|
|
|
28277
28279
|
//#region src/routes/account/apps/slug-available/GET.ts
|
|
28278
28280
|
const handler$11 = async (c) => {
|
|
28279
28281
|
const organization = c.get("organization");
|
|
28280
|
-
const parsed = require_dist.AppSlugAvailabilityQuerySchema.safeParse({ slug: c.req.query("slug") });
|
|
28281
|
-
if (!parsed.success) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
28282
|
+
const parsed = require_dist$1.AppSlugAvailabilityQuerySchema.safeParse({ slug: c.req.query("slug") });
|
|
28283
|
+
if (!parsed.success) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Invalid slug query" }), 400);
|
|
28282
28284
|
const org = await (0, _keystrokehq_platform_database.selectOrganizationById)(organization.organizationId);
|
|
28283
|
-
if (!org) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
28285
|
+
if (!org) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Organization not found" }), 404);
|
|
28284
28286
|
const availability = await (0, _keystrokehq_platform_database.checkOrgAppSlugAvailability)(org.slug, parsed.data.slug);
|
|
28285
|
-
return c.json(require_dist.AppSlugAvailabilityResponseSchema.parse(availability));
|
|
28287
|
+
return c.json(require_dist$1.AppSlugAvailabilityResponseSchema.parse(availability));
|
|
28286
28288
|
};
|
|
28287
28289
|
//#endregion
|
|
28288
28290
|
//#region src/routes/account/apps/[slug]/GET.ts
|
|
28289
28291
|
const handler$10 = async (c) => {
|
|
28290
28292
|
const organization = c.get("organization");
|
|
28291
28293
|
const slug = c.req.param("slug") ?? "";
|
|
28292
|
-
if (!slug) return c.json(require_dist.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
28294
|
+
if (!slug) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
28293
28295
|
const row = await (0, _keystrokehq_platform_database.selectAppForOrganization)(organization.organizationId, decodeURIComponent(slug));
|
|
28294
|
-
if (!row || row.source !== "custom") return c.json(require_dist.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
28296
|
+
if (!row || row.source !== "custom") return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
28295
28297
|
try {
|
|
28296
|
-
return c.json(require_dist.GetCustomAppResponseSchema.parse(appRowToCustomAppDetail(row)));
|
|
28298
|
+
return c.json(require_dist$1.GetCustomAppResponseSchema.parse(appRowToCustomAppDetail(row)));
|
|
28297
28299
|
} catch {
|
|
28298
|
-
return c.json(require_dist.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
28300
|
+
return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "App not found" }), 404);
|
|
28299
28301
|
}
|
|
28300
28302
|
};
|
|
28301
28303
|
//#endregion
|
|
@@ -28306,7 +28308,7 @@ const handler$9 = async (c) => {
|
|
|
28306
28308
|
const records = apiKeyListScope(accessContext(c)).kind === "all" ? await (0, _keystrokehq_platform_database.listOrgPlatformApiKeysForOrganization)(organizationId) : await (0, _keystrokehq_platform_database.listOrgPlatformApiKeysForUser)(organizationId, user.id);
|
|
28307
28309
|
const creators = await (0, _keystrokehq_platform_database.selectUsersByIds)([...new Set(records.map((record) => record.createdByUserId))]);
|
|
28308
28310
|
const creatorsById = new Map(creators.map((creator) => [creator.id, creator]));
|
|
28309
|
-
return c.json(require_dist.ListApiKeysResponseSchema.parse(records.map((record) => ({
|
|
28311
|
+
return c.json(require_dist$1.ListApiKeysResponseSchema.parse(records.map((record) => ({
|
|
28310
28312
|
id: record.id,
|
|
28311
28313
|
name: record.name,
|
|
28312
28314
|
keyPreview: record.keyPreview,
|
|
@@ -28320,7 +28322,7 @@ const handler$9 = async (c) => {
|
|
|
28320
28322
|
const handler$8 = async (c) => {
|
|
28321
28323
|
const { organizationId } = c.get("organization");
|
|
28322
28324
|
const user = c.get("user");
|
|
28323
|
-
const body = require_dist.CreateApiKeyRequestSchema.parse(await c.req.json());
|
|
28325
|
+
const body = require_dist$1.CreateApiKeyRequestSchema.parse(await c.req.json());
|
|
28324
28326
|
const created = await (0, _keystrokehq_platform_database.createOrgPlatformApiKey)({
|
|
28325
28327
|
organizationId,
|
|
28326
28328
|
userId: user.id,
|
|
@@ -28328,7 +28330,7 @@ const handler$8 = async (c) => {
|
|
|
28328
28330
|
});
|
|
28329
28331
|
const creator = await (0, _keystrokehq_platform_database.loadOrgPlatformApiKeyUser)(user.id);
|
|
28330
28332
|
if (!creator) return c.json({ error: "User not found" }, 404);
|
|
28331
|
-
return c.json(require_dist.CreateApiKeyResponseSchema.parse({
|
|
28333
|
+
return c.json(require_dist$1.CreateApiKeyResponseSchema.parse({
|
|
28332
28334
|
id: created.id,
|
|
28333
28335
|
name: created.name,
|
|
28334
28336
|
keyPreview: created.keyPreview,
|
|
@@ -28344,13 +28346,13 @@ const handler$7 = async (c) => {
|
|
|
28344
28346
|
const { organizationId } = c.get("organization");
|
|
28345
28347
|
const user = c.get("user");
|
|
28346
28348
|
const apiKeyId = c.req.param("apiKeyId");
|
|
28347
|
-
if (!apiKeyId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "API key id is required" }), 400);
|
|
28349
|
+
if (!apiKeyId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "API key id is required" }), 400);
|
|
28348
28350
|
const apiKey = await (0, _keystrokehq_platform_database.selectOrgPlatformApiKeyForOrganization)(apiKeyId, organizationId);
|
|
28349
|
-
if (!apiKey) return c.json(require_dist.ErrorResponseSchema.parse({ error: "API key not found" }), 404);
|
|
28351
|
+
if (!apiKey) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "API key not found" }), 404);
|
|
28350
28352
|
if (!canReadApiKey(accessContext(c), {
|
|
28351
28353
|
userId: user.id,
|
|
28352
28354
|
createdByUserId: apiKey.createdByUserId
|
|
28353
|
-
})) return c.json(require_dist.ErrorResponseSchema.parse({ error: "API key not found" }), 404);
|
|
28355
|
+
})) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "API key not found" }), 404);
|
|
28354
28356
|
if (!canRevokeApiKey(accessContext(c), {
|
|
28355
28357
|
userId: user.id,
|
|
28356
28358
|
createdByUserId: apiKey.createdByUserId
|
|
@@ -28359,7 +28361,7 @@ const handler$7 = async (c) => {
|
|
|
28359
28361
|
await (0, _keystrokehq_platform_database.revokeOrgPlatformApiKey)(apiKeyId, organizationId);
|
|
28360
28362
|
return c.body(null, 204);
|
|
28361
28363
|
} catch (error) {
|
|
28362
|
-
if (error instanceof _keystrokehq_platform_database.OrgPlatformApiKeyNotFoundError) return c.json(require_dist.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
28364
|
+
if (error instanceof _keystrokehq_platform_database.OrgPlatformApiKeyNotFoundError) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: error.message }), 404);
|
|
28363
28365
|
throw error;
|
|
28364
28366
|
}
|
|
28365
28367
|
};
|
|
@@ -28369,10 +28371,10 @@ const handler$6 = async (c) => {
|
|
|
28369
28371
|
const { organizationId } = c.get("organization");
|
|
28370
28372
|
const user = c.get("user");
|
|
28371
28373
|
const kindParam = c.req.query("kind");
|
|
28372
|
-
const records = await (0, _keystrokehq_platform_database.listManagedServiceCredentialsForOrganization)(organizationId, kindParam ? require_dist.ManagedServiceKindSchema.parse(kindParam) : void 0);
|
|
28374
|
+
const records = await (0, _keystrokehq_platform_database.listManagedServiceCredentialsForOrganization)(organizationId, kindParam ? require_dist$1.ManagedServiceKindSchema.parse(kindParam) : void 0);
|
|
28373
28375
|
const creators = await (0, _keystrokehq_platform_database.selectUsersByIds)([...new Set(records.map((record) => record.createdByUserId))]);
|
|
28374
28376
|
const creatorsById = new Map(creators.map((creator) => [creator.id, creator]));
|
|
28375
|
-
return c.json(require_dist.ListManagedServiceCredentialsResponseSchema.parse(records.map((record) => ({
|
|
28377
|
+
return c.json(require_dist$1.ListManagedServiceCredentialsResponseSchema.parse(records.map((record) => ({
|
|
28376
28378
|
id: record.id,
|
|
28377
28379
|
kind: record.kind,
|
|
28378
28380
|
provider: record.provider,
|
|
@@ -28388,10 +28390,10 @@ const handler$6 = async (c) => {
|
|
|
28388
28390
|
const handler$5 = async (c) => {
|
|
28389
28391
|
const { organizationId } = c.get("organization");
|
|
28390
28392
|
const user = c.get("user");
|
|
28391
|
-
const body = require_dist.ConnectManagedServiceCredentialRequestSchema.parse(await c.req.json());
|
|
28392
|
-
if (body.kind === "llm" && !require_dist.isLlmProviderSlug(body.provider)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Unsupported LLM provider" }), 400);
|
|
28393
|
-
if (await (0, _keystrokehq_platform_database.getManagedServiceCredential)(organizationId, body.kind, body.provider)) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Managed service credential already connected" }), 409);
|
|
28394
|
-
const { id } = await require_dist.setManagedServiceCredential({
|
|
28393
|
+
const body = require_dist$1.ConnectManagedServiceCredentialRequestSchema.parse(await c.req.json());
|
|
28394
|
+
if (body.kind === "llm" && !require_dist$1.isLlmProviderSlug(body.provider)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Unsupported LLM provider" }), 400);
|
|
28395
|
+
if (await (0, _keystrokehq_platform_database.getManagedServiceCredential)(organizationId, body.kind, body.provider)) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Managed service credential already connected" }), 409);
|
|
28396
|
+
const { id } = await require_dist$1.setManagedServiceCredential({
|
|
28395
28397
|
organizationId,
|
|
28396
28398
|
kind: body.kind,
|
|
28397
28399
|
provider: body.provider,
|
|
@@ -28400,8 +28402,8 @@ const handler$5 = async (c) => {
|
|
|
28400
28402
|
});
|
|
28401
28403
|
const row = await (0, _keystrokehq_platform_database.getManagedServiceCredential)(organizationId, body.kind, body.provider);
|
|
28402
28404
|
const creator = await (0, _keystrokehq_platform_database.loadOrgPlatformApiKeyUser)(user.id);
|
|
28403
|
-
if (!row || !creator) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Failed to connect managed service" }), 500);
|
|
28404
|
-
return c.json(require_dist.ManagedServiceCredentialSchema.parse({
|
|
28405
|
+
if (!row || !creator) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Failed to connect managed service" }), 500);
|
|
28406
|
+
return c.json(require_dist$1.ManagedServiceCredentialSchema.parse({
|
|
28405
28407
|
id,
|
|
28406
28408
|
kind: row.kind,
|
|
28407
28409
|
provider: row.provider,
|
|
@@ -28418,11 +28420,11 @@ const handler$4 = async (c) => {
|
|
|
28418
28420
|
const { organizationId } = c.get("organization");
|
|
28419
28421
|
const user = c.get("user");
|
|
28420
28422
|
const credentialId = c.req.param("id");
|
|
28421
|
-
const body = require_dist.UpdateManagedServiceCredentialRequestSchema.parse(await c.req.json());
|
|
28422
|
-
if (!credentialId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Credential id is required" }), 400);
|
|
28423
|
+
const body = require_dist$1.UpdateManagedServiceCredentialRequestSchema.parse(await c.req.json());
|
|
28424
|
+
if (!credentialId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Credential id is required" }), 400);
|
|
28423
28425
|
const existing = await (0, _keystrokehq_platform_database.selectManagedServiceCredentialById)(credentialId);
|
|
28424
|
-
if (!existing || existing.organizationId !== organizationId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Managed service credential not found" }), 404);
|
|
28425
|
-
await require_dist.setManagedServiceCredential({
|
|
28426
|
+
if (!existing || existing.organizationId !== organizationId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Managed service credential not found" }), 404);
|
|
28427
|
+
await require_dist$1.setManagedServiceCredential({
|
|
28426
28428
|
organizationId,
|
|
28427
28429
|
kind: existing.kind,
|
|
28428
28430
|
provider: existing.provider,
|
|
@@ -28431,8 +28433,8 @@ const handler$4 = async (c) => {
|
|
|
28431
28433
|
});
|
|
28432
28434
|
const row = await (0, _keystrokehq_platform_database.selectManagedServiceCredentialById)(credentialId);
|
|
28433
28435
|
const creator = await (0, _keystrokehq_platform_database.loadOrgPlatformApiKeyUser)(existing.createdByUserId);
|
|
28434
|
-
if (!row || !creator) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Failed to update managed service" }), 500);
|
|
28435
|
-
return c.json(require_dist.ManagedServiceCredentialSchema.parse({
|
|
28436
|
+
if (!row || !creator) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Failed to update managed service" }), 500);
|
|
28437
|
+
return c.json(require_dist$1.ManagedServiceCredentialSchema.parse({
|
|
28436
28438
|
id: row.id,
|
|
28437
28439
|
kind: row.kind,
|
|
28438
28440
|
provider: row.provider,
|
|
@@ -28448,10 +28450,10 @@ const handler$4 = async (c) => {
|
|
|
28448
28450
|
const handler$3 = async (c) => {
|
|
28449
28451
|
const { organizationId } = c.get("organization");
|
|
28450
28452
|
const credentialId = c.req.param("id");
|
|
28451
|
-
if (!credentialId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Credential id is required" }), 400);
|
|
28453
|
+
if (!credentialId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Credential id is required" }), 400);
|
|
28452
28454
|
const existing = await (0, _keystrokehq_platform_database.selectManagedServiceCredentialById)(credentialId);
|
|
28453
|
-
if (!existing || existing.organizationId !== organizationId) return c.json(require_dist.ErrorResponseSchema.parse({ error: "Managed service credential not found" }), 404);
|
|
28454
|
-
await require_dist.deleteManagedServiceCredential(credentialId);
|
|
28455
|
+
if (!existing || existing.organizationId !== organizationId) return c.json(require_dist$1.ErrorResponseSchema.parse({ error: "Managed service credential not found" }), 404);
|
|
28456
|
+
await require_dist$1.deleteManagedServiceCredential(credentialId);
|
|
28455
28457
|
return c.body(null, 204);
|
|
28456
28458
|
};
|
|
28457
28459
|
//#endregion
|
|
@@ -28517,7 +28519,7 @@ async function postTeamRequestToSlack(input) {
|
|
|
28517
28519
|
const handler$2 = async (c) => {
|
|
28518
28520
|
const user = c.get("user");
|
|
28519
28521
|
const organizationContext = c.get("organization");
|
|
28520
|
-
const parsed = require_dist.SubmitTeamRequestRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28522
|
+
const parsed = require_dist$1.SubmitTeamRequestRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28521
28523
|
if (!parsed.success) {
|
|
28522
28524
|
const message = parsed.error.issues[0]?.message ?? "Invalid request body";
|
|
28523
28525
|
return c.json({ error: message }, 400);
|
|
@@ -28543,7 +28545,7 @@ const handler$2 = async (c) => {
|
|
|
28543
28545
|
console.error("Failed to deliver team request to Slack", error);
|
|
28544
28546
|
return c.json({ error: "Failed to deliver team request" }, 502);
|
|
28545
28547
|
}
|
|
28546
|
-
return c.json(require_dist.SubmitTeamRequestResponseSchema.parse({ ok: true }), 200);
|
|
28548
|
+
return c.json(require_dist$1.SubmitTeamRequestResponseSchema.parse({ ok: true }), 200);
|
|
28547
28549
|
};
|
|
28548
28550
|
//#endregion
|
|
28549
28551
|
//#region src/routes/account/mount.ts
|
|
@@ -28567,13 +28569,13 @@ function mountAccountRoutes(options) {
|
|
|
28567
28569
|
const requireApiKeyCreate = authorize(apiKeysActions.create);
|
|
28568
28570
|
const requireManagedServicesRead = authorize(managedServicesActions.read);
|
|
28569
28571
|
const requireManagedServicesManage = authorize(managedServicesActions.manage);
|
|
28570
|
-
const requireInvitableRole = authorizePayload(require_dist.InviteOrganizationMembersRequestSchema, ({ ctx, body }) => canInviteRole(ctx.orgRole, body.role));
|
|
28572
|
+
const requireInvitableRole = authorizePayload(require_dist$1.InviteOrganizationMembersRequestSchema, ({ ctx, body }) => canInviteRole(ctx.orgRole, body.role));
|
|
28571
28573
|
const requireProjectMember = requireProjectMembership();
|
|
28572
28574
|
const requireProjectDeploy = authorize(projectActions.deploy);
|
|
28573
28575
|
const requireProjectUpdate = authorize(projectActions.update);
|
|
28574
28576
|
const requireProjectDelete = authorize(projectActions.delete);
|
|
28575
28577
|
const requireProjectManageMembers = authorize(projectActions.manageMembers);
|
|
28576
|
-
const requireInvitableProjectRole = authorizePayload(require_dist.InviteProjectMembersRequestSchema, ({ c, ctx, body }) => canInviteToProject(ctx, { invitePermission: getProjectInvitePermission(c) }, body.role));
|
|
28578
|
+
const requireInvitableProjectRole = authorizePayload(require_dist$1.InviteProjectMembersRequestSchema, ({ c, ctx, body }) => canInviteToProject(ctx, { invitePermission: getProjectInvitePermission(c) }, body.role));
|
|
28577
28579
|
const requireOrgParam = requireOrganizationParam();
|
|
28578
28580
|
account.get("/organizations", handler$90);
|
|
28579
28581
|
account.get("/organizations/slug-available", handler$89);
|
|
@@ -28677,29 +28679,6 @@ function mountAccountRoutes(options) {
|
|
|
28677
28679
|
return account;
|
|
28678
28680
|
}
|
|
28679
28681
|
//#endregion
|
|
28680
|
-
//#region src/middleware/require-worker-token.ts
|
|
28681
|
-
/** Worker auth from Bearer or x-api-key (Anthropic SDK uses the latter). */
|
|
28682
|
-
function readWorkerTokenFromRequest(c) {
|
|
28683
|
-
const authorization = c.req.header("authorization");
|
|
28684
|
-
if (authorization?.startsWith("Bearer ")) return authorization.slice(7).trim();
|
|
28685
|
-
const apiKey = c.req.header("x-api-key")?.trim();
|
|
28686
|
-
if (apiKey) return apiKey;
|
|
28687
|
-
}
|
|
28688
|
-
function requireWorkerToken(expectedToken) {
|
|
28689
|
-
return async (c, next) => {
|
|
28690
|
-
if (!expectedToken) return c.json({
|
|
28691
|
-
error: "worker_auth_unconfigured",
|
|
28692
|
-
message: "Worker auth is not configured."
|
|
28693
|
-
}, 503);
|
|
28694
|
-
const token = readWorkerTokenFromRequest(c);
|
|
28695
|
-
if (!token || token !== expectedToken) return c.json({
|
|
28696
|
-
error: "unauthorized",
|
|
28697
|
-
message: "Invalid worker token."
|
|
28698
|
-
}, 401);
|
|
28699
|
-
await next();
|
|
28700
|
-
};
|
|
28701
|
-
}
|
|
28702
|
-
//#endregion
|
|
28703
28682
|
//#region src/routes/internal/web-search-proxy.ts
|
|
28704
28683
|
const EXA_API_ORIGIN = "https://api.exa.ai";
|
|
28705
28684
|
async function proxyExaWebSearchRequest(options) {
|
|
@@ -28730,11 +28709,129 @@ const EnsureWebhookRouteBodySchema = zod.z.object({
|
|
|
28730
28709
|
route: zod.z.string().trim().min(1),
|
|
28731
28710
|
attachmentSlugs: zod.z.array(zod.z.string().trim().min(1)).min(1)
|
|
28732
28711
|
});
|
|
28712
|
+
async function runOrgDatabaseQuery(options, query) {
|
|
28713
|
+
const handle = await (0, _keystrokehq_database.acquireProjectDatabasePool)(options);
|
|
28714
|
+
try {
|
|
28715
|
+
if (handle.dialect !== "postgres") throw new Error("DB proxy requires postgres");
|
|
28716
|
+
return { rows: (await handle.pool.query({
|
|
28717
|
+
text: query.sql,
|
|
28718
|
+
values: query.params,
|
|
28719
|
+
rowMode: query.method === "all" ? "array" : void 0
|
|
28720
|
+
})).rows };
|
|
28721
|
+
} finally {
|
|
28722
|
+
(0, _keystrokehq_database.releaseProjectDatabasePool)(options);
|
|
28723
|
+
}
|
|
28724
|
+
}
|
|
28725
|
+
async function runOrgDatabaseMigrations(options, migrations, lockKey) {
|
|
28726
|
+
const handle = await (0, _keystrokehq_database.acquireProjectDatabasePool)(options);
|
|
28727
|
+
try {
|
|
28728
|
+
if (handle.dialect !== "postgres") throw new Error("DB proxy requires postgres");
|
|
28729
|
+
const client = await handle.pool.connect();
|
|
28730
|
+
try {
|
|
28731
|
+
await client.query("BEGIN");
|
|
28732
|
+
await client.query("SELECT pg_advisory_xact_lock(hashtext($1))", [lockKey]);
|
|
28733
|
+
await client.query(`
|
|
28734
|
+
CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (
|
|
28735
|
+
id SERIAL PRIMARY KEY,
|
|
28736
|
+
hash text NOT NULL,
|
|
28737
|
+
created_at numeric
|
|
28738
|
+
)
|
|
28739
|
+
`);
|
|
28740
|
+
const journal = await client.query(`SELECT created_at FROM "__drizzle_migrations" ORDER BY created_at DESC LIMIT 1`);
|
|
28741
|
+
const lastMigrationMillis = journal.rows[0]?.created_at === void 0 || journal.rows[0]?.created_at === null ? void 0 : Number(journal.rows[0].created_at);
|
|
28742
|
+
const results = [];
|
|
28743
|
+
for (const migration of migrations) {
|
|
28744
|
+
if (lastMigrationMillis !== void 0 && lastMigrationMillis >= migration.folderMillis) continue;
|
|
28745
|
+
for (const statement of migration.sql) {
|
|
28746
|
+
const result = await client.query(statement);
|
|
28747
|
+
results.push({ rows: result.rows });
|
|
28748
|
+
}
|
|
28749
|
+
await client.query(`INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES ($1, $2)`, [migration.hash, migration.folderMillis]);
|
|
28750
|
+
}
|
|
28751
|
+
await client.query("COMMIT");
|
|
28752
|
+
return results;
|
|
28753
|
+
} catch (error) {
|
|
28754
|
+
await client.query("ROLLBACK").catch(() => void 0);
|
|
28755
|
+
throw error;
|
|
28756
|
+
} finally {
|
|
28757
|
+
client.release();
|
|
28758
|
+
}
|
|
28759
|
+
} finally {
|
|
28760
|
+
(0, _keystrokehq_database.releaseProjectDatabasePool)(options);
|
|
28761
|
+
}
|
|
28762
|
+
}
|
|
28733
28763
|
function mountInternalRoutes(workerToken, tokenRefresh, llmProxy, mcp) {
|
|
28734
28764
|
const internal = new hono.Hono();
|
|
28735
|
-
const protect = requireWorkerToken(workerToken);
|
|
28765
|
+
const protect = require_with_project_scope.requireWorkerToken(workerToken);
|
|
28736
28766
|
const materialize = (0, _keystrokehq_runtime.createCredentialMaterializeHandler)(tokenRefresh);
|
|
28767
|
+
internal.use("/orgs/:organizationId/db/*", async (c, next) => {
|
|
28768
|
+
const verified = require_dist.verifyOrgWorkerToken(workerToken, require_with_project_scope.readWorkerTokenFromRequest(c));
|
|
28769
|
+
if (!verified || verified.organizationId !== c.req.param("organizationId")) return c.json({
|
|
28770
|
+
error: "unauthorized",
|
|
28771
|
+
message: "Invalid database proxy token."
|
|
28772
|
+
}, 401);
|
|
28773
|
+
await next();
|
|
28774
|
+
});
|
|
28775
|
+
internal.post("/orgs/:organizationId/db/query", async (c) => {
|
|
28776
|
+
const organizationId = c.req.param("organizationId");
|
|
28777
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
28778
|
+
if (!organization) return c.json({ error: "Organization not found" }, 404);
|
|
28779
|
+
const parsed = require_dist$1.DbProxyQueryRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28780
|
+
if (!parsed.success) return c.json({
|
|
28781
|
+
error: "Invalid request body",
|
|
28782
|
+
details: parsed.error.flatten()
|
|
28783
|
+
}, 400);
|
|
28784
|
+
const options = (0, _keystrokehq_platform_database.resolveOrgProjectDatabaseOptions)(organization);
|
|
28785
|
+
try {
|
|
28786
|
+
return c.json(await runOrgDatabaseQuery(options, parsed.data));
|
|
28787
|
+
} catch (error) {
|
|
28788
|
+
console.error("Database proxy query failed", {
|
|
28789
|
+
organizationId,
|
|
28790
|
+
error
|
|
28791
|
+
});
|
|
28792
|
+
const message = error instanceof Error ? error.message : "Database proxy query failed.";
|
|
28793
|
+
return c.json({
|
|
28794
|
+
error: "db_proxy_query_failed",
|
|
28795
|
+
message
|
|
28796
|
+
}, 500);
|
|
28797
|
+
}
|
|
28798
|
+
});
|
|
28799
|
+
internal.post("/orgs/:organizationId/db/migrate", async (c) => {
|
|
28800
|
+
const organizationId = c.req.param("organizationId");
|
|
28801
|
+
const organization = await (0, _keystrokehq_platform_database.selectOrganizationById)(organizationId);
|
|
28802
|
+
if (!organization) return c.json({ error: "Organization not found" }, 404);
|
|
28803
|
+
const parsed = require_dist$1.DbProxyMigrateRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28804
|
+
if (!parsed.success) return c.json({
|
|
28805
|
+
error: "Invalid request body",
|
|
28806
|
+
details: parsed.error.flatten()
|
|
28807
|
+
}, 400);
|
|
28808
|
+
const options = (0, _keystrokehq_platform_database.resolveOrgProjectDatabaseOptions)(organization);
|
|
28809
|
+
try {
|
|
28810
|
+
return c.json({ results: await runOrgDatabaseMigrations(options, parsed.data.migrations, organizationId) });
|
|
28811
|
+
} catch (error) {
|
|
28812
|
+
console.error("Database proxy migration failed", {
|
|
28813
|
+
organizationId,
|
|
28814
|
+
error
|
|
28815
|
+
});
|
|
28816
|
+
const message = error instanceof Error ? error.message : "Database proxy migration failed.";
|
|
28817
|
+
return c.json({
|
|
28818
|
+
error: "db_proxy_migrate_failed",
|
|
28819
|
+
message
|
|
28820
|
+
}, 500);
|
|
28821
|
+
}
|
|
28822
|
+
});
|
|
28737
28823
|
internal.use("/*", protect);
|
|
28824
|
+
internal.use("/projects/:projectId/*", async (c, next) => {
|
|
28825
|
+
const verified = require_dist.verifyOrgWorkerToken(workerToken, require_with_project_scope.readWorkerTokenFromRequest(c));
|
|
28826
|
+
if (verified) {
|
|
28827
|
+
const project = await (0, _keystrokehq_platform_database.selectProjectById)(c.req.param("projectId"));
|
|
28828
|
+
if (project && project.organizationId !== verified.organizationId) return c.json({
|
|
28829
|
+
error: "unauthorized",
|
|
28830
|
+
message: "Token org mismatch."
|
|
28831
|
+
}, 401);
|
|
28832
|
+
}
|
|
28833
|
+
await next();
|
|
28834
|
+
});
|
|
28738
28835
|
internal.get("/projects/:projectId/connect-context", async (c) => {
|
|
28739
28836
|
const project = await (0, _keystrokehq_platform_database.selectProjectById)(c.req.param("projectId"));
|
|
28740
28837
|
if (!project) return c.json({ error: "Project not found" }, 404);
|
|
@@ -28831,9 +28928,9 @@ async function loadModelIds() {
|
|
|
28831
28928
|
async function handler$1(c) {
|
|
28832
28929
|
try {
|
|
28833
28930
|
const models = await loadModelIds();
|
|
28834
|
-
return c.json(require_dist.PublicModelsResponseSchema.parse({ models }));
|
|
28931
|
+
return c.json(require_dist$1.PublicModelsResponseSchema.parse({ models }));
|
|
28835
28932
|
} catch (error) {
|
|
28836
|
-
if (cache) return c.json(require_dist.PublicModelsResponseSchema.parse({ models: cache.models }));
|
|
28933
|
+
if (cache) return c.json(require_dist$1.PublicModelsResponseSchema.parse({ models: cache.models }));
|
|
28837
28934
|
const message = error instanceof Error ? error.message : "Failed to load models";
|
|
28838
28935
|
return c.json({ error: message }, 502);
|
|
28839
28936
|
}
|
|
@@ -28933,12 +29030,12 @@ function clientIp(c) {
|
|
|
28933
29030
|
}
|
|
28934
29031
|
async function handler(c) {
|
|
28935
29032
|
if (!consumeContactRateLimit(clientIp(c))) return c.json({ error: "Too many requests" }, 429);
|
|
28936
|
-
const parsed = require_dist.SubmitMarketingContactRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
29033
|
+
const parsed = require_dist$1.SubmitMarketingContactRequestSchema.safeParse(await c.req.json().catch(() => null));
|
|
28937
29034
|
if (!parsed.success) {
|
|
28938
29035
|
const message = parsed.error.issues[0]?.message ?? "Invalid request body";
|
|
28939
29036
|
return c.json({ error: message }, 400);
|
|
28940
29037
|
}
|
|
28941
|
-
if (parsed.data.companyWebsite?.trim()) return c.json(require_dist.SubmitMarketingContactResponseSchema.parse({ ok: true }), 200);
|
|
29038
|
+
if (parsed.data.companyWebsite?.trim()) return c.json(require_dist$1.SubmitMarketingContactResponseSchema.parse({ ok: true }), 200);
|
|
28942
29039
|
try {
|
|
28943
29040
|
await postMarketingContactToSlack({
|
|
28944
29041
|
fullName: parsed.data.fullName,
|
|
@@ -28950,7 +29047,7 @@ async function handler(c) {
|
|
|
28950
29047
|
console.error("Failed to deliver marketing contact to Slack", error);
|
|
28951
29048
|
return c.json({ error: "Failed to deliver contact request" }, 502);
|
|
28952
29049
|
}
|
|
28953
|
-
return c.json(require_dist.SubmitMarketingContactResponseSchema.parse({ ok: true }), 200);
|
|
29050
|
+
return c.json(require_dist$1.SubmitMarketingContactResponseSchema.parse({ ok: true }), 200);
|
|
28954
29051
|
}
|
|
28955
29052
|
//#endregion
|
|
28956
29053
|
//#region src/app.ts
|
|
@@ -28992,7 +29089,7 @@ function resolvePlatformListenPort() {
|
|
|
28992
29089
|
const { hostname } = new URL(publicUrl);
|
|
28993
29090
|
if (hostname !== "localhost" && hostname !== "127.0.0.1") return PRODUCTION_PLATFORM_LISTEN_PORT;
|
|
28994
29091
|
} catch {}
|
|
28995
|
-
return require_dist.listenPortFromPublicUrl(process.env.PUBLIC_PLATFORM_URL, LOCAL_PLATFORM_PORT);
|
|
29092
|
+
return require_dist$1.listenPortFromPublicUrl(process.env.PUBLIC_PLATFORM_URL, LOCAL_PLATFORM_PORT);
|
|
28996
29093
|
}
|
|
28997
29094
|
function usesPgBossScheduler(platformConfig) {
|
|
28998
29095
|
return platformConfig.scheduler.name === "pg-boss" || platformConfig.scheduler.name === "default";
|
|
@@ -29000,7 +29097,7 @@ function usesPgBossScheduler(platformConfig) {
|
|
|
29000
29097
|
async function startPlatformServer(platformConfig, hooks = {}) {
|
|
29001
29098
|
const runtime = platformConfig.hosting.createRuntime();
|
|
29002
29099
|
await (0, _keystrokehq_platform_database.initDatabase)();
|
|
29003
|
-
await require_dist.ensureKeystrokeAssetsBucket();
|
|
29100
|
+
await require_dist$1.ensureKeystrokeAssetsBucket();
|
|
29004
29101
|
await (0, _keystrokehq_runtime.seedOAuthAppsFromEnvForAllOrganizations)();
|
|
29005
29102
|
if (usesPgBossScheduler(platformConfig)) await (0, _keystrokehq_platform_database.ensureProjectPgBossGrants)();
|
|
29006
29103
|
configureProjectRuntimeScheduler(platformConfig.scheduler);
|
|
@@ -29011,6 +29108,7 @@ async function startPlatformServer(platformConfig, hooks = {}) {
|
|
|
29011
29108
|
if (!organization) throw new Error(`Organization ${job.organizationId} not found`);
|
|
29012
29109
|
const database = await (0, _keystrokehq_platform_database.resolveOrgRuntimeDatabase)(job.organizationId);
|
|
29013
29110
|
const workerRuntime = platformConfig.hosting.workerRuntime;
|
|
29111
|
+
const orgWorkerToken = require_dist.mintOrgWorkerToken(workerRuntime.workerToken, job.organizationId);
|
|
29014
29112
|
return {
|
|
29015
29113
|
organizationId: job.organizationId,
|
|
29016
29114
|
projects: [],
|
|
@@ -29023,11 +29121,11 @@ async function startPlatformServer(platformConfig, hooks = {}) {
|
|
|
29023
29121
|
...(0, _keystrokehq_platform_database.orgSchedulerRuntimeEnv)(organization, process.env),
|
|
29024
29122
|
...platformConfig.llmProxy?.workerEnv({
|
|
29025
29123
|
platformUrl: workerRuntime.platformUrl,
|
|
29026
|
-
workerToken:
|
|
29124
|
+
workerToken: orgWorkerToken
|
|
29027
29125
|
}),
|
|
29028
29126
|
...platformConfig.workerEnv?.({
|
|
29029
29127
|
platformUrl: workerRuntime.platformUrl,
|
|
29030
|
-
workerToken:
|
|
29128
|
+
workerToken: orgWorkerToken
|
|
29031
29129
|
})
|
|
29032
29130
|
},
|
|
29033
29131
|
hosting: organization.hostingAppName ? { appName: organization.hostingAppName } : void 0,
|
|
@@ -29204,4 +29302,4 @@ Object.defineProperty(exports, "x$1", {
|
|
|
29204
29302
|
}
|
|
29205
29303
|
});
|
|
29206
29304
|
|
|
29207
|
-
//# sourceMappingURL=start-
|
|
29305
|
+
//# sourceMappingURL=start-DV5tMkuC.cjs.map
|